mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] Makes uses of do_after sane (#11582)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2c34c93e00
commit
1b8f394a14
@@ -64,7 +64,7 @@
|
||||
if(box.caliber == bullet.caliber && bullet.BB)
|
||||
if (boolets < 1)
|
||||
to_chat(user, span_notice("You start collecting shells.")) // Say it here so it doesn't get said if we don't find anything useful.
|
||||
if(do_after(user,5,box))
|
||||
if(do_after(user, 5, target = box))
|
||||
if(box.stored_ammo.len >= box.max_ammo) // Double check because these can change during the wait.
|
||||
break
|
||||
if(bullet.loc != floor)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
return
|
||||
else
|
||||
to_chat(user, "You begin inserting \the [I] into \the [src].")
|
||||
if(do_after(user, 25))
|
||||
if(do_after(user, 25, target = src))
|
||||
user.drop_item()
|
||||
I.forceMove(src)
|
||||
attached_cell = I
|
||||
@@ -90,7 +90,7 @@
|
||||
else if(I.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
if(attached_cell)
|
||||
to_chat(user, "You begin removing \the [attached_cell] from \the [src].")
|
||||
if(do_after(user, 10)) // Faster than doing it by hand
|
||||
if(do_after(user, 1 SECOND, target = src)) // Faster than doing it by hand
|
||||
attached_cell.update_icon()
|
||||
attached_cell.forceMove(get_turf(src.loc))
|
||||
attached_cell = null
|
||||
@@ -113,7 +113,7 @@
|
||||
if(user.get_inactive_hand() == src)
|
||||
if(attached_cell)
|
||||
to_chat(user, "You struggle to remove \the [attached_cell] from \the [src].")
|
||||
if(do_after(user, 40))
|
||||
if(do_after(user, 4 SECONDS, target = src))
|
||||
attached_cell.update_icon()
|
||||
user.put_in_hands(attached_cell)
|
||||
attached_cell = null
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if(get_dist(get_turf(user),get_turf(src)) <= 1)
|
||||
to_chat(user, span_notice("You begin inspecting \the [src]."))
|
||||
|
||||
if(do_after(user, 5 SECONDS))
|
||||
if(do_after(user, 5 SECONDS, target = src))
|
||||
to_chat(user, span_notice("\The [src] can possibly be restored with:"))
|
||||
for(var/obj/item/res as anything in material_needs)
|
||||
if(material_needs[res] > 0)
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
/obj/item/broken_gun/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(can_repair_with(W, user))
|
||||
if(do_after(user, (rand() * 10 SECONDS) + 5 SECONDS))
|
||||
if(do_after(user, (rand() * 10 SECONDS + 5 SECONDS), target = src))
|
||||
repair_with(W, user)
|
||||
return
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
if(dna_lock && attached_lock && !attached_lock.controller_lock)
|
||||
to_chat(user, span_notice("You begin removing \the [attached_lock] from \the [src]."))
|
||||
playsound(src, A.usesound, 50, 1)
|
||||
if(do_after(user, 25 * A.toolspeed))
|
||||
if(do_after(user, 25 * A.toolspeed, target = src))
|
||||
to_chat(user, span_notice("You remove \the [attached_lock] from \the [src]."))
|
||||
user.put_in_hands(attached_lock)
|
||||
dna_lock = 0
|
||||
@@ -731,7 +731,7 @@
|
||||
|
||||
mouthshoot = 1
|
||||
M.visible_message(span_red("[user] sticks their gun in their mouth, ready to pull the trigger..."))
|
||||
if(!do_after(user, 40))
|
||||
if(!do_after(user, 4 SECONDS, target = src))
|
||||
M.visible_message(span_blue("[user] decided life was worth living"))
|
||||
mouthshoot = 0
|
||||
return
|
||||
|
||||
@@ -135,7 +135,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
|
||||
|
||||
@@ -145,7 +145,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
|
||||
|
||||
@@ -88,7 +88,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)
|
||||
|
||||
@@ -299,7 +299,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
|
||||
@@ -329,7 +329,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
|
||||
|
||||
@@ -57,7 +57,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()
|
||||
|
||||
@@ -112,7 +112,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"
|
||||
|
||||
@@ -194,7 +194,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) //CHOMP Remove
|
||||
|
||||
@@ -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