Death of mutant bodyparts AND external organs (#85137)

## About The Pull Request

Removes mutant bodyparts and external organs from the game completely
Digitgrade behaviour was mutant bodypart for no reason

Cat ears now work with the bodyparts overlay system, same as all the
other external organs (since all their behaviour is now just on /organ

It doesn't remove all the /external types, but moves all behaviour to
/organ. I'll follow up with a PR wiping all the /external organ types,
but it's just conflict heaven so not this PR

I've also streamlined a lot of duplicate/weird species regeneration code

Melbert did the same PR as well but due to a lack of time (?) I have
absorbed his PR to double nuke mutant bodyparts

## Why It's Good For The Game
Frees us from the chain of unmodular code, and kills my greatest nemesis
(after the shuttle meteor murder bug)

## Changelog
🆑 Time-Green and MrMelbert
Refactor: External organ behaviour has been moved to /organ, ears now
use the same system as the other organs
Refactor: Mutant bodyparts are dead! This likely does not mean much to
the average person but it's very dear to me
code: Improves digitgrade handling in preference code
/🆑

I have absorbed #85126, using Melberts code to improve and add some
missing changes. Mainly improving the functioning of preferences and
digitgrade legs. I didn't take over the hairstyle improvements.

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
Time-Green
2024-08-20 16:33:34 +02:00
committed by GitHub
co-authored by Ghom
parent a92a5f8613
commit 095f7e3b70
68 changed files with 331 additions and 539 deletions
@@ -111,10 +111,6 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
/// DOES have random body on, will this already be randomized?
var/randomize_by_default = TRUE
/// If the selected species has this in its /datum/species/mutant_bodyparts,
/// will show the feature as selectable.
var/relevant_mutant_bodypart = null
/// If the selected species has this in its /datum/species/body_markings,
/// will show the feature as selectable.
var/relevant_body_markings = null
@@ -336,8 +332,7 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
SHOULD_NOT_SLEEP(TRUE)
if ( \
!isnull(relevant_mutant_bodypart) \
|| !isnull(relevant_inherent_trait) \
!isnull(relevant_inherent_trait) \
|| !isnull(relevant_external_organ) \
|| !isnull(relevant_head_flag) \
|| !isnull(relevant_body_markings) \
@@ -20,7 +20,7 @@
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
can_randomize = FALSE
relevant_mutant_bodypart = "ears"
relevant_external_organ = /obj/item/organ/internal/ears/cat
/datum/preference/choiced/ears/init_possible_values()
return assoc_to_keys_features(SSaccessories.ears_list)
@@ -93,13 +93,51 @@
savefile_key = "feature_lizard_legs"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_mutant_bodypart = "legs"
/datum/preference/choiced/lizard_legs/init_possible_values()
return assoc_to_keys_features(SSaccessories.legs_list)
return list(NORMAL_LEGS, DIGITIGRADE_LEGS)
/datum/preference/choiced/lizard_legs/apply_to_human(mob/living/carbon/human/target, value)
target.dna.features["legs"] = value
// Hack to update the dummy in the preference menu
// (Because digi legs are ONLY handled on species change)
if(!isdummy(target) || target.dna.species.digitigrade_customization == DIGITIGRADE_NEVER)
return
var/list/correct_legs = target.dna.species.bodypart_overrides.Copy() & list(BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
if(value == DIGITIGRADE_LEGS)
correct_legs[BODY_ZONE_R_LEG] = /obj/item/bodypart/leg/right/digitigrade
correct_legs[BODY_ZONE_L_LEG] = /obj/item/bodypart/leg/left/digitigrade
for(var/obj/item/bodypart/old_part as anything in target.bodyparts)
if(old_part.change_exempt_flags & BP_BLOCK_CHANGE_SPECIES)
continue
var/path = correct_legs[old_part.body_zone]
if(!path)
continue
var/obj/item/bodypart/new_part = new path()
new_part.replace_limb(target, TRUE)
new_part.update_limb(is_creating = TRUE)
qdel(old_part)
/datum/preference/choiced/lizard_legs/is_accessible(datum/preferences/preferences)
if(!..())
return FALSE
var/datum/species/species_type = preferences.read_preference(/datum/preference/choiced/species)
return initial(species_type.digitigrade_customization) == DIGITIGRADE_OPTIONAL
/datum/preference/choiced/lizard_legs/is_accessible(datum/preferences/preferences)
. = ..()
if(!.)
return
var/datum/species/species_type = preferences.read_preference(/datum/preference/choiced/species)
return initial(species_type.digitigrade_customization) & DIGITIGRADE_OPTIONAL
/datum/preference/choiced/lizard_snout
savefile_key = "feature_lizard_snout"
@@ -121,7 +159,7 @@
savefile_key = "feature_lizard_spines"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_mutant_bodypart = "spines"
relevant_external_organ = /obj/item/organ/external/spines
/datum/preference/choiced/lizard_spines/init_possible_values()
return assoc_to_keys_features(SSaccessories.spines_list)
@@ -2,7 +2,7 @@
savefile_key = "feature_mushperson_cap"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_mutant_bodypart = "cap"
relevant_external_organ = /obj/item/organ/external/mushroom_cap
/datum/preference/choiced/mushroom_cap/init_possible_values()
return assoc_to_keys_features(SSaccessories.caps_list)