Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix active transformable mutations not contributing instability #72919

Conversation

anoobindisguise
Copy link
Contributor

Summary

Bugfixes "Transformed active mutations (extended claws etc) properly cause instability"

Purpose of change

Someone asked how the new instability system interacts with mutations that transform, since their transformed variants have valid:false (you mutate only the inactive version of the trait). As a result when active they didn't cause instability.

Describe the solution

If the first check is failed, then also try checking to see if it has a transformed mutation target, and if it does, if that target is valid, and if it is, if either it or its transformed version has >-1 point cost.

Describe alternatives you've considered

n/a

Testing

Tried on mainline; mutated long fingernails -> claws -> retracted claws, extended my claws, and then used Alpha mutagen. Instability was 0.
Compiled the branch with my changes locally. Mutated long fingernails -> claws -> retracted claws, extended my claws, and then used Alpha mutagen. Instability was 6 as expected.

Additional context

anoobindisguise and others added 5 commits April 8, 2024 16:15
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Apr 9, 2024
@Venera3
Copy link
Member

Venera3 commented Apr 9, 2024

The major limb mutations use long-term transformations into otherwise-imvalid mutations so this will still miss them - they do have changes_to generally, so you could filter there as well.

What's the reason for the validity check in the first place?

@anoobindisguise
Copy link
Contributor Author

anoobindisguise commented Apr 9, 2024

What's the reason for the validity check in the first place?

So, I'm checking validity because I'm counting all traits the player has, but not all traits they have that aren't base traits are mutations. The alternative would be to for each trait check if its category entry isn't empty if it wasn't a base trait or a threshold or negative which would work since Extended Claws for example belongs to Feline but isn't valid. I was using valid as a shorthand for "it is mutable". If there are other technically-mutable but invalid mutations then this solution might not work perfectly. But checking for a non empty category might be easier.

@Venera3
Copy link
Member

Venera3 commented Apr 9, 2024

Since we don't do category-less actual mutations that would be my suggestion, yeah. As long as you document that invalid traits still need a category to count for instability it shouldn't lead to too much breakage.

(also, please document the new instability cal in mutations.md in some form)

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 9, 2024
@anoobindisguise
Copy link
Contributor Author

Since we don't do category-less actual mutations that would be my suggestion, yeah. As long as you document that invalid traits still need a category to count for instability it shouldn't lead to too much breakage.

(also, please document the new instability cal in mutations.md in some form)

OK, I did this and confirmed it looks like it's working.

src/mutation.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Apr 10, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 10, 2024
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 12, 2024
@Maleclypse Maleclypse merged commit 0a3e18c into CleverRaven:master Apr 21, 2024
20 of 25 checks passed
@anoobindisguise anoobindisguise deleted the anoobindisguise-transformmutsinstab branch July 31, 2024 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants