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

Add tests for BMI effect on speed #39769

Merged
merged 3 commits into from
Apr 21, 2020

Conversation

wapcaplet
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Add tests for BMI effect on speed"

Purpose of change

The effects of being underweight are poorly understood by both developers and some experienced players of the game, and deserve to be brought to light.

Describe the solution

Add a test case for player::kcal_speed_penalty testing and illustrating the effect of BMI (stored kcals) on overall speed:

  • Normal weight (BMI 18.5 - 25) or heavier: No penalty
  • Underweight (BMI 16 - 18): Reduces speed by 5% to 25%
  • Emaciated, skeletal: Reduces speed by 31% to 90%

Describe alternatives you've considered

Keeping it a secret

Testing

tests/cata_test [bmi][speed]

Additional context

Discussed with other devs in discord; @KorGgenT and @kevingranade agreed there are no plans to reduce speed for being overweight, so I also removed a couple of comments in src/player.cpp to that effect.

@wapcaplet
Copy link
Contributor Author

wapcaplet commented Apr 21, 2020

Clang-tidy spews a pile of errors that I cannot make sense of, and are totally unrelated to this PR:

/home/runner/work/Cataclysm-DDA/Cataclysm-DDA/src/faction.cpp:896:17: error: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage,-warnings-as-errors]
            if( guy->has_companion_mission() ) {
                ^
/home/runner/work/Cataclysm-DDA/Cataclysm-DDA/src/faction.cpp:816:5: note: Loop condition is true.  Entering loop body
    while( true ) {
    ^
/home/runner/work/Cataclysm-DDA/Cataclysm-DDA/src/faction.cpp:833:9: note: Null pointer value stored to 'guy'
        guy = nullptr;
        ^

These appear to be related to changes added in #39753

@wapcaplet wapcaplet force-pushed the body-weight-effects branch from 7d55be1 to b0461b2 Compare April 21, 2020 02:22
@kevingranade kevingranade merged commit 43af505 into CleverRaven:master Apr 21, 2020
@wapcaplet wapcaplet deleted the body-weight-effects branch April 25, 2020 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants