fix: reset turnCount at the beginning of a new round
This commit is contained in:
parent
a69d8b916f
commit
213955bc37
@ -381,6 +381,7 @@ class GameLogic {
|
|||||||
* Verifies that a {@link Character} is alive.
|
* Verifies that a {@link Character} is alive.
|
||||||
*/
|
*/
|
||||||
private static void requireAlive(Character entity) throws InvalidRequestException {
|
private static void requireAlive(Character entity) throws InvalidRequestException {
|
||||||
|
//TODO: only characters are allowed here
|
||||||
if(entity.hp.getValue() <= 0 || !entity.isActive()) {
|
if(entity.hp.getValue() <= 0 || !entity.isActive()) {
|
||||||
throw new InvalidRequestException();
|
throw new InvalidRequestException();
|
||||||
}
|
}
|
||||||
@ -607,6 +608,7 @@ class GameLogic {
|
|||||||
ArrayList<Event> result = new ArrayList<>();
|
ArrayList<Event> result = new ArrayList<>();
|
||||||
|
|
||||||
state.roundNumber++;
|
state.roundNumber++;
|
||||||
|
state.turnNumber = 0;
|
||||||
|
|
||||||
if(state.roundNumber >= 1 && state.roundNumber <= 6) {
|
if(state.roundNumber >= 1 && state.roundNumber <= 6) {
|
||||||
result.addAll(handleGoose(state));
|
result.addAll(handleGoose(state));
|
||||||
|
Loading…
Reference in New Issue
Block a user