From 213955bc3796dace32f435b2c1ef6ca0ede73502 Mon Sep 17 00:00:00 2001 From: punchready Date: Mon, 31 May 2021 17:37:37 +0200 Subject: [PATCH] fix: reset turnCount at the beginning of a new round --- .../teamname/marvelous/gamelibrary/gamelogic/GameLogic.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java index 6fd9a36..e6766b0 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java @@ -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 result = new ArrayList<>(); state.roundNumber++; + state.turnNumber = 0; if(state.roundNumber >= 1 && state.roundNumber <= 6) { result.addAll(handleGoose(state));