diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index e6cf3fa25d..87be7884c7 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -108,7 +108,5 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 /// can pull things #define MOBILITY_PULL (1<<6) - #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/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index a2d566d566..1ce359b91d 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -14,7 +14,7 @@ if(check_click_intercept(params,A)) return - if(stat || lockcharge || IsKnockdown() || IsStun() || IsUnconscious()) + if(stat || lockcharge || IsParalyzed() || _MOBILITYFLAGTEMPORARY_IsStun() || _MOBILITYFLAGTEMPORARY_IsUnconscious()) return var/list/modifiers = params2list(params) @@ -66,7 +66,7 @@ if(C.user_unbuckle_mob(C.buckled_mobs[1],src)) return - if(!W && get_dist(src,A) <= interaction_range) + if(!W && (get_dist(src,A) <= interaction_range))) A.attack_robot(src) return diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 0c43d33a4b..6bab87bc03 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -168,7 +168,7 @@ .["security_level"] = get_security_level() .["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0 // Amount of world's ticks in seconds, useful for calculating round duration - + //Time dilation stats. .["time_dilation_current"] = SStime_track.time_dilation_current .["time_dilation_avg"] = SStime_track.time_dilation_avg @@ -180,4 +180,4 @@ // Shuttle status, see /__DEFINES/stat.dm .["shuttle_timer"] = SSshuttle.emergency.timeLeft() // Shuttle timer, in seconds - + diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 37dd7b6a31..e7b8250494 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -39,12 +39,8 @@ container = null return ..() -/mob/living/brain/update_canmove() - if(in_contents_of(/obj/mecha)) - canmove = 1 - else - canmove = 0 - return canmove +/mob/living/brain/update_mobility() + return ((mobility_flags = (in_contents_of(/obj/mecha)? MOBILITY_FLAGS_DEFAULT : NONE))) /mob/living/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up. return diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 01a52b3b80..397fc2a0f0 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -18,7 +18,7 @@ if(health<= -maxHealth || !getorgan(/obj/item/organ/brain)) death() return - if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || health <= crit_threshold) + if(_MOBILITYFLAGTEMPORARY_IsUnconscious() || _MOBILITYFLAGTEMPORARY_IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || health <= crit_threshold) if(stat == CONSCIOUS) stat = UNCONSCIOUS blind_eyes(1) diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm index a4d5511059..8510f7278d 100644 --- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm @@ -14,9 +14,9 @@ icon_state = "larva[state]_dead" else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state? icon_state = "larva[state]_cuff" - else if(stat == UNCONSCIOUS || lying || resting) + else if(stat == UNCONSCIOUS || lying || _MOBILTIYFLAGTEMPORARY_resting) icon_state = "larva[state]_sleep" - else if(_MOBILTIYFLAGTEMPORARY_IsStun() || _MOBILITYFLAGTEMPORARY_IsParalyzed()) + else if(_MOBILTIYFLAGTEMPORARY_IsStun() || IsParalyzed()) icon_state = "larva[state]_stun" else icon_state = "larva[state]" diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index 34c268578c..0d381d9f53 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -95,7 +95,7 @@ . += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly unsimian manner." if(combatmode) - . += "[t_He] [t_is] visibly tense[resting ? "." : ", and [t_is] standing in combative stance."]" + . += "[t_He] [t_is] visibly tense[CHECK_BITFIELD(mobility_flags, MOBILITY_STAND) ? "." : ", and [t_is] standing in combative stance."]" var/trait_exam = common_trait_examine() if (!isnull(trait_exam)) diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 56ef4fe24a..89bb0f3bff 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -50,17 +50,11 @@ // taken from /mob/living/carbon/human/interactive/ /mob/living/carbon/monkey/proc/IsDeadOrIncap(checkDead = TRUE) - if(!canmove) - return 1 + if(!CHECK_BITFIELD(mobility_flags, MOBILITY_MOVE)) + return TRUE if(health <= 0 && checkDead) - return 1 - if(IsUnconscious()) - return 1 - if(IsStun() || IsKnockdown()) - return 1 - if(stat) - return 1 - return 0 + return TRUE + return FALSE /mob/living/carbon/monkey/proc/battle_screech() if(next_battle_screech < world.time) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 427318ae84..4376e99826 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -13,7 +13,7 @@ if(!client) if(stat == CONSCIOUS) - if(on_fire || buckled || restrained() || (resting && canmove)) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting) + if(on_fire || buckled || restrained() || (!CHECK_BITFIELD(mobility_flags, MOBILITY_STAND) && CHECK_BITFIELD(mobility_flags, MOBILITY_MOVE))) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting) if(!resisting && prob(MONKEY_RESIST_PROB)) resisting = TRUE walk_to(src,0) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a87510233c..7667113937 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -672,11 +672,11 @@ var/obj/C = loc C.container_resist(src) - else if(canmove) + else if(CHECK_BITFIELD(mobility_flags, MOBILITY_MOVE)) if(on_fire) resist_fire() //stop, drop, and roll return - if(resting) //cit change - allows resisting out of resting + if(_MOBILTIYFLAGTEMPORARY_resting) //cit change - allows resisting out of resting resist_a_rest() // ditto return if(resist_embedded()) //Citadel Change for embedded removal memes diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm index ec5f2e2c11..2a98e283fd 100644 --- a/code/modules/mob/living/living_mobility.dm +++ b/code/modules/mob/living/living_mobility.dm @@ -20,37 +20,28 @@ if(disarm_items) drop_all_held_items() - - - - - /mob/living/proc/lay_down() set name = "Rest" set category = "IC" - - if(client && client.prefs && client.prefs.autostand) + if(client?.prefs?.autostand) intentionalresting = !intentionalresting - to_chat(src, "You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].") + to_chat(src, "You are now attempting to [intentionalresting ? "[!_MOBILTIYFLAGTEMPORARY_resting ? "lay down and ": ""]stay down" : "[_MOBILTIYFLAGTEMPORARY_resting ? "get up and ": ""]stay up"].") if(intentionalresting && !resting) - resting = TRUE - update_canmove() + set_resting(TRUE, FALSE) else resist_a_rest() else - if(!resting) - resting = TRUE + if(!_MOBILTIYFLAGTEMPORARY_resting) + set_resting(TRUE, FALSE) to_chat(src, "You are now laying down.") - update_canmove() else resist_a_rest() /mob/living/proc/resist_a_rest(automatic = FALSE, ignoretimer = FALSE) //Lets mobs resist out of resting. Major QOL change with combat reworks. - if(!resting || stat || attemptingstandup) + if(!_MOBILITYFLAGTEMPORARY_resting || stat || attemptingstandup) return FALSE if(ignoretimer) - resting = FALSE - update_canmove() + set_resting(FALSE, FALSE) return TRUE else var/totaldelay = 3 //A little bit less than half of a second as a baseline for getting up from a rest @@ -77,9 +68,8 @@ var/usernotice = automatic ? "You are now getting up. (Auto)" : "You are now getting up." visible_message("[standupwarning]", usernotice, vision_distance = 5) if(do_after(src, totaldelay, target = src)) - resting = FALSE + set_resting(FALSE, FALSE) attemptingstandup = FALSE - update_canmove() return TRUE else visible_message("[src] falls right back down.", "You fall right back down.") @@ -91,18 +81,72 @@ //Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. //Robots, animals and brains have their own version so don't worry about them /mob/living/proc/update_mobility() -/* var/stat_softcrit = stat == SOFT_CRIT var/stat_conscious = (stat == CONSCIOUS) || stat_softcrit - var/conscious = !IsUnconscious() && stat_conscious && !HAS_TRAIT(src, TRAIT_DEATHCOMA) + + var/conscious = !_MOBILITYFLAGTEMPORARY_IsUnconscious() && stat_conscious && !HAS_TRAIT(src, TRAIT_DEATHCOMA) + + var/has_arms = get_num_arms() + var/has_legs = get_num_legs() + var/ignore_legs = get_leg_ignore() + var/stun = _MOBILITYFLAGTEMPORARY_IsStun() + var/paralyze = IsParalyzed() + var/knockdown = _MOBILITYFLAGTEMPORARY_IsKnockdown() + 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/has_legs = get_num_legs() - var/has_arms = get_num_arms() - var/paralyzed = IsParalyzed() - var/stun = IsStun() - var/knockdown = IsKnockdown() - var/ignore_legs = get_leg_ignore() var/canmove = !IsImmobilized() && !stun && conscious && !paralyzed && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs) if(canmove) mobility_flags |= MOBILITY_MOVE @@ -172,55 +216,3 @@ remove_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE) */ -//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. -//Robots, animals and brains have their own version so don't worry about them -/mob/living/proc/update_canmove() -/* - 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/has_legs = get_num_legs() - var/has_arms = get_num_arms() - var/ignore_legs = get_leg_ignore() - 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 -*/ diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm index 517ced2e7b..8e0375fae1 100644 --- a/code/modules/mob/living/silicon/pai/pai_shell.dm +++ b/code/modules/mob/living/silicon/pai/pai_shell.dm @@ -17,7 +17,6 @@ return FALSE emitter_next_use = world.time + emittercd - canmove = TRUE density = TRUE if(istype(card.loc, /obj/item/pda)) var/obj/item/pda/P = card.loc @@ -37,6 +36,7 @@ C.push_data() forceMove(get_turf(card)) card.forceMove(src) + update_mobility() if(client) client.perspective = EYE_PERSPECTIVE client.eye = src @@ -63,11 +63,11 @@ var/turf/T = drop_location() card.forceMove(T) forceMove(card) - canmove = FALSE density = FALSE set_light(0) holoform = FALSE - set_resting(FALSE, TRUE) + set_resting(FALSE, TRUE, FALSE) + update_mobility() /mob/living/silicon/pai/proc/choose_chassis() if(!isturf(loc) && loc != card) @@ -100,7 +100,7 @@ /mob/living/silicon/pai/lay_down() . = ..() if(loc != card) - visible_message("[src] [resting? "lays down for a moment..." : "perks up from the ground"]") + visible_message("[src] [_MOBILITYFLAGTEMPORARY_resting? "lays down for a moment..." : "perks up from the ground"]") update_icon() /mob/living/silicon/pai/start_pulling(atom/movable/AM, gs) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 1dafb3c550..39a8858106 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -675,7 +675,7 @@ if(module.cyborg_base_icon == "robot") icon = 'icons/mob/robots.dmi' pixel_x = initial(pixel_x) - if(stat != DEAD && !(IsUnconscious() || IsStun() || IsKnockdown() || low_power_mode)) //Not dead, not stunned. + if(stat != DEAD && !(_MOBILITYFLAGTEMPORARY_IsUnconscious() ||_MOBILITYFLAGTEMPORARY_IsStun() || _MOBILITYFLAGTEMPORARY_IsKnockdown() || IsParalyzed() || low_power_mode)) //Not dead, not stunned. if(!eye_lights) eye_lights = new() if(lamp_intensity > 2) @@ -699,7 +699,7 @@ update_fire() if(client && stat != DEAD && module.dogborg == TRUE) - if(resting) + if(_MOBILITYFLAGTEMPORARY_resting) if(sitting) icon_state = "[module.cyborg_base_icon]-sit" if(bellyup) @@ -724,8 +724,6 @@ connected_ai.connected_robots -= src src.connected_ai = null lawupdate = 0 - lockcharge = 0 - canmove = 1 scrambledcodes = 1 //Disconnect it's camera so it's not so easily tracked. if(!QDELETED(builtInCamera)) @@ -734,6 +732,7 @@ // Instead of being listed as "deactivated". The downside is that I'm going // to have to check if every camera is null or not before doing anything, to prevent runtime errors. // I could change the network to null but I don't know what would happen, and it seems too hacky for me. + update_mobility() /mob/living/silicon/robot/mode() set name = "Activate Held Object" @@ -1021,7 +1020,7 @@ if(health <= -maxHealth) //die only once death() return - if(_MOBILITYFLAGTEMPORARY_IsUnconscious() || _MOBILITYFLAGTEMPORARY_IsStun() || _MOBILITYFLAGTEMPORARY_IsParalyze() || getOxyLoss() > maxHealth*0.5) + if(_MOBILITYFLAGTEMPORARY_IsUnconscious() || _MOBILITYFLAGTEMPORARY_IsStun() || IsParalyzed() || getOxyLoss() > maxHealth*0.5) if(stat == CONSCIOUS) stat = UNCONSCIOUS blind_eyes(1) diff --git a/code/modules/mob/living/simple_animal/bot/firebot.dm b/code/modules/mob/living/simple_animal/bot/firebot.dm index 2b52da6821..06fba520d8 100644 --- a/code/modules/mob/living/simple_animal/bot/firebot.dm +++ b/code/modules/mob/living/simple_animal/bot/firebot.dm @@ -170,7 +170,7 @@ if(!..()) return - if(IsStun()) + if(_MOBILITYFLAGTEMPORARY_IsStun() || IsParalyzed()) old_target_fire = target_fire target_fire = null mode = BOT_IDLE @@ -287,7 +287,7 @@ if(!on) icon_state = "firebot0" return - if(IsStun()) + if(_MOBILITYFLAGTEMPORARY_IsStun() || IsParalyzed()) icon_state = "firebots1" else if(stationary_mode) //Bot has yellow light to indicate stationary mode. icon_state = "firebots1" diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f70080c5e8..2dfa02debb 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -417,17 +417,17 @@ else ..() -/mob/living/simple_animal/update_canmove(value_otherwise = TRUE) - if(IsUnconscious() || IsStun() || IsKnockdown() || stat || resting) +/mob/living/simple_animal/update_mobility(value_otherwise = MOBILITY_FLAGS_DEFAULT) + if(_MOBILITYFLAGTEMPORARY_IsUnconscious() || _MOBILITYFLAGTEMPORARY_IsStun() || IsParalyzed() || stat || resting) drop_all_held_items() - canmove = FALSE + mobility_flags = NONE else if(buckled) - canmove = FALSE + mobility_flags = ~MOBILITY_MOVE else - canmove = value_otherwise + mobility_flags = MOBILITY_FLAGS_DEFAUTL update_transform() update_action_buttons_icon() - return canmove + return mobility_flags /mob/living/simple_animal/update_transform() var/matrix/ntransform = matrix(transform) //aka transform.Copy() diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 61295a8ad5..126f0a4263 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -244,27 +244,27 @@ update_mobility() /mob/living/proc/SetAllImmobility(amount, updating, ignore_canstun = FALSE) - _MOBILITYFLAGTEMPORARY_SetParalyzed(amount, FALSE, ignore_canstun) + SetParalyzed(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_SetKnockdown(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun) - _MOBILITYFLAGTEMPORARY_SetImmobilized(amount, FALSE, ignore_canstun) + SetImmobilized(amount, FALSE, ignore_canstun) if(updating) update_mobility() /mob/living/proc/AdjustAllImmobility(amount, updating, ignore_canstun = FALSE) - _MOBILITYFLAGTEMPORARY_AdjustParalyzed(amount, FALSE, ignore_canstun) + AdjustParalyzed(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_AdjustKnockdown(amount, FALSE, ignore_canstun) _MOBILITYFLAGTEMPORARY_AdjustStun(amount, FALSE, ignore_canstun) - _MOBILITYFLAGTEMPORARY_AdjustImmobilized(amount, FALSE, ignore_canstun) + AdjustImmobilized(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. /mob/living/proc/HealAllImmobilityupto(amount, updating, ignore_canstun = FALSE) - if(AmountStun() > amount) - SetStun(amount, FALSE, ignore_canstun) - if(AmountKnockdown() > amount) - SetKnockdown(amount, FALSE, ignore_canstun) + if(_MOBILTIYFLAGTEMPORARY_AmountStun() > amount) + _MOBILTIYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun) + if(_MOBILTIYFLAGTEMPORARY_AmountKnockdown() > amount) + _MOBILTIYFLAGTEMPORARY_SetKnockdown(amount, FALSE, ignore_canstun) if(AmountParalyzed() > amount) SetParalyzed(amount, FALSE, ignore_canstun) if(AmountImmobilized() > amount) @@ -286,7 +286,7 @@ if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) return if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() + var/datum/status_effect/incapacitating/unconscious/U = _MOBILTIYFLAGTEMPORARY_IsUnconscious() if(U) U.duration = max(world.time + amount, U.duration) else if(amount > 0) @@ -344,7 +344,7 @@ if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) return if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() + var/datum/status_effect/incapacitating/sleeping/S = _MOBILTIYFLAGTEMPORARY_IsSleeping() if(amount <= 0) if(S) qdel(S) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 6394b45aa7..6acface60f 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -187,8 +187,7 @@ //Make mob invisible and spawn animation - notransform = 1 - canmove = 0 + notransform = TRUE Stun(22, ignore_canstun = TRUE) icon = null cut_overlays() @@ -365,8 +364,8 @@ else dropItemToGround(W) regenerate_icons() - notransform = 1 - canmove = 0 + notransform = TRUE + Paralyze(INFINITY) icon = null invisibility = INVISIBILITY_MAXIMUM for(var/t in bodyparts) @@ -485,8 +484,8 @@ for(var/obj/item/W in src) dropItemToGround(W) regenerate_icons() - notransform = 1 - canmove = 0 + notransform = TRUE + Paralyze(INFINITY) icon = null invisibility = INVISIBILITY_MAXIMUM for(var/t in bodyparts) //this really should not be necessary @@ -516,7 +515,7 @@ regenerate_icons() notransform = TRUE - canmove = FALSE + Paralyze(INFINITY) icon = null invisibility = INVISIBILITY_MAXIMUM var/mob/living/simple_animal/hostile/gorilla/new_gorilla = new (get_turf(src)) @@ -545,7 +544,7 @@ regenerate_icons() notransform = TRUE - canmove = FALSE + Paralyze(INFINITY) icon = null invisibility = INVISIBILITY_MAXIMUM diff --git a/modular_citadel/code/modules/mob/living/living.dm b/modular_citadel/code/modules/mob/living/living.dm index 854294e4e0..b3f5dd041d 100644 --- a/modular_citadel/code/modules/mob/living/living.dm +++ b/modular_citadel/code/modules/mob/living/living.dm @@ -52,17 +52,17 @@ if(total_health) if(!recoveringstam && total_health >= STAMINA_CRIT && !stat) to_chat(src, "You're too exhausted to keep going...") - resting = TRUE + set_resting(TRUE, FALSE, FALSE) if(combatmode) toggle_combat_mode(TRUE) recoveringstam = TRUE filters += CIT_FILTER_STAMINACRIT - update_canmove() + update_mobility() if(recoveringstam && total_health <= STAMINA_SOFTCRIT) to_chat(src, "You don't feel nearly as exhausted anymore.") recoveringstam = FALSE filters -= CIT_FILTER_STAMINACRIT - update_canmove() + update_mobility() update_health_hud() /mob/living/proc/update_hud_sprint_bar()