From 34c0a699189a0aca30dc1184802b17544c1dd26b Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Fri, 16 Mar 2018 00:01:40 -0400 Subject: [PATCH] POLARIS: Fix several organ bugs Eye color without needing eyes, Prometheans not dropping limbs, robotize not always honoring your parameters --- code/modules/organs/organ_external.dm | 13 ++++++++++--- code/modules/organs/organ_icon.dm | 15 +++++++++++---- code/modules/organs/subtypes/standard.dm | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 2c9626ee7e..39f93cf046 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -213,8 +213,6 @@ /obj/item/organ/external/update_health() damage = min(max_damage, (brute_dam + burn_dam)) - return - /obj/item/organ/external/New(var/mob/living/carbon/holder) ..(holder, 0) @@ -775,6 +773,8 @@ Note that amputating the affected organ does in fact remove the infection from t if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(robotic >= ORGAN_ROBOT)) src.fracture() + update_health() + // new damage icon system // adjusted to set damage_state to brute/burn code only (without r_name0 as before) /obj/item/organ/external/update_icon() @@ -810,6 +810,13 @@ Note that amputating the affected organ does in fact remove the infection from t tbrute = 3 return "[tbrute][tburn]" +/obj/item/organ/external/take_damage() + ..() + + if(!cannot_amputate) + if(nonsolid && damage >= max_damage) + droplimb(DROPLIMB_BLUNT) + /**************************************************** DISMEMBERMENT ****************************************************/ @@ -1091,7 +1098,7 @@ Note that amputating the affected organ does in fact remove the infection from t unmutate() for(var/obj/item/organ/external/T in children) - T.robotize(company, 1) + T.robotize(company, keep_organs = keep_organs) if(owner) diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 92079cc56c..6bed7b49c0 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -55,14 +55,21 @@ var/global/list/limb_icon_cache = list() overlays.Cut() if(!owner || !owner.species) return - if(owner.should_have_organ(O_EYES)) + if(owner.species.appearance_flags & HAS_EYE_COLOR) var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[O_EYES] if(eye_icon) var/icon/eyes_icon = new/icon(eye_icon_location, eye_icon) - if(eyes) - eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD) + //Should have eyes + if(owner.should_have_organ(O_EYES)) + //And we have them + if(eyes) + eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD) + //They're gone! + else + eyes_icon.Blend(rgb(128,0,0), ICON_ADD) + //We have weird other-sorts of eyes else - eyes_icon.Blend(rgb(128,0,0), ICON_ADD) + eyes_icon.Blend(rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes), ICON_ADD) mob_icon.Blend(eyes_icon, ICON_OVERLAY) overlays |= eyes_icon diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index eb0518de38..a5a8acb4d4 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -23,7 +23,7 @@ organ_rel_size = 70 base_miss_chance = 10 -/obj/item/organ/external/chest/robotize() +/obj/item/organ/external/chest/robotize(var/company, var/skip_prosthetics = 0, var/keep_organs = 0) if(..()) // Give them a new cell. owner.internal_organs_by_name["cell"] = new /obj/item/organ/internal/cell(owner,1)