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

Toggle bionics/deactivate mutations causes bonus stats ignored until next turn #78050

Closed
osuphobia opened this issue Nov 21, 2024 · 3 comments · Fixed by #78090
Closed

Toggle bionics/deactivate mutations causes bonus stats ignored until next turn #78050

osuphobia opened this issue Nov 21, 2024 · 3 comments · Fixed by #78090
Labels
Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies (S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@osuphobia
Copy link
Contributor

osuphobia commented Nov 21, 2024

Describe the bug

Activate/deactivate bionics or deactivate mutations will make bonus stats temporarily not applied to PC.
Didn't check if it's a display-only issue or it actually affects your abilities.

Attach save file

Saint Bernard-trimmed.tar.gz

Steps to reproduce

1.Load the save, toggle bionics/mutations, wait a turn, see how stats change.

Expected behavior

Bonus stats displayed/applied correctly.

Screenshots

2024-11-21.141443.mp4

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.22631.4460 (23H2)
  • Game Version: c544d81 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Slowdown Fungal Growth [no_fungal_growth]
    ]

Additional context

No response

@osuphobia osuphobia added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Nov 21, 2024
@osuphobia
Copy link
Contributor Author

osuphobia commented Nov 23, 2024

Turns out that this is another piece of the enchantment mess.
Toggle bionics will call Character::reset, while deactivate mutations will call Character::apply_mods. Both will call Character::reset_stats, but the stats do not get calculated correctly, so you need to wait till next turn to refresh the stats.
For Character::apply_mods, if no debuff to stats exists, it seems to be working correctly, but when debuffs that reduce your stats exists, it just apply the debuffs ever time this function is called.
Character::apply_mods is also called when you get or lose a mutation, as it does not work properly, mutations that should add stat to base stats instead give bonus stats now.
Disabling the reset functions will solve this issue.

2024-11-23.12-56-07.MP4

@osuphobia
Copy link
Contributor Author

osuphobia commented Nov 23, 2024

but when debuffs that reduce your stats exists, it just apply the debuffs ever time this function is called.

So if I change reset_stats to reset in apply_mods, this will not happen. Pain penalties will be counted multiple times if you do not clear hardcoded effects first. It still make bonus stats ingnored though.

@osuphobia
Copy link
Contributor Author

Ahh, get_mod apply_mods no longer work, as we already moved from stat mod to enchantment.

@osuphobia osuphobia changed the title Toggle bionics/deactivate mutations causes bouns stats ingnored until next turn Toggle bionics/deactivate mutations causes bonus stats ingnored until next turn Nov 23, 2024
@NetSysFire NetSysFire changed the title Toggle bionics/deactivate mutations causes bonus stats ingnored until next turn Toggle bionics/deactivate mutations causes bonus stats ignored until next turn Nov 23, 2024
@NetSysFire NetSysFire added the Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies (S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
2 participants