mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Fixes #7508
This commit is contained in:
@@ -76,23 +76,27 @@
|
|||||||
if (!can_touch(user) || !climbable)
|
if (!can_touch(user) || !climbable)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/turf/T = src.loc
|
|
||||||
if(!T || !istype(T)) return 0
|
|
||||||
|
|
||||||
if (!user.Adjacent(src))
|
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
|
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)
|
for(var/obj/O in T.contents)
|
||||||
if(istype(O,/obj/structure))
|
if(istype(O,/obj/structure))
|
||||||
var/obj/structure/S = O
|
var/obj/structure/S = O
|
||||||
if(S.climbable)
|
if(S.climbable) continue
|
||||||
continue
|
|
||||||
|
|
||||||
if(O && O.density && !(O.flags & ON_BORDER)) //ON_BORDER structures are handled by the Adjacent() check.
|
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 O
|
||||||
return 0
|
return 0
|
||||||
return 1
|
|
||||||
|
|
||||||
/obj/structure/proc/do_climb(var/mob/living/user)
|
/obj/structure/proc/do_climb(var/mob/living/user)
|
||||||
if (!can_climb(user))
|
if (!can_climb(user))
|
||||||
@@ -118,14 +122,14 @@
|
|||||||
if(M.lying) return //No spamming this on people.
|
if(M.lying) return //No spamming this on people.
|
||||||
|
|
||||||
M.Weaken(5)
|
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))
|
if(prob(25))
|
||||||
|
|
||||||
var/damage = rand(15,30)
|
var/damage = rand(15,30)
|
||||||
var/mob/living/carbon/human/H = M
|
var/mob/living/carbon/human/H = M
|
||||||
if(!istype(H))
|
if(!istype(H))
|
||||||
H << "\red You land heavily!"
|
H << "<span class='danger'>You land heavily!</span>"
|
||||||
M.adjustBruteLoss(damage)
|
M.adjustBruteLoss(damage)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -144,12 +148,12 @@
|
|||||||
affecting = H.get_organ("head")
|
affecting = H.get_organ("head")
|
||||||
|
|
||||||
if(affecting)
|
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)
|
affecting.take_damage(damage, 0)
|
||||||
if(affecting.parent)
|
if(affecting.parent)
|
||||||
affecting.parent.add_autopsy_data("Misadventure", damage)
|
affecting.parent.add_autopsy_data("Misadventure", damage)
|
||||||
else
|
else
|
||||||
H << "\red You land heavily!"
|
H << "<span class='danger'>You land heavily!</span>"
|
||||||
H.adjustBruteLoss(damage)
|
H.adjustBruteLoss(damage)
|
||||||
|
|
||||||
H.UpdateDamageIcon()
|
H.UpdateDamageIcon()
|
||||||
|
|||||||
@@ -470,9 +470,15 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/structure/table/proc/unflipping_check(var/direction)
|
/obj/structure/table/proc/unflipping_check(var/direction)
|
||||||
|
|
||||||
for(var/mob/M in oview(src,0))
|
for(var/mob/M in oview(src,0))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
var/obj/occupied = turf_is_crowded()
|
||||||
|
if(occupied)
|
||||||
|
usr << "There's \a [occupied] in the way."
|
||||||
|
return 0
|
||||||
|
|
||||||
var/list/L = list()
|
var/list/L = list()
|
||||||
if(direction)
|
if(direction)
|
||||||
L.Add(direction)
|
L.Add(direction)
|
||||||
|
|||||||
Reference in New Issue
Block a user