mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
Stunbaton delayed knockdown now respects antistuns (#21069)
* stunbaton delayed knockdown now moved into status effect * renaming proc to keep its meaning * made STATUS_EFFECT_DELAYED as status effect for any delayed logic, removed STATUS_EFFECT_BATONNED * cleanup, little bug fixing * cleanup * whoopsie * updates * signal string changed * Update code/datums/status_effects/neutral.dm Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> --------- Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
This commit is contained in:
@@ -218,3 +218,34 @@
|
||||
/// Remove the image from the lwap user's screen
|
||||
/obj/effect/temp_visual/lwap_ping/proc/remove_mind(mob/living/looker)
|
||||
looker.client?.images -= lwap_image
|
||||
|
||||
/datum/status_effect/delayed
|
||||
id = "delayed_status_effect"
|
||||
status_type = STATUS_EFFECT_MULTIPLE
|
||||
alert_type = null
|
||||
var/prevent_signal = null
|
||||
var/datum/callback/expire_proc = null
|
||||
|
||||
/datum/status_effect/delayed/on_creation(mob/living/new_owner, new_duration, datum/callback/new_expire_proc, new_prevent_signal = null)
|
||||
if(!new_duration || !istype(new_expire_proc))
|
||||
qdel(src)
|
||||
return
|
||||
duration = new_duration
|
||||
expire_proc = new_expire_proc
|
||||
. = ..()
|
||||
if(new_prevent_signal)
|
||||
RegisterSignal(owner, new_prevent_signal, PROC_REF(prevent_action))
|
||||
prevent_signal = new_prevent_signal
|
||||
|
||||
/datum/status_effect/proc/prevent_action()
|
||||
SIGNAL_HANDLER
|
||||
qdel(src)
|
||||
|
||||
/datum/status_effect/delayed/on_remove()
|
||||
if(prevent_signal)
|
||||
UnregisterSignal(owner, prevent_signal)
|
||||
. = ..()
|
||||
|
||||
/datum/status_effect/delayed/on_timeout()
|
||||
. = ..()
|
||||
expire_proc.Invoke()
|
||||
|
||||
Reference in New Issue
Block a user