[MIRROR] Refactors do_after w/ TG's do_after (#11486)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-22 17:35:16 -07:00
committed by GitHub
parent c1fffe13f3
commit f85a202d80
91 changed files with 558 additions and 310 deletions

View File

@@ -177,7 +177,7 @@
playsound(src, WT.usesound, 50, 1)
if(istext(glass))
user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.")
if(do_after(user, 4 SECONDS * WT.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * WT.toolspeed, src))
if(!src || !WT.isOn()) return
to_chat(user, span_notice("You welded the [glass] plating off!"))
var/M = text2path("/obj/item/stack/material/[glass]")
@@ -185,14 +185,14 @@
glass = 0
else if(glass == 1)
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly.")
if(do_after(user, 4 SECONDS * WT.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * WT.toolspeed, src))
if(!src || !WT.isOn()) return
to_chat(user, span_notice("You welded the glass panel out!"))
new /obj/item/stack/material/glass/reinforced(src.loc)
glass = 0
else if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if(do_after(user, 4 SECONDS * WT.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * WT.toolspeed, src))
if(!src || !WT.isOn()) return
to_chat(user, span_notice("You dissasembled the airlock assembly!"))
new /obj/item/stack/material/steel(src.loc, 4)
@@ -208,7 +208,7 @@
else
user.visible_message("[user] begins securing the airlock assembly to the floor.", "You starts securing the airlock assembly to the floor.")
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * W.toolspeed, src))
if(!src) return
to_chat(user, span_notice("You [anchored? "un" : ""]secured the airlock assembly!"))
anchored = !anchored
@@ -219,7 +219,7 @@
to_chat(user, span_warning("You need one length of coil to wire the airlock assembly."))
return
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) && state == 0 && anchored)
if(do_after(user, 4 SECONDS, src) && state == 0 && anchored)
if (C.use(1))
src.state = 1
to_chat(user, span_notice("You wire the airlock."))
@@ -228,7 +228,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * W.toolspeed, src))
if(!src) return
to_chat(user, span_notice("You cut the airlock wires.!"))
new/obj/item/stack/cable_coil(src.loc, 1)
@@ -238,7 +238,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS, src))
if(!src) return
user.drop_item()
W.loc = src
@@ -256,7 +256,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("\The [user] starts removing the electronics from the airlock assembly.", "You start removing the electronics from the airlock assembly.")
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * W.toolspeed, src))
if(!src) return
to_chat(user, span_notice("You removed the airlock electronics!"))
src.state = 1
@@ -271,7 +271,7 @@
if(material_name == MAT_RGLASS)
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) && !glass)
if(do_after(user, 4 SECONDS, src) && !glass)
if (S.use(1))
to_chat(user, span_notice("You installed reinforced glass windows into the airlock assembly."))
glass = 1
@@ -283,7 +283,7 @@
if(S.get_amount() >= 2)
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) && !glass)
if(do_after(user, 4 SECONDS, src) && !glass)
if (S.use(2))
to_chat(user, span_notice("You installed [material_display_name(material_name)] plating into the airlock assembly."))
glass = material_name
@@ -292,7 +292,7 @@
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now finishing the airlock."))
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 4 SECONDS * W.toolspeed, src))
if(!src) return
to_chat(user, span_notice("You finish the airlock!"))
var/path

View File

@@ -120,7 +120,7 @@
if(O.has_tool_quality(TOOL_WRENCH))
if(finished)
to_chat(user, span_notice("You start breaking down \the [src]."))
if(do_after(user, 10 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE))
if(do_after(user, 10 SECONDS, src))
new /obj/item/stack/material/plasteel(loc, 10)
playsound(user, O.usesound, 50, 1)
qdel(src)

View File

@@ -152,20 +152,20 @@
if(anchored && !reinf_material)
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now disassembling the girder..."))
if(do_after(user,(35 + round(max_health/50)) * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user,(35 + round(max_health/50)) * W.toolspeed))
if(!src) return
to_chat(user, span_notice("You dissasembled the girder!"))
dismantle()
else if(!anchored)
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now securing the girder..."))
if(do_after(user, 40 * W.toolspeed, src, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user, 40 * W.toolspeed, src))
to_chat(user, span_notice("You secured the girder!"))
reset_girder()
else if(istype(W, /obj/item/pickaxe/plasmacutter))
to_chat(user, span_notice("Now slicing apart the girder..."))
if(do_after(user,30 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user,30 * W.toolspeed))
if(!src) return
to_chat(user, span_notice("You slice apart the girder!"))
dismantle()
@@ -178,7 +178,7 @@
if(state == 2)
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now unsecuring support struts..."))
if(do_after(user,40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user,40 * W.toolspeed))
if(!src) return
to_chat(user, span_notice("You unsecured the support struts!"))
state = 1
@@ -190,7 +190,7 @@
else if(W.has_tool_quality(TOOL_WIRECUTTER) && state == 1)
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now removing support struts..."))
if(do_after(user,40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user,40 * W.toolspeed))
if(!src) return
to_chat(user, span_notice("You removed the support struts!"))
reinf_material.place_dismantled_product(get_turf(src))
@@ -200,7 +200,7 @@
else if(W.has_tool_quality(TOOL_CROWBAR) && state == 0 && anchored)
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now dislodging the girder..."))
if(do_after(user, 40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user, 40 * W.toolspeed))
if(!src) return
to_chat(user, span_notice("You dislodged the girder!"))
displace()
@@ -251,7 +251,7 @@
to_chat(user, span_notice("You begin adding the plating..."))
if(!do_after(user,time_to_reinforce, exclusive = TASK_USER_EXCLUSIVE) || !S.use(amount_to_use))
if(!do_after(user,time_to_reinforce) || !S.use(amount_to_use))
return TRUE //once we've gotten this far don't call parent attackby()
if(anchored)
@@ -285,7 +285,7 @@
return 0
to_chat(user, span_notice("Now reinforcing..."))
if (!do_after(user,40, exclusive = TASK_USER_EXCLUSIVE) || !S.use(1))
if (!do_after(user,40) || !S.use(1))
return 1 //don't call parent attackby() past this point
to_chat(user, span_notice("You added reinforcement!"))
@@ -351,13 +351,13 @@
if(W.has_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 100, 1)
to_chat(user, span_notice("Now disassembling the girder..."))
if(do_after(user,40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user,40 * W.toolspeed))
to_chat(user, span_notice("You dissasembled the girder!"))
dismantle()
else if(istype(W, /obj/item/pickaxe/plasmacutter))
to_chat(user, span_notice("Now slicing apart the girder..."))
if(do_after(user,30 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE))
if(do_after(user,30 * W.toolspeed))
to_chat(user, span_notice("You slice apart the girder!"))
dismantle()

View File

@@ -172,7 +172,7 @@
to_chat(user, span_warning("You need at least two rods to do this."))
return
to_chat(user, span_notice("Assembling grille..."))
if(!do_after(user, 1 SECONDS, R, exclusive = TASK_ALL_EXCLUSIVE))
if(!do_after(user, 1 SECONDS, R))
return
if(!R.use(2))
return
@@ -192,7 +192,7 @@
to_chat(user, span_warning("You need at least four sheets of glass to do this."))
return
to_chat(user, span_notice("Assembling window..."))
if(!do_after(user, 4 SECONDS, G, exclusive = TASK_ALL_EXCLUSIVE))
if(!do_after(user, 4 SECONDS, G))
return
if(!G.use(4))
return