fix: reset turnCount at the beginning of a new round

This commit is contained in:
punchready 2021-05-31 17:37:37 +02:00
parent a69d8b916f
commit 213955bc37

View File

@ -381,6 +381,7 @@ class GameLogic {
* Verifies that a {@link Character} is alive.
*/
private static void requireAlive(Character entity) throws InvalidRequestException {
//TODO: only characters are allowed here
if(entity.hp.getValue() <= 0 || !entity.isActive()) {
throw new InvalidRequestException();
}
@ -607,6 +608,7 @@ class GameLogic {
ArrayList<Event> result = new ArrayList<>();
state.roundNumber++;
state.turnNumber = 0;
if(state.roundNumber >= 1 && state.roundNumber <= 6) {
result.addAll(handleGoose(state));