Shock and Trauma adjustments & additions (#19583)

* Gets rid of trauma_mod

* Update life.dm

* Update life.dm

* Update life.dm

* Update positive.dm

* Apply suggestion from @Cameron-The-Raven
This commit is contained in:
Cameron Lennox
2026-07-11 05:05:33 -04:00
committed by GitHub
parent 2f7520d747
commit 69f538e892
8 changed files with 109 additions and 87 deletions
+2
View File
@@ -386,6 +386,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)
@@ -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
+69 -46
View File
@@ -1864,56 +1864,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&#44; 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&#44; 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&#44; 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)
@@ -1944,13 +1962,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]
@@ -1962,6 +1980,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
@@ -2006,7 +2028,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)
@@ -2021,7 +2044,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)
@@ -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
@@ -161,14 +161,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
@@ -431,6 +423,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."
@@ -311,15 +311,6 @@
custom_only = FALSE
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."
@@ -803,18 +794,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."
+18 -18
View File
@@ -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()
+1 -1
View File
@@ -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))