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

@@ -101,7 +101,7 @@
)
LAZYADD(climbers, user)
if(!do_after(user,25))
if(!do_after(user, 2.5 SECONDS))
LAZYREMOVE(climbers, user)
return

View File

@@ -233,7 +233,7 @@
if(manipulating) return M
manipulating = 1
to_chat(user, "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>")
if(!do_after(user, 20) || !S.use(1))
if(!do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) || !S.use(1))
manipulating = 0
return null
user.visible_message("<span class='notice'>\The [user] [verb]es \the [src] with [M.display_name].</span>", "<span class='notice'>You finish [verb]ing \the [src].</span>")
@@ -252,7 +252,7 @@
"<span class='notice'>You begin removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.</span>")
if(sound)
playsound(src.loc, sound, 50, 1)
if(!do_after(user, 40))
if(!do_after(user, 4 SECONDS, src, DO_REPAIR_CONSTRUCT))
manipulating = 0
return M
user.visible_message("<span class='notice'>\The [user] removes the [M.display_name] [what] from \the [src].</span>",