Rewriting multiz movement to be gooder (#2464)

Intent: implement all of the features from #2442 while also unfucking the multiz movement files to be more readable and not recurse.

To that end, this PR does the following:

All multiz travel is now arbitrated by SSfalling. This will eliminate the need for recursion without relying on timers. Timers would be a bit scary.
The call chain for multiz movement now looks like this (in terms of overwritable procs):
can_fall() (Can lead into fall_impact() & fall_collateral() if returns FALSE)
fall_through() IF current block is open space ELSE fall_impact() & fall_collateral()
Removed almost every istype(src, A) check in the movement.dm file by exercising proper parenting and call chains.
Documented and standardized the contents of multiz/movement.dm. Because this is an API we're going to be relying on very heavily, I'd like to get this right before we move on.
A lot of minor tweaks, like swapping usr over to the applicable mob, and so on.
This commit is contained in:
skull132
2017-05-27 02:14:35 +03:00
committed by GitHub
parent e71299699e
commit 755ce490db
16 changed files with 598 additions and 235 deletions
+38 -38
View File
@@ -131,47 +131,47 @@
opacity = 0
anchored = 1
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/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)
Uncross(atom/movable/A)
if(A.dir == dir)
// This is hackish but whatever.
var/turf/target = get_step(GetAbove(A), dir)
var/turf/source = A.loc
if(target.Enter(A, source))
A.loc = target
target.Entered(A, source)
return 0
return 1
/obj/structure/stairs/Uncross(atom/movable/A)
if(A.dir == dir)
// This is hackish but whatever.
var/turf/target = get_step(GetAbove(A), dir)
var/turf/source = A.loc
if(target.Enter(A, source))
A.loc = target
target.Entered(A, source)
return FALSE
return TRUE
CanPass(obj/mover, turf/source, height, airflow)
return airflow || !density
/obj/structure/stairs/CanPass(obj/mover, turf/source, height, airflow)
return airflow || !density
// type paths to make mapping easier.
north
dir = NORTH
bound_height = 64
bound_y = -32
pixel_y = -32
// type paths to make mapping easier.
/obj/structure/stairs/north
dir = NORTH
bound_height = 64
bound_y = -32
pixel_y = -32
south
dir = SOUTH
bound_height = 64
/obj/structure/stairs/south
dir = SOUTH
bound_height = 64
east
dir = EAST
bound_width = 64
bound_x = -32
pixel_x = -32
/obj/structure/stairs/east
dir = EAST
bound_width = 64
bound_x = -32
pixel_x = -32
west
dir = WEST
bound_width = 64
/obj/structure/stairs/west
dir = WEST
bound_width = 64