burn wounds, for real this time (#20542)

* burn wounds

* user feedback

* ready for review

* sean review

* Apply suggestions from code review

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* surgery fix

* other repair methods

* GDN review

* health scanner feedback

* Update code/game/objects/items/devices/scanners.dm

Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>

* bodyscanner print out

* Update code/game/machinery/adv_med.dm

---------

Co-authored-by: Farie82 <farie82@users.noreply.github.com>
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
This commit is contained in:
Charlie
2023-04-14 15:58:38 +02:00
committed by GitHub
co-authored by Farie82 Nathan Winters
parent 7293b7ecbd
commit e6085895c1
22 changed files with 107 additions and 47 deletions
+1 -1
View File
@@ -104,7 +104,7 @@
germ_level = 0
return
if(!owner)
if(!owner || ((status & ORGAN_BURNT) && !(status & ORGAN_SALVED)))
if(is_preserved())
return
// Maybe scale it down a bit, have it REALLY kick in once past the basic infection threshold
+23 -7
View File
@@ -146,6 +146,8 @@
if(HAS_TRAIT(owner, TRAIT_STURDY_LIMBS))
limb_flags |= CANNOT_DISMEMBER
if(HAS_TRAIT(owner, TRAIT_BURN_WOUND_IMMUNE))
limb_flags |= CANNOT_BURN
/obj/item/organ/external/replaced(mob/living/carbon/human/target)
owner = target
@@ -191,6 +193,8 @@
// See if bones need to break
check_fracture(brute)
// see if we need to inflict severe burns
check_for_burn_wound(burn)
// Threshold needed to have a chance of hurting internal bits with something sharp
#define LIMB_SHARP_THRESH_INT_DMG 5
// Threshold needed to have a chance of hurting internal bits
@@ -364,9 +368,6 @@ This function completely restores a damaged organ to perfect condition.
if(trace_chemicals[chemID] <= 0)
trace_chemicals.Remove(chemID)
if(!(status & ORGAN_BROKEN))
perma_injury = 0
if(..())
if(owner.germ_level > germ_level && infection_check())
//Open wounds can become infected
@@ -447,6 +448,12 @@ Note that amputating the affected organ does in fact remove the infection from t
if(damage > 15 && local_damage > 30 && prob(damage))
cause_internal_bleeding()
/obj/item/organ/external/proc/check_for_burn_wound(damage)
if(is_robotic())
return
if(burn_dam >= min_broken_damage && prob(damage * max(owner.bodytemperature / BODYTEMP_HEAT_DAMAGE_LIMIT, 1)))
cause_burn_wound()
// new damage icon system
// returns just the brute/burn damage code
/obj/item/organ/external/proc/damage_state_text()
@@ -657,7 +664,6 @@ Note that amputating the affected organ does in fact remove the infection from t
status |= ORGAN_BROKEN
broken_description = pick("broken", "fracture", "hairline fracture")
perma_injury = brute_dam
// Fractures have a chance of getting you out of restraints
if(prob(25))
@@ -672,7 +678,6 @@ Note that amputating the affected organ does in fact remove the infection from t
status &= ~ORGAN_BROKEN
status &= ~ORGAN_SPLINTED
perma_injury = 0
if(owner)
owner.handle_splints()
return TRUE
@@ -689,7 +694,18 @@ Note that amputating the affected organ does in fact remove the infection from t
if(is_robotic())
return
status &= ~ORGAN_INT_BLEEDING
perma_injury = 0
/obj/item/organ/external/proc/cause_burn_wound()
if(is_robotic() || (limb_flags & CANNOT_BURN) || (status & ORGAN_BURNT))
return
status |= ORGAN_BURNT
perma_injury = min_broken_damage
/obj/item/organ/external/proc/fix_burn_wound(update_health = TRUE)
status &= ~ORGAN_BURNT
perma_injury = max(perma_injury - min_broken_damage, 0)
if(update_health)
owner.updatehealth("burn wound")
/obj/item/organ/external/robotize(company, make_tough = FALSE, convert_all = TRUE)
..()
@@ -733,7 +749,7 @@ Note that amputating the affected organ does in fact remove the infection from t
status &= ~ORGAN_MUTATED
/obj/item/organ/external/proc/get_damage() //returns total damage
return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health?
return max(brute_dam + burn_dam, perma_injury)
/obj/item/organ/external/proc/has_infected_wound()
if(germ_level > INFECTION_LEVEL_ONE)