Skip to content

feat: Allow Json to Specify Swappable Traits#8372

Open
AzmodiusX wants to merge 6 commits intocataclysmbn:mainfrom
AzmodiusX:Jsonify-Char-Create-Hardcodes
Open

feat: Allow Json to Specify Swappable Traits#8372
AzmodiusX wants to merge 6 commits intocataclysmbn:mainfrom
AzmodiusX:Jsonify-Char-Create-Hardcodes

Conversation

@AzmodiusX
Copy link
Collaborator

Purpose of change (The Why)

Character creation has several traits that are mutually exclusive. A while back I made it so you could swap these traits, partially to enforce having one of them as mandatory, and partially so you could swap between them for the preview (these are typically appearance traits).
I wanted to abstract this to JSON, but it was out of scope.

Describe the solution (The How)

Implemented 4 new mutation flags:
MALE_EXCLUSIVE
FEMALE_EXCLUSIVE
MALE_PREFERRED
FEMALE_PREFERRED

These new flags just handle gendered mutation blocking. Scenarios, classes, etc. can bypass this easily enough. Now you can have your hyper anime hair mod only spawn on women, I guess.
It also abstracted the implementation for facial hair on women already in the game; They don't spawn with it, but the player can pick it at the start if they want to, because choice is cool.

Added optional field to mutation_type mandatory_one requiring at least one of that type to be picked in the trait selection screen.
Added optional field to mutation_type swap_on_conflict which does as the name implies. mandatory_one implies this for convenience.

Describe alternatives you've considered

We could just keep it all hard-coded.

Testing

Compiled and checked character creation and such.

Additional context

Needs docs, will do tomorrow.

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Mar 24, 2026
@AzmodiusX AzmodiusX changed the title feat(json): Allow Json to Specify Swappable Traits feat: Allow Json to Specify Swappable Traits Mar 24, 2026
@autofix-ci
Copy link
Contributor

autofix-ci bot commented Mar 24, 2026

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

@AzmodiusX AzmodiusX marked this pull request as ready for review March 24, 2026 21:32
@github-actions github-actions bot added the docs PRs releated to docs page label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs PRs releated to docs page JSON related to game datas in JSON format. src changes related to source code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant