[MIRROR] Proper MaxHealth checks and Crit Point (#10881)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-05-16 00:25:21 -07:00
committed by GitHub
parent 901dc552fc
commit 4ce45f8cc4
46 changed files with 92 additions and 94 deletions

View File

@@ -298,10 +298,10 @@
H.updatehealth()
if(H.isSynthetic())
if(H.health + H.getOxyLoss() + H.getToxLoss() <= CONFIG_GET(number/health_threshold_dead))
if(H.health + H.getOxyLoss() + H.getToxLoss() <= -(H.getMaxHealth()))
return "buzzes, \"Resuscitation failed - Severe damage detected. Begin damage restoration before further attempts.\""
else if(H.health + H.getOxyLoss() <= CONFIG_GET(number/health_threshold_dead)) //They need to be healed first.
else if(H.health + H.getOxyLoss() <= -(H.getMaxHealth())) //They need to be healed first.
return "buzzes, \"Resuscitation failed - Severe tissue damage detected. Repair of anatomical damage required.\""
else if(HUSK in H.mutations) //Husked! Need to fix their husk status first.
@@ -434,7 +434,7 @@
H.apply_damage(burn_damage_amt, BURN, BP_TORSO)
//set oxyloss so that the patient is just barely in crit, if possible
var/barely_in_crit = CONFIG_GET(number/health_threshold_crit) - 1
var/barely_in_crit = H.get_crit_point() - 1
var/adjust_health = barely_in_crit - H.health //need to increase health by this much
H.adjustOxyLoss(-adjust_health)