Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MrMelbert
Copy link
Member

About The Pull Request

Rather than having 100 separate list variables on SSaccessories, have 1 list for all feature keys that are associated with sprite accessories

This way you can get a feature by doing SSaccessories.feature_list[key], instead of necessitating SSaccessories.ears_list, SSaccessories.tail_list, etc.

This lets us cut back on a lot of boilerplate in prefs, dna, and organs

Why It's Good For The Game

We can see the benefit in this example: This is all the code for horn DNA, bodypart overlay, and preference

/datum/dna_block/feature/accessory/horn
	feature_key = FEATURE_HORNS
/datum/bodypart_overlay/mutant/horns
	layers = EXTERNAL_ADJACENT
	feature_key = FEATURE_HORNS
	dyable = TRUE

/datum/bodypart_overlay/mutant/horns/can_draw_on_bodypart(obj/item/bodypart/bodypart_owner)
	return !(bodypart_owner.owner?.obscured_slots & HIDEHAIR)
/datum/preference/choiced/species_feature/lizard_horns
	savefile_key = "feature_lizard_horns"
	savefile_identifier = PREFERENCE_CHARACTER
	category = PREFERENCE_CATEGORY_FEATURES
	main_feature_name = "Horns"
	should_generate_icons = TRUE
	relevant_organ = /obj/item/organ/horns

/datum/preference/choiced/species_feature/lizard_horns/icon_for(value)
	return generate_lizard_side_shot(get_accessory_for_value(value), "horns")

Changelog

🆑 Melbert
refactor: Refactored species unique organs slightly, particularly how they are set up at game start. Report any oddities, like invisible tails or wings
/:cl:

@github-actions github-actions bot added the Refactor Makes the code harder to read label Oct 22, 2025
@github-actions github-actions bot requested a review from Time-Green October 22, 2025 00:29
@Tsar-Salat
Copy link

Hell yeah.

From a downstream codebase that just recently made the bp overlay and accessories subsystem jump, this is very nice 👍

@MrMelbert
Copy link
Member Author

Next step says we can prolly auto-generate dna blocks for mutant bodypart overlays

image

Copy link
Member

@Time-Green Time-Green left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's beautiful. Experience tells me this will need a TM
Actually you have webpanel access, can you just throw it on a server for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Makes the code harder to read

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants