-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add perceived kwarg to pain_eval math function, apply it in Mind Over Matter #72938
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-requesting reviews from non-collaborators: @andrei8l
I think a kwarg for Cataclysm-DDA/src/math_parser_diag.cpp Lines 1207 to 1209 in 2c47a81
Cataclysm-DDA/src/math_parser_diag.cpp Line 1214 in 2c47a81
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Infrastructure "Add perceived kwarg to pain_eval math function, apply it in Mind Over Matter"
Purpose of change
While investigating #72882, I discovered that u_pain() checks the absolute pain the character suffers, not the relative pain they're feeling, taking into account any effects that ameliorate the absolute pain (such as painkillers). That seems like a useful function to be able to check.
Fixes #72882.
Describe the solution
Add a perceived kwarg to the pain_eval function, as suggested by Andrei8l and implemented by Guardian DII. I just uploaded the changes.
In Mind Over Matter, changed the function that disables your powers to check
u_pain('type': 'perceived')
, notu_pain()
Describe alternatives you've considered
Testing
Followed the reproduction instructions in the above issue: set pain to 50, took 2 codeine, waited 15 minutes. Results--powers were usable even though debug menu showed current pain as 48. When pain 50 was assigned, powers were still unusable.
Also GuardianDII tested it and told me it worked.
Additional context
Thank you GuardianDII for giving me the answer since I've been remodeling the condo over the weekend and haven't had time to look up how kwargs work.