Refactored do_after to use a flag-based system for options (#17127)

* Refactored do_after to use a flag-based system for options

* More flags

* Ditto

* Use the HAS_FLAG macro

* do_after pass

* Fix burning paper code

* Resolve issues from Fluffy's code reviews

* .
This commit is contained in:
Cody Brittain
2023-09-27 08:17:14 -04:00
committed by GitHub
parent 085e7c8107
commit 0a3dac31e0
125 changed files with 531 additions and 314 deletions

View File

@@ -584,7 +584,7 @@
mouthshoot = TRUE
M.visible_message(SPAN_DANGER("\The [user] sticks \the [src] in their mouth, their finger ready to pull the trigger..."))
if(!do_after(user, 40))
if(!do_after(user, 4 SECONDS))
M.visible_message(SPAN_GOOD("\The [user] takes \the [src] out of their mouth."))
mouthshoot = FALSE
return

View File

@@ -42,7 +42,7 @@
playsound(user.loc, 'sound/items/crank.ogg', 60, 1)
is_charging = TRUE
flick("crank", src)
if(do_after(user,20))
if(do_after(user,2 SECONDS))
to_chat(user, "<span class='notice'>You finish charging \the [src].</span>")
power_supply.give(charge_cost)
update_maptext()

View File

@@ -81,7 +81,7 @@
/obj/item/gun/projectile/shotgun/pump/proc/pump(mob/M)
if(!wielded)
if(!do_after(M, 20, TRUE)) // have to stand still for 2 seconds instead of doing it instantly. bad idea during a shootout
if(!do_after(M, 2 SECONDS)) // have to stand still for 2 seconds instead of doing it instantly. bad idea during a shootout
return
playsound(M, rack_sound, 60, FALSE)