[MIRROR] SPECIES NUKING 2023: Nukes species_traits, good night sweet prince [MDB IGNORE] (#22458)

* SPECIES NUKING 2023: Nukes species_traits, good night sweet prince (#76297)

IT'S OVER.

Species traits are a relic of a time before the trait system was added
to generalize this kind of behavior.
They are clunky and overall less useful than inherent_traits -
Converting these makes it easier to make these behaviors modular and
usable not only by species.

🆑
refactor: A significant species refactor happened, report any issues on
the github.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>

* Makes it all work

* Fix widespread vampirism (#76414)

## About The Pull Request

Removing code you think is not necessary but is actually is always a
recipe for disaster (#76297)


![image](https://github.com/tgstation/tgstation/assets/51863163/8ea9fdcc-2f95-47d4-a00f-cc8ebeb319f9)

## Changelog

🆑 Melbert
fix: Fix everyone being vampires
/🆑

* Whoops, missed one!

---------

Co-authored-by: ChungusGamer666 <82850673+ChungusGamer666@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
GoldenAlpharex
2023-07-14 21:38:54 -04:00
committed by GitHub
parent 480763e0bc
commit 7a827df807
78 changed files with 293 additions and 316 deletions
@@ -101,9 +101,9 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
/// will show the feature as selectable.
var/relevant_mutant_bodypart = null
/// If the selected species has this in its /datum/species/species_traits,
/// If the selected species has this in its /datum/species/inherent_traits,
/// will show the feature as selectable.
var/relevant_species_trait = null
var/relevant_inherent_trait = null
/// If the selected species has this in its /datum/species/var/external_organs,
/// will show the feature as selectable.
@@ -314,7 +314,12 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
SHOULD_CALL_PARENT(TRUE)
SHOULD_NOT_SLEEP(TRUE)
if (!isnull(relevant_mutant_bodypart) || !isnull(relevant_species_trait) || !isnull(relevant_external_organ))
if ( \
!isnull(relevant_mutant_bodypart) \
|| !isnull(relevant_inherent_trait) \
|| !isnull(relevant_external_organ) \
|| !isnull(relevant_head_flag) \
)
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
+1 -1
View File
@@ -141,7 +141,7 @@
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return !(NO_UNDERWEAR in species.species_traits)
return !(TRAIT_NO_UNDERWEAR in species.inherent_traits)
/datum/preference/choiced/underwear/compile_constant_data()
var/list/data = ..()
@@ -3,7 +3,15 @@
savefile_key = "feature_mcolor"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_species_trait = MUTCOLORS
relevant_inherent_trait = TRAIT_MUTANT_COLORS
/datum/preference/color/mutant_color/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return !(TRAIT_FIXED_MUTANT_COLORS in species.inherent_traits)
/datum/preference/color/mutant_color/create_default_value()
return sanitize_hexcolor("[pick("7F", "FF")][pick("7F", "FF")][pick("7F", "FF")]")
@@ -5,7 +5,7 @@
priority = PREFERENCE_PRIORITY_NAME_MODIFICATIONS //this will be overwritten by names otherwise
main_feature_name = "Vampire status"
should_generate_icons = TRUE
relevant_species_trait = BLOOD_CLANS
relevant_inherent_trait = TRAIT_BLOOD_CLANS
/datum/preference/choiced/vampire_status/create_default_value()
return "Inoculated" //eh, have em try out the mechanic first
@@ -22,7 +22,7 @@
GLOBAL_LIST_EMPTY(vampire_houses)
/datum/preference/choiced/vampire_status/apply_to_human(mob/living/carbon/human/target, value)
if (!(relevant_species_trait in target.dna?.species.species_traits))
if(!HAS_TRAIT(target, TRAIT_BLOOD_CLANS))
return
if(value != "Inoculated")
@@ -3,13 +3,13 @@
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES
/datum/preference/color/underwear_color/apply_to_human(mob/living/carbon/human/target, value)
target.underwear_color = value
/datum/preference/color/underwear_color/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return !(NO_UNDERWEAR in species.species_traits)
return !(TRAIT_NO_UNDERWEAR in species.inherent_traits)
/datum/preference/color/underwear_color/apply_to_human(mob/living/carbon/human/target, value)
target.underwear_color = value