diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index effdc174b6..25a41b9f94 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -93,14 +93,14 @@ //Allow you to drag-drop disposal pipes and transit tubes into it -/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/usr) - if(!usr.canmove || usr.stat || usr.restrained()) +/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/living/user) + if(!istype(user) || !CHECK_BITFIELD(user.mobility_flags, MOBILITY_USE)) return if (!istype(pipe, /obj/structure/disposalconstruct) && !istype(pipe, /obj/structure/c_transit_tube) && !istype(pipe, /obj/structure/c_transit_tube_pod)) return - if (get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 ) + if (get_dist(user, src) > 1 || get_dist(src,pipe) > 1 ) return if (pipe.anchored) diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index b9a75f88af..a775a0039f 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -136,7 +136,7 @@ src.visible_message(text("[M] falls free of [src]!")) unbuckle_mob(M,force=1) M.emote("scream") - M.AdjustKnockdown(20) + M.DefaultCombatKnockdown(20) /obj/structure/kitchenspike/Destroy() if(has_buckled_mobs()) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index fe67df36ac..3d4e731899 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -547,8 +547,8 @@ break /obj/structure/table/optable/tablepush(mob/living/user, mob/living/pushed_mob) - pushed_mob.forceMove(src.loc) - pushed_mob.resting = 1 + pushed_mob.forceMove(loc) + pushed_mob.set_resting(TRUE, TRUE) pushed_mob.update_canmove() visible_message("[user] has laid [pushed_mob] on [src].") check_patient() diff --git a/code/modules/antagonists/bloodsucker/powers/bs_haste.dm b/code/modules/antagonists/bloodsucker/powers/bs_haste.dm index 154a41dc44..7fae79d64b 100644 --- a/code/modules/antagonists/bloodsucker/powers/bs_haste.dm +++ b/code/modules/antagonists/bloodsucker/powers/bs_haste.dm @@ -53,7 +53,7 @@ playsound(get_turf(owner), 'sound/weapons/punchmiss.ogg', 25, 1, -1) var/safety = 20 while(get_turf(owner) != T && safety > 0 && !(isliving(target) && target.Adjacent(owner))) - user.canmove = FALSE //Dont move while doing the thing, or itll break + user.mobility_flags = NONE safety -- // Did I get knocked down? if(owner && owner.incapacitated(ignore_restraints=TRUE, ignore_grab=TRUE))// owner.incapacitated()) @@ -77,8 +77,7 @@ newtarget.drop_all_held_items() foundtargets += newtarget sleep(1) - if(user) - user.update_canmove() //Let the poor guy move again + user?.update_mobility() //Let the poor guy move again /datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // activate = FALSE diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index 14f1d0e76d..2d146e396f 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -22,7 +22,7 @@ In all, this is a lot like the monkey code. /N switch(M.a_intent) if (INTENT_HELP) if(!recoveringstam) - resting = 0 + SetResting(FALSE, TRUE) AdjustAllImmobility(-60) AdjustUnconscious(-60) AdjustSleeping(-100) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 25c267ade3..908fc8bc77 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1201,7 +1201,7 @@ stuttering = 0 updatehealth() update_stamina() - update_canmove() + update_mobility() for(var/chem in healing_chems) reagents.add_reagent(chem, healing_chems[chem]) diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm index fdb394bdbb..5c9a8ad092 100644 --- a/code/modules/mob/living/living_mobility.dm +++ b/code/modules/mob/living/living_mobility.dm @@ -26,7 +26,7 @@ if(client?.prefs?.autostand) intentionalresting = !intentionalresting to_chat(src, "You are now attempting to [intentionalresting ? "[!_REFACTORING_resting ? "lay down and ": ""]stay down" : "[_REFACTORING_resting ? "get up and ": ""]stay up"].") - if(intentionalresting && !resting) + if(intentionalresting && !_REFACTORING_resting) set_resting(TRUE, FALSE) else resist_a_rest() @@ -97,15 +97,15 @@ var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK var/restrained = restrained() - var/pinned = 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() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs) && !pinned + 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 if(canmove) mobility_flags |= MOBILITY_MOVE else mobility_flags &= ~MOBILITY_MOVE var/canstand_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying) - var/canstand = canstand_involuntary && !resting + var/canstand = canstand_involuntary && !_REFACTORING_resting var/should_be_lying = !canstand if(buckled) @@ -128,11 +128,23 @@ else mobility_flags |= MOBILITY_UI|MOBILITY_PULL - var/canitem = !paralyze && !stun && conscious && !chokehold && !restrained && has_arms - if(canitem) - mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE) + var/canitem_general = !paralyze && !stun && conscious && !chokehold && !restrained && has_arms + if(canitem_general) + mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD) else - mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE) + mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD) + + if(HAS_TRAIT(src, TRAIT_MOBILITY_NOMOVE)) + DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE) + if(HAS_TRAIT(src, TRAIT_MOBILITY_NOPICKUP)) + DISABLE_BITFIELD(mobility_flags, MOBILITY_PICKUP) + if(HAS_TRAIT(src, TRAIT_MOBILITY_NOUSE)) + DISABLE_BITFIELD(mobility_flags, MOBILITY_USE) + + if(daze) + DISABLE_BITFIELD(mobility_flags, MOBILITY_USE) + + //Handle update-effects. if(!(mobility_flags & MOBILITY_HOLD)) drop_all_held_items() if(!(mobility_flags & MOBILITY_PULL)) @@ -162,10 +174,3 @@ addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto return mobility_flags - - if(HAS_TRAIT(src, TRAIT_MOBILITY_NOMOVE)) - DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE) - if(HAS_TRAIT(src, TRAIT_MOBILITY_NOPICKUP)) - DISABLE_BITFIELD(mobility_flags, MOBILITY_PICKUP) - if(HAS_TRAIT(src, TRAIT_MOBILITY_NOUSE)) - DISABLE_BITFIELD(mobility_flags, MOBILITY_USE) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 7055838039..d8cb0969ce 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -80,7 +80,7 @@ var/radio_short_cooldown = 5 MINUTES var/radio_short_timerid - canmove = FALSE + mobility_flags = NONE var/silent = FALSE var/brightness_power = 5 @@ -100,7 +100,6 @@ START_PROCESSING(SSfastprocess, src) GLOB.pai_list += src make_laws() - canmove = 0 if(!istype(P)) //when manually spawning a pai, we create a card to put it into. var/newcardloc = P P = new /obj/item/paicard(newcardloc) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 0ae2dab749..c6f5443965 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -180,7 +180,7 @@ collar_type = "[initial(collar_type)]_sit" set_resting(TRUE) else if (prob(1)) - if (resting) + if (_REFACTORING_resting) emote("me", EMOTE_VISIBLE, pick("gets up and meows.", "walks around.", "stops resting.")) icon_state = "[icon_living]" collar_type = "[initial(collar_type)]" diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm index 9c3e5b5def..283c9f6ae9 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/simple_animal/friendly/crab.dm @@ -26,7 +26,7 @@ ..() //CRAB movement if(!ckey && !stat) - if(isturf(src.loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc. + if(isturf(loc) && !_REFACTORING_resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc. turns_since_move++ if(turns_since_move >= turns_per_move) var/east_vs_west = pick(4,8) diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 22dee60eb4..4e9ee9ae39 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.AdjustStun(amount) + target._REFACTOR_AdjustStun(amount) if("knockdown") - target.AdjustKnockdown(amount) + target._REFACTOR_AdjustKnockdown(amount) if("unconscious") target.AdjustUnconscious(amount) else diff --git a/modular_citadel/code/modules/mob/living/carbon/carbon.dm b/modular_citadel/code/modules/mob/living/carbon/carbon.dm index b78f97cc7f..3db57832d0 100644 --- a/modular_citadel/code/modules/mob/living/carbon/carbon.dm +++ b/modular_citadel/code/modules/mob/living/carbon/carbon.dm @@ -13,7 +13,7 @@ if(.) var/mob/living/mobdude = mover if(istype(mobdude)) - if(!resting && mobdude.resting) + if(CHECK_BITFIELD(mobility_flags, MOBILITY_STAND) && !CHECK_BITFIELD(mobdude.mobility_flags, MOBILITY_STAND)) if(!(mobdude.pass_flags & PASSMOB)) return FALSE return .