added isStart + (DU)

This commit is contained in:
Cedric Beck
2024-12-09 14:14:15 +01:00
parent 0e9ff609ec
commit dfd361d8be
5 changed files with 17 additions and 4 deletions

View File

@@ -128,7 +128,7 @@ private BitmapText createName(String name, boolean first, boolean own){
//renderedSize = 45
hudText.setSize(TEXT_SIZE);
hudText.setColor(first ? ACTIVE_COLOR : own ? OWN_COLOR : NORMAL_COLOR);
hudText.setText(name);
hudText.setText(own ? name + " (Du)" : name);
hudText.setLocalTranslation(PADDING_LEFT,hudText.getHeight()/2, 0);
return hudText;
}

View File

@@ -47,8 +47,12 @@ protected void throwPiece(Piece piece) {
}
private void handleShield(UUID uuid) {
if (logic.getGame().getBoard().getInfieldIndexOfPiece(logic.getGame().getPieceThroughUUID(uuid)) % 10 != 0) {
Board board = logic.getGame().getBoard();
Piece piece = logic.getGame().getPieceThroughUUID(uuid);
Node node = board.getInfield()[board.getInfieldIndexOfPiece(piece)];
if (node.isStart()) {
logic.getGame().getPieceThroughUUID(uuid).setShield(ShieldState.SUPPRESSED);
logic.addNotification(new ShieldActiveNotification(uuid));
logic.addNotification(new ShieldSuppressedNotification(uuid));
} else {
logic.getGame().getPieceThroughUUID(uuid).setShield(ShieldState.ACTIVE);

View File

@@ -95,8 +95,8 @@ public Game() {
*/
private void initializeDrawPile() {
// this.addBonusCards(new TurboCard(), AMOUNT_OF_TURBO_CARDS);
this.addBonusCards(new SwapCard(), AMOUNT_OF_SWAP_CARDS);
// this.addBonusCards(new ShieldCard(), AMOUNT_OF_SHIELD_CARDS);
// this.addBonusCards(new SwapCard(), AMOUNT_OF_SWAP_CARDS);
this.addBonusCards(new ShieldCard(), AMOUNT_OF_SHIELD_CARDS);
Collections.shuffle(this.drawPile);
}

View File

@@ -99,4 +99,8 @@ public boolean isOccupied() {
public boolean isOccupied(Color color) {
return isOccupied() && this.occupant.getColor() == color;
}
public boolean isStart() {
return false;
}
}

View File

@@ -47,4 +47,9 @@ public Color getColor() {
public void setColor(Color color) {
this.color = color;
}
@Override
public boolean isStart() {
return true;
}
}