mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
[READY]MultiZ stuff - tile atmos, movement backend, falling backend, etc etc - Electric boogaloo (#40428)
Basic multiZ mob movement procs (Observers can always move)
Open space, showing what things are below it, and everything that entails. No complex support for dynamic generation just yet.
Decide how openspace should look :/
Atoms falling through open space (NO MOB SUPPORT/DAMAGE/ANYTHING YET.)
//CANCELLED FOR ANOTHER PR - [ ] Being able to see upwards? Downwards is going to be handled by open space.
MultiZ tile atmospherics - EDIT: Working demo! https://puu.sh/B7mUs/3f6274740f.mp4
Bugtest the heck out of this trainwreck.
This commit is contained in:
committed by
yogstation13-bot
parent
36f9fa9b90
commit
d1411a8eee
47
code/modules/mapping/space_management/multiz_helpers.dm
Normal file
47
code/modules/mapping/space_management/multiz_helpers.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
/proc/get_step_multiz(ref, dir)
|
||||
if(dir & UP)
|
||||
dir &= ~UP
|
||||
return get_step(SSmapping.get_turf_above(get_turf(ref)), dir)
|
||||
if(dir & DOWN)
|
||||
dir &= ~DOWN
|
||||
return get_step(SSmapping.get_turf_below(get_turf(ref)), dir)
|
||||
return get_step(ref, dir)
|
||||
|
||||
/proc/get_dir_multiz(turf/us, turf/them)
|
||||
us = get_turf(us)
|
||||
them = get_turf(them)
|
||||
if(!us || !them)
|
||||
return NONE
|
||||
if(us.z == them.z)
|
||||
return get_dir(us, them)
|
||||
else
|
||||
var/turf/T = us.above()
|
||||
var/dir = NONE
|
||||
if(T && (T.z == them.z))
|
||||
dir = UP
|
||||
else
|
||||
T = us.below()
|
||||
if(T && (T.z == them.z))
|
||||
dir = DOWN
|
||||
else
|
||||
return get_dir(us, them)
|
||||
return (dir | get_dir(us, them))
|
||||
|
||||
/turf/proc/above()
|
||||
return get_step_multiz(src, UP)
|
||||
|
||||
/turf/proc/below()
|
||||
return get_step_multiz(src, DOWN)
|
||||
|
||||
/proc/dir_inverse_multiz(dir)
|
||||
var/holder = dir & (UP|DOWN)
|
||||
if((holder == NONE) || (holder == (UP|DOWN)))
|
||||
return turn(dir, 180)
|
||||
dir &= ~(UP|DOWN)
|
||||
dir = turn(dir, 180)
|
||||
if(holder == UP)
|
||||
holder = DOWN
|
||||
else
|
||||
holder = UP
|
||||
dir |= holder
|
||||
return dir
|
||||
Reference in New Issue
Block a user