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
+2 -11
View File
@@ -46,17 +46,8 @@
playsound(src, 'sound/weapons/heavysmash.ogg', 50, 1)
if(damage_type == BRUTE)
step_away(M,src,15)
/*
if(M.stat>1)
M.gib()
melee_can_hit = 0
if(do_after(melee_cooldown))
melee_can_hit = 1
return
*/
if(ishuman(T))
var/mob/living/carbon/human/H = T
// if (M.health <= 0) return
var/obj/item/organ/external/temp = H.get_organ(pick(BP_TORSO, BP_TORSO, BP_TORSO, BP_HEAD))
if(temp)
@@ -104,7 +95,7 @@
src.visible_message("[src] pushes [T] out of the way.")
melee_can_hit = 0
if(do_after(melee_cooldown))
if(do_after_action(melee_cooldown))
melee_can_hit = 1
return
@@ -124,7 +115,7 @@
melee_can_hit = 0
if(do_after(melee_cooldown))
if(do_after_action(melee_cooldown))
melee_can_hit = 1
return
+1 -1
View File
@@ -140,7 +140,7 @@
if(integrity < max_integrity)
to_chat(user, span_notice("You start to repair damage to \the [src]."))
while(integrity < max_integrity && NP)
if(do_after(user, 1 SECOND, src))
if(do_after(user, 1 SECOND, target = src))
NP.use(1)
adjust_integrity(NP.mech_repair)
+3 -3
View File
@@ -32,7 +32,7 @@
var/obj/machinery/door/firedoor/FD = O
if(FD.blocked)
FD.visible_message(span_danger("\The [chassis] begins prying on \the [FD]!"))
if(do_after(chassis.occupant,10 SECONDS,FD))
if(do_after(chassis.occupant, 10 SECONDS, target = FD))
playsound(FD, 'sound/machines/door/airlock_creaking.ogg', 100, 1)
FD.blocked = 0
FD.update_icon()
@@ -40,7 +40,7 @@
FD.visible_message(span_warning("\The [chassis] tears \the [FD] open!"))
else if(FD.density)
FD.visible_message(span_warning("\The [chassis] begins forcing \the [FD] open!"))
if(do_after(chassis.occupant, 5 SECONDS,FD))
if(do_after(chassis.occupant, 5 SECONDS, target = FD))
playsound(FD, 'sound/machines/door/airlock_creaking.ogg', 100, 1)
FD.visible_message(span_danger("\The [chassis] forces \the [FD] open!"))
FD.open(1)
@@ -54,7 +54,7 @@
else if(!AD.operating)
if(AD.welded)
AD.visible_message(span_warning("\The [chassis] begins prying on \the [AD]!"))
if(do_after(chassis.occupant, 15 SECONDS,AD) && chassis.Adjacent(AD))
if(do_after(chassis.occupant, 15 SECONDS, target = AD) && chassis.Adjacent(AD))
AD.welded = FALSE
AD.update_icon()
playsound(AD, 'sound/machines/door/airlock_creaking.ogg', 100, 1)
+1 -1
View File
@@ -81,7 +81,7 @@
chassis.float_direction = direction
chassis.start_process(MECHA_PROC_MOVEMENT)
chassis.log_message(span_warning("Movement control lost. Inertial movement started."))
if(chassis.do_after(get_step_delay()))
if(chassis.do_after_action(get_step_delay()))
chassis.can_move = 1
return 1
return 0
@@ -30,7 +30,7 @@
var/datum/beam/ScanBeam = chassis.Beam(target, "g_beam", 'icons/effects/beam.dmi', 2 SECONDS, 10, /obj/effect/ebeam, 2)
if(do_after(chassis.occupant, 2 SECONDS))
if(do_after(chassis.occupant, 2 SECONDS, target))
my_scanner.ScanTurf(target, chassis.occupant, exact_scan)
QDEL_NULL(ScanBeam)
+1 -1
View File
@@ -26,7 +26,7 @@
if (chassis)
chassis.visible_message(span_notice("[user] starts to climb into [chassis]."))
if(do_after(user, 40))
if(do_after(user, 4 SECONDS, target = src))
if(!src.occupant)
user.forceMove(src)
occupant = user
+5 -5
View File
@@ -479,7 +479,7 @@
radio.icon_state = icon_state
radio.subspace_transmission = 1
/obj/mecha/proc/do_after(delay as num)
/obj/mecha/proc/do_after_action(delay as num) //This is literally just a sleep disguised as a proc. Fucking bullshit.
sleep(delay)
if(src)
return 1
@@ -871,7 +871,7 @@
float_direction = direction
start_process(MECHA_PROC_MOVEMENT)
src.log_message(span_warning("Movement control lost. Inertial movement started."))
if(do_after(get_step_delay()))
if(do_after_action(get_step_delay()))
can_move = 1
return 1
return 0
@@ -1582,7 +1582,7 @@
else if(C.integrity < C.max_integrity)
to_chat(user, span_notice("You start to repair damage to \the [C]."))
while(C.integrity < C.max_integrity && NP)
if(do_after(user, 1 SECOND, src))
if(do_after(user, 1 SECOND, target = src))
NP.use(1)
C.adjust_integrity(NP.mech_repair)
@@ -2613,7 +2613,7 @@
var/mob/occupant = P.occupant
user.visible_message(span_infoplain(span_bold("\The [user]") + " begins opening the hatch on \the [P]..."), span_notice("You begin opening the hatch on \the [P]..."))
if (!do_after(user, 40))
if (!do_after(user, 4 SECONDS, target = src))
return
user.visible_message(span_infoplain(span_bold("\The [user]") + " opens the hatch on \the [P] and removes [occupant]!"), span_notice("You open the hatch on \the [P] and remove [occupant]!"))
@@ -2653,7 +2653,7 @@
src.occupant_message("Recalibrating coordination system.")
src.log_message("Recalibration of coordination system started.")
var/T = src.loc
if(do_after(100))
if(do_after_action(100))
if(T == src.loc)
src.clearInternalDamage(MECHA_INT_CONTROL_LOST)
src.occupant_message(span_blue("Recalibration successful."))
+2 -2
View File
@@ -80,7 +80,7 @@
src.visible_message("[src] pushes [target] out of the way.")
melee_can_hit = 0
if(do_after(melee_cooldown))
if(do_after_action(melee_cooldown))
melee_can_hit = 1
return
@@ -95,7 +95,7 @@
else
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
melee_can_hit = 0
if(do_after(melee_cooldown))
if(do_after_action(melee_cooldown))
melee_can_hit = 1
break
return