From f097111c562d043a44c53a42063df516b76a6b25 Mon Sep 17 00:00:00 2001 From: Chompstation Bot Date: Sat, 27 Feb 2021 00:21:13 +0000 Subject: [PATCH] Improved Trait Exclusion Logic v2 --- .../client/preference_setup/vore/07_traits.dm | 3 ++ .../species/station/traits_vr/neutral.dm | 30 +++++++++++++++++++ .../human/species/station/traits_vr/trait.dm | 9 +++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 782111c161..b0f131281c 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -283,6 +283,9 @@ //pref.dirty_synth = 0 //Just to be sure // Commented out because it allow for someone to take a synth-blacklisted trait CHOMP Edit return TOPIC_REFRESH + if(pref.species in instance.banned_species) + alert("The trait you've selected cannot be taken by the species you've chosen!","Error") + return TOPIC_REFRESH if(trait_choice in pref.pos_traits + pref.neu_traits + pref.neg_traits) conflict = instance.name diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index 41dbf2a72b..6b8d63c16d 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -208,6 +208,36 @@ YW change end */ H.verbs |= /mob/living/proc/glow_toggle H.verbs |= /mob/living/proc/glow_color +/* +//Allergen traits! Not available to any species with a base allergens var. +/datum/trait/allergy_gluten + name = "Allergy: Gluten" + desc = "You're highly allergic to gluten proteins, which are found in most common grains. This trait cannot be taken by skrell or tajara." + cost = 0 + custom_only = FALSE + banned_species = list(SPECIES_SKRELL,SPECIES_TAJ) + var_changes = list("allergens" = 16) + excludes = list(/datum/trait/allergy_nuts,/datum/trait/allergy_soy) + +/datum/trait/allergy_nuts + name = "Allergy: Nuts" + desc = "You're highly allergic to hard-shell seeds, such as peanuts. This trait cannot be taken by skrell or tajara." + cost = 0 + custom_only = FALSE + banned_species = list(SPECIES_SKRELL,SPECIES_TAJ) + var_changes = list("allergens" = 64) + excludes = list(/datum/trait/allergy_gluten,/datum/trait/allergy_soy) + +/datum/trait/allergy_soy + name = "Allergy: Soy" + desc = "You're highly allergic to soybeans, and some other kinds of bean. This trait cannot be taken by skrell or tajara." + cost = 0 + custom_only = FALSE + banned_species = list(SPECIES_SKRELL,SPECIES_TAJ) + var_changes = list("allergens" = 32) + excludes = list(/datum/trait/allergy_gluten,/datum/trait/allergy_nuts) +*/ + // Spicy Food Traits, from negative to positive. /datum/trait/spice_intolerance_extreme name = "Extreme Spice Intolerance" diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm index 605da7e569..1179569a1e 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm @@ -3,9 +3,16 @@ var/desc = "Contact a developer if you see this trait." var/cost = 0 // 0 is neutral, negative cost means negative, positive cost means positive. - var/list/var_changes // A list to apply to the custom species vars. + var/list/var_changes // A list to apply to the custom species vars. var/list/excludes // Store a list of paths of traits to exclude, but done automatically if they change the same vars. +<<<<<<< HEAD var/not_for_synths = FALSE // Can freaking synths use those. +||||||| parent of 96115d20fd... Merge pull request #9804 from KillianKirilenko/kk-traits + var/can_take = ORGANICS|SYNTHETICS // Can freaking synths use those. +======= + var/can_take = ORGANICS|SYNTHETICS // Can freaking synths use those. + var/list/banned_species // A list of species that can't take this trait +>>>>>>> 96115d20fd... Merge pull request #9804 from KillianKirilenko/kk-traits var/custom_only = TRUE // Trait only available for custom species //Proc can be overridden lower to include special changes, make sure to call up though for the vars changes