Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes some of the do afters working #3072

Merged
merged 10 commits into from
Jun 18, 2024
2 changes: 1 addition & 1 deletion code/datums/components/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
return
var/datum/progressbar/progress = new(M, len, I.loc)
var/list/rejections = list()
while(do_after(M, 10, TRUE, parent, FALSE, CALLBACK(src, PROC_REF(handle_mass_pickup), things, I.loc, rejections, progress)))
while(do_after(M, 10, parent, TRUE, FALSE, CALLBACK(src, PROC_REF(handle_mass_pickup), things, I.loc, rejections, progress)))
stoplag(1)
progress.end_progress()
to_chat(M, "<span class='notice'>You put everything you could [insert_preposition] [parent].</span>")
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
if(!welded && !operating && !(machine_stat & NOPOWER) && (!density || allow_hand_open(user)))
user.visible_message("[user] tries to open \the [src] manually.",
"You operate the manual lever on \the [src].")
if (!do_after(user, 30, TRUE, src))
if (!do_after(user, 30, src))
return FALSE
add_fingerprint(user)
if(density)
Expand Down Expand Up @@ -174,7 +174,7 @@
if(is_holding_pressure())
// tell the user that this is a bad idea, and have a do_after as well
to_chat(user, "<span class='warning'>As you begin crowbarring \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
if(!do_after(user, 20, TRUE, src)) // give them a few seconds to reconsider their decision.
if(!do_after(user, 20, src)) // give them a few seconds to reconsider their decision.
return
log_game("[key_name(user)] has opened a firelock with a pressure difference at [AREACOORD(loc)]")
user.log_message("has opened a firelock with a pressure difference at [AREACOORD(loc)]", LOG_ATTACK)
Expand Down
4 changes: 2 additions & 2 deletions code/game/mecha/equipment/mecha_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
chassis.use_power(energy_drain)
addtimer(CALLBACK(src, PROC_REF(set_ready_state), 1), equip_cooldown)

/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(atom/target, mob/user, interaction_key)
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(atom/target)
if(!chassis)
return
var/C = chassis.loc
set_ready_state(0)
chassis.use_power(energy_drain)
. = do_after(user, equip_cooldown, target=target, interaction_key = interaction_key)
. = do_after(chassis.occupant, equip_cooldown, target=target)
set_ready_state(1)
if(!chassis || chassis.loc != C || src != chassis.selected || !(get_dir(chassis, target)&chassis.dir))
return 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/anomalies/_anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
/obj/effect/anomaly/attackby(obj/item/weapon, mob/user, params)
if(weapon.tool_behaviour == TOOL_ANALYZER && aSignal)
to_chat(user, span_notice("You start analyzing [src]."))
if(do_after(user, 20, TRUE, src))
if(do_after(user, 20, src, hidden = TRUE))
to_chat(user, span_notice("[src]'s primary field is fluctuating along frequency [format_frequency(aSignal.frequency)], code [aSignal.code]."))
if(bSignal)
to_chat(user, span_notice("A second field is fluctuating along [format_frequency(bSignal.frequency)], code [bSignal.code]. It is highly unstable." ))
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/granters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/obj/item/book/granter/proc/turn_page(mob/user)
playsound(user, pick('sound/effects/pageturn1.ogg','sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg'), 30, TRUE)
if(do_after(user, 50, TRUE, src))
if(do_after(user, 50, src, hidden = TRUE))
if(remarks.len)
to_chat(user, "<span class='notice'>[pick(remarks)]</span>")
else
Expand Down Expand Up @@ -57,7 +57,7 @@
on_reading_stopped()
reading = FALSE
return
if(do_after(user, 50, TRUE, src))
if(do_after(user, 50, src, hidden = TRUE))
on_reading_finished(user)
reading = FALSE
return TRUE
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
return

to_chat(user, "<span class='notice'>You connect to [M]'s power line...</span>")
while(do_after(user, 15, target = M, progress = 0))
while(do_after(user, 15, target = M, progress = TRUE))
if(!user || !user.cell || mode != "draw")
return

Expand Down Expand Up @@ -210,7 +210,7 @@

to_chat(user, "<span class='notice'>You connect to [target]'s power port...</span>")

while(do_after(user, 15, target = target, progress = 0))
while(do_after(user, 15, target = target, progress = TRUE))
if(!user || !user.cell || mode != "draw")
return

Expand Down Expand Up @@ -248,7 +248,7 @@

to_chat(user, "<span class='notice'>You connect to [target]'s power port...</span>")

while(do_after(user, 15, target = target, progress = 0))
while(do_after(user, 15, target = target, progress = TRUE))
if(!user || !user.cell || mode != "charge")
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/survery_handheld.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
src_turf.visible_message("<span class='warning'>Warning: unable to locate valuable information in current sector.</span>")
break

if(!do_after(user, list(src), survey_delay / penalty))
if(!do_after(user, survey_delay / penalty, src))
flick(icon_state + "-corrupted", src)
playsound(src, 'sound/machines/buzz-sigh.ogg', 20)
src_turf.visible_message("<span class='warning'>Warning: results corrupted. Please try again.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/open/floor/plating/asteroid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
to_chat(user, "<span class='warning'>There is already a grave there!</span>")
return
to_chat(user, "<span class='notice'>You start piling the dirt...</span>")
if(do_after(user,30, target = src))
if(do_after(user, 30, target = src))
if(locate(/obj/structure/closet/crate/grave) in dest_turf)
return
if(istype(W, /obj/item/stack/sheet/mineral/wood))
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ GLOBAL_LIST_EMPTY(created_baseturf_lists)
return
if(length(src_object.contents()))
to_chat(usr, "<span class='notice'>You start dumping out the contents...</span>")
if(!do_after(usr,20,target=src_object.parent))
if(!do_after(usr, 20, target=src_object.parent))
return FALSE

var/list/things = src_object.contents()
var/datum/progressbar/progress = new(user, things.len, src)
while (do_after(usr, 10, TRUE, src, FALSE, CALLBACK(src_object, TYPE_PROC_REF(/datum/component/storage, mass_remove_from_storage), src, things, progress)))
while (do_after(usr, 10, src, TRUE, FALSE, CALLBACK(src_object, TYPE_PROC_REF(/datum/component/storage, mass_remove_from_storage), src, things, progress)))
stoplag(1)
progress.end_progress()

Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/changeling/powers/linglink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
to_chat(user, "<span class='notice'>We must keep holding on to [target] to sustain the link. </span>")
while(user.pulling && user.grab_state >= GRAB_NECK)
target.reagents.add_reagent(/datum/reagent/medicine/salbutamol, 0.5) // So they don't choke to death while you interrogate them
do_after(user, 10 SECONDS, target, TRUE)
do_after(user, 10 SECONDS, target, hidden = TRUE)

changeling.islinking = 0
target.mind.linglink = 0
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
if(istype(I, /obj/item/nuke_core_container))
var/obj/item/nuke_core_container/core_box = I
to_chat(user, "<span class='notice'>You start loading the plutonium core into [core_box]...</span>")
if(do_after(user,50,target=src, hidden = TRUE))
if(do_after(user, 50, target = src, hidden = TRUE))
if(core_box.load(core, user))
to_chat(user, "<span class='notice'>You load the plutonium core into [core_box].</span>")
deconstruction_state = NUKESTATE_CORE_REMOVED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
close_machine(target)
else
user.visible_message("<span class='notice'>[user] starts shoving [target] inside [src].</span>", "<span class='notice'>You start shoving [target] inside [src].</span>")
if (do_after(user, 25, target=target))
if (do_after(user, 25, target = target))
close_machine(target)

/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/hardsuit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
if(L.status)
to_chat(user, "<span class='warning'>This bulb is too damaged to use as a replacement!</span>")
return
if(do_after(user, 50, 1, src))
if(do_after(user, 50, src))
qdel(I)
helmet = new helmettype(src)
to_chat(user, "<span class='notice'>You have successfully repaired [src]'s helmet.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mining/drill.dm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
/obj/machinery/drill/AltClick(mob/user)
if(active)
to_chat(user, "<span class='notice'>You begin the manual shutoff process.</span>")
if(do_after(user,10))
if(do_after(user, 10, src))
active = FALSE
soundloop.stop()
deltimer(current_timerid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
var/static/mutable_appearance/overcharge //shameless copycode from lightning spell
overcharge = overcharge || mutable_appearance('icons/effects/effects.dmi', "electricity", EFFECTS_LAYER)
_human.add_overlay(overcharge)
if(do_after(_human, 50, _human, 1))
if(do_after(_human, 50, _human, TRUE))
_human.flash_lighting_fx(5, 7, current_color)
var/obj/item/organ/stomach/ethereal/stomach = _human.getorganslot(ORGAN_SLOT_STOMACH)
playsound(_human, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@

H.notransform = TRUE

if(do_after(owner, delay=60, target=owner, progress=TRUE, timed_action_flags = IGNORE_HELD_ITEM))
if(do_after(owner, delay = 60, target = owner, progress = TRUE, timed_action_flags = IGNORE_HELD_ITEM))
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
make_dupe()
else
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species_types/spider.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ GLOBAL_LIST_INIT(spider_last, world.file2list("strings/names/spider_last.txt"))
var/nutrition_threshold = NUTRITION_LEVEL_FED
if (H.nutrition >= nutrition_threshold)
to_chat(H, "<i>You begin spinning some web...</i>")
if(!do_after(H, 10 SECONDS, 1, T))
if(!do_after(H, 10 SECONDS, T, hidden = TRUE))
to_chat(H, "<span class='warning'>Your web spinning was interrupted!</span>")
return
if(prob(75))
Expand Down Expand Up @@ -208,7 +208,7 @@ GLOBAL_LIST_INIT(spider_last, world.file2list("strings/names/spider_last.txt"))
to_chat(H, "<span class='warning'>You cannot wrap this.</span>")
return
H.visible_message("<span class='danger'>[H] starts to wrap [A] into a cocoon!</span>","<span class='warning'>You start to wrap [A] into a cocoon.</span>")
if(!do_after(H, 10 SECONDS, 1, A))
if(!do_after(H, 10 SECONDS, A, hidden = TRUE))
to_chat(H, "<span class='warning'>Your web spinning was interrupted!</span>")
return
H.adjust_nutrition(E.spinner_rate * -3.5)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/pai/pai_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
user.do_attack_animation(src)
if (user.name == master)
visible_message("<span class='notice'>Responding to its master's touch, [src] disengages its holochassis emitter, rapidly losing coherence.</span>")
if(do_after(user, 1 SECONDS, TRUE, src))
if(do_after(user, 1 SECONDS, src, hidden = TRUE))
fold_in()
if(user.put_in_hands(card))
user.visible_message("<span class='notice'>[user] promptly scoops up [user.p_their()] pAI's card.</span>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if("Cannibalize")
if(D.health < D.maxHealth)
D.visible_message("<span class='notice'>[D] begins to cannibalize parts from [src].</span>", "<span class='notice'>You begin to cannibalize parts from [src]...</span>")
if(do_after(D, 60, 0, target = src))
if(do_after(D, 60, src, FALSE))
D.visible_message("<span class='notice'>[D] repairs itself using [src]'s remains!</span>", "<span class='notice'>You repair yourself using [src]'s remains.</span>")
D.adjustBruteLoss(-src.maxHealth)
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/friendly/mouse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ GLOBAL_VAR_INIT(mouse_killed, 0)
visible_message(
"<span class='danger'>[src] starts eating away [A]...</span>",
"<span class='notice'>You start eating the [A]...</span>")
if(do_after(src, 30, FALSE, A))
if(do_after(src, 30, A, hidden = TRUE))
if(QDELETED(A))
return
visible_message(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@

/mob/living/simple_animal/hostile/asteroid/goliath/beast/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/saddle) && !saddled)
if(tame && do_after(user,55,target=src))
if(tame && do_after(user, 55, target=src))
user.visible_message("<span class='notice'>You manage to put [O] on [src], you can now ride [p_them()].</span>")
qdel(O)
saddled = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/modules/ninja/suit/ninjaDrainAct.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ They *could* go in their appropriate files, but this is supposed to be modular
drain = S.cell.maxcharge - S.cell.charge
maxcapacity = 1

if (do_after(H,10, target = src, hidden = TRUE))
if (do_after(H, 10, target = src, hidden = TRUE))
spark_system.start()
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
charge -= drain
Expand Down Expand Up @@ -235,7 +235,7 @@ They *could* go in their appropriate files, but this is supposed to be modular
if(S.cell.charge+drain > S.cell.maxcharge)
drain = S.cell.maxcharge - S.cell.charge
maxcapacity = 1
if (do_after(H,10, hidden = TRUE))
if (do_after(H, 10, hidden = TRUE))
spark_system.start()
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
cell.use(drain)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/ninja/suit/suit_attackby.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
var/obj/item/stock_parts/cell/CELL = I
if(CELL.maxcharge > cell.maxcharge && n_gloves && n_gloves.candrain)
to_chat(U, "<span class='notice'>Higher maximum capacity detected.\nUpgrading...</span>")
if (n_gloves && n_gloves.candrain && do_after(U,s_delay, target = src))
if (n_gloves && n_gloves.candrain && do_after(U, s_delay, target = src))
U.transferItemToLoc(CELL, src)
CELL.charge = min(CELL.charge+cell.charge, CELL.maxcharge)
var/obj/item/stock_parts/cell/old_cell = cell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
if(istype(attacking_obj, /obj/item/ammo_box))
var/obj/item/ammo_box/attacking_box = attacking_obj
for(var/obj/item/ammo_casing/casing_to_insert in attacking_box.stored_ammo)
if(!((instant_load && attacking_box.instant_load) || (stored_ammo.len >= max_ammo) || do_after(user, 1 SECONDS, list(attacking_box))))
if(!((instant_load && attacking_box.instant_load) || (stored_ammo.len >= max_ammo) || do_after(user, 1 SECONDS, attacking_box)))
break
var/did_load = give_round(casing_to_insert, replace_spent)
if(!did_load)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
var/list/ammo_list_no_empty = ammo_list(FALSE)
listclearnulls(ammo_list_no_empty)
for(var/obj/item/ammo_casing/casing_to_insert in attacking_box.stored_ammo)
if(!((instant_load && attacking_box.instant_load) || (ammo_list_no_empty.len >= max_ammo) || do_after(user, 1 SECONDS, list(attacking_box)))) //stupid work around for revolvers
if(!((instant_load && attacking_box.instant_load) || (ammo_list_no_empty.len >= max_ammo) || do_after(user, 1 SECONDS, attacking_box))) //stupid work around for revolvers
break
var/did_load = give_round(casing_to_insert, replace_spent)
if(!did_load)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
update_appearance()
SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD)
if (tac_load)
if(do_after(user, tactical_reload_delay, TRUE, src))
if(do_after(user, tactical_reload_delay, src, hidden = TRUE))
if (insert_magazine(user, tac_load, FALSE))
to_chat(user, "<span class='notice'>You perform a tactical reload on \the [src].</span>")
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/ballistic/hmg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
if(!can_deploy)
to_chat(user, "<span class='warning'>You need to brace against something to deploy [src]'s bipod! Either lie on the floor or stand next to a waist high object like a table!</span>")
return
if(!do_after(user, deploy_time, src, FALSE, TRUE, CALLBACK(src, PROC_REF(is_wielded))))
if(!do_after(user, deploy_time, src, NONE, TRUE, CALLBACK(src, PROC_REF(is_wielded))))
to_chat(user, "<span class='warning'>You need to hold still to deploy [src]'s bipod!</span>")
return
playsound(src, 'sound/machines/click.ogg', 75, TRUE)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
to_chat(user, "<span class='notice'>You pull the cell out of \the [src].</span>")
update_appearance()
if(tac_load && tac_reloads)
if(do_after(user, tactical_reload_delay, TRUE, src))
if(do_after(user, tactical_reload_delay, src, hidden = TRUE))
if(insert_cell(user, tac_load))
to_chat(user, "<span class='notice'>You perform a tactical reload on \the [src].</span>")
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/vehicles/secway.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
if(istype(W, /obj/item/reagent_containers/food/snacks/grown/banana))
// ignore the occupants because they're presumably too distracted to notice the guy stuffing fruit into their vehicle's exhaust. do segways have exhausts? they do now!
user.visible_message("<span class='warning'>[user] begins stuffing [W] into [src]'s tailpipe.</span>", "<span class='warning'>You begin stuffing [W] into [src]'s tailpipe...</span>", ignored_mobs = occupants)
if(do_after(user, 30, TRUE, src))
if(do_after(user, 30, src))
if(user.transferItemToLoc(W, src))
user.visible_message("<span class='warning'>[user] stuffs [W] into [src]'s tailpipe.</span>", "<span class='warning'>You stuff [W] into [src]'s tailpipe.</span>", ignored_mobs = occupants)
eddie_murphy = W
Expand Down
Loading