mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +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>
56 lines
2.0 KiB
Plaintext
56 lines
2.0 KiB
Plaintext
// Should be more than any minimum exposure time coming in
|
|
#define TIME_UNTIL_DELETION (10 SECONDS)
|
|
|
|
/// Begins the countdown before a target can be irradiated.
|
|
/// Added by the radiation subsystem when a pulse information has a minimum exposure time.
|
|
/// Will clear itself out after a while.
|
|
/datum/component/radiation_countdown
|
|
/// The time this component was added
|
|
var/time_added
|
|
|
|
/// The shortest minimum time before being irradiated.
|
|
/// If the source has an attempted irradiation again outside this timeframe, it will go through.
|
|
var/minimum_exposure_time
|
|
|
|
/datum/component/radiation_countdown/Initialize(minimum_exposure_time)
|
|
if (!CAN_IRRADIATE(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
src.minimum_exposure_time = minimum_exposure_time
|
|
|
|
time_added = world.time
|
|
|
|
to_chat(parent, span_userdanger("The air around you feels warm...perhaps you should go somewhere else."))
|
|
|
|
start_deletion_timer()
|
|
|
|
/datum/component/radiation_countdown/proc/start_deletion_timer()
|
|
addtimer(CALLBACK(src, PROC_REF(remove_self)), TIME_UNTIL_DELETION, TIMER_UNIQUE | TIMER_OVERRIDE)
|
|
|
|
/datum/component/radiation_countdown/proc/remove_self()
|
|
if (!HAS_TRAIT(parent, TRAIT_IRRADIATED))
|
|
to_chat(parent, span_notice("The air here feels safer."))
|
|
|
|
qdel(src)
|
|
|
|
/datum/component/radiation_countdown/RegisterWithParent()
|
|
RegisterSignal(parent, COMSIG_IN_THRESHOLD_OF_IRRADIATION, PROC_REF(on_pre_potential_irradiation_within_range))
|
|
|
|
/datum/component/radiation_countdown/UnregisterFromParent()
|
|
UnregisterSignal(parent, COMSIG_IN_THRESHOLD_OF_IRRADIATION)
|
|
|
|
/datum/component/radiation_countdown/proc/on_pre_potential_irradiation_within_range(datum/source, datum/radiation_pulse_information/pulse_information)
|
|
SIGNAL_HANDLER
|
|
|
|
minimum_exposure_time = min(minimum_exposure_time, pulse_information.minimum_exposure_time)
|
|
|
|
start_deletion_timer()
|
|
|
|
// Played with fire, now you might be getting irradiated.
|
|
if (world.time - time_added >= minimum_exposure_time)
|
|
return SKIP_MINIMUM_EXPOSURE_TIME_CHECK
|
|
|
|
return CANCEL_IRRADIATION
|
|
|
|
#undef TIME_UNTIL_DELETION
|