mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
Refactors do_after w/ TG's do_after (#18282)
* part1 * keeps range ability * no cog vore
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
return FALSE
|
||||
if(!target.mind)
|
||||
user.visible_message("[user] gently presses [src] to [target]...", runemessage = "presses [src] to [target]")
|
||||
if(do_after(user, revive_time, exclusive = TASK_USER_EXCLUSIVE, target = target))
|
||||
if(do_after(user, revive_time, target = target))
|
||||
target.faction = user.faction
|
||||
target.revivedby = user.name
|
||||
target.ghostjoin = 1
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
/obj/item/denecrotizer/proc/ghostjoin_rez(mob/living/simple_mob/target, mob/living/user)
|
||||
user.visible_message("[user] gently presses [src] to [target]...", runemessage = "presses [src] to [target]")
|
||||
if(do_after(user, revive_time, exclusive = TASK_ALL_EXCLUSIVE, target = target))
|
||||
if(do_after(user, revive_time, target = target))
|
||||
target.faction = user.faction
|
||||
target.revivedby = user.name
|
||||
target.ai_holder.returns_home = FALSE
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
/obj/item/denecrotizer/proc/basic_rez(mob/living/simple_mob/target, mob/living/user) //so medical can have a way to bring back people's pets or whatever, does not change any settings about the mob or offer it to ghosts.
|
||||
user.visible_message("[user] presses [src] to [target]...", runemessage = "presses [src] to [target]")
|
||||
if(do_after(user, revive_time, exclusive = TASK_ALL_EXCLUSIVE, target = target))
|
||||
if(do_after(user, revive_time, target = target))
|
||||
target.revive()
|
||||
target.sight = initial(target.sight)
|
||||
target.see_in_dark = initial(target.see_in_dark)
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
balloon_alert(user, "you can't apply a splint to the arm you're using!")
|
||||
return
|
||||
user.balloon_alert_visible("[user] starts to apply \the [src] to their [limb].", "applying \the [src] to your [limb].", "You hear something being wrapped.")
|
||||
if(do_after(user, 50, M, exclusive = TASK_USER_EXCLUSIVE))
|
||||
if(do_after(user, 50, M))
|
||||
if(affecting.splinted)
|
||||
balloon_alert(user, "[M]'s [limb] is already splinted!")
|
||||
return
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if (R.getBruteLoss() || R.getFireLoss())
|
||||
if(do_after(user, 7 * toolspeed, R, exclusive = TASK_ALL_EXCLUSIVE))
|
||||
if(do_after(user, 7 * toolspeed, R))
|
||||
R.adjustBruteLoss(-15)
|
||||
R.adjustFireLoss(-15)
|
||||
R.updatehealth()
|
||||
@@ -51,9 +51,9 @@
|
||||
else if(can_use(1))
|
||||
user.setClickCooldown(user.get_attack_speed(src))
|
||||
if(S.open >= 2)
|
||||
if(do_after(user, 5 * toolspeed, S, exclusive = TASK_ALL_EXCLUSIVE))
|
||||
if(do_after(user, 5 * toolspeed, S))
|
||||
S.heal_damage(restoration_internal, restoration_internal, robo_repair = 1)
|
||||
else if(do_after(user, 5 * toolspeed, S, exclusive = TASK_ALL_EXCLUSIVE))
|
||||
else if(do_after(user, 5 * toolspeed, S))
|
||||
S.heal_damage(restoration_external,restoration_external, robo_repair =1)
|
||||
H.updatehealth()
|
||||
use(1)
|
||||
|
||||
@@ -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