diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index cdf0f604b8..71c5570961 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -359,7 +359,7 @@ GLOBAL_LIST_EMPTY(species_list)
checked_health["health"] = health
return ..()
-/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null)
+/proc/do_after(mob/user, var/delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null, required_mobility_flags = (MOBILITY_STAND|MOBILITY_USE|MOBILITY_MOVE))
if(!user)
return 0
var/atom/Tloc = null
@@ -396,7 +396,7 @@ GLOBAL_LIST_EMPTY(species_list)
drifting = 0
Uloc = user.loc
- if(QDELETED(user) || user.stat || user.IsKnockdown() || user.IsStun() || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
+ if(QDELETED(user) || user.stat || !CHECK_ALL_MOBILITY(user, required_mobility_flags) || (!drifting && user.loc != Uloc) || (extra_checks && !extra_checks.Invoke()))
. = 0
break
diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm
index 599c492d4c..ce280c5864 100644
--- a/code/datums/emotes.dm
+++ b/code/datums/emotes.dm
@@ -117,7 +117,7 @@
if(DEAD)
to_chat(user, "You cannot [key] while dead.")
return FALSE
- if(restraint_check && (user.IsStun() || user.IsKnockdown()))
+ if(restraint_check && !CHECK_MOBILITY(user, MOBILITY_MOVE))
if(!intentional)
return FALSE
to_chat(user, "You cannot [key] while stunned.")
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 6b8cac544e..d861802432 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -91,7 +91,8 @@ Buildable meters
set name = "Flip Pipe"
set src in view(1)
- if ( usr.stat || usr.restrained() || !usr.canmove )
+ var/mob/living/L = usr
+ if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
do_a_flip()
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index 1f2df63690..33ed274350 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -66,7 +66,7 @@
M.buckled = src
M.setDir(dir)
buckled_mobs |= M
- M.update_canmove()
+ M.update_mobility()
M.throw_alert("buckled", /obj/screen/alert/restrained/buckled)
post_buckle_mob(M)
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 1a73c87440..55d9aef4c0 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -177,14 +177,13 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
set category = "Object"
set src in oview(1)
- if(!isturf(loc) || usr.stat || usr.restrained() || !usr.canmove)
+ var/mob/living/L = usr
+ if(!istype(L) || !isturf(loc) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
- var/turf/T = src.loc
-
- src.loc = null
-
- src.loc = T
+ var/turf/T = loc
+ loc = null
+ loc = T
/obj/item/examine(mob/user) //This might be spammy. Remove?
. = ..()
diff --git a/code/game/objects/items/religion.dm b/code/game/objects/items/religion.dm
index ddc49a456c..e1c3ba3a2e 100644
--- a/code/game/objects/items/religion.dm
+++ b/code/game/objects/items/religion.dm
@@ -64,8 +64,7 @@
/obj/item/banner/proc/inspiration(mob/living/carbon/human/H)
H.adjustBruteLoss(-15)
H.adjustFireLoss(-15)
- H.AdjustStun(-40)
- H.AdjustKnockdown(-40)
+ H.AdjustAllImmobility(-40)
H.AdjustUnconscious(-40)
playsound(H, 'sound/magic/staff_healing.ogg', 25, FALSE)
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index 178476ead4..adb2d14acf 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -99,7 +99,7 @@
else
user.visible_message("[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...", \
"You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...")
- if(M.resting && !M.recoveringstam)
+ if(!CHECK_MOBILITY(M, MOBILITY_STAND) && !M.recoveringstam)
M.set_resting(FALSE, TRUE)
else
user.visible_message("[user] bops [M] on the head!", \
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index b6cfc15137..e8f8d5a3a6 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -45,7 +45,8 @@
if(!climbable)
return
if(user == O && iscarbon(O))
- if(user.canmove)
+ var/mob/living/L = O
+ if(CHECK_MOBILITY(O, MOBILITY_MOVE))
climb_structure(user)
return
if(!istype(O, /obj/item) || user.get_active_held_item() != O)
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index cdae11c066..17ca178cd9 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -44,7 +44,7 @@
//pod insertion
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/living/user)
- if(!istype(user) || !CHECK_MOBILLITY(user, MOBILITY_USE))
+ if(!istype(user) || !CHECK_MOBILITY(user, MOBILITY_USE))
return
if(!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
return
diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm
index dffdeaf7fc..8b1e093a60 100644
--- a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm
+++ b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm
@@ -96,7 +96,7 @@
// Incap?
if(must_be_capacitated)
var/mob/living/L = owner
- if (L.incapacitated(TRUE, TRUE) || L.resting && !can_be_immobilized)
+ if (L.incapacitated(TRUE, TRUE) || !CHECK_MOBILITY(L, MOBILITY_STAND) && !can_be_immobilized)
if(display_error)
to_chat(owner, "Not while you're incapacitated!")
return FALSE
diff --git a/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm b/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm
index 0da9ab5ba3..6b240a17f9 100644
--- a/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm
+++ b/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm
@@ -96,9 +96,9 @@
// TELEPORT: Move to Coffin & Close it!
do_teleport(owner, bloodsuckerdatum.coffin, no_effects = TRUE, forced = TRUE, channel = TELEPORT_CHANNEL_QUANTUM) // in teleport.dm?
// SLEEP
- user.resting = TRUE
+ user.set_resting(TRUE, TRUE, FALSE)
//user.Unconscious(30,0)
- user.Stun(30,1)
+ user.Stun(30, TRUE)
// CLOSE LID: If fail, force me in.
if (!bloodsuckerdatum.coffin.close(owner))
bloodsuckerdatum.coffin.insert(owner) // Puts me inside.
diff --git a/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm b/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm
index 94bc0e11d0..f7094c57f0 100644
--- a/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm
+++ b/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm
@@ -76,7 +76,7 @@
to_chat(owner, "You must be facing your victim.")
return FALSE
// Check: Target facing me?
- if (!target.resting && !is_A_facing_B(target,owner))
+ if (CHECK_MOBILITY(target, MOBILITY_STAND) && !is_A_facing_B(target,owner))
if (display_error)
to_chat(owner, "Your victim must be facing you to see into your eyes.")
return FALSE
diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm
index 346d948c79..da7ca59f7f 100644
--- a/code/modules/antagonists/changeling/powers/fakedeath.dm
+++ b/code/modules/antagonists/changeling/powers/fakedeath.dm
@@ -18,7 +18,6 @@
user.tod = STATION_TIME_TIMESTAMP("hh:mm:ss")
user.fakedeath("changeling") //play dead
user.update_stat()
- user.update_canmove()
addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME, TIMER_UNIQUE)
return TRUE
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index f8cd17ce08..1319f16595 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -965,7 +965,7 @@
return FALSE
if(hallucinating())
return TRUE
- if(IsSleeping())
+ if(_REFACTORING_IsSleeping())
return TRUE
if(HAS_TRAIT(src, TRAIT_DUMB))
return TRUE
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 7aa023d0c1..422bd3546d 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -1843,8 +1843,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
to_chat(user, "You can only force yourself up if you're on the ground.")
return
user.visible_message("[user] forces [p_them()]self up to [p_their()] feet!", "You force yourself up to your feet!")
- user.resting = 0
- user.update_canmove()
+ user.set_resting(FALSE, TRUE)
user.adjustStaminaLossBuffered(user.stambuffer) //Rewards good stamina management by making it easier to instantly get up from resting
playsound(user, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -1884,7 +1883,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
//Thank you based whoneedsspace
target_collateral_human = locate(/mob/living/carbon/human) in target_shove_turf.contents
- if(target_collateral_human && !target_collateral_human.resting)
+ if(target_collateral_human && CHECK_MOBILITY(target_collateral_human, MOBILITY_STAND))
shove_blocked = TRUE
else
target_collateral_human = null
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 0061c7ed70..25890145e8 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -506,7 +506,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
/mob/living/carbon/handle_status_effects()
..()
if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active
- adjustStaminaLoss(resting ? (recoveringstam ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
+ adjustStaminaLoss(!CHECK_MOBILITY(src, MOBILITY_STAND) ? (recoveringstam ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
if(!recoveringstam && incomingstammult != 1)
incomingstammult = max(0.01, incomingstammult)
@@ -519,7 +519,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
adjustStaminaLoss(drainrate*0.5)
//END OF CIT CHANGES
- var/restingpwr = 1 + 4 * resting
+ var/restingpwr = 1 + 4 * !CHECK_MOBILITY(src, MOBILITY_STAND)
//Dizziness
if(dizziness)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 0b2d2167bf..bc99607323 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -128,7 +128,7 @@
return TRUE
attemptingcrawl = TRUE
visible_message("[src] is attempting to crawl under [L].", "You are now attempting to crawl under [L].")
- if(!do_after(src, CRAWLUNDER_DELAY, target = src) || !resting)
+ if(!do_after(src, CRAWLUNDER_DELAY, target = src) || CHECK_MOBILITY(src, MOBILITY_STAND))
attemptingcrawl = FALSE
return TRUE
var/src_passmob = (pass_flags & PASSMOB)
diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm
index 97cb0c67b1..9c2881ae48 100644
--- a/code/modules/mob/living/living_mobility.dm
+++ b/code/modules/mob/living/living_mobility.dm
@@ -98,7 +98,7 @@
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
var/restrained = restrained()
var/pinned = _REFACTORING_resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
- var/canmove = !IsImmobilized() && !stun && conscious && !paralyze && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && (has_arms || ignore_legs || has_legs) && !pinned
+ var/canmove = !immobilize && !stun && conscious && !paralyze && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && (has_arms || ignore_legs || has_legs) && !pinned
if(canmove)
mobility_flags |= MOBILITY_MOVE
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index 6cc74bd0f7..3e6c4e4ab7 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -213,7 +213,7 @@ Auto Patrol: []"},
return
if(iscarbon(A))
var/mob/living/carbon/C = A
- if(C.canmove || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun.
+ if(CHECK_MOBILITY(C, MOBILITY_MOVE|MOBILITY_USE|MOBILITY_STAND) || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun.
stun_attack(A)
else if(C.canBeHandcuffed() && !C.handcuffed)
cuff(A)
diff --git a/code/modules/mob/living/simple_animal/slime/slime_mobility.dm b/code/modules/mob/living/simple_animal/slime/slime_mobility.dm
index d82e945172..5be5ff4e36 100644
--- a/code/modules/mob/living/simple_animal/slime/slime_mobility.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime_mobility.dm
@@ -1,4 +1,4 @@
-/mob/living/simple_animal/slime/proc/update_mobility()
+/mob/living/simple_animal/slime/update_mobility()
. = ..()
if(Tempstun && !buckled)
DISABLE_BITFIELD(., MOBILITY_MOVE)
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index 19d1b7fa53..34b3dee2a0 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -29,9 +29,8 @@
dropItemToGround(W)
//Make mob invisible and spawn animation
- notransform = 1
- canmove = 0
- Stun(22, ignore_canstun = TRUE)
+ notransform = TRUE
+ Stun(INFINITY, ignore_canstun = TRUE)
icon = null
cut_overlays()
invisibility = INVISIBILITY_MAXIMUM
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index d540cd02fe..577544d4b7 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -328,7 +328,7 @@
addiction_tick++
if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates.
C.updatehealth()
- C.update_canmove()
+ C.update_mobility()
C.update_stamina()
update_total()
diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
index 36621aa662..fea741231e 100644
--- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
@@ -243,8 +243,7 @@
/datum/reagent/teslium/energized_jelly/on_mob_life(mob/living/carbon/M)
if(isjellyperson(M))
shock_timer = 0 //immune to shocks
- M.AdjustStun(-40, 0)
- M.AdjustKnockdown(-40, 0)
+ M.AdjustAllImmobility(-40, 0)
M.AdjustUnconscious(-40, 0)
M.adjustStaminaLoss(-2, 0)
if(isluminescent(M))
diff --git a/modular_citadel/code/datums/status_effects/debuffs.dm b/modular_citadel/code/datums/status_effects/debuffs.dm
deleted file mode 100644
index 6dcfc84a87..0000000000
--- a/modular_citadel/code/datums/status_effects/debuffs.dm
+++ /dev/null
@@ -1,18 +0,0 @@
-/datum/status_effect/incapacitating/knockdown/on_creation(mob/living/new_owner, set_duration, updating_canmove, override_duration, override_stam)
- if(iscarbon(new_owner) && (isnum(set_duration) || isnum(override_duration)))
- if(istype(new_owner.buckled, /obj/vehicle/ridden))
- var/obj/buckl = new_owner.buckled
- buckl.unbuckle_mob(new_owner)
- new_owner.resting = TRUE
- new_owner.adjustStaminaLoss(isnull(override_stam)? set_duration*0.25 : override_stam)
- if(isnull(override_duration) && (set_duration > 80))
- set_duration = set_duration*0.01
- return ..()
- else if(!isnull(override_duration))
- set_duration = override_duration
- return ..()
- else if(updating_canmove)
- new_owner.update_canmove()
- qdel(src)
- else
- . = ..()
diff --git a/modular_citadel/code/modules/mob/living/carbon/human/human.dm b/modular_citadel/code/modules/mob/living/carbon/human/human.dm
index e5d386b56b..9993b70d6a 100644
--- a/modular_citadel/code/modules/mob/living/carbon/human/human.dm
+++ b/modular_citadel/code/modules/mob/living/carbon/human/human.dm
@@ -4,7 +4,7 @@
/mob/living/carbon/human/resist_embedded()
if(handcuffed || legcuffed || (wear_suit && wear_suit.breakouttime))
return
- if(canmove && !on_fire)
+ if(CHECK_MOBILITY(src, MOBILITY_MOVE) && !on_fire)
for(var/obj/item/bodypart/L in bodyparts)
if(istype(L) && L.embedded_objects.len)
for(var/obj/item/I in L.embedded_objects)
diff --git a/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm b/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm
index 6437834e92..e6a6aba3a2 100644
--- a/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm
+++ b/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm
@@ -54,7 +54,7 @@ SLEEPER CODE IS IN game/objects/items/devices/dogborg_sleeper.dm !
var/mob/living/M = A
var/cachedstam = M.getStaminaLoss()
var/totalstuntime = cachedstam * stamtostunconversion * (M.lying ? 2 : 1)
- if(!M.resting)
+ if(CHECK_MOBILITY(M, MOBILITY_STAND))
M.DefaultCombatKnockdown(cachedstam*2) //BORK BORK. GET DOWN.
M.Stun(totalstuntime)
user.do_attack_animation(A, ATTACK_EFFECT_BITE)
diff --git a/tgstation.dme b/tgstation.dme
index 37300f0ab1..7d6e73adb7 100755
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -3066,7 +3066,6 @@
#include "modular_citadel\code\datums\components\material_container.dm"
#include "modular_citadel\code\datums\components\souldeath.dm"
#include "modular_citadel\code\datums\status_effects\chems.dm"
-#include "modular_citadel\code\datums\status_effects\debuffs.dm"
#include "modular_citadel\code\datums\wires\autoylathe.dm"
#include "modular_citadel\code\game\machinery\displaycases.dm"
#include "modular_citadel\code\game\machinery\Sleeper.dm"