Makes uses of do_after sane (#18334)

* Prevents insta-actions

* Do_after sanity

NOTE: NUKE do_after_action

* Update bonfire.dm

* The  rest of them

Also fixes a tpyo

* no minitest :)

* .

* .

* Gets rid of the slowdown for now

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-09-08 02:25:08 +02:00
committed by GitHub
co-authored by Kashargul
parent 736fe6ef28
commit d73f6b8dbd
330 changed files with 682 additions and 690 deletions
+1 -1
View File
@@ -114,7 +114,7 @@
user.visible_message("\The [user] starts transferring \the [ai] into \the [src]...", "You start transferring \the [ai] into \the [src]...")
show_message(span_critical("\The [user] is transferring you into \the [src]!"))
if(do_after(user, 100))
if(do_after(user, 10 SECONDS, target = src))
if(carded_ai)
to_chat(user, span_danger("Transfer failed:") + " Existing AI found on remote device. Remove existing AI to install a new one.")
return 0
@@ -45,7 +45,7 @@
else
log_and_message_admins("attempted to body swap with [key_name(M)].")
user.visible_message(span_warning("[user] pushes the device up their forehead and [M]'s head, the device beginning to let out a series of light beeps!"),span_notice("You begin swap minds with [M]!"))
if(do_after(user,35 SECONDS,M))
if(do_after(user,35 SECONDS, target = M))
if(user.mind && M.mind && M.stat != DEAD && user.stat != DEAD)
log_and_message_admins("[user.ckey] used a Bodysnatcher to swap bodies with [M.ckey]", user)
to_chat(user,span_notice("Your minds have been swapped! Have a nice day."))
+3 -3
View File
@@ -397,7 +397,7 @@
//beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
user.visible_message(span_warning("\The [user] begins to place [src] on [H]'s chest."), span_warning("You begin to place [src] on [H]'s chest..."))
if(!do_after(user, 30, H))
if(!do_after(user, 3 SECONDS, target = H))
return
user.visible_message(span_infoplain(span_bold("\The [user]") + " places [src] on [H]'s chest."), span_warning("You place [src] on [H]'s chest."))
playsound(src, 'sound/machines/defib_charge.ogg', 50, 0)
@@ -412,7 +412,7 @@
make_announcement("buzzes, \"Warning - Patient is in hypovolemic shock.\"", "warning") //also includes heart damage
//placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
if(!do_after(user, chargetime, H))
if(!do_after(user, chargetime, target = H))
return
//deduct charge here, in case the base unit was EMPed or something during the delay time
@@ -467,7 +467,7 @@
playsound(src, 'sound/machines/defib_charge.ogg', 50, 0)
audible_message(span_warning("\The [src] lets out a steadily rising hum..."), runemessage = "whines")
if(!do_after(user, chargetime, H))
if(!do_after(user, chargetime, target = H))
return
//deduct charge here, in case the base unit was EMPed or something during the delay time
+1 -1
View File
@@ -36,7 +36,7 @@
var/answer = tgui_alert(user, "Would you like to activate this personal emergency beacon?","\The [src]", list("Yes", "No"))
if(answer != "Yes")
return
else if(do_after(user, (3 SECONDS))) //short delay, so they can still abort if they want to
else if(do_after(user, 3 SECONDS, target = src)) //short delay, so they can still abort if they want to
user.visible_message(span_warning("[user] activates \the [src]!"),span_warning("You activate \the [src], spiking it into the ground!"))
beacon_active = TRUE
icon_state = "e_beacon_active"
+1 -1
View File
@@ -47,7 +47,7 @@
return
user.visible_message(span_infoplain(span_bold("\The [user]") + " starts trying to repair \the [src]'s bulb."))
repairing = TRUE
if(do_after(user, (40 SECONDS + rand(0, 20 SECONDS)) * W.toolspeed) && can_repair)
if(do_after(user, (40 SECONDS + rand(0, 20 SECONDS)) * W.toolspeed, target = src) && can_repair)
if(prob(30))
user.visible_message(span_notice("\The [user] successfully repairs \the [src]!"))
broken = FALSE
+2 -2
View File
@@ -80,7 +80,7 @@
var/obj/structure/closet/crate/secure/A = target
if(A.locked)
to_chat(user, span_notice("Overriding access. Stand by."))
if(do_after(user, (((5 SECONDS + rand(0, 5 SECONDS) + rand(0, 5 SECONDS))*hackspeed))))
if(do_after(user, (((5 SECONDS + rand(0, 5 SECONDS) + rand(0, 5 SECONDS))*hackspeed)), target = src))
to_chat(user, span_notice("Override successful!"))
A.locked = FALSE
A.update_icon()
@@ -92,7 +92,7 @@
var/obj/structure/closet/secure_closet/A = target
if(A.locked)
to_chat(user, span_notice("Overriding access. Stand by."))
if(do_after(user, (((5 SECONDS + rand(0, 5 SECONDS) + rand(0, 5 SECONDS))*hackspeed))))
if(do_after(user, (((5 SECONDS + rand(0, 5 SECONDS) + rand(0, 5 SECONDS))*hackspeed)), target = src))
to_chat(user, span_notice("Override successful!"))
A.locked = FALSE
A.update_icon()
@@ -17,7 +17,7 @@ GLOBAL_LIST_EMPTY(paikeys)
user.visible_message(span_notice("\The [user] secured \the [src]'s maintenance panel."))
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
else if(pai)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
panel_open = TRUE
user.visible_message(span_warning("\The [user] opened \the [src]'s maintenance panel."))
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
@@ -154,7 +154,7 @@ GLOBAL_LIST_EMPTY(paikeys)
if(istype(I,/obj/item/paiparts/cell))
if(cell == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
cell = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -163,7 +163,7 @@ GLOBAL_LIST_EMPTY(paikeys)
to_chat(user, span_warning("You would need to remove the installed [I] first!"))
if(istype(I,/obj/item/paiparts/processor))
if(processor == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
processor = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -172,7 +172,7 @@ GLOBAL_LIST_EMPTY(paikeys)
to_chat(user, span_warning("You would need to remove the installed [I] first!"))
if(istype(I,/obj/item/paiparts/board))
if(board == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
board = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(paikeys)
to_chat(user, span_warning("You would need to remove the installed [I] first!"))
if(istype(I,/obj/item/paiparts/capacitor))
if(capacitor == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
capacitor = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -190,7 +190,7 @@ GLOBAL_LIST_EMPTY(paikeys)
to_chat(user, span_warning("You would need to remove the installed [I] first!"))
if(istype(I,/obj/item/paiparts/projector))
if(projector == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
projector = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -199,7 +199,7 @@ GLOBAL_LIST_EMPTY(paikeys)
to_chat(user, span_warning("You would need to remove the installed [I] first!"))
if(istype(I,/obj/item/paiparts/emitter))
if(emitter == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
emitter = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -208,7 +208,7 @@ GLOBAL_LIST_EMPTY(paikeys)
to_chat(user, span_warning("You would need to remove the installed [I] first!"))
if(istype(I,/obj/item/paiparts/speech_synthesizer))
if(speech_synthesizer == PP_MISSING)
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, target = src))
user.visible_message(span_notice("\The [user] installs \the [I] into \the [src]."),span_notice("You install \the [I] into \the [src]."))
speech_synthesizer = PP_FUNCTIONAL
user.drop_from_inventory(I)
@@ -241,7 +241,7 @@ GLOBAL_LIST_EMPTY(paikeys)
playsound(src, 'sound/items/pickup/component.ogg', vary = TRUE)
else
return
if(!do_after(user, 3 SECONDS))
if(!do_after(user, 3 SECONDS, target = src))
return
switch(choice)
if("cell")
@@ -19,7 +19,7 @@
playsound(src, 'sound/misc/bloop.ogg', 50, 1)
flick("health2", src)
if(do_after(user,6 SECONDS,AM))
if(do_after(user, 6 SECONDS, target = AM))
scan_genes(AM,user)
/obj/item/gene_scanner/proc/scan_genes(atom/movable/AM,mob/user)
@@ -214,7 +214,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
persist_nif_data(H)
usr.visible_message("[usr] begins scanning [target]'s mind.",span_notice("You begin scanning [target]'s mind."))
if(do_after(usr,8 SECONDS,target))
if(do_after(usr, 8 SECONDS, target))
our_db.m_backup(target.mind,nif,one_time = TRUE)
to_chat(usr,span_notice("Mind backed up!"))
else
@@ -230,7 +230,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
var/mob/living/carbon/human/H = target
usr.visible_message("[usr] begins scanning [target]'s body.",span_notice("You begin scanning [target]'s body."))
if(do_after(usr,8 SECONDS,target))
if(do_after(usr, 8 SECONDS, target))
var/datum/transhuman/body_record/BR = new()
BR.init_from_mob(H, TRUE, TRUE, database_key = db_key)
to_chat(usr,span_notice("Body scanned!"))
@@ -252,7 +252,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
if(choice == "Continue" && usr.get_active_hand() == src && usr.Adjacent(target))
usr.visible_message(span_warning("[usr] begins downloading [target]'s mind!"),span_notice("You begin downloading [target]'s mind!"))
if(do_after(usr,35 SECONDS,target)) //This is powerful, yo.
if(do_after(usr, 35 SECONDS, target)) //This is powerful, yo.
if(!stored_mind && target.mind)
get_mind(target)
to_chat(usr,span_notice("Mind downloaded!"))
@@ -303,7 +303,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
return
usr.visible_message(span_warning("[usr] begins uploading someone's mind into [target]!"),span_notice("You begin uploading a mind into [target]!"))
if(do_after(usr,35 SECONDS,target))
if(do_after(usr, 35 SECONDS, target))
if(!stored_mind)
to_chat(usr,span_warning("\The [src] no longer has a stored mind."))
return
@@ -417,7 +417,7 @@
if(ruined && I.has_tool_quality(TOOL_SCREWDRIVER))
to_chat(user, span_notice("You start winding the tape back in..."))
playsound(src, I.usesound, 50, 1)
if(do_after(user, 120 * I.toolspeed, target = src))
if(do_after(user, 12 SECONDS * I.toolspeed, target = src))
to_chat(user, span_notice("You wound the tape back in."))
fix()
return
@@ -262,7 +262,7 @@ This device records all warnings given and teleport events for admin review in c
if(L.a_intent != I_HELP || L.has_AI())
to_chat(user, span_notice("[L] is resisting your attempt to teleport them with \the [src]."))
to_chat(L, span_danger(" [user] is trying to teleport you with \the [src]!"))
if(!do_after(user, 30, L))
if(!do_after(user, 3 SECONDS, target = L))
return
//Bzzt.
@@ -412,7 +412,7 @@ GLOBAL_LIST_BOILERPLATE(premade_tele_beacons, /obj/item/perfect_tele_beacon/stat
var/obj/belly/bellychoice = tgui_input_list(user, "Which belly?","Select A Belly", L.vore_organs)
if(bellychoice)
user.visible_message(span_warning("[user] is trying to stuff \the [src] into [user.gender == MALE ? "his" : user.gender == FEMALE ? "her" : "their"] [bellychoice.name]!"),span_notice("You begin putting \the [src] into your [bellychoice.name]!"))
if(do_after(user,5 SECONDS,src))
if(do_after(user, 5 SECONDS, target = src))
user.unEquip(src)
forceMove(bellychoice)
user.visible_message(span_warning("[user] eats a telebeacon!"),"You eat the the beacon!")
@@ -478,7 +478,7 @@ GLOBAL_LIST_BOILERPLATE(premade_tele_beacons, /obj/item/perfect_tele_beacon/stat
user.visible_message(span_notice("[user] opens \the [src] and starts pumping the handle."), \
span_notice("You open \the [src] and start pumping the handle."))
while(recharging)
if(!do_after(user, 10, src))
if(!do_after(user, 1 SECOND, target = src))
break
playsound(src,'sound/items/change_drill.ogg',25,1)
if(power_source.give(phase_power) < phase_power)