Implements timed_action_flags for do_after-like procs (#54409)

Originally I wanted to fix an issue where the `get_up()` `do_after()` would ignore the callback checks, because it was `uninterruptible`, so that made me refactor these procs to allow for higher granularity on checks and standardize behavior a bit more.
There's more work to be done for them, but one thing at a time.

* Removes the `uninterruptible` check in favor of the more granular `timed_action_flags`
* Cleans code on the `do_atom`, `do_after_mob`, `do_mob` and `do_after` procs to standardize them a little better.
This commit is contained in:
Rohesie
2020-10-19 18:06:49 -03:00
committed by GitHub
parent 2ae02bced0
commit 29ec525147
42 changed files with 154 additions and 129 deletions
@@ -466,7 +466,7 @@
/obj/structure/chair/plastic/proc/snap_check(mob/living/carbon/Mob)
if (Mob.nutrition >= NUTRITION_LEVEL_FAT)
to_chat(Mob, "<span class='warning'>The chair begins to pop and crack, you're too heavy!</span>")
if(do_after(Mob, 60, 1, Mob, 0))
if(do_after(Mob, 6 SECONDS, progress = FALSE))
Mob.visible_message("<span class='notice'>The plastic chair snaps under [Mob]'s weight!</span>")
new /obj/effect/decal/cleanable/plastic(loc)
qdel(src)
@@ -335,7 +335,7 @@
if((user.a_intent != INTENT_HARM) && istype(I, /obj/item/paper) && (obj_integrity < max_integrity))
user.visible_message("<span class='notice'>[user] starts to patch the holes in [src].</span>", "<span class='notice'>You start patching some of the holes in [src]!</span>")
if(do_after(user, 20, TRUE, src))
if(do_after(user, 2 SECONDS, src))
obj_integrity = min(obj_integrity+4,max_integrity)
qdel(I)
user.visible_message("<span class='notice'>[user] patches some of the holes in [src].</span>", "<span class='notice'>You patch some of the holes in [src]!</span>")
+1 -1
View File
@@ -40,7 +40,7 @@
GM.visible_message("<span class='danger'>[user] starts to give [GM] a swirlie!</span>", "<span class='userdanger'>[user] starts to give you a swirlie...</span>")
swirlie = GM
var/was_alive = (swirlie.stat != DEAD)
if(do_after(user, 30, 0, target = src))
if(do_after(user, 3 SECONDS, target = src, timed_action_flags = IGNORE_HELD_ITEM))
GM.visible_message("<span class='danger'>[user] gives [GM] a swirlie!</span>", "<span class='userdanger'>[user] gives you a swirlie!</span>", "<span class='hear'>You hear a toilet flushing.</span>")
if(iscarbon(GM))
var/mob/living/carbon/C = GM