mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 12:47:16 +01:00
Merge branch 'master' into upstream-merge-9483
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
//////////////////////////////
|
||||
//Contents: Ladders, Stairs.//
|
||||
//////////////////////////////
|
||||
|
||||
/obj/structure/ladder
|
||||
name = "ladder"
|
||||
desc = "A ladder. You can climb it up and down."
|
||||
icon_state = "ladder01"
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon = 'icons/obj/structures/multiz.dmi'
|
||||
density = 0
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
@@ -125,65 +121,3 @@
|
||||
/obj/structure/ladder/updown
|
||||
allowed_directions = UP|DOWN
|
||||
icon_state = "ladder11"
|
||||
|
||||
/obj/structure/stairs
|
||||
name = "Stairs"
|
||||
desc = "Stairs leading to another deck. Not too useful if the gravity goes out."
|
||||
icon = 'icons/obj/stairs.dmi'
|
||||
density = 0
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
flags = ON_BORDER
|
||||
layer = STAIRS_LAYER
|
||||
|
||||
/obj/structure/stairs/Initialize()
|
||||
. = ..()
|
||||
for(var/turf/turf in locs)
|
||||
var/turf/simulated/open/above = GetAbove(turf)
|
||||
if(!above)
|
||||
warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])")
|
||||
return qdel(src)
|
||||
if(!istype(above))
|
||||
above.ChangeTurf(/turf/simulated/open)
|
||||
|
||||
/obj/structure/stairs/CheckExit(atom/movable/mover as mob|obj, turf/target as turf)
|
||||
if(get_dir(loc, target) == dir && upperStep(mover.loc))
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
/obj/structure/stairs/Bumped(atom/movable/A)
|
||||
// This is hackish but whatever.
|
||||
var/turf/target = get_step(GetAbove(A), dir)
|
||||
if(target.Enter(A, src)) // Pass src to be ignored to avoid infinate loop
|
||||
A.forceMove(target)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(L.pulling && !L.pulling.anchored)
|
||||
L.pulling.forceMove(target)
|
||||
|
||||
/obj/structure/stairs/proc/upperStep(var/turf/T)
|
||||
return (T == loc)
|
||||
|
||||
/obj/structure/stairs/CanPass(obj/mover, turf/source, height, airflow)
|
||||
return airflow || !density
|
||||
|
||||
// type paths to make mapping easier.
|
||||
/obj/structure/stairs/north
|
||||
dir = NORTH
|
||||
bound_height = 64
|
||||
bound_y = -32
|
||||
pixel_y = -32
|
||||
|
||||
/obj/structure/stairs/south
|
||||
dir = SOUTH
|
||||
bound_height = 64
|
||||
|
||||
/obj/structure/stairs/east
|
||||
dir = EAST
|
||||
bound_width = 64
|
||||
bound_x = -32
|
||||
pixel_x = -32
|
||||
|
||||
/obj/structure/stairs/west
|
||||
dir = WEST
|
||||
bound_width = 64
|
||||
@@ -358,24 +358,16 @@
|
||||
for(var/atom/A in landing)
|
||||
if(!A.CanPass(src, src.loc, 1, 0))
|
||||
return FALSE
|
||||
// TODO - Stairs should operate thru a different mechanism, not falling, to allow side-bumping.
|
||||
|
||||
// Now lets move there!
|
||||
if(!Move(landing))
|
||||
return 1
|
||||
|
||||
// Detect if we made a silent landing.
|
||||
if(locate(/obj/structure/stairs) in landing)
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if(L.pulling)
|
||||
L.pulling.forceMove(landing)
|
||||
return 1
|
||||
else
|
||||
var/atom/A = find_fall_target(oldloc, landing)
|
||||
if(special_fall_handle(A) || !A || !A.check_impact(src))
|
||||
return
|
||||
fall_impact(A)
|
||||
var/atom/A = find_fall_target(oldloc, landing)
|
||||
if(special_fall_handle(A) || !A || !A.check_impact(src))
|
||||
return
|
||||
fall_impact(A)
|
||||
|
||||
/atom/movable/proc/special_fall_handle(var/atom/A)
|
||||
return FALSE
|
||||
@@ -446,14 +438,6 @@
|
||||
/turf/space/check_impact(var/atom/movable/falling_atom)
|
||||
return FALSE
|
||||
|
||||
// We return 1 without calling fall_impact in order to provide a soft landing. So nice.
|
||||
// Note this really should never even get this far
|
||||
/obj/structure/stairs/CheckFall(var/atom/movable/falling_atom)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/stairs/check_impact(var/atom/movable/falling_atom)
|
||||
return FALSE
|
||||
|
||||
// Can't fall onto ghosts
|
||||
/mob/observer/dead/CheckFall()
|
||||
return FALSE
|
||||
|
||||
@@ -55,8 +55,16 @@
|
||||
GLOB.turf_entered_event.register(T, src, .proc/BelowOpenUpdated)
|
||||
GLOB.turf_exited_event.register(T, src, .proc/BelowOpenUpdated)
|
||||
|
||||
/turf/simulated/open/Entered(var/atom/movable/mover)
|
||||
|
||||
/turf/simulated/open/Entered(var/atom/movable/mover, var/atom/oldloc)
|
||||
. = ..()
|
||||
|
||||
// Going down stairs from the topstair piece
|
||||
var/obj/structure/stairs/top/T = locate(/obj/structure/stairs/top) in oldloc
|
||||
if(T && mover.dir == turn(T.dir, 180) && T.check_integrity())
|
||||
T.use_stairs(mover, oldloc)
|
||||
return
|
||||
|
||||
mover.fall()
|
||||
|
||||
/turf/simulated/open/proc/BelowOpenUpdated(turf/T, atom/movable/AM, old_loc)
|
||||
@@ -187,6 +195,4 @@
|
||||
for(var/obj/O in contents)
|
||||
if(!O.CanFallThru(L, GetBelow(src)))
|
||||
return TRUE // Can't fall through this, like lattice or catwalk.
|
||||
if(!locate(/obj/structure/stairs) in GetBelow(src))
|
||||
return FALSE // Falling on stairs is safe.
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user