Skip to content

Commit

Permalink
Body scan implant tweak (Aurorastation#19259)
Browse files Browse the repository at this point in the history
Body scan now respects the known/hidden setting in the implant.
Body scan now reports how many unknown implanted things are present in
an organ.
  • Loading branch information
FluffyGhoster authored Jun 1, 2024
1 parent 861d3e9 commit 2b6ad6a
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 24 deletions.
68 changes: 44 additions & 24 deletions code/game/machinery/body_scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@
icon = 'icons/obj/sleeper.dmi'
icon_state = "body_scannerconsole"
var/obj/machinery/bodyscanner/connected
var/known_implants = list(/obj/item/implant/chem, /obj/item/implant/death_alarm, /obj/item/implant/mindshield, /obj/item/implant/tracking, /obj/item/implant/integrated_circuit)
var/collapse_desc = ""
var/broken_desc = ""
var/has_internal_injuries = FALSE
Expand Down Expand Up @@ -512,7 +511,7 @@
/obj/machinery/body_scanconsole/proc/get_external_wound_data(var/mob/living/carbon/human/H)
// Limbs.
var/organs = list()
for (var/obj/item/organ/external/O in H.organs)
for(var/obj/item/organ/external/O in H.organs)
var/list/data = list()
data["name"] = capitalize_first_letters(O.name)
var/burn_damage = get_severity(O.burn_dam, TRUE)
Expand All @@ -522,47 +521,68 @@

var/list/wounds = list()

if (O.status & ORGAN_ROBOT)
if(O.status & ORGAN_ROBOT)
wounds += "inorganic"
if (O.status & ORGAN_ARTERY_CUT)
if(O.status & ORGAN_ARTERY_CUT)
wounds += "severed [O.artery_name]"
if (O.tendon_status() & TENDON_CUT)
if(O.tendon_status() & TENDON_CUT)
wounds += "severed [O.tendon.name]"
if (O.status & ORGAN_SPLINTED)
if(O.status & ORGAN_SPLINTED)
wounds += "splinted"
if (O.status & ORGAN_BLEEDING)
if(O.status & ORGAN_BLEEDING)
wounds += "bleeding"
if(ORGAN_IS_DISLOCATED(O))
wounds += "dislocated"
if (O.status & ORGAN_BROKEN)
if(O.status & ORGAN_BROKEN)
wounds += "[O.broken_description]"
if (O.open)
if(O.open)
wounds += "open"

var/list/infection = list()
if (O.germ_level)
if(O.germ_level)
var/level = get_infection_level(O.germ_level)
if (level && level != "")
infection += "[level]"
if (O.rejecting)
if(O.rejecting)
infection += "rejection"

if (O.implants.len)
if(length(O.implants))
var/unk = 0
var/list/organic = list()
for (var/atom/movable/I in O.implants)
if(is_type_in_list(I, known_implants))
wounds += "[I.name] installed"
else if(istype(I, /obj/effect/spider))
organic += I
else
if(!istype(I, /obj/item/implant/uplink))

for(var/atom/movable/object_in_organ in O.implants)
//Handle actual implants
if(istype(object_in_organ, /obj/item/implant))
var/obj/item/implant/implant_in_organ = object_in_organ
//If the implant is hidden, skip it, no report in the scan
if(implant_in_organ.hidden)
continue

//If it's a known implant, report it with its full name
if(implant_in_organ.known)
wounds += "[implant_in_organ.name] installed"
//Otherwise, just let the player know there's something unknown there and call it a day
else
unk += 1
if (unk)
wounds += "unknown objects present"
var/friends = length(organic)
if(friends)
wounds += friends > 1 ? "multiple abnormal organic bodies" : "abnormal organic body"

//We did our job with implants, continue
continue

//Ok, implants fucked off above thanks to the continue, handle gremorian eggs now, they report as organics
//and whatever else is present, is unknown
if(istype(object_in_organ, /obj/effect/spider))
organic += object_in_organ
else
unk += 1

//If we found unknown objects, report them as such
if(unk)
wounds += "[unk] unknown object(s) present"

//If we found organic things present, report them as one or many
if(length(organic))
wounds += length(organic) > 1 ? "multiple abnormal organic bodies" : "abnormal organic body"


if(length(wounds) || brute_damage != "None" || burn_damage != "None")
has_external_injuries = TRUE
Expand Down
59 changes: 59 additions & 0 deletions html/changelogs/fluffyghost-scannerimplanttweaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: FluffyGhost

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Body scan now respects the known/hidden setting in the implant."
- rscadd: "Body scan now reports how many unknown implanted things are present in an organ."

0 comments on commit 2b6ad6a

Please sign in to comment.