mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 20:20:33 +01:00
Datumizes DNA blocks, makes DNA cleaner in general (#92061)
Moves all the dna block handling onto singleton datums initialized inside global lists, to make the handling dna less of a copy-paste mess and make adding new blocks significantly easier. There is still some work to be done in the copypaste department but ultimately that falls under its own PR scope after the core refactor goes through. (Ill probably do those but it will also be easier for everyone else as the code is now significantly less of an eyesore) Both features and identities have been tested through and through, and seem to be working fine. Also removed the reliance on weird hardcoded lookup tables for length, and other similar things that just didn't make sense when I was passing through DNA code. There's a lot more that fall out of scope for this exact PR's goal however I've been told the maintainers will love me for doing this 🆑 code: feature keys are no longer magical strings floating around the codebase and use proper defines refactor: DNA blocks are now handled with singleton datums. /🆑
This commit is contained in:
@@ -33,4 +33,4 @@
|
||||
return icon
|
||||
|
||||
/datum/preference/choiced/ethereal_color/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["ethcolor"] = GLOB.color_list_ethereal[value]
|
||||
target.dna.features[FEATURE_ETHEREAL_COLOR] = GLOB.color_list_ethereal[value]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
return assoc_to_keys_features(SSaccessories.tails_list_felinid)
|
||||
|
||||
/datum/preference/choiced/tail_felinid/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["tail_cat"] = value
|
||||
target.dna.features[FEATURE_TAIL] = value
|
||||
|
||||
/datum/preference/choiced/tail_felinid/create_default_value()
|
||||
var/datum/sprite_accessory/tails/felinid/cat/tail = /datum/sprite_accessory/tails/felinid/cat
|
||||
@@ -27,7 +27,7 @@
|
||||
return assoc_to_keys_features(SSaccessories.ears_list)
|
||||
|
||||
/datum/preference/choiced/felinid_ears/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["ears"] = value
|
||||
target.dna.features[FEATURE_EARS] = value
|
||||
|
||||
/datum/preference/choiced/felinid_ears/create_default_value()
|
||||
return /datum/sprite_accessory/ears/cat::name
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
return final_icon
|
||||
|
||||
/datum/preference/choiced/lizard_body_markings/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["lizard_markings"] = value
|
||||
target.dna.features[FEATURE_LIZARD_MARKINGS] = value
|
||||
|
||||
/datum/preference/choiced/lizard_frills
|
||||
savefile_key = "feature_lizard_frills"
|
||||
@@ -73,7 +73,7 @@
|
||||
return generate_lizard_side_shot(SSaccessories.frills_list[value], "frills")
|
||||
|
||||
/datum/preference/choiced/lizard_frills/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["frills"] = value
|
||||
target.dna.features[FEATURE_FRILLS] = value
|
||||
|
||||
/datum/preference/choiced/lizard_horns
|
||||
savefile_key = "feature_lizard_horns"
|
||||
@@ -90,7 +90,7 @@
|
||||
return generate_lizard_side_shot(SSaccessories.horns_list[value], "horns")
|
||||
|
||||
/datum/preference/choiced/lizard_horns/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["horns"] = value
|
||||
target.dna.features[FEATURE_HORNS] = value
|
||||
|
||||
/datum/preference/choiced/lizard_legs
|
||||
savefile_key = "feature_lizard_legs"
|
||||
@@ -101,7 +101,7 @@
|
||||
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
|
||||
target.dna.features[FEATURE_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)
|
||||
@@ -146,7 +146,7 @@
|
||||
return generate_lizard_side_shot(SSaccessories.snouts_list[value], "snout", include_snout = FALSE)
|
||||
|
||||
/datum/preference/choiced/lizard_snout/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["snout"] = value
|
||||
target.dna.features[FEATURE_SNOUT] = value
|
||||
|
||||
/datum/preference/choiced/lizard_spines
|
||||
savefile_key = "feature_lizard_spines"
|
||||
@@ -158,7 +158,7 @@
|
||||
return assoc_to_keys_features(SSaccessories.spines_list)
|
||||
|
||||
/datum/preference/choiced/lizard_spines/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["spines"] = value
|
||||
target.dna.features[FEATURE_SPINES] = value
|
||||
|
||||
/datum/preference/choiced/lizard_tail
|
||||
savefile_key = "feature_lizard_tail"
|
||||
@@ -170,7 +170,7 @@
|
||||
return assoc_to_keys_features(SSaccessories.tails_list_lizard)
|
||||
|
||||
/datum/preference/choiced/lizard_tail/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["tail_lizard"] = value
|
||||
target.dna.features[FEATURE_TAIL_LIZARD] = value
|
||||
|
||||
/datum/preference/choiced/lizard_tail/create_default_value()
|
||||
return /datum/sprite_accessory/tails/lizard/smooth::name
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
return assoc_to_keys_features(SSaccessories.tails_list_monkey)
|
||||
|
||||
/datum/preference/choiced/monkey_tail/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["tail_monkey"] = value
|
||||
target.dna.features[FEATURE_TAIL_MONKEY] = value
|
||||
|
||||
/datum/preference/choiced/monkey_tail/create_default_value()
|
||||
var/datum/sprite_accessory/tails/monkey/default/tail = /datum/sprite_accessory/tails/monkey/default
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
return icon_with_antennae
|
||||
|
||||
/datum/preference/choiced/moth_antennae/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["moth_antennae"] = value
|
||||
target.dna.features[FEATURE_MOTH_ANTENNAE] = value
|
||||
|
||||
/datum/preference/choiced/moth_markings
|
||||
savefile_key = "feature_moth_markings"
|
||||
@@ -78,7 +78,7 @@
|
||||
return icon_with_markings
|
||||
|
||||
/datum/preference/choiced/moth_markings/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["moth_markings"] = value
|
||||
target.dna.features[FEATURE_MOTH_MARKINGS] = value
|
||||
|
||||
/datum/preference/choiced/moth_wings
|
||||
savefile_key = "feature_moth_wings"
|
||||
@@ -96,6 +96,5 @@
|
||||
return uni_icon(moth_wings.icon, "m_moth_wings_[moth_wings.icon_state]_BEHIND")
|
||||
|
||||
/datum/preference/choiced/moth_wings/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["moth_wings"] = value
|
||||
|
||||
target.dna.features[FEATURE_MOTH_WINGS] = value
|
||||
*/
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
return assoc_to_keys_features(SSaccessories.caps_list)
|
||||
|
||||
/datum/preference/choiced/mushroom_cap/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["caps"] = value
|
||||
target.dna.features[FEATURE_MUSH_CAP] = value
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
return sanitize_hexcolor("[pick("7F", "FF")][pick("7F", "FF")][pick("7F", "FF")]")
|
||||
|
||||
/datum/preference/color/mutant_color/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["mcolor"] = value
|
||||
target.dna.features[FEATURE_MUTANT_COLOR] = value
|
||||
|
||||
/datum/preference/color/mutant_color/is_valid(value)
|
||||
if (!..(value))
|
||||
|
||||
@@ -30,5 +30,5 @@
|
||||
return pick(assoc_to_keys_features(SSaccessories.pod_hair_list))
|
||||
|
||||
/datum/preference/choiced/pod_hair/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.dna.features["pod_hair"] = value
|
||||
*/ // SKYRAT EDIT END
|
||||
target.dna.features[FEATURE_POD_HAIR] = value
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user