Skip to content

Commit

Permalink
Improve character heal_rate tests
Browse files Browse the repository at this point in the history
Describe plainly how healing works, in terms of the Character functions
that calculate healing rate per turn, and enforce the current behavior
with simple test cases.

The `healing_rate` and `healing_rate_medicine` functions have the
following behavior, as tested:

Baseline healing is 8.64 HP per day while sleeping, 0 while awake. This
base rate comes from `data/json/game_balance.json : PLAYER_HEALING_RATE`.

Traits like "Poor healer", "Regeneration", and "Rapid Metabolism" affect
healing rate, with different multipliers for awake and asleep rates.

Hidden health stat `[-200, +200]` influences healing rate, with +200
doubling healing, and -200 giving no healing at all, even while asleep.

Bandages and/or disinfectant each add 1-3 HP/day to healing rate while
awake, doubled to 2-6 HP/day while sleeping. The head gets less benefit
while the torso gets the most benefit from these treatments; the limbs
all get the same moderate benefit.

When bandages and disinfectant are used together, not only do their
effects combine, they are again doubled, giving +4-12 HP/day while
awake (head 4, limbs 8, torso 12), and +8-24 HP/day while asleep.

Changes in this commit:

- Add top-level documentation and coverage notes
- Use constants for hp_per_day, tolerance, and effects
- Include descriptions for all trait/mutation healing factors
- Add heal_rate_medicine tests for bandages and/or disinfectant
  • Loading branch information
wapcaplet committed Apr 26, 2020
1 parent 5c5876c commit 45d26b1
Showing 1 changed file with 241 additions and 54 deletions.
Loading

0 comments on commit 45d26b1

Please sign in to comment.