From 9ecd0321909c16c77b552e6904b4136db4401293 Mon Sep 17 00:00:00 2001 From: Chompstation Bot Date: Mon, 8 Feb 2021 19:21:07 +0000 Subject: [PATCH] Improved Trait Exclusion Logic --- .../client/preference_setup/vore/07_traits.dm | 29 +++++++++++++++++++ .../species/station/traits_vr/negative.dm | 7 +++-- .../species/station/traits_vr/neutral.dm | 3 ++ .../species/station/traits_vr/positive.dm | 3 ++ .../human/species/station/traits_vr/trait.dm | 5 +++- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 782111c161..6b276b82c9 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -2,6 +2,9 @@ #define NEUTRAL_MODE 2 #define NEGATIVE_MODE 3 +#define ORGANICS 1 +#define SYNTHETICS 2 + /datum/preferences var/custom_species // Custom species name, can't be changed due to it having been used in savefiles already. var/custom_base // What to base the custom species on @@ -15,6 +18,7 @@ var/starting_trait_points = STARTING_SPECIES_POINTS var/max_traits = MAX_SPECIES_TRAITS var/dirty_synth = 0 //Are you a synth + var/gross_meatbag = 0 //Where'd I leave my Voight-Kampff test kit? // Definition of the stuff for Ears /datum/category_item/player_setup_item/vore/traits @@ -85,8 +89,16 @@ if(character.isSynthetic()) //Checking if we have a synth on our hands, boys. pref.dirty_synth = 1 +<<<<<<< HEAD else //CHOMPEdit pref.dirty_synth = 0 //CHOMPEdit +||||||| parent of 8b0c23c122... Merge pull request #9659 from KillianKirilenko/kk-misc4 +======= + pref.gross_meatbag = 0 + else + pref.gross_meatbag = 1 + pref.dirty_synth = 0 +>>>>>>> 8b0c23c122... Merge pull request #9659 from KillianKirilenko/kk-misc4 var/datum/species/S = character.species var/SB @@ -276,11 +288,28 @@ var/conflict = FALSE +<<<<<<< HEAD user.isSynthetic() //Recheck just to be sure if(pref.dirty_synth && instance.not_for_synths)//if you are a synth you can't take this trait. alert("You cannot take this trait as a SYNTH.\ Please remove that trait, or pick another trait to add.","Error") //pref.dirty_synth = 0 //Just to be sure // Commented out because it allow for someone to take a synth-blacklisted trait CHOMP Edit +||||||| parent of 8b0c23c122... Merge pull request #9659 from KillianKirilenko/kk-misc4 + user.isSynthetic() //Recheck just to be sure + if(pref.dirty_synth && instance.not_for_synths)//if you are a synth you can't take this trait. + alert("You cannot take this trait as a SYNTH.\ + Please remove that trait, or pick another trait to add.","Error") + pref.dirty_synth = 0 //Just to be sure +======= + if(pref.dirty_synth && !(instance.can_take & SYNTHETICS)) + alert("The trait you've selected can only be taken by organic characters!","Error") + pref.dirty_synth = 0 //Just to be sure +>>>>>>> 8b0c23c122... Merge pull request #9659 from KillianKirilenko/kk-misc4 + return TOPIC_REFRESH + + if(pref.gross_meatbag && !(instance.can_take & ORGANICS)) + alert("The trait you've selected can only be taken by synthetic characters!","Error") + pref.gross_meatbag = 0 //Just to be sure return TOPIC_REFRESH diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm index 1fa2796d0b..6fc26b12a9 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm @@ -1,3 +1,6 @@ +#define ORGANICS 1 +#define SYNTHETICS 2 + /datum/trait/speed_slow name = "Slowdown" desc = "Allows you to move slower on average than baseline." @@ -142,10 +145,10 @@ */ /datum/trait/haemophilia name = "Haemophilia - Organics only" - desc = "When you bleed, you bleed a LOT. This trait is only for organics, buggy with synths!" + desc = "When you bleed, you bleed a LOT." cost = -2 var_changes = list("bloodloss_rate" = 2) - not_for_synths = 1 + can_take = ORGANICS /datum/trait/hollow name = "Hollow Bones/Aluminum Alloy" 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 709e5f53e3..53b0d5829d 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 @@ -1,3 +1,6 @@ +#define ORGANICS 1 +#define SYNTHETICS 2 + /datum/trait/metabolism_up name = "Fast Metabolism" desc = "You process ingested and injected reagents faster, but get hungry faster (Teshari speed)." diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm index 9c22f2f60c..75f7090bc6 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm @@ -1,3 +1,6 @@ +#define ORGANICS 1 +#define SYNTHETICS 2 + /datum/trait/speed_fast name = "Haste" desc = "Allows you to move faster on average than baseline." 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..a17883884b 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 @@ -1,3 +1,6 @@ +#define ORGANICS 1 +#define SYNTHETICS 2 + /datum/trait var/name var/desc = "Contact a developer if you see this trait." @@ -5,7 +8,7 @@ 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/excludes // Store a list of paths of traits to exclude, but done automatically if they change the same vars. - var/not_for_synths = FALSE // Can freaking synths use those. + var/can_take = ORGANICS|SYNTHETICS // Can freaking synths use those. 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