mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Fixes #7508
This commit is contained in:
@@ -76,23 +76,27 @@
|
||||
if (!can_touch(user) || !climbable)
|
||||
return 0
|
||||
|
||||
var/turf/T = src.loc
|
||||
if(!T || !istype(T)) return 0
|
||||
|
||||
if (!user.Adjacent(src))
|
||||
user << "\red You can't climb there, the way is blocked."
|
||||
user << "<span class='danger'>You can't climb there, the way is blocked.</span>"
|
||||
return 0
|
||||
|
||||
var/obj/occupied = turf_is_crowded()
|
||||
if(occupied)
|
||||
user << "<span class='danger'>There's \a [occupied] in the way.</span>"
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/proc/turf_is_crowded()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || !istype(T))
|
||||
return 0
|
||||
for(var/obj/O in T.contents)
|
||||
if(istype(O,/obj/structure))
|
||||
var/obj/structure/S = O
|
||||
if(S.climbable)
|
||||
continue
|
||||
|
||||
if(S.climbable) continue
|
||||
if(O && O.density && !(O.flags & ON_BORDER)) //ON_BORDER structures are handled by the Adjacent() check.
|
||||
user << "\red There's \a [O] in the way."
|
||||
return 0
|
||||
return 1
|
||||
return O
|
||||
return 0
|
||||
|
||||
/obj/structure/proc/do_climb(var/mob/living/user)
|
||||
if (!can_climb(user))
|
||||
@@ -118,14 +122,14 @@
|
||||
if(M.lying) return //No spamming this on people.
|
||||
|
||||
M.Weaken(5)
|
||||
M << "\red You topple as \the [src] moves under you!"
|
||||
M << "<span class='danger'>You topple as \the [src] moves under you!</span>"
|
||||
|
||||
if(prob(25))
|
||||
|
||||
var/damage = rand(15,30)
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!istype(H))
|
||||
H << "\red You land heavily!"
|
||||
H << "<span class='danger'>You land heavily!</span>"
|
||||
M.adjustBruteLoss(damage)
|
||||
return
|
||||
|
||||
@@ -144,12 +148,12 @@
|
||||
affecting = H.get_organ("head")
|
||||
|
||||
if(affecting)
|
||||
M << "\red You land heavily on your [affecting.display_name]!"
|
||||
M << "<span class='danger'>You land heavily on your [affecting.display_name]!</span>"
|
||||
affecting.take_damage(damage, 0)
|
||||
if(affecting.parent)
|
||||
affecting.parent.add_autopsy_data("Misadventure", damage)
|
||||
else
|
||||
H << "\red You land heavily!"
|
||||
H << "<span class='danger'>You land heavily!</span>"
|
||||
H.adjustBruteLoss(damage)
|
||||
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
Reference in New Issue
Block a user