Species whitelist for traits

Tunes up the trait system to have a whitelist AND a blacklist so you can choose whichever makes you have to write the lowest amount of code
This commit is contained in:
Sharkmare
2021-03-06 17:23:41 +01:00
parent 01da72ac5d
commit 06d969a967
3 changed files with 6 additions and 22 deletions
@@ -41,7 +41,7 @@
S["traits_cheating"] >> pref.traits_cheating
S["max_traits"] >> pref.max_traits
S["trait_points"] >> pref.starting_trait_points
S["custom_say"] >> pref.custom_say
S["custom_whisper"] >> pref.custom_whisper
S["custom_ask"] >> pref.custom_ask
@@ -58,7 +58,7 @@
S["traits_cheating"] << pref.traits_cheating
S["max_traits"] << pref.max_traits
S["trait_points"] << pref.starting_trait_points
S["custom_say"] << pref.custom_say
S["custom_whisper"] << pref.custom_whisper
S["custom_ask"] << pref.custom_ask
@@ -179,7 +179,7 @@
. += "<a href='?src=\ref[src];blood_color=1'>Set Color</a>"
. += "<a href='?src=\ref[src];blood_reset=1'>R</a><br>"
. += "<br>"
. += "<b>Custom Say: </b>"
. += "<a href='?src=\ref[src];custom_say=1'>Set Say Verb</a><br>"
. += "<b>Custom Whisper: </b>"
@@ -345,7 +345,7 @@
pref.gross_meatbag = 0 //Just to be sure
return TOPIC_REFRESH
if(pref.species in instance.banned_species)
if(pref.species in instance.banned_species || (LAZYLEN(instance.allowed_species) && !(pref.species in instance.allowed_species))) //CHOMPEDIT: Whitelising!
alert("The trait you've selected cannot be taken by the species you've chosen!","Error")
return TOPIC_REFRESH