Skip to content

Commit

Permalink
[MIRROR] organ scarring is correctly reported by body scanners (#2867)
Browse files Browse the repository at this point in the history
Co-authored-by: Spookerton <[email protected]>
Co-authored-by: Lexanx <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent 1d0cb45 commit ce0b6b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
34 changes: 15 additions & 19 deletions code/game/objects/items/devices/scanners/health.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,28 +303,24 @@
. = jointext(.,"<br>")
. = jointext(list(header,.),null)

// Calculates severity based on the ratios defined external limbs.
/proc/get_wound_severity(damage_ratio, can_heal_overkill = 0)
var/degree

// Calculates severity based on the ratios defined external limbs.
/proc/get_wound_severity(damage_ratio, can_heal_overkill)
switch(damage_ratio)
if(0 to 10)
degree = "minor"
if(10 to 25)
degree = "moderate"
if(25 to 50)
degree = "significant"
if(50 to 75)
degree = "severe"
if(75 to 99)
degree = "extreme"
else
if(can_heal_overkill)
degree = "critical"
else
degree = "irreparable"
if (0 to 10)
return "minor"
if (10 to 25)
return "moderate"
if (25 to 50)
return "significant"
if (50 to 75)
return "severe"
if (75 to 99)
return "extreme"
if (can_heal_overkill)
return "critical"
return "irreparable"

return degree

/obj/item/device/scanner/health/verb/toggle_mode()
set name = "Switch Verbosity"
Expand Down
3 changes: 2 additions & 1 deletion code/modules/organs/internal/_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
heal_damage(damage)

/obj/item/organ/internal/proc/get_scarring_level()
. = (initial(max_damage) - max_damage)/initial(max_damage)
var/initial_max = initial(max_damage)
return (initial_max - max_damage) * 100 / initial_max

/obj/item/organ/internal/get_scan_results(tag = FALSE)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/internal/brain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
heal_damage(damage)

/obj/item/organ/internal/brain/get_scarring_level()
. = (species.total_health - max_damage)/species.total_health
return (species.total_health - max_damage) * 100 / species.total_health

/obj/item/organ/internal/brain/get_mechanical_assisted_descriptor()
return "machine-interface [name]"

0 comments on commit ce0b6b8

Please sign in to comment.