From f00a2250d66efb616f1c8a8b71c03e1f2509d075 Mon Sep 17 00:00:00 2001 From: Wallemations <66052067+Wallemations@users.noreply.github.com> Date: Fri, 4 Sep 2020 20:44:08 -0400 Subject: [PATCH] adds ability to set organs as unremovable --- code/__DEFINES/obj_flags.dm | 1 + code/modules/surgery/organ_manipulation.dm | 4 ++-- code/modules/surgery/organs/tongue.dm | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 52fb66d6ce6..5258ec64a6a 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -59,6 +59,7 @@ #define ORGAN_VITAL (1<<4) //Currently only the brain #define ORGAN_EDIBLE (1<<5) //is a snack? :D #define ORGAN_SYNTHETIC_EMP (1<<6) //Synthetic organ affected by an EMP. Deteriorates over time. +#define ORGAN_UNREMOVABLE (1<<7) //Can't be removed using surgery /// Integrity defines for clothing (not flags but close enough) #define CLOTHING_PRISTINE 0 // We have no damage on the clothing diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 4565c1d63bf..5601fe597de 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -119,8 +119,8 @@ I = organs[I] if(!I) return -1 - if(istype(I, /obj/item/organ/tongue/tied)) //Since I couldn't find any code for unremovable organs - to_chat(user, "Only Alexander the Great would be able to untie that knot!") + if(I.organ_flags & ORGAN_UNREMOVABLE) + to_chat(user, "[I] is too well connected to take out!") return -1 display_results(user, target, "You begin to extract [I] from [target]'s [parse_zone(target_zone)]...", "[user] begins to extract [I] from [target]'s [parse_zone(target_zone)].", diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 935d97fb032..70a267e2648 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -326,6 +326,7 @@ say_mod = "signs" icon_state = "tonguetied" modifies_speech = TRUE + organ_flags = ORGAN_UNREMOVABLE /obj/item/organ/tongue/tied/Insert(mob/living/carbon/M) . = ..()