diff --git a/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm b/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm index 89a65dad23..56cd4dd8cd 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm @@ -33,3 +33,8 @@ /// From /mob/living/Collide(): (atom/A) #define COMSIG_LIVING_PRE_COLLIDE "living_pre_collide" #define COMPONENT_LIVING_COLLIDE_HANDLED (1<<0) + +///from base of mob/living/set_buckled(): (new_buckled) +#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled" +///from base of mob/living/set_body_position() +#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position" diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index 529b2e9314..0f2457d4b1 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -37,10 +37,6 @@ #define COMSIG_MOB_FIRED_GUN_ATTACHMENT "mob_fired_gun_attachment" /// From /mob/proc/death #define COMSIG_MOB_DEATH "mob_death" -/// From /mob/proc/update_canmove() -#define COMSIG_MOB_GETTING_UP "mob_getting_up" -/// From /mob/proc/update_canmove() -#define COMSIG_MOB_KNOCKED_DOWN "mob_knocked_down" /// For when a mob is dragged #define COMSIG_MOB_DRAGGED "mob_dragged" /// From /obj/item/proc/unequipped() @@ -86,8 +82,6 @@ //from /mob/proc/on_deafness_loss() #define COMSIG_MOB_REGAINED_HEARING "mob_regained_hearing" -#define COMSIG_MOB_POST_UPDATE_CANMOVE "mob_can_move" - #define COMSIG_ATTEMPT_MOB_PULL "attempt_mob_pull" #define COMPONENT_CANCEL_MOB_PULL (1<<0) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 23b05a4d7b..67c52379e8 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -419,3 +419,32 @@ var/list/default_xeno_onmob_icons = list( #define EXTREMITY_LIMBS list("l_leg","l_foot","r_leg","r_foot","l_arm","l_hand","r_arm","r_hand") #define CORE_LIMBS list("chest","head","groin") +#define SYMPTOM_ACTIVATION_PROB 3 + +// Body position defines. +/// Mob is standing up, usually associated with lying_angle value of 0. +#define STANDING_UP 0 +/// Mob is lying down, usually associated with lying_angle values of 90 or 270. +#define LYING_DOWN 1 + +/// Possible value of [/atom/movable/buckle_lying]. If set to a different (positive-or-zero) value than this, the buckling thing will force a lying angle on the buckled. +#define NO_BUCKLE_LYING -1 + +// ==================================== +// /mob/living /tg/ mobility_flags +// These represent in what capacity the mob is capable of moving +// Because porting this is underway, NOT ALL FLAGS ARE CURRENTLY IN. + +/// can move +#define MOBILITY_MOVE (1<<0) +/// can, and is, standing up +#define MOBILITY_STAND (1<<1) +/// can rest +#define MOBILITY_REST (1<<7) +/// can lie down +#define MOBILITY_LIEDOWN (1<<8) + +#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND) +#define MOBILITY_FLAGS_CARBON_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN) +#define MOBILITY_FLAGS_REST_CAPABLE_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN) + diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 7f69a4acc4..8962230946 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -143,10 +143,18 @@ // #define TRAIT_X "t_x" //-- mob traits -- -/// Prevents voluntary movement. -#define TRAIT_IMMOBILIZED "immobilized" /// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! #define TRAIT_UNDENSE "undense" +/// Forces the user to stay unconscious. +#define TRAIT_KNOCKEDOUT "knockedout" +/// Prevents voluntary movement. +#define TRAIT_IMMOBILIZED "immobilized" +/// Prevents voluntary standing or staying up on its own. +#define TRAIT_FLOORED "floored" +/// Forces user to stay standing +#define TRAIT_FORCED_STANDING "forcedstanding" +/// Stuns preventing movement and using objects but without further impairement +#define TRAIT_INCAPACITATED "incapacitated" /// Apply this to identify a mob as merged with weeds #define TRAIT_MERGED_WITH_WEEDS "merged_with_weeds" @@ -298,7 +306,10 @@ GLOBAL_LIST_INIT(mob_traits, list( */ GLOBAL_LIST_INIT(traits_by_type, list( /mob = list( + "TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT, "TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED, + "TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED, + "TRAIT_FLOORED" = TRAIT_FLOORED, "TRAIT_UNDENSE" = TRAIT_UNDENSE, "TRAIT_YAUTJA_TECH" = TRAIT_YAUTJA_TECH, "TRAIT_SUPER_STRONG" = TRAIT_SUPER_STRONG, @@ -416,13 +427,39 @@ GLOBAL_LIST(trait_name_map) //Status trait coming from clothing. #define TRAIT_SOURCE_CLOTHING "t_s_clothing" -/// traits associated with actively interacted machinery -#define INTERACTION_TRAIT "interaction" +/// trait associated to being buckled +#define BUCKLED_TRAIT "buckled" // Yes the name doesn't conform. /tg/ appears to have changed naming style inbetween +/// trait source when an effect is coming from a fakedeath effect (refactor this) +#define FAKEDEATH_TRAIT "fakedeath" +/// trait source where a condition comes from body state +#define BODY_TRAIT "body" +/// Trait associated to lying down (having a [lying_angle] of a different value than zero). +#define LYING_DOWN_TRAIT "lying-down" +/// trait associated to a stat value or range of +#define STAT_TRAIT "stat" +/// trait effect related to the queen ovipositor +#define OVIPOSITOR_TRAIT "ovipositor" +/// trait associated to being held in a chokehold +#define CHOKEHOLD_TRAIT "chokehold" /// trait effect related to active specialist gear #define SPECIALIST_GEAR_TRAIT "specialist_gear" /// traits associated with usage of snowflake dropship double seats #define DOUBLE_SEATS_TRAIT "double_seats" /// traits associated with xeno on-ground weeds #define XENO_WEED_TRAIT "xeno_weed" +/// traits associated with actively interacted machinery +#define INTERACTION_TRAIT "interaction" +/// traits bound by stunned status effects +#define STUNNED_TRAIT "stunned" +/// traits bound by knocked_down status effect +#define KNOCKEDDOWN_TRAIT "knockeddown" +/// traits bound by knocked_out status effect +#define KNOCKEDOUT_TRAIT "knockedout" +/// traits from being pounced +#define POUNCED_TRAIT "pounced" +/// traits from step_triggers on the map +#define STEP_TRIGGER_TRAIT "step_trigger" +/// traits from hacked machine interactions +#define HACKED_TRAIT "hacked" /// traits from chloroform usage #define CHLOROFORM_TRAIT "chloroform" diff --git a/code/__HELPERS/animations.dm b/code/__HELPERS/animations.dm new file mode 100644 index 0000000000..f85fb763a4 --- /dev/null +++ b/code/__HELPERS/animations.dm @@ -0,0 +1,2 @@ +/// The duration of the animate call in mob/living/update_transform +#define UPDATE_TRANSFORM_ANIMATION_TIME (0.2 SECONDS) diff --git a/code/__HELPERS/status_effects.dm b/code/__HELPERS/status_effects.dm new file mode 100644 index 0000000000..d06cb687f6 --- /dev/null +++ b/code/__HELPERS/status_effects.dm @@ -0,0 +1 @@ +#define TRAIT_STATUS_EFFECT(effect_id) "[effect_id]-trait" diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 07f237fada..c443a49ba1 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1111,7 +1111,7 @@ var/global/image/action_purple_power_up target_orig_turf = get_turf(target) var/obj/user_holding = busy_user.get_active_hand() var/obj/target_holding - var/cur_user_lying = busy_user.lying + var/cur_user_lying = busy_user.body_position var/cur_target_lying var/expected_total_time = delayfraction*numticks var/time_remaining = expected_total_time @@ -1119,7 +1119,7 @@ var/global/image/action_purple_power_up if(has_target && istype(T)) cur_target_zone_sel = T.zone_selected target_holding = T.get_active_hand() - cur_target_lying = T.lying + cur_target_lying = T.body_position . = TRUE for(var/i in 1 to numticks) @@ -1143,13 +1143,13 @@ var/global/image/action_purple_power_up ) . = FALSE break - if(user_flags & INTERRUPT_KNOCKED_DOWN && busy_user.knocked_down || \ - target_is_mob && (target_flags & INTERRUPT_KNOCKED_DOWN && T.knocked_down) + if(user_flags & INTERRUPT_KNOCKED_DOWN && HAS_TRAIT(busy_user, TRAIT_FLOORED) || \ + target_is_mob && (target_flags & INTERRUPT_KNOCKED_DOWN && HAS_TRAIT(T, TRAIT_FLOORED)) ) . = FALSE break - if(user_flags & INTERRUPT_STUNNED && busy_user.stunned || \ - target_is_mob && (target_flags & INTERRUPT_STUNNED && T.stunned) + if(user_flags & INTERRUPT_STUNNED && HAS_TRAIT(busy_user, TRAIT_INCAPACITATED)|| \ + target_is_mob && (target_flags & INTERRUPT_STUNNED && HAS_TRAIT(T, TRAIT_INCAPACITATED)) ) . = FALSE break @@ -1223,8 +1223,8 @@ var/global/image/action_purple_power_up ) . = FALSE break - if(user_flags & INTERRUPT_CHANGED_LYING && busy_user.lying != cur_user_lying || \ - target_is_mob && (target_flags & INTERRUPT_CHANGED_LYING && T.lying != cur_target_lying) + if(user_flags & INTERRUPT_CHANGED_LYING && busy_user.body_position != cur_user_lying || \ + target_is_mob && (target_flags & INTERRUPT_CHANGED_LYING && T.body_position != cur_target_lying) ) . = FALSE break diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index b85aa18fdb..541d1a0536 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -369,6 +369,13 @@ DEFINE_BITFIELD(mob_flags, list( "NOBIOSCAN" = NOBIOSCAN, )) +DEFINE_BITFIELD(mobility_flags, list( + "MOVE" = MOBILITY_MOVE, + "STAND" = MOBILITY_STAND, + "REST" = MOBILITY_REST, + "LIEDOWN" = MOBILITY_LIEDOWN +)) + DEFINE_BITFIELD(flags, list( "NO_BLOOD" = NO_BLOOD, "NO_BREATHE" = NO_BREATHE, diff --git a/code/_onclick/human.dm b/code/_onclick/human.dm index 1ff0fe6102..b57fc76f2e 100644 --- a/code/_onclick/human.dm +++ b/code/_onclick/human.dm @@ -64,7 +64,7 @@ /mob/living/carbon/human/UnarmedAttack(atom/A, proximity, click_parameters) - if(lying) //No attacks while laying down + if(body_position == LYING_DOWN) //No attacks while laying down return 0 var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines @@ -92,7 +92,7 @@ SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user) return -/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/user) +/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/living/user) if(user != src) return . = ..() @@ -157,6 +157,4 @@ target.Move(user.loc, get_dir(target.loc, user.loc)) target.update_transform(TRUE) - target.update_canmove() - diff --git a/code/_onclick/ventcrawl.dm b/code/_onclick/ventcrawl.dm index b079cffe2a..51afbc139f 100644 --- a/code/_onclick/ventcrawl.dm +++ b/code/_onclick/ventcrawl.dm @@ -45,7 +45,7 @@ to_chat(src, SPAN_WARNING("You must be conscious to do this!")) return - if(lying) + if(is_mob_incapacitated()) to_chat(src, SPAN_WARNING("You can't vent crawl while you're stunned!")) return @@ -88,7 +88,7 @@ return updatehealth() - if(stat || stunned || dazed || knocked_down || lying || health < 0 || !client || !ventcrawl_carry()) + if(is_mob_incapacitated(src) || health < 0 || !client || !ventcrawl_carry()) vent_found.animate_ventcrawl_reset() return diff --git a/code/_onclick/xeno.dm b/code/_onclick/xeno.dm index 02b90b5cf4..c29841ce14 100644 --- a/code/_onclick/xeno.dm +++ b/code/_onclick/xeno.dm @@ -3,7 +3,7 @@ */ /mob/living/carbon/xenomorph/UnarmedAttack(atom/target, proximity, click_parameters, tile_attack = FALSE, ignores_resin = FALSE) - if(lying || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down + if(body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down return FALSE var/mob/alt @@ -21,7 +21,7 @@ if (!L.is_xeno_grabbable() || L == src) //Xenos never attack themselves. continue - if (L.lying) + if (L.body_position == LYING_DOWN) alt = L continue target = L diff --git a/code/datums/action.dm b/code/datums/action.dm index 47b302e09a..0510a43415 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -187,8 +187,10 @@ I.ui_action_click(owner, holder_item) /datum/action/item_action/can_use_action() - if(ishuman(owner) && !owner.is_mob_incapacitated() && !owner.lying) - return TRUE + if(ishuman(owner) && !owner.is_mob_incapacitated()) + var/mob/living/carbon/human/human = owner + if(human.body_position == STANDING_UP) + return TRUE /datum/action/item_action/update_button_icon() button.overlays.Cut() diff --git a/code/datums/agents/tools/chloroform.dm b/code/datums/agents/tools/chloroform.dm index c6e3320688..b1c666ac9e 100644 --- a/code/datums/agents/tools/chloroform.dm +++ b/code/datums/agents/tools/chloroform.dm @@ -50,7 +50,6 @@ ADD_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) ADD_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) M.able_to_speak = FALSE - M.update_canmove() M.drop_inv_item_on_ground(M.wear_mask, force = TRUE) @@ -79,7 +78,6 @@ /obj/item/weapon/chloroform/proc/remove_stun(mob/living/M) animate(M, pixel_x = 0, pixel_y = 0, time = 0.2 SECONDS, easing = QUAD_EASING) M.anchored = FALSE - M.density = TRUE M.able_to_speak = TRUE M.layer = MOB_LAYER REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) diff --git a/code/datums/ammo/ammo.dm b/code/datums/ammo/ammo.dm index 7957a8a994..41a8676f76 100644 --- a/code/datums/ammo/ammo.dm +++ b/code/datums/ammo/ammo.dm @@ -141,7 +141,7 @@ /datum/ammo/proc/knockback(mob/living/living_mob, obj/projectile/fired_projectile, max_range = 2) if(!living_mob || living_mob == fired_projectile.firer) return - if(fired_projectile.distance_travelled > max_range || living_mob.lying) + if(fired_projectile.distance_travelled > max_range || living_mob.body_position == LYING_DOWN) return //Two tiles away or more, basically. if(living_mob.mob_size >= MOB_SIZE_BIG) @@ -183,8 +183,8 @@ else living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET) -/datum/ammo/proc/pushback(mob/target_mob, obj/projectile/fired_projectile, max_range = 2) - if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.lying) +/datum/ammo/proc/pushback(mob/living/target_mob, obj/projectile/fired_projectile, max_range = 2) + if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.body_position == LYING_DOWN) return if(target_mob.mob_size >= MOB_SIZE_BIG) diff --git a/code/datums/ammo/bullet/shotgun.dm b/code/datums/ammo/bullet/shotgun.dm index d8a7248436..e254821aea 100644 --- a/code/datums/ammo/bullet/shotgun.dm +++ b/code/datums/ammo/bullet/shotgun.dm @@ -352,7 +352,7 @@ if(P.distance_travelled > 8) knockback(M, P, 12) - else if(!M || M == P.firer || M.lying) //These checks are included in knockback and would be redundant above. + else if(!M || M == P.firer || M.body_position == LYING_DOWN) //These checks are included in knockback and would be redundant above. return shake_camera(M, 3, 4) diff --git a/code/datums/ammo/xeno.dm b/code/datums/ammo/xeno.dm index 75c78298fe..9ecc9ebf93 100644 --- a/code/datums/ammo/xeno.dm +++ b/code/datums/ammo/xeno.dm @@ -49,9 +49,9 @@ if(!isxeno(M)) if(insta_neuro) - if(M.knocked_down < 3) + if(M.GetKnockDownValueNotADurationDoNotUse() < 3) // If they have less than somewhere random between 4 and 6 seconds KD left and assuming it doesnt get refreshed itnernally M.adjust_effect(1 * power, WEAKEN) - return + return if(ishuman(M)) M.apply_effect(2.5, SUPERSLOW) @@ -65,7 +65,7 @@ no_clothes_neuro = TRUE if(no_clothes_neuro) - if(M.knocked_down < 5) + if(M.GetKnockDownValueNotADurationDoNotUse() < 5) // If they have less than somewhere random between 8 and 10 seconds KD left and assuming it doesnt get refreshed itnernally M.adjust_effect(1 * power, WEAKEN) // KD them a bit more M.visible_message(SPAN_DANGER("[M] falls prone.")) @@ -79,7 +79,7 @@ H.visible_message(SPAN_DANGER("[M] shrugs off the neurotoxin!")) return - if(M.knocked_down < 0.7) // apply knockdown only if current knockdown is less than 0.7 second + if(M.GetKnockDownValueNotADurationDoNotUse() < 0.7) // basically (knocked_down && prob(90)) M.apply_effect(0.7, WEAKEN) M.visible_message(SPAN_DANGER("[M] falls prone.")) diff --git a/code/datums/components/footstep.dm b/code/datums/components/footstep.dm index ef77aaf471..6eaaa6e76a 100644 --- a/code/datums/components/footstep.dm +++ b/code/datums/components/footstep.dm @@ -47,7 +47,7 @@ if(!T) return var/mob/living/parent_mob = parent - if(parent_mob.lying && (isfile(drag_sounds) || istext(drag_sounds))) + if(parent_mob.body_position == LYING_DOWN && (isfile(drag_sounds) || istext(drag_sounds))) playsound(T, drag_sounds, volume, rand(20000, 25000), range, falloff = falloff) else if(isfile(footstep_sounds) || istext(footstep_sounds)) playsound(T, footstep_sounds, volume, rand(20000, 25000), range, falloff = falloff) diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index 72a132cf51..96a628be66 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -3,8 +3,6 @@ var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom var/list/dictionary_symptoms = list() -var/global/const/SYMPTOM_ACTIVATION_PROB = 3 - /datum/symptom // Buffs/Debuffs the symptom has to the overall engineered disease. var/name = "" diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index 46cd8952dd..fd3fbc3a7d 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -20,7 +20,7 @@ cure() return */ - if(affected_mob.lying && prob(40)) //changed FROM prob(10) until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(40)) //changed FROM prob(10) until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) cure() return @@ -43,7 +43,7 @@ cure() return */ - if(affected_mob.lying && prob(25)) //changed FROM prob(5) until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(25)) //changed FROM prob(5) until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) cure() return diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index f2c0295876..fad0b15228 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -21,7 +21,7 @@ stage-- return */ - if(affected_mob.lying && prob(20)) //added until sleeping is fixed --Blaank + if(affected_mob.body_position == LYING_DOWN && prob(20)) //added until sleeping is fixed --Blaank to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) stage-- return @@ -46,7 +46,7 @@ stage-- return */ - if(affected_mob.lying && prob(15)) //added until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(15)) //added until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) stage-- return diff --git a/code/datums/effects/xeno_strains/boiler_trap.dm b/code/datums/effects/xeno_strains/boiler_trap.dm index 1833b9641a..199505379b 100644 --- a/code/datums/effects/xeno_strains/boiler_trap.dm +++ b/code/datums/effects/xeno_strains/boiler_trap.dm @@ -5,16 +5,16 @@ duration = null flags = INF_DURATION -/datum/effects/boiler_trap/New(atom/A, mob/from, last_dmg_source, zone) +/datum/effects/boiler_trap/New(atom/A, mob/living/from, last_dmg_source, zone) . = ..() if(!QDELETED(src)) - var/mob/M = affected_atom - ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + ADD_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) /datum/effects/boiler_trap/Destroy(force) if(ismob(affected_atom)) - var/mob/M = affected_atom - REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + REMOVE_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return ..() /datum/effects/boiler_trap/validate_atom(atom/A) @@ -26,6 +26,6 @@ /datum/effects/boiler_trap/process_mob() . = ..() if(!.) return FALSE - var/mob/M = affected_atom - ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + ADD_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return TRUE diff --git a/code/datums/elements/mouth_drop_item.dm b/code/datums/elements/mouth_drop_item.dm index 42c61bd275..7a546c6b39 100644 --- a/code/datums/elements/mouth_drop_item.dm +++ b/code/datums/elements/mouth_drop_item.dm @@ -19,9 +19,9 @@ SIGNAL_HANDLER if(slot == WEAR_FACE) - I.RegisterSignal(user, COMSIG_MOB_KNOCKED_DOWN, TYPE_PROC_REF(/obj/item, drop_to_floor)) + I.RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, TYPE_PROC_REF(/obj/item, drop_to_floor)) /datum/element/mouth_drop_item/proc/item_dropped(obj/item/I, mob/living/carbon/human/user) SIGNAL_HANDLER - I.UnregisterSignal(user, COMSIG_MOB_KNOCKED_DOWN) + I.UnregisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index ff12635107..fdd4435d12 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -803,8 +803,6 @@ var/global/image/hud_icon_hudfocus if (tag_found) tag_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag") - // Hacky, but works. Currently effects are hard to make with precise timings - var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && !buckled && !lying - + var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && body_position == STANDING_UP && !buckled // Eligible targets are unable to move but can stand and aren't buckled (eg nested) - This is to convey that they are temporarily unable to move if (freeze_found) freeze_holder.overlays += image('icons/mob/hud/hud.dmi', src, "xeno_freeze") diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 22e8cd3093..2f42c7891f 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -171,7 +171,7 @@ directive is properly returned. if(!time) transform = complete return - animate(src, transform = complete, time = time, easing = easing) + animate(src, transform = complete, time = time, easing = easing, flags = ANIMATION_PARALLEL) /// Upates the base_transform which will be compounded with other transforms /atom/proc/update_base_transform(matrix/new_transform, time = 0) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm index 4484846cd7..d8907911e9 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm @@ -511,10 +511,10 @@ unacidable = TRUE var/working = 0 -/obj/structure/machinery/wo_recycler/attack_hand(mob/user) +/obj/structure/machinery/wo_recycler/attack_hand(mob/living/user) if(inoperable(MAINT)) return - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return if(ismaintdrone(usr) || \ istype(usr, /mob/living/carbon/xenomorph)) diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index a19c3e3582..0e3107858b 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -141,7 +141,6 @@ original.statistic_exempt = TRUE original.buckled = start_nest original.setDir(start_nest.dir) - original.update_canmove() start_nest.buckled_mob = original start_nest.afterbuckle(original) diff --git a/code/game/jobs/job/antag/xeno/xenomorph.dm b/code/game/jobs/job/antag/xeno/xenomorph.dm index 53b06147e2..78b6ab7e3a 100644 --- a/code/game/jobs/job/antag/xeno/xenomorph.dm +++ b/code/game/jobs/job/antag/xeno/xenomorph.dm @@ -88,9 +88,8 @@ break human_to_transform.statistic_exempt = TRUE - human_to_transform.buckled = start_nest + human_to_transform.set_buckled(start_nest) human_to_transform.setDir(start_nest.dir) - human_to_transform.update_canmove() start_nest.buckled_mob = human_to_transform start_nest.afterbuckle(human_to_transform) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index c9092a750f..03c013703b 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -19,7 +19,7 @@ active_power_usage = 5 var/strapped = 0 can_buckle = TRUE - buckle_lying = TRUE + buckle_lying = 90 var/buckling_y = -4 surgery_duration_multiplier = SURGERY_SURFACE_MULT_IDEAL //Ideal surface for surgery. var/patient_exam = 0 diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index b88f824956..16e4335b71 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -763,7 +763,6 @@ M.stop_pulling() M.apply_effect(8, STUN) M.apply_effect(5, WEAKEN) - M.lying = 1 ..() /obj/structure/machinery/bot/mulebot/alter_health() diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 67e4e8ed35..3a809620d7 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -68,7 +68,6 @@ src.occupant.updatehealth() if (src.occupant.health >= 0 && src.occupant.stat == DEAD) src.occupant.set_stat(CONSCIOUS) - src.occupant.lying = 0 GLOB.dead_mob_list -= src.occupant GLOB.alive_mob_list += src.occupant occupant.reload_fullscreens() diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 53efad3da8..6f5c1229c5 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -24,7 +24,7 @@ set name = "Eject ID Card" set src in oview(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(scan) to_chat(usr, "You remove \the [scan] from \the [src].") diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index c5a13e2c3e..19e3ac900a 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -51,11 +51,11 @@ dat += "[R.name] |" if(R.stat) dat += " Not Responding |" - else if (!R.canmove) + else if (HAS_TRAIT_FROM(R, TRAIT_IMMOBILIZED, HACKED_TRAIT)) dat += " Locked Down |" else dat += " Operating Normally |" - if(R.canmove && R.cell) + if(R.cell) dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" else dat += " No Cell Installed |" @@ -70,7 +70,8 @@ if (isRemoteControlling(user)) if((user.mind.original == user)) dat += "(Hack) " - dat += "([R.canmove ? "Lockdown" : "Release"]) " + var/canmove = HAS_TRAIT_FROM(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) + dat += "([canmove ? "Lockdown" : "Release"]) " dat += "(Destroy)" dat += "
" dat += "(Return to Main Menu)
" @@ -161,20 +162,22 @@ else if (href_list["stopbot"]) if(src.allowed(usr)) var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) + var/canmove = HAS_TRAIT_FROM(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) if(R && istype(R)) // Extra sancheck because of input var references - var/choice = tgui_input_list(usr, "Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?", "Hack machine", list("Confirm", "Abort")) + var/choice = tgui_input_list(usr, "Are you certain you wish to [canmove ? "lock down" : "release"] [R.name]?", "Hack machine", list("Confirm", "Abort")) if(choice == "Confirm") if(R && istype(R)) - message_admins("[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - R.canmove = !R.canmove + message_admins("[key_name_admin(usr)] [canmove ? "locked down" : "released"] [R.name]!") + log_game("[key_name(usr)] [canmove ? "locked down" : "released"] [R.name]!") + if(canmove) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) + else + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) if (R.lockcharge) - // R.cell.charge = R.lockcharge R.lockcharge = !R.lockcharge to_chat(R, "Your lockdown has been lifted!") else R.lockcharge = !R.lockcharge - // R.cell.charge = 0 to_chat(R, "You have been locked down!") else diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c6d9ddf3ef..e381da0c33 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -91,7 +91,7 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( else if(user.hallucination > 50 && prob(10) && operating == 0) to_chat(user, SPAN_DANGER("You feel a powerful shock course through your body!")) user.halloss += 10 - user.stunned += 10 + user.apply_effect(10, STUN) return ..(user) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 065816567c..d236b96166 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -135,7 +135,7 @@ "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ "\The [src]", list("Yes", "No")) != "Yes") return - if(user.is_mob_incapacitated() || (!user.canmove && !isRemoteControlling(user)) || (get_dist(src, user) > 1 && !isRemoteControlling(user))) + if(user.is_mob_incapacitated() || (get_dist(src, user) > 1 && !isRemoteControlling(user))) to_chat(user, "Sorry, you must remain able bodied and close to \the [src] in order to use it.") return if(density && (inoperable())) //can still close without power diff --git a/code/game/machinery/fax_machine.dm b/code/game/machinery/fax_machine.dm index ff21671ed7..77a7de45a6 100644 --- a/code/game/machinery/fax_machine.dm +++ b/code/game/machinery/fax_machine.dm @@ -110,7 +110,8 @@ var/list/alldepartments = list() set category = "Object" set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(usr.is_mob_incapacitated()) + return if(ishuman(usr) && scan) to_chat(usr, "You remove \the [scan] from \the [src].") diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 516cdad380..580fea644e 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -36,12 +36,12 @@ update_icon() -/obj/structure/machinery/floodlight/attack_hand(mob/user) +/obj/structure/machinery/floodlight/attack_hand(mob/living/user) if(!toggleable) to_chat(user, SPAN_NOTICE("[src] doesn't seem to have a switch to toggle the light.")) return - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return if(!is_valid_user(user)) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index ef6c74a052..4b863bec04 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -57,7 +57,7 @@ if(ishuman(usr)) var/mob/living/carbon/human/user = usr - if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying) + if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded) return if(!skillcheck(user, SKILL_SURGERY, SKILL_SURGERY_NOVICE)) @@ -179,7 +179,7 @@ if(!istype(usr, /mob/living)) return - if(usr.stat || usr.lying) + if(usr.stat || usr.is_mob_incapacitated()) return mode = !mode diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 66bf08afba..1cc66233f9 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -229,7 +229,11 @@ Class Procs: return TRUE if(inoperable()) return 1 - if(usr.is_mob_restrained() || usr.lying || usr.stat) + if(isliving(usr)) + var/mob/living/living = usr + if(living.body_position == LYING_DOWN) // legacy. if you too find it doesn't make sense, consider removing it + return TRUE + if(usr.is_mob_restrained()) return 1 if(!is_valid_user(usr)) to_chat(usr, SPAN_DANGER("You don't have the dexterity to do this!")) @@ -251,10 +255,10 @@ Class Procs: else return src.attack_hand(user) -/obj/structure/machinery/attack_hand(mob/user as mob) +/obj/structure/machinery/attack_hand(mob/living/user as mob) if(inoperable(MAINT)) return TRUE - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return TRUE if(!is_valid_user(user)) to_chat(usr, SPAN_DANGER("You don't have the dexterity to do this!")) diff --git a/code/game/machinery/medical_pod/bodyscanner.dm b/code/game/machinery/medical_pod/bodyscanner.dm index fdcd0ceb62..bbc3be7d5a 100644 --- a/code/game/machinery/medical_pod/bodyscanner.dm +++ b/code/game/machinery/medical_pod/bodyscanner.dm @@ -204,7 +204,7 @@ "toxloss" = H.getToxLoss(), "cloneloss" = H.getCloneLoss(), "brainloss" = H.getBrainLoss(), - "knocked_out" = H.knocked_out, + "knocked_out" = H.GetKnockOutValueNotADurationDoNotUse(), "bodytemp" = H.bodytemperature, "inaprovaline_amount" = H.reagents.get_reagent_amount("inaprovaline"), "dexalin_amount" = H.reagents.get_reagent_amount("dexalin"), @@ -263,7 +263,7 @@ s_class = occ["brainloss"] < 1 ? INTERFACE_GOOD : INTERFACE_BAD dat += "[SET_CLASS("  Approx. Brain Damage:", INTERFACE_PINK)] [SET_CLASS("[occ["brainloss"]]%", s_class)]

" - dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% ([round(occ["knocked_out"] / 4)] seconds left!)
" + dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% (approximately [round(occ["knocked_out"] / 5)] seconds left!)
" dat += "[SET_CLASS("Body Temperature:", "#40628a")] [occ["bodytemp"]-T0C]°C ([occ["bodytemp"]*1.8-459.67]°F)

" s_class = occ["blood_amount"] > 448 ? INTERFACE_OKAY : INTERFACE_BAD diff --git a/code/game/machinery/medical_pod/medical_pod.dm b/code/game/machinery/medical_pod/medical_pod.dm index b284d71ad4..62c8eef1f7 100644 --- a/code/game/machinery/medical_pod/medical_pod.dm +++ b/code/game/machinery/medical_pod/medical_pod.dm @@ -155,7 +155,6 @@ if(exit_stun) occupant.apply_effect(exit_stun, STUN) //Action delay when going out - occupant.update_canmove() //Force the delay to go in action immediately occupant.visible_message(SPAN_WARNING("[occupant] pops out of \the [src]!"), SPAN_WARNING("You get out of \the [src] and get your bearings!")) diff --git a/code/game/machinery/medical_pod/sleeper.dm b/code/game/machinery/medical_pod/sleeper.dm index bf2abe246c..0694783e20 100644 --- a/code/game/machinery/medical_pod/sleeper.dm +++ b/code/game/machinery/medical_pod/sleeper.dm @@ -390,8 +390,8 @@ to_chat(user, "[]\t -Respiratory Damage %: []", (occupant.getOxyLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getOxyLoss()) to_chat(user, "[]\t -Toxin Content %: []", (occupant.getToxLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getToxLoss()) to_chat(user, "[]\t -Burn Severity %: []", (occupant.getFireLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getFireLoss()) - to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)")) - to_chat(user, SPAN_NOTICE(" \t [occupant.knocked_out / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)")) + to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: These times are always inaccurate)")) + to_chat(user, SPAN_NOTICE(" \t [occupant.GetKnockOutValueNotADurationDoNotUse() / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)")) else to_chat(user, SPAN_NOTICE(" There is no one inside!")) return diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 28ebbecc75..45062cbf6b 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -99,7 +99,7 @@ var/bomb_set = FALSE ..() /obj/structure/machinery/nuclearbomb/attack_hand(mob/user as mob) - if(user.is_mob_incapacitated() || !user.canmove || get_dist(src, user) > 1 || isRemoteControlling(user)) + if(user.is_mob_incapacitated() || get_dist(src, user) > 1 || isRemoteControlling(user)) return if(isyautja(user)) @@ -291,7 +291,7 @@ var/bomb_set = FALSE set name = "Make Deployable" set src in oview(1) - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || being_used || timing) + if(usr.is_mob_incapacitated() || being_used || timing) return if(!ishuman(usr)) diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index fc8815b051..e007ada79a 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -75,7 +75,7 @@ /obj/structure/machinery/pipedispenser/Topic(href, href_list) if(..()) return - if(unwrenched || !usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(unwrenched || usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "pipedispenser") return usr.set_interaction(src) @@ -150,7 +150,7 @@ Nah //Allow you to drag-drop disposal pipes into it /obj/structure/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/disposalconstruct/pipe as obj, mob/usr as mob) - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return if (!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 ) @@ -192,7 +192,7 @@ Nah usr.set_interaction(src) src.add_fingerprint(usr) if(href_list["dmake"]) - if(unwrenched || !usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(unwrenched || usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "pipedispenser") return if(!wait) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 03fe1c198b..fee6f9a53c 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -909,7 +909,7 @@ GLOBAL_LIST_EMPTY(vending_products) if(inoperable()) return - if(user.stat || user.is_mob_restrained() || user.lying) + if(user.stat || user.is_mob_restrained()) return if(get_dist(user, src) > 1 || get_dist(src, A) > 1) diff --git a/code/game/machinery/vending/vending.dm b/code/game/machinery/vending/vending.dm index 414ab4a562..b5f2c6181c 100644 --- a/code/game/machinery/vending/vending.dm +++ b/code/game/machinery/vending/vending.dm @@ -820,7 +820,7 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending if(inoperable()) return - if(user.stat || user.is_mob_restrained() || user.lying) + if(user.stat || user.is_mob_restrained()) return if(get_dist(user, src) > 1 || get_dist(src, A) > 1) diff --git a/code/game/objects/effects/acid_hole.dm b/code/game/objects/effects/acid_hole.dm index 207c6c9e25..8c972c42ef 100644 --- a/code/game/objects/effects/acid_hole.dm +++ b/code/game/objects/effects/acid_hole.dm @@ -48,20 +48,20 @@ return XENO_NO_DELAY_ACTION /obj/effect/acid_hole/proc/expand_hole(mob/living/carbon/xenomorph/user) - if(user.action_busy || user.lying) + if(user.action_busy || user.is_mob_incapacitated()) return playsound(src, "pry", 25, 1) xeno_attack_delay(user) ADD_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Acid hole")) - if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && !user.lying && istype(holed_wall)) + if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && istype(holed_wall)) holed_wall.take_damage(rand(2000,3500)) user.emote("roar") REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Acid hole")) -/obj/effect/acid_hole/proc/use_wall_hole(mob/user) +/obj/effect/acid_hole/proc/use_wall_hole(mob/living/user) - if(user.mob_size >= MOB_SIZE_BIG || user.is_mob_incapacitated() || user.lying || user.buckled || user.anchored) + if(user.mob_size >= MOB_SIZE_BIG || user.is_mob_incapacitated() || user.buckled || user.anchored) return FALSE var/mob_dir = get_dir(user, src) @@ -95,7 +95,7 @@ to_chat(user, SPAN_NOTICE("You start crawling through the hole.")) if(do_after(user, 15, INTERRUPT_NO_NEEDHAND, BUSY_ICON_GENERIC)) - if(!user.is_mob_incapacitated() && !user.lying && !user.buckled) + if(!user.is_mob_incapacitated() && !user.buckled) if (T.density) return for(var/obj/O in T) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 867c6924b3..0b44c0bb44 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -160,7 +160,7 @@ //damages human that comes in contact /obj/effect/xenomorph/spray/proc/apply_spray(mob/living/carbon/H, should_stun = TRUE) - if(!H.lying) + if(H.body_position == STANDING_UP) to_chat(H, SPAN_DANGER("Your feet scald and burn! Argh!")) if(ishuman(H)) H.emote("pain") @@ -264,7 +264,7 @@ else PAS.increment_stack_count(2) - if(!H.lying) + if(H.body_position == STANDING_UP) to_chat(H, SPAN_DANGER("Your feet scald and burn! Argh!")) H.emote("pain") H.last_damage_data = cause_data diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 3c7eeaa6f4..6c1b740596 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -50,7 +50,7 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 0 + ADD_TRAIT(M, TRAIT_IMMOBILIZED, STEP_TRIGGER_TRAIT) affecting.Add(AM) while(AM && !stopthrow) @@ -87,7 +87,7 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 1 + REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, STEP_TRIGGER_TRAIT) /* Stops things thrown by a thrower, doesn't do anything */ diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index d097090736..f6eaff2713 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -517,14 +517,14 @@ cases. Override_icon_state should be a list.*/ if(WEAR_L_HAND) if(human.l_hand) return FALSE - if(human.lying) + if(human.body_position == LYING_DOWN) to_chat(human, SPAN_WARNING("You can't equip that while lying down.")) return return TRUE if(WEAR_R_HAND) if(human.r_hand) return FALSE - if(human.lying) + if(human.body_position == LYING_DOWN) to_chat(human, SPAN_WARNING("You can't equip that while lying down.")) return return TRUE @@ -920,9 +920,10 @@ cases. Override_icon_state should be a list.*/ mob_state += GLOB.slot_to_contained_sprite_shorthand[slot] return mob_state -/obj/item/proc/drop_to_floor(mob/wearer) +/obj/item/proc/drop_to_floor(mob/wearer, body_position) SIGNAL_HANDLER - wearer.drop_inv_item_on_ground(src) + if(body_position == LYING_DOWN) + wearer.drop_inv_item_on_ground(src) // item animatzionen diff --git a/code/game/objects/items/devices/autopsy_scanner.dm b/code/game/objects/items/devices/autopsy_scanner.dm index c4c7ec665e..8aa2053fee 100644 --- a/code/game/objects/items/devices/autopsy_scanner.dm +++ b/code/game/objects/items/devices/autopsy_scanner.dm @@ -174,7 +174,7 @@ M.update_inv_r_hand() /obj/item/device/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob) - if(!istype(M) || !M.lying) + if(!istype(M) || !M.is_mob_incapacitated()) return var/table diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 2d44ce076f..f8cf524731 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -422,7 +422,7 @@ if(!(GLOB.character_traits[/datum/character_trait/skills/spotter] in human.traits)) to_chat(human, SPAN_WARNING("You have no idea how to use this!")) return FALSE - if(istype(human) && !human.is_mob_incapacitated() && !human.lying && (holder_item == human.r_hand || holder_item || human.l_hand)) + if(istype(human) && !human.is_mob_incapacitated() && (holder_item == human.r_hand || holder_item || human.l_hand)) return TRUE /datum/action/item_action/specialist/spotter_target/proc/use_ability(atom/targeted_atom) diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 0b8cbc303c..bc97cf04fd 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -27,7 +27,7 @@ set category = "Object" set src in usr - if ((usr.canmove && !( usr.is_mob_restrained() ))) + if (usr.is_mob_incapacitated()) src.code = t if (!( src.code )) src.code = "beacon" diff --git a/code/game/objects/items/explosives/grenades/flashbang.dm b/code/game/objects/items/explosives/grenades/flashbang.dm index 365dfe26df..50cb34668a 100644 --- a/code/game/objects/items/explosives/grenades/flashbang.dm +++ b/code/game/objects/items/explosives/grenades/flashbang.dm @@ -256,6 +256,7 @@ //decide how banged mob is var/bang_effect = 0 + var/lying = H.body_position == LYING_DOWN //flashbang effect depends on eye protection only, so we will process this case first //A bit dumb, but headsets don't have ear protection and even earmuffs are a fluff now @@ -264,7 +265,7 @@ if((get_dist(H, T) <= 1 || src.loc == H.loc || src.loc == H)) H.apply_damage(5, BRUTE) H.apply_damage(5, BURN) - if(H.lying) + if(lying) bang_effect = 1 else bang_effect = 2 @@ -277,13 +278,13 @@ H.apply_damage(5, BRUTE) H.apply_damage(5, BURN) - if(H.lying) + if(lying) bang_effect = 4 else bang_effect = 5 else if(get_dist(H, T) <= 5) - if(H.lying) + if(lying) bang_effect = 3 else bang_effect = 4 diff --git a/code/game/objects/items/hoverpack.dm b/code/game/objects/items/hoverpack.dm index c2bfacd3c3..027b9d77f5 100644 --- a/code/game/objects/items/hoverpack.dm +++ b/code/game/objects/items/hoverpack.dm @@ -184,7 +184,7 @@ warning.forceMove(path[max_distance]) /obj/item/hoverpack/proc/can_use_hoverpack(mob/living/carbon/human/user) - if(user.is_mob_incapacitated() || user.lying) + if(user.is_mob_incapacitated()) to_chat(user, SPAN_WARNING("You're a bit too incapacitated for that.")) return FALSE @@ -204,7 +204,7 @@ /datum/action/item_action/hover/can_use_action() var/mob/living/carbon/human/H = owner - if(!H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(!H.is_mob_incapacitated() && holder_item == H.back) return TRUE /datum/action/item_action/hover/action_activate() diff --git a/code/game/objects/items/implants/implantneurostim.dm b/code/game/objects/items/implants/implantneurostim.dm index 544cf70147..21ee254264 100644 --- a/code/game/objects/items/implants/implantneurostim.dm +++ b/code/game/objects/items/implants/implantneurostim.dm @@ -63,7 +63,7 @@ var/mob_pain_msg = "Excruciating pain shoots through [part ? "your [part.display_name]" : "you"]!" M.visible_message(SPAN_DANGER("[M] convulses in pain!"), SPAN_DANGER(mob_pain_msg)) M.flash_eyes(1, TRUE) - M.stunned += 10 + M.apply_effect(10, STUN) M.apply_effect(10, WEAKEN) M.apply_damage(100, HALLOSS, part) M.apply_damage(5, BURN, part, 0, 0, src) diff --git a/code/game/objects/items/reagent_containers/blood_pack.dm b/code/game/objects/items/reagent_containers/blood_pack.dm index 128c127082..4794fb8cc0 100644 --- a/code/game/objects/items/reagent_containers/blood_pack.dm +++ b/code/game/objects/items/reagent_containers/blood_pack.dm @@ -159,7 +159,7 @@ if(!istype(usr, /mob/living)) return - if(usr.stat || usr.lying) + if(usr.stat || usr.is_mob_incapacitated()) return mode = !mode diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 4c19cdd0dc..3daaf0228e 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -757,7 +757,7 @@ /datum/action/item_action/specialist/toggle_cloak/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(istype(H) && !H.is_mob_incapacitated() && holder_item == H.back) return TRUE /datum/action/item_action/specialist/toggle_cloak/action_activate() diff --git a/code/game/objects/items/storage/internal.dm b/code/game/objects/items/storage/internal.dm index 68bdda8d7e..a491df12f0 100644 --- a/code/game/objects/items/storage/internal.dm +++ b/code/game/objects/items/storage/internal.dm @@ -25,10 +25,10 @@ //Items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour. //Returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of //Doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj) +/obj/item/storage/internal/proc/handle_mousedrop(mob/living/carbon/human/user, obj/over_object as obj) if(ishuman(user)) - if(user.lying) //Can't use your inventory when lying + if(user.body_position == LYING_DOWN) //Can't use your inventory when lying //what about stuns? don't argue return if(QDELETED(master_object)) @@ -84,8 +84,8 @@ //Items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour. //Returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise. //It's strange, but no other way of doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_attack_hand(mob/user as mob, mods) - if(user.lying) +/obj/item/storage/internal/proc/handle_attack_hand(mob/living/user as mob, mods) + if(user.body_position == LYING_DOWN) // what about stuns? huh? return FALSE if(ishuman(user)) diff --git a/code/game/objects/items/storage/large_holster.dm b/code/game/objects/items/storage/large_holster.dm index 27026165fc..76f98c4239 100644 --- a/code/game/objects/items/storage/large_holster.dm +++ b/code/game/objects/items/storage/large_holster.dm @@ -367,7 +367,7 @@ /datum/action/item_action/specialist/toggle_fuel/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.back) return TRUE /datum/action/item_action/specialist/toggle_fuel/action_activate() diff --git a/code/game/objects/items/storage/smartpack.dm b/code/game/objects/items/storage/smartpack.dm index 0b0fd05eac..d012e77361 100644 --- a/code/game/objects/items/storage/smartpack.dm +++ b/code/game/objects/items/storage/smartpack.dm @@ -223,7 +223,7 @@ user.remove_filter("synth_protective_form") -/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/user) +/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/living/user) if(activated_form) return diff --git a/code/game/objects/items/tools/experimental_tools.dm b/code/game/objects/items/tools/experimental_tools.dm index d27272881e..221aa279a5 100644 --- a/code/game/objects/items/tools/experimental_tools.dm +++ b/code/game/objects/items/tools/experimental_tools.dm @@ -279,7 +279,7 @@ return if(ishuman(user)) - if(user.stat || user.blinded || user.lying) + if(user.stat || user.blinded || user.body_position == LYING_DOWN) return if(attaching) diff --git a/code/game/objects/items/toys/toy_weapons.dm b/code/game/objects/items/toys/toy_weapons.dm index 9acf6f2943..80f94cab8e 100644 --- a/code/game/objects/items/toys/toy_weapons.dm +++ b/code/game/objects/items/toys/toy_weapons.dm @@ -156,10 +156,10 @@ O.show_message(SPAN_DANGER("[user] realized they were out of ammo and starting scrounging for some!"), SHOW_MESSAGE_VISIBLE) -/obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob) +/obj/item/toy/crossbow/attack(mob/living/M as mob, mob/user as mob) src.add_fingerprint(user) - if (src.bullets > 0 && M.lying) + if (src.bullets > 0 && M.body_position == LYING_DOWN) for(var/mob/O in viewers(M, null)) if(O.client) @@ -169,7 +169,7 @@ playsound(user.loc, 'sound/items/syringeproj.ogg', 15, 1) new /obj/item/toy/crossbow_ammo(M.loc) src.bullets-- - else if (M.lying && src.bullets == 0) + else if (M.body_position == LYING_DOWN && src.bullets == 0) for(var/mob/O in viewers(M, null)) if (O.client) O.show_message(SPAN_DANGER("[user] casually lines up a shot with [M]'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!"), SHOW_MESSAGE_VISIBLE, SPAN_DANGER("You hear someone fall"), SHOW_MESSAGE_AUDIBLE) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 3fa16af058..109747f476 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -14,7 +14,8 @@ /// If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! var/in_use = FALSE var/mob/living/buckled_mob - var/buckle_lying = FALSE //Is the mob buckled in a lying position + /// Bed-like behaviour, forces mob.lying = buckle_lying if not set to [NO_BUCKLE_LYING]. + var/buckle_lying = NO_BUCKLE_LYING var/can_buckle = FALSE /**Applied to surgery times for mobs buckled prone to it or lying on the same tile, if the surgery cares about surface conditions. The lowest multiplier of objects on the tile is used.**/ @@ -224,7 +225,7 @@ else . = ..() /obj/proc/afterbuckle(mob/M as mob) // Called after somebody buckled / unbuckled - handle_rotation() + handle_rotation() // To be removed when we have full dir support in set_buckled SEND_SIGNAL(src, COSMIG_OBJ_AFTER_BUCKLE, buckled_mob) if(!buckled_mob) UnregisterSignal(M, COMSIG_PARENT_QDELETING) @@ -235,9 +236,8 @@ /obj/proc/unbuckle() SIGNAL_HANDLER if(buckled_mob && buckled_mob.buckled == src) - buckled_mob.buckled = null + buckled_mob.set_buckled(null) buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_canmove() var/M = buckled_mob REMOVE_TRAITS_IN(buckled_mob, TRAIT_SOURCE_BUCKLE) @@ -268,7 +268,7 @@ //trying to buckle a mob /obj/proc/buckle_mob(mob/M, mob/user) - if (!ismob(M) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.lying || user.stat || buckled_mob || M.buckled || !isturf(user.loc)) + if (!ismob(M) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.stat || buckled_mob || M.buckled || !isturf(user.loc)) return if (isxeno(user)) @@ -299,20 +299,15 @@ // the actual buckling proc // Yes I know this is not style but its unreadable otherwise -/obj/proc/do_buckle(mob/target, mob/user) +/obj/proc/do_buckle(mob/living/target, mob/user) send_buckling_message(target, user) if (src && src.loc) - target.buckled = src + target.set_buckled(src) target.forceMove(src.loc) target.setDir(dir) - target.update_canmove() src.buckled_mob = target src.add_fingerprint(user) afterbuckle(target) - if(buckle_lying) // Make sure buckling to beds/nests etc only turns, and doesn't give a random offset - var/matrix/new_matrix = matrix() - new_matrix.Turn(90) - target.apply_transform(new_matrix) return TRUE /obj/proc/send_buckling_message(mob/M, mob/user) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 9b0b8cf30a..95998d5de7 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -150,7 +150,8 @@ for(var/mob/living/M in get_turf(src)) - if(M.lying) return //No spamming this on people. + if(HAS_TRAIT(M, TRAIT_FLOORED)) + return //No spamming this on people. M.apply_effect(5, WEAKEN) to_chat(M, SPAN_WARNING("You topple as \the [src] moves under you!")) @@ -191,7 +192,7 @@ H.updatehealth() return -/obj/structure/proc/can_touch(mob/user) +/obj/structure/proc/can_touch(mob/living/user) if(!user) return 0 if(!Adjacent(user) || !isturf(user.loc)) @@ -199,7 +200,7 @@ if(user.is_mob_restrained() || user.buckled) to_chat(user, SPAN_NOTICE("You need your hands and legs free for this.")) return 0 - if(user.is_mob_incapacitated(TRUE) || user.lying) + if(user.is_mob_incapacitated(TRUE) || user.body_position == LYING_DOWN) return 0 if(isRemoteControlling(user)) to_chat(user, SPAN_NOTICE("You need hands for this.")) diff --git a/code/game/objects/structures/barricade/deployable.dm b/code/game/objects/structures/barricade/deployable.dm index 77aa6b7e68..0d5275f98a 100644 --- a/code/game/objects/structures/barricade/deployable.dm +++ b/code/game/objects/structures/barricade/deployable.dm @@ -63,7 +63,7 @@ if(!ishuman(usr)) return - if(usr.lying) + if(usr.is_mob_incapacitated()) return if(over_object == usr && Adjacent(usr)) diff --git a/code/game/objects/structures/bookcase.dm b/code/game/objects/structures/bookcase.dm index 6d6ee9ffa3..aba4eed6e8 100644 --- a/code/game/objects/structures/bookcase.dm +++ b/code/game/objects/structures/bookcase.dm @@ -34,7 +34,7 @@ if(contents.len) var/obj/item/book/choice = input("Which book would you like to remove from the shelf?") as null|obj in contents if(choice) - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) return if(ishuman(user)) if(!user.get_active_hand()) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index a7394f3a75..d6148b23b7 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -79,10 +79,11 @@ M.forceMove(loc) if(exit_stun) M.apply_effect(exit_stun, STUN) //Action delay when going out of a closet - M.update_canmove() //Force the delay to go in action immediately - if(!M.lying) - M.visible_message(SPAN_WARNING("[M] suddenly gets out of [src]!"), - SPAN_WARNING("You get out of [src] and get your bearings!")) + if(isliving(M)) + var/mob/living/living_M = M + if(living_M.mobility_flags & MOBILITY_MOVE) + M.visible_message(SPAN_WARNING("[M] suddenly gets out of [src]!"), + SPAN_WARNING("You get out of [src] and get your bearings!")) /obj/structure/closet/proc/open() if(opened) @@ -333,7 +334,7 @@ set category = "Object" set name = "Toggle Open" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return if(usr.loc == src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index b63936ef88..b85a7834ec 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -63,7 +63,7 @@ set src in oview(1) // One square distance set category = "Object" set name = "Reset Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) src.add_fingerprint(usr) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 331cb884bd..ba974a8e72 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -121,7 +121,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) diff --git a/code/game/objects/structures/crates_lockers/secure_crates.dm b/code/game/objects/structures/crates_lockers/secure_crates.dm index 28a77e0c81..6b025a57c7 100644 --- a/code/game/objects/structures/crates_lockers/secure_crates.dm +++ b/code/game/objects/structures/crates_lockers/secure_crates.dm @@ -53,7 +53,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index f2e6b172ad..da6d4f1a82 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -67,8 +67,8 @@ else //wtf make your ladders properly assholes icon_state = "ladder00" -/obj/structure/ladder/attack_hand(mob/user) - if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying || user.buckled || user.anchored) return +/obj/structure/ladder/attack_hand(mob/living/user) + if(user.stat || get_dist(user, src) > 1 || user.blinded || user.body_position == LYING_DOWN || user.buckled || user.anchored) return if(busy) to_chat(user, SPAN_WARNING("Someone else is currently using [src].")) return @@ -94,7 +94,7 @@ SPAN_NOTICE("You start climbing [ladder_dir_name] [src].")) busy = TRUE if(do_after(user, 20, INTERRUPT_INCAPACITATED|INTERRUPT_OUT_OF_RANGE|INTERRUPT_RESIST, BUSY_ICON_GENERIC, src, INTERRUPT_NONE)) - if(!user.is_mob_incapacitated() && get_dist(user, src) <= 1 && !user.blinded && !user.lying && !user.buckled && !user.anchored) + if(!user.is_mob_incapacitated() && get_dist(user, src) <= 1 && !user.blinded && user.body_position != LYING_DOWN && !user.buckled && !user.anchored) visible_message(SPAN_NOTICE("[user] climbs [ladder_dir_name] [src].")) //Hack to give a visible message to the people here without duplicating user message user.visible_message(SPAN_NOTICE("[user] climbs [ladder_dir_name] [src]."), SPAN_NOTICE("You climb [ladder_dir_name] [src].")) @@ -103,9 +103,9 @@ busy = FALSE add_fingerprint(user) -/obj/structure/ladder/check_eye(mob/user) +/obj/structure/ladder/check_eye(mob/living/user) //Are we capable of looking? - if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded || user.lying || !user.client) + if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded || user.body_position == LYING_DOWN || !user.client) user.unset_interaction() //Are ladder cameras ok? @@ -140,7 +140,7 @@ //Peeking up/down /obj/structure/ladder/MouseDrop(over_object, src_location, over_location) if((over_object == usr && (in_range(src, usr)))) - if(islarva(usr) || isobserver(usr) || usr.is_mob_incapacitated() || usr.blinded || usr.lying) + if(islarva(usr) || isobserver(usr) || usr.is_mob_incapacitated() || usr.blinded) to_chat(usr, "You can't do that in your current state.") return if(is_watching) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index e203bfc67a..3733e0b836 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -117,9 +117,8 @@ if(user.is_mob_incapacitated()) return if(exit_stun) - user.stunned = max(user.stunned, exit_stun) //Action delay when going out of a closet (or morgue in this case) - user.update_canmove() //Force the delay to go in action immediately - if(!user.lying) + user.apply_effect(exit_stun, STUN) + if(user.mobility_flags & MOBILITY_MOVE) user.visible_message(SPAN_WARNING("[user] suddenly gets out of [src]!"), SPAN_WARNING("You get out of [src] and get your bearings!")) toggle_morgue(user) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index bc3b4ad7f4..a33d2889a4 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -13,7 +13,7 @@ icon_state = "bed" icon = 'icons/obj/objects.dmi' can_buckle = TRUE - buckle_lying = TRUE + buckle_lying = 90 throwpass = TRUE debris = list(/obj/item/stack/sheet/metal) var/buildstacktype = /obj/item/stack/sheet/metal diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 4186ae8608..e523906f4c 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -6,7 +6,7 @@ name = "chair" desc = "A rectangular metallic frame sitting on four legs with a back panel. Designed to fit the sitting position, more or less comfortably." icon_state = "chair" - buckle_lying = FALSE + buckle_lying = 0 var/propelled = FALSE //Check for fire-extinguisher-driven chairs var/can_rotate = TRUE var/picked_up_item = /obj/item/weapon/twohanded/folded_metal_chair diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 2b42e641f0..986ae99739 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -20,7 +20,7 @@ if(world.time <= l_move_time + move_delay) return // Redundant check? - if(user.is_mob_incapacitated() || user.lying) + if(user.is_mob_incapacitated()) return if(propelled) //can't manually move it mid-propelling. diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index 6375fcd138..65bb2fd6a9 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -10,7 +10,7 @@ health = 100 layer = ABOVE_MOB_LAYER plane = GAME_PLANE - buckle_lying = FALSE + buckle_lying = 0 var/on_fire = 0 var/resisting = 0 var/resisting_ready = 0 @@ -145,7 +145,7 @@ if(!(buckled_mob && buckled_mob.buckled == src && buckled_mob != user)) return - if(user.stat || user.lying || user.is_mob_restrained()) + if(user.body_position == LYING_DOWN || user.is_mob_incapacitated()) return if(isxeno(user)) @@ -167,7 +167,7 @@ if(H.stat != DEAD) if(alert(user, "[H] is still alive and kicking! Are you sure you want to remove them from the nest?", "Confirmation", "Yes", "No") != "Yes") return - if(!buckled_mob || !user.Adjacent(H) || user.stat || user.lying || user.is_mob_restrained()) + if(!buckled_mob || !user.Adjacent(H) || user.is_mob_incapacitated(FALSE)) return if(ishuman(user)) @@ -191,7 +191,7 @@ /obj/structure/bed/nest/buckle_mob(mob/mob, mob/user) . = FALSE - if(!isliving(mob) || islarva(user) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.stat || user.lying || mob.buckled || !iscarbon(user)) + if(!isliving(mob) || islarva(user) || (get_dist(src, user) > 1) || user.is_mob_incapacitated(FALSE)) return if(isxeno(mob)) @@ -220,7 +220,7 @@ var/mob/living/carbon/human/human = null if(ishuman(mob)) human = mob - if(!human.lying) //Don't ask me why is has to be + if(human.body_position != LYING_DOWN) //Don't ask me why is has to be to_chat(user, SPAN_WARNING("[mob] is resisting, ground them.")) return @@ -242,7 +242,7 @@ return if(human) //Improperly stunned Marines won't be nested - if(!human.lying) //Don't ask me why is has to be + if(human.body_position != LYING_DOWN) //Don't ask me why is has to be to_chat(user, SPAN_WARNING("[mob] is resisting, ground them.")) return diff --git a/code/game/objects/structures/vulture_spotter.dm b/code/game/objects/structures/vulture_spotter.dm index 44efd5ce84..ab23a80867 100644 --- a/code/game/objects/structures/vulture_spotter.dm +++ b/code/game/objects/structures/vulture_spotter.dm @@ -78,7 +78,7 @@ try_scope(user) -/obj/structure/vulture_spotter_tripod/on_set_interaction(mob/user) +/obj/structure/vulture_spotter_tripod/on_set_interaction(mob/living/user) var/obj/item/attachable/vulture_scope/scope = get_vulture_scope() scope.spotter_spotting = TRUE to_chat(scope.scope_user, SPAN_NOTICE("You notice that [scope] drifts less.")) @@ -102,7 +102,7 @@ give_action(user, /datum/action/vulture_tripod_unscope, null, null, src) set_scope_loc(user, scope) -/obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/user) +/obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/living/user) user.status_flags &= ~IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] looks up from [src]."),SPAN_NOTICE("You look up from [src].")) REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Vulture spotter")) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 27fdf94dac..872b9be15d 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -9,6 +9,7 @@ anchored = TRUE can_buckle = TRUE unslashable = TRUE + buckle_lying = 0 var/open = 0 //if the lid is up var/cistern = 0 //if the cistern bit is open var/w_items = 0 //the combined w_class of all the items in the cistern diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index d60377123c..7dfc28a85e 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -612,17 +612,6 @@ message_admins("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]") H.monkeyize() - else if(href_list["corgione"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locate(href_list["corgione"]) - if(!istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human") - return - - message_admins("[key_name_admin(usr)] attempting to corgize [key_name_admin(H)]") - H.corgize() - else if(href_list["forcespeech"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/animations/animation_library.dm b/code/modules/animations/animation_library.dm index 2bbff8d4cf..d4fd8feeaf 100644 --- a/code/modules/animations/animation_library.dm +++ b/code/modules/animations/animation_library.dm @@ -249,7 +249,7 @@ Can look good elsewhere as well.*/ var/pre_rappel_alpha = alpha alpha = 20 dir = WEST - canmove = FALSE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) var/matrix/initial_matrix = matrix() initial_matrix.Turn(45) apply_transform(initial_matrix) @@ -257,4 +257,4 @@ Can look good elsewhere as well.*/ var/matrix/reset_matrix = matrix() animate(src, 3, transform = reset_matrix, pixel_y = 0, alpha = pre_rappel_alpha, flags = ANIMATION_PARALLEL) sleep(3) - canmove = TRUE + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 05ad7c5a87..929e2d6af7 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -137,7 +137,7 @@ /obj/item/device/assembly/infra/Topic(href, href_list) ..() - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "infra") return diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 853a07ef10..0fbca14801 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -507,38 +507,40 @@ set name = "Adjust welding goggles" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) - if(active) - active = 0 - vision_impair = vision_impair_off - flags_inventory &= ~COVEREYES - flags_inv_hide &= ~HIDEEYES - flags_armor_protection &= ~BODY_FLAG_EYES - update_icon() - eye_protection = EYE_PROTECTION_NONE - to_chat(usr, "You push [src] up out of your face.") - else - active = 1 - vision_impair = vision_impair_on - flags_inventory |= COVEREYES - flags_inv_hide |= HIDEEYES - flags_armor_protection |= BODY_FLAG_EYES - update_icon() - eye_protection = initial(eye_protection) - to_chat(usr, "You flip [src] down to protect your eyes.") - - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.glasses == src) - H.update_tint() + if(usr.is_mob_incapacitated()) + return + + if(active) + active = 0 + vision_impair = vision_impair_off + flags_inventory &= ~COVEREYES + flags_inv_hide &= ~HIDEEYES + flags_armor_protection &= ~BODY_FLAG_EYES + update_icon() + eye_protection = EYE_PROTECTION_NONE + to_chat(usr, "You push [src] up out of your face.") + else + active = 1 + vision_impair = vision_impair_on + flags_inventory |= COVEREYES + flags_inv_hide |= HIDEEYES + flags_armor_protection |= BODY_FLAG_EYES + update_icon() + eye_protection = initial(eye_protection) + to_chat(usr, "You flip [src] down to protect your eyes.") + + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.glasses == src) + H.update_tint() - update_clothing_icon() + update_clothing_icon() - for(var/X in actions) - var/datum/action/A = X - if(istype(A, /datum/action/item_action/toggle)) - A.update_button_icon() + for(var/X in actions) + var/datum/action/A = X + if(istype(A, /datum/action/item_action/toggle)) + A.update_button_icon() /obj/item/clothing/glasses/welding/superior name = "superior welding goggles" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 1a133eee0d..e4f9bdde48 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -36,7 +36,7 @@ return /datum/action/item_action/view_publications/can_use_action() - if(owner && !owner.is_mob_incapacitated() && !owner.lying && owner.faction != FACTION_SURVIVOR) + if(owner && !owner.is_mob_incapacitated() && owner.faction != FACTION_SURVIVOR) return TRUE /datum/action/item_action/view_publications/action_activate() diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm index e6c8391ac0..15a4cf7424 100644 --- a/code/modules/clothing/gloves/miscellaneous.dm +++ b/code/modules/clothing/gloves/miscellaneous.dm @@ -88,7 +88,7 @@ playsound(loc, knockout_sound, 50, FALSE) M.show_message(FONT_SIZE_LARGE(SPAN_WARNING("KNOCKOUT!")), SHOW_MESSAGE_VISIBLE) return 1 - if (L.lying == 1 || L.stat == UNCONSCIOUS)//Can't beat 'em while they're down. + if (L.body_position == LYING_DOWN || L.stat == UNCONSCIOUS)//Can't beat 'em while they're down. to_chat(M, SPAN_WARNING("You can't box with [A], they're already down!")) return 1 M.visible_message(SPAN_DANGER("[M] [boxing_verb] [A]!")) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 102d824175..afc8e0a7cb 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -45,33 +45,35 @@ set name = "Adjust welding mask" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) - if(up) - vision_impair = VISION_IMPAIR_MAX - flags_inventory |= COVEREYES|COVERMOUTH|BLOCKSHARPOBJ - flags_inv_hide |= HIDEEARS|HIDEEYES|HIDEFACE - icon_state = initial(icon_state) - eye_protection = initial(eye_protection) - to_chat(usr, "You flip the [src] down to protect your eyes.") - else - vision_impair = VISION_IMPAIR_NONE - flags_inventory &= ~(COVEREYES|COVERMOUTH|BLOCKSHARPOBJ) - flags_inv_hide &= ~(HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = "[initial(icon_state)]up" - eye_protection = EYE_PROTECTION_NONE - to_chat(usr, "You push the [src] up out of your face.") - up = !up - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.head == src) - H.update_tint() - - update_clothing_icon() //so our mob-overlays update - - for(var/X in actions) - var/datum/action/A = X - A.update_button_icon() + if(usr.is_mob_incapacitated()) + return + + if(up) + vision_impair = VISION_IMPAIR_MAX + flags_inventory |= COVEREYES|COVERMOUTH|BLOCKSHARPOBJ + flags_inv_hide |= HIDEEARS|HIDEEYES|HIDEFACE + icon_state = initial(icon_state) + eye_protection = initial(eye_protection) + to_chat(usr, "You flip the [src] down to protect your eyes.") + else + vision_impair = VISION_IMPAIR_NONE + flags_inventory &= ~(COVEREYES|COVERMOUTH|BLOCKSHARPOBJ) + flags_inv_hide &= ~(HIDEEARS|HIDEEYES|HIDEFACE) + icon_state = "[initial(icon_state)]up" + eye_protection = EYE_PROTECTION_NONE + to_chat(usr, "You push the [src] up out of your face.") + up = !up + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.head == src) + H.update_tint() + + update_clothing_icon() //so our mob-overlays update + + for(var/X in actions) + var/datum/action/A = X + A.update_button_icon() /* * Cakehat diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 76d61b4e3c..ffdda93f8a 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -16,7 +16,7 @@ set name = "Adjust mask" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) if(!src.hanging) src.hanging = !src.hanging gas_transfer_coefficient = 1 //gas is now escaping to the turf and vice versa diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm index a28a143f4f..5b97051852 100644 --- a/code/modules/clothing/suits/jobs.dm +++ b/code/modules/clothing/suits/jobs.dm @@ -385,7 +385,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 switch(icon_state) diff --git a/code/modules/clothing/suits/labcoat.dm b/code/modules/clothing/suits/labcoat.dm index 278ffb666b..1c2fb2a9f2 100644 --- a/code/modules/clothing/suits/labcoat.dm +++ b/code/modules/clothing/suits/labcoat.dm @@ -52,7 +52,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.buttoned == TRUE) diff --git a/code/modules/clothing/suits/marine_armor.dm b/code/modules/clothing/suits/marine_armor.dm index fe37ba86ee..eae4cd6fd8 100644 --- a/code/modules/clothing/suits/marine_armor.dm +++ b/code/modules/clothing/suits/marine_armor.dm @@ -626,7 +626,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(!injections) @@ -905,7 +905,6 @@ H.alpha = full_camo_alpha H.FF_hit_evade = 1000 ADD_TRAIT(H, TRAIT_UNDENSE, SPECIALIST_GEAR_TRAIT) - H.density = FALSE RegisterSignal(H, COMSIG_MOB_MOVE_OR_LOOK, PROC_REF(handle_mob_move_or_look)) @@ -930,7 +929,6 @@ COMSIG_MOB_FIRED_GUN, COMSIG_MOB_FIRED_GUN_ATTACHMENT, COMSIG_MOB_DEATH, - COMSIG_MOB_POST_UPDATE_CANMOVE, COMSIG_HUMAN_EXTINGUISH, COMSIG_MOB_MOVE_OR_LOOK )) @@ -939,7 +937,6 @@ animate(H, alpha = initial(H.alpha), flags = ANIMATION_END_NOW) H.FF_hit_evade = initial(H.FF_hit_evade) REMOVE_TRAIT(H, TRAIT_UNDENSE, SPECIALIST_GEAR_TRAIT) - H.update_canmove() var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] SA.add_to_hud(H) @@ -984,7 +981,7 @@ /datum/action/item_action/specialist/prepare_position/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.wear_suit) + if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.wear_suit) return TRUE /datum/action/item_action/specialist/prepare_position/action_activate() diff --git a/code/modules/clothing/suits/marine_coat.dm b/code/modules/clothing/suits/marine_coat.dm index 73d7e09818..3aa43706c7 100644 --- a/code/modules/clothing/suits/marine_coat.dm +++ b/code/modules/clothing/suits/marine_coat.dm @@ -53,7 +53,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.buttoned == TRUE) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 2a3cff05ee..b5859bb6f2 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -332,7 +332,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.icon_state == "suitjacket_blue_open") diff --git a/code/modules/clothing/under/under.dm b/code/modules/clothing/under/under.dm index f452628a1c..ec20ed6f6b 100644 --- a/code/modules/clothing/under/under.dm +++ b/code/modules/clothing/under/under.dm @@ -106,7 +106,7 @@ if ((flags_item & NODROP) || loc != usr) return - if (!usr.is_mob_incapacitated() && !(usr.buckled && usr.lying)) + if (!usr.is_mob_incapacitated() && !(usr.buckled)) if(over_object) switch(over_object.name) if("r_hand") diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index 247118b965..3cbac124b3 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -160,7 +160,8 @@ /obj/effect/alien/resin/sticky/Crossed(atom/movable/AM) . = ..() var/mob/living/carbon/human/H = AM - if(istype(H) && !H.lying && !H.ally_of_hivenumber(hivenumber)) + // Wait doesn't this stack slows if you get dragged over it? What's going on here? + if(istype(H) && !H.ally_of_hivenumber(hivenumber)) H.next_move_slowdown = H.next_move_slowdown + slow_amt return . var/mob/living/carbon/xenomorph/X = AM @@ -565,7 +566,7 @@ return FALSE burning_friendly = TRUE - else if(current_mob.lying || current_mob.is_mob_incapacitated(TRUE)) + else if(current_mob.body_position == LYING_DOWN || current_mob.is_mob_incapacitated(TRUE)) return FALSE if(!burning_friendly && current_mob.health < 0) diff --git a/code/modules/cm_aliens/structures/fruit.dm b/code/modules/cm_aliens/structures/fruit.dm index 318bc6ba6c..09983c9300 100644 --- a/code/modules/cm_aliens/structures/fruit.dm +++ b/code/modules/cm_aliens/structures/fruit.dm @@ -442,7 +442,7 @@ /obj/effect/alien/resin/fruit/MouseDrop(atom/over_object) var/mob/living/carbon/xenomorph/X = over_object - if(!istype(X) || !Adjacent(X) || X != usr || X.is_mob_incapacitated() || X.lying) return ..() + if(!istype(X) || !Adjacent(X) || X != usr || X.is_mob_incapacitated() || X.body_position == LYING_DOWN) return ..() X.pickup_fruit(src) // Handles xenos picking up fruit diff --git a/code/modules/cm_aliens/structures/trap.dm b/code/modules/cm_aliens/structures/trap.dm index bc8eb7e6c7..d885e4d14a 100644 --- a/code/modules/cm_aliens/structures/trap.dm +++ b/code/modules/cm_aliens/structures/trap.dm @@ -106,7 +106,7 @@ var/mob/living/carbon/human/H = AM if(issynth(H) || isyautja(H)) return - if(H.stat == DEAD || H.lying) + if(H.stat == DEAD || H.body_position == LYING_DOWN) return if(H.ally_of_hivenumber(hivenumber)) return diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 9ef7bfe87c..a8912bc438 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -127,7 +127,7 @@ /obj/structure/tunnel/proc/pick_tunnel(mob/living/carbon/xenomorph/X) . = FALSE //For peace of mind when it comes to dealing with unintended proc failures - if(!istype(X) || X.stat || X.lying || !isfriendly(X) || !hive) + if(!istype(X) || X.is_mob_incapacitated(TRUE) || !isfriendly(X) || !hive) return FALSE if(X in contents) var/list/tunnels = list() @@ -195,7 +195,7 @@ . = attack_alien(M) /obj/structure/tunnel/attack_alien(mob/living/carbon/xenomorph/M) - if(!istype(M) || M.stat || M.lying) + if(!istype(M) || M.is_mob_incapacitated(TRUE)) return XENO_NO_DELAY_ACTION if(!isfriendly(M)) diff --git a/code/modules/cm_marines/Donator_Items.dm b/code/modules/cm_marines/Donator_Items.dm index e8eb3f75ae..6d2f46490d 100644 --- a/code/modules/cm_marines/Donator_Items.dm +++ b/code/modules/cm_marines/Donator_Items.dm @@ -23,7 +23,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -35,7 +35,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -91,7 +91,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -103,7 +103,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return diff --git a/code/modules/cm_marines/m2c.dm b/code/modules/cm_marines/m2c.dm index 75c96f6717..ff16c924cd 100644 --- a/code/modules/cm_marines/m2c.dm +++ b/code/modules/cm_marines/m2c.dm @@ -445,7 +445,7 @@ //ATTACK WITH BOTH HANDS COMBO -/obj/structure/machinery/m56d_hmg/auto/attack_hand(mob/user) +/obj/structure/machinery/m56d_hmg/auto/attack_hand(mob/living/user) ..() var/turf/user_turf = get_turf(user) @@ -515,16 +515,13 @@ ..() ADD_TRAIT(user, TRAIT_OVERRIDE_CLICKDRAG, TRAIT_SOURCE_WEAPON) RegisterSignal(user, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(disable_interaction)) - RegisterSignal(user, COMSIG_MOB_POST_UPDATE_CANMOVE, PROC_REF(disable_canmove_interaction)) + RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(body_position_changed)) // DISMOUNT THE MG /obj/structure/machinery/m56d_hmg/auto/on_unset_interaction(mob/user) REMOVE_TRAIT(user, TRAIT_OVERRIDE_CLICKDRAG, TRAIT_SOURCE_WEAPON) - UnregisterSignal(user, list( - COMSIG_MOVABLE_PRE_MOVE, - COMSIG_MOB_POST_UPDATE_CANMOVE - )) + UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE) ..() // GET ANIMATED @@ -598,16 +595,16 @@ to_chat(user, SPAN_NOTICE("You rotate [src], using the tripod to support your pivoting movement.")) -/obj/structure/machinery/m56d_hmg/auto/proc/disable_interaction(mob/user, NewLoc, direction) +/obj/structure/machinery/m56d_hmg/auto/proc/disable_interaction(mob/living/user, NewLoc, direction) SIGNAL_HANDLER - if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) + if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) user.unset_interaction() -/obj/structure/machinery/m56d_hmg/auto/proc/disable_canmove_interaction(mob/user, canmove, laid_down, lying) +/obj/structure/machinery/m56d_hmg/auto/proc/body_position_changed(mob/living/user, body_position, old_body_position) SIGNAL_HANDLER - if(laid_down) + if(body_position != STANDING_UP) user.unset_interaction() /obj/structure/machinery/m56d_hmg/auto/proc/handle_rotating_gun(mob/user) diff --git a/code/modules/cm_marines/marines_consoles.dm b/code/modules/cm_marines/marines_consoles.dm index a3bea392c2..734972ac7b 100644 --- a/code/modules/cm_marines/marines_consoles.dm +++ b/code/modules/cm_marines/marines_consoles.dm @@ -432,7 +432,7 @@ set name = "Eject ID Card" set src in oview(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(user_id_card) user_id_card.loc = get_turf(src) @@ -498,7 +498,7 @@ set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(ishuman(usr) && ID_to_modify) to_chat(usr, "You remove \the [ID_to_modify] from \the [src].") diff --git a/code/modules/cm_marines/orbital_cannon.dm b/code/modules/cm_marines/orbital_cannon.dm index 42737e7a8a..3aafc4b7c4 100644 --- a/code/modules/cm_marines/orbital_cannon.dm +++ b/code/modules/cm_marines/orbital_cannon.dm @@ -450,7 +450,7 @@ var/list/ob_type_fuel_requirements shake_camera(user, 3, total_shake_factor, shake_frequency) user.KnockDown(rand(max_knockdown_time * distance_percent, (max_knockdown_time * distance_percent + 1))) - if(!user.knocked_down) + if(HAS_TRAIT(user, TRAIT_FLOORED)) continue to_chat(user, SPAN_WARNING("You are thrown off balance and fall to the ground!")) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 225b855062..501cbfdd6e 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -839,7 +839,7 @@ to_chat(usr, SPAN_NOTICE("You are too far from the handles to man [src]!")) /obj/structure/machinery/m56d_hmg/on_set_interaction(mob/user) - RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_MOB_KNOCKED_DOWN), PROC_REF(exit_interaction)) + RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_LIVING_SET_BODY_POSITION), PROC_REF(exit_interaction)) flags_atom |= RELAY_CLICK user.status_flags |= IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] mans \the [src]."),SPAN_NOTICE("You man \the [src], locked and loaded!")) @@ -854,7 +854,7 @@ update_pixels(user) operator = user -/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/user) +/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/living/user) flags_atom &= ~RELAY_CLICK SEND_SIGNAL(src, COMSIG_GUN_INTERRUPT_FIRE) user.status_flags &= ~IMMOBILE_ACTION @@ -875,7 +875,7 @@ COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, - COMSIG_MOB_KNOCKED_DOWN, + COMSIG_LIVING_SET_BODY_POSITION, )) @@ -915,8 +915,8 @@ user.client.pixel_y = 0 animate(user, pixel_x=user_old_x, pixel_y=user_old_y, 4, 1) -/obj/structure/machinery/m56d_hmg/check_eye(mob/user) - if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) +/obj/structure/machinery/m56d_hmg/check_eye(mob/living/user) + if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) user.unset_interaction() /obj/structure/machinery/m56d_hmg/clicked(mob/user, list/mods) diff --git a/code/modules/cm_preds/thrall_procs.dm b/code/modules/cm_preds/thrall_procs.dm index 8ea0f2abb5..a28f6eba26 100644 --- a/code/modules/cm_preds/thrall_procs.dm +++ b/code/modules/cm_preds/thrall_procs.dm @@ -14,7 +14,7 @@ to_chat(wearer, SPAN_WARNING("You've already claimed your equipment.")) return - if(wearer.is_mob_incapacitated() || wearer.lying || wearer.buckled) + if(wearer.is_mob_incapacitated() || wearer.body_position == LYING_DOWN /* replace by mobility_flags */ || wearer.buckled) to_chat(wearer, SPAN_WARNING("You're not able to do that right now.")) return diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index 7173575710..9cb8b4bea4 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -106,6 +106,7 @@ /// handles decloaking only on HUNTER gloves /obj/item/clothing/gloves/yautja/proc/decloak() + SIGNAL_HANDLER return /// Called to update the minimap icon of the predator @@ -408,7 +409,7 @@ . = wristblades_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/wristblades_internal(mob/living/carbon/human/caller, forced = FALSE) - if(!caller.loc || !caller.canmove || caller.stat || !ishuman(caller)) + if(!caller.loc || caller.is_mob_incapacitated() || !ishuman(caller)) return . = check_random_function(caller, forced) @@ -648,7 +649,7 @@ . = caster_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/caster_internal(mob/living/carbon/human/caller, forced = FALSE) - if(!caller.loc || !caller.canmove || caller.stat || !ishuman(caller)) + if(!caller.loc || caller.is_mob_incapacitated() || !ishuman(caller)) return . = check_random_function(caller, forced) diff --git a/code/modules/cm_preds/yaut_procs.dm b/code/modules/cm_preds/yaut_procs.dm index 32d532da72..728e548dfd 100644 --- a/code/modules/cm_preds/yaut_procs.dm +++ b/code/modules/cm_preds/yaut_procs.dm @@ -48,7 +48,7 @@ set name = "Butcher" set desc = "Butcher a corpse you're standing on for its tasty meats." - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) return var/list/choices = list() @@ -77,7 +77,7 @@ to_chat(src, SPAN_WARNING("This tiny worm is not even worth using your tools on.")) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) return if(issynth(T)) @@ -236,7 +236,7 @@ to_chat(src, SPAN_WARNING("You've already claimed your equipment.")) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, SPAN_WARNING("You're not able to do that right now.")) return diff --git a/code/modules/cm_tech/hologram.dm b/code/modules/cm_tech/hologram.dm index 5c0e986f45..3509c0a73a 100644 --- a/code/modules/cm_tech/hologram.dm +++ b/code/modules/cm_tech/hologram.dm @@ -5,7 +5,6 @@ GLOBAL_LIST_EMPTY_TYPED(hologram_list, /mob/hologram) desc = "It seems to be a visual projection of someone" //jinkies! icon = 'icons/mob/mob.dmi' icon_state = "hologram" - canmove = TRUE blinded = FALSE invisibility = INVISIBILITY_OBSERVER diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index 3a55e537f4..5ad8dbdc4b 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -416,9 +416,9 @@ damaged_action(damage) if(stat == DEFENSE_DAMAGED) - density = FALSE + set_density(FALSE) else - density = initial(density) + set_density(initial(density)) update_icon() diff --git a/code/modules/desert_dam/filtration/filtration.dm b/code/modules/desert_dam/filtration/filtration.dm index 6c079f3dcd..a0fd1b2933 100644 --- a/code/modules/desert_dam/filtration/filtration.dm +++ b/code/modules/desert_dam/filtration/filtration.dm @@ -198,7 +198,7 @@ var/global/east_riverstart = 0 M.apply_damage(0.5,BURN) else var/dam_amount = 3 - if(M.lying) + if(M.body_position == LYING_DOWN) M.apply_damage(dam_amount,BURN) M.apply_damage(dam_amount,BURN) M.apply_damage(dam_amount,BURN) diff --git a/code/modules/desert_dam/motion_sensor/sensortower.dm b/code/modules/desert_dam/motion_sensor/sensortower.dm index 6a718607aa..50aeede45f 100644 --- a/code/modules/desert_dam/motion_sensor/sensortower.dm +++ b/code/modules/desert_dam/motion_sensor/sensortower.dm @@ -211,7 +211,7 @@ if(do_after(M, 40, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) if(M.loc != cur_loc) return XENO_NO_DELAY_ACTION //Make sure we're still there - if(M.lying) + if(M.is_mob_incapacitated()) return XENO_NO_DELAY_ACTION if(buildstate == SENSORTOWER_BUILDSTATE_BLOWTORCH) return XENO_NO_DELAY_ACTION diff --git a/code/modules/droppod/container_droppod.dm b/code/modules/droppod/container_droppod.dm index 270f15011c..a9432933fa 100644 --- a/code/modules/droppod/container_droppod.dm +++ b/code/modules/droppod/container_droppod.dm @@ -126,7 +126,7 @@ . = ..() if(loc) collect_objects(loc.contents) - density = TRUE + set_density(TRUE) /obj/structure/droppod/container/proc/collect_objects(list/L) for(var/atom/movable/A in L) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 2e9142dcef..b166f9a496 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -465,7 +465,7 @@ log transactions set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(ishuman(usr) && held_card) to_chat(usr, "You remove \the [held_card] from \the [src].") diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 9503eee267..e62ad15a64 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -21,7 +21,7 @@ for(var/i = rand(1,4),i > 0, i--) to_chat(src, SPAN_NOTICE("... [pick(POSSIBLE_DREAM_TOPICS)] ...")) sleep(rand(40,70)) - if(knocked_out <= 0) + if(!stat) dreaming = 0 return dreaming = 0 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index c7b1d65c7d..1f8dcb2f81 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -351,7 +351,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/device/aicard,\ var/clone_weapon = null for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(H.stat || H.lying) continue + if(H.stat) continue // possible_clones += H clone = H break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order. diff --git a/code/modules/gear_presets/corpses.dm b/code/modules/gear_presets/corpses.dm index 70f4e22060..de24f1f84f 100644 --- a/code/modules/gear_presets/corpses.dm +++ b/code/modules/gear_presets/corpses.dm @@ -39,7 +39,6 @@ if(nest) new_human.buckled = nest new_human.setDir(nest.dir) - new_human.update_canmove() nest.buckled_mob = new_human nest.afterbuckle(new_human) new_human.spawned_corpse = TRUE diff --git a/code/modules/hydroponics/vines.dm b/code/modules/hydroponics/vines.dm index 14091a1d29..0b7987e82b 100644 --- a/code/modules/hydroponics/vines.dm +++ b/code/modules/hydroponics/vines.dm @@ -124,7 +124,6 @@ if(V && (V.stat != DEAD) && (V.buckled != src)) // If mob exists and is not dead or captured. V.buckled = src V.forceMove(src.loc) - V.update_canmove() src.buckled_mob = V to_chat(V, SPAN_DANGER("The vines [pick("wind", "tangle", "tighten")] around you!")) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index a68a67cfdf..44a3592329 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -25,7 +25,6 @@ icon = 'icons/mob/mob.dmi' icon_state = "ghost" density = FALSE - canmove = TRUE blinded = FALSE anchored = TRUE // don't get pushed around invisibility = INVISIBILITY_OBSERVER @@ -80,6 +79,9 @@ GLOB.observer_list += src + // Ghosts don't move, they teleport via a special case in mob code + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) + var/turf/spawn_turf if(ismob(body)) spawn_turf = get_turf(body) //Where is the body located? diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 6c825ec509..115e78fa7f 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -57,8 +57,6 @@ set_stat(DEAD) - update_canmove() - dizziness = 0 jitteriness = 0 diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 5ce40810e0..d71a908d62 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -29,8 +29,6 @@ //Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_l_hand(obj/item/W) - if(lying) - return FALSE if(!istype(W)) return FALSE if(!l_hand) @@ -48,8 +46,6 @@ //Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_r_hand(obj/item/W) - if(lying) - return FALSE if(!istype(W)) return FALSE if(!r_hand) diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 60fe422c0e..d9480fab4c 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -41,15 +41,6 @@ return 1 return ..() - -/mob/living/brain/update_canmove() - canmove = FALSE - return canmove - - - - - /mob/living/brain/update_sight() if (stat == DEAD) sight |= SEE_TURFS diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 82cbb155b5..7f84b64661 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -18,7 +18,6 @@ //Status updates, death etc. handle_regular_status_updates() - update_canmove() if(client) handle_regular_hud_updates() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0d33503bce..b63ce0174a 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -74,7 +74,7 @@ /mob/living/carbon/ex_act(severity, direction, datum/cause_data/cause_data) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER if(severity >= 30) @@ -260,19 +260,24 @@ /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) if(src == M) return - var/t_him = "it" - if(gender == MALE) - t_him = "him" - else if(gender == FEMALE) - t_him = "her" - if(lying || sleeping) + var/t_him = p_them() + + var/shake_action + if(stat == DEAD || HAS_TRAIT(src, TRAIT_INCAPACITATED) || sleeping) // incap implies also unconscious or knockedout + shake_action = "wake [t_him] up!" + else if(HAS_TRAIT(src, TRAIT_FLOORED)) + shake_action = "get [t_him] up!" + + if(shake_action) // We are incapacitated in some fashion if(client) sleeping = max(0,sleeping-5) - if(sleeping == 0) - resting = 0 - update_canmove() - M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \ - SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4) + M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to [shake_action]"), \ + SPAN_NOTICE("You shake [src] trying to [shake_action]"), null, 4) + + else if(body_position == LYING_DOWN) // We're just chilling on the ground, let us be + M.visible_message(SPAN_NOTICE("[M] stares and waves impatiently at [src] lying on the ground."), \ + SPAN_NOTICE("You stare and wave at [src] just lying on the ground."), null, 4) + else var/mob/living/carbon/human/H = M if(istype(H)) @@ -452,19 +457,19 @@ /mob/living/carbon/slip(slip_source_name, stun_level, weaken_level, run_only, override_noslip, slide_steps) set waitfor = 0 if(buckled) return FALSE //can't slip while buckled - if(lying) return FALSE //can't slip if already lying down. + if(body_position != STANDING_UP) return FALSE //can't slip if already lying down. stop_pulling() to_chat(src, SPAN_WARNING("You slipped on \the [slip_source_name? slip_source_name : "floor"]!")) playsound(src.loc, 'sound/misc/slip.ogg', 25, 1) apply_effect(stun_level, STUN) apply_effect(weaken_level, WEAKEN) . = TRUE - if(slide_steps && lying)//lying check to make sure we downed the mob + if(slide_steps && HAS_TRAIT(src, TRAIT_FLOORED))//lying check to make sure we downed the mob var/slide_dir = dir for(var/i=1, i<=slide_steps, i++) step(src, slide_dir) sleep(2) - if(!lying) + if(!HAS_TRAIT(src, TRAIT_FLOORED)) // just watch this break in the most horrible way possible break @@ -518,3 +523,17 @@ . += SPAN_GREEN("[src] was thralled by [src.hunter_data.thralled_set.real_name] for '[src.hunter_data.thralled_reason]'.") else if(src.hunter_data.gear) . += SPAN_RED("[src] was marked as carrying gear by [src.hunter_data.gear_set].") + + +/mob/living/carbon/on_lying_down(new_lying_angle) + . = ..() + if(!buckled || buckled.buckle_lying != 0) + lying_angle_on_lying_down(new_lying_angle) + + +/// Special carbon interaction on lying down, to transform its sprite by a rotation. +/mob/living/carbon/proc/lying_angle_on_lying_down(new_lying_angle) + if(!new_lying_angle) + set_lying_angle(pick(90, 270)) + else + set_lying_angle(new_lying_angle) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 5cac9db53c..6ff2a96b72 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -1,5 +1,6 @@ /mob/living/carbon gender = MALE + mobility_flags = MOBILITY_FLAGS_CARBON_DEFAULT var/list/stomach_contents = list() var/life_tick = 0 // The amount of life ticks that have processed on this mob. diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index c493559ff0..3f88d6becc 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -28,7 +28,7 @@ I = giver.r_hand if(!istype(I) || (I.flags_item & (DELONDROP|NODROP|ITEM_ABSTRACT))) return - if(lying) + if(body_position == LYING_DOWN) // replace by mobiilty_flags probably to_chat(giver, SPAN_WARNING("[src] can't hold that while lying down.")) return if(r_hand && l_hand) @@ -47,7 +47,7 @@ to_chat(giver, SPAN_WARNING("You need to keep the item in your active hand.")) to_chat(src, SPAN_WARNING("[giver] seem to have given up on giving [I] to you.")) return - if(lying) + if(body_position == LYING_DOWN) to_chat(src, SPAN_WARNING("You can't hold that while lying down.")) to_chat(giver, SPAN_WARNING("[src] can't hold that while lying down.")) return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c6bce7757d..260976af38 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -133,7 +133,7 @@ . += "Self Destruct Status: [SShijack.get_sd_eta()]" /mob/living/carbon/human/ex_act(severity, direction, datum/cause_data/cause_data) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER @@ -172,6 +172,7 @@ var/obj/item/item1 = get_active_hand() var/obj/item/item2 = get_inactive_hand() apply_effect(round(knockdown_minus_armor), WEAKEN) + apply_effect(round(knockdown_minus_armor), STUN) // Remove this to let people crawl after an explosion. Funny but perhaps not desirable. var/knockout_value = damage * 0.1 var/knockout_minus_armor = min(knockout_value * bomb_armor_mult * 0.5, 0.5 SECONDS) // the KO time is halved from the knockdown timer. basically same stun time, you just spend less time KO'd. apply_effect(round(knockout_minus_armor), PARALYZE) @@ -1009,7 +1010,7 @@ /mob/living/carbon/human/proc/handle_embedded_objects() - if((stat == DEAD) || lying || buckled) // Shouldnt be needed, but better safe than sorry + if((stat == DEAD) || body_position || buckled) // Shouldnt be needed, but better safe than sorry return for(var/obj/item/W in embedded_items) diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index 027e279e29..75aa0de09a 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -455,9 +455,7 @@ CULT return to_chat(chosen, SPAN_HIGHDANGER("You feel a dangerous presence in the back of your head. You find yourself unable to move!")) - ADD_TRAIT(chosen, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cultist Stun")) - chosen.update_canmove() chosen.update_xeno_hostile_hud() diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 805b3d7e17..2bb113d677 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -206,12 +206,11 @@ w_uniform.add_fingerprint(M) - if(lying || sleeping) + if(body_position == LYING_DOWN || sleeping) if(client) sleeping = max(0,src.sleeping-5) if(!sleeping) - resting = 0 - update_canmove() + set_resting(FALSE) M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \ SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4) else if(stunned) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 4416ba74fd..cd6abd2262 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -1,5 +1,6 @@ /mob/living/carbon/human light_system = MOVABLE_LIGHT + rotate_on_lying = TRUE //Hair color and style var/r_hair = 0 var/g_hair = 0 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index d2b86d2aa3..a98de60d3e 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -219,14 +219,6 @@ return 0 - -/mob/living/carbon/human/has_legs() - . = 0 - if(has_limb("r_foot") && has_limb("r_leg")) - .++ - if(has_limb("l_foot") && has_limb("l_leg")) - .++ - /mob/living/carbon/human/proc/disable_special_flags() status_flags |= CANPUSH anchored = FALSE diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 1a906dfa5c..1803e28911 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -108,7 +108,7 @@ //Do we have a working jetpack if(istype(back, /obj/item/tank/jetpack)) var/obj/item/tank/jetpack/J = back - if(((!check_drift) || (check_drift && J.stabilization_on)) && (!lying) && (J.allow_thrust(0.01, src))) + if(((!check_drift) || (check_drift && J.stabilization_on)) && (body_position == STANDING_UP) && (J.allow_thrust(0.01, src))) inertia_dir = 0 return 1 // if(!check_drift && J.allow_thrust(0.01, src)) @@ -140,3 +140,10 @@ prob_slip = round(prob_slip) return(prob_slip) + +/// Updates [TRAIT_FLOORED] based on whether the mob has appropriate limbs to stand or not +/mob/living/carbon/human/proc/update_leg_status() + if((has_limb("r_foot") && has_limb("r_leg")) || (has_limb("l_foot") && has_limb("l_leg"))) + REMOVE_TRAIT(src, TRAIT_FLOORED, BODY_TRAIT) + else + ADD_TRAIT(src, TRAIT_FLOORED, BODY_TRAIT) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fded3d5e3f..be1c7833c5 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -82,8 +82,6 @@ //Status updates, death etc. handle_regular_status_updates() //Optimized a bit - update_canmove() - handle_regular_hud_updates() pulse = handle_pulse() diff --git a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm index 9ab2342121..77358ca45b 100644 --- a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm +++ b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm @@ -3,7 +3,7 @@ /mob/living/carbon/human/proc/handle_disabilities() if(disabilities & EPILEPSY) - if((prob(1) && knocked_out < 1)) + if(prob(1) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) visible_message(SPAN_DANGER("\The [src] starts having a seizure!"), \ SPAN_DANGER("You start having a seizure!"), null, 5) apply_effect(10, PARALYZE) @@ -11,14 +11,14 @@ return if(disabilities & COUGHING) - if((prob(5) && knocked_out <= 1)) + if(prob(5) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) drop_held_item() INVOKE_ASYNC(src, PROC_REF(emote), "cough") return if(disabilities & TOURETTES) speech_problem_flag = TRUE - if((prob(10) && knocked_out <= 1)) + if((prob(10) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT))) apply_effect(10, STUN) spawn() switch(rand(1, 3)) @@ -56,6 +56,6 @@ to_chat(src, SPAN_DANGER("Your hand won't respond properly, you drop what you're holding.")) drop_held_item() if(10 to 12) - if(getBrainLoss() >= 50 && !lying) + if(getBrainLoss() >= 50 && body_position == STANDING_UP) to_chat(src, SPAN_DANGER("Your legs won't respond properly, you fall down.")) resting = 1 diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index 2c978f2295..706e8567a5 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -16,7 +16,7 @@ else E.process() - if(!lying && world.time - l_move_time < 15) + if(body_position == STANDING_UP && world.time - l_move_time < 15) // Moving around with fractured ribs won't do you any good if(E.is_broken() && E.internal_organs && prob(15)) var/datum/internal_organ/I = pick(E.internal_organs) @@ -32,7 +32,7 @@ custom_pain("You feel broken bones cutting at you in your [E.display_name]!", 1) pain.apply_pain(damage * 1.5) - if(!lying && !buckled && prob(2)) + if(body_position == STANDING_UP && !buckled && prob(2)) var/left_leg_crippled = FALSE var/right_leg_crippled = FALSE diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm index 5c951a8112..41554f0567 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm @@ -1,6 +1,6 @@ //Refer to life.dm for caller -/mob/living/carbon/human/handle_regular_status_updates(regular_update = TRUE) +/mob/living/carbon/human/handle_regular_status_updates(regular_update = TRUE) // you're next, evil proc --fira if(status_flags & GODMODE) return 0 @@ -53,9 +53,8 @@ if(!already_in_crit) new /datum/effects/crit/human(src) - if(knocked_out) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) blinded = TRUE - set_stat(UNCONSCIOUS) if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) diff --git a/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm b/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm index 9d257da720..16d9955395 100644 --- a/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm +++ b/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm @@ -4,6 +4,9 @@ //Handle side effects from stasis switch(in_stasis) if(STASIS_IN_BAG) + // I hate whoever wrote this and statuses with a passion knocked_down = knocked_down? --knocked_down : knocked_down + 10 //knocked_down set. + if(knocked_down <= 0) + knocked_down_callback() if(STASIS_IN_CRYO_CELL) if(sleeping < 10) sleeping += 10 //Puts the mob to sleep indefinitely. diff --git a/code/modules/mob/living/carbon/human/life/life_helpers.dm b/code/modules/mob/living/carbon/human/life/life_helpers.dm index fedeaf9fd4..25f020a9f8 100644 --- a/code/modules/mob/living/carbon/human/life/life_helpers.dm +++ b/code/modules/mob/living/carbon/human/life/life_helpers.dm @@ -25,33 +25,6 @@ pressure_adjustment_coefficient = min(1, max(pressure_adjustment_coefficient, 0)) //So it isn't less than 0 or larger than 1. return pressure_adjustment_coefficient -//Calculate how much of the enviroment pressure-difference affects the human. -/mob/living/carbon/human/calculate_affecting_pressure(pressure) - var/pressure_difference - - //First get the absolute pressure difference. - if(pressure < ONE_ATMOSPHERE) //We are in an underpressure. - pressure_difference = ONE_ATMOSPHERE - pressure - - else //We are in an overpressure or standard atmosphere. - pressure_difference = pressure - ONE_ATMOSPHERE - - if(pressure_difference < 5) //If the difference is small, don't bother calculating the fraction. - pressure_difference = 0 - - else - //Otherwise calculate how much of that absolute pressure difference affects us, can be 0 to 1 (equals 0% to 100%). - //This is our relative difference. - pressure_difference *= get_pressure_weakness() - - //The difference is always positive to avoid extra calculations. - //Apply the relative difference on a standard atmosphere to get the final result. - //The return value will be the adjusted_pressure of the human that is the basis of pressure warnings and damage. - if(pressure < ONE_ATMOSPHERE) - return ONE_ATMOSPHERE - pressure_difference - else - return ONE_ATMOSPHERE + pressure_difference - /mob/living/carbon/human/proc/stabilize_body_temperature() @@ -320,9 +293,7 @@ emote("gasp") regenerate_icons() reload_fullscreens() - update_canmove() flash_eyes() apply_effect(10, EYE_BLUR) apply_effect(10, PARALYZE) - update_canmove() updatehealth() //One more time, so it doesn't show the target as dead on HUDs diff --git a/code/modules/mob/living/carbon/human/powers/human_powers.dm b/code/modules/mob/living/carbon/human/powers/human_powers.dm index 10b13225b3..219212d1e1 100644 --- a/code/modules/mob/living/carbon/human/powers/human_powers.dm +++ b/code/modules/mob/living/carbon/human/powers/human_powers.dm @@ -9,7 +9,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || buckled) to_chat(src, "You cannot tackle someone in your current state.") return @@ -27,7 +27,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || buckled) to_chat(src, "You cannot tackle in your current state.") return @@ -56,7 +56,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -74,7 +74,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -110,7 +110,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated(TRUE) || lying) + if(is_mob_incapacitated() || body_position != STANDING_UP) to_chat(src, SPAN_DANGER("You cannot do that in your current state.")) return @@ -193,13 +193,46 @@ /mob/living/verb/lay_down() set name = "Rest" set category = "IC" + set_resting(!resting, FALSE, TRUE) - if(!resting) - apply_effect(1, WEAKEN) //so that the mob immediately falls over - - resting = !resting +///Proc to hook behavior to the change of value in the resting variable. +/mob/living/proc/set_resting(new_resting, silent = TRUE, instant = FALSE) + if(!(mobility_flags & MOBILITY_REST)) + return + if(new_resting == resting) + return + if(!COOLDOWN_FINISHED(src, rest_cooldown)) + to_chat(src, SPAN_WARNING("You can't 'rest' that fast. Take a breather!")) + return + COOLDOWN_START(src, rest_cooldown, 1 SECONDS) + + . = resting + resting = new_resting + if(new_resting) + if(body_position == LYING_DOWN) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now try to stay lying down on the floor.")) + else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING)) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now lay down as soon as you are able to.")) + else + if(!silent) + to_chat(src, SPAN_NOTICE("You lay down.")) + set_lying_down() + else + if(body_position == STANDING_UP) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now try to remain standing up.")) + else if(HAS_TRAIT(src, TRAIT_FLOORED) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING)) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now stand up as soon as you are able to.")) + else + if(!silent) + to_chat(src, SPAN_NOTICE("You stand up.")) + get_up(instant) - to_chat(src, SPAN_NOTICE("You are now [resting ? "resting." : "getting up."]")) +// SEND_SIGNAL(src, COMSIG_LIVING_RESTING, new_resting, silent, instant) +// update_resting() // HUD icons /mob/living/carbon/human/proc/toggle_inherent_nightvison() set category = "Synthetic" diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index 6c774432e7..8e8d244329 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -46,8 +46,8 @@ /datum/species/monkey/handle_npc(mob/living/carbon/human/H) if(H.stat != CONSCIOUS) return - if(prob(33) && isturf(H.loc) && !H.pulledby && !H.lying && !H.is_mob_restrained()) //won't move if being pulled - step(H, pick(cardinal)) + if(prob(33) && isturf(H.loc) && !H.pulledby && (H.mobility_flags & MOBILITY_MOVE) && !H.is_mob_restrained()) //won't move if being pulled + step(H, pick(GLOB.cardinals)) var/obj/held = H.get_active_hand() if(held && prob(1)) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 3f415d8d30..d2177cf49a 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -166,6 +166,13 @@ for(var/datum/internal_organ/I in H.internal_organs) I.mechanize() + // We just deleted the legs so they fell down. + // Update again now that the legs are back so they can stand properly during rest of species code and before outside updates kick in. + // I hate this code. + H.update_leg_status() + // While we're deep in shitcode we also force instant transition so this nonsense isn't visually noticeable + H.update_transform(instant_update = TRUE) + /datum/species/proc/initialize_pain(mob/living/carbon/human/H) if(pain_type) QDEL_NULL(H.pain) @@ -179,12 +186,7 @@ /datum/species/proc/hug(mob/living/carbon/human/H, mob/living/carbon/target, target_zone = "chest") if(H.flags_emote) return - var/t_him = "them" - switch(target.gender) - if(MALE) - t_him = "him" - if(FEMALE) - t_him = "her" + var/t_him = target.p_them() if(target_zone == "head") attempt_rock_paper_scissors(H, target) @@ -195,6 +197,9 @@ else if(target_zone in list("l_hand", "r_hand")) attempt_fist_bump(H, target) return + else if(H.body_position == LYING_DOWN) // Keep other interactions above lying check for maximum awkwardness potential + H.visible_message(SPAN_NOTICE("[H] waves at [target] to make [t_him] feel better!"), \ + SPAN_NOTICE("You wave at [target] to make [t_him] feel better!"), null, 4) else if(target_zone == "groin") H.visible_message(SPAN_NOTICE("[H] hugs [target] to make [t_him] feel better!"), \ SPAN_NOTICE("You hug [target] to make [t_him] feel better!"), null, 4) diff --git a/code/modules/mob/living/carbon/human/species/zombie.dm b/code/modules/mob/living/carbon/human/species/zombie.dm index 5fa928a67f..35b6d4e43e 100644 --- a/code/modules/mob/living/carbon/human/species/zombie.dm +++ b/code/modules/mob/living/carbon/human/species/zombie.dm @@ -53,9 +53,6 @@ if(zombie.glasses) zombie.drop_inv_item_on_ground(zombie.glasses, FALSE, TRUE) if(zombie.wear_mask) zombie.drop_inv_item_on_ground(zombie.wear_mask, FALSE, TRUE) - if(zombie.lying) - zombie.lying = FALSE - var/obj/item/weapon/zombie_claws/ZC = new(zombie) ZC.icon_state = "claw_r" zombie.equip_to_slot_or_del(ZC, WEAR_R_HAND, TRUE) @@ -116,7 +113,7 @@ /datum/species/zombie/proc/revive_from_death(mob/living/carbon/human/zombie) if(zombie && zombie.loc && zombie.stat == DEAD) zombie.revive(TRUE) - zombie.stunned = 4 + zombie.apply_effect(4, STUN) zombie.make_jittery(500) zombie.visible_message(SPAN_WARNING("[zombie] rises from the ground!")) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 1dcefec9b6..2952aa7197 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -89,25 +89,6 @@ There are several things that need to be remembered: overlays -= I overlays_standing[cache_index] = null - -/mob/living/carbon/human/update_transform(force = FALSE) - if(lying == lying_prev && !force) - return - lying_prev = lying - var/matrix/new_matrix = matrix() - if(lying) - if(pulledby && pulledby.grab_level >= GRAB_CARRY) - new_matrix.Turn(90) - else - if(prob(50)) - new_matrix.Turn(90) - else - new_matrix.Turn(270) - new_matrix.Translate(rand(-10,10), rand(-10,10)) - apply_transform(new_matrix) - else - apply_transform(new_matrix) - /mob/living/carbon/human/UpdateDamageIcon() for(var/obj/limb/O in limbs) if(!(O.status & LIMB_DESTROYED)) @@ -131,6 +112,8 @@ There are several things that need to be remembered: //BASE MOB SPRITE /mob/living/carbon/human/proc/update_body() + update_leg_status() // Not icon ops, but placed here due to lack of a non-icons update_body + appearance_flags |= KEEP_TOGETHER // sanity update_damage_overlays() @@ -807,3 +790,11 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, /mob/living/carbon/human/on_immobilized_trait_loss(datum/source) . = ..() update_xeno_hostile_hud() + +/mob/living/carbon/human/on_floored_trait_gain(datum/source) + . = ..() + update_xeno_hostile_hud() + +/mob/living/carbon/human/on_floored_trait_loss(datum/source) + . = ..() + update_xeno_hostile_hud() diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index cc76999358..e08a71f81e 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -4,8 +4,3 @@ /mob/living/carbon/proc/remove_overlay(cache_index) return - -/mob/living/carbon/update_transform() - if(lying != lying_prev ) - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again - update_icons() diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index d253d8bc07..06f677ece9 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -102,7 +102,7 @@ switch(stage) if(2) if(prob(4)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("[affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -123,7 +123,7 @@ else if(prob(2)) affected_mob.emote("[pick("sneeze", "cough")]") if(prob(5)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("\The [affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -139,7 +139,7 @@ if(prob(50)) affected_mob.emote("scream") if(prob(6)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("[affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -295,7 +295,7 @@ return victim.chestburst = TRUE to_chat(src, SPAN_DANGER("You start bursting out of [victim]'s chest!")) - if(victim.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) victim.apply_effect(20, DAZE) victim.visible_message(SPAN_DANGER("\The [victim] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something ripping up your insides!")) diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index 26003affa2..18bb56b632 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -116,8 +116,8 @@ attack_hand(user)//Not a carrier, or already full? Just pick it up. return XENO_NO_DELAY_ACTION -/obj/item/clothing/mask/facehugger/attack(mob/M, mob/user) - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.lying || M.buckled && !isyautja(M))) +/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user) + if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled && !isyautja(M))) to_chat(user, SPAN_WARNING("The facehugger refuses to attach.")) ..() return @@ -130,7 +130,7 @@ if(!do_after(user, 2 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE, M, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.lying || M.buckled)) + if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled)) return attach(M) @@ -525,7 +525,7 @@ var/catch_chance = 50 if(target.dir == reverse_dir[hugger.dir]) catch_chance += 20 - if(target.lying) + if(target.body_position == LYING_DOWN) catch_chance -= 50 catch_chance -= ((target.maxHealth - target.health) / 3) if(target.get_active_hand()) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index a1b6f96ab6..49bb644b40 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -150,7 +150,7 @@ //A simple handler for checking your state. Used in pretty much all the procs. /mob/living/carbon/xenomorph/proc/check_state(permissive = FALSE) if(!permissive) - if(is_mob_incapacitated() || lying || buckled || evolving || !isturf(loc)) + if(is_mob_incapacitated() || body_position == LYING_DOWN || buckled || evolving || !isturf(loc)) to_chat(src, SPAN_WARNING("You cannot do this in your current state.")) return FALSE else if(caste_type != XENO_CASTE_QUEEN && observed_xeno) @@ -319,7 +319,6 @@ if (pounceAction.freeze_self) if(pounceAction.freeze_play_sound) playsound(loc, rand(0, 100) < 95 ? 'sound/voice/alien_pounce.ogg' : 'sound/voice/alien_pounce2.ogg', 25, 1) - canmove = FALSE ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) pounceAction.freeze_timer_id = addtimer(CALLBACK(src, PROC_REF(unfreeze_pounce)), pounceAction.freeze_time, TIMER_STOPPABLE) pounceAction.additional_effects(M) @@ -628,7 +627,7 @@ if(!TC) TC = new(tackle_min + tackle_min_offset, tackle_max + tackle_max_offset, tackle_chance*tackle_mult) LAZYSET(tackle_counter, M, TC) - RegisterSignal(M, COMSIG_MOB_KNOCKED_DOWN, PROC_REF(tackle_handle_lying_changed)) + RegisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(tackle_handle_lying_changed)) if (TC.tackle_reset_id) deltimer(TC.tackle_reset_id) @@ -640,8 +639,11 @@ else reset_tackle(M) -/mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/M) +/mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/living/M, body_position) SIGNAL_HANDLER + if(body_position != LYING_DOWN) + return + // Infected mobs do not have their tackle counter reset if // they get knocked down or get up from a knockdown if(M.status_flags & XENO_HOST) @@ -654,7 +656,7 @@ if (TC) qdel(TC) LAZYREMOVE(tackle_counter, M) - UnregisterSignal(M, COMSIG_MOB_KNOCKED_DOWN) + UnregisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION) /mob/living/carbon/xenomorph/burn_skin(burn_amount) @@ -778,3 +780,6 @@ SSminimaps.remove_marker(src) add_minimap_marker() + +/mob/living/carbon/xenomorph/lying_angle_on_lying_down(new_lying_angle) + return // Do not rotate xenos around on the floor, their sprite is already top-down'ish diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 6ce6de84a0..641312e050 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm @@ -165,7 +165,6 @@ return REMOVE_TRAIT(H, TRAIT_IMMOBILIZED, trait_source) - H.update_canmove() if(ishuman(H)) var/mob/living/carbon/human/T = H diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm index 8b8e3f9c86..6a2071fafc 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm @@ -37,18 +37,14 @@ to_chat(src, SPAN_XENOWARNING("You burrow yourself into the ground.")) invisibility = 101 anchored = TRUE - density = FALSE if(caste.fire_immunity == FIRE_IMMUNITY_NONE) RegisterSignal(src, COMSIG_LIVING_PREIGNITION, PROC_REF(fire_immune)) RegisterSignal(src, list( COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, ), PROC_REF(flamer_crossed_immune)) - ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) - ADD_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) - ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) + add_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow")) playsound(src.loc, 'sound/effects/burrowing_b.ogg', 25) - update_canmove() update_icons() addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) burrow_timer = world.time + 90 // How long we can be burrowed @@ -74,19 +70,15 @@ COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, )) - REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) - REMOVE_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) - REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) + remove_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow")) invisibility = FALSE anchored = FALSE - density = TRUE playsound(loc, 'sound/effects/burrowoff.ogg', 25) for(var/mob/living/carbon/mob in loc) if(!can_not_harm(mob)) mob.apply_effect(2, WEAKEN) addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) - update_canmove() update_icons() /mob/living/carbon/xenomorph/proc/do_burrow_cooldown() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm index 5be44deb87..ca5f88638a 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm @@ -133,6 +133,11 @@ #define MINIMUM_CHARGE_DISTANCE 3 #define MAXIMUM_TARGET_DISTANCE 12 +/datum/action/xeno_action/onclick/charger_charge/proc/handle_position_change(mob/living/carbon/xenomorph/xeno, body_position) + SIGNAL_HANDLER + if(body_position == LYING_DOWN) + handle_movement(xeno) + /datum/action/xeno_action/onclick/charger_charge/process_ai(mob/living/carbon/xenomorph/processing_xeno, delta_time) if(!DT_PROB(ai_prob_chance, delta_time) || !isnull(charge_dir) || processing_xeno.action_busy) return @@ -281,7 +286,7 @@ shake_camera(Mob, 2, 1) for(var/mob/living/carbon/human/Mob in xeno.loc) - if(Mob.lying && Mob.stat != DEAD) + if(Mob.body_position == LYING_DOWN && Mob.stat != DEAD) xeno.visible_message(SPAN_DANGER("[xeno] runs [Mob] over!"), SPAN_DANGER("You run [Mob] over!") ) @@ -297,7 +302,7 @@ if(momentum >= 5) for(var/mob/living/carbon/human/hit_human in orange(1, xeno)) - if(hit_human.knocked_down) + if(hit_human.body_position == LYING_DOWN) continue shake_camera(hit_human, 4, 2) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm index b14af5c005..74c6dadb72 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm @@ -113,17 +113,14 @@ ADD_TRAIT(xeno_owner, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Stomp")) xeno_owner.anchored = TRUE - xeno_owner.update_canmove() if (!do_after(xeno_owner, windup_duration, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) REMOVE_TRAIT(xeno_owner, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Stomp")) xeno_owner.anchored = FALSE - xeno_owner.update_canmove() return REMOVE_TRAIT(xeno_owner, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Stomp")) xeno_owner.anchored = FALSE - xeno_owner.update_canmove() playsound(get_turf(xeno_owner), 'sound/effects/bang.ogg', 25, 0) xeno_owner.visible_message(SPAN_XENODANGER("[xeno_owner] smashes into the ground!"), SPAN_XENODANGER("You smash into the ground!")) @@ -223,7 +220,7 @@ to_chat(Xeno, SPAN_XENONOTICE("You will [will_charge] charge when moving.")) if(activated) RegisterSignal(Xeno, COMSIG_MOVABLE_MOVED, PROC_REF(handle_movement)) - RegisterSignal(Xeno, COMSIG_MOB_KNOCKED_DOWN, PROC_REF(handle_movement)) + RegisterSignal(Xeno, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(handle_position_change)) RegisterSignal(Xeno, COMSIG_ATOM_DIR_CHANGE, PROC_REF(handle_dir_change)) RegisterSignal(Xeno, COMSIG_XENO_RECALCULATE_SPEED, PROC_REF(update_speed)) RegisterSignal(Xeno, COMSIG_XENO_STOP_MOMENTUM, PROC_REF(stop_momentum)) @@ -235,7 +232,7 @@ stop_momentum() UnregisterSignal(Xeno, list( COMSIG_MOVABLE_MOVED, - COMSIG_MOB_KNOCKED_DOWN, + COMSIG_LIVING_SET_BODY_POSITION, COMSIG_ATOM_DIR_CHANGE, COMSIG_XENO_RECALCULATE_SPEED, COMSIG_MOVABLE_ENTERED_RIVER, diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm index bbb202fef3..3cdf1342f5 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm @@ -220,7 +220,6 @@ ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) X.anchored = TRUE X.small_explosives_stun = FALSE - X.update_canmove() RegisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE, PROC_REF(check_directional_armor)) X.mob_size = MOB_SIZE_IMMOBILE //knockback immune X.mob_flags &= ~SQUEEZE_UNDER_VEHICLES @@ -242,7 +241,6 @@ UnregisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE) X.mob_size = MOB_SIZE_XENO //no longer knockback immune X.mob_flags |= SQUEEZE_UNDER_VEHICLES - X.update_canmove() X.update_icons() X.fortify = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index ed50ab58e2..a91f898e9b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -282,7 +282,6 @@ return var/mob/living/carbon/xenomorph/X = owner REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) - X.update_canmove() deltimer(freeze_timer_id) freeze_timer_id = TIMER_ID_NULL to_chat(X, SPAN_XENONOTICE("Slashing frenzies you! You feel free to move immediately!")) @@ -315,7 +314,7 @@ /datum/action/xeno_action/onclick/toggle_long_range/can_use_action() var/mob/living/carbon/xenomorph/xeno = owner - if(xeno && !xeno.is_mob_incapacitated() && !xeno.lying && !xeno.buckled) + if(xeno && !xeno.is_mob_incapacitated() && !xeno.buckled) return TRUE /datum/action/xeno_action/onclick/toggle_long_range/give_to(mob/living/living_mob) @@ -572,6 +571,14 @@ hide_from(owner) +/datum/action/xeno_action/onclick/tacmap/can_use_action() + if(!owner) + return FALSE + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno.is_mob_incapacitated() || xeno.dazed) + return FALSE + return TRUE + /datum/action/xeno_action/onclick/tacmap/use_ability(atom/target) var/mob/living/carbon/xenomorph/xeno = owner xeno.xeno_tacmap() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 928dba4a76..958e0f7a2f 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -413,7 +413,6 @@ if (!windup_interruptable) ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = TRUE - X.update_canmove() pre_windup_effects() if (!do_after(X, windup_duration, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) @@ -421,14 +420,12 @@ if (!windup_interruptable) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE - X.update_canmove() post_windup_effects(interrupted = TRUE) return if (!windup_interruptable) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE - X.update_canmove() post_windup_effects() X.visible_message(SPAN_XENOWARNING("\The [X] [ability_name][findtext(ability_name, "e", -1) || findtext(ability_name, "p", -1) ? "s" : "es"] at [A]!"), SPAN_XENOWARNING("You [ability_name] at [A]!")) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm index 8c39228e35..02e7fd8144 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm @@ -18,7 +18,7 @@ /datum/action/xeno_action/active_toggle/toggle_speed/can_use_action() var/mob/living/carbon/xenomorph/hivelord/xeno = owner - if(xeno && !xeno.is_mob_incapacitated() && !xeno.lying && !xeno.buckled) + if(xeno && !xeno.is_mob_incapacitated() && xeno.body_position == STANDING_UP && !xeno.buckled) // do we rly need standing up? return TRUE /datum/action/xeno_action/active_toggle/toggle_speed/give_to(mob/living/living_mob) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm index 13734a5b9c..0c2b226cb2 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm @@ -268,7 +268,7 @@ if(xeno.can_not_harm(target_carbon)) return - if(!(target_carbon.knocked_out || target_carbon.stat == UNCONSCIOUS)) //called knocked out because for some reason .stat seems to have a delay . + if(!(HAS_TRAIT(target_carbon, TRAIT_KNOCKEDOUT) || target_carbon.stat == UNCONSCIOUS)) //called knocked out because for some reason .stat seems to have a delay . to_chat(xeno, SPAN_XENOHIGHDANGER("You can only headbite an unconscious, adjacent target!")) return diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm index 400a4a80ba..aab1ff6a60 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm @@ -174,9 +174,7 @@ var/root_duration = buffed ? root_duration_buffed : root_duration_unbuffed vanguard_user.visible_message(SPAN_XENODANGER("[vanguard_user] slams [target_atom] into the ground!"), SPAN_XENOHIGHDANGER("You slam [target_atom] into the ground!")) - ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cleave")) - target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon @@ -293,7 +291,6 @@ var/throw_target_turf = get_step(xeno.loc, facing) ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - xeno.update_canmove() if(!do_after(xeno, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) to_chat(xeno, SPAN_XENOWARNING("You relax your tail.")) apply_cooldown() @@ -303,7 +300,6 @@ qdel(xenotelegraph) REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - xeno.update_canmove() return @@ -311,7 +307,6 @@ return REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - xeno.update_canmove() playsound(get_turf(xeno), 'sound/effects/bang.ogg', 25, 0) xeno.visible_message(SPAN_XENODANGER("\The [xeno] suddenly uncoils its tail, firing it towards [atom]!"), SPAN_XENODANGER("You uncoil your tail, sending it out towards \the [atom]!")) @@ -339,13 +334,11 @@ new /datum/effects/xeno_slow(target, xeno, , ,25) target.apply_effect(1, SLOW) else if (LAZYLEN(targets) == 2) - ADD_TRAIT(target, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - target.update_canmove() if (ishuman(target)) - var/mob/living/carbon/human/human = target - human.update_xeno_hostile_hud() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target), get_xeno_stun_duration(target, 25)) + var/mob/living/carbon/human/target_human = target + target_human.update_xeno_hostile_hud() + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target, TRAIT_SOURCE_ABILITY("Abduct")), get_xeno_stun_duration(target, 25)) to_chat(target, SPAN_XENOHIGHDANGER("[xeno] has pinned you to the ground! You cannot move!")) target.set_effect(2, DAZE) @@ -409,10 +402,9 @@ oppressor_user.animation_attack_on(target_carbon) oppressor_user.flick_attack_overlay(target_carbon, "punch") - if (HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed || target_carbon.knocked_down) + if (!(target_carbon.mobility_flags & MOBILITY_MOVE) || !(target_carbon.mobility_flags & MOBILITY_STAND) || target_carbon.slowed) target_carbon.apply_damage(get_xeno_damage_slash(target_carbon, damage), BRUTE, target_limb? target_limb.name : "chest") ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Oppressor Punch")) - target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon @@ -1013,7 +1005,6 @@ throw_target_turf = behind_turf ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() if(windup) if(!do_after(X, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) to_chat(X, SPAN_XENOWARNING("You cancel your retrieve.")) @@ -1024,12 +1015,10 @@ qdel(XT) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() return REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() playsound(get_turf(X), 'sound/effects/bang.ogg', 25, 0) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm index a26cc922c5..3c475743c0 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm @@ -79,7 +79,6 @@ for(var/mob/living/carbon/carbon in oview(round(behavior.kills * 0.5 + 2), xeno)) if(!xeno.can_not_harm(carbon) && carbon.stat != DEAD) ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Smash")) - carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon @@ -126,7 +125,6 @@ return ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) - carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon @@ -136,7 +134,6 @@ ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = TRUE - xeno.update_canmove() if (do_after(xeno, activation_delay, INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] rips open the guts of [carbon]!"), SPAN_XENOHIGHDANGER("You rip open the guts of [carbon]!")) @@ -154,9 +151,6 @@ REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = FALSE unroot_human(carbon, TRAIT_SOURCE_ABILITY("Devastate")) - xeno.update_canmove() - - unroot_human(carbon) xeno.visible_message(SPAN_XENODANGER("[xeno] rapidly slices into [carbon]!")) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm index a6c8067660..c2862c7762 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm @@ -387,7 +387,6 @@ ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = TRUE - xeno.update_canmove() if (do_after(xeno, (activation_delay - windup_reduction), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) xeno.emote("roar") @@ -432,7 +431,6 @@ REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = FALSE - xeno.update_canmove() return ..() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm b/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm index 5f59f1c006..289e0f1bfa 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm @@ -82,7 +82,7 @@ if(!owner) return FALSE var/mob/living/carbon/xenomorph/X = owner - if(X && !X.is_mob_incapacitated() && !X.dazed && !X.lying && !X.buckled && X.plasma_stored >= plasma_cost) + if(X && !X.is_mob_incapacitated() && !X.dazed && X.body_position == STANDING_UP && !X.buckled && X.plasma_stored >= plasma_cost) return TRUE /datum/action/xeno_action/give_to(mob/living/living_mob) diff --git a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm index 5835fd5165..4cac1dabe6 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm @@ -147,7 +147,7 @@ /mob/living/carbon/xenomorph/proc/can_move_and_apply_move_delay() // Unable to move, try next time. - if(ai_move_delay > world.time || !canmove || is_mob_incapacitated(TRUE) || (lying && !can_crawl) || anchored) + if(ai_move_delay > world.time || !(mobility_flags & MOBILITY_MOVE) || is_mob_incapacitated(TRUE) || (body_position != STANDING_UP && !can_crawl) || anchored) return FALSE ai_move_delay = world.time + move_delay diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index 497ebe734e..1f37113ffc 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -209,7 +209,7 @@ SPAN_DANGER("You tackle down [src]!"), null, 5, CHAT_TYPE_XENO_COMBAT) else playsound(loc, 'sound/weapons/alien_claw_swipe.ogg', 25, 1) - if (knocked_down) + if (HAS_TRAIT(src, TRAIT_FLOORED)) M.visible_message(SPAN_DANGER("[M] tries to tackle [src], but they are already down!"), \ SPAN_DANGER("You try to tackle [src], but they are already down!"), null, 5, CHAT_TYPE_XENO_COMBAT) else @@ -555,8 +555,8 @@ if(M.action_busy) return - if(M.lying) - return + if(M.is_mob_incapacitated() || M.body_position != STANDING_UP) + return XENO_NO_DELAY_ACTION var/delay @@ -574,7 +574,7 @@ if(do_after(M, delay, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) if(M.loc != cur_loc) return XENO_NO_DELAY_ACTION //Make sure we're still there - if(M.lying) + if(M.is_mob_incapacitated() || M.body_position != STANDING_UP) return XENO_NO_DELAY_ACTION if(locked) to_chat(M, SPAN_WARNING("[src] is bolted down tight.")) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm index e7118164cf..ee882bc14f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm @@ -84,13 +84,6 @@ . = ..() sight |= SEE_TURFS -/mob/living/carbon/xenomorph/burrower/update_canmove() - . = ..() - if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) - density = FALSE - canmove = FALSE - return canmove - /mob/living/carbon/xenomorph/burrower/ex_act(severity) if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index c13555cba1..07f161f4c6 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -117,8 +117,8 @@ for(var/i in hugger_image_index) if(stat == DEAD) hugger_overlays_icon.overlays += icon(icon, "clinger_[i] Knocked Down") - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) hugger_overlays_icon.overlays += icon(icon, "clinger_[i] Sleeping") else hugger_overlays_icon.overlays +=icon(icon, "clinger_[i] Knocked Down") @@ -162,8 +162,8 @@ i = 1 if(stat != DEAD) - if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) eggsac_overlays_icon.overlays += icon(icon, "eggsac_[i] Sleeping") else eggsac_overlays_icon.overlays +=icon(icon, "eggsac_[i] Knocked Down") diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm index 7eca90af85..d326a4d061 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm @@ -295,6 +295,6 @@ . += "Shield: [shield_total]" /datum/behavior_delegate/crusher_base/on_update_icons() - if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && !bound_xeno.lying) + if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && bound_xeno.body_position == STANDING_UP) bound_xeno.icon_state = "[bound_xeno.mutation_icon_state || bound_xeno.mutation_type] Crusher Charging" return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index 6113832ddd..16ce2ed9d5 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -69,7 +69,7 @@ if(stat == DEAD) return ..() - if(!lying && !(mutation_type == FACEHUGGER_WATCHER) && !(locate(/obj/effect/alien/weeds) in get_turf(src))) + if(body_position == STANDING_UP && !(mutation_type == FACEHUGGER_WATCHER) && !(locate(/obj/effect/alien/weeds) in get_turf(src))) adjustBruteLoss(1) return ..() @@ -85,8 +85,8 @@ if(stat == DEAD) icon_state = "[mutation_type] [caste.caste_type] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[mutation_type] [caste.caste_type] Sleeping" else icon_state = "[mutation_type] [caste.caste_type] Knocked Down" @@ -109,8 +109,8 @@ if(!caste) return FALSE - if(lying) //No attacks while laying down - return FALSE + if(body_position == LYING_DOWN) //No attacks while laying down + return FALSE // Yoooo replace this by a mobility_flag for attacks or something if(istype(A, /obj/effect/alien/resin/special/eggmorph)) var/obj/effect/alien/resin/special/eggmorph/morpher = A @@ -129,7 +129,7 @@ if(ishuman(A)) var/mob/living/carbon/human/human = A - if(!human.lying) + if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return if(!can_hug(human, hivenumber)) @@ -138,7 +138,7 @@ visible_message(SPAN_WARNING("\The [src] starts climbing onto \the [human]'s face..."), SPAN_XENONOTICE("You start climbing onto \the [human]'s face...")) if(!do_after(src, FACEHUGGER_WINDUP_DURATION, INTERRUPT_ALL, BUSY_ICON_HOSTILE, human, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!human.lying) + if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return if(!can_hug(human, hivenumber)) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index 34a2574f04..4efebf0a9c 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -129,8 +129,8 @@ else if(handcuffed || legcuffed) icon_state = "[state_override || state]Larva Cuff" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[state_override || state]Larva Sleeping" else icon_state = "[state_override || state]Larva Stunned" @@ -154,7 +154,7 @@ if(!caste) return FALSE - if(lying) //No attacks while laying down + if(body_position) //No attacks while laying down return FALSE A.attack_larva(src) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index d18b5eb671..4a399a3e40 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -162,7 +162,7 @@ if (!isxeno_human(target_carbon)) return - if (target_carbon.knocked_down) + if (HAS_TRAIT(target_carbon, TRAIT_FLOORED)) new /datum/effects/xeno_slow(target_carbon, bound_xeno, null, null, get_xeno_stun_duration(target_carbon, slash_slow_duration)) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index c4eba46c64..40ca7d674f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -789,6 +789,9 @@ if(ovipositor) return //sanity check ovipositor = TRUE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, OVIPOSITOR_TRAIT) + set_body_position(STANDING_UP) + set_resting(FALSE) set_resin_build_order(GLOB.resin_build_order_ovipositor) // This needs to occur before we update the abilities so we can update the choose resin icon for(var/datum/action/xeno_action/action in actions) @@ -841,7 +844,6 @@ egg_planting_range = 3 anchored = TRUE resting = FALSE - update_canmove() update_icons() bubble_icon_x_offset = 32 bubble_icon_y_offset = 32 @@ -869,6 +871,7 @@ if(!ovipositor) return ovipositor = FALSE + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, OVIPOSITOR_TRAIT) update_icons() bubble_icon_x_offset = initial(bubble_icon_x_offset) bubble_icon_y_offset = initial(bubble_icon_y_offset) @@ -897,7 +900,6 @@ ovi_ability.apply_cooldown() break anchored = FALSE - update_canmove() for(var/mob/living/carbon/xenomorph/L in hive.xeno_leader_list) L.handle_xeno_leader_pheromones() @@ -907,14 +909,6 @@ SEND_SIGNAL(src, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, instant_dismount) -/mob/living/carbon/xenomorph/queen/update_canmove() - . = ..() - if(ovipositor) - lying = FALSE - density = TRUE - canmove = FALSE - return canmove - /mob/living/carbon/xenomorph/queen/handle_special_state() if(ovipositor) return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm index 51ceee1533..b6ceb20434 100644 --- a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm @@ -36,7 +36,7 @@ /mob/living/carbon/xenomorph/ex_act(severity, direction, datum/cause_data/cause_data, pierce=0) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER if(severity >= 30) diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 6ea3b699dc..271ac7bbe3 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -10,7 +10,8 @@ ..() - if(is_zoomed && (stat || lying)) + // replace this by signals or trait signals + if(is_zoomed && (stat || body_position == LYING_DOWN)) zoom_out() if(stat != DEAD) //Stop if dead. Performance boost @@ -23,7 +24,6 @@ handle_regular_status_updates() handle_stomach_contents() handle_overwatch() // For new Xeno hivewide overwatch - Fourk, 6/24/19 - update_canmove() update_icons() handle_luminosity() handle_blood() @@ -184,9 +184,8 @@ ear_damage = 0 SetEyeBlind(0) - if(knocked_out) //If they're down, make sure they are actually down. + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) //If they're down, make sure they are actually down. blinded = TRUE - set_stat(UNCONSCIOUS) if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) @@ -339,7 +338,7 @@ Make sure their actual health updates immediately.*/ if(recovery_aura) plasma_stored += round(plasma_gain * plasma_max / 100 * recovery_aura/4) //Divided by four because it gets massive fast. 1 is equivalent to weed regen! Only the strongest pheromones should bypass weeds if(health < maxHealth && !hardcore && is_hive_living(hive) && last_hit_time + caste.heal_delay_time <= world.time) - if(lying || resting) + if(body_position == LYING_DOWN || resting) if(health < 0) //Unconscious heal_wounds(caste.heal_knocked_out * regeneration_multiplier, recoveryActual) //Healing is much slower. Warding pheromones make up for the rest if you're curious else @@ -533,8 +532,6 @@ Make sure their actual health updates immediately.*/ if(layer != initial(layer)) //Unhide layer = initial(layer) recalculate_move_delay = TRUE - if(!lying) - update_canmove() SEND_SIGNAL(src, COMSIG_XENO_HANDLE_CRIT) @@ -582,16 +579,14 @@ Make sure their actual health updates immediately.*/ return superslowed /mob/living/carbon/xenomorph/handle_knocked_down() - if(knocked_down) + if(HAS_TRAIT(src, TRAIT_FLOORED)) adjust_effect(life_knockdown_reduction, WEAKEN, EFFECT_FLAG_LIFE) knocked_down_callback_check() - return knocked_down /mob/living/carbon/xenomorph/handle_knocked_out() - if(knocked_out) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) adjust_effect(life_knockout_reduction, PARALYZE, EFFECT_FLAG_LIFE) knocked_out_callback_check() - return knocked_out //Returns TRUE if xeno is on weeds //Returns TRUE if xeno is off weeds AND doesn't need weeds for healing AND is not on Almayer UNLESS Queen is also on Almayer (aka - no solo Lurker Almayer hero) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm index fc7be12e4e..9e8bb6a3ea 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm @@ -114,7 +114,7 @@ return /datum/behavior_delegate/crusher_charger/on_update_icons() - if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && !bound_xeno.lying) + if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && bound_xeno.body_position == STANDING_UP) bound_xeno.icon_state = "[bound_xeno.mutation_icon_state || bound_xeno.mutation_type] Crusher Charging" return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm index 303e1c9469..c11f0e11f3 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm @@ -379,8 +379,8 @@ if(bound_xeno.stat == DEAD) fruit_sac_overlay_icon.icon_state = "Gardener Drone Dead" - else if(bound_xeno.lying) - if((bound_xeno.resting || bound_xeno.sleeping) && (!bound_xeno.knocked_down && !bound_xeno.knocked_out && bound_xeno.health > 0)) + else if(bound_xeno.body_position == LYING_DOWN) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) fruit_sac_overlay_icon.icon_state = "Gardener Drone Sleeping" else fruit_sac_overlay_icon.icon_state = "Gardener Drone Knocked Down" diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm index 5caab38529..2e562ceac6 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm @@ -160,8 +160,8 @@ if(bound_xeno.stat == DEAD) salve_applied_icon.icon_state = "Healer Drone Dead" - else if(bound_xeno.lying) - if((bound_xeno.resting || bound_xeno.sleeping) && (!bound_xeno.knocked_down && !bound_xeno.knocked_out && bound_xeno.health > 0)) + else if(bound_xeno.body_position == LYING_DOWN) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) salve_applied_icon.icon_state = "Healer Drone Sleeping" else salve_applied_icon.icon_state = "Healer Drone Knocked Down" diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm index ecb0e1eff5..4beaedf8d6 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm @@ -52,14 +52,12 @@ var/tearing_damage = 15 /datum/behavior_delegate/oppressor_praetorian/melee_attack_additional_effects_target(mob/living/carbon/target_carbon) - if(target_carbon.stat == DEAD) return - if(!(target_carbon.knocked_down || HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed)) - return + // impaired in some capacity + if(!(target_carbon.mobility_flags & MOBILITY_STAND) || !(target_carbon.mobility_flags & MOBILITY_MOVE) || target_carbon.slowed) + target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") + target_carbon.visible_message(SPAN_DANGER("[bound_xeno] tears into [target_carbon]!")) + playsound(bound_xeno, 'sound/weapons/alien_tail_attack.ogg', 25, TRUE) - target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") - target_carbon.visible_message(SPAN_DANGER("[bound_xeno] tears into [target_carbon]!")) - playsound(bound_xeno, 'sound/weapons/alien_tail_attack.ogg', 25, TRUE) - return diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm index 630edf26d3..490e5ca36c 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm @@ -87,7 +87,7 @@ if(embryo?.stage >= 4) //very late stage hugged in case the runner unnests them return - if(target_mob.lying) + if(target_mob.body_position == LYING_DOWN) modify_acid(acid_slash_regen_lying) return modify_acid(acid_slash_regen_standing) diff --git a/code/modules/mob/living/carbon/xenomorph/update_icons.dm b/code/modules/mob/living/carbon/xenomorph/update_icons.dm index 2eb86ac047..880f23f2d8 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -69,8 +69,8 @@ icon_state = "[mutation_caste_state] Dead" if(!(icon_state in icon_states(icon_xeno))) icon_state = "Normal [caste.caste_type] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[mutation_caste_state] Sleeping" if(!(icon_state in icon_states(icon_xeno))) icon_state = "Normal [caste.caste_type] Sleeping" @@ -93,6 +93,28 @@ update_inv_resource() update_icons() +/* CRUTCH ZONE - Update icons when relevant status happen - Ideally do this properly and for everything, then kill update_icons() someday */ +// set_body_position is needed on addition of floored start/stop because we can be switching between resting and knockeddown +/mob/living/carbon/xenomorph/set_body_position(new_value) + . = ..() + if(. != new_value) + update_icons() // Snowflake handler for xeno resting icons + +/mob/living/carbon/xenomorph/on_floored_start() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_floored_end() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_incapacitated_trait_gain() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_incapacitated_trait_loss() + . = ..() + update_icons() + +/* ^^^^^^^^^^^^^^ End Icon updates */ + /mob/living/carbon/xenomorph/update_inv_pockets() var/datum/custom_hud/alien/ui_datum = GLOB.custom_huds_list[HUD_ALIEN] if(l_store) @@ -142,8 +164,8 @@ var/state_modifier = "" if(stat == DEAD) state_modifier = " Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) state_modifier = " Sleeping" else state_modifier = " Knocked Down" @@ -237,7 +259,7 @@ if(on_fire && fire_reagent) var/image/I if(mob_size >= MOB_SIZE_BIG) - if((!initial(pixel_y) || lying) && !resting && !sleeping) + if((!initial(pixel_y) || body_position != LYING_DOWN)) // what's that pixel_y doing here??? I = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state"="alien_fire", "layer"=-X_FIRE_LAYER) else I = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state"="alien_fire_lying", "layer"=-X_FIRE_LAYER) @@ -278,8 +300,8 @@ if(health > HEALTH_THRESHOLD_DEAD) if(health_threshold > 3) wound_icon_holder.icon_state = "none" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) wound_icon_holder.icon_state = "[caste.caste_type]_rest_[health_threshold]" else wound_icon_holder.icon_state = "[caste.caste_type]_downed_[health_threshold]" diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index d7edd02893..696eaa3f01 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -1,21 +1,91 @@ /// Called on [/mob/living/Initialize(mapload)], for the mob to register to relevant signals. /mob/living/proc/register_init_signals() + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_loss)) RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_gain)) RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_loss)) + RegisterSignal(src, list(SIGNAL_ADDTRAIT(TRAIT_UNDENSE), SIGNAL_REMOVETRAIT(TRAIT_UNDENSE)), PROC_REF(undense_changed)) +/// Called when [TRAIT_KNOCKEDOUT] is added to the mob. +/mob/living/proc/on_knockedout_trait_gain(datum/source) + SIGNAL_HANDLER + if(stat < UNCONSCIOUS) + set_stat(UNCONSCIOUS) + +/// Called when [TRAIT_KNOCKEDOUT] is removed from the mob. +/mob/living/proc/on_knockedout_trait_loss(datum/source) + SIGNAL_HANDLER + if(stat <= UNCONSCIOUS) + update_stat() + /// Called when [TRAIT_IMMOBILIZED] is added to the mob. /mob/living/proc/on_immobilized_trait_gain(datum/source) SIGNAL_HANDLER -// mobility_flags &= ~MOBILITY_MOVE - update_canmove() + mobility_flags &= ~MOBILITY_MOVE /// Called when [TRAIT_IMMOBILIZED] is removed from the mob. /mob/living/proc/on_immobilized_trait_loss(datum/source) SIGNAL_HANDLER -// mobility_flags |= MOBILITY_MOVE - update_canmove() + mobility_flags |= MOBILITY_MOVE + +/// Called when [TRAIT_FLOORED] is added to the mob. +/mob/living/proc/on_floored_trait_gain(datum/source) + SIGNAL_HANDLER + if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING) + return // Handled by the buckle. + if(HAS_TRAIT(src, TRAIT_FORCED_STANDING)) + return // Don't go horizontal if mob has forced standing trait. + mobility_flags &= ~MOBILITY_STAND + on_floored_start() + + +/// Called when [TRAIT_FLOORED] is removed from the mob. +/mob/living/proc/on_floored_trait_loss(datum/source) + SIGNAL_HANDLER + mobility_flags |= MOBILITY_STAND + on_floored_end() + +/// Called when [TRAIT_FORCED_STANDING] is added to the mob. +/mob/living/proc/on_forced_standing_trait_gain(datum/source) + SIGNAL_HANDLER + + set_body_position(STANDING_UP) + set_lying_angle(0) + +/// Called when [TRAIT_FORCED_STANDING] is removed from the mob. +/mob/living/proc/on_forced_standing_trait_loss(datum/source) + SIGNAL_HANDLER + + if(HAS_TRAIT(src, TRAIT_FLOORED)) + on_fall() + set_lying_down() + else if(resting) + set_lying_down() + +/// Called when [TRAIT_INCAPACITATED] is added to the mob. +/mob/living/proc/on_incapacitated_trait_gain(datum/source) + SIGNAL_HANDLER + //add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED) + //update_appearance() + return + +/// Called when [TRAIT_INCAPACITATED] is removed from the mob. +/mob/living/proc/on_incapacitated_trait_loss(datum/source) + SIGNAL_HANDLER + //remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED) + //update_appearance() + return /// Called when [TRAIT_UNDENSE] is gained or lost /mob/living/proc/undense_changed(datum/source) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9f01b8037e..6205c4f919 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -34,11 +34,6 @@ QDEL_NULL(stamina) QDEL_NULL(hallucinations) -//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually -//affects them once clothing is factored in. ~Errorage -/mob/living/proc/calculate_affecting_pressure(pressure) - return - /mob/living/proc/initialize_pain() pain = new /datum/pain(src) @@ -151,6 +146,8 @@ return /mob/living/Move(NewLoc, direct) + if(lying_angle != 0) + lying_angle_on_movement(direct) if (buckled && buckled.loc != NewLoc) //not updating position if (!buckled.anchored) return buckled.Move(NewLoc, direct) @@ -454,16 +451,170 @@ for(var/h in src.hud_possible) src.clone.hud_list[h].icon_state = src.hud_list[h].icon_state +// Note that this might CLASH with handle_regular_status_updates until it is ELIMINATED +// and everything is switched from updates to signaling - due to not accounting for all cases. +// If this proc causes issues you can probably disable it until then. +/mob/living/carbon/update_stat() + if(stat != DEAD) + if(health <= HEALTH_THRESHOLD_DEAD) + death() + return + else if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) + set_stat(UNCONSCIOUS) + else + set_stat(CONSCIOUS) + /mob/living/set_stat(new_stat) . = ..() if(isnull(.)) return - switch(.) + + switch(.) //Previous stat. + if(CONSCIOUS) + if(stat >= UNCONSCIOUS) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) + add_traits(list(/*TRAIT_HANDS_BLOCKED, */ TRAIT_INCAPACITATED, TRAIT_FLOORED), STAT_TRAIT) + if(UNCONSCIOUS) + if(stat >= UNCONSCIOUS) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) //adding trait sources should come before removing to avoid unnecessary updates if(DEAD) SEND_SIGNAL(src, COMSIG_MOB_STAT_SET_ALIVE) - switch(stat) +// remove_from_dead_mob_list() +// add_to_alive_mob_list() + + switch(stat) //Current stat. + if(CONSCIOUS) + if(. >= UNCONSCIOUS) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) + remove_traits(list(/*TRAIT_HANDS_BLOCKED, */ TRAIT_INCAPACITATED, TRAIT_FLOORED, /*TRAIT_CRITICAL_CONDITION*/), STAT_TRAIT) + if(UNCONSCIOUS) + if(. >= UNCONSCIOUS) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) if(DEAD) SEND_SIGNAL(src, COMSIG_MOB_STAT_SET_DEAD) +// REMOVE_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT) +// remove_from_alive_mob_list() +// add_to_dead_mob_list() + +/** + * Changes the inclination angle of a mob, used by humans and others to differentiate between standing up and prone positions. + * + * In BYOND-angles 0 is NORTH, 90 is EAST, 180 is SOUTH and 270 is WEST. + * This usually means that 0 is standing up, 90 and 270 are horizontal positions to right and left respectively, and 180 is upside-down. + * Mobs that do now follow these conventions due to unusual sprites should require a special handling or redefinition of this proc, due to the density and layer changes. + * The return of this proc is the previous value of the modified lying_angle if a change was successful (might include zero), or null if no change was made. + */ +/mob/living/proc/set_lying_angle(new_lying, on_movement = FALSE) + if(new_lying == lying_angle) + return + . = lying_angle + lying_angle = new_lying + if(lying_angle != lying_prev) + update_transform(instant_update = on_movement) // Don't use transition for eg. crawling movement, because we already have the movement glide + lying_prev = lying_angle + +///Called by mob Move() when the lying_angle is different than zero, to better visually simulate crawling. +/mob/living/proc/lying_angle_on_movement(direct) + if(direct & EAST) + set_lying_angle(90, on_movement = TRUE) + else if(direct & WEST) + set_lying_angle(270, on_movement = TRUE) + +///Reports the event of the change in value of the buckled variable. +/mob/living/proc/set_buckled(new_buckled) + if(new_buckled == buckled) + return + SEND_SIGNAL(src, COMSIG_LIVING_SET_BUCKLED, new_buckled) + . = buckled + buckled = new_buckled + if(buckled) +// if(!HAS_TRAIT(buckled, TRAIT_NO_IMMOBILIZE)) +// ADD_TRAIT(src, TRAIT_IMMOBILIZED, BUCKLED_TRAIT) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, BUCKLED_TRAIT) + switch(buckled.buckle_lying) + if(NO_BUCKLE_LYING) // The buckle doesn't force a lying angle. + REMOVE_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + if(0) // Forcing to a standing position. + REMOVE_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + set_body_position(STANDING_UP) + set_lying_angle(0) + else // Forcing to a lying position. + ADD_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + set_body_position(LYING_DOWN) + set_lying_angle(buckled.buckle_lying) + else + remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_FLOORED), BUCKLED_TRAIT) + if(.) // We unbuckled from something. + //var/atom/movable/old_buckled = . + var/obj/old_buckled = . // /tg/ code has buckling defined on /atom/movable - consider refactoring this sometime + if(old_buckled.buckle_lying == 0 && (resting || HAS_TRAIT(src, TRAIT_FLOORED))) // The buckle forced us to stay up (like a chair) + set_lying_down() // We want to rest or are otherwise floored, so let's drop on the ground. + +/mob/living/proc/get_up(instant = FALSE) // arg ignored +// set waitfor = FALSE +// if(!instant && !do_after(src, 1 SECONDS, src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM), extra_checks = CALLBACK(src, TYPE_PROC_REF(/mob/living, rest_checks_callback)), interaction_key = DOAFTER_SOURCE_GETTING_UP)) +// return + if(resting || body_position == STANDING_UP || HAS_TRAIT(src, TRAIT_FLOORED)) + return + set_body_position(STANDING_UP) + set_lying_angle(0) + +/// Change the [body_position] to [LYING_DOWN] and update associated behavior. +/mob/living/proc/set_lying_down(new_lying_angle) + set_body_position(LYING_DOWN) + +/// Proc to append behavior related to lying down. +/mob/living/proc/on_lying_down(new_lying_angle) +// if(layer == initial(layer)) //to avoid things like hiding larvas. +// layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs + add_traits(list(/*TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED,*/ TRAIT_UNDENSE), LYING_DOWN_TRAIT) + if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH))) + setDir(pick(NORTH, SOUTH)) // We are and look helpless. +// if(rotate_on_lying) +// body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING + + // CM legacy canmove procs, replace this with signal procs probably + drop_l_hand() + drop_r_hand() + add_temp_pass_flags(PASS_MOB_THRU) + //so mob lying always appear behind standing mobs, but dead ones appear behind living ones + if(pulledby && pulledby.grab_level == GRAB_CARRY) + layer = ABOVE_MOB_LAYER + else if (stat == DEAD) + layer = LYING_DEAD_MOB_LAYER // Dead mobs should layer under living ones + else if(layer == initial(layer)) //to avoid things like hiding larvas. + layer = LYING_LIVING_MOB_LAYER + +/// Called when mob changes from a standing position into a prone while lacking the ability to stand up at the moment. +/mob/living/proc/on_fall() + return + +/// Changes the value of the [living/body_position] variable. Call this before set_lying_angle() +/mob/living/proc/set_body_position(new_value) + if(body_position == new_value) + return + if((new_value == LYING_DOWN) && !(mobility_flags & MOBILITY_LIEDOWN)) + return + . = body_position + body_position = new_value + SEND_SIGNAL(src, COMSIG_LIVING_SET_BODY_POSITION, new_value, .) + if(new_value == LYING_DOWN) // From standing to lying down. + on_lying_down() + else // From lying down to standing up. + on_standing_up() + +/// Proc to append behavior related to lying down. +/mob/living/proc/on_standing_up() + //if(layer == LYING_MOB_LAYER) + // layer = initial(layer) + remove_traits(list(/*TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED,*/ TRAIT_UNDENSE), LYING_DOWN_TRAIT) + // Make sure it doesn't go out of the southern bounds of the tile when standing. + //body_position_pixel_y_offset = get_pixel_y_offset_standing(current_size) + // CM stuff below + remove_temp_pass_flags(PASS_MOB_THRU) + if(layer == LYING_DEAD_MOB_LAYER || layer == LYING_LIVING_MOB_LAYER) + layer = initial(layer) + /// Uses presence of [TRAIT_UNDENSE] to figure out what is the correct density state for the mob. Triggered by trait signal. /mob/living/proc/update_density() @@ -471,3 +622,40 @@ set_density(FALSE) else set_density(TRUE) + +/// Proc to append behavior to the condition of being floored. Called when the condition starts. +/mob/living/proc/on_floored_start() + if(body_position == STANDING_UP) //force them on the ground + set_body_position(LYING_DOWN) + set_lying_angle(pick(90, 270), on_movement = TRUE) +// on_fall() + + +/// Proc to append behavior to the condition of being floored. Called when the condition ends. +/mob/living/proc/on_floored_end() + if(!resting) + get_up() + + +/mob/living/update_transform(instant_update = FALSE) + var/visual_angle = lying_angle + if(!rotate_on_lying) + return + var/matrix/base = matrix() + if(pulledby && pulledby.grab_level >= GRAB_CARRY) + visual_angle = 90 // CM code - for fireman carry + if(instant_update) + apply_transform(base.Turn(visual_angle)) + else + apply_transform(base.Turn(visual_angle), UPDATE_TRANSFORM_ANIMATION_TIME) + + +// legacy procs +/mob/living/put_in_l_hand(obj/item/W) + if(body_position == LYING_DOWN) + return + return ..() +/mob/living/put_in_r_hand(obj/item/W) + if(body_position == LYING_DOWN) + return + return ..() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 97d71fcb4e..ce4634a102 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -14,6 +14,18 @@ var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot. var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off. + // please don't use these + VAR_PROTECTED/knocked_out = 0 + VAR_PROTECTED/knocked_down = 0 + VAR_PROTECTED/stunned = 0 + var/dazed = 0 + var/slowed = 0 // X_SLOW_AMOUNT + var/superslowed = 0 // X_SUPERSLOW_AMOUNT + var/sleeping = 0 + + /// Cooldown for manually toggling resting to avoid spamming + COOLDOWN_DECLARE(rest_cooldown) + var/hallucination = 0 //Directly affects how long a mob will hallucinate for var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm @@ -99,7 +111,6 @@ var/current_weather_effect_type - var/slash_verb = "attack" var/slashes_verb = "attacks" @@ -111,10 +122,15 @@ /// This is what the value is changed to when the mob dies. Actual BMV definition in atom/movable. var/dead_black_market_value = 0 - var/dazed = 0 - var/knocked_out = 0 - var/stunned = 0 - var/knocked_down = 0 - var/slowed = 0 // X_SLOW_AMOUNT - var/superslowed = 0 // X_SUPERSLOW_AMOUNT - var/sleeping = 0 + /// Variable to track the body position of a mob, regardgless of the actual angle of rotation (usually matching it, but not necessarily). + var/body_position = STANDING_UP + /// Number of degrees of rotation of a mob. 0 means no rotation, up-side facing NORTH. 90 means up-side rotated to face EAST, and so on. + VAR_PROTECTED/lying_angle = 0 + /// Value of lying lying_angle before last change. TODO: Remove the need for this. + var/lying_prev = 0 + /// Does the mob rotate when lying + var/rotate_on_lying = FALSE + + /// Flags that determine the potential of a mob to perform certain actions. Do not change this directly. + var/mobility_flags = MOBILITY_FLAGS_DEFAULT + diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 2e4e8354c4..7801549528 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -89,6 +89,7 @@ VAR_PROTECTED/stun_timer = TIMER_ID_NULL /mob/living/proc/stun_callback() + REMOVE_TRAIT(src, TRAIT_INCAPACITATED, STUNNED_TRAIT) stunned = 0 handle_regular_status_updates(FALSE) if(stun_timer != TIMER_ID_NULL) @@ -96,9 +97,14 @@ stun_timer = TIMER_ID_NULL /mob/living/proc/stun_callback_check() + if(stunned) + ADD_TRAIT(src, TRAIT_INCAPACITATED, STUNNED_TRAIT) if(stunned && stunned < recovery_constant) stun_timer = addtimer(CALLBACK(src, PROC_REF(stun_callback)), (stunned/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) return + if(!stunned) // Force reset since the timer wasn't called + stun_callback() + return if(stun_timer != TIMER_ID_NULL) deltimer(stun_timer) @@ -175,15 +181,23 @@ VAR_PRIVATE/knocked_down_timer /mob/living/proc/knocked_down_callback() + remove_traits(list(TRAIT_FLOORED, TRAIT_INCAPACITATED), KNOCKEDDOWN_TRAIT) knocked_down = 0 handle_regular_status_updates(FALSE) knocked_down_timer = null /mob/living/proc/knocked_down_callback_check() + if(knocked_down) + add_traits(list(TRAIT_FLOORED, TRAIT_INCAPACITATED), KNOCKEDDOWN_TRAIT) + if(knocked_down && knocked_down < recovery_constant) knocked_down_timer = addtimer(CALLBACK(src, PROC_REF(knocked_down_callback)), (knocked_down/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) // times whatever amount we have per tick return + if(!knocked_down) // Force reset since the timer wasn't called + knocked_down_callback() + return + if(knocked_down_timer) deltimer(knocked_down_timer) knocked_down_timer = null @@ -195,11 +209,14 @@ return /mob/living/proc/knocked_out_callback() + REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, KNOCKEDOUT_TRAIT) knocked_out = 0 handle_regular_status_updates(FALSE) knocked_out_timer = null /mob/living/proc/knocked_out_callback_check() + if(knocked_out) + ADD_TRAIT(src, TRAIT_KNOCKEDOUT, KNOCKEDOUT_TRAIT) if(knocked_out && knocked_out < recovery_constant) knocked_out_timer = addtimer(CALLBACK(src, PROC_REF(knocked_out_callback)), (knocked_out/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) // times whatever amount we have per tick return @@ -222,7 +239,6 @@ knocked_down_callback_check() return - /mob/living/proc/SetKnockDown(amount) if(status_flags & CANKNOCKDOWN) knocked_down = max(amount,0) @@ -365,12 +381,6 @@ to_chat(src, SPAN_WARNING("You start hearing things again!")) SEND_SIGNAL(src, COMSIG_MOB_REGAINED_HEARING) - - - - - - // heal ONE limb, organ gets randomly selected from damaged ones. /mob/living/proc/heal_limb_damage(brute, burn) apply_damage(-brute, BRUTE) @@ -494,14 +504,13 @@ return if(stat >= UNCONSCIOUS) return + face_dir(direction) return ..() -/mob/living/is_laid_down() - if(knocked_down || knocked_out) - return TRUE - return ..() - -/mob/living/is_mob_incapacitated(ignore_restrained) - if(stunned || knocked_down || knocked_out) - return TRUE - return ..() +// Transition handlers. do NOT use this. I mean seriously don't. It's broken. Players love their broken behaviors. +/mob/living/proc/GetStunValueNotADurationDoNotUse() + return stunned +/mob/living/proc/GetKnockDownValueNotADurationDoNotUse() + return knocked_down +/mob/living/proc/GetKnockOutValueNotADurationDoNotUse() + return knocked_out diff --git a/code/modules/mob/living/living_verbs.dm b/code/modules/mob/living/living_verbs.dm index 77b996ff6b..45f5a25fce 100644 --- a/code/modules/mob/living/living_verbs.dm +++ b/code/modules/mob/living/living_verbs.dm @@ -163,7 +163,7 @@ return //breaking out of handcuffs & putting out fires - if(canmove && !knocked_down) + if(!is_mob_incapacitated(TRUE)) if(on_fire) resist_fire() @@ -179,7 +179,7 @@ if(!iscarbon(src)) return var/mob/living/carbon/C = src - if((C.handcuffed || C.legcuffed) && C.canmove && (C.last_special <= world.time)) + if((C.handcuffed || C.legcuffed) && (C.mobility_flags & MOBILITY_MOVE) && (C.last_special <= world.time)) resist_restraints() /mob/living/proc/resist_buckle() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index cf734a09ae..818377c9c1 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -101,8 +101,8 @@ var/list/ai_verbs_default = list( // aiPDA = new/obj/item/device/pda/ai(src) SetName(pickedName) anchored = TRUE - canmove = 0 - density = TRUE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) + set_density(TRUE) forceMove(loc) holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) diff --git a/code/modules/mob/living/silicon/decoy/decoy.dm b/code/modules/mob/living/silicon/decoy/decoy.dm index b625b19b17..5b41078eea 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -4,7 +4,6 @@ icon = 'icons/obj/structures/machinery/ai.dmi' icon_state = "hydra" anchored = TRUE - canmove = 0 density = TRUE //Do not want to see past it. bound_height = 64 //putting this in so we can't walk through our machine. bound_width = 96 @@ -23,6 +22,7 @@ ai_headset = new(src) ai_mob_list += src real_name = MAIN_AI_SYSTEM + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) /mob/living/silicon/decoy/ship_ai/Destroy() QDEL_NULL(ai_headset) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index b0230bba5d..b4a6e59e52 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -18,7 +18,6 @@ use_power() process_killswitch() process_locks() - update_canmove() /mob/living/silicon/robot/proc/clamp_values() @@ -79,14 +78,14 @@ death() if (stat != DEAD) //Alive. - if (knocked_out || stunned || knocked_down || !has_power) //Stunned etc. + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || HAS_TRAIT(src, TRAIT_INCAPACITATED) || !has_power) //Stunned etc. set_stat(UNCONSCIOUS) if(regular_update) - if (src.stunned > 0) + if (HAS_TRAIT(src, TRAIT_INCAPACITATED)) adjust_effect(-1, STUN) - if (src.knocked_down > 0) + if (HAS_TRAIT(src, TRAIT_FLOORED)) adjust_effect(-1, WEAKEN) - if (src.knocked_out > 0) + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) adjust_effect(-1, PARALYZE) src.blinded = TRUE else @@ -113,8 +112,6 @@ src.ear_damage -= 0.05 src.ear_damage = max(src.ear_damage, 0) - src.density = !( src.lying ) - if ((src.sdisabilities & DISABILITY_BLIND)) src.blinded = TRUE if ((src.sdisabilities & DISABILITY_DEAF)) @@ -271,8 +268,3 @@ to_chat(src, SPAN_DANGER("Weapon Lock Timed Out!")) weapon_lock = 0 weaponlock_time = 120 - -/mob/living/silicon/robot/update_canmove() - if(knocked_out || stunned || knocked_down || buckled || lockcharge || !is_component_functioning("actuator")) canmove = 0 - else canmove = 1 - return canmove diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 4ad29179da..ebcdd60aa9 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -840,7 +840,7 @@ var/list/robot_verbs_default = list( cleaned_item.clean_blood() else if(istype(A, /mob/living/carbon/human)) var/mob/living/carbon/human/cleaned_human = A - if(cleaned_human.lying) + if(cleaned_human.body_position == LYING_DOWN) if(cleaned_human.head) cleaned_human.head.clean_blood() cleaned_human.update_inv_head(0) @@ -866,7 +866,7 @@ var/list/robot_verbs_default = list( src.connected_ai = null lawupdate = 0 lockcharge = 0 - canmove = 1 + //canmove = 1 // Yes this will probably break something, whatevver it is scrambledcodes = 1 //Disconnect it's camera so it's not so easily tracked. if(src.camera) diff --git a/code/modules/mob/living/simple_animal/bat.dm b/code/modules/mob/living/simple_animal/bat.dm index a95d97be6e..eea7998bda 100644 --- a/code/modules/mob/living/simple_animal/bat.dm +++ b/code/modules/mob/living/simple_animal/bat.dm @@ -27,4 +27,3 @@ set_stat(CONSCIOUS) icon_state = "bat" wander = 1 - canmove = 1 diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 7196090f0b..109a53c831 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -44,7 +44,6 @@ set_stat(CONSCIOUS) icon_state = "mouse_[body_color]" wander = 1 - canmove = 1 else if(prob(5)) INVOKE_ASYNC(src, PROC_REF(emote), "snuffles") diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 5e56b02047..6e8d0b8a28 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -63,19 +63,19 @@ icon_living = "Normal [caste_name] Running" icon_dead = "Normal [caste_name] Dead" -/mob/living/simple_animal/hostile/alien/update_transform() - if(lying != lying_prev) - lying_prev = lying +/mob/living/simple_animal/hostile/alien/update_transform(instant_update = FALSE) + // TODO: Move all this mess outside of update_transform if(stat == DEAD) icon_state = "Normal [caste_name] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "Normal [caste_name] Sleeping" else icon_state = "Normal [caste_name] Knocked Down" else icon_state = "Normal [caste_name] Running" update_wounds() + return ..() /mob/living/simple_animal/hostile/alien/evaluate_target(mob/living/carbon/target) . = ..() @@ -114,8 +114,8 @@ if(health > HEALTH_THRESHOLD_DEAD) if(health_threshold > 3) wound_icon_holder.icon_state = "none" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) wound_icon_holder.icon_state = "[caste_name]_rest_[health_threshold]" else wound_icon_holder.icon_state = "[caste_name]_downed_[health_threshold]" diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index b47b14f0d1..b285ec1179 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -125,7 +125,7 @@ if(client) return 0 - if(!stat && canmove) + if(!stat && mobility_flags & MOBILITY_MOVE) switch(stance) if(HOSTILE_STANCE_IDLE) target_mob = FindTarget() diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 0f15bd1d8f..f1452d95c2 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -127,7 +127,7 @@ /mob/living/simple_animal/parrot/Topic(href, href_list) //Can the usr physically do this? - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) return //Is the usr's mob type able to do this? @@ -284,7 +284,7 @@ if(client || stat) return //Lets not force players or dead/incap parrots to move - if(!isturf(src.loc) || !canmove || buckled) + if(!isturf(src.loc) || !(mobility_flags & MOBILITY_MOVE) || buckled) return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 403cfcfd1e..023ab46bb2 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -88,8 +88,8 @@ GLOB.dead_mob_list -= src GLOB.alive_mob_list += src set_stat(CONSCIOUS) - lying = 0 - density = TRUE +// lying = 0 +// density = TRUE reload_fullscreens() return 0 @@ -103,11 +103,10 @@ handle_stunned() handle_knocked_down(TRUE) handle_knocked_out(TRUE) - update_canmove() //Movement if(!client && !stop_automated_movement && wander && !anchored) - if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc. + if(isturf(src.loc) && !resting && !buckled && (mobility_flags & MOBILITY_MOVE)) //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) if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled @@ -368,10 +367,17 @@ ..(message, null, verb, nolog = !ckey) //if the animal has a ckey then it will log the message -/mob/living/simple_animal/update_canmove() +/mob/living/simple_animal/on_immobilized_trait_gain(datum/source) . = ..() - if(!canmove) - stop_moving() + stop_moving() + +/mob/living/simple_animal/on_knockedout_trait_gain(datum/source) + . = ..() + stop_moving() + +/mob/living/simple_animal/on_incapacitated_trait_gain(datum/source) + . = ..() + stop_moving() /mob/living/simple_animal/proc/stop_moving() walk_to(src, 0) // stops us dead in our tracks diff --git a/code/modules/mob/living/simple_animal/slug.dm b/code/modules/mob/living/simple_animal/slug.dm index ca06bfcde3..cdbf82081d 100644 --- a/code/modules/mob/living/simple_animal/slug.dm +++ b/code/modules/mob/living/simple_animal/slug.dm @@ -34,7 +34,6 @@ set_stat(CONSCIOUS) icon_state = "slug_movement" wander = 1 - canmove = 1 /mob/living/simple_animal/alien_slug/Initialize() . = ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3d591d9027..4b49a15a6f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -454,7 +454,7 @@ if(!Adjacent(usr)) return if(!ishuman(M) && !ismonkey(M)) return if(!ishuman(src) && !ismonkey(src)) return - if(M.lying || M.is_mob_incapacitated()) + if(M.is_mob_incapacitated()) return if(M.pulling == src && (M.a_intent & INTENT_GRAB) && M.grab_level == GRAB_AGGRESSIVE) return @@ -517,6 +517,8 @@ if(!pulling) return + REMOVE_TRAIT(pulling, TRAIT_FLOORED, CHOKEHOLD_TRAIT) + var/mob/M = pulling pulling.pulledby = null pulling = null @@ -539,7 +541,6 @@ //so we must undo it here so the victim can move right away M.client.next_movement = world.time M.update_transform(TRUE) - M.update_canmove() /mob/living/vv_get_header() . = ..() @@ -720,71 +721,15 @@ note dizziness decrements automatically in the mob's Life() proc. // facing verbs /mob/proc/canface() - if(!canmove) return 0 - if(client && client.moving) return 0 + if(client.moving) return 0 if(stat==2) return 0 if(anchored) return 0 if(monkeyizing) return 0 if(is_mob_restrained()) return 0 + if(HAS_TRAIT(src, TRAIT_INCAPACITATED)) // We allow rotation if simply floored + return FALSE return 1 -//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. -/mob/proc/update_canmove() - var/laid_down = is_laid_down() - - if(laid_down) - lying = TRUE - flags_atom &= ~DIRLOCK - else - lying = FALSE - if(buckled) - if(buckled.buckle_lying) - lying = TRUE - flags_atom &= ~DIRLOCK - else - lying = FALSE - - canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED) - - if(isliving(src)) // Temporary I SWEAR. This whole proc is going down - var/mob/living/living = src - if(living.stunned) - canmove = FALSE - - if(!can_crawl && lying) - canmove = FALSE - - if(lying_prev != lying) - if(lying) - ADD_TRAIT(src, TRAIT_UNDENSE, LYING_TRAIT) - add_temp_pass_flags(PASS_MOB_THRU) - drop_l_hand() - drop_r_hand() - SEND_SIGNAL(src, COMSIG_MOB_KNOCKED_DOWN) - else - REMOVE_TRAIT(src, TRAIT_UNDENSE, LYING_TRAIT) - SEND_SIGNAL(src, COMSIG_MOB_GETTING_UP) - remove_temp_pass_flags(PASS_MOB_THRU) - update_transform() - - if(lying) - //so mob lying always appear behind standing mobs, but dead ones appear behind living ones - if(pulledby && pulledby.grab_level == GRAB_CARRY) - layer = ABOVE_MOB_LAYER - else if (stat == DEAD) - layer = LYING_DEAD_MOB_LAYER // Dead mobs should layer under living ones - else if(layer == initial(layer)) //to avoid things like hiding larvas. - layer = LYING_LIVING_MOB_LAYER - else if(layer == LYING_DEAD_MOB_LAYER || layer == LYING_LIVING_MOB_LAYER) - layer = initial(layer) - - SEND_SIGNAL(src, COMSIG_MOB_POST_UPDATE_CANMOVE, canmove, laid_down, lying) - - return canmove - -/mob/proc/is_laid_down() - return (stat || !has_legs() || resting || (status_flags & FAKEDEATH) || (pulledby && pulledby.grab_level >= GRAB_AGGRESSIVE)) - /mob/proc/face_dir(ndir, specific_dir) if(!canface()) return 0 if(dir != ndir) @@ -951,13 +896,13 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/living/proc/handle_knocked_down(bypass_client_check = FALSE) if(knocked_down && (bypass_client_check || client)) - knocked_down = max(knocked_down-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times + knocked_down = max(knocked_down-1,0) knocked_down_callback_check() return knocked_down /mob/living/proc/handle_knocked_out(bypass_client_check = FALSE) if(knocked_out && (bypass_client_check || client)) - knocked_out = max(knocked_out-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times + knocked_out = max(knocked_out-1,0) knocked_out_callback_check() return knocked_out @@ -1150,6 +1095,9 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/set_stat(new_stat) if(new_stat == stat) return - . = stat //old stat + . = stat stat = new_stat SEND_SIGNAL(src, COMSIG_MOB_STATCHANGE, new_stat, .) + +/mob/proc/update_stat() + return diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index dc107e1bd1..f0e5bc48a8 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -87,9 +87,6 @@ var/exploit_record = "" var/gibbing = FALSE - var/lying = FALSE - var/lying_prev = 0 - var/canmove = 1 var/lastpuke = 0 unacidable = FALSE var/mob_size = MOB_SIZE_HUMAN diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index ecda0787c5..a5caf0ad06 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -74,21 +74,21 @@ if(GRAB_AGGRESSIVE) progress_aggressive(user, victim) -/obj/item/grab/proc/progress_passive(mob/living/carbon/human/user, mob/victim) + if(user.grab_level >= GRAB_AGGRESSIVE) + ADD_TRAIT(victim, TRAIT_FLOORED, CHOKEHOLD_TRAIT) + +/obj/item/grab/proc/progress_passive(mob/living/carbon/human/user, mob/living/victim) user.grab_level = GRAB_AGGRESSIVE playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) user.visible_message(SPAN_WARNING("[user] has grabbed [victim] aggressively!"), null, null, 5) - victim.update_canmove() -/obj/item/grab/proc/progress_aggressive(mob/living/carbon/human/user, mob/victim) +/obj/item/grab/proc/progress_aggressive(mob/living/carbon/human/user, mob/living/victim) user.grab_level = GRAB_CHOKE playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) user.visible_message(SPAN_WARNING("[user] holds [victim] by the neck and starts choking them!"), null, null, 5) victim.Move(user.loc, get_dir(victim.loc, user.loc)) victim.update_transform(TRUE) - victim.update_canmove() - /obj/item/grab/attack(mob/living/M, mob/living/user) if(M == grabbed_thing) attack_self(user) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index ae094e5ebc..08412dab48 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -311,14 +311,11 @@ var/global/list/limb_types_by_name = list( /mob/proc/is_mob_restrained() return +/// Returns if the mob is incapacitated and unable to perform general actions /mob/proc/is_mob_incapacitated(ignore_restrained) - return (stat || (!ignore_restrained && is_mob_restrained()) || status_flags & FAKEDEATH) - - -//returns how many non-destroyed legs the mob has (currently only useful for humans) -/mob/proc/has_legs() - return 2 - + // note that stat includes knockout via unconscious + // TODO: re-re-re-figure out if we need TRAIT_FLOORED here or using TRAIT_INCAPACITATED only is acceptable deviance from legacy behavior + return (stat || (!ignore_restrained && is_mob_restrained()) || (status_flags & FAKEDEATH) || HAS_TRAIT(src, TRAIT_INCAPACITATED)) /mob/proc/get_eye_protection() return EYE_PROTECTION_NONE @@ -480,7 +477,7 @@ var/global/list/limb_types_by_name = list( set name = "Pick Up" set category = "Object" - if(!canmove || stat || is_mob_restrained() || !Adjacent(pickupify)) + if(is_mob_incapacitated() || !Adjacent(pickupify)) return if(world.time <= next_move) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 6ccb9644d6..980e786aa7 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -95,7 +95,13 @@ mob.next_delay_update = world.time + mob.next_delay_delay /client/Move(n, direct) - if(world.time < next_movement || (mob.lying && mob.crawling)) + var/mob/living/living_mob + if(isliving(mob)) + living_mob = mob + + if(world.time < next_movement) + return + if(living_mob && living_mob.body_position == LYING_DOWN && mob.crawling) return next_move_dir_add = 0 @@ -134,7 +140,17 @@ if(!isliving(mob)) return mob.Move(n, direct) - if(!mob.canmove || mob.is_mob_incapacitated(TRUE) || (mob.lying && !mob.can_crawl)) + if(mob.is_mob_incapacitated(TRUE)) + return + + if(mob.buckled) + // Handle buckled relay before mobility because buckling inherently immobilizes + // This means you can (try to) move with a cargo tug or powerloader while immobilized, which i think makes sense + return mob.buckled.relaymove(mob, direct) + + if(!(living_mob.mobility_flags & MOBILITY_MOVE)) + return + if(living_mob.body_position == LYING_DOWN && !living_mob.can_crawl) return //Check if you are being grabbed and if so attemps to break it @@ -150,9 +166,6 @@ next_movement = world.time + MINIMAL_MOVEMENT_INTERVAL return - if(mob.buckled) - return mob.buckled.relaymove(mob, direct) - if(!mob.z)//Inside an object, tell it we moved var/atom/O = mob.loc if(!O) @@ -170,7 +183,7 @@ //We are now going to move moving = TRUE mob.move_intentionally = TRUE - if(mob.lying) + if(living_mob && living_mob.body_position == LYING_DOWN) //check for them not being a limbless blob (only humans have limbs) if(ishuman(mob)) var/mob/living/carbon/human/human = mob diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index d80455d7b2..ab2dd5262a 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -98,7 +98,8 @@ if(length(mind.memory) < 4000) mind.store_memory(msg) else - message_admins("[key_name(usr)] auto-slept for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z) + message_admins("[key_name(usr)] warned for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z) + to_chat(src, "You have exceeded the maximum memory limit. Sorry!") else to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.") diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 0d6d906252..3e98167488 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -6,7 +6,6 @@ invisibility = 101 density = FALSE - canmove = FALSE anchored = TRUE universal_speak = TRUE stat = DEAD @@ -15,6 +14,7 @@ . = ..() GLOB.new_player_list += src GLOB.dead_mob_list -= src + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) /mob/new_player/Destroy() if(ready) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index dcb478d0fc..51c9ba9e13 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -7,8 +7,8 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 - stunned = 1 + anchored = TRUE + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -68,7 +68,7 @@ for(var/obj/item/W in src) drop_inv_item_on_ground(W) monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 return ..() @@ -85,7 +85,7 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -131,7 +131,7 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -186,28 +186,6 @@ qdel(src) return -/mob/living/carbon/human/proc/corgize() - if (monkeyizing) - return - for(var/obj/item/W in src) - drop_inv_item_on_ground(W) - regenerate_icons() - monkeyizing = 1 - canmove = 0 - icon = null - invisibility = 101 - for(var/t in limbs) //this really should not be necessary - qdel(t) - - var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc) - new_corgi.a_intent = INTENT_HARM - new_corgi.key = key - if(new_corgi.client) new_corgi.client.change_view(world_view_size) - - to_chat(new_corgi, "You are now a Corgi. Yap Yap!") - qdel(src) - return - /mob/living/carbon/human/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) @@ -224,7 +202,7 @@ regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index ce01931f5d..69263ed02e 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -177,9 +177,13 @@ nanoui is used to open and update nano browser uis close() return + var/mob/living/living_user + if(isliving(user)) + living_user = user + if ((allowed_user_stat > -1) && (user.stat > allowed_user_stat)) set_status(STATUS_DISABLED, push_update) // no updates, completely disabled (red visibility) - else if (user.is_mob_restrained() || user.lying) + else if (user.is_mob_restrained() || (living_user && living_user.body_position == LYING_DOWN)) set_status(STATUS_UPDATE, push_update) // update only (orange visibility) else if (!(src_object in view(4, user))) // If the src object is not in visable, set status to 0 set_status(STATUS_DISABLED, push_update) // interactive (green visibility) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index dbd490792e..b62161b802 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -213,7 +213,7 @@ // Check if we're looking at a mob that's lying down if(istype(cur_atom, /mob/living)) var/mob/living/cur_mob = cur_atom - if(!isxeno(cur_mob) && cur_mob.lying) //xenos don't use icon rotatin for lying. + if(!isxeno(cur_mob) && cur_mob.body_position == LYING_DOWN) //xenos don't use icon rotatin for lying. cur_icon.BecomeLying() // Calculate where we are relative to the center of the photo diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 731ad78caa..b210dbac29 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1000,7 +1000,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( SEND_SIGNAL(user, COMSIG_MOB_APC_POWER_PULSE, src) addtimer(VARSET_CALLBACK(src, shorted, FALSE), 2 MINUTES) -/obj/structure/machinery/power/apc/proc/can_use(mob/user as mob, loud = 0) //used by attack_hand() and Topic() +/obj/structure/machinery/power/apc/proc/can_use(mob/living/user as mob, loud = 0) //used by attack_hand() and Topic() if(user.client && user.client.remote_control) return TRUE @@ -1016,7 +1016,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( if(user.is_mob_restrained()) to_chat(user, SPAN_WARNING("You must have free hands to use [src].")) return 0 - if(user.lying) + if(user.body_position == LYING_DOWN) to_chat(user, SPAN_WARNING("You can't reach [src]!")) return 0 autoflag = 5 diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index d98af7748c..c7a64f710a 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1411,7 +1411,7 @@ and you're good to go. var/damage_buff = BASE_BULLET_DAMAGE_MULT //if target is lying or unconscious - add damage bonus - if(attacked_mob.lying == TRUE || attacked_mob.stat == UNCONSCIOUS) + if(!(attacked_mob.mobility_flags & MOBILITY_STAND) || attacked_mob.stat == UNCONSCIOUS) damage_buff += BULLET_DAMAGE_MULT_TIER_4 projectile_to_fire.damage *= damage_buff //Multiply the damage for point blank. if(bullets_fired == 1) //First shot gives the PB message. @@ -1437,7 +1437,7 @@ and you're good to go. projectile_to_fire.give_bullet_traits(BP) if(bullets_fired > 1) BP.original = attacked_mob //original == the original target of the projectile. If the target is downed and this isn't set, the projectile will try to fly over it. Of course, it isn't going anywhere, but it's the principle of the thing. Very embarrassing. - if(!BP.handle_mob(attacked_mob) && attacked_mob.lying) //This is the 'handle impact' proc for a flying projectile, including hit RNG, on_hit_mob and bullet_act. If it misses, it doesn't go anywhere. We'll pretend it slams into the ground or punches a hole in the ceiling, because trying to make it bypass the xeno or shoot from the tile beyond it is probably more spaghet than my life is worth. + if(!BP.handle_mob(attacked_mob) && attacked_mob.body_position == LYING_DOWN) //This is the 'handle impact' proc for a flying projectile, including hit RNG, on_hit_mob and bullet_act. If it misses, it doesn't go anywhere. We'll pretend it slams into the ground or punches a hole in the ceiling, because trying to make it bypass the xeno or shoot from the tile beyond it is probably more spaghet than my life is worth. if(BP.ammo.sound_bounce) playsound(attacked_mob.loc, BP.ammo.sound_bounce, 35, 1) attacked_mob.visible_message(SPAN_AVOIDHARM("[BP] slams into [get_turf(attacked_mob)]!"), //Managing to miss an immobile target flat on the ground deserves some recognition, don't you think? @@ -1450,7 +1450,7 @@ and you're good to go. if(bullets_fired > 1) projectile_to_fire.original = attacked_mob - if(!projectile_to_fire.handle_mob(attacked_mob) && attacked_mob.lying) + if(!projectile_to_fire.handle_mob(attacked_mob) && attacked_mob.body_position == LYING_DOWN) if(projectile_to_fire.ammo.sound_bounce) playsound(attacked_mob.loc, projectile_to_fire.ammo.sound_bounce, 35, 1) attacked_mob.visible_message(SPAN_AVOIDHARM("[projectile_to_fire] slams into [get_turf(attacked_mob)]!"), diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 20781639a5..e08db17db2 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -2671,7 +2671,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/attached_gun/grenade/unique_action(mob/user) if(!ishuman(usr)) return - if(!user.canmove || user.stat || user.is_mob_restrained() || !user.loc || !isturf(usr.loc)) + if(user.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(user, SPAN_WARNING("Not right now.")) return diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index ba5f8e4915..8e73124a8b 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -462,7 +462,7 @@ DEFINES in setup.dm, referenced here. /obj/item/weapon/gun/proc/get_active_firearm(mob/user, restrictive = TRUE) if(!ishuman(usr)) return - if(!user.canmove || user.stat || user.is_mob_restrained() || !user.loc || !isturf(usr.loc)) + if(user.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(user, SPAN_WARNING("Not right now.")) return diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index e9b5bd3aff..d42c1f4aa8 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -376,7 +376,7 @@ return for(var/mob/living/checked_living in checked_turf) - if(checked_living.lying && projectile_to_fire.original != checked_living) + if(checked_living.body_position == LYING_DOWN && projectile_to_fire.original != checked_living) continue if(checked_living.get_target_lock(user.faction_group)) diff --git a/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm b/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm index 6d99800213..356d0e6c3b 100644 --- a/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm +++ b/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm @@ -190,7 +190,7 @@ smoke.start() playsound(src, 'sound/weapons/gun_rocketlauncher.ogg', 100, TRUE, 10) for(var/mob/living/carbon/C in backblast_loc) - if(!C.lying && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff + if(C.body_position == STANDING_UP && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff C.apply_damage(15, BRUTE) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life C.apply_effect(4, STUN) //For good measure C.apply_effect(6, STUTTER) @@ -362,7 +362,7 @@ smoke.start() playsound(src, 'sound/weapons/gun_rocketlauncher.ogg', 100, TRUE, 10) for(var/mob/living/carbon/C in backblast_loc) - if(!C.lying && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff + if(C.body_position == STANDING_UP && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff C.apply_damage(15, BRUTE) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life C.apply_effect(4, STUN) //For good measure C.apply_effect(6, STUTTER) diff --git a/code/modules/projectiles/guns/specialist/sniper.dm b/code/modules/projectiles/guns/specialist/sniper.dm index 1e72a42538..71e5088aeb 100644 --- a/code/modules/projectiles/guns/specialist/sniper.dm +++ b/code/modules/projectiles/guns/specialist/sniper.dm @@ -75,7 +75,7 @@ /datum/action/item_action/specialist/aimed_shot/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && (holder_item == H.r_hand || holder_item || H.l_hand)) + if(istype(H) && !H.is_mob_incapacitated() && (holder_item == H.r_hand || holder_item || H.l_hand)) return TRUE /datum/action/item_action/specialist/aimed_shot/proc/use_ability(atom/A) @@ -450,7 +450,7 @@ . = ..() if(.) var/mob/living/carbon/human/PMC_sniper = user - if(PMC_sniper.lying == 0 && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran)) + if(PMC_sniper.body_position == STANDING_UP && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran)) PMC_sniper.visible_message(SPAN_WARNING("[PMC_sniper] is blown backwards from the recoil of the [src.name]!"),SPAN_HIGHDANGER("You are knocked prone by the blowback!")) step(PMC_sniper,turn(PMC_sniper.dir,180)) PMC_sniper.apply_effect(5, WEAKEN) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 531afd2f4a..cec5d2089e 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -517,7 +517,7 @@ X.behavior_delegate.on_hitby_projectile(ammo) . = TRUE - else if(!L.lying) + else if(L.body_position != LYING_DOWN) animatation_displace_reset(L) if(ammo.sound_miss) playsound_client(L.client, ammo.sound_miss, get_turf(L), 75, TRUE) if(COOLDOWN_FINISHED(L, shot_cooldown)) @@ -768,8 +768,8 @@ //mobs use get_projectile_hit_chance instead of get_projectile_hit_boolean /mob/living/proc/get_projectile_hit_chance(obj/projectile/P) - if(lying && src != P.original) - return FALSE + if((body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_NESTED)) && src != P.original) + return FALSE // Snowflake check for xeno nests, because we want bullets to fly through even though they're standing in it var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(ammo_flags & AMMO_XENO) if((status_flags & XENO_HOST) && HAS_TRAIT(src, TRAIT_NESTED)) @@ -777,7 +777,7 @@ . = P.get_effective_accuracy() - if(lying && stat) + if(body_position == LYING_DOWN && stat) . += 15 //Bonus hit against unconscious people. if(isliving(P.firer)) diff --git a/code/modules/reagents/chemistry_machinery/acid_harness.dm b/code/modules/reagents/chemistry_machinery/acid_harness.dm index ae54474c3a..52a1a5f13b 100644 --- a/code/modules/reagents/chemistry_machinery/acid_harness.dm +++ b/code/modules/reagents/chemistry_machinery/acid_harness.dm @@ -443,7 +443,7 @@ else if(inject_conditions & ACID_SCAN_CONDITION_DEFIB && vitals_scan < ACID_VITALS_DEAD && last_vitals_scan & ACID_SCAN_CONDITION_DEATH) condition_scan |= ACID_SCAN_CONDITION_DEFIB //If we were previously dead and are now alive, we assume we got defibbed - if(inject_conditions & ACID_SCAN_CONDITION_CONCUSSION && (user.knocked_down || user.knocked_out)) + if(inject_conditions & ACID_SCAN_CONDITION_CONCUSSION && (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || HAS_TRAIT(src, TRAIT_FLOORED))) condition_scan |= ACID_SCAN_CONDITION_CONCUSSION if(inject_conditions & ACID_SCAN_CONDITION_INTOXICATION && (user.dazed || user.slowed || user.confused || user.drowsyness || user.dizziness || user.druggy)) diff --git a/code/modules/reagents/chemistry_properties/prop_neutral.dm b/code/modules/reagents/chemistry_properties/prop_neutral.dm index d420623879..3048b12ee2 100644 --- a/code/modules/reagents/chemistry_properties/prop_neutral.dm +++ b/code/modules/reagents/chemistry_properties/prop_neutral.dm @@ -199,8 +199,8 @@ M.druggy = min(M.druggy + 0.5 * potency * delta_time, potency * 10) /datum/chem_property/neutral/hallucinogenic/process_overdose(mob/living/M, potency = 1, delta_time) - if(isturf(M.loc) && !istype(M.loc, /turf/open/space) && M.canmove && !M.is_mob_restrained()) - step(M, pick(cardinal)) + if(isturf(M.loc) && !istype(M.loc, /turf/open/space) && (M.mobility_flags & MOBILITY_MOVE) && !M.is_mob_restrained()) + step(M, pick(GLOB.cardinals)) M.hallucination += 10 M.make_jittery(5) diff --git a/code/modules/reagents/chemistry_properties/prop_positive.dm b/code/modules/reagents/chemistry_properties/prop_positive.dm index 971051e9bf..8bf7eadc5d 100644 --- a/code/modules/reagents/chemistry_properties/prop_positive.dm +++ b/code/modules/reagents/chemistry_properties/prop_positive.dm @@ -455,7 +455,7 @@ if(prob(10 * delta_time)) to_chat(M, SPAN_WARNING("You feel like you have the worst brain freeze ever!")) M.apply_effect(20, PARALYZE) - M.stunned = max(M.stunned,21) + M.apply_effect(20, STUN) /datum/chem_property/positive/neurocryogenic/process_overdose(mob/living/M, potency = 1, delta_time) M.bodytemperature = max(M.bodytemperature - 2.5 * potency * delta_time,0) diff --git a/code/modules/reagents/chemistry_properties/prop_special.dm b/code/modules/reagents/chemistry_properties/prop_special.dm index 8dbc1bbe3d..5921644777 100644 --- a/code/modules/reagents/chemistry_properties/prop_special.dm +++ b/code/modules/reagents/chemistry_properties/prop_special.dm @@ -381,8 +381,8 @@ /datum/chem_property/special/revitalizing/reagent_added(mob/living/M) if(!ishuman(M)) return + M.SetKnockOut(0) M.status_flags &= ~CANKNOCKOUT - M.knocked_out = 0 /datum/chem_property/special/revitalizing/on_delete(mob/living/M) M.status_flags |= CANKNOCKOUT diff --git a/code/modules/reagents/chemistry_reagents/drink.dm b/code/modules/reagents/chemistry_reagents/drink.dm index 3bd7336c32..66ce084455 100644 --- a/code/modules/reagents/chemistry_reagents/drink.dm +++ b/code/modules/reagents/chemistry_reagents/drink.dm @@ -555,7 +555,8 @@ /datum/reagent/neurotoxin/on_mob_life(mob/living/carbon/M) . = ..() if(!.) return - M.knocked_down = max(M.knocked_down, 3) + if(!HAS_TRAIT(src, TRAIT_FLOORED)) + M.apply_effect(5, WEAKEN) if(!data) data = 1 data++ M.dizziness +=6 diff --git a/code/modules/reagents/chemistry_reagents/toxin.dm b/code/modules/reagents/chemistry_reagents/toxin.dm index 6ffd14ea8a..d9be565a85 100644 --- a/code/modules/reagents/chemistry_reagents/toxin.dm +++ b/code/modules/reagents/chemistry_reagents/toxin.dm @@ -113,6 +113,7 @@ if(!. || deleted) return M.status_flags |= FAKEDEATH + ADD_TRAIT(M, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT) M.apply_damage(0.5*REM, OXY) M.apply_effect(2, WEAKEN) M.silent = max(M.silent, 10) @@ -125,6 +126,7 @@ var/mob/living/holder_mob = . holder_mob.status_flags &= ~FAKEDEATH + REMOVE_TRAIT(holder_mob, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT) /datum/reagent/toxin/mindbreaker name = "Mindbreaker Toxin" diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index b4b4f68ed9..429f560032 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -112,7 +112,7 @@ // attack with hand, move pulled object onto conveyor /obj/structure/machinery/conveyor/attack_hand(mob/user as mob) - if ((!( user.canmove ) || user.is_mob_restrained() || !( user.pulling ))) + if (( user.is_mob_incapacitated() || !( user.pulling ))) return if (user.pulling.anchored) return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index b6b35e3ed5..3a1e33a7ac 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -222,7 +222,7 @@ ///Attempt to move while inside /obj/structure/machinery/disposal/relaymove(mob/living/user) - if(user.stat || user.stunned || user.knocked_down || flushing) + if(user.is_mob_incapacitated(TRUE) || flushing) return FALSE if(user.loc == src) go_out(user) @@ -234,9 +234,8 @@ user.client.eye = user.client.mob user.client.perspective = MOB_PERSPECTIVE user.forceMove(loc) - user.stunned = max(user.stunned, 2) //Action delay when going out of a bin - user.update_canmove() //Force the delay to go in action immediately - if(!user.lying) + user.apply_effect(2, STUN) + if(user.mobility_flags & MOBILITY_MOVE) user.visible_message(SPAN_WARNING("[user] suddenly climbs out of [src]!"), SPAN_WARNING("You climb out of [src] and get your bearings!")) update() @@ -305,8 +304,7 @@ if(isliving(AM)) var/mob/living/living = AM living.Stun(2) - living.update_canmove() //Force the delay to go in action immediately - if(!living.lying) + if(living.body_position == STANDING_UP) living.visible_message(SPAN_WARNING("[living] is suddenly pushed out of [src]!"), SPAN_WARNING("You get pushed out of [src] and get your bearings!")) update() diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index dccdfad920..da1923730e 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -82,8 +82,6 @@ GLOBAL_LIST_EMPTY(shuttle_controls) user.visible_message(SPAN_NOTICE("[user] starts to type on the [src]."), SPAN_NOTICE("You try to take back the control over the shuttle. It will take around 3 minutes.")) if(do_after(user, 3 MINUTES, INTERRUPT_ALL, BUSY_ICON_FRIENDLY)) - if(user.lying) - return 0 shuttle.last_locked = world.time shuttle.queen_locked = 0 shuttle.last_door_override = world.time diff --git a/code/modules/sorokyne/sorokyne_cold_water.dm b/code/modules/sorokyne/sorokyne_cold_water.dm index adf7e3de62..345014a1e4 100644 --- a/code/modules/sorokyne/sorokyne_cold_water.dm +++ b/code/modules/sorokyne/sorokyne_cold_water.dm @@ -48,13 +48,13 @@ var/dam_amount = COLD_WATER_DAMAGE if(issynth(M) || isyautja(M)) dam_amount -= 0.5 - if(M.lying) - M.apply_damage(5*dam_amount,BURN) - else + if(M.body_position == STANDING_UP) M.apply_damage(dam_amount,BURN,"l_leg") M.apply_damage(dam_amount,BURN,"l_foot") M.apply_damage(dam_amount,BURN,"r_leg") M.apply_damage(dam_amount,BURN,"r_foot") + else + M.apply_damage(5*dam_amount,BURN) if (ishuman(M)) if (M.bodytemperature > MINIMUM_TEMP) diff --git a/code/modules/surgery/surgery_initiator.dm b/code/modules/surgery/surgery_initiator.dm index 8b7506c9b7..706b28d0e9 100644 --- a/code/modules/surgery/surgery_initiator.dm +++ b/code/modules/surgery/surgery_initiator.dm @@ -43,7 +43,7 @@ continue //Lying and self-surgery checks. - if(surgeryloop.lying_required && !target.lying) + if(surgeryloop.lying_required && target.body_position != LYING_DOWN) continue if(!surgeryloop.self_operable && target == user) continue @@ -134,7 +134,7 @@ [target_zone == "r_hand"||target_zone == "l_hand" ? "hand":"arm"] you're using!")) return TRUE - if(surgeryinstance.lying_required && !target.lying) + if(surgeryinstance.lying_required && target.body_position != LYING_DOWN) return TRUE if(surgery_limb) diff --git a/code/modules/surgery/surgery_procedure.dm b/code/modules/surgery/surgery_procedure.dm index 1e11516a80..8620c557eb 100644 --- a/code/modules/surgery/surgery_procedure.dm +++ b/code/modules/surgery/surgery_procedure.dm @@ -90,7 +90,7 @@ to_chat(user, SPAN_WARNING("You can't operate on [target], \he is being carried by [target.pulledby]!")) return FALSE - if(lying_required && !target.lying) + if(lying_required && target.body_position != LYING_DOWN) to_chat(user, SPAN_WARNING("[user == target ? "You need" : "[target] needs"] to be lying down for this operation!")) return FALSE diff --git a/code/modules/tgui/status_composers.dm b/code/modules/tgui/status_composers.dm index 6d7b589786..ba1b29d815 100644 --- a/code/modules/tgui/status_composers.dm +++ b/code/modules/tgui/status_composers.dm @@ -56,17 +56,6 @@ /mob/living/silicon/proc/get_ui_access(atom/source) return UI_INTERACTIVE // Ubiquitous networking. Do not abuse. -/// Returns UI_INTERACTIVE if the user is conscious and lying down. -/// Returns UI_UPDATE otherwise. -/proc/ui_status_user_is_conscious_and_lying_down(mob/user) - if (!isliving(user)) - return UI_UPDATE - - var/mob/living/living_user = user - return (living_user.lying && living_user.stat == CONSCIOUS) \ - ? UI_INTERACTIVE \ - : UI_UPDATE - /// Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. /// Return UI_CLOSE otherwise. /proc/ui_status_user_strictly_adjacent(mob/user, atom/target) diff --git a/code/modules/vehicles/interior/interactable/seats.dm b/code/modules/vehicles/interior/interactable/seats.dm index 3f3058d057..2984adda91 100644 --- a/code/modules/vehicles/interior/interactable/seats.dm +++ b/code/modules/vehicles/interior/interactable/seats.dm @@ -388,17 +388,6 @@ handle_rotation() -/obj/structure/bed/chair/vehicle/unbuckle() - if(buckled_mob && buckled_mob.buckled == src) - buckled_mob.buckled = null - buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_canmove() - - var/M = buckled_mob - buckled_mob = null - - afterbuckle(M) - //attack handling /obj/structure/bed/chair/vehicle/attack_alien(mob/living/user) diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 92358a1e0f..cbad4535df 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -54,8 +54,8 @@ //------------------------------------------- -/obj/vehicle/train/MouseDrop_T(atom/movable/C, mob/user as mob) - if(user.buckled || user.stat || user.is_mob_restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !user.canmove)) +/obj/vehicle/train/MouseDrop_T(atom/movable/C, mob/living/user as mob) + if(user.buckled || user.stat || user.is_mob_restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !(user.mobility_flags & MOBILITY_MOVE))) return if(istype(C,/obj/vehicle/train)) latch(C, user) @@ -71,7 +71,7 @@ if(!istype(usr, /mob/living/carbon/human)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !Adjacent(usr)) + if(usr.is_mob_incapacitated() || !Adjacent(usr)) return unattach(usr) diff --git a/code/modules/vehicles/van/van.dm b/code/modules/vehicles/van/van.dm index c017eae28d..0b99d682c0 100644 --- a/code/modules/vehicles/van/van.dm +++ b/code/modules/vehicles/van/van.dm @@ -91,13 +91,13 @@ if(mover in mobs_under) //can't collide with the thing you're buckled to return NO_BLOCKED_MOVEMENT - if(ismob(mover)) - var/mob/M = mover + if(isliving(mover)) + var/mob/living/M = mover if(M.mob_flags & SQUEEZE_UNDER_VEHICLES) add_under_van(M) return NO_BLOCKED_MOVEMENT - if(M.lying) + if(M.body_position == LYING_DOWN) return NO_BLOCKED_MOVEMENT if(M.mob_size >= MOB_SIZE_IMMOBILE && next_push < world.time) diff --git a/colonialmarines.dme b/colonialmarines.dme index f91139d4c9..f3f5d9a012 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -147,6 +147,7 @@ #include "code\__HELPERS\#maths.dm" #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_time.dm" +#include "code\__HELPERS\animations.dm" #include "code\__HELPERS\chat.dm" #include "code\__HELPERS\cmp.dm" #include "code\__HELPERS\datums.dm" @@ -168,6 +169,7 @@ #include "code\__HELPERS\qdel.dm" #include "code\__HELPERS\sanitize_values.dm" #include "code\__HELPERS\shell.dm" +#include "code\__HELPERS\status_effects.dm" #include "code\__HELPERS\text.dm" #include "code\__HELPERS\traits.dm" #include "code\__HELPERS\type2type.dm"