From 0841ffd17d131d5afa7ebaabba79e3ae8efa59e2 Mon Sep 17 00:00:00 2001 From: Afya212 <54920261+Afya212@users.noreply.github.com> Date: Sat, 28 Jan 2023 11:13:42 +0000 Subject: [PATCH] Ghosts can now scan IPCs/Robots (#15648) --- .../modules/mob/abstract/observer/observer.dm | 4 ++- .../mob/living/silicon/robot/analyzer.dm | 27 +++++++++++-------- html/changelogs/Afya-Ghostscanner.yml | 6 +++++ 3 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 html/changelogs/Afya-Ghostscanner.yml diff --git a/code/modules/mob/abstract/observer/observer.dm b/code/modules/mob/abstract/observer/observer.dm index 5338fdf3fed..4764c3ce9ce 100644 --- a/code/modules/mob/abstract/observer/observer.dm +++ b/code/modules/mob/abstract/observer/observer.dm @@ -337,7 +337,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, SPAN_WARNING("You aren't following anything!")) return - if(ishuman(following)) + if(isipc(following) || isrobot(following)) + robotic_analyze_mob(following, usr, TRUE) + else if(ishuman(following)) health_scan_mob(following, usr, TRUE, TRUE) else to_chat(src, SPAN_WARNING("This isn't a scannable target.")) diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm index 0a6c13083ae..0e5716088a8 100644 --- a/code/modules/mob/living/silicon/robot/analyzer.dm +++ b/code/modules/mob/living/silicon/robot/analyzer.dm @@ -16,15 +16,22 @@ matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 200) /obj/item/device/robotanalyzer/attack(mob/living/M, mob/living/user) - if((user.is_clumsy() || HAS_FLAG(user.mutations, DUMB)) && prob(50)) - to_chat(user, SPAN_WARNING("You try to analyze the floor's vitals!")) - visible_message(SPAN_WARNING("\The [user] has analyzed the floor's vitals!")) - to_chat(user, SPAN_NOTICE("Analyzing Results for The floor:")) - to_chat(user, SPAN_NOTICE("Overall Status: Healthy")) - to_chat(user, SPAN_NOTICE("Damage Specifics: [0]-[0]-[0]-[0]")) - to_chat(user, SPAN_NOTICE("Key: Suffocation/Toxin/Burns/Brute")) - to_chat(user, SPAN_NOTICE("Body Temperature: ???")) - return + robotic_analyze_mob(M, user) + add_fingerprint(user) + + +/proc/robotic_analyze_mob (var/mob/living/M, var/mob/living/user, var/just_scan = FALSE) + if(!just_scan) + if((user.is_clumsy() || HAS_FLAG(user.mutations, DUMB)) && prob(50)) + to_chat(user, SPAN_WARNING("You try to analyze the floor's vitals!")) + user.visible_message(SPAN_WARNING("\The [user] has analyzed the floor's vitals!")) + to_chat(user, SPAN_NOTICE("Analyzing Results for The floor:")) + to_chat(user, SPAN_NOTICE("Overall Status: Healthy")) + to_chat(user, SPAN_NOTICE("Damage Specifics: [0]-[0]-[0]-[0]")) + to_chat(user, SPAN_NOTICE("Key: Suffocation/Toxin/Burns/Brute")) + to_chat(user, SPAN_NOTICE("Body Temperature: ???")) + return + user.visible_message(SPAN_NOTICE("\The [user] has analyzed \the [M]'s components."), SPAN_NOTICE("You have analyzed \the [M]'s components.")) var/scan_type if(istype(M, /mob/living/silicon/robot)) @@ -35,7 +42,6 @@ to_chat(user, SPAN_WARNING("You can't analyze non-robotic things!")) return - user.visible_message(SPAN_NOTICE("\The [user] has analyzed \the [M]'s components."), SPAN_NOTICE("You have analyzed \the [M]'s components.")) switch(scan_type) if("robot") var/BU = M.getFireLoss() > 50 ? "[M.getFireLoss()]" : M.getFireLoss() @@ -101,7 +107,6 @@ if(!organ_found) to_chat(user, SPAN_NOTICE("No prosthetics located.")) - add_fingerprint(user) /obj/item/device/robotanalyzer/augment name = "retractable cyborg analyzer" diff --git a/html/changelogs/Afya-Ghostscanner.yml b/html/changelogs/Afya-Ghostscanner.yml new file mode 100644 index 00000000000..2bdbd2e5d11 --- /dev/null +++ b/html/changelogs/Afya-Ghostscanner.yml @@ -0,0 +1,6 @@ +author: Afya + +delete-after: True + +changes: + - rscadd: "Ghost can now medscan IPCs/Robots." \ No newline at end of file