Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dionae
Browse files Browse the repository at this point in the history
  • Loading branch information
XeonMations committed Aug 4, 2024
2 parents ba29e92 + 9b605eb commit cd8115b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
13 changes: 7 additions & 6 deletions code/game/objects/items/devices/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ GENE SCANNER
healthy = FALSE
if(healthy)
message += "\t<span class='info'>Healthy.</span>"
else
message += "\t<span class='alert'>Subject does not have ears.</span>"
var/obj/item/organ/eyes/eyes = C.getorganslot(ORGAN_SLOT_EYES)
message += "\t<span class='info'><b>==EYE STATUS==</b></span>"
if(istype(eyes))
Expand All @@ -310,9 +308,6 @@ GENE SCANNER
healthy = FALSE
if(healthy)
message += "\t<span class='info'>Healthy.</span>"
else
message += "\t<span class='alert'>Subject does not have eyes.</span>"


// Body part damage report
if(iscarbon(M))
Expand Down Expand Up @@ -348,6 +343,7 @@ GENE SCANNER
var/minor_damage
var/major_damage
var/max_damage
var/list/missing_organ_list = list()
var/report_organs = FALSE

//Piece together the lists to be reported
Expand Down Expand Up @@ -377,7 +373,10 @@ GENE SCANNER
else
minor_damage = "\t<span class='info'>Mildly Damaged Organs: "
minor_damage += organ.name

for(var/obj/item/organ/each_organ as anything in H.dna.species.required_organs) //Start checking against the carbon mob, seeing if there is any organs missing.
if(isnull(H.getorgan(each_organ))) //Can we find the given organ in the mob?
missing_organ_list += initial(each_organ.name) //If not, add it to the list.
report_organs = TRUE
if(report_organs) //we either finish the list, or set it to be empty if no organs were reported in that category
if(!max_damage)
max_damage = "\t<span class='alert'>Non-Functional Organs: </span>"
Expand All @@ -394,6 +393,8 @@ GENE SCANNER
message += minor_damage
message += major_damage
message += max_damage
if(length(missing_organ_list)) //If we have missing organs, display them in a fancy list.
message += "\t<span class='alert'>Missing Organs: [english_list(missing_organ_list)]</span>"
//Genetic damage
if(advanced && H.has_dna())
message += "\t<span class='info'>Genetic Stability: [H.dna.stability]%.</span>"
Expand Down
25 changes: 25 additions & 0 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
var/obj/item/organ/lungs/mutantlungs = null
var/breathid = "o2"

var/list/required_organs = list()
var/obj/item/organ/brain/mutant_brain = /obj/item/organ/brain
var/obj/item/organ/heart/mutant_heart = /obj/item/organ/heart
var/obj/item/organ/eyes/mutanteyes = /obj/item/organ/eyes
Expand Down Expand Up @@ -261,50 +262,61 @@ GLOBAL_LIST_EMPTY(features_by_species)

if(heart && (!should_have_heart || replace_current))
heart.Remove(C,1)
required_organs -= /obj/item/organ/heart
QDEL_NULL(heart)
if(should_have_heart && !heart)
heart = new mutant_heart()
heart.Insert(C)
required_organs |= /obj/item/organ/heart

if(lungs && (!should_have_lungs || replace_current))
lungs.Remove(C,1)
required_organs -= /obj/item/organ/lungs
QDEL_NULL(lungs)
if(should_have_lungs && !lungs)
if(mutantlungs)
lungs = new mutantlungs()
else
lungs = new()
lungs.Insert(C)
required_organs |= /obj/item/organ/lungs

if(liver && (!should_have_liver || replace_current))
liver.Remove(C,1)
required_organs -= /obj/item/organ/liver
QDEL_NULL(liver)
if(should_have_liver && !liver)
if(mutantliver)
liver = new mutantliver()
else
liver = new()
liver.Insert(C)
required_organs |= /obj/item/organ/liver

if(stomach && (!should_have_stomach || replace_current))
stomach.Remove(C,1)
required_organs -= /obj/item/organ/stomach
QDEL_NULL(stomach)
if(should_have_stomach && !stomach)
if(mutantstomach)
stomach = new mutantstomach()
else
stomach = new()
stomach.Insert(C)
required_organs |= /obj/item/organ/stomach

if(appendix && (!should_have_appendix || replace_current))
appendix.Remove(C,1)
required_organs -= /obj/item/organ/appendix
QDEL_NULL(appendix)
if(should_have_appendix && !appendix)
appendix = new()
appendix.Insert(C)
required_organs |= /obj/item/organ/appendix

if(tail && (!should_have_tail || replace_current))
tail.Remove(C,1)
required_organs -= /obj/item/organ/tail
QDEL_NULL(tail)
if(should_have_tail && !tail)
tail = new mutanttail()
Expand All @@ -314,9 +326,11 @@ GLOBAL_LIST_EMPTY(features_by_species)
lizard_tail.spines = C.dna.features["spines"]
tail = lizard_tail
tail.Insert(C)
required_organs |= /obj/item/organ/tail

if(wings && (!should_have_wings || replace_current))
wings.Remove(C,1)
required_organs -= /obj/item/organ/wings
QDEL_NULL(wings)
if(should_have_wings && !wings)
wings = new mutantwings()
Expand All @@ -326,47 +340,58 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(locate(/datum/mutation/strongwings) in C.dna.mutations)
wings.flight_level = WINGS_FLYING
wings.Insert(C)
required_organs |= /obj/item/organ/wings

if(C.get_bodypart(BODY_ZONE_HEAD))
if(brain && (replace_current || !should_have_brain))
if(!brain.decoy_override)//Just keep it if it's fake
brain.Remove(C,TRUE,TRUE)
required_organs -= /obj/item/organ/brain
QDEL_NULL(brain)
if(should_have_brain && !brain)
brain = new mutant_brain()
brain.Insert(C, TRUE, TRUE)
required_organs |= /obj/item/organ/brain

if(eyes && (replace_current || !should_have_eyes))
eyes.Remove(C,1)
required_organs -= /obj/item/organ/eyes
QDEL_NULL(eyes)
if(should_have_eyes && !eyes)
eyes = new mutanteyes
eyes.Insert(C)
required_organs |= /obj/item/organ/eyes

if(ears && (replace_current || !should_have_ears))
ears.Remove(C,1)
required_organs -= /obj/item/organ/ears
QDEL_NULL(ears)
if(should_have_ears && !ears)
ears = new mutantears
ears.Insert(C)
required_organs |= /obj/item/organ/ears

if(tongue && (replace_current || !should_have_tongue))
tongue.Remove(C,1)
required_organs -= /obj/item/organ/tongue
QDEL_NULL(tongue)
if(should_have_tongue && !tongue)
tongue = new mutanttongue
tongue.Insert(C)
required_organs |= /obj/item/organ/tongue

if(old_species)
for(var/mutantorgan in old_species.mutant_organs)
var/obj/item/organ/I = C.getorgan(mutantorgan)
if(I)
I.Remove(C, TRUE)
required_organs -= I.type
QDEL_NULL(I)

for(var/path in mutant_organs)
var/obj/item/organ/I = new path()
I.Insert(C)
required_organs |= I.type

/datum/species/proc/replace_body(mob/living/carbon/C, var/datum/species/new_species)
new_species ||= C.dna.species //If no new species is provided, assume its src.
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-11093.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: XeonMations
delete-after: true
changes:
- tweak: Medical scanners now show missing organs.

0 comments on commit cd8115b

Please sign in to comment.