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:
HMBGERDO
2023-06-01 18:36:44 -05:00
committed by GitHub
co-authored by SteelSlayer
parent bdb8039c8f
commit 02db93e37e
10 changed files with 45 additions and 6 deletions
+31
View File
@@ -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()