pongstylin / tactics

A tactical turn-based board game
The Unlicense
75 stars 23 forks source link

Fix bug with incorrect wait time when berserker attacks friendly unit #120

Closed gr8st closed 1 year ago

gr8st commented 1 year ago

Second fix for berserker after realizing there is a second bug for units that already have a recovery time.

Testing

http://localhost:2000

"Fixing the bug" test

  1. Attack friendly unit with berserker
  2. Recovery changes to 1
  3. End turn - observe recovery stays at 1

Regression tests

  1. Attack friendly unit with berserker which has a recovery time of 2
  2. Recovery changes to 3
  3. End turn - observe recovery falls to 2

  4. Attack enemy unit with berserker
  5. Recovery changes to 1
  6. End turn - recovery stays at 1 (for enemy unit)
  7. End turn again - recovery falls to 0 (back to player's turn)

  8. Attack enemy unit with berserker which has a recovery time of 2
  9. Recovery changes to 3
  10. End turn - recovery stays at 3 (for enemy unit)
  11. End turn again - recovery falls to 2 (back to player's turn)

  12. Heal with cleric
  13. Recovery of 3
  14. End turn - recovery stays at 3
  15. End turn - recovery stays at 3 (enemy turn)
  16. End turn - recovery falls to 2