From aab87dff3c94e38cecb78603c506aa3476a0a8e9 Mon Sep 17 00:00:00 2001
From: Divulf <134484326+Divulf@users.noreply.github.com>
Date: Fri, 28 Jul 2023 02:56:06 +1200
Subject: [PATCH] Allows simple mobs to be scanned by health analyzers.
(#21802)
* Allows simple mobs to be scanned by health analyzers.
* Better math.
---
code/__DEFINES/is_helpers.dm | 2 ++
code/game/objects/items/devices/scanners.dm | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm
index b9b163662dd..b43627a25cd 100644
--- a/code/__DEFINES/is_helpers.dm
+++ b/code/__DEFINES/is_helpers.dm
@@ -26,6 +26,8 @@
// Simple animals
+#define issimple_animal(A) (istype(A, /mob/living/simple_animal))
+
#define ismegafauna(A) istype(A, /mob/living/simple_animal/hostile/megafauna)
#define isshade(A) (istype(A, /mob/living/simple_animal/shade))
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index a89a93709e5..ac26474b09a 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -118,6 +118,13 @@ REAGENT SCANNER
// Used by the PDA medical scanner too
/proc/healthscan(mob/user, mob/living/M, mode = 1, advanced = FALSE)
+ if(issimple_animal(M))
+ if(M.stat == DEAD)
+ to_chat(user, "Analyzing Results for [M]:\n\t Overall Status: Dead")
+ else
+ to_chat(user, "Analyzing Results for [M]:\n\t Overall Status: [round(M.health / M.maxHealth * 100, 0.1)]% Healthy")
+ to_chat(user, "\t Damage Specifics: [M.maxHealth - M.health]")
+ return
if(!ishuman(M) || ismachineperson(M))
//these sensors are designed for organic life
to_chat(user, "Analyzing Results for ERROR:\n\t Overall Status: ERROR")