From d0e8fba365b22622e0e6ec054f673690a2cee4c2 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Thu, 13 May 2021 02:58:45 -0400 Subject: [PATCH] Refactors IsSynthetic (#8078) * Refactors IsSynthetic Port of https://github.com/VOREStation/VOREStation/pull/10298 by Aronai * Fixes emote refactor bug --- .../client/preference_setup/general/03_body.dm | 2 ++ .../mob/living/carbon/human/human_helpers.dm | 12 +----------- .../mob/living/carbon/human/human_powers.dm | 1 - code/modules/organs/subtypes/standard.dm | 16 +++++++++++++++- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 54d3413cc7..398f106ce9 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -396,6 +396,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else pref.body_descriptors[entry] = CLAMP(last_descriptors[entry], 1, LAZYLEN(descriptor.standalone_value_descriptors)) + character.update_emotes() + return /datum/category_item/player_setup_item/general/body/content(var/mob/user) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 22b8fdab54..254f78a02a 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -98,17 +98,7 @@ // This is the 'mechanical' check for synthetic-ness, not appearance // Returns the company that made the synthetic /mob/living/carbon/human/isSynthetic() - if(synthetic) - return synthetic //Your synthetic-ness is not going away - var/obj/item/organ/external/T = organs_by_name[BP_TORSO] - if(T && T.robotic >= ORGAN_ROBOT) - src.verbs += /mob/living/carbon/human/proc/self_diagnostics - src.verbs += /mob/living/carbon/human/proc/setmonitor_state - var/datum/robolimb/R = all_robolimbs[T.model] - synthetic = R - update_emotes() - return synthetic - return FALSE + return synthetic // Would an onlooker know this person is synthetic? // Based on sort of logical reasoning, 'Look at head, look at torso' diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 27b463b914..65edd95efb 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -218,7 +218,6 @@ if(isSynthetic()) output += "Current Battery Charge: [nutrition]\n" - if(isSynthetic()) var/toxDam = getToxLoss() if(toxDam) output += "System Instability: [toxDam > 25 ? "Severe" : "Moderate"]. Seek charging station for cleanup.\n" diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index 63a95d8f8d..b910f697fc 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -33,6 +33,13 @@ owner.internal_organs_by_name[O_HEATSINK] = new /obj/item/organ/internal/robotic/heatsink(owner,1) owner.internal_organs_by_name[O_DIAGNOSTIC] = new /obj/item/organ/internal/robotic/diagnostic(owner,1) + var/datum/robolimb/R = all_robolimbs[model] // company should be set in parent by now + if(!R) + log_error("A torso was robotize() but has no model that can be found: [model]. May affect FBPs.") + owner.synthetic = R + owner.update_emotes() + return FALSE + /obj/item/organ/external/chest/handle_germ_effects() . = ..() //Should return an infection level if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. @@ -278,7 +285,14 @@ return ..() /obj/item/organ/external/head/robotize(var/company, var/skip_prosthetics, var/keep_organs) - return ..(company, skip_prosthetics, 1) + . = ..(company, skip_prosthetics, 1) + if(model) + var/datum/robolimb/robohead = all_robolimbs[model] + if(robohead?.monitor_styles && robohead?.monitor_icon) + LAZYDISTINCTADD(organ_verbs, /mob/living/carbon/human/proc/setmonitor_state) + else + LAZYREMOVE(organ_verbs, /mob/living/carbon/human/proc/setmonitor_state) + handle_organ_mod_special() /obj/item/organ/external/head/removed() if(owner)