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 12:17:14 +00:00
committed by GitHub
parent 085e7c8107
commit 0a3dac31e0
125 changed files with 531 additions and 314 deletions
+1 -1
View File
@@ -226,7 +226,7 @@
else
user.visible_message(SPAN_WARNING("[user] begins to wipe [H]'s lipstick off with \the [src]."), \
SPAN_NOTICE("You begin to wipe off [H]'s lipstick."))
if(do_after(user, 10) && do_after(H, 10, 0)) //user needs to keep their active hand, H does not.
if(do_after(user, 1 SECOND, H, do_flags = (DO_DEFAULT | DO_USER_UNIQUE_ACT) & ~DO_BOTH_CAN_TURN))
user.visible_message(SPAN_NOTICE("[user] wipes [H]'s lipstick off with \the [src]."), \
SPAN_NOTICE("You wipe off [H]'s lipstick."))
H.lipstick_color = null
+6 -10
View File
@@ -159,17 +159,13 @@
user.visible_message(span("[class]", "[user] holds \the [P] up to \the [src], trying to burn it!"), \
span("[class]", "You hold \the [P] up to \the [src], burning it slowly."))
playsound(src.loc, 'sound/bureaucracy/paperburn.ogg', 50, 1)
flick("shredp_onfire", src) //no do_after here, so people can walk n' burn at the same time. -wezzy
flick("shredp_onfire", src)
spawn(20)
if(get_dist(src, user) < 2 && user.get_active_hand() == P)
user.visible_message(span("[class]", "[user] burns right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap."), \
span("[class]", "You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap."))
new /obj/effect/decal/cleanable/ash(src.loc)
qdel(src)
else
to_chat(user, SPAN_WARNING("You must hold \the [P] steady to burn \the [src]."))
if (do_after(user, 2 SECONDS, src, DO_UNIQUE | DO_USER_CAN_MOVE))
user.visible_message(span("[class]", "[user] burns right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap."), \
span("[class]", "You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap."))
new /obj/effect/decal/cleanable/ash(src.loc)
qdel(src)
/obj/item/shreddedp
name = "shredded paper"