mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +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
@@ -134,7 +134,7 @@
|
||||
to_chat(user, span_notice("[src] already has a power cell."))
|
||||
else
|
||||
user.visible_message("[user] is reloading [src].", span_notice("You start to insert [P] into [src]."))
|
||||
if(do_after(user, reload_time * P.w_class))
|
||||
if(do_after(user, reload_time * P.w_class, target = src))
|
||||
user.remove_from_mob(P)
|
||||
power_supply = P
|
||||
P.loc = src
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
if(istype(A, /obj/item/tool/screwdriver))
|
||||
if(safetycatch && attached_safety)
|
||||
to_chat(user, span_notice("You begin removing \the [attached_safety] from \the [src]."))
|
||||
if(do_after(user, 25))
|
||||
if(do_after(user, 25, target = src))
|
||||
to_chat(user, span_notice("You remove \the [attached_safety] from \the [src]."))
|
||||
user.put_in_hands(attached_safety)
|
||||
safetycatch = 0
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
user.visible_message(span_notice("[user] opens \the [src] and starts pumping the handle."), \
|
||||
span_notice("You open \the [src] and start pumping the handle."))
|
||||
while(recharging)
|
||||
if(!do_after(user, 10, src))
|
||||
if(!do_after(user, 1 SECOND, target = src))
|
||||
break
|
||||
playsound(src,'sound/items/change_drill.ogg',25,1)
|
||||
user.hud_used.update_ammo_hud(user, src)
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
user.visible_message(span_cult("[user] aims \the [src] at \the [A]."))
|
||||
if(power_supply && power_supply.charge >= charge_cost) //Do a delay for pointblanking too.
|
||||
power_cycle = TRUE
|
||||
if(do_after(user, 30))
|
||||
if(do_after(user, 3 SECONDS, target = src))
|
||||
if(A.loc == target_turf)
|
||||
..(A, user, def_zone)
|
||||
else
|
||||
@@ -321,7 +321,7 @@
|
||||
|
||||
if(!power_cycle)
|
||||
power_cycle = TRUE
|
||||
if(do_after(user, 30))
|
||||
if(do_after(user, 3 SECONDS, target = src))
|
||||
if(A.loc == target_turf)
|
||||
..(A, user, adjacent, params)
|
||||
else
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
update_icon()
|
||||
user.visible_message(span_notice("[user] starts charging the [src]!"), \
|
||||
span_notice("You start charging the [src]!"))
|
||||
if(do_after(user, 8, src))
|
||||
if(do_after(user, 8, target = src))
|
||||
spinning_up = FALSE
|
||||
..()
|
||||
else
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
current_user = user
|
||||
user.visible_message(span_infoplain(span_bold("[user]") + " begins to draw back the string of [src]."),span_notice("You begin to draw back the string of [src]."))
|
||||
if(do_after(user, 25, src))
|
||||
if(do_after(user, 25, target = src))
|
||||
drawn = TRUE
|
||||
user.visible_message(span_infoplain(span_bold("[user]") + "draws the string on [src] back fully!"), span_infoplain("You draw the string on [src] back fully!"))
|
||||
update_icon()
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
tension = 1
|
||||
|
||||
while(bolt && tension && loc == current_user)
|
||||
if(!do_after(user, 25)) //crossbow strings don't just magically pull back on their own.
|
||||
if(!do_after(user, 25, target = src)) //crossbow strings don't just magically pull back on their own.
|
||||
user.visible_message("[user] stops drawing and relaxes the string of [src].",span_warning("You stop drawing back and relax the string of [src]."))
|
||||
tension = 0
|
||||
update_icon()
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
to_chat(user, span_warning("\The [src] cannot hold more [ammo_material]."))
|
||||
return
|
||||
loading = TRUE
|
||||
while(mat_storage + SHEET_MATERIAL_AMOUNT <= max_mat_storage && do_after(user,1.5 SECONDS))
|
||||
while(mat_storage + SHEET_MATERIAL_AMOUNT <= max_mat_storage && do_after(user,1.5 SECONDS, target = src))
|
||||
mat_storage += SHEET_MATERIAL_AMOUNT
|
||||
playsound(src, 'sound/effects/phasein.ogg', 15, 1)
|
||||
M.use(1)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
to_chat(user, span_notice("[src] already has a power cell."))
|
||||
else
|
||||
user.visible_message("[user] is reloading [src].", span_notice("You start to insert [P] into [src]."))
|
||||
if(do_after(user, 10))
|
||||
if(do_after(user, 1 SECOND, target = src))
|
||||
user.remove_from_mob(P)
|
||||
power_supply = P
|
||||
P.loc = src
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
if(ammo_magazine)
|
||||
to_chat(user, span_warning("[src] already has a magazine loaded.")) //already a magazine here
|
||||
return
|
||||
if(do_after(user, reload_time * AM.w_class))
|
||||
if(do_after(user, reload_time * AM.w_class, target = src))
|
||||
user.remove_from_mob(AM)
|
||||
AM.loc = src
|
||||
ammo_magazine = AM
|
||||
@@ -148,7 +148,7 @@
|
||||
AM.stored_ammo -= C //should probably go inside an ammo_magazine proc, but I guess less proc calls this way...
|
||||
count++
|
||||
user.hud_used.update_ammo_hud(user, src)
|
||||
if(do_after(user, reload_time * AM.w_class))
|
||||
if(do_after(user, reload_time * AM.w_class, target = src))
|
||||
if(count)
|
||||
user.visible_message("[user] reloads [src].", span_notice("You load [count] round\s into [src]."))
|
||||
user.hud_used.update_ammo_hud(user, src)
|
||||
@@ -162,7 +162,7 @@
|
||||
to_chat(user, span_warning("[src] is full."))
|
||||
return
|
||||
|
||||
if(do_after(user, reload_time * C.w_class))
|
||||
if(do_after(user, reload_time * C.w_class, target = src))
|
||||
user.remove_from_mob(C)
|
||||
C.loc = src
|
||||
loaded.Insert(1, C) //add to the head of the list
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
playsound(src, fire_sound, 50, 1)
|
||||
user.visible_message(span_danger("[src] goes off!"), span_danger("The rifle goes off in your face!"))
|
||||
return
|
||||
if(do_after(user, 30))
|
||||
if(do_after(user, 3 SECONDS, target = src))
|
||||
if(sawn_off)
|
||||
return
|
||||
icon_state = "sawn_rifle"
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port
|
||||
burst = burstsetting
|
||||
return
|
||||
if(do_after(user, 30)) // SHIT IS STEALTHY EYYYYY
|
||||
if(do_after(user, 3 SECONDS, target = src)) // SHIT IS STEALTHY EYYYYY
|
||||
if(sawn_off)
|
||||
return
|
||||
if(unique_reskin)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/obj/item/gun/projectile/heavysniper/proc/collapse_rifle(mob/user)
|
||||
to_chat(user, span_warning("You begin removing \the [src]'s barrel."))
|
||||
if(do_after(user, 40))
|
||||
if(do_after(user, 4 SECONDS, target = src))
|
||||
if(user.unEquip(src, force=1))
|
||||
to_chat(user, span_warning("You remove \the [src]'s barrel."))
|
||||
qdel(src)
|
||||
@@ -75,7 +75,7 @@
|
||||
return
|
||||
|
||||
to_chat(user, span_notice("You start disassembling \the [src]."))
|
||||
if(!do_after(user, 40))
|
||||
if(!do_after(user, 4 SECONDS, target = src))
|
||||
return
|
||||
|
||||
to_chat(user, span_notice("You disassemble \the [src]."))
|
||||
@@ -95,7 +95,7 @@
|
||||
/obj/item/sniper_rifle_part/attackby(var/obj/item/sniper_rifle_part/A as obj, mob/user as mob)
|
||||
|
||||
to_chat(user, span_notice("You begin adding \the [A] to \the [src]."))
|
||||
if(!do_after(user, 30))
|
||||
if(!do_after(user, 3 SECONDS, target = src))
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user