From a7f13f15cfd19cfa2ea29584828237a18685fa96 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Thu, 17 May 2018 11:24:48 -0400 Subject: [PATCH 1/2] Fixes Adminorazine killing ash lizards (#37872) * Fixes Adminorazine killing ash lizards * this should do it... --- code/__DEFINES/traits.dm | 1 + .../antagonists/abductor/equipment/gland.dm | 4 ++-- code/modules/mob/living/status_procs.dm | 21 +++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 94606273be..384e65bdcb 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -68,6 +68,7 @@ #define MAGIC_TRAIT "magic" #define TRAUMA_TRAIT "trauma" #define SPECIES_TRAIT "species" +#define ORGAN_TRAIT "organ" #define ROUNDSTART_TRAIT "roundstart" //cannot be removed without admin intervention // unique trait sources, still defines diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index c551509cc7..726f77d7ae 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -272,10 +272,10 @@ /obj/item/organ/heart/gland/electric/Insert(mob/living/carbon/M, special = 0) ..() - owner.add_trait(TRAIT_SHOCKIMMUNE, "abductor_gland") + owner.add_trait(TRAIT_SHOCKIMMUNE, ORGAN_TRAIT) /obj/item/organ/heart/gland/electric/Remove(mob/living/carbon/M, special = 0) - owner.remove_trait(TRAIT_SHOCKIMMUNE, "abductor_gland") + owner.remove_trait(TRAIT_SHOCKIMMUNE, ORGAN_TRAIT) ..() /obj/item/organ/heart/gland/electric/activate() diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 0a0f27f123..47de9a0896 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -204,8 +204,25 @@ /mob/living/proc/has_quirk(quirk) return roundstart_quirks[quirk] -/mob/living/proc/remove_all_traits() - status_traits = list() +/mob/living/proc/remove_all_traits(remove_species_traits = FALSE, remove_organ_traits = FALSE, remove_quirks = FALSE) + + var/list/blacklisted_sources = list() + if(!remove_species_traits) + blacklisted_sources += SPECIES_TRAIT + if(!remove_organ_traits) + blacklisted_sources += ORGAN_TRAIT + if(!remove_quirks) + blacklisted_sources += ROUNDSTART_TRAIT + + for(var/kebab in status_traits) + var/skip + for(var/S in blacklisted_sources) + if(S in status_traits[kebab]) + skip = TRUE + break + if(!skip) + remove_trait(kebab, null, TRUE) + CHECK_TICK /////////////////////////////////// TRAIT PROCS ////////////////////////////////////