diff --git a/code/datums/action.dm b/code/datums/action.dm index 40532987fd..78c9aa8467 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -97,7 +97,8 @@ /datum/action/proc/IsAvailable() if(!owner) return FALSE - if(!CHECK_ALL_MOBILITY(owner, required_mobility_flags)) + var/mob/living/L = owner + if(istype(L) && !CHECK_ALL_MOBILITY(L, required_mobility_flags)) return FALSE if(check_flags & AB_CHECK_RESTRAINED) if(owner.restrained()) diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index ce280c5864..da571bf51d 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -117,7 +117,8 @@ if(DEAD) to_chat(user, "You cannot [key] while dead.") return FALSE - if(restraint_check && !CHECK_MOBILITY(user, MOBILITY_MOVE)) + var/mob/living/L = user + if(restraint_check && (istype(L) && !CHECK_MOBILITY(user, MOBILITY_USE))) if(!intentional) return FALSE to_chat(user, "You cannot [key] while stunned.") diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 1860c0a0e9..9bb4a73f77 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -227,7 +227,7 @@ H.visible_message("[H] collapses!", \ "Your legs give out!") H.DefaultCombatKnockdown(80) - if(H.staminaloss && !_REFACTORING_H.IsSleeping()) + if(H.staminaloss && !H._REFACTORING_IsSleeping()) var/total_health = (H.health - H.staminaloss) if(total_health <= HEALTH_THRESHOLD_CRIT && !H.stat) H.visible_message("[user] delivers a heavy hit to [H]'s head, knocking [H.p_them()] out cold!", \ diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 7e860d9315..c19242be3f 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -750,7 +750,7 @@ AI.cancel_camera() AI.controlled_mech = src AI.remote_control = src - AI.canmove = 1 //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow. + AI.mobility_flags = MOBILIITY_FLAG_DEFAULT //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow. AI.can_shunt = 0 //ONE AI ENTERS. NO AI LEAVES. to_chat(AI, AI.can_dominate_mechs ? "Takeover of [name] complete! You are now loaded onto the onboard computer. Do not attempt to leave the station sector!" :\ "You have been uploaded to a mech's onboard computer.") @@ -922,7 +922,7 @@ brainmob.forceMove(src) //should allow relaymove brainmob.reset_perspective(src) brainmob.remote_control = src - brainmob.update_canmove() + brainmob.update_mobility() brainmob.update_mouse_pointer() icon_state = initial(icon_state) update_icon() diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm index 3493622945..8fab1408e4 100644 --- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm @@ -205,7 +205,7 @@ buckled_mob.pixel_y = buckled_mob.get_standard_pixel_y_offset(180) src.visible_message(text("[buckled_mob][buckled_mob.stat==DEAD?"'s corpse":""] slides off of the rack.")) density = FALSE - buckled_mob.AdjustKnockdown(30) + buckled_mob.DefaultCombatKnockdown(30) update_icon() useLock = FALSE // Failsafe diff --git a/code/modules/fields/timestop.dm b/code/modules/fields/timestop.dm index a063296edf..bc56fe3a49 100644 --- a/code/modules/fields/timestop.dm +++ b/code/modules/fields/timestop.dm @@ -135,7 +135,7 @@ if(L.anti_magic_check(check_anti_magic, check_holy)) immune += L return - L.Stun(20, 1, 1) + L._REFACTORING_Stun(20, TRUE, TRUE) frozen_mobs[L] = L.anchored L.anchored = TRUE global_frozen_atoms[L] = TRUE @@ -146,7 +146,7 @@ /datum/proximity_monitor/advanced/timestop/proc/unfreeze_mob(mob/living/L) escape_the_negative_zone(L) - L.AdjustStun(-20, 1, 1) + L._REFACTORING_AdjustStun(-20, TRUE, TRUE) L.anchored = frozen_mobs[L] frozen_mobs -= L global_frozen_atoms -= L diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index 2d146e396f..dc6d3a36fb 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -22,10 +22,11 @@ In all, this is a lot like the monkey code. /N switch(M.a_intent) if (INTENT_HELP) if(!recoveringstam) - SetResting(FALSE, TRUE) - AdjustAllImmobility(-60) - AdjustUnconscious(-60) - AdjustSleeping(-100) + set_resting(FALSE, TRUE, FALSE) + AdjustAllImmobility(-60, FALSE) + AdjustUnconscious(-60, FALSE) + AdjustSleeping(-100, FALSE) + update_mobililty() visible_message("[M.name] nuzzles [src] trying to wake [p_them()] up!") if(INTENT_DISARM, INTENT_HARM) if(health > 0) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ef985194fc..fc9985b050 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -885,7 +885,7 @@ if(do_after(src, 30, TRUE, target)) //Second check to make sure they're still valid to be carried if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE)) - target.resting = FALSE + target.set_resting(FALSE, TRUE) buckle_mob(target, TRUE, TRUE, 90, 1, 0) return visible_message("[src] fails to fireman carry [target]!") diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 422bd3546d..e3928fbdf2 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1370,7 +1370,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) return TRUE if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB)) - if(!H.IsKnockdown()) + if(CHECK_MOBILITY(H, MOBILITY_STAND)) H.emote("collapse") H.DefaultCombatKnockdown(RAD_MOB_KNOCKDOWN_AMOUNT) to_chat(H, "You feel weak.") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index bc99607323..6018774e5c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -422,7 +422,6 @@ else if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes") SetSleeping(400) //Short nap - update_canmove() /mob/proc/get_contents() 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 e6a6aba3a2..bf16a3e94d 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 @@ -446,4 +446,4 @@ SLEEPER CODE IS IN game/objects/items/devices/dogborg_sleeper.dm ! leaping = 0 pixel_y = initial(pixel_y) update_icons() - update_canmove() + update_mobility()