mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 20:11:56 +00:00
Makes the code compatible with 515.1594+
Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword
And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.
@tgstation/commit-access Since the .proc/stuff is pretty big change.
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
/**
|
|
* ## soft landing element!
|
|
*
|
|
* Non bespoke element (1 in existence) that makes objs provide a soft landing when you fall on them!
|
|
*/
|
|
/datum/element/soft_landing
|
|
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY // Detach for turfs
|
|
|
|
/datum/element/soft_landing/Attach(datum/target)
|
|
. = ..()
|
|
if(!isatom(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
RegisterSignal(target, COMSIG_ATOM_INTERCEPT_Z_FALL, PROC_REF(intercept_z_fall))
|
|
|
|
/datum/element/soft_landing/Detach(datum/target)
|
|
. = ..()
|
|
UnregisterSignal(target, COMSIG_ATOM_INTERCEPT_Z_FALL)
|
|
|
|
///signal called by the stat of the target changing
|
|
/datum/element/soft_landing/proc/intercept_z_fall(atom/soft_object, falling_movables, levels)
|
|
SIGNAL_HANDLER
|
|
|
|
var/turf/falling_spot = get_turf(soft_object)
|
|
|
|
if(locate(/obj/structure/stairs) in falling_spot)
|
|
return FALL_INTERCEPTED | FALL_NO_MESSAGE
|
|
|
|
for(var/mob/living/falling_victim in falling_movables)
|
|
if(soft_object == falling_victim)
|
|
to_chat(falling_victim, span_notice("Your fall is cushioned by your body to provide a soft landing!"))
|
|
else
|
|
to_chat(falling_victim, span_notice("[soft_object] provides a soft landing for you!"))
|
|
return FALL_INTERCEPTED | FALL_NO_MESSAGE
|