Merge pull request #15999 from SandPoot/do_after

Implements timed_action_flags for do_after-like procs
This commit is contained in:
silicons
2023-09-14 17:59:55 -07:00
committed by GitHub
60 changed files with 210 additions and 403 deletions
@@ -81,7 +81,7 @@
// Make Attempt...
to_chat(user, "<span class='notice'>You put all your weight into embedding the stake into [target]'s chest...</span>")
playsound(user, 'sound/magic/Demon_consume.ogg', 50, 1)
if(!do_mob(user, C, staketime, 0, 1, extra_checks=CALLBACK(C, /mob/living/carbon/proc/can_be_staked))) // user / target / time / uninterruptable / show progress bar / extra checks
if(!do_mob(user, C, staketime, NONE, extra_checks=CALLBACK(C, /mob/living/carbon/proc/can_be_staked))) // user / target / time / uninterruptable / show progress bar / extra checks
return
// Drop & Embed Stake
user.visible_message("<span class='danger'>[user.name] drives the [src] into [target]'s chest!</span>", \
@@ -146,7 +146,7 @@
to_chat(user, "<span class='notice'>You lean quietly toward [target] and secretly draw out your fangs...</span>")
else
to_chat(user, "<span class='warning'>You pull [target] close to you and draw out your fangs...</span>")
if(!do_mob(user, target, feed_time, 0, 1, extra_checks = CALLBACK(src, .proc/ContinueActive, user, target)))//sleep(10)
if(!do_mob(user, target, feed_time, NONE, extra_checks = CALLBACK(src, .proc/ContinueActive, user, target)))//sleep(10)
to_chat(user, "<span class='warning'>Your feeding was interrupted.</span>")
//DeactivatePower(user,target)
return
@@ -207,7 +207,7 @@
//user.mobility_flags &= ~MOBILITY_MOVE // user.canmove = 0 // Prevents spilling blood accidentally.
// Abort? A bloody mistake.
if(!do_mob(user, target, 20, 0, 0, extra_checks=CALLBACK(src, .proc/ContinueActive, user, target)))
if(!do_mob(user, target, 2 SECONDS, NONE, extra_checks=CALLBACK(src, .proc/ContinueActive, user, target)))
// May have disabled Feed during do_mob
if(!active || !ContinueActive(user, target))
break
@@ -59,7 +59,7 @@
target.reagents.add_reagent(/datum/reagent/medicine/salbutamol, 40) // So they don't choke to death while you interrogate them
sleep(1800)
SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]", "[i]"))
if(!do_mob(user, target, 20))
if(!do_mob(user, target, 2 SECONDS))
to_chat(user, "<span class='warning'>Our link with [target] has ended!</span>")
changeling.islinking = 0
target.mind.linglink = 0
@@ -43,7 +43,7 @@
/obj/item/forbidden_book/proc/get_power_from_influence(atom/target, mob/user)
var/obj/effect/reality_smash/RS = target
to_chat(user, "<span class='danger'>You start drawing power from influence...</span>")
if(do_after(user,10 SECONDS,TRUE,RS))
if(do_after(user, 10 SECONDS, RS))
qdel(RS)
charge += 1
@@ -57,7 +57,7 @@
var/A = get_turf(target)
to_chat(user, "<span class='danger'>You start drawing a rune...</span>")
if(do_after(user,30 SECONDS,FALSE, user))
if(do_after(user, 30 SECONDS, user))
new /obj/effect/eldritch/big(A)
@@ -65,7 +65,7 @@
/obj/item/forbidden_book/proc/remove_rune(atom/target,mob/user)
to_chat(user, "<span class='danger'>You start removing a rune...</span>")
if(do_after(user,2 SECONDS,FALSE, user))
if(do_after(user, 2 SECONDS, user))
qdel(target)
/obj/item/forbidden_book/ui_interact(mob/user, datum/tgui/ui = null)
@@ -958,7 +958,7 @@
halo = halo || mutable_appearance('icons/effects/effects.dmi', "at_shield2", EFFECTS_LAYER)
user.add_overlay(halo)
playsound(get_turf(user), Snd, 50, 0)
if(do_mob(user,user,50,1))
if(do_mob(user, user, 5 SECONDS))
user.cut_overlay(halo)
user.emote("clap1")
user.say("DOM'ENO ISPLETIMAS")
@@ -32,7 +32,7 @@
draining = TRUE
essence_drained += rand(15, 20)
to_chat(src, "<span class='revennotice'>You search for the soul of [target].</span>")
if(do_after(src, rand(10, 20), 0, target)) //did they get deleted in that second?
if(do_after(src, rand(10, 20), target)) //did they get deleted in that second?
if(target.ckey)
to_chat(src, "<span class='revennotice'>[target.p_their(TRUE)] soul burns with intelligence.</span>")
essence_drained += rand(20, 30)
@@ -41,7 +41,7 @@
essence_drained += rand(40, 50)
else
to_chat(src, "<span class='revennotice'>[target.p_their(TRUE)] soul is weak and faltering.</span>")
if(do_after(src, rand(15, 20), 0, target)) //did they get deleted NOW?
if(do_after(src, rand(15, 20), target)) //did they get deleted NOW?
switch(essence_drained)
if(1 to 30)
to_chat(src, "<span class='revennotice'>[target] will not yield much essence. Still, every bit counts.</span>")
@@ -51,7 +51,7 @@
to_chat(src, "<span class='revenboldnotice'>Such a feast! [target] will yield much essence to you.</span>")
if(90 to INFINITY)
to_chat(src, "<span class='revenbignotice'>Ah, the perfect soul. [target] will yield massive amounts of essence to you.</span>")
if(do_after(src, rand(15, 25), 0, target)) //how about now
if(do_after(src, rand(15, 25), target)) //how about now
if(!target.stat)
to_chat(src, "<span class='revenwarning'>[target.p_theyre(TRUE)] now powerful enough to fight off your draining.</span>")
to_chat(target, "<span class='boldannounce'>You feel something tugging across your body before subsiding.</span>")
@@ -73,7 +73,7 @@
draining = FALSE
return
var/datum/beam/B = Beam(target,icon_state="drain_life",time=INFINITY)
if(do_after(src, 46, 0, target)) //As one cannot prove the existance of ghosts, ghosts cannot prove the existance of the target they were draining.
if(do_after(src, 4.6 SECONDS, target)) //As one cannot prove the existance of ghosts, ghosts cannot prove the existance of the target they were draining.
change_essence_amount(essence_drained, FALSE, target)
if(essence_drained <= 90 && target.stat != DEAD)
essence_regen_cap += 5
+1 -1
View File
@@ -110,7 +110,7 @@
to_chat(user, "<span class='warning'>You require 3 [S.name] to repair [src].</span>")
return
to_chat(user, "<span class='notice'>You begin fixing the damage to [src] with [S]...</span>")
if(do_after(user, 6 SECONDS, TRUE, src))
if(do_after(user, 6 SECONDS, src))
if(S.use(3))
repair(user, params)
return 1
+3 -3
View File
@@ -180,7 +180,7 @@
return
user.visible_message("<span class='notice'>[user] begins [tied ? "unknotting" : "tying"] the laces of [user.p_their()] [src.name].</span>", "<span class='notice'>You begin [tied ? "unknotting" : "tying"] the laces of your [src.name]...</span>")
if(do_after(user, lace_time, needhand=TRUE, target=our_guy, extra_checks=CALLBACK(src, .proc/still_shoed, our_guy)))
if(do_after(user, lace_time, our_guy, extra_checks = CALLBACK(src, .proc/still_shoed, our_guy)))
to_chat(user, "<span class='notice'>You [tied ? "unknot" : "tie"] the laces of your [src.name].</span>")
if(tied == SHOES_UNTIED)
adjust_laces(SHOES_TIED, user)
@@ -204,7 +204,7 @@
if(HAS_TRAIT(user, TRAIT_CLUMSY)) // based clowns trained their whole lives for this
mod_time *= 0.75
if(do_after(user, mod_time, needhand=TRUE, target=our_guy, extra_checks=CALLBACK(src, .proc/still_shoed, our_guy)))
if(do_after(user, mod_time, our_guy, extra_checks = CALLBACK(src, .proc/still_shoed, our_guy)))
to_chat(user, "<span class='notice'>You [tied ? "untie" : "knot"] the laces on [loc]'s [src.name].</span>")
if(tied == SHOES_UNTIED)
adjust_laces(SHOES_KNOTTED, user)
@@ -285,6 +285,6 @@
to_chat(user, "<span class='notice'>You begin [tied ? "untying" : "tying"] the laces on [src]...</span>")
if(do_after(user, lace_time, needhand=TRUE, target=src,extra_checks=CALLBACK(src, .proc/still_shoed, user)))
if(do_after(user, lace_time, src, extra_checks = CALLBACK(src, .proc/still_shoed, user)))
to_chat(user, "<span class='notice'>You [tied ? "untie" : "tie"] the laces on [src].</span>")
adjust_laces(tied ? SHOES_TIED : SHOES_UNTIED, user)
+1 -1
View File
@@ -44,7 +44,7 @@
/obj/item/seeds/kudzu/attack_self(mob/user)
user.visible_message("<span class='danger'>[user] begins throwing seeds on the ground...</span>")
if(do_after(user, 50, needhand = TRUE, target = user.drop_location(), progress = TRUE))
if(do_after(user, 5 SECONDS, target = user.drop_location()))
plant(user)
to_chat(user, "<span class='notice'>You plant the kudzu. You monster.</span>")
+1 -1
View File
@@ -52,7 +52,7 @@
correctness = 100
correctness -= U.getOrganLoss(ORGAN_SLOT_BRAIN) * 0.5 //Brain damage makes researching hard.
speed += U.getOrganLoss(ORGAN_SLOT_BRAIN) * 3
if(do_after(user, speed, 0, user))
if(do_after(user, speed, user))
var/usedName = devilName
if(!prob(correctness))
usedName += "x"
+2 -2
View File
@@ -123,7 +123,7 @@
return
user.visible_message("<span class='notice'>[user] starts to pour the contents of [O] onto [src].</span>", "<span class='notice'>You start to slowly pour the contents of [O] onto [src].</span>")
if(!do_after(user, 60, TRUE, src))
if(!do_after(user, 6 SECONDS, src))
to_chat(user, "<span class='warning'>You failed to pour [O] onto [src]!</span>")
return
@@ -153,7 +153,7 @@
return
user.visible_message("<span class='notice'>[user] starts to pour the contents of [O] onto [src].</span>", "<span class='notice'>You start to slowly pour the contents of [O] onto [src].</span>")
if(!do_after(user, 60, TRUE, src))
if(!do_after(user, 6 SECONDS, src))
to_chat(user, "<span class='warning'>You failed to pour [O] onto [src]!</span>")
return
+7 -24
View File
@@ -267,7 +267,7 @@
MarkResistTime()
visible_message("<span class='warning'>[src] attempts to unbuckle [p_them()]self!</span>", \
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [round(buckle_cd/600,1)] minute\s, and you need to stay still.)</span>")
if(do_after(src, buckle_cd, 0, target = src, required_mobility_flags = MOBILITY_RESIST))
if(do_after(src, buckle_cd, src, timed_action_flags = IGNORE_HELD_ITEM))
if(!buckled)
return
buckled.user_unbuckle_mob(src, src)
@@ -304,13 +304,16 @@
if(I.item_flags & BEING_REMOVED)
to_chat(src, "<span class='warning'>You're already attempting to remove [I]!</span>")
return
var/obj/item/restraints/R = istype(I, /obj/item/restraints) ? I : null
var/allow_breakout_movement = NONE
if(R?.allow_breakout_movement)
allow_breakout_movement = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE)
I.item_flags |= BEING_REMOVED
breakouttime = I.breakouttime
var/datum/cuffbreak_checker/cuffbreak_checker = new(get_turf(src), istype(I, /obj/item/restraints)? I : null)
if(!cuff_break)
visible_message("<span class='warning'>[src] attempts to remove [I]!</span>")
to_chat(src, "<span class='notice'>You attempt to remove [I]... (This will take around [DisplayTimeText(breakouttime)] and you need to stand still.)</span>")
if(do_after_advanced(src, breakouttime, src, NONE, CALLBACK(cuffbreak_checker, /datum/cuffbreak_checker.proc/check_movement), required_mobility_flags = MOBILITY_RESIST))
if(do_after(src, breakouttime, target = src, timed_action_flags = allow_breakout_movement))
clear_cuffs(I, cuff_break)
else
to_chat(src, "<span class='warning'>You fail to remove [I]!</span>")
@@ -319,7 +322,7 @@
breakouttime = 50
visible_message("<span class='warning'>[src] is trying to break [I]!</span>")
to_chat(src, "<span class='notice'>You attempt to break [I]... (This will take around 5 seconds and you need to stand still.)</span>")
if(do_after_advanced(src, breakouttime, src, NONE, CALLBACK(cuffbreak_checker, /datum/cuffbreak_checker.proc/check_movement), required_mobility_flags = MOBILITY_RESIST))
if(do_after(src, breakouttime, target = src, timed_action_flags = allow_breakout_movement))
clear_cuffs(I, cuff_break)
else
to_chat(src, "<span class='warning'>You fail to break [I]!</span>")
@@ -327,28 +330,8 @@
else if(cuff_break == INSTANT_CUFFBREAK)
clear_cuffs(I, cuff_break)
QDEL_NULL(cuffbreak_checker)
I.item_flags &= ~BEING_REMOVED
/datum/cuffbreak_checker
var/turf/last
var/obj/item/restraints/cuffs
/datum/cuffbreak_checker/New(turf/initial_turf, obj/item/restraints/R)
last = initial_turf
if(R)
cuffs = R
/datum/cuffbreak_checker/proc/check_movement(atom/user, delay, atom/target, time_left, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool, list/passed_in)
if(get_turf(user) != last)
last = get_turf(user)
passed_in[1] = 0.5
if(cuffs && !cuffs.allow_breakout_movement)
return DO_AFTER_STOP
else
passed_in[1] = 1
return DO_AFTER_CONTINUE
/mob/living/carbon/proc/uncuff()
if (handcuffed)
var/obj/item/W = handcuffed
@@ -198,7 +198,7 @@
//rock paper scissors emote handling
/mob/living/carbon/human/proc/beginRockPaperScissors(var/chosen_move)
GLOB.rockpaperscissors_players[src] = list(chosen_move, ROCKPAPERSCISSORS_NOT_DECIDED)
do_after_advanced(src, ROCKPAPERSCISSORS_TIME_LIMIT, src, DO_AFTER_REQUIRES_USER_ON_TURF|DO_AFTER_NO_COEFFICIENT|DO_AFTER_NO_PROGRESSBAR|DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER, CALLBACK(src, .proc/rockpaperscissors_tick))
do_after(src, ROCKPAPERSCISSORS_TIME_LIMIT, src, extra_checks = CALLBACK(src, .proc/rockpaperscissors_tick))
var/new_entry = GLOB.rockpaperscissors_players[src]
if(new_entry[2] == ROCKPAPERSCISSORS_NOT_DECIDED)
to_chat(src, "You put your hand back down.")
@@ -240,10 +240,10 @@
src.visible_message("<b>[opponent]</b> wins!")
//make the progress bar end so that each player can handle the result
return DO_AFTER_STOP
return FALSE
//no opponent was found, so keep searching
return DO_AFTER_PROCEED
return TRUE
//the actual emotes
/datum/emote/living/carbon/human/rockpaperscissors
@@ -782,7 +782,7 @@
//src is the user that will be carrying, target is the mob to be carried
/mob/living/carbon/human/proc/can_piggyback(mob/living/target)
return (iscarbon(target) || ispAI(target)) && target.stat == CONSCIOUS
return (iscarbon(target) || ispAI(target)) && target.stat == CONSCIOUS && CHECK_MOBILITY(src, MOBILITY_STAND)
/mob/living/carbon/human/proc/can_be_firemanned(mob/living/carbon/target)
return (ishuman(target) && !CHECK_MOBILITY(target, MOBILITY_STAND)) || ispAI(target)
@@ -801,7 +801,7 @@
//Joe Medic starts quickly/expertly lifting Grey Tider onto their back..
"<span class='notice'>[carrydelay < 35 ? "Using your gloves' nanochips, you" : "You"] [skills_space]start to lift [target] onto your back[carrydelay == 40 ? ", while assisted by the nanochips in your gloves.." : "..."]</span>")
//(Using your gloves' nanochips, you/You) ( /quickly/expertly) start to lift Grey Tider onto your back(, while assisted by the nanochips in your gloves../...)
if(do_after(src, carrydelay, TRUE, target))
if(do_after(src, carrydelay, target, extra_checks = CALLBACK(src, PROC_REF(can_be_firemanned), target)))
//Second check to make sure they're still valid to be carried
if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE))
buckle_mob(target, TRUE, TRUE, 90, 1, 0, TRUE)
@@ -816,7 +816,7 @@
/mob/living/carbon/human/proc/piggyback(mob/living/carbon/target)
if(can_piggyback(target))
visible_message("<span class='notice'>[target] starts to climb onto [src]...</span>")
if(do_after(target, 15, target = src, required_mobility_flags = MOBILITY_STAND))
if(do_after(target, 1.5 SECONDS, src, extra_checks = CALLBACK(src, PROC_REF(can_piggyback), target)))
if(can_piggyback(target))
if(target.incapacitated(FALSE, TRUE) || incapacitated(FALSE, TRUE))
target.visible_message("<span class='warning'>[target] can't hang onto [src]!</span>")
@@ -546,7 +546,7 @@
if(src == M)
if(has_status_effect(STATUS_EFFECT_CHOKINGSTRAND))
to_chat(src, "<span class='notice'>You attempt to remove the durathread strand from around your neck.</span>")
if(do_after(src, 35, null, src))
if(do_after(src, 3.5 SECONDS, src))
to_chat(src, "<span class='notice'>You succesfuly remove the durathread strand.</span>")
remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND)
return
@@ -817,7 +817,7 @@
to_chat(src, "\t <a href='?src=[REF(src)];embedded_object=[REF(I)];embedded_limb=[REF(LB)]' class='warning'>There is \a [I] stuck to your [LB.name]!</a>")
else
to_chat(src, "\t <a href='?src=[REF(src)];embedded_object=[REF(I)];embedded_limb=[REF(LB)]' class='warning'>There is \a [I] embedded in your [LB.name]!</a>")
/mob/living/carbon/human/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone)
if(damage_type != BRUTE && damage_type != BURN)
@@ -35,7 +35,7 @@
standupwarning = "[src] struggles to stand up."
var/usernotice = automatic ? "<span class='notice'>You are now getting up. (Auto)</span>" : "<span class='notice'>You are now getting up.</span>"
visible_message("<span class='notice'>[standupwarning]</span>", usernotice, vision_distance = 5)
if(do_after(src, totaldelay, target = src, required_mobility_flags = MOBILITY_RESIST))
if(do_after(src, totaldelay, target = src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM)))
set_resting(FALSE, TRUE)
combat_flags &= ~COMBAT_FLAG_RESISTING_REST
@@ -60,7 +60,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
if (!istype(jumpsuit))
return null
to_chat(source, "<span class='notice'>[user] is trying to adjust your [jumpsuit.name].")
if (!do_mob(user, source, jumpsuit.strip_delay * 0.5, ignorehelditem = TRUE))
if (!do_mob(user, source, jumpsuit.strip_delay * 0.5, timed_action_flags = IGNORE_HELD_ITEM))
return
to_chat(source, "<span class='notice'>[user] successfully adjusted your [jumpsuit.name].")
jumpsuit.toggle_jumpsuit_adjust()
@@ -96,7 +96,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
source.visible_message("<span class='danger'>[user] tries to [hardsuit.suittoggled ? "retract" : "extend"] [source]'s helmet.</span>", \
"<span class='userdanger'>[user] tries to [hardsuit.suittoggled ? "retract" : "extend"] [source]'s helmet.</span>", \
target = user, target_message = "<span class='danger'>You try to [hardsuit.suittoggled ? "retract" : "extend"] [source]'s helmet.</span>")
if(!do_mob(user, source, hardsuit_head ? hardsuit_head.strip_delay : POCKET_STRIP_DELAY, ignorehelditem = TRUE))
if(!do_mob(user, source, hardsuit_head ? hardsuit_head.strip_delay : POCKET_STRIP_DELAY, timed_action_flags = IGNORE_HELD_ITEM))
return null
if((source.head != hardsuit_head) && source.head)
return null
@@ -279,7 +279,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
to_chat(user, span_notice("You try to [isnull(carbon_source.internal) ? "open": "close"] the valve on [source]'s [item.name]..."))
if(!do_mob(user, carbon_source, INTERNALS_TOGGLE_DELAY, ignorehelditem = TRUE))
if(!do_mob(user, carbon_source, INTERNALS_TOGGLE_DELAY, timed_action_flags = IGNORE_HELD_ITEM))
return null
if(carbon_source.internal)
@@ -92,7 +92,7 @@
var/nutrition_threshold = NUTRITION_LEVEL_FED
if (H.nutrition >= nutrition_threshold)
to_chat(H, "<i>You begin spinning some web...</i>")
if(!do_after(H, 10 SECONDS, 1, T))
if(!do_after(H, 10 SECONDS, T))
to_chat(H, "<span class='warning'>Your web spinning was interrupted!</span>")
return
H.adjust_nutrition(-E.spinner_rate)
@@ -152,7 +152,7 @@
to_chat(H, "<span class='warning'>You cannot wrap this.</span>")
return
H.visible_message("<span class='danger'>[H] starts to wrap [A] into a cocoon!</span>","<span class='warning'>You start to wrap [A] into a cocoon.</span>")
if(!do_after(H, 10 SECONDS, 1, A))
if(!do_after(H, 10 SECONDS, A))
to_chat(H, "<span class='warning'>Your web spinning was interrupted!</span>")
return
H.adjust_nutrition(E.spinner_rate * -3)
@@ -153,7 +153,7 @@
var/static/mutable_appearance/overcharge //shameless copycode from lightning spell
overcharge = overcharge || mutable_appearance('icons/effects/effects.dmi', "electricity", EFFECTS_LAYER)
H.add_overlay(overcharge)
if(do_mob(H, H, 50, 1))
if(do_after(H, 5 SECONDS, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_HELD_ITEM|IGNORE_INCAPACITATED)))
H.flash_lighting_fx(5, 7, current_color)
var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
playsound(H, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
@@ -169,7 +169,6 @@
to_chat(H, "<span class='userdanger'>You're pretty sure you just felt your heart stop for a second there..</span>")
H.playsound_local(H, 'sound/effects/singlebeat.ogg', 100, 0)
H.Paralyze(100)
return
/datum/species/ethereal/proc/get_charge(mob/living/carbon/H) //this feels like it should be somewhere else. Eh?
var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
@@ -198,7 +198,7 @@
H.mob_transforming = TRUE
if(do_after(owner, delay=60, needhand=FALSE, target=owner, progress=TRUE))
if(do_after(owner, 6 SECONDS, owner))
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
make_dupe()
else
+1 -1
View File
@@ -953,7 +953,7 @@
else
to_chat(src,"<span class='notice'>You try to remove [who]'s [what.name].</span>")
what.add_fingerprint(src)
if(do_mob(src, who, round(what.strip_delay / strip_mod), ignorehelditem = TRUE))
if(do_mob(src, who, round(what.strip_delay / strip_mod), timed_action_flags = IGNORE_HELD_ITEM))
if(what && Adjacent(who))
if(islist(where))
var/list/L = where
@@ -48,7 +48,7 @@
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = 2.5, FALSE, SINE_EASING | EASE_IN)
/mob/living/proc/continue_starting_active_block()
return (combat_flags & COMBAT_FLAG_ACTIVE_BLOCK_STARTING)? DO_AFTER_CONTINUE : DO_AFTER_STOP
return (combat_flags & COMBAT_FLAG_ACTIVE_BLOCK_STARTING)
/mob/living/get_standard_pixel_x_offset()
. = ..()
@@ -102,7 +102,7 @@
var/delay = data.block_start_delay
combat_flags |= COMBAT_FLAG_ACTIVE_BLOCK_STARTING
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = delay, FALSE, SINE_EASING | EASE_IN)
if(!do_after_advanced(src, delay, src, DO_AFTER_REQUIRES_USER_ON_TURF|DO_AFTER_NO_COEFFICIENT, CALLBACK(src, .proc/continue_starting_active_block), MOBILITY_USE, null, null, I))
if(!do_after(src, delay, src, (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE), extra_checks = CALLBACK(src, .proc/continue_starting_active_block)))
to_chat(src, "<span class='warning'>You fail to raise [I].</span>")
combat_flags &= ~(COMBAT_FLAG_ACTIVE_BLOCK_STARTING)
animate(src, pixel_x = get_standard_pixel_x_offset(), pixel_y = get_standard_pixel_y_offset(), time = 2.5, FALSE, SINE_EASING | EASE_IN, ANIMATION_END_NOW)
@@ -365,7 +365,7 @@
playsound(src, 'sound/weapons/cablecuff.ogg', 30, TRUE, -2)
C.visible_message("<span class='danger'>[process_emote("CAPTURE_ONE", C)]</span>",\
"<span class='userdanger'>[process_emote("CAPTURE_TWO", C)]</span>")
if(do_after(src, 60, FALSE, C))
if(do_after(src, 60, C))
attempt_handcuff(C)
/mob/living/simple_animal/bot/secbot/proc/attempt_handcuff(mob/living/carbon/C)
@@ -17,7 +17,7 @@
if("Cannibalize")
if(D.health < D.maxHealth)
D.visible_message("<span class='notice'>[D] begins to cannibalize parts from [src].</span>", "<span class='notice'>You begin to cannibalize parts from [src]...</span>")
if(do_after(D, 60, 0, target = src))
if(do_after(D, 6 SECONDS, src))
D.visible_message("<span class='notice'>[D] repairs itself using [src]'s remains!</span>", "<span class='notice'>You repair yourself using [src]'s remains.</span>")
D.adjustBruteLoss(-src.maxHealth)
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
@@ -44,7 +44,7 @@
to_chat(user, "<span class='warning'>You can't seem to find the [pick(faux_gadgets)]! Without it, [src] [pick(faux_problems)].</span>")
return
user.visible_message("<span class='notice'>[user] begins to reactivate [src].</span>", "<span class='notice'>You begin to reactivate [src]...</span>")
if(do_after(user, 30, 1, target = src))
if(do_after(user, 3 SECONDS, src))
revive(full_heal = 1)
user.visible_message("<span class='notice'>[user] reactivates [src]!</span>", "<span class='notice'>You reactivate [src].</span>")
alert_drones(DRONE_NET_CONNECT)
+1 -1
View File
@@ -53,7 +53,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
if(vent_found_parent && (vent_found_parent.members.len || vent_found_parent.other_atmosmch))
visible_message("<span class='notice'>[src] begins climbing into the ventilation system...</span>" ,"<span class='notice'>You begin climbing into the ventilation system...</span>")
if(!do_after(src, 25, target = vent_found, required_mobility_flags = MOBILITY_MOVE))
if(!do_after(src, 25, target = vent_found))
return
if(!client)
+10 -5
View File
@@ -1,3 +1,5 @@
#define MOD_ACTIVATION_STEP_FLAGS IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM|IGNORE_INCAPACITATED
/// Creates a radial menu from which the user chooses parts of the suit to deploy/retract. Repeats until all parts are extended or retracted.
/obj/item/mod/control/proc/choose_deploy(mob/user)
if(!length(mod_parts))
@@ -132,31 +134,31 @@
playsound(src, 'sound/machines/synth_no.ogg', 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE, frequency = 6000)
return TRUE
if(do_after(wearer, activation_step_time, target = wearer, required_mobility_flags = NONE))
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[boots] [active ? "relax their grip on your legs" : "seal around your feet"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(boots, seal = !active)
else
return toggle_activate_fail()
if(do_after(wearer, activation_step_time, target = wearer, required_mobility_flags = NONE))
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[gauntlets] [active ? "become loose around your fingers" : "tighten around your fingers and wrists"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(gauntlets, seal = !active)
else
return toggle_activate_fail()
if(do_after(wearer, activation_step_time, target = wearer, required_mobility_flags = NONE))
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[chestplate] [active ? "releases your chest" : "cinches tightly against your chest"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(chestplate,seal = !active)
else
return toggle_activate_fail()
if(do_after(wearer, activation_step_time, target = wearer, required_mobility_flags = NONE))
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("[helmet] hisses [active ? "open" : "closed"]."))
playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
seal_part(helmet, seal = !active)
else
return toggle_activate_fail()
if(do_after(wearer, activation_step_time, target = wearer, required_mobility_flags = NONE))
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS, extra_checks = CALLBACK(src, PROC_REF(has_wearer))))
to_chat(wearer, span_notice("Systems [active ? "shut down. Parts unsealed. Goodbye" : "started up. Parts sealed. Welcome"], [wearer]."))
if(ai)
to_chat(ai, span_notice("<b>SYSTEMS [active ? "DEACTIVATED. GOODBYE" : "ACTIVATED. WELCOME"]: \"[ai]\"</b>"))
@@ -240,3 +242,6 @@
for(var/obj/item/part in mod_parts)
seal_part(part, seal = TRUE)
finish_activation(on = TRUE)
/obj/item/mod/control/proc/has_wearer()
return wearer
+1 -1
View File
@@ -587,7 +587,7 @@ By design, d1 is the smallest direction and d2 is the highest
to_chat(user, "<span class='notice'>You don't have enough cable coil to make restraints out of them</span>")
return
to_chat(user, "<span class='notice'>You start making some cable restraints.</span>")
if(!do_after(user, 30, TRUE, user, TRUE) || !use(15))
if(!do_after(user, 3 SECONDS, user) || !use(15))
to_chat(user, "<span class='notice'>You fail to make cable restraints, you need to be standing still to do it</span>")
return
var/obj/item/restraints/handcuffs/cable/result = new(get_turf(user))
@@ -37,14 +37,14 @@
var/log_object = "a damp rag containing [reagentlist]"
if(user.a_intent == INTENT_HARM && !C.is_mouth_covered())
C.visible_message("<span class='danger'>[user] is trying to smother \the [C] with \the [src]!</span>", "<span class='userdanger'>[user] is trying to smother you with \the [src]!</span>", "<span class='italics'>You hear some struggling and muffled cries of surprise.</span>")
if(do_after(user, 20, target = C))
if(do_after(user, 2 SECONDS, C))
reagents.reaction(C, INGEST)
reagents.trans_to(C, 5, log = "rag smother")
C.visible_message("<span class='danger'>[user] has smothered \the [C] with \the [src]!</span>", "<span class='userdanger'>[user] has smothered you with \the [src]!</span>", "<span class='italics'>You hear some struggling and a heavy breath taken.</span>")
log_combat(user, C, "smothered", log_object)
else
C.visible_message("<span class='notice'>[user] is trying to wipe \the [C] with \the [src].</span>")
if(do_after(user, 20, target = C))
if(do_after(user, 2 SECONDS, C))
reagents.reaction(C, TOUCH)
reagents.remove_all(5)
C.visible_message("<span class='notice'>[user] has wiped \the [C] with \the [src].</span>")
@@ -52,7 +52,7 @@
else if(istype(A) && (src in user))
user.visible_message("[user] starts to wipe down [A] with [src]!", "<span class='notice'>You start to wipe down [A] with [src]...</span>")
if(do_after(user, action_speed, target = A))
if(do_after(user, action_speed, A))
user.visible_message("[user] finishes wiping off [A]!", "<span class='notice'>You finish wiping off [A].</span>")
SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM)
@@ -91,7 +91,7 @@
. = ..()
if(reagents.total_volume && user.canUseTopic(src, BE_CLOSE))
to_chat(user, "<span class='notice'>You start squeezing \the [src] dry...</span>")
if(do_after(user, action_speed, TRUE, src))
if(do_after(user, action_speed, src))
var/msg = "You squeeze \the [src]"
var/obj/item/target
if(Adjacent(user)) //Allows the user to drain the reagents into a beaker if adjacent (no telepathy).
+1 -1
View File
@@ -114,7 +114,7 @@
if(designate_time && (landing_clear != SHUTTLE_DOCKER_BLOCKED))
to_chat(current_user, "<span class='warning'>Targeting transit location, please wait [DisplayTimeText(designate_time)]...</span>")
designating_target_loc = the_eye.loc
var/wait_completed = do_after(current_user, designate_time, FALSE, designating_target_loc, TRUE, CALLBACK(src, /obj/machinery/computer/camera_advanced/shuttle_docker/proc/canDesignateTarget))
var/wait_completed = do_after(current_user, designate_time, designating_target_loc, timed_action_flags = IGNORE_HELD_ITEM, extra_checks = CALLBACK(src, /obj/machinery/computer/camera_advanced/shuttle_docker/proc/canDesignateTarget))
designating_target_loc = null
if(!current_user)
return
+1 -1
View File
@@ -46,7 +46,7 @@
playsound(user, 'sound/effects/pope_entry.ogg', 100)
if(!do_after(M, 50, needhand=FALSE, target=marked_item))
if(!do_after(M, 5 SECONDS, marked_item, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_HELD_ITEM)))
to_chat(M, "<span class='warning'>Your soul snaps back to your body as you stop ensouling [marked_item]!</span>")
return
+1 -1
View File
@@ -27,7 +27,7 @@
halo = halo || mutable_appearance('icons/effects/effects.dmi', "electricity", EFFECTS_LAYER)
user.add_overlay(halo)
playsound(get_turf(user), Snd, 50, 0)
if(do_mob(user,user,100,1))
if(do_mob(user, user, 10 SECONDS))
if(ready && cast_check(skipcharge=1))
choose_targets()
else
+1 -1
View File
@@ -25,7 +25,7 @@
return FALSE
if(occupant_amount() >= max_occupants)
return FALSE
if(do_after(M, get_enter_delay(M), FALSE, src, TRUE))
if(do_after(M, get_enter_delay(M), src, timed_action_flags = IGNORE_HELD_ITEM))
mob_enter(M)
return TRUE
return FALSE
+3 -3
View File
@@ -539,7 +539,7 @@
//Handle a mob struggling
// Called from /mob/living/carbon/relaymove()
/obj/belly/proc/relay_resist(var/mob/living/R)
/obj/belly/proc/relay_resist(mob/living/R)
if (!(R in contents))
return // User is not in this belly
@@ -547,7 +547,7 @@
to_chat(R,"<span class='warning'>You attempt to climb out of \the [lowertext(name)]. (This will take around [escapetime/10] seconds.)</span>")
to_chat(owner,"<span class='warning'>Someone is attempting to climb out of your [lowertext(name)]!</span>")
if(do_after(R, owner, escapetime))
if(do_after(R, escapetime, owner, (IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM)))
if((owner.stat || escapable) && (R.loc == src)) //Can still escape?
release_specific_contents(R)
return
@@ -604,7 +604,7 @@
if(prob(escapechance)) //Let's have it check to see if the prey escapes first.
to_chat(R,"<span class='warning'>You start to climb out of \the [lowertext(name)].</span>")
to_chat(owner,"<span class='warning'>Someone is attempting to climb out of your [lowertext(name)]!</span>")
if(do_after(R, escapetime))
if(do_after(R, escapetime, owner, (IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM)))
if((escapable) && (R.loc == src)) //Can still escape?
release_specific_contents(R)
to_chat(R,"<span class='warning'>You climb out of \the [lowertext(name)].</span>")
+1 -1
View File
@@ -152,7 +152,7 @@
swallow_time = istype(prey, /mob/living/carbon/human) ? belly.human_prey_swallow_time : belly.nonhuman_prey_swallow_time
//Timer and progress bar
if(!do_after(user, swallow_time, TRUE, prey))
if(!do_after(user, swallow_time, prey))
return FALSE // Prey escaped (or user disabled) before timer expired.
if(!prey.Adjacent(user)) //double check'd just in case they moved during the timer and the do_mob didn't fail for whatever reason