made turbo flag work with only one flag

This commit is contained in:
Fleischer Hanno
2024-12-09 03:39:24 +01:00
parent 38687b6d25
commit be8d4b2d6e
8 changed files with 7 additions and 10 deletions

View File

@@ -27,6 +27,7 @@ public GameStates(ClientState parent, ClientGameLogic logic) {
protected void handlePowerCard(PlayCardMessage msg) {
if (msg.getCard().getCard().equals(BonusCard.TURBO)) {
logic.getGame().setTurboFlag(true);
logic.getGame().setDiceModifier(msg.getDiceModifier());
} else if (msg.getCard().getCard().equals(BonusCard.SHIELD)) {
handleShield(msg.getPieces().get(0).getUuid());

View File

@@ -94,6 +94,7 @@ public void received(MoveMessage msg) {
//set new node
logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece);
}
logic.getGame().setTurboFlag(false);
parent.setState(parent.getAnimation());
}
}

View File

@@ -111,6 +111,7 @@ public void received(MoveMessage msg) {
//set new node
logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece);
}
logic.getGame().setTurboFlag(false);
parent.setState(parent.getAnimation());
}
}

View File

@@ -24,13 +24,6 @@ public RollDiceState(ClientState parent, ClientGameLogic logic) {
@Override
public void enter() {
logic.addNotification(new DiceNowNotification());
if (logic.getGame().getTurboFlag()){
if (parent.isCanChangeTurbo()){
logic.getGame().setTurboFlag(false);
} else {
parent.setCanChangeTurbo(true);
}
}
}
@Override

View File

@@ -72,6 +72,7 @@ public void received(StartPieceMessage msg){
@Override
public void received(NoTurnMessage msg){
logic.getGame().setTurboFlag(false);
parent.getParent().getParent().setState(parent.getParent().getParent().getWaiting());
}
}

View File

@@ -71,7 +71,7 @@ public void received(MoveMessage msg) {
//set new node
logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece);
}
logic.getGame().setTurboFlag(false);
parent.getParent().setState(parent.getParent().getMovePiece());
}
}

View File

@@ -65,7 +65,7 @@ public void received(MoveMessage msg){
targetNode.setOccupant(msg.getPiece());
logic.addNotification(new MovePieceNotification(msg.getPiece().getUuid(), oldIndex, targetIndex));
logic.getGame().setTurboFlag(false);
parent.getParent().setState(parent.getParent().getMovePiece());
}
}

View File

@@ -49,7 +49,7 @@ public void received(MoveMessage msg){
logic.addNotification(new MovePieceNotification(pieceToMove.getUuid(), logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getStartNodeIndex(), true));
logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(msg.getPiece());
logic.getGame().setTurboFlag(false);
pieceToMove.setState(PieceState.ACTIVE);
parent.getParent().setState(parent.getParent().getMovePiece());
}