mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 21:49:11 +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:
co-authored by
Kashargul
parent
736fe6ef28
commit
d73f6b8dbd
@@ -132,7 +132,7 @@
|
||||
to_chat(user, span_warning("You need one coil of wire to wire [src]."))
|
||||
return
|
||||
to_chat(user, span_notice("You start to wire [src]."))
|
||||
if(do_after(user, 40) && build_step == 6)
|
||||
if(do_after(user, 4 SECONDS, target = src) && build_step == 6)
|
||||
if(C.use(1))
|
||||
build_step++
|
||||
to_chat(user, span_notice("You wire the ED-209 assembly."))
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
else if(O.has_tool_quality(TOOL_CROWBAR))
|
||||
if(open && paicard)
|
||||
to_chat(user, span_notice("You are attempting to remove the pAI.."))
|
||||
if(do_after(user,10 * O.toolspeed))
|
||||
if(do_after(user, 1 SECOND * O.toolspeed, target = src))
|
||||
ejectpai(user)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
cleantime = istype(D, /obj/effect/decal/cleanable/dirt) ? 10 : 50
|
||||
if(prob(20))
|
||||
automatic_custom_emote(AUDIBLE_MESSAGE, "begins to clean up \the [D]")
|
||||
if(do_after(src, cleantime * cTimeMult))
|
||||
if(do_after(src, cleantime * cTimeMult, target = D))
|
||||
if(istype(loc, /turf/simulated))
|
||||
var/turf/simulated/f = loc
|
||||
f.dirt = 0
|
||||
@@ -138,7 +138,7 @@
|
||||
if(cleantime != 0)
|
||||
if(prob(20))
|
||||
automatic_custom_emote(AUDIBLE_MESSAGE, "begins to clean up \the [loc]")
|
||||
if(do_after(src, cleantime * cTimeMult))
|
||||
if(do_after(src, cleantime * cTimeMult, target = loc))
|
||||
if(blood)
|
||||
wash(CLEAN_TYPE_BLOOD)
|
||||
if(istype(loc, /turf/simulated))
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
to_chat(user, span_warning("You need one coil of wire to wire [src]."))
|
||||
return
|
||||
to_chat(user, span_notice("You start to wire [src]."))
|
||||
if(do_after(user, 40) && build_step == 6)
|
||||
if(do_after(user, 4 SECONDS, target = src) && build_step == 6)
|
||||
if(C.use(1))
|
||||
build_step++
|
||||
to_chat(user, span_notice("You wire the ED-209 assembly."))
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
to_chat(user, span_warning("You need one coil of wire to wire \the [src]."))
|
||||
return
|
||||
to_chat(user, span_notice("You start to wire \the [src]."))
|
||||
if(do_after(user, 40))
|
||||
if(do_after(user, 4 SECONDS, target = src))
|
||||
if(C.use(1))
|
||||
build_step++
|
||||
to_chat(user, span_notice("You wire the ED-CLN assembly."))
|
||||
@@ -198,7 +198,7 @@
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
to_chat(user, span_notice("Attatching the mop to the frame..."))
|
||||
if(do_after(user, 40) && get_turf(user) == T)
|
||||
if(do_after(user, 4 SECONDS, target = src) && get_turf(user) == T)
|
||||
build_step++
|
||||
name = "mopped ED-CLN assembly"
|
||||
to_chat(user, span_notice("Mop attached."))
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
visible_message(span_notice("[src] starts [T.dead? "removing the plant from" : "harvesting"] \the [A]."))
|
||||
|
||||
busy = 1
|
||||
if(do_after(src, 30, A))
|
||||
if(do_after(src, 3 SECONDS, target = A))
|
||||
visible_message(span_notice("[src] [T.dead? "removes the plant from" : "harvests"] \the [A]."))
|
||||
T.attack_hand(src)
|
||||
if(FARMBOT_WATER)
|
||||
@@ -201,7 +201,7 @@
|
||||
visible_message(span_notice("[src] starts watering \the [A]."))
|
||||
|
||||
busy = 1
|
||||
if(do_after(src, 30, A))
|
||||
if(do_after(src, 3 SECONDS, target = A))
|
||||
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
|
||||
visible_message(span_notice("[src] waters \the [A]."))
|
||||
tank.reagents.trans_to(T, 100 - T.waterlevel)
|
||||
@@ -211,7 +211,7 @@
|
||||
visible_message(span_notice("[src] starts uprooting the weeds in \the [A]."))
|
||||
|
||||
busy = 1
|
||||
if(do_after(src, 30))
|
||||
if(do_after(src, 3 SECONDS, target = A))
|
||||
visible_message(span_notice("[src] uproots the weeds in \the [A]."))
|
||||
T.weedlevel = 0
|
||||
if(FARMBOT_NUTRIMENT)
|
||||
@@ -220,7 +220,7 @@
|
||||
visible_message(span_notice("[src] starts fertilizing \the [A]."))
|
||||
|
||||
busy = 1
|
||||
if(do_after(src, 30, A))
|
||||
if(do_after(src, 3 SECONDS, target = A))
|
||||
|
||||
visible_message(span_notice("[src] fertilizes \the [A]."))
|
||||
T.reagents.add_reagent(REAGENT_ID_AMMONIA, 10)
|
||||
@@ -237,7 +237,7 @@
|
||||
visible_message(span_notice("[src] starts refilling its tank from \the [A]."))
|
||||
|
||||
busy = 1
|
||||
while(do_after(src, 10) && tank.reagents.total_volume < tank.reagents.maximum_volume)
|
||||
while(do_after(src, 1 SECOND, target = A) && tank.reagents.total_volume < tank.reagents.maximum_volume)
|
||||
tank.reagents.add_reagent("water", 100) //VOREStation Edit
|
||||
if(prob(5))
|
||||
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
|
||||
|
||||
@@ -209,12 +209,12 @@
|
||||
update_icons()
|
||||
if(F.flooring)
|
||||
visible_message(span_warning("\The [src] begins to tear the floor tile from the floor!"))
|
||||
if(do_after(src, 50))
|
||||
if(do_after(src, 5 SECONDS, target = A))
|
||||
F.break_tile_to_plating()
|
||||
addTiles(1)
|
||||
else
|
||||
visible_message(span_danger("\The [src] begins to tear through the floor!"))
|
||||
if(do_after(src, 150)) // Extra time because this can and will kill.
|
||||
if(do_after(src, 15 SECONDS, target = A)) // Extra time because this can and will kill.
|
||||
F.ReplaceWithLattice()
|
||||
addTiles(1)
|
||||
target = null
|
||||
@@ -229,7 +229,7 @@
|
||||
busy = 1
|
||||
update_icons()
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " begins to repair the hole."))
|
||||
if(do_after(src, 50))
|
||||
if(do_after(src, 5 SECONDS, target = A))
|
||||
if(A && (locate(/obj/structure/lattice, A) && building == 1 || !locate(/obj/structure/lattice, A) && building == 2)) // Make sure that it still needs repairs
|
||||
var/obj/item/I
|
||||
if(building == 1)
|
||||
@@ -246,7 +246,7 @@
|
||||
busy = 1
|
||||
update_icons()
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " begins to remove the broken floor."))
|
||||
if(do_after(src, 50, F))
|
||||
if(do_after(src, 5 SECONDS, target = F))
|
||||
if(F.broken || F.burnt)
|
||||
F.make_plating()
|
||||
target = null
|
||||
@@ -256,7 +256,7 @@
|
||||
busy = 1
|
||||
update_icons()
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " begins to improve the floor."))
|
||||
if(do_after(src, 50))
|
||||
if(do_after(src, 5 SECONDS, target = F))
|
||||
if(!F.flooring)
|
||||
F.set_flooring(get_flooring_data(floor_build_type))
|
||||
addTiles(-1)
|
||||
@@ -268,7 +268,7 @@
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " begins to collect tiles."))
|
||||
busy = 1
|
||||
update_icons()
|
||||
if(do_after(src, 20))
|
||||
if(do_after(src, 2 SECONDS, target = T))
|
||||
if(T)
|
||||
var/eaten = min(maxAmount - amount, T.get_amount())
|
||||
T.use(eaten)
|
||||
@@ -282,7 +282,7 @@
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " begins to make tiles."))
|
||||
busy = 1
|
||||
update_icons()
|
||||
if(do_after(50))
|
||||
if(do_after(src, 5 SECONDS, target = A))
|
||||
if(M)
|
||||
M.use(1)
|
||||
addTiles(4)
|
||||
|
||||
@@ -206,12 +206,12 @@
|
||||
say(message)
|
||||
playsound(src, messagevoice[message], 70, FALSE)
|
||||
|
||||
if(do_after(H, 3 SECONDS, target=src))
|
||||
if(do_after(H, 3 SECONDS, target = src))
|
||||
tip_over(H)
|
||||
|
||||
else if(istype(H) && H.a_intent == I_HELP && is_tipped)
|
||||
H.visible_message(span_notice("[H] begins righting [src]."), span_notice("You begin righting [src]..."))
|
||||
if(do_after(H, 3 SECONDS, target=src))
|
||||
if(do_after(H, 3 SECONDS, target = src))
|
||||
set_right(H)
|
||||
else
|
||||
tgui_interact(H)
|
||||
|
||||
Reference in New Issue
Block a user