mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-31 09:09:49 +01:00
[MIRROR] Refactors do_after w/ TG's do_after (#11486)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
c1fffe13f3
commit
f85a202d80
@@ -31,11 +31,11 @@
|
||||
if(bound_mob in contents)
|
||||
unleash()
|
||||
to_chat(bound_mob, span_notice("You feel like yourself again. You are no longer under the influence of \the [src]'s command."))
|
||||
UnregisterSignal(bound_mob, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(bound_mob, COMSIG_QDELETING)
|
||||
bound_mob.capture_caught = FALSE
|
||||
bound_mob = null
|
||||
if(owner)
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(owner, COMSIG_QDELETING)
|
||||
owner = null
|
||||
return ..()
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
else
|
||||
M.visible_message("\The [src] flickers in \the [M]'s hand and emits a little tone.", "\The [src] flickers in your hand and emits a little tone.")
|
||||
playsound(src, 'sound/effects/capture-crystal-out.ogg', 75, 1, -1)
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(owner, COMSIG_QDELETING)
|
||||
owner = null
|
||||
|
||||
//Let's make inviting ghosts be an option you can do instead of an automatic thing!
|
||||
@@ -251,8 +251,8 @@
|
||||
|
||||
//Make it so the crystal knows if its mob references get deleted to make sure things get cleaned up
|
||||
/obj/item/capture_crystal/proc/knowyoursignals(mob/living/M, mob/living/U)
|
||||
RegisterSignal(M, COMSIG_PARENT_QDELETING, PROC_REF(mob_was_deleted), TRUE)
|
||||
RegisterSignal(U, COMSIG_PARENT_QDELETING, PROC_REF(owner_was_deleted), TRUE)
|
||||
RegisterSignal(M, COMSIG_QDELETING, PROC_REF(mob_was_deleted), TRUE)
|
||||
RegisterSignal(U, COMSIG_QDELETING, PROC_REF(owner_was_deleted), TRUE)
|
||||
|
||||
//The basic capture command does most of the registration work.
|
||||
/obj/item/capture_crystal/proc/capture(mob/living/M, mob/living/U)
|
||||
@@ -337,8 +337,8 @@
|
||||
//The clean up procs!
|
||||
/obj/item/capture_crystal/proc/mob_was_deleted()
|
||||
SIGNAL_HANDLER
|
||||
UnregisterSignal(bound_mob, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(bound_mob, COMSIG_QDELETING)
|
||||
UnregisterSignal(owner, COMSIG_QDELETING)
|
||||
bound_mob.capture_caught = FALSE
|
||||
bound_mob = null
|
||||
owner = null
|
||||
@@ -348,7 +348,7 @@
|
||||
|
||||
/obj/item/capture_crystal/proc/owner_was_deleted()
|
||||
SIGNAL_HANDLER
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(owner, COMSIG_QDELETING)
|
||||
owner = null
|
||||
active = FALSE
|
||||
update_icon()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
if(user.get_active_hand() == src || user.get_inactive_hand() == src)
|
||||
return TRUE // Skip delay
|
||||
|
||||
if(insert_delay && !do_after(user, insert_delay, src, needhand = TRUE, exclusive = TASK_USER_EXCLUSIVE))
|
||||
if(insert_delay && !do_after(user, insert_delay, src))
|
||||
return FALSE // Moved while there is a delay
|
||||
|
||||
return TRUE //Now we're allowed to put the item in the pouch
|
||||
@@ -33,7 +33,7 @@
|
||||
if(user.get_active_hand() == src || user.get_inactive_hand() == src)
|
||||
return TRUE // Skip delay
|
||||
|
||||
if(remove_delay && !do_after(user, remove_delay, src, needhand = TRUE, exclusive = TASK_USER_EXCLUSIVE))
|
||||
if(remove_delay && !do_after(user, remove_delay, src))
|
||||
return FALSE // Moved while there is a delay
|
||||
|
||||
if(W in src)
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
/obj/effect/energy_net/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
|
||||
user.setClickCooldown(user.get_attack_speed())
|
||||
visible_message(span_danger("[user] begins to tear at \the [src]!"))
|
||||
if(do_after(user, escape_time, src, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY)))
|
||||
if(do_after(user, escape_time, src, timed_action_flags = IGNORE_INCAPACITATED))
|
||||
if(!has_buckled_mobs())
|
||||
return
|
||||
visible_message(span_danger("[user] manages to tear \the [src] apart!"))
|
||||
|
||||
Reference in New Issue
Block a user