Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 15 additions & 22 deletions code/game/turfs/open_space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
/turf/open_space/on_throw_end(atom/movable/thrown_atom)
check_fall(thrown_atom)

/turf/open_space/proc/check_fall(atom/movable/movable)
if(movable.flags_atom & NO_ZFALL)
return

var/height = 1
var/turf/below = SSmapping.get_turf_below(get_turf(src))

while(istype(below, /turf/open_space))
below = SSmapping.get_turf_below(below)
height++

movable.forceMove(below)
movable.onZImpact(below, height)


/turf/open_space/attack_alien(mob/user)
attack_hand(user)

/turf/open_space/attack_hand(mob/user)
/turf/open_space/proc/climb_down(mob/user)
if(user.action_busy)
return

Expand All @@ -53,9 +35,6 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
if(!istype(current_turf, /turf/open_space))
return

if(!current_turf.Enter(user))
return

user.visible_message(SPAN_WARNING("[user] starts climbing down."), SPAN_WARNING("You start climbing down."))

if(!do_after(user, 3 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC))
Expand All @@ -71,5 +50,19 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
user.forceMove(below)
return

/turf/open_space/proc/check_fall(atom/movable/movable)
if(movable.flags_atom & NO_ZFALL)
return

var/height = 1
var/turf/below = SSmapping.get_turf_below(get_turf(src))

while(istype(below, /turf/open_space))
below = SSmapping.get_turf_below(below)
height++

movable.forceMove(below)
movable.onZImpact(below, height)

/turf/open_space/is_weedable()
return NOT_WEEDABLE
8 changes: 8 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@
if(!mover.Collide(A))
return FALSE

if(mover.move_intentionally && istype(src, /turf/open_space) && istype(mover,/mob/living))
var/turf/open_space/space = src
var/mob/living/climber = mover
if(climber.a_intent == INTENT_HARM)
return TRUE
space.climb_down(climber)
return FALSE

return TRUE //Nothing found to block so return success!

/turf/Entered(atom/movable/A)
Expand Down