From 830054c1061d04d7d668be7fe61975260348b13c Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 10 Jan 2020 13:25:47 -0800 Subject: [PATCH] sigh --- code/__DEFINES/flags.dm | 4 +- code/__DEFINES/status_effects.dm | 7 +- code/__DEFINES/traits.dm | 9 ++ code/datums/status_effects/debuffs.dm | 5 ++ .../machinery/porta_turret/portable_turret.dm | 2 +- .../antagonists/wizard/equipment/artefact.dm | 11 ++- .../antagonists/wizard/equipment/soulstone.dm | 4 +- .../components/unary_devices/cryo.dm | 6 +- .../carbon/alien/humanoid/caste/hunter.dm | 2 +- .../mob/living/carbon/alien/larva/life.dm | 4 +- .../mob/living/carbon/human/human_defense.dm | 2 +- code/modules/mob/living/carbon/monkey/life.dm | 2 +- code/modules/mob/living/living.dm | 4 +- code/modules/mob/living/living_mobility.dm | 90 +++++-------------- .../modules/mob/living/silicon/robot/robot.dm | 6 +- .../living/silicon/robot/robot_mobility.dm | 2 +- code/modules/mob/living/status_procs.dm | 60 ++++++++++++- code/modules/mob/transform_procs.dm | 4 +- .../surgery/bodyparts/dismemberment.dm | 4 +- .../code/modules/mob/living/carbon/carbon.dm | 2 +- 20 files changed, 133 insertions(+), 97 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 87be7884c7..6b65a7ce7a 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define MOBILITY_STAND (1<<1) /// can pickup items #define MOBILITY_PICKUP (1<<2) -/// can hold and use items +/// can use items #define MOBILITY_USE (1<<3) /// can use interfaces like consoles #define MOBILITY_UI (1<<4) @@ -107,6 +107,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define MOBILITY_STORAGE (1<<5) /// can pull things #define MOBILITY_PULL (1<<6) +/// can hold non-nodropped items voluntarily +#define MOBILITY_HOLD (1<<7) #define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_PICKUP | MOBILITY_USE | MOBILITY_UI | MOBILITY_STORAGE | MOBILITY_PULL) #define MOBILITY_FLAGS_ANY_INTERACTION (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_UI | MOBILITY_STORAGE) diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 5ad599ab45..1fce2be908 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -37,8 +37,8 @@ ///////////// // DEBUFFS // ///////////// - -#define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun //the affected is unable to move or use items +/// The affected is unable to move, or to use, hold, or pickup items. +#define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun #define STATUS_EFFECT_KNOCKDOWN /datum/status_effect/incapacitating/knockdown //the affected is unable to stand up @@ -46,6 +46,9 @@ #define STATUS_EFFECT_PARALYZED /datum/status_effect/incapacitating/paralyzed //the affected is unable to move, use items, or stand up. +/// The affected is unable to use or pickup items +#define STATUS_EFFECT_DAZED /datum/status_effect/incapacitating/dazed + #define STATUS_EFFECT_UNCONSCIOUS /datum/status_effect/incapacitating/unconscious //the affected is unconscious #define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 4f66482f51..2caf04c041 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -136,6 +136,15 @@ #define TRAIT_NOPULSE "nopulse" // Your heart doesn't beat. #define TRAIT_EXEMPT_HEALTH_EVENTS "exempt-health-events" +// mobility flag traits + +/// Disallow movement +#define TRAIT_MOBILITY_NOMOVE "mobility_nomove" +/// Disallow pickup +#define TRAIT_MOBILITY_NOPICKUP "mobility_nopickup" +/// Disallow item use +#define TRAIT_MOBILITY_NOUSE "mobility_nouse" + //non-mob traits #define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index c0b9c49240..cc3fb7d14f 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -33,6 +33,7 @@ /datum/status_effect/incapacitating/immobilized id = "immobilized" +//PARALYZED /datum/status_effect/incapacitating/paralyzed id = "paralyzed" @@ -40,6 +41,10 @@ if(owner.getStaminaLoss()) owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds +//DAZED +/datum/status_effect/incapacitating/dazed + id = "dazed" + //UNCONSCIOUS /datum/status_effect/incapacitating/unconscious id = "unconscious" diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 8c2a04bfbc..9d9e5d14d8 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -545,7 +545,7 @@ var/obj/item/projectile/A //any emagged turrets drains 2x power and uses a different projectile? if(mode == TURRET_STUN) - if(nonlethal_projectile && C && C.resting) + if(nonlethal_projectile && C && C._REFACTORING_resting) use_power(reqpower*0.5) A = new nonlethal_projectile(T) playsound(loc, nonlethal_projectile_sound, 75, 1) diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm index 676ef68ea9..f86f1622c7 100644 --- a/code/modules/antagonists/wizard/equipment/artefact.dm +++ b/code/modules/antagonists/wizard/equipment/artefact.dm @@ -377,7 +377,10 @@ /obj/item/warpwhistle/proc/end_effect(mob/living/carbon/user) user.invisibility = initial(user.invisibility) user.status_flags &= ~GODMODE - user.canmove = TRUE + REMOVE_TRAIT(user, TRAIT_MOBILITY_NOMOVE, src) + REMOVE_TRAIT(user, TRAIT_MOBILITY_NOUSE, src) + REMOVE_TRAIT(user, TRAIT_MOBILITY_NOPICKUP, src) + user.update_mobility() /obj/item/warpwhistle/attack_self(mob/living/carbon/user) if(!istype(user) || on_cooldown) @@ -390,7 +393,10 @@ on_cooldown = TRUE last_user = user playsound(T,'sound/magic/warpwhistle.ogg', 200, 1) - user.canmove = FALSE + ADD_TRAIT(user, TRAIT_MOBILITY_NOMOVE, src) + ADD_TRAIT(user, TRAIT_MOBILITY_NOUSE, src) + ADD_TRAIT(user, TRAIT_MOBILITY_NOPICKUP, src) + user.update_mobility() new /obj/effect/temp_visual/tornado(T) sleep(20) if(interrupted(user)) @@ -412,7 +418,6 @@ return if(T.z != potential_T.z || abs(get_dist_euclidian(potential_T,T)) > 50 - breakout) do_teleport(user, potential_T, channel = TELEPORT_CHANNEL_MAGIC) - user.canmove = 0 T = potential_T break breakout += 1 diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm index 962c2b2da4..4eb1e33bc2 100644 --- a/code/modules/antagonists/wizard/equipment/soulstone.dm +++ b/code/modules/antagonists/wizard/equipment/soulstone.dm @@ -83,8 +83,8 @@ /obj/item/soulstone/proc/release_shades(mob/user) for(var/mob/living/simple_animal/shade/A in src) A.status_flags &= ~GODMODE - A.canmove = TRUE A.forceMove(get_turf(user)) + A.mobility_flags = MOBILITY_FLAGS_DEFAULT A.cancel_camera() icon_state = "soulstone" name = initial(name) @@ -173,7 +173,7 @@ else T.forceMove(src) //put shade in stone T.status_flags |= GODMODE - T.canmove = FALSE + T.mobility_flags = NONE T.health = T.maxHealth icon_state = "soulstone2" name = "soulstone: Shade of [T.real_name]" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 0a54503be5..9046d2ff28 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -271,10 +271,10 @@ else . += "[src] seems empty." -/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user) - if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser()) +/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/living/carbon/target, mob/user) + if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !istype(target) || !user.IsAdvancedToolUser()) return - if (target.IsKnockdown() || target.IsStun() || target.IsSleeping() || target.IsUnconscious()) + if(!CHECK_BITFIELD(target.mobility_flags, MOBILITY_MOVE)) close_machine(target) else user.visible_message("[user] starts shoving [target] inside [src].", "You start shoving [target] inside [src].") diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index e9cd788e30..8c09bb431c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -79,7 +79,7 @@ if(leaping) leaping = 0 update_icons() - update_canmove() + update_mobility() /mob/living/carbon/alien/humanoid/float(on) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 397fc2a0f0..64b40f63e3 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -22,13 +22,13 @@ if(stat == CONSCIOUS) stat = UNCONSCIOUS blind_eyes(1) - update_canmove() + update_mobility() else if(stat == UNCONSCIOUS) stat = CONSCIOUS if(!recoveringstam) resting = 0 adjust_blindness(-1) - update_canmove() + update_mobility() update_damage_hud() update_health_hud() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index fe1a6d7d1c..6cf04e970c 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -296,7 +296,7 @@ if(M.force > 35) // durand and other heavy mechas DefaultCombatKnockdown(50) src.throw_at(throw_target, rand(1,5), 7) - else if(M.force >= 20 && !IsKnockdown()) // lightweight mechas like gygax + else if(M.force >= 20 && CHECK_BITFIELD(mobility_flags, MOBILITY_STAND)) // lightweight mechas like gygax DefaultCombatKnockdown(30) src.throw_at(throw_target, rand(1,3), 7) update |= temp.receive_damage(dmg, 0) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 4376e99826..b34580bb19 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -21,7 +21,7 @@ else if(resisting) resisting = FALSE else if((mode == MONKEY_IDLE && !pickupTarget && !prob(MONKEY_SHENANIGAN_PROB)) || !handle_combat()) - if(prob(25) && canmove && isturf(loc) && !pulledby) + if(prob(25) && CHECK_BITFIELD(mobility_flags, MOBILITY_MOVE) && isturf(loc) && !pulledby) step(src, pick(GLOB.cardinals)) else if(prob(1)) emote(pick("scratch","jump","roll","tail")) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 364d98c70d..980af46f41 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -486,7 +486,7 @@ stat = UNCONSCIOUS //the mob starts unconscious, blind_eyes(1) updatehealth() //then we check if the mob should wake up. - update_canmove() + update_mobility() update_sight() clear_alert("not_enough_oxy") reload_fullscreen() @@ -520,7 +520,7 @@ ExtinguishMob() fire_stacks = 0 confused = 0 - update_canmove() + update_mobility() var/datum/component/mood/mood = GetComponent(/datum/component/mood) if (mood) QDEL_LIST_ASSOC_VAL(mood.mood_events) diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm index 6e49442919..111fa2de9b 100644 --- a/code/modules/mob/living/living_mobility.dm +++ b/code/modules/mob/living/living_mobility.dm @@ -92,61 +92,14 @@ var/stun = _MOBILITYFLAGTEMPORARY_IsStun() var/paralyze = IsParalyzed() var/knockdown = _MOBILITYFLAGTEMPORARY_IsKnockdown() + var/daze = IsDazed() var/immobilize = IsImmobilized() - -/* - var/ko = IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) - var/move_and_fall = stat == SOFT_CRIT && !pulledby - var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK - var/buckle_lying = !(buckled && !buckled.buckle_lying) - var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground - if(ko || move_and_fall || IsStun() || chokehold) // Cit change - makes resting not force you to drop everything - drop_all_held_items() - unset_machine() - if(pulling) - stop_pulling() - else if(resting) //CIT CHANGE - makes resting make you stop pulling and interacting with machines - unset_machine() //CIT CHANGE - Ditto! - if(pulling) //CIT CHANGE - Ditto. - stop_pulling() //CIT CHANGE - Ditto... - else if(has_legs || ignore_legs) - lying = 0 - if (pulledby) - var/mob/living/L = pulledby - L.update_pull_movespeed() - if(buckled) - lying = 90*buckle_lying - else if(!lying) - if(resting) - lying = pick(90, 270) // Cit change - makes resting not force you to drop your held items - if(has_gravity()) // Cit change - Ditto - playsound(src, "bodyfall", 50, 1) // Cit change - Ditto! - else if(ko || move_and_fall || (!has_legs && !ignore_legs) || chokehold) - fall(forced = 1) - canmove = !(ko || recoveringstam || pinned || IsStun() || IsFrozen() || chokehold || buckled || (!has_legs && !ignore_legs && !has_arms)) //Cit change - makes it plausible to move while resting, adds pinning and stamina crit - density = !lying - if(lying) - if(layer == initial(layer)) //to avoid special cases like hiding larvas. - layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs - else - if(layer == LYING_MOB_LAYER) - layer = initial(layer) - update_transform() - if(!lying && lying_prev) - if(client) - client.move_delay = world.time + movement_delay() - lying_prev = lying - if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference - addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto - return canmove -*/ - - -/* var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK var/restrained = restrained() - var/canmove = !IsImmobilized() && !stun && conscious && !paralyzed && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs) + var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground + var/canmove = !IsImmobilized() && !stun && conscious && !paralyzed && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs) && !pinned + if(canmove) mobility_flags |= MOBILITY_MOVE else @@ -175,24 +128,27 @@ else mobility_flags |= MOBILITY_UI|MOBILITY_PULL - - var/canitem = !paralyzed && !stun && conscious && !chokehold && !restrained && has_arms if(canitem) mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE) else mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE) - if(!(mobility_flags & MOBILITY_USE)) + if(!(mobility_flags & MOBILITY_HOLD)) drop_all_held_items() if(!(mobility_flags & MOBILITY_PULL)) if(pulling) stop_pulling() if(!(mobility_flags & MOBILITY_UI)) unset_machine() + + if(pulledby) + pulledby.update_pull_movespeed() + + //Handle lying down, voluntary or involuntary density = !lying if(lying) if(!lying_prev) - fall(!canstand_involuntary) + set_resting(TRUE, TRUE, FALSE) if(layer == initial(layer)) //to avoid special cases like hiding larvas. layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs else @@ -201,17 +157,15 @@ update_transform() lying_prev = lying - // Movespeed mods based on arms/legs quantity - if(!get_leg_ignore()) - var/limbless_slowdown = 0 - // These checks for <2 should be swapped out for something else if we ever end up with a species with more than 2 - if(has_legs < 2) - limbless_slowdown += 6 - (has_legs * 3) - if(!has_legs && has_arms < 2) - limbless_slowdown += 6 - (has_arms * 3) - if(limbless_slowdown) - add_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=limbless_slowdown, movetypes=GROUND) - else - remove_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE) -*/ + //Handle citadel autoresist + if((mobility_flags & MOBILITY_MOVE) && !intentionalresting && canstand_involuntary && iscarbon(src) && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference + addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto + return mobility_flags + + if(HAS_TRAIT(src, TRAIT_MOBILITY_NOMOVE)) + DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE) + if(HAS_TRAIT(src, TRAIT_MOBILITY_NOPICKUP)) + DISABLE_BITFIELD(mobility_flags, MOBILITY_PICKUP) + if(HAS_TRAIT(src, TRAIT_MOBILITY_NOUSE)) + DISABLE_BITFIELD(mobility_flags, MOBILITY_USE) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 0b5b667e3f..3ace38f4e2 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -755,7 +755,7 @@ else clear_alert("locked") locked_down = state - update_canmove() + update_mobility() /mob/living/silicon/robot/proc/SetEmagged(new_state) emagged = new_state @@ -1024,13 +1024,13 @@ if(stat == CONSCIOUS) stat = UNCONSCIOUS blind_eyes(1) - update_canmove() + update_mobility() update_headlamp() else if(stat == UNCONSCIOUS) stat = CONSCIOUS adjust_blindness(-1) - update_canmove() + update_mobility() update_headlamp() diag_hud_set_status() diag_hud_set_health() diff --git a/code/modules/mob/living/silicon/robot/robot_mobility.dm b/code/modules/mob/living/silicon/robot/robot_mobility.dm index 4b0d30b06e..e2ec8aeb55 100644 --- a/code/modules/mob/living/silicon/robot/robot_mobility.dm +++ b/code/modules/mob/living/silicon/robot/robot_mobility.dm @@ -11,4 +11,4 @@ mobility_flags = newflags update_transform() update_action_buttons_icon() - return canmove + return mobility_flags diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 873aeaba62..f960ffcdf1 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -234,12 +234,66 @@ P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount, updating) return P +///////////////////////////////// DAZED //////////////////////////////////// +/mob/living/proc/IsDazed() //If we're Dazed + return has_status_effect(STATUS_EFFECT_DAZED) + +/mob/living/proc/AmountDazed() //How many deciseconds remain in our Dazed status effect + var/datum/status_effect/incapacitating/dazed/I = IsDazed() + if(I) + return I.duration - world.time + return 0 + +/mob/living/proc/Daze(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) + return + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/dazed/I = IsDazed() + if(I) + I.duration = max(world.time + amount, I.duration) + else if(amount > 0) + I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating) + return I + +/mob/living/proc/SetDazed(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) + return + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) + var/datum/status_effect/incapacitating/dazed/I = IsDazed() + if(amount <= 0) + if(I) + qdel(I) + else + if(absorb_stun(amount, ignore_canstun)) + return + if(I) + I.duration = world.time + amount + else + I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating) + return I + +/mob/living/proc/AdjustDazed(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) + return + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/dazed/I = IsDazed() + if(I) + I.duration += amount + else if(amount > 0) + I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating) + return I + //Blanket /mob/living/proc/AllImmobility(amount, updating, ignore_canstun = FALSE) Paralyze(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_Knockdown(amount, FALSE, ignore_canstun) Stun(amount, FALSE, ignore_canstun) Immobilize(amount, FALSE, ignore_canstun) + Daze(amount, FALSE, ignore_canstun) if(updating) update_mobility() @@ -248,6 +302,7 @@ _MOBILITYFLAGTEMPORARY_SetKnockdown(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun) SetImmobilized(amount, FALSE, ignore_canstun) + SetDazed(amount, FALSE, ignore_canstun) if(updating) update_mobility() @@ -256,10 +311,11 @@ _MOBILITYFLAGTEMPORARY_AdjustKnockdown(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_AdjustStun(amount, FALSE, ignore_canstun) AdjustImmobilized(amount, FALSE, ignore_canstun) + AdjustDazed(amount, FALSE, ignore_canstun) if(updating) update_mobility() -/// Makes sure all 4 of the non-knockout immobilizing status effects are lower or equal to amount. +/// Makes sure all 5 of the non-knockout immobilizing status effects are lower or equal to amount. /mob/living/proc/HealAllImmobilityUpTo(amount, updating, ignore_canstun = FALSE) if(_MOBILITYFLAGTEMPORARY_AmountStun() > amount) _MOBILITYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun) @@ -269,6 +325,8 @@ SetParalyzed(amount, FALSE, ignore_canstun) if(AmountImmobilized() > amount) SetImmobilized(amount, FALSE, ignore_canstun) + if(AmountDazed() > amount) + SetImmobilized(amount, FALSE, ignore_canstun) if(updating) update_mobility() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 975516b033..19d1b7fa53 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -407,7 +407,7 @@ dropItemToGround(W) regenerate_icons() notransform = 1 - canmove = 0 + Paralyze(INFINITY) icon = null invisibility = INVISIBILITY_MAXIMUM for(var/t in bodyparts) @@ -440,7 +440,7 @@ dropItemToGround(W) regenerate_icons() notransform = 1 - canmove = 0 + Paralyze(INFINITY) icon = null invisibility = INVISIBILITY_MAXIMUM for(var/t in bodyparts) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 31f08f0e87..310b1f7bbe 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -121,7 +121,7 @@ C.update_health_hud() //update the healthdoll C.update_body() C.update_hair() - C.update_canmove() + C.update_mobility() if(!Tsec) // Tsec = null happens when a "dummy human" used for rendering icons on prefs screen gets its limbs replaced. qdel(src) @@ -296,7 +296,7 @@ C.update_body() C.update_hair() C.update_damage_overlays() - C.update_canmove() + C.update_mobility() /obj/item/bodypart/head/attach_limb(mob/living/carbon/C, special) diff --git a/modular_citadel/code/modules/mob/living/carbon/carbon.dm b/modular_citadel/code/modules/mob/living/carbon/carbon.dm index 34ea0e789f..f0d633ba45 100644 --- a/modular_citadel/code/modules/mob/living/carbon/carbon.dm +++ b/modular_citadel/code/modules/mob/living/carbon/carbon.dm @@ -33,7 +33,7 @@ if(combatmode) if(world.time >= combatmessagecooldown) if(a_intent != INTENT_HELP) - visible_message("[src] [resting ? "tenses up" : (prob(95)? "drops into a combative stance" : (prob(95)? "poses aggressively" : "asserts dominance with their pose"))].") + visible_message("[src] [_MOBILITYFLAGTEMPORARY_resting ? "tenses up" : (prob(95)? "drops into a combative stance" : (prob(95)? "poses aggressively" : "asserts dominance with their pose"))].") else visible_message("[src] [pick("looks","seems","goes")] [pick("alert","attentive","vigilant")].") playsound_local(src, 'sound/misc/ui_toggle.ogg', 50, FALSE, pressure_affected = FALSE) //Sound from interbay!