From 24c1baddd0d70b51d84c533a33f670e2d28079f0 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 10 Jan 2020 05:50:19 -0800 Subject: [PATCH] compile compile compile --- code/game/machinery/computer/robot.dm | 7 +++---- code/game/mecha/equipment/tools/medical_tools.dm | 3 +-- code/game/objects/items/devices/laserpointer.dm | 3 +-- code/game/objects/items/holy_weapons.dm | 2 +- code/game/objects/items/hot_potato.dm | 3 +-- code/game/objects/items/robot/robot_items.dm | 9 +++------ code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/storage/bags.dm | 3 ++- code/game/objects/items/toys.dm | 7 ++++++- code/modules/assembly/flash.dm | 2 +- code/modules/clothing/head/misc_special.dm | 2 +- code/modules/mob/living/living_defense.dm | 6 +++--- code/modules/mob/living/living_mobility.dm | 1 - code/modules/mob/living/simple_animal/simple_animal.dm | 4 ++-- code/modules/mob/living/status_procs.dm | 4 ++-- 15 files changed, 28 insertions(+), 30 deletions(-) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index a9050a63ab..2df3dd5fe5 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -37,12 +37,11 @@ dat += "[R.name] |" if(R.stat) dat += " Not Responding |" - else if (!R.canmove) + else if(R.locked_down) dat += " Locked Down |" else dat += " Operating Normally |" - if (!R.canmove) - else if(R.cell) + if(R.cell) dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" else dat += " No Cell Installed |" @@ -62,7 +61,7 @@ dat += "(Hack) " else if(IsAdminGhost(user) && !R.emagged) dat += "(Hack) " - dat += "([R.canmove ? "Lockdown" : "Release"]) " + dat += "([R.locked_down? "Lockdown" : "Release"]) " dat += "(Destroy)" dat += "
" diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index ae3fdb15b4..8b043de9ce 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -225,8 +225,7 @@ return if(M.health > 0) M.adjustOxyLoss(-1) - M.AdjustStun(-80) - M.AdjustKnockdown(-80) + M.AdjustAllImmobility(-80) M.AdjustUnconscious(-80) if(M.reagents.get_reagent_amount("epinephrine") < 5) M.reagents.add_reagent("epinephrine", 5) diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 5a343ced30..69454b34d3 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -144,8 +144,7 @@ if(prob(50)) C.visible_message("[C] pounces on the light!","LIGHT!") C.Move(targloc) - C.resting = TRUE - C.update_canmove() + C.set_resting(TRUE) else C.visible_message("[C] looks uninterested in your games.","You spot [user] shining [src] at you. How insulting!") diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index b6a218520f..151a0c4bf1 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -72,7 +72,7 @@ display_names += list(initial(A.name) = A) var/choice = input(M,"What holy armor kit would you like to order?","Holy Armor Theme") as null|anything in display_names - if(QDELETED(src) || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || GLOB.holy_armor_type) + if(QDELETED(src) || !choice || !CHECK_BITFIELD(M.mobility_flags, MOBILITY_USE) || !in_range(M, src) || GLOB.holy_armor_type) return var/index = display_names.Find(choice) diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm index 40f2741a17..70f83c7ba8 100644 --- a/code/game/objects/items/hot_potato.dm +++ b/code/game/objects/items/hot_potato.dm @@ -71,8 +71,7 @@ if(stimulant) if(isliving(loc)) var/mob/living/L = loc - L.SetStun(0) - L.SetKnockdown(0) + L.SetAllImmobility(0) L.SetSleeping(0) L.SetUnconscious(0) L.reagents.add_reagent("muscle_stimulant", CLAMP(5 - L.reagents.get_reagent_amount("muscle_stimulant"), 0, 5)) //If you don't have legs or get bola'd, tough luck! diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 4d006e3806..43812ce2f0 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -80,9 +80,8 @@ else user.visible_message("[user] hugs [M] to make [M.p_them()] feel better!", \ "You hug [M] to make [M.p_them()] feel better!") - if(M.resting && !M.recoveringstam) - M.resting = FALSE - M.update_canmove() + if(M._MOBILITYFLAGTEMPORARY_resting && !M.recoveringstam) + M.set_resting(FALSE, TRUE) else user.visible_message("[user] pets [M]!", \ "You pet [M]!") @@ -101,8 +100,7 @@ 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) - M.resting = FALSE - M.update_canmove() + M.set_resting(FALSE, TRUE) else user.visible_message("[user] bops [M] on the head!", \ "You bop [M] on the head!") @@ -114,7 +112,6 @@ M.electrocute_act(5, "[user]", safety = 1) user.visible_message("[user] electrocutes [M] with [user.p_their()] touch!", \ "You electrocute [M] with your touch!") - M.update_canmove() else if(!iscyborg(M)) M.adjustFireLoss(10) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 03a643c690..ac4f3e1d49 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -318,7 +318,7 @@ if(!locomotion) O.locked_down = 1 - O.update_canmove() + O.update_mobility() to_chat(O, "Error: Servo motors unresponsive.") else diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm index a5f438ea65..618a4b7d31 100644 --- a/code/game/objects/items/storage/bags.dm +++ b/code/game/objects/items/storage/bags.dm @@ -231,7 +231,8 @@ set name = "Activate Seed Extraction" set category = "Object" set desc = "Activate to convert your plants into plantable seeds." - if(usr.stat || !usr.canmove || usr.restrained()) + var/mob/living/L = usr + if(istype(L) && !CHECK_BITFIELD(L.mobility_flags, MOBILITY_USE)) return for(var/obj/item/O in contents) seedify(O, 1) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 08c43f0437..01d43203f0 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1076,7 +1076,12 @@ return ..() /obj/item/toy/cards/singlecard/attack_self(mob/user) - if(usr.stat || !ishuman(usr) || !usr.canmove || usr.restrained()) + . = ..() + if(.) + return + if(!ishuman(user)) + return + if(!CHECK_BITFIELD(user, MOBILITY_USE)) return Flip() diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index b8efc28b1c..4bdfc29c36 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -203,7 +203,7 @@ /obj/item/assembly/flash/cyborg/attack(mob/living/M, mob/user) . = ..() new /obj/effect/temp_visual/borgflash(get_turf(src)) - if(. && !CONFIG_GET(flag/disable_borg_flash_knockdown) && iscarbon(M) && !M.resting && !M.get_eye_protection()) + if(. && !CONFIG_GET(flag/disable_borg_flash_knockdown) && iscarbon(M) && CHECK_BITFIELD(M.mobility_flags, MOBILITY_STAND) && !M.get_eye_protection()) M.DefaultCombatKnockdown(80) /obj/item/assembly/flash/cyborg/attack_self(mob/user) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 127bf4c773..b24af9769a 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -282,7 +282,7 @@ if(target.get_item_by_slot(SLOT_HEAD) != src) return QDEL_NULL(paranoia) - if(!target.IsUnconscious()) + if(!target._MOBILITYFLAGTEMPORARY_IsUnconscious()) to_chat(target, "Your zealous conspirationism rapidly dissipates as the donned hat warps up into a ruined mess. All those theories starting to sound like nothing but a ridicolous fanfare.") /obj/item/clothing/head/foilhat/attack_hand(mob/user) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 3c5c5e3518..19a8a07ddb 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -261,21 +261,21 @@ else visible_message("[user] has grabbed [src] aggressively!", \ "[user] has grabbed you aggressively!") - drop_all_held_items() + update_mobility() stop_pulling() log_combat(user, src, "grabbed", addition="aggressive grab[add_log]") if(GRAB_NECK) log_combat(user, src, "grabbed", addition="neck grab") visible_message("[user] has grabbed [src] by the neck!",\ "[user] has grabbed you by the neck!") - update_canmove() //we fall down + update_mobility() //we fall down if(!buckled && !density) Move(user.loc) if(GRAB_KILL) log_combat(user, src, "strangled", addition="kill grab") visible_message("[user] is strangling [src]!", \ "[user] is strangling you!") - update_canmove() //we fall down + update_mobility() //we fall down if(!buckled && !density) Move(user.loc) return 1 diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm index e28762521c..6e49442919 100644 --- a/code/modules/mob/living/living_mobility.dm +++ b/code/modules/mob/living/living_mobility.dm @@ -95,7 +95,6 @@ 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 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 2dfa02debb..db0ebc12fe 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -418,13 +418,13 @@ ..() /mob/living/simple_animal/update_mobility(value_otherwise = MOBILITY_FLAGS_DEFAULT) - if(_MOBILITYFLAGTEMPORARY_IsUnconscious() || _MOBILITYFLAGTEMPORARY_IsStun() || IsParalyzed() || stat || resting) + if(_MOBILITYFLAGTEMPORARY_IsUnconscious() || _MOBILITYFLAGTEMPORARY_IsStun() || IsParalyzed() || stat || _MOBILITYFLAGTEMPORARY_resting) drop_all_held_items() mobility_flags = NONE else if(buckled) mobility_flags = ~MOBILITY_MOVE else - mobility_flags = MOBILITY_FLAGS_DEFAUTL + mobility_flags = MOBILITY_FLAGS_DEFAULT update_transform() update_action_buttons_icon() return mobility_flags diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 43be1bc273..873aeaba62 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -26,7 +26,7 @@ return has_status_effect(STATUS_EFFECT_STUN) /mob/living/proc/_MOBILITYFLAGTEMPORARY_AmountStun() //How many deciseconds remain in our stun - var/datum/status_effect/incapacitating/stun/S = IsStun() + var/datum/status_effect/incapacitating/stun/S = _MOBILITYFLAGTEMPORARY_IsStun() if(S) return S.duration - world.time return 0 @@ -260,7 +260,7 @@ 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) +/mob/living/proc/HealAllImmobilityUpTo(amount, updating, ignore_canstun = FALSE) if(_MOBILITYFLAGTEMPORARY_AmountStun() > amount) _MOBILITYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun) if(_MOBILITYFLAGTEMPORARY_AmountKnockdown() > amount)