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-07 20:25:08 -04:00
committed by GitHub
parent 736fe6ef28
commit d73f6b8dbd
330 changed files with 682 additions and 690 deletions
+2 -2
View File
@@ -51,7 +51,7 @@
user.visible_message("\The [user] starts to weld \the [src] to the floor.", \
"You start to weld \the [src] to the floor.", \
"You hear welding")
if(do_after(user, 2 SECONDS))
if(do_after(user, 2 SECONDS, target = src))
if(QDELETED(src) || !WT.isOn()) return
state = LADDER_CONSTRUCTION_WELDED
to_chat(user, "You weld \the [src] to the floor.")
@@ -64,7 +64,7 @@
user.visible_message("\The [user] starts to cut \the [src] free from the floor.", \
"You start to cut \the [src] free from the floor.", \
"You hear welding")
if(do_after(user, 2 SECONDS))
if(do_after(user, 2 SECONDS, target = src))
if(QDELETED(src) || !WT.isOn()) return
state = LADDER_CONSTRUCTION_WRENCHED
to_chat(user, "You cut \the [src] free from the floor.")
+2 -2
View File
@@ -51,7 +51,7 @@
user.visible_message("\The [user] starts to deconstruct \the [src].", \
"You start to deconstruct \the [src].", \
"You hear welding")
if(do_after(user, 2 SECONDS))
if(do_after(user, 2 SECONDS, target = src))
if(QDELETED(src) || !WT.isOn()) return
var/obj/structure/ladder_assembly/A
to_chat(user, "You deconstruct \the [src].")
@@ -143,7 +143,7 @@
var/mob/living/carbon/human/MS = M
climb_modifier = MS.species.climb_mult
if(do_after(M, (climb_time * climb_modifier), src))
if(do_after(M, (climb_time * climb_modifier), target = src))
var/turf/T = get_turf(target_ladder)
for(var/atom/A in T)
if(!A.CanPass(M, M.loc, 1.5, 0))
+5 -5
View File
@@ -59,7 +59,7 @@
var/pull_up_time = max((3 SECONDS + (src.movement_delay() * 10) * swim_modifier), 1)
to_chat(src, span_notice("You start diving underwater..."))
src.audible_message(span_notice("[src] begins to dive under the water."), runemessage = "splish splosh")
if(do_after(src, pull_up_time))
if(do_after(src, pull_up_time, target = src))
to_chat(src, span_notice("You reach the sea floor."))
else
to_chat(src, span_warning("You stopped swimming downwards."))
@@ -84,7 +84,7 @@
var/pull_up_time = max((5 SECONDS + (src.movement_delay() * 10) * climb_modifier), 1)
to_chat(src, span_notice("You grab \the [lattice] and start pulling yourself upward..."))
src.audible_message(span_notice("[src] begins climbing up \the [lattice]."), runemessage = "clank clang")
if(do_after(src, pull_up_time))
if(do_after(src, pull_up_time, target = src))
to_chat(src, span_notice("You pull yourself up."))
else
to_chat(src, span_warning("You gave up on pulling yourself up."))
@@ -94,7 +94,7 @@
var/pull_up_time = max((5 SECONDS + (src.movement_delay() * 10) * swim_modifier), 1)
to_chat(src, span_notice("You start swimming upwards..."))
src.audible_message(span_notice("[src] begins to swim towards the surface."), runemessage = "splish splosh")
if(do_after(src, pull_up_time))
if(do_after(src, pull_up_time, target = src))
to_chat(src, span_notice("You reach the surface."))
else
to_chat(src, span_warning("You stopped swimming upwards."))
@@ -109,7 +109,7 @@
to_chat(src, span_notice("There's something in the way up above in that direction, try another."))
return 0
src.audible_message(span_notice("[src] begins climbing up \the [lattice]."), runemessage = "clank clang")
if(do_after(src, pull_up_time))
if(do_after(src, pull_up_time, target = src))
to_chat(src, span_notice("You pull yourself up."))
else
to_chat(src, span_warning("You gave up on pulling yourself up."))
@@ -130,7 +130,7 @@
var/fly_time = max(7 SECONDS + (H.movement_delay() * 10), 1) //So it's not too useful for combat. Could make this variable somehow, but that's down the road.
to_chat(src, span_notice("You begin to fly upwards..."))
H.audible_message(span_notice("[H] begins to flap \his wings, preparing to move upwards!"), runemessage = "flap flap")
if(do_after(H, fly_time) && H.flying)
if(do_after(H, fly_time, target = src) && H.flying)
to_chat(src, span_notice("You fly upwards."))
else
to_chat(src, span_warning("You stopped flying upwards."))
+2 -2
View File
@@ -192,7 +192,7 @@
var/oops_time = world.time
var/grace_time = 4 SECONDS
to_chat(L, span_warning("If you get interrupted after [(grace_time / (1 SECOND))] seconds of climbing, you will fall and hurt yourself, beware!"))
if(do_after(L,climb_time))
if(do_after(L, climb_time, target = src))
if(prob(fall_chance))
L.forceMove(above_mob)
L.visible_message(message = span_infoplain(span_bold("[L]") + " falls off " + span_bold("\The [src]")), self_message = span_danger("You slipped off " + span_bold("\The [src]")), \
@@ -315,7 +315,7 @@
var/oops_time = world.time
var/grace_time = 3 SECONDS
to_chat(src, span_warning("If you get interrupted after [(grace_time / (1 SECOND))] seconds of climbing, you will fall and hurt yourself, beware!"))
if(do_after(src,climb_time))
if(do_after(src, climb_time, target = src))
if(prob(fall_chance))
src.forceMove(front_of_us)
src.visible_message(message = span_infoplain(span_bold("[src]") + " falls off " + span_bold("\The [below_wall]")), \