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
+1 -1
View File
@@ -32,7 +32,7 @@
var/r_eyes = hex2num(copytext(new_eyes, 2, 4))
var/g_eyes = hex2num(copytext(new_eyes, 4, 6))
var/b_eyes = hex2num(copytext(new_eyes, 6, 8))
if(do_after(owner, 5) && owner.change_eye_color(r_eyes, g_eyes, b_eyes))
if(do_after(owner, 0.5 SECONDS, do_flags = DO_USER_CAN_MOVE | DO_USER_CAN_TURN) && owner.change_eye_color(r_eyes, g_eyes, b_eyes))
owner.update_eyes()
owner.visible_message("<span class='notice'>[owner] shifts, their eye color changing.</span>", "<span class='notice'>You shift, your eye color changing.</span>")
+1 -1
View File
@@ -249,7 +249,7 @@
examinate(user, src)
else
user.visible_message(SPAN_WARNING("\The [user] starts fiddling with \the [src]..."), SPAN_NOTICE("You start fiddling with \the [src]..."))
if(do_after(user, 30, TRUE, src))
if(do_after(user, 30, src))
if(src.loc != user)
to_chat(user, SPAN_WARNING("You can only modify \the [src] if it's on your person!"))
return
+4 -4
View File
@@ -183,7 +183,7 @@
var/obj/item/organ/external/E = input(src, "Select a limb to detach:", "Nymph Limb Detach") as null|anything in my_nymph_limbs
if(!istype(E))
return
if(!do_after(src, delay = 3 SECONDS, needhand = FALSE))
if(!do_after(src, delay = 3 SECONDS, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
return
if(E.detach_nymph_limb() && my_nymph_limbs.len == 1)
remove_verb(src, /mob/living/carbon/human/proc/detach_nymph_limb)
@@ -199,7 +199,7 @@
if(istype(E))
to_chat(src, "You start to detach from your host.")
to_chat(E.owner, "The nymph acting as your [E.name] starts to unattach itself.")
if(do_after(src, delay = 3 SECONDS, needhand = FALSE))
if(do_after(src, delay = 3 SECONDS, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
E.detach_nymph_limb()
// Organ detach
@@ -261,7 +261,7 @@
if(!limb_choice)
return
if(!do_after(src, delay = 3 SECONDS, needhand = FALSE))
if(!do_after(src, delay = 3 SECONDS, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
return
// Make new limb and put it on the host
@@ -321,7 +321,7 @@
if(!limb_choice)
return
if(!do_after(target, delay = 3 SECONDS, needhand = TRUE))
if(!do_after(target, delay = 3 SECONDS, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
return
// Make new limb and put it on the host