diff --git a/citadel.dme b/citadel.dme index ee27022f70d..e3b31d9829b 100644 --- a/citadel.dme +++ b/citadel.dme @@ -84,7 +84,6 @@ #include "code\__DEFINES\spells.dm" #include "code\__DEFINES\stat_tracking.dm" #include "code\__DEFINES\statpanel.dm" -#include "code\__DEFINES\status_effects.dm" #include "code\__DEFINES\storage.dm" #include "code\__DEFINES\strack_trace.dm" #include "code\__DEFINES\targeting.dm" @@ -174,6 +173,7 @@ #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_combat.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_inventory.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_main.dm" +#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_mobility.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_organs.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_perspectiive.dm" #include "code\__DEFINES\economy\economy.dm" @@ -212,6 +212,7 @@ #include "code\__DEFINES\mobs\organs.dm" #include "code\__DEFINES\mobs\silicon_privileges.dm" #include "code\__DEFINES\mobs\sprite_accessories.dm" +#include "code\__DEFINES\mobs\stat.dm" #include "code\__DEFINES\overmaps\misc.dm" #include "code\__DEFINES\overmaps\overmap.dm" #include "code\__DEFINES\power\balancing.dm" @@ -229,6 +230,7 @@ #include "code\__DEFINES\procs\clickcode.dm" #include "code\__DEFINES\procs\do_after.dm" #include "code\__DEFINES\procs\drain_energy.dm" +#include "code\__DEFINES\procs\saycode.dm" #include "code\__DEFINES\procs\update_icon.dm" #include "code\__DEFINES\projectiles\ammo_casing.dm" #include "code\__DEFINES\projectiles\guns.dm" @@ -345,7 +347,7 @@ #include "code\__HELPERS\lists\unique.dm" #include "code\__HELPERS\math\angles.dm" #include "code\__HELPERS\matrices\color_matrix.dm" -#include "code\__HELPERS\matrices\transfor_matrix.dm" +#include "code\__HELPERS\matrices\transform_matrix.dm" #include "code\__HELPERS\misc\sonar.dm" #include "code\__HELPERS\rendering\positioning.dm" #include "code\__HELPERS\sanitize\datatypes.dm" @@ -512,6 +514,7 @@ #include "code\controllers\subsystem\sonar.dm" #include "code\controllers\subsystem\spacedrift.dm" #include "code\controllers\subsystem\statpanel.dm" +#include "code\controllers\subsystem\status_effects.dm" #include "code\controllers\subsystem\sun.dm" #include "code\controllers\subsystem\supply.dm" #include "code\controllers\subsystem\tgui.dm" @@ -561,7 +564,6 @@ #include "code\controllers\subsystem\processing\pathfinder.dm" #include "code\controllers\subsystem\processing\processing.dm" #include "code\controllers\subsystem\processing\projectiles.dm" -#include "code\controllers\subsystem\processing\status_effects.dm" #include "code\controllers\subsystem\processing\turfs.dm" #include "code\controllers\subsystem\sound\_sound.dm" #include "code\controllers\subsystem\sound\channel_manager.dm" @@ -742,7 +744,6 @@ #include "code\datums\observation\observation.dm" #include "code\datums\observation\shuttle_added.dm" #include "code\datums\observation\shuttle_moved.dm" -#include "code\datums\observation\stat_set.dm" #include "code\datums\observation\~cleanup.dm" #include "code\datums\outfits\_defines.dm" #include "code\datums\outfits\ghostrole.dm" @@ -772,9 +773,13 @@ #include "code\datums\soundbytes\announcer.dm" #include "code\datums\soundbytes\effects\explosion.dm" #include "code\datums\soundbytes\machinery\terminal.dm" +#include "code\datums\status_effects\grouped.dm" +#include "code\datums\status_effects\stacking.dm" #include "code\datums\status_effects\status_effect.dm" -#include "code\datums\status_effects\debuffs\crusher_mark.dm" -#include "code\datums\status_effects\neutral\crusher_track.dm" +#include "code\datums\status_effects\basic\crusher_track.dm" +#include "code\datums\status_effects\basic\incapacitation.dm" +#include "code\datums\status_effects\basic\staggered.dm" +#include "code\datums\status_effects\grouped\crusher_mark.dm" #include "code\datums\underwear\bottom.dm" #include "code\datums\underwear\socks.dm" #include "code\datums\underwear\top.dm" @@ -1119,7 +1124,6 @@ #include "code\game\machinery\newscaster.dm" #include "code\game\machinery\nuclear_bomb.dm" #include "code\game\machinery\OpTable.dm" -#include "code\game\machinery\overview.dm" #include "code\game\machinery\oxygen_pump.dm" #include "code\game\machinery\partslathe_vr.dm" #include "code\game\machinery\pda_multicaster.dm" @@ -3014,14 +3018,15 @@ #include "code\modules\mob\mob_defines.dm" #include "code\modules\mob\mob_helpers.dm" #include "code\modules\mob\mob_planes.dm" -#include "code\modules\mob\mob_pull.dm" #include "code\modules\mob\mob_transformation_simple.dm" #include "code\modules\mob\mobility.dm" #include "code\modules\mob\movement.dm" #include "code\modules\mob\perspective.dm" #include "code\modules\mob\physiology.dm" +#include "code\modules\mob\pulling.dm" #include "code\modules\mob\say.dm" #include "code\modules\mob\say_vr.dm" +#include "code\modules\mob\ssd.dm" #include "code\modules\mob\status_procs.dm" #include "code\modules\mob\throwing.dm" #include "code\modules\mob\transform_procs.dm" @@ -3094,16 +3099,16 @@ #include "code\modules\mob\living\life.dm" #include "code\modules\mob\living\living.dm" #include "code\modules\mob\living\living_defines.dm" -#include "code\modules\mob\living\living_defines_vr.dm" #include "code\modules\mob\living\living_powers.dm" #include "code\modules\mob\living\living_vr.dm" #include "code\modules\mob\living\login.dm" #include "code\modules\mob\living\logout.dm" +#include "code\modules\mob\living\mobility.dm" #include "code\modules\mob\living\movement.dm" #include "code\modules\mob\living\organs.dm" #include "code\modules\mob\living\resist.dm" #include "code\modules\mob\living\say.dm" -#include "code\modules\mob\living\status_indicators.dm" +#include "code\modules\mob\living\status_procs.dm" #include "code\modules\mob\living\throwing.dm" #include "code\modules\mob\living\bot\assembly.dm" #include "code\modules\mob\living\bot\bot.dm" @@ -3174,7 +3179,6 @@ #include "code\modules\mob\living\carbon\human\human_defines.dm" #include "code\modules\mob\living\carbon\human\human_helpers.dm" #include "code\modules\mob\living\carbon\human\human_modular_limbs.dm" -#include "code\modules\mob\living\carbon\human\human_movement.dm" #include "code\modules\mob\living\carbon\human\human_organs.dm" #include "code\modules\mob\living\carbon\human\human_powers.dm" #include "code\modules\mob\living\carbon\human\human_resist.dm" @@ -3184,10 +3188,13 @@ #include "code\modules\mob\living\carbon\human\login.dm" #include "code\modules\mob\living\carbon\human\logout.dm" #include "code\modules\mob\living\carbon\human\MedicalSideEffects.dm" +#include "code\modules\mob\living\carbon\human\mobility.dm" +#include "code\modules\mob\living\carbon\human\movement.dm" #include "code\modules\mob\living\carbon\human\npcs.dm" #include "code\modules\mob\living\carbon\human\pain.dm" #include "code\modules\mob\living\carbon\human\riding.dm" #include "code\modules\mob\living\carbon\human\say.dm" +#include "code\modules\mob\living\carbon\human\status_procs.dm" #include "code\modules\mob\living\carbon\human\stripping.dm" #include "code\modules\mob\living\carbon\human\unarmed_attack.dm" #include "code\modules\mob\living\carbon\human\update_icons.dm" @@ -3249,10 +3256,12 @@ #include "code\modules\mob\living\silicon\robot\emote.dm" #include "code\modules\mob\living\silicon\robot\examine.dm" #include "code\modules\mob\living\silicon\robot\examine_vr.dm" +#include "code\modules\mob\living\silicon\robot\health.dm" #include "code\modules\mob\living\silicon\robot\inventory.dm" #include "code\modules\mob\living\silicon\robot\laws.dm" #include "code\modules\mob\living\silicon\robot\life.dm" #include "code\modules\mob\living\silicon\robot\login.dm" +#include "code\modules\mob\living\silicon\robot\mobility.dm" #include "code\modules\mob\living\silicon\robot\photos.dm" #include "code\modules\mob\living\silicon\robot\robot.dm" #include "code\modules\mob\living\silicon\robot\robot_animation_vr.dm" @@ -3552,6 +3561,7 @@ #include "code\modules\modular_computers\NTNet\NTNRC\conversation.dm" #include "code\modules\movespeed\movespeed_modifier.dm" #include "code\modules\movespeed\modifiers\misc.dm" +#include "code\modules\movespeed\modifiers\mob.dm" #include "code\modules\multiz\atoms.dm" #include "code\modules\multiz\basic.dm" #include "code\modules\multiz\falling.dm" diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm index 96e8aa29279..4e6bfc0d83b 100644 --- a/code/__DEFINES/MC.dm +++ b/code/__DEFINES/MC.dm @@ -1,4 +1,5 @@ #define MC_TICK_CHECK ( ( TICK_USAGE > Master.current_ticklimit || src.state != SS_RUNNING ) ? pause() : 0 ) +#define MC_TICK_CHECK_USAGE ( ( TICK_USAGE > Master.current_ticklimit ) ? pause() : 0 ) #define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = Master.current_ticklimit; var/split_tick_phases = ##phase_count #define MC_SPLIT_TICK \ diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_inventory.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_inventory.dm index 1a2eb6bc104..1aff02f288d 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_inventory.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_inventory.dm @@ -1,4 +1,8 @@ -/// A mob has just equipped an item. Called on [/mob] from base of [/obj/item/equipped()]: (/obj/item/equipped_item, slot) -//#define COMSIG_MOB_EQUIPPED_ITEM "mob_equipped_item" -/// A mob has just unequipped an item. -//#define COMSIG_MOB_UNEQUIPPED_ITEM "mob_unequipped_item" +/// A mob has just equipped an item. Called on [/mob] from base of [/obj/item/equipped()]: (/obj/item/equipped_item, slot, inv_op_flags) +#define COMSIG_MOB_ITEM_EQUIPPED "mob_equipped_item" +/// A mob has just unequipped an item. Called on [/mob] from base of [/obj/item/unequipped()]: (/obj/item/equipped_item, slot, inv_op_flags) +#define COMSIG_MOB_ITEM_UNEQUIPPED "mob_unequipped_item" +/// A mob has just picked up an item. Called on [/mob] from base of [/obj/item/pickup()]: (/obj/item/equipped_item, inv_op_flags, old_loc) +#define COMSIG_MOB_ITEM_PICKUP "mob_pickup_item" +/// A mob has just dropped an item. Called on [/mob] from base of [/obj/item/dropped()]: (/obj/item/equipped_item, inv_op_flags, new_loc) +#define COMSIG_MOB_ITEM_DROPPED "mob_dropped_item" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm index ca0aa3178c1..3f52802874f 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm @@ -53,19 +53,6 @@ //! ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS! !// -/// From base of mob/living/Stun() (amount, ignore_canstun) -////#define COMSIG_LIVING_STATUS_STUN "living_stun" -/// From base of mob/living/Knockdown() (amount, ignore_canstun) -////#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown" -/// From base of mob/living/Paralyze() (amount, ignore_canstun) -////#define COMSIG_LIVING_STATUS_PARALYZE "living_paralyze" -/// From base of mob/living/Immobilize() (amount, ignore_canstun) -////#define COMSIG_LIVING_STATUS_IMMOBILIZE "living_immobilize" -/// From base of mob/living/Unconscious() (amount, ignore_canstun) -////#define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious" -/// From base of mob/living/Sleeping() (amount, ignore_canstun) -////#define COMSIG_LIVING_STATUS_SLEEP "living_sleeping" - ////#define COMPONENT_NO_STUN (1<<0) //For all of them /// From base of /mob/living/can_track(): (mob/user) ////#define COMSIG_LIVING_CAN_TRACK "mob_cantrack" ////#define COMPONENT_CANT_TRACK (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_mobility.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_mobility.dm new file mode 100644 index 00000000000..717d3c5771f --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_mobility.dm @@ -0,0 +1,6 @@ +/// sent at the very end of /mob/update_mobility(): (new_mobility_flags) +#define COMSIG_MOB_ON_UPDATE_MOBILITY "mob_updated_mobility" +/// sent at the very end of /mob/set_resitng(): (new_resting) +#define COMSIG_MOB_ON_SET_RESTING "mob_set_resting" +/// sent at the very end of /mob/update_lying(): (old_lying, new_lying) +#define COMSIG_MOB_ON_UPDATE_LYING "mob_updated_lying" diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index b2d03fe862b..1bf7d8f5799 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -75,19 +75,20 @@ ////////////////////////////////// // Bitflags defining which status effects could be or are inflicted on a mob. -#define CANSTUN 0x1 -#define CANWEAKEN 0x2 -#define CANPARALYSE 0x4 -#define CANPUSH 0x8 -#define LEAPING 0x10 -#define HIDING 0x20 -/// Mob has a cortical borer or holders inside of it that need to see emotes. -#define PASSEMOTES 0x40 -#define GODMODE 0x1000 -/// Replaces stuff like changeling.changeling_fakedeath. -#define FAKEDEATH 0x2000 -/// Set but never checked. Remove this sometime and replace occurences with the appropriate organ code -#define DISFIGURED 0x4000 +#define STATUS_CAN_STUN (1<<0) //! Can Stun() +#define STATUS_CAN_KNOCKDOWN (1<<1) //! Can Knockdown() +#define STATUS_CAN_ROOT (1<<2) //! Can Root() +#define STATUS_CAN_STAGGER (1<<3) //! Can Stagger() +#define STATUS_CAN_PARALYZE (1<<4) //! Can Paralyze() +#define STATUS_CAN_PUSH (1<<5) //! Can Push() + +#define STATUS_LEAPING (1<<20) //! Is leaping (??? legacy) +#define STATUS_HIDING (1<<21) //! Is hiding (??? legacy) +#define STATUS_GODMODE (1<<22) //! Godmode (??? legacy) +#define STATUS_FAKEDEATH (1<<23) //! In fakedeath - SLATED FOR REMOVAL, THIS SHOULD BE TRAIT + +#define STATUS_FLAGS_DEFAULT (STATUS_CAN_STUN | STATUS_CAN_PARALYZE | STATUS_CAN_PUSH \ +| STATUS_CAN_KNOCKDOWN | STATUS_CAN_ROOT | STATUS_CAN_STAGGER) #define BORGMESON 0x1 #define BORGTHERM 0x2 diff --git a/code/__DEFINES/mobs/health.dm b/code/__DEFINES/mobs/health.dm index b76d5f8c7b8..4f4b76d1b0d 100644 --- a/code/__DEFINES/mobs/health.dm +++ b/code/__DEFINES/mobs/health.dm @@ -1,28 +1,12 @@ -//? Medical system defines go in here +//* Medical system defines go in here -//! Health - Core +//? Health - Core /** Round damage values to this value * Atom damage uses this too! */ #define DAMAGE_PRECISION 0.01 -//! Stat var - lets us get the most basic of mob health status from one var -/// we're conscious -#define CONSCIOUS 0 -/// we're unconscious -#define UNCONSCIOUS 1 -/// we're dead -#define DEAD 2 - -//! stat helpers - since most semantic checks are going to be compound checks -#define IS_CONSCIOUS(M) (M.stat == CONSCIOUS) -#define IS_DEAD(M) (M.stat == DEAD) - -//! direct stat helpers -#define STAT_IS_CONSCIOUS(N) (N == CONSCIOUS) -#define STAT_IS_DEAD(N) (N == DEAD) - -//! CPR +//? CPR /// how long CPR suppresses brain decay #define CPR_BRAIN_STASIS_TIME (15 SECONDS) /// how long CPR acts as mechanical ventilation @@ -38,9 +22,9 @@ /// on-cooldown reagent tick strength (as multiplier of normal living) #define CPR_FORCED_METABOLISM_STRENGTH_CLIPPED (3 * 0.5) // 50% as effective as living at best -//! Organs - General +//? Organs - General -//! Organs - Decaying while dead/removed +//? Organs - Decaying while dead/removed //? current formula is generally (maxhealth / (seconds to decay)) /// how much damage most organs take per second when the user is dead and it is not preserved #define ORGAN_DECAY_PER_SECOND_DEFAULT (60 / (60 * 40)) // most organs decay entirely over 40 minutes, or to lethal degrees in 20 diff --git a/code/__DEFINES/mobs/mobility.dm b/code/__DEFINES/mobs/mobility.dm index d0a45837b5a..95e12b928f4 100644 --- a/code/__DEFINES/mobs/mobility.dm +++ b/code/__DEFINES/mobs/mobility.dm @@ -1,29 +1,47 @@ -//! Mob mobility var flags +//? /mob/var/mobility_flags /// any flag #define CHECK_MOBILITY(target, flags) (target.mobility_flags & flags) +/// all flags #define CHECK_ALL_MOBILITY(target, flags) CHECK_MULTIPLE_BITFIELDS(target.mobility_flags, flags) -#define MOBILITY_MOVE (1<<0) // Can move. -#define MOBILITY_STAND (1<<1) // Can, and is, standing up. -#define MOBILITY_PICKUP (1<<2) // Can pickup items. -#define MOBILITY_USE (1<<3) // Can use items and interact with world objects like opening closets/etc. -#define MOBILITY_UI (1<<4) // Can use interfaces like consoles. -#define MOBILITY_STORAGE (1<<5) // Can use storage item. -#define MOBILITY_PULL (1<<6) // Can pull things. -#define MOBILITY_HOLD (1<<7) // Can hold non-nodropped items voluntarily. -#define MOBILITY_RESIST (1<<8) // Can resist out of buckling, grabs, cuffs, etc, in the usual order (buckle --> cuffs --> grab) +#define MOBILITY_CAN_MOVE (1<<0) //! Can move. +#define MOBILITY_CAN_STAND (1<<1) //! Can, and is, standing up. +#define MOBILITY_CAN_PICKUP (1<<2) //! Can pickup items. +#define MOBILITY_CAN_USE (1<<3) //! Can use items and interact with world objects like opening closets/etc. +#define MOBILITY_CAN_UI (1<<4) //! Can use interfaces like consoles. +#define MOBILITY_CAN_STORAGE (1<<5) //! Can use storage item. +#define MOBILITY_CAN_PULL (1<<6) //! Can pull things. +#define MOBILITY_CAN_HOLD (1<<7) //! Can hold non-nodropped items voluntarily. +#define MOBILITY_CAN_RESIST (1<<8) //! Can resist out of buckling, grabs, cuffs, etc, in the usual order (buckle --> cuffs --> grab) -#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_PICKUP | MOBILITY_USE | MOBILITY_UI | MOBILITY_STORAGE | MOBILITY_PULL | MOBILITY_RESIST) -#define MOBILITY_FLAGS_ANY_INTERACTION (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_UI | MOBILITY_STORAGE) +#define MOBILITY_IS_STANDING (1<<22) //! READ-ONLY - Set by set_resting() if we're upright as opposed to on the ground for any reason. Used for checks. +#define MOBILITY_IS_CONSCIOUS (1<<23) //! READ-ONLY - Set by update_stat() if we're conscious by any means. Used for checks. -DEFINE_BITFIELD(mobility_flags, list( - "MOVE" = MOBILITY_MOVE, - "STAND" = MOBILITY_STAND, - "PICKUP" = MOBILITY_PICKUP, - "USE" = MOBILITY_USE, - "UI" = MOBILITY_UI, - "STORAGE" = MOBILITY_STORAGE, - "PULL" = MOBILITY_PULL, - "HOLD" = MOBILITY_HOLD, - "RESIST" = MOBILITY_RESIST, +#define MOBILITY_FLAGS_REAL (MOBILITY_CAN_MOVE | MOBILITY_CAN_STAND | MOBILITY_CAN_PICKUP | MOBILITY_CAN_USE | MOBILITY_CAN_UI | MOBILITY_CAN_STORAGE | MOBILITY_CAN_PULL | MOBILITY_CAN_HOLD | MOBILITY_CAN_RESIST) +#define MOBILITY_FLAGS_VIRTUAL (MOBILITY_IS_CONSCIOUS | MOBILITY_IS_STANDING) +#define MOBILITY_FLAGS_DEFAULT MOBILITY_FLAGS_REAL | MOBILITY_FLAGS_VIRTUAL +#define MOBILITY_FLAGS_ANY_INTERACTION (MOBILITY_CAN_USE | MOBILITY_CAN_PICKUP | MOBILITY_CAN_UI | MOBILITY_CAN_STORAGE) +#define MOBILITY_FLAGS_ANY_MOVEMENT (MOBILITY_CAN_MOVE) + +DEFINE_SHARED_BITFIELD(mobility_flags, list( + "mobility_flags", + "mobility_flags_blocked", + "mobility_flags_forced", +), list( + "MOVE" = MOBILITY_CAN_MOVE, + "STAND" = MOBILITY_CAN_STAND, + "PICKUP" = MOBILITY_CAN_PICKUP, + "USE" = MOBILITY_CAN_USE, + "UI" = MOBILITY_CAN_UI, + "STORAGE" = MOBILITY_CAN_STORAGE, + "PULL" = MOBILITY_CAN_PULL, + "HOLD" = MOBILITY_CAN_HOLD, + "RESIST" = MOBILITY_CAN_RESIST, + "IS_STANDING" = MOBILITY_IS_STANDING, + "IS_CONSCIOUS" = MOBILITY_IS_CONSCIOUS, )) + +//? Helpers + +#define IS_STANDING(M) CHECK_MOBILITY(M, MOBILITY_IS_STANDING) +#define IS_PRONE(M) (!IS_STANDING(M)) diff --git a/code/__DEFINES/mobs/stat.dm b/code/__DEFINES/mobs/stat.dm new file mode 100644 index 00000000000..7467ae3de45 --- /dev/null +++ b/code/__DEFINES/mobs/stat.dm @@ -0,0 +1,17 @@ +//? Stat var - lets us get the most basic of mob health status from one var. higher = 'worse' / less conscious. +/// we're conscious +#define CONSCIOUS 0 +/// we're unconscious +#define UNCONSCIOUS 1 +/// we're dead +#define DEAD 2 + +//? stat helpers - since most semantic checks are going to be compound checks +#define IS_CONSCIOUS(M) (M.stat == CONSCIOUS) +#define IS_ALIVE_BUT_UNCONSCIOUS(M) (M.stat == UNCONSCIOUS) //! named this way because dead is technically unconscious +#define IS_DEAD(M) (M.stat == DEAD) +#define IS_ALIVE(M) (M.stat != DEAD) + +//? direct stat helpers +#define STAT_IS_CONSCIOUS(N) (N == CONSCIOUS) +#define STAT_IS_DEAD(N) (N == DEAD) diff --git a/code/__DEFINES/procs/do_after.dm b/code/__DEFINES/procs/do_after.dm index 992bfa062a6..2a8c22cc0f6 100644 --- a/code/__DEFINES/procs/do_after.dm +++ b/code/__DEFINES/procs/do_after.dm @@ -1,37 +1,31 @@ -/// Requires absolute stillness from the user -#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_USER (1<<0) -/// Requires absolute stillness from the target -#define DO_AFTER_DISALLOW_MOVING_ABSOLUTE_TARGET (1<<1) -/// Requires that the user is on a turf. -#define DO_AFTER_REQUIRES_USER_ON_TURF (1<<2) -/// Requires relative stillness to our target via dx and dy coordinate difference but only if both are spacedrifting. Specify DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY to say otherwise. -#define DO_AFTER_DISALLOW_MOVING_RELATIVE (1<<3) -/// Breaks if active hand item changes. Requires a tool be specified, otherwise defaults to active item -#define DO_AFTER_DISALLOW_ACTIVE_ITEM_CHANGE (1<<4) -/// Breaks if the user has no free hands. If a tool is specified, allows that as well. -#define DO_AFTER_REQUIRE_FREE_HAND_OR_TOOL (1<<5) -/// Do not display progressbar. -#define DO_AFTER_NO_PROGRESSBAR (1<<6) -/// Do not check do_after_coefficient() -#define DO_AFTER_NO_COEFFICIENT (1<<7) -/// For relative stillness, allow non spacedrift relative movement -#define DO_AFTER_ALLOW_NONSPACEDRIFT_RELATIVITY (1<<8) +//? do_after flags arg -/// Ignores checks. -#define DO_AFTER_PROCEED "PROCEED" -/// Uses all other checks -#define DO_AFTER_CONTINUE "CONTINUE" -/// Breaks -#define DO_AFTER_STOP "STOP" +/// allow user movement +#define DO_AFTER_IGNORE_USER_MOVEMENT (1<<0) +/// allow target movement +#define DO_AFTER_IGNORE_TARGET_MOVEMENT (1<<1) +/// allow movement +#define DO_AFTER_IGNORE_MOVEMENT (DO_AFTER_IGNORE_USER_MOVEMENT | DO_AFTER_IGNORE_TARGET_MOVEMENT) +/// don't care about currently held item +#define DO_AFTER_IGNORE_ACTIVE_ITEM (1<<2) +/// check for user turf as well instead of just exact loc +#define DO_AFTER_CHECK_USER_TURF (1<<3) +/// check for target turf as well instead of just exact loc +#define DO_AFTER_CHECK_TARGET_TURF (1<<4) +/// no progress bar +#define DO_AFTER_NO_PROGRESS (1<<5) -/// Stage - initiating a do_after -#define DO_AFTER_STARTING 1 -/// Stage - main loop of a do_after -#define DO_AFTER_PROGRESSING 2 -/// Stage - Last check of a do_after -#define DO_AFTER_FINISHING 3 +//? do_after arg indices -//! Interaction Checks +#define DO_AFTER_ARG_USER 1 +#define DO_AFTER_ARG_DELAY 2 +#define DO_AFTER_ARG_TARGET 3 +#define DO_AFTER_ARG_FLAGS 4 +#define DO_AFTER_ARG_MOBILITY 5 +#define DO_AFTER_ARG_DIST 6 +#define DO_AFTER_ARG_CALLBACK 7 + +//? Interaction Checks /// checks if we're interacting with an atom #define INTERACTING_WITH(M, A) M.interacting_with?[A] /// checks if we're interacting with an atom for a certain type @@ -47,7 +41,7 @@ /// checks if we're interacting with *anything* for *any* reason. #define IS_INTERACTING_WITH_SOMETHING(M) !!length(M.interacting_with) -//! Interactiong Types +//? Interactiong Types /// Generic do after #define INTERACTING_FOR_DO_AFTER "do_after" /// Dynaimc tool usage in progress diff --git a/code/__DEFINES/procs/saycode.dm b/code/__DEFINES/procs/saycode.dm new file mode 100644 index 00000000000..f9b1ee98cd7 --- /dev/null +++ b/code/__DEFINES/procs/saycode.dm @@ -0,0 +1,10 @@ +// works as long as can see +#define SAYCODE_TYPE_VISIBLE 1 +// works as long as can hear +#define SAYCODE_TYPE_AUDIBLE 2 +// works as long as conscious +#define SAYCODE_TYPE_CONSCIOUS 3 +// works as long as alive +#define SAYCODE_TYPE_LIVING 4 +// it just works +#define SAYCODE_TYPE_ALWAYS 5 diff --git a/code/__DEFINES/rendering/atom_huds.dm b/code/__DEFINES/rendering/atom_huds.dm index a2aefe82ede..87181812b02 100644 --- a/code/__DEFINES/rendering/atom_huds.dm +++ b/code/__DEFINES/rendering/atom_huds.dm @@ -3,7 +3,7 @@ // /datum/atom_hud expects these to be unique // these need to be strings in order to make them associative lists /// dead, alive, sick, health status -#define STATUS_HUD "1" +#define BIOLOGY_HUD "1" /// a simple line rounding the mob's number health #define LIFE_HUD "2" /// the job asigned to your ID @@ -24,7 +24,7 @@ // constant list lookup of hud to icon GLOBAL_LIST_INIT(hud_icon_files, list( - STATUS_HUD = 'icons/screen/atom_hud/status.dmi', + BIOLOGY_HUD = 'icons/screen/atom_hud/biology.dmi', LIFE_HUD = 'icons/screen/atom_hud/health.dmi', WANTED_HUD = 'icons/screen/atom_hud/security.dmi', IMPLOYAL_HUD = 'icons/screen/atom_hud/implant.dmi', @@ -36,7 +36,7 @@ GLOBAL_LIST_INIT(hud_icon_files, list( // constant list lookup of hud to layer GLOBAL_LIST_INIT(hud_icon_layers, list( - STATUS_HUD = 1 // render above default + BIOLOGY_HUD = 1 // render above default )) //by default everything in the hud_list of an atom is an image diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm deleted file mode 100644 index 4809687676b..00000000000 --- a/code/__DEFINES/status_effects.dm +++ /dev/null @@ -1,33 +0,0 @@ - -//These are all the different status effects. Use the paths for each effect in the defines. - -///if it allows multiple instances of the effect -#define STATUS_EFFECT_MULTIPLE 0 -///if it allows only one, preventing new instances -#define STATUS_EFFECT_UNIQUE 1 -///if it allows only one, but new instances replace -#define STATUS_EFFECT_REPLACE 2 -/// if it only allows one, and new instances just instead refresh the timer -#define STATUS_EFFECT_REFRESH 3 -/////////// -// BUFFS // -/////////// - -///////////// -// DEBUFFS // -///////////// - -///if struck with a proto-kinetic crusher, takes a ton of damage -#define STATUS_EFFECT_CRUSHERMARK /datum/status_effect/crusher_mark -///////////// -// NEUTRAL // -///////////// -///tracks total kinetic crusher damage on a target -#define STATUS_EFFECT_CRUSHERDAMAGETRACKING /datum/status_effect/crusher_damage -///////////// -// SLIME // -///////////// - -///////////// -// GROUPED // -///////////// diff --git a/code/__DEFINES/traits/_helpers.dm b/code/__DEFINES/traits/_helpers.dm index ddf662a89c4..a8872bd847b 100644 --- a/code/__DEFINES/traits/_helpers.dm +++ b/code/__DEFINES/traits/_helpers.dm @@ -27,7 +27,7 @@ }; \ if (_L && _L[trait]) { \ for (var/_T in _L[trait]) { \ - if ((!_S && (_T != ROUNDSTART_TRAIT)) || (_T in _S)) { \ + if ((!_S) || (_T in _S)) { \ _L[trait] -= _T \ } \ };\ diff --git a/code/__DEFINES/traits/atoms.dm b/code/__DEFINES/traits/atoms.dm index fb756541819..0ee8aaab559 100644 --- a/code/__DEFINES/traits/atoms.dm +++ b/code/__DEFINES/traits/atoms.dm @@ -2,12 +2,15 @@ /// flying /// use add/remove_atom_flying() to modify #define TRAIT_ATOM_FLYING "atom_flying" +DATUM_TRAIT(/atom, TRAIT_ATOM_FLYING) /// phsaing /// use add/remove_atom_phasing() to modify #define TRAIT_ATOM_PHASING "atom_phasing" +DATUM_TRAIT(/atom, TRAIT_ATOM_PHASING) /// floating /// use add/remove_atom_floating() to modify #define TRAIT_ATOM_FLOATING "atom_floating" +DATUM_TRAIT(/atom, TRAIT_ATOM_FLOATING) //? radiation diff --git a/code/__DEFINES/traits/mob.dm b/code/__DEFINES/traits/mob.dm index d84ab3170f2..a2819fc46e9 100644 --- a/code/__DEFINES/traits/mob.dm +++ b/code/__DEFINES/traits/mob.dm @@ -1,3 +1,53 @@ +//? mobility ; call update_mobility_blocked() and update_mobility_forced() when assigning these. +//? update_mobility() may assign additional flags. + +#define TRAIT_MOBILITY_MOVE_BLOCKED "mobility_no_move" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_MOVE_BLOCKED) +#define TRAIT_MOBILITY_STAND_BLOCKED "mobility_no_stand" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_STAND_BLOCKED) +#define TRAIT_MOBILITY_PICKUP_BLOCKED "mobility_no_pickup" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_PICKUP_BLOCKED) +#define TRAIT_MOBILITY_USE_BLOCKED "mobility_no_use" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_USE_BLOCKED) +#define TRAIT_MOBILITY_UI_BLOCKED "mobility_no_ui" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_UI_BLOCKED) +#define TRAIT_MOBILITY_STORAGE_BLOCKED "mobility_no_storage" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_STORAGE_BLOCKED) +#define TRAIT_MOBILITY_PULL_BLOCKED "mobility_no_pull" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_PULL_BLOCKED) +#define TRAIT_MOBILITY_HOLD_BLOCKED "mobility_no_hold" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_HOLD_BLOCKED) +#define TRAIT_MOBILITY_RESIST_BLOCKED "mobility_no_resist" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_RESIST_BLOCKED) + +#define TRAIT_MOBILITY_MOVE_FORCED "mobility_yes_move" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_MOVE_FORCED) +#define TRAIT_MOBILITY_STAND_FORCED "mobility_yes_stand" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_STAND_FORCED) +#define TRAIT_MOBILITY_PICKUP_FORCED "mobility_yes_pickup" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_PICKUP_FORCED) +#define TRAIT_MOBILITY_USE_FORCED "mobility_yes_use" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_USE_FORCED) +#define TRAIT_MOBILITY_UI_FORCED "mobility_yes_ui" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_UI_FORCED) +#define TRAIT_MOBILITY_STORAGE_FORCED "mobility_yes_storage" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_STORAGE_FORCED) +#define TRAIT_MOBILITY_PULL_FORCED "mobility_yes_pull" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_PULL_FORCED) +#define TRAIT_MOBILITY_HOLD_FORCED "mobility_yes_hold" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_HOLD_FORCED) +#define TRAIT_MOBILITY_RESIST_FORCED "mobility_yes_resist" +DATUM_TRAIT(/mob, TRAIT_MOBILITY_RESIST_FORCED) + +//? stat ; call update_stat(). update_stat() has the right to ignore. + +#define TRAIT_MOB_UNCONSCIOUS "mob_unconscious" +DATUM_TRAIT(/mob, TRAIT_MOB_UNCONSCIOUS) +#define TRAIT_MOB_SLEEPING "mob_sleeping" +DATUM_TRAIT(/mob, TRAIT_MOB_SLEEPING) + +//? misc + /// Tracks whether you're a mime or not. #define TRAIT_MIMING "miming" DATUM_TRAIT(/mob, TRAIT_MIMING) diff --git a/code/__DEFINES/traits/sources.dm b/code/__DEFINES/traits/sources.dm index 8a12dbeb8a0..bea0a1088cf 100644 --- a/code/__DEFINES/traits/sources.dm +++ b/code/__DEFINES/traits/sources.dm @@ -1,4 +1,6 @@ -/// Generic source - don't use this if at all possible. +//? Generic sources - use extremely sparingly. + +/// generic trait source #define GENERIC_TRAIT "generic" /// Trait is from ourselves (src) #define INNATE_TRAIT "innate" @@ -7,11 +9,17 @@ /// From species #define SPECIES_TRAIT "species" +/// From species quirks +#define QUIRK_TRAIT "quirk" +/// status effect trait source +#define STATUS_EFFECT_TRAIT(id) "status_effect_[id]" //? Role / Jobs -/// Roles -#define ROLE_TRAIT "role" +/// from your role +#define ROLE_TRAIT(id) "role_[id]" +/// from your ghostrole instantiator +#define GHOSTROLE_TRAIT "ghostrole" //? Admin / Special Sources @@ -22,22 +30,11 @@ //? Unsorted / Legacy -/* -#define EYE_DAMAGE "eye_damage" -#define GENETIC_MUTATION "genetic" -#define OBESITY "obesity" -*/ #define MAGIC_TRAIT "magic" -/* -#define TRAUMA_TRAIT "trauma" -#define DISEASE_TRAIT "disease" -#define SPECIES_TRAIT "species" -#define ORGAN_TRAIT "organ" -*/ #define HOLOGRAM_TRAIT "hologram" ///Mime trait. -#define TRAIT_MIME "mime" +#define MIME_TRAIT "mime" #define CLOTHING_TRAIT "clothing" #define RIG_TRAIT "rig" @@ -50,10 +47,24 @@ #define MMI_TRAIT "mmi" #define STASIS_BAG_TRAIT "stasis_bag" #define GRIPPER_TRAIT "gripper" -#define HAND_REPLACEMENT_TRAIT "magic-hand" +#define HAND_REPLACEMENT_TRAIT "magic-hand" + #define CHANGELING_TRAIT "changeling" #define TECHNOMANCER_TRAIT "technomancer" +//? specific mechanics sources + +/// from the CPR system #define CPR_TRAIT "cpr" + +//? species specific source + +/// shadekin phasing ability +#define SPECIES_SHADEKIN_PHASING_TRAIT "shadekin1" + +//? component source + +/// rad_insulation +#define TRAIT_SOURCE_COMPONENT_RAD_INSULATION "c_rad_insulation" diff --git a/code/__DEFINES/traits/unsorted.dm b/code/__DEFINES/traits/unsorted.dm index 8595ee5f06b..6f912c83f21 100644 --- a/code/__DEFINES/traits/unsorted.dm +++ b/code/__DEFINES/traits/unsorted.dm @@ -6,144 +6,20 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai //mob traits #define TRAIT_BLIND "blind" #define TRAIT_MUTE "mute" -/* -#define TRAIT_EMOTEMUTE "emotemute" -*/ + #define TRAIT_DEAF "deaf" -/* -#define TRAIT_NEARSIGHT "nearsighted" -#define TRAIT_FAT "fat" -#define TRAIT_HUSK "husk" -#define TRAIT_BADDNA "baddna" -#define TRAIT_CLUMSY "clumsy" -///means that you can't use weapons with normal trigger guards. -#define TRAIT_CHUNKYFINGERS "chunkyfingers" -#define TRAIT_DUMB "dumb" -///sets IsAdvancedToolUser to FALSE -#define TRAIT_MONKEYLIKE "monkeylike" -#define TRAIT_PACIFISM "pacifism" -#define TRAIT_IGNORESLOWDOWN "ignoreslow" -#define TRAIT_IGNOREDAMAGESLOWDOWN "ignoredamageslowdown" -///Causes death-like unconsciousness -#define TRAIT_DEATHCOMA "deathcoma" -///Makes the owner appear as dead to most forms of medical examination -#define TRAIT_FAKEDEATH "fakedeath" -#define TRAIT_DISFIGURED "disfigured" -*/ + ///Tracks whether we're gonna be a baby alien's mummy. #define TRAIT_XENO_HOST "xeno_host" -/* -#define TRAIT_STUNIMMUNE "stun_immunity" -#define TRAIT_STUNRESISTANCE "stun_resistance" -#define TRAIT_SLEEPIMMUNE "sleep_immunity" -*/ + /// cannot be pushed out of the way by mob movement #define TRAIT_PUSHIMMUNE "push_immunity" -/* -#define TRAIT_SHOCKIMMUNE "shock_immunity" -#define TRAIT_STABLEHEART "stable_heart" -#define TRAIT_STABLELIVER "stable_liver" -#define TRAIT_RESISTHEAT "resist_heat" -///For when you want to be able to touch hot things, but still want fire to be an issue. -#define TRAIT_RESISTHEATHANDS "resist_heat_handsonly" -#define TRAIT_RESISTCOLD "resist_cold" -#define TRAIT_RESISTHIGHPRESSURE "resist_high_pressure" -#define TRAIT_RESISTLOWPRESSURE "resist_low_pressure" -#define TRAIT_RADIMMUNE "rad_immunity" -#define TRAIT_VIRUSIMMUNE "virus_immunity" -#define TRAIT_PIERCEIMMUNE "pierce_immunity" -#define TRAIT_NODISMEMBER "dismember_immunity" -#define TRAIT_NOFIRE "nonflammable" -#define TRAIT_NOGUNS "no_guns" -#define TRAIT_NOHUNGER "no_hunger" -#define TRAIT_NOMETABOLISM "no_metabolism" -#define TRAIT_TOXIMMUNE "toxin_immune" -#define TRAIT_EASYDISMEMBER "easy_dismember" -#define TRAIT_LIMBATTACHMENT "limb_attach" -#define TRAIT_NOLIMBDISABLE "no_limb_disable" -#define TRAIT_EASYLIMBDISABLE "easy_limb_disable" -#define TRAIT_TOXINLOVER "toxinlover" -#define TRAIT_NOBREATH "no_breath" -*/ + #define TRAIT_ANTIMAGIC "anti_magic" #define TRAIT_HOLY "holy" #define TRAIT_AI_PAUSE_AUTOMATED_MOVEMENT "ai_pause_movement" -/* -#define TRAIT_DEPRESSION "depression" -#define TRAIT_JOLLY "jolly" -#define TRAIT_NOCRITDAMAGE "no_crit" -#define TRAIT_NOSLIPWATER "noslip_water" -#define TRAIT_NOSLIPALL "noslip_all" -#define TRAIT_NODEATH "nodeath" -#define TRAIT_NOHARDCRIT "nohardcrit" -#define TRAIT_NOSOFTCRIT "nosoftcrit" -#define TRAIT_MINDSHIELD "mindshield" -#define TRAIT_DISSECTED "dissected" -///I can hear dead people -#define TRAIT_SIXTHSENSE "sixth_sense" -#define TRAIT_FEARLESS "fearless" -///These are used for brain-based paralysis, where replacing the limb won't fix it -#define TRAIT_PARALYSIS_L_ARM "para-l-arm" -#define TRAIT_PARALYSIS_R_ARM "para-r-arm" -#define TRAIT_PARALYSIS_L_LEG "para-l-leg" -#define TRAIT_PARALYSIS_R_LEG "para-r-leg" -#define TRAIT_CANNOT_OPEN_PRESENTS "cannot-open-presents" -#define TRAIT_PRESENT_VISION "present-vision" -#define TRAIT_DISK_VERIFIER "disk-verifier" -#define TRAIT_NOMOBSWAP "no-mob-swap" -#define TRAIT_XRAY_VISION "xray_vision" -#define TRAIT_THERMAL_VISION "thermal_vision" -#define TRAIT_ABDUCTOR_TRAINING "abductor-training" -#define TRAIT_ABDUCTOR_SCIENTIST_TRAINING "abductor-scientist-training" -#define TRAIT_SURGEON "surgeon" -#define TRAIT_STRONG_GRABBER "strong_grabber" -#define TRAIT_MAGIC_CHOKE "magic_choke" -#define TRAIT_SOOTHED_THROAT "soothed-throat" -#define TRAIT_LAW_ENFORCEMENT_METABOLISM "law-enforcement-metabolism" -#define TRAIT_ALWAYS_CLEAN "always-clean" -#define TRAIT_BOOZE_SLIDER "booze-slider" -#define TRAIT_UNINTELLIGIBLE_SPEECH "unintelligible-speech" -#define TRAIT_UNSTABLE "unstable" -#define TRAIT_OIL_FRIED "oil_fried" -#define TRAIT_MEDICAL_HUD "med_hud" -#define TRAIT_SECURITY_HUD "sec_hud" -///Is a medibot healing you -#define TRAIT_MEDIBOTCOMINGTHROUGH "medibot" -#define TRAIT_PASSTABLE "passtable" -//non-mob traits -///Used for limb-based paralysis, where replacing the limb will fix it -#define TRAIT_PARALYSIS "paralysis" -// item traits -*/ #define TRAIT_DISRUPTED "disrupted" -/* -/// Visible on t-ray scanners if the atom/var/level == 1 -#define TRAIT_T_RAY_VISIBLE "t-ray-visible" -///you just can't -#define TRAIT_NO_TELEPORT "no-teleport" -//quirk traits -#define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance" -#define TRAIT_AGEUSIA "ageusia" -#define TRAIT_HEAVY_SLEEPER "heavy_sleeper" -#define TRAIT_NIGHT_VISION "night_vision" -#define TRAIT_LIGHT_STEP "light_step" -#define TRAIT_SPIRITUAL "spiritual" -#define TRAIT_VORACIOUS "voracious" -#define TRAIT_SELF_AWARE "self_aware" -#define TRAIT_FREERUNNING "freerunning" -#define TRAIT_SKITTISH "skittish" -#define TRAIT_POOR_AIM "poor_aim" -#define TRAIT_PROSOPAGNOSIA "prosopagnosia" -#define TRAIT_DRUNK_HEALING "drunk_healing" -#define TRAIT_TAGGER "tagger" -#define TRAIT_PHOTOGRAPHER "photographer" -#define TRAIT_MUSICIAN "musician" -#define TRAIT_LIGHT_DRINKER "light_drinker" -#define TRAIT_EMPATH "empath" -#define TRAIT_FRIENDLY "friendly" -#define TRAIT_GRABWEAKNESS "grab_weakness" -*/ /// CPR was done already; CPR is less effective #define TRAIT_CPR_COOLDOWN "cpr_cooldown" diff --git a/code/__HELPERS/do_after.dm b/code/__HELPERS/do_after.dm index 35a7530be6e..a8a667b336d 100644 --- a/code/__HELPERS/do_after.dm +++ b/code/__HELPERS/do_after.dm @@ -1,4 +1,5 @@ -// TODO: Refactor everything, add actionspeed support. +// TODO: Refactor do_mob, add actionspeed support to do_mob, do_after, do_self. +// (or don't for actionspeed, why are we checking it in the proc anyways...) /proc/do_mob(mob/user , mob/target, time = 30, target_zone = 0, uninterruptible = FALSE, progress = TRUE, ignore_movement = FALSE) if(!user || !target) @@ -55,74 +56,140 @@ STOP_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) -/proc/do_after(mob/user, delay, atom/target = null, needhand = TRUE, progress = TRUE, incapacitation_flags = INCAPACITATION_DEFAULT, ignore_movement = FALSE, max_distance = null, ignore_resist = FALSE) - if(!user) - return 0 +/** + * Does an action after a delay. + * + * @params + * * user - acting mob + * * delay - how long in deciseconds + * * target - targeted atom, if any + * * flags - do_after flags as specified in [code/__DEFINES/procs/do_after.dm] + * * mobility_flags - required mobility flags + * * max_distance - if not null, the user is required to be get_dist() <= max_distance from target. + * * additional_checks - a callback that allows for custom checks. this is invoked with our args directly, allowing us to modify delay. + */ +/proc/do_after(mob/user, delay, atom/target, flags, mobility_flags = MOBILITY_CAN_USE, max_distance, datum/callback/additional_checks) + if(isnull(user)) + return FALSE if(!delay) - return 1 //Okay. Done. - var/atom/target_loc = null - if(target) + return \ + (isnull(additional_checks) || additional_checks.Invoke(args)) && \ + (isnull(max_distance) || get_dist(user, target) <= max_distance) && \ + CHECK_ALL_MOBILITY(user, mobility_flags) + + //* setup + + //? legacy + if(ismecha(user.loc)) + flags |= DO_AFTER_CHECK_USER_TURF + //? end + + var/atom/user_loc = user.loc + var/turf/user_turf = (flags & DO_AFTER_CHECK_USER_TURF)? get_turf(user) : null + var/atom/target_loc + var/turf/target_turf + + if(!isnull(target)) target_loc = target.loc + target_turf = (flags & DO_AFTER_CHECK_TARGET_TURF)? get_turf(target) : null START_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) - var/atom/original_loc = user.loc + var/obj/item/active_held_item = user.get_active_held_item() - var/obj/mecha/M = null + var/datum/progressbar/progress + var/original_delay = delay + var/delay_factor = 1 + if(!(flags & DO_AFTER_NO_PROGRESS)) + progress = new(user, delay, target) + var/start_time = world.time - if(ismecha(user.loc)) - original_loc = get_turf(original_loc) - M = user.loc + //* loop - var/holding = user.get_active_held_item() - - var/datum/progressbar/progbar - if (progress) - progbar = new(user, delay, target) - - var/endtime = world.time + delay - var/starttime = world.time - . = 1 - while (world.time < endtime) + . = TRUE + while(world.time < (start_time + delay)) stoplag(1) - if(progress) - progbar.update(world.time - starttime) - if(!user || user.incapacitated(incapacitation_flags)) + progress?.update((world.time - start_time) * delay_factor) + + // check if deleted + if(QDELETED(user)) . = FALSE break - if(M) - if(user.loc != M || (M.loc != original_loc && !ignore_movement)) // Mech coooooode. + // check mobility + if(!CHECK_ALL_MOBILITY(user, mobility_flags)) + . = FALSE + break + + // check movement + if(!(flags & DO_AFTER_IGNORE_USER_MOVEMENT) && (user.loc != user_loc)) + . = FALSE + break + + if(!isnull(user_turf) && (get_turf(user) != user_turf)) + . = FALSE + break + + // check held + if(!(flags & DO_AFTER_IGNORE_ACTIVE_ITEM) && (active_held_item != user.get_active_held_item())) + . = FALSE + break + + // target checks + if(!isnull(target)) + + // check if deleted + if(QDELETED(target)) . = FALSE break - else if(user.loc != original_loc && !ignore_movement) - . = FALSE - break - - if(target_loc && (QDELETED(target))) - . = FALSE - break - - if(target && target_loc != target.loc && !ignore_movement) - . = FALSE - break - - if(target && !INTERACTING_WITH_FOR(user, target, INTERACTING_FOR_DO_AFTER)) - . = FALSE - break - - if(needhand) - if(user.get_active_held_item() != holding) + // check if interrupted + if(!INTERACTING_WITH_FOR(user, target, INTERACTING_FOR_DO_AFTER)) . = FALSE break - if(max_distance && target && get_dist(user, target) > max_distance) - . = FALSE - break + // check movement + if(!(flags & DO_AFTER_IGNORE_USER_MOVEMENT) && (target.loc != target_loc)) + . = FALSE + break + if(!isnull(target_turf) && (get_turf(target) != target_turf)) + . = FALSE + break - if(!QDELETED(progbar)) - qdel(progbar) + // check max distance - does NOT check z as of right now! + if(!isnull(max_distance) && get_dist(user, target) > max_distance) + . = FALSE + break - if(target) + if(!isnull(additional_checks)) + if(!additional_checks.Invoke(args)) + . = FALSE + break + // update delay factor incase they changed + delay_factor = original_delay / delay + + //* end + if(!QDELETED(progress)) + qdel(progress) + + if(!isnull(target)) STOP_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) + +/** + * Does an action to ourselves after a delay. + * + * @params + * * user - acting mob + * * delay - how long in deciseconds + * * flags - do_after flags as specified in [code/__DEFINES/procs/do_after.dm] + * * mobility_flags - required mobility flags + * * additional_checks - a callback that allows for custom checks. this is invoked with our args directly, allowing us to modify delay. + */ +/proc/do_self(mob/user, delay, flags, mobility_flags = MOBILITY_CAN_USE, datum/callback/additional_checks) + return do_after( + user, + delay, + flags = flags, + mobility_flags = mobility_flags, + additional_checks = additional_checks, + ) diff --git a/code/__HELPERS/matrices/transfor_matrix.dm b/code/__HELPERS/matrices/transform_matrix.dm similarity index 96% rename from code/__HELPERS/matrices/transfor_matrix.dm rename to code/__HELPERS/matrices/transform_matrix.dm index b36b94a7d7e..fab3126be03 100644 --- a/code/__HELPERS/matrices/transfor_matrix.dm +++ b/code/__HELPERS/matrices/transform_matrix.dm @@ -71,6 +71,12 @@ /matrix/proc/get_y_shift() . = f +/matrix/proc/get_x_scale() + return a + +/matrix/proc/get_y_scale() + return e + /matrix/proc/get_x_skew() . = b diff --git a/code/_globals/traits.dm b/code/_globals/traits.dm index 6da003a2e2a..5db55c4172e 100644 --- a/code/_globals/traits.dm +++ b/code/_globals/traits.dm @@ -1,4 +1,5 @@ /* + FUN ZONE OF ADMIN LISTINGS Try to keep this in sync with __DEFINES/traits.dm quirks have it's own panel so we don't need them here. @@ -30,7 +31,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_DISFIGURED" = TRAIT_DISFIGURED, */ "TRAIT_XENO_HOST" = TRAIT_XENO_HOST, - "TRAIT_MIME" = TRAIT_MIME, + "MIME_TRAIT" = MIME_TRAIT, /* "TRAIT_STUNIMMUNE" = TRAIT_STUNIMMUNE, "TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE, diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 2c2021dd3ea..a6935ad0e2e 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -94,7 +94,7 @@ MiddleClickOn(A) return 1 - if(stat || paralysis || stunned || weakened) + if(!IS_CONSCIOUS(src)) return face_atom(A) // change direction to face what you clicked on @@ -113,6 +113,10 @@ RestrainedClickOn(A) return 1 + if(!CHECK_MOBILITY(src, MOBILITY_CAN_USE)) + to_chat(src, SPAN_WARNING("You can't do that right now.")) + return + if(throw_mode_check()) if(isturf(A) || isturf(A.loc)) throw_active_held_item(A) @@ -335,7 +339,7 @@ /mob/proc/face_atom(var/atom/A) if(!A || !x || !y || !A.x || !A.y) return - if(!canmove) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) return var/dx = A.x - x var/dy = A.y - y diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index d66d5c6d469..e2268ea8d80 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -36,7 +36,7 @@ CtrlClickOn(A) return - if(stat || lockdown || weakened || stunned || paralysis) + if(!IS_CONSCIOUS(src) || !CHECK_MOBILITY(src, MOBILITY_CAN_USE)) return if(!canClick()) diff --git a/code/_onclick/hud/_screen_object.dm b/code/_onclick/hud/_screen_object.dm index a5741baed86..89e13388a74 100644 --- a/code/_onclick/hud/_screen_object.dm +++ b/code/_onclick/hud/_screen_object.dm @@ -51,7 +51,7 @@ if(!usr.canClick()) return - if(usr.stat || usr.restrained() || usr.stunned || usr.lying) + if(usr.stat || usr.restrained() || !CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 1 if(!(owner in usr)) @@ -81,7 +81,7 @@ /atom/movable/screen/storage/Click() if(!usr.canClick()) return 1 - if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_STORAGE)) return 1 if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech return 1 @@ -243,7 +243,7 @@ if("internal") if(iscarbon(usr)) var/mob/living/carbon/C = usr - if(!C.stat && !C.stunned && !C.paralysis && !C.restrained()) + if(CHECK_MOBILITY(C, MOBILITY_CAN_USE)) if(C.internal) C.internal = null to_chat(C, "No longer running on internals.") diff --git a/code/_onclick/hud/inventory/inventory.dm b/code/_onclick/hud/inventory/inventory.dm index dc37314cb57..70c331aa297 100644 --- a/code/_onclick/hud/inventory/inventory.dm +++ b/code/_onclick/hud/inventory/inventory.dm @@ -4,7 +4,7 @@ /atom/movable/screen/inventory/proc/check_inventory_usage(mob/user) if(!user.canClick()) return FALSE - if(user.stunned || user.paralysis || user.weakened || user.stat) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_STORAGE) || user.stat) return FALSE return TRUE diff --git a/code/_onclick/items.dm b/code/_onclick/items.dm index ebd3083ba2a..48a9243e9f9 100644 --- a/code/_onclick/items.dm +++ b/code/_onclick/items.dm @@ -117,6 +117,9 @@ // end if(item_flags & ITEM_NOBLUDGEON) return NONE + // todo: not hardcoding this + if(IS_PRONE(user)) + mult *= 0.66 // is mob, go to that // todo: signals for both if(ismob(target)) diff --git a/code/_rendering/atom_huds/data_huds.dm b/code/_rendering/atom_huds/data_huds.dm index 4b895cc663e..f4555ee4e39 100644 --- a/code/_rendering/atom_huds/data_huds.dm +++ b/code/_rendering/atom_huds/data_huds.dm @@ -18,7 +18,7 @@ /datum/atom_hud/data /datum/atom_hud/data/human/medical - hud_icons = list(STATUS_HUD, LIFE_HUD) + hud_icons = list(BIOLOGY_HUD, LIFE_HUD) /datum/atom_hud/data/human/job_id hud_icons = list(ID_HUD) @@ -52,7 +52,7 @@ I.icon_state = RoundHealth((health-config_legacy.health_threshold_crit)/(getMaxHealth()-config_legacy.health_threshold_crit)*100) /mob/proc/update_hud_med_status() - var/image/holder = hud_list[STATUS_HUD] + var/image/holder = hud_list[BIOLOGY_HUD] if(!holder) return var/foundVirus = check_viruses() diff --git a/code/controllers/subsystem/job/_legacy_job_stuff.dm b/code/controllers/subsystem/job/_legacy_job_stuff.dm index 5c9c071a208..229879718b8 100644 --- a/code/controllers/subsystem/job/_legacy_job_stuff.dm +++ b/code/controllers/subsystem/job/_legacy_job_stuff.dm @@ -409,7 +409,6 @@ var/wheelchair_type = R?.unfolded_type || /obj/structure/bed/chair/wheelchair var/obj/structure/bed/chair/wheelchair/W = new wheelchair_type(H.loc) W.buckle_mob(H) - H.update_canmove() W.setDir(H.dir) W.add_fingerprint(H) if(R) diff --git a/code/controllers/subsystem/processing/status_effects.dm b/code/controllers/subsystem/processing/status_effects.dm deleted file mode 100644 index 30667f5ee15..00000000000 --- a/code/controllers/subsystem/processing/status_effects.dm +++ /dev/null @@ -1,4 +0,0 @@ -PROCESSING_SUBSYSTEM_DEF(status_effects) - wait = 1 - subsystem_flags = SS_TICKER - name = "Status Effects" diff --git a/code/controllers/subsystem/status_effects.dm b/code/controllers/subsystem/status_effects.dm new file mode 100644 index 00000000000..cceedbafb1b --- /dev/null +++ b/code/controllers/subsystem/status_effects.dm @@ -0,0 +1,40 @@ +SUBSYSTEM_DEF(status_effects) + wait = 0.5 + subsystem_flags = NONE + name = "Status Effects" + + /// ticking effects + var/list/datum/status_effect/ticking = list() + /// currentrun + var/list/datum/status_effect/currentrun = list() + +/datum/controller/subsystem/status_effects/Recover() + if(islist(SSstatus_effects.ticking)) + src.ticking = list() + for(var/datum/status_effect/eff in SSstatus_effects.ticking) + src.ticking += eff + return ..() + +/datum/controller/subsystem/status_effects/proc/register(datum/status_effect/effect) + ticking += effect + +/datum/controller/subsystem/status_effects/proc/unregister(datum/status_effect/effect) + ticking -= effect + currentrun -= effect + +/datum/controller/subsystem/status_effects/fire(resumed) + if(!resumed) + currentrun = ticking.Copy() + if(!length(currentrun)) + return + var/i + var/datum/status_effect/effect + for(i in 1 to length(currentrun)) + effect = currentrun[i] + if(effect.tick_next > world.time) + continue + effect.tick(effect.tick_interval) + effect.tick_next = world.time + effect.tick_interval + if(MC_TICK_CHECK_USAGE) // effect.tick() is SHOULD NOT SLEEP. + return + currentrun.Cut(1, i + 1) diff --git a/code/datums/ability.dm b/code/datums/ability.dm index 2a5667841da..d4083209d07 100644 --- a/code/datums/ability.dm +++ b/code/datums/ability.dm @@ -151,7 +151,7 @@ if(!check_trigger(user, toggling, TRUE)) return if(windup) - if(!do_after(user, windup, ignore_movement = !windup_requires_still)) + if(!do_after(user, windup, (windup_requires_still? NONE : DO_AFTER_IGNORE_MOVEMENT), mobility_check_flags)) return if(!check_trigger(user, toggling, TRUE)) return @@ -255,11 +255,11 @@ return TRUE if((ability_check_flags & ABILITY_CHECK_CONSCIOUS) && !IS_CONSCIOUS(owner)) return FALSE - if((ability_check_flags & ABILITY_CHECK_STANDING) && owner.lying) + if((ability_check_flags & ABILITY_CHECK_STANDING) && IS_PRONE(owner)) return FALSE if((ability_check_flags & ABILITY_CHECK_FREE_HAND) && !(owner.has_free_hand())) return FALSE - if((ability_check_flags & ABILITY_CHECK_STUNNED) && (!IS_CONSCIOUS(owner) || owner.stunned || owner.weakened || owner.incapacitated())) + if(!CHECK_MOBILITY(owner, mobility_check_flags)) return FALSE return TRUE @@ -277,7 +277,7 @@ return "You cannot do that while on the ground." if((ability_check_flags & ABILITY_CHECK_FREE_HAND) && !(owner.has_free_hand())) return "You cannot do that without a free hand." - if((ability_check_flags & ABILITY_CHECK_STUNNED) && (!IS_CONSCIOUS(owner) || owner.stunned || owner.weakened || owner.incapacitated())) + if(!CHECK_MOBILITY(owner, mobility_check_flags)) return "You cannot do that while incapacitated." /** diff --git a/code/datums/action.dm b/code/datums/action.dm index c66e6f3bfd5..c5c3fe219e3 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -47,6 +47,8 @@ var/action_type = ACTION_TYPE_ITEM var/procname = null var/check_flags = 0 + /// required mobility flags + var/mobility_flags = NONE var/processing = 0 var/active = 0 var/button_icon = 'icons/screen/actions/actions.dmi' @@ -161,11 +163,13 @@ /datum/action/proc/Checks()// returns 1 if all checks pass if(!owner) return 0 + if(mobility_flags && !CHECK_MOBILITY(owner, mobility_flags)) + return FALSE if(check_flags & ACTION_CHECK_RESTRAINED) if(owner.restrained()) return 0 if(check_flags & ACTION_CHECK_STUNNED) - if(owner.stunned) + if(!CHECK_MOBILITY(owner, MOBILITY_CAN_USE)) return 0 if(check_flags & ACTION_CHECK_LYING) if(owner.lying) diff --git a/code/datums/components/chasm.dm b/code/datums/components/chasm.dm index 50306611397..8a8aca2080a 100644 --- a/code/datums/components/chasm.dm +++ b/code/datums/components/chasm.dm @@ -110,7 +110,7 @@ if (isliving(AM)) var/mob/living/L = AM L.notransform = TRUE - L.Stun(200) + L.afflict_stun(20 * 200) L.resting = TRUE var/oldtransform = AM.transform diff --git a/code/datums/components/jousting.dm b/code/datums/components/jousting.dm index 14783ea575b..76d87594b0e 100644 --- a/code/datums/components/jousting.dm +++ b/code/datums/components/jousting.dm @@ -55,7 +55,7 @@ msg += " and knocks [target] [target_buckled? "off of [target.buckled]" : "down"]" if(target_buckled) target.buckled.unbuckle_mob(target) - L.SetUnconscious(knockdown_time) + L.set_unconscious(20 * knockdown_time) if(length(msg)) user.visible_message("[msg]!") diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 421e5bcd552..300ac6170c7 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -215,7 +215,7 @@ return var/datum/progressbar/progress = new(M, len, I.loc) var/list/rejections = list() - while(do_after(M, 10, TRUE, parent, FALSE, CALLBACK(src, .proc/handle_mass_pickup, things, I.loc, rejections, progress))) + while(do_after(M, 10, parent, DO_AFTER_NO_PROGRESS, additional_checks = CALLBACK(src, .proc/handle_mass_pickup, things, I.loc, rejections, progress))) stoplag(1) qdel(progress) to_chat(M, "You put everything you could [insert_preposition] [parent].") @@ -273,7 +273,7 @@ var/turf/T = get_turf(A) var/list/things = contents() var/datum/progressbar/progress = new(M, length(things), T) - while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress))) + while(do_after(M, 10, T, DO_AFTER_NO_PROGRESS, additional_checks = CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress))) stoplag(1) qdel(progress) diff --git a/code/datums/components/waddling.dm b/code/datums/components/waddling.dm index 6549d9fa888..13a36c9473d 100644 --- a/code/datums/components/waddling.dm +++ b/code/datums/components/waddling.dm @@ -12,7 +12,7 @@ /datum/component/waddling/proc/LivingWaddle() var/mob/living/L = parent - if(L.incapacitated() || !(L.mobility_flags & MOBILITY_STAND)) + if(L.incapacitated() || !(L.mobility_flags & MOBILITY_IS_STANDING)) return Waddle() diff --git a/code/datums/elements/cleaning.dm b/code/datums/elements/cleaning.dm index b989494c625..96ade07744b 100644 --- a/code/datums/elements/cleaning.dm +++ b/code/datums/elements/cleaning.dm @@ -26,7 +26,7 @@ M.regenerate_icons() else if(ishuman(A)) var/mob/living/carbon/human/cleaned_human = A - if(!(cleaned_human.mobility_flags & MOBILITY_STAND)) + if(!(cleaned_human.mobility_flags & MOBILITY_IS_STANDING)) if(cleaned_human.head) SEND_SIGNAL(cleaned_human.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) if(cleaned_human.wear_suit) diff --git a/code/datums/observation/stat_set.dm b/code/datums/observation/stat_set.dm deleted file mode 100644 index ec3aa0a36e4..00000000000 --- a/code/datums/observation/stat_set.dm +++ /dev/null @@ -1,24 +0,0 @@ -// Observer Pattern Implementation: Stat Set -// Registration type: /mob/living -// -// Raised when: A /mob/living changes stat, using the set_stat() proc -// -// Arguments that the called proc should expect: -// /mob/living/stat_mob: The mob whose stat changed -// /old_stat: Status before the change. -// /new_stat: Status after the change. - -GLOBAL_DATUM_INIT(stat_set_event, /singleton/observ/stat_set, new) - -/singleton/observ/stat_set - name = "Stat Set" - expected_type = /mob/living - -/**************** -* Stat Handling * -****************/ -/mob/living/set_stat(var/new_stat) - var/old_stat = stat - . = ..() - if(stat != old_stat) - GLOB.stat_set_event.raise_event(src, old_stat, new_stat) diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index e440a4c5087..de1bf67bd4b 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -7,7 +7,8 @@ /datum/progressbar/New(mob/user, goal_number, atom/target) . = ..() - if(!target) target = user + if(!target) + target = user if (!istype(target)) EXCEPTION("Invalid target given") if (goal_number) diff --git a/code/datums/status_effects/neutral/crusher_track.dm b/code/datums/status_effects/basic/crusher_track.dm similarity index 55% rename from code/datums/status_effects/neutral/crusher_track.dm rename to code/datums/status_effects/basic/crusher_track.dm index 2081596b7d7..b37026c318b 100644 --- a/code/datums/status_effects/neutral/crusher_track.dm +++ b/code/datums/status_effects/basic/crusher_track.dm @@ -1,6 +1,3 @@ /datum/status_effect/crusher_damage //tracks the damage dealt to this mob by kinetic crushers - id = "crusher_damage" - duration = -1 - status_type = STATUS_EFFECT_UNIQUE - alert_type = null + identifier = "crusher_damage" var/total_damage = 0 diff --git a/code/datums/status_effects/basic/incapacitation.dm b/code/datums/status_effects/basic/incapacitation.dm new file mode 100644 index 00000000000..89b673d590a --- /dev/null +++ b/code/datums/status_effects/basic/incapacitation.dm @@ -0,0 +1,41 @@ +/datum/status_effect/incapacitation + var/requires_mobility_update = TRUE + var/requires_stat_update = FALSE + +/datum/status_effect/incapacitation/on_apply(...) + . = ..() + if(requires_mobility_update) + owner.update_mobility() + if(requires_stat_update) + owner.update_stat() + +/datum/status_effect/incapacitation/on_remove() + . = ..() + if(requires_mobility_update) + owner.update_mobility() + if(requires_stat_update) + owner.update_stat() + +/datum/status_effect/incapacitation/stun + identifier = "stun" + requires_mobility_update = TRUE + +/datum/status_effect/incapacitation/knockdown + identifier = "knockdown" + requires_mobility_update = TRUE + +/datum/status_effect/incapacitation/paralyze + identifier = "paralyze" + requires_mobility_update = TRUE + +/datum/status_effect/incapacitation/root + identifier = "root" + requires_mobility_update = TRUE + +/datum/status_effect/incapacitation/unconscious + identifier = "unconscious" + requires_stat_update = TRUE + +/datum/status_effect/incapacitation/sleeping + identifier = "sleeping" + requires_stat_update = TRUE diff --git a/code/datums/status_effects/basic/staggered.dm b/code/datums/status_effects/basic/staggered.dm new file mode 100644 index 00000000000..a82b8a7fe01 --- /dev/null +++ b/code/datums/status_effects/basic/staggered.dm @@ -0,0 +1,18 @@ +#define MAX_STAGGER_STACKS 30 +#define STACKS_TO_SLOWDOWN(amt) (amt * (1 / 3.5)) + +/datum/status_effect/stacking/staggered + identifier = "staggered" + duration = 1 SECONDS + max_stacks = MAX_STAGGER_STACKS + + +/datum/status_effect/stacking/staggered/on_stacks(old_stacks, new_stacks, decayed) + . = ..() + if(!new_stacks) + owner.remove_movespeed_modifier(/datum/movespeed_modifier/mob_staggered) + else + owner.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/mob_staggered, multiplicative_slowdown = STACKS_TO_SLOWDOWN(new_stacks)) + +#undef STACKS_TO_SLOWDOWN +#undef MAX_STAGGER_STACKS diff --git a/code/datums/status_effects/debuffs/crusher_mark.dm b/code/datums/status_effects/debuffs/crusher_mark.dm deleted file mode 100644 index 04add755197..00000000000 --- a/code/datums/status_effects/debuffs/crusher_mark.dm +++ /dev/null @@ -1,32 +0,0 @@ -/datum/status_effect/crusher_mark - id = "crusher_mark" - duration = 300 //if you leave for 30 seconds you lose the mark, deal with it - status_type = STATUS_EFFECT_REPLACE - alert_type = null - var/mutable_appearance/marked_underlay - var/obj/item/kinetic_crusher/hammer_synced - -/datum/status_effect/crusher_mark/on_creation(mob/living/new_owner, obj/item/kinetic_crusher/new_hammer_synced) - hammer_synced = new_hammer_synced - return ..() - -/datum/status_effect/crusher_mark/on_apply() - . = ..() - if(hammer_synced? hammer_synced.can_mark(owner) : TRUE) - marked_underlay = mutable_appearance('icons/effects/effects.dmi', "shield2") - marked_underlay.pixel_x = -owner.pixel_x - marked_underlay.pixel_y = -owner.pixel_y - owner.underlays += marked_underlay - return TRUE - return FALSE - -/datum/status_effect/crusher_mark/Destroy() - hammer_synced = null - if(owner) - owner.underlays -= marked_underlay - QDEL_NULL(marked_underlay) - return ..() - -/datum/status_effect/crusher_mark/be_replaced() - owner.underlays -= marked_underlay //if this is being called, we should have an owner at this point. - ..() diff --git a/code/datums/status_effects/grouped.dm b/code/datums/status_effects/grouped.dm new file mode 100644 index 00000000000..b35ec7583af --- /dev/null +++ b/code/datums/status_effects/grouped.dm @@ -0,0 +1,121 @@ +/** + * ## Grouped Status Effects + * + * status effects that can track source. + * + * this and all subtypes have `source` as an argument on apply. + */ +/datum/status_effect/grouped + abstract_type = /datum/status_effect/grouped + /// sources list - associated to arbitrary values that evaluate to TRUE. + var/list/sources = list() + /// sources associated to time of expiry + var/list/expires = list() + /// sources associated to timerid + var/list/timers = list() + +/datum/status_effect/grouped/on_apply(source, value, duration, ...) + apply_source(source, value, duration) + return ..() + +/datum/status_effect/grouped/on_refreshed(old_timeleft, source, value, duration, ...) + apply_source(source, value, duration) + return ..() + +/datum/status_effect/grouped/rebuild_decay_timer() + return // we don't use this. + +/datum/status_effect/grouped/proc/has_source(source) + return !isnull(sources[source]) + +/datum/status_effect/grouped/proc/remove_source(source, expiring) + if(!has_source(source)) + return FALSE + var/old = sources[source] + sources -= source + if(expires[source]) + expires -= source + deltimer(timers[source]) + timers -= source + on_change(source, old, null) + if(!length(sources)) + qdel(src) + return TRUE + +/datum/status_effect/grouped/proc/apply_source(source, value, duration = src.duration) + // source can technically be any non-number value, but to enforce code durability + // we don't want any del'able reference types. + ASSERT(istext(source) && !isnull(value)) + var/old = sources[source] + sources[source] = value + var/old_expires = expires[source] + if(old_expires) + if((old_expires - world.time) < duration) + // refresh + deltimer(timers[source]) + expires[source] = world.time + duration + timers[source] = addtimer(CALLBACK(src, PROC_REF(remove_source), source, TRUE), duration, TIMER_STOPPABLE) + else if(old && (duration > 0)) + // didn't exist, set + expires[source] = world.time + duration + timers[source] = addtimer(CALLBACK(src, PROC_REF(remove_source), source, TRUE), duration, TIMER_STOPPABLE) + on_change(source, old, value) + +/datum/status_effect/grouped/proc/set_source(source, value, duration = src.duration) + // source can technically be any non-number value, but to enforce code durability + // we don't want any del'able reference types. + ASSERT(istext(source) && !isnull(value)) + var/old = sources[source] + sources[source] = value + var/old_expires = expires[source] + if(old_expires) + deltimer(timers[source]) + timers -= source + expires -= source + if(duration > 0) + expires[source] = world.time + duration + timers[source] = addtimer(CALLBACK(src, PROC_REF(remove_source), source, TRUE), duration, TIMER_STOPPABLE) + on_change(source, old, value) + +/** + * called on a change of source or value. + * + * @params + * * source - source + * * old_value - what value was before ; null if we're adding the source for the first time. + * * new_value - what value is now ; null if we're removing the source. + */ +/datum/status_effect/grouped/proc/on_change(source, old_value, new_value) + return + +//? Mob procs + +/** + * adds or contributes to a grouped status effect + * + * @params + * * source - source of application; must be text + * * value - metadata; must be non-null + * * duration - duration override, otherwise we use default of the path. + * + * @return effect datum + */ +/mob/proc/apply_grouped_effect(datum/status_effect/grouped/path, source, value, duration) + if(!ispath(path, /datum/status_effect/grouped)) + CRASH("[path] is not a grouped effect.") + ASSERT(istext(source) && !isnull(value)) + return apply_status_effect(path, additional = list(source, value)) + +/** + * removes a source from a grouped effect + * + * the effect is fully removed upon all sources being removed. + * + * @return TRUE if a source was removed + */ +/mob/proc/remove_grouped_effect(datum/status_effect/grouped/path, source) + if(!ispath(path, /datum/status_effect/grouped)) + CRASH("[path] is not a grouped effect.") + ASSERT(istext(source)) + var/datum/status_effect/grouped/effect = has_status_effect(path) + return effect.remove_source(source) diff --git a/code/datums/status_effects/grouped/crusher_mark.dm b/code/datums/status_effects/grouped/crusher_mark.dm new file mode 100644 index 00000000000..d5b31f425ff --- /dev/null +++ b/code/datums/status_effects/grouped/crusher_mark.dm @@ -0,0 +1,19 @@ +/datum/status_effect/grouped/crusher_mark + identifier = "crusher_mark" + duration = 300 //if you leave for 30 seconds you lose the mark, deal with it + var/mutable_appearance/marked_underlay + var/obj/item/kinetic_crusher/hammer_synced + +/datum/status_effect/grouped/crusher_mark/on_apply(obj/item/kinetic_crusher/new_hammer_synced, ...) + hammer_synced = new_hammer_synced + marked_underlay = mutable_appearance('icons/effects/effects.dmi', "shield2") + marked_underlay.pixel_x = -owner.pixel_x + marked_underlay.pixel_y = -owner.pixel_y + owner.underlays += marked_underlay + return ..() + +/datum/status_effect/grouped/crusher_mark/on_remove() + hammer_synced = null + owner.underlays -= marked_underlay + QDEL_NULL(marked_underlay) + return ..() diff --git a/code/datums/status_effects/stacking.dm b/code/datums/status_effects/stacking.dm new file mode 100644 index 00000000000..3e664369bdb --- /dev/null +++ b/code/datums/status_effects/stacking.dm @@ -0,0 +1,94 @@ +/** + * ## Stacking Status Effects + * + * able to track stacks. + * + * this and all subtypes have `stacks` as an argument on apply. + */ +/datum/status_effect/stacking + abstract_type = /datum/status_effect/stacking + + /// decay amount - this can be negative. + var/decay_amount = 1 + /// stacks + var/stacks = 1 + /// max stacks + var/max_stacks = INFINITY + /// default behavior: do we refresh decay timer to maximum (duration) when stacks increase from external sources? + var/stacking_resets_decay = TRUE + +/datum/status_effect/stacking/on_apply(stacks, ...) + src.stacks = isnull(stacks)? 1 : stacks + ASSERT(src.stacks > 0) + return ..() + +/datum/status_effect/stacking/decay() + adjust_stacks(decay_amount, TRUE) + if(!stacks) + return ..() + started = world.time + rebuild_decay_timer() + +/** + * called when stacks change + * when we're being removed, new_stacks is 0. + * + * @params + * * old_stacks - old stacks + * * new_stacks - new stacks + * * decayed - is this from decaying? + */ +/datum/status_effect/stacking/proc/on_stacks(old_stacks, new_stacks, decayed) + return + +/** + * called to modify stacks. + * + * @return stacks modified + */ +/datum/status_effect/stacking/proc/adjust_stacks(stacks, decaying) + var/old = src.stacks + src.stacks = clamp(src.stacks + stacks, 0, max_stacks) + on_stacks(old, src.stacks, decaying) + if(!decaying) + qdel(src) + return src.stacks - old + +//? Mob procs + +/** + * simple add or increment to stacks of a stacking effect + * + * maximum as well as the effect's maximum are both respected. + * + * @return stacks applied + */ +/mob/proc/apply_stacking_effect(datum/status_effect/stacking/path, stacks, maximum) + if(isnull(maximum)) + maximum = stacks // default no additional stacking + if(!ispath(path, /datum/status_effect/stacking)) + CRASH("[path] is not a stacking effect.") + stacks = min(stacks, maximum) // just in case + ASSERT(stacks > 0) + var/datum/status_effect/stacking/effect = has_status_effect(path) + if(isnull(effect)) + . = effect.adjust_stacks(clamp(stacks, 0, maximum - effect.stacks), FALSE) + else + effect = apply_status_effect(path, additional = list(stacks)) + . = effect.stacks + +/** + * simple decrement to stacks of a stacking effect + * + * @return stacks left + */ +/mob/proc/remove_stacking_effect(datum/status_effect/stacking/path, stacks) + if(!ispath(path, /datum/status_effect/stacking)) + CRASH("[path] is not a stacking effect.") + ASSERT(stacks > 0) + var/datum/status_effect/stacking/effect = has_status_effect(path) + if(isnull(effect)) + effect.adjust_stacks(-stacks, FALSE) + . = effect.stacks + else + return 0 diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index 704ac543ca0..e0980c2b8de 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -1,275 +1,235 @@ -//Status effects are used to apply temporary or permanent effects to mobs. Mobs are aware of their status effects at all times. -//This file contains their code, plus code for applying and removing them. -//When making a new status effect, add a define to status_effects.dm in __DEFINES for ease of use! - +/** + * ## Status Effects + * + * permanent / temporary tickable effects applied to mobs that are able to track + * instance data. + * + * each effect potentially has its own amount of variable arguments that + * can be passed into apply_status_effect. they will be detailed per-file. + */ /datum/status_effect - var/id = "effect" //Used for screen alerts. - var/duration = -1 //How long the status effect lasts in DECISECONDS. Enter -1 for an effect that never ends unless removed through some means. - var/tick_interval = 10 //How many deciseconds between ticks, approximately. Leave at 10 for every second. - var/next_tick //The scheduled time for the next tick. - var/mob/living/owner //The mob affected by the status effect. - var/on_remove_on_mob_delete = FALSE //if we call on_remove() when the mob is deleted - var/examine_text //If defined, this text will appear when the mob is examined - to use he, she etc. use "SUBJECTPRONOUN" and replace it in the examines themselves - var/alert_type = /atom/movable/screen/alert/status_effect //the alert thrown by the status effect, contains name and description - var/atom/movable/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists - /// How many of the effect can be on one mob, and what happens when you try to add another - var/status_type = STATUS_EFFECT_UNIQUE + abstract_type = /datum/status_effect + /// unique identifier + var/identifier = "effect" + /// duration in deciseconds - 0 for permanent. + var/duration + /// expiration timerid + var/decay_timer + /// start time - when refreshing we just bump this to world.time or something. + var/started + /// deciseconds per tick. null for no ticking. + var/tick_interval + /// next world.time we should tick. + var/tick_next + /// path of screen alert thrown + var/alert_type + /// screen alert instance if it exists + var/atom/movable/screen/alert/status_effect/alert_linked + /// mob we're affecting + var/mob/owner -/datum/status_effect/New(list/arguments) - on_creation(arglist(arguments)) - -/datum/status_effect/proc/on_creation(mob/living/new_owner, ...) - if(new_owner) - owner = new_owner - if(owner) - LAZYADD(owner.status_effects, src) - if(!owner || !on_apply()) - qdel(src) - return - if(duration != -1) - duration = world.time + duration - next_tick = world.time + tick_interval - // if(alert_type) - // var/atom/movable/screen/alert/status_effect/A = owner.throw_alert(id, alert_type) - // A.attached_effect = src //so the alert can reference us, if it needs to - // linked_alert = A //so we can reference the alert, if we need to - START_PROCESSING(SSstatus_effects, src) - return TRUE +/datum/status_effect/New(mob/owner, duration, list/arguments) + ASSERT(isnull(owner.status_effects[identifier])) + src.owner = owner + owner.status_effects[identifier] = src + if(!isnull(duration)) + src.duration = duration + started = world.time + rebuild_decay_timer() + on_apply(arglist(arguments)) /datum/status_effect/Destroy() - STOP_PROCESSING(SSstatus_effects, src) - if(owner) - // owner.clear_alert(id) - LAZYREMOVE(owner.status_effects, src) - on_remove() - owner = null + owner?.status_effects?.Remove(identifier) + on_remove() + owner = null + if(decay_timer) + deltimer(decay_timer) + decay_timer = null return ..() -/datum/status_effect/process() - if(!owner) - qdel(src) - return - if(next_tick < world.time) - tick() - next_tick = world.time + tick_interval - if(duration != -1 && duration < world.time) - qdel(src) - -/datum/status_effect/proc/on_apply() //Called whenever the buff is applied; returning FALSE will cause it to autoremove itself. - SHOULD_CALL_PARENT(TRUE) - return TRUE - -/datum/status_effect/proc/tick() //Called every tick. - -/datum/status_effect/proc/before_remove() //! Called before being removed; returning FALSE will cancel removal - return TRUE - -/datum/status_effect/proc/on_remove() //Called whenever the buff expires or is removed; do note that at the point this is called, it is out of the owner's status_effects but owner is not yet null - SHOULD_CALL_PARENT(TRUE) - return TRUE - -/datum/status_effect/proc/be_replaced() //Called instead of on_remove when a status effect is replaced by itself or when a status effect with on_remove_on_mob_delete = FALSE has its mob deleted - // owner.clear_alert(id) - LAZYREMOVE(owner.status_effects, src) - owner = null - qdel(src) - -/datum/status_effect/proc/refresh() - var/original_duration = initial(duration) - if(original_duration == -1) - return - duration = world.time + original_duration +/datum/status_effect/proc/tick(dt) + SHOULD_NOT_SLEEP(TRUE) /** - * Multiplied to clickdelays - */ -/datum/status_effect/proc/action_cooldown_mod() - return 1 + * decays - this *must* either delete ourselves or automatically reapply the decay timer! + */ +/datum/status_effect/proc/decay() + qdel(src) -//////////////// -// ALERT HOOK // -//////////////// +/** + * called on full removal + */ +/datum/status_effect/proc/on_remove() + SHOULD_CALL_PARENT(TRUE) + if(!isnull(tick_interval)) + SSstatus_effects.ticking -= src + +/** + * called after add + * + * @params + * * ... - rest of parameters from /mob/apply_status_effect() + */ +/datum/status_effect/proc/on_apply(...) + SHOULD_CALL_PARENT(TRUE) + if(!isnull(tick_interval)) + SSstatus_effects.ticking += src + +/** + * called on refresh + * + * @params + * * old_timeleft - old time remaining + * * ... - rest of parameters from /mob/apply_status_effect() or /datum/status_effect/refresh() + */ +/datum/status_effect/proc/on_refreshed(old_timeleft, ...) + return + +/** + * refreshes our duration + * + * if duration is supplied and it isn't necessary to refresh, on_refreshed is not called. + * + * @params + * * duration - if supplied, refreshes us to that long from now (if we weren't already at or above). otherwise, refreshes us to what current duration was from now. + * * ... - rest of parameters from /mob/apply_status_effect(), passed to on_refreshed. + * + * @return were we refreshed? + */ +/datum/status_effect/proc/refresh(duration, ...) + SHOULD_NOT_SLEEP(TRUE) + var/left = time_left() + if(isnull(duration)) + duration = src.duration + else if(duration < left) + return FALSE + set_duration_from_now(duration) + var/list/built = args.Copy() + built[1] = left + on_refreshed(arglist(built)) + return TRUE + +/datum/status_effect/proc/time_left() + return (started + duration) - world.time + +/datum/status_effect/proc/set_duration_from_apply(duration) + src.duration = duration + rebuild_decay_timer() + +/datum/status_effect/proc/set_duration_from_now(duration) + src.duration = duration + started = world.time + rebuild_decay_timer() + +/datum/status_effect/proc/adjust_duration(duration) + src.duration += duration + rebuild_decay_timer() + +/datum/status_effect/proc/set_tick_interval(interval) + var/was_ticking = !isnull(tick_interval) + tick_interval = interval + if(was_ticking && isnull(interval)) + SSstatus_effects.ticking -= src + else if(!was_ticking && !isnull(interval)) + SSstatus_effects.ticking += src + +/datum/status_effect/proc/rebuild_decay_timer() + if(decay_timer) + deltimer(decay_timer) + decay_timer = null + if(isnull(duration)) + return + var/time_left = time_left() + if(time_left <= 0) + decay() + return + decay_timer = addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/status_effect, decay)), time_left, TIMER_STOPPABLE) + +/datum/status_effect/vv_edit_var(var_name, var_value, mass_edit, raw_edit) + if(raw_edit) + return ..() + switch(var_name) + if(NAMEOF(src, tick_interval)) + set_tick_interval(var_value) + . = TRUE + if(.) + datum_flags |= DF_VAR_EDITED + return + . = ..() + if(!.) + return + switch(var_name) + if(NAMEOF(src, duration)) + rebuild_decay_timer() + +/datum/status_effect/proc/on_examine(list/examine_list) + return + +//? Mob procs + +/** + * applies a status effect to this mob + * + * if the status effect is already there, we will refresh it instead. + * + * @params + * * path - path to effect + * * duration - (optional) duration of effect; defaults to what the effect specifies. + * * list/additional - all further args passed to effect. + * + * @return effect datum created / refreshed / whatever, null on failure + */ +/mob/proc/apply_status_effect(datum/status_effect/path, duration, list/additional) + if(isnull(status_effects)) + status_effects = list() + var/id = initial(path.identifier) + if(status_effects[id]) + var/datum/status_effect/existing = status_effects[id] + var/list/built = additional?.Copy() || list() + built.Insert(1, duration) + existing.refresh(arglist(built)) + return existing + else + var/datum/status_effect/making = new path(src, duration, additional) + return making + +/** + * remove a status effect + * + * @params + * * path - path to effect + * * stacks - stacks to remove for grouped and stacking, default is all. + * + * @return stacks **left**. for single effects this is probably 0. + */ +/mob/proc/remove_status_effect(datum/status_effect/path, stacks = INFINITY, ...) + var/id = initial(path.identifier) + var/datum/status_effect/found = status_effects?[id] + if(isnull(found)) + return 0 + if(istype(found, /datum/status_effect/stacking)) + var/datum/status_effect/stacking/stacking = found + . = min(stacking.stacks, stacks) + stacking.adjust_stacks(-stacks, FALSE) + else + . = 1 + qdel(found) + +/** + * checks if we have a status effect + * + * @params + * * path - path to effect + * + * @return effect datum found or null + */ +/mob/proc/has_status_effect(datum/status_effect/path) + var/id = initial(path.identifier) + return LAZYACCESS(status_effects, id) + +//? Alert object /atom/movable/screen/alert/status_effect name = "Curse of Mundanity" desc = "You don't feel any different..." var/datum/status_effect/attached_effect - -////////////////// -// HELPER PROCS // -////////////////// - -/mob/living/proc/apply_status_effect(effect, ...) //applies a given status effect to this mob, returning the effect if it was successful - . = FALSE - var/datum/status_effect/S1 = effect - LAZYINITLIST(status_effects) - for(var/datum/status_effect/S in status_effects) - if(S.id == initial(S1.id) && S.status_type) - if(S.status_type == STATUS_EFFECT_REPLACE) - S.be_replaced() - else if(S.status_type == STATUS_EFFECT_REFRESH) - S.refresh() - return - else - return - var/list/arguments = args.Copy() - arguments[1] = src - S1 = new effect(arguments) - . = S1 - -/mob/living/proc/remove_status_effect(effect, ...) //removes all of a given status effect from this mob, returning TRUE if at least one was removed - . = FALSE - var/list/arguments = args.Copy(2) - if(status_effects) - var/datum/status_effect/S1 = effect - for(var/datum/status_effect/S in status_effects) - if(initial(S1.id) == S.id && S.before_remove(arguments)) - qdel(S) - . = TRUE - -/mob/living/proc/has_status_effect(effect) //returns the effect if the mob calling the proc owns the given status effect - . = FALSE - if(status_effects) - var/datum/status_effect/S1 = effect - for(var/datum/status_effect/S in status_effects) - if(initial(S1.id) == S.id) - return S - -/mob/living/proc/has_status_effect_list(effect) //returns a list of effects with matching IDs that the mod owns; use for effects there can be multiple of - . = list() - if(status_effects) - var/datum/status_effect/S1 = effect - for(var/datum/status_effect/S in status_effects) - if(initial(S1.id) == S.id) - . += S - -////////////////////// -// STACKING EFFECTS // -////////////////////// - -/datum/status_effect/stacking - id = "stacking_base" - duration = -1 //removed under specific conditions - alert_type = null - var/stacks = 0 //how many stacks are accumulated, also is # of stacks that target will have when first applied - var/delay_before_decay //deciseconds until ticks start occuring, which removes stacks (first stack will be removed at this time plus tick_interval) - tick_interval = 10 //deciseconds between decays once decay starts - var/stack_decay = 1 //how many stacks are lost per tick (decay trigger) - var/stack_threshold //special effects trigger when stacks reach this amount - var/max_stacks //stacks cannot exceed this amount - var/consumed_on_threshold = TRUE //if status should be removed once threshold is crossed - var/threshold_crossed = FALSE //set to true once the threshold is crossed, false once it falls back below - var/overlay_file - var/underlay_file - var/overlay_state // states in .dmi must be given a name followed by a number which corresponds to a number of stacks. put the state name without the number in these state vars - var/underlay_state // the number is concatonated onto the string based on the number of stacks to get the correct state name - var/mutable_appearance/status_overlay - var/mutable_appearance/status_underlay - -/datum/status_effect/stacking/proc/threshold_cross_effect() //what happens when threshold is crossed - -/datum/status_effect/stacking/proc/stacks_consumed_effect() //runs if status is deleted due to threshold being crossed - -/datum/status_effect/stacking/proc/fadeout_effect() //runs if status is deleted due to being under one stack - -/datum/status_effect/stacking/proc/stack_decay_effect() //runs every time tick() causes stacks to decay - -/datum/status_effect/stacking/proc/on_threshold_cross() - threshold_cross_effect() - if(consumed_on_threshold) - stacks_consumed_effect() - qdel(src) - -/datum/status_effect/stacking/proc/on_threshold_drop() - -/datum/status_effect/stacking/proc/can_have_status() - return owner.stat != DEAD - -/datum/status_effect/stacking/proc/can_gain_stacks() - return owner.stat != DEAD - -/datum/status_effect/stacking/tick() - if(!can_have_status()) - qdel(src) - else - add_stacks(-stack_decay) - stack_decay_effect() - -/datum/status_effect/stacking/proc/add_stacks(stacks_added) - if(stacks_added > 0 && !can_gain_stacks()) - return FALSE - owner.cut_overlay(status_overlay) - owner.underlays -= status_underlay - stacks += stacks_added - if(stacks > 0) - if(stacks >= stack_threshold && !threshold_crossed) //threshold_crossed check prevents threshold effect from occuring if changing from above threshold to still above threshold - threshold_crossed = TRUE - on_threshold_cross() - if(consumed_on_threshold) - return - else if(stacks < stack_threshold && threshold_crossed) - threshold_crossed = FALSE //resets threshold effect if we fall below threshold so threshold effect can trigger again - on_threshold_drop() - if(stacks_added > 0) - next_tick += delay_before_decay //refreshes time until decay - stacks = min(stacks, max_stacks) - status_overlay.icon_state = "[overlay_state][stacks]" - status_underlay.icon_state = "[underlay_state][stacks]" - owner.add_overlay(status_overlay) - owner.underlays += status_underlay - else - fadeout_effect() - qdel(src) //deletes status if stacks fall under one - -/datum/status_effect/stacking/on_creation(mob/living/new_owner, stacks_to_apply) - . = ..() - if(.) - add_stacks(stacks_to_apply) - -/datum/status_effect/stacking/on_apply() - if(!can_have_status()) - return FALSE - status_overlay = mutable_appearance(overlay_file, "[overlay_state][stacks]") - status_underlay = mutable_appearance(underlay_file, "[underlay_state][stacks]") - var/icon/I = icon(owner.icon, owner.icon_state, owner.dir) - var/icon_height = I.Height() - status_overlay.pixel_x = -owner.pixel_x - status_overlay.pixel_y = FLOOR(icon_height * 0.25, 1) - status_overlay.transform = matrix() * (icon_height/world.icon_size) //scale the status's overlay size based on the target's icon size - status_underlay.pixel_x = -owner.pixel_x - status_underlay.transform = matrix() * (icon_height/world.icon_size) * 3 - status_underlay.alpha = 40 - owner.add_overlay(status_overlay) - owner.underlays += status_underlay - return ..() - -/datum/status_effect/stacking/Destroy() - if(owner) - owner.cut_overlay(status_overlay) - owner.underlays -= status_underlay - QDEL_NULL(status_overlay) - return ..() - -/// Status effect from multiple sources, when all sources are removed, so is the effect -/datum/status_effect/grouped - status_type = STATUS_EFFECT_MULTIPLE //! Adds itself to sources and destroys itself if one exists already, there are never multiple - var/list/sources = list() - -/datum/status_effect/grouped/on_creation(mob/living/new_owner, source) - var/datum/status_effect/grouped/existing = new_owner.has_status_effect(type) - if(existing) - existing.sources |= source - qdel(src) - return FALSE - else - sources |= source - return ..() - -/datum/status_effect/grouped/before_remove(source) - sources -= source - return !length(sources) - -/// Gets and formats examine text associated with our status effect. -/// Return 'null' to have no examine text appear (default behavior). -/datum/status_effect/proc/get_examine_text() - return null diff --git a/code/game/area/area.dm b/code/game/area/area.dm index aae400472b9..6c218aceb9a 100644 --- a/code/game/area/area.dm +++ b/code/game/area/area.dm @@ -589,11 +589,11 @@ GLOBAL_LIST_EMPTY(forced_ambiance_list) if(H.species.species_flags & NO_SLIP)//diona and similar should not slip from moving onto space either. return if(H.m_intent == MOVE_INTENT_RUN) - H.AdjustStunned(6) - H.AdjustWeakened(6) + H.adjust_stunned(20 * 6) + H.adjust_paralyzed(20 * 6) else - H.AdjustStunned(3) - H.AdjustWeakened(3) + H.adjust_stunned(20 * 3) + H.adjust_paralyzed(20 * 3) to_chat(mob, "The sudden appearance of gravity makes you fall to the floor!") playsound(get_turf(src), "bodyfall", 50, 1) diff --git a/code/game/atoms/buckling.dm b/code/game/atoms/buckling.dm index 287afaced4a..32f3da64bee 100644 --- a/code/game/atoms/buckling.dm +++ b/code/game/atoms/buckling.dm @@ -183,11 +183,12 @@ LAZYINITLIST(buckled_mobs) buckled_mobs[M] = semantic M.setDir(dir) - M.update_canmove() + M.update_mobility() // todo: refactor the below M.update_floating(M.Check_Dense_Object()) if(isliving(M)) var/mob/living/L = M + L.update_lying() L.update_water() // end M.reset_pixel_shifting() @@ -217,11 +218,12 @@ M.buckled = null buckled_mobs -= M UNSETEMPTY(buckled_mobs) - M.update_canmove() + M.update_mobility() // todo: refactor the below M.update_floating(M.Check_Dense_Object()) if(isliving(M)) var/mob/living/L = M + L.update_lying() L.update_water() // end M.reset_pixel_offsets() @@ -308,7 +310,7 @@ SPAN_DANGER("[M] attempts to unbuckle themselves from [src]!"), SPAN_WARNING("You attempt to unbuckle yourself. (This will take a little bit and you need to stand still.)") ) - if(!do_after(M, buckle_restrained_resist_time, src, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY))) + if(!do_after(M, buckle_restrained_resist_time, src, mobility_flags = MOBILITY_CAN_RESIST)) return FALSE M.visible_message( SPAN_DANGER("[M] manages to unbuckle themselves."), @@ -375,7 +377,15 @@ * get the buckle_lying field for a given mob. */ /atom/movable/proc/buckle_lying(mob/M) - return buckle_lying + switch(buckle_lying) + if(null) // don't set + return null + if(0) // FALSE + return 0 + if(1) // true + return M.lying || pick(90, -90) // don't change if already lying + else + return buckle_lying // explicitly est //! mob stuff /** diff --git a/code/game/atoms/movable/movable.dm b/code/game/atoms/movable/movable.dm index e432654364d..a550990539f 100644 --- a/code/game/atoms/movable/movable.dm +++ b/code/game/atoms/movable/movable.dm @@ -189,7 +189,6 @@ if(locs && locs.len >= 2) // If something is standing on top of us, let them pass. if(mover.loc in locs) . = TRUE - return . //Overlays /atom/movable/overlay @@ -261,6 +260,7 @@ /atom/movable/proc/get_icon_scale_y() return icon_scale_y +// todo: refactor this shit /atom/movable/proc/update_transform() var/matrix/M = matrix() M.Scale(icon_scale_x, icon_scale_y) @@ -292,12 +292,6 @@ /atom/movable/proc/blood_act() // blood_act(null, 500, 50) -/** - * Sets our movement type. - */ -/atom/movable/proc/set_movement_type(new_movetype) - movement_type = new_movetype - /atom/movable/proc/Bump_vr(var/atom/A, yes) return diff --git a/code/game/atoms/movable/pulling.dm b/code/game/atoms/movable/pulling.dm index f933cbf9553..f02c792439f 100644 --- a/code/game/atoms/movable/pulling.dm +++ b/code/game/atoms/movable/pulling.dm @@ -41,6 +41,7 @@ AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once. pulling = AM AM.pulledby = src + AM.on_start_pulled_by(src) recursive_glidesize_update() if(ismob(AM)) @@ -55,11 +56,19 @@ * Stops pulling. Returns the object we "dropped" from our pull. */ /atom/movable/proc/stop_pulling() - if(pulling) - . = pulling - pulling.pulledby = null - pulling.reset_glide_size() - pulling = null + if(isnull(pulling)) + return + . = pulling + pulling.pulledby = null + pulling.reset_glide_size() + pulling.on_stop_pulled_by() + pulling = null + +/** + * stops a pull on ourselves + */ +/atom/movable/proc/break_pull() + pulledby?.stop_pulling() /** * Checks if a pull is valid. If it ain't, stop pulling. @@ -163,3 +172,15 @@ M.set_glide_size(glide_size, FALSE) ran[M] = TRUE updating = updating.pulling + +/** + * on start pull + */ +/atom/movable/proc/on_start_pulled_by(atom/movable/puller) + return + +/** + * on stop pull + */ +/atom/movable/proc/on_stop_pulled_by(atom/movable/puller) + return diff --git a/code/game/atoms/vv.dm b/code/game/atoms/vv.dm index 4f68044c6cc..e2a71bc0c16 100644 --- a/code/game/atoms/vv.dm +++ b/code/game/atoms/vv.dm @@ -159,6 +159,7 @@ set_armor(armor.overwritten(built)) log_admin("[key_name(usr)] modified the armor on [src] ([type]) to [armor.log_string()]") message_admins(SPAN_NOTICE("[key_name_admin(usr)] modified the armor on [src] ([type]) to [armor.log_string()]")) + // todo: proper tgui for armor mods /atom/vv_get_header() . = ..() diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm index f0a58cb4d18..d1f75215936 100644 --- a/code/game/dna/dna2_domutcheck.dm +++ b/code/game/dna/dna2_domutcheck.dm @@ -33,11 +33,11 @@ gene.activate(M,connected,flags) if(M) M.active_genes |= gene.type - M.update_icon = 1 + M.update_mutations() // If Gene is NOT active: else testing("[gene.name] deactivated!") gene.deactivate(M,connected,flags) if(M) M.active_genes -= gene.type - M.update_icon = 1 + M.update_mutations() diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index 0a699099519..2efcd3dc966 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -23,8 +23,8 @@ if (W==H.w_uniform) // will be teared continue H.drop_from_inventory(W) - M.transforming = 1 - M.canmove = 0 + M.transforming = TRUE + M.update_mobility() M.icon = null M.invisibility = 101 var/atom/movable/overlay/animation = new( M.loc ) @@ -91,8 +91,8 @@ if(!connected) for(var/obj/item/W in (Mo.contents-implants)) Mo.drop_from_inventory(W) - M.transforming = 1 - M.canmove = 0 + M.transforming = TRUE + M.update_mobility() M.icon = null M.invisibility = 101 var/atom/movable/overlay/animation = new( M.loc ) diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 2e608f28a47..0f829830332 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -172,7 +172,7 @@ M.mutations.Remove(MUTATION_HULK) M.update_mutations() //update our mutation overlays to_chat(M, SPAN_WARNING("You suddenly feel very weak.")) - M.Weaken(3) + M.afflict_paralyze(20 * 3) M.emote("collapse") /datum/gene/basic/xray diff --git a/code/game/gamemodes/changeling/powers/death_sting.dm b/code/game/gamemodes/changeling/powers/death_sting.dm deleted file mode 100644 index 9f27c2978ea..00000000000 --- a/code/game/gamemodes/changeling/powers/death_sting.dm +++ /dev/null @@ -1,23 +0,0 @@ -/datum/power/changeling/DeathSting - name = "Death Sting" - desc = "We silently sting a human, filling him with potent chemicals. His rapid death is all but assured." - ability_icon_state = "ling_sting_death" - genomecost = 10 - verbpath = /mob/proc/changeling_DEATHsting - -/mob/proc/changeling_DEATHsting() - set category = "Changeling" - set name = "Death Sting (40)" - set desc = "Causes spasms onto death." - - var/mob/living/carbon/T = changeling_sting(40,/mob/proc/changeling_DEATHsting) - if(!T) - return 0 - add_attack_logs(src,T,"Death sting (changeling)") - to_chat(T, "You feel a small prick and your chest becomes tight.") - T.silent = 10 - T.Unconscious(10) - T.make_jittery(100) - if(T.reagents) T.reagents.add_reagent("lexorin", 40) - feedback_add_details("changeling_powers","DTHS") - return 1 diff --git a/code/game/gamemodes/changeling/powers/epinephrine_overdose.dm b/code/game/gamemodes/changeling/powers/epinephrine_overdose.dm index 756e762f605..9ecf521ff10 100644 --- a/code/game/gamemodes/changeling/powers/epinephrine_overdose.dm +++ b/code/game/gamemodes/changeling/powers/epinephrine_overdose.dm @@ -30,11 +30,11 @@ var/mob/living/carbon/human/C = src to_chat(C, "Energy rushes through us. [C.lying ? "We arise." : ""]") C.set_stat(CONSCIOUS) - C.SetUnconscious(0) - C.SetStunned(0) - C.SetWeakened(0) + C.set_unconscious(0) + C.set_stunned(0) + C.set_paralyzed(0) C.lying = 0 - C.update_canmove() + C.update_mobility() // C.reagents.add_reagent("toxin", 10) C.reagents.add_reagent("epinephrine", 20) @@ -59,8 +59,8 @@ M.add_chemical_effect(CE_SPEEDBOOST, 3) M.ceiling_chemical_effect(CE_PAINKILLER, 60) M.adjustHalLoss(-30) - M.AdjustUnconscious(-2) - M.AdjustStunned(-2) - M.AdjustWeakened(-2) + M.adjust_unconscious(20 * -2) + M.adjust_stunned(20 * -2) + M.adjust_paralyzed(20 * -2) ..() return diff --git a/code/game/gamemodes/changeling/powers/fake_death.dm b/code/game/gamemodes/changeling/powers/fake_death.dm index c7b2e9f98ee..1054be6b503 100644 --- a/code/game/gamemodes/changeling/powers/fake_death.dm +++ b/code/game/gamemodes/changeling/powers/fake_death.dm @@ -26,7 +26,7 @@ return to_chat(C, "We will attempt to regenerate our form.") - C.update_canmove() + C.update_mobility() C.remove_changeling_powers() changeling.chem_charges -= CHANGELING_STASIS_COST diff --git a/code/game/gamemodes/changeling/powers/lesser_form.dm b/code/game/gamemodes/changeling/powers/lesser_form.dm index 36b3c549a35..cf301b6a33f 100644 --- a/code/game/gamemodes/changeling/powers/lesser_form.dm +++ b/code/game/gamemodes/changeling/powers/lesser_form.dm @@ -64,8 +64,8 @@ for (var/obj/item/implant/I in C) //Still preserving implants implants += I - C.transforming = 1 - C.canmove = 0 + C.transforming = TRUE + C.update_mobility() C.icon = null C.cut_overlays() C.invisibility = 101 diff --git a/code/game/gamemodes/changeling/powers/para_sting.dm b/code/game/gamemodes/changeling/powers/para_sting.dm index 98935ccd3eb..957c95d2430 100644 --- a/code/game/gamemodes/changeling/powers/para_sting.dm +++ b/code/game/gamemodes/changeling/powers/para_sting.dm @@ -14,6 +14,6 @@ return 0 add_attack_logs(src,T,"Paralysis sting (changeling)") to_chat(T, "Your muscles begin to painfully tighten.") - T.Weaken(20) + T.afflict_paralyze(20 * 20) feedback_add_details("changeling_powers","PS") return 1 diff --git a/code/game/gamemodes/changeling/powers/revive.dm b/code/game/gamemodes/changeling/powers/revive.dm index bd34b55995f..f2e2b36a4f2 100644 --- a/code/game/gamemodes/changeling/powers/revive.dm +++ b/code/game/gamemodes/changeling/powers/revive.dm @@ -21,9 +21,9 @@ C.setToxLoss(0) C.setOxyLoss(0) C.setCloneLoss(0) - C.SetUnconscious(0) - C.SetStunned(0) - C.SetWeakened(0) + C.set_unconscious(0) + C.set_stunned(0) + C.set_paralyzed(0) C.radiation = 0 C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss()) C.reagents.clear_reagents() @@ -33,7 +33,6 @@ H.restore_all_organs(ignore_prosthetic_prefs=1) //Covers things like fractures and other things not covered by the above. H.restore_blood() H.mutations.Remove(MUTATION_HUSK) - H.status_flags &= ~DISFIGURED H.update_icons_body() for(var/limb in H.organs_by_name) var/obj/item/organ/external/current_limb = H.organs_by_name[limb] @@ -51,7 +50,7 @@ C.halloss = 0 C.shock_stage = 0 //Pain to_chat(C, "We have regenerated.") - C.update_canmove() + C.update_mobility() C.mind.changeling.purchased_powers -= C feedback_add_details("changeling_powers","CR") C.set_stat(CONSCIOUS) diff --git a/code/game/gamemodes/changeling/powers/shriek.dm b/code/game/gamemodes/changeling/powers/shriek.dm index 0ba649e58f6..547b12acdce 100644 --- a/code/game/gamemodes/changeling/powers/shriek.dm +++ b/code/game/gamemodes/changeling/powers/shriek.dm @@ -72,7 +72,7 @@ if(issilicon(M)) SEND_SOUND(M, sound('sound/weapons/flash.ogg')) to_chat(M, "Auditory input overloaded. Reinitializing...") - M.Weaken(rand(5,10)) + M.afflict_paralyze(20 * rand(5,10)) affected += M for(var/obj/machinery/light/L in range(range, src)) diff --git a/code/game/gamemodes/cult/construct_spells.dm b/code/game/gamemodes/cult/construct_spells.dm index f5747c394f4..ab7b05f7afc 100644 --- a/code/game/gamemodes/cult/construct_spells.dm +++ b/code/game/gamemodes/cult/construct_spells.dm @@ -529,7 +529,7 @@ if(pre_shot_delay) var/image/target_image = image(icon = 'icons/obj/spells.dmi', loc = get_turf(hit_atom), icon_state = "target") SEND_IMAGE(user, target_image) - user.Stun(pre_shot_delay / 10) + user.afflict_stun(20 * pre_shot_delay / 10) sleep(pre_shot_delay) qdel(target_image) if(owner) @@ -657,7 +657,7 @@ var/mob/living/L = hit_atom L.visible_message("\The [user] [attack_message] \the [L], sending them flying!") playsound(src, "punch", 50, 1) - L.Weaken(2) + L.afflict_paralyze(20 * 2) L.adjustBruteLoss(rand(30, 50)) var/throwdir = get_dir(src, L) L.throw_at_old(get_edge_target_turf(L, throwdir), 3, 1, src) diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index aca2f88bb13..ebe367a9a70 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -30,7 +30,7 @@ to_chat(user, "An inexplicable force rips through your [affecting.name], tearing the sword from your grasp!") //random amount of damage between half of the blade's force and the full force of the blade. H.apply_damage(rand(damage_force/2, damage_force), BRUTE, zone, 0, sharp=1, edge=1) - H.Weaken(5) + H.afflict_paralyze(20 * 5) else if(!istype(user, /mob/living/simple_mob/construct)) to_chat(user, "An inexplicable force rips through you, tearing the sword from your grasp!") else diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index 18f1e5a32c9..be7ee616b79 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -76,7 +76,7 @@ var/global/list/narsie_list = list() /obj/singularity/narsie/mezzer() for(var/mob/living/carbon/M in oviewers(8, src)) if(M.stat == CONSCIOUS) - if(M.status_flags & GODMODE) + if(M.status_flags & STATUS_GODMODE) continue if(!iscultist(M)) to_chat(M, " You feel your sanity crumble away in an instant as you gaze upon [src.name]...") @@ -170,7 +170,7 @@ var/global/list/narsie_list = list() if (istype(A, /mob/) && (get_dist(A, src) <= 7)) var/mob/M = A - if(M.status_flags & GODMODE) + if(M.status_flags & STATUS_GODMODE) return 0 M.cultify() @@ -202,7 +202,7 @@ var/global/list/narsie_list = list() if (istype(A, /mob/living/)) var/mob/living/C2 = A - if(C2.status_flags & GODMODE) + if(C2.status_flags & STATUS_GODMODE) return 0 C2.dust() // Changed from gib(), just for less lag. @@ -234,7 +234,7 @@ var/global/list/narsie_list = list() if (istype(A, /mob/living/)) var/mob/living/C2 = A - if(C2.status_flags & GODMODE) + if(C2.status_flags & STATUS_GODMODE) return 0 C2.dust() // Changed from gib(), just for less lag. diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index acd457153ad..d2de722e778 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -315,7 +315,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," if(!ishuman(user)) return var/mob/living/carbon/human/H = user - if(!H.canmove || H.stat || H.restrained()) + if(!CHECK_MOBILITY(H, MOBILITY_CAN_USE)) return if(!cultwords["travel"]) runerandom() diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 4aa49dbea20..7c40a112941 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -471,7 +471,7 @@ var/list/sacrificed = list() chose_name = 1 break D.universal_speak = 1 - D.status_flags &= ~GODMODE + D.status_flags &= ~STATUS_GODMODE D.b_eyes = 200 D.r_eyes = 200 D.g_eyes = 200 @@ -1056,14 +1056,14 @@ var/list/sacrificed = list() C.flash_eyes() if(C.stuttering < 1 && (!(MUTATION_HULK in C.mutations))) C.stuttering = 1 - C.Weaken(1) - C.Stun(1) + C.afflict_paralyze(20 * 1) + C.afflict_stun(20 * 1) C.show_message("The rune explodes in a bright flash.", 3) add_attack_logs(usr,C,"Stun rune") else if(issilicon(L)) var/mob/living/silicon/S = L - S.Weaken(5) + S.afflict_paralyze(20 * 5) S.show_message("BZZZT... The rune has exploded in a bright flash.", 3) add_attack_logs(usr,S,"Stun rune") qdel(src) @@ -1078,15 +1078,15 @@ var/list/sacrificed = list() O.show_message(text("[] invokes a talisman at []", usr, T), 1) if(issilicon(T)) - T.Weaken(15) + T.afflict_paralyze(20 * 15) add_attack_logs(usr,T,"Stun rune") else if(iscarbon(T)) var/mob/living/carbon/C = T C.flash_eyes() if (!(MUTATION_HULK in C.mutations)) C.silent += 15 - C.Weaken(25) - C.Stun(25) + C.afflict_paralyze(20 * 25) + C.afflict_stun(20 * 25) add_attack_logs(usr,C,"Stun rune") return diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index 3a1ea713b4c..8f920f2e5e8 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -74,8 +74,7 @@ if ("Summon") for(var/mob/living/simple_mob/construct/shade/A in src) - A.status_flags &= ~GODMODE - A.canmove = 1 + A.status_flags &= ~STATUS_GODMODE to_chat(A, "You have been released from your prison, but you are still bound to [U.name]'s will. Help them suceed in their goals at all costs.") A.forceMove(U.loc) A.cancel_camera() @@ -133,8 +132,7 @@ var/mob/living/simple_mob/construct/shade/S = new /mob/living/simple_mob/construct/shade( T.loc ) S.forceMove(src) //put shade in stone - S.status_flags |= GODMODE //So they won't die inside the stone somehow - S.canmove = 0//Can't move out of the soul stone + S.status_flags |= STATUS_GODMODE //So they won't die inside the stone somehow S.name = "Shade of [T.real_name]" S.real_name = "Shade of [T.real_name]" S.icon = T.icon @@ -169,8 +167,7 @@ return T.forceMove(src) //put shade in stone - T.status_flags |= GODMODE - T.canmove = 0 + T.status_flags |= STATUS_GODMODE T.health = T.getMaxHealth() src.icon_state = "soulstone2" diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index 20386a6648f..7eaa9d5480d 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -112,7 +112,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked if(!istype(M.current,/mob/living)) continue if(M.current.stat!=2) - M.current.Weaken(10) + M.current.afflict_paralyze(20 * 10) M.current.flash_eyes() clear_antag_roles(M) diff --git a/code/game/gamemodes/technomancer/instability.dm b/code/game/gamemodes/technomancer/instability.dm index 64b3bc30304..f39cb1a26bc 100644 --- a/code/game/gamemodes/technomancer/instability.dm +++ b/code/game/gamemodes/technomancer/instability.dm @@ -242,7 +242,7 @@ if(1) visible_message("\The [src] suddenly collapses!", "You suddenly feel very light-headed, and faint!") - Unconscious(instability * 0.1) + afflict_unconscious(20 * instability * 0.1) if(2) if(can_feel_pain()) apply_effect(instability, AGONY) diff --git a/code/game/gamemodes/technomancer/spells/apportation.dm b/code/game/gamemodes/technomancer/spells/apportation.dm index 0050af09349..998ba0f432f 100644 --- a/code/game/gamemodes/technomancer/spells/apportation.dm +++ b/code/game/gamemodes/technomancer/spells/apportation.dm @@ -64,7 +64,7 @@ qdel(src) return - L.Weaken(3) + L.afflict_paralyze(20 * 3) user.visible_message("\The [user] seizes [L]!") var/obj/item/grab/G = new(user,L) diff --git a/code/game/gamemodes/technomancer/spells/audible_deception.dm b/code/game/gamemodes/technomancer/spells/audible_deception.dm index 43787309c55..43e684e4f09 100644 --- a/code/game/gamemodes/technomancer/spells/audible_deception.dm +++ b/code/game/gamemodes/technomancer/spells/audible_deception.dm @@ -83,13 +83,13 @@ for(var/mob/living/carbon/M in ohearers(6, T)) if(M.get_ear_protection() >= 2) continue - M.SetSleeping(0) + M.set_sleeping(0) M.stuttering += 20 M.ear_deaf += 30 - M.Weaken(3) + M.afflict_paralyze(20 * 3) if(prob(30)) - M.Stun(10) - M.Unconscious(4) + M.afflict_stun(20 * 10) + M.afflict_unconscious(20 * 4) else M.make_jittery(50) to_chat(M, "HONK") diff --git a/code/game/gamemodes/technomancer/spells/projectile/projectile.dm b/code/game/gamemodes/technomancer/spells/projectile/projectile.dm index bfc80c5c639..e3867ebb71b 100644 --- a/code/game/gamemodes/technomancer/spells/projectile/projectile.dm +++ b/code/game/gamemodes/technomancer/spells/projectile/projectile.dm @@ -32,7 +32,7 @@ if(pre_shot_delay) var/image/target_image = image(icon = 'icons/obj/spells.dmi', loc = get_turf(hit_atom), icon_state = "target") SEND_IMAGE(user, target_image) - user.Stun(pre_shot_delay / 10) + user.afflict_stun(20 * pre_shot_delay / 10) sleep(pre_shot_delay) qdel(target_image) if(owner) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index fb74e454e37..20f0994585e 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -367,7 +367,7 @@ if(temp_apc && temp_apc.terminal && temp_apc.terminal.powernet) temp_apc.terminal.powernet.trigger_warning() - if(user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return 1 return 0 diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 811fed49874..5efd47539ee 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -285,8 +285,8 @@ occupantData["radLoss"] = H.radiation occupantData["cloneLoss"] = H.getCloneLoss() occupantData["brainLoss"] = H.getBrainLoss() - occupantData["paralysis"] = H.paralysis - occupantData["paralysisSeconds"] = round(H.paralysis / 4) + occupantData["paralysis"] = H.is_unconscious() + occupantData["paralysisSeconds"] = round(H.is_unconscious()?.time_left() / 10) occupantData["bodyTempC"] = H.bodytemperature-T0C occupantData["bodyTempF"] = (((H.bodytemperature-T0C) * 1.8) + 32) @@ -472,7 +472,7 @@ extra_font = "" dat += "[extra_font]\tApprox. Brain Damage %: [occupant.getBrainLoss()]
" - dat += "Paralysis Summary %: [occupant.paralysis] ([round(occupant.paralysis / 4)] seconds left!)
" + dat += "Paralysis Summary: [round(occupant.is_unconscious()?.time_left() / 10)] seconds left!)
" dat += "Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)
" dat += "
" diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 88f5a72be48..9db9d330bda 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -114,10 +114,10 @@ // Get the clone body ready H.adjustCloneLoss(150) // New damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite - H.Unconscious(4) + H.afflict_unconscious(20 * 4) // Here let's calculate their health so the pod doesn't immediately eject them!!! - H.updatehealth() + H.update_health() clonemind.transfer(H) H.ckey = R.ckey @@ -186,7 +186,7 @@ return else if(occupant.health < heal_level && occupant.getCloneLoss() > 0) - occupant.Unconscious(4) + occupant.afflict_unconscious(20 * 4) //Slowly get that clone healed and finished. occupant.adjustCloneLoss(-2 * heal_rate) @@ -197,7 +197,7 @@ //So clones don't die of oxyloss in a running pod. if(occupant.reagents.get_reagent_amount("inaprovaline") < 30) occupant.reagents.add_reagent("inaprovaline", 60) - occupant.Sleeping(30) + occupant.afflict_sleeping(20 * 30) //Also heal some oxyloss ourselves because inaprovaline is so bad at preventing it!! occupant.adjustOxyLoss(-4) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index d74d698e305..94e50904ced 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -78,7 +78,7 @@ occupantData["oxyLoss"] = occupant.getOxyLoss() occupantData["toxLoss"] = occupant.getToxLoss() occupantData["fireLoss"] = occupant.getFireLoss() - occupantData["paralysis"] = occupant.paralysis + occupantData["paralysis"] = round(occupant.is_unconscious()?.time_left() / 10) / 2 occupantData["hasBlood"] = 0 occupantData["bodyTemperature"] = occupant.bodytemperature occupantData["maxTemp"] = 1000 // If you get a burning vox armalis into the sleeper, congratulations diff --git a/code/game/machinery/computer/arcade/orion_event.dm b/code/game/machinery/computer/arcade/orion_event.dm index 440bbd27dc5..c2e076b7e49 100644 --- a/code/game/machinery/computer/arcade/orion_event.dm +++ b/code/game/machinery/computer/arcade/orion_event.dm @@ -290,11 +290,11 @@ if(severity == 2) to_chat(usr, "You suddenly feel extremely nauseated and hunch over until it passes.") //gamer.adjust_disgust(110) - gamer.Stun(60) + gamer.afflict_stun(20 * 60) if(severity >= 3) //you didn't pray hard enough to_chat(gamer, "An overpowering wave of nausea consumes over you. You hunch over, your stomach's contents preparing for a spectacular exit.") //gamer.adjust_disgust(150) //max this bitch out so they barf a lot - gamer.Stun(100) + gamer.afflict_stun(20 * 100) */ #define BUTTON_KEEP_SPEED "Keep Speed" #define BUTTON_SLOW_DOWN "Slow Down" @@ -438,7 +438,7 @@ if(game.obj_flags & EMAGGED) playsound(game.loc, 'sound/effects/supermatter.ogg', 100, TRUE) game.say("A miniature black hole suddenly appears in front of [game], devouring [gamer] alive!") - gamer.Stun(200, ignore_canstun = TRUE) //you can't run :^) + gamer.afflict_stun(20 * 200, ignore_canstun = TRUE) //you can't run :^) var/black_hole = new /obj/singularity/academy(gamer.loc) addtimer(CALLBACK(game, /atom/movable/proc/say, "[black_hole] winks out, just as suddenly as it appeared."), 50) QDEL_IN(black_hole, 5 SECONDS) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index ea488475f0a..8d9c41dc0ad 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -8,7 +8,6 @@ light_color = "#a91515" circuit = /obj/item/circuitboard/security - var/mapping = 0//For the overview file, interesting bit of code. var/list/network = list() var/datum/tgui_module_old/camera/camera diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 22b551cc206..0e6de4e1690 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -231,8 +231,8 @@ occupant.set_stat(UNCONSCIOUS) occupant.dir = SOUTH if(occupant.bodytemperature < T0C) - occupant.Sleeping(max(5, (1/occupant.bodytemperature)*2000)) - occupant.Unconscious(max(5, (1/occupant.bodytemperature)*3000)) + occupant.afflict_sleeping(20 * max(5, (1/occupant.bodytemperature)*2000)) + occupant.afflict_unconscious(20 * max(5, (1/occupant.bodytemperature)*3000)) if(air_contents.gas[/datum/gas/oxygen] > 2) if(occupant.getOxyLoss()) occupant.adjustOxyLoss(-1) else @@ -307,7 +307,7 @@ return M.forceMove(src) M.ExtinguishMob() - if(M.health > -100 && (M.health < 0 || M.sleeping)) + if(!IS_DEAD(M)) to_chat(M, SPAN_USERDANGER("You feel a cold liquid surround you. Your skin starts to freeze up.")) occupant = M occupant.update_perspective() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index eb0102b8bb4..f14c7360ab6 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -308,7 +308,7 @@ /obj/machinery/cryopod/Destroy() if(occupant) occupant.forceMove(loc) - occupant.resting = 1 + occupant.update_perspective() return ..() /obj/machinery/cryopod/Initialize(mapload) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 21fe6bca5de..14899a2b549 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -650,7 +650,7 @@ About the new airlock wires panel: else if(user.hallucination > 50 && prob(10) && src.operating == 0) to_chat(user, "You feel a powerful shock course through your body!") user.halloss += 10 - user.stunned += 10 + user.afflict_stun(5 SECONDS) return ..(user) @@ -1330,8 +1330,8 @@ About the new airlock wires panel: /mob/living/airlock_crush(var/crush_damage) . = ..() adjustBruteLoss(crush_damage) - SetStunned(5) - SetWeakened(5) + set_stunned(20 * 5) + set_paralyzed(20 * 5) var/turf/T = get_turf(src) T.add_blood(src) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 6f84e1239fc..1644ad5ddcf 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -91,7 +91,7 @@ if(!O.blinded && isliving(O)) var/mob/living/L = O L.flash_eyes() - O.Weaken(flash_time) + O.afflict_paralyze(20 * flash_time) /obj/machinery/flasher/emp_act(severity) if(machine_stat & (BROKEN|NOPOWER)) diff --git a/code/game/machinery/holopad.dm b/code/game/machinery/holopad.dm index d90dbca3b56..1a8dd034a08 100644 --- a/code/game/machinery/holopad.dm +++ b/code/game/machinery/holopad.dm @@ -960,6 +960,7 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE) return FALSE remoting = user RegisterSignal(remoting, COMSIG_MOB_RESET_PERSPECTIVE, .proc/cleanup_remote_presence) + RegisterSignal(remoting, COMSIG_MOB_ITEM_EQUIPPED, .proc/on_item_equipped) action_hang_up.grant(remoting) action_swap_view.grant(remoting) if(isAI(user)) @@ -979,10 +980,17 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE) hologram_last_move = world.time hologram.hologram_step(dir) +/datum/holocall/proc/on_item_equipped(mob/source) + if(source != remoting) + UnregisterSignal(source, COMSIG_MOB_ITEM_EQUIPPED) + CRASH("how") + hologram.from_appearance(remoting) + /datum/holocall/proc/cleanup_remote_presence() if(!remoting) return UnregisterSignal(remoting, COMSIG_MOB_RESET_PERSPECTIVE) + UnregisterSignal(remoting, COMSIG_MOB_ITEM_EQUIPPED) remoting.unshunt_perspective() remoting.clear_movement_intercept() action_hang_up.remove(remoting) @@ -1043,12 +1051,8 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE) cleanup_remote_presence() /datum/holocall/proc/check_remoting() - if(!IS_CONSCIOUS(remoting)) + if(remoting?.loc != source.loc) return FALSE - if(remoting.lying) - return FALSE - if(remoting.stunned) - return TRUE return TRUE /datum/holocall/proc/check() @@ -1283,7 +1287,7 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE) return FALSE playsound('sound/effects/stealthoff.ogg', 50, 0) vored.forceMove(drop_location()) - vored.Weaken(1) + vored.afflict_paralyze(20) visible_message(SPAN_BOLDWARNING("[vored] flops out of [src].")) vored = null pass_flags = initial(pass_flags) diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index 109988acaaa..0a2bb00449c 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -239,13 +239,13 @@ //for(var/mob/living/carbon/M in ohearers(6, src)) //if(M.get_ear_protection() >= 2) //continue - //M.SetSleeping(0) + //M.set_sleeping(0) //M.stuttering += 20 //M.ear_deaf += 30 - //M.Weaken(3) + //M.afflict_paralyze(20 * 3) //if(prob(30)) - //M.Stun(10) - //M.Unconscious(4) + //M.afflict_stun(20 * 10) + //M.afflict_unconscious(20 * 4) //else //M.make_jittery(500) //spawn(15) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 7b33f104326..ea0d046fbd4 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -216,7 +216,7 @@ var/bomb_set set name = "Make Deployable" set src in oview(1) - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return if(!ishuman(usr)) to_chat(usr, "You don't have the dexterity to do this!") @@ -232,7 +232,7 @@ var/bomb_set /obj/machinery/nuclearbomb/Topic(href, href_list) ..() - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) usr.set_machine(src) diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm deleted file mode 100644 index 0a8d18ab296..00000000000 --- a/code/game/machinery/overview.dm +++ /dev/null @@ -1,337 +0,0 @@ -//#define AMAP -/obj/machinery/computer/security/verb/station_map() - set name = ".map" - set category = "Object" - set src in oview(1) - set hidden = TRUE - - usr.set_machine(src) - if(!mapping) return - log_game("[usr]([usr.key]) used station map L[z] in [src.loc.loc]") - drawmap(usr) - -/obj/machinery/computer/security/proc/drawmap(mob/user) - - var/icx = round(world.maxx/16) + 1 - var/icy = round(world.maxy/16) + 1 - - var/xoff = round((icx*16-world.maxx)-2) - var/yoff = round((icy*16-world.maxy)-2) - - var/icount = icx * icy - - var/list/imap = list() - -#ifdef AMAP - - for(var/i = 0; i 1 || get_dist(src,pipe) > 1 ) diff --git a/code/game/machinery/virtual_reality/ar_console.dm b/code/game/machinery/virtual_reality/ar_console.dm index a1f8ac68bde..7f5f2ee44bc 100644 --- a/code/game/machinery/virtual_reality/ar_console.dm +++ b/code/game/machinery/virtual_reality/ar_console.dm @@ -97,7 +97,7 @@ avatar = new(src, produce_species) if(occupant.species.get_species_id() != SPECIES_ID_PROMETHEAN && occupant.species.get_species_id() != SPECIES_ID_HUMAN && mirror_first_occupant) avatar.shapeshifter_change_shape(occupant.species.name) - avatar.Sleeping(6) + avatar.afflict_sleeping(20 * 6) occupant.enter_vr(avatar) diff --git a/code/game/machinery/virtual_reality/vr_console.dm b/code/game/machinery/virtual_reality/vr_console.dm index 35a3ad2b18b..af3c6e3cd98 100644 --- a/code/game/machinery/virtual_reality/vr_console.dm +++ b/code/game/machinery/virtual_reality/vr_console.dm @@ -244,7 +244,7 @@ if(occupant.species.get_species_id() != SPECIES_ID_PROMETHEAN && occupant.species.get_species_id() != SPECIES_ID_HUMAN && mirror_first_occupant) avatar.shapeshifter_change_shape(occupant.species.name) avatar.forceMove(get_turf(S)) // Put the mob on the landmark, instead of inside it - avatar.Sleeping(1) + avatar.afflict_sleeping(20 * 1) occupant.enter_vr(avatar) diff --git a/code/game/machinery/vitals_monitor.dm b/code/game/machinery/vitals_monitor.dm index 810469e3ea1..13ced32d34f 100644 --- a/code/game/machinery/vitals_monitor.dm +++ b/code/game/machinery/vitals_monitor.dm @@ -37,7 +37,7 @@ var/brain_activity = "none" var/breathing = "none" - if(victim.stat != DEAD && !(victim.status_flags & FAKEDEATH)) + if(victim.stat != DEAD && !(victim.status_flags & STATUS_FAKEDEATH)) var/obj/item/organ/internal/brain/brain = victim.internal_organs_by_name[O_BRAIN] if(istype(brain)) if(victim.getBrainLoss()) @@ -107,7 +107,7 @@ add_overlay("pulse_warning") var/obj/item/organ/internal/brain/brain = victim.internal_organs_by_name[O_BRAIN] - if(istype(brain) && victim.stat != DEAD && !(victim.status_flags & FAKEDEATH)) + if(istype(brain) && victim.stat != DEAD && !(victim.status_flags & STATUS_FAKEDEATH)) if(victim.getBrainLoss()) add_overlay("brain_verybad") add_overlay("brain_warning") @@ -119,7 +119,7 @@ add_overlay("brain_warning") var/obj/item/organ/internal/lungs/lungs = victim.internal_organs_by_name[O_LUNGS] - if(istype(lungs) && victim.stat != DEAD && !(victim.status_flags & FAKEDEATH)) + if(istype(lungs) && victim.stat != DEAD && !(victim.status_flags & STATUS_FAKEDEATH)) var/oxyloss = victim.getOxyLoss() if(oxyloss > 50) add_overlay("breathing_shallow") diff --git a/code/game/machinery/vr_console.dm b/code/game/machinery/vr_console.dm index c75339692c9..6ae30bbb571 100644 --- a/code/game/machinery/vr_console.dm +++ b/code/game/machinery/vr_console.dm @@ -205,7 +205,7 @@ if(occupant.species.get_species_id() != SPECIES_ID_PROMETHEAN && occupant.species.get_species_id() != SPECIES_ID_HUMAN) avatar.shapeshifter_change_shape(occupant.species.name) avatar.forceMove(get_turf(S)) // Put the mob on the landmark, instead of inside it - avatar.Sleeping(1) + avatar.afflict_sleeping(20 * 1) occupant.enter_vr(avatar) diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index ed3e10beef2..6b042ee87a7 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -64,7 +64,7 @@ var/update = 0 switch(damtype) if("brute") - H.Unconscious(1) + H.afflict_unconscious(20 * 1) update |= temp.take_damage(rand(force/2, force), 0) if("fire") update |= temp.take_damage(0, rand(force/2, force)) @@ -79,12 +79,12 @@ else return if(update) H.UpdateDamageIcon() - H.updatehealth() + H.update_health() else switch(damtype) if("brute") - M.Unconscious(1) + M.afflict_unconscious(20 * 1) M.take_overall_damage(rand(force/2, force)) if("fire") M.take_overall_damage(0, rand(force/2, force)) @@ -96,7 +96,7 @@ M.reagents.add_reagent("cryptobiolin", force) else return - M.updatehealth() + M.update_health() src.occupant_message("You hit [T].") src.visible_message("[src.name] hits [T].") else diff --git a/code/game/mecha/equipment/tools/clamp.dm b/code/game/mecha/equipment/tools/clamp.dm index 43084dd1553..9ba0167c1ac 100644 --- a/code/game/mecha/equipment/tools/clamp.dm +++ b/code/game/mecha/equipment/tools/clamp.dm @@ -98,7 +98,7 @@ if(chassis.occupant.a_intent == INTENT_HARM || istype(chassis.occupant,/mob/living/carbon/brain)) //No tactile feedback for brains M.take_overall_damage(dam_force) M.adjustOxyLoss(round(dam_force/2)) - M.updatehealth() + M.update_health() occupant_message("You squeeze [target] with [src.name]. Something cracks.") playsound(src, "fracture", 5, 1, -2) //CRACK chassis.visible_message("[chassis] squeezes [target].") @@ -106,7 +106,7 @@ playsound(src, 'sound/mecha/hydraulic.ogg', 10, 1, -2) M.take_overall_damage(dam_force/2) M.adjustOxyLoss(round(dam_force/3)) - M.updatehealth() + M.update_health() occupant_message("You slam [target] with [src.name]. Something cracks.") playsound(src, "fracture", 3, 1, -2) //CRACK 2 chassis.visible_message("[chassis] slams [target].") diff --git a/code/game/mecha/equipment/tools/passenger.dm b/code/game/mecha/equipment/tools/passenger.dm index e133e5a72eb..6f44e5a0cce 100644 --- a/code/game/mecha/equipment/tools/passenger.dm +++ b/code/game/mecha/equipment/tools/passenger.dm @@ -26,7 +26,7 @@ if (chassis) chassis.visible_message("[user] starts to climb into [chassis].") - if(do_after(user, 40, needhand=0)) + if(do_after(user, 40, chassis, DO_AFTER_IGNORE_ACTIVE_ITEM)) if(!src.occupant) //? WARNING WARNING SHITCODE ALERT //? BYOND WILL REFUSE TO PROPERLY UPDATE STUFF IF WE MOVE IN IMMEDIATELY diff --git a/code/game/mecha/equipment/tools/sleeper.dm b/code/game/mecha/equipment/tools/sleeper.dm index 74060eb8431..c6dc5200aec 100644 --- a/code/game/mecha/equipment/tools/sleeper.dm +++ b/code/game/mecha/equipment/tools/sleeper.dm @@ -233,13 +233,13 @@ return if(M.health > 0) M.adjustOxyLoss(-1) - M.updatehealth() - M.AdjustStunned(-4) - M.AdjustWeakened(-4) - M.AdjustStunned(-4) - M.Unconscious(2) - M.Weaken(2) - M.Stun(2) + M.update_health() + M.adjust_stunned(20 * -4) + M.adjust_paralyzed(20 * -4) + M.adjust_stunned(20 * -4) + M.afflict_unconscious(20 * 2) + M.afflict_paralyze(20 * 2) + M.afflict_stun(20 * 2) if(M.reagents.get_reagent_amount("inaprovaline") < 5) M.reagents.add_reagent("inaprovaline", 5) S.chassis.use_power(S.energy_drain) diff --git a/code/game/mecha/equipment/weapons/honk.dm b/code/game/mecha/equipment/weapons/honk.dm index cd81bffb345..0cda1685441 100644 --- a/code/game/mecha/equipment/weapons/honk.dm +++ b/code/game/mecha/equipment/weapons/honk.dm @@ -26,11 +26,11 @@ return to_chat(M, "Your ears feel like they're bleeding!") playsound(M, 'sound/items/airhorn.ogg', 100, 1, 30) - M.SetSleeping(0) + M.set_sleeping(0) M.ear_deaf += 30 M.ear_damage += rand(5, 20) - M.Weaken(3) - M.Stun(5) + M.afflict_paralyze(20 * 3) + M.afflict_stun(20 * 5) chassis.use_power(energy_drain) log_message("Used a sound emission device.") do_after_cooldown() diff --git a/code/game/mecha/equipment/weapons/reticent.dm b/code/game/mecha/equipment/weapons/reticent.dm index 30cad526eea..c6c95737a93 100644 --- a/code/game/mecha/equipment/weapons/reticent.dm +++ b/code/game/mecha/equipment/weapons/reticent.dm @@ -18,7 +18,7 @@ if(chassis.occupant.a_intent == INTENT_HARM || istype(chassis.occupant,/mob/living/carbon/brain)) //No tactile feedback for brains M.apply_damage(dam_force, BRUTE) M.adjustOxyLoss(round(dam_force/2)) - M.updatehealth() + M.update_health() occupant_message("You pierce [target] with [src.name]. The blade goes all the way through.") playsound(src, 'sound/weapons/slice.ogg', 5, 1, -2) //Whisper quiet. chassis.visible_message("[chassis] stabs [target].") @@ -26,7 +26,7 @@ playsound(src, 'sound/weapons/punchmiss.ogg', 10, 1, -2) M.apply_damage(dam_force/2, BRUTE) M.adjustOxyLoss(round(dam_force/3)) - M.updatehealth() + M.update_health() occupant_message("You slaps [target] with the flat of [src.name]. Something cracks.") playsound(src, "fracture", 3, 1, -2) //CRACK 2 chassis.visible_message("[chassis] slaps [target].") @@ -83,7 +83,7 @@ if(chassis.occupant.a_intent == INTENT_HARM || istype(chassis.occupant,/mob/living/carbon/brain)) //No tactile feedback for brains M.apply_damage(dam_force, BURN) M.adjust_fire_stacks(1) - M.updatehealth() + M.update_health() occupant_message("You pierce [target] with [src.name]. The blade goes all the way through.") playsound(src, 'sound/weapons/blade1.ogg', 5, 1, -2) //Whisper quiet. chassis.visible_message("[chassis] stabs [target].") @@ -91,7 +91,7 @@ playsound(src, 'sound/weapons/punchmiss.ogg', 10, 1, -2) M.apply_damage(dam_force/2, BRUTE) M.adjustOxyLoss(round(dam_force/3)) - M.updatehealth() + M.update_health() occupant_message("You slaps [target] with the flat of [src.name]. Something cracks.") playsound(src, "fracture", 3, 1, -2) //CRACK 2 chassis.visible_message("[chassis] slaps [target].") diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 051c6d2aa31..b5816ce7636 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -431,7 +431,7 @@ for(var/i = 0, i[user] hits [src] with [W].") user.visible_message("[user] hits [src] with [W].", "You hit [src] with [W].") - src.take_damage(W.damage_force,W.damtype) + src.take_damage(W.force,W.damtype) src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) */ return @@ -1603,7 +1603,7 @@ occupant = brainmob brainmob.forceMove(src) brainmob.reset_perspective(src) - brainmob.canmove = 1 + brainmob.mobility_flags = MOBILITY_FLAGS_DEFAULT mmi_as_oc.mecha = src add_obj_verb(src, /obj/mecha/verb/eject) src.Entered(mmi_as_oc) @@ -1986,7 +1986,7 @@ if(mmi.brainmob) occupant.forceMove(mmi) mmi.mecha = null - occupant.canmove = 0 + occupant.mobility_flags = NONE occupant.clear_alert("charge") occupant.clear_alert("mech damage") occupant.in_enclosed_vehicle = 0 @@ -2563,7 +2563,7 @@ O.fireloss = AI.getFireLoss() O.bruteloss = AI.getBruteLoss() O.toxloss = AI.toxloss - O.updatehealth() + O.update_health() src.occupant = O if(AI.mind) AI.mind.transfer(O) @@ -2581,7 +2581,7 @@ AI.fireloss = O.getFireLoss() AI.bruteloss = O.getBruteLoss() AI.toxloss = O.toxloss - AI.updatehealth() + AI.update_health() qdel(O) if (!AI.stat) AI.icon_state = "ai" diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 0160a522890..b5094733b3b 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -107,7 +107,7 @@ holder.icon_state = RoundHealth((patient.health-config.health_threshold_crit)/(patient.getMaxHealth()-config.health_threshold_crit)*100) C.images += holder - holder = patient.hud_list[STATUS_HUD] + holder = patient.hud_list[BIOLOGY_HUD] if(patient.isSynthetic()) holder.icon_state = "hudrobo" else if(patient.stat == DEAD) diff --git a/code/game/mecha/micro/micro.dm b/code/game/mecha/micro/micro.dm index a7cef04e255..404d14b656d 100644 --- a/code/game/mecha/micro/micro.dm +++ b/code/game/mecha/micro/micro.dm @@ -63,12 +63,12 @@ else return if(update) H.UpdateDamageIcon() - H.updatehealth() + H.update_health() else switch(damtype) if("brute") - M.Unconscious(1) + M.afflict_unconscious(20 * 1) M.take_overall_damage(rand(force/2, force)) if("fire") M.take_overall_damage(0, rand(force/2, force)) @@ -80,7 +80,7 @@ M.reagents.add_reagent("cryptobiolin", force) else return - M.updatehealth() + M.update_health() src.occupant_message("You hit [target].") src.visible_message("[src.name] hits [target].") else diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index ded7b19719f..63f4f1de58f 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -501,7 +501,7 @@ steam.start() -- spawns the effect for(var/mob/M in viewers(1, location)) if (prob (50 * amount)) to_chat(M, "The explosion knocks you down.") - M.Weaken(rand(1,5)) + M.afflict_paralyze(20 * rand(1,5)) return else var/devst = -1 diff --git a/code/game/objects/effects/map_effects/portal.dm b/code/game/objects/effects/map_effects/portal.dm index 2c8f335db26..2dcbb5887f5 100644 --- a/code/game/objects/effects/map_effects/portal.dm +++ b/code/game/objects/effects/map_effects/portal.dm @@ -88,21 +88,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec /obj/effect/map_effect/portal/proc/go_through_portal(atom/movable/AM, check) if(AM.loc != loc && check) return - // TODO: Find a way to fake the glide or something. - if(isliving(AM)) - var/mob/living/L = AM - if(L.pulling) - var/atom/movable/pulled = L.pulling - L.stop_pulling() - // For some reason, trying to put the pulled object behind the person makes the drag stop and it doesn't even move to the other side. - // pulled.forceMove(get_turf(counterpart)) - pulled.forceMove(counterpart.get_focused_turf()) - L.forceMove(counterpart.get_focused_turf()) - L.start_pulling(pulled) - else - L.forceMove(counterpart.get_focused_turf()) - else - AM.forceMove(counterpart.get_focused_turf()) + AM.locationTransitForceMove(counterpart.get_focused_turf()) // 'Focused turf' is the turf directly in front of a portal, // and it is used both as the destination when crossing, as well as the PoV for visuals. diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 56783531d68..f4868b547b2 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -95,7 +95,7 @@ s.set_up(3, 1, src) s.start() if(M) - M.Stun(30) + M.afflict_stun(20 * 30) visible_message("\The [src.name] flashes violently before disintegrating!") spawn(0) qdel(s) diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index f61cfc17c2f..70aee8bbc71 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -54,7 +54,8 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 0 + ADD_TRAIT(M, TRAIT_MOBILITY_MOVE_BLOCKED, "__THROWER__") + M.update_mobility_blocked() affecting.Add(AM) while(AM && !stopthrow) @@ -90,8 +91,9 @@ if(ismob(AM)) var/mob/M = AM + REMOVE_TRAIT(M, TRAIT_MOBILITY_MOVE_BLOCKED, "__THROWER__") if(immobilize) - M.canmove = 1 + M.update_mobility_blocked() /* Stops things thrown by a thrower, doesn't do anything */ diff --git a/code/game/objects/effects/traps.dm b/code/game/objects/effects/traps.dm index 399ea76ac78..f186c216c25 100644 --- a/code/game/objects/effects/traps.dm +++ b/code/game/objects/effects/traps.dm @@ -280,7 +280,7 @@ Add those other swinging traps you mentioned above! var/mob/living/M = AM var/damage = rand(min_damage, max_damage) M.apply_damage(damage, TOX) - M.SetStunned(15) + M.set_stunned(20 * 15) M.visible_message("[M] falls into a writhing mass of tentacles!", \ "You are entwined by a writhing mass of tentacles!") @@ -682,11 +682,11 @@ if (istype(AM, /mob/living)) var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) M.setBrainLoss(2,5) - M.updatehealth() + M.update_health() update_icon() playsound(src, 'sound/effects/bang.ogg', 100, 1) visible_message("[src] slams into [M], sending them flying!") - M.Weaken(12) + M.afflict_paralyze(20 * 12) /obj/effect/trap/pop_up/thrower/attackby(var/obj/item/W, var/mob/user) if(istype(W,/obj/item/stack/rods)) @@ -799,10 +799,10 @@ if (istype(AM, /mob/living)) M.throw_at_old(T2, 1, 1, src) if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) M.setBrainLoss(2,5) - M.updatehealth() + M.update_health() playsound(src, 'sound/effects/bang.ogg', 100, 1) visible_message("The falling log slams into [M], sending them flying!") - M.Weaken(12) + M.afflict_paralyze(20 * 12) /obj/effect/trap/falling/log/Reset() broken = FALSE diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 03fb4c33a26..13aefca6915 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -279,7 +279,11 @@ return if(anchored) - to_chat(user, SPAN_NOTICE("\The [src] won't budge, you can't pick it up!")) + user.action_feedback(SPAN_NOTICE("\The [src] won't budge, you can't pick it up!"), src) + return + + if(!CHECK_MOBILITY(user, MOBILITY_CAN_PICKUP)) + user.action_feedback(SPAN_WARNING("You can't do that right now."), src) return if (hasorgans(user)) @@ -451,7 +455,7 @@ if(!(usr)) //BS12 EDIT return - if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr)) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_PICKUP) || !Adjacent(usr)) return if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain to_chat(usr, "You can't pick things up!") @@ -558,8 +562,8 @@ to_chat(M, "You drop what you're holding and clutch at your eyes!") M.drop_active_held_item() M.eye_blurry += 10 - M.Unconscious(1) - M.Weaken(4) + M.afflict_unconscious(20 * 1) + M.afflict_paralyze(20 * 4) if (eyes.damage >= eyes.min_broken_damage) if(M.stat != 2) to_chat(M, "You go blind!") diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index ec8f446567d..97752455374 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -475,7 +475,7 @@ GLOBAL_LIST_EMPTY(PDAs) return 0 var/mob/M = loc - if(M.stat || M.restrained() || M.paralysis || M.stunned || M.weakened) + if(!CHECK_MOBILITY(M, MOBILITY_CAN_USE)) return 0 if((src in M.contents) || ( istype(loc, /turf) && in_range(src, M) )) return 1 @@ -1369,7 +1369,7 @@ GLOBAL_LIST_EMPTY(PDAs) ), 1) user.show_message(" Key: Suffocation/Toxin/Burns/Brute", 1) user.show_message(" Body Temperature: [C.bodytemperature-T0C]°C ([C.bodytemperature*1.8-459.67]°F)", 1) - if(C.tod && (C.stat == DEAD || (C.status_flags & FAKEDEATH))) + if(C.tod && (C.stat == DEAD || (C.status_flags & STATUS_FAKEDEATH))) user.show_message(" Time of Death: [C.tod]") if(istype(C, /mob/living/carbon/human)) var/mob/living/carbon/human/H = C diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 9821af79c9c..e165998ee95 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -539,14 +539,11 @@ var/list/civilian_cartridges = list( /obj/item/cartridge/Topic(href, href_list) ..() - if (!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) + if (!CHECK_MOBILITY(usr, MOBILITY_CAN_UI) || !in_range(loc, usr)) usr.unset_machine() usr << browse(null, "window=pda") return - - - switch(href_list["choice"]) if("Medical Records") var/datum/data/record/R = locate(href_list["target"]) diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 959f702afb5..c5d044eec23 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -72,7 +72,7 @@ if(carded_ai.deployed_shell && prob(carded_ai.oxyloss)) //You feel it creeping? Eventually will reach 100, resulting in the second half of the AI's remaining life being lonely. carded_ai.disconnect_shell("Disconnecting from remote shell due to insufficent power.") carded_ai.adjustOxyLoss(2) - carded_ai.updatehealth() + carded_ai.update_health() sleep(10) flush = 0 if (href_list["radio"]) @@ -134,14 +134,14 @@ if(user.client) to_chat(ai, "Transfer successful: [ai.name] extracted from current device and placed within mobile core.") - ai.canmove = 1 + ai.mobility_flags = initial(ai.mobility_flags) update_icon() return TRUE return FALSE /obj/item/aicard/proc/clear() if(carded_ai && istype(carded_ai.loc, /turf)) - carded_ai.canmove = 0 + carded_ai.mobility_flags = NONE carded_ai.carded = 0 name = initial(name) carded_ai = null @@ -160,7 +160,7 @@ ..() /obj/item/aicard/relaymove(var/mob/user, var/direction) - if(user.stat || user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return var/obj/item/rig/rig = src.get_rig() if(istype(rig)) diff --git a/code/game/objects/items/devices/body_snatcher_vr.dm b/code/game/objects/items/devices/body_snatcher_vr.dm index e6d20f7b2da..d759ac291f4 100644 --- a/code/game/objects/items/devices/body_snatcher_vr.dm +++ b/code/game/objects/items/devices/body_snatcher_vr.dm @@ -56,11 +56,11 @@ prey_mind.transfer(user) M.ooc_notes = user_ooc_notes //Let's keep their OOC notes over to their new body. user.ooc_notes = target_ooc_notes - user.sleeping = 10 //Device knocks out both the user and the target. + user.afflict_sleeping(10 SECONDS) user.eye_blurry = 30 //Blurry vision while they both get used to their new body's vision user.slurring = 50 //And let's also have them slurring while they attempt to get used to using their new body. if(ishuman(M)) //Let's not have the AI slurring, even though its downright hilarious. - M.sleeping = 10 + M.afflict_sleeping(10 SECONDS) M.eye_blurry = 30 M.slurring = 50 diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 2c1f23f843b..13451201f52 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -272,7 +272,7 @@ /obj/item/shockpaddles/proc/can_revive(mob/living/carbon/human/H) //This is checked right before attempting to revive - H.updatehealth() + H.update_health() if(H.isSynthetic()) if(H.health + H.getOxyLoss() + H.getToxLoss() <= config_legacy.health_threshold_dead) @@ -481,8 +481,8 @@ M.reload_fullscreen() M.emote("gasp") - M.Weaken(rand(10,25)) - M.updatehealth() + M.afflict_paralyze(20 * rand(10,25)) + M.update_health() /obj/item/shockpaddles/proc/make_announcement(var/message, var/msg_class) audible_message("\The [src] [message]", "\The [src] vibrates slightly.") diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 52969c41a34..be52a67bbf0 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -193,6 +193,7 @@ if(flash_strength > 0) H.Confuse(flash_strength + 5) + H.afflict_stagger(5) H.Blind(flash_strength) H.eye_blurry = max(H.eye_blurry, flash_strength + 5) H.flash_eyes() @@ -233,7 +234,7 @@ user.visible_message("[user] blinds [M] with the flash!") else user.visible_message("[user] overloads [M]'s sensors with the flash!") - M.Weaken(rand(5,10)) + M.afflict_paralyze(20 * rand(5,10)) else user.visible_message("[user] fails to blind [M] with the flash!") @@ -284,7 +285,7 @@ var/safety = C.eyecheck() if(safety <= 0) C.adjustHalLoss(halloss_per_flash) - //C.Weaken(10) + //C.afflict_paralyze(20 * 10) C.flash_eyes() for(var/mob/M in viewers(C, null)) M.show_message("[C] is blinded by the flash!") diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index a8795109d69..a8e82d5073b 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -129,14 +129,14 @@ if(3) //rank 1 with minor vulnerability, rank 2 or 3 with no protection, or rank 3 with basic protection if(prob(3 * diode.rating)) - C.Weaken(1) + C.afflict_paralyze(20 * 1) flick("flash", C.flash_eyes()) E.damage += 1 to_chat(C, "A bright light briefly blinds you!") if(4) //rank 3 with no protection, or rank 2 with minor vulnerability if(prob(5 * diode.rating)) - C.Weaken(1) + C.afflict_paralyze(20 * 1) flick("e_flash", C.flash_eyes()) E.damage += 2 to_chat(C, "A blinding light burns your eyes!") @@ -150,7 +150,7 @@ if(prob(effectchance * diode.rating)) flick("flash", S.flash_eyes(affect_silicon = TRUE)) if (prob(3 * diode.rating)) - S.Weaken(1) + S.afflict_paralyze(20 * 1) to_chat(S, "Your sensors were blinded by a laser!") outmsg = "You blind [S] by shining [src] at their sensors." add_attack_logs(user,S,"Tried disabling using [src]") diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index 00b0516fd38..f00117a7735 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -144,13 +144,13 @@ for(var/mob/living/carbon/M in oviewers(4, T)) if(M.get_ear_protection() >= 2) continue - M.SetSleeping(0) + M.set_sleeping(0) M.stuttering += 20 M.ear_deaf += 30 - M.Weaken(3) + M.afflict_paralyze(20 * 3) if(prob(30)) - M.Stun(10) - M.Unconscious(4) + M.afflict_stun(20 * 10) + M.afflict_unconscious(20 * 4) else M.make_jittery(50) insults-- diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 7b48f2930ac..efbb82a8e0b 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -16,7 +16,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/paicard) var/mob/living/silicon/pai/pai /obj/item/paicard/relaymove(var/mob/user, var/direction) - if(user.stat || user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return var/obj/item/rig/rig = src.get_rig() if(istype(rig)) @@ -347,7 +347,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/paicard) qdel(src) /obj/item/paicard/see_emote(mob/living/M, text) - if(pai && pai.client && !pai.canmove) + if(pai && pai.client && (pai in contents)) var/rendered = "[text]" pai.show_message(rendered, 2) ..() diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index fcafa8c09be..9626d06675e 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -33,12 +33,11 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/radio/beacon) set category = "Object" set src in usr - if ((usr.canmove && !( usr.restrained() ))) + if(CHECK_MOBILITY(usr, MOBILITY_CAN_MOVE)) src.code = t - if (!( src.code )) + if(!( src.code )) src.code = "beacon" src.add_fingerprint(usr) - return /obj/item/radio/beacon/anchored desc = "A beacon used by a teleporter. This one appears to be bolted to the ground." diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index f1adebdb640..6dcc9d7aa50 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -98,7 +98,7 @@ s.set_up(3, 1, M) s.start() - M.Weaken(10) + M.afflict_paralyze(20 * 10) if(master && wires & 1) master.receive_signal() diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 2cde4bad668..2f4c55ece3a 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -77,7 +77,7 @@ HALOGEN COUNTER - Radcount on mobs var/TX = M.getToxLoss() > 50 ? "[M.getToxLoss()]" : M.getToxLoss() var/BU = M.getFireLoss() > 50 ? "[M.getFireLoss()]" : M.getFireLoss() var/BR = M.getBruteLoss() > 50 ? "[M.getBruteLoss()]" : M.getBruteLoss() - if(M.status_flags & FAKEDEATH) + if(M.status_flags & STATUS_FAKEDEATH) OX = fake_oxy > 50 ? "[fake_oxy]" : fake_oxy dat += SPAN_NOTICE("\nAnalyzing Results for [M]:") dat += SPAN_NOTICE("\nOverall Status: dead") @@ -88,7 +88,7 @@ HALOGEN COUNTER - Radcount on mobs dat += "\nBody Temperature: [M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F)" dat += "\nSpecies: [M.get_species_name()]" - if(M.timeofdeath && (M.stat == DEAD || (M.status_flags & FAKEDEATH))) + if(M.timeofdeath && (M.stat == DEAD || (M.status_flags & STATUS_FAKEDEATH))) dat += SPAN_NOTICE("\nTime of Death: [worldtime2stationtime(M.timeofdeath)]") var/tdelta = round(world.time - M.timeofdeath) if(tdelta < (DEFIB_TIME_LIMIT * 10)) @@ -112,7 +112,7 @@ HALOGEN COUNTER - Radcount on mobs TX = M.getToxLoss() > 50 ? "Dangerous amount of toxins detected" : "Subject bloodstream toxin level minimal" BU = M.getFireLoss() > 50 ? "Severe burn damage detected" : "Subject burn injury status O.K" BR = M.getBruteLoss() > 50 ? "Severe anatomical damage detected" : "Subject brute-force injury status O.K" - if(M.status_flags & FAKEDEATH) + if(M.status_flags & STATUS_FAKEDEATH) OX = fake_oxy > 50 ? SPAN_WARNING("Severe oxygen deprivation detected") : "Subject bloodstream oxygen level normal" dat += "\n[OX] | [TX] | [BU] | [BR]" if(M.radiation) diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 83021099335..66f9540758b 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -40,9 +40,9 @@ effective or pretty fucking useless. spawn() if(prob(50)) - M.Weaken(rand(10,20)) + M.afflict_paralyze(20 * rand(10,20)) if(prob(25)) - M.Stun(rand(5,10)) + M.afflict_stun(20 * rand(5,10)) to_chat(M, "You feel a tremendous, paralyzing wave flood your mind.") else diff --git a/code/game/objects/items/inducer.dm b/code/game/objects/items/inducer.dm index cea94322645..3168bf3af01 100644 --- a/code/game/objects/items/inducer.dm +++ b/code/game/objects/items/inducer.dm @@ -142,7 +142,7 @@ var/datum/current = targets[1] targets.Cut(1, 2) - while(!QDELETED(A) && do_after(user, 2 SECONDS, A, ignore_movement = TRUE, max_distance = recharge_dist) && !QDELETED(cell)) + while(!QDELETED(A) && do_after(user, 2 SECONDS, A, DO_AFTER_IGNORE_MOVEMENT, max_distance = recharge_dist) && !QDELETED(cell)) var/amount = min(cell.charge, transfer_rate * 2) // transfer rate is per second, we do this every 2 seconds var/charged = current.inducer_act(src, amount, inducer_flags) spark_system.start() diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 95c006e2e60..81d7dfc0985 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -65,7 +65,7 @@ ) use(1) . = FALSE // already did so - C.updatehealth() + C.update_health() return TRUE /obj/item/stack/medical/proc/upgrade_stack(var/upgrade_amount) diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 2ae6f829bf2..054b2958d5c 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -26,7 +26,7 @@ if(do_after(user,7 * tool_speed)) R.adjustBruteLoss(-15) R.adjustFireLoss(-15) - R.updatehealth() + R.update_health() use(1) user.visible_message("\The [user] applied some [src] on [R]'s damaged areas.",\ "You apply some [src] at [R]'s damaged areas.") @@ -46,7 +46,7 @@ S.heal_damage(restoration_internal, restoration_internal, robo_repair = 1) else if(do_after(user,5 * tool_speed)) S.heal_damage(restoration_external,restoration_external, robo_repair =1) - H.updatehealth() + H.update_health() use(1) user.visible_message("\The [user] applies some nanite paste on [user != L ? "[L]'s [S.name]" : "[S]"] with [src].",\ "You apply some nanite paste on [user == L ? "your" : "[L]'s"] [S.name].") diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index bc21e936ed6..1932c60a3f6 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -411,7 +411,7 @@ /obj/item/stack/AltClick(mob/living/user) . = ..() - if(!istype(user) || !in_range(user, src) || !user.canmove) + if(!istype(user) || !in_range(user, src) || !CHECK_MOBILITY(user, MOBILITY_CAN_PICKUP)) return attempt_split_stack(user) @@ -427,7 +427,7 @@ var/stackmaterial = tgui_input_number(user, "How many sheets do you wish to take out of this stack?", "Stack", max, max, 1, round_value=TRUE) max = get_amount() // Not sure why this is done twice but whatever. stackmaterial = min(max, stackmaterial) - if(stackmaterial == null || stackmaterial <= 0 || !in_range(user, src) || !user.canmove) + if(stackmaterial == null || stackmaterial <= 0 || !in_range(user, src) || !CHECK_MOBILITY(user, MOBILITY_CAN_PICKUP)) return TRUE else change_stack(user, stackmaterial) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 3da3cd32ea4..e9e4994d1c3 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -206,7 +206,7 @@ return else if (bullets == 0) - user.Weaken(5) + user.afflict_paralyze(20 * 5) for(var/mob/O in viewers(world.view, user)) O.show_message(text("\The [] realized they were out of ammo and starting scrounging for some!", user), 1) @@ -231,7 +231,7 @@ for(var/mob/O in viewers(target, null)) if (O.client) O.show_message(text("\The [] casually lines up a shot with []'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!", user, target), 1, "You hear someone fall", 2) - user.Weaken(5) + user.afflict_paralyze(20 * 5) /obj/item/toy/ammo/crossbow name = "foam dart" diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm index bc01512a773..cbb1a4f5b8b 100644 --- a/code/game/objects/items/weapons/RPD.dm +++ b/code/game/objects/items/weapons/RPD.dm @@ -169,7 +169,7 @@ . = ..() if(.) return - if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE) || !in_range(loc, usr)) return TRUE var/playeffect = TRUE switch(action) diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index dccb4fdb702..2ea8e4204ba 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -86,7 +86,7 @@ else user.visible_message("[user] begins to do [H]'s lips with \the [src].", \ "You begin to apply \the [src].") - if(do_after(user, 20) && do_after(H, 20, 5, 0)) //user needs to keep their active hand, H does not. + if(do_after(user, 20, H)) //user needs to keep their active hand, H does not. user.visible_message("[user] does [H]'s lips with \the [src].", \ "You apply \the [src].") H.lip_style = colour diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 24631abbbcf..de0f06ebd01 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -56,7 +56,7 @@ to_chat(user, "Planting explosives...") user.do_attack_animation(target) - if(do_after(user, 50) && in_range(user, target)) + if(do_after(user, 50, target, max_distance = 1)) if(!user.attempt_void_item_for_installation(src)) return src.target = target diff --git a/code/game/objects/items/weapons/grenades/concussion.dm b/code/game/objects/items/weapons/grenades/concussion.dm index 9628ad7a13d..b8d5da08343 100644 --- a/code/game/objects/items/weapons/grenades/concussion.dm +++ b/code/game/objects/items/weapons/grenades/concussion.dm @@ -37,7 +37,7 @@ H.Confuse(2) else H.Confuse(8) - H.Weaken(1) + H.afflict_paralyze(20 * 1) if ((prob(14) || (H == src.loc && prob(70)))) H.ear_damage += rand(1, 10) else diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index 2f14fa2317a..38899f113c0 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -49,16 +49,16 @@ if(eye_safety < 1 && get_dist(M, T) <= round(max_range * 0.7 * flash_effectiveness)) M.flash_eyes() M.Confuse(2 * flash_effectiveness) - M.Weaken(5 * flash_effectiveness) + M.afflict_paralyze(20 * 5 * flash_effectiveness) //Now applying sound if((get_dist(M, T) <= round(max_range * 0.3 * bang_effectiveness) || src.loc == M.loc || src.loc == M)) if(ear_safety > 0) M.Confuse(2) - M.Weaken(1) + M.afflict_paralyze(20 * 1) else M.Confuse(10) - M.Weaken(3) + M.afflict_paralyze(20 * 3) if ((prob(14) || (M == src.loc && prob(70)))) M.ear_damage += rand(1, 10) else diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index cb0ca4cb054..19969897f0b 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -469,9 +469,9 @@ the implant may become unstable and either pre-maturely inject the subject or si if (emote == "pale") src.uses-- to_chat(source, "You feel a sudden surge of energy!") - source.SetStunned(0) - source.SetWeakened(0) - source.SetUnconscious(0) + source.set_stunned(0) + source.set_paralyzed(0) + source.set_unconscious(0) return diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index 3bd78837ea3..ed28313e17b 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -138,6 +138,6 @@ if ((MUTATION_CLUMSY in L.mutations) && prob(50)) to_chat(user, "\The [src] slips out of your hand and hits your head.") L.take_organ_damage(10) - L.Unconscious(2) + L.afflict_unconscious(20 * 2) return CLICKCHAIN_DO_NOT_PROPAGATE return ..() diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 0544fbf267b..455c3fbe569 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -140,9 +140,9 @@ return if(affecting.take_damage(damage_force, 0)) H.UpdateDamageIcon() - H.updatehealth() + H.update_health() if(affecting.organ_can_feel_pain()) - H.Weaken(3) + H.afflict_paralyze(20 * 3) return check -= picked return diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 68cc5b7b0d9..9311b219542 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -404,7 +404,7 @@ else G.stun_effect_act(10 , 50, BP_TORSO, src) G.take_organ_damage(10) - G.Unconscious(20) + G.afflict_unconscious(20 * 20) playsound(src.loc, "sparks", 50, 1) return */ diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index c36e4fcc130..e382abfbb9b 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -114,7 +114,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop) else if (user) //You hit a wall! user.setClickCooldown(2) - user.Stun(2) + user.afflict_stun(20 * 2) shake_camera(user, 1, 1) playsound(T,"thud", 20, 1, -3) to_chat(user, "There's not enough space for broad sweeps here!") diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 724dd88be19..a0fea6338ee 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -133,7 +133,7 @@ /obj/item/melee/baton/attack_mob(mob/target, mob/user, clickchain_flags, list/params, mult, target_zone, intent) if(status && (MUTATION_CLUMSY in user.mutations) && prob(50)) to_chat(user, "You accidentally hit yourself with the [src]!") - user.Weaken(30) + user.afflict_paralyze(20 * 30) deductcharge(hitcost) return deductcharge(hitcost) diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 48bbf3f2b8d..36b92f51fcb 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -23,7 +23,7 @@ if ((MUTATION_CLUMSY in user.mutations) && prob(50) && isliving(user)) var/mob/living/L = user to_chat(user, "You club yourself over the head.") - user.Weaken(3 * damage_force) + user.afflict_paralyze(20 * 3 * damage_force) if(ishuman(user)) var/mob/living/carbon/human/H = user H.apply_damage(2*damage_force, BRUTE, BP_HEAD) @@ -99,7 +99,7 @@ if(on) if ((MUTATION_CLUMSY in user.mutations) && prob(50)) to_chat(user, "You club yourself over the head.") - user.Weaken(3 * damage_force) + user.afflict_paralyze(20 * 3 * damage_force) if(ishuman(user)) var/mob/living/carbon/human/H = user H.apply_damage(2*damage_force, BRUTE, BP_HEAD) diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm index 008e0a2bbdf..87d5da28dc2 100644 --- a/code/game/objects/items/weapons/traps.dm +++ b/code/game/objects/items/weapons/traps.dm @@ -136,7 +136,7 @@ // allow it so they can do buckle interactions at all buckle_allowed = TRUE buckle_mob(L, BUCKLE_OP_FORCE) - L.Stun(stun_length) + L.afflict_stun(20 * stun_length) to_chat(L, "The steel jaws of \the [src] bite into you, trapping you in place!") deployed = FALSE diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index e36eb2c1bda..b899b5e9666 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -37,7 +37,7 @@ if((MUTATION_CLUMSY in L.mutations) && prob(50)) //What if he's a clown? to_chat(victim, "You accidentally slam yourself with the [src]!") - L.Weaken(1) + L.afflict_paralyze(20 * 1) L.take_organ_damage(2) if(prob(50)) playsound(victim, 'sound/items/trayhit1.ogg', 50, 1) @@ -59,7 +59,7 @@ add_attack_logs(L,victim,"Hit with [src]") if(prob(15)) - victim.Weaken(3) + victim.afflict_paralyze(20 * 3) victim.take_organ_damage(3) else victim.take_organ_damage(5) @@ -105,7 +105,7 @@ for(var/mob/O in viewers(victim, null)) O.show_message(text("[] slams [] with the tray!", L, victim), 1) if(prob(10)) - victim.Stun(rand(1,3)) + victim.afflict_stun(20 * rand(1,3)) victim.take_organ_damage(3) return else @@ -129,13 +129,13 @@ for(var/mob/O in viewers(victim, null)) O.show_message(text("[] slams [] in the face with the tray!", L, victim), 1) if(prob(30)) - victim.Stun(rand(2,4)) + victim.afflict_stun(20 * rand(2,4)) victim.take_organ_damage(4) return else victim.take_organ_damage(8) if(prob(30)) - victim.Weaken(2) + victim.afflict_paralyze(20 * 2) return return diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index f04c660a58d..6d21cfdac76 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -83,7 +83,7 @@ return M.setClickCooldown(M.get_attack_speed()) visible_message("[M] begins to tear at \the [src]!") - if(!do_after(M, escape_time, src, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY))) + if(!do_after(M, escape_time, src, mobility_flags = MOBILITY_CAN_RESIST)) return FALSE visible_message("[M] manages to tear \the [src] apart!") qdel(src) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 857405524cb..254cb560c9b 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -253,7 +253,7 @@ var/extra_time = MODULUS(time, interval) var/i for(i in 1 to round(time / interval)) - if(!do_after(escapee, interval, incapacitation_flags = INCAPACITATION_KNOCKOUT)) + if(!do_after(escapee, interval, mobility_flags = MOBILITY_CAN_RESIST)) return FALSE if(escapee.loc != src) return FALSE @@ -261,7 +261,7 @@ return FALSE if(breakout_sound) playsound(src, breakout_sound, breakout_volume, 1) - if(!do_after(escapee, extra_time, incapacitation_flags = INCAPACITATION_KNOCKOUT)) + if(!do_after(escapee, extra_time, mobility_flags = MOBILITY_CAN_RESIST)) return FALSE if(!contents_resist_step(escapee, i + 1, TRUE)) return FALSE diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index a15f9460a08..f050a280f3f 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -121,7 +121,7 @@ usr.visible_message("[user] starts climbing onto \the [src]!") climbers |= user - if(!do_after(user, issmall(user) ? climb_delay * 0.6 : climb_delay, src, incapacitation_flags = INCAPACITATION_ALL)) + if(!do_after(user, issmall(user) ? climb_delay * 0.6 : climb_delay, src, mobility_flags = MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) climbers -= user return @@ -140,14 +140,14 @@ /obj/structure/proc/structure_shaken() for(var/mob/living/M in climbers) - M.Weaken(1) + M.afflict_paralyze(20 * 1) to_chat(M, "You topple as you are shaken off \the [src]!") climbers.Cut(1,2) for(var/mob/living/M in get_turf(src)) if(M.lying) return //No spamming this on people. - M.Weaken(3) + M.afflict_paralyze(20 * 3) to_chat(M, "You topple as \the [src] moves under you!") if(prob(25)) @@ -183,9 +183,10 @@ H.adjustBruteLoss(damage) H.UpdateDamageIcon() - H.updatehealth() + H.update_health() return +// todo: remove /obj/structure/proc/can_touch(var/mob/user) if (!user) return 0 @@ -194,7 +195,7 @@ if (user.restrained() || user.buckled) to_chat(user, "You need your hands and legs free for this.") return 0 - if (user.stat || user.paralysis || user.sleeping || user.lying || user.weakened) + if (!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return 0 if (isAI(user)) to_chat(user, "You need hands for this.") diff --git a/code/game/objects/structures/cliff.dm b/code/game/objects/structures/cliff.dm index fa6f1d020b6..e6100d7aaa8 100644 --- a/code/game/objects/structures/cliff.dm +++ b/code/game/objects/structures/cliff.dm @@ -192,7 +192,7 @@ two tiles on initialization, and which way a cliff is facing may change during m harm /= 2 playsound(L, 'sound/effects/break_stone.ogg', 70, 1) - L.Weaken(5 * harm) + L.afflict_paralyze(20 * 5 * harm) var/fall_time = 3 if(displaced) // Make the fall look more natural when falling sideways. L.pixel_z = 32 * 2 diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 6ff8c61da08..0f9e8cc655b 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -336,7 +336,7 @@ return if(O.loc == user) return - if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return if((!( istype(O, /atom/movable) ) || O.anchored || !Adjacent(user) || !Adjacent(O) || !user.Adjacent(O) || user.contents.Find(src))) return @@ -385,7 +385,7 @@ set category = "Object" set name = "Toggle Open" - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return if(ishuman(usr) || isrobot(usr)) diff --git a/code/game/objects/structures/crates_lockers/closets/coffin.dm b/code/game/objects/structures/crates_lockers/closets/coffin.dm index defc8571224..68b7ef58fdc 100644 --- a/code/game/objects/structures/crates_lockers/closets/coffin.dm +++ b/code/game/objects/structures/crates_lockers/closets/coffin.dm @@ -70,7 +70,7 @@ return TRUE //Everything else can move over the graves /obj/structure/closet/grave/proc/fall_in(mob/living/L) //Only called on humans for now, but still - L.Weaken(5) + L.afflict_paralyze(20 * 5) if(ishuman(L)) var/mob/living/carbon/human/H = L var/limb_damage = rand(5,25) 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 1b078ab9ec5..5096b677de7 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -92,7 +92,8 @@ set src in oview(1) // One square distance set category = "Object" set name = "Reset Lock" - if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) // 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 6527e2b06b2..4a671d02e3d 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 @@ -134,7 +134,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE) || !Adjacent(usr)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr) || isrobot(usr)) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index b42516c625b..fac522dedde 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -38,7 +38,7 @@ var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, src) s.start() - if(usr.stunned) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_MOVE)) return 2 playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3) @@ -184,7 +184,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr) || isrobot(usr)) diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index 8b3140ffe84..d41885f16cb 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -69,7 +69,7 @@ to_chat(L, "You feel a deep shock course through your body!") sleep(1) L.burn_skin(85) - L.Stun(600) + L.afflict_stun(20 * 6) visible_message("The electric chair went off!", "You hear a deep sharp shock!") A.power_light = light diff --git a/code/game/objects/structures/femur_breaker.dm b/code/game/objects/structures/femur_breaker.dm index 74e2bbf6560..1bbbfea3ed5 100644 --- a/code/game/objects/structures/femur_breaker.dm +++ b/code/game/objects/structures/femur_breaker.dm @@ -94,7 +94,7 @@ return playsound(src, 'sound/effects/femur_breaker.ogg', 100, FALSE) - H.Stun(BREAKER_ANIMATION_LENGTH) + H.afflict_stun(20 * BREAKER_ANIMATION_LENGTH) addtimer(CALLBACK(src, .proc/damage_leg, H), BREAKER_ANIMATION_LENGTH, TIMER_UNIQUE) log_combat(user, H, "femur broke", src) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 2557b89be81..35d3b6e644b 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -190,7 +190,7 @@ var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(3, 1, src) s.start() - if(user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return 1 else return 0 diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 0a694b925ae..f6928838b02 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -216,7 +216,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart) ..() /obj/structure/bed/chair/janicart/relaymove(mob/living/user, direction) - if(user.stat || user.stunned || user.weakened || user.paralysis) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) unbuckle_mob() if(user.get_held_item_of_type(/obj/item/key)) step(src, direction) diff --git a/code/game/objects/structures/kitchen_foodcart.dm b/code/game/objects/structures/kitchen_foodcart.dm index a059777a286..968d990be4c 100644 --- a/code/game/objects/structures/kitchen_foodcart.dm +++ b/code/game/objects/structures/kitchen_foodcart.dm @@ -26,7 +26,7 @@ if(contents.len) var/obj/item/reagent_containers/food/choice = input("What would you like to grab from the cart?") as null|obj in contents if(choice) - if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE) || !in_range(loc, usr)) return if(ishuman(user)) if(!user.get_active_held_item()) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 8abd5673acb..bafc7c5a1de 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -192,7 +192,7 @@ return if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag)) return - if (!ismob(user) || user.stat || user.lying || user.stunned) + if (!ismob(user) || !CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return O.forceMove(src.loc) if (user != O) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index b1268ebb25c..4a4a7399ea6 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -239,7 +239,7 @@ return if (G.state < 2) if(user.a_intent == INTENT_HARM) - if (prob(15)) M.Weaken(5) + if (prob(15)) M.afflict_paralyze(20 * 5) M.apply_damage(8,def_zone = "head") take_damage(8) visible_message("[G.assailant] slams [G.affecting]'s face against \the [src]!") @@ -252,7 +252,7 @@ G.affecting.forceMove(get_step(src, src.dir)) else G.affecting.forceMove(get_turf(src)) - G.affecting.Weaken(5) + G.affecting.afflict_paralyze(20 * 5) visible_message("[G.assailant] throws [G.affecting] over \the [src]!") qdel(W) return diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index 3e96369860f..8df9fcbeade 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -26,7 +26,7 @@ "You struggle to break free from the gelatinous resin...",\ "You hear squelching...") add_fingerprint(L) - if(!do_after(L, NEST_RESIST_TIME, src, FALSE)) + if(!do_after(L, NEST_RESIST_TIME, src, DO_AFTER_IGNORE_ACTIVE_ITEM, MOBILITY_CAN_RESIST)) L.visible_message( SPAN_WARNING("[L] fails to break out of [src]!"), SPAN_WARNING("You fail to break out of [src].") diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index 4a8e0dca1e7..782a79b5d9c 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -84,7 +84,7 @@ var/global/list/stool_cache = list() //haha stool dismantle() qdel(src) var/mob/living/T = target - T.Weaken(10) + T.afflict_paralyze(20 * 10) T.apply_damage(20) return CLICKCHAIN_DO_NOT_PROPAGATE 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 8ea90987721..f7dd34397fd 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -33,14 +33,14 @@ return last_active_move = world.time - if(user.stat || user.stunned || user.weakened || user.paralysis || user.lying || user.restrained()) + if(!CHECK_ALL_MOBILITY(user, MOBILITY_CAN_HOLD)) if(user==pulling_along) pulling_along = null user.pulledby = null to_chat(user, "You lost your grip!") return if(has_buckled_mobs() && pulling_along && (user in buckled_mobs)) - if(pulling_along.stat || pulling_along.stunned || pulling_along.weakened || pulling_along.paralysis || pulling_along.lying || pulling_along.restrained()) + if(!CHECK_ALL_MOBILITY(pulling_along, MOBILITY_CAN_MOVE | MOBILITY_IS_STANDING)) pulling_along.pulledby = null pulling_along = null if((user.pulling != src) && (user == pulling_along)) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 6f6f3906884..cf5c8f936b3 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -438,9 +438,9 @@ if(B.bcell) if(B.bcell.charge > 0 && B.status == 1) flick("baton_active", src) - user.Stun(10) + user.afflict_stun(20 * 10) user.stuttering = 10 - user.Weaken(10) + user.afflict_paralyze(20 * 10) if(isrobot(user)) var/mob/living/silicon/robot/R = user R.cell.charge -= 20 diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index c7a5800bac8..ce65a0b7f18 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -350,12 +350,12 @@ if (2) M.visible_message(SPAN_DANGER("[user] bashes [M] against \the [src]!")) if (prob(50)) - M.Weaken(1) + M.afflict_paralyze(20 * 1) M.apply_damage(10) hit(25) - if (3) + if(3) M.visible_message(SPAN_BOLDDANGER("[user] crushes [M] against \the [src]!")) - M.Weaken(5) + M.afflict_paralyze(20 * 5) M.apply_damage(20) hit(50) return diff --git a/code/game/objects/stumble_into_vr.dm b/code/game/objects/stumble_into_vr.dm index 61ff414a6b7..ce6f9e10325 100644 --- a/code/game/objects/stumble_into_vr.dm +++ b/code/game/objects/stumble_into_vr.dm @@ -3,7 +3,7 @@ visible_message("[M] [pick("ran", "slammed")] into \the [src]!") to_chat(M, "You just [pick("ran", "slammed")] into \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.stop_flying() /obj/structure/table/stumble_into(mob/living/M) @@ -16,7 +16,7 @@ playsound(get_turf(src), 'sound/weapons/tablehit1.ogg', 25, 1, -1) visible_message("[M] flopped onto \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.forceMove(get_turf(src)) M.stop_flying() @@ -24,7 +24,7 @@ playsound(get_turf(src), 'sound/effects/clang.ogg', 25, 1, -1) visible_message("[M] [pick("tripped", "stumbled")] into \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.forceMove(src) M.update_perspective() M.stop_flying() @@ -33,21 +33,21 @@ /obj/structure/inflatable/stumble_into(mob/living/M) playsound(get_turf(M), "sound/effects/Glasshit.ogg", 25, 1, -1) visible_message("[M] [pick("ran", "slammed")] into \the [src]!") - M.Weaken(1) + M.afflict_paralyze(20 * 1) M.stop_flying() /obj/structure/kitchenspike/stumble_into(mob/living/M) playsound(get_turf(M), "sound/weapons/pierce.ogg", 25, 1, -1) visible_message("[M] [pick("ran", "slammed")] into the spikes on \the [src]!") M.apply_damage(15, BRUTE, sharp=1) - M.Weaken(5) + M.afflict_paralyze(20 * 5) M.stop_flying() /obj/structure/m_tray/stumble_into(mob/living/M) playsound(get_turf(src), 'sound/weapons/tablehit1.ogg', 25, 1, -1) visible_message("[M] flopped onto \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.forceMove(get_turf(src)) M.stop_flying() @@ -55,14 +55,14 @@ playsound(get_turf(src), 'sound/weapons/tablehit1.ogg', 25, 1, -1) visible_message("[M] flopped onto \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.forceMove(get_turf(src)) M.stop_flying() /obj/structure/window/stumble_into(mob/living/M) visible_message("[M] [pick("ran", "slammed")] into \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.stop_flying() /obj/structure/railing/stumble_into(mob/living/M) @@ -71,7 +71,7 @@ return ..() playsound(get_turf(src), 'sound/misc/slip.ogg', 25, 1, -1) visible_message("[M] [pick("tripped", "stumbled")] over \the [src]!") - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.stop_flying() if(get_turf(M) == get_turf(src)) M.forceMove(get_step(src, src.dir)) @@ -89,7 +89,7 @@ /obj/machinery/appliance/cooker/fryer/stumble_into(mob/living/M) // Citadel change visible_message("[M] [pick("ran", "slammed")] into \the [src]!") M.apply_damage(15, BURN) - M.Weaken(5) + M.afflict_paralyze(20 * 5) M.emote("scream") M.stop_flying() @@ -99,7 +99,7 @@ playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 25, 1, -1) visible_message("[M] [pick("tripped", "stumbled")] into \the [src]!") M.apply_damage(5, BRUTE) - M.Weaken(2) + M.afflict_paralyze(20 * 2) put_mob(M) M.stop_flying() diff --git a/code/game/turfs/simulated/floors/snow.dm b/code/game/turfs/simulated/floors/snow.dm index 87f04780b30..6f3227957ac 100644 --- a/code/game/turfs/simulated/floors/snow.dm +++ b/code/game/turfs/simulated/floors/snow.dm @@ -61,9 +61,9 @@ /turf/simulated/floor/outdoors/ice/Entered(var/mob/living/M) . = ..() if(istype(M, /mob/living)) - if(M.stunned == 0) + if(!M.is_stunned()) to_chat(M, "You slide across the ice!") - M.SetStunned(1) + M.set_stunned(20 * 1) step(M,M.dir) // Ice that is used for, say, areas floating on water or similar. diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index e83f3e4cc60..fbf47238b63 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -259,7 +259,7 @@ FD.attack_hand(user) return TRUE - if(!(user.canmove) || user.restrained() || !(user.pulling)) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE) || user.restrained() || !(user.pulling)) return 0 if(user.pulling.anchored || !isturf(user.pulling.loc)) return 0 @@ -313,28 +313,32 @@ /turf/MouseDroppedOnLegacy(atom/movable/O as mob|obj, mob/user as mob) var/turf/T = get_turf(user) var/area/A = T.loc + if(!ismob(O)) + return + var/mob/M = O if((istype(A) && !(A.has_gravity)) || (istype(T,/turf/space))) return - if(istype(O, /atom/movable/screen)) - return - if(user.restrained() || user.stat || user.stunned || user.paralysis || (!user.lying && !istype(user, /mob/living/silicon/robot))) - return if((!(istype(O, /atom/movable)) || O.anchored || !Adjacent(user) || !Adjacent(O) || !user.Adjacent(O))) return if(!isturf(O.loc) || !isturf(user.loc)) return if(isanimal(user) && O != user) return - if (do_after(user, 25 + (5 * user.weakened)) && !(user.stat)) - step_towards(O, src) - if(ismob(O)) - animate(O, transform = turn(O.transform, 20), time = 2) - sleep(2) - animate(O, transform = turn(O.transform, -40), time = 4) - sleep(4) - animate(O, transform = turn(O.transform, 20), time = 2) - sleep(2) - O.update_transform() + if(M.pulledby || M.is_grabbed()) + return + if(!CHECK_MOBILITY(user, user == M? MOBILITY_IS_CONSCIOUS : MOBILITY_CAN_USE)) + return + if (do_after(user, 2.5 SECONDS, mobility_flags = user == M? MOBILITY_IS_CONSCIOUS : MOBILITY_CAN_USE)) + if(M.pulledby || M.is_grabbed()) + return + step_towards(M, src) + animate(M, transform = turn(O.transform, 20), time = 2) + sleep(2) + animate(M, transform = turn(O.transform, -40), time = 4) + sleep(4) + animate(M, transform = turn(O.transform, 20), time = 2) + sleep(2) + M.update_transform() /turf/proc/adjacent_fire_act(turf/simulated/floor/source, temperature, volume) diff --git a/code/game/verbs/suicide.dm b/code/game/verbs/suicide.dm index ed33d487526..de22149cab4 100644 --- a/code/game/verbs/suicide.dm +++ b/code/game/verbs/suicide.dm @@ -23,7 +23,7 @@ var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") if(confirm == "Yes") - if(!canmove || restrained()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide + if(!CHECK_MOBILITY(src, MOBILITY_CAN_USE) || restrained()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide to_chat(src, "You can't commit suicide whilst restrained! ((You can type Ghost instead however.))") return suiciding = 15 @@ -69,7 +69,7 @@ if(!(damagetype | BRUTELOSS) && !(damagetype | FIRELOSS) && !(damagetype | TOXLOSS) && !(damagetype | OXYLOSS)) adjustOxyLoss(max(175 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) - updatehealth() + update_health() return log_and_message_admins("[key_name(src)] commited suicide") @@ -86,7 +86,7 @@ visible_message(suicidemsg) adjustOxyLoss(max(175 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) - updatehealth() + update_health() /mob/living/carbon/brain/verb/suicide() set hidden = 1 @@ -130,7 +130,7 @@ visible_message("[src] is powering down. It looks like they're trying to commit suicide.") //put em at -175 adjustOxyLoss(max(getMaxHealth() * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) - updatehealth() + update_health() /mob/living/silicon/robot/verb/suicide() set hidden = 1 @@ -150,7 +150,7 @@ visible_message("[src] is powering down. It looks like they're trying to commit suicide.") //put em at -175 adjustOxyLoss(max(getMaxHealth() * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0)) - updatehealth() + update_health() /mob/living/silicon/pai/verb/suicide() set category = "pAI Commands" diff --git a/code/modules/actionspeed/actionspeed_modifier.dm b/code/modules/actionspeed/actionspeed_modifier.dm index 38bb8c8ba98..cedbbd95dbd 100644 --- a/code/modules/actionspeed/actionspeed_modifier.dm +++ b/code/modules/actionspeed/actionspeed_modifier.dm @@ -178,7 +178,6 @@ GLOBAL_LIST_EMPTY(actionspeed_modification_cache) ///Adds a default action speed /mob/proc/initialize_actionspeed() - add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/base, multiplicative_slowdown = 1) /// Get the action speed modifier datums on the mob /mob/proc/get_actionspeed_modifiers() diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index e38d6df6201..25bf4628a2e 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1425,16 +1425,21 @@ var/datum/legacy_announcement/minor/admin_min_announcer = new var/msg - if(check_rights(R_ADMIN|R_MOD)) - if (H.paralysis == 0) - H.SetUnconscious(8000) - msg = "has paralyzed [key_name(H)]." - log_and_message_admins(msg) - else - if(alert(src, "[key_name(H)] is paralyzed, would you like to unparalyze them?",,"Yes","No") == "Yes") - H.SetUnconscious(0) - msg = "has unparalyzed [key_name(H)]." - log_and_message_admins(msg) + if(!check_rights(R_ADMIN|R_MOD)) + return + + if(!HAS_TRAIT(H, TRAIT_MOB_UNCONSCIOUS)) + ADD_TRAIT(H, TRAIT_MOB_UNCONSCIOUS, ADMIN_TRAIT) + H.update_stat() + msg = "has paralyzed [key_name(H)]." + log_and_message_admins(msg) + else + if(alert(src, "[key_name(H)] is paralyzed, would you like to unparalyze them?",,"Yes","No") !="Yes") + return + REMOVE_TRAIT(H, TRAIT_MOB_UNCONSCIOUS, ADMIN_TRAIT) + H.update_stat() + msg = "has unparalyzed [key_name(H)]." + log_and_message_admins(msg) /datum/admins/proc/set_tcrystals(mob/living/carbon/human/H as mob) set category = "Debug" diff --git a/code/modules/admin/secrets/admin_secrets/prison_warp.dm b/code/modules/admin/secrets/admin_secrets/prison_warp.dm index 8fb5f9b526a..ad718373854 100644 --- a/code/modules/admin/secrets/admin_secrets/prison_warp.dm +++ b/code/modules/admin/secrets/admin_secrets/prison_warp.dm @@ -11,7 +11,7 @@ if((T && (T in GLOB.using_map.admin_levels)) || prisonwarped.Find(H)) //don't warp them if they aren't ready or are already there continue - H.Unconscious(5) + H.afflict_unconscious(20 * 5) if(H.wear_id) var/obj/item/card/id/id = H.get_idcard() for(var/A in id.access) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index c54abc0d18e..ea79b2a1299 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1104,7 +1104,7 @@ M.transfer_item_to_loc(I, locker, INV_OP_FORCE) //so they black out before warping - M.Unconscious(5) + M.afflict_unconscious(20 * 5) sleep(5) if(!M) return @@ -1135,7 +1135,7 @@ for(var/obj/item/I in M.get_equipped_items(TRUE, TRUE)) M.drop_item_to_ground(I, INV_OP_FORCE) - M.Unconscious(5) + M.afflict_unconscious(20 * 5) sleep(5) M.loc = pick(tdome1) spawn(50) @@ -1160,7 +1160,7 @@ for(var/obj/item/I in M.get_equipped_items(TRUE, TRUE)) M.drop_item_to_ground(I, INV_OP_FORCE) - M.Unconscious(5) + M.afflict_unconscious(20 * 5) sleep(5) M.loc = pick(tdome2) spawn(50) @@ -1182,7 +1182,7 @@ to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return - M.Unconscious(5) + M.afflict_unconscious(20 * 5) sleep(5) M.loc = pick(tdomeadmin) spawn(50) @@ -1211,7 +1211,7 @@ var/mob/living/carbon/human/observer = M observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), SLOT_ID_UNIFORM) observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), SLOT_ID_SHOES) - M.Unconscious(5) + M.afflict_unconscious(20 * 5) sleep(5) M.loc = pick(tdomeobserve) spawn(50) diff --git a/code/modules/admin/verbs/lightning_strike.dm b/code/modules/admin/verbs/lightning_strike.dm index bda0f237083..45b2e2eb2f8 100644 --- a/code/modules/admin/verbs/lightning_strike.dm +++ b/code/modules/admin/verbs/lightning_strike.dm @@ -91,7 +91,7 @@ // Deafen them. if(L.get_ear_protection() < 2) - L.AdjustSleeping(-100) + L.adjust_sleeping(20 * -100) if(iscarbon(L)) var/mob/living/carbon/C = L C.ear_deaf += 10 diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 7404c807a2d..8afad5db5c6 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -30,7 +30,7 @@ for(var/obj/item/I in M.get_equipped_items(TRUE, TRUE)) M.drop_item_to_ground(I, INV_OP_FORCE) //teleport person to cell - M.Unconscious(5) + M.afflict_unconscious(20 * 5) sleep(5) //so they black out before warping M.loc = pick(prisonwarp) if(istype(M, /mob/living/carbon/human)) @@ -169,11 +169,11 @@ if(!holder) to_chat(src, "Only administrators may use this command.") return - M.status_flags ^= GODMODE - to_chat(usr, " Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]") + M.status_flags ^= STATUS_GODMODE + to_chat(usr, " Toggled [(M.status_flags & STATUS_GODMODE) ? "ON" : "OFF"]") - log_admin("[key_name(usr)] has toggled [key_name(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]") - var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]" + log_admin("[key_name(usr)] has toggled [key_name(M)]'s nodamage to [(M.status_flags & STATUS_GODMODE) ? "On" : "Off"]") + var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(M)]'s nodamage to [(M.status_flags & STATUS_GODMODE) ? "On" : "Off"]" message_admins(msg) admin_ticket_log(M, msg) feedback_add_details("admin_verb","GOD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/smite.dm b/code/modules/admin/verbs/smite.dm index 0e876de9151..3c0227b1140 100644 --- a/code/modules/admin/verbs/smite.dm +++ b/code/modules/admin/verbs/smite.dm @@ -136,8 +136,8 @@ target.gib() else target.adjustBruteLoss( min( 99 , (target.health - 1) ) ) - target.Stun(20) - target.Weaken(20) + target.afflict_stun(20 * 20) + target.afflict_paralyze(20 * 20) target.stuttering = 20 /proc/fake_autosave(var/mob/living/target, var/client/user, var/wide) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index b4eade54640..32f162db852 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -30,15 +30,15 @@ if("feet") if(!H.shoes) affecting = H.get_organ(pick("l_leg", "r_leg")) - H.Weaken(3) + H.afflict_paralyze(20 * 3) if("l_hand", "r_hand") if(!H.gloves) affecting = H.get_organ(type) - H.Stun(3) + H.afflict_stun(20 * 3) if(affecting) if(affecting.take_damage(1, 0)) H.UpdateDamageIcon() - H.updatehealth() + H.update_health() else if(ismouse(target)) var/mob/living/simple_mob/animal/passive/mouse/M = target visible_message("SPLAT!") diff --git a/code/modules/atmospherics/environmental/zas/airflow.dm b/code/modules/atmospherics/environmental/zas/airflow.dm index dace21cd68c..b9eadaffffd 100644 --- a/code/modules/atmospherics/environmental/zas/airflow.dm +++ b/code/modules/atmospherics/environmental/zas/airflow.dm @@ -11,7 +11,7 @@ Contains helper procs for airflow, handled in /connection_group. CACHE_VSC_PROP(atmos_vsc, /atmos/airflow/stun_cooldown, stuncd) if(last_airflow_stun > world.time - stuncd) return 0 - if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN)) + if(!(status_flags & STATUS_CAN_STUN) && !(status_flags & STATUS_CAN_PARALYZE)) to_chat(src, "You stay upright as the air rushes past you.") return 0 if(buckled) @@ -19,7 +19,7 @@ Contains helper procs for airflow, handled in /connection_group. return 0 if(!lying) to_chat(src, "The sudden rush of air knocks you over!") - Weaken(2) + afflict_paralyze(20 * 2) last_airflow_stun = world.time /mob/living/silicon/airflow_stun() @@ -85,7 +85,7 @@ Contains helper procs for airflow, handled in /connection_group. return 1 /mob/AirflowCanMove(n) - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return 0 if(buckled) return 0 @@ -111,7 +111,7 @@ Contains helper procs for airflow, handled in /connection_group. M.show_message("\The [src] slams into \a [A]!",1,"You hear a loud slam!",2) playsound(src.loc, "smash.ogg", 25, 1, -1) var/weak_amt = istype(A,/obj/item) ? A:w_class : rand(1,5) //Heheheh - Weaken(weak_amt) + afflict_paralyze(20 * weak_amt) return ..() /obj/airflow_hit(atom/A) @@ -149,10 +149,10 @@ Contains helper procs for airflow, handled in /connection_group. GET_VSC_PROP(atmos_vsc, /atmos/airflow/impact_stun, impact_stun) if(airflow_speed > 10) - Unconscious(round(airflow_speed * impact_stun)) - Stun(paralysis + 3) + afflict_unconscious(20 * round(airflow_speed * impact_stun)) + afflict_stun(20 * (round(airflow_speed * impact_stun) + 3)) else - Stun(round(airflow_speed * impact_stun/2)) + afflict_stun(20 * round(airflow_speed * impact_stun/2)) return ..() /datum/zas_zone/proc/movables() diff --git a/code/modules/atmospherics/environmental/zas/edge.dm b/code/modules/atmospherics/environmental/zas/edge.dm index 5d1c536271f..daac8360c8f 100644 --- a/code/modules/atmospherics/environmental/zas/edge.dm +++ b/code/modules/atmospherics/environmental/zas/edge.dm @@ -104,7 +104,7 @@ Class Procs: //Check for knocking people over if(ismob(M) && differential > stun_pressure) - if(M:status_flags & GODMODE) + if(M:status_flags & STATUS_GODMODE) continue M:airflow_stun() diff --git a/code/modules/atmospherics/environmental/zas/phoron.dm b/code/modules/atmospherics/environmental/zas/phoron.dm index 83c98e60a8f..2fc1d8d7f21 100644 --- a/code/modules/atmospherics/environmental/zas/phoron.dm +++ b/code/modules/atmospherics/environmental/zas/phoron.dm @@ -68,7 +68,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') burn_skin(0.75) if(prob(20)) to_chat(src, SPAN_USERDANGER("Your skin burns!")) - updatehealth() + update_health() //Burn eyes if exposed. if(eye_burns && species.breath_type && (species.breath_type != /datum/gas/phoron)) diff --git a/code/modules/catalogue/cataloguer.dm b/code/modules/catalogue/cataloguer.dm index dcbb58fbe45..53b51910a66 100644 --- a/code/modules/catalogue/cataloguer.dm +++ b/code/modules/catalogue/cataloguer.dm @@ -114,7 +114,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) // The delay, and test for if the scan succeeds or not. var/scan_start_time = world.time - if(do_after(user, scan_delay, target, ignore_movement = TRUE, max_distance = scan_range)) + if(do_after(user, scan_delay, target, DO_AFTER_IGNORE_MOVEMENT, max_distance = scan_range)) if(target.can_catalogue(user)) to_chat(user, SPAN_NOTICE("You successfully scan \the [target] with \the [src].")) playsound(src.loc, 'sound/machines/ping.ogg', 50) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 81bdab96688..5a79a3a3b99 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -184,7 +184,8 @@ var/mob/source = mob.get_looc_source() var/turf/T = get_turf(source) - if(!T) return + if(!T) + return var/list/in_range = get_mobs_and_objs_in_view_fast(T,world.view,0) var/list/m_viewers = in_range["mobs"] diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 063164c8705..d0ea537af57 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -461,7 +461,7 @@ BLIND // can't see anything set name = "Adjust welding goggles" set src in usr - if(usr.canmove && !usr.stat && !usr.restrained()) + if(CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) if(src.up) src.up = !src.up inv_hide_flags |= HIDEEYES @@ -686,7 +686,7 @@ BLIND // can't see anything set name = "Adjust Orange Goggles" set src in usr - if(usr.canmove && !usr.stat && !usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) if(src.up) src.up = !src.up inv_hide_flags |= HIDEEYES diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 80cb652787d..881bb0ce7f4 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -46,7 +46,7 @@ if(!base_state) base_state = icon_state - if(usr.canmove && !usr.stat && !usr.restrained()) + if(CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) if(src.up) src.up = !src.up body_cover_flags |= (EYES|FACE) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 2e57556a1c5..3aae23b9922 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -51,7 +51,7 @@ action_button_name = "Adjust Face Mask" /obj/item/clothing/mask/gas/half/proc/adjust_mask(mob/user) - if(usr.canmove && !usr.stat) + if(CHECK_MOBILITY(user, MOBILITY_CAN_USE)) src.hanging = !src.hanging if (src.hanging) gas_transfer_coefficient = 1 @@ -112,7 +112,7 @@ action_button_name = "Toggle Feeding Port" /obj/item/clothing/mask/gas/swat/vox/proc/feeding_port(mob/user) - if(user.canmove && !user.stat) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) mask_open = !mask_open if(mask_open) body_cover_flags = EYES diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index dbd984ce1a1..027c997ed8e 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -39,7 +39,7 @@ var/hanging = 0 /obj/item/clothing/mask/surgical/proc/adjust_mask(mob_user) - if(usr.canmove && !usr.stat) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) src.hanging = !src.hanging if (src.hanging) gas_transfer_coefficient = 1 diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index fc036f2f676..f1ecfd37958 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -67,7 +67,7 @@ set name = "Toggle Coat Buttons" set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 if(open == 1) //Will check whether icon state is currently set to the "open" or "closed" state and switch it around with a message to the user @@ -101,7 +101,7 @@ set name ="Adjust Badge" set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 if(icon_state == icon_badge) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 735bbed0388..db8b506708b 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -292,7 +292,7 @@ SPAN_WARNING("[user] is trying to set your sensors!") ) var/mob/M = worn_mob() - if(do_after(user, HUMAN_STRIP_DELAY, M, FALSE)) + if(do_after(user, HUMAN_STRIP_DELAY, M, DO_AFTER_IGNORE_ACTIVE_ITEM)) . = strip_menu_sensor_interact(user, M) /obj/item/clothing/under/proc/strip_menu_sensor_interact(mob/user, mob/wearer = worn_mob()) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 3dff066ad7e..a4280089b6b 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -219,7 +219,7 @@ var/obj/item/organ/internal/heart/heart = H.internal_organs_by_name[O_HEART] if(heart && !(heart.robotic >= ORGAN_ROBOT)) heartbeat = 1 - if(H.stat == DEAD || (H.status_flags&FAKEDEATH)) + if(H.stat == DEAD || (H.status_flags&STATUS_FAKEDEATH)) sound_strength = "cannot hear" sound = "anything" else @@ -723,7 +723,7 @@ var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(3, 1, M) s.start() - M.Weaken(10) + M.afflict_paralyze(20 * 10) return /obj/item/clothing/accessory/collar/shock/attack_self(mob/user as mob, flag1) diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index f0f64867ee8..d52f993283d 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -35,7 +35,7 @@ continue to_chat(S, "Your integrated sensors detect an ionospheric anomaly. Your systems will be impacted as you begin a partial restart.") var/ionbug = rand(3, 9) - S.confused += ionbug + S.Confuse(ionbug) S.eye_blurry += (ionbug - 1) // Ionize silicon mobs diff --git a/code/modules/events/meteor_strike_vr.dm b/code/modules/events/meteor_strike_vr.dm index f3b4b3430ab..888ba073619 100644 --- a/code/modules/events/meteor_strike_vr.dm +++ b/code/modules/events/meteor_strike_vr.dm @@ -64,7 +64,7 @@ if(!L.buckled && !issilicon(L)) if(!L.Check_Shoegrip()) L.throw_at_old(get_step_rand(L),1,5) - L.Weaken(5) + L.afflict_paralyze(20 * 5) if(L.client) to_chat(L, "The ground lurches beneath you!") shake_camera(L, 6, 1) diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 338bafd780f..a3355201a7c 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -35,7 +35,7 @@ var/list/dreams = list( for(var/i = rand(1,4),i > 0, i--) to_chat(src, "... [pick(dreams)] ...") sleep(rand(40,70)) - if(paralysis <= 0) + if(!is_sleeping()) dreaming = 0 return dreaming = 0 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 15769bd047c..00d52f74c19 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -168,12 +168,12 @@ Gunshots/explosions/opening doors/less rare audio (done) if(71 to 72) //Fake death // src.sleeping_willingly = 1 - SetSleeping(20) + set_sleeping(20 * 20) hal_crit = 1 hal_screwyhud = 1 spawn(rand(50,100)) // src.sleeping_willingly = 0 - SetSleeping(0) + set_sleeping(0) hal_crit = 0 hal_screwyhud = 0 handling_hal = 0 diff --git a/code/modules/genetics/side_effects.dm b/code/modules/genetics/side_effects.dm index 6a93578fe86..582bfd5ff51 100644 --- a/code/modules/genetics/side_effects.dm +++ b/code/modules/genetics/side_effects.dm @@ -9,12 +9,12 @@ spawn(20) if(!istype(H)) return - H.Weaken(rand(0, S.duration / 50)) + H.afflict_paralyze(20 * rand(0, S.duration / 50)) sleep(S.duration) if(!istype(H)) return - H.SetWeakened(0) + H.set_paralyzed(0) S.finish(H) /datum/genetics/side_effect diff --git a/code/modules/ghostroles/instantiator.dm b/code/modules/ghostroles/instantiator.dm index 58bc071225a..b1aa9a5408a 100644 --- a/code/modules/ghostroles/instantiator.dm +++ b/code/modules/ghostroles/instantiator.dm @@ -2,7 +2,7 @@ * Handles mob creation, equip, and ckey transfer. */ /datum/ghostrole_instantiator - /// traits to add to mob : will be made with ROLE_TRAIT source + /// traits to add to mob : will be made with GHOSTROLE_TRAIT source var/list/mob_traits /datum/ghostrole_instantiator/proc/Run(client/C, atom/location, list/params) @@ -33,7 +33,7 @@ CRASH("Invalid path: [type_to_make]") var/mob/living/L = new type_to_make(location) for(var/trait in mob_traits) - ADD_TRAIT(L, trait, ROLE_TRAIT) + ADD_TRAIT(L, trait, GHOSTROLE_TRAIT) return L /datum/ghostrole_instantiator/simple/proc/GetMobType(client/C, atom/location, list/params) @@ -46,7 +46,7 @@ /datum/ghostrole_instantiator/human/Create(client/C, atom/location, list/params) var/mob/living/carbon/human/H = new(location) for(var/trait in mob_traits) - ADD_TRAIT(H, trait, ROLE_TRAIT) + ADD_TRAIT(H, trait, GHOSTROLE_TRAIT) return H /datum/ghostrole_instantiator/human/Equip(client/C, mob/M, list/params) diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 4bf5b3a078d..f607a80d653 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -181,12 +181,12 @@ if(2) M.visible_message("[user] bashes [M] against \the [src]!") if (prob(50)) - M.Weaken(1) + M.afflict_paralyze(20 * 1) M.apply_damage(10) hit(25) if(3) M.visible_message("[user] crushes [M] against \the [src]!") - M.Weaken(5) + M.afflict_paralyze(20 * 5) M.apply_damage(20) hit(50) return @@ -374,7 +374,7 @@ to_chat(user, "You need a better grip to do that!") return G.affecting.loc = src.loc - G.affecting.Weaken(5) + G.affecting.afflict_paralyze(20 * 5) visible_message("[G.assailant] dunks [G.affecting] into the [src]!", 3) qdel(W) return diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 7eea3a2d329..cb1aa99cc2b 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -159,8 +159,8 @@ M.stop_pulling() to_chat(M, "You slipped on the [name]!") playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) - M.Stun(8) - M.Weaken(5) + M.afflict_stun(20 * 8) + M.afflict_paralyze(20 * 5) seed.thrown_at(src,M) qdel(src) return diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index ce0c8586f53..2955ef77163 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -69,15 +69,9 @@ /obj/effect/plant/proc/unbuckle() - if(has_buckled_mobs()) - for(var/A in buckled_mobs) - var/mob/living/L = A - if(L.buckled == src) - L.buckled = null - L.anchored = initial(L.anchored) - L.update_canmove() - buckled_mobs = list() - return + if(!has_buckled_mobs()) + return + unbuckle_all_mobs(BUCKLE_OP_FORCE) /obj/effect/plant/proc/manual_unbuckle(mob/user as mob) if(has_buckled_mobs()) @@ -131,11 +125,11 @@ buckle_mob(victim) victim.setDir(pick(GLOB.cardinal)) to_chat(victim, "Tendrils [pick("wind", "tangle", "tighten")] around you!") - victim.Weaken(1) + victim.afflict_paralyze(20 * 1) victim.adjustToxLoss(rand(0.5,1.25)) seed.do_thorns(victim,src) else // Adding a non-grab attack chance since we will be increasing the rate at which the vines check for nearby targets src.visible_message("Tendrils lash out from \the [src] and swipe across [victim]!") - victim.Weaken(1.5) + victim.afflict_paralyze(20 * 1.5) victim.adjustToxLoss(rand(1,3.5)) attack_mob(victim,rand(2,3.5)) diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 720d036ee7a..68f55de5bfe 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -155,7 +155,7 @@ if(istype(user,/mob/living/carbon/alien/diona)) var/mob/living/carbon/alien/diona/nymph = user - if(nymph.stat == DEAD || nymph.paralysis || nymph.weakened || nymph.stunned || nymph.restrained()) + if(!CHECK_MOBILITY(nymph, MOBILITY_CAN_USE)) return if(weedlevel > 0) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 12b7d282df5..e47dcedf6f1 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -58,7 +58,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.restrained() || !in_range(loc, usr)) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE) || !in_range(loc, user)) return if(ishuman(user)) if(!user.get_active_held_item()) diff --git a/code/modules/maps/away_missions/archive/labyrinth.dm b/code/modules/maps/away_missions/archive/labyrinth.dm index 168ea400a0e..b6b61df3222 100644 --- a/code/modules/maps/away_missions/archive/labyrinth.dm +++ b/code/modules/maps/away_missions/archive/labyrinth.dm @@ -174,10 +174,10 @@ M.sleeping = 0 M.stuttering += 20 M.ear_deaf += 30 - M.Weaken(3) + M.afflict_paralyze(20 * 3) if(prob(30)) - M.Stun(10) - M.Unconscious(4) + M.afflict_stun(20 * 10) + M.afflict_unconscious(20 * 4) else M.make_jittery(500) chassis.use_power(energy_drain) @@ -292,7 +292,7 @@ melee_damage_upper = 1 attacktext = "honked" attack_sound = 'sound/items/bikehorn.ogg' - status_flags = CANPUSH + status_flags = STATUS_CAN_PUSH min_oxy = 5 max_oxy = 0 min_tox = 0 diff --git a/code/modules/maps/away_missions/archive/wildwest.dm b/code/modules/maps/away_missions/archive/wildwest.dm index 1f3e1437a5e..f343556da93 100644 --- a/code/modules/maps/away_missions/archive/wildwest.dm +++ b/code/modules/maps/away_missions/archive/wildwest.dm @@ -161,9 +161,9 @@ C.setToxLoss(0) C.setOxyLoss(0) C.setCloneLoss(0) - C.SetUnconscious(0) - C.SetStunned(0) - C.SetWeakened(0) + C.set_unconscious(0) + C.set_stunned(0) + C.set_paralyzed(0) C.radiation = 0 C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss()) C.reagents.clear_reagents() diff --git a/code/modules/maps/overmap/space/alienship.dm b/code/modules/maps/overmap/space/alienship.dm index 90b05f73de7..083d12fcc3c 100644 --- a/code/modules/maps/overmap/space/alienship.dm +++ b/code/modules/maps/overmap/space/alienship.dm @@ -168,7 +168,7 @@ for(var/obj/item/holder/H in L.get_all_contents()) H.forceMove(get_turf(L)) abduct(H) - L.Unconscious(10) + L.afflict_unconscious(20 * 10) L.forceMove(get_turf(pick(teleport_to))) L << 'sound/effects/bamf.ogg' to_chat(L,"You're starting to come to. You feel like you've been out for a few minutes, at least...") diff --git a/code/modules/maps/weather/rift_lythios-43c.dm b/code/modules/maps/weather/rift_lythios-43c.dm index 4a59fa7de3b..01d09847aa6 100644 --- a/code/modules/maps/weather/rift_lythios-43c.dm +++ b/code/modules/maps/weather/rift_lythios-43c.dm @@ -333,7 +333,7 @@ var/datum/planet/lythios43c/planet_lythios43c = null var/obj/item/melee/umbrella/U = L.get_active_held_item() if(U.open) to_chat(L, "You struggle to keep hold of your umbrella!") - L.Stun(20) // This is not nearly as long as it seems + L.afflict_stun(20 * 20) // This is not nearly as long as it seems playsound(L, 'sound/effects/rustle1.ogg', 100, 1) // Closest sound I've got to "Umbrella in the wind" else if(istype(L.get_inactive_held_item(), /obj/item/melee/umbrella)) var/obj/item/melee/umbrella/U = L.get_inactive_held_item() diff --git a/code/modules/maps/weather/tether_virgo3b.dm b/code/modules/maps/weather/tether_virgo3b.dm index 8f3e0bb21f8..8e6cb915035 100644 --- a/code/modules/maps/weather/tether_virgo3b.dm +++ b/code/modules/maps/weather/tether_virgo3b.dm @@ -364,7 +364,7 @@ var/obj/item/melee/umbrella/U = L.get_active_held_item() if(U.open) to_chat(L, "You struggle to keep hold of your umbrella!") - L.Stun(20) // This is not nearly as long as it seems + L.afflict_stun(20 * 20) // This is not nearly as long as it seems playsound(L, 'sound/effects/rustle1.ogg', 100, 1) // Closest sound I've got to "Umbrella in the wind" else if(istype(L.get_inactive_held_item(), /obj/item/melee/umbrella)) var/obj/item/melee/umbrella/U = L.get_inactive_held_item() diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 65dffe3c1dd..8071a85b22d 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -90,7 +90,7 @@ var/global/list/total_extraction_beacons = list() var/mutable_appearance/balloon3 if(isliving(A)) var/mob/living/M = A - M.AdjustStunned(10) // Keep them from moving during the duration of the extraction + M.adjust_stunned(20 * 10) // Keep them from moving during the duration of the extraction if(M.buckled) M.buckled.unbuckle_mob(M) else @@ -124,7 +124,7 @@ var/global/list/total_extraction_beacons = list() animate(holder_obj, pixel_z = 1000, time = 30) if(ishuman(A)) var/mob/living/carbon/L = A - L.AdjustStunned(stuntime) + L.adjust_stunned(20 * stuntime) L.drowsyness = 0 sleep(30) var/list/flooring_near_beacon = list() diff --git a/code/modules/mining/kinetic_crusher.dm b/code/modules/mining/kinetic_crusher.dm index 56dfa221d7e..988d3e0f952 100644 --- a/code/modules/mining/kinetic_crusher.dm +++ b/code/modules/mining/kinetic_crusher.dm @@ -120,7 +120,7 @@ if(!wielded && requires_wield) to_chat(user, "[src] is too heavy to use with one hand.") return - var/datum/status_effect/crusher_damage/C = L.has_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING) + var/datum/status_effect/crusher_damage/C = L.has_status_effect(/datum/status_effect/crusher_damage) var/target_health = L.health . = ..() /* @@ -164,10 +164,10 @@ detonate(target, user) /obj/item/kinetic_crusher/proc/detonate(mob/living/L, mob/living/user, thrown = FALSE) - var/datum/status_effect/crusher_mark/CM = L.has_status_effect(STATUS_EFFECT_CRUSHERMARK) - if(!CM || CM.hammer_synced != src || !L.remove_status_effect(STATUS_EFFECT_CRUSHERMARK)) + var/datum/status_effect/grouped/crusher_mark/CM = L.has_status_effect(/datum/status_effect/grouped/crusher_mark) + if(!CM || CM.hammer_synced != src || !L.remove_status_effect(/datum/status_effect/grouped/crusher_mark)) return - var/datum/status_effect/crusher_damage/C = L.has_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING) + var/datum/status_effect/crusher_damage/C = L.has_status_effect(/datum/status_effect/crusher_damage) var/target_health = L.health /* for(var/t in trophies) @@ -198,7 +198,7 @@ if(!isliving(A)) return var/mob/living/L = A - if(!L.has_status_effect(STATUS_EFFECT_CRUSHERMARK)) + if(!L.has_status_effect(/datum/status_effect/grouped/crusher_mark)) detonate(L, TT.thrower, TRUE) /obj/item/kinetic_crusher/proc/Recharge() @@ -321,9 +321,10 @@ /obj/projectile/destabilizer/on_hit(atom/target, blocked = FALSE) if(isliving(target)) var/mob/living/L = target - L.apply_status_effect(STATUS_EFFECT_CRUSHERMARK, hammer_synced) - // var/had_effect = (L.has_status_effect(STATUS_EFFECT_CRUSHERMARK)) //used as a boolean - // var/datum/status_effect/crusher_mark/CM = L.apply_status_effect(STATUS_EFFECT_CRUSHERMARK, hammer_synced) + if(hammer_synced.can_mark(L)) + L.apply_status_effect(/datum/status_effect/grouped/crusher_mark, hammer_synced) + // var/had_effect = (L.has_status_effect(/datum/status_effect/grouped/crusher_mark)) //used as a boolean + // var/datum/status_effect/grouped/crusher_mark/CM = L.apply_status_effect(/datum/status_effect/grouped/crusher_mark, hammer_synced) /* if(hammer_synced) for(var/t in hammer_synced.trophies) diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index c02113683d5..f01bf4efc1b 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -695,7 +695,7 @@ else M.flash_eyes() if(prob(50)) - M.Stun(5) + M.afflict_stun(20 * 5) new /obj/item/artifact_shards(src, 1000, rand(0.5 MINUTES, 3 MINUTES), RAD_FALLOFF_ANOMALY_SHARDS) if(prob(25)) excavate_find(prob(5), finds[1]) diff --git a/code/modules/mob/_modifiers/modifiers_misc.dm b/code/modules/mob/_modifiers/modifiers_misc.dm index b9427c4b8b7..339d3882d4d 100644 --- a/code/modules/mob/_modifiers/modifiers_misc.dm +++ b/code/modules/mob/_modifiers/modifiers_misc.dm @@ -87,12 +87,12 @@ the artifact triggers the rage. holder.visible_message("\The [holder] descends into an all consuming rage!") // End all stuns. - holder.SetUnconscious(0) - holder.SetStunned(0) - holder.SetWeakened(0) + holder.set_unconscious(0) + holder.set_stunned(0) + holder.set_paralyzed(0) holder.setHalLoss(0) holder.lying = 0 - holder.update_canmove() + holder.update_mobility() // Temporarily end pain. if(ishuman(holder)) @@ -106,7 +106,7 @@ the artifact triggers the rage. if(prob(last_shock_stage)) to_chat(holder, "You pass out from the pain you were suppressing.") - holder.Unconscious(5) + holder.afflict_unconscious(20 * 5) if(ishuman(holder)) var/mob/living/carbon/human/H = holder @@ -302,11 +302,11 @@ the artifact triggers the rage. /datum/modifier/poisoned/paralysis/tick() ..() if(prob(5)) - holder.Unconscious(3) + holder.afflict_unconscious(20 * 3) /datum/modifier/poisoned/paralysis/on_applied() ..() - holder.Unconscious(4) + holder.afflict_unconscious(20 * 4) // Pulse modifier. /datum/modifier/false_pulse diff --git a/code/modules/mob/_modifiers/unholy.dm b/code/modules/mob/_modifiers/unholy.dm index 27a334fa31c..ffb52055668 100644 --- a/code/modules/mob/_modifiers/unholy.dm +++ b/code/modules/mob/_modifiers/unholy.dm @@ -144,7 +144,7 @@ H.apply_effect(2, AGONY) if(prob(10)) to_chat(H, "It feels as though your body is being torn apart!") - L.updatehealth() + L.update_health() /datum/modifier/gluttonyregeneration name = "gluttonous regeneration" diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 300563b8cd1..f3a67f6e725 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -2,8 +2,12 @@ name = "observer" desc = "This shouldn't appear" density = 0 + mobility_flags = NONE cached_multiplicative_slowdown = 0.5 // 20 tiles per second +/mob/observer/update_mobility() + return + /mob/observer/dead name = "ghost" desc = "It's a g-g-g-g-ghooooost!" //jinkies! @@ -13,7 +17,7 @@ plane = PLANE_GHOSTS alpha = 127 stat = DEAD - canmove = FALSE + mobility_flags = NONE blinded = FALSE anchored = TRUE invisibility = INVISIBILITY_OBSERVER @@ -174,14 +178,8 @@ . = ..() return TRUE -/mob/observer/dead/set_stat(var/new_stat) - if(new_stat != DEAD) - CRASH("It is best if observers stay dead, thank you.") - -/* -Transfer_mind is there to check if mob is being deleted/not going to have a body. -Works together with spawning an observer, noted above. -*/ +/mob/observer/dead/set_stat(new_stat, update_mobility = TRUE) + CRASH("It is best if observers stay dead, thank you.") /mob/observer/dead/Life(seconds, times_fired) if((. = ..())) diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 6900cd96bcf..33eb3ab1a32 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -2,11 +2,10 @@ //added different sort of gibs and animations. N /mob/proc/gib(anim="gibbed-m", do_gibs, gib_file = 'icons/mob/mob.dmi') death(1) - transforming = 1 - canmove = 0 + transforming = TRUE + mobility_flags = NONE icon = null invisibility = 101 - update_canmove() dead_mob_list -= src var/atom/movable/overlay/animation = null @@ -28,8 +27,8 @@ /mob/proc/dust(anim="dust-m",remains=/obj/effect/debris/cleanable/ash) death(1) var/atom/movable/overlay/animation = null - transforming = 1 - canmove = 0 + transforming = TRUE + mobility_flags = NONE icon = null invisibility = 101 @@ -70,7 +69,7 @@ set_stat(DEAD) - update_canmove() + update_mobility() dizziness = 0 jitteriness = 0 diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 059a8a71a60..65dda263cfc 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -7,7 +7,8 @@ return var/muzzled = is_muzzled() - if(m_type == 2 && muzzled) return + if(m_type == 2 && muzzled) + return var/input if(!message) diff --git a/code/modules/mob/freelook/eye.dm b/code/modules/mob/freelook/eye.dm index 337b4b7b325..60ad689c77e 100644 --- a/code/modules/mob/freelook/eye.dm +++ b/code/modules/mob/freelook/eye.dm @@ -16,7 +16,7 @@ var/slowdown = 1 //people said this was too fast. meh. see_in_dark = 7 - status_flags = GODMODE + status_flags = STATUS_GODMODE plane = PLANE_AI_EYE var/mob/owner = null diff --git a/code/modules/mob/grab.dm b/code/modules/mob/grab.dm index 09cc18eb3d7..341b2210784 100644 --- a/code/modules/mob/grab.dm +++ b/code/modules/mob/grab.dm @@ -19,13 +19,13 @@ /** * check the grab state of us to someone + * + * @return grab state, or null */ /mob/proc/check_grab(mob/M) for(var/obj/item/grab/G in get_held_items()) if(G.affecting == M) return G.state - // CRASH("in grabbed by but no grab item?") - /** * drops our grab to someone immediately */ @@ -34,6 +34,29 @@ if(G.affecting == M) qdel(G) +/** + * drops all grabs immediately + */ +/mob/proc/drop_grabs() + for(var/obj/item/grab/G in get_held_items()) + qdel(G) + +/** + * are we being grabbed + * + * @return TRUE / FALSE + */ +/mob/proc/is_grabbed() + return length(grabbed_by) + +/** + * are we being grabbed by someone + * + * @return null, or state + */ +/mob/proc/is_grabbed_by(mob/M) + return (M in grabbed_by)? M.check_grab(src) : null + #define UPGRADE_COOLDOWN 40 #define UPGRADE_KILL_TIMER 100 @@ -44,7 +67,7 @@ //if we are being grabbed if(isliving(mob)) var/mob/living/L = mob - if(!L.canmove && L.grabbed_by.len) + if(!CHECK_MOBILITY(L, MOBILITY_CAN_MOVE) && L.grabbed_by.len) L.resist() //shortcut for resisting grabs //if we are grabbing someone @@ -170,15 +193,15 @@ if(affecting.loc != assailant.loc || size_difference(affecting, assailant) > 0) force_down = 0 else - affecting.Weaken(2) + affecting.afflict_paralyze(20 * 2) if(state >= GRAB_NECK) - affecting.Stun(3) + affecting.afflict_stun(20 * 3) if(state >= GRAB_KILL) //affecting.apply_effect(STUTTER, 5) //would do this, but affecting isn't declared as mob/living for some stupid reason. affecting.stuttering = max(affecting.stuttering, 5) //It will hamper your voice, being choked and all. - affecting.Weaken(5) //Should keep you down unless you get help. + affecting.afflict_paralyze(20 * 5) //Should keep you down unless you get help. affecting.losebreath = max(affecting.losebreath + 2, 3) adjust_position() @@ -277,7 +300,7 @@ return if(world.time < (last_action + UPGRADE_COOLDOWN)) return - if(!assailant.canmove || assailant.lying) + if(!CHECK_ALL_MOBILITY(assailant, MOBILITY_CAN_USE | MOBILITY_IS_STANDING)) qdel(src) return @@ -309,7 +332,7 @@ add_attack_logs(assailant,affecting,"Neck grabbed") hud.icon_state = "kill" hud.name = "kill" - affecting.Stun(10) //10 ticks of ensured grab + affecting.afflict_stun(20 * 10) //10 ticks of ensured grab else if(state < GRAB_KILL) assailant.visible_message("[assailant] starts to tighten [TU.his] grip on [affecting]'s neck!") hud.icon_state = "kill1" @@ -405,7 +428,7 @@ if(GRAB_NECK) grab_name = "headlock" //If the you move when grabbing someone then it's easier for them to break free. Same if the affected mob is immune to stun. - if(world.time - assailant.l_move_time < 30 || !affecting.stunned) + if(world.time - assailant.l_move_time < 30 || !affecting.is_stunned()) break_strength++ break_chance_table = list(3, 18, 45, 100) @@ -586,8 +609,7 @@ /obj/item/grab/proc/apply_pinning(mob/target, mob/attacker) force_down = 1 - target.Weaken(3) - target.lying = 1 + target.afflict_paralyze(20 * 3) step_to(attacker, target) attacker.setDir(EAST) //face the victim target.setDir(SOUTH) //face up diff --git a/code/modules/mob/health.dm b/code/modules/mob/health.dm index dbe2ece85fd..4d888f420f7 100644 --- a/code/modules/mob/health.dm +++ b/code/modules/mob/health.dm @@ -1,5 +1,39 @@ /** * are we in critical? + * + * todo: this is silly, brainmed when */ /mob/proc/is_in_critical() return FALSE + +/** + * update health + */ +/mob/proc/update_health() + return + +/** + * update stat, return new stat + * + * @params + * * forced - misnomer; this is not always respected. this is used by child calls to be able to force itself to be unconscious without more snowflake than necessary. parent calls should not go higher than forced. + * * update_mobility - update mobility after + */ +/mob/proc/update_stat(forced, update_mobility = TRUE) + . = forced || initial(stat) + if(. != stat) + set_stat(., update_mobility) + +/** + * set stat + * should only be called internally by update_stat(). + */ +/mob/proc/set_stat(new_stat, update_mobility = TRUE) + if(stat == new_stat) + return + stat = new_stat + mobility_flags = (mobility_flags & ~(MOBILITY_IS_CONSCIOUS)) | (STAT_IS_CONSCIOUS(new_stat)? MOBILITY_IS_CONSCIOUS : NONE) + if(!STAT_IS_CONSCIOUS(new_stat)) + facing_dir = null + if(update_mobility) + update_mobility() diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 1631a5a92c9..9779d52ec32 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -20,7 +20,7 @@ italics = 1 sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact - if(sleeping || stat == 1) + if(IS_ALIVE_BUT_UNCONSCIOUS(src)) hear_sleep(message) return @@ -159,7 +159,7 @@ playsound(loc, 'sound/effects/radiochatter.ogg', 10, 0, -1, falloff = -3) last_radio_sound = world.time - if(sleeping || stat==1) //If unconscious or sleeping + if(IS_ALIVE_BUT_UNCONSCIOUS(src)) //If unconscious or sleeping hear_sleep(message) return diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index 00ecee4e64d..45860fd7af3 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -158,7 +158,7 @@ if(isliving(target)) var/mob/living/L = target if(prob(10)) - L.Stun(2) + L.afflict_stun(20 * 2) //Roach Types /obj/item/holder/roach diff --git a/code/modules/mob/inventory/items.dm b/code/modules/mob/inventory/items.dm index 602c61504fc..d54695422e7 100644 --- a/code/modules/mob/inventory/items.dm +++ b/code/modules/mob/inventory/items.dm @@ -34,6 +34,7 @@ /obj/item/proc/equipped(mob/user, slot, flags) SHOULD_CALL_PARENT(TRUE) SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot, flags) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_EQUIPPED, user, slot, flags) worn_slot = slot if(!(flags & INV_OP_IS_ACCESSORY)) // todo: shouldn't be in here @@ -57,6 +58,7 @@ /obj/item/proc/unequipped(mob/user, slot, flags) SHOULD_CALL_PARENT(TRUE) SEND_SIGNAL(src, COMSIG_ITEM_UNEQUIPPED, user, slot, flags) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_UNEQUIPPED, user, slot, flags) worn_slot = null if(!(flags & INV_OP_IS_ACCESSORY)) // todo: shouldn't be in here @@ -91,6 +93,7 @@ user.handle_actions() . = SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user, flags, newLoc) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_DROPPED, src, flags, newLoc) if(!(flags & INV_OP_SUPPRESS_SOUND) && isturf(newLoc) && !(. & COMPONENT_ITEM_DROPPED_SUPPRESS_SOUND)) playsound(src, drop_sound, 30, ignore_walls = FALSE) @@ -108,6 +111,7 @@ /obj/item/proc/pickup(mob/user, flags, atom/oldLoc) SHOULD_CALL_PARENT(TRUE) SEND_SIGNAL(src, COMSIG_ITEM_PICKUP, user, flags, oldLoc) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_PICKUP, src, flags, oldLoc) pixel_x = initial(pixel_x) pixel_y = initial(pixel_y) hud_layerise() @@ -359,7 +363,7 @@ CRASH("no worn mob") if(!M.strip_interaction_prechecks(user)) return - if(!do_after(user, delay, M, FALSE)) + if(!do_after(user, delay, M, DO_AFTER_IGNORE_ACTIVE_ITEM)) return if(slot != worn_slot || M != worn_mob()) return diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index bd0fbe19955..65b6bb9190b 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -116,9 +116,9 @@ death() return TRUE - SetWeakened(0) - SetStunned(0) - SetUnconscious(0) + set_paralyzed(0) + set_stunned(0) + set_unconscious(0) if(on && !client && !busy) spawn(0) @@ -127,8 +127,8 @@ spawn(0) handleAI() -/mob/living/bot/updatehealth() - if(status_flags & GODMODE) +/mob/living/bot/update_health() + if(status_flags & STATUS_GODMODE) health = getMaxHealth() set_stat(CONSCIOUS) else @@ -174,7 +174,7 @@ fireloss = 0 else fireloss = fireloss - 10 - updatehealth() + update_health() user.visible_message("[user] repairs [src].","You repair [src].") playsound(src, O.tool_sound, 50, 1) else diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index 022077972f1..44284820f85 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -235,8 +235,8 @@ /mob/living/bot/mulebot/Bump(var/mob/living/M) if(!safety && istype(M)) visible_message("[src] knocks over [M]!") - M.Stun(8) - M.Weaken(5) + M.afflict_stun(20 * 8) + M.afflict_paralyze(20 * 5) ..() /mob/living/bot/mulebot/proc/runOver(var/mob/living/M) diff --git a/code/modules/mob/living/carbon/alien/alien_attacks.dm b/code/modules/mob/living/carbon/alien/alien_attacks.dm index 875d9a5d5ad..0754e0ad724 100644 --- a/code/modules/mob/living/carbon/alien/alien_attacks.dm +++ b/code/modules/mob/living/carbon/alien/alien_attacks.dm @@ -40,7 +40,7 @@ if (MUTATION_HULK in L.mutations) damage += 5 spawn(0) - Unconscious(1) + afflict_unconscious(20 * 1) step_away(src,L,15) sleep(3) step_away(src,L,15) @@ -49,12 +49,12 @@ if ((O.client && !( O.blinded ))) O.show_message(text("[] has punched []!", L, src), 1) if (damage > 4.9) - Weaken(rand(10,15)) + afflict_paralyze(20 * rand(10,15)) for(var/mob/O in viewers(L, null)) if ((O.client && !( O.blinded ))) O.show_message(text("[] has weakened []!", L, src), 1, "You hear someone fall.", 2) adjustBruteLoss(damage) - updatehealth() + update_health() else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) for(var/mob/O in viewers(src, null)) diff --git a/code/modules/mob/living/carbon/alien/alien_damage.dm b/code/modules/mob/living/carbon/alien/alien_damage.dm index a346fb59f23..d185e96d7d8 100644 --- a/code/modules/mob/living/carbon/alien/alien_damage.dm +++ b/code/modules/mob/living/carbon/alien/alien_damage.dm @@ -23,11 +23,11 @@ if(3.0) b_loss += 30 if (prob(50)) - Unconscious(1) + afflict_unconscious(20 * 1) ear_damage += 15 ear_deaf += 60 adjustBruteLoss(b_loss) adjustFireLoss(f_loss) - updatehealth() + update_health() diff --git a/code/modules/mob/living/carbon/alien/diona/diona.dm b/code/modules/mob/living/carbon/alien/diona/diona.dm index a6717877746..cca8ef277ae 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona.dm @@ -37,7 +37,7 @@ /mob/living/carbon/alien/diona/proc/handle_npc(var/mob/living/carbon/alien/diona/D) if(D.stat != CONSCIOUS) return - if(prob(33) && D.canmove && isturf(D.loc) && !D.pulledby) //won't move if being pulled + if(prob(33) && CHECK_MOBILITY(D, MOBILITY_CAN_MOVE) && isturf(D.loc) && !D.pulledby) //won't move if being pulled step(D, pick(GLOB.cardinal)) if(prob(1)) D.emote(pick("scratch","jump","chirp","roll")) diff --git a/code/modules/mob/living/carbon/alien/diona/diona_powers.dm b/code/modules/mob/living/carbon/alien/diona/diona_powers.dm index 2c18c9516bb..cf2a266f05f 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona_powers.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona_powers.dm @@ -5,7 +5,7 @@ set name = "Merge with gestalt" set desc = "Merge with another diona." - if(stat == DEAD || paralysis || weakened || stunned || restrained()) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_USE)) return if(istype(src.loc,/mob/living/carbon)) @@ -45,7 +45,7 @@ set name = "Split from gestalt" set desc = "Split away from your gestalt as a lone nymph." - if(stat == DEAD || paralysis || weakened || stunned || restrained()) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_USE)) return if(!(istype(src.loc,/mob/living/carbon))) diff --git a/code/modules/mob/living/carbon/alien/diona/update_icons.dm b/code/modules/mob/living/carbon/alien/diona/update_icons.dm index 39f271f3514..a6c05f82a5f 100644 --- a/code/modules/mob/living/carbon/alien/diona/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/diona/update_icons.dm @@ -2,7 +2,7 @@ if(stat == DEAD) icon_state = "[initial(icon_state)]_dead" - else if(lying || resting || stunned) + else if(lying || !CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) icon_state = "[initial(icon_state)]_sleep" else icon_state = "[initial(icon_state)]" diff --git a/code/modules/mob/living/carbon/alien/emote.dm b/code/modules/mob/living/carbon/alien/emote.dm index 517b8d39bcf..f903d8b9b82 100644 --- a/code/modules/mob/living/carbon/alien/emote.dm +++ b/code/modules/mob/living/carbon/alien/emote.dm @@ -107,7 +107,7 @@ message = "The [src.name] hisses softly." m_type = 1 if("collapse") - Unconscious(2) + afflict_unconscious(20 * 2) message = text("[] collapses!", src) m_type = 2 if("chirp") diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index e6e68e084ee..d484394ce86 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -33,40 +33,24 @@ /mob/living/carbon/alien/handle_regular_UI_updates() - if(status_flags & GODMODE) return 0 + if(status_flags & STATUS_GODMODE) return 0 if(stat == DEAD) blinded = 1 silent = 0 else - updatehealth() + update_health() if(health <= 0) death() blinded = 1 silent = 0 return 1 - if(paralysis && paralysis > 0) + if(!IS_CONSCIOUS(src)) blinded = 1 - set_stat(UNCONSCIOUS) - if(halloss > 0) - adjustHalLoss(-3) - - if(sleeping) adjustHalLoss(-3) - if (mind) - if(mind.active && client != null) - AdjustSleeping(-1) - blinded = 1 - set_stat(UNCONSCIOUS) - else if(resting) - if(halloss > 0) - adjustHalLoss(-3) - - else - set_stat(CONSCIOUS) - if(halloss > 0) - adjustHalLoss(-1) + else if(IS_PRONE(src)) + adjustHalLoss(-3) // Eyes and blindness. if(!has_eyes()) diff --git a/code/modules/mob/living/carbon/alien/update_icons.dm b/code/modules/mob/living/carbon/alien/update_icons.dm index a91445cc44a..095ab849780 100644 --- a/code/modules/mob/living/carbon/alien/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/update_icons.dm @@ -12,7 +12,7 @@ if(stat == DEAD) icon_state = "[initial(icon_state)][state]_dead" - else if (stunned) + else if (!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) icon_state = "[initial(icon_state)][state]_stun" else if(lying || resting) icon_state = "[initial(icon_state)][state]_sleep" diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index 8c6f67d51cb..1e2227312c7 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -42,7 +42,7 @@ set category = "Object" set src in usr set popup_menu = 1 - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 if (radio.radio_enabled == 1) @@ -154,7 +154,7 @@ return /obj/item/mmi/relaymove(var/mob/user, var/direction) - if(user.stat || user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return var/obj/item/rig/rig = src.get_rig() if(rig) diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 749d671955a..50809547ec5 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -56,13 +56,13 @@ ghostize() //Ghostize checks for key so nothing else is necessary. return ..() -/mob/living/carbon/brain/update_canmove() +/mob/living/carbon/brain/update_mobility(blocked, forced) if(in_contents_of(/obj/mecha) || istype(loc, /obj/item/mmi)) - canmove = 1 - use_me = 1 + use_me = TRUE + return ..(blocked, forced) else - canmove = 0 - return canmove + use_me = FALSE + return ..(MOBILITY_FLAGS_REAL, forced) /mob/living/carbon/brain/isSynthetic() return istype(loc, /obj/item/mmi) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index ccbb97269c2..bdc1577b16c 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -18,7 +18,7 @@ // radiation-- // if(prob(25)) // adjustToxLoss(1) - // updatehealth() + // update_health() // if(50 to 74) // radiation -= 2 @@ -29,12 +29,12 @@ // to_chat(src, "You feel weak.") // else // to_chat(src, "STATUS: DANGEROUS LEVELS OF RADIATION DETECTED.") - // updatehealth() + // update_health() // if(75 to 100) // radiation -= 3 // adjustToxLoss(3) - // updatehealth() + // update_health() /mob/living/carbon/brain/handle_environment(datum/gas_mixture/environment) @@ -58,7 +58,7 @@ return //TODO: DEFERRED /mob/living/carbon/brain/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) - if(status_flags & GODMODE) return + if(status_flags & STATUS_GODMODE) return if(exposed_temperature > bodytemperature) var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) @@ -85,12 +85,12 @@ else dizziness = max(0, dizziness - 1) - updatehealth() + update_health() return //TODO: DEFERRED /mob/living/carbon/brain/handle_regular_UI_updates() //TODO: comment out the unused bits >_> - updatehealth() + update_health() if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP blinded = 1 diff --git a/code/modules/mob/living/carbon/brain/login.dm b/code/modules/mob/living/carbon/brain/login.dm index 3e5f0e48365..ca62650dd0f 100644 --- a/code/modules/mob/living/carbon/brain/login.dm +++ b/code/modules/mob/living/carbon/brain/login.dm @@ -1,3 +1,3 @@ /mob/living/carbon/brain/Login() ..() - SetSleeping(0) + set_sleeping(0) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0c834934a7f..c2e171353a8 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -142,17 +142,15 @@ var/mob/living/carbon/human/H = src H.w_uniform.add_fingerprint(M) - var/show_ssd var/mob/living/carbon/human/H = src var/datum/gender/T = GLOB.gender_datums[H.get_visible_gender()] // make sure to cast to human before using get_gender() or get_visible_gender()! - if(istype(H)) - show_ssd = H.species.show_ssd - if(show_ssd && !client && !teleop && (!istype(H) || !H.override_ssd)) - M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [T.him] up!"), - SPAN_NOTICE("You shake [src], but [T.he] [T.does] not respond... Maybe [T.he] [T.has] S.S.D?")) - else if(lying || src.sleeping) - AdjustSleeping(-5) - if(H) H.in_stasis = 0 + if(IS_PRONE(src) || !IS_CONSCIOUS(src)) + if(!resting_intentionally && IS_PRONE(src) && CHECK_MOBILITY(src, MOBILITY_CAN_STAND)) + set_resting(FALSE) + adjust_sleeping(-5 SECONDS) + adjust_unconscious(-2 SECONDS) + if(H) + H.in_stasis = 0 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!")) else @@ -178,9 +176,9 @@ M.adjust_fire_stacks(-1) if(M.on_fire) src.IgniteMob() - AdjustUnconscious(-3) - AdjustStunned(-3) - AdjustWeakened(-3) + adjust_unconscious(20 * -3) + adjust_stunned(20 * -3) + adjust_paralyzed(20 * -3) playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) @@ -245,11 +243,12 @@ set name = "Sleep" set category = "IC" - if(usr.sleeping) - to_chat(usr, "You are already sleeping") + + if(is_sleeping()) + to_chat(src, "You are already sleeping") return - if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes") - usr.AdjustSleeping(20) + if(alert(src, "You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes") + afflict_sleeping(20 SECONDS) /mob/living/carbon/Bump(atom/A) . = ..() @@ -265,7 +264,7 @@ stop_pulling() to_chat(src, "You slipped on [slipped_on]!") playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3) - Weaken(FLOOR(stun_duration/2, 1)) + afflict_paralyze(20 * FLOOR(stun_duration/2, 1)) return 1 /mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 66bc02c073d..d3cabab1e1a 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -52,7 +52,7 @@ return 0 /mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, var/stun = 1) - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return 0 //godmode if(def_zone == "l_hand" || def_zone == "r_hand") //Diona (And any other potential plant people) hands don't get shocked. if(species.species_flags & IS_PLANT) @@ -79,13 +79,13 @@ if(stun) switch(shock_damage) if(16 to 20) - Stun(2) + afflict_stun(20 * 2) if(21 to 25) - Weaken(2) + afflict_paralyze(20 * 2) if(26 to 30) - Weaken(5) + afflict_paralyze(20 * 5) if(31 to INFINITY) - Weaken(10) //This should work for now, more is really silly and makes you lay there forever + afflict_paralyze(20 * 10) //This should work for now, more is really silly and makes you lay there forever var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, loc) diff --git a/code/modules/mob/living/carbon/human/blood.dm b/code/modules/mob/living/carbon/human/blood.dm index 621ffe55a4a..b7b1dbcfd8c 100644 --- a/code/modules/mob/living/carbon/human/blood.dm +++ b/code/modules/mob/living/carbon/human/blood.dm @@ -125,7 +125,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 adjustOxyLoss(10 * dmg_coef) adjustOxyLoss(1 * dmg_coef) if(prob(15)) - Unconscious(rand(1,3)) + afflict_unconscious(20 * rand(1,3)) var/word = pick("dizzy","woozy","faint","disoriented","unsteady") to_chat(src, SPAN_USERDANGER("You feel dangerously [word]")) else if(blood_volume_raw >= species.blood_volume*species.blood_level_fatal) @@ -139,7 +139,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 pale = 1 update_icons_body() eye_blurry = max(eye_blurry,6) - Unconscious(3) + afflict_unconscious(20 * 3) adjustToxLoss(3 * dmg_coef) adjustOxyLoss(75 * dmg_coef) // 15 more than dexp fixes (also more than dex+dexp+tricord) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 43ed22c02b8..aadf5cb70f5 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -140,7 +140,6 @@ update_hair(0) mutations.Add(MUTATION_HUSK) - status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools update_icons_body() return @@ -159,6 +158,5 @@ update_hair(0) mutations.Add(MUTATION_SKELETON) - status_flags |= DISFIGURED update_icons_body() return diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index 2ebadde6c72..771d8a2d838 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -1,6 +1,7 @@ /mob/living/carbon/human/dummy real_name = "Test Dummy" - status_flags = GODMODE|CANPUSH + status_flags = STATUS_GODMODE | STATUS_CAN_PUSH + ssd_visible = FALSE no_vore = TRUE //Dummies don't need bellies. // NO STOP USING THESE FOR ANYTHING BUT PREFS SETUP diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index c99606f8a18..8ae1ea5a1e5 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -255,7 +255,7 @@ if (input2 == "Visible") m_type = 1 else if (input2 == "Hearable") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) return m_type = 2 else @@ -316,7 +316,7 @@ if ("choke") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "clutches [T.his] throat desperately!" m_type = 1 else @@ -343,14 +343,14 @@ if (!src.restrained()) message = "flaps [T.his] wings." m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if(HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT)) m_type = 1 if ("aflap") if (!src.restrained()) message = "flaps [T.his] wings ANGRILY!" m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if(HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT)) m_type = 1 if("ara") @@ -376,7 +376,7 @@ m_type = 1 if ("chuckle") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears to chuckle." m_type = 1 else @@ -397,13 +397,13 @@ if ("faint") message = "faints." - if(src.sleeping) + if(!IS_CONSCIOUS(src)) return //Can't faint while asleep - Sleeping(10) //Short-short nap + afflict_sleeping(20 * 10) //Short-short nap m_type = 1 if("cough", "coughs") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears to cough!" m_type = 1 else @@ -435,7 +435,7 @@ m_type = 2 if("bcough") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears to cough up blood!" m_type = 1 else @@ -473,7 +473,7 @@ m_type = 1 if ("gasp") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears to be gasping!" m_type = 1 else @@ -489,7 +489,7 @@ m_type = 1 if ("giggle") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "giggles silently!" m_type = 1 else @@ -552,7 +552,7 @@ m_type = 1 if ("cry") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "cries." m_type = 1 else @@ -564,7 +564,7 @@ m_type = 2 if ("sigh") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "sighs." m_type = 1 else @@ -576,7 +576,7 @@ m_type = 2 if ("laugh") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "acts out a laugh." m_type = 1 else @@ -601,11 +601,11 @@ if ("mumble") message = "mumbles!" m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) m_type = 1 if ("grumble") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "grumbles!" m_type = 1 if (!muzzled) @@ -616,7 +616,7 @@ m_type = 2 if ("groan") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears to groan!" m_type = 1 else @@ -628,7 +628,7 @@ m_type = 2 if ("moan") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears to moan!" m_type = 1 else @@ -642,7 +642,7 @@ if (!M) param = null else - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "takes a drag from a cigarette and blows \"[M]\" out in smoke." m_type = 1 else @@ -704,7 +704,7 @@ if ("shiver") message = "shivers." m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) m_type = 1 if ("pale") @@ -716,7 +716,7 @@ m_type = 1 if("sneeze", "sneezes") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "sneezes." m_type = 1 else @@ -749,11 +749,11 @@ if ("sniff") message = "sniffs." m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) m_type = 1 if ("snore") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "sleeps soundly." m_type = 1 else @@ -765,7 +765,7 @@ m_type = 2 if ("whimper") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "appears hurt." m_type = 1 else @@ -784,14 +784,14 @@ if (!muzzled) message = "yawns." m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) m_type = 1 if ("collapse") - Unconscious(2) + afflict_unconscious(20 * 2) message = "collapses!" m_type = 2 - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) m_type = 1 if("hug") @@ -824,7 +824,7 @@ M = null if (M) - if (M.canmove && !M.r_hand && !M.restrained()) + if (CHECK_MOBILITY(M, MOBILITY_CAN_USE)) message = "shakes hands with [M]." else message = "holds out [T.his] hand to [M]." @@ -901,7 +901,7 @@ //adding damage for aslaps to stop the spam if("scream", "screams") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "acts out a scream!" m_type = 1 else @@ -923,7 +923,7 @@ message = "makes a very loud noise." m_type = 2 if("squeak","squeaks") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "acts out a soft squeak." m_type = 1 else @@ -933,7 +933,7 @@ playsound(loc, "sound/effects/mouse_squeak.ogg", 50, 1) if("meow", "meows") - if HAS_TRAIT_FROM(src, TRAIT_MUTE, TRAIT_MIME) + if HAS_TRAIT_FROM(src, TRAIT_MUTE, MIME_TRAIT) message = "acts out a soft mrowl." m_type = 1 else @@ -1204,7 +1204,7 @@ if ("flip") var/list/involved_parts = list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT) //Check if they are physically capable - if(src.sleeping || src.resting || src.buckled || src.weakened || src.restrained() || involved_parts.len < 2) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE) || involved_parts.len < 2) to_chat(src, "You can't *flip in your current state!") return 1 else @@ -1216,7 +1216,7 @@ addtimer(CALLBACK(src, .proc/spam_flag_false), 18) else if(prob(30)) // Little known fact: HRP is /tg/ + 10 - src.Weaken(2) + src.afflict_paralyze(20 * 2) if(prob(50)) src.adjustBruteLoss(1) message = "attempts to do a flip and falls on their face. Ouch!" diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 62340d56575..950a4246597 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -496,12 +496,15 @@ pose = addtext(pose,".") //Makes sure all emotes end with a period. . += SPAN_INFO("[T.He] [pose]") - // if(LAZYLEN(.) > 1) //Want this to appear after species text, aka the second line - // .[2] = "
[.[2]]" + // handle status effects + // todo: this should probably be a signal but it's not urgent, this isn't a hot path + for(var/id in status_effects) + var/datum/status_effect/effect = status_effects[id] + effect.on_examine(.) + // send signal last so everything else prioritizes above SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .) //This also handles flavor texts now - //Helper procedure. Called by /mob/living/carbon/human/examine() and /mob/living/carbon/human/Topic() to determine HUD access to security and medical records. /proc/hasHUD(mob/M as mob, hudtype) if(istype(M, /mob/living/carbon/human)) @@ -676,20 +679,3 @@ if(dat.len) return dat.Join() */ -/** - * Shows any and all examine text related to any status effects the user has. - */ -/mob/living/proc/get_status_effect_examinations() - var/list/examine_list = list() - - for(var/datum/status_effect/effect as anything in status_effects) - var/effect_text = effect.get_examine_text() - if(!effect_text) - continue - - examine_list += effect_text - - if(!length(examine_list)) - return - - return examine_list.Join("\n") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f384d930b52..49b1c44f6d3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -148,7 +148,7 @@ ear_damage += 30 ear_deaf += 120 if (prob(70) && !shielded) - Unconscious(10) + afflict_unconscious(20 * 10) if(3.0) b_loss += 30 @@ -158,7 +158,7 @@ ear_damage += 15 ear_deaf += 60 if (prob(50) && !shielded) - Unconscious(10) + afflict_unconscious(20 * 10) var/update = 0 @@ -304,7 +304,7 @@ //Now checks siemens_coefficient of the affected area by default /mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if (!def_zone) def_zone = pick("l_hand", "r_hand") @@ -1052,7 +1052,7 @@ if(istype(O, /obj/item/melee/spike)) organ.take_damage(rand(3,9), 0, 0) // it has spikes on it it's going to stab you to_chat(src, "The edges of [O] in your [organ.name] are not doing you any favors.") - Weaken(2) // having a very jagged stick jammed into your bits is Bad for your health + afflict_paralyze(20 * 2) // having a very jagged stick jammed into your bits is Bad for your health organ.take_damage(rand(1,3), 0, 0) if(!(organ.robotic >= ORGAN_ROBOT) && (should_have_organ(O_HEART))) //There is no blood in protheses. organ.status |= ORGAN_BLEEDING @@ -1166,7 +1166,7 @@ species.create_blood(src) species.handle_post_spawn(src) species.update_attack_types() // Required for any trait that updates unarmed_types in setup. - updatehealth() // uh oh stinky - some species just have more/less maxhealth, this is a shit fix imo but deal with it for now ~silicons + update_health() // uh oh stinky - some species just have more/less maxhealth, this is a shit fix imo but deal with it for now ~silicons // Rebuild the HUD. If they aren't logged in then login() should reinstantiate it for them. update_hud() @@ -1268,12 +1268,16 @@ if(isSynthetic()) switch(severity) if(1) + afflict_stagger(20, 30) Confuse(10) if(2) + afflict_stagger(10, 15) Confuse(7) if(3) + afflict_stagger(5, 10) Confuse(5) if(4) + afflict_stagger(2) Confuse(2) flash_eyes() to_chat(src, "*BZZZT*") @@ -1457,16 +1461,6 @@ return 1 return 0 -/mob/living/carbon/human/can_stand_overridden() - if(wearing_rig && wearing_rig.ai_can_move_suit(check_for_ai = 1)) - // Actually missing a leg will screw you up. Everything else can be compensated for. - for(var/limbcheck in list("l_leg","r_leg")) - var/obj/item/organ/affecting = get_organ(limbcheck) - if(!affecting) - return 0 - return 1 - return 0 - /mob/living/carbon/human/verb/toggle_underwear() set name = "Toggle Underwear" set desc = "Shows/hides selected parts of your underwear." @@ -1539,9 +1533,9 @@ equip_to_appropriate_slot(permit) // If for some reason it can't find room, it'll still be on the floor. /mob/living/carbon/human/proc/update_icon_special() //For things such as teshari hiding and whatnot. - if(status_flags & HIDING) // Hiding? Carry on. + if(status_flags & STATUS_HIDING) // Hiding? Carry on. // Stunned/knocked down by something that isn't the rest verb? Note: This was tried with INCAPACITATION_STUNNED, but that refused to work. - if(stat == DEAD || paralysis || weakened || stunned || restrained() || buckled || LAZYLEN(grabbed_by) || has_buckled_mobs()) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_USE) || buckled || LAZYLEN(grabbed_by) || has_buckled_mobs()) reveal(null) else set_base_layer(HIDING_LAYER) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 79dbc5ee222..a7100ba978b 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -134,14 +134,14 @@ accurate = 1 if(INTENT_HARM, INTENT_GRAB) // We're in a fighting stance, there's a chance we block - if(src.canmove && src!=H && prob(20)) + if(CHECK_MOBILITY(src, MOBILITY_CAN_MOVE) && src!=H && prob(20)) block = 1 if (L.grabbed_by.len) // Someone got a good grip on them, they won't be able to do much damage rand_damage = max(1, rand_damage - 2) - if(src.grabbed_by.len || src.buckled || !src.canmove || src==H) + if(src.grabbed_by.len || src.buckled || !CHECK_MOBILITY(src, MOBILITY_CAN_MOVE) || src==H) accurate = 1 // certain circumstances make it impossible for us to evade punches rand_damage = 5 @@ -313,7 +313,7 @@ var/armor_block = run_armor_check(affecting, armor_type, armor_pen) var/armor_soak = get_armor_soak(affecting, armor_type, armor_pen) apply_damage(damage, BRUTE, affecting, armor_block, armor_soak, sharp = a_sharp, edge = a_edge) - updatehealth() + update_health() return TRUE //Used to attack a joint through grabbing diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 3e6be100810..8f13d57d47b 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -1,6 +1,6 @@ //Updates the mob's health from organs and mob damage variables -/mob/living/carbon/human/updatehealth() - if(status_flags & GODMODE) +/mob/living/carbon/human/update_health() + if(status_flags & STATUS_GODMODE) health = getMaxHealth() set_stat(CONSCIOUS) update_hud_med_all() @@ -32,7 +32,7 @@ /mob/living/carbon/human/adjustBrainLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(should_have_organ("brain")) var/obj/item/organ/internal/brain/sponge = internal_organs_by_name["brain"] @@ -49,7 +49,7 @@ /mob/living/carbon/human/setBrainLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(should_have_organ("brain")) var/obj/item/organ/internal/brain/sponge = internal_organs_by_name["brain"] @@ -64,7 +64,7 @@ /mob/living/carbon/human/getBrainLoss() - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(should_have_organ("brain")) var/obj/item/organ/internal/brain/sponge = internal_organs_by_name["brain"] @@ -201,24 +201,6 @@ update_hud_med_all() -/mob/living/carbon/human/Stun(amount) - if(MUTATION_HULK in mutations) - return - ..() - -/mob/living/carbon/human/Weaken(amount) - if(MUTATION_HULK in mutations) - return - ..() - -/mob/living/carbon/human/Unconscious(amount) - if(MUTATION_HULK in mutations) - return - // Notify our AI if they can now control the suit. - if(wearing_rig && !stat && paralysis < amount) //We are passing out right this second. - wearing_rig.notify_ai("Warning: user consciousness failure. Mobility control passed to integrated intelligence system.") - ..() - /mob/living/carbon/human/proc/Stasis(amount) if((species.species_flags & NO_SCAN) || isSynthetic()) in_stasis = 0 @@ -349,7 +331,7 @@ var/obj/item/organ/external/picked = pick(parts) if(picked.heal_damage(brute,burn)) UpdateDamageIcon() - updatehealth() + update_health() /* In most cases it makes more sense to use apply_damage() instead! And make sure to check armour if applicable. @@ -364,7 +346,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t var/obj/item/organ/external/picked = pick(parts) if(picked.take_damage(brute,burn,sharp,edge)) UpdateDamageIcon() - updatehealth() + update_health() //Heal MANY external organs, in random order //'include_robo' only applies to healing, for legacy purposes, as all damage typically hurts both types of organs @@ -384,13 +366,13 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t burn -= (burn_was-picked.burn_dam) parts -= picked - updatehealth() + update_health() if(update) UpdateDamageIcon() // damage MANY external organs, in random order /mob/living/carbon/human/take_overall_damage(var/brute, var/burn, var/sharp = 0, var/edge = 0, var/used_weapon = null) - if(status_flags & GODMODE) return //godmode + if(status_flags & STATUS_GODMODE) return //godmode var/list/obj/item/organ/external/parts = get_damageable_organs() var/update = 0 while(parts.len && (brute>0 || burn>0) ) @@ -404,7 +386,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t burn -= (picked.burn_dam - burn_was) parts -= picked - updatehealth() + update_health() if(update) UpdateDamageIcon() @@ -504,5 +486,5 @@ This function restores all organs. UpdateDamageIcon() // Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life(). - updatehealth() + update_health() return 1 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 8cea6bfc3cc..86e3a1cb610 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -4,7 +4,6 @@ Contains most of the procs that are called when a mob is attacked by something bullet_act legacy_ex_act meteor_act -emp_act */ @@ -360,7 +359,7 @@ emp_act var/obj/O = AM if(in_throw_mode && TT.speed <= THROW_SPEED_CATCHABLE) //empty active hand and we're in throw mode - if(canmove && !restrained()) + if(CHECK_ALL_MOBILITY(src, MOBILITY_CAN_USE | MOBILITY_CAN_PICKUP)) if(isturf(O.loc)) if(can_catch(O)) put_in_active_hand(O) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index c4f6d2869e6..85eb5024251 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -5,6 +5,7 @@ icon = 'icons/effects/effects.dmi' //We have an ultra-complex update icons that overlays everything, don't load some stupid random male human icon_state = "nothing" low_priority = FALSE // UH YEA MAYBE STILL TICK THIS? + ssd_visible = TRUE blocks_emissive = EMISSIVE_BLOCK_UNIQUE SET_APPEARANCE_FLAGS(TILE_BOUND | PIXEL_SCALE | KEEP_TOGETHER) @@ -34,7 +35,7 @@ hud_possible = list( LIFE_HUD, - STATUS_HUD, + BIOLOGY_HUD, ID_HUD, WANTED_HUD, IMPLOYAL_HUD, @@ -263,3 +264,7 @@ // ignore ssd status var/override_ssd = FALSE + + //? movement + /// are we trying to crawl under someone? mob if true + var/mob/crawling_under_someone diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 5ce719c5070..17e661de0b5 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -60,7 +60,7 @@ if (prob(10) && !stat && can_feel_pain() && chem_effects[CE_PAINKILLER] < 50 && E.is_broken() && E.internal_organs.len) custom_pain("Pain jolts through your broken [E.encased ? E.encased : E.name], staggering you!", 50) drop_active_held_item() - Stun(2) + afflict_stun(20 * 2) //Moving makes open wounds get infected much faster if (length(E.wounds)) @@ -117,7 +117,7 @@ if(limb_pain) emote("scream") custom_emote(1, "collapses!") - Weaken(5) //can't emote while weakened, apparently. + afflict_paralyze(20 * 5) //can't emote while weakened, apparently. /mob/living/carbon/human/proc/handle_grasp() if(!l_hand && !r_hand) diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index fd19f9a9f4d..43b58585e46 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -41,7 +41,7 @@ if(last_special > world.time) return - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src, "You cannot tackle someone in your current state.") return @@ -60,7 +60,7 @@ if(last_special > world.time) return - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src, "You cannot tackle in your current state.") return @@ -68,13 +68,13 @@ var/failed if(prob(75)) - T.Weaken(rand(0.5,3)) + T.afflict_paralyze(20 * rand(0.5,3)) else failed = 1 playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) if(failed) - src.Weaken(rand(2,4)) + src.afflict_paralyze(20 * rand(2,4)) for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) diff --git a/code/modules/mob/living/carbon/human/human_resist.dm b/code/modules/mob/living/carbon/human/human_resist.dm index e517a0e5fb4..1cb361e2f8a 100644 --- a/code/modules/mob/living/carbon/human/human_resist.dm +++ b/code/modules/mob/living/carbon/human/human_resist.dm @@ -51,7 +51,7 @@ "You gnaw on \the [SJ]. (This will take around [round(breakouttime / 600)] minutes and you need to stand still.)" ) - if(do_after(src, breakouttime, incapacitation_flags = INCAPACITATION_DISABLED & INCAPACITATION_KNOCKDOWN)) + if(do_after(src, breakouttime, mobility_flags = MOBILITY_CAN_RESIST)) if(!wear_suit) return visible_message( @@ -75,7 +75,7 @@ "You attempt to rip your [wear_suit.name] apart. (This will take around 5 seconds and you need to stand still)" ) - if(do_after(src, 20 SECONDS, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED)) // Same scaling as breaking cuffs, 5 seconds to 120 seconds, 20 seconds to 480 seconds. + if(do_after(src, 20 SECONDS, mobility_flags = MOBILITY_CAN_RESIST)) // Same scaling as breaking cuffs, 5 seconds to 120 seconds, 20 seconds to 480 seconds. if(!wear_suit || buckled) return diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fb543d99c6b..4c6c0b57183 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -80,7 +80,7 @@ var/stasis = inStasisNow() if(getStasis() > 2) - Sleeping(20) + afflict_sleeping(20 * 20) handle_changeling() @@ -209,23 +209,23 @@ return if (disabilities & DISABILITY_EPILEPSY) - if ((prob(1) && paralysis < 1)) + if (prob(1) && IS_CONSCIOUS(src)) to_chat(src, "You have a seizure!") for(var/mob/O in viewers(src, null)) if(O == src) continue O.show_message(text("[src] starts having a seizure!"), 1) - Unconscious(10) + afflict_unconscious(20 * 10) make_jittery(1000) if (disabilities & DISABILITY_COUGHING) - if ((prob(5) && paralysis <= 1)) + if (prob(5) && IS_CONSCIOUS(src)) drop_active_held_item() spawn( 0 ) emote("cough") return if (disabilities & DISABILITY_TOURETTES) - if ((prob(10) && paralysis <= 1)) - Stun(10) + if (prob(10) && IS_CONSCIOUS(src)) + afflict_stun(20 * 10) spawn( 0 ) switch(rand(1, 3)) if(1) @@ -254,10 +254,10 @@ if(10 <= rn && rn <= 12) if(prob(50)) to_chat(src, "You suddenly black out!") - Unconscious(10) + afflict_unconscious(20 * 10) else if(!lying) to_chat(src, "Your legs won't respond properly, you fall down!") - Weaken(10) + afflict_paralyze(20 * 10) /mob/living/carbon/human/handle_mutations_and_radiation(seconds) if(inStasisNow()) @@ -295,7 +295,7 @@ adjustFireLoss(-rads) adjustOxyLoss(-rads) adjustToxLoss(-rads) - updatehealth() + update_health() cure_radiation(RAD_MOB_PASSIVE_LOSS_FOR(radiation, seconds) + rads) return // not enough to care: stop @@ -323,7 +323,7 @@ to_chat(src, SPAN_WARNING("Ionization detected in systems. Rebooting...")) if(!lying) emote("collapse") - Weaken(RAD_MOB_KNOCKDOWN_AMOUNT(radiation, seconds)) + afflict_paralyze(20 * RAD_MOB_KNOCKDOWN_AMOUNT(radiation, seconds)) #endif else if(radiation >= RAD_MOB_WARNING_THRESHOLD) @@ -339,7 +339,7 @@ to_chat(src, SPAN_WARNING("You feel weak...")) if(!lying) emote("collapse") - Weaken(RAD_MOB_KNOCKDOWN_AMOUNT(radiation, seconds)) + afflict_paralyze(20 * RAD_MOB_KNOCKDOWN_AMOUNT(radiation, seconds)) if(radiation >= RAD_MOB_HAIRLOSS_THRESHOLD) if(prob(RAD_MOB_HAIRLOSS_CHANCE(radiation, seconds))) to_chat(src, SPAN_WARNING("Your hair starts falling out in clumps...")) @@ -402,7 +402,7 @@ /mob/living/carbon/human/handle_breath(datum/gas_mixture/breath) - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return if(suiciding) @@ -566,11 +566,11 @@ if(SA_pp > SA_para_min) // 3 gives them one second to wake up and run away a bit! - Unconscious(3) + afflict_unconscious(20 * 3) // Enough to make us sleep as well if(SA_pp > SA_sleep_min) - Sleeping(5) + afflict_sleeping(20 * 5) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning else if(SA_pp > 0.15) @@ -753,7 +753,7 @@ if(bodytemperature >= species.heat_level_1) //Body temperature is too hot. fire_alert = max(fire_alert, 1) - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return 1 //godmode var/burn_dam = 0 @@ -778,7 +778,7 @@ //Body temperature is too cold. fire_alert = max(fire_alert, 1) - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return 1 //godmode @@ -798,7 +798,7 @@ // Account for massive pressure differences. Done by Polymorph // Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense! - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return 1 //godmode if(adjusted_pressure >= species.hazard_high_pressure) @@ -983,10 +983,10 @@ //If you hold it in hand, and your hands arent covered by anything total_phoronloss += loss_per_part if(total_phoronloss) - if(!(status_flags & GODMODE)) + if(!(status_flags & STATUS_GODMODE)) adjustToxLoss(total_phoronloss) - if(status_flags & GODMODE) + if(status_flags & STATUS_GODMODE) return FALSE //godmode if(species.light_dam) @@ -1034,7 +1034,7 @@ if(!isSynthetic()) handle_trace_chems() - updatehealth() + update_health() return //TODO: DEFERRED @@ -1043,18 +1043,14 @@ if(skip_some_updates()) return FALSE - if(status_flags & GODMODE) return 0 + if(status_flags & STATUS_GODMODE) return 0 //SSD check, if a logged player is awake put them back to sleep! - var/was_ssd = FALSE - if(species.get_ssd(src) && !client && !teleop && !override_ssd && !temporary_form) - Sleeping(2) - was_ssd = TRUE if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP blinded = 1 silent = 0 else //ALIVE. LIGHTS ARE ON - updatehealth() //TODO + update_health() //TODO if(health <= config_legacy.health_threshold_dead || (should_have_organ("brain") && !has_brain())) death() @@ -1064,7 +1060,7 @@ //UNCONSCIOUS. NO-ONE IS HOME if((getOxyLoss() > (species.total_health/2)) || (health <= config_legacy.health_threshold_crit)) - Unconscious(3) + afflict_unconscious(20 * 3) if(hallucination) if(hallucination >= 20 && !(species.species_flags & (NO_POISON|IS_PLANT|NO_HALLUCINATION)) ) @@ -1079,7 +1075,7 @@ qdel(a) //Brain damage from Oxyloss - if(should_have_organ("brain")) + if(should_have_organ(O_BRAIN)) var/brainOxPercent = 0.015 //Default 1.5% of your current oxyloss is applied as brain damage, 50 oxyloss is 1 brain damage if(CE_STABLE in chem_effects) brainOxPercent = 0.008 //Halved in effect @@ -1089,27 +1085,19 @@ if(halloss >= species.total_health) to_chat(src, "You're in too much pain to keep going...") src.visible_message("[src] slumps to the ground, too weak to continue fighting.") - Unconscious(10) + afflict_unconscious(20 * 10) setHalLoss(species.total_health - 1) - if(paralysis || sleeping) + if(!IS_CONSCIOUS(src)) blinded = 1 - set_stat(UNCONSCIOUS) animate_tail_reset() adjustHalLoss(-3) - if(sleeping) - handle_dreams() - if (mind) - //Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of stoxin or similar. - if(!was_ssd || sleeping > 3) - AdjustSleeping(-1) - if( prob(2) && health && !hal_crit ) - spawn(0) - emote("snore") - //CONSCIOUS - else - set_stat(CONSCIOUS) + if(is_sleeping()) + handle_dreams() + if( prob(2) && health > 0 && !hal_crit ) + spawn(0) + emote("snore") //Periodically double-check embedded_flag if(embedded_flag && !(life_tick % 10)) @@ -1173,7 +1161,7 @@ ear_damage = max(ear_damage-0.05, 0) //Resting - if(resting) + if(IS_PRONE(src)) dizziness = max(0, dizziness - 15) jitteriness = max(0, jitteriness - 15) adjustHalLoss(-3) @@ -1186,8 +1174,8 @@ drowsyness = max(0, drowsyness - 1) eye_blurry = max(2, eye_blurry) if (prob(5)) - Sleeping(1) - Unconscious(5) + afflict_sleeping(20 * 1) + afflict_unconscious(20 * 5) // If you're dirty, your gloves will become dirty, too. if(gloves && germ_level > gloves.germ_level && prob(10)) @@ -1635,7 +1623,7 @@ qdel(M) continue if(air_master.current_cycle%3==1) - if(!(M.status_flags & GODMODE)) + if(!(M.status_flags & STATUS_GODMODE)) M.adjustBruteLoss(5) nutrition += 10 @@ -1686,7 +1674,7 @@ /mob/living/carbon/human/handle_shock() ..() - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(!can_feel_pain()) return if(health < config_legacy.health_threshold_softcrit)// health 0 makes you immediately collapse @@ -1719,24 +1707,24 @@ if(shock_stage == 60) emote("me",1,"'s body becomes limp.") if (prob(2)) to_chat(src, "[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!") - Weaken(20) + afflict_paralyze(20 * 20) if(shock_stage >= 80) if (prob(5)) to_chat(src, "[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!") - Weaken(20) + afflict_paralyze(20 * 20) if(shock_stage >= 120) if (prob(2)) to_chat(src, "[pick("You black out", "You feel like you could die any moment now", "You are about to lose consciousness")]!") - Unconscious(5) + afflict_unconscious(20 * 5) if(shock_stage == 150) emote("me",1,"can no longer stand, collapsing!") - Weaken(20) + afflict_paralyze(20 * 20) if(shock_stage >= 150) - Weaken(20) + afflict_paralyze(20 * 20) /mob/living/carbon/human/proc/handle_pulse() if(life_tick % 5) @@ -1791,7 +1779,7 @@ if(round(vessel.get_reagent_amount("blood")) <= species.blood_volume*species.blood_level_danger) //how much blood do we have temp = temp + 3 //not enough :( - if(status_flags & FAKEDEATH) + if(status_flags & STATUS_FAKEDEATH) temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds if(!isnull(modifier_set)) diff --git a/code/modules/mob/living/carbon/human/mobility.dm b/code/modules/mob/living/carbon/human/mobility.dm new file mode 100644 index 00000000000..14c91771cd2 --- /dev/null +++ b/code/modules/mob/living/carbon/human/mobility.dm @@ -0,0 +1,5 @@ +/mob/living/carbon/human/update_mobility(blocked, forced) + if(wearing_rig?.ai_can_move_suit(check_for_ai = TRUE)) + // there are no brakes on this train + forced |= MOBILITY_FLAGS_REAL + return ..() diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/movement.dm similarity index 82% rename from code/modules/mob/living/carbon/human/human_movement.dm rename to code/modules/mob/living/carbon/human/movement.dm index 456a209b9e9..f68afc52a61 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/movement.dm @@ -23,9 +23,9 @@ if(!isnull(M.slowdown)) tally += M.slowdown - var/health_deficiency = (getMaxHealth() - health) - if(health_deficiency >= 40) - tally += (health_deficiency / 35) + var/health_deficiency = 1 - clamp(health / getMaxHealth(), 0, 1) + if(health_deficiency >= 0.4) + tally += health_deficiency * (100 / 35) if(can_feel_pain()) if(!(CE_SPEEDBOOST in chem_effects)) //Hyperzine stops pain slowdown @@ -36,21 +36,13 @@ if (hungry >= 70) tally += hungry/50 - if (feral >= 10) //crazy feral animals give less and less of a shit about pain and hunger as they get crazier - tally = max(species.slowdown, species.slowdown+((tally-species.slowdown)/(feral/10))) // As feral scales to damage, this amounts to an effective +1 slowdown cap - if(shock_stage >= 10) tally -= 1.5 //this gets a +3 later, feral critters take reduced penalty if(reagents.has_reagent("numbenzyme")) tally += 1.5 //A tad bit of slowdown. - // if(riding_datum) //Bit of slowdown for taur rides if rider is bigger or fatter than mount. - // var/datum/riding/R = riding_datum - // var/mob/living/L = R.ridden - // for(var/mob/living/M in L.buckled_mobs) - // if(ishuman(M)) - // var/mob/living/carbon/human/H = M - // if(H.size_multiplier > L.size_multiplier) - // tally += 1 - // if(H.weight > L.weight) - // tally += 1 + + if (feral >= 10) //crazy feral animals give less and less of a shit about pain and hunger as they get crazier + tally = max(species.slowdown, species.slowdown+((tally-species.slowdown)/(feral/10))) // As feral scales to damage, this amounts to an effective +1 slowdown cap + if(shock_stage >= 10) + tally -= 1.5 //this gets a +3 later, feral critters take reduced penalty if(istype(buckled, /obj/structure/bed/chair/wheelchair)) for(var/organ_name in list(BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM)) @@ -71,9 +63,11 @@ else if(E.status & ORGAN_BROKEN) tally += 1.5 - if(shock_stage >= 10) tally += 3 + if(shock_stage >= 10) + tally += 3 - if(aiming && aiming.aiming_at) tally += 5 // Iron sights make you slower, it's a well-known fact. + if(aiming && aiming.aiming_at) + tally += 5 // Iron sights make you slower, it's a well-known fact. if(MUTATION_FAT in src.mutations) tally += 1.5 @@ -99,18 +93,6 @@ else tally += item_tally // if it's less than 0 that means it speeds you up, theoretically, so, hit it - /* removed - kevinz000. A system will eventually be reintroduced to do this, but for the moment I'd rather this Not be a thing. - // Dragging heavy objects will also slow you down, similar to above. - if(pulling) - if(istype(pulling, /obj/item)) - var/obj/item/pulled = pulling - item_tally += max(pulled.slowdown, 0) - else if(ishuman(pulling)) - var/mob/living/carbon/human/H = pulling - var/their_slowdown = max(H.calculate_item_encumbrance(), 1) - item_tally = max(item_tally, their_slowdown) // If our slowdown is less than theirs, then we become as slow as them (before species modifires). - */ - if(CE_SLOWDOWN in chem_effects) if (tally >= 0 ) tally = (tally + tally/4) //Add a quarter of penalties on top. @@ -225,15 +207,31 @@ /mob/living/carbon/human/handle_footstep(turf/T) if(is_incorporeal()) return + + // if buckled, don't bother + if(buckled) + return + if(!config_legacy.footstep_volume || !T.footstep_sounds || !T.footstep_sounds.len) return + + // if down + if(IS_PRONE(src)) + // if grabbed, don't bother + if(length(grabbed_by)) + return + // play crawling sound + playsound(T, 'sound/effects/footstep/crawl1.ogg', 25, TRUE, -4) + + // todo: REFACTOR EVERYTHING. // Future Upgrades - Multi species support var/list/footstep_sounds = T.footstep_sounds["human"] if(!footstep_sounds) return var/S = pick(footstep_sounds) - if(!S) return + if(!S) + return // Play every 20 steps while walking, for the sneak if(m_intent == "walk" && step_count++ % 20 != 0) @@ -264,10 +262,33 @@ playsound(T, S, volume, FALSE) -/mob/living/carbon/human/can_stumble_into(obj/O) - //? nah this was fun for no one. - /* - if(flying && species.id != SPECIES_ADHERENT) +//? crawling + +/mob/living/carbon/human/try_crawl_under(mob/living/other) + if(!in_selfmove) // we're being shoved under + bump_position_swap(other, TRUE) return TRUE - */ - return ..() + if(crawling_under_someone) + return + crawling_under_someone = other + if(is_grabbed()) + selfmove_feedback(SPAN_WARNING("You can't crawl under [other] while grabbed!")) + crawling_under_someone = null + return FALSE + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) + selfmove_feedback(SPAN_WARNING("You can't crawl under [other] right now!")) + crawling_under_someone = null + return FALSE + visible_message( + SPAN_NOTICE("[src] is attempting to crawl under [other]."), + SPAN_NOTICE("You are now attempting to crawl under [other].") + ) + if(!do_self(src, 2 SECONDS, DO_AFTER_IGNORE_ACTIVE_ITEM, MOBILITY_CAN_MOVE)) + crawling_under_someone = null + return FALSE + bump_position_swap(other, TRUE) + crawling_under_someone = null + return TRUE + +/mob/living/carbon/human/should_crawl_under(mob/living/other) + return IS_PRONE(src) && !IS_PRONE(other) diff --git a/code/modules/mob/living/carbon/human/pain.dm b/code/modules/mob/living/carbon/human/pain.dm index 054cd032dcc..042127feff1 100644 --- a/code/modules/mob/living/carbon/human/pain.dm +++ b/code/modules/mob/living/carbon/human/pain.dm @@ -45,8 +45,8 @@ damaged_organ = E maxdam = dam if(damaged_organ && chem_effects[CE_PAINKILLER] < maxdam) - if(maxdam > 10 && paralysis) - AdjustUnconscious(-round(maxdam/10)) + if(maxdam > 10 && is_unconscious()) + adjust_unconscious(20 * -round(maxdam/10)) if(maxdam > 50 && prob(maxdam / 5)) drop_active_held_item() var/burning = damaged_organ.burn_dam > damaged_organ.brute_dam @@ -90,9 +90,9 @@ if(agony_amount > 5 && owner && vital && get_pain() > 0.5 * max_damage) owner.visible_message("[owner] reels in pain!") if(has_genitals() || get_pain() + agony_amount > max_damage) - owner.Weaken(6) + owner.afflict_paralyze(20 * 6) else - owner.Stun(6) + owner.afflict_stun(20 * 6) owner.drop_l_hand() owner.drop_r_hand() return 1 diff --git a/code/modules/mob/living/carbon/human/status_procs.dm b/code/modules/mob/living/carbon/human/status_procs.dm new file mode 100644 index 00000000000..794c10ff7d5 --- /dev/null +++ b/code/modules/mob/living/carbon/human/status_procs.dm @@ -0,0 +1,14 @@ +/mob/living/carbon/human/afflict_stun(amount) + if(MUTATION_HULK in mutations) + return FALSE + return ..() + +/mob/living/carbon/human/afflict_knockdown(amount) + if(MUTATION_HULK in mutations) + return FALSE + return ..() + +/mob/living/carbon/human/afflict_unconscious(amount) + if(MUTATION_HULK in mutations) + return FALSE + return ..() diff --git a/code/modules/mob/living/carbon/human/traits/_trait.dm b/code/modules/mob/living/carbon/human/traits/_trait.dm index 52b7953e17e..8ea7fb86414 100644 --- a/code/modules/mob/living/carbon/human/traits/_trait.dm +++ b/code/modules/mob/living/carbon/human/traits/_trait.dm @@ -13,7 +13,7 @@ /// Trait only available for custom species. var/custom_only = TRUE - /// list of TRAIT_*'s to apply, using ROUNDSTART_TRAIT + /// list of TRAIT_*'s to apply, using QUIRK_TRAIT var/list/traits /// Proc can be overridden lower to include special changes, make sure to call up though for the vars changes @@ -21,7 +21,7 @@ SHOULD_CALL_PARENT(TRUE) for(var/trait in traits) - ADD_TRAIT(H, trait, ROUNDSTART_TRAIT) + ADD_TRAIT(H, trait, QUIRK_TRAIT) // todo: why does this depend on species? screw you, this is awful ASSERT(S) diff --git a/code/modules/mob/living/carbon/human/traits/weaver_objs.dm b/code/modules/mob/living/carbon/human/traits/weaver_objs.dm index 82ad59453a8..b08f5cd4bb2 100644 --- a/code/modules/mob/living/carbon/human/traits/weaver_objs.dm +++ b/code/modules/mob/living/carbon/human/traits/weaver_objs.dm @@ -112,7 +112,7 @@ var/global/list/weavable_items = list() "You hear a squishy noise!" ) buckle_mob(L, BUCKLE_OP_FORCE) - L.Stun(1) + L.afflict_stun(20 * 1) to_chat(L, "The sticky fibers of \the [src] ensnare, trapping you in place!") trap_active = FALSE desc += " Actually, it looks like it's been all spent." diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 2c9c4410d89..5e0d2c3cbc2 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -80,36 +80,31 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) stack_trace("CANARY: Old human update_icons_huds was called.") /mob/living/carbon/human/update_transform() + var/matrix/M = matrix() + + // handle scaling first, we don't want to have massive mobs still shift to align to tile + // when they're laying down. var/desired_scale_x = size_multiplier * icon_scale_x var/desired_scale_y = size_multiplier * icon_scale_y if(istype(species)) desired_scale_x *= species.icon_scale_x desired_scale_y *= species.icon_scale_y + M.Scale(desired_scale_x, desired_scale_y) + M.Translate(0, 16 * (desired_scale_y - 1)) - var/matrix/M = matrix() - var/anim_time = 3 - - //Due to some involuntary means, you're laying now - if(lying && !resting && !sleeping) - anim_time = 1 //Thud - - if(lying) //Only rotate them if we're not drawing a specific icon for being prone. there are no prone icons - var/randn = rand(1, 2) - if(randn <= 1) // randomly choose a rotation - M.Turn(-90) - else - M.Turn(90) - M.Scale(desired_scale_y, desired_scale_x) + // handle turning + M.Turn(lying) + // extremely lazy heuristic to see if we should shift down to appear to be, well, down. + if(lying < -45 || lying > 45) M.Translate(1,-6) - set_base_layer(MOB_LAYER - 0.01) - else - M.Scale(desired_scale_x, desired_scale_y) - M.Translate(0, 16*(desired_scale_y-1)) - set_base_layer(MOB_LAYER) - animate(src, transform = M, time = anim_time) + // fall faster if incapacitated + var/anim_time = CHECK_MOBILITY(src, MOBILITY_CAN_STAND)? 3 : 1 + + animate(src, transform = M, time = anim_time, flags = ANIMATION_PARALLEL) appearance_flags = fuzzy? (appearance_flags & ~(PIXEL_SCALE)) : (appearance_flags | PIXEL_SCALE) update_icon_special() //May contain transform-altering things + update_ssd_overlay() //DAMAGE OVERLAYS //constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists diff --git a/code/modules/mob/living/carbon/metroid/death.dm b/code/modules/mob/living/carbon/metroid/death.dm deleted file mode 100644 index b90337c2cfd..00000000000 --- a/code/modules/mob/living/carbon/metroid/death.dm +++ /dev/null @@ -1,22 +0,0 @@ -/mob/living/carbon/slime/death(gibbed) - - if(stat == DEAD) return - - if(!gibbed && is_adult) - var/mob/living/carbon/slime/M = new /mob/living/carbon/slime(loc, colour) - M.rabid = 1 - M.Friends = Friends.Copy() - step_away(M, src) - is_adult = 0 - maxHealth = 150 - revive() - if (!client) rabid = 1 - number = rand(1, 1000) - name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])" - return - - . = ..(gibbed, "seizes up and falls limp...") - mood = null - regenerate_icons() - - return diff --git a/code/modules/mob/living/carbon/metroid/emote.dm b/code/modules/mob/living/carbon/metroid/emote.dm deleted file mode 100644 index e4a5b302a9c..00000000000 --- a/code/modules/mob/living/carbon/metroid/emote.dm +++ /dev/null @@ -1,99 +0,0 @@ -/mob/living/carbon/slime/emote(var/act, var/m_type=1, var/message = null) - - if (findtext(act, "-", 1, null)) - var/t1 = findtext(act, "-", 1, null) - //param = copytext(act, t1 + 1, length(act) + 1) - act = copytext(act, 1, t1) - - if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' - act = copytext(act,1,length(act)) - - var/updateicon = 0 - - switch(act) //Alphabetical please - if ("me") - if(silent) - return - if (src.client) - if (client.prefs.muted & MUTE_IC) - to_chat(src, "You cannot send IC messages (muted).") - return - if (stat) - return - if(!(message)) - return - return custom_emote(m_type, message) - if("bounce") - message = "The [src.name] bounces in place." - m_type = 1 - - if ("custom") - return custom_emote(m_type, message) - - if("jiggle") - message = "The [src.name] jiggles!" - m_type = 1 - - if("light") - message = "The [src.name] lights up for a bit, then stops." - m_type = 1 - - if("moan") - message = "The [src.name] moans." - m_type = 2 - - if("shiver") - message = "The [src.name] shivers." - m_type = 2 - - if("sway") - message = "The [src.name] sways around dizzily." - m_type = 1 - - if("twitch") - message = "The [src.name] twitches." - m_type = 1 - - if("vibrate") - message = "The [src.name] vibrates!" - m_type = 1 - - if("nomood") - mood = null - updateicon = 1 - - if("pout") - mood = "pout" - updateicon = 1 - - if("sad") - mood = "sad" - updateicon = 1 - - if("angry") - mood = "angry" - updateicon = 1 - - if("frown") - mood = "mischevous" - updateicon = 1 - - if("smile") - mood = ":3" - updateicon = 1 - - if ("help") //This is an exception - to_chat(src, "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate. You can also set your face with: \n\nnomood, pout, sad, angry, frown, smile") - - else - to_chat(src, "Unusable emote '[act]'. Say *help for a list.") - if ((message && src.stat == 0)) - if (m_type & 1) - for(var/mob/O in viewers(src, null)) - O.show_message(message, m_type) - else - for(var/mob/O in hearers(src, null)) - O.show_message(message, m_type) - if(updateicon) - regenerate_icons() - return diff --git a/code/modules/mob/living/carbon/metroid/examine.dm b/code/modules/mob/living/carbon/metroid/examine.dm deleted file mode 100644 index 35b10a2636e..00000000000 --- a/code/modules/mob/living/carbon/metroid/examine.dm +++ /dev/null @@ -1,27 +0,0 @@ -/mob/living/carbon/slime/examine(mob/user) - . = list("This is [icon2html(src, user)] \a [src]!") - if (src.stat == DEAD) - . += SPAN_DEADSAY("It is limp and unresponsive.<") - else - if (stat == UNCONSCIOUS) // Slime stasis - . += SPAN_DEADSAY("It appears to be alive but unresponsive.") - if (getBruteLoss()) - if (getBruteLoss() < 40) - . += SPAN_WARNING("It has some punctures in its flesh!") - else - . += SPAN_DANGER("It has severe punctures and tears in its flesh!") - - switch(powerlevel) - if(2 to 3) - . += "It is flickering gently with a little electrical activity." - - if(4 to 5) - . += "It is glowing gently with moderate levels of electrical activity." - - if(6 to 9) - . += SPAN_WARNING("It is glowing brightly with high levels of electrical activity.") - - if(10) - . += SPAN_DANGER("It is radiating with massive levels of electrical activity!") - - . += "" diff --git a/code/modules/mob/living/carbon/metroid/hud.dm b/code/modules/mob/living/carbon/metroid/hud.dm deleted file mode 100644 index bd655f66992..00000000000 --- a/code/modules/mob/living/carbon/metroid/hud.dm +++ /dev/null @@ -1,2 +0,0 @@ -/mob/living/carbon/slime/handle_regular_hud_updates() - return diff --git a/code/modules/mob/living/carbon/metroid/items.dm b/code/modules/mob/living/carbon/metroid/items.dm deleted file mode 100644 index 1f884d9f54a..00000000000 --- a/code/modules/mob/living/carbon/metroid/items.dm +++ /dev/null @@ -1,308 +0,0 @@ -/obj/item/slime_extract - name = "slime extract" - desc = "Goo extracted from a slime. Legends claim these to have \"magical powers\"." - icon = 'icons/mob/slimes.dmi' - icon_state = "grey slime extract" - damage_force = 1.0 - w_class = ITEMSIZE_TINY - throw_force = 0 - throw_speed = 3 - throw_range = 6 - origin_tech = list(TECH_BIO = 4) - var/uses = 1 // uses before it goes inert - var/enhanced = 0 //has it been enhanced before? - atom_flags = OPENCONTAINER -/* -/obj/item/slime_extract/attackby(obj/item/O as obj, mob/user as mob) - if(istype(O, /obj/item/slimesteroid2)) - if(enhanced == 1) - to_chat(user, " This extract has already been enhanced!") - return ..() - if(Uses == 0) - to_chat(user, " You can't enhance a used extract!") - return ..() - to_chat(user, "You apply the enhancer. It now has triple the amount of uses.") - Uses = 3 - enhanced = 1 - qdel(O) -*/ -/obj/item/slime_extract/Initialize(mapload) - . = ..() - create_reagents(5) -// reagents.add_reagent("slimejelly", 30) - -/obj/item/slime_extract/grey - name = "grey slime extract" - icon_state = "grey slime extract" - -/obj/item/slime_extract/gold - name = "gold slime extract" - icon_state = "gold slime extract" - -/obj/item/slime_extract/silver - name = "silver slime extract" - icon_state = "silver slime extract" - -/obj/item/slime_extract/metal - name = "metal slime extract" - icon_state = "metal slime extract" - -/obj/item/slime_extract/purple - name = "purple slime extract" - icon_state = "purple slime extract" - -/obj/item/slime_extract/dark_purple - name = "dark purple slime extract" - icon_state = "dark purple slime extract" - -/obj/item/slime_extract/orange - name = "orange slime extract" - icon_state = "orange slime extract" - -/obj/item/slime_extract/yellow - name = "yellow slime extract" - icon_state = "yellow slime extract" - -/obj/item/slime_extract/red - name = "red slime extract" - icon_state = "red slime extract" - -/obj/item/slime_extract/blue - name = "blue slime extract" - icon_state = "blue slime extract" - -/obj/item/slime_extract/dark_blue - name = "dark blue slime extract" - icon_state = "dark blue slime extract" - -/obj/item/slime_extract/pink - name = "pink slime extract" - icon_state = "pink slime extract" - -/obj/item/slime_extract/green - name = "green slime extract" - icon_state = "green slime extract" - -/obj/item/slime_extract/lightpink - name = "light pink slime extract" - icon_state = "light pink slime extract" - -/obj/item/slime_extract/black - name = "black slime extract" - icon_state = "black slime extract" - -/obj/item/slime_extract/oil - name = "oil slime extract" - icon_state = "oil slime extract" - -/obj/item/slime_extract/adamantine - name = "adamantine slime extract" - icon_state = "adamantine slime extract" - -/obj/item/slime_extract/bluespace - name = "bluespace slime extract" - icon_state = "bluespace slime extract" - -/obj/item/slime_extract/pyrite - name = "pyrite slime extract" - icon_state = "pyrite slime extract" - -/obj/item/slime_extract/cerulean - name = "cerulean slime extract" - icon_state = "cerulean slime extract" - -/obj/item/slime_extract/sepia - name = "sepia slime extract" - icon_state = "sepia slime extract" - -/obj/item/slime_extract/rainbow - name = "rainbow slime extract" - icon_state = "rainbow slime extract" - -/obj/item/slimepotion - icon = 'icons/obj/medical/chemical.dmi' - -////Pet Slime Creation/// -/* -/obj/item/slimepotion/docility - name = "docility potion" - desc = "A potent chemical mix that will nullify a slime's powers, causing it to become docile and tame." - icon_state = "bottle19" - -/obj/item/slimepotion/docility/attack(mob/living/carbon/slime/M as mob, mob/user as mob) - if(!istype(M, /mob/living/carbon/slime))//If target is not a slime. - to_chat(user, " The potion only works on slimes!") - return ..() -// if(M.is_adult) //Can't tame adults -// to_chat(user, " Only baby slimes can be tamed!") -// return..() - if(M.stat) - to_chat(user, " The slime is dead!") - return..() - if(M.mind) - to_chat(user, " The slime resists!") - return ..() - var/mob/living/simple_mob/slime/pet = new /mob/living/simple_mob/slime(M.loc) - pet.icon_state = "[M.colour] [M.is_adult ? "adult" : "baby"] slime" - pet.icon_living = "[M.colour] [M.is_adult ? "adult" : "baby"] slime" - pet.icon_dead = "[M.colour] [M.is_adult ? "adult" : "baby"] slime dead" - pet.colour = "[M.colour]" - to_chat(user, "You feed the slime the potion, removing it's powers and calming it.") - - qdel(M) - - var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN) - - if (!newname) - newname = "pet slime" - pet.name = newname - pet.real_name = newname - qdel(src) - -/obj/item/slimepotion/stabilizer - name = "slime stabilizer" - desc = "A potent chemical mix that will reduce the chance of a slime mutating." - icon_state = "potcyan" - -/obj/item/slimepotion/stabilizer/attack(mob/living/carbon/slime/M, mob/user) - if(!isslime(M)) - to_chat(user, "The stabilizer only works on slimes!") - return ..() - if(M.stat) - to_chat(user, "The slime is dead!") - return ..() - if(M.mutation_chance == 0) - to_chat(user, "The slime already has no chance of mutating!") - return ..() - - to_chat(user, "You feed the slime the stabilizer. It is now less likely to mutate.") - M.mutation_chance = clamp(M.mutation_chance-15,0,100) - qdel(src) - - -/obj/item/slimepotion2 - name = "advanced docility potion" - desc = "A potent chemical mix that will nullify a slime's powers, causing it to become docile and tame. This one is meant for adult slimes" - icon = 'icons/obj/medical/chemical.dmi' - icon_state = "bottle19" - - attack(mob/living/carbon/slime/M as mob, mob/user as mob) - if(!istype(M, /mob/living/carbon/slime/))//If target is not a slime. - to_chat(user, " The potion only works on slimes!") - return ..() - if(M.stat) - to_chat(user, " The slime is dead!") - return..() - if(M.mind) - to_chat(user, " The slime resists!") - return ..() - var/mob/living/simple_mob/adultslime/pet = new /mob/living/simple_mob/adultslime(M.loc) - pet.icon_state = "[M.colour] adult slime" - pet.icon_living = "[M.colour] adult slime" - pet.icon_dead = "[M.colour] baby slime dead" - pet.colour = "[M.colour]" - to_chat(user, "You feed the slime the potion, removing it's powers and calming it.") - qdel(M) - var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN) - - if (!newname) - newname = "pet slime" - pet.name = newname - pet.real_name = newname - qdel(src) - - -/obj/item/slimesteroid - name = "slime steroid" - desc = "A potent chemical mix that will cause a slime to generate more extract." - icon = 'icons/obj/medical/chemical.dmi' - icon_state = "bottle16" - - attack(mob/living/carbon/slime/M as mob, mob/user as mob) - if(!istype(M, /mob/living/carbon/slime))//If target is not a slime. - to_chat(user, " The steroid only works on baby slimes!") - return ..() - if(M.is_adult) //Can't tame adults - to_chat(user, " Only baby slimes can use the steroid!") - return..() - if(M.stat) - to_chat(user, " The slime is dead!") - return..() - if(M.cores == 3) - to_chat(user, " The slime already has the maximum amount of extract!") - return..() - - to_chat(user, "You feed the slime the steroid. It now has triple the amount of extract.") - M.cores = 3 - qdel(src) - -/obj/item/slimesteroid2 - name = "extract enhancer" - desc = "A potent chemical mix that will give a slime extract three uses." - icon = 'icons/obj/medical/chemical.dmi' - icon_state = "bottle17" - - /*afterattack(obj/target, mob/user , flag) - if(istype(target, /obj/item/slime_extract)) - if(target.enhanced == 1) - to_chat(user, " This extract has already been enhanced!") - return ..() - if(target.Uses == 0) - to_chat(user, " You can't enhance a used extract!") - return ..() - to_chat(user, "You apply the enhancer. It now has triple the amount of uses.") - target.Uses = 3 - target.enahnced = 1 - qdel(src)*/ -*/ -/obj/effect/golemrune - anchored = 1 - desc = "a strange rune used to create golems. It glows when spirits are nearby." - name = "rune" - icon = 'icons/obj/rune.dmi' - icon_state = "golem" - unacidable = 1 - layer = TURF_LAYER - - New() - ..() - START_PROCESSING(SSobj, src) - - process() - var/mob/observer/dead/ghost - for(var/mob/observer/dead/O in src.loc) - if(!O.client) continue - if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue - ghost = O - break - if(ghost) - icon_state = "golem2" - else - icon_state = "golem" - - attack_hand(mob/living/user as mob) - var/mob/observer/dead/ghost - for(var/mob/observer/dead/O in src.loc) - if(!O.client) continue - if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue - ghost = O - break - if(!ghost) - to_chat(user, "The rune fizzles uselessly. There is no spirit nearby.") - return - var/mob/living/carbon/human/G = new(src.loc) - G.set_species(SPECIES_GOLEM) - G.key = ghost.key - to_chat(G, "You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve [user], and assist them in completing their goals at any cost.") - qdel(src) - - - proc/announce_to_ghosts() - for(var/mob/observer/dead/G in GLOB.player_list) - if(G.client) - var/area/A = get_area(src) - if(A) - to_chat(G, "Golem rune created in [A.name].") - -/mob/living/carbon/slime/has_eyes() - return 0 diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm deleted file mode 100644 index f0e43094936..00000000000 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ /dev/null @@ -1,526 +0,0 @@ -/mob/living/carbon/slime/BiologicalLife(seconds, times_fired) - if((. = ..())) - return - - if(stat == DEAD) - return - - handle_nutrition() - - if (!client) - handle_targets() - if (!AIproc) - spawn() - handle_AI() - handle_speech_and_mood() - -/mob/living/carbon/slime/handle_environment(datum/gas_mixture/environment) - if(!environment) - adjustToxLoss(rand(10,20)) - return - - //var/environment_heat_capacity = environment.heat_capacity() - var/loc_temp = T0C - if(istype(get_turf(src), /turf/space)) - //environment_heat_capacity = loc:heat_capacity - var/turf/heat_turf = get_turf(src) - loc_temp = heat_turf.temperature - else if(istype(loc, /obj/machinery/atmospherics/component/unary/cryo_cell)) - var/obj/machinery/atmospherics/component/unary/cryo_cell/C = loc - loc_temp = C.air_contents.temperature - else - loc_temp = environment.temperature - - bodytemperature += adjust_body_temperature(bodytemperature, loc_temp, 1) - - if(bodytemperature < (T0C + 5)) // start calculating temperature damage etc - if(bodytemperature <= hurt_temperature) - if(bodytemperature <= die_temperature) - adjustToxLoss(200) - else - // could be more fancy, but doesn't worth the complexity: when the slimes goes into a cold area - // the damage is mostly determined by how fast its body cools - adjustToxLoss(30) - - updatehealth() - - return //TODO: DEFERRED - -/mob/living/carbon/slime/proc/adjust_body_temperature(current, loc_temp, boost) - var/temperature = current - var/difference = abs(current-loc_temp) //get difference - var/increments// = difference/10 //find how many increments apart they are - if(difference > 50) - increments = difference/5 - else - increments = difference/10 - var/change = increments*boost // Get the amount to change by (x per increment) - var/temp_change - if(current < loc_temp) - temperature = min(loc_temp, temperature+change) - else if(current > loc_temp) - temperature = max(loc_temp, temperature-change) - temp_change = (temperature - current) - return temp_change - -/mob/living/carbon/slime/handle_chemicals_in_body() - chem_effects.Cut() - - if(touching) touching.metabolize() - if(ingested) ingested.metabolize() - if(bloodstr) bloodstr.metabolize() - - src.updatehealth() - - return //TODO: DEFERRED - -/mob/living/carbon/slime/handle_regular_UI_updates() - - src.blinded = null - - health = getMaxHealth() - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss()) - - if(health < 0 && stat != DEAD) - death() - return - - if (halloss) - halloss = 0 - - if(prob(30)) - adjustOxyLoss(-1) - adjustToxLoss(-1) - adjustFireLoss(-1) - adjustCloneLoss(-1) - adjustBruteLoss(-1) - - if (src.stat == DEAD) - src.lying = 1 - src.blinded = 1 - else - if (src.paralysis || src.stunned || src.weakened || (status_flags & FAKEDEATH)) //Stunned etc. - if (src.stunned > 0) - src.set_stat(CONSCIOUS) - if (src.weakened > 0) - src.lying = 0 - src.set_stat(CONSCIOUS) - if (src.paralysis > 0) - src.blinded = 0 - src.lying = 0 - src.set_stat(CONSCIOUS) - - else - src.lying = 0 - src.set_stat(CONSCIOUS) - - if (src.stuttering) src.stuttering = 0 - - if (src.eye_blind) - SetBlinded(0) - src.blinded = 1 - - if (src.ear_deaf > 0) - src.ear_deaf = 0 - if (src.ear_damage < 25) - src.ear_damage = 0 - - src.density = !( src.lying ) - - if (src.sdisabilities & SDISABILITY_NERVOUS) - src.blinded = 1 - if (src.sdisabilities & SDISABILITY_DEAF) - src.ear_deaf = 1 - - if (src.eye_blurry > 0) - src.eye_blurry = 0 - - if (src.druggy > 0) - src.druggy = 0 - - return 1 - -/mob/living/carbon/slime/proc/handle_nutrition() - - if (prob(15)) - nutrition -= 1 + is_adult - - if(nutrition <= 0) - nutrition = 0 - adjustToxLoss(rand(1,3)) - if (client && prob(5)) - to_chat(src, "You are starving!") - - else if (nutrition >= get_grow_nutrition() && amount_grown < 10) - nutrition -= 20 - amount_grown++ - -/mob/living/carbon/slime/proc/handle_targets() - if(attacked > 50) attacked = 50 // Let's not get into absurdly long periods of rage - - if(attacked > 0) - attacked-- - - if(Discipline > 0) - - if(Discipline >= 5 && rabid) - if(prob(60)) rabid = 0 - - if(prob(10)) - Discipline-- - - if(!canmove) return - - if(Victim) return // if it's eating someone already, continue eating! - - if(Target) - --target_patience - if (target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention - target_patience = 0 - Target = null - - var/hungry = 0 // determines if the slime is hungry - - if (nutrition < get_starve_nutrition()) - hungry = 2 - else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) - hungry = 1 - - if(hungry == 2 && !client) // if a slime is starving, it starts losing its friends - if(Friends.len > 0 && prob(1)) - var/mob/nofriend = pick(Friends) - if(nofriend && Friends[nofriend]) - Friends[nofriend] -= 1 - if (Friends[nofriend] <= 0) - Friends[nofriend] = null - Friends -= nofriend - Friends -= null - - if(!Target) - if(will_hunt(hungry) || attacked || rabid) // Only add to the list if we need to - var/list/targets = list() - - for(var/mob/living/L in view(7,src)) - - if(isslime(L) || L.stat == DEAD) // Ignore other slimes and dead mobs - continue - - if(L in Friends) // No eating friends! - continue - - if(issilicon(L) && (rabid || attacked)) // They can't eat silicons, but they can glomp them in defence - targets += L // Possible target found! - - if(istype(L, /mob/living/carbon/human) && dna) //Ignore slime(wo)men - var/mob/living/carbon/human/H = L - if(H.species.get_species_id() == SPECIES_ID_PROMETHEAN) - continue - - if(!L.canmove) // Only one slime can latch on at a time. - var/notarget = 0 - for(var/mob/living/carbon/slime/M in view(1,L)) - if(M.Victim == L) - notarget = 1 - if(notarget) - continue - - targets += L // Possible target found! - - if(targets.len > 0) - if(attacked || rabid || hungry == 2) - Target = targets[1] // I am attacked and am fighting back or so hungry I don't even care - else - for(var/mob/living/carbon/C in targets) - if(ishuman(C) && !Discipline && prob(5)) - Target = C - break - - if(isalien(C) || issmall(C) || isanimal(C)) - Target = C - break - - if (Target) - target_patience = rand(5,7) - if (is_adult) - target_patience += 3 - - if(!Target) // If we have no target, we are wandering or following orders - if (Leader) - if (holding_still) - holding_still = max(holding_still - 1, 0) - else if(canmove && isturf(loc)) - step_to(src, Leader) - - else if(hungry) - if (holding_still) - holding_still = max(holding_still - 1 - hungry, 0) - else if(canmove && isturf(loc) && prob(50)) - step(src, pick(GLOB.cardinal)) - - else - if (holding_still) - holding_still = max(holding_still - 1, 0) - else if(canmove && isturf(loc) && prob(33)) - step(src, pick(GLOB.cardinal)) - -/mob/living/carbon/slime/proc/handle_AI() // the master AI process - - if(stat == DEAD || client || Victim) return // If we're dead or have a client, we don't need AI, if we're feeding, we continue feeding - AIproc = 1 - - if(amount_grown >= 10 && !Target) - if(is_adult) - Reproduce() - else - Evolve() - AIproc = 0 - return - - if(Target) // We're chasing the target - if(Target.stat == DEAD) - Target = null - AIproc = 0 - return - - for(var/mob/living/carbon/slime/M in view(1, Target)) - if(M.Victim == Target) - Target = null - AIproc = 0 - return - - if(Target.Adjacent(src)) - if(istype(Target, /mob/living/silicon)) // Glomp the silicons - if(!Atkcool) - a_intent = INTENT_HARM - UnarmedAttack(Target) - Atkcool = 1 - spawn(45) - Atkcool = 0 - AIproc = 0 - return - - if(Target.client && !Target.lying && prob(60 + powerlevel * 4)) // Try to take down the target first - if(!Atkcool) - Atkcool = 1 - spawn(45) - Atkcool = 0 - - a_intent = INTENT_DISARM - UnarmedAttack(Target) - - else - if(!Atkcool) - a_intent = INTENT_GRAB - UnarmedAttack(Target) - - else if(Target in view(7, src)) - step_to(src, Target) - - else - Target = null - AIproc = 0 - return - - else - var/mob/living/carbon/slime/frenemy - for (var/mob/living/carbon/slime/S in view(1, src)) - if (S != src) - frenemy = S - if (frenemy && prob(1)) - if (frenemy.colour == colour) - a_intent = INTENT_HELP - else - a_intent = INTENT_HARM - UnarmedAttack(frenemy) - - var/sleeptime = movement_delay() - if(sleeptime <= 5) sleeptime = 5 // Maximum one action per half a second - spawn (sleeptime) - handle_AI() - return - -/mob/living/carbon/slime/proc/handle_speech_and_mood() - //Mood starts here - var/newmood = "" - a_intent = INTENT_HELP - if (rabid || attacked) - newmood = "angry" - a_intent = INTENT_HARM - else if (Target) newmood = "mischevous" - - if (!newmood) - if (Discipline && prob(25)) - newmood = "pout" - else if (prob(1)) - newmood = pick("sad", ":3", "pout") - - if ((mood == "sad" || mood == ":3" || mood == "pout") && !newmood) - if (prob(75)) newmood = mood - - if (newmood != mood) // This is so we don't redraw them every time - mood = newmood - regenerate_icons() - - //Speech understanding starts here - var/to_say - if (speech_buffer.len > 0) - var/who = speech_buffer[1] // Who said it? - var/phrase = speech_buffer[2] // What did they say? - if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us - if (findtext(phrase, "hello") || findtext(phrase, "hi")) - to_say = pick("Hello...", "Hi...") - else if (findtext(phrase, "follow")) - if (Leader) - if (Leader == who) // Already following him - to_say = pick("Yes...", "Lead...", "Following...") - else if (Friends[who] > Friends[Leader]) // VIVA - Leader = who - to_say = "Yes... I follow [who]..." - else - to_say = "No... I follow [Leader]..." - else - if (Friends[who] > 2) - Leader = who - to_say = "I follow..." - else // Not friendly enough - to_say = pick("No...", "I won't follow...") - else if (findtext(phrase, "stop")) - if (Victim) // We are asked to stop feeding - if (Friends[who] > 4) - Victim = null - Target = null - if (Friends[who] < 7) - --Friends[who] - to_say = "Grrr..." // I'm angry but I do it - else - to_say = "Fine..." - else if (Target) // We are asked to stop chasing - if (Friends[who] > 3) - Target = null - if (Friends[who] < 6) - --Friends[who] - to_say = "Grrr..." // I'm angry but I do it - else - to_say = "Fine..." - else if (Leader) // We are asked to stop following - if (Leader == who) - to_say = "Yes... I'll stay..." - Leader = null - else - if (Friends[who] > Friends[Leader]) - Leader = null - to_say = "Yes... I'll stop..." - else - to_say = "No... I'll keep following..." - else if (findtext(phrase, "stay")) - if (Leader) - if (Leader == who) - holding_still = Friends[who] * 10 - to_say = "Yes... Staying..." - else if (Friends[who] > Friends[Leader]) - holding_still = (Friends[who] - Friends[Leader]) * 10 - to_say = "Yes... Staying..." - else - to_say = "No... I'll keep following..." - else - if (Friends[who] > 2) - holding_still = Friends[who] * 10 - to_say = "Yes... Staying..." - else - to_say = "No... I won't stay..." - speech_buffer = list() - - //Speech starts here - if (to_say) - say (to_say) - else if(prob(1)) - emote(pick("bounce","sway","light","vibrate","jiggle")) - else - var/t = 10 - var/slimes_near = -1 // Don't count myself - var/dead_slimes = 0 - var/friends_near = list() - for (var/mob/living/carbon/M in view(7,src)) - if (isslime(M)) - ++slimes_near - if (M.stat == DEAD) - ++dead_slimes - if (M in Friends) - t += 20 - friends_near += M - if (nutrition < get_hunger_nutrition()) t += 10 - if (nutrition < get_starve_nutrition()) t += 10 - if (prob(2) && prob(t)) - var/phrases = list() - if (Target) phrases += "[Target]... looks tasty..." - if (nutrition < get_starve_nutrition()) - phrases += "So... hungry..." - phrases += "Very... hungry..." - phrases += "Need... food..." - phrases += "Must... eat..." - else if (nutrition < get_hunger_nutrition()) - phrases += "Hungry..." - phrases += "Where is the food?" - phrases += "I want to eat..." - phrases += "Rawr..." - phrases += "Blop..." - phrases += "Blorble..." - if (rabid || attacked) - phrases += "Hrr..." - phrases += "Nhuu..." - phrases += "Unn..." - if (mood == ":3") - phrases += "Purr..." - if (attacked) - phrases += "Grrr..." - if (getToxLoss() > 30) - phrases += "Cold..." - if (getToxLoss() > 60) - phrases += "So... cold..." - phrases += "Very... cold..." - if (getToxLoss() > 90) - phrases += "..." - phrases += "C... c..." - if (Victim) - phrases += "Nom..." - phrases += "Tasty..." - if (powerlevel > 3) phrases += "Bzzz..." - if (powerlevel > 5) phrases += "Zap..." - if (powerlevel > 8) phrases += "Zap... Bzz..." - if (mood == "sad") phrases += "Bored..." - if (slimes_near) phrases += "Brother..." - if (slimes_near > 1) phrases += "Brothers..." - if (dead_slimes) phrases += "What happened?" - if (!slimes_near) - phrases += "Lonely..." - for (var/M in friends_near) - phrases += "[M]... friend..." - if (nutrition < get_hunger_nutrition()) - phrases += "[M]... feed me..." - say (pick(phrases)) - -/mob/living/carbon/slime/proc/get_max_nutrition() // Can't go above it - if (is_adult) return 1200 - else return 1000 - -/mob/living/carbon/slime/proc/get_grow_nutrition() // Above it we grow, below it we can eat - if (is_adult) return 1000 - else return 800 - -/mob/living/carbon/slime/proc/get_hunger_nutrition() // Below it we will always eat - if (is_adult) return 600 - else return 500 - -/mob/living/carbon/slime/proc/get_starve_nutrition() // Below it we will eat before everything else - if (is_adult) return 300 - else return 200 - -/mob/living/carbon/slime/proc/will_hunt(var/hunger) // Check for being stopped from feeding and chasing - if (hunger == 2 || rabid || attacked) return 1 - if (Leader) return 0 - if (holding_still) return 0 - if (hunger == 1 || prob(25)) - return 1 - return 0 - -/mob/living/carbon/slime/slip() //Can't slip something without legs. - return 0 diff --git a/code/modules/mob/living/carbon/metroid/login.dm b/code/modules/mob/living/carbon/metroid/login.dm deleted file mode 100644 index d3ac320f2f4..00000000000 --- a/code/modules/mob/living/carbon/metroid/login.dm +++ /dev/null @@ -1,4 +0,0 @@ -/mob/living/carbon/slime/Login() - ..() - update_hud() - return diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm deleted file mode 100644 index 0311f34a9b2..00000000000 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ /dev/null @@ -1,389 +0,0 @@ -/* -/datum/category_item/catalogue/fauna/slime - name = "Slime" - desc = "Often referred to as Slimes, this mysterious \ - species represents a larger biological curiosity for NanoTrasen. \ - Highly mutable, these carnivorous blobs of gelatinous tissue may \ - be trained and farmed, but their temperament makes them a constant danger.\ - Speculation among Xenobiologists that Slimes share a common ancestor \ - with Prometheans have not been fully confirmed." - value = CATALOGUER_REWARD_EASY -*/ - -/mob/living/carbon/slime - name = "baby slime" - icon = 'icons/mob/slimes.dmi' - icon_state = "grey baby slime" - pass_flags = ATOM_PASS_TABLE - var/is_adult = 0 - speak_emote = list("chirps") - - plane = MOB_PLANE - layer = ABOVE_MOB_LAYER - maxHealth = 150 - health = 150 - gender = NEUTER - - update_icon = 0 - nutrition = 700 - - see_in_dark = 8 - update_slimes = 0 - - // canstun and canweaken don't affect slimes because they ignore stun and weakened variables - // for the sake of cleanliness, though, here they are. - status_flags = CANPARALYSE|CANPUSH - - var/cores = 1 // the number of /obj/item/slime_extract's the slime has left inside - var/mutation_chance = 30 // Chance of mutating, should be between 25 and 35 - - var/powerlevel = 0 // 0-10 controls how much electricity they are generating - var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows or reproduces - - var/number = 0 // Used to understand when someone is talking to it - - var/mob/living/Victim = null // the person the slime is currently feeding on - var/mob/living/Target = null // AI variable - tells the slime to hunt this down - var/mob/living/Leader = null // AI variable - tells the slime to follow this person - - var/attacked = 0 // Determines if it's been attacked recently. Can be any number, is a cooloff-ish variable - var/rabid = 0 // If set to 1, the slime will attack and eat anything it comes in contact with - var/holding_still = 0 // AI variable, cooloff-ish for how long it's going to stay in one place - var/target_patience = 0 // AI variable, cooloff-ish for how long it's going to follow its target - - var/list/Friends = list() // A list of friends; they are not considered targets for feeding; passed down after splitting - - var/list/speech_buffer = list() // Last phrase said near it and person who said it - - var/mood = "" // To show its face - - var/AIproc = 0 // If it's 0, we need to launch an AI proc - var/Atkcool = 0 // attack cooldown - var/SStun = 0 // NPC stun variable. Used to calm them down when they are attacked while feeding, or they will immediately re-attach - var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while. The part about freeze gun is a lie - - var/hurt_temperature = T0C-50 // slime keeps taking damage when its bodytemperature is below this - var/die_temperature = 50 // slime dies instantly when its bodytemperature is below this - - ///////////TIME FOR SUBSPECIES - - var/colour = "grey" - var/coretype = /obj/item/slime_extract/grey - var/list/slime_mutation[4] - - var/core_removal_stage = 0 //For removing cores. - -/mob/living/carbon/slime/Initialize(mapload, colour = "grey") - add_verb(src, /mob/living/proc/ventcrawl) - - src.colour = colour - number = rand(1, 1000) - name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])" - real_name = name - slime_mutation = mutation_table(colour) - mutation_chance = rand(25, 35) - var/sanitizedcolour = replacetext(colour, " ", "") - coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]") - regenerate_icons() - return ..(mapload) - -/mob/living/carbon/slime/movement_delay() - . = ..() - if (bodytemperature >= 330.23) // 135 F - return -1 // slimes become supercharged at high temperatures - - var/tally = 0 - - var/health_deficiency = (getMaxHealth() - health) - if(health_deficiency >= 30) tally += (health_deficiency / 25) - - if (bodytemperature < 183.222) - tally += (283.222 - bodytemperature) / 10 * 1.75 - - if(reagents) - if(reagents.has_reagent("hyperzine")) // Hyperzine slows slimes down - tally *= 2 - - if(reagents.has_reagent("frostoil")) // Frostoil also makes them move VEEERRYYYYY slow - tally *= 5 - - if(health <= 0) // if damaged, the slime moves twice as slow - tally *= 2 - - return . + tally + config_legacy.slime_delay - -/mob/living/carbon/slime/Bump(atom/movable/AM as mob|obj, yes) - if ((!(yes) || now_pushing)) - return - now_pushing = 1 - - if(isobj(AM) && !client && powerlevel > 0) - var/probab = 10 - switch(powerlevel) - if(1 to 2) probab = 20 - if(3 to 4) probab = 30 - if(5 to 6) probab = 40 - if(7 to 8) probab = 60 - if(9) probab = 70 - if(10) probab = 95 - if(prob(probab)) - if(istype(AM, /obj/structure/window) || istype(AM, /obj/structure/grille)) - if(nutrition <= get_hunger_nutrition() && !Atkcool) - if (is_adult || prob(5)) - UnarmedAttack(AM) - Atkcool = 1 - spawn(45) - Atkcool = 0 - - if(ismob(AM)) - var/mob/tmob = AM - - if(is_adult) - if(istype(tmob, /mob/living/carbon/human)) - if(prob(90)) - now_pushing = 0 - return - else - if(istype(tmob, /mob/living/carbon/human)) - now_pushing = 0 - return - - now_pushing = 0 - - ..() - -/mob/living/carbon/slime/Process_Spacemove() - return 2 - -/mob/living/carbon/slime/statpanel_data(client/C) - . = ..() - if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") - STATPANEL_DATA_LINE("Health: [round((health / getMaxHealth()) * 100)]%") - STATPANEL_DATA_LINE("Intent: [a_intent]") - STATPANEL_DATA_LINE("Nutrition: [nutrition]/[get_max_nutrition()]") - if(amount_grown >= 10) - if(is_adult) - STATPANEL_DATA_LINE("You can reproduce!") - else - STATPANEL_DATA_LINE("You can evolve!") - STATPANEL_DATA_LINE("Power Level: [powerlevel]") - -/mob/living/carbon/slime/adjustFireLoss(var/amount,var/include_robo) - ..(-abs(amount)) // Heals them - return - -/mob/living/carbon/slime/bullet_act(var/obj/projectile/Proj) - attacked += 10 - ..(Proj) - return 0 - -/mob/living/carbon/slime/emp_act(severity) - powerlevel = 0 // oh no, the power! - ..() - -/mob/living/carbon/slime/legacy_ex_act(severity) - ..() - - var/b_loss = null - var/f_loss = null - switch (severity) - if (1.0) - qdel(src) - return - - if (2.0) - - b_loss += 60 - f_loss += 60 - - - if(3.0) - b_loss += 30 - - adjustBruteLoss(b_loss) - adjustFireLoss(f_loss) - - updatehealth() - -/mob/living/carbon/slime/attack_ui(slot) - return - -/mob/living/carbon/slime/attack_hand(mob/user, list/params) - - ..() - - if(Victim) - if(Victim == M) - if(prob(60)) - visible_message("[M] attempts to wrestle \the [name] off!") - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - - else - visible_message(" [M] manages to wrestle \the [name] off!") - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - - if(prob(90) && !client) - Discipline++ - - SStun = 1 - spawn(rand(45,60)) - SStun = 0 - - Victim = null - anchored = 0 - step_away(src,M) - - return - - else - if(prob(30)) - visible_message("[M] attempts to wrestle \the [name] off of [Victim]!") - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - - else - visible_message(" [M] manages to wrestle \the [name] off of [Victim]!") - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - - if(prob(80) && !client) - Discipline++ - - if(!is_adult) - if(Discipline == 1) - attacked = 0 - - SStun = 1 - spawn(rand(55,65)) - SStun = 0 - - Victim = null - anchored = 0 - step_away(src,M) - - return - - switch(M.a_intent) - - if (INTENT_HELP) - help_shake_act(M) - - if (INTENT_GRAB) - if (M == src || anchored) - return - var/obj/item/grab/G = new /obj/item/grab(M, src) - - M.put_in_active_hand(G) - - G.synch() - - LAssailant = M - - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - visible_message("[M] has grabbed [src] passively!") - - else - - var/damage = rand(1, 9) - - attacked += 10 - if (prob(90)) - if (MUTATION_HULK in M.mutations) - damage += 5 - if(Victim || Target) - Victim = null - Target = null - anchored = 0 - if(prob(80) && !client) - Discipline++ - spawn(0) - step_away(src,M,15) - sleep(3) - step_away(src,M,15) - - playsound(loc, "punch", 25, 1, -1) - visible_message("[M] has punched [src]!", \ - "[M] has punched [src]!") - - adjustBruteLoss(damage) - updatehealth() - else - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - visible_message("[M] has attempted to punch [src]!") - return - -/mob/living/carbon/slime/attackby(obj/item/W, mob/user) - if(W.damage_force > 0) - attacked += 10 - if(prob(25)) - to_chat(user, "[W] passes right through [src]!") - return - if(Discipline && prob(50)) // wow, buddy, why am I getting attacked?? - Discipline = 0 - if(W.damage_force >= 3) - if(is_adult) - if(prob(5 + round(W.damage_force/2))) - if(Victim || Target) - if(prob(80) && !client) - Discipline++ - - Victim = null - Target = null - anchored = 0 - - SStun = 1 - spawn(rand(5,20)) - SStun = 0 - - spawn(0) - if(user) - canmove = 0 - step_away(src, user) - if(prob(25 + W.damage_force)) - sleep(2) - if(user) - step_away(src, user) - canmove = 1 - - else - if(prob(10 + W.damage_force*2)) - if(Victim || Target) - if(prob(80) && !client) - Discipline++ - if(Discipline == 1) - attacked = 0 - SStun = 1 - spawn(rand(5,20)) - SStun = 0 - - Victim = null - Target = null - anchored = 0 - - spawn(0) - if(user) - canmove = 0 - step_away(src, user) - if(prob(25 + W.damage_force*4)) - sleep(2) - if(user) - step_away(src, user) - canmove = 1 - ..() - -/mob/living/carbon/slime/restrained() - return 0 - -/mob/living/carbon/slime/var/co2overloadtime = null -/mob/living/carbon/slime/var/temperature_resistance = T0C+75 - -/mob/living/carbon/slime/toggle_throw_mode() - return - -/mob/living/carbon/slime/proc/gain_nutrition(var/amount) - nutrition += amount - if(prob(amount * 2)) // Gain around one level per 50 nutrition - powerlevel++ - if(powerlevel > 10) - powerlevel = 10 - adjustToxLoss(-10) - nutrition = max(nutrition, get_max_nutrition()) diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm deleted file mode 100644 index 89b3a9c95d7..00000000000 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ /dev/null @@ -1,168 +0,0 @@ -/mob/living/carbon/slime/proc/Wrap(var/mob/living/M) // This is a proc for the clicks - if (Victim == M || src == M) - Feedstop() - return - - if (Victim) - to_chat(src, "I am already feeding...") - return - - var t = invalidFeedTarget(M) - if (t) - to_chat(src, t) - return - - Feedon(M) - -/mob/living/carbon/slime/proc/invalidFeedTarget(var/mob/living/M) - if (!M || !istype(M)) - return "This subject is incomparable..." - if (istype(M, /mob/living/carbon/slime)) // No cannibalism... yet - return "I cannot feed on other slimes..." - if (!Adjacent(M)) - return "This subject is too far away..." - if (istype(M, /mob/living/carbon) && M.getCloneLoss() >= M.getMaxHealth() * 1.5 || istype(M, /mob/living/simple_mob) && M.stat == DEAD) - return "This subject does not have an edible life energy..." - for(var/mob/living/carbon/slime/met in view()) - if(met.Victim == M && met != src) - return "The [met.name] is already feeding on this subject..." - return 0 - -/mob/living/carbon/slime/proc/Feedon(var/mob/living/M) - Victim = M - loc = M.loc - canmove = 0 - anchored = 1 - - regenerate_icons() - - while(Victim && !invalidFeedTarget(M) && stat != 2) - canmove = 0 - - if(Adjacent(M)) - UpdateFeed(M) - - if(istype(M, /mob/living/carbon)) - Victim.adjustCloneLoss(rand(5,6)) - Victim.adjustToxLoss(rand(1,2)) - if(Victim.health <= 0) - Victim.adjustToxLoss(rand(2,4)) - - else if(istype(M, /mob/living/simple_mob)) - Victim.adjustBruteLoss(is_adult ? rand(7, 15) : rand(4, 12)) - - else - to_chat(src, "[pick("This subject is incompatable", "This subject does not have a life energy", "This subject is empty", "I am not satisified", "I can not feed from this subject", "I do not feel nourished", "This subject is not food")]...") - Feedstop() - break - - if(prob(15) && M.client && istype(M, /mob/living/carbon)) - var/painMes = pick("You can feel your body becoming weak!", "You feel like you're about to die!", "You feel every part of your body screaming in agony!", "A low, rolling pain passes through your body!", "Your body feels as if it's falling apart!", "You feel extremely weak!", "A sharp, deep pain bathes every inch of your body!") - if (ishuman(M)) - var/mob/living/carbon/human/H = M - H.custom_pain(painMes, 100) - else if (istype(M, /mob/living/carbon)) - var/mob/living/carbon/C = M - if (C.can_feel_pain()) - to_chat(M, "[painMes]") - - gain_nutrition(rand(20,25)) - - adjustOxyLoss(-10) //Heal yourself - adjustBruteLoss(-10) - adjustFireLoss(-10) - adjustCloneLoss(-10) - updatehealth() - if(Victim) - Victim.updatehealth() - - sleep(30) // Deal damage every 3 seconds - else - break - - canmove = 1 - anchored = 0 - - if(M && invalidFeedTarget(M)) // This means that the slime drained the victim - if(!client) - if(Victim && !rabid && !attacked && Victim.LAssailant && Victim.LAssailant != Victim && prob(50)) - if(!(Victim.LAssailant in Friends)) - Friends[Victim.LAssailant] = 1 - else - ++Friends[Victim.LAssailant] - - else - to_chat(src, "This subject does not have a strong enough life energy anymore...") - - Victim = null - -/mob/living/carbon/slime/proc/Feedstop() - if(Victim) - if(Victim.client) to_chat(Victim, "[src] has let go of your head!") - Victim = null - -/mob/living/carbon/slime/proc/UpdateFeed(var/mob/M) - if(Victim) - if(Victim == M) - loc = M.loc // simple "attach to head" effect! - -/mob/living/carbon/slime/verb/Evolve() - set category = "Slime" - set desc = "This will let you evolve from baby to adult slime." - - if(stat) - to_chat(src, "I must be conscious to do this...") - return - - if(!is_adult) - if(amount_grown >= 10) - is_adult = 1 - maxHealth = 200 - amount_grown = 0 - regenerate_icons() - name = text("[colour] [is_adult ? "adult" : "baby"] slime ([number])") - else - to_chat(src, "I am not ready to evolve yet...") - else - to_chat(src, "I have already evolved...") - -/mob/living/carbon/slime/verb/Reproduce() - set category = "Slime" - set desc = "This will make you split into four Slimes." - - if(stat) - to_chat(src, "I must be conscious to do this...") - return - - if(is_adult) - if(amount_grown >= 10) - if(stat) - to_chat(src, "I must be conscious to do this...") - return - - var/list/babies = list() - var/new_nutrition = round(nutrition * 0.9) - var/new_powerlevel = round(powerlevel / 4) - for(var/i = 1, i <= 4, i++) - var/t = colour - if(prob(mutation_chance)) - t = slime_mutation[rand(1,4)] - var/mob/living/carbon/slime/M = new /mob/living/carbon/slime/(loc, t) - if(ckey) M.nutrition = new_nutrition //Player slimes are more robust at spliting. Once an oversight of poor copypasta, now a feature! - M.powerlevel = new_powerlevel - if(i != 1) step_away(M, src) - M.Friends = Friends.Copy() - babies += M - feedback_add_details("slime_babies_born","slimebirth_[replacetext(M.colour," ","_")]") - - var/mob/living/carbon/slime/new_slime = pick(babies) - new_slime.universal_speak = universal_speak - if(src.mind) - src.mind.transfer(new_slime) - else - new_slime.key = src.key - qdel(src) - else - to_chat(src, "I am not ready to reproduce yet...") - else - to_chat(src, "I am not old enough to reproduce yet...") diff --git a/code/modules/mob/living/carbon/metroid/say.dm b/code/modules/mob/living/carbon/metroid/say.dm deleted file mode 100644 index 548acd967a9..00000000000 --- a/code/modules/mob/living/carbon/metroid/say.dm +++ /dev/null @@ -1,39 +0,0 @@ -/mob/living/carbon/slime/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/whispering = 0) - - message = sanitize(message) - - verb = say_quote(message) - - if(copytext(message,1,2) == "*") - return emote(copytext(message,2)) - - return ..() - -/mob/living/carbon/slime/say_quote(var/text) - var/ending = copytext(text, length(text)) - - if (ending == "?") - return "asks"; - else if (ending == "!") - return "cries"; - - return "chirps"; - -/mob/living/carbon/slime/say_understands(var/other) - if (istype(other, /mob/living/carbon/slime)) - return 1 - return ..() - -/mob/living/carbon/slime/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol) - if (speaker in Friends) - speech_buffer = list() - speech_buffer.Add(speaker) - speech_buffer.Add(lowertext(html_decode(message))) - ..() - -/mob/living/carbon/slime/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/part_c, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="") - if (speaker in Friends) - speech_buffer = list() - speech_buffer.Add(speaker) - speech_buffer.Add(lowertext(html_decode(message))) - ..() diff --git a/code/modules/mob/living/carbon/metroid/subtypes.dm b/code/modules/mob/living/carbon/metroid/subtypes.dm deleted file mode 100644 index 1fd886eb8c9..00000000000 --- a/code/modules/mob/living/carbon/metroid/subtypes.dm +++ /dev/null @@ -1,79 +0,0 @@ -/mob/living/carbon/slime/proc/mutation_table(var/colour) - var/list/slime_mutation[4] - switch(colour) - //Tier 1 - if("grey") - slime_mutation[1] = "orange" - slime_mutation[2] = "metal" - slime_mutation[3] = "blue" - slime_mutation[4] = "purple" - //Tier 2 - if("purple") - slime_mutation[1] = "dark purple" - slime_mutation[2] = "dark blue" - slime_mutation[3] = "green" - slime_mutation[4] = "green" - if("metal") - slime_mutation[1] = "silver" - slime_mutation[2] = "yellow" - slime_mutation[3] = "gold" - slime_mutation[4] = "gold" - if("orange") - slime_mutation[1] = "dark purple" - slime_mutation[2] = "yellow" - slime_mutation[3] = "red" - slime_mutation[4] = "red" - if("blue") - slime_mutation[1] = "dark blue" - slime_mutation[2] = "silver" - slime_mutation[3] = "pink" - slime_mutation[4] = "pink" - //Tier 3 - if("dark blue") - slime_mutation[1] = "purple" - slime_mutation[2] = "purple" - slime_mutation[3] = "blue" - slime_mutation[4] = "blue" - if("dark purple") - slime_mutation[1] = "purple" - slime_mutation[2] = "purple" - slime_mutation[3] = "orange" - slime_mutation[4] = "orange" - if("yellow") - slime_mutation[1] = "metal" - slime_mutation[2] = "metal" - slime_mutation[3] = "orange" - slime_mutation[4] = "orange" - if("silver") - slime_mutation[1] = "metal" - slime_mutation[2] = "metal" - slime_mutation[3] = "blue" - slime_mutation[4] = "blue" - //Tier 4 - if("pink") - slime_mutation[1] = "pink" - slime_mutation[2] = "pink" - slime_mutation[3] = "light pink" - slime_mutation[4] = "light pink" - if("red") - slime_mutation[1] = "red" - slime_mutation[2] = "red" - slime_mutation[3] = "oil" - slime_mutation[4] = "oil" - if("gold") - slime_mutation[1] = "gold" - slime_mutation[2] = "gold" - slime_mutation[3] = "adamantine" - slime_mutation[4] = "adamantine" - if("green") - slime_mutation[1] = "green" - slime_mutation[2] = "green" - slime_mutation[3] = "black" - slime_mutation[4] = "black" - // Tier 5 - else - slime_mutation[1] = colour - slime_mutation[2] = colour - slime_mutation[3] = colour - slime_mutation[4] = colour - return(slime_mutation) diff --git a/code/modules/mob/living/carbon/metroid/update_icons.dm b/code/modules/mob/living/carbon/metroid/update_icons.dm deleted file mode 100644 index 416579d4d55..00000000000 --- a/code/modules/mob/living/carbon/metroid/update_icons.dm +++ /dev/null @@ -1,9 +0,0 @@ -/mob/living/carbon/slime/regenerate_icons() - if (stat == DEAD) - icon_state = "[colour] baby slime dead" - else - icon_state = "[colour] [is_adult ? "adult" : "baby"] slime[Victim ? "" : " eat"]" - cut_overlays() - if (mood) - add_overlay(image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]")) - ..() diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm index 90e5d3255fd..44664c21941 100644 --- a/code/modules/mob/living/carbon/resist.dm +++ b/code/modules/mob/living/carbon/resist.dm @@ -1,6 +1,8 @@ /mob/living/carbon/resist_fire() + if(!on_fire) + return FALSE adjust_fire_stacks(-1.2) - Weaken(3) + afflict_paralyze(20) spin(32,2) visible_message( SPAN_DANGER("[src] rolls on the floor, trying to put themselves out!"), @@ -24,7 +26,8 @@ if(I) setClickCooldown(100) - cuff_resist(I, cuff_break = can_break_cuffs()) + INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living/carbon, cuff_resist), I, cuff_break = can_break_cuffs()) + return TRUE /mob/living/carbon/proc/reduce_cuff_time() return FALSE @@ -46,7 +49,7 @@ SPAN_DANGER("[src] is trying to break [I]!"), SPAN_WARNING("You attempt to break your [I]. (This will take around 5 seconds and you need to stand still)")) - if(do_after(src, 5 SECONDS, target = src, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED)) + if(do_after(src, 5 SECONDS, target = src, mobility_flags = MOBILITY_CAN_RESIST)) if(!I || buckled) return visible_message( @@ -71,7 +74,7 @@ visible_message( SPAN_DANGER("[src] attempts to remove [I]!"), SPAN_WARNING("You attempt to remove [I]. (This will take around [displaytime] seconds and you need to stand still)")) - if(do_after(src, breakouttime, target = src, incapacitation_flags = INCAPACITATION_DISABLED & INCAPACITATION_KNOCKDOWN)) + if(do_after(src, breakouttime, target = src, mobility_flags = MOBILITY_CAN_RESIST)) visible_message( SPAN_DANGER("[src] manages to remove [I]!"), SPAN_NOTICE("You successfully remove [I].")) diff --git a/code/modules/mob/living/carbon/viruses.dm b/code/modules/mob/living/carbon/viruses.dm index 7c9c28dda65..5de29075785 100644 --- a/code/modules/mob/living/carbon/viruses.dm +++ b/code/modules/mob/living/carbon/viruses.dm @@ -1,6 +1,6 @@ /mob/living/carbon/proc/handle_viruses() - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(bodytemperature > 406) for (var/ID in virus2) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index d814666ec3e..e465905dc3f 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -45,7 +45,7 @@ else adjustToxLoss(damage * blocked) flash_weak_pain() - updatehealth() + update_health() return 1 @@ -71,23 +71,23 @@ switch(effecttype) if(STUN) - Stun(effect * blocked) + afflict_stun(20 * effect * blocked) if(WEAKEN) - Weaken(effect * blocked) + afflict_paralyze(20 * effect * blocked) if(PARALYZE) - Unconscious(effect * blocked) + afflict_unconscious(20 * effect * blocked) if(AGONY) halloss += max((effect * blocked), 0) // Useful for objects that cause "subdual" damage. PAIN! if(IRRADIATE) afflict_radiation(effect, TRUE) if(STUTTER) - if(status_flags & CANSTUN) // stun is usually associated with stutter + if(status_flags & STATUS_CAN_STUN) // stun is usually associated with stutter stuttering = max(stuttering,(effect * blocked)) if(EYE_BLUR) eye_blurry = max(eye_blurry,(effect * blocked)) if(DROWSY) drowsyness = max(drowsyness,(effect * blocked)) - updatehealth() + update_health() return 1 /mob/living/proc/apply_effects(var/stun = 0, var/weaken = 0, var/paralyze = 0, var/irradiate = 0, var/stutter = 0, var/eyeblur = 0, var/drowsy = 0, var/agony = 0, var/blocked = 0, var/ignite = 0, var/flammable = 0) diff --git a/code/modules/mob/living/defense.dm b/code/modules/mob/living/defense.dm index f115730a4de..199b93f03a3 100644 --- a/code/modules/mob/living/defense.dm +++ b/code/modules/mob/living/defense.dm @@ -172,8 +172,8 @@ flash_pain() if (stun_amount) - Stun(stun_amount) - Weaken(stun_amount) + afflict_stun(20 * stun_amount) + afflict_paralyze(20 * stun_amount) apply_effect(STUTTER, stun_amount) apply_effect(EYE_BLUR, stun_amount) @@ -363,7 +363,7 @@ ai_holder.react_to_attack(user) src.visible_message("[user] has [attack_message] [src]!") user.do_attack_animation(src) - spawn(1) updatehealth() + spawn(1) update_health() return 1 /mob/living/proc/IgniteMob() @@ -452,7 +452,7 @@ // Called when struck by lightning. /mob/living/proc/lightning_act() // The actual damage/electrocution is handled by the tesla_zap() that accompanies this. - Unconscious(5) + afflict_unconscious(20 * 5) stuttering += 20 make_jittery(150) emp_act(1) @@ -473,7 +473,7 @@ inflict_poison_damage(5) adjustFireLoss(5) // Acid cannot be 100% resisted by protection. adjustToxLoss(5) - confused = max(confused, 1) + Confuse(1) //Blood //Acid diff --git a/code/modules/mob/living/health.dm b/code/modules/mob/living/health.dm index 79644330465..8a80205ec7d 100644 --- a/code/modules/mob/living/health.dm +++ b/code/modules/mob/living/health.dm @@ -1,3 +1,23 @@ +//? Health / Stat + +/mob/living/update_health() + if(status_flags & STATUS_GODMODE) + health = 100 + set_stat(CONSCIOUS) + else + health = getMaxHealth() - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - halloss + +/mob/living/update_stat(forced, update_mobility) + if(stat == DEAD) + return stat + if(is_unconscious() || is_sleeping() || (status_flags & STATUS_FAKEDEATH)) + . = UNCONSCIOUS + else + . = CONSCIOUS + . = max(., isnull(forced)? initial(stat) : forced) + if(. != stat) + set_stat(., update_mobility) + //? Body Temperature /** diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index f4a7acaffd2..5df0aa13f02 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -14,7 +14,8 @@ handle_vision() handle_light() - update_canmove() + // todo: is this necessary? probably but still.. + update_mobility() /mob/living/PhysicalLife(seconds, times_fired) if((. = ..())) @@ -35,6 +36,7 @@ for(var/obj/item/grab/G in src) G.process(2) + auto_resist_rest() /mob/living/BiologicalLife(seconds, times_fired) if((. = ..())) @@ -84,36 +86,16 @@ //This updates the health and status of the mob (conscious, unconscious, dead) /mob/living/proc/handle_regular_UI_updates() - updatehealth() - if(stat != DEAD) - if(paralysis) - set_stat(UNCONSCIOUS) - else if (status_flags & FAKEDEATH) - set_stat(UNCONSCIOUS) - else - set_stat(CONSCIOUS) - return 1 + update_health() + update_stat() /mob/living/proc/handle_statuses() - handle_stunned() - handle_weakened() - handle_paralysed() handle_stuttering() handle_silent() handle_drugged() handle_slurring() handle_confused() -/mob/living/proc/handle_stunned() - if(stunned) - AdjustStunned(-1) - return stunned - -/mob/living/proc/handle_weakened() - if(weakened) - AdjustWeakened(-1) - return weakened - /mob/living/proc/handle_stuttering() if(stuttering) stuttering = max(stuttering-1, 0) @@ -134,11 +116,6 @@ slurring = max(slurring-1, 0) return slurring -/mob/living/proc/handle_paralysed() - if(paralysis) - AdjustUnconscious(-1) - return paralysis - /mob/living/proc/handle_confused() if(confused) AdjustConfused(-1) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b0d3c54c244..51013b80502 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -23,13 +23,6 @@ update_hud_med_all() /mob/living/Destroy() - if(LAZYLEN(status_effects)) - for(var/s in status_effects) - var/datum/status_effect/S = s - if(S.on_remove_on_mob_delete) //the status effect calls on_remove when its mob is deleted - qdel(S) - else - S.be_replaced() if(dsoverlay) dsoverlay.loc = null dsoverlay = null @@ -74,7 +67,7 @@ /mob/living/pointed(atom/A as mob|obj|turf in view()) if(src.stat || src.restrained()) return 0 - if(src.status_flags & FAKEDEATH) + if(src.status_flags & STATUS_FAKEDEATH) return 0 if(!..()) return 0 @@ -114,13 +107,6 @@ default behaviour is: else to_chat(src, "You are not injured enough to succumb to death!") -/mob/living/proc/updatehealth() - if(status_flags & GODMODE) - health = 100 - set_stat(CONSCIOUS) - else - health = getMaxHealth() - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - halloss - //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(var/pressure) @@ -141,7 +127,7 @@ default behaviour is: if(!affecting) continue if(affecting.take_damage(0, divided_damage+extradam)) //TODO: fix the extradam stuff. Or, ebtter yet...rewrite this entire proc ~Carn H.UpdateDamageIcon() - H.updatehealth() + H.update_health() return 1 else if(istype(src, /mob/living/silicon/ai)) return 0 @@ -182,7 +168,7 @@ default behaviour is: //'include_robo' only applies to healing, for legacy purposes, as all damage typically hurts both types of organs /mob/living/proc/adjustBruteLoss(var/amount,var/include_robo) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(amount > 0) for(var/datum/modifier/M in modifiers) @@ -196,13 +182,13 @@ default behaviour is: amount *= M.incoming_healing_percent bruteloss = min(max(bruteloss + amount, 0),(getMaxHealth()*2)) - updatehealth() + update_health() /mob/living/proc/getOxyLoss() return oxyloss /mob/living/proc/adjustOxyLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(amount > 0) for(var/datum/modifier/M in modifiers) @@ -216,17 +202,17 @@ default behaviour is: amount *= M.incoming_healing_percent oxyloss = min(max(oxyloss + amount, 0),(getMaxHealth()*2)) - updatehealth() + update_health() /mob/living/proc/setOxyLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode oxyloss = amount /mob/living/proc/getToxLoss() return toxloss /mob/living/proc/adjustToxLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(amount > 0) for(var/datum/modifier/M in modifiers) @@ -240,10 +226,10 @@ default behaviour is: amount *= M.incoming_healing_percent toxloss = min(max(toxloss + amount, 0),(getMaxHealth()*2)) - updatehealth() + update_health() /mob/living/proc/setToxLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode toxloss = amount /mob/living/proc/getFireLoss() @@ -257,7 +243,7 @@ default behaviour is: //'include_robo' only applies to healing, for legacy purposes, as all damage typically hurts both types of organs /mob/living/proc/adjustFireLoss(var/amount,var/include_robo) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) @@ -270,13 +256,13 @@ default behaviour is: amount *= M.incoming_healing_percent fireloss = min(max(fireloss + amount, 0),(getMaxHealth()*2)) - updatehealth() + update_health() /mob/living/proc/getCloneLoss() return cloneloss /mob/living/proc/adjustCloneLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(amount > 0) for(var/datum/modifier/M in modifiers) @@ -290,28 +276,28 @@ default behaviour is: amount *= M.incoming_healing_percent cloneloss = min(max(cloneloss + amount, 0),(getMaxHealth()*2)) - updatehealth() + update_health() /mob/living/proc/setCloneLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode cloneloss = amount /mob/living/proc/getBrainLoss() return brainloss /mob/living/proc/adjustBrainLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode brainloss = min(max(brainloss + amount, 0),(getMaxHealth()*2)) /mob/living/proc/setBrainLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode brainloss = amount /mob/living/proc/getHalLoss() return halloss /mob/living/proc/adjustHalLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) @@ -325,10 +311,10 @@ default behaviour is: if(!isnull(M.incoming_healing_percent)) amount *= M.incoming_healing_percent halloss = min(max(halloss + amount, 0),(getMaxHealth()*2)) - updatehealth() + update_health() /mob/living/proc/setHalLoss(var/amount) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode halloss = amount // Use this to get a mob's max health whenever possible. Reading maxHealth directly will give inaccurate results if any modifiers exist. @@ -347,124 +333,12 @@ default behaviour is: health = (health/maxHealth) * (newMaxHealth) // Adjust existing health maxHealth = newMaxHealth -/mob/living/Stun(amount) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(stunned > 0) - add_status_indicator("stunned") - -/mob/living/SetStunned(amount) - ..() - if(stunned <= 0) - remove_status_indicator("stunned") - else - add_status_indicator("stunned") - -/mob/living/AdjustStunned(amount) - if(amount > 0) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(stunned <= 0) - remove_status_indicator("stunned") - else - add_status_indicator("stunned") - -/mob/living/Weaken(amount) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(weakened > 0) - add_status_indicator("weakened") - -/mob/living/SetWeakened(amount) - ..() - if(weakened <= 0) - remove_status_indicator("weakened") - else - add_status_indicator("weakened") - -/mob/living/AdjustWeakened(amount) - if(amount > 0) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(weakened <= 0) - remove_status_indicator("weakened") - else - add_status_indicator("weakened") - -/mob/living/Unconscious(amount) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(paralysis > 0) - add_status_indicator("paralysis") - -/mob/living/SetUnconscious(amount) - ..() - if(paralysis <= 0) - remove_status_indicator("paralysis") - else - add_status_indicator("paralysis") - -/mob/living/AdjustUnconscious(amount) - if(amount > 0) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(paralysis <= 0) - remove_status_indicator("paralysis") - else - add_status_indicator("paralysis") - -/mob/living/Sleeping(amount) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(sleeping > 0) - add_status_indicator("sleeping") - -/mob/living/SetSleeping(amount) - ..() - if(sleeping <= 0) - remove_status_indicator("sleeping") - else - add_status_indicator("sleeping") - -/mob/living/AdjustSleeping(amount) - if(amount > 0) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - if(sleeping <= 0) - remove_status_indicator("sleeping") - else - add_status_indicator("sleeping") /mob/living/Confuse(amount) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) ..(amount) - if(confused > 0) - add_status_indicator("confused") - -/mob/living/SetConfused(amount) - ..() - if(confused <= 0) - remove_status_indicator("confused") - else - add_status_indicator("confused") /mob/living/AdjustConfused(amount) if(amount > 0) @@ -472,10 +346,6 @@ default behaviour is: if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) ..(amount) - if(confused <= 0) - remove_status_indicator("confused") - else - add_status_indicator("confused") /mob/living/Blind(amount) for(var/datum/modifier/M in modifiers) @@ -589,27 +459,27 @@ default behaviour is: /mob/living/proc/heal_organ_damage(var/brute, var/burn) adjustBruteLoss(-brute) adjustFireLoss(-burn) - src.updatehealth() + src.update_health() // damage ONE external organ, organ gets randomly selected from damaged ones. /mob/living/proc/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/edge = 0, var/emp = 0) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode adjustBruteLoss(brute) adjustFireLoss(burn) - src.updatehealth() + src.update_health() // heal MANY external organs, in random order /mob/living/proc/heal_overall_damage(var/brute, var/burn) adjustBruteLoss(-brute) adjustFireLoss(-burn) - src.updatehealth() + src.update_health() // damage MANY external organs, in random order /mob/living/proc/take_overall_damage(var/brute, var/burn, var/used_weapon = null) - if(status_flags & GODMODE) return 0 //godmode + if(status_flags & STATUS_GODMODE) return 0 //godmode adjustBruteLoss(brute) adjustFireLoss(burn) - src.updatehealth() + src.update_health() /mob/living/proc/restore_all_organs() return @@ -640,9 +510,9 @@ default behaviour is: setOxyLoss(0) setCloneLoss(0) setBrainLoss(0) - SetUnconscious(0) - SetStunned(0) - SetWeakened(0) + set_unconscious(0) + set_stunned(0) + set_paralyzed(0) // shut down ongoing problems radiation = 0 @@ -699,14 +569,6 @@ default behaviour is: /mob/living/proc/handle_footstep(turf/T) return FALSE -/mob/living/verb/lay_down() - set name = "Rest" - set category = "IC" - - resting = !resting - to_chat(src, "You are now [resting ? "resting" : "getting up"]") - update_canmove() - //called when the mob receives a bright flash /mob/living/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /atom/movable/screen/fullscreen/tiled/flash) if(override_blindness_check || !(disabilities & SDISABILITY_NERVOUS)) @@ -760,11 +622,11 @@ default behaviour is: lastpuke = 1 if(isSynthetic()) to_chat(src, "A sudden, dizzying wave of internal feedback rushes over you!") - src.Weaken(5) + src.afflict_paralyze(20 * 5) else if (nutrition <= 100) to_chat(src, "You gag as you want to throw up, but there's nothing in your stomach!") - src.Weaken(10) + src.afflict_paralyze(20 * 10) else to_chat(src, "You feel nauseous...") @@ -791,7 +653,7 @@ default behaviour is: if(!L || L.is_broken()) blood_vomit = 1 - Stun(5) + afflict_stun(20 * 5) src.visible_message("[src] throws up!","You throw up!") playsound(loc, 'sound/effects/splat.ogg', 50, 1) @@ -812,43 +674,6 @@ default behaviour is: spawn(350) lastpuke = 0 -/mob/living/update_canmove() - // TEMPORARY PATCH UNTIL MOBILITY FLAGS - if(restrained()) - stop_pulling() - drop_all_held_items() - // End - if(!resting && cannot_stand() && can_stand_overridden()) - lying = 0 - canmove = 1 - else - if(buckled) - lying = buckled.buckle_lying(src) - else - lying = incapacitated(INCAPACITATION_KNOCKDOWN) - canmove = !incapacitated(INCAPACITATION_DISABLED) - - if(lying) - density = FALSE - drop_all_held_items() - for(var/obj/item/holder/H in get_mob_riding_slots()) - drop_item_to_ground(H) - update_water() // Submerges the mob. - else - density = initial(density) - - for(var/obj/item/grab/G in grabbed_by) - if(G.state >= GRAB_AGGRESSIVE) - canmove = FALSE - break - - if(lying != lying_prev) - lying_prev = lying - update_transform() - SEND_SIGNAL(src, COMSIG_MOB_UPDATE_LYING, lying) - - return canmove - // Mob holders in these slots will be spilled if the mob goes prone. /mob/living/proc/get_mob_riding_slots() return list(back) @@ -905,8 +730,8 @@ default behaviour is: var/matrix/M = matrix() M.Scale(desired_scale_x, desired_scale_y) M.Translate(0, 16*(desired_scale_y-1)) + update_ssd_overlay() animate(src, transform = M, time = 10) - handle_status_indicators() // This handles setting the client's color variable, which makes everything look a specific color. // This proc is here so it can be called without needing to check if the client exists, or if the client relogs. @@ -999,7 +824,7 @@ default behaviour is: return DIZZY else if (confused) return DIZZY - else if (sleeping) + else if (!IS_CONSCIOUS(src)) return UNDERWATER else return ..() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 81002c28f5c..1fa9d8699e1 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -18,9 +18,6 @@ /// A mob's "class", e.g. human, mechanical, animal, etc. Used for certain projectile effects. See __defines/mob.dm for available classes. var/mob_class = null - /// A list of all status effects the mob has - var/list/status_effects - //* Damage related vars *// NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS /// Brutal damage caused by brute force. (punching, being clubbed by a toolbox ect... this also accounts for pressure damage) var/bruteloss = 0.0 @@ -107,7 +104,16 @@ // TODO: execute iamcrystalclear for making this var var/last_blood_warn = -INFINITY - //! inventory + var/ooc_notes = null + var/obj/structure/mob_spawner/source_spawner = null + +//custom say verbs + var/custom_say = null + var/custom_ask = null + var/custom_exclaim = null + var/custom_whisper = null + + //? inventory var/hand = null var/obj/item/l_hand = null var/obj/item/r_hand = null @@ -119,10 +125,24 @@ /// Set to TRUE to enable the use of hands and the hands hud var/has_hands = FALSE - //! movement + //? movement /// are we currently pushing (or trying to push) (or otherwise inside Bump() handling that deals with this crap) another atom? - var/_pushing_bumped_atom = FALSE + var/pushing_bumped_atom = FALSE - //! throwing + //? throwing /// the force we use when we throw things var/throw_impulse = THROW_FORCE_DEFAULT + + //? mobility + /// are we resting either by will or by force + var/resting = FALSE + /// are we intentionally resting? + var/resting_intentionally = FALSE + /// are we resisting out of a resting state? + var/getting_up = FALSE + /// last loc while getting up - used by resist_a_rest + var/atom/getting_up_loc + /// last penalize time while getting up - used by resist_a_rest + var/getting_up_penalized + /// last delay before modifications while getting up - used by resist_a_rest, so reducing damage / whatever doesn't leave you with the same delay + var/getting_up_original diff --git a/code/modules/mob/living/living_defines_vr.dm b/code/modules/mob/living/living_defines_vr.dm deleted file mode 100644 index fcfca43483e..00000000000 --- a/code/modules/mob/living/living_defines_vr.dm +++ /dev/null @@ -1,13 +0,0 @@ -/mob - var/muffled = 0 // Used by muffling belly - -/mob/living - var/ooc_notes = null - var/obj/structure/mob_spawner/source_spawner = null - -//custom say verbs - var/custom_say = null - var/custom_ask = null - var/custom_exclaim = null - var/custom_whisper = null - diff --git a/code/modules/mob/living/living_powers.dm b/code/modules/mob/living/living_powers.dm index 169593dc896..1ad1a07c682 100644 --- a/code/modules/mob/living/living_powers.dm +++ b/code/modules/mob/living/living_powers.dm @@ -1,6 +1,6 @@ /mob/living/proc/reveal(var/silent, var/message = "You have been revealed! You are no longer hidden.") - if(status_flags & HIDING) - status_flags &= ~HIDING + if(status_flags & STATUS_HIDING) + status_flags &= ~STATUS_HIDING reset_plane_and_layer() if(!silent && message) to_chat(src, message) @@ -11,13 +11,13 @@ set category = "Abilities" // Check for has_buckled_mobs() (taur riding) - if(stat == DEAD || paralysis || weakened || stunned || restrained() || buckled || LAZYLEN(grabbed_by) || has_buckled_mobs()) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_USE) || buckled || LAZYLEN(grabbed_by) || has_buckled_mobs()) return - if(status_flags & HIDING) + if(status_flags & STATUS_HIDING) reveal("You have stopped hiding.") else - status_flags |= HIDING + status_flags |= STATUS_HIDING set_base_layer(HIDING_LAYER) plane = OBJ_PLANE to_chat(src,"You are now hiding.") diff --git a/code/modules/mob/living/mobility.dm b/code/modules/mob/living/mobility.dm new file mode 100644 index 00000000000..d4b2cd50b27 --- /dev/null +++ b/code/modules/mob/living/mobility.dm @@ -0,0 +1,180 @@ +/mob/living/update_mobility(blocked, forced) + // this proc looks mildly heretical and pyramid of doomy + // for micro-optimization purposes. + if(!IS_CONSCIOUS(src)) + blocked |= MOBILITY_FLAGS_REAL | MOBILITY_IS_CONSCIOUS + else + if(restrained()) + blocked |= MOBILITY_CAN_USE | MOBILITY_CAN_PICKUP | MOBILITY_CAN_HOLD | MOBILITY_CAN_PULL | MOBILITY_CAN_STORAGE | MOBILITY_CAN_UI + if(pulledby || buckled) + blocked |= MOBILITY_CAN_MOVE + for(var/obj/item/grab/G as anything in grabbed_by) + if(G.state >= GRAB_AGGRESSIVE) + blocked |= MOBILITY_CAN_MOVE | MOBILITY_CAN_USE | MOBILITY_CAN_HOLD | MOBILITY_CAN_PICKUP | MOBILITY_CAN_STORAGE | MOBILITY_CAN_UI + if(resting) + blocked |= MOBILITY_IS_STANDING + + . = ..() + + if(!(mobility_flags & MOBILITY_CAN_HOLD)) + drop_all_held_items() + if(!(mobility_flags & MOBILITY_CAN_PULL)) + stop_pulling() + if(!(mobility_flags & MOBILITY_CAN_STAND)) + set_resting(TRUE) + +/** + * immediately sets whether or not we're prone. + * does not check mobility flags. + * does not set other mobility flags or update mobility. + */ +/mob/living/proc/set_resting(value) + if(resting == value) + return + resting = value + if(resting) + add_movespeed_modifier(/datum/movespeed_modifier/mob_crawling) + else + remove_movespeed_modifier(/datum/movespeed_modifier/mob_crawling) + set_density(!resting) + if(value) + mobility_flags &= ~(MOBILITY_IS_STANDING) + else + mobility_flags |= MOBILITY_IS_STANDING + SEND_SIGNAL(src, COMSIG_MOB_ON_SET_RESTING, value) + update_lying() + update_water() + +/** + * immediately toggles resting + * does not check, or update mobility flags. + */ +/mob/living/proc/toggle_resting() + set_resting(!resting) + +/** + * starts to resist up from a resting state + * + * @return TRUE / FALSE based on if we started a new resist operation. + */ +/mob/living/proc/resist_a_rest(instant = FALSE) + if(!resting) // already up + return FALSE + if(!CHECK_MOBILITY(src, MOBILITY_CAN_STAND)) + return FALSE // nah + if(getting_up) + return FALSE // already doing so + INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living, _resist_a_rest), instant) + return TRUE + +/mob/living/proc/_resist_a_rest(instant) + PRIVATE_PROC(TRUE) + getting_up = TRUE + getting_up_loc = loc + getting_up_penalized = world.time + getting_up_original = get_up_delay() + if(isturf(loc) && !instant) + visible_message( + SPAN_NOTICE("[src] starts to get up off the ground."), + SPAN_NOTICE("You start pushing yourself off the ground."), + ) + else + innate_feedback(SPAN_NOTICE("You start pushing yourself off the ground.")) + if(instant || do_self(src, getting_up_original, flags = DO_AFTER_IGNORE_ACTIVE_ITEM | DO_AFTER_IGNORE_MOVEMENT, mobility_flags = MOBILITY_CAN_RESIST, additional_checks = CALLBACK(src, PROC_REF(_resisting_a_rest)))) + if(isturf(loc)) + visible_message( + SPAN_NOTICE("[src] gets up from the ground."), + SPAN_NOTICE("You get up."), + ) + else + innate_feedback(SPAN_NOTICE("You get up.")) + set_resting(FALSE) + else + if(isturf(loc)) + visible_message( + SPAN_NOTICE("[src] falls back down."), + SPAN_NOTICE("You fall back down."), + ) + else + innate_feedback(SPAN_NOTICE("You get up.")) + getting_up = FALSE + +/mob/living/proc/get_up_delay() + // todo: redo + return 5 + (1 - clamp(health / getMaxHealth(), 0, 1)) * 33 + min(halloss, 100) * 0.33 + +#define PENALIZE_FACTOR 0.5 + +/mob/living/proc/_resisting_a_rest(list/do_after_args) + var/current_delay = get_up_delay() + if(current_delay != getting_up_original) + do_after_args[DO_AFTER_ARG_DELAY] += current_delay - getting_up_original + getting_up_original = current_delay + if(getting_up_loc != loc) + var/penalizing = world.time - getting_up_penalized + getting_up_penalized = world.time + getting_up_loc = loc + // penalize up to 1.5 seconds retroactively + do_after_args[DO_AFTER_ARG_DELAY] += min(1.5 SECONDS, penalizing) * PENALIZE_FACTOR + return TRUE + +#undef PENALIZE_FACTOR + +/mob/living/proc/auto_resist_rest() + if(resting_intentionally || !resting) + return + if(!CHECK_MOBILITY(src, MOBILITY_CAN_STAND)) + return + resist_a_rest() + +/mob/living/proc/set_intentionally_resting(value, instant) + resting_intentionally = value + if(resting_intentionally && !resting) + set_resting(TRUE) + else if(!resting_intentionally && resting) + resist_a_rest(instant) + +/mob/living/proc/toggle_intentionally_resting(instant) + set_intentionally_resting(!resting_intentionally, instant) + +/** + * sets our lying value to the correct value, + * updates icons if necessary, + * and updates mobility if necessary. + */ +/mob/living/proc/update_lying() + var/wanted = 0 + // check if we're standing + if(IS_PRONE(src)) + // fall onto side if not already down + if(!lying) + switch(dir) + if(NORTH, SOUTH) + wanted = pick(90, -90) + if(EAST) + wanted = 90 + if(WEST) + wanted = -90 + else + wanted = lying + // allow buckled override + var/overriding = buckled?.buckle_lying() + if(!isnull(overriding)) + wanted = overriding + // check if we need to update + if(wanted == lying) + return + var/old = lying + lying = wanted + SEND_SIGNAL(src, COMSIG_MOB_ON_UPDATE_LYING, old, lying) + update_transform() + +/mob/proc/cannot_stand() + return incapacitated(INCAPACITATION_KNOCKDOWN) + +/mob/living/verb/lay_down() + set name = "Rest" + set category = "IC" + + to_chat(src, "You are now [resting_intentionally ? "attempting to stay upright." : "resting intentionally."]") + toggle_intentionally_resting() diff --git a/code/modules/mob/living/movement.dm b/code/modules/mob/living/movement.dm index affad96577d..7e8dc397844 100644 --- a/code/modules/mob/living/movement.dm +++ b/code/modules/mob/living/movement.dm @@ -26,14 +26,13 @@ ///Checks mobility move as well as parent checks /mob/living/canface() /* - if(!(mobility_flags & MOBILITY_MOVE)) + if(!(mobility_flags & MOBILITY_CAN_MOVE)) return FALSE */ if(stat != CONSCIOUS) return FALSE return ..() - /mob/living/CanAllowThrough(atom/movable/mover, turf/target) if(ismob(mover)) var/mob/M = mover @@ -45,6 +44,13 @@ return TRUE return ..() +/mob/living/can_cross_under(atom/movable/mover) + if(isliving(mover)) + var/mob/living/L = mover + if(IS_PRONE(L) && IS_STANDING(src)) + return FALSE + return ..() + //Called when something steps onto us. This allows for mulebots and vehicles to run things over. <3 /mob/living/Crossed(var/atom/movable/AM) // Transplanting this from /mob/living/carbon/human/Crossed() if(AM == src || AM.is_incorporeal()) // We're not going to run over ourselves or ghosts @@ -88,21 +94,21 @@ /mob/living/proc/_handle_atom_bumping(atom/A) set waitfor = FALSE - if(_pushing_bumped_atom) + if(pushing_bumped_atom) return if(buckled) // nope! return - _pushing_bumped_atom = TRUE + pushing_bumped_atom = TRUE if(isliving(A) && handle_living_bump(A)) - _pushing_bumped_atom = FALSE + pushing_bumped_atom = FALSE return if(isobj(A) && handle_obj_bump(A)) - _pushing_bumped_atom = FALSE + pushing_bumped_atom = FALSE return if(ismovable(A) && handle_movable_bump(A)) - _pushing_bumped_atom = FALSE + pushing_bumped_atom = FALSE return - _pushing_bumped_atom = FALSE + pushing_bumped_atom = FALSE /** * handles mob bumping/fire spread/pushing/etc @@ -133,33 +139,10 @@ to_chat(src, SPAN_WARNING("[L] is restraining [M], you cannot push past.")) return TRUE - // todo: crawling - //CIT CHANGES START HERE - makes it so resting stops you from moving through standing folks or over prone bodies without a short delay - /* - if(!CHECK_MOBILITY(src, MOBILITY_STAND)) - var/origtargetloc = L.loc - if(!pulledby) - if(combat_flags & COMBAT_FLAG_ATTEMPTING_CRAWL) - return TRUE - if(IS_STAMCRIT(src)) - to_chat(src, "You're too exhausted to crawl [(CHECK_MOBILITY(L, MOBILITY_STAND)) ? "under": "over"] [L].") - return TRUE - combat_flags |= COMBAT_FLAG_ATTEMPTING_CRAWL - visible_message("[src] is attempting to crawl [(CHECK_MOBILITY(L, MOBILITY_STAND)) ? "under" : "over"] [L].", - "You are now attempting to crawl [(CHECK_MOBILITY(L, MOBILITY_STAND)) ? "under": "over"] [L].", - target = L, target_message = "[src] is attempting to crawl [(CHECK_MOBILITY(L, MOBILITY_STAND)) ? "under" : "over"] you.") - if(!do_after(src, CRAWLUNDER_DELAY, target = src) || CHECK_MOBILITY(src, MOBILITY_STAND)) - combat_flags &= ~(COMBAT_FLAG_ATTEMPTING_CRAWL) - return TRUE - var/src_ATOM_PASS_mob = (pass_flags & ATOM_PASS_MOB) - pass_flags |= ATOM_PASS_MOB - Move(origtargetloc) - if(!src_ATOM_PASS_mob) - pass_flags &= ~ATOM_PASS_MOB - combat_flags &= ~(COMBAT_FLAG_ATTEMPTING_CRAWL) - return TRUE - */ - //END OF CIT CHANGES + // can crawl under + if(should_crawl_under(L)) + try_crawl_under(L) + return TRUE // we can either push past or swap if(can_bump_position_swap(L)) @@ -170,7 +153,7 @@ if(ishuman(L)) var/mob/living/carbon/human/H = L if(H.species.lightweight && prob(50)) - H.Weaken(5) + H.afflict_paralyze(20 * 5) H.visible_message(SPAN_WARNING("[src] bumps into [H], knocking them to the floor!")) return TRUE @@ -257,7 +240,7 @@ */ /mob/living/proc/can_bump_push_mob(mob/living/them) // check status flags - if(!(them.status_flags & CANPUSH)) + if(!(them.status_flags & STATUS_CAN_PUSH)) return FALSE //? TRAIT_PUSHIMMUNE checked in movable bump //! this isn't active until we get mobility flags, right click, and shoving @@ -275,6 +258,18 @@ return FALSE return TRUE +/** + * can try to crawl under; mostly for subtypes + */ +/mob/living/proc/should_crawl_under(mob/living/other) + return FALSE + +/** + * try to crawl under + */ +/mob/living/proc/try_crawl_under(mob/living/other) + return FALSE + /** * handles obj bumping/fire spread/pushing/etc */ diff --git a/code/modules/mob/living/resist.dm b/code/modules/mob/living/resist.dm index b5c02fb7000..4b73a7c3641 100644 --- a/code/modules/mob/living/resist.dm +++ b/code/modules/mob/living/resist.dm @@ -5,12 +5,16 @@ if(!incapacitated(INCAPACITATION_KNOCKOUT) && canClick()) setClickCooldown(20) resist_grab() - if(!weakened) + if(CHECK_MOBILITY(src, MOBILITY_CAN_RESIST)) process_resist() /mob/living/proc/process_resist() + if(!CHECK_MOBILITY(src, MOBILITY_CAN_RESIST)) + return + if(SEND_SIGNAL(src, COMSIG_MOB_PROCESS_RESIST) & COMPONENT_MOB_RESIST_INTERRUPT) return + //unbuckling yourself if(buckled) resist_buckle() @@ -22,20 +26,19 @@ C.contents_resist(src) return TRUE - else if(canmove) - if(on_fire) - resist_fire() //stop, drop, and roll - else - resist_restraints() + if(resist_fire()) + return - else if(canmove) - if(on_fire) - resist_fire() //stop, drop, and roll - else - resist_restraints() + if(resist_restraints()) + return - if(attempt_vr(src,"vore_process_resist",args)) - return TRUE + if(isbelly(loc)) + var/obj/belly/B = loc + B.relay_resist(src) + return + + if(resist_a_rest()) + return /mob/living/proc/resist_grab() var/resisting = 0 diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index f845769d2ed..464d6cedef1 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -57,7 +57,7 @@ var/list/ai_verbs_default = list( anchored = TRUE density = TRUE can_be_antagged = TRUE - status_flags = CANSTUN|CANPARALYSE|CANPUSH + status_flags = STATUS_CAN_STUN|STATUS_CAN_PARALYZE|STATUS_CAN_PUSH catalogue_data = list(/datum/category_item/catalogue/fauna/silicon/ai) translation_context_type = /datum/translation_context/variable/learning/silicons // ai gets the gamer context by default see_invisible = SEE_INVISIBLE_LIVING @@ -159,9 +159,8 @@ var/list/ai_verbs_default = list( if(!is_dummy) aiPDA = new/obj/item/pda/ai(src) SetName(pickedName) - anchored = 1 - canmove = 0 - density = 1 + anchored = TRUE + density = TRUE if(!is_dummy) aiCommunicator = new /obj/item/communicator/integrated(src) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index ad05b3a6c39..0103f99b0ad 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -15,7 +15,7 @@ reset_perspective() disconnect_shell("Disconnecting from remote shell due to local system failure.") - src.updatehealth() + src.update_health() if (!hardware_integrity() || !backup_capacitor()) death() @@ -35,7 +35,6 @@ aiRestorePowerRoutine = 0 // Necessary if AI activated it's APU AFTER losing primary power. adjustOxyLoss(-1) - handle_stunned() // Handle EMP-stun lying = 0 // Handle lying down malf_process() @@ -161,8 +160,8 @@ var/area/A = get_area(src) return ((!A.power_equip) && A.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item) -/mob/living/silicon/ai/updatehealth() - if(status_flags & GODMODE) +/mob/living/silicon/ai/update_health() + if(status_flags & STATUS_GODMODE) health = 100 set_stat(CONSCIOUS) setOxyLoss(0) diff --git a/code/modules/mob/living/silicon/decoy/decoy.dm b/code/modules/mob/living/silicon/decoy/decoy.dm index f382b707a91..1737cb40b20 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -2,12 +2,11 @@ name = "AI" icon = 'icons/mob/AI.dmi'// icon_state = "ai" - anchored = 1 // -- TLE - canmove = 0 + anchored = TRUE // -- TLE + mobility_flags = NONE /mob/living/silicon/decoy/Initialize(mapload) . = ..() src.icon = 'icons/mob/AI.dmi' src.icon_state = "ai" - src.anchored = 1 - src.canmove = 0 + src.anchored = TRUE diff --git a/code/modules/mob/living/silicon/decoy/life.dm b/code/modules/mob/living/silicon/decoy/life.dm index 1909ff9d059..669090b8344 100644 --- a/code/modules/mob/living/silicon/decoy/life.dm +++ b/code/modules/mob/living/silicon/decoy/life.dm @@ -6,8 +6,8 @@ death() return TRUE -/mob/living/silicon/decoy/updatehealth() - if(status_flags & GODMODE) +/mob/living/silicon/decoy/update_health() + if(status_flags & STATUS_GODMODE) health = 100 set_stat(CONSCIOUS) else diff --git a/code/modules/mob/living/silicon/login.dm b/code/modules/mob/living/silicon/login.dm index b2a526be89f..4ebff060721 100644 --- a/code/modules/mob/living/silicon/login.dm +++ b/code/modules/mob/living/silicon/login.dm @@ -1,4 +1,4 @@ /mob/living/silicon/Login() - SetSleeping(0) + set_sleeping(0) ..() plane_holder.set_vis(VIS_AUGMENTED, TRUE) diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index fc0b0162394..df972fecdd1 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -28,8 +28,8 @@ if(health <= 0) death(null,"gives one shrill beep before falling lifeless.") -/mob/living/silicon/pai/updatehealth() - if(status_flags & GODMODE) +/mob/living/silicon/pai/update_health() + if(status_flags & STATUS_GODMODE) health = 100 set_stat(CONSCIOUS) else diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index ef3d34a8e4e..0ad5651790c 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -258,7 +258,7 @@ set category = "pAI Commands" set name = "Unfold Chassis" - if(stat || sleeping || paralysis || weakened) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) return if(src.loc != card) @@ -310,7 +310,7 @@ set category = "pAI Commands" set name = "Collapse Chassis" - if(stat || sleeping || paralysis || weakened) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) return if(src.loc == card) @@ -361,24 +361,24 @@ // Pass lying down or getting up to our pet human, if we're in a rig. if(istype(src.loc,/obj/item/paicard)) - resting = 0 + set_resting(FALSE) var/obj/item/rig/rig = src.get_rig() if(istype(rig)) rig.force_rest(src) else - resting = !resting + toggle_resting() icon_state = resting ? "[chassis]_rest" : "[chassis]" update_icon() to_chat(src, SPAN_NOTICE("You are now [resting ? "resting" : "getting up"]")) - canmove = !resting + update_mobility() //Overriding this will stop a number of headaches down the track. /mob/living/silicon/pai/attackby(obj/item/W as obj, mob/user as mob) if(W.damage_force) visible_message("[user.name] attacks [src] with [W]!") src.adjustBruteLoss(W.damage_force) - src.updatehealth() + src.update_health() else visible_message("[user.name] bonks [src] harmlessly with [W].") spawn(1) @@ -421,8 +421,8 @@ card.forceMove(loc) forceMove(card) update_perspective() - canmove = TRUE - resting = FALSE + set_resting(FALSE) + update_mobility() icon_state = "[chassis]" remove_verb(src, /mob/living/silicon/pai/proc/pai_nom) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm index 9bc72f609b9..e5ac9903f38 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm @@ -268,8 +268,8 @@ var/mob/living/L = target if(R.cell.charge <= 666) return - L.Stun(1) - L.Weaken(1) + L.afflict_stun(20 * 1) + L.afflict_paralyze(20 * 1) L.apply_effect(STUTTER, 1) L.visible_message("[user] has shocked [L] with its tongue!", \ "[user] has shocked you with its tongue! You can feel the betrayal.") @@ -281,7 +281,7 @@ water.use_charge(5) var/mob/living/carbon/human/H = target if(H.species.lightweight == 1) - H.Weaken(3) + H.afflict_paralyze(20 * 3) else user.visible_message("[user] begins to lick [target] clean...", "You begin to lick [target] clean...") if(do_after(user, 50, target = target)) @@ -422,7 +422,7 @@ return last_special = world.time + 10 - status_flags |= LEAPING + status_flags |= STATUS_LEAPING pixel_y = pixel_y + 10 src.visible_message("\The [src] leaps at [T]!") @@ -433,7 +433,7 @@ sleep(5) - if(status_flags & LEAPING) status_flags &= ~LEAPING + if(status_flags & STATUS_LEAPING) status_flags &= ~STATUS_LEAPING if(!src.Adjacent(T)) to_chat(src, "You miss!") @@ -442,7 +442,7 @@ if(ishuman(T)) var/mob/living/carbon/human/H = T if(H.species.lightweight == 1) - H.Weaken(3) + H.afflict_paralyze(20 * 3) return var/armor_block = run_armor_check(T, "melee") var/armor_soak = get_armor_soak(T, "melee") diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm index e51fcab651d..672e73a50d2 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm @@ -277,8 +277,6 @@ dat += "\t-Toxin Content %: [patient.getToxLoss()]
" dat += "\t-Burn Severity %: [patient.getFireLoss()]
" - if(round(patient.paralysis / 4) >= 1) - dat += text("
Patient paralyzed for: []
", round(patient.paralysis / 4) >= 1 ? "[round(patient.paralysis / 4)] seconds" : "None") if(patient.getBrainLoss()) dat += "
Significant brain damage detected.

" if(patient.getCloneLoss()) @@ -521,7 +519,7 @@ var/volume = 0 for(var/mob/living/T in (touchable_items)) touchable_items -= T //Exclude mobs from loose item picking. - if((T.status_flags & GODMODE) || !T.digestable) + if((T.status_flags & STATUS_GODMODE) || !T.digestable) items_preserved |= T else var/old_brute = T.getBruteLoss() @@ -636,10 +634,10 @@ update_patient() if(patient.health < 0) patient.adjustOxyLoss(-1) //Heal some oxygen damage if they're in critical condition - patient.updatehealth() + patient.update_health() drain() - patient.AdjustStunned(-4) - patient.AdjustWeakened(-4) + patient.adjust_stunned(20 * -4) + patient.adjust_paralyzed(20 * -4) drain(1) return diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 9f14583d92c..cc5d6f428a3 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -269,8 +269,8 @@ //DRONE LIFE/DEATH //For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here. -/mob/living/silicon/robot/drone/updatehealth() - if(status_flags & GODMODE) +/mob/living/silicon/robot/drone/update_health() + if(status_flags & STATUS_GODMODE) health = maxHealth set_stat(CONSCIOUS) return diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index 16acb48c10c..a49b10e4898 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -186,7 +186,7 @@ m_type = 1 if("flip") - if(src.sleeping || src.resting || src.buckled || src.weakened || src.restrained()) + if(!CHECK_ALL_MOBILITY(src, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) to_chat(src, "You can't *flip in your current state!") else src.SpinAnimation(7,1) diff --git a/code/modules/mob/living/silicon/robot/health.dm b/code/modules/mob/living/silicon/robot/health.dm new file mode 100644 index 00000000000..26d25438853 --- /dev/null +++ b/code/modules/mob/living/silicon/robot/health.dm @@ -0,0 +1,4 @@ +/mob/living/silicon/robot/update_stat(forced, update_mobility) + if(!has_power || is_stunned() || is_paralyzed()) + forced = UNCONSCIOUS + return ..() diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 1d89b4cdbd1..053b2a7d899 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -17,14 +17,14 @@ process_killswitch() process_locks() process_queued_alarms() - update_canmove() /mob/living/silicon/robot/proc/clamp_values() + var/datum/status_effect/effect + effect = is_unconscious() + if(effect?.time_left() > 20 SECONDS) + effect.set_duration_from_now(20 SECONDS) -// SetStunned(min(stunned, 30)) - SetUnconscious(min(paralysis, 30)) -// SetWeakened(min(weakened, 20)) - SetSleeping(0) + set_sleeping(0) adjustBruteLoss(0) adjustToxLoss(0) adjustOxyLoss(0) @@ -61,40 +61,21 @@ /mob/living/silicon/robot/handle_regular_UI_updates() if(src.camera && !scrambledcodes) - if(src.stat == 2 || wires.is_cut(WIRE_BORG_CAMERA)) + if(IS_DEAD(src) || wires.is_cut(WIRE_BORG_CAMERA)) src.camera.set_status(0) else src.camera.set_status(1) - updatehealth() - - if(src.sleeping) - Unconscious(3) - AdjustSleeping(-1) + update_health() + update_stat() if(health < config_legacy.health_threshold_dead && src.stat != 2) //die only once death() - if (src.stat != 2) //Alive. - if (src.paralysis || src.stunned || src.weakened || !src.has_power) //Stunned etc. - src.set_stat(UNCONSCIOUS) - if (src.stunned > 0) - AdjustStunned(-1) - if (src.weakened > 0) - AdjustWeakened(-1) - if (src.paralysis > 0) - AdjustUnconscious(-1) - src.blinded = 1 - else - src.blinded = 0 + AdjustConfused(-1) - else //Not stunned. - src.set_stat(CONSCIOUS) + blinded = !!IS_DEAD(src) - AdjustConfused(-1) - - else //Dead or just unconscious. - src.blinded = 1 if (src.stuttering) src.stuttering-- @@ -156,8 +137,10 @@ seemeson = TRUE if(sight_mode & BORGMATERIAL) AddSightSelf(SEE_OBJS) + fullbright = TRUE if(sight_mode & BORGTHERM) AddSightSelf(SEE_MOBS) + fullbright = TRUE plane_holder?.set_vis(VIS_FULLBRIGHT, fullbright) plane_holder?.set_vis(VIS_MESONS, seemeson) @@ -282,11 +265,14 @@ weapon_lock = 0 weaponlock_time = 120 -/mob/living/silicon/robot/update_canmove() - ..() // Let's not reinvent the wheel. - if(lockdown || !is_component_functioning("actuator")) - canmove = FALSE - return canmove +// todo: better way +/mob/living/silicon/robot/update_mobility() + . = ..() + if(!is_component_functioning("actuator")) + mobility_flags &= ~MOBILITY_CAN_MOVE + if(lockdown) + mobility_flags &= ~(MOBILITY_FLAGS_ANY_INTERACTION | MOBILITY_CAN_MOVE | MOBILITY_CAN_PULL | MOBILITY_CAN_RESIST) + return mobility_flags /mob/living/silicon/robot/update_fire() cut_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state" = get_fire_icon_state())) diff --git a/code/modules/mob/living/silicon/robot/mobility.dm b/code/modules/mob/living/silicon/robot/mobility.dm new file mode 100644 index 00000000000..7924a236f31 --- /dev/null +++ b/code/modules/mob/living/silicon/robot/mobility.dm @@ -0,0 +1,5 @@ +/mob/living/silicon/robot/update_mobility(blocked, forced) + if(lockdown) + blocked |= MOBILITY_FLAGS_ANY_INTERACTION | MOBILITY_FLAGS_ANY_MOVEMENT | MOBILITY_CAN_PULL | MOBILITY_CAN_HOLD | MOBILITY_CAN_RESIST + . = ..() + updateicon() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 186676f5226..a2de51ae3b3 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -591,7 +591,7 @@ if (WT.remove_fuel(0)) user.setClickCooldown(user.get_attack_speed(WT)) adjustBruteLoss(-30) - updatehealth() + update_health() add_fingerprint(user) for(var/mob/O in viewers(user, null)) O.show_message(text("[user] has fixed some of the dents on [src]!"), 1) @@ -607,7 +607,7 @@ if (coil.use(1)) user.setClickCooldown(user.get_attack_speed(W)) adjustFireLoss(-30) - updatehealth() + update_health() for(var/mob/O in viewers(user, null)) O.show_message(text("[user] has fixed some of the burnt wires on [src]!"), 1) @@ -782,7 +782,7 @@ visible_message( \ SPAN_DANGER("[src] is trying to break their [bolt]!"), \ SPAN_WARNING("You attempt to break your [bolt]. (This will take around 90 seconds and you need to stand still)")) - if(do_after(src, 1.5 MINUTES, src, incapacitation_flags = INCAPACITATION_DISABLED)) + if(do_after(src, 1.5 MINUTES, src, mobility_flags = MOBILITY_CAN_RESIST)) visible_message( \ SPAN_DANGER("[src] manages to break \the [bolt]!"), \ SPAN_WARNING("You successfully break your [bolt].")) @@ -893,11 +893,6 @@ return 1 return 0 -/mob/living/silicon/robot/update_canmove() - . = ..() - updateicon() - - /mob/living/silicon/robot/updateicon() cut_overlays() @@ -1170,8 +1165,9 @@ lawupdate = 0 lockcharge = 0 lockdown = 0 - canmove = 1 scrambledcodes = 1 + update_stat(update_mobility = FALSE) + update_mobility() //Disconnect it's camera so it's not so easily tracked. if(src.camera) src.camera.clear_all_networks() @@ -1195,7 +1191,7 @@ state = 1 lockdown = state lockcharge = state - update_canmove() + update_mobility() /mob/living/silicon/robot/mode() set name = "Activate Held Object" diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index 4e500cf7837..31fbb9bfe33 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -1,5 +1,5 @@ -/mob/living/silicon/robot/updatehealth() - if(status_flags & GODMODE) +/mob/living/silicon/robot/update_health() + if(status_flags & STATUS_GODMODE) health = getMaxHealth() set_stat(CONSCIOUS) return @@ -111,7 +111,7 @@ parts -= picked /mob/living/silicon/robot/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null) - if(status_flags & GODMODE) return //godmode + if(status_flags & STATUS_GODMODE) return //godmode var/list/datum/robot_component/parts = get_damageable_components() //Combat shielding absorbs a percentage of damage directly into the cell. diff --git a/code/modules/mob/living/silicon/robot/robot_modules/station.dm b/code/modules/mob/living/silicon/robot/robot_modules/station.dm index f2a19e473c9..70a024d9982 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules/station.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules/station.dm @@ -211,11 +211,11 @@ GLOBAL_LIST_INIT(robot_modules, list( /obj/item/robot_module/proc/apply_status_flags(var/mob/living/silicon/robot/R) if(!can_be_pushed) - R.status_flags &= ~CANPUSH + R.status_flags &= ~STATUS_CAN_PUSH /obj/item/robot_module/proc/remove_status_flags(var/mob/living/silicon/robot/R) if(!can_be_pushed) - R.status_flags |= CANPUSH + R.status_flags |= STATUS_CAN_PUSH /// This is different from the dogborg or wideborg vars -- this is specifically if the module is a *dog* - if it should be able to do dog things like bark. /obj/item/robot_module/proc/is_dog() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index cb5b809c497..07207033479 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -142,7 +142,7 @@ "Energy pulse detected, system damaged!", \ "You hear an electrical crack.") if(prob(20)) - Stun(2) + afflict_stun(20 * 2) return /mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0) @@ -161,7 +161,7 @@ adjustFireLoss(Proj.get_final_damage(src)) Proj.on_hit(src,2) - updatehealth() + update_health() return 2 /mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1) @@ -316,7 +316,7 @@ if (stat != 2) adjustBruteLoss(30) - updatehealth() + update_health() /mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised) if(!next_alarm_notice) diff --git a/code/modules/mob/living/simple_animal/constructs/constructs.dm b/code/modules/mob/living/simple_animal/constructs/constructs.dm index dfe1c140c65..4ba1c3eacb4 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs.dm @@ -27,7 +27,7 @@ a_intent = INTENT_HARM stop_automated_movement = 1 - status_flags = CANPUSH + status_flags = STATUS_CAN_PUSH universal_speak = 0 universal_understand = 1 @@ -452,7 +452,7 @@ silence_spells(purge) -/mob/living/simple_animal/construct/updatehealth() //Special icons. +/mob/living/simple_animal/construct/update_health() //Special icons. health = getMaxHealth() - getToxLoss() - getFireLoss() - getBruteLoss() //Alive, becoming dead diff --git a/code/modules/mob/living/simple_mob/defense.dm b/code/modules/mob/living/simple_mob/defense.dm index 4ea3dcc3882..a7350ebe3df 100644 --- a/code/modules/mob/living/simple_mob/defense.dm +++ b/code/modules/mob/living/simple_mob/defense.dm @@ -20,7 +20,7 @@ if(INTENT_GRAB) if (L == src) return - if (!(status_flags & CANPUSH)) + if (!(status_flags & STATUS_CAN_PUSH)) return if(!incapacitated(INCAPACITATION_ALL) && prob(grab_resist)) L.visible_message("\The [L] tries to grab \the [src] but fails!") @@ -205,7 +205,7 @@ // If the damage is fatal, it is turned to ash. if(!client) inflict_shock_damage(200) // Mobs that are very beefy or resistant to shock may survive getting struck. - updatehealth() + update_health() if(health <= 0) visible_message(SPAN_CRITICAL("\The [src] disintegrates into ash!")) ash() @@ -217,7 +217,7 @@ // Similar to lightning, the mob is turned to ash if the lava tick was fatal and it isn't a player. // Unlike lightning, we don't add an additional damage spike (since lava already hurts a lot). if(!client) - updatehealth() + update_health() if(health <= 0) visible_message(SPAN_CRITICAL("\The [src] flashes into ash as the lava consumes them!")) ash() @@ -230,7 +230,7 @@ if(!client) inflict_heat_damage(30) inflict_poison_damage(10) - updatehealth() + update_health() if(health <= 0) visible_message(SPAN_CRITICAL("\The [src] melts into slurry!")) gib() diff --git a/code/modules/mob/living/simple_mob/life.dm b/code/modules/mob/living/simple_mob/life.dm index 5195174c836..7e895df6f7c 100644 --- a/code/modules/mob/living/simple_mob/life.dm +++ b/code/modules/mob/living/simple_mob/life.dm @@ -3,7 +3,7 @@ return //Health - updatehealth() + update_health() /mob/living/simple_mob/BiologicalLife(seconds, times_fired) if((. = ..())) @@ -11,9 +11,6 @@ if(!IS_DEAD(src)) - handle_stunned() - handle_weakened() - handle_paralysed() handle_supernatural() handle_atmos() @@ -22,7 +19,7 @@ handle_guts(seconds) //Should we be dead? -/mob/living/simple_mob/updatehealth() +/mob/living/simple_mob/update_health() health = getMaxHealth() - getFireLoss() - getBruteLoss() - getToxLoss() - getOxyLoss() - getCloneLoss() //Alive, becoming dead diff --git a/code/modules/mob/living/simple_mob/simple_mob_vr.dm b/code/modules/mob/living/simple_mob/simple_mob_vr.dm index 6e1b3a49225..58346b975f1 100644 --- a/code/modules/mob/living/simple_mob/simple_mob_vr.dm +++ b/code/modules/mob/living/simple_mob/simple_mob_vr.dm @@ -81,57 +81,6 @@ /mob/living/simple_mob/proc/will_eat(var/mob/living/M) return FALSE // no more mobvore -/mob/living/simple_mob/apply_attack(atom/A, damage_to_do) - if(isliving(A)) // Converts target to living - var/mob/living/L = A - - //ai_log("vr/do_attack() [L]", 3) - // If we're not hungry, call the sideways "parent" to do normal punching - if(!vore_active) - return ..() - - // If target is standing we might pounce and knock them down instead of attacking - var/pouncechance = CanPounceTarget(L) - if(pouncechance) - return PounceTarget(L, pouncechance) - - // We're not attempting a pounce, if they're down or we can eat standing, do it as long as they're edible. Otherwise, hit normally. - if(will_eat(L) && (!L.canmove || vore_standing_too)) - return EatTarget(L) - else - return ..() - else - return ..() - - -/mob/living/simple_mob/proc/CanPounceTarget(var/mob/living/M) //returns either FALSE or a %chance of success - if(!M.canmove || issilicon(M) || world.time < vore_pounce_cooldown) //eliminate situations where pouncing CANNOT happen - return FALSE - if(!prob(vore_pounce_chance) || !will_eat(M)) //mob doesn't want to pounce - return FALSE - if(vore_standing_too) //100% chance of hitting people we can eat on the spot - return 100 - var/TargetHealthPercent = (M.health/M.getMaxHealth())*100 //now we start looking at the target itself - if (TargetHealthPercent > vore_pounce_maxhealth) //target is too healthy to pounce - return FALSE - else - return max(0,(vore_pounce_successrate - (vore_pounce_falloff * TargetHealthPercent))) - - -/mob/living/simple_mob/proc/PounceTarget(var/mob/living/M, var/successrate = 100) - vore_pounce_cooldown = world.time + 20 SECONDS // don't attempt another pounce for a while - if(prob(successrate)) // pounce success! - M.Weaken(5) - M.visible_message("\the [src] pounces on \the [M]!!") - else // pounce misses! - M.visible_message("\the [src] attempts to pounce \the [M] but misses!!") - playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - - if(will_eat(M) && (!M.canmove || vore_standing_too)) //if they're edible then eat them too - return EatTarget(M) - else - return //just leave them - // Attempt to eat target // TODO - Review this. Could be some issues here /mob/living/simple_mob/proc/EatTarget(var/mob/living/M) @@ -211,19 +160,6 @@ "The churning walls slowly pulverize you into meaty nutrients.", "The stomach glorps and gurgles as it tries to work you into slop.") -/mob/living/simple_mob/Bumped(var/atom/movable/AM, yes) - if(ismob(AM)) - var/mob/tmob = AM - if(will_eat(tmob) && !istype(tmob, type) && prob(vore_bump_chance) && !ckey) //check if they decide to eat. Includes sanity check to prevent cannibalism. - if(tmob.canmove && prob(vore_pounce_chance)) //if they'd pounce for other noms, pounce for these too, otherwise still try and eat them if they hold still - tmob.Weaken(5) - tmob.visible_message("\the [src] [vore_bump_emote] \the [tmob]!!") - set_AI_busy(TRUE) - animal_nom(tmob) - update_icon() - set_AI_busy(FALSE) - ..() - // Checks to see if mob doesn't like this kind of turf /mob/living/simple_mob/IMove(turf/newloc, safety = TRUE) if(istype(newloc,/turf/simulated/floor/sky)) @@ -288,7 +224,7 @@ return last_special = world.time + 10 - status_flags |= LEAPING + status_flags |= STATUS_LEAPING pixel_y = pixel_y + 10 src.visible_message("\The [src] leaps at [T]!") @@ -298,7 +234,7 @@ sleep(5) - if(status_flags & LEAPING) status_flags &= ~LEAPING + if(status_flags & STATUS_LEAPING) status_flags &= ~STATUS_LEAPING if(!src.Adjacent(T)) to_chat(src, "You miss!") @@ -307,7 +243,7 @@ if(ishuman(T)) var/mob/living/carbon/human/H = T if(H.species.lightweight == 1) - H.Weaken(3) + H.afflict_paralyze(20 * 3) return var/armor_block = run_armor_check(T, "melee") var/armor_soak = get_armor_soak(T, "melee") diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm index ec5ad764f8d..8e77d850db2 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm @@ -30,7 +30,7 @@ attacktext = list("nipped") friendly = list("prods") - status_flags = CANPUSH + status_flags = STATUS_CAN_PUSH pass_flags = ATOM_PASS_TABLE movement_cooldown = 5 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_powers.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_powers.dm index 3171656b468..cc5afec92c4 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_powers.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_powers.dm @@ -262,7 +262,7 @@ to_chat(src, "You focus your psychic lance on [M] and freeze their limbs with a wave of terrible dread.") to_chat(M, "You feel a creeping, horrible sense of dread come over you, freezing your limbs and setting your heart racing.") - M.Weaken(10) + M.afflict_paralyze(20 * 10) used_dominate = world.time @@ -351,4 +351,4 @@ rejuvenate() restore_blood() fixblood() - update_canmove() + update_mobility() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/farm animals/cow.dm b/code/modules/mob/living/simple_mob/subtypes/animal/farm animals/cow.dm index 79174de7049..dd1534a2565 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/farm animals/cow.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/farm animals/cow.dm @@ -68,7 +68,7 @@ return if(!stat && M.a_intent == INTENT_DISARM && icon_state != icon_dead) M.visible_message("[M] tips over [src].","You tip over [src].") - Weaken(30) + afflict_paralyze(20 * 30) icon_state = icon_dead spawn(rand(20,50)) if(!stat && M) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm index 4db129c3b69..87c26382eb7 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/hunter.dm @@ -67,15 +67,15 @@ sleep(leap_warmup) // For the telegraphing. // Do the actual leap. - status_flags |= LEAPING // Lets us pass over everything. + status_flags |= STATUS_LEAPING // Lets us pass over everything. visible_message(SPAN_DANGER("\The [src] leaps at \the [A]!")) throw_at_old(get_step(get_turf(A), get_turf(src)), special_attack_max_range+1, 1, src) playsound(src, leap_sound, 75, 1) sleep(5) // For the throw to complete. It won't hold up the AI SSticker due to waitfor being false. - if(status_flags & LEAPING) - status_flags &= ~LEAPING // Revert special passage ability. + if(status_flags & STATUS_LEAPING) + status_flags &= ~STATUS_LEAPING // Revert special passage ability. var/turf/T = get_turf(src) // Where we landed. This might be different than A's turf. @@ -96,7 +96,7 @@ break if(victim) - victim.Weaken(2) + victim.afflict_paralyze(20 * 2) victim.visible_message(SPAN_DANGER("\The [src] knocks down \the [victim]!")) to_chat(victim, SPAN_CRITICAL("\The [src] jumps on you!")) . = TRUE diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/lurker.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/lurker.dm index 40dc8b82f3c..44b430f3169 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/lurker.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/lurker.dm @@ -109,7 +109,7 @@ if(stealthed) if(isliving(A)) var/mob/living/L = A - L.Weaken(stealthed_weaken_amount) + L.afflict_paralyze(20 * stealthed_weaken_amount) to_chat(L, SPAN_DANGER("\The [src] ambushes you!")) playsound(L, 'sound/weapons/spiderlunge.ogg', 75, 1) unstealth() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm index de61372ba3c..cd7095b9d8e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm @@ -116,7 +116,7 @@ visible_message(SPAN_DANGER("\The [src] erupts from underneath, and hits \the [L]!")) playsound(L, 'sound/weapons/heavysmash.ogg', 75, 1) - L.Weaken(3) + L.afflict_paralyze(20 * 3) overshoot = FALSE if(!overshoot) // We hit the target, or something, at destination, so we're done. @@ -158,14 +158,14 @@ if(T.check_density(ignore_mobs = TRUE)) to_chat(src, SPAN_CRITICAL("You hit something really solid!")) playsound(src, "punch", 75, 1) - Weaken(5) + afflict_paralyze(20 * 5) add_modifier(/datum/modifier/tunneler_vulnerable, 10 SECONDS) return FALSE // Hit a wall. // Stun anyone in our way. for(var/mob/living/L in T) playsound(L, 'sound/weapons/heavysmash.ogg', 75, 1) - L.Weaken(2) + L.afflict_paralyze(20 * 2) // Get into the tile. forceMove(T) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm b/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm index 87d0cf0dfbe..fccc2be3ac3 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/roach/roach.dm @@ -530,7 +530,7 @@ if(stealthed) if(isliving(A)) var/mob/living/L = A - L.Weaken(stealthed_weaken_amount) + L.afflict_paralyze(20 * stealthed_weaken_amount) to_chat(L, SPAN_DANGER("\The [src] ambushes you!")) playsound(L, 'sound/weapons/spiderlunge.ogg', 75, 1) unstealth() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/hooligan_crab.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/hooligan_crab.dm index 2a4e34727a2..e17e6b5e64b 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/hooligan_crab.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/hooligan_crab.dm @@ -86,7 +86,7 @@ if(isliving(A)) var/mob/living/L = A var/was_stunned = L.incapacitated(INCAPACITATION_DISABLED) - L.Weaken(weaken_amount) + L.afflict_paralyze(20 * weaken_amount) playsound(L, 'sound/effects/break_stone.ogg', 75, 1) if(was_stunned) // Try to prevent chain-stuns by having them thrown. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm index c16f2e60cfe..c11997d84be 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm @@ -43,7 +43,7 @@ density = FALSE // Non-dense, so things can pass over them. - status_flags = CANPUSH + status_flags = STATUS_CAN_PUSH pass_flags = ATOM_PASS_TABLE maxHealth = 100 @@ -476,7 +476,7 @@ if(isliving(A)) var/mob/living/L = A if(ishuman(L) && !L.isSynthetic()) - if(L.incapacitated() || (L.stat && L.stat != DEAD) || L.resting || L.paralysis) + if(L.incapacitated() || (L.stat && L.stat != DEAD) || !CHECK_MOBILITY(L, MOBILITY_FLAGS_ANY_INTERACTION) || !IS_CONSCIOUS(L)) holder.a_intent = INTENT_GRAB // Infesting time. else holder.a_intent = INTENT_DISARM // They're standing up! Try to drop or stun them. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/bats.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/bats.dm index 0a005f555ff..f444c551dc4 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/bats.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/bats.dm @@ -52,7 +52,7 @@ if(isliving(A)) var/mob/living/L = A if(prob(scare_chance)) - L.Stun(1) + L.afflict_stun(20 * 1) L.visible_message("\the [src] scares \the [L]!") // Spookiest of bats diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm index 523fef55ac7..9d341dfcc8c 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm @@ -64,7 +64,7 @@ if(isliving(A)) var/mob/living/L = A if(prob(knockdown_chance)) - L.Weaken(3) + L.afflict_paralyze(20 * 3) L.visible_message(SPAN_DANGER("\The [src] knocks down \the [L]!")) // Subtypes. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm index 2d3fa428f62..f79a459dfb8 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/mouse_army.dm @@ -410,7 +410,7 @@ if(stealthed) if(isliving(A)) var/mob/living/L = A - L.Weaken(stealthed_weaken_amount) + L.afflict_paralyze(20 * stealthed_weaken_amount) to_chat(L, SPAN_DANGER("\The [src] ambushes you!")) playsound(L, 'sound/weapons/spiderlunge.ogg', 75, 1) unstealth() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/thrumbo.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/thrumbo.dm index 2fe314020d5..f673c4c8c55 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/thrumbo.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/thrumbo.dm @@ -86,8 +86,8 @@ if(istype(AM, /mob/living)) var/mob/living/M = AM visible_message("[src] rams [AM]!") - M.Stun(5) - M.Weaken(3) + M.afflict_stun(20 * 5) + M.afflict_paralyze(20 * 3) var/throwdir = pick(turn(dir, 45), turn(dir, -45)) M.throw_at_old(get_step(src.loc, throwdir), 1, 1, src) runOver(M) // Actually should not use this, placeholder diff --git a/code/modules/mob/living/simple_mob/subtypes/humanoid/cultist.dm b/code/modules/mob/living/simple_mob/subtypes/humanoid/cultist.dm index bbcf48d5b63..8945234ce49 100644 --- a/code/modules/mob/living/simple_mob/subtypes/humanoid/cultist.dm +++ b/code/modules/mob/living/simple_mob/subtypes/humanoid/cultist.dm @@ -135,7 +135,7 @@ visible_message(SPAN_DANGER("\The [src] suddenly rises from a pool of blood \the [L]!")) new /obj/effect/debris/cleanable/blood (src.loc) playsound(L, 'sound/weapons/heavysmash.ogg', 75, 1) - L.Weaken(3) + L.afflict_paralyze(20 * 3) overshoot = FALSE if(!overshoot) // We hit the target, or something, at destination, so we're done. @@ -178,7 +178,7 @@ if(T.check_density(ignore_mobs = TRUE)) to_chat(src, SPAN_CRITICAL("You hit something really solid!")) playsound(src, "punch", 75, 1) - Weaken(5) + afflict_paralyze(20 * 5) add_modifier(/datum/modifier/tunneler_vulnerable, 10 SECONDS) return FALSE // Hit a wall. diff --git a/code/modules/mob/living/simple_mob/subtypes/lavaland/goliath.dm b/code/modules/mob/living/simple_mob/subtypes/lavaland/goliath.dm index cef04b05e3f..efe94317922 100644 --- a/code/modules/mob/living/simple_mob/subtypes/lavaland/goliath.dm +++ b/code/modules/mob/living/simple_mob/subtypes/lavaland/goliath.dm @@ -269,7 +269,7 @@ continue visible_message("[src] grabs hold of [C]!") tripanim() - C.Stun(2) + C.afflict_stun(20 * 2) C.adjustBruteLoss(rand(5,10)) latched = TRUE for(var/obj/mecha/M in loc) diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/cyber_horror/cyber_horror.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/cyber_horror/cyber_horror.dm index 275c68cf6f3..20be11d5b5c 100644 --- a/code/modules/mob/living/simple_mob/subtypes/mechanical/cyber_horror/cyber_horror.dm +++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/cyber_horror/cyber_horror.dm @@ -160,7 +160,7 @@ // Do the actual leap. // Lets us pass over everything. - status_flags |= LEAPING + status_flags |= STATUS_LEAPING visible_message(SPAN_DANGER("\The [src] leaps at \the [A]!")) throw_at_old(get_step(get_turf(A), get_turf(src)), special_attack_max_range+1, 1, src) playsound(src, leap_sound, 75, 1) @@ -168,8 +168,8 @@ sleep(5) // Revert special passage ability. - if(status_flags & LEAPING) - status_flags &= ~LEAPING + if(status_flags & STATUS_LEAPING) + status_flags &= ~STATUS_LEAPING // Where we landed. This might be different than A's turf. var/turf/T = get_turf(src) @@ -192,7 +192,7 @@ break if(victim) - victim.Weaken(2) + victim.afflict_paralyze(20 * 2) victim.visible_message(SPAN_DANGER("\The [src] knocks down \the [victim]!")) to_chat(victim, SPAN_CRITICAL("\The [src] jumps on you!")) . = TRUE @@ -292,7 +292,7 @@ if(stealthed) if(isliving(A)) var/mob/living/L = A - L.Weaken(stealthed_weaken_amount) + L.afflict_paralyze(20 * stealthed_weaken_amount) to_chat(L, SPAN_DANGER("\The [src] tears into you!")) playsound(L, 'sound/weapons/spiderlunge.ogg', 75, 1) unstealth() diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/combat_mecha.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/combat_mecha.dm index d667be5b147..7ad65f27cfa 100644 --- a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/combat_mecha.dm +++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/combat_mecha.dm @@ -30,7 +30,7 @@ if(L.mob_size <= MOB_MEDIUM) visible_message(SPAN_DANGER("\The [src] sends \the [L] flying with their mechanized fist!")) playsound(src, "punch", 50, 1) - L.Weaken(weaken_amount) + L.afflict_paralyze(20 * weaken_amount) var/throw_dir = get_dir(src, L) var/throw_dist = L.incapacitated(INCAPACITATION_DISABLED) ? 4 : 1 L.throw_at_old(get_edge_target_turf(L, throw_dir), throw_dist, 1, src) diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm index 4f2d2734776..b61bf06dc52 100644 --- a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm +++ b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/juggernaut.dm @@ -56,7 +56,7 @@ "rad" = 100) /mob/living/simple_mob/construct/juggernaut/Life(seconds, times_fired) - SetWeakened(0) + set_paralyzed(0) return ..() /mob/living/simple_mob/construct/juggernaut/Initialize(mapload) diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/wraith.dm b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/wraith.dm index e8fc52e6750..bfebbcf2c2e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/wraith.dm +++ b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/wraith.dm @@ -105,7 +105,7 @@ visible_message(SPAN_DANGER("\The [src] appears in a flurry of slashes \the [L]!")) playsound(L, 'sound/weapons/heavysmash.ogg', 75, 1) - L.Weaken(3) + L.afflict_paralyze(20 * 3) overshoot = FALSE if(!overshoot) // We hit the target, or something, at destination, so we're done. @@ -148,7 +148,7 @@ if(T.check_density(ignore_mobs = TRUE)) to_chat(src, SPAN_CRITICAL("You hit something really solid!")) playsound(src, "punch", 75, 1) - Weaken(5) + afflict_paralyze(20 * 5) add_modifier(/datum/modifier/tunneler_vulnerable, 10 SECONDS) return FALSE // Hit a wall. diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/faithless.dm b/code/modules/mob/living/simple_mob/subtypes/occult/faithless.dm index 8dcb276cddc..7c781f4fc9e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/occult/faithless.dm +++ b/code/modules/mob/living/simple_mob/subtypes/occult/faithless.dm @@ -60,7 +60,7 @@ if(isliving(A)) var/mob/living/L = A if(prob(12)) - L.Weaken(3) + L.afflict_paralyze(20 * 3) L.visible_message("\the [src] knocks down \the [L]!") // Strong Variant diff --git a/code/modules/mob/living/simple_mob/subtypes/plant/tree.dm b/code/modules/mob/living/simple_mob/subtypes/plant/tree.dm index 144168c1580..63d446d158a 100644 --- a/code/modules/mob/living/simple_mob/subtypes/plant/tree.dm +++ b/code/modules/mob/living/simple_mob/subtypes/plant/tree.dm @@ -42,7 +42,7 @@ if(isliving(A)) var/mob/living/L = A if(prob(15)) - L.Weaken(3) + L.afflict_paralyze(20 * 3) L.visible_message(SPAN_DANGER("\The [src] knocks down \the [L]!")) /mob/living/simple_mob/animal/space/tree/death() diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/combat.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/combat.dm index d889de6acc2..a5f1d083997 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/combat.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/combat.dm @@ -21,8 +21,8 @@ SPAN_DANGER("\The [src] has shocked you!") ) playsound(src, 'sound/weapons/Egloves.ogg', 75, 1) - L.Weaken(4) - L.Stun(4) + L.afflict_paralyze(20 * 4) + L.afflict_stun(20 * 4) do_attack_animation(L) if(L.buckled) L.buckled.unbuckle_mob() // To prevent an exploit where being buckled prevents slimes from jumping on you. @@ -42,7 +42,7 @@ SPAN_DANGER("\The [src] has pounced at you!") ) playsound(src, 'sound/weapons/thudswoosh.ogg', 75, 1) - L.Weaken(2) + L.afflict_paralyze(20 * 2) do_attack_animation(L) if(L.buckled) L.buckled.unbuckle_mob() // To prevent an exploit where being buckled prevents slimes from jumping on you. diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm index 0855c3a641e..8bc7f12bd75 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm @@ -72,7 +72,7 @@ stop_consumption() if(victim) - victim.updatehealth() + victim.update_health() else stop_consumption() diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/defense.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/defense.dm index cce47e639c8..7d0d0eccb65 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/defense.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/defense.dm @@ -54,4 +54,4 @@ // Getting slimebatoned/xenotased. /mob/living/simple_mob/slime/xenobio/slimebatoned(mob/living/user, amount) adjust_discipline(round(amount/2)) - Weaken(amount) // This needs to come afterwards or else it will always be considered abuse to the slime. + afflict_paralyze(20 * amount) // This needs to come afterwards or else it will always be considered abuse to the slime. diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm index d09542601e8..e879fa3b0f4 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm @@ -405,7 +405,7 @@ if(L.mob_size <= MOB_MEDIUM) visible_message(SPAN_DANGER("\The [src] sends \the [L] flying with the impact!")) playsound(src, "punch", 50, 1) - L.Weaken(1) + L.afflict_paralyze(20 * 1) var/throwdir = get_dir(src, L) L.throw_at_old(get_edge_target_turf(L, throwdir), 3, 1, src) else diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes_vr.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes_vr.dm index 258f7506d38..c989eaff5b3 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes_vr.dm @@ -4,4 +4,4 @@ /mob/living/simple_mob/slime/xenobio/Initialize(mapload, var/mob/living/simple_mob/slime/xenobio/my_predecessor) . = ..() - Weaken(2) + afflict_paralyze(20 * 2) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon.dm b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon.dm index 531fed2c174..aae089eafed 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon.dm @@ -83,9 +83,8 @@ else return .=..() -/mob/living/simple_mob/vore/demon/update_canmove() +// todo: better way +/mob/living/simple_mob/vore/demon/update_mobility() if(is_shifting) - canmove = FALSE - return canmove - else - return ..() + return (mobility_flags = MOBILITY_CAN_MOVE) + return ..() diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm index 9f14b5e0892..1c1f1bdf2bf 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities.dm @@ -17,15 +17,13 @@ return FALSE forceMove(T) - var/original_canmove = canmove - SetStunned(0) - SetWeakened(0) + set_stunned(0) + set_paralyzed(0) if(buckled) buckled.unbuckle_mob() if(pulledby) pulledby.stop_pulling() stop_pulling() - canmove = FALSE is_shifting = TRUE //Shifting in @@ -49,7 +47,6 @@ custom_emote(1,"phases in!") sleep(30) //The duration of the TP animation is_shifting = FALSE - canmove = original_canmove //Potential phase-in vore if(can_be_drop_pred) //Toggleable in vore panel @@ -102,7 +99,6 @@ alpha = 127 is_shifting = FALSE - canmove = original_canmove incorporeal_move = TRUE density = FALSE force_max_speed = TRUE @@ -129,15 +125,13 @@ shift_state = AB_SHIFT_ACTIVE forceMove(T) - var/original_canmove = canmove - SetStunned(0) - SetWeakened(0) + set_stunned(0) + set_paralyzed(0) if(buckled) buckled.unbuckle_mob() if(pulledby) pulledby.stop_pulling() stop_pulling() - canmove = FALSE is_shifting = TRUE shifted_out = TRUE @@ -158,7 +152,6 @@ alpha = 127 is_shifting = FALSE - canmove = original_canmove incorporeal_move = TRUE density = FALSE force_max_speed = TRUE @@ -177,8 +170,6 @@ incorporeal_move = initial(incorporeal_move) density = initial(density) force_max_speed = initial(force_max_speed) - original_canmove = canmove - canmove = FALSE is_shifting = TRUE //Cosmetics mostly @@ -186,7 +177,6 @@ custom_emote(1,"phases in!") sleep(30) //The duration of the TP animation is_shifting = FALSE - canmove = original_canmove var/turf/NT = get_turf(src) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm b/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm index 15ef401c233..6c3fd2b91c4 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm @@ -123,7 +123,7 @@ if(isliving(A)) var/mob/living/L = A if(prob(knockdown_chance)) - L.Weaken(3) + L.afflict_paralyze(20 * 3) L.visible_message(SPAN_DANGER("\The [src] knocks down \the [L]!")) /mob/living/simple_mob/vore/aggressive/mimic/will_show_tooltip() diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm index c706b628850..fb496a6cc03 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm @@ -10,7 +10,7 @@ icon_living = "morph" icon_dead = "morph_dead" movement_cooldown = 1 - status_flags = CANPUSH + status_flags = STATUS_CAN_PUSH pass_flags = ATOM_PASS_TABLE mob_bump_flag = SLIME diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm index 9bfd153c1c9..f0763a8c527 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm @@ -6,15 +6,13 @@ return FALSE forceMove(T) - var/original_canmove = canmove - SetStunned(0) - SetWeakened(0) + set_stunned(0) + set_paralyzed(0) if(buckled) buckled.unbuckle_mob() if(pulledby) pulledby.stop_pulling() stop_pulling() - canmove = FALSE //Shifting in if(ability_flags & AB_PHASE_SHIFTED) @@ -37,7 +35,6 @@ flick("tp_in",src) custom_emote(1,"phases in!") sleep(5) //The duration of the TP animation - canmove = original_canmove //Potential phase-in vore if(can_be_drop_pred) //Toggleable in vore panel @@ -88,7 +85,6 @@ update_icon() alpha = 127 - canmove = original_canmove incorporeal_move = TRUE density = FALSE force_max_speed = TRUE diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub.dm b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub.dm index bca370c74a5..b7103cf38ca 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub.dm @@ -83,7 +83,7 @@ GLOBAL_LIST_EMPTY(solargrubs) /mob/living/simple_mob/vore/solargrub/BiologicalLife(seconds, times_fired) if((. = ..())) return - + if(stat != CONSCIOUS) return @@ -143,8 +143,8 @@ GLOBAL_LIST_EMPTY(solargrubs) if(prob(shock_chance)) A.emp_act(4) //The weakest strength of EMP playsound(src, 'sound/weapons/Egloves.ogg', 75, 1) - L.Weaken(4) - L.Stun(4) + L.afflict_paralyze(20 * 4) + L.afflict_stun(20 * 4) L.stuttering = max(L.stuttering, 4) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, L) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/solarmoth_ch.dm b/code/modules/mob/living/simple_mob/subtypes/vore/solarmoth_ch.dm index 9a552e2c53d..733a3e5314e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/solarmoth_ch.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/solarmoth_ch.dm @@ -84,8 +84,8 @@ if(prob(shock_chance)) A.emp_act(4) //The weakest strength of EMP playsound(src, 'sound/weapons/Egloves.ogg', 75, 1) - L.Weaken(4) - L.Stun(4) + L.afflict_paralyze(20 * 4) + L.afflict_stun(20 * 4) L.stuttering = max(L.stuttering, 4) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, L) diff --git a/code/modules/mob/living/status_indicators.dm b/code/modules/mob/living/status_indicators.dm deleted file mode 100644 index 6b18d08fec5..00000000000 --- a/code/modules/mob/living/status_indicators.dm +++ /dev/null @@ -1,89 +0,0 @@ -/// Offset from the edge of the icon sprite, so 32 pixels plus whatever number is here. -#define STATUS_INDICATOR_Y_OFFSET 2 -/// Don't need to care about the Y size due to the origin being on the bottom side. -#define STATUS_INDICATOR_ICON_X_SIZE 16 -/// The space between two status indicators. -#define STATUS_INDICATOR_ICON_MARGIN 2 -// 'Status indicators' are icons that display over a mob's head, that visually indicate that the mob is suffering -// from some kind of effect, such as being stunned, blinded, confused, asleep, etc. -// The icons are managed automatically by the mob itself, so that their positions will shift if another indicator is added, -// and it will try to always be above the mob sprite, even for larger sprites like xenos. - -/mob/living - var/list/status_indicators = null // Will become a list as needed. - -// Refreshes the indicators over a mob's head. Should only be called when adding or removing a status indicator with the above procs, -// or when the mob changes size visually for some reason. -/mob/living/proc/handle_status_indicators() - // First, get rid of all the overlays. - for(var/thing in status_indicators) - cut_overlay(thing) - - if(!LAZYLEN(status_indicators)) - return - - if(stat == DEAD) - return - - // Now put them back on in the right spot. - var/our_sprite_x = icon_dimension_x * get_icon_scale_x() - var/our_sprite_y = icon_dimension_y * get_icon_scale_y() - - var/x_offset = our_sprite_x // Add your own offset here later if you want. - var/y_offset = our_sprite_y + STATUS_INDICATOR_Y_OFFSET - - // Calculates how 'long' the row of indicators and the margin between them should be. - // The goal is to have the center of that row be horizontally aligned with the sprite's center. - var/expected_status_indicator_length = (STATUS_INDICATOR_ICON_X_SIZE * status_indicators.len) + (STATUS_INDICATOR_ICON_MARGIN * max(status_indicators.len - 1, 0)) - var/current_x_position = (x_offset / 2) - (expected_status_indicator_length / 2) - - // In /mob/living's `update_transform()`, the sprite is horizontally shifted when scaled up, so that the center of the sprite doesn't move to the right. - // Because of that, this adjustment needs to happen with the future indicator row as well, or it will look bad. - current_x_position -= (icon_dimension_x / 2) * (get_icon_scale_y() - 1) - - // Now the indicator row can actually be built. - for(var/thing in status_indicators) - var/image/I = thing - - // This is a semi-HUD element, in a similar manner as medHUDs, in that they're 'above' everything else in the world, - // but don't pierce obfuscation layers such as blindness or darkness, unlike actual HUD elements like inventory slots. - I.plane = PLANE_STATUS - I.layer = HUD_LAYER - I.appearance_flags = PIXEL_SCALE|TILE_BOUND|NO_CLIENT_COLOR|RESET_COLOR|RESET_ALPHA|RESET_TRANSFORM|KEEP_APART - I.pixel_y = y_offset - I.pixel_x = current_x_position - add_overlay(I) - // Adding the margin space every time saves a conditional check on the last iteration, - // and it won't cause any issues since no more icons will be added, and the var is not used for anything else. - current_x_position += STATUS_INDICATOR_ICON_X_SIZE + STATUS_INDICATOR_ICON_MARGIN - -// Adds an icon_state, or image overlay, to the list of indicators to be managed automatically. -// Also initializes the list if one doesn't exist. -/mob/living/proc/add_status_indicator(image/thing) - if(get_status_indicator(thing)) // No duplicates, please. - return - - if(!istype(thing, /image)) - thing = image(icon = 'icons/mob/status_indicators.dmi', icon_state = thing) - - LAZYADD(status_indicators, thing) - handle_status_indicators() - -// Similar to above but removes it instead, and nulls the list if it becomes empty as a result. -/mob/living/proc/remove_status_indicator(image/thing) - thing = get_status_indicator(thing) - - cut_overlay(thing) - LAZYREMOVE(status_indicators, thing) - handle_status_indicators() - -/mob/living/proc/get_status_indicator(image/thing) - if(!istype(thing, /image)) - for(var/image/I in status_indicators) - if(I.icon_state == thing) - return I - return LAZYACCESS(status_indicators, LAZYFIND(status_indicators, thing)) - -#undef STATUS_INDICATOR_Y_OFFSET -#undef STATUS_INDICATOR_ICON_X_SIZE -#undef STATUS_INDICATOR_ICON_MARGIN diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm new file mode 100644 index 00000000000..2fa3195d013 --- /dev/null +++ b/code/modules/mob/living/status_procs.dm @@ -0,0 +1,51 @@ +/mob/living/afflict_stun(amount) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/adjust_stunned(amount) + if(amount > 0) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/afflict_knockdown(amount) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/adjust_knockdown(amount) + if(amount > 0) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/afflict_unconscious(amount) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/adjust_unconscious(amount) + if(amount > 0) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/afflict_sleeping(amount) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() + +/mob/living/adjust_sleeping(amount) + if(amount > 0) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.disable_duration_percent)) + amount = round(amount * M.disable_duration_percent) + return ..() diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index fe675507308..34567ffd547 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -99,6 +99,8 @@ reload_rendering() // reset statpanel of any verbs/whatnot client.statpanel_reload() + // update ssd overlay + addtimer(CALLBACK(src, TYPE_PROC_REF(/mob, update_ssd_overlay)), 0) /// Handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying /mob/proc/update_Login_details() diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index be736021215..8cebd172f60 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -20,6 +20,8 @@ // gc perspectives if(using_perspective?.reset_on_logout) reset_perspective() + // update ssd overlay + addtimer(CALLBACK(src, TYPE_PROC_REF(/mob, update_ssd_overlay)), 0) ..() return 1 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 780c1a0b51c..d4bcb78a7d1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -41,10 +41,12 @@ init_physiology() // movespeed update_movespeed(TRUE) + update_config_movespeed() // actionspeed initialize_actionspeed() - . = ..() - update_config_movespeed() + // ssd overlay + update_ssd_overlay() + return ..() /** * Delete a mob @@ -69,6 +71,12 @@ * Returns QDEL_HINT_HARDDEL (don't change this) */ /mob/Destroy()//This makes sure that mobs with GLOB.clients/keys are not just deleted from the game. + // status effects + for(var/id in status_effects) + var/datum/status_effect/effect = status_effects[id] + qdel(effect) + status_effects = null + // mob lists GLOB.mob_list -= src dead_mob_list -= src living_mob_list -= src @@ -166,32 +174,36 @@ /// Message, type of message (1 or 2), alternative message, alt message type (1 or 2) // todo: refactor /mob/show_message(msg, type, alt, alt_type) + if(!client && !teleop) + return - if(!client && !teleop) return + if(!saycode_type_eligible(type)) + if(alt && saycode_type_eligible(alt_type)) + msg = alt + type = alt_type + else + return - if (type) - if((type & 1) && (is_blind() || paralysis) )//Vision related - if (!( alt )) - return - else - msg = alt - type = alt_type - if ((type & 2) && is_deaf())//Hearing related - if (!( alt )) - return - else - msg = alt - type = alt_type - if ((type & 1) && (sdisabilities & SDISABILITY_NERVOUS)) - return - // Added voice muffling for Issue 41. - if(stat == UNCONSCIOUS || sleeping > 0) + if(IS_ALIVE_BUT_UNCONSCIOUS(src)) to_chat(src,"... You can almost hear someone talking ...", type = MESSAGE_TYPE_LOCALCHAT) else to_chat(src,msg, type = MESSAGE_TYPE_LOCALCHAT) if(teleop) to_chat(teleop, create_text_tag("body", "BODY:", teleop) + "[msg]", type = MESSAGE_TYPE_LOCALCHAT) - return + +/mob/proc/saycode_type_eligible(type) + switch(type) + if(SAYCODE_TYPE_VISIBLE) + return !is_blind() + if(SAYCODE_TYPE_AUDIBLE) + return !is_deaf() + if(SAYCODE_TYPE_CONSCIOUS) + return IS_CONSCIOUS(src) + if(SAYCODE_TYPE_LIVING) + return !IS_DEAD(src) + if(SAYCODE_TYPE_ALWAYS) + return TRUE + return TRUE /** * Show a message to all mobs in earshot of this one @@ -249,17 +261,14 @@ /mob/proc/is_physically_disabled() return incapacitated(INCAPACITATION_DISABLED) -/mob/proc/cannot_stand() - return incapacitated(INCAPACITATION_KNOCKDOWN) - /mob/proc/incapacitated(var/incapacitation_flags = INCAPACITATION_DEFAULT) - if ((incapacitation_flags & INCAPACITATION_STUNNED) && stunned) + if ((incapacitation_flags & INCAPACITATION_STUNNED) && !CHECK_MOBILITY(src, MOBILITY_CAN_USE)) return 1 - if ((incapacitation_flags & INCAPACITATION_FORCELYING) && (weakened || resting)) + if ((incapacitation_flags & INCAPACITATION_FORCELYING) && !CHECK_MOBILITY(src, MOBILITY_IS_STANDING)) return 1 - if ((incapacitation_flags & INCAPACITATION_KNOCKOUT) && (stat || paralysis || sleeping || (status_flags & FAKEDEATH))) + if ((incapacitation_flags & INCAPACITATION_KNOCKOUT) && !CHECK_MOBILITY(src, MOBILITY_IS_CONSCIOUS)) return 1 if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained()) @@ -757,10 +766,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) for(var/mob/M in viewers()) M.see(message) -/// Not sure what to call this. Used to check if humans are wearing an AI-controlled exosuit and hence don't need to fall over yet. -/mob/proc/can_stand_overridden() - return 0 - /// This might need a rename but it should replace the can this mob use things check /mob/proc/IsAdvancedToolUser() return 0 @@ -902,11 +907,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /mob/proc/updateicon() return -/// Please always use this proc, never just set the var directly. -/mob/proc/set_stat(var/new_stat) - . = (stat != new_stat) - stat = new_stat - /mob/verb/face_direction() set name = "Face Direction" @@ -1257,7 +1257,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) * no_dexterity - Whether you need to be an ADVANCEDTOOLUSER * no_tk - If be_close is TRUE, this will block Telekinesis from bypassing the requirement * need_hands - Whether you need hands to use this - * floor_okay - Whether mobility flags should be checked for MOBILITY_UI to use. + * floor_okay - Whether mobility flags should be checked for MOBILITY_CAN_UI to use. */ /mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dexterity=FALSE, no_tk=FALSE) return diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 07a858a9f3c..f6e83e1b562 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -95,10 +95,31 @@ /// What we're interacting with right now, associated to list of reasons and the number of concurrent interactions for that reason. var/list/interacting_with + //? Mobility / Stat + /// mobility flags from [code/__DEFINES/mobs/mobility.dm], updated by update_mobility(). use traits to remove these. + var/mobility_flags = MOBILITY_FLAGS_DEFAULT + /// force-enabled mobility flags, usually updated by traits + var/mobility_flags_forced = NONE + /// force-blocked mobility flags, usually updated by traits + var/mobility_flags_blocked = NONE + /// Super basic information about a mob's stats - flags are in [code/__DEFINES/mobs/stat.dm], this is updated by update_stat(). + var/stat = CONSCIOUS + // todo: move to /living level, things should be checking mobility flags anyways. + /// which way are we lying down right now? in degrees. 0 default since we're not laying down. + var/lying = 0 + + //? Status Effects + /// A list of all status effects the mob has + var/list/status_effects + + //? SSD + /// current ssd overlay + var/image/ssd_overlay + /// do we use ssd overlays? + var/ssd_visible = FALSE + //? unsorted / legacy var/datum/mind/mind - /// Whether a mob is alive or dead. TODO: Move this to living - Nodrak - var/stat = CONSCIOUS var/next_move = null // For click delay, despite the misleading name. @@ -155,15 +176,12 @@ var/use_me = 1 var/damageoverlaytemp = 0 var/computer_id = null - var/already_placed = 0.0 var/obj/machinery/machine = null var/other_mobs = null var/memory = "" - var/poll_answer = 0.0 var/sdisabilities = 0 //?Carbon var/disabilities = 0 //?Carbon var/transforming = null //?Carbon - var/other = 0.0 var/eye_blind = null //?Carbon var/eye_blurry = null //?Carbon var/ear_deaf = null //?Carbon @@ -185,12 +203,7 @@ var/confused = 0 //?Carbon var/antitoxs = null var/phoron = null - var/sleeping = 0 //?Carbon - var/resting = 0 //?Carbon - var/lying = 0 - var/lying_prev = 0 - var/canmove = 1 /// Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects. var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas. var/unacidable = 0 @@ -218,16 +231,12 @@ var/bodytemperature = 310.055 //98.7 F var/drowsyness = 0 //?Carbon - var/charges = 0 var/nutrition = 400 //?Carbon var/hydration = 400 //?Carbon /// How long this guy is overeating. //?Carbon var/overeatduration = 0 - var/paralysis = 0 - var/stunned = 0 - var/weakened = 0 var/losebreath = 0 //?Carbon var/shakecamera = 0 var/m_int = null //?Living @@ -239,14 +248,6 @@ var/list/grabbed_by = list( ) - var/list/mapobjs = list() - - /// whether or not we're prepared to throw stuff. - var/in_throw_mode = THROW_MODE_OFF - - // todo: nuke from orbit - var/music_lastplayed = "null" - // todo: nuke from orbit var/job = null //?Living @@ -284,11 +285,8 @@ mouse_drag_pointer = MOUSE_ACTIVE_POINTER - /// Set to TRUE to trigger update_icons() at the next life() call. - var/update_icon = TRUE - /// Bitflags defining which status effects can be inflicted. (replaces canweaken, canstun, etc) - var/status_flags = CANSTUN|CANWEAKEN|CANPARALYSE|CANPUSH + var/status_flags = STATUS_FLAGS_DEFAULT var/area/lastarea = null @@ -339,12 +337,8 @@ var/last_radio_sound = -INFINITY - /// A mock client, provided by tests and friends - var/datum/client_interface/mock_client - //! ## Virgo Defines - /// Do I have the HUD enabled? - var/vantag_hud = FALSE + //? vorestation legacy /// Allows flight. var/flying = FALSE /// For holding onto a temporary form. @@ -355,6 +349,20 @@ var/atom/movable/screen/shadekin/shadekin_display = null var/atom/movable/screen/xenochimera/danger_level/xenochimera_danger_display = null - //! Typing Indicator + var/muffled = 0 // Used by muffling belly + + //? Unit Tests + /// A mock client, provided by tests and friends + var/datum/client_interface/mock_client + + //? Throwing + /// whether or not we're prepared to throw stuff. + var/in_throw_mode = THROW_MODE_OFF + + //? Typing Indicator var/typing = FALSE var/mutable_appearance/typing_indicator + + //? Movement + /// Is self-moving. + var/in_selfmove diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 34e164c56df..d38df512dad 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -416,10 +416,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) A.add_overlay(alert_overlay) /mob/proc/switch_to_camera(obj/machinery/camera/C) - if (!C.can_use() || stat || (get_dist(C, src) > 1 || machine != src || blinded || !canmove)) - return FALSE - check_eye(src) - return TRUE + return FALSE /mob/living/silicon/ai/switch_to_camera(obj/machinery/camera/C) if(!C.can_use() || !is_in_chassis()) diff --git a/code/modules/mob/mobility.dm b/code/modules/mob/mobility.dm index 1dde2f8b799..9d62eaff649 100644 --- a/code/modules/mob/mobility.dm +++ b/code/modules/mob/mobility.dm @@ -14,103 +14,87 @@ * being dead (duh) can impact mobility, not the other way around. */ -// todo: mobility system +/** + * updates mobility flags + * + * @params + * * blocked - what to deny + * * forced - what to always allow. overrides blocked. + * + * @return new mobility flags + */ +/mob/proc/update_mobility(blocked, forced) + if(transforming) + . = mobility_flags = NONE + SEND_SIGNAL(src, COMSIG_MOB_ON_UPDATE_MOBILITY, .) + return + . = MOBILITY_FLAGS_DEFAULT + if(!IS_CONSCIOUS(src)) + . &= ~(MOBILITY_IS_CONSCIOUS | MOBILITY_FLAGS_REAL) + if(is_paralyzed()) + . &= ~(MOBILITY_CAN_MOVE | MOBILITY_CAN_USE | MOBILITY_CAN_PICKUP | MOBILITY_CAN_STORAGE | MOBILITY_CAN_UI | MOBILITY_CAN_PULL | MOBILITY_CAN_RESIST | MOBILITY_CAN_STAND | MOBILITY_CAN_HOLD) + else + if(is_stunned()) + . &= ~(MOBILITY_CAN_USE | MOBILITY_CAN_MOVE | MOBILITY_CAN_PICKUP | MOBILITY_CAN_STORAGE | MOBILITY_CAN_UI | MOBILITY_CAN_PULL | MOBILITY_CAN_RESIST) + else if(is_rooted()) + . &= ~(MOBILITY_CAN_MOVE) + if(is_knockdown()) + . &= ~MOBILITY_CAN_STAND -// for now, just dumb wrappers + mobility_flags = (. & ~(blocked | mobility_flags_blocked)) | (forced | mobility_flags_forced) + SEND_SIGNAL(src, COMSIG_MOB_ON_UPDATE_MOBILITY, .) +/mob/proc/update_mobility_blocked() + var/old = mobility_flags_blocked -/// 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() - return canmove + . = NONE -/mob/proc/Stun(amount) - if(status_flags & CANSTUN) - facing_dir = null - stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun - update_canmove() //updates lying, canmove and icons - return + if(HAS_TRAIT(src, TRAIT_MOBILITY_HOLD_BLOCKED)) + . |= MOBILITY_CAN_HOLD + if(HAS_TRAIT(src, TRAIT_MOBILITY_MOVE_BLOCKED)) + . |= MOBILITY_CAN_MOVE + if(HAS_TRAIT(src, TRAIT_MOBILITY_PICKUP_BLOCKED)) + . |= MOBILITY_CAN_PICKUP + if(HAS_TRAIT(src, TRAIT_MOBILITY_PULL_BLOCKED)) + . |= MOBILITY_CAN_PULL + if(HAS_TRAIT(src, TRAIT_MOBILITY_RESIST_BLOCKED)) + . |= MOBILITY_CAN_RESIST + if(HAS_TRAIT(src, TRAIT_MOBILITY_STAND_BLOCKED)) + . |= MOBILITY_CAN_STAND + if(HAS_TRAIT(src, TRAIT_MOBILITY_UI_BLOCKED)) + . |= MOBILITY_CAN_UI + if(HAS_TRAIT(src, TRAIT_MOBILITY_STORAGE_BLOCKED)) + . |= MOBILITY_CAN_STORAGE -/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" - if(status_flags & CANSTUN) - stunned = max(amount,0) - update_canmove() //updates lying, canmove and icons - return + mobility_flags_blocked = . -/mob/proc/AdjustStunned(amount) - if(status_flags & CANSTUN) - stunned = max(stunned + amount,0) - update_canmove() //updates lying, canmove and icons - return + if(. != old) + update_mobility() -/mob/proc/Weaken(amount) - if(status_flags & CANWEAKEN) - facing_dir = null - weakened = max(max(weakened,amount),0) - update_canmove() //updates lying, canmove and icons - return +/mob/proc/update_mobility_forced() + var/old = mobility_flags_forced -/mob/proc/SetWeakened(amount) - if(status_flags & CANWEAKEN) - weakened = max(amount,0) - update_canmove() //can you guess what this does yet? - return + . = NONE -/mob/proc/AdjustWeakened(amount) - if(status_flags & CANWEAKEN) - weakened = max(weakened + amount,0) - update_canmove() //updates lying, canmove and icons - return + if(HAS_TRAIT(src, TRAIT_MOBILITY_HOLD_FORCED)) + . |= MOBILITY_CAN_HOLD + if(HAS_TRAIT(src, TRAIT_MOBILITY_MOVE_FORCED)) + . |= MOBILITY_CAN_MOVE + if(HAS_TRAIT(src, TRAIT_MOBILITY_PICKUP_FORCED)) + . |= MOBILITY_CAN_PICKUP + if(HAS_TRAIT(src, TRAIT_MOBILITY_PULL_FORCED)) + . |= MOBILITY_CAN_PULL + if(HAS_TRAIT(src, TRAIT_MOBILITY_RESIST_FORCED)) + . |= MOBILITY_CAN_RESIST + if(HAS_TRAIT(src, TRAIT_MOBILITY_STAND_FORCED)) + . |= MOBILITY_CAN_STAND + if(HAS_TRAIT(src, TRAIT_MOBILITY_UI_FORCED)) + . |= MOBILITY_CAN_UI + if(HAS_TRAIT(src, TRAIT_MOBILITY_STORAGE_FORCED)) + . |= MOBILITY_CAN_STORAGE -/mob/proc/Unconscious(amount) - if(status_flags & CANPARALYSE) - facing_dir = null - paralysis = max(max(paralysis,amount),0) - return + mobility_flags_forced = . -/mob/proc/SetUnconscious(amount) - if(status_flags & CANPARALYSE) - paralysis = max(amount,0) - return - -/mob/proc/AdjustUnconscious(amount) - if(status_flags & CANPARALYSE) - paralysis = max(paralysis + amount,0) - return - -/mob/proc/Sleeping(amount) - facing_dir = null - sleeping = max(max(sleeping,amount),0) - return - -/mob/proc/SetSleeping(amount) - sleeping = max(amount,0) - return - -/mob/proc/AdjustSleeping(amount) - sleeping = max(sleeping + amount,0) - return - -/mob/proc/Confuse(amount) - confused = max(max(confused,amount),0) - return - -/mob/proc/SetConfused(amount) - confused = max(amount,0) - return - -/mob/proc/AdjustConfused(amount) - confused = max(confused + amount,0) - return - -/mob/proc/Blind(amount) - eye_blind = max(max(eye_blind,amount),0) - return - -/mob/proc/SetBlinded(amount) - eye_blind = max(amount,0) - return - -/mob/proc/AdjustBlinded(amount) - eye_blind = max(eye_blind + amount,0) - return + if(. != old) + update_mobility() diff --git a/code/modules/mob/movement.dm b/code/modules/mob/movement.dm index 7e32caf861b..1195cf3ae9b 100644 --- a/code/modules/mob/movement.dm +++ b/code/modules/mob/movement.dm @@ -45,6 +45,8 @@ /mob/CanAllowThrough(atom/movable/mover, turf/target) . = ..() + if(.) + return if(ismob(mover)) var/mob/moving_mob = mover if ((other_mobs && moving_mob.other_mobs)) @@ -53,7 +55,7 @@ var/obj/projectile/P = mover return !P.can_hit_target(src, P.permutated, src == P.original, TRUE) // thrown things still hit us even when nondense - if(!mover.density && !mover.throwing) + if(can_cross_under(mover)) return TRUE /mob/CanPassThrough(atom/blocker, turf/target, blocker_opinion) @@ -63,6 +65,9 @@ return TRUE return ..() +/mob/proc/can_cross_under(atom/movable/mover) + return !mover.density && !mover.throwing + /** * Toggle the move intent of the mob * @@ -102,7 +107,7 @@ * * being grabbed * * being buckled (relaymove() is called to the buckled atom instead) * * having your loc be some other mob (relaymove() is called on that mob instead) - * * Not having MOBILITY_MOVE + * * Not having MOBILITY_CAN_MOVE * * Failing Process_Spacemove() call * * At this point, if the mob is is confused, then a random direction and target turf will be calculated for you to travel to instead @@ -192,14 +197,14 @@ if(mob.buckled) return mob.buckled.relaymove_from_buckled(mob, direct) - // todo: mobility refactor & move to mob + // todo: move to mob // mobility check - if(!mob.canmove) + if(!CHECK_MOBILITY(mob, MOBILITY_CAN_MOVE)) return // new mobility flags check todo /* - if(!(L.mobility_flags & MOBILITY_MOVE)) + if(!(L.mobility_flags & MOBILITY_CAN_MOVE)) return FALSE */ @@ -264,9 +269,13 @@ else if(mob.confused) switch(mob.m_intent) if("run") - if(prob(50)) direct = turn(direct, pick(90, -90)) + if(prob(25)) + to_chat(src, SPAN_WARNING("You stumble around confusedly.")) + direct = turn(direct, pick(90, -90)) if("walk") - if(prob(25)) direct = turn(direct, pick(90, -90)) + if(prob(10)) + to_chat(src, SPAN_WARNING("You stumble around confusedly.")) + direct = turn(direct, pick(90, -90)) add_delay += 2 return mob.buckled.relaymove(mob,direct) //! oh god I hate this so much todo proper relaymove system for pulling fr fr @@ -306,14 +315,17 @@ M.animate_movement = 2 return else - if(mob.confused) + + if(mob.confused && !IS_PRONE(mob)) switch(mob.m_intent) - if("run") - if(prob(75)) + if(MOVE_INTENT_RUN) + if(prob(20)) + to_chat(src, SPAN_WARNING("You stumble around confusedly.")) direct = turn(direct, pick(90, -90)) n = get_step(mob, direct) - if("walk") - if(prob(25)) + if(MOVE_INTENT_WALK) + if(prob(10)) + to_chat(src, SPAN_WARNING("You stumble around confusedly.")) direct = turn(direct, pick(90, -90)) n = get_step(mob, direct) . = mob.SelfMove(n, direct) @@ -351,7 +363,9 @@ mob.last_move_time = world.time /mob/proc/SelfMove(turf/T, dir) + in_selfmove = TRUE . = Move(T, dir) + in_selfmove = FALSE if(.) throwing?.terminate() if(pulling && !ismob(pulling) && pulling.density) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index a7146ab65f2..b6414e7bfb9 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -12,7 +12,7 @@ density = 0 stat = DEAD - canmove = 0 + mobility_flags = NONE anchored = 1 // Don't get pushed around @@ -175,6 +175,9 @@ totalPlayers++ if(player.ready)totalPlayersReady++ +/mob/new_player/update_mobility() + return + /mob/new_player/Topic(href, href_list[]) if(src != usr) return 0 diff --git a/code/modules/mob/physiology.dm b/code/modules/mob/physiology.dm index ed387a463bb..643b895eec4 100644 --- a/code/modules/mob/physiology.dm +++ b/code/modules/mob/physiology.dm @@ -11,28 +11,67 @@ * physiology modifier */ /datum/physiology_modifier + abstract_type = /datum/physiology_modifier + + /// is this a globally cached modifier? + var/is_globally_cached = FALSE /** * subtype for hardcoded physiology modifiers */ /datum/physiology_modifier/intrinsic + abstract_type = /datum/physiology_modifier/intrinsic +GLOBAL_LIST_EMPTY(cached_physiology_modifiers) + +/proc/cached_physiology_modifier(datum/physiology_modifier/path) + ASSERT(ispath(path, /datum/physiology_modifier)) + ASSERT(initial(path.abstract_type) != path) + // if it already exists, set default return value to it and return + if((. = GLOB.cached_physiology_modifiers[path])) + return + var/datum/physiology_modifier/modifier = new path + modifier.is_globally_cached = TRUE + GLOB.cached_physiology_modifiers[path] = modifier + return modifier + +/** + * initializes physiology modifiers + * paths in physiology modifier are converted to the cached instances in globals. + */ /mob/proc/init_physiology() for(var/i in 1 to length(physiology_modifiers)) if(ispath(physiology_modifiers[i])) - physiology_modifiers[i] = new physiology_modifiers[i] + physiology_modifiers[i] = cached_physiology_modifier(physiology_modifiers[i]) rebuild_physiology() +/** + * adds a modifier to physiology + * you are responsible for not double-adding + * paths are allowed; if modifier is a path, it'll be the globally cached modifier of that type. + */ /mob/proc/add_physiology_modifier(datum/physiology_modifier/modifier) + if(ispath(modifier)) + modifier = cached_physiology_modifier(modifier) ASSERT(!(modifier in physiology_modifiers)) physiology_modifiers += modifier physiology.apply(modifier) +/** + * removes a modifier from physiology + * you are responsible for not double-adding + * paths are allowed + */ /mob/proc/remove_physiology_modifier(datum/physiology_modifier/modifier) + if(ispath(modifier)) + modifier = cached_physiology_modifier(modifier) ASSERT(modifier in physiology_modifiers) physiology_modifiers -= modifier physiology.revert(modifier) +/** + * completely rebuilds physiology from our modifiers + */ /mob/proc/rebuild_physiology() physiology = new for(var/datum/physiology_modifier/modifier as anything in physiology_modifiers) @@ -40,3 +79,5 @@ physiology_modifiers -= modifier continue physiology.apply(modifier) + +// todo: admin vv verb via tgui to input new modifier diff --git a/code/modules/mob/mob_pull.dm b/code/modules/mob/pulling.dm similarity index 95% rename from code/modules/mob/mob_pull.dm rename to code/modules/mob/pulling.dm index 0e465bdf0dc..6d9d047f0fc 100644 --- a/code/modules/mob/mob_pull.dm +++ b/code/modules/mob/pulling.dm @@ -3,7 +3,7 @@ return FALSE if(!(AM.can_be_pulled(src))) return FALSE - if(throwing || restrained())// || !(mobility_flags & MOBILITY_PULL)) + if(throwing || restrained())// || !(mobility_flags & MOBILITY_CAN_PULL)) return FALSE // vorecode start why isn't this move force @@ -137,3 +137,10 @@ /mob/proc/update_pull_hud_icon() pullin?.icon_state = pulling? "pull1" : "pull0" + +/mob/on_start_pulled_by(atom/movable/puller) + update_mobility() + +/mob/on_stop_pulled_by(atom/movable/puller) + . = ..() + update_mobility() diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 4960c67bad8..3b866092b75 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -35,7 +35,7 @@ set_typing_indicator(FALSE) if(use_me) - usr.emote("me",usr.emote_type,message) + usr.emote("me",SAYCODE_TYPE_ALWAYS,message) else usr.emote(message) diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 0c714389c79..63affc19764 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -51,7 +51,7 @@ if(M.client && !M.client.is_preference_enabled(/datum/client_preference/subtle_see)) continue spawn(0) - M.show_message(message, 2) + M.show_message(message, SAYCODE_TYPE_ALWAYS) for(var/visobj in vis_objs) var/obj/O = visobj @@ -104,11 +104,12 @@ for(var/vismob in vis_mobs) var/mob/M = vismob if(!istype(vismob, /mob/observer)) - M.show_message(message, 2) + M.show_message(message, SAYCODE_TYPE_ALWAYS) + else //(istype(vismob, /mob/observer)) var/mob/observer/O = vismob if(O.client && check_rights(R_ADMIN, FALSE, O.client) && O.client.is_preference_enabled(/datum/client_preference/subtle_see)) - O.show_message(message) + O.show_message(message, SAYCODE_TYPE_ALWAYS) for(var/visobj in vis_objs) var/obj/O = visobj diff --git a/code/modules/mob/ssd.dm b/code/modules/mob/ssd.dm new file mode 100644 index 00000000000..5fa5634e6f6 --- /dev/null +++ b/code/modules/mob/ssd.dm @@ -0,0 +1,67 @@ +/** + * "space sleep disorder" is the HRP term for someone who's logged out. + * + * people who just don't have minds do not count. + * people who are AI-controlled never count. + * people who are dead do not count. + * adminghosted people do not count. + */ +/mob/proc/is_ssd() + return ckey && isnull(client) && isnull(teleop) && !IS_DEAD(src) + +/mob/living/is_ssd() + return isnull(ai_holder) && ..() + +/** + * basically, indicates that a player's gone, and there's no ai holder + */ +/mob/proc/is_catatonic() + return !ckey + +/mob/living/is_catatonic() + return isnull(ai_holder) && ..() + +/** + * update ssd overlay + * + * @params + * * forced_state - if set, adds on TRUE and removes on FALSE, ignoring client status. + */ +/mob/proc/update_ssd_overlay(forced_state) + var/want = isnull(forced_state)? (is_catatonic() || is_ssd()) : forced_state + if(want) + if(isnull(ssd_overlay)) + render_ssd_overlay() + add_overlay(ssd_overlay, TRUE) + else if(needs_ssd_overlay_update()) + // just update + cut_overlay(ssd_overlay, TRUE) + render_ssd_overlay() + add_overlay(ssd_overlay, TRUE) + else if(!want && !isnull(ssd_overlay)) + cut_overlay(ssd_overlay, TRUE) + ssd_overlay = null + +/** + * checks if we need a ssd overlay update + */ +/mob/proc/needs_ssd_overlay_update() + return TRUE // no support for smart re-renders yet. + +/** + * renders ssd overlay + * + * @return TRUE if anything changed, FALSE otherwise + */ +/mob/proc/render_ssd_overlay() + if(isnull(ssd_overlay)) + ssd_overlay = image(icon = 'icons/screen/atom_hud/status_16x16_oversized.dmi', icon_state = "eepy") + // flags + ssd_overlay.appearance_flags = RESET_COLOR | PIXEL_SCALE | KEEP_APART + // matrix + var/matrix/transforming_with = matrix() + // center above + transforming_with.Translate(8, 32 * transform.get_y_scale()) + // modify transform to new + ssd_overlay.transform = transforming_with + return TRUE // no support for smart re-renders yet. diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index 7de4b652373..45fa6c27962 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -1,8 +1,227 @@ +//? Incapacitation + /** * default method of kicking a poor guy down to the ground * * @params * - amount - standard strength in deciseconds */ -/mob/proc/DefaultCombatKnockdown(amount) - return +/mob/proc/default_combat_knockdown(amount) + return afflict_knockdown(amount) + +/mob/proc/is_stunned() + RETURN_TYPE(/datum/status_effect) + return has_status_effect(/datum/status_effect/incapacitation/stun) + +/mob/proc/afflict_stun(amount) + if(!(status_flags & STATUS_CAN_STUN)) + return FALSE + apply_status_effect(/datum/status_effect/incapacitation/stun, amount) + return TRUE + +/mob/proc/set_stunned(amount) + if(!(status_flags & STATUS_CAN_STUN)) + return FALSE + if(amount == 0) + remove_status_effect(/datum/status_effect/incapacitation/stun) + else + var/datum/status_effect/effect = is_stunned() + if(effect) + effect.set_duration_from_now(amount) + else if(amount > 0) + afflict_stun(amount) + return TRUE + +/mob/proc/adjust_stunned(amount) + if(!(status_flags & STATUS_CAN_STUN)) + return FALSE + var/datum/status_effect/effect = is_stunned() + if(effect) + effect.adjust_duration(amount) + else if(amount > 0) + afflict_stun(amount) + return TRUE + +/mob/proc/is_knockdown() + RETURN_TYPE(/datum/status_effect) + return has_status_effect(/datum/status_effect/incapacitation/knockdown) + +/mob/proc/afflict_knockdown(amount) + if(!(status_flags & STATUS_CAN_KNOCKDOWN)) + return FALSE + apply_status_effect(/datum/status_effect/incapacitation/knockdown, amount) + return TRUE + +/mob/proc/set_knockdown(amount) + if(!(status_flags & STATUS_CAN_KNOCKDOWN)) + return FALSE + if(amount == 0) + remove_status_effect(/datum/status_effect/incapacitation/knockdown) + else + var/datum/status_effect/effect = is_knockdown() + if(effect) + effect.set_duration_from_now(amount) + else if(amount > 0) + afflict_knockdown(amount) + return TRUE + +/mob/proc/adjust_knockdown(amount) + if(!(status_flags & STATUS_CAN_KNOCKDOWN)) + return FALSE + var/datum/status_effect/effect = is_knockdown() + if(effect) + effect.adjust_duration(amount) + else if(amount > 0) + afflict_knockdown(amount) + return TRUE + +/mob/proc/is_paralyzed() + RETURN_TYPE(/datum/status_effect) + return has_status_effect(/datum/status_effect/incapacitation/paralyze) + +/mob/proc/afflict_paralyze(amount) + if(!(status_flags & STATUS_CAN_PARALYZE)) + return FALSE + apply_status_effect(/datum/status_effect/incapacitation/paralyze, amount) + return TRUE + +/mob/proc/adjust_paralyzed(amount) + if(!(status_flags & STATUS_CAN_PARALYZE)) + return FALSE + var/datum/status_effect/effect = is_paralyzed() + if(effect) + effect.adjust_duration(amount) + else if(amount > 0) + afflict_paralyze(amount) + return TRUE + +/mob/proc/set_paralyzed(amount) + if(!(status_flags & STATUS_CAN_PARALYZE)) + return FALSE + if(amount == 0) + remove_status_effect(/datum/status_effect/incapacitation/paralyze) + else + var/datum/status_effect/effect = is_paralyzed() + if(effect) + effect.set_duration_from_now(amount) + else if(amount > 0) + afflict_paralyze(amount) + return TRUE + +/mob/proc/is_rooted() + RETURN_TYPE(/datum/status_effect) + return has_status_effect(/datum/status_effect/incapacitation/root) + +/mob/proc/afflict_root(amount) + if(!(status_flags & STATUS_CAN_ROOT)) + return FALSE + apply_status_effect(/datum/status_effect/incapacitation/root, amount) + return TRUE + +/mob/proc/adjust_rooted(amount) + if(!(status_flags & STATUS_CAN_ROOT)) + return FALSE + var/datum/status_effect/effect = is_rooted() + if(effect) + effect.adjust_duration(amount) + else if(amount > 0) + afflict_root(amount) + return TRUE + +/mob/proc/set_rooted(amount) + if(!(status_flags & STATUS_CAN_ROOT)) + return FALSE + if(amount == 0) + remove_status_effect(/datum/status_effect/incapacitation/root) + else + var/datum/status_effect/effect = is_rooted() + if(effect) + effect.set_duration_from_now(amount) + else if(amount > 0) + afflict_root(amount) + return TRUE + +/mob/proc/afflict_stagger(stacks, maximum) + apply_stacking_effect(/datum/status_effect/stacking/staggered, stacks, maximum) + +/mob/proc/cure_stagger(stacks) + remove_stacking_effect(/datum/status_effect/stacking/staggered, stacks) + +/mob/proc/is_staggered() + RETURN_TYPE(/datum/status_effect/stacking/staggered) + return has_status_effect(/datum/status_effect/stacking/staggered) + +/mob/proc/stacks_staggered() + return is_staggered()?.stacks + +/mob/proc/is_unconscious() + RETURN_TYPE(/datum/status_effect) + return has_status_effect(/datum/status_effect/incapacitation/unconscious) + +/mob/proc/afflict_unconscious(amount) + apply_status_effect(/datum/status_effect/incapacitation/unconscious, amount) + return TRUE + +/mob/proc/set_unconscious(amount) + var/datum/status_effect/incapacitation/unconscious/effect = is_unconscious() + if(isnull(effect)) + apply_status_effect(/datum/status_effect/incapacitation/unconscious, amount) + else + effect.set_duration_from_now(amount) + return TRUE + +/mob/proc/adjust_unconscious(amount) + var/datum/status_effect/incapacitation/unconscious/effect = is_unconscious() + if(isnull(effect)) + if(amount < 0) + return + apply_status_effect(/datum/status_effect/incapacitation/unconscious, amount) + else + effect.adjust_duration(amount) + return TRUE + +/mob/proc/is_sleeping() + RETURN_TYPE(/datum/status_effect) + return has_status_effect(/datum/status_effect/incapacitation/sleeping) + +/mob/proc/afflict_sleeping(amount) + apply_status_effect(/datum/status_effect/incapacitation/sleeping, amount) + return TRUE + +/mob/proc/set_sleeping(amount) + var/datum/status_effect/incapacitation/sleeping/effect = is_sleeping() + if(isnull(effect)) + apply_status_effect(/datum/status_effect/incapacitation/sleeping, amount) + else + effect.set_duration_from_now(amount) + return TRUE + +/mob/proc/adjust_sleeping(amount) + var/datum/status_effect/incapacitation/sleeping/effect = is_sleeping() + if(isnull(effect)) + if(amount < 0) + return + apply_status_effect(/datum/status_effect/incapacitation/sleeping, amount) + else + effect.adjust_duration(amount) + return TRUE + +//? legacy + +/mob/proc/Confuse(amount) + confused = max(confused, amount, 0) + +/mob/proc/SetConfused(amount) + confused = max(amount, 0) + +/mob/proc/AdjustConfused(amount) + confused = max(confused + amount, 0) + +/mob/proc/Blind(amount) + eye_blind = max(eye_blind, amount, 0) + +/mob/proc/SetBlinded(amount) + eye_blind = max(amount, 0) + +/mob/proc/AdjustBlinded(amount) + eye_blind = max(eye_blind + amount, 0) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index cad3cbaecb4..5d94a26d980 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -3,9 +3,8 @@ return drop_inventory(TRUE, TRUE, TRUE) regenerate_icons() - transforming = 1 - canmove = 0 - stunned = 1 + transforming = TRUE + update_mobility() icon = null invisibility = 101 for(var/t in organs) @@ -18,9 +17,8 @@ sleep(48) //animation = null - transforming = 0 - stunned = 0 - update_canmove() + transforming = FALSE + update_mobility() invisibility = initial(invisibility) if(!species.primitive_form) //If the creature in question has no primitive set, this is going to be messy. @@ -52,8 +50,8 @@ if (transforming) return drop_inventory(TRUE, TRUE, TRUE) - transforming = 1 - canmove = 0 + transforming = TRUE + update_mobility() icon = null invisibility = 101 return ..() @@ -103,8 +101,8 @@ return drop_inventory(TRUE, TRUE, TRUE) regenerate_icons() - transforming = 1 - canmove = 0 + transforming = TRUE + update_mobility() icon = null invisibility = 101 for(var/t in organs) @@ -160,8 +158,8 @@ return drop_inventory(TRUE, TRUE, TRUE) regenerate_icons() - transforming = 1 - canmove = 0 + transforming = TRUE + update_mobility() icon = null invisibility = 101 for(var/t in organs) @@ -183,8 +181,8 @@ return drop_inventory(TRUE, TRUE, TRUE) regenerate_icons() - transforming = 1 - canmove = 0 + transforming = TRUE + update_mobility() icon = null invisibility = 101 for(var/t in organs) //this really should not be necessary @@ -213,8 +211,8 @@ drop_inventory(TRUE, TRUE, TRUE) regenerate_icons() - transforming = 1 - canmove = 0 + transforming = TRUE + update_mobility() icon = null invisibility = 101 diff --git a/code/modules/movespeed/modifiers/mob.dm b/code/modules/movespeed/modifiers/mob.dm new file mode 100644 index 00000000000..77c8fe51864 --- /dev/null +++ b/code/modules/movespeed/modifiers/mob.dm @@ -0,0 +1,5 @@ +/datum/movespeed_modifier/mob_crawling + multiplicative_slowdown = 3.5 + +/datum/movespeed_modifier/mob_staggered + variable = TRUE diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 7570a96b037..f498407e171 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -449,8 +449,8 @@ // Hits 10 times, because apparently targeting individual limbs lets certain species survive the fall from atmosphere for(var/i = 1 to 10) adjustBruteLoss(rand(damage_min, damage_max)) - Weaken(4) - updatehealth() + afflict_paralyze(20 * 4) + update_health() /mob/living/carbon/human/fall_impact(atom/hit_atom, damage_min, damage_max, silent, planetary) if(!species?.handle_falling(src, hit_atom, damage_min, damage_max, silent, planetary)) @@ -524,7 +524,7 @@ for(var/mob/living/L in hit_atom.contents) L.visible_message(SPAN_DANGER("\The [src] crushes \the [L] as it lands on them!")) L.adjustBruteLoss(rand(70, 100)) - L.Weaken(8) + L.afflict_paralyze(20 * 8) var/turf/landing = get_turf(hit_atom) diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index 8c9ba0999d7..303e593ca29 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -332,10 +332,10 @@ GLOBAL_LIST_INIT(nif_id_lookup, init_nif_id_lookup()) human.adjustHalLoss(35) human.custom_pain(message,35) if(2) - human.Weaken(5) + human.afflict_paralyze(20 * 5) to_chat(human,"A wave of weakness rolls over you.") if(3) - human.Sleeping(5) + human.afflict_sleeping(20 * 5) to_chat(human,"You suddenly black out!") //Finishing up diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index 2e87981751a..e57cbee79dc 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -505,6 +505,9 @@ /mob/living/carbon/brain/caught_soul/set_typing_indicator(state) return eyeobj?.set_typing_indicator(state) +/mob/living/carbon/brain/caught_soul/update_mobility(blocked, forced) + return ..(blocked, ALL) + /////////////////// //A projected AR soul thing /mob/observer/eye/ar_soul diff --git a/code/modules/organs/external/external.dm b/code/modules/organs/external/external.dm index b9a5565e9ea..dbf947ab73a 100644 --- a/code/modules/organs/external/external.dm +++ b/code/modules/organs/external/external.dm @@ -384,7 +384,7 @@ // sync the organ's damage with its wounds src.update_damages() if(owner) - owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called + owner.update_health() //droplimb will call update_health() again if it does end up being called //If limb took enough damage, try to cut or tear it off if(owner && loc == owner && !is_stump()) @@ -452,7 +452,7 @@ //Sync the organ's damage with its wounds src.update_damages() src.process_wounds() // todo: this should not be here - this has side effects of processing. - owner.updatehealth() + owner.update_health() var/result = update_icon() return result @@ -551,7 +551,7 @@ robotize(robodata, null, null, TRUE) else robotize() - owner.updatehealth() + owner.update_health() /obj/item/organ/external/remove_rejuv() if(owner) @@ -909,7 +909,7 @@ Note that amputating the affected organ does in fact remove the infection from t spawn(1) if(istype(victim)) - victim.updatehealth() + victim.update_health() victim.UpdateDamageIcon() victim.update_icons_body() else diff --git a/code/modules/organs/external/subtypes/standard.dm b/code/modules/organs/external/subtypes/standard.dm index ba6570859a1..f54c5a9a549 100644 --- a/code/modules/organs/external/subtypes/standard.dm +++ b/code/modules/organs/external/subtypes/standard.dm @@ -144,7 +144,7 @@ if (. >= 2) if(prob(.)) owner.custom_pain("A jolt of pain surges through your [name]!",1) - owner.Weaken(5) + owner.afflict_paralyze(20 * 5) /obj/item/organ/external/leg/right organ_tag = BP_R_LEG @@ -183,7 +183,7 @@ if (. >= 2) if(prob(.)) owner.custom_pain("A jolt of pain surges through your [name]!",1) - owner.Weaken(5) + owner.afflict_paralyze(20 * 5) /obj/item/organ/external/foot/right organ_tag = BP_R_FOOT diff --git a/code/modules/organs/internal/subtypes/appendix.dm b/code/modules/organs/internal/subtypes/appendix.dm index 412a879a673..327320f38ea 100644 --- a/code/modules/organs/internal/subtypes/appendix.dm +++ b/code/modules/organs/internal/subtypes/appendix.dm @@ -41,7 +41,7 @@ if(inflamed > 3) if(prob(1)) to_chat(owner, "Your abdomen is a world of pain!") - owner.Weaken(10) + owner.afflict_paralyze(20 * 10) var/obj/item/organ/external/groin = owner.get_organ(BP_GROIN) groin.create_specific_wound(/datum/wound/internal_bleeding, 20) diff --git a/code/modules/organs/internal/subtypes/brain.dm b/code/modules/organs/internal/subtypes/brain.dm index 4d4c5cf1c83..f3c64f727dd 100644 --- a/code/modules/organs/internal/subtypes/brain.dm +++ b/code/modules/organs/internal/subtypes/brain.dm @@ -257,8 +257,8 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain) H.nutrition = 260 //Enough to try to regenerate ONCE. H.adjustBruteLoss(40) H.adjustFireLoss(40) - H.Unconscious(4) - H.updatehealth() + H.afflict_unconscious(20 * 4) + H.update_health() for(var/obj/item/organ/external/E in H.organs) //They've still gotta congeal, but it's faster than the clone sickness they'd normally get. if(E && E.organ_tag == BP_L_ARM || E.organ_tag == BP_R_ARM || E.organ_tag == BP_L_LEG || E.organ_tag == BP_R_LEG) E.removed() diff --git a/code/modules/paperwork/paper/paper.dm b/code/modules/paperwork/paper/paper.dm index efba476d6b3..61da611282e 100644 --- a/code/modules/paperwork/paper/paper.dm +++ b/code/modules/paperwork/paper/paper.dm @@ -182,7 +182,7 @@ else user.visible_message("[user] begins to wipe [H]'s lipstick off with \the [src].", \ "You begin to wipe off [H]'s lipstick.") - if(do_after(user, 10) && do_after(H, 10, 5, 0)) //user needs to keep their active hand, H does not. + if(do_after(user, 10, H, mobility_flags = MOBILITY_CAN_USE | (IS_STANDING(target)? MOBILITY_IS_STANDING : NONE))) //user needs to keep their active hand, H does not. user.visible_message("[user] wipes [H]'s lipstick off with \the [src].", \ "You wipe off [H]'s lipstick.") H.lip_style = null diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 87a910afa8d..4dca0439a4d 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -83,7 +83,7 @@ set category = "Object" set src in range(1) - if(usr.stat || usr.restrained() || usr.weakened || usr.paralysis || usr.lying || usr.stunned) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return if(!paperamount) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index c181d43c22a..f0f96b5814d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -748,7 +748,7 @@ GLOBAL_LIST_EMPTY(apcs) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, src) s.start() - if(user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return C.use(10) user.visible_message(\ @@ -770,7 +770,7 @@ GLOBAL_LIST_EMPTY(apcs) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, src) s.start() - if(usr.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return new /obj/item/stack/cable_coil(loc,10) to_chat(user,"You cut the cables and dismantle the power terminal.") diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 9f26809b256..57d65aba016 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -273,7 +273,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, src) s.start() - if(usr.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return 1 return 0 @@ -631,7 +631,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( set category = "Object" var/mob/M = usr - if(ishuman(M) && !M.restrained() && !M.stat && !M.paralysis && ! M.stunned) + if(CHECK_MOBILITY(M, MOBILITY_CAN_USE)) if(!istype(usr.loc,/turf)) return if(src.amount <= 14) to_chat(usr, "You need at least 15 lengths to make restraints!") diff --git a/code/modules/power/singularity/act.dm b/code/modules/power/singularity/act.dm index 83edb58c974..b196d97e05a 100644 --- a/code/modules/power/singularity/act.dm +++ b/code/modules/power/singularity/act.dm @@ -32,7 +32,7 @@ if(!lying && (!shoes || !(shoes.clothing_flags & NOSLIP)) && (!species || !(species.species_flags & NOSLIP)) && prob(current_size*5)) to_chat(src, "A strong gravitational force slams you to the ground!") - Weaken(current_size) + afflict_paralyze(20 * current_size) ..() /obj/singularity_act() diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 5de3b7015db..ab25c2fa90e 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -401,7 +401,7 @@ GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) for(var/mob/living/carbon/M in oviewers(8, src)) if(istype(M, /mob/living/carbon/brain)) //Ignore brains continue - if(M.status_flags & GODMODE) + if(M.status_flags & STATUS_GODMODE) continue if(M.stat == CONSCIOUS) if (istype(M,/mob/living/carbon/human)) diff --git a/code/modules/power/smes/smes.dm b/code/modules/power/smes/smes.dm index 7302477d3a6..49b5e2d8267 100644 --- a/code/modules/power/smes/smes.dm +++ b/code/modules/power/smes/smes.dm @@ -294,7 +294,7 @@ GLOBAL_LIST_EMPTY(smeses) s.set_up(5, 1, src) s.start() building_terminal = 0 - if(usr.stunned) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 new /obj/item/stack/cable_coil(loc,10) user.visible_message(\ diff --git a/code/modules/power/smes/smes_construction.dm b/code/modules/power/smes/smes_construction.dm index d85636720e2..e875d36c8bd 100644 --- a/code/modules/power/smes/smes_construction.dm +++ b/code/modules/power/smes/smes_construction.dm @@ -177,7 +177,7 @@ else to_chat(h_user, "A small electrical arc sparks and burns your hand as you touch the [src]!") h_user.adjustFireLossByPart(rand(5,10), used_hand) - h_user.Weaken(2) + h_user.afflict_paralyze(20 * 2) if (16 to 35) // Medium overcharge @@ -188,7 +188,7 @@ else to_chat(h_user, "A medium electrical arc sparks as you touch the [src], severely burning your hand!") h_user.adjustFireLossByPart(rand(10,25), used_hand) - h_user.Weaken(5) + h_user.afflict_paralyze(20 * 5) spawn() empulse(get_turf(src), 1, 2, 3, 4) @@ -199,7 +199,7 @@ if (user_protected) to_chat(h_user, "A strong electrical arc sparks between you and [src], ignoring your gloves and burning your hand!") h_user.adjustFireLossByPart(rand(25,60), used_hand) - h_user.Weaken(8) + h_user.afflict_paralyze(20 * 8) else to_chat(h_user, "A strong electrical arc sparks between you and [src], knocking you out for a while!") h_user.electrocute_act(rand(35,75), src, def_zone = BP_TORSO) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index f1fdc9a70e9..d6fec387e04 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -230,7 +230,7 @@ else if(isliving(A)) var/dist = get_dist(source, A) var/mob/living/L = A - if(dist <= zap_range && (dist < closest_dist || !closest_mob) && L.stat != DEAD && !(L.status_flags & GODMODE)) + if(dist <= zap_range && (dist < closest_dist || !closest_mob) && L.stat != DEAD && !(L.status_flags & STATUS_GODMODE)) closest_mob = L closest_atom = A closest_dist = dist diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index c5e7b4151a1..5795e41ff96 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -664,6 +664,8 @@ forcespread = rand(50, 50) else if(mob.shock_stage > 70) forcespread = rand(-25, 25) + else if(IS_PRONE(mob)) + forcespread = rand(-15, 15) var/launched = !P.launch_from_gun(target, target_zone, user, params, null, forcespread, src) if(launched) diff --git a/code/modules/projectiles/projectile/beam/beams.dm b/code/modules/projectiles/projectile/beam/beams.dm index 43841314300..be6dbe5b48b 100644 --- a/code/modules/projectiles/projectile/beam/beams.dm +++ b/code/modules/projectiles/projectile/beam/beams.dm @@ -170,7 +170,7 @@ if(ishuman(target)) var/mob/living/carbon/human/M = target if(istype(M.wear_suit, /obj/item/clothing/suit/redtag)) - M.Weaken(5) + M.afflict_paralyze(20 * 5) return 1 /obj/projectile/beam/lasertag/red @@ -181,7 +181,7 @@ if(ishuman(target)) var/mob/living/carbon/human/M = target if(istype(M.wear_suit, /obj/item/clothing/suit/bluetag)) - M.Weaken(5) + M.afflict_paralyze(20 * 5) return 1 /obj/projectile/beam/lasertag/omni//A laser tag bolt that stuns EVERYONE @@ -196,7 +196,7 @@ if(ishuman(target)) var/mob/living/carbon/human/M = target if((istype(M.wear_suit, /obj/item/clothing/suit/bluetag))||(istype(M.wear_suit, /obj/item/clothing/suit/redtag))) - M.Weaken(5) + M.afflict_paralyze(20 * 5) return 1 /obj/projectile/beam/sniper diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 88d74c2abc8..a0ced79eee2 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -438,7 +438,7 @@ var/mob/living/L = target var/throwdir = get_dir(firer,L) if(prob(10) && !blocked) - L.Stun(1) + L.afflict_stun(20 * 1) L.Confuse(1) L.throw_at_old(get_edge_target_turf(L, throwdir), rand(3,6), 10) @@ -453,7 +453,7 @@ var/mob/living/L = target var/throwdir = get_dir(firer,L) if(prob(10) && !blocked) - L.Stun(1) + L.afflict_stun(20 * 1) L.Confuse(1) L.throw_at_old(get_edge_target_turf(L, throwdir), rand(3,6), 10) diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 8ff4f02a210..bb573e02443 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -188,8 +188,8 @@ else if (ear_safety > 1) M.Confuse(30) else if (!ear_safety) - M.Stun(10) - M.Weaken(2) + M.afflict_stun(20 * 10) + M.afflict_paralyze(20 * 2) M.ear_damage += rand(1, 10) M.ear_deaf = max(M.ear_deaf,15) if (M.ear_damage >= 15) diff --git a/code/modules/projectiles/projectile/magnetic.dm b/code/modules/projectiles/projectile/magnetic.dm index bfb497f48da..e1728daf168 100644 --- a/code/modules/projectiles/projectile/magnetic.dm +++ b/code/modules/projectiles/projectile/magnetic.dm @@ -78,8 +78,8 @@ eye_coverage = M.eyecheck() if(eye_coverage < 2) M.flash_eyes() - M.Stun(2) - M.Weaken(10) + M.afflict_stun(20 * 2) + M.afflict_paralyze(20 * 10) if(searing) if(blocked) diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index b05daf120e1..357f028b8c5 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -141,7 +141,7 @@ if(prob(15)) // todo: less stunlock capability M.afflict_radiation(RAD_MOB_AFFLICT_FLORARAY_ON_PLANT, TRUE) - M.Weaken(5) + M.afflict_paralyze(20 * 5) var/datum/gender/TM = GLOB.gender_datums[M.get_visible_gender()] for (var/mob/V in viewers(src)) V.show_message("[M] writhes in pain as [TM.his] vacuoles boil.", 3, "You hear the crunching of leaves.", 2) diff --git a/code/modules/projectiles/targeting/targeting_mob.dm b/code/modules/projectiles/targeting/targeting_mob.dm index 3c080574a98..7968b119b3d 100644 --- a/code/modules/projectiles/targeting/targeting_mob.dm +++ b/code/modules/projectiles/targeting/targeting_mob.dm @@ -26,12 +26,12 @@ if(..()) stop_aiming(no_message=1) -/mob/living/update_canmove() - ..() +/mob/living/update_mobility(blocked, forced) + . = ..() if(lying) stop_aiming(no_message=1) -/mob/living/Weaken(amount) +/mob/living/afflict_paralyze(amount) stop_aiming(no_message=1) ..() diff --git a/code/modules/projectiles/unsorted/magic.dm b/code/modules/projectiles/unsorted/magic.dm index a9cdd126f4b..d46f279354f 100644 --- a/code/modules/projectiles/unsorted/magic.dm +++ b/code/modules/projectiles/unsorted/magic.dm @@ -115,7 +115,7 @@ qdel(src) /proc/wabbajack(mob/living/M) - if(!istype(M) || M.stat == DEAD || M.mob_transforming || (GODMODE & M.status_flags)) + if(!istype(M) || M.stat == DEAD || M.mob_transforming || (STATUS_GODMODE & M.status_flags)) return M.mob_transforming = TRUE diff --git a/code/modules/reagents/Misc-Recipes.dm b/code/modules/reagents/Misc-Recipes.dm index 0887f739e59..4d1a5001482 100644 --- a/code/modules/reagents/Misc-Recipes.dm +++ b/code/modules/reagents/Misc-Recipes.dm @@ -364,7 +364,7 @@ continue M.flash_eyes() - M.Weaken(15) + M.afflict_paralyze(20 * 15) if(4 to 5) if(hasvar(M, "glasses")) @@ -372,7 +372,7 @@ continue M.flash_eyes() - M.Stun(5) + M.afflict_stun(20 * 5) /datum/chemical_reaction/emp_pulse name = "EMP Pulse" @@ -1013,7 +1013,7 @@ C.adjustOxyLoss(-25) C.adjustBrainLoss(-25) C.adjustCloneLoss(-25) - C.updatehealth() + C.update_health() /datum/chemical_reaction/slimejelly name = "Slime Jam" diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Dispenser.dm index 4b03ad57d6f..4be75564adf 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Dispenser.dm @@ -127,8 +127,8 @@ if(effective_dose >= strength * 6) // Toxic dose M.add_chemical_effect(CE_ALCOHOL_TOXIC, toxicity*3) if(effective_dose >= strength * 7) // Pass out - M.Unconscious(60) - M.Sleeping(90) + M.afflict_unconscious(20 * 60) + M.afflict_sleeping(20 * 90) if(druggy != 0) M.druggy = max(M.druggy, druggy*3) @@ -175,8 +175,8 @@ if(dose * strength_mod >= strength * 6) // Toxic dose M.add_chemical_effect(CE_ALCOHOL_TOXIC, toxicity) if(dose * strength_mod >= strength * 7) // Pass out - M.Unconscious(20) - M.Sleeping(30) + M.afflict_unconscious(20 * 20) + M.afflict_sleeping(20 * 30) if(druggy != 0) M.druggy = max(M.druggy, druggy) @@ -250,7 +250,7 @@ /datum/reagent/lithium/affect_blood(mob/living/carbon/M, alien, removed) if(alien != IS_DIONA) - if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) + if(CHECK_MOBILITY(M, MOBILITY_CAN_MOVE) && istype(M.loc, /turf/space)) step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch", "drool", "moan")) @@ -265,7 +265,7 @@ /datum/reagent/mercury/affect_blood(mob/living/carbon/M, alien, removed) if(alien != IS_DIONA) - if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) + if(CHECK_MOBILITY(M, MOBILITY_CAN_MOVE) && istype(M.loc, /turf/space)) step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch", "drool", "moan")) @@ -411,7 +411,6 @@ if(prob(100 * removed / meltdose)) // Applies disfigurement if (affecting.organ_can_feel_pain()) H.emote("scream") - H.status_flags |= DISFIGURED else M.take_organ_damage(0, removed * power * 0.1) // Balance. The damage is instant, so it's weaker. 10 units -> 5 damage, double for pacid. 120 units beaker could deal 60, but a) it's burn, which is not as dangerous, b) it's a one-use weapon, c) missing with it will splash it over the ground and d) clothes give some protection, so not everything will hit @@ -470,10 +469,10 @@ M.eye_blurry = max(M.eye_blurry, 10) else if(effective_dose < 20) if(prob(50)) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.drowsyness = max(M.drowsyness, 20) else - M.Sleeping(20) + M.afflict_sleeping(20 * 20) M.drowsyness = max(M.drowsyness, 60) if(alien == IS_ALRAUNE) //cit change - too much sugar isn't good for plants diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm index 34a7e984c98..0c6b0ab51a8 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm @@ -125,10 +125,10 @@ M.eye_blurry = max(M.eye_blurry, 10) else if(effective_dose < 20) if(prob(50)) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.drowsyness = max(M.drowsyness, 20) else - M.Sleeping(20) + M.afflict_sleeping(20 * 20) M.drowsyness = max(M.drowsyness, 60) /datum/reagent/nutriment/mayo @@ -588,8 +588,8 @@ to_chat(M, "Your [safe_thing] protects you from most of the pepperspray!") M.eye_blurry = max(M.eye_blurry, effective_strength * 3) M.Blind(effective_strength) - M.Stun(5) - M.Weaken(5) + M.afflict_stun(20 * 5) + M.afflict_paralyze(20 * 5) if(alien != IS_SLIME) return else if(mouth_covered) // Mouth cover is better than eye cover @@ -601,8 +601,8 @@ to_chat(M, "You're sprayed directly in the eyes with pepperspray!") M.eye_blurry = max(M.eye_blurry, effective_strength * 5) M.Blind(effective_strength * 2) - M.Stun(5) - M.Weaken(5) + M.afflict_stun(20 * 5) + M.afflict_paralyze(20 * 5) if(alien != IS_SLIME) return if(alien == IS_SLIME) @@ -677,7 +677,7 @@ M.adjust_hydration(hydration * removed) M.dizziness = max(0, M.dizziness + adj_dizzy) M.drowsyness = max(0, M.drowsyness + adj_drowsy) - M.AdjustSleeping(adj_sleepy) + M.adjust_sleeping(20 * adj_sleepy) if(adj_temp > 0 && M.bodytemperature < 310) // 310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) @@ -761,10 +761,10 @@ M.eye_blurry = max(M.eye_blurry, 10) else if(effective_dose < 20) if(prob(50)) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.drowsyness = max(M.drowsyness, 20) else - M.Sleeping(20) + M.afflict_sleeping(20 * 20) M.drowsyness = max(M.drowsyness, 60) /datum/reagent/drink/juice/lemon @@ -1480,10 +1480,10 @@ M.eye_blurry = max(M.eye_blurry, 10) else if(effective_dose < 20) if(prob(50)) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.drowsyness = max(M.drowsyness, 20) else - M.Sleeping(20) + M.afflict_sleeping(20 * 20) M.drowsyness = max(M.drowsyness, 60) /datum/reagent/drink/milkshake/chocoshake @@ -2323,7 +2323,7 @@ ..() M.dizziness = max(0, M.dizziness - 5) M.drowsyness = max(0, M.drowsyness - 3) - M.AdjustSleeping(-2) + M.adjust_sleeping(20 * -2) if(M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) @@ -2694,7 +2694,7 @@ /datum/reagent/ethanol/beepsky_smash/affect_ingest(mob/living/carbon/M, alien, removed) ..() - M.Stun(2) + M.afflict_stun(20 * 2) /datum/reagent/ethanol/bilk name = "Bilk" @@ -3063,7 +3063,7 @@ /datum/reagent/ethanol/neurotoxin/affect_ingest(mob/living/carbon/M, alien, removed) ..() - M.Weaken(3) + M.afflict_paralyze(20 * 3) /datum/reagent/ethanol/patron name = "Patron" @@ -3333,7 +3333,7 @@ drug_strength = drug_strength * 0.8 M.druggy = max(M.druggy, drug_strength) - if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && M.canmove && !M.restrained()) + if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && CHECK_MOBILITY(M, MOBILITY_CAN_MOVE)) step(M, pick(GLOB.cardinal)) /datum/reagent/ethanol/sakebomb @@ -4664,7 +4664,7 @@ /datum/reagent/ethanol/galacticpanic/affect_ingest(mob/living/carbon/M, alien, removed) ..() - M.Stun(2) + M.afflict_stun(20 * 2) /datum/reagent/ethanol/galacticpanic/affect_ingest(mob/living/carbon/M, alien, removed) ..() diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm index fcd6aef0abf..82582d410f2 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm @@ -245,7 +245,7 @@ if(prob(15)) to_chat(M, "You have a moment of clarity as you collapse.") M.adjustBrainLoss(-20 * removed) //Deals braindamage to promethians - M.Weaken(6) + M.afflict_paralyze(20 * 6) else if(alien != IS_DIONA) M.adjustOxyLoss(-60 * removed) //Heals alot of oxyloss damage/but //keep in mind that Dexaline has a metabolism rate of 0.25*REM meaning only 0.25 units are removed every tick(if your metabolism takes usuall 1u per tick) @@ -271,7 +271,7 @@ if(prob(25)) to_chat(M, "You have a moment of clarity, as you feel your tubes lose pressure rapidly.") M.adjustBrainLoss(-8 * removed)//deals less braindamage than Dex - M.Weaken(3) + M.afflict_paralyze(20 * 3) else if(alien != IS_DIONA) M.adjustOxyLoss(-150 * removed)//Heals more oxyloss than Dex and has no metabolism reduction @@ -352,7 +352,7 @@ if(alien == IS_SLIME) chem_effective = 0.25 to_chat(M, "It's cold. Something causes your cellular mass to harden occasionally, resulting in vibration.") - M.Weaken(10) + M.afflict_paralyze(20 * 10) M.silent = max(M.silent, 10) M.make_jittery(4) M.adjustCloneLoss(-10 * removed * chem_effective)//Clone damage, either occured during cloning or from xenobiology slimes. @@ -378,7 +378,7 @@ if(prob(10)) to_chat(M, "It's so cold. Something causes your cellular mass to harden sporadically, resulting in seizure-like twitching.") chem_effective = 0.5 - M.Weaken(20) + M.afflict_paralyze(20 * 20) M.silent = max(M.silent, 20) M.make_jittery(4) M.adjustCloneLoss(-30 * removed * chem_effective)//Better version of cryox, but they can work at the same time @@ -412,7 +412,7 @@ if(prob(10)) to_chat(M, "It's so cold. Something causes your cellular mass to harden sporadically, resulting in seizure-like twitching.") chem_effective = 0.5 - M.Weaken(20) + M.afflict_paralyze(20 * 20) M.silent = max(M.silent, 20) M.make_jittery(4) if(M.stat != DEAD) @@ -518,7 +518,7 @@ var/mob/living/carbon/human/H = M if(prob(1)) to_chat(H,"Your entire body feels numb and the sensation of pins and needles continually assaults you. You blink and the next thing you know, your legs give out momentarily!") - H.AdjustWeakened(5) //Fall onto the floor for a few moments. + H.adjust_paralyzed(20 * 5) //Fall onto the floor for a few moments. H.Confuse(15) //Be unable to walk correctly for a bit longer. if(prob(1)) if(H.losebreath <= 1 && H.oxyloss <= 20) //Let's not suffocate them to the point that they pass out. @@ -561,9 +561,9 @@ M.adjustFireLoss(-1 * removed) chem_effective = 0.5 M.drowsyness = max(M.drowsyness - 5, 0) - M.AdjustUnconscious(-1) - M.AdjustStunned(-1) - M.AdjustWeakened(-1) + M.adjust_unconscious(20 * -1) + M.adjust_stunned(20 * -1) + M.adjust_paralyzed(20 * -1) holder.remove_reagent("mindbreaker", 5) M.hallucination = max(0, M.hallucination - 10)//Primary use M.adjustToxLoss(5 * removed * chem_effective) // It used to be incredibly deadly due to an oversight. Not anymore! @@ -609,9 +609,9 @@ if(alien == IS_SLIME) chem_effective = 0.25 if(M.brainloss >= 10) - M.Weaken(5) - if(dose >= 10 && M.paralysis < 40) - M.AdjustUnconscious(1) //Messing with the core with a simple chemical probably isn't the best idea. + M.afflict_paralyze(20 * 5) + if(dose >= 10 && M.is_unconscious()) + M.adjust_unconscious(20 * 1) //Messing with the core with a simple chemical probably isn't the best idea. M.adjustBrainLoss(-8 * removed * chem_effective) //the Brain damage heal M.ceiling_chemical_effect(CE_PAINKILLER, 10 * chem_effective) @@ -711,7 +711,7 @@ if(O.status & ORGAN_BROKEN) O.mend_fracture() //Only works if the bone won't rebreak, as usual H.custom_pain("You feel a terrible agony tear through your bones!",60) - H.AdjustWeakened(1) //Bones being regrown will knock you over + H.adjust_paralyzed(20 * 1) //Bones being regrown will knock you over /datum/reagent/myelamine name = "Myelamine" @@ -769,7 +769,7 @@ H.Confuse(2) if(M.reagents.has_reagent("gastirodaxon") || M.reagents.has_reagent("peridaxon")) if(H.losebreath >= 15 && prob(H.losebreath)) - H.Stun(2) + H.afflict_stun(20 * 2) else H.losebreath = clamp(H.losebreath + 3, 0, 20) else @@ -1140,9 +1140,9 @@ if(prob(25)) if(prob(25)) to_chat(M, "Your pneumatic fluids seize for a moment.") - M.Stun(2) + M.afflict_stun(20 * 2) spawn(30) - M.Weaken(2) + M.afflict_paralyze(20 * 2) if(dose >= 10 || M.toxloss >= 25) //Internal skeletal tubes are rupturing, allowing the chemical to breach them. M.adjustToxLoss(removed * 4) M.make_jittery(5) @@ -1160,7 +1160,7 @@ if(prob(20)) M.Confuse(5) if(prob(20)) - M.Weaken(5) + M.afflict_paralyze(20 * 5) if(prob(20)) M.make_dizzy(5) if(prob(20)) @@ -1320,8 +1320,6 @@ M.adjustOxyLoss(-2 * removed) M.heal_organ_damage(20 * removed, 20 * removed) M.adjustToxLoss(-20 * removed) - if(dose > 3) - M.status_flags &= ~DISFIGURED if(dose > 10) M.make_dizzy(5) M.make_jittery(5) diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm index adff6bfd10b..37a532dc01c 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm @@ -213,15 +213,15 @@ M.sdisabilities = 0 M.eye_blurry = 0 M.SetBlinded(0) - M.SetWeakened(0) - M.SetStunned(0) - M.SetUnconscious(0) + M.set_paralyzed(0) + M.set_stunned(0) + M.set_unconscious(0) M.silent = 0 M.dizziness = 0 M.drowsyness = 0 M.stuttering = 0 M.SetConfused(0) - M.SetSleeping(0) + M.set_sleeping(0) M.jitteriness = 0 M.radiation = 0 M.ExtinguishMob() @@ -306,8 +306,8 @@ /datum/reagent/adrenaline/affect_blood(mob/living/carbon/M, alien, removed) if(alien == IS_DIONA) return - M.SetUnconscious(0) - M.SetWeakened(0) + M.set_unconscious(0) + M.set_paralyzed(0) M.adjustToxLoss(rand(3)) /datum/reagent/water/holywater diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Toxins.dm index db44511b0f5..0793260f527 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Toxins.dm @@ -67,7 +67,7 @@ /datum/reagent/toxin/neurotoxic_protein/affect_blood(mob/living/carbon/M, alien, removed) ..() if(alien != IS_DIONA) - if(M.canmove && !M.restrained() && istype(M.loc, /turf/space)) + if(CHECK_MOBILITY(M, MOBILITY_CAN_MOVE) && istype(M.loc, /turf/space)) step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch", "drool", "moan")) @@ -171,7 +171,7 @@ /datum/reagent/toxin/cyanide/affect_blood(mob/living/carbon/M, alien, removed) ..() M.adjustOxyLoss(20 * removed) - M.Sleeping(1) + M.afflict_sleeping(20 * 1) /datum/reagent/toxin/mold name = "Mold" @@ -260,7 +260,7 @@ if(H.losebreath >= 10) H.losebreath = max(10, H.losebreath - 10) H.adjustOxyLoss(2) - H.Weaken(10) + H.afflict_paralyze(20 * 10) /datum/reagent/toxin/potassium_chlorophoride name = "Potassium Chlorophoride" @@ -281,7 +281,7 @@ if(H.losebreath >= 10) H.losebreath = max(10, M.losebreath-10) H.adjustOxyLoss(2) - H.Weaken(10) + H.afflict_paralyze(20 * 10) if(alien == IS_SLIME) M.adjustFireLoss(removed * 3) @@ -300,16 +300,16 @@ ..() if(alien == IS_DIONA) return - M.status_flags |= FAKEDEATH + M.status_flags |= STATUS_FAKEDEATH M.adjustOxyLoss(3 * removed) - M.Weaken(10) + M.afflict_paralyze(20 * 10) M.silent = max(M.silent, 10) M.tod = stationtime2text() /datum/reagent/toxin/zombiepowder/Destroy() if(holder && holder.my_atom && ismob(holder.my_atom)) var/mob/M = holder.my_atom - M.status_flags &= ~FAKEDEATH + M.status_flags &= ~STATUS_FAKEDEATH return ..() /datum/reagent/toxin/lichpowder @@ -326,7 +326,7 @@ ..() if(alien == IS_DIONA) return - M.status_flags |= FAKEDEATH + M.status_flags |= STATUS_FAKEDEATH M.adjustOxyLoss(1 * removed) M.silent = max(M.silent, 10) M.tod = stationtime2text() @@ -338,7 +338,7 @@ /datum/reagent/toxin/lichpowder/Destroy() if(holder && holder.my_atom && ismob(holder.my_atom)) var/mob/M = holder.my_atom - M.status_flags &= ~FAKEDEATH + M.status_flags &= ~STATUS_FAKEDEATH return ..() /datum/reagent/toxin/fertilizer //Reagents used for plant fertilizers. @@ -537,7 +537,7 @@ M.adjustToxLoss(3 * removed) if(prob(10)) to_chat(M, "Your cellular mass hardens for a moment.") - M.Stun(6) + M.afflict_stun(20 * 6) return if(alien == IS_SKRELL) M.take_organ_damage(2.4 * removed, 0) @@ -731,7 +731,7 @@ M.eye_blurry = max(M.eye_blurry, 10) else if(effective_dose < 5 * threshold) if(prob(50)) - M.Weaken(2) + M.afflict_paralyze(20 * 2) M.drowsyness = max(M.drowsyness, 20) else if(alien == IS_SLIME) //They don't have eyes, and they don't really 'sleep'. Fumble their general senses. @@ -741,9 +741,9 @@ M.ear_deaf = max(M.ear_deaf, 4) M.Confuse(2) else - M.Weaken(2) + M.afflict_paralyze(20 * 2) else - M.Sleeping(20) + M.afflict_sleeping(20 * 20) M.drowsyness = max(M.drowsyness, 60) /datum/reagent/chloralhydrate @@ -777,17 +777,17 @@ M.Confuse(2) M.drowsyness += 2 else if(effective_dose < 2 * threshold) - M.Weaken(30) + M.afflict_paralyze(20 * 30) M.eye_blurry = max(M.eye_blurry, 10) else if(alien == IS_SLIME) if(prob(30)) M.ear_deaf = max(M.ear_deaf, 4) M.eye_blurry = max(M.eye_blurry, 60) - M.Weaken(30) + M.afflict_paralyze(20 * 30) M.Confuse(40) else - M.Sleeping(30) + M.afflict_sleeping(20 * 30) if(effective_dose > 1 * threshold) M.adjustToxLoss(removed) @@ -833,7 +833,7 @@ drug_strength = drug_strength * 1.2 M.druggy = max(M.druggy, drug_strength) - if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && M.canmove && !M.restrained()) + if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && CHECK_MOBILITY(M, MOBILITY_CAN_MOVE)) step(M, pick(GLOB.cardinal)) if(prob(7)) M.emote(pick("twitch", "drool", "moan", "giggle")) @@ -1014,7 +1014,7 @@ M.adjustToxLoss(10 * removed) //Given incorporations of other toxins with similiar damage, this seems right. M.druggy = max(M.druggy, drug_strength) - if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && M.canmove && !M.restrained()) + if(prob(10) && isturf(M.loc) && !istype(M.loc, /turf/space) && CHECK_MOBILITY(M, MOBILITY_CAN_MOVE)) step(M, pick(GLOB.cardinal)) if(prob(7)) M.emote(pick("twitch", "drool", "moan", "giggle")) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 7f7651ec1d7..8da3a8e5f0e 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -151,9 +151,9 @@ // attack with hand, move pulled object onto conveyor /obj/machinery/conveyor/attack_hand(mob/user, list/params) - if ((!( user.canmove ) || user.restrained() || !( user.pulling ))) + if(!CHECK_ALL_MOBILITY(user, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) return - if (user.pulling.anchored) + if(isnull(user.pulling) || user.pulling.anchored) return if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1)) return @@ -165,7 +165,6 @@ else step(user.pulling, get_dir(user.pulling.loc, src)) user.stop_pulling() - return // make the conveyor broken // also propagate inoperability to any connected conveyor with the same ID diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 87b1cac2374..3a22cfb2a5b 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -153,7 +153,7 @@ // mouse drop another mob or self // /obj/machinery/disposal/MouseDroppedOnLegacy(mob/target, mob/user) - if(user.stat || !user.canmove || !istype(target)) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE) || !istype(target)) return if(target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1) return @@ -166,20 +166,20 @@ var/target_loc = target.loc var/msg for (var/mob/V in viewers(usr)) - if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + if(target == user && !user.stat && CHECK_ALL_MOBILITY(user, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) V.show_message("[usr] starts climbing into the disposal.", 3) - if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + if(target != user && !user.restrained() && !user.stat && CHECK_ALL_MOBILITY(user, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) if(target.anchored) return V.show_message("[usr] starts stuffing [target.name] into the disposal.", 3) if(!do_after(usr, 20)) return if(target_loc != target.loc) return - if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) // if drop self, then climbed in + if(target == user && !user.stat && CHECK_ALL_MOBILITY(user, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) // if drop self, then climbed in // must be awake, not stunned or whatever msg = "[user.name] climbs into the [src]." to_chat(user, "You climb into the [src].") - else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + else if(target != user && !user.restrained() && !user.stat && CHECK_ALL_MOBILITY(user, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE)) msg = "[user.name] stuffs [target.name] into the [src]!" to_chat(user, "You stuff [target.name] into the [src]!") diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm index 6e23adb4807..b9cbaf12e57 100644 --- a/code/modules/resleeving/infomorph.dm +++ b/code/modules/resleeving/infomorph.dm @@ -209,7 +209,7 @@ var/list/infomorph_emotions = list( set category = "Card Commands" set name = "Chassis Open" - if(stat || sleeping || paralysis || weakened) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) return if(src.loc != card) @@ -251,7 +251,7 @@ var/list/infomorph_emotions = list( set category = "Card Commands" set name = "Chassis Close" - if(stat || sleeping || paralysis || weakened) + if(!IS_CONSCIOUS(src)) return if(src.loc == card) @@ -289,7 +289,6 @@ var/list/infomorph_emotions = list( // Move us into the card and move the card to the ground. card.forceMove(get_turf(src)) forceMove(card) - canmove = 1 resting = 0 icon_state = "[chassis]" @@ -325,14 +324,12 @@ var/list/infomorph_emotions = list( icon_state = resting ? "[chassis]_rest" : "[chassis]" to_chat(src, "You are now [resting ? "resting" : "getting up"]") - canmove = !resting - ////////////////// ATTACKBY, HAND, SELF etc /mob/living/silicon/infomorph/attackby(obj/item/W as obj, mob/user as mob) if(W.damage_force) visible_message("[user.name] attacks [src] with [W]!") src.adjustBruteLoss(W.damage_force) - src.updatehealth() + src.update_health() else visible_message("[user.name] bonks [src] harmlessly with [W].") spawn(1) @@ -586,8 +583,8 @@ var/global/list/default_infomorph_software = list() if(health <= 0) death(null,"gives one shrill beep before falling lifeless.") -/mob/living/silicon/infomorph/updatehealth() - if(status_flags & GODMODE) +/mob/living/silicon/infomorph/update_health() + if(status_flags & STATUS_GODMODE) health = 100 set_stat(CONSCIOUS) else diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index 4301b275598..a0b901ebd0b 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -93,8 +93,8 @@ //Apply damage H.adjustCloneLoss((H.getMaxHealth() - config_legacy.health_threshold_dead)*-0.75) - H.Unconscious(4) - H.updatehealth() + H.afflict_unconscious(20 * 4) + H.update_health() //Grower specific mutations if(heal_level < 60) @@ -308,7 +308,7 @@ //Apply damage H.adjustBruteLoss(brute_value) H.adjustFireLoss(burn_value) - H.updatehealth() + H.update_health() //Update appearance, remake icons H.UpdateAppearance() diff --git a/code/modules/resleeving/sleevecard.dm b/code/modules/resleeving/sleevecard.dm index 0400c0a6502..e9cfce1d001 100644 --- a/code/modules/resleeving/sleevecard.dm +++ b/code/modules/resleeving/sleevecard.dm @@ -23,7 +23,7 @@ matter = list(MAT_STEEL = 4000, MAT_GLASS = 4000) /obj/item/sleevecard/relaymove(var/mob/user, var/direction) - if(user.stat || user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return var/obj/item/rig/rig = src.get_rig() if(istype(rig)) @@ -102,7 +102,7 @@ qdel(src) /obj/item/sleevecard/see_emote(mob/living/M, text) - if(infomorph && infomorph.client && !infomorph.canmove) + if(infomorph && infomorph.client) var/rendered = "[text]" infomorph.show_message(rendered, 2) ..() diff --git a/code/modules/rigsuits/_rig.dm b/code/modules/rigsuits/_rig.dm index d708fc8ca93..14526792e8b 100644 --- a/code/modules/rigsuits/_rig.dm +++ b/code/modules/rigsuits/_rig.dm @@ -359,7 +359,7 @@ if(!failed_to_seal && (M.back == src || M.belt == src) && piece == compare_piece) - if(seal_delay && !instant && !do_after(M,seal_delay,needhand=0)) + if(seal_delay && !instant && !do_self(M, seal_delay, DO_AFTER_IGNORE_ACTIVE_ITEM | DO_AFTER_IGNORE_MOVEMENT, NONE)) failed_to_seal = 1 piece.icon_state = "[suit_state][is_sealing ? "_sealed" : ""]" @@ -755,7 +755,7 @@ return 0 if(href_list["toggle_piece"]) - if(ishuman(usr) && (usr.stat || usr.stunned || usr.lying)) + if(ishuman(usr) && !CHECK_MOBILITY(usr, MOBILITY_CAN_STORAGE)) return 0 toggle_piece(href_list["toggle_piece"], usr) else if(href_list["toggle_seals"]) @@ -821,7 +821,7 @@ if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src)) return - if(usr == wearer && (usr.stat||usr.paralysis||usr.stunned)) // If the usr isn't wearing the suit it's probably an AI. + if(usr == wearer && !CHECK_MOBILITY(H, MOBILITY_CAN_MOVE)) // If the usr isn't wearing the suit it's probably an AI. return if(trapSprung == 1) @@ -932,7 +932,7 @@ /obj/item/rig/proc/shock(mob/user) if (electrocute_mob(user, cell, src)) //electrocute_mob() handles removing charge from the cell, no need to do that here. spark_system.start() - if(user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_USE)) return 1 return 0 @@ -1045,7 +1045,7 @@ return //This is sota the goto stop mobs from moving var - if(wearer.transforming || !wearer.canmove) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return if(locate(/obj/effect/stop/, wearer.loc)) @@ -1072,7 +1072,7 @@ if(wearer.restrained())//Why being pulled while cuffed prevents you from moving for(var/mob/M in range(wearer, 1)) if(M.pulling == wearer) - if(!M.restrained() && M.stat == 0 && M.canmove && wearer.Adjacent(M)) + if(CHECK_MOBILITY(M, MOBILITY_CAN_MOVE) && wearer.Adjacent(M)) to_chat(user, "Your host is restrained! They can't move!") return 0 else @@ -1112,7 +1112,7 @@ var/power_cost = 200 if(!ai_moving) power_cost = 20 - if(protean_shitcode_moment) // fuck this kill me + if(!protean_shitcode_moment) // fuck this kill me cell.use(power_cost) //Arbitrary, TODO wearer.Move(get_step(get_turf(wearer),direction),direction) diff --git a/code/modules/rigsuits/modules/modules.dm b/code/modules/rigsuits/modules/modules.dm index f8e83f05307..8f5635ce1b8 100644 --- a/code/modules/rigsuits/modules/modules.dm +++ b/code/modules/rigsuits/modules/modules.dm @@ -154,7 +154,7 @@ to_chat(usr, "The suit is not initialized.") return 0 - if(usr.lying || usr.stat || usr.stunned || usr.paralysis || usr.weakened) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) to_chat(usr, "You cannot use the suit in this state.") return 0 diff --git a/code/modules/rigsuits/suits/species/protean.dm b/code/modules/rigsuits/suits/species/protean.dm index 8d30ac8c9c7..a91731c6817 100644 --- a/code/modules/rigsuits/suits/species/protean.dm +++ b/code/modules/rigsuits/suits/species/protean.dm @@ -24,7 +24,7 @@ rad = 1.0 /obj/item/rig/protean/relaymove(mob/user, var/direction) - if(user.stat || user.stunned) + if(!CHECK_MOBILITY(user, MOBILITY_CAN_MOVE)) return forced_move(direction, user, FALSE, TRUE) diff --git a/code/modules/shieldgen/energy_shield.dm b/code/modules/shieldgen/energy_shield.dm index 58fc4ba6b03..4d672731600 100644 --- a/code/modules/shieldgen/energy_shield.dm +++ b/code/modules/shieldgen/energy_shield.dm @@ -280,7 +280,7 @@ /obj/effect/shield/proc/overcharge_shock(var/mob/living/M) M.adjustFireLoss(rand(20, 40)) - M.Weaken(5) + M.afflict_paralyze(20 * 5) to_chat(M, "As you come into contact with \the [src] a surge of energy paralyses you!") take_damage(10, SHIELD_DAMTYPE_EM) diff --git a/code/modules/shuttles/crashes.dm b/code/modules/shuttles/crashes.dm index 84f2992cf35..69d72a314a1 100644 --- a/code/modules/shuttles/crashes.dm +++ b/code/modules/shuttles/crashes.dm @@ -55,7 +55,7 @@ for(var/living in victims) var/mob/living/L = living victims[L] = get_turf(L) - L.Sleeping(rand(10,20)) + L.afflict_sleeping(20 * rand(10,20)) L.Life(1, SSmobs.times_fired) L.loc = null diff --git a/code/modules/shuttles/shuttle.dm b/code/modules/shuttles/shuttle.dm index ddb7e47d761..0119e990ce4 100644 --- a/code/modules/shuttles/shuttle.dm +++ b/code/modules/shuttles/shuttle.dm @@ -340,7 +340,7 @@ shake_camera(M, 10, 1) // TODO - tossing? if(istype(M, /mob/living/carbon)) - M.Weaken(3) + M.afflict_paralyze(20 * 3) if(move_direction) throw_a_mob(M,move_direction) // We only need to rebuild powernets for our cables. No need to check machines because they are on top of cables. diff --git a/code/modules/species/promethean/promethean.dm b/code/modules/species/promethean/promethean.dm index dbfaf027bc9..ea392f62afb 100644 --- a/code/modules/species/promethean/promethean.dm +++ b/code/modules/species/promethean/promethean.dm @@ -246,7 +246,7 @@ var/datum/species/shapeshifter/promethean/prometheans return //Human form - else if(stat || paralysis || stunned || weakened || restrained()) + else if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || restrained()) to_chat(src, SPAN_WARNING("You can only do this while not stunned.")) return else diff --git a/code/modules/species/promethean/promethean_blob.dm b/code/modules/species/promethean/promethean_blob.dm index 5e0bb94f5d0..1a0a764e011 100644 --- a/code/modules/species/promethean/promethean_blob.dm +++ b/code/modules/species/promethean/promethean_blob.dm @@ -85,12 +85,12 @@ ..() if(H) humanform = H - updatehealth() + update_health() else qdel(src) -/mob/living/simple_mob/slime/promethean/updatehealth() +/mob/living/simple_mob/slime/promethean/update_health() if(!humanform) return ..() @@ -112,7 +112,6 @@ //Grab any other interesting values confused = humanform.confused radiation = humanform.radiation - paralysis = humanform.paralysis //Update our hud if we have one if(healths) @@ -230,7 +229,7 @@ //Blob form if(!ishuman(src)) - if(humanform.temporary_form.stat || paralysis || stunned || weakened || restrained()) + if(humanform.temporary_form.stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || restrained()) to_chat(src,"You can only do this while not stunned.") else humanform.prommie_outofblob(src) @@ -372,7 +371,7 @@ if(r_hand) blob.prev_right_hand = r_hand //Put our owner in it (don't transfer var/mind) - blob.Weaken(2) + blob.afflict_paralyze(20 * 2) blob.transforming = TRUE blob.ckey = ckey blob.ooc_notes = ooc_notes @@ -440,7 +439,7 @@ forceMove(reform_spot) //Put our owner in it (don't transfer var/mind) - Weaken(2) + afflict_paralyze(20 * 2) playsound(src.loc, "sound/effects/slime_squish.ogg", 15) transforming = TRUE ckey = blob.ckey diff --git a/code/modules/species/protean/protean_blob.dm b/code/modules/species/protean/protean_blob.dm index 2c18bcaae00..14b7fe75c04 100644 --- a/code/modules/species/protean/protean_blob.dm +++ b/code/modules/species/protean/protean_blob.dm @@ -76,7 +76,7 @@ add_verb(src, /mob/living/simple_mob/protean_blob/proc/rig_transform) add_verb(src, /mob/living/simple_mob/protean_blob/proc/leap_attack) add_verb(src, /mob/living/proc/usehardsuit) - INVOKE_ASYNC(src, /mob/living/proc/updatehealth) + INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, update_health)) else update_icon() @@ -97,7 +97,7 @@ if(humanform && C.statpanel_tab("Species", TRUE)) . += humanform.species.statpanel_status(C, humanform) -/mob/living/simple_mob/protean_blob/updatehealth() +/mob/living/simple_mob/protean_blob/update_health() if(humanform) //Set the max maxHealth = humanform.getMaxHealth() + 100 // +100 for crit threshold so you don't die from trying to blob to heal, ironically @@ -239,13 +239,14 @@ to_chat(src, "You can't eat this.") return - if(is_type_in_list(I,edible_trash) | adminbus_trash) + if(is_type_in_list(I, edible_trash) || adminbus_trash) if(I.hidden_uplink) to_chat(src, "You really should not be eating this.") message_admins("[key_name(src)] has attempted to ingest an uplink item. ([src ? "JMP" : "null"])") return - visible_message("[name] stretches itself over the [I], engulfing it whole!") - I.forceMove(vore_selected) + visible_message("[name] stretches itself over the [I], engulfing it whole!") + I.forceMove(vore_selected) + return else return ..() @@ -609,7 +610,8 @@ /datum/modifier/protean/steelBlob/tick() ..() - if(holder.temporary_form?.resting) + var/mob/living/living_form = holder.temporary_form + if(istype(living_form) && living_form.resting) return var/dt = 2 // put it on param sometime but for now assume 2 var/mob/living/carbon/human/H = holder diff --git a/code/modules/species/protean/protean_powers.dm b/code/modules/species/protean/protean_powers.dm index 7cc944d2e25..daac8ccccfc 100644 --- a/code/modules/species/protean/protean_powers.dm +++ b/code/modules/species/protean/protean_powers.dm @@ -39,7 +39,7 @@ // var/mob/living/simple_mob/protean_blob/blob = nano_intoblob() active_regen = TRUE src.visible_message("[src]'s flesh begins to bubble, growing oily tendrils from their limb stump...") // Gives a visualization for regenerating limbs. - if(do_after(src,5 SECONDS)) // Makes you not need to blob to regen a single limb. I'm keeping the full-body regen as blob-only, though + if(do_self(src, 5 SECONDS, DO_AFTER_IGNORE_ACTIVE_ITEM | DO_AFTER_IGNORE_MOVEMENT, NONE)) // Makes you not need to blob to regen a single limb. I'm keeping the full-body regen as blob-only, though if(!refactory.use_stored_material(MAT_STEEL,PER_LIMB_STEEL_COST)) return var/list/limblist = species.has_limbs[choice] @@ -132,7 +132,7 @@ var/mob/living/simple_mob/protean_blob/blob = nano_intoblob() active_regen = TRUE - if(do_after(blob,5 SECONDS)) + if(do_self(blob, 5 SECONDS, DO_AFTER_IGNORE_ACTIVE_ITEM | DO_AFTER_IGNORE_MOVEMENT, NONE)) synthetic = usable_manufacturers[manu_choice] torso.robotize(manu_choice) //Will cascade to all other organs. regenerate_icons() @@ -152,7 +152,7 @@ active_regen = TRUE var/mob/living/simple_mob/protean_blob/blob = nano_intoblob() - if(do_after(blob, delay_length, null, 0)) + if(do_self(blob, 5 SECONDS, DO_AFTER_IGNORE_ACTIVE_ITEM | DO_AFTER_IGNORE_MOVEMENT, NONE)) if(stat != DEAD && refactory) //Not enough resources (AND spends the resources, should be the last check) if(!refactory.use_stored_material(MAT_STEEL,refactory.max_storage)) diff --git a/code/modules/species/shadekin/shadekin_abilities.dm b/code/modules/species/shadekin/shadekin_abilities.dm index 1498663a489..79842dfb72b 100644 --- a/code/modules/species/shadekin/shadekin_abilities.dm +++ b/code/modules/species/shadekin/shadekin_abilities.dm @@ -77,15 +77,11 @@ playsound(src, 'sound/effects/stealthoff.ogg', 75, TRUE) forceMove(T) - var/original_canmove = canmove - SetStunned(0) - SetWeakened(0) - if(buckled) - buckled.unbuckle_mob() - if(pulledby) - pulledby.stop_pulling() + set_stunned(0) + set_paralyzed(0) + unbuckle(BUCKLE_OP_FORCE) + break_pull() stop_pulling() - canmove = FALSE //Shifting in if(ability_flags & AB_PHASE_SHIFTED) @@ -112,11 +108,10 @@ remove_a_modifier_of_type(/datum/modifier/shadekin_phase_vision) RemoveSightSelf(SEE_THRU) sleep(5) //The duration of the TP animation - canmove = original_canmove alpha = initial(alpha) // probably replace with a trait later. - set_movement_type(MOVEMENT_GROUND) + remove_atom_phasing(SPECIES_SHADEKIN_PHASING_TRAIT) //Potential phase-in vore if(can_be_drop_pred) //Toggleable in vore panel @@ -161,9 +156,8 @@ alpha = 127 // probably replace with a trait later. - set_movement_type(MOVEMENT_PHASING) + add_atom_phasing(SPECIES_SHADEKIN_PHASING_TRAIT) - canmove = original_canmove incorporeal_move = TRUE density = FALSE force_max_speed = TRUE diff --git a/code/modules/species/species.dm b/code/modules/species/species.dm index 6982f449d01..af0dbbffc7b 100644 --- a/code/modules/species/species.dm +++ b/code/modules/species/species.dm @@ -788,9 +788,7 @@ GLOBAL_LIST_INIT(species_oxygen_tank_by_gas, list( /datum/species/proc/handle_npc(var/mob/living/carbon/human/H) if(H.stat == CONSCIOUS && H.ai_holder) if(H.resting) - H.resting = FALSE - H.update_canmove() - return + H.set_intentionally_resting(FALSE) // Called when lying down on a water tile. /datum/species/proc/can_breathe_water() diff --git a/code/modules/species/station/alraune.dm b/code/modules/species/station/alraune.dm index 37c86a49781..e1fdc8c230c 100644 --- a/code/modules/species/station/alraune.dm +++ b/code/modules/species/station/alraune.dm @@ -261,11 +261,11 @@ if(SA_pp > SA_para_min) // 3 gives them one second to wake up and run away a bit! - H.Unconscious(3) + H.afflict_unconscious(20 * 3) // Enough to make us sleep as well if(SA_pp > SA_sleep_min) - H.Sleeping(5) + H.afflict_sleeping(20 * 5) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning else if(SA_pp > 0.15) diff --git a/code/modules/species/station/monkey.dm b/code/modules/species/station/monkey.dm index 6b57b16ff7d..7c198c53808 100644 --- a/code/modules/species/station/monkey.dm +++ b/code/modules/species/station/monkey.dm @@ -61,7 +61,7 @@ /datum/species/monkey/handle_npc(mob/living/carbon/human/H) if(H.stat != CONSCIOUS) return - if(prob(33) && H.canmove && isturf(H.loc) && !H.pulledby) //won't move if being pulled + if(prob(33) && CHECK_MOBILITY(H, MOBILITY_CAN_MOVE) && isturf(H.loc) && !H.pulledby) //won't move if being pulled step(H, pick(GLOB.cardinal)) if(prob(1)) H.emote(pick("scratch","jump","roll","tail")) diff --git a/code/modules/species/station/standard/teshari.dm b/code/modules/species/station/standard/teshari.dm index 8c6189de14f..91a8960cbde 100644 --- a/code/modules/species/station/standard/teshari.dm +++ b/code/modules/species/station/standard/teshari.dm @@ -217,6 +217,6 @@ if(!silent) to_chat(H, SPAN_NOTICE("You catch the air in your wings and greatly slow your fall.")) H.visible_message(SPAN_NOTICE("\The [H] glides down from above, landing safely.")) - H.Stun(2) + H.afflict_stun(20 * 2) playsound(H, "rustle", 25, 1) return TRUE diff --git a/code/modules/species/station/station_special_abilities.dm b/code/modules/species/station/station_special_abilities.dm index 8b18a892bcf..58a5bed246e 100644 --- a/code/modules/species/station/station_special_abilities.dm +++ b/code/modules/species/station/station_special_abilities.dm @@ -121,8 +121,6 @@ //Unfreeze some things does_not_breathe = FALSE - update_canmove() - weakened = 2 //Visual effects var/T = get_turf(src) @@ -344,7 +342,7 @@ /*if(last_special > world.time) return*/ - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src, "You cannot bite anyone in your current state!") return @@ -362,7 +360,7 @@ //if(last_special > world.time) return - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src, "You cannot bite in your current state.") return @@ -689,7 +687,7 @@ to_chat(src,"You can't shred that type of creature.") return FALSE //Needs to be capable (replace with incapacitated call?) - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src,"You cannot do that in your current state!") return FALSE //Needs to be adjacent, at the very least. diff --git a/code/modules/species/station/xenochimera.dm b/code/modules/species/station/xenochimera.dm index b45a4cb0862..54c241931c6 100644 --- a/code/modules/species/station/xenochimera.dm +++ b/code/modules/species/station/xenochimera.dm @@ -164,8 +164,6 @@ //While regenerating if(H.revive_ready == REVIVING_NOW || H.revive_ready == REVIVING_DONE) - H.weakened = 5 - H.canmove = 0 H.does_not_breathe = TRUE //Cold/pressure effects when not regenerating diff --git a/code/modules/species/virtual_reality/avatar.dm b/code/modules/species/virtual_reality/avatar.dm index 3ba4ee14e3b..32341e9c990 100644 --- a/code/modules/species/virtual_reality/avatar.dm +++ b/code/modules/species/virtual_reality/avatar.dm @@ -78,7 +78,7 @@ src.vr_link = avatar // Can't reuse vr_holder so that death can automatically eject users from VR // Move the mind - avatar.Sleeping(1) + avatar.afflict_sleeping(20 * 1) src.mind.transfer(avatar) to_chat(avatar, "You have enterred Virtual Reality!\nAll normal gameplay rules still apply.\nWounds you suffer here won't persist when you leave VR, but some of the pain will.\nYou can leave VR at any time by using the \"Exit Virtual Reality\" verb in the Abilities tab, or by ghosting.\nYou can modify your appearance by using various \"Change \[X\]\" verbs in the Abilities tab.") to_chat(avatar, " You black out for a moment, and wake to find yourself in a new body in virtual reality.") // So this is what VR feels like? @@ -100,7 +100,6 @@ total_damage = H.getBruteLoss() + H.getFireLoss() + H.getOxyLoss() + H.getToxLoss() // Move the mind back to the original mob -// vr_holder.Sleeping(1) src.mind.transfer(vr_holder) to_chat(vr_holder, "You black out for a moment, and wake to find yourself back in your own body.") // Two-thirds damage is transferred as agony for /humans diff --git a/code/modules/species/xenomorphs/alien_embryo.dm b/code/modules/species/xenomorphs/alien_embryo.dm index a6c15d1055f..7ea507ef6ee 100644 --- a/code/modules/species/xenomorphs/alien_embryo.dm +++ b/code/modules/species/xenomorphs/alien_embryo.dm @@ -63,11 +63,11 @@ to_chat(affected_mob, "Your stomach hurts.") if(prob(20)) affected_mob.adjustToxLoss(1) - affected_mob.updatehealth() + affected_mob.update_health() if(5) to_chat(affected_mob, "You feel something tearing its way out of your stomach...") affected_mob.adjustToxLoss(10) - affected_mob.updatehealth() + affected_mob.update_health() if(prob(50)) AttemptGrow() diff --git a/code/modules/species/xenomorphs/alien_facehugger.dm b/code/modules/species/xenomorphs/alien_facehugger.dm index 239ff19dbd4..1c55820caf9 100644 --- a/code/modules/species/xenomorphs/alien_facehugger.dm +++ b/code/modules/species/xenomorphs/alien_facehugger.dm @@ -171,7 +171,7 @@ var/const/MAX_ACTIVE_TIME = 400 target.equip_to_slot_if_possible(src, SLOT_ID_MASK, INV_OP_FLUFFLESS) if(!sterile) - L.Unconscious(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings + L.afflict_unconscious(20 * MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings GoIdle() //so it doesn't jump the people that tear it off @@ -430,7 +430,7 @@ var/const/MAX_ACTIVE_TIME = 400 target.equip_to_slot(src, SLOT_ID_MASK) target.contents += src // Monkey sanity check - Snapshot - if(!sterile) L.Unconscious(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings + if(!sterile) L.afflict_unconscious(20 * MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings GoIdle() //so it doesn't jump the people that tear it off diff --git a/code/modules/species/xenomorphs/alien_powers.dm b/code/modules/species/xenomorphs/alien_powers.dm index 4d119a3677a..83e62ac6045 100644 --- a/code/modules/species/xenomorphs/alien_powers.dm +++ b/code/modules/species/xenomorphs/alien_powers.dm @@ -267,7 +267,7 @@ if(last_special > world.time) return - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -286,12 +286,12 @@ if(last_special > world.time) return - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying || restrained() || buckled) to_chat(src, "You cannot leap in your current state.") return last_special = world.time + 75 - status_flags |= LEAPING + status_flags |= STATUS_LEAPING src.visible_message("\The [src] leaps at [T]!") src.throw_at_old(get_step(get_turf(T),get_turf(src)), 4, 1, src) @@ -299,13 +299,13 @@ sleep(5) - if(status_flags & LEAPING) status_flags &= ~LEAPING + if(status_flags & STATUS_LEAPING) status_flags &= ~STATUS_LEAPING if(!src.Adjacent(T)) to_chat(src, "You miss!") return - T.Weaken(3) + T.afflict_paralyze(20 * 3) var/use_hand = "left" if(l_hand) @@ -335,7 +335,7 @@ if(last_special > world.time) return - if(stat || paralysis || stunned || weakened || lying) + if(stat || !CHECK_MOBILITY(src, MOBILITY_CAN_USE) || lying) to_chat(src, "You cannot do that in your current state.") return diff --git a/code/modules/spells/artifacts.dm b/code/modules/spells/artifacts.dm index c27947df2c5..71c0c394b1f 100644 --- a/code/modules/spells/artifacts.dm +++ b/code/modules/spells/artifacts.dm @@ -259,7 +259,7 @@ GiveHint(target) else if(I.get_sharpness()) to_chat(target, "You feel a stabbing pain in [parse_zone(user.zone_selected)]!") - target.DefaultCombatKnockdown(40) + target.default_combat_knockdown(40) GiveHint(target) else if(istype(I, /obj/item/bikehorn)) to_chat(target, "HONK") @@ -378,11 +378,11 @@ /obj/item/warpwhistle/proc/end_effect(mob/living/carbon/user) user.invisibility = initial(user.invisibility) - user.status_flags &= ~GODMODE + user.status_flags &= ~STATUS_GODMODE REMOVE_TRAIT(user, TRAIT_MOBILITY_NOMOVE, src) REMOVE_TRAIT(user, TRAIT_MOBILITY_NOUSE, src) REMOVE_TRAIT(user, TRAIT_MOBILITY_NOPICKUP, src) - user.update_mobility() + user.update_mobility_blocked() /obj/item/warpwhistle/attack_self(mob/user) . = ..() @@ -401,13 +401,13 @@ ADD_TRAIT(user, TRAIT_MOBILITY_NOMOVE, src) ADD_TRAIT(user, TRAIT_MOBILITY_NOUSE, src) ADD_TRAIT(user, TRAIT_MOBILITY_NOPICKUP, src) - user.update_mobility() + user.update_mobility_blocked() new /obj/effect/temp_visual/tornado(T) sleep(20) if(interrupted(user)) return user.invisibility = INVISIBILITY_MAXIMUM - user.status_flags |= GODMODE + user.status_flags |= STATUS_GODMODE sleep(20) if(interrupted(user)) end_effect(user) diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 2fa5a993352..2c430cff982 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -115,11 +115,11 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if("oxyloss") target.adjustOxyLoss(amount) if("stunned") - target.AdjustStunned(amount) + target.adjust_stunned(20 * amount) if("weakened") - target.AdjustWeakened(amount) + target.adjust_paralyzed(20 * amount) if("paralysis") - target.AdjustUnconscious(amount) + target.adjust_unconscious(20 * amount) else target.vars[type] += amount //I bear no responsibility for the runtimes that'll happen if you try to adjust non-numeric or even non-existant vars return diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 5590fec37c5..44cca82241c 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -399,7 +399,7 @@ /obj/item/spellbook/oneuse/knock/recoil(mob/user) ..() to_chat(user, "You're knocked down!") - user.Weaken(20) + user.afflict_paralyze(20 * 20) /obj/item/spellbook/oneuse/horsemask spell = /spell/targeted/equip_item/horsemask diff --git a/code/modules/spells/targeted/chimera_spells.dm b/code/modules/spells/targeted/chimera_spells.dm index 9e4317704dc..11e4df983a6 100644 --- a/code/modules/spells/targeted/chimera_spells.dm +++ b/code/modules/spells/targeted/chimera_spells.dm @@ -149,7 +149,10 @@ H.visible_message(" [H] lays eerily still. Something about them seems off, even when dead.","We begin to gather up whatever is left to begin regrowth.") else H.visible_message(" [H] suddenly collapses, seizing up and going eerily still. ", "We begin the regrowth process to start anew.") - H.SetUnconscious(8000) //admin style self-stun + + ADD_TRAIT(H, TRAIT_MOB_UNCONSCIOUS, "__CHIMERA__") + H.update_stat() + H.update_mobility() //These are only messages to give the player and everyone around them an idea of which stage they're at //visible_message doesn't seem to relay selfmessages if you're paralysed, so we use to_chat @@ -201,11 +204,12 @@ //Drop everything H.drop_inventory(TRUE, TRUE) H.visible_message("[H] emerges from a cloud of viscera!") - H.SetUnconscious(0) //Unfreeze some things + REMOVE_TRAIT(H, TRAIT_MOB_UNCONSCIOUS, "__CHIMERA__") + H.update_stat() + H.update_mobility() H.does_not_breathe = FALSE - H.update_canmove() - H.weakened = 2 + H.afflict_paralyze(2) //Visual effects var/T = get_turf(H) new /obj/effect/gibspawner/human(T, H.dna,H.dna.blood_color,H.dna.blood_color) diff --git a/code/modules/spells/targeted/ethereal_jaunt.dm b/code/modules/spells/targeted/ethereal_jaunt.dm index fa459bd43c7..078cc2ac2ae 100644 --- a/code/modules/spells/targeted/ethereal_jaunt.dm +++ b/code/modules/spells/targeted/ethereal_jaunt.dm @@ -40,7 +40,8 @@ mobloc = holder.last_valid_turf animation.loc = mobloc jaunt_steam(mobloc) - target.canmove = 0 + ADD_TRAIT(target, TRAIT_MOBILITY_MOVE_BLOCKED, "JAUNT") + target.update_mobility_blocked() holder.reappearing = 1 sleep(20) jaunt_reappear(animation, target) @@ -52,7 +53,8 @@ if(target.forceMove(T)) break target.update_perspective() - target.canmove = 1 + REMOVE_TRAIT(target, TRAIT_MOBILITY_MOVE_BLOCKED, "JAUNT") + target.update_mobility_blocked() qdel(animation) qdel(holder) diff --git a/code/modules/spells/targeted/mind_transfer.dm b/code/modules/spells/targeted/mind_transfer.dm index 5da0396dca4..284f4ad86a3 100644 --- a/code/modules/spells/targeted/mind_transfer.dm +++ b/code/modules/spells/targeted/mind_transfer.dm @@ -74,7 +74,7 @@ //MIND TRANSFER END //Target is handled in ..(), so we handle the caster here - caster.Unconscious(amt_paralysis) + caster.afflict_unconscious(20 * amt_paralysis) //After a certain amount of time the victim gets a message about being in a different body. spawn(msg_wait) diff --git a/code/modules/spells/targeted/targeted.dm b/code/modules/spells/targeted/targeted.dm index 8a5cd30b804..33fdfda6366 100644 --- a/code/modules/spells/targeted/targeted.dm +++ b/code/modules/spells/targeted/targeted.dm @@ -132,9 +132,9 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp target.adjustToxLoss(amt_dam_tox) target.adjustOxyLoss(amt_dam_oxy) //disabling - target.Weaken(amt_weakened) - target.Unconscious(amt_paralysis) - target.Stun(amt_stunned) + target.afflict_paralyze(20 * amt_weakened) + target.afflict_unconscious(20 * amt_paralysis) + target.afflict_stun(20 * amt_stunned) if(amt_weakened || amt_paralysis || amt_stunned) if(target.buckled) target.buckled = null diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index 3824114625b..ebeeec188c6 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -59,7 +59,7 @@ "You have attached [target]'s [E.name] to the [E.amputation_point].") E.replaced(target) target.update_icons_body(FALSE) - target.updatehealth() + target.update_health() target.UpdateDamageIcon() /datum/surgery_step/limb/attach/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -99,7 +99,7 @@ "You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool].") E.status &= ~ORGAN_CUT_AWAY target.update_icons_body() - target.updatehealth() + target.update_health() target.UpdateDamageIcon() /datum/surgery_step/limb/connect/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -149,7 +149,7 @@ new_limb.sabotaged = 1 target.update_icons_body(FALSE) - target.updatehealth() + target.update_health() target.UpdateDamageIcon() qdel(tool) diff --git a/code/modules/surgery/neck.dm b/code/modules/surgery/neck.dm index cca5cb72e01..3f37c72a569 100644 --- a/code/modules/surgery/neck.dm +++ b/code/modules/surgery/neck.dm @@ -49,7 +49,7 @@ user.visible_message("[user]'s hand slips, tearing at [target]'s brainstem with \the [tool]!" , \ "Your hand slips, tearing at [target]'s brainstem with \the [tool]!" ) affected.create_wound(PIERCE, 10) - target.AdjustUnconscious(10) + target.adjust_unconscious(20 * 10) ///////////////////////////// // Bone Drilling @@ -80,7 +80,7 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] has drilled around [target]'s brainstem with \the [tool]." , \ " You have drilled around [target]'s brainstem with \the [tool].",) - target.AdjustUnconscious(10) //We're getting Invasive here. This only ticks down when the person is alive, so it's a good side-effect for this step. Rattling the braincase with a drill is not optimal. + target.adjust_unconscious(20 * 10) //We're getting Invasive here. This only ticks down when the person is alive, so it's a good side-effect for this step. Rattling the braincase with a drill is not optimal. target.op_stage.brainstem = 2 affected.fracture() //Does not apply damage, simply breaks it if it wasn't already. Doesn't stop a defib on its own. @@ -89,7 +89,7 @@ user.visible_message("[user] almost loses their grip on the [tool]!" , \ "Your hand slips and nearly shreds [target]'s brainstem with \the [tool]!" ) /*affected.create_wound(PIERCE, 10) - target.AdjustUnconscious(15) + target.adjust_unconscious(20 * 15) spawn() for(var/obj/item/organ/internal/brain/O in affected.internal_organs) O.take_damage(rand(5,10))*/ // Citadel Edit: Make NIF surgeries not so deadly @@ -121,7 +121,7 @@ /datum/surgery_step/brainstem/clean_chips/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] has cleaned around [target]'s brainstem with \the [tool]." , \ " You have cleaned around [target]'s brainstem with \the [tool].",) - target.AdjustUnconscious(10) //Still invasive. + target.adjust_unconscious(20 * 10) //Still invasive. target.op_stage.brainstem = 3 /datum/surgery_step/brainstem/clean_chips/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -129,7 +129,7 @@ user.visible_message("[user]'s hand slips, gouging [target]'s brainstem with \the [tool]!" , \ "Your hand slips, gouging [target]'s brainstem with \the [tool]!" ) /*affected.create_wound(CUT, 5) - target.AdjustUnconscious(10) + target.adjust_unconscious(20 * 10) spawn() for(var/obj/item/organ/internal/brain/O in affected.internal_organs) //If there's more than one... O.take_damage(rand(1,10))*/ @@ -161,7 +161,7 @@ user.visible_message("[user] has fused [target]'s spinal cord with \the [tool]." , \ " You have fused [target]'s spinal cord with \the [tool].",) target.op_stage.brainstem = 4 - target.AdjustUnconscious(5) + target.adjust_unconscious(20 * 5) target.add_modifier(/datum/modifier/franken_sickness, 20 MINUTES) /datum/surgery_step/brainstem/mend_cord/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -169,7 +169,7 @@ user.visible_message("[user]'s hand slips, tearing at [target]'s spinal cord with \the [tool]!" , \ "Your hand slips, tearing at [target]'s spinal cord with \the [tool]!" ) affected.create_wound(PIERCE, 5) - target.AdjustUnconscious(20) + target.adjust_unconscious(20 * 20) spawn() for(var/obj/item/organ/internal/brain/O in affected.internal_organs) O.take_damage(rand(5,15)) //Down to the wire. Or rather, the cord. @@ -207,7 +207,7 @@ user.visible_message("[user]'s hand slips, tearing at [target]'s spinal cord with \the [tool]!" , \ "Your hand slips, tearing at [target]'s spinal cord with \the [tool]!" ) affected.create_wound(PIERCE, 5) - target.AdjustUnconscious(15) + target.adjust_unconscious(20 * 15) spawn() for(var/obj/item/organ/internal/brain/O in affected.internal_organs) O.take_damage(rand(1,10)) @@ -239,7 +239,7 @@ /datum/surgery_step/brainstem/realign_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] has realigned the tissues in [target]'s skull back into place with \the [tool]." , \ " You have realigned the tissues in [target]'s skull back into place with \the [tool].",) - target.AdjustUnconscious(5) //I n v a s i v e + target.adjust_unconscious(20 * 5) //I n v a s i v e target.op_stage.brainstem = 0 //The cycle begins anew. /datum/surgery_step/brainstem/realign_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -247,7 +247,7 @@ user.visible_message("[user]'s hand slips, gouging [target]'s brainstem with \the [tool]!" , \ "Your hand slips, gouging [target]'s brainstem with \the [tool]!" ) affected.create_wound(CUT, 5) - target.AdjustUnconscious(30) + target.adjust_unconscious(20 * 30) spawn() for(var/obj/item/organ/internal/brain/O in affected.internal_organs) O.take_damage(rand(1,10)) diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 53b9971db6e..fde970bd70b 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -341,7 +341,6 @@ "You finish recreating the missing biological structures and filling in gaps in [target]'s flesh with \the [tool].") target.op_stage.dehusk = 0 target.mutations.Remove(MUTATION_HUSK) - target.status_flags &= ~DISFIGURED target.update_icons_body() ..() diff --git a/code/modules/tables/interactions.dm b/code/modules/tables/interactions.dm index e4f23aba7a5..a75c5e731dc 100644 --- a/code/modules/tables/interactions.dm +++ b/code/modules/tables/interactions.dm @@ -69,7 +69,7 @@ return if (G.state < 2) if(user.a_intent == INTENT_HARM) - if (prob(15)) M.Weaken(5) + if (prob(15)) M.afflict_paralyze(20 * 5) M.apply_damage(8,def_zone = BP_HEAD) visible_message("[G.assailant] slams [G.affecting]'s face against \the [src]!") if(material) @@ -90,7 +90,7 @@ return else if(G.state > GRAB_AGGRESSIVE || world.time >= (G.last_action + UPGRADE_COOLDOWN)) M.forceMove(get_turf(src)) - M.Weaken(5) + M.afflict_paralyze(20 * 5) visible_message("[G.assailant] puts [G.affecting] on \the [src].") qdel(W) return diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm index f0ff260d962..7d927e799fc 100644 --- a/code/modules/tgui/states.dm +++ b/code/modules/tgui/states.dm @@ -74,7 +74,7 @@ /* /mob/living/shared_ui_interaction(src_object) . = ..() - if(!(mobility_flags & MOBILITY_UI) && . == UI_INTERACTIVE) + if(!(mobility_flags & MOBILITY_CAN_UI) && . == UI_INTERACTIVE) return UI_UPDATE */ diff --git a/code/modules/tgui/states/not_incapacitated.dm b/code/modules/tgui/states/not_incapacitated.dm index a7afb65d91d..984c5d40590 100644 --- a/code/modules/tgui/states/not_incapacitated.dm +++ b/code/modules/tgui/states/not_incapacitated.dm @@ -31,8 +31,6 @@ GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/ui_state/not_incapacitate return UI_CLOSE if(user.incapacitated() || (turf_check && !isturf(user.loc))) return UI_DISABLED - if(isliving(user)) - var/mob/living/L = user - if(!(L.canmove)) - return UI_DISABLED + if(!CHECK_MOBILITY(user, MOBILITY_CAN_UI)) + return UI_DISABLED return UI_INTERACTIVE diff --git a/code/modules/vehicles/sealed.dm b/code/modules/vehicles/sealed.dm index 72716bf0f2f..51b92294bdb 100644 --- a/code/modules/vehicles/sealed.dm +++ b/code/modules/vehicles/sealed.dm @@ -28,7 +28,7 @@ return FALSE if(occupant_amount() >= max_occupants) return FALSE - if(do_after(M, get_enter_delay(M), FALSE, src, TRUE)) + if(do_after(M, get_enter_delay(M), src, FALSE, TRUE)) mob_enter(M) return TRUE return FALSE @@ -101,7 +101,7 @@ mob_exit(i, null, randomstep) if(iscarbon(i)) var/mob/living/carbon/Carbon = i - Carbon.DefaultCombatKnockdown(40) + Carbon.default_combat_knockdown(40) /obj/vehicle/sealed/proc/DumpSpecificMobs(flag, randomstep = TRUE) for(var/i in occupants) @@ -109,7 +109,7 @@ mob_exit(i, null, randomstep) if(iscarbon(i)) var/mob/living/carbon/C = i - C.DefaultCombatKnockdown(40) + C.default_combat_knockdown(40) /obj/vehicle/sealed/AllowDrop() return FALSE diff --git a/code/modules/vehicles_legacy/skateboard.dm b/code/modules/vehicles_legacy/skateboard.dm index a2671d0d2ec..d454378fb83 100644 --- a/code/modules/vehicles_legacy/skateboard.dm +++ b/code/modules/vehicles_legacy/skateboard.dm @@ -90,9 +90,9 @@ var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.setBrainLoss(2,5) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") - H.Weaken(12) + H.afflict_paralyze(20 * 12) else if (rough_terrain) var/list/throw_dirs = list(1, 2, 4, 8, 5, 6, 9, 10) var/turf/T2 = get_step(A, pick(throw_dirs)) @@ -101,9 +101,9 @@ var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.setBrainLoss(2,5) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") - H.Weaken(12) + H.afflict_paralyze(20 * 12) else var/backdir = turn(dir, 180) Move(get_step(src, backdir)) @@ -131,7 +131,7 @@ var/atom/throw_target = get_edge_target_turf(src) L.throw_at_old(throw_target, 2, 2) visible_message("[L] loses their footing and slams on the ground!") - L.Weaken(40) + L.afflict_paralyze(20 * 40) grinding = FALSE icon_state = board_icon return @@ -235,9 +235,9 @@ var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.setBrainLoss(2,5) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") - H.Weaken(12) + H.afflict_paralyze(20 * 12) else if (rough_terrain || prob(70)) var/list/throw_dirs = list(1, 2, 4, 8, 5, 6, 9, 10) var/turf/T2 = get_step(A, pick(throw_dirs)) @@ -246,9 +246,9 @@ var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.setBrainLoss(2,5) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") - H.Weaken(12) + H.afflict_paralyze(20 * 12) else var/backdir = turn(dir, 180) Move(backdir) @@ -296,9 +296,9 @@ var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.setBrainLoss(2,5) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") - H.Weaken(12) + H.afflict_paralyze(20 * 12) else var/backdir = turn(dir, 180) Move(get_step(src, backdir)) @@ -325,9 +325,9 @@ var/head_slot = SLOT_HEAD if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.setBrainLoss(2,5) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") - H.Weaken(12) + H.afflict_paralyze(20 * 12) else var/backdir = turn(dir, 180) Move(get_step(src, backdir)) @@ -616,12 +616,12 @@ var/atom/throw_target = get_edge_target_turf(H, pick(GLOB.cardinals)) unbuckle_mob(H) H.throw_at_old(throw_target, 4, 3) - H.DefaultCombatKnockdown(30) + H.default_combat_knockdown(30) H.adjustStaminaLoss(30) var/head_slot = H.get_item_by_slot(SLOT_HEAD) if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) - H.updatehealth() + H.update_health() visible_message("[src] crashes into [A], sending [H] flying!") playsound(src, 'sound/effects/bang.ogg', 50, 1) */ diff --git a/code/modules/vehicles_legacy/train.dm b/code/modules/vehicles_legacy/train.dm index ec1751315b7..3fdbe536aed 100644 --- a/code/modules/vehicles_legacy/train.dm +++ b/code/modules/vehicles_legacy/train.dm @@ -106,7 +106,7 @@ return 1 /obj/vehicle_old/train/MouseDroppedOnLegacy(var/atom/movable/C, mob/user as mob) - if(user.buckled || user.stat || user.restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !user.canmove)) + if(user.buckled || user.stat || user.restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !CHECK_MOBILITY(user, MOBILITY_CAN_MOVE))) return if(istype(C,/obj/vehicle_old/train)) latch(C, user) @@ -138,7 +138,7 @@ if(!istype(usr, /mob/living/carbon/human)) return - if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr)) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE) || !Adjacent(usr)) return unattach(usr) diff --git a/code/modules/ventcrawl/ventcrawl.dm b/code/modules/ventcrawl/ventcrawl.dm index 459f52d8827..82f17e817c2 100644 --- a/code/modules/ventcrawl/ventcrawl.dm +++ b/code/modules/ventcrawl/ventcrawl.dm @@ -96,7 +96,7 @@ var/list/ventcrawl_machinery = list( pipe = pipes[1] else pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes - if(canmove && pipe) + if(CHECK_MOBILITY(src, MOBILITY_CAN_MOVE) && pipe) return pipe /mob/living/carbon/alien/ventcrawl_carry() diff --git a/code/modules/ventcrawl/ventcrawl_atmospherics.dm b/code/modules/ventcrawl/ventcrawl_atmospherics.dm index 59c443e9904..7c6a6b3619a 100644 --- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm +++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm @@ -53,9 +53,6 @@ user.forceMove(loc) user.update_perspective() user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.") - user.canmove = 0 - spawn(1) - user.canmove = 1 /obj/machinery/atmospherics/proc/can_crawl_through() return 1 diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 3d75785e686..3b0d1af1ae6 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -529,7 +529,7 @@ to_chat(R,"You attempt to climb out of \the [lowertext(name)]. (This will take around [escapetime/10] seconds.)") to_chat(owner,"Someone is attempting to climb out of your [lowertext(name)]!") - if(do_after(R, escapetime, owner, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED)) + if(do_after(R, escapetime, owner, mobility_flags = MOBILITY_CAN_RESIST)) if((owner.stat || escapable) && (R.loc == src)) //Can still escape? release_specific_contents(R) return diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index 24ef3e29501..17312e6a965 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -99,7 +99,7 @@ touchable_mobs += L if(L.absorbed) - L.Weaken(5) + L.afflict_paralyze(20 * 5) //Handle 'human' if(ishuman(L)) diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index bb774fb9cf2..881c3eb8cc6 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -181,21 +181,6 @@ return FALSE -// -// Our custom resist catches for /mob/living -// -/mob/living/proc/vore_process_resist() - - //Are we resisting from inside a belly? - if(isbelly(loc)) - var/obj/belly/B = loc - B.relay_resist(src) - return TRUE //resist() on living does this TRUE thing. - - //Other overridden resists go here - - return FALSE - // // Verb for saving vore preferences to save file // @@ -396,7 +381,6 @@ return smell_message - // // OOC Escape code for pref-breaking or AFK preds // diff --git a/code/modules/vore/eating/silicon_vr.dm b/code/modules/vore/eating/silicon_vr.dm index d17a2d4ca15..4f3f5fdc131 100644 --- a/code/modules/vore/eating/silicon_vr.dm +++ b/code/modules/vore/eating/silicon_vr.dm @@ -26,7 +26,7 @@ hologram.visible_message("[hologram] starts forming around [prey]!") to_chat(src, SPAN_NOTICE("You begin forming hardlight holograms around [prey].")) - if(!do_after(eyeobj, 50, prey, needhand = FALSE)) + if(!do_after(eyeobj, 50, prey, DO_AFTER_IGNORE_ACTIVE_ITEM )) return if(!hologram || hologram.vored) diff --git a/code/modules/vore/eating/simple_animal_vr.dm b/code/modules/vore/eating/simple_animal_vr.dm index f11125cb800..354555af9b3 100644 --- a/code/modules/vore/eating/simple_animal_vr.dm +++ b/code/modules/vore/eating/simple_animal_vr.dm @@ -74,7 +74,7 @@ /mob/living/simple_mob/attackby(var/obj/item/O, var/mob/user) if (istype(O, /obj/item/newspaper) && !(ckey || (ai_holder.hostile && faction != user.faction)) && isturf(user.loc)) if (ai_holder.retaliate && prob(vore_pounce_chance/2)) // This is a gamble! - user.Weaken(5) //They get tackled anyway whether they're edible or not. + user.afflict_paralyze(20 * 5) //They get tackled anyway whether they're edible or not. user.visible_message("\the [user] swats \the [src] with \the [O] and promptly gets tackled!!") if (will_eat(user)) set_AI_busy(TRUE) diff --git a/code/modules/vore/fluffstuff/custom_clothes.dm b/code/modules/vore/fluffstuff/custom_clothes.dm index 02d20e2668b..a3584e66896 100644 --- a/code/modules/vore/fluffstuff/custom_clothes.dm +++ b/code/modules/vore/fluffstuff/custom_clothes.dm @@ -443,7 +443,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.restrained()) + if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 switch(unbuttoned) diff --git a/code/modules/vore/fluffstuff/guns/pummeler.dm b/code/modules/vore/fluffstuff/guns/pummeler.dm index 20a4b871934..fd96bfc588b 100644 --- a/code/modules/vore/fluffstuff/guns/pummeler.dm +++ b/code/modules/vore/fluffstuff/guns/pummeler.dm @@ -41,7 +41,7 @@ var/mob/living/L = target var/throwdir = get_dir(firer,L) if(prob(40) && !blocked) - L.Stun(1) + L.afflict_stun(20 * 1) L.Confuse(1) L.throw_at_old(get_edge_target_turf(L, throwdir), rand(3,6), 10) diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index b4d20caea01..1ef224cb9ea 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -269,7 +269,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 return //They can't be stepping on anyone - if(!canmove || buckled) + if(!CHECK_MOBILITY(src, MOBILITY_CAN_MOVE)) return //Test/set if human diff --git a/code/modules/xenoarcheaology/effects/heal.dm b/code/modules/xenoarcheaology/effects/heal.dm index 6d2fb0985a4..4cd6acd9c21 100644 --- a/code/modules/xenoarcheaology/effects/heal.dm +++ b/code/modules/xenoarcheaology/effects/heal.dm @@ -46,7 +46,7 @@ C.adjustToxLoss(-1 * weakness) C.adjustOxyLoss(-1 * weakness) C.adjustBrainLoss(-1 * weakness) - C.updatehealth() + C.update_health() /datum/artifact_effect/heal/DoEffectPulse() //todo: check over this properly @@ -61,4 +61,4 @@ C.adjustToxLoss(-5 * weakness) C.adjustOxyLoss(-5 * weakness) C.adjustBrainLoss(-5 * weakness) - C.updatehealth() + C.update_health() diff --git a/code/modules/xenoarcheaology/effects/hurt.dm b/code/modules/xenoarcheaology/effects/hurt.dm index b1b169d1fde..cff65c266c7 100644 --- a/code/modules/xenoarcheaology/effects/hurt.dm +++ b/code/modules/xenoarcheaology/effects/hurt.dm @@ -17,7 +17,7 @@ C.apply_effect(25 * weakness, IRRADIATE) C.nutrition -= min(50 * weakness, C.nutrition) C.make_dizzy(6 * weakness) - C.weakened += 6 * weakness + C.afflict_paralyze(20 * weakness * 6) /datum/artifact_effect/hurt/DoEffectAura() if(holder) @@ -32,7 +32,7 @@ C.adjustToxLoss(1 * weakness) C.adjustOxyLoss(1 * weakness) C.adjustBrainLoss(0.1 * weakness) - C.updatehealth() + C.update_health() /datum/artifact_effect/hurt/DoEffectPulse() if(holder) @@ -46,4 +46,4 @@ C.adjustToxLoss(3 * weakness) C.adjustOxyLoss(3 * weakness) C.adjustBrainLoss(0.1 * weakness) - C.updatehealth() + C.update_health() diff --git a/code/modules/xenoarcheaology/effects/roboheal.dm b/code/modules/xenoarcheaology/effects/roboheal.dm index f5857b9cb76..be36462a8a8 100644 --- a/code/modules/xenoarcheaology/effects/roboheal.dm +++ b/code/modules/xenoarcheaology/effects/roboheal.dm @@ -24,7 +24,7 @@ last_message = world.time M.adjustBruteLoss(-1) M.adjustFireLoss(-1) - M.updatehealth() + M.update_health() return 1 /datum/artifact_effect/roboheal/DoEffectPulse() @@ -36,5 +36,5 @@ last_message = world.time M.adjustBruteLoss(-10) M.adjustFireLoss(-10) - M.updatehealth() + M.update_health() return 1 diff --git a/code/modules/xenoarcheaology/effects/robohurt.dm b/code/modules/xenoarcheaology/effects/robohurt.dm index 8ed47a9e281..5f2a7ae4519 100644 --- a/code/modules/xenoarcheaology/effects/robohurt.dm +++ b/code/modules/xenoarcheaology/effects/robohurt.dm @@ -24,7 +24,7 @@ last_message = world.time M.adjustBruteLoss(1) M.adjustFireLoss(1) - M.updatehealth() + M.update_health() return 1 /datum/artifact_effect/robohurt/DoEffectPulse() @@ -36,5 +36,5 @@ last_message = world.time M.adjustBruteLoss(10) M.adjustFireLoss(10) - M.updatehealth() + M.update_health() return 1 diff --git a/code/modules/xenoarcheaology/effects/stun.dm b/code/modules/xenoarcheaology/effects/stun.dm index ab00465477e..b56ae816f17 100644 --- a/code/modules/xenoarcheaology/effects/stun.dm +++ b/code/modules/xenoarcheaology/effects/stun.dm @@ -11,9 +11,9 @@ var/susceptibility = GetAnomalySusceptibility(C) if(prob(susceptibility * 100)) to_chat(C, "A powerful force overwhelms your consciousness.") - C.Weaken(rand(1,10) * susceptibility) + C.afflict_paralyze(20 * rand(1,10) * susceptibility) C.stuttering += 30 * susceptibility - C.Stun(rand(1,10) * susceptibility) + C.afflict_stun(20 * rand(1,10) * susceptibility) /datum/artifact_effect/stun/DoEffectAura() if(holder) @@ -22,10 +22,10 @@ var/susceptibility = GetAnomalySusceptibility(C) if(prob(10 * susceptibility)) to_chat(C, "Your body goes numb for a moment.") - C.Weaken(2) + C.afflict_paralyze(20 * 2) C.stuttering += 2 if(prob(10)) - C.Stun(1) + C.afflict_stun(20 * 1) else if(prob(10)) to_chat(C, "You feel numb.") @@ -36,7 +36,7 @@ var/susceptibility = GetAnomalySusceptibility(C) if(prob(100 * susceptibility)) to_chat(C, "A wave of energy overwhelms your senses!") - C.SetWeakened(4 * susceptibility) + C.set_paralyzed(20 * 4 * susceptibility) C.stuttering = 4 * susceptibility if(prob(10)) - C.SetStunned(1 * susceptibility) + C.set_stunned(20 * 1 * susceptibility) diff --git a/code/modules/xenoarcheaology/finds/special.dm b/code/modules/xenoarcheaology/finds/special.dm index d80c65af79e..8a62c8d1f39 100644 --- a/code/modules/xenoarcheaology/finds/special.dm +++ b/code/modules/xenoarcheaology/finds/special.dm @@ -189,7 +189,7 @@ 'sound/hallucinations/turn_around1.ogg',\ 'sound/hallucinations/turn_around2.ogg',\ ), 50, 1, -3) - M.Sleeping(rand(5, 10)) + M.afflict_sleeping(20 * rand(5, 10)) loc = null else STOP_PROCESSING(SSobj, src) diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index 734c3fbf0e9..489349dc9c6 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -21,7 +21,7 @@ var/turf/T = get_turf(suspension_field) for(var/mob/living/M in T) if(cell.use(power_use)) - M.Weaken(3) + M.afflict_paralyze(20 * 3) if(prob(5)) to_chat(M, SPAN_WARNING("[pick("You feel tingly","You feel like floating","It is hard to speak","You can barely move")].")) else @@ -138,7 +138,7 @@ var/collected = 0 for(var/mob/living/M in T) - M.Weaken(5) + M.afflict_paralyze(20 * 5) M.visible_message(SPAN_NOTICE("[icon2html(thing = src, target = world)] [M] begins to float in the air!"),"You feel tingly and light, but it is difficult to move.") suspension_field = new(T) @@ -165,7 +165,7 @@ for(var/mob/living/M in T) to_chat(M, SPAN_INFO("You no longer feel like floating.")) - M.Weaken(3) + M.afflict_paralyze(20 * 3) visible_message(SPAN_NOTICE("[icon2html(thing = src, target = world)] [src] deactivates with a gentle shudder.")) qdel(suspension_field) diff --git a/code/modules/xenobio/items/extracts.dm b/code/modules/xenobio/items/extracts.dm index 5b66e986519..6c9b752f87a 100644 --- a/code/modules/xenobio/items/extracts.dm +++ b/code/modules/xenobio/items/extracts.dm @@ -78,7 +78,7 @@ /datum/chemical_reaction/slime/grey_new_slime/on_reaction(var/datum/reagents/holder) holder.my_atom.visible_message("Infused with phoron, the core begins to quiver and grow, and soon a new baby slime emerges from it!") var/mob/living/simple_mob/slime/xenobio/S = new(get_turf(holder.my_atom)) - S.Weaken(10) + S.afflict_paralyze(20 * 10) ..() /datum/chemical_reaction/slime/grey_monkey diff --git a/code/modules/xenobio/items/weapons.dm b/code/modules/xenobio/items/weapons.dm index 06435ad14b4..24953384769 100644 --- a/code/modules/xenobio/items/weapons.dm +++ b/code/modules/xenobio/items/weapons.dm @@ -19,7 +19,7 @@ var/mob/living/simple_mob/slime/S = L S.slimebatoned(user, 5) // Feral and xenobio slimes will react differently to this. else - L.Weaken(5) + L.afflict_paralyze(20 * 5) // Now for prommies. if(ishuman(L)) @@ -99,7 +99,7 @@ var/mob/living/simple_mob/slime/S = L S.slimebatoned(firer, round(agony/2)) else - L.Weaken(round(agony/2)) + L.afflict_paralyze(20 * round(agony/2)) if(ishuman(L)) var/mob/living/carbon/human/H = L diff --git a/code/modules/xenobio/machinery/processor.dm b/code/modules/xenobio/machinery/processor.dm index d6408754606..4c5adff8951 100644 --- a/code/modules/xenobio/machinery/processor.dm +++ b/code/modules/xenobio/machinery/processor.dm @@ -61,7 +61,7 @@ set name = "Eject Processor" set src in oview(1) - if(usr.stat || !usr.canmove || usr.restrained()) + if(CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return empty() add_fingerprint(usr) diff --git a/icons/mob/status_indicators.dmi b/icons/mob/status_indicators.dmi deleted file mode 100644 index 64103b82ff4..00000000000 Binary files a/icons/mob/status_indicators.dmi and /dev/null differ diff --git a/icons/screen/atom_hud/status.dmi b/icons/screen/atom_hud/biology.dmi similarity index 100% rename from icons/screen/atom_hud/status.dmi rename to icons/screen/atom_hud/biology.dmi diff --git a/icons/screen/atom_hud/status_16x16.dmi b/icons/screen/atom_hud/status_16x16.dmi new file mode 100644 index 00000000000..58c66bf82f6 Binary files /dev/null and b/icons/screen/atom_hud/status_16x16.dmi differ diff --git a/icons/screen/atom_hud/status_16x16_oversized.dmi b/icons/screen/atom_hud/status_16x16_oversized.dmi new file mode 100644 index 00000000000..d50eddc8902 Binary files /dev/null and b/icons/screen/atom_hud/status_16x16_oversized.dmi differ diff --git a/sound/effects/footstep/crawl1.ogg b/sound/effects/footstep/crawl1.ogg new file mode 100644 index 00000000000..61a73a58d0c Binary files /dev/null and b/sound/effects/footstep/crawl1.ogg differ