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 Toggle bionics/deactivate mutations causes bonus stats ignored until next turn #78090

Merged
merged 6 commits into from
Nov 24, 2024

Conversation

osuphobia
Copy link
Contributor

@osuphobia osuphobia commented Nov 23, 2024

Summary

Bugfixes "Toggle bionics/deactivate mutations causes bonus stats ignored until next turn"

Purpose of change

Fix #78050

Describe the solution

We no longer use mods in mutations after #72034, remove relevant codes.
Not to immediately reset stats when toggling bionics so bonus do not get ignored.

Describe alternatives you've considered

Find a way to let mutations modify base stats like it was, but I don't know how to do it.

Testing

Works fine locally.

Additional context

Further audit is needed for enchantments and test cases.

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) Bionics CBM (Compact Bionic Modules) Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Nov 23, 2024
@osuphobia
Copy link
Contributor Author

player_character.set_mutation( trait_test_trait ); // Give the player the spell scool test_trait
player_character.magic->set_spell_level( spell_test_spell_json, 1, &player_character );
player_character.magic->learn_spell( spell_test_spell_pew, player_character, true );
player_character.magic->set_spell_level( spell_test_spell_pew, 4, &player_character );
player_character.magic->learn_spell( spell_test_spell_lava, player_character, true );
player_character.magic->set_spell_level( spell_test_spell_lava, 12, &player_character );
player_character.set_proficiency_practice( proficiency_prof_test, 12_hours );
// Set focus after killing monster, since the character
// gains weakpoint proficiency practice which lowers focus
// (see kill_tracker::notify() -> weakpoint_families::practice_kill())
player_character.set_focus( 24 );
player_character.str_cur = 5;
player_character.dex_cur = 6;
player_character.int_cur = 7;
player_character.per_cur = 8;
player_character.magic->set_mana( 25 );

So npc_compare_int is failing because I removed apply_mods, as the test case relies on set_mutation->set_mutation_unsafe->mutation_effect->apply_mods to call reset_stats in player_character.set_mutation( trait_test_trait ).
Still have no idea how reset_stats is affecting max mana.

@osuphobia osuphobia changed the title Fix Toggle bionics/deactivate mutations causes bonus stats ingnored until next turn Fix Toggle bionics/deactivate mutations causes bonus stats ignored until next turn Nov 23, 2024
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 23, 2024
@Night-Pryanik Night-Pryanik merged commit d9f9225 into CleverRaven:master Nov 24, 2024
21 of 27 checks passed
@osuphobia osuphobia deleted the refactor_enchantment branch November 24, 2024 13:18
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 Bionics CBM (Compact Bionic Modules) <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toggle bionics/deactivate mutations causes bonus stats ignored until next turn
2 participants