From 80a699826894408dd4b9780c495de7cf416dd4da Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:25:00 -0700 Subject: [PATCH] [MIRROR] Shock and Trauma adjustments & additions (#12893) Co-authored-by: Cameron Lennox --- code/modules/mob/living/carbon/carbon.dm | 2 + .../mob/living/carbon/human/human_movement.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 115 +++++++++++------- .../living/carbon/human/species/species.dm | 1 - .../human/species/station/traits/negative.dm | 16 +-- .../human/species/station/traits/positive.dm | 22 ++-- code/modules/mob/living/carbon/shock.dm | 36 +++--- code/modules/organs/pain.dm | 2 +- .../human/species/station/station_ch.dm | 1 - 9 files changed, 109 insertions(+), 88 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 64853af218..345d762743 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -387,6 +387,8 @@ return num2text(method ? temp : temp + rand(-10, 10)) if(PULSE_THREADY) return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread" + else //Anything too high just returns thready. + return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread" // output for machines^ ^^^^^^^output for people^^^^^^^^^ /mob/living/carbon/Bump(atom/A) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 364b5cc246..10b9fc8673 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -27,7 +27,7 @@ if(species.pain_mod) var/health_percent = ((health / getMaxHealth()) * 100) / species.pain_mod //Species pain sensitivity does not apply to painkillers, so we apply it before - var/hal_pain = getHalLoss() * species.pain_mod //trauma_mod is something entirely differently + var/hal_pain = getHalLoss() * species.pain_mod //var/hal_pain = can_feel_pain() ? (getHalLoss() * 2) * species.pain_mod : 0 //Variant for if you want pain immune people to not be affected by halloss slowdown. if((health_percent <= 60 || hal_pain >= 25) && !chem_effects[CE_NARCOTICS]) //Have taken 40% of our max health in damage OR we have >=25 halloss pain diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6aa75e29ee..c12956d396 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1877,56 +1877,74 @@ if(stat) return 0 - if(shock_stage == 10) - if(traumatic_shock >= 80) - custom_pain("[pick("It hurts so much", "You really need some painkillers", "Dear god, the pain")]!", 40) - - if(shock_stage >= 30) - if(shock_stage == 30 && !isbelly(loc)) - automatic_custom_emote(VISIBLE_MESSAGE, "is having trouble keeping their eyes open.", check_stat = TRUE) + //Passive effects. + if(shock_stage >= 30 || traumatic_shock > 120) //Either signifigantly in shock or SEVERELY injured. eye_blurry = max(2, eye_blurry) - if(traumatic_shock >= 80) - stuttering = max(stuttering, 5) + stuttering = max(5, stuttering) + //The various stages, sorted from most severe to least. + switch(shock_stage) + if(151 to INFINITY) + if(prob(10)) //Instead of perma-stunned on the ground, you have a chance to get back up. + if(!weakened && !lying) + automatic_custom_emote(VISIBLE_MESSAGE, "collapses!", check_stat = TRUE) + Weaken(5) + return - if(shock_stage == 40) - if(traumatic_shock >= 80) - to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) - - if (shock_stage >= 60) - if(shock_stage == 60 && !isbelly(loc)) - automatic_custom_emote(VISIBLE_MESSAGE, "'s body becomes limp.", check_stat = TRUE) - if (prob(2)) - if(traumatic_shock >= 80) - to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) - Weaken(20) - - if(shock_stage >= 80) - if (prob(5)) - if(traumatic_shock >= 80) - to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) - if(prob(20) && !isbelly(loc)) + if(150) + if(!isbelly(loc)) + automatic_custom_emote(VISIBLE_MESSAGE, "can no longer stand, collapsing!", check_stat = TRUE) + if(prob(60)) emote("pain") - Weaken(20) + Weaken(3) + return - if(shock_stage >= 120) - if (prob(2)) + if(120 to 149) + if(prob(2)) + if(traumatic_shock >= 80) + to_chat(src, span_danger("[pick("Your body freezes up", "You feel like you could die any moment now", "You fall over, your body refusing to respond")]!")) + if(prob(40) && !isbelly(loc)) + emote("pain") + Paralyse(5) + return + + if(80 to 119) + if(prob(5)) + if(traumatic_shock >= 80) + to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) + if(prob(20) && !isbelly(loc)) + emote("pain") + Weaken(3) + return + + if(60 to 79) + if(shock_stage == 60 && !isbelly(loc)) + automatic_custom_emote(VISIBLE_MESSAGE, "'s body becomes limp.", check_stat = TRUE) + if(prob(2)) + if(traumatic_shock >= 80) + to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) + Weaken(3) + return + + if(41 to 59) + return //A small reprieve. Inbetween compensated and decompensated shock. + + if(40) if(traumatic_shock >= 80) - to_chat(src, span_danger("[pick("You black out", "You feel like you could die any moment now", "You are about to lose consciousness")]!")) - if(prob(40) && !isbelly(loc)) - emote("pain") - Paralyse(5) - Sleeping(5) + to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) + return + + if(30 to 39) + if(shock_stage == 30 && !isbelly(loc)) + automatic_custom_emote(VISIBLE_MESSAGE, "is having trouble keeping their eyes open.", check_stat = TRUE) + return + + if(10) + if(traumatic_shock >= 80) + custom_pain("[pick("It hurts so much", "You really need some painkillers", "Dear god, the pain")]!", 40) + return - if(shock_stage == 150) - if(!isbelly(loc)) - automatic_custom_emote(VISIBLE_MESSAGE, "can no longer stand, collapsing!", check_stat = TRUE) - if(prob(60)) - emote("pain") - Weaken(20) - if(shock_stage >= 150) - Weaken(20) /mob/living/carbon/human/proc/handle_pulse() if(life_tick % 5) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load) @@ -1957,13 +1975,13 @@ temp = PULSE_NONE if(!isnull(modifier_set)) temp = modifier_set - return temp //No blood, no pulse. + return CLAMP(round(temp), 0, PULSE_THREADY) //No blood, no pulse. if(stat == DEAD) temp = PULSE_NONE if(!isnull(modifier_set)) temp = modifier_set - return temp //that's it, you're dead, nothing can influence your pulse, aside from outside means. + return CLAMP(round(temp), 0, PULSE_THREADY) //that's it, you're dead, nothing can influence your pulse, aside from outside means. var/obj/item/organ/internal/heart/Pump = internal_organs_by_name[O_HEART] @@ -1975,6 +1993,10 @@ if(brain_modifier <= 0.7 && brain_modifier >= 0.4) // 70%-40% control, things start going weird as the brain is failing. brain_modifier = rand(5, 15) / 10 + if(shock_stage > 60) //Fight or flight time. + if(temp < PULSE_2FAST) + temp = PULSE_2FAST + if(Pump) temp += Pump.standard_pulse_level - PULSE_NORM @@ -2019,7 +2041,8 @@ if(R.volume >= R.overdose) temp = PULSE_NONE break //No amount of medications is getting you out of this. - return temp * brain_modifier + return CLAMP(round(temp * brain_modifier), 0, PULSE_THREADY) + //handles different chems' influence on pulse for(var/datum/reagent/R in reagents.reagent_list) if(R.id in GLOB.bradycardics) @@ -2034,7 +2057,7 @@ if(R.volume >= R.overdose) temp = PULSE_NONE - return max(0, round(temp * brain_modifier)) + return CLAMP(round(temp * brain_modifier), 0, PULSE_THREADY) /mob/living/carbon/human/proc/handle_heartbeat() if(pulse == PULSE_NONE) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index bd561ba4e0..56a35b3f05 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -130,7 +130,6 @@ var/weaken_mod = 1 // Multiplier to weakness effects; 0.5 = half, - = no effect (immune), 2 = double, etc. // Stuns + Weakens will be rounded to the nearest whole #. If you set 0.5 mod, on a base stun of 3, the return will be 1.5, which rounds to 1. Be careful. var/spice_mod = 1 // Multiplier to spice/capsaicin/frostoil effects; 0.5 = half, 0 = no effect (immunity), 2 = double, etc. - var/trauma_mod = 1 // Affects traumatic shock (how fast pain crit happens). 0 = no effect (immunity to pain crit), 2 = double etc.Overriden by "can_feel_pain" var // set below is EMP interactivity for nonsynth carbons var/emp_sensitivity = 0 // bitflag. valid flags are: EMP_PAIN, EMP_BLIND, EMP_DEAFEN, EMP_CONFUSE, EMP_STUN, and EMP_(BRUTE/BURN/TOX/OXY)_DMG var/emp_dmg_mod = 1 // Multiplier to all EMP damage sustained by the mob, if it's EMP-sensitive diff --git a/code/modules/mob/living/carbon/human/species/station/traits/negative.dm b/code/modules/mob/living/carbon/human/species/station/traits/negative.dm index cb98a59aeb..756eb0bf96 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits/negative.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits/negative.dm @@ -162,14 +162,6 @@ primitive_expression_messages=list("staggers") excludes = list(/datum/trait/negative/lightweight_light, /datum/trait/positive/heavyweight) -/datum/trait/negative/neural_hypersensitivity - name = "Neural Hypersensitivity" - desc = "Your nerves are particularly sensitive to physical changes, leading to experiencing twice the intensity of pain and pleasure alike. Makes all pain effects twice as strong, and occur at half as much damage." - cost = -1 - var_changes = list("trauma_mod" = 2) - can_take = ORGANICS - custom_only = FALSE - /datum/trait/negative/breathes cost = -2 can_take = ORGANICS @@ -432,6 +424,14 @@ activation_message="You feel as though the airflow around you is painful..." primitive_expression_messages=list("bumps their toe, screaming in pain") +/datum/trait/negative/neural_hypersensitivity + name = "Neural Hypersensitivity" //Would rename this to 'Pain Intolerance, Extreme' but for savefile reasons, it stays this name. + desc = "You are frail and sensitive to pain. You experience 100% more pain from all sources." + cost = -5 + var_changes = list("pain_mod" = 2) + can_take = ORGANICS + custom_only = FALSE + /datum/trait/negative/sensitive_biochem name = "Sensitive Biochemistry, Minor" desc = "Your biochemistry is a little delicate, rendering you more susceptible to the negative effects of some chemicals. You'll probably want to list this in your medical records, and perhaps in your exploitable info as well. Chemical toxin damage and negative drug effects are 25% stronger on you. Additionally, knockout drugs work 25% faster on you." diff --git a/code/modules/mob/living/carbon/human/species/station/traits/positive.dm b/code/modules/mob/living/carbon/human/species/station/traits/positive.dm index a56665d0b9..12a02aff7b 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits/positive.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits/positive.dm @@ -325,15 +325,6 @@ varchange_type = TRAIT_VARCHANGE_MORE_BETTER */ -/datum/trait/positive/trauma_tolerance - name = "Grit" - desc = "You can keep going a little longer, a little harder when you get hurt, Injuries only inflict 85% as much pain, and slowdown from pain is 85% as effective." - cost = 2 - var_changes = list("trauma_mod" = 0.85) - excludes = list(/datum/trait/negative/neural_hypersensitivity) - can_take = ORGANICS - custom_only = FALSE - /datum/trait/positive/throw_resistance name = "Firm Body" desc = "Your body is firm enough that small thrown items can't do anything to you." @@ -817,18 +808,25 @@ /datum/trait/positive/pain_tolerance name = "Pain Tolerance" - desc = "You are noticeably more resistant to pain than most, and experience 20% less pain from all sources." + desc = "You are moderately more resistant to pain than most, and experience 20% less pain from all sources." cost = 2 custom_only = FALSE var_changes = list("pain_mod" = 0.8) /datum/trait/positive/pain_tolerance_advanced // High Pain Intolerance is 50% incoming pain, but this is 40% reduced incoming pain. name = "Pain Tolerance, Major" - desc = "You are extremely resistant to pain sources, and experience 40% less pain from all sources." - cost = 3 // Equivalent to High Pain Intolerance, but less pain resisted for balance reasons. + desc = "You are noticably resistant to pain sources, and experience 40% less pain from all sources." + cost = 3 custom_only = FALSE var_changes = list("pain_mod" = 0.6) +/datum/trait/positive/pain_tolerance_extreme // Essentialy the inverse of Neural Hypersensitivity + name = "Pain Tolerance, Extreme" + desc = "You are extremely resistant to pain sources, and experience 50% less pain from all sources." + cost = 4 + custom_only = FALSE + var_changes = list("pain_mod" = 0.50) + /datum/trait/positive/improved_biocompat name = "Improved Biocompatibility" desc = "Your body is naturally (or artificially) more receptive to healing chemicals without being vulnerable to the 'bad stuff'. You heal more efficiently from most chemicals, with no other drawbacks. Remember to note this down in your medical records! Chems heal for 20% more." diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index a7f3b4866b..0a50d41a28 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -4,19 +4,19 @@ // proc to find out in how much pain the mob is at the moment /mob/living/carbon/proc/updateshock() if (!can_feel_pain() && !synth_cosmetic_pain) - src.traumatic_shock = 0 + traumatic_shock = 0 return 0 - src.traumatic_shock = \ - 1 * src.getOxyLoss() + \ - 0.7 * src.getToxLoss() + \ - 1.2 * src.getShockFireLoss() + \ - 1.2 * src.getShockBruteLoss() + \ - 1.7 * src.getCloneLoss() + \ - 2 * src.halloss + traumatic_shock = \ + 1 * getOxyLoss() + \ + 0.7 * getToxLoss() + \ + 1.2 * getShockFireLoss() + \ + 1.2 * getShockBruteLoss() + \ + 1.7 * getCloneLoss() + \ + 2 * getHalLoss() - if(src.slurring) - src.traumatic_shock -= 20 + if(slurring) + traumatic_shock -= 20 // broken or ripped off organs will add quite a bit of pain if(ishuman(src)) @@ -25,21 +25,21 @@ if(!organ.organ_can_feel_pain()) continue if(organ.is_broken() || organ.open) - src.traumatic_shock += 30 + traumatic_shock += 30 else if(organ.is_dislocated()) - src.traumatic_shock += 15 + traumatic_shock += 15 - // Some individuals/species are more or less supectible to pain. Default trauma_mod = 1. Does not affect painkillers + // Some individuals/species are more or less supectible to pain. Default pain_mod = 1. Does not affect painkillers if(ishuman(src)) var/mob/living/carbon/human/H = src - H.traumatic_shock *= H.species.trauma_mod + H.traumatic_shock *= H.species.pain_mod - src.traumatic_shock += -1 * src.chem_effects[CE_PAINKILLER] + traumatic_shock += -1 * chem_effects[CE_PAINKILLER] - if(src.traumatic_shock < 0) - src.traumatic_shock = 0 + if(traumatic_shock < 0) + traumatic_shock = 0 - return src.traumatic_shock + return traumatic_shock /mob/living/carbon/proc/handle_shock() diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index e2df335ced..8b16bffca1 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -70,7 +70,7 @@ maxdam = dam if(ishuman(src)) var/mob/living/carbon/human/H = src - maxdam *= H.species.trauma_mod + maxdam *= H.species.pain_mod if(damaged_organ && chem_effects[CE_PAINKILLER] < maxdam) if(maxdam > 10 && paralysis) AdjustParalysis(-round(maxdam/10)) diff --git a/modular_chomp/code/modules/mob/living/carbon/human/species/station/station_ch.dm b/modular_chomp/code/modules/mob/living/carbon/human/species/station/station_ch.dm index 6be2872964..eee31c7e1e 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/species/station/station_ch.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/species/station/station_ch.dm @@ -65,7 +65,6 @@ total_health = 150 // Larger health pool. burn_mod = 2 // Fire does not mix well with their silicon carapace. toxins_mod = 0.5 // Resistant to toxins. - trauma_mod = 0.3 // Highly resistant to pain. pain_mod = 0.3 // Highly resistant to pain. rad_removal_mod = 1.5 // Radiation leaves the body much faster. chem_strength_heal = 0.1 // Acidic blood neutralizes most injected and ingested beneficial chemicals.