Merge pull request #15999 from SandPoot/do_after
Implements timed_action_flags for do_after-like procs
This commit is contained in:
@@ -1,32 +1,11 @@
|
||||
/// Requires absolute stillness from the user
|
||||
#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER (1<<0)
|
||||
/// Requires absolute stillness from the target
|
||||
#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET (1<<1)
|
||||
/// Requires that the user is on a turf.
|
||||
#define DO_AFTER_REQUIRES_USER_ON_TURF (1<<2)
|
||||
/// Requires relative stillness to our target via dx and dy coordinate difference but only if both are spacedrifting. Specify DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY to say otherwise.
|
||||
#define DO_AFTER_DISALLOW_MOVING_RELATIVE (1<<3)
|
||||
/// Breaks if active hand item changes. Requires a tool be specified, otherwise defaults to active item
|
||||
#define DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE (1<<4)
|
||||
/// Breaks if the user has no free hands. If a tool is specified, allows that as well.
|
||||
#define DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL (1<<5)
|
||||
/// Do not display progressbar.
|
||||
#define DO_AFTER_NO_PROGRESSBAR (1<<6)
|
||||
/// Do not check do_after_coefficient()
|
||||
#define DO_AFTER_NO_COEFFICIENT (1<<7)
|
||||
/// For relative stillness, allow non spacedrift relative movement
|
||||
#define DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY (1<<8)
|
||||
|
||||
/// Ignores checks.
|
||||
#define DO_AFTER_PROCEED "PROCEED"
|
||||
/// Uses all other checks
|
||||
#define DO_AFTER_CONTINUE "CONTINUE"
|
||||
/// Breaks
|
||||
#define DO_AFTER_STOP "STOP"
|
||||
|
||||
/// Stage - initiating a do_after
|
||||
#define DO_AFTER_STARTING 1
|
||||
/// Stage - main loop of a do_after
|
||||
#define DO_AFTER_PROGRESSING 2
|
||||
/// Stage - Last check of a do_after
|
||||
#define DO_AFTER_FINISHING 3
|
||||
// timed_action_flags parameter for `/proc/do_after`
|
||||
/// Can do the action even if target is not added to doafters
|
||||
#define IGNORE_TARGET_IN_DOAFTERS (1<<0)
|
||||
/// Can do the action even if mob moves location
|
||||
#define IGNORE_USER_LOC_CHANGE (1<<1)
|
||||
/// Can do the action even if the target moves location
|
||||
#define IGNORE_TARGET_LOC_CHANGE (1<<2)
|
||||
/// Can do the action even if the item is no longer being held
|
||||
#define IGNORE_HELD_ITEM (1<<3)
|
||||
/// Can do the action even if the mob is incapacitated (ex. handcuffed)
|
||||
#define IGNORE_INCAPACITATED (1<<4)
|
||||
|
||||
@@ -1,168 +1,6 @@
|
||||
/**
|
||||
* Higher overhead "advanced" version of do_after.
|
||||
* @params
|
||||
* - atom/user is the atom doing the action or the "physical" user
|
||||
* - delay is time in deciseconds
|
||||
* - atom/target is the atom the action is being done to, defaults to user
|
||||
* - do_after_flags see __DEFINES/flags/do_after.dm for details.
|
||||
* - datum/callback/extra_checks - Every time this ticks, extra_checks() is invoked with (user, delay, target, time_left, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool, passed_in).
|
||||
* Stage can be DO_AFTER_STARTING, DO_AFTER_PROGRESSING, DO_AFTER_FINISHING
|
||||
* If it returns DO_AFTER_STOP, this breaks.
|
||||
* If it returns nothing, all other checks are done.
|
||||
* If it returns DO_AFTER_PROCEED, all other checks are ignored.
|
||||
* passed_in is a list[PROGRESS_MULTIPLIER], for modification.
|
||||
* - required_mobility_flags is checked with CHECK_ALL_MOBILITY. Will immediately fail if the user isn't a mob.
|
||||
* - requried_combat_flags is checked with CHECK_MULTIPLE_BITFIELDS. Will immediately fail if the user isn't a mob.
|
||||
* - mob/living/mob_redirect - advanced option: If this is specified, movement and mobility/combat flag checks will use this instead of user. Progressbars will also go to this.
|
||||
* - obj/item/tool - The tool we're using. See do_after flags for details.
|
||||
*/
|
||||
#define INVOKE_CALLBACK cb_return = extra_checks?.Invoke(user, delay, target, timeleft, do_after_flags, required_mobility_flags, required_combat_flags, mob_redirect, stage, initially_held_item, tool, passed_in)
|
||||
#define CHECK_FLAG_FAILURE ((required_mobility_flags || required_combat_flags) && (!living_user || (required_mobility_flags && !CHECK_ALL_MOBILITY(living_user, required_mobility_flags)) || (required_combat_flags && !CHECK_MULTIPLE_BITFIELDS(living_user.combat_flags, required_combat_flags))))
|
||||
#define TIMELEFT (timeleft)
|
||||
/proc/do_after_advanced(atom/user, delay, atom/target, do_after_flags, datum/callback/extra_checks, required_mobility_flags, required_combat_flags, mob/living/mob_redirect, obj/item/tool)
|
||||
// CHECK AND SET VARIABLES
|
||||
if(!user)
|
||||
return FALSE
|
||||
if(!target)
|
||||
target = user
|
||||
if((user.loc == null) || (target.loc == null))
|
||||
return FALSE
|
||||
var/mob/living/living_user = mob_redirect
|
||||
if(!living_user && isliving(user))
|
||||
living_user = user
|
||||
var/stage = DO_AFTER_STARTING
|
||||
var/startlocuser = user.loc
|
||||
var/startloctarget = target.loc
|
||||
var/turf/userturf = get_turf(user)
|
||||
var/turf/targetturf = get_turf(target)
|
||||
if(!userturf || !targetturf)
|
||||
return FALSE
|
||||
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
|
||||
return FALSE
|
||||
if(!(do_after_flags & DO_AFTER_NO_COEFFICIENT) && living_user)
|
||||
delay *= living_user.cached_multiplicative_actions_slowdown
|
||||
var/timeleft = delay
|
||||
var/obj/item/initially_held_item = mob_redirect?.get_active_held_item()
|
||||
var/atom/movable/AM_user = ismovable(user) && user
|
||||
var/drifting = AM_user?.Process_Spacemove(NONE) && AM_user.inertia_dir
|
||||
var/initial_dx = targetturf.x - userturf.x
|
||||
var/initial_dy = targetturf.y - userturf.y
|
||||
var/dx = initial_dx
|
||||
var/dy = initial_dy
|
||||
// DO OUR STARTING CHECKS
|
||||
var/cb_return
|
||||
var/list/passed_in = list(1)
|
||||
INVOKE_CALLBACK
|
||||
if(cb_return == DO_AFTER_STOP)
|
||||
return FALSE
|
||||
else if(cb_return != DO_AFTER_PROCEED)
|
||||
if(CHECK_FLAG_FAILURE)
|
||||
return FALSE
|
||||
// SETUP LOOP
|
||||
var/datum/progressbar/progbar
|
||||
if(living_user)
|
||||
if(!(do_after_flags & DO_AFTER_NO_PROGRESSBAR))
|
||||
progbar = new(living_user, delay, target)
|
||||
// MAIN LOOP
|
||||
. = TRUE
|
||||
if(!delay)
|
||||
return
|
||||
var/obj/item/held
|
||||
var/locchanged
|
||||
var/ctu
|
||||
var/ctt
|
||||
var/tick_time = world.time
|
||||
while(timeleft > 0)
|
||||
stoplag(1)
|
||||
var/timepassed = world.time - tick_time
|
||||
tick_time = world.time
|
||||
progbar?.update(TIMELEFT)
|
||||
if(QDELETED(user) || QDELETED(target) || (user.loc == null) || (target.loc == null))
|
||||
. = FALSE
|
||||
break
|
||||
INVOKE_CALLBACK
|
||||
timeleft -= timepassed * passed_in[1]
|
||||
if(cb_return == DO_AFTER_STOP)
|
||||
. = FALSE
|
||||
break
|
||||
else if(cb_return == DO_AFTER_PROCEED)
|
||||
continue
|
||||
// otherwise, go through our normal checks.
|
||||
if(((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER) && (user.loc != startlocuser)) || ((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET) && (target.loc != startloctarget)))
|
||||
. = FALSE
|
||||
break
|
||||
else if(do_after_flags & DO_AFTER_DISALLOW_MOVING_RELATIVE)
|
||||
ctu = get_turf(user)
|
||||
ctt = get_turf(target)
|
||||
locchanged = (userturf != ctu) || (targetturf != ctt)
|
||||
userturf = ctu
|
||||
targetturf = ctt
|
||||
dx = targetturf.x - userturf.x
|
||||
dy = targetturf.y - userturf.y
|
||||
if((dx != initial_dx) || (dy != initial_dy))
|
||||
. = FALSE
|
||||
break
|
||||
if(locchanged && !drifting && !(do_after_flags & DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY))
|
||||
. = FALSE
|
||||
break
|
||||
if(!AM_user.inertia_dir)
|
||||
drifting = FALSE
|
||||
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
|
||||
return FALSE
|
||||
if(CHECK_FLAG_FAILURE)
|
||||
. = FALSE
|
||||
break
|
||||
held = living_user?.get_active_held_item()
|
||||
if((do_after_flags & DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE) && (held != (tool || initially_held_item)))
|
||||
. = FALSE
|
||||
break
|
||||
if((do_after_flags & DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL) && (!living_user?.is_holding(tool) && !length(living_user?.get_empty_held_indexes())))
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
// CLEANUP
|
||||
progbar.end_progress()
|
||||
// If we failed, just return.
|
||||
if(!.)
|
||||
return FALSE
|
||||
// DO FINISHING CHECKS
|
||||
if(QDELETED(user) || QDELETED(target))
|
||||
return FALSE
|
||||
INVOKE_CALLBACK
|
||||
if(cb_return == DO_AFTER_STOP)
|
||||
return FALSE
|
||||
else if(cb_return == DO_AFTER_PROCEED)
|
||||
return TRUE
|
||||
if(CHECK_FLAG_FAILURE)
|
||||
return FALSE
|
||||
if(((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER) && (user.loc != startlocuser)) || ((do_after_flags & DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET) && (target.loc != startloctarget)))
|
||||
return FALSE
|
||||
else if(do_after_flags & DO_AFTER_DISALLOW_MOVING_RELATIVE)
|
||||
ctu = get_turf(user)
|
||||
ctt = get_turf(target)
|
||||
locchanged = (userturf != ctu) || (targetturf != ctt)
|
||||
userturf = ctu
|
||||
targetturf = ctt
|
||||
dx = targetturf.x - userturf.x
|
||||
dy = targetturf.y - userturf.y
|
||||
if((dx != initial_dx) || (dy != initial_dy))
|
||||
return FALSE
|
||||
if(locchanged && !drifting && !(do_after_flags & DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY))
|
||||
return FALSE
|
||||
if((do_after_flags & DO_AFTER_REQUIRES_USER_ON_TURF) && !isturf(user.loc))
|
||||
return FALSE
|
||||
held = living_user?.get_active_held_item()
|
||||
if((do_after_flags & DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE) && (held != (tool || initially_held_item)))
|
||||
return FALSE
|
||||
if((do_after_flags & DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL) && (!living_user?.is_holding(tool) && !length(living_user?.get_empty_held_indexes())))
|
||||
return FALSE
|
||||
|
||||
#undef INVOKE_CALLBACK
|
||||
#undef CHECK_FLAG_FAILURE
|
||||
|
||||
/proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks = null, ignorehelditem = FALSE, resume_time = 0 SECONDS)
|
||||
/proc/do_mob(mob/user, mob/target, time = 3 SECONDS, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks, resume_time = 0 SECONDS)
|
||||
if(!user || !target)
|
||||
return 0
|
||||
return FALSE
|
||||
var/user_loc = user.loc
|
||||
|
||||
var/drifting = 0
|
||||
@@ -181,30 +19,26 @@
|
||||
|
||||
var/endtime = world.time+time
|
||||
var/starttime = world.time
|
||||
. = 1
|
||||
. = TRUE
|
||||
while (world.time + resume_time < endtime)
|
||||
stoplag(1)
|
||||
if (progress)
|
||||
progbar.update(world.time - starttime + resume_time)
|
||||
if(QDELETED(user) || QDELETED(target))
|
||||
. = 0
|
||||
break
|
||||
if(uninterruptible)
|
||||
continue
|
||||
if(!(target in user.do_afters))
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(!(target in user.do_afters))
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(drifting && !user.inertia_dir)
|
||||
drifting = 0
|
||||
drifting = FALSE
|
||||
user_loc = user.loc
|
||||
|
||||
if((!drifting && user.loc != user_loc) || target.loc != target_loc || (!ignorehelditem && user.get_active_held_item() != holding) || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
|
||||
. = 0
|
||||
if(
|
||||
QDELETED(user) || QDELETED(target) \
|
||||
|| (!(timed_action_flags & IGNORE_TARGET_IN_DOAFTERS) && !(target in user.do_afters)) \
|
||||
|| (!(timed_action_flags & IGNORE_USER_LOC_CHANGE) && !drifting && user.loc != user_loc) \
|
||||
|| (!(timed_action_flags & IGNORE_TARGET_LOC_CHANGE) && target.loc != target_loc) \
|
||||
|| (!(timed_action_flags & IGNORE_HELD_ITEM) && user.get_active_held_item() != holding) \
|
||||
|| (!(timed_action_flags & IGNORE_INCAPACITATED) && user.incapacitated()) \
|
||||
|| (extra_checks && !extra_checks.Invoke()) \
|
||||
)
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(!QDELETED(progbar))
|
||||
@@ -228,29 +62,25 @@
|
||||
checked_health["health"] = health
|
||||
return ..()
|
||||
|
||||
/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_USE|MOBILITY_MOVE), resume_time = 0 SECONDS)
|
||||
/proc/do_after(mob/user, delay, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks, resume_time = 0 SECONDS)
|
||||
if(!user)
|
||||
return 0
|
||||
var/atom/Tloc = null
|
||||
return FALSE
|
||||
var/atom/target_loc = null
|
||||
if(target && !isturf(target))
|
||||
Tloc = target.loc
|
||||
target_loc = target.loc
|
||||
|
||||
if(target)
|
||||
LAZYADD(user.do_afters, target)
|
||||
LAZYADD(target.targeted_by, user)
|
||||
|
||||
var/atom/Uloc = user.loc
|
||||
var/atom/user_loc = user.loc
|
||||
|
||||
var/drifting = 0
|
||||
var/drifting = FALSE
|
||||
if(!user.Process_Spacemove(0) && user.inertia_dir)
|
||||
drifting = 1
|
||||
drifting = TRUE
|
||||
|
||||
var/holding = user.get_active_held_item()
|
||||
|
||||
var/holdingnull = 1 //User's hand started out empty, check for an empty hand
|
||||
if(holding)
|
||||
holdingnull = 0 //Users hand started holding something, check to see if it's still holding that
|
||||
|
||||
delay *= user.cached_multiplicative_actions_slowdown
|
||||
|
||||
var/datum/progressbar/progbar
|
||||
@@ -259,44 +89,39 @@
|
||||
|
||||
var/endtime = world.time + delay
|
||||
var/starttime = world.time
|
||||
. = 1
|
||||
var/mob/living/L = isliving(user) && user //evals to last thing eval'd
|
||||
. = TRUE
|
||||
while (world.time + resume_time < endtime)
|
||||
stoplag(1)
|
||||
if (progress)
|
||||
progbar.update(world.time - starttime + resume_time)
|
||||
|
||||
if(drifting && !user.inertia_dir)
|
||||
drifting = 0
|
||||
Uloc = user.loc
|
||||
drifting = FALSE
|
||||
user_loc = user.loc
|
||||
|
||||
if(L && !CHECK_ALL_MOBILITY(L, required_mobility_flags))
|
||||
. = 0
|
||||
break
|
||||
|
||||
if(QDELETED(user) || user.stat || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
|
||||
. = 0
|
||||
break
|
||||
|
||||
if(!QDELETED(Tloc) && (QDELETED(target) || Tloc != target.loc))
|
||||
if((Uloc != Tloc || Tloc != user) && !drifting)
|
||||
. = 0
|
||||
break
|
||||
|
||||
if(target && !(target in user.do_afters))
|
||||
if(
|
||||
QDELETED(user) \
|
||||
|| (!(timed_action_flags & IGNORE_USER_LOC_CHANGE) && !drifting && user.loc != user_loc) \
|
||||
|| (!(timed_action_flags & IGNORE_HELD_ITEM) && user.get_active_held_item() != holding) \
|
||||
|| (!(timed_action_flags & IGNORE_INCAPACITATED) && user.incapacitated()) \
|
||||
|| (extra_checks && !extra_checks.Invoke()) \
|
||||
)
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(needhand)
|
||||
//This might seem like an odd check, but you can still need a hand even when it's empty
|
||||
//i.e the hand is used to pull some item/tool out of the construction
|
||||
if(!holdingnull)
|
||||
if(!holding)
|
||||
. = 0
|
||||
break
|
||||
if(user.get_active_held_item() != holding)
|
||||
. = 0
|
||||
break
|
||||
if(
|
||||
!(timed_action_flags & IGNORE_TARGET_LOC_CHANGE) \
|
||||
&& !drifting \
|
||||
&& !QDELETED(target_loc) \
|
||||
&& (QDELETED(target) || target_loc != target.loc) \
|
||||
&& ((user_loc != target_loc || target_loc != user)) \
|
||||
)
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(target && !(timed_action_flags & IGNORE_TARGET_IN_DOAFTERS) && !(target in user.do_afters))
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(!QDELETED(progbar))
|
||||
progbar.end_progress()
|
||||
@@ -308,16 +133,16 @@
|
||||
LAZYREMOVE(user.do_afters, target)
|
||||
LAZYREMOVE(target.targeted_by, user)
|
||||
|
||||
/proc/do_after_mob(mob/user, var/list/targets, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks)
|
||||
/proc/do_after_mob(mob/user, list/targets, time = 3 SECONDS, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks)
|
||||
if(!user || !targets)
|
||||
return 0
|
||||
return FALSE
|
||||
if(!islist(targets))
|
||||
targets = list(targets)
|
||||
var/user_loc = user.loc
|
||||
|
||||
var/drifting = 0
|
||||
var/drifting = FALSE
|
||||
if(!user.Process_Spacemove(0) && user.inertia_dir)
|
||||
drifting = 1
|
||||
drifting = TRUE
|
||||
|
||||
var/list/originalloc = list()
|
||||
for(var/atom/target in targets)
|
||||
@@ -335,25 +160,39 @@
|
||||
var/endtime = world.time + time
|
||||
var/starttime = world.time
|
||||
. = 1
|
||||
mainloop:
|
||||
while(world.time < endtime)
|
||||
stoplag(1)
|
||||
if(progress)
|
||||
progbar.update(world.time - starttime)
|
||||
if(QDELETED(user) || !targets)
|
||||
. = 0
|
||||
while(world.time < endtime)
|
||||
stoplag(1)
|
||||
|
||||
if(!QDELETED(progbar))
|
||||
progbar.update(world.time - starttime)
|
||||
if(QDELETED(user) || !length(targets))
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
if(drifting && !user.inertia_dir)
|
||||
drifting = FALSE
|
||||
user_loc = user.loc
|
||||
|
||||
if(
|
||||
!((timed_action_flags & IGNORE_USER_LOC_CHANGE) && !drifting && user_loc != user.loc) \
|
||||
|| (!(timed_action_flags & IGNORE_HELD_ITEM) && user.get_active_held_item() != holding) \
|
||||
|| (!(timed_action_flags & IGNORE_INCAPACITATED) && user.incapacitated()) \
|
||||
|| (extra_checks && !extra_checks.Invoke()) \
|
||||
)
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
for(var/t in targets)
|
||||
var/atom/target = t
|
||||
if(
|
||||
(QDELETED(target)) \
|
||||
|| (!(timed_action_flags & IGNORE_TARGET_LOC_CHANGE) && originalloc[target] != target.loc) \
|
||||
)
|
||||
. = FALSE
|
||||
break
|
||||
if(uninterruptible)
|
||||
continue
|
||||
|
||||
if(drifting && !user.inertia_dir)
|
||||
drifting = 0
|
||||
user_loc = user.loc
|
||||
|
||||
for(var/atom/target in targets)
|
||||
if((!drifting && user_loc != user.loc) || QDELETED(target) || originalloc[target] != target.loc || user.get_active_held_item() != holding || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
|
||||
. = 0
|
||||
break mainloop
|
||||
if(!.) // In case the for-loop found a reason to break out of the while.
|
||||
break
|
||||
|
||||
if(!QDELETED(progbar))
|
||||
progbar.end_progress()
|
||||
|
||||
@@ -1340,7 +1340,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
return temp
|
||||
|
||||
//same as do_mob except for movables and it allows both to drift and doesn't draw progressbar
|
||||
/proc/do_atom(atom/movable/user , atom/movable/target, time = 30, uninterruptible = 0,datum/callback/extra_checks = null)
|
||||
/proc/do_atom(atom/movable/user, atom/movable/target, time = 3 SECONDS, timed_action_flags = NONE, datum/callback/extra_checks)
|
||||
if(!user || !target)
|
||||
return TRUE
|
||||
var/user_loc = user.loc
|
||||
@@ -1359,11 +1359,10 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
. = TRUE
|
||||
while (world.time < endtime)
|
||||
stoplag(1)
|
||||
|
||||
if(QDELETED(user) || QDELETED(target))
|
||||
. = 0
|
||||
. = FALSE
|
||||
break
|
||||
if(uninterruptible)
|
||||
continue
|
||||
|
||||
if(drifting && !user.inertia_dir)
|
||||
drifting = FALSE
|
||||
@@ -1373,7 +1372,11 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
target_drifting = FALSE
|
||||
target_loc = target.loc
|
||||
|
||||
if((!drifting && user.loc != user_loc) || (!target_drifting && target.loc != target_loc) || (extra_checks && !extra_checks.Invoke()))
|
||||
if(
|
||||
(!(timed_action_flags & IGNORE_USER_LOC_CHANGE) && !drifting && user.loc != user_loc) \
|
||||
|| (!(timed_action_flags& IGNORE_TARGET_LOC_CHANGE) && !target_drifting && target.loc != target_loc) \
|
||||
|| (extra_checks && !extra_checks.Invoke()) \
|
||||
)
|
||||
. = FALSE
|
||||
break
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
to_chat(M, "<span class='notice'>You start dumping out tier/cell rating [lowest_rating] parts from [parent].</span>")
|
||||
var/turf/T = get_turf(A)
|
||||
var/datum/progressbar/progress = new(M, length(things), T)
|
||||
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
|
||||
while (do_after(M, 1 SECONDS, T, NONE, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
A.do_squish(0.8, 1.2)
|
||||
@@ -81,7 +81,7 @@
|
||||
to_chat(M, "<span class='notice'>You start dumping out tier/cell rating [lowest_rating] parts from [parent].</span>")
|
||||
var/turf/T = get_turf(A)
|
||||
var/datum/progressbar/progress = new(M, length(things), T)
|
||||
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
|
||||
while (do_after(M, 10, T, NONE, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
A.do_squish(0.8, 1.2)
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
return
|
||||
var/datum/progressbar/progress = new(M, len, I.loc)
|
||||
var/list/rejections = list()
|
||||
while(do_after(M, 10, TRUE, parent, FALSE, CALLBACK(src, .proc/handle_mass_pickup, things, I.loc, rejections, progress)))
|
||||
while(do_after(M, 1 SECONDS, parent, NONE, FALSE, CALLBACK(src, .proc/handle_mass_pickup, things, I.loc, rejections, progress)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
to_chat(M, "<span class='notice'>You put everything you could [insert_preposition] [parent].</span>")
|
||||
@@ -271,7 +271,7 @@
|
||||
var/turf/T = get_turf(A)
|
||||
var/list/things = contents()
|
||||
var/datum/progressbar/progress = new(M, length(things), T)
|
||||
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
|
||||
while(do_after(M, 1 SECONDS, T, NONE, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
A.do_squish(0.8, 1.2)
|
||||
@@ -374,7 +374,8 @@
|
||||
if(check_locked(null, M, TRUE))
|
||||
return FALSE
|
||||
if(dump_destination.storage_contents_dump_act(src, M))
|
||||
playsound(A, "rustle", 50, 1, -5)
|
||||
if(rustle_sound)
|
||||
playsound(A, "rustle", 50, 1, -5)
|
||||
A.do_squish(0.8, 1.2)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -437,7 +438,7 @@
|
||||
if(isrevenant(M))
|
||||
INVOKE_ASYNC(GLOBAL_PROC, .proc/RevenantThrow, over_object, M, source)
|
||||
return
|
||||
if(check_locked(null, M) || !M.CanReach(A) || (!M.CanReach(over_object) && !istype(over_object, /atom/movable/screen)))
|
||||
if(check_locked(null, M) || !M.CanReach(A))
|
||||
return
|
||||
playsound(A, "rustle", 50, TRUE, -5)
|
||||
A.do_jiggle()
|
||||
@@ -673,7 +674,7 @@
|
||||
var/atom/A = parent
|
||||
update_actions()
|
||||
for(var/mob/M in range(1, A))
|
||||
if(M.active_storage == src)
|
||||
if(M.active_storage == src && (M != user))
|
||||
close(M)
|
||||
|
||||
/datum/component/storage/proc/signal_take_obj(datum/source, atom/movable/AM, new_loc, force = FALSE)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
if(len_messages >= 3)
|
||||
msg_blind = "<span class='italic'>[search_texts[3]]</span>"
|
||||
user.visible_message("<span class='notice'>[user] [search_texts[1]] [source].</span>", msg_first_person, msg_blind)
|
||||
if(do_after(user, scavenge_time * speed_multi, TRUE, source, TRUE, CALLBACK(src, .proc/set_progress, source, world.time), resume_time = progress_done * speed_multi))
|
||||
if(do_after(user, scavenge_time * speed_multi, source, NONE, TRUE, CALLBACK(src, .proc/set_progress, source, world.time), resume_time = progress_done * speed_multi))
|
||||
spawn_loot(source, user)
|
||||
players_busy_scavenging -= user
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
if(istype(gloves))
|
||||
strip_mod = gloves.strip_mod
|
||||
|
||||
if (!do_mob(user, source, (strip_delay || item.strip_delay) / strip_mod, ignorehelditem = TRUE))
|
||||
if (!do_mob(user, source, (strip_delay || item.strip_delay) / strip_mod, timed_action_flags = IGNORE_HELD_ITEM))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -977,7 +977,7 @@
|
||||
if(usr != owner)
|
||||
return
|
||||
to_chat(owner, "<span class='notice'>You attempt to remove the durathread strand from around your neck.</span>")
|
||||
if(do_after(owner, 35, null, owner))
|
||||
if(do_after(owner, 3.5 SECONDS, owner))
|
||||
if(isliving(owner))
|
||||
var/mob/living/L = owner
|
||||
to_chat(owner, "<span class='notice'>You successfully remove the durathread strand.</span>")
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/datum/status_effect/freon/proc/owner_resist()
|
||||
to_chat(owner, "You start breaking out of the ice cube!")
|
||||
if(do_mob(owner, owner, 40))
|
||||
if(do_mob(owner, owner, 4 SECONDS))
|
||||
if(!QDELETED(src))
|
||||
to_chat(owner, "You break out of the ice cube!")
|
||||
owner.remove_status_effect(/datum/status_effect/freon)
|
||||
|
||||
@@ -903,7 +903,7 @@
|
||||
if(STR == src_object)
|
||||
progress.end_progress()
|
||||
return
|
||||
while (do_after(user, 10, TRUE, src, FALSE, CALLBACK(STR, /datum/component/storage.proc/handle_mass_item_insertion, things, src_object, user, progress)))
|
||||
while(do_after(user, 1 SECONDS, src, NONE, FALSE, CALLBACK(STR, /datum/component/storage.proc/handle_mass_item_insertion, things, src_object, user, progress)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
to_chat(user, "<span class='notice'>You dump as much of [src_object.parent]'s contents into [STR.insert_preposition]to [src] as you can.</span>")
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
if(is_holding_pressure())
|
||||
// tell the user that this is a bad idea, and have a do_after as well
|
||||
to_chat(user, "<span class='warning'>As you begin crowbarring \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
if(!do_after(user, 15, TRUE, src)) // give them a few seconds to reconsider their decision.
|
||||
if(!do_after(user, 1.5 SECONDS, src)) // give them a few seconds to reconsider their decision.
|
||||
return
|
||||
log_game("[key_name_admin(user)] has opened a firelock with a pressure difference at [AREACOORD(loc)]") // there bibby I made it logged just for you. Enjoy.
|
||||
// since we have high-pressure-ness, close all other firedoors on the tile
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
. = ..()
|
||||
if(stored)
|
||||
to_chat(user, "<span class='notice'>You start struggling to pry the [stored] from the [src]...</span>")
|
||||
if(!do_after(user, 30 SECONDS, TRUE, src))
|
||||
if(!do_after(user, 30 SECONDS, src))
|
||||
to_chat(user, "<span class='warning'>Your fingers slip as you fail to pry the [stored] from the [src], clicking it right back into the slot!</span>")
|
||||
return
|
||||
user.put_in_hands(stored)
|
||||
@@ -73,7 +73,6 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
|
||||
|
||||
// The message server itself.
|
||||
/obj/machinery/telecomms/message_server
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
@@ -84,6 +83,7 @@
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
circuit = /obj/item/circuitboard/machine/telecomms/message_server
|
||||
|
||||
id = "Messaging Server"
|
||||
network = "tcommsat"
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
var/new_appearance = show_radial_menu(user, src, possible_appearances, custom_check = CALLBACK(src, .proc/check_menu, user, crayon), radius = 36, require_near = TRUE)
|
||||
if(!new_appearance)
|
||||
return
|
||||
if(!do_after(user, 10, FALSE, src, TRUE))
|
||||
if(!do_after(user, 1 SECONDS, src, timed_action_flags = IGNORE_HELD_ITEM))
|
||||
return FALSE
|
||||
if(!check_menu(user, crayon))
|
||||
return FALSE
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
M.visible_message("<span class='danger'>[user] hastily places [src] on [M]'s chest!</span>", \
|
||||
"<span class='userdanger'>[user] hastily places [src] on [M]'s chest!</span>")
|
||||
busy = TRUE
|
||||
if(do_after(user, isnull(defib?.disarm_shock_time)? disarm_shock_time : defib.disarm_shock_time, target = M))
|
||||
if(do_after(user, isnull(defib?.disarm_shock_time)? disarm_shock_time : defib.disarm_shock_time, M))
|
||||
M.visible_message("<span class='danger'>[user] zaps [M] with [src]!</span>", \
|
||||
"<span class='userdanger'>[user] zaps [M] with [src]!</span>")
|
||||
M.DefaultCombatKnockdown(140)
|
||||
@@ -477,7 +477,7 @@
|
||||
"<span class='warning'>You overcharge the paddles and begin to place them onto [H]'s chest...</span>")
|
||||
busy = TRUE
|
||||
update_icon()
|
||||
if(do_after(user, 30, target = H))
|
||||
if(do_after(user, 3 SECONDS, H))
|
||||
user.visible_message("<span class='notice'>[user] places [src] on [H]'s chest.</span>",
|
||||
"<span class='warning'>You place [src] on [H]'s chest and begin to charge them.</span>")
|
||||
var/turf/T = get_turf(defib)
|
||||
@@ -486,7 +486,7 @@
|
||||
T.audible_message("<span class='warning'>\The [defib] lets out an urgent beep and lets out a steadily rising hum...</span>")
|
||||
else
|
||||
user.audible_message("<span class='warning'>[src] let out an urgent beep.</span>")
|
||||
if(do_after(user, 30, target = H)) //Takes longer due to overcharging
|
||||
if(do_after(user, 3 SECONDS, H)) //Takes longer due to overcharging
|
||||
if(!H)
|
||||
busy = FALSE
|
||||
update_icon()
|
||||
@@ -542,7 +542,7 @@
|
||||
primetimer2 = 20
|
||||
deathtimer = DEFIB_TIME_LOSS * 10
|
||||
|
||||
if(do_after(user, primetimer, target = H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
|
||||
if(do_after(user, primetimer, H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
|
||||
user.visible_message("<span class='notice'>[user] places [src] on [H]'s chest.</span>", "<span class='warning'>You place [src] on [H]'s chest.</span>")
|
||||
playsound(src, 'sound/machines/defib_charge.ogg', 75, 0)
|
||||
// patients rot when they are killed, and die when they are dead
|
||||
@@ -551,7 +551,7 @@
|
||||
var/total_burn = 0
|
||||
var/total_brute = 0
|
||||
var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart)
|
||||
if(do_after(user, primetimer2, target = H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
|
||||
if(do_after(user, primetimer2, H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
|
||||
for(var/obj/item/carried_item in H.contents)
|
||||
if(istype(carried_item, /obj/item/clothing/suit/space))
|
||||
if((!combat && !req_defib) || (req_defib && !defib.combat))
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
to_chat(user, "<span class='warning'>Your [src] is already occupied.</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[hound.name] is carefully inserting [target.name] into their [src].</span>", "<span class='notice'>You start placing [target] into your [src]...</span>")
|
||||
if(!patient && iscarbon(target) && !target.buckled && do_after (user, 100, target = target))
|
||||
if(!patient && iscarbon(target) && !target.buckled && do_after(user, 10 SECONDS, target))
|
||||
|
||||
if(!in_range(src, target)) //Proximity is probably old news by now, do a new check.
|
||||
return //If they moved away, you can't eat them.
|
||||
@@ -127,7 +127,7 @@
|
||||
user.visible_message("<span class='notice'>You see [voracious ? "[user] struggling against the expanded material of [hound]'s gut!" : "and hear [user] pounding against something inside of [hound]'s [src.name]!"]</span>", \
|
||||
"<span class='notice'>[voracious ? "You start struggling inside of [src]'s tight, flexible confines," : "You start pounding against the metallic walls of [src],"] trying to trigger the release... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a [voracious ? "couple of thumps" : "loud banging noise"] coming from within [hound].</span>")
|
||||
if(do_after(user, breakout_time, target = src))
|
||||
if(do_after(user, breakout_time, src, IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM))
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [hound.name]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [hound.name]!</span>")
|
||||
go_out(user, hound)
|
||||
@@ -443,7 +443,7 @@
|
||||
to_chat(user,"<span class='warning'>[target] is buckled and can not be put into your [src].</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[hound.name] is ingesting [target] into their [src].</span>", "<span class='notice'>You start ingesting [target] into your [src.name]...</span>")
|
||||
if(do_after(user, 30, target = target) && !patient && !target.buckled)
|
||||
if(do_after(user, 3 SECONDS, target) && !patient && !target.buckled)
|
||||
target.forceMove(src)
|
||||
target.reset_perspective(src)
|
||||
update_gut(hound)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
shaking = TRUE
|
||||
|
||||
start_shaking(user)
|
||||
if(do_after(user, shake_time, needhand=TRUE, target=user, progress=TRUE))
|
||||
if(do_after(user, shake_time))
|
||||
var/answer = get_answer()
|
||||
say(answer)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/obj/item/book/granter/proc/turn_page(mob/user)
|
||||
playsound(user, pick('sound/effects/pageturn1.ogg','sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg'), 30, 1)
|
||||
if(do_after(user,50, TRUE, user))
|
||||
if(do_after(user, 5 SECONDS, src))
|
||||
if(remarks.len)
|
||||
to_chat(user, "<span class='notice'>[pick(remarks)]</span>")
|
||||
else
|
||||
@@ -53,7 +53,7 @@
|
||||
on_reading_stopped()
|
||||
reading = FALSE
|
||||
return
|
||||
if(do_after(user,50, TRUE, user))
|
||||
if(do_after(user, 5 SECONDS, src))
|
||||
on_reading_finished(user)
|
||||
reading = FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
/obj/item/restraints/handcuffs/cable/attack_self(mob/user)
|
||||
to_chat(user, "<span class='notice'>You start unwinding the cable restraints back into coil</span>")
|
||||
if(!do_after(user, 25, TRUE, user))
|
||||
if(!do_after(user, 25, user))
|
||||
return
|
||||
qdel(src)
|
||||
var/obj/item/stack/cable_coil/coil = new(get_turf(user))
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
if(staffcooldown + staffwait > world.time)
|
||||
return
|
||||
user.visible_message("[user] chants deeply and waves [user.p_their()] staff!")
|
||||
if(do_after(user, 20,1,src))
|
||||
if(do_after(user, 2 SECONDS, src))
|
||||
target.add_atom_colour(conversion_color, WASHABLE_COLOUR_PRIORITY) //wololo
|
||||
staffcooldown = world.time
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
||||
"<span class='notice'>You begin whittling [src] into a sharp point at one end.</span>", \
|
||||
"<span class='italics'>You hear wood carving.</span>")
|
||||
// 8 Second Timer
|
||||
if(!do_after(user, 80, TRUE, src))
|
||||
if(!do_after(user, 8 SECONDS, src))
|
||||
return
|
||||
// Make Stake
|
||||
var/obj/item/stake/basic/new_item = new(user.loc)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
attack_verb = list("pinched", "nipped")
|
||||
hitsound = 'sound/items/wirecutter.ogg'
|
||||
usesound = 'sound/items/wirecutter.ogg'
|
||||
|
||||
tool_behaviour = TOOL_WIRECUTTER
|
||||
toolspeed = 1
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 30)
|
||||
@@ -126,7 +125,6 @@
|
||||
desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a cutting head."
|
||||
icon_state = "jaws_cutter"
|
||||
item_state = "jawsoflife"
|
||||
|
||||
custom_materials = list(/datum/material/iron=150,/datum/material/silver=50,/datum/material/titanium=25)
|
||||
usesound = 'sound/items/jaws_cut.ogg'
|
||||
toolspeed = 0.25
|
||||
@@ -161,7 +159,7 @@
|
||||
var/man = C == user ? "your" : "[C]'\s"
|
||||
user.visible_message("<span class='notice'>[user] attempts to remove the durathread strand from around [man] neck.</span>", \
|
||||
"<span class='notice'>You attempt to remove the durathread strand from around [man] neck.</span>")
|
||||
if(do_after(user, 15, null, C))
|
||||
if(do_after(user, 1.5 SECONDS, C))
|
||||
user.visible_message("<span class='notice'>[user] succesfuly removes the durathread strand.</span>",
|
||||
"<span class='notice'>You succesfuly remove the durathread strand.</span>")
|
||||
C.remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND)
|
||||
|
||||
@@ -468,7 +468,7 @@
|
||||
user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \
|
||||
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='hear'>You hear banging from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src, required_mobility_flags = MOBILITY_RESIST))
|
||||
if(do_after(user, breakout_time, src, IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
|
||||
return
|
||||
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
|
||||
|
||||
@@ -48,7 +48,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, 3 SECONDS, target = src))
|
||||
if(do_after(user, 3 SECONDS, src))
|
||||
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
|
||||
@@ -514,7 +514,7 @@
|
||||
"<span class='notice'>You start washing your [washing_face ? "face" : "hands"]...</span>")
|
||||
busy = TRUE
|
||||
|
||||
if(!do_after(user, 40, target = src))
|
||||
if(!do_after(user, 4 SECONDS, src))
|
||||
busy = FALSE
|
||||
return
|
||||
|
||||
@@ -595,7 +595,7 @@
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='notice'>You start washing [O]...</span>")
|
||||
busy = TRUE
|
||||
if(!do_after(user, 40, target = src))
|
||||
if(!do_after(user, 4 SECONDS, src))
|
||||
busy = FALSE
|
||||
return 1
|
||||
busy = FALSE
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
. = ..()
|
||||
if(dropping == user && isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.resting && do_after(L, max(10, L.getStaminaLoss()*0.5), 0, src))
|
||||
if(L.resting && do_after(L, max(10, L.getStaminaLoss()*0.5), src, IGNORE_HELD_ITEM))
|
||||
if(Adjacent(L, src))
|
||||
step(L, get_dir(L, src))
|
||||
playsound(L, "rustle", 25, 1)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
if(!istype(I, /obj/item/pickaxe/drill/jackhammer))
|
||||
return FALSE
|
||||
to_chat(user, "<span class='notice'>You begin to smash though [src]...</span>")
|
||||
if(!do_after(user, 70, TRUE, src))
|
||||
if(!do_after(user, 7 SECONDS, src))
|
||||
return FALSE
|
||||
I.play_tool_sound(src)
|
||||
visible_message("<span class='warning'>[user] smashes through [src] with [I]!</span>", "<span class='italics'>You hear the grinding of metal.</span>")
|
||||
|
||||
@@ -388,7 +388,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
|
||||
var/list/things = src_object.contents()
|
||||
var/datum/progressbar/progress = new(user, things.len, src)
|
||||
while (do_after(usr, 1 SECONDS, TRUE, src, FALSE, CALLBACK(src_object, /datum/component/storage.proc/mass_remove_from_storage, src, things, progress, TRUE, user)))
|
||||
while (do_after(usr, 1 SECONDS, src, NONE, FALSE, CALLBACK(src_object, /datum/component/storage.proc/mass_remove_from_storage, src, things, progress, TRUE, user)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>")
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user