Refactored do_after to use a flag-based system for options (#17127)

* Refactored do_after to use a flag-based system for options

* More flags

* Ditto

* Use the HAS_FLAG macro

* do_after pass

* Fix burning paper code

* Resolve issues from Fluffy's code reviews

* .
This commit is contained in:
Cody Brittain
2023-09-27 12:17:14 +00:00
committed by GitHub
parent 085e7c8107
commit 0a3dac31e0
125 changed files with 531 additions and 314 deletions
@@ -163,7 +163,7 @@
/obj/effect/decal/cleanable/confetti/attack_hand(mob/user)
to_chat(user, SPAN_NOTICE("You start to meticulously pick up the confetti."))
if(do_after(user, 60))
if(do_after(user, 6 SECONDS))
qdel(src)
/obj/effect/decal/cleanable/acid_remnants
+10 -10
View File
@@ -25,7 +25,7 @@
"<span class='warning'>[user] begins deploying \the [src].</span>",
"<span class='notice'>You begin deplyoing \the [src].</span>"
)
if (!do_after(user, 0.45 SECONDS, act_target = src))
if (!do_after(user, 0.45 SECONDS))
return
user.visible_message(
"<span class='warning'>[user] deployed \the [src].</span>" ,
@@ -197,7 +197,7 @@
"<span class='warning'>[usr] begins folding up the [src.name].</span>",
"<span class='notice'>You begin folding up the [src.name].</span>"
)
if (!do_after(usr, 0.45 SECONDS, act_target = src))
if (!do_after(usr, 0.45 SECONDS))
return
usr.visible_message(
"<span class='warning'>[usr] folds up the [src.name].</span>" ,
@@ -268,7 +268,7 @@
var/time = 360 * breakout_time * 2
breakout = TRUE
if (!do_after(escapee, time, act_target = src, extra_checks = CALLBACK(src, PROC_REF(breakout_callback), escapee)))
if (!do_after(escapee, time, src, extra_checks = CALLBACK(src, PROC_REF(breakout_callback), escapee)))
breakout = FALSE
return
@@ -312,7 +312,7 @@
"<span class='warning'>[usr] is setting [src] internals.</span>",
"<span class='notice'>You are settting [src] internals.</span>"
)
if (!do_after(usr, 2 SECONDS, act_target = src))
if (!do_after(usr, 2 SECONDS, src))
return
usr.visible_message(
"<span class='warning'>[usr] has set [src] internals.</span>" ,
@@ -345,7 +345,7 @@
"<span class='warning'>[usr] is removing [internal_tank] from [src].</span>",
"<span class='notice'>You are removing [internal_tank] from [src].</span>"
)
if (!do_after(usr, 2 SECONDS, act_target = src))
if (!do_after(usr, 2 SECONDS, src))
return
usr.visible_message(
"<span class='warning'>[usr] has removed [internal_tank] from [src].</span>",
@@ -378,7 +378,7 @@
"<span class='warning'>[usr] is removing [cell] from [src].</span>",
"<span class='notice'>You are removing [cell] from [src].</span>"
)
if (!do_after(usr, 2 SECONDS, act_target = src))
if (!do_after(usr, 2 SECONDS, src))
return
usr.visible_message(
"<span class='warning'>[usr] has removed [cell] from [src].</span>",
@@ -399,7 +399,7 @@
"<span class='warning'>[user] is attaching [W] to [src].</span>",
"<span class='notice'>You are attaching [W] to [src].</span>"
)
if (!do_after(user, 2 SECONDS, act_target = src))
if (!do_after(user, 2 SECONDS, src))
return
user.visible_message(
"<span class='warning'>[user] has attached [W] to [src].</span>",
@@ -430,7 +430,7 @@
"<span class='notice'>You begin putting cable restrains on zipper of [src].</span>"
)
playsound(loc, 'sound/weapons/cablecuff.ogg', 50, 1)
if (!do_after(user, 3 SECONDS, act_target = src, extra_checks = CALLBACK(src, PROC_REF(is_closed))))
if (!do_after(user, 3 SECONDS, src, extra_checks = CALLBACK(src, PROC_REF(is_closed))))
return TRUE
zipped = !zipped
update_icon()
@@ -452,7 +452,7 @@
"<span class='notice'>You begin cutting cable restrains on zipper of [src].</span>"
)
playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1)
if (!do_after(user, 3 SECONDS, act_target = src, extra_checks = CALLBACK(src, PROC_REF(is_closed))))
if (!do_after(user, 3 SECONDS, src, extra_checks = CALLBACK(src, PROC_REF(is_closed))))
return TRUE
zipped = !zipped
update_icon()
@@ -472,7 +472,7 @@
"<span class='warning'>[user] is attaching [W] to [src].</span>",
"<span class='notice'>You are attaching [W] to [src].</span>"
)
if (!do_after(user, 2 SECONDS, act_target = src))
if (!do_after(user, 2 SECONDS, src))
return TRUE
user.visible_message(
"<span class='warning'>[user] has attached [W] to [src].</span>",
+3 -3
View File
@@ -380,7 +380,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, 3 SECONDS, act_target = H))
if(!do_after(user, 3 SECONDS, H, DO_DEFAULT | DO_USER_UNIQUE_ACT))
return
user.visible_message(SPAN_NOTICE("\The [user] places [src] on [H]'s chest."), SPAN_WARNING("You place [src] on [H]'s chest."))
playsound(get_turf(src), 'sound/machines/defib_charge.ogg', 50, 0)
@@ -395,7 +395,7 @@
make_announcement("buzzes, \"Warning - Patient is in hypovolemic shock and may require a blood transfusion.\"", "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, act_target = H))
if(!do_after(user, chargetime, H))
return
//deduct charge here, in case the base unit was EMPed or something during the delay time
@@ -458,7 +458,7 @@
playsound(get_turf(src), 'sound/machines/defib_charge.ogg', 50, 0)
audible_message(SPAN_WARNING("\The [src] lets out a steadily rising hum..."))
if(!do_after(user, chargetime, act_target = H))
if(!do_after(user, chargetime, H))
return
//deduct charge here, in case the base unit was EMPed or something during the delay time
+1 -1
View File
@@ -75,7 +75,7 @@
current_hacks += target
// On average hackin takes ~10 seconds. Fairly small random span to avoid people simply aborting and trying again
var/hack_result = do_after(user, hack_time + rand(-3 SECONDS, 3 SECONDS), use_user_turf = (allow_movement ? -1 : FALSE))
var/hack_result = do_after(user, hack_time + rand(-3 SECONDS, 3 SECONDS), do_flags = DO_DEFAULT & ~DO_SHOW_PROGRESS)
is_hacking = FALSE
current_hacks -= target
@@ -147,7 +147,7 @@
to_chat(user, SPAN_WARNING("There are no more working lights left in the box!"))
return
if (do_after(user, load_interval, needhand = 0) && boxstartloc == box.loc && ourstartloc == src.loc)
if (do_after(user, load_interval, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND) && boxstartloc == box.loc && ourstartloc == src.loc)
if(uses >= max_uses) //catches loading from multiple boxes
break
uses++
@@ -238,7 +238,7 @@
/obj/item/device/magnetic_lock/process()
if(!processpower)
return
var/obj/item/cell/C = powercell
var/obj/item/cell/C = powercell
var/delta_sec = (world.time - last_process_time) / 10
var/drainamount = drain_per_second * delta_sec
if (C)
@@ -281,7 +281,7 @@
user.visible_message("<span class='notice'>[user] starts mounting [src] onto [newtarget].</span>", "<span class='notice'>You begin mounting [src] onto [newtarget].</span>")
if (do_after(user, 35))
if (do_after(user, 3.5 SECONDS))
if (!check_target(newtarget, user)) return
@@ -63,7 +63,7 @@
to_chat(usr, "You plug \the [src] into your maintenace port.")
else
visible_message("<b>[usr]</b> begins hunting for the maintenance port on \the [over_object]'s chassis.") // The age old question of "where do I put it in!?"
if(do_after(usr, 50))
if(do_after(usr, 5 SECONDS))
plug(over_object)
visible_message("[usr] plugs \the [src] into \the [attached]'s maintenance port.")
@@ -37,7 +37,7 @@
if(G.pin)
to_chat(user, "<span class ='notice'>You begin removing [G.name]'s [G.pin.name] using \the [src.name], it will take 15 seconds.</span>")
if(!do_after(user, 15 SECONDS, act_target = target))
if(!do_after(user, 15 SECONDS, target, DO_UNIQUE))
return
to_chat(user, "<span class ='notice'>You remove [G.name]'s [G.pin.name].</span>")
+2 -3
View File
@@ -621,8 +621,7 @@ BREATH ANALYZER
LAZYADD(src.other_DNA, H.dna.unique_enzymes)
src.other_DNA_type = "saliva"
if (!do_after(user, 2 SECONDS, act_target = H))
to_chat(user,"<span class='notice'>You and the target need to be standing still in order to take a breath sample.</span>")
if (!do_after(user, 2 SECONDS, H, DO_UNIQUE & ~DO_BOTH_CAN_TURN))
return
user.visible_message("<span class='notice'>[user] takes a breath sample from [H].</span>","<span class='notice'>\The [src] clicks as it finishes reading [H]'s breath sample.</span>")
@@ -710,7 +709,7 @@ BREATH ANALYZER
if(!internal_bodyscanner)
return
user.visible_message("<b>[user]</b> starts scanning \the [M] with \the [src].", SPAN_NOTICE("You start scanning \the [M] with \the [src]."))
if(do_after(user, 7 SECONDS, TRUE))
if(do_after(user, 7 SECONDS, M, DO_UNIQUE))
print_scan(M, user)
add_fingerprint(user)
+1 -1
View File
@@ -34,7 +34,7 @@
var/q // recycled from tip of the day code. it just works!(TM)
q = pick(randomquip)
if(do_after(user, 25))
if(do_after(user, 2.5 SECONDS))
to_chat(user, "<span class='notice'>You notice a particular verse: [q]</span>")
reading = FALSE
+1 -1
View File
@@ -34,7 +34,7 @@
to_chat(user, "You start marking a line on [target].")
if (!do_after(user, 1 SECONDS, act_target = target))
if (!do_after(user, 1 SECONDS, target))
return
for (var/obj/effect/decal/cleanable/draftingchalk/C in target)
+1 -1
View File
@@ -101,7 +101,7 @@
working = TRUE
update_icon()
if(!do_after(user,2 MINUTES))
if(!do_after(user, 2 MINUTES, src, DO_UNIQUE))
to_chat(user, SPAN_WARNING("Your concentration is broken!"))
working = FALSE
update_icon()
+1 -1
View File
@@ -406,7 +406,7 @@ Contains:
to_chat(user, SPAN_DANGER("You can't apply a splint to the arm you're using!"))
return
user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to their [limb]."), SPAN_DANGER("You start to apply \the [src] to your [limb]."), SPAN_DANGER("You hear something being wrapped."))
if(do_after(user, 50))
if(do_after(user, 5 SECONDS, M))
if (M != user)
user.visible_message(SPAN_DANGER("[user] finishes applying \the [src] to [M]'s [limb]."), SPAN_DANGER("You finish applying \the [src] to [M]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
else
+1 -1
View File
@@ -135,7 +135,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list(
user.visible_message(SPAN_NOTICE("[user] starts assembling a liquidbag barricade."),
SPAN_NOTICE("You start assembling a liquidbag barricade."))
if(!do_after(user, 3 SECONDS))
if(!do_after(user, 3 SECONDS, do_flags = DO_REPAIR_CONSTRUCT))
return
for(var/obj/O in user.loc) //Objects, we don't care about mobs. Turfs are checked elsewhere
@@ -89,7 +89,7 @@
user.visible_message(SPAN_NOTICE("\The [user] starts slicing the [hide_type] from \the [src]."),
SPAN_NOTICE("You start slicing the [hide_type] from \the [src]"),
SPAN_NOTICE("You hear the sound of a knife scraping against flesh."))
if(do_after(user,50, act_target = src))
if(do_after(user, 5 SECONDS, src))
if(amount <= 0) //Ensures we don't get multiple products from queuing clicks.
return
use(1)
@@ -130,7 +130,7 @@
return
user.visible_message(SPAN_NOTICE("\The [user] starts drying \the [src] with \the [WT]."), SPAN_NOTICE("You start drying the wet leather with \the [WT]..."))
being_dried = TRUE
while(do_after(user, 20, act_target = src) && wetness > 0)
while(do_after(user, 2 SECONDS, src) && wetness > 0)
if(!WT.use(1) || !WT.isOn())
break
if(prob(5))
+1 -1
View File
@@ -159,7 +159,7 @@
to_chat(user, SPAN_NOTICE("Building [recipe.title]..."))
if (recipe.time)
if (!do_after(user, recipe.time))
if (!do_after(user, recipe.time, do_flags = DO_REPAIR_CONSTRUCT))
return
if (use(required))
+1 -1
View File
@@ -570,7 +570,7 @@
var/used_energy = 100
to_chat(user, "Fabricating machine...")
playsound(get_turf(src), 'sound/items/rfd_start.ogg', 50, FALSE)
if(do_after(user, 30 SECONDS, act_target = src))
if(do_after(user, 30 SECONDS, src, DO_UNIQUE))
var/obj/product = new /obj/machinery/transformer
malftransformermade = 1
product.forceMove(get_turf(A))
@@ -187,7 +187,7 @@
if(M.stat != DEAD && ishuman(M) && user.a_intent != I_HURT)
var/mob/living/K = M
if(cult && (K.mind in cult.current_antagonists) && prob(75))
if(do_after(user, 15))
if(do_after(user, 1.5 SECONDS))
K.visible_message(SPAN_DANGER("[user] waves \the [src] over \the [K]'s head, [K] looks captivated by it."), SPAN_WARNING("[user] waves the [src] over your head. <b>You see a foreign light, asking you to follow it. Its presence burns and blinds.</b>"))
var/choice = alert(K,"Do you want to give up your goal?","Become cleansed","Resist","Give in")
switch(choice)
+1 -1
View File
@@ -129,7 +129,7 @@
else
user.visible_message("<span class='warning'>[user] begins to do [H]'s lips with \the [src].</span>", \
"<span class='notice'>You begin to apply \the [src].</span>")
if(do_after(user, 20) && do_after(H, 20, 0)) //user needs to keep their active hand, H does not.
if(do_after(user, 4 SECONDS, H, do_flags = DO_DEFAULT & ~DO_SHOW_PROGRESS & ~DO_BOTH_CAN_TURN))
user.visible_message("<span class='notice'>[user] does [H]'s lips with \the [src].</span>", \
"<span class='notice'>You apply \the [src].</span>")
H.lipstick_color = lipstick_color
@@ -111,7 +111,7 @@
spawn(50)
inuse = 0
if(!do_after(user,50))
if(!do_after(user, 5 SECONDS))
return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
@@ -51,7 +51,7 @@
return
to_chat(user, SPAN_NOTICE("Planting explosives..."))
if(do_after(user, 50, TRUE, target))
if(do_after(user, 5 SECONDS, target, DO_UNIQUE))
user.do_attack_animation(target)
deploy_c4(target, user)
@@ -35,7 +35,7 @@
to_chat(user, SPAN_WARNING("\The [src] reads, \"Scanning failure, please submit scanner for repairs.\""))
return
user.visible_message(SPAN_NOTICE("\The [user] starts analyzing \the [M] with \the [src]..."), SPAN_NOTICE("You start analyzing \the [M] with \the [src]..."))
if(do_after(user, 50, TRUE, src))
if(do_after(user, 5 SECONDS, src, DO_UNIQUE))
if(!isipc(M))
to_chat(user, SPAN_WARNING("You analyze \the [M], but find that they're not an IPC at all!"))
return
@@ -59,4 +59,4 @@
else
to_chat(user, SPAN_WARNING("\The [src]'s wires aren't exposed."))
else
..()
..()
+2 -2
View File
@@ -37,7 +37,7 @@
"<span class='danger'>You begin deploying \the [src]!</span>"
)
if (do_after(user, 60))
if (do_after(user, 6 SECONDS, DO_REPAIR_CONSTRUCT))
user.visible_message(
"<span class='danger'>[user] has deployed \the [src].</span>",
"<span class='danger'>You have deployed \the [src]!</span>"
@@ -90,7 +90,7 @@
var/obj/item/stack/cable_coil/C = I
if(C.use(1))
to_chat(user, SPAN_NOTICE("You start carefully start rewiring \the [src]."))
if(do_after(user, 100, TRUE, src))
if(do_after(user, 10 SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You successfully rewire \the [src], priming it for use."))
deactivated = FALSE
return
@@ -515,7 +515,7 @@
PowerUp(user)
else
playsound(loc, 'sound/weapons/saw/chainsawpull.ogg', 50, 0, 15)
if(!do_after(user, 2 SECONDS, act_target = user))
if(!do_after(user, 2 SECONDS))
break
/obj/item/material/twohanded/chainsaw/pre_attack(var/mob/living/target, var/mob/living/user)
+1 -1
View File
@@ -78,7 +78,7 @@
else
clean_msg = FALSE
playsound(loc, 'sound/effects/mop.ogg', 25, 1)
if (do_after(user, 25, needhand = 0))
if (do_after(user, 2.5 SECONDS, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
target.clean_blood()
if(clean_msg)
to_chat(user, SPAN_NOTICE("You scrub \the [target.name] out."))
@@ -637,7 +637,7 @@
if(empty_delay)
usr.visible_message("\The [usr] starts to empty the contents of \the [src]...", SPAN_NOTICE("You start emptying the contents of \the [src]..."))
if(!do_after(usr, contents.len * empty_delay, act_target=usr))
if(!do_after(usr, contents.len * empty_delay))
return
var/turf/T = get_turf(src)
+2 -2
View File
@@ -25,7 +25,7 @@
return
user.visible_message("<span class='danger'>\The [user] begins taping over \the [H]'s eyes!</span>")
if(!do_after(user, 30))
if(!do_after(user, 3 SECONDS, H, DO_UNIQUE))
return
// Repeat failure checks.
@@ -54,7 +54,7 @@
playsound(src, /singleton/sound_category/rip_sound, 25)
user.visible_message("<span class='danger'>\The [user] begins taping up \the [H]'s mouth!</span>")
if(!do_after(user, 30))
if(!do_after(user, 3 SECONDS, H, DO_UNIQUE))
return
// Repeat failure checks.
+1 -1
View File
@@ -455,7 +455,7 @@
log_and_message_admins("is attempting to welderbomb", user)
to_chat(user, SPAN_ALERT("You start heating the fueltank..."))
tank.armed = 1
if(do_after(user, 100))
if(do_after(user, 10 SECONDS, O, DO_UNIQUE))
if(tank.defuse)
user.visible_message("[user] melts some of the framework on the [O]!", "You melt some of the framework!")
tank.defuse = 0
+3 -3
View File
@@ -249,7 +249,7 @@
var/time = 360 * time_to_escape * 2
breakout = TRUE
if (!do_after(escapee, time, act_target = src, extra_checks = CALLBACK(src, PROC_REF(breakout_callback), escapee)))
if (!do_after(escapee, time, src))
breakout = FALSE
return
@@ -446,7 +446,7 @@
user.visible_message("<span class='notice'>[user] attempts to pass through \the [src] without triggering it.</span>",
"<span class='notice'>You attempt to pass through \the [src] without triggering it. </span>"
)
if(do_after(user, 2 SECONDS, act_target = src))
if(do_after(user, 2 SECONDS, src))
if(prob(pct))
user.forceMove(loc)
user.visible_message("<span class='notice'>[user] passes through \the [src] without triggering it.</span>",
@@ -626,7 +626,7 @@
to_chat(user, "<span class='notice'>You are trying to add metal bars to \the [src].</span>")
if (!do_after(user, 2 SECONDS, act_target = src))
if (!do_after(user, 2 SECONDS, src))
return
to_chat(user, "<span class='notice'>You add metal bars to \the [src].</span>")
+1 -1
View File
@@ -137,7 +137,7 @@
user.visible_message(SPAN_WARNING("[user] starts [flags & ON_BORDER ? "leaping over" : "climbing onto"] \the [src]!"))
LAZYADD(climbers, user)
if(!do_after(user,50))
if(!do_after(user, 5 SECONDS, src, DO_DEFAULT | DO_USER_UNIQUE_ACT))
LAZYREMOVE(climbers, user)
return
@@ -146,7 +146,7 @@
if(can_wire)
user.visible_message(SPAN_NOTICE("[user] starts setting up [W.name] on [src]."),
SPAN_NOTICE("You start setting up [W.name] on [src]."))
if(do_after(user, 20, act_target = src) && can_wire)
if(do_after(user, 20, src, DO_REPAIR_CONSTRUCT) && can_wire)
// Make sure there's still enough wire in the stack
if(!B.use(1))
return
@@ -167,7 +167,7 @@
if(is_wired)
user.visible_message(SPAN_NOTICE("[user] begin removing the barbed wire on [src]."),
SPAN_NOTICE("You begin removing the barbed wire on [src]."))
if(do_after(user, 20, act_target = src))
if(do_after(user, 20, src, DO_REPAIR_CONSTRUCT))
if(!is_wired)
return
@@ -74,7 +74,7 @@
user.visible_message(SPAN_NOTICE("[user] starts adding more [SB] to [src]."), \
SPAN_NOTICE("You start adding liquid bags to [src]."))
for(var/i = build_stage to BARRICADE_LIQUIDBAG_5)
if(build_stage >= BARRICADE_LIQUIDBAG_5 || !do_after(user, 5, act_target = src) || build_stage >= BARRICADE_LIQUIDBAG_5)
if(build_stage >= BARRICADE_LIQUIDBAG_5 || !do_after(user, 5, src, DO_REPAIR_CONSTRUCT) || build_stage >= BARRICADE_LIQUIDBAG_5)
break
SB.use(1)
increment_build_stage()
@@ -23,7 +23,7 @@
to_chat(user, SPAN_WARNING("You need one plank of wood to repair [src]."))
return
visible_message(SPAN_NOTICE("[user] begins to repair [src]."))
if(do_after(user, 2 SECONDS, act_target = src) && (health < maxhealth))
if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && (health < maxhealth))
if(D.use(1))
update_health(-0.5*maxhealth)
update_damage_state()
@@ -311,7 +311,7 @@
return
var/obj/item/closet_teleporter/CT = W
user.visible_message(SPAN_NOTICE("\The [user] starts attaching \the [CT] to \the [src]..."), SPAN_NOTICE("You begin attaching \the [CT] to \the [src]..."), range = 3)
if(do_after(user, 30, TRUE, src))
if(do_after(user, 30, src, DO_REPAIR_CONSTRUCT))
user.visible_message(SPAN_NOTICE("\The [user] attaches \the [CT] to \the [src]."), SPAN_NOTICE("You attach \the [CT] to \the [src]."), range = 3)
linked_teleporter = CT
CT.attached_closet = src
@@ -325,7 +325,7 @@
if(W.isscrewdriver()) // Moved here so you can only detach linked teleporters when the door is open. So you can like unscrew and bolt the locker normally in most circumstances.
if(linked_teleporter)
user.visible_message(SPAN_NOTICE("\The [user] starts detaching \the [linked_teleporter] from \the [src]..."), SPAN_NOTICE("You begin detaching \the [linked_teleporter] from \the [src]..."), range = 3)
if(do_after(user, 30, TRUE, src))
if(do_after(user, 30, src, DO_REPAIR_CONSTRUCT))
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [linked_teleporter] from \the [src]."), SPAN_NOTICE("You detach \the [linked_teleporter] from \the [src]."), range = 3)
linked_teleporter.attached_closet = null
user.put_in_hands(linked_teleporter)
@@ -340,7 +340,7 @@
"You hear a welding torch on metal."
)
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
if (!do_after(user, 2 SECONDS, act_target = src, extra_checks = CALLBACK(src, PROC_REF(is_open))))
if (!do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT))
return
if(!WT.use(0,user))
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
@@ -411,14 +411,14 @@
if(screwed)
to_chat(user, SPAN_NOTICE("You start to unscrew \the [src] from the floor..."))
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 10/W.toolspeed SECONDS, act_target = src))
if (do_after(user, 10/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You unscrew the locker!"))
playsound(loc, W.usesound, 50, 1)
screwed = FALSE
else if(!screwed && wrenched)
to_chat(user, SPAN_NOTICE("You start to screw the \the [src] to the floor..."))
playsound(src, 'sound/items/Welder.ogg', 80, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
if (do_after(user, 15/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You screw \the [src]!"))
playsound(loc, W.usesound, 50, 1)
screwed = TRUE
@@ -426,7 +426,7 @@
if(wrenched && !screwed)
to_chat(user, SPAN_NOTICE("You start to unfasten the bolts holding \the [src] in place..."))
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
if (do_after(user, 15/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You unfasten \the [src]'s bolts!"))
playsound(loc, W.usesound, 50, 1)
wrenched = FALSE
@@ -434,7 +434,7 @@
else if(!wrenched)
to_chat(user, SPAN_NOTICE("You start to fasten the bolts holding the locker in place..."))
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
if (do_after(user, 15/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You fasten the \the [src]'s bolts!"))
playsound(loc, W.usesound, 50, 1)
wrenched = TRUE
@@ -458,7 +458,7 @@
SPAN_WARNING("You start cutting the [src]..."),\
SPAN_NOTICE("You hear a loud buzzing sound and metal grinding on metal...")\
)
if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), W)))
if(do_after(user, ChainSawVar.opendelay SECONDS, user, DO_REPAIR_CONSTRUCT))
user.visible_message(\
SPAN_WARNING("[user.name] finishes cutting open \the [src] with the [W]."),\
SPAN_WARNING("You finish cutting open the [src]."),\
@@ -708,7 +708,7 @@
if (bar)
bar.update(i)
if(!do_after(escapee, 50, display_progress = FALSE)) //5 seconds
if(!do_after(escapee, 50, do_flags = DO_DEFAULT & ~DO_SHOW_PROGRESS)) //5 seconds
breakout = 0
qdel(bar)
return
@@ -179,7 +179,7 @@
if (timeneeded > 0)
user.visible_message("[user] starts hoisting \the [src] onto \the [table].", "You start hoisting \the [src] onto \the [table]. This will take about [timeneeded * 0.1] seconds.")
user.face_atom(src)
if (!do_after(user, timeneeded, needhand = TRUE, act_target = src))
if (!do_after(user, timeneeded, src))
return FALSE
else
forceMove(get_turf(table))
+1 -1
View File
@@ -86,7 +86,7 @@
if(!time_to_dig)
time_to_dig = 50
if(do_after(user, time_to_dig * mine_rate, act_target = src))
if(do_after(user, time_to_dig * mine_rate, src))
if(!src)
return
harvest()
@@ -265,7 +265,7 @@
SPAN_NOTICE("You start cutting \the [src] apart..."), \
SPAN_WARNING("You hear a loud buzzing sound and metal grinding on metal...") \
)
if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), W)))
if(do_after(user, ChainSawVar.opendelay SECONDS, user, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), W)))
user.visible_message(\
SPAN_DANGER("[user] finishes cutting \the [src] apart with the [W]."), \
SPAN_NOTICE("You finish cutting \the [src] apart."), \
@@ -198,7 +198,7 @@
if(!Adjacent(user)) // Cannot bring up dialogue and walk away.
return FALSE
user.visible_message(SPAN_WARNING("\The [user] starts to grab hold of \the [src] with destructive intent!"), SPAN_WARNING("You grab hold of \the [src] with destructive intent!"),)
if(!do_after(user, 5 SECONDS, act_target = src))
if(!do_after(user, 5 SECONDS, src))
return FALSE
user.visible_message(SPAN_WARNING("\The [user] rips \the [src] in a single, decisive motion!"), SPAN_WARNING("You \the [src] in a single, decisive motion!"))
playsound(src.loc, 'sound/items/poster_ripped.ogg', 100, 1)
@@ -226,7 +226,7 @@
..()
if(W.isFlameSource())
visible_message(SPAN_WARNING("\The [user] starts to burn \the [src] down!"))
if(!do_after(user, 2 SECONDS, act_target = src))
if(!do_after(user, 2 SECONDS, src))
return FALSE
visible_message(SPAN_WARNING("\The [user] burns \the [src] down!"))
playsound(src.loc, 'sound/items/cigs_lighters/zippo_on.ogg', 100, 1)
+1 -1
View File
@@ -41,7 +41,7 @@
return
M.last_special = world.time
M.visible_message(SPAN_WARNING("[M] starts struggling to break free of the sticky flesh..."), SPAN_WARNING("You struggle to break free from the gelatinous flesh..."), SPAN_WARNING("You hear squelching..."))
if(do_after(M, NEST_RESIST_TIME, TRUE))
if(do_after(M, NEST_RESIST_TIME))
unbuckle_buckled_mob(M)
/obj/structure/bed/nest/proc/unbuckle_buckled_mob(var/mob/buck)
+1 -1
View File
@@ -204,7 +204,7 @@
if(user)
playsound(src.loc, I.usesound, 50, 1)
user.visible_message("<b>[user]</b> starts taking apart the [src]...", SPAN_NOTICE("You start disassembling the [src]..."))
if (!do_after(user, 30, needhand = 0))
if (!do_after(user, 30, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
return
dismantle()
@@ -203,7 +203,7 @@
var/obj/item/grab/G = W
var/mob/living/affecting = G.affecting
user.visible_message("<span class='notice'>[user] attempts to buckle [affecting] into \the [src]!</span>")
if(do_after(user, 20))
if(do_after(user, 2 SECONDS, affecting, DO_UNIQUE))
affecting.forceMove(loc)
spawn(0)
if(buckle(affecting))
@@ -44,7 +44,7 @@
/obj/structure/bed/stool/chair/MouseDrop_T(mob/target, mob/user)
if(target == user && user.loc != loc && (reverse_dir[dir] & angle2dir(Get_Angle(src, user))))
user.visible_message("<b>[user]</b> starts climbing over the back of \the [src]...", SPAN_NOTICE("You start climbing over the back of \the [src]..."))
if(do_after(user, 2 SECONDS))
if(do_after(user, 2 SECONDS, DO_UNIQUE))
user.forceMove(loc)
return
return ..()
+3 -3
View File
@@ -32,7 +32,7 @@
if(!Adjacent(user) || use_check_and_message(user))
return
user.visible_message("<b>[user]</b> starts climbing into \the [src]...", SPAN_NOTICE("You start climbing into \the [src]..."))
if(do_after(user, 3 SECONDS))
if(do_after(user, 3 SECONDS, src, DO_UNIQUE))
user.visible_message("<b>[user]</b> climbs into \the [src], disappearing from sight.", SPAN_NOTICE("You climb into \the [src], finally finding a good spot to hide."))
user.forceMove(src)
hider = user
@@ -54,7 +54,7 @@
var/mob/living/carbon/human/H = user
if(H.a_intent == I_HURT)
H.visible_message("<b>[user]</b> starts taking \the [src] apart...", SPAN_NOTICE("You start taking \the [src] apart..."))
if(do_after(user, 2 MINUTES))
if(do_after(user, 2 MINUTES, src, DO_UNIQUE))
H.visible_message("<b>[user]</b> takes \the [src] apart.", SPAN_NOTICE("You takes \the [src] apart."))
for(var/i = 1 to 5)
var/obj/item/I = give_item()
@@ -66,7 +66,7 @@
if(hider)
to_chat(hider, SPAN_WARNING("[user] is searching the trash pile you're in!"))
//Do the searching
if(do_after(user, rand(4 SECONDS, 6 SECONDS)))
if(do_after(user, rand(4 SECONDS, 6 SECONDS), src, DO_UNIQUE))
var/unique_string = "[user.ckey]-[user.real_name]"
//If there was a hider, chance to reveal them
if(eject_hider(50, user))
@@ -28,7 +28,7 @@
/obj/structure/bed/stool/chair/remote/attackby(obj/item/W, mob/user)
if(portable_type && W.iswrench())
user.visible_message(SPAN_NOTICE("\The [user] starts dismantling \the [src]..."), SPAN_NOTICE("You start dismantling \the [src]..."))
if(do_after(user, 20 SECONDS, TRUE, src))
if(do_after(user, 20 SECONDS, src, DO_REPAIR_CONSTRUCT))
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
var/obj/kit = new portable_type(get_turf(src))
user.put_in_hands(kit)
+1 -1
View File
@@ -68,7 +68,7 @@
if(open && !swirlie)
user.visible_message(SPAN_DANGER("[user] starts to give [GM.name] a swirlie!"), SPAN_NOTICE("You start to give [GM.name] a swirlie!"))
swirlie = GM
if(do_after(user, 30, 5, 0))
if(do_after(user, 30, GM, do_flags = DO_UNIQUE))
user.visible_message(SPAN_DANGER("[user] gives [GM.name] a swirlie!"), SPAN_NOTICE("You give [GM.name] a swirlie!"), "You hear a toilet flushing.")
if(!GM.internal)
GM.adjustOxyLoss(5)