Skip to content

Commit

Permalink
Heath System Rework (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert authored Jan 27, 2025
1 parent c238fe5 commit 0067ac0
Show file tree
Hide file tree
Showing 534 changed files with 7,543 additions and 5,907 deletions.
1 change: 1 addition & 0 deletions _maps/map_files/Deltastation/DeltaStation2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -69905,6 +69905,7 @@
},
/obj/effect/turf_decal/tile/neutral/fourcorners,
/obj/machinery/light/cold/directional/east,
/obj/structure/sign/eyechart/directional/east,
/turf/open/floor/iron,
/area/station/medical/treatment_center)
"qHt" = (
Expand Down
13 changes: 6 additions & 7 deletions _maps/map_files/IceBoxStation/IceBoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -13064,7 +13064,6 @@
/obj/structure/window/reinforced/spawner/directional/north{
layer = 2.9
},
/obj/item/radio/intercom/directional/west,
/obj/structure/disposalpipe/segment,
/turf/open/floor/iron/large,
/area/station/medical/medbay/aft)
Expand Down Expand Up @@ -48042,6 +48041,7 @@
/obj/effect/turf_decal/box/white{
color = "#52B4E9"
},
/obj/structure/sign/eyechart/directional/east,
/turf/open/floor/iron/dark/smooth_large,
/area/station/medical/treatment_center)
"ous" = (
Expand Down Expand Up @@ -57760,9 +57760,9 @@
},
/obj/effect/turf_decal/trimline/blue/filled/end,
/obj/structure/window/reinforced/spawner/directional/south,
/obj/structure/sign/warning/no_smoking/circle/directional/west,
/obj/structure/disposalpipe/segment,
/obj/machinery/light/directional/west,
/obj/item/radio/intercom/directional/west,
/turf/open/floor/iron/large,
/area/station/medical/medbay/aft)
"rjE" = (
Expand Down Expand Up @@ -66393,11 +66393,6 @@
"tOO" = (
/obj/structure/sign/warning/no_smoking/circle/directional/west,
/obj/machinery/light/directional/west,
/obj/machinery/camera{
c_tag = "Medbay Mid-South";
dir = 5;
network = list("ss13","medbay")
},
/obj/effect/turf_decal/trimline/blue/filled/line{
dir = 10
},
Expand All @@ -66407,6 +66402,10 @@
fax_name = "Medical";
name = "Medical Fax Machine"
},
/obj/machinery/camera/directional/west{
c_tag = "Medbay Mid-South";
network = list("ss13","medbay")
},
/turf/open/floor/iron/white,
/area/station/medical/medbay/aft)
"tOX" = (
Expand Down
8 changes: 5 additions & 3 deletions _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -14943,7 +14943,7 @@
network = list("ss13","medbay")
},
/obj/effect/turf_decal/tile/blue/fourcorners,
/obj/machinery/light_switch/directional/north,
/obj/machinery/airalarm/directional/north,
/turf/open/floor/iron/white,
/area/station/medical/cryo)
"dIj" = (
Expand Down Expand Up @@ -30781,6 +30781,7 @@
dir = 1
},
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/obj/machinery/light_switch/directional/south,
/turf/open/floor/iron/dark,
/area/station/medical/cryo)
"jJK" = (
Expand Down Expand Up @@ -36350,6 +36351,7 @@
pixel_y = 6
},
/obj/effect/turf_decal/tile/blue/fourcorners,
/obj/item/radio/intercom/directional/west,
/turf/open/floor/iron/white,
/area/station/medical/cryo)
"lVw" = (
Expand Down Expand Up @@ -42738,9 +42740,9 @@
"olq" = (
/obj/structure/cable,
/obj/structure/sink/directional/east,
/obj/machinery/airalarm/directional/west,
/obj/machinery/atmospherics/pipe/smart/manifold4w/cyan/visible,
/obj/effect/turf_decal/tile/blue/fourcorners,
/obj/structure/mirror/directional/west,
/turf/open/floor/iron/white,
/area/station/medical/cryo)
"olK" = (
Expand Down Expand Up @@ -55843,7 +55845,7 @@
dir = 10
},
/obj/structure/cable,
/obj/item/radio/intercom/directional/west,
/obj/structure/sign/eyechart/directional/west,
/turf/open/floor/iron/white,
/area/station/medical/cryo)
"tqn" = (
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/atmospherics/atmos_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#define T20C CELCIUS_TO_KELVIN(20 CELCIUS)
/// -14C - Temperature used for kitchen cold room, medical freezer, etc.
#define COLD_ROOM_TEMP CELCIUS_TO_KELVIN(-14 CELCIUS)
/// -60C - Temperature used for body preservation
#define BODY_PRESERVATION_TEMP CELCIUS_TO_KELVIN(-60 CELCIUS)

/**
*I feel the need to document what happens here. Basically this is used
Expand Down
7 changes: 2 additions & 5 deletions code/__DEFINES/atmospherics/atmos_mob_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
//The proportion of oxygen needed for metabolism compared to pluoxium. (Pluoxium is this many times efficient as oxygen)
#define PLUOXIUM_PROPORTION 8

//Defines for N2O and Healium euphoria moodlets
#define EUPHORIA_INACTIVE 0
#define EUPHORIA_ACTIVE 1
#define EUPHORIA_LAST_FLAG 2

#define MIASMA_CORPSE_MOLES 0.02
#define MIASMA_GIBS_MOLES 0.005

Expand Down Expand Up @@ -200,3 +195,5 @@

///Minimum temperature for items on fire
#define BURNING_ITEM_MINIMUM_TEMPERATURE (150+T0C)

#define SKIP_INTERNALS "skip_internals"
21 changes: 5 additions & 16 deletions code/__DEFINES/bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,13 @@

/// The max damage a limb can take before it stops taking damage.
/// Used by the max_damage var.
#define LIMB_MAX_HP_PROSTHESIS 20 //Used by surplus prosthesis limbs.
#define LIMB_MAX_HP_DEFAULT 50 //Used by most all limbs by default.
#define LIMB_MAX_HP_ADVANCED 75 //Used by advanced robotic limbs.
#define LIMB_MAX_HP_CORE 200 //Only use this for heads and torsos.
#define LIMB_MAX_HP_DEFAULT 150 //
#define LIMB_MAX_HP_CORE 600 //

/// Xenomorph Limbs
#define LIMB_MAX_HP_ALIEN_LARVA 50 //Used by the weird larva chest and head. Did you know they have those?
#define LIMB_MAX_HP_ALIEN_LIMBS 100 //Used by xenomorph limbs.
#define LIMB_MAX_HP_ALIEN_CORE 500 //Used by xenomorph chests and heads

/// Limb Body Damage Coefficient
/// A mutiplication of the burn and brute damage that the limb's stored damage contributes to its attached mob's overall wellbeing.
/// For instance, if a limb has 50 damage, and has a coefficient of 50%, the human is considered to have suffered 25 damage to their total health.

#define LIMB_BODY_DAMAGE_COEFFICIENT_ADVANCED 0.66 //Used by advanced robotic limbs.
#define LIMB_BODY_DAMAGE_COEFFICIENT_DEFAULT 0.75 //Used by all limbs by default.
#define LIMB_BODY_DAMAGE_COEFFICIENT_TOTAL 1 //Used by heads and torsos
#define LIMB_BODY_DAMAGE_COEFFICIENT_PROSTHESIS 1.5 //Used by surplus prosthesis limbs
#define LIMB_MAX_HP_ALIEN_LARVA 100 // 50 //Used by the weird larva chest and head. Did you know they have those?
#define LIMB_MAX_HP_ALIEN_LIMBS 300 // 100 //Used by xenomorph limbs.
#define LIMB_MAX_HP_ALIEN_CORE 1500 // 500 //Used by xenomorph chests and heads

// EMP
// Note most of these values are doubled on heavy EMP
Expand Down
38 changes: 2 additions & 36 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ DEFINE_BITFIELD(status_flags, list(
"GOD MODE" = GODMODE,
))

//Health Defines
#define HEALTH_THRESHOLD_CRIT 0
#define HEALTH_THRESHOLD_FULLCRIT -30
#define HEALTH_THRESHOLD_DEAD -100

#define HEALTH_THRESHOLD_NEARDEATH -90 //Not used mechanically, but to determine if someone is so close to death they hear the other side

//Actual combat defines

//click cooldowns, in tenths of a second, used for various combat actions
Expand Down Expand Up @@ -180,38 +173,11 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define UNARMED_MISS_CHANCE_MAX 80

//Combat object defines

//Embedded objects
///Chance for embedded objects to cause pain (damage user)
#define EMBEDDED_PAIN_CHANCE 15
///Chance for embedded object to fall out (causing pain but removing the object)
#define EMBEDDED_ITEM_FALLOUT 5
///Chance for an object to embed into somebody when thrown
#define EMBED_CHANCE 45
///Coefficient of multiplication for the damage the item does while embedded (this*item.w_class)
#define EMBEDDED_PAIN_MULTIPLIER 2
///Coefficient of multiplication for the damage the item does when it first embeds (this*item.w_class)
#define EMBEDDED_IMPACT_PAIN_MULTIPLIER 4
///The minimum value of an item's throw_speed for it to embed (Unless it has embedded_ignore_throwspeed_threshold set to 1)
/// The minimum value of an item's throw_speed for it to embed (Unless it has embedded_ignore_throwspeed_threshold set to 1)
#define EMBED_THROWSPEED_THRESHOLD 4
///Coefficient of multiplication for the damage the item does when it falls out or is removed without a surgery (this*item.w_class)
#define EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER 6
///A Time in ticks, total removal time = (this*item.w_class)
#define EMBEDDED_UNSAFE_REMOVAL_TIME 30
///Chance for embedded objects to cause pain every time they move (jostle)
#define EMBEDDED_JOSTLE_CHANCE 5
///Coefficient of multiplication for the damage the item does while
#define EMBEDDED_JOSTLE_PAIN_MULTIPLIER 1
///This percentage of all pain will be dealt as stam damage rather than brute (0-1)
#define EMBEDDED_PAIN_STAM_PCT 0.0
///For thrown weapons, every extra speed it's thrown at above its normal throwspeed will add this to the embed chance
/// For thrown embedding weapons, every extra speed it's thrown at above its normal throwspeed will add this to the embed chance
#define EMBED_CHANCE_SPEED_BONUS 10

#define EMBED_HARMLESS list("pain_mult" = 0, "jostle_pain_mult" = 0, "ignore_throwspeed_threshold" = TRUE)
#define EMBED_HARMLESS_SUPERIOR list("pain_mult" = 0, "jostle_pain_mult" = 0, "ignore_throwspeed_threshold" = TRUE, "embed_chance" = 100, "fall_chance" = 0.1)
#define EMBED_POINTY list("ignore_throwspeed_threshold" = TRUE)
#define EMBED_POINTY_SUPERIOR list("embed_chance" = 100, "ignore_throwspeed_threshold" = TRUE)

//Gun weapon weight
#define WEAPON_LIGHT 1
#define WEAPON_MEDIUM 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#define COMSIG_MOVABLE_BUCKLE "buckle"
///from base of atom/movable/unbuckle_mob(): (mob, force)
#define COMSIG_MOVABLE_UNBUCKLE "unbuckle"
///from /atom/movable/proc/buckle_mob(): (buckled_movable)
#define COMSIG_MOB_BUCKLED "mob_buckle"
///from /atom/movable/proc/unbuckle_mob(): (buckled_movable)
#define COMSIG_MOB_UNBUCKLED "mob_unbuckle"
///from /obj/vehicle/proc/driver_move, caught by the riding component to check and execute the driver trying to drive the vehicle
#define COMSIG_RIDDEN_DRIVER_MOVE "driver_move"
#define COMPONENT_DRIVER_BLOCK_MOVE (1<<0)
Expand Down
18 changes: 14 additions & 4 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@
#define COMSIG_CARBON_SANITY_UPDATE "carbon_sanity_update"
///Called when a carbon attempts to breath, before the breath has actually occured
#define COMSIG_CARBON_ATTEMPT_BREATHE "carbon_attempt_breathe"
// Prevents the breath
#define COMSIG_CARBON_BLOCK_BREATH (1 << 0)
///Called when a carbon breathes, before the breath has actually occured
#define COMSIG_CARBON_PRE_BREATHE "carbon_pre_breathe"
/// Prevents the breath entirely, which means they will neither suffocate nor regain oxyloss nor decay losebreath stacks
#define BREATHE_BLOCK_BREATH (1<<0)
/// Allow the breath but prevent inake, think losebreath
#define BREATHE_SKIP_BREATH (1<<1)
/// Called when a carbon breathes out (breath (the exhale))
#define COMSIG_CARBON_BREATH_EXHALE "carbon_breath_exhale"
/// Return if the exhale was handled, or I guess to send the exhale into the void
#define BREATHE_EXHALE_HANDLED (1<<0)
///Called when a carbon updates their mood
#define COMSIG_CARBON_MOOD_UPDATE "carbon_mood_update"
///Called when a carbon attempts to eat (eating)
Expand Down Expand Up @@ -154,6 +158,12 @@
/// Sent at the very end of human character setup
#define COMSIG_HUMAN_CHARACTER_SETUP "after_human_setup"

/// Carbon is steppin
#define COMSIG_CARBON_STEP "carbon_step"
/// Carbon is steppin on a painful limb
#define COMSIG_CARBON_PAINED_STEP "carbon_pain_step"
/// Stop the pain from happening
#define STOP_PAIN (1<<0)
/// from /datum/status_effect/limp/proc/check_step()
#define COMSIG_CARBON_LIMPING "mob_limp_check"
#define COMPONENT_CANCEL_LIMP (1<<0)
79 changes: 70 additions & 9 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,22 @@
/// Amount of pain gained (to chest) from surgically removed limb
#define PAIN_LIMB_REMOVED 30

/// Soft max pains for bodyparts, adds up to 500
#define PAIN_LIMB_MAX 70
#define PAIN_CHEST_MAX 120
#define PAIN_HEAD_MAX 100
// Defines for pain (and shock) gained by surgery
#define SURGERY_PAIN_TRIVIAL 6
#define SURGERY_PAIN_LOW 12
#define SURGERY_PAIN_MEDIUM 18
#define SURGERY_PAIN_HIGH 24
#define SURGERY_PAIN_SEVERE 36
#define SURGERY_PAIN_CRITICAL 48

/// Cap on shock level
#define MAX_TRAUMATIC_SHOCK 200

/// Checks if a mob can feel pain.
#define CAN_FEEL_PAIN(mob) (mob?.stat <= SOFT_CRIT && mob?.pain_controller?.pain_modifier > 0.33)

// Keys for pain modifiers
#define PAIN_MOD_CHEMS "chems"
#define PAIN_MOD_LYING "lying"
#define PAIN_MOD_NEAR_DEATH "near-death"
#define PAIN_MOD_KOD "ko-d"
#define PAIN_MOD_RECENT_SHOCK "recently-shocked"
Expand All @@ -58,15 +66,25 @@

/// If the mob enters shock, they will have +1 cure condition (helps cure it faster)
#define TRAIT_ABATES_SHOCK "shock_abated"
/// Pain effects, such as stuttering or feedback messages ("Everything hurts") are disabled.
#define TRAIT_NO_PAIN_EFFECTS "no_pain_effects"
/// Shock buildup does not increase, only decrease. No effect if already in shock (unlike abates_shock)
#define TRAIT_NO_SHOCK_BUILDUP "no_shock_buildup"
/// All this trait does is change your stat to soft crit, which itself doesn't do much,
/// but as your stat is changed many stat checks will block you (such as using the radio)
#define TRAIT_SOFT_CRIT "soft_crit"
/// Skip a breath once in every x breaths (where x is ticks between breaths)
#define TRAIT_LABOURED_BREATHING "laboured_breathing"
/// Blocks losebreath from accumulating from things such as heart attacks or choking
#define TRAIT_ASSISTED_BREATHING "assisted_breathing"
/// Stops organs from decaying while dead
#define TRAIT_NO_ORGAN_DECAY "no_organ_decay"
/// Don't get slowed down by aggro grabbing (or above)
#define TRAIT_NO_GRAB_SPEED_PENALTY "no_grab_speed_penalty"
/// Doesn't let a mob shift this atom around with move_pulled
#define TRAIT_NO_MOVE_PULL "no_move_pull"

/// Boosts the heart rate of the mob
#define TRAIT_HEART_RATE_BOOST "heart_rate_boost"
/// Slows the heart rate of the mob
#define TRAIT_HEART_RATE_SLOW "heart_rate_slow"

/// The trait that determines if someone has the robotic limb reattachment quirk.
#define TRAIT_ROBOTIC_LIMBATTACHMENT "trait_robotic_limbattachment"

Expand All @@ -77,10 +95,53 @@

#define COLOR_BLOOD "#c90000"

/// Checks if the value is "left"
/// Used primarily for hand or foot indexes
#define IS_RIGHT(value) (value % 2 == 0)
/// Checks if the value is "right"
/// Used primarily for hand or foot indexes
#define IS_LEFT(value) (value % 2 != 0)
/// Helper for picking between left or right when given a value
/// Used primarily for hand or foot indexes
#define SELECT_LEFT_OR_RIGHT(value, left, right) (IS_LEFT(value) ? left : right)

// Used in ready menu anominity
/// Hide ckey
#define CKEY_ANON (1<<0)
/// Hide character name
#define NAME_ANON (1<<1)
/// Hide top job preference
#define JOB_ANON (1<<2)

/// Calculates oxyloss cap
#define MAX_OXYLOSS(maxHealth) (maxHealth * 2)

// Some source defines for pain and consciousness
// Consciousness ones are human readable because of laziness (they are shown in cause of death)
#define PAINSHOCK "traumatic shock"
#define PAINCRIT "paincrit"
#define PAIN "pain"
#define HUNGER "starvation"
#define BRAIN_DAMAGE "brain damage"
#define BLOOD_LOSS "blood loss"
#define BLUNT_DAMAGE "blunt force trauma"
#define BURN_DAMAGE "severe burns"
#define OXY_DAMAGE "suffocation"
#define TOX_DAMAGE "toxic poisoning"

// For SShealth_updates
/// Call update_damage_hud()
#define UPDATE_SELF_DAMAGE (1 << 0)
/// Call update_health_hud()
#define UPDATE_SELF_HEALTH (1 << 1)
/// Call med_hud_set_health()
#define UPDATE_MEDHUD_HEALTH (1 << 2)
/// Call med_hud_set_status()
#define UPDATE_MEDHUD_STATUS (1 << 3)
/// Call update_conscisouness()
#define UPDATE_CON (1 << 4)

/// Updates the entire medhud
#define UPDATE_MEDHUD (UPDATE_MEDHUD_HEALTH | UPDATE_MEDHUD_STATUS)
/// Updates associated self-huds on the mob
#define UPDATE_SELF (UPDATE_SELF_DAMAGE | UPDATE_SELF_HEALTH)
Loading

0 comments on commit 0067ac0

Please sign in to comment.