Merge pull request #1262 from CHOMPStationBot/upstream-merge-9659

[MIRROR] Improved Trait Exclusion Logic
This commit is contained in:
cadyn
2021-02-27 15:38:34 -08:00
committed by GitHub
7 changed files with 40 additions and 19 deletions

View File

@@ -2,6 +2,9 @@
#define NEUTRAL_MODE 2 #define NEUTRAL_MODE 2
#define NEGATIVE_MODE 3 #define NEGATIVE_MODE 3
#define ORGANICS 1
#define SYNTHETICS 2
/datum/preferences /datum/preferences
var/custom_species // Custom species name, can't be changed due to it having been used in savefiles already. 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 var/custom_base // What to base the custom species on
@@ -15,6 +18,7 @@
var/starting_trait_points = STARTING_SPECIES_POINTS var/starting_trait_points = STARTING_SPECIES_POINTS
var/max_traits = MAX_SPECIES_TRAITS var/max_traits = MAX_SPECIES_TRAITS
var/dirty_synth = 0 //Are you a synth 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 // Definition of the stuff for Ears
/datum/category_item/player_setup_item/vore/traits /datum/category_item/player_setup_item/vore/traits
@@ -85,8 +89,10 @@
if(character.isSynthetic()) //Checking if we have a synth on our hands, boys. if(character.isSynthetic()) //Checking if we have a synth on our hands, boys.
pref.dirty_synth = 1 pref.dirty_synth = 1
else //CHOMPEdit pref.gross_meatbag = 0
pref.dirty_synth = 0 //CHOMPEdit else
pref.gross_meatbag = 1
pref.dirty_synth = 0
var/datum/species/S = character.species var/datum/species/S = character.species
var/SB var/SB
@@ -276,11 +282,14 @@
var/conflict = FALSE var/conflict = FALSE
user.isSynthetic() //Recheck just to be sure if(pref.dirty_synth && !(instance.can_take & SYNTHETICS))
if(pref.dirty_synth && instance.not_for_synths)//if you are a synth you can't take this trait. alert("The trait you've selected can only be taken by organic characters!","Error")
alert("You cannot take this trait as a SYNTH.\ //pref.dirty_synth = 0 //Just to be sure //CHOMPEdit this shit broke, stop.
Please remove that trait, or pick another trait to add.","Error") return TOPIC_REFRESH
//pref.dirty_synth = 0 //Just to be sure // Commented out because it allow for someone to take a synth-blacklisted trait CHOMP Edit
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 return TOPIC_REFRESH

View File

@@ -1,3 +1,6 @@
#define ORGANICS 1
#define SYNTHETICS 2
/datum/trait/speed_slow /datum/trait/speed_slow
name = "Slowdown" name = "Slowdown"
desc = "Allows you to move slower on average than baseline." desc = "Allows you to move slower on average than baseline."
@@ -142,10 +145,10 @@
*/ */
/datum/trait/haemophilia /datum/trait/haemophilia
name = "Haemophilia - Organics only" 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 cost = -2
var_changes = list("bloodloss_rate" = 2) var_changes = list("bloodloss_rate" = 2)
not_for_synths = 1 can_take = ORGANICS
/datum/trait/hollow /datum/trait/hollow
name = "Hollow Bones/Aluminum Alloy" name = "Hollow Bones/Aluminum Alloy"

View File

@@ -18,7 +18,7 @@
cost = -3 cost = -3
var_changes = list("blood_volume" = 375) var_changes = list("blood_volume" = 375)
excludes = list(/datum/trait/less_blood_extreme,/datum/trait/more_blood,/datum/trait/more_blood_extreme) excludes = list(/datum/trait/less_blood_extreme,/datum/trait/more_blood,/datum/trait/more_blood_extreme)
not_for_synths = TRUE can_take = ORGANICS
/datum/trait/less_blood_extreme /datum/trait/less_blood_extreme
name = "Extremely low blood volume" name = "Extremely low blood volume"
@@ -26,7 +26,7 @@
cost = -5 cost = -5
var_changes = list("blood_volume" = 224) var_changes = list("blood_volume" = 224)
excludes = list(/datum/trait/less_blood,/datum/trait/more_blood,/datum/trait/more_blood_extreme) excludes = list(/datum/trait/less_blood,/datum/trait/more_blood,/datum/trait/more_blood_extreme)
not_for_synths = TRUE can_take = ORGANICS
/datum/trait/scrawny /datum/trait/scrawny
name = "Scrawny" name = "Scrawny"
@@ -85,7 +85,7 @@
desc = "You have a condition which causes you to spontaneously have hallucinations! Luckily for you, in the modern space age, our doctors have solutions for you, just make sure you don't forget to take your pills." desc = "You have a condition which causes you to spontaneously have hallucinations! Luckily for you, in the modern space age, our doctors have solutions for you, just make sure you don't forget to take your pills."
cost = -3 cost = -3
special_env = TRUE special_env = TRUE
not_for_synths = TRUE can_take = ORGANICS
var/hallucination_max = 60 var/hallucination_max = 60
var/hallucination_increase = 3 var/hallucination_increase = 3
var/episode_length_nomeds_avg = 4000 var/episode_length_nomeds_avg = 4000

View File

@@ -1,3 +1,6 @@
#define ORGANICS 1
#define SYNTHETICS 2
/datum/trait/metabolism_up /datum/trait/metabolism_up
name = "Fast Metabolism" name = "Fast Metabolism"
desc = "You process ingested and injected reagents faster, but get hungry faster (Teshari speed)." desc = "You process ingested and injected reagents faster, but get hungry faster (Teshari speed)."

View File

@@ -1,3 +1,6 @@
#define ORGANICS 1
#define SYNTHETICS 2
/datum/trait/speed_fast /datum/trait/speed_fast
name = "Haste" name = "Haste"
desc = "Allows you to move faster on average than baseline." desc = "Allows you to move faster on average than baseline."
@@ -253,7 +256,7 @@
cost = 2 cost = 2
var_changes = list("cold_level_1" = 200, "cold_level_2" = 150, "cold_level_3" = 90, "breath_cold_level_1" = 180, "breath_cold_level_2" = 100, "breath_cold_level_3" = 60, "cold_discomfort_level" = 210, "heat_level_1" = 305, "heat_level_2" = 360, "heat_level_3" = 700, "breath_heat_level_1" = 345, "breath_heat_level_2" = 380, "breath_heat_level_3" = 780, "heat_discomfort_level" = 295) var_changes = list("cold_level_1" = 200, "cold_level_2" = 150, "cold_level_3" = 90, "breath_cold_level_1" = 180, "breath_cold_level_2" = 100, "breath_cold_level_3" = 60, "cold_discomfort_level" = 210, "heat_level_1" = 305, "heat_level_2" = 360, "heat_level_3" = 700, "breath_heat_level_1" = 345, "breath_heat_level_2" = 380, "breath_heat_level_3" = 780, "heat_discomfort_level" = 295)
excludes = list(/datum/trait/hotadapt) excludes = list(/datum/trait/hotadapt)
not_for_synths = 1 // CHOMP edit can_take = ORGANICS // CHOMP edit
/datum/trait/hotadapt /datum/trait/hotadapt
name = "Heat-Adapted" name = "Heat-Adapted"
@@ -261,7 +264,7 @@
cost = 2 cost = 2
var_changes = list("heat_level_1" = 420, "heat_level_2" = 460, "heat_level_3" = 1100, "breath_heat_level_1" = 440, "breath_heat_level_2" = 510, "breath_heat_level_3" = 1500, "heat_discomfort_level" = 390, "cold_level_1" = 280, "cold_level_2" = 220, "cold_level_3" = 140, "breath_cold_level_1" = 260, "breath_cold_level_2" = 240, "breath_cold_level_3" = 120, "cold_discomfort_level" = 280) var_changes = list("heat_level_1" = 420, "heat_level_2" = 460, "heat_level_3" = 1100, "breath_heat_level_1" = 440, "breath_heat_level_2" = 510, "breath_heat_level_3" = 1500, "heat_discomfort_level" = 390, "cold_level_1" = 280, "cold_level_2" = 220, "cold_level_3" = 140, "breath_cold_level_1" = 260, "breath_cold_level_2" = 240, "breath_cold_level_3" = 120, "cold_discomfort_level" = 280)
excludes = list(/datum/trait/coldadapt) excludes = list(/datum/trait/coldadapt)
not_for_synths = 1 // CHOMP edit can_take = ORGANICS // CHOMP edit
// YW Addition end // YW Addition end
/datum/trait/snowwalker /datum/trait/snowwalker

View File

@@ -34,7 +34,7 @@
desc = "Your body is able to produce nutrition from being in light." desc = "Your body is able to produce nutrition from being in light."
cost = 3 cost = 3
var_changes = list("photosynthesizing" = TRUE) var_changes = list("photosynthesizing" = TRUE)
not_for_synths = 0 //Synths actually use nutrition, just with a fancy covering. can_take = ORGANICS|SYNTHETICS //Synths actually use nutrition, just with a fancy covering.
/datum/trait/rad_resistance /datum/trait/rad_resistance
name = "Radiation Resistance" name = "Radiation Resistance"
@@ -54,7 +54,7 @@
cost = 3 cost = 3
var_changes = list("blood_volume" = 840) var_changes = list("blood_volume" = 840)
excludes = list(/datum/trait/more_blood_extreme,/datum/trait/less_blood,/datum/trait/less_blood_extreme) excludes = list(/datum/trait/more_blood_extreme,/datum/trait/less_blood,/datum/trait/less_blood_extreme)
not_for_synths = TRUE can_take = ORGANICS
/datum/trait/more_blood_extreme /datum/trait/more_blood_extreme
name = "Very high blood volume" name = "Very high blood volume"
@@ -62,7 +62,7 @@
cost = 6 cost = 6
var_changes = list("blood_volume" = 1400) var_changes = list("blood_volume" = 1400)
excludes = list(/datum/trait/more_blood,/datum/trait/less_blood,/datum/trait/less_blood_extreme) excludes = list(/datum/trait/more_blood,/datum/trait/less_blood,/datum/trait/less_blood_extreme)
not_for_synths = TRUE can_take = ORGANICS
/datum/trait/heavyweight /datum/trait/heavyweight
name = "Heavyweight" name = "Heavyweight"
@@ -164,7 +164,7 @@
desc = "When you get critically damaged, you'll have an adrenaline rush before going down, giving you another chance to finish the fight, or get to safety." desc = "When you get critically damaged, you'll have an adrenaline rush before going down, giving you another chance to finish the fight, or get to safety."
cost = 6 cost = 6
special_env = TRUE special_env = TRUE
not_for_synths = TRUE can_take = ORGANICS
var/last_adrenaline_rush var/last_adrenaline_rush
/datum/trait/adrenaline_rush/handle_environment_special(var/mob/living/carbon/human/H) /datum/trait/adrenaline_rush/handle_environment_special(var/mob/living/carbon/human/H)

View File

@@ -1,3 +1,6 @@
#define ORGANICS 1
#define SYNTHETICS 2
/datum/trait /datum/trait
var/name var/name
var/desc = "Contact a developer if you see this trait." 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/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. 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 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 //Proc can be overridden lower to include special changes, make sure to call up though for the vars changes