From 5886dd5dfa0b6d48d002acdc2b62e1dd5ec6cb0d Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Fri, 7 Nov 2025 20:11:29 -0500 Subject: [PATCH] Swaps species.total_health for getMaxHealth() (#18702) * Swaps species.total_health for getMaxHealth() * fix this as well shock_stage is what they want to increase, NOT traumatic val as it gets reeset as soon as we have a shock tick --- .../spells/insert/asphyxiation.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 48 +++++++++++++++++-- .../station/station_special_abilities.dm | 4 +- code/modules/mob/mob_grab_specials.dm | 2 +- code/modules/organs/organ_external.dm | 2 +- 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/code/game/gamemodes/technomancer/spells/insert/asphyxiation.dm b/code/game/gamemodes/technomancer/spells/insert/asphyxiation.dm index 850a91a9d5c..571f518f965 100644 --- a/code/game/gamemodes/technomancer/spells/insert/asphyxiation.dm +++ b/code/game/gamemodes/technomancer/spells/insert/asphyxiation.dm @@ -75,7 +75,7 @@ to fade to black..."))) //to_world("Predicted hardcrit.") return 1 - else if(predicted_damage >= victim.species.total_health / 2) // Or perhaps we're gonna go into 'oxy crit'. + else if(predicted_damage >= victim.getMaxHealth() / 2) // Or perhaps we're gonna go into 'oxy crit'. to_chat(victim, span_danger("You feel really light-headed, and everything seems to be fading...")) //to_world("Predicted oxycrit.") return 1 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 38843448bcf..d808821f898 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1247,7 +1247,7 @@ return 1 //UNCONSCIOUS. NO-ONE IS HOME - if((getOxyLoss() > (species.total_health/2)) || (health <= (get_crit_point() * species.crit_mod))) + if((getOxyLoss() > (getMaxHealth()/2)) || (health <= (get_crit_point() * species.crit_mod))) Paralyse(3) if(hallucination) @@ -1269,11 +1269,11 @@ if(oxyloss >= (getMaxHealth() * 0.3) && prob(5)) // If oxyloss exceeds 30% of your max health, you can take brain damage. adjustBrainLoss(brainOxPercent * oxyloss) - if(halloss >= species.total_health) + if(halloss >= getMaxHealth()) to_chat(src, span_notice("You're in too much pain to keep going...")) src.visible_message(span_infoplain(span_bold("[src]") + " slumps to the ground, too weak to continue fighting.")) Paralyse(10) - setHalLoss(species.total_health - 1) + setHalLoss(getMaxHealth() - 1) if(tiredness) //tiredness for vore drain tiredness = (tiredness - 1) @@ -1521,6 +1521,48 @@ else clear_fullscreen("fear") + if(healths) + if(chem_effects[CE_PAINKILLER] > 100) + healths.icon_state = "health_numb" + else + // Generate a by-limb health display. + var/mutable_appearance/healths_ma = new(healths) + healths_ma.icon_state = "blank" + healths_ma.overlays = null + healths_ma.plane = PLANE_PLAYER_HUD + + var/no_damage = 1 + var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators. + if(!(species.flags & NO_PAIN)) + trauma_val = max(traumatic_shock,halloss)/getMaxHealth() + var/limb_trauma_val = trauma_val*0.3 + // Collect and apply the images all at once to avoid appearance churn. + var/list/health_images = list() + for(var/obj/item/organ/external/E in organs) + if(no_damage && (E.brute_dam || E.burn_dam)) + no_damage = 0 + health_images += E.get_damage_hud_image(limb_trauma_val) + + // Apply a fire overlay if we're burning. + if(on_fire || get_hallucination_component()?.get_hud_state() == HUD_HALLUCINATION_ONFIRE) + health_images += image('icons/mob/OnFire.dmi',"[get_fire_icon_state()]") + + // Show a general pain/crit indicator if needed. + if(get_hallucination_component()?.get_hud_state() == HUD_HALLUCINATION_CRIT) + trauma_val = 2 + if(trauma_val) + if(!(species.flags & NO_PAIN)) + if(trauma_val > 0.7) + health_images += image('icons/mob/screen1_health.dmi',"softcrit") + if(trauma_val >= 1) + health_images += image('icons/mob/screen1_health.dmi',"hardcrit") + else if(no_damage) + health_images += image('icons/mob/screen1_health.dmi',"fullhealth") + + healths_ma.add_overlay(health_images) + healths.appearance = healths_ma + + var/fat_alert = /atom/movable/screen/alert/fat var/hungry_alert = /atom/movable/screen/alert/hungry var/starving_alert = /atom/movable/screen/alert/starving diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities.dm index 0bdeef108b8..d0b292d353e 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities.dm @@ -197,7 +197,7 @@ if(100) C.nutrition = (C.nutrition + T.nutrition) T.nutrition = 0 //Completely drained of everything. - var/damage_to_be_applied = T.species.total_health //Get their max health. + var/damage_to_be_applied = T.getMaxHealth() //Get their max health. T.apply_damage(damage_to_be_applied, HALLOSS) //Knock em out. C.absorbing_prey = FALSE to_chat(C, span_notice("You have completely drained [T], causing them to pass out.")) @@ -267,7 +267,7 @@ to_chat(T, span_danger("You feel completely drained as [src] finishes draining you and begins to move onto draining you lethally, but you are too strong for them to do so!")) nutrition = (nutrition + T.nutrition) T.nutrition = 0 //Completely drained of everything. - var/damage_to_be_applied = T.species.total_health //Get their max health. + var/damage_to_be_applied = T.getMaxHealth() //Get their max health. T.apply_damage(damage_to_be_applied, HALLOSS) //Knock em out. absorbing_prey = 0 //Clean this up before we return return diff --git a/code/modules/mob/mob_grab_specials.dm b/code/modules/mob/mob_grab_specials.dm index 6523559a6bb..94e679b8f27 100644 --- a/code/modules/mob/mob_grab_specials.dm +++ b/code/modules/mob/mob_grab_specials.dm @@ -58,7 +58,7 @@ if(armor < 60) to_chat(target, span_danger("You feel extreme pain!")) - var/max_halloss = round(target.species.total_health * 0.8) //up to 80% of passing out + var/max_halloss = round(target.getMaxHealth() * 0.8) //up to 80% of passing out affecting.adjustHalLoss(CLAMP(max_halloss - affecting.halloss, 0, 30)) /obj/item/grab/proc/attack_eye(mob/living/carbon/human/target, mob/living/carbon/human/attacker) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index ee55a340ec8..f73fb0b1b28 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -972,7 +972,7 @@ Note that amputating the affected organ does in fact remove the infection from t var/use_blood_colour = data.get_species_blood_colour(owner) removed(null, ignore_children) - victim?.traumatic_shock += 60 + victim?.shock_stage += 60 if(parent_organ) var/datum/wound/lost_limb/W = new (src, disintegrate, clean)