From 2c245a18fd010684c6ef4e58b2d5ca474c795f46 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Fri, 10 Jan 2020 13:43:53 -0800
Subject: [PATCH] compile
---
code/__DEFINES/components.dm | 1 +
code/game/machinery/dance_machine.dm | 4 ++--
.../objects/structures/crates_lockers/closets.dm | 6 +++---
.../crates_lockers/closets/cardboardbox.dm | 2 +-
code/game/objects/structures/tables_racks.dm | 13 +++++--------
code/game/objects/structures/windoor_assembly.dm | 4 ++--
code/game/turfs/open.dm | 2 +-
.../mob/living/carbon/human/species_types/angel.dm | 6 +++---
code/modules/mob/living/living.dm | 2 +-
code/modules/mob/living/living_mobility.dm | 6 +++---
code/modules/spells/spell_types/shadow_walk.dm | 3 +--
11 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm
index 4352ada0cf..c489b6ce7d 100644
--- a/code/__DEFINES/components.dm
+++ b/code/__DEFINES/components.dm
@@ -205,6 +205,7 @@
#define COMSIG_LIVING_STATUS_IMMOBILIZE "living_immobilize" //from base of mob/living/Immobilize() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious" //from base of mob/living/Unconscious() (amount, update, ignore)
#define COMSIG_LIVING_STATUS_SLEEP "living_sleeping" //from base of mob/living/Sleeping() (amount, update, ignore)
+#define COMSIG_LIVING_STATUS_DAZE "living_daze" //from base of mob/living/Daze() (amount, update, ignore)
#define COMPONENT_NO_STUN 1 //For all of them
// /mob/living/carbon signals
diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm
index 91306585b8..8bcfd8bb09 100644
--- a/code/game/machinery/dance_machine.dm
+++ b/code/game/machinery/dance_machine.dm
@@ -431,6 +431,6 @@
/obj/machinery/jukebox/disco/process()
. = ..()
if(active)
- for(var/mob/M in rangers)
- if(prob(5+(allowed(M)*4)) && M.canmove)
+ for(var/mob/living/M in rangers)
+ if(prob(5+(allowed(M)*4)) && CHECK_BITFIELD(M.mobility_flags, MOBILITY_MOVE))
dance(M)
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index fbf39887f7..729e81750d 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -603,12 +603,12 @@
step_towards(user, T2)
T1 = get_turf(user)
if(T1 == T2)
- user.resting = TRUE //so people can jump into crates without slamming the lid on their head
+ user.set_resting(TRUE, TRUE)
if(!close(user))
to_chat(user, "You can't get [src] to close!")
- user.resting = FALSE
+ user.set_resting(FALSE, TRUE)
return
- user.resting = FALSE
+ user.set_resting(FALSE, TRUE)
togglelock(user)
T1.visible_message("[user] dives into [src]!")
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index aad68b2166..1c9f59942e 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -19,7 +19,7 @@
var/use_mob_movespeed = FALSE //Citadel adds snowflake box handling
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
- if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
+ if(opened || move_delay || !CHECK_BITFIELD(user.mobility_flags, MOBILITY_MOVE) || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
if(step(src, direction))
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 273e846ad0..fe67df36ac 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -109,8 +109,7 @@
/obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob)
pushed_mob.forceMove(src.loc)
- pushed_mob.resting = TRUE
- pushed_mob.update_canmove()
+ pushed_mob.set_resting(TRUE, FALSE)
pushed_mob.visible_message("[user] places [pushed_mob] onto [src].", \
"[user] places [pushed_mob] onto [src].")
log_combat(user, pushed_mob, "placed")
@@ -138,11 +137,11 @@
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table)
/obj/structure/table/shove_act(mob/living/target, mob/living/user)
- if(!target.resting)
+ if(CHECK_BITFIELD(target.mobility_flags, MOBILITY_STAND))
target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_TABLE)
user.visible_message("[user.name] shoves [target.name] onto \the [src]!",
"You shove [target.name] onto \the [src]!", null, COMBAT_MESSAGE_RANGE)
- target.forceMove(src.loc)
+ target.forceMove(loc)
log_combat(user, target, "shoved", "onto [src] (table)")
return TRUE
@@ -557,15 +556,13 @@
/obj/structure/table/optable/proc/check_patient()
var/mob/M = locate(/mob/living/carbon/human, loc)
if(M)
- if(M.resting)
+ if(!CHECK_BITFIELD(M.mobility_flags, MOBILITY_STAND))
patient = M
return 1
else
patient = null
return 0
-
-
/*
* Racks
*/
@@ -624,7 +621,7 @@
. = ..()
if(.)
return
- if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
+ if(CHECK_MULTIPLE_BITFIELDS(user.mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) || user.get_num_legs() < 2)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 10c6e53701..5d1cc4e69c 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -343,7 +343,8 @@
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
- if(usr.stat || !usr.canmove || usr.restrained())
+ var/mob/living/L = usr
+ if(!CHECK_BITFIELD(L, MOBILITY_PULL))
return
if(facing == "l")
@@ -354,4 +355,3 @@
to_chat(usr, "The windoor will now slide to the left.")
update_icon()
- return
diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm
index fb3087a1a8..b313d86c88 100644
--- a/code/game/turfs/open.dm
+++ b/code/game/turfs/open.dm
@@ -36,7 +36,7 @@
. = ..()
if(dropping == user && isliving(user))
var/mob/living/L = user
- if(L.resting && do_after(L, max(10, L.getStaminaLoss()*0.5), 0, src))
+ if(!CHECK_BITFIELD(L.mobility_flags, MOBILITY_STAND) && do_after(L, max(10, L.getStaminaLoss()*0.5), 0, src))
if(Adjacent(L, src))
step(L, get_dir(L, src))
playsound(L, "rustle", 25, 1)
diff --git a/code/modules/mob/living/carbon/human/species_types/angel.dm b/code/modules/mob/living/carbon/human/species_types/angel.dm
index 7669a8c740..ce0ccd73e8 100644
--- a/code/modules/mob/living/carbon/human/species_types/angel.dm
+++ b/code/modules/mob/living/carbon/human/species_types/angel.dm
@@ -81,12 +81,12 @@
if(H.movement_type & FLYING)
to_chat(H, "You settle gently back onto the ground...")
A.ToggleFlight(H,0)
- H.update_canmove()
+ H.update_mobility()
else
to_chat(H, "You beat your wings and begin to hover gently above the ground...")
- H.resting = 0
+ H.set_resting(FALSE, TRUE)
A.ToggleFlight(H,1)
- H.update_canmove()
+ H.update_mobility()
/datum/species/angel/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 980af46f41..25c267ade3 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -691,7 +691,7 @@
/mob/living/resist_grab(moving_resist)
. = 1
if(pulledby.grab_state)
- if(!resting && prob(30/pulledby.grab_state))
+ if(CHECK_BITFIELD(mobility_flags, MOBILITY_STAND) && prob(30/pulledby.grab_state))
visible_message("[src] has broken free of [pulledby]'s grip!")
log_combat(pulledby, src, "broke grab")
pulledby.stop_pulling()
diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm
index 533065a96f..fdb394bdbb 100644
--- a/code/modules/mob/living/living_mobility.dm
+++ b/code/modules/mob/living/living_mobility.dm
@@ -98,13 +98,13 @@
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 && !paralyzed && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs) && !pinned
+ var/canmove = !IsImmobilized() && !stun && conscious && !paralyze && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (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 && !paralyzed && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying)
+ var/canstand_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying)
var/canstand = canstand_involuntary && !resting
var/should_be_lying = !canstand
@@ -128,7 +128,7 @@
else
mobility_flags |= MOBILITY_UI|MOBILITY_PULL
- var/canitem = !paralyzed && !stun && conscious && !chokehold && !restrained && has_arms
+ var/canitem = !paralyze && !stun && conscious && !chokehold && !restrained && has_arms
if(canitem)
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
else
diff --git a/code/modules/spells/spell_types/shadow_walk.dm b/code/modules/spells/spell_types/shadow_walk.dm
index 8dbb6d6532..a3b4465edc 100644
--- a/code/modules/spells/spell_types/shadow_walk.dm
+++ b/code/modules/spells/spell_types/shadow_walk.dm
@@ -25,8 +25,7 @@
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
playsound(get_turf(user), 'sound/magic/ethereal_enter.ogg', 50, 1, -1)
visible_message("[user] melts into the shadows!")
- user.SetStun(0, FALSE)
- user.SetKnockdown(0, FALSE)
+ user.SetAllImmobility(0)
user.setStaminaLoss(0, 0)
var/obj/effect/dummy/phased_mob/shadow/S2 = new(get_turf(user.loc))
user.forceMove(S2)