mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 10:34:10 +01:00
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:
@@ -99,7 +99,7 @@
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, span_notice("You begin to [anchored ? "un" : ""]fasten \the [src]."))
|
||||
if (do_after(user, 20 * W.toolspeed))
|
||||
if (do_after(user, 2 SECONDS * W.toolspeed, target = src))
|
||||
user.visible_message(
|
||||
span_notice("\The [user] [anchored ? "un" : ""]fastens \the [src]."),
|
||||
span_notice("You have [anchored ? "un" : ""]fastened \the [src]."),
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
/obj/structure/reagent_dispensers/fueltank/attack_hand(mob/user)
|
||||
if (rig)
|
||||
user.visible_message("[user] begins to detach [rig] from \the [src].", "You begin to detach [rig] from \the [src]")
|
||||
if(do_after(user, 20))
|
||||
if(do_after(user, 2 SECONDS, target = src))
|
||||
user.visible_message(span_notice("[user] detaches [rig] from \the [src]."), span_notice("You detach [rig] from \the [src]"))
|
||||
rig.loc = get_turf(user)
|
||||
rig = null
|
||||
@@ -224,7 +224,7 @@
|
||||
to_chat(user, span_warning("There is another device in the way."))
|
||||
return ..()
|
||||
user.visible_message("[user] begins rigging [W] to \the [src].", "You begin rigging [W] to \the [src]")
|
||||
if(do_after(user, 20))
|
||||
if(do_after(user, 2 SECONDS, target = src))
|
||||
user.visible_message(span_notice("[user] rigs [W] to \the [src]."), span_notice("You rig [W] to \the [src]"))
|
||||
|
||||
var/obj/item/assembly_holder/H = W
|
||||
@@ -384,7 +384,7 @@
|
||||
src.add_fingerprint(user)
|
||||
if(bottle)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
if(do_after(user, 20) && bottle)
|
||||
if(do_after(user, 2 SECONDS, target = src) && bottle)
|
||||
to_chat(user, span_notice("You unfasten the jug."))
|
||||
var/obj/item/reagent_containers/glass/cooler_bottle/G = new /obj/item/reagent_containers/glass/cooler_bottle( src.loc )
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
@@ -398,7 +398,7 @@
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
else
|
||||
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
|
||||
if(do_after(user, 20 * I.toolspeed, src))
|
||||
if(do_after(user, 2 SECONDS * I.toolspeed, target = src))
|
||||
if(!src) return
|
||||
to_chat(user, span_notice("You [anchored? "un" : ""]secured \the [src]!"))
|
||||
anchored = !anchored
|
||||
@@ -420,7 +420,7 @@
|
||||
if(!bottle && !cupholder)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
to_chat(user, span_notice("You start taking the water-cooler apart."))
|
||||
if(do_after(user, 20 * I.toolspeed) && !bottle && !cupholder)
|
||||
if(do_after(user, 2 SECONDS * I.toolspeed, target = src) && !bottle && !cupholder)
|
||||
to_chat(user, span_notice("You take the water-cooler apart."))
|
||||
new /obj/item/stack/material/plastic( src.loc, 4 )
|
||||
qdel(src)
|
||||
@@ -432,7 +432,7 @@
|
||||
if(anchored)
|
||||
var/obj/item/reagent_containers/glass/cooler_bottle/G = I
|
||||
to_chat(user, span_notice("You start to screw the bottle onto the water-cooler."))
|
||||
if(do_after(user, 20) && !bottle && anchored)
|
||||
if(do_after(user, 2 SECONDS, target = src) && !bottle && anchored)
|
||||
bottle = 1
|
||||
update_icon()
|
||||
to_chat(user, span_notice("You screw the bottle onto the water-cooler!"))
|
||||
@@ -453,7 +453,7 @@
|
||||
src.add_fingerprint(user)
|
||||
to_chat(user, span_notice("You start to attach a cup dispenser onto the water-cooler."))
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20) && !cupholder && anchored)
|
||||
if(do_after(user, 2 SECONDS, target = src) && !cupholder && anchored)
|
||||
if (P.use(1))
|
||||
to_chat(user, span_notice("You attach a cup dispenser onto the water-cooler."))
|
||||
cupholder = 1
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if(H != user && prototype)
|
||||
balloon_alert(user, "injecting [H] with \the [src]")
|
||||
balloon_alert(H, "[user] is trying to inject you with \the [src]")
|
||||
if(!do_after(user, 30, H))
|
||||
if(!do_after(user, 3 SECONDS, target = H))
|
||||
return
|
||||
//VOREstation Add End
|
||||
else if(!H.stat && !prototype)
|
||||
@@ -64,7 +64,7 @@
|
||||
if(H.a_intent != I_HELP)
|
||||
balloon_alert(user, "[H] resists your attempt to inject them with \the [src].")
|
||||
balloon_alert(H, "[user] is trying to inject you with \the [src]")
|
||||
if(!do_after(user, 30, H))
|
||||
if(!do_after(user, 3 SECONDS, target = H))
|
||||
return
|
||||
|
||||
do_injection(H, user)
|
||||
@@ -132,7 +132,7 @@
|
||||
if(istype(W, /obj/item/reagent_containers/glass/beaker/vial))
|
||||
if(!loaded_vial)
|
||||
balloon_alert_visible("[user] begins loading [W] into \the [src].", "loading [W] into \the [src].")
|
||||
if(!do_after(user,30) || loaded_vial || !(W in user))
|
||||
if(!do_after(user, 3 SECONDS, target = src) || loaded_vial || !(W in user))
|
||||
return 0
|
||||
if(W.is_open_container())
|
||||
W.flags ^= OPENCONTAINER
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
|
||||
//The warmup
|
||||
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
|
||||
if(!do_after(user,warmup_time,target))
|
||||
if(!do_after(user, warmup_time, target))
|
||||
return
|
||||
|
||||
var/trans = 0
|
||||
@@ -246,7 +246,7 @@
|
||||
while(reagents.total_volume)
|
||||
trans += reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
|
||||
update_icon()
|
||||
if(!reagents.total_volume || !do_after(user,cycle_time,target))
|
||||
if(!reagents.total_volume || !do_after(user, cycle_time, target))
|
||||
break
|
||||
else
|
||||
trans += reagents.trans_to_obj(target, amount_per_transfer_from_this)
|
||||
|
||||
Reference in New Issue
Block a user