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

Correctly display pain penalties. #74116

Merged
merged 3 commits into from
May 28, 2024
Merged

Conversation

osuphobia
Copy link
Contributor

Summary

Bugfixes "Correctly display pain penalties."

Purpose of change

Fix #72854

Describe the solution

After calculating and applying the pain penalties, save the numbers, then read them when displaying under EFFECTS in the character window.
Also fix the stats of character can get lower than 1 by pain penalties.

Describe alternatives you've considered

Use get_stat_base instead of get_stat in Character::get_pain_penalty to calculate the penalties.

Testing

Compiled and tested locally.

Additional context

2024-05-26 233028
With 100 pain, stats are: 6/12 str, 3/12 dex, 1/12 int, 1/12 per, and the pain penalties are displayed correctly.

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Enchantments / Spells Enchantments and spells <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels May 26, 2024
src/character.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 26, 2024
@osuphobia
Copy link
Contributor Author

osuphobia commented May 27, 2024

There is another issue existing, and I'm not sure if it can be fixed in this PR, or worth opening a separate PR.
That is, NPCs' stats are not actually affected by pain.

https://discord.com/channels/598523535169945603/598535827169083403/1244629105991876660
Seems that there is no need for me to do further adjustment right now.

@osuphobia osuphobia marked this pull request as ready for review May 27, 2024 12:36
@Maleclypse Maleclypse merged commit c63005b into CleverRaven:master May 28, 2024
24 of 26 checks passed
@osuphobia osuphobia deleted the pain branch May 29, 2024 00:42
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` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Mechanics: Enchantments / Spells Enchantments and spells
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pain. Incorrect display of characteristic penalty.
4 participants