From 9fd9f608557df21aac5f1235fb97266ee2a2735c Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sat, 11 Jan 2020 10:49:44 -0800 Subject: [PATCH] compile --- code/__DEFINES/flags.dm | 4 ++++ code/_onclick/hud/alert.dm | 4 ++-- code/game/objects/effects/step_triggers.dm | 6 ++++-- code/modules/antagonists/bloodsucker/powers/bs_haste.dm | 6 +++--- code/modules/antagonists/bloodsucker/powers/bs_lunge.dm | 4 ++-- code/modules/atmospherics/machinery/atmosmachinery.dm | 4 ---- code/modules/food_and_drinks/kitchen_machinery/processor.dm | 5 +++-- code/modules/mob/living/carbon/alien/larva/life.dm | 2 +- code/modules/mob/living/living.dm | 6 +++--- code/modules/mob/living/silicon/pai/death.dm | 2 +- code/modules/mob/living/silicon/robot/robot_mobility.dm | 2 +- code/modules/spells/spell.dm | 4 ++-- code/modules/spells/spell_types/ethereal_jaunt.dm | 6 ++++-- 13 files changed, 30 insertions(+), 25 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 6b65a7ce7a..3db9c5a70b 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -93,6 +93,10 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define RAD_NO_CONTAMINATE (1<<1) //Mob mobility var flags +/// any flag +#define CHECK_MOBILITY(target, flags) CHECK_BITFIELD(target.mobility_flags, flags) +#define CHECK_ALL_MOBILITY(target, flags) CHECK_MULTIPLE_BITFIELDS(target.mobility_flags, flags) + /// can move #define MOBILITY_MOVE (1<<0) /// can, and is, standing up. diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index c42956bbaa..bdc6ea2980 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -273,7 +273,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." if(!istype(L) || !L.can_resist()) return L.changeNext_move(CLICK_CD_RESIST) - if(L.canmove) + if(CHECK_MOBILITY(L, MOBILITY_MOVE)) return L.resist_fire() //I just want to start a flame in your hearrrrrrtttttt. @@ -601,7 +601,7 @@ so as to remain in compliance with the most up-to-date laws." if(!istype(L) || !L.can_resist()) return L.changeNext_move(CLICK_CD_RESIST) - if((L.canmove) && (L.last_special <= world.time)) + if(CHECK_MOBILITY(L, MOBILITY_MOVE) && (L.last_special <= world.time)) return L.resist_restraints() /obj/screen/alert/restrained/buckled/Click() diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 3e0848130d..e81c00afb5 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -64,7 +64,8 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 0 + ADD_TRAIT(M, TRAIT_MOBILITY_NOMOVE, src) + M.update_mobility() affecting.Add(AM) while(AM && !stopthrow) @@ -101,7 +102,8 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 1 + REMOVE_TRAIT(M, TRAIT_MOBILITY_NOMOVE, src) + M.update_mobility() /* Stops things thrown by a thrower, doesn't do anything */ diff --git a/code/modules/antagonists/bloodsucker/powers/bs_haste.dm b/code/modules/antagonists/bloodsucker/powers/bs_haste.dm index 7fae79d64b..7c6ae4f426 100644 --- a/code/modules/antagonists/bloodsucker/powers/bs_haste.dm +++ b/code/modules/antagonists/bloodsucker/powers/bs_haste.dm @@ -58,7 +58,7 @@ // Did I get knocked down? if(owner && owner.incapacitated(ignore_restraints=TRUE, ignore_grab=TRUE))// owner.incapacitated()) // We're gonna cancel. But am I on the ground? Spin me! - if(user.resting) + if(!CHECK_MOBILTIY(user, MOBILITY_STAND)) var/send_dir = get_dir(owner, T) new /datum/forced_movement(owner, get_ranged_target_turf(owner, send_dir, 1), 1, FALSE) owner.spin(10) @@ -71,7 +71,7 @@ if (rand(0, 5) < level_current) playsound(get_turf(newtarget), "sound/weapons/punch[rand(1,4)].ogg", 15, 1, -1) newtarget.DefaultCombatKnockdown(10 + level_current * 5) - if(newtarget.IsStun()) + if(_REFACTORING_newtarget.IsStun()) newtarget.spin(10,1) if (rand(0,4)) newtarget.drop_all_held_items() @@ -81,4 +81,4 @@ /datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // activate = FALSE - user.update_canmove() + user.update_mobility() diff --git a/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm b/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm index f9c9d3b590..3d1e054826 100644 --- a/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm +++ b/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm @@ -74,10 +74,10 @@ target.adjustStaminaLoss(40 + 10 * level_current) // Cancel Walk (we were close enough to contact them) walk(owner, 0) - target.Stun(10,1) //Without this the victim can just walk away + target._REFACTORING_Stun(10,1) //Without this the victim can just walk away target.grabbedby(owner) // Taken from mutations.dm under changelings target.grippedby(owner, instant = TRUE) //instant aggro grab /datum/action/bloodsucker/targeted/lunge/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // activate = FALSE - user.update_canmove() + user.update_mobility() diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index ee4d1bda11..c26566e194 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -333,10 +333,6 @@ Pipelines + Other Objects -> Pipe network user.forceMove(loc) user.visible_message("You hear something squeezing through the ducts...","You climb out the ventilation system.") - user.canmove = FALSE - addtimer(VARSET_CALLBACK(user, canmove, TRUE), 1) - - /obj/machinery/atmospherics/AltClick(mob/living/L) if(is_type_in_typecache(src, GLOB.ventcrawl_machinery)) return L.handle_ventcrawl(src) diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index 35ce25bbaf..fbf039cd8c 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -127,8 +127,9 @@ set name = "Eject Contents" set src in oview(1) - if(usr.stat || !usr.canmove || usr.restrained()) - return + var/mob/living/L = usr + if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE)) + return ..() empty() add_fingerprint(usr) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index c0216543bb..d63f156d9e 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -27,7 +27,7 @@ if(stat == UNCONSCIOUS) stat = CONSCIOUS if(!recoveringstam) - resting = 0 + set_resting(FALSE, TRUE) adjust_blindness(-1) update_mobility() update_damage_hud() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 908fc8bc77..48ae6eefc2 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -118,7 +118,7 @@ return 1 //CIT CHANGES START HERE - makes it so resting stops you from moving through standing folks without a short delay - if(resting && !L.resting) + if(!CHECK_MOBILITY(src, MOBILITY_STAND) && CHECK_MOBILITY(L, MOBILITY_STAND)) var/origtargetloc = L.loc if(!pulledby) if(attemptingcrawl) @@ -416,7 +416,7 @@ set name = "Sleep" set category = "IC" - if(IsSleeping()) + if(_REFACTORING_IsSleeping()) to_chat(src, "You are already sleeping.") return else @@ -675,7 +675,7 @@ if(on_fire) resist_fire() //stop, drop, and roll return - if(_MOBILTIYFLAGTEMPORARY_resting) //cit change - allows resisting out of resting + if(_REFACTORING_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/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index f558ff3907..0f5e043605 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -2,7 +2,7 @@ if(stat == DEAD) return stat = DEAD - canmove = 0 + update_mobility() update_sight() clear_fullscreens() diff --git a/code/modules/mob/living/silicon/robot/robot_mobility.dm b/code/modules/mob/living/silicon/robot/robot_mobility.dm index e2ec8aeb55..6e0de34d22 100644 --- a/code/modules/mob/living/silicon/robot/robot_mobility.dm +++ b/code/modules/mob/living/silicon/robot/robot_mobility.dm @@ -1,7 +1,7 @@ /mob/living/silicon/robot/update_mobility() var/newflags = NONE if(!stat) - if(!resting) + if(!_REFACTORING_resting) newflags |= MOBILITY_STAND if(!locked_down) newflags |= MOBILITY_MOVE diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 4e9ee9ae39..e5ccbbc908 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -377,9 +377,9 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th if("oxyloss") target.adjustOxyLoss(amount) if("stun") - target._REFACTOR_AdjustStun(amount) + target._REFACTORING_AdjustStun(amount) if("knockdown") - target._REFACTOR_AdjustKnockdown(amount) + target._REFACTORING_AdjustKnockdown(amount) if("unconscious") target.AdjustUnconscious(amount) else diff --git a/code/modules/spells/spell_types/ethereal_jaunt.dm b/code/modules/spells/spell_types/ethereal_jaunt.dm index c003ffb2f2..11ecfc1e15 100644 --- a/code/modules/spells/spell_types/ethereal_jaunt.dm +++ b/code/modules/spells/spell_types/ethereal_jaunt.dm @@ -40,7 +40,8 @@ return mobloc = get_turf(target.loc) jaunt_steam(mobloc) - target.canmove = 0 + ADD_TRAIT(target, TRAIT_MOBILITY_NOMOVE) + target.update_mobility() holder.reappearing = 1 playsound(get_turf(target), 'sound/magic/ethereal_exit.ogg', 50, 1, -1) sleep(25 - jaunt_in_time) @@ -55,7 +56,8 @@ if(T) if(target.Move(T)) break - target.canmove = 1 + REMOVE_TRAIT(target, TRAIT_MOBILITY_NOMOVE) + target.update_mobility() /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/proc/jaunt_steam(mobloc) var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread()