SPECIES NUKING 2023: Refactors a bunch of species traits into flags for the head bodypart (#76074)

## About The Pull Request

Title. 
I saw a comment on psyker code complaining about these species traits
(which admittedly, they suck) and heeded the call to turn all of this
crap into something defined almost entirely by the head bodypart.

## Why It's Good For The Game

Potential to simplify species code further in the future, by delegating
more visuals to bodyparts, which is where most of them should be
handled.

## Changelog

Should not be player facing, unless I fucked up.

---------

Co-authored-by: Time-Green <timkoster1@hotmail.com>
This commit is contained in:
ChungusGamer666
2023-06-22 10:23:19 +02:00
committed by GitHub
co-authored by Time-Green
parent 866a06a248
commit f030b3b5aa
51 changed files with 494 additions and 440 deletions
@@ -109,6 +109,10 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
/// will show the feature as selectable.
var/relevant_external_organ = null
/// If the selected species has this head_flag by default,
/// will show the feature as selectable.
var/relevant_head_flag = null
/// Called on the saved input when retrieving.
/// Also called by the value sent from the user through UI. Do not trust it.
/// Input is the value inside the savefile, output is to tell other code
@@ -26,7 +26,7 @@
savefile_key = "eye_color"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_species_trait = EYECOLOR
relevant_head_flag = HEAD_EYECOLOR
/datum/preference/color/eye_color/apply_to_human(mob/living/carbon/human/target, value)
var/hetero = target.eye_color_heterochromatic
@@ -59,7 +59,7 @@
category = PREFERENCE_CATEGORY_FEATURES
main_feature_name = "Facial hair"
should_generate_icons = TRUE
relevant_species_trait = FACEHAIR
relevant_head_flag = HEAD_FACIAL_HAIR
/datum/preference/choiced/facial_hairstyle/init_possible_values()
return generate_possible_values_for_sprite_accessories_on_head(GLOB.facial_hairstyles_list)
@@ -79,7 +79,7 @@
savefile_key = "facial_hair_color"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES
relevant_species_trait = FACEHAIR
relevant_head_flag = HEAD_FACIAL_HAIR
/datum/preference/color/facial_hair_color/apply_to_human(mob/living/carbon/human/target, value)
target.facial_hair_color = value
@@ -89,7 +89,7 @@
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "facial_hair_gradient"
relevant_species_trait = FACEHAIR
relevant_head_flag = HEAD_FACIAL_HAIR
/datum/preference/choiced/facial_hair_gradient/init_possible_values()
return assoc_to_keys_features(GLOB.facial_hair_gradients_list)
@@ -106,7 +106,7 @@
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "facial_hair_gradient_color"
relevant_species_trait = FACEHAIR
relevant_head_flag = HEAD_FACIAL_HAIR
/datum/preference/color/facial_hair_gradient/apply_to_human(mob/living/carbon/human/target, value)
LAZYSETLEN(target.grad_color, GRADIENTS_LEN)
@@ -122,7 +122,7 @@
savefile_key = "hair_color"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES
relevant_species_trait = HAIR
relevant_head_flag = HEAD_HAIR
/datum/preference/color/hair_color/apply_to_human(mob/living/carbon/human/target, value)
target.hair_color = value
@@ -133,7 +133,7 @@
category = PREFERENCE_CATEGORY_FEATURES
main_feature_name = "Hairstyle"
should_generate_icons = TRUE
relevant_species_trait = HAIR
relevant_head_flag = HEAD_HAIR
/datum/preference/choiced/hairstyle/init_possible_values()
return generate_possible_values_for_sprite_accessories_on_head(GLOB.hairstyles_list)
@@ -152,7 +152,7 @@
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "hair_gradient"
relevant_species_trait = HAIR
relevant_head_flag = HEAD_HAIR
/datum/preference/choiced/hair_gradient/init_possible_values()
return assoc_to_keys_features(GLOB.hair_gradients_list)
@@ -169,7 +169,7 @@
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "hair_gradient_color"
relevant_species_trait = HAIR
relevant_head_flag = HEAD_HAIR
/datum/preference/color/hair_gradient/apply_to_human(mob/living/carbon/human/target, value)
LAZYSETLEN(target.grad_color, GRADIENTS_LEN)