Merge commit

This commit is contained in:
Felix Koppe
2024-12-09 03:17:47 +01:00
6 changed files with 6 additions and 34 deletions

View File

@@ -172,8 +172,8 @@ private void handleGame(Notification notification) {
} else if (notification instanceof ThrowPieceNotification n) { } else if (notification instanceof ThrowPieceNotification n) {
boardHandler.throwPiece(n.getPieceId(), n.getThrowColor()); boardHandler.throwPiece(n.getPieceId(), n.getThrowColor());
waitForAnimation = true; waitForAnimation = true;
} else if (notification instanceof NoShieldNotification n) { } else if (notification instanceof RemoveShieldNotification n) {
boardHandler.unshieldPiece(n.getPieceId()); boardHandler.unshieldPiece(n.getPieceUuid());
} else if (notification instanceof PlayCardNotification n) { } else if (notification instanceof PlayCardNotification n) {
if(n.getCard() == BonusCard.TURBO) { if(n.getCard() == BonusCard.TURBO) {
guiHandler.turbo(); guiHandler.turbo();

View File

@@ -529,7 +529,6 @@ private void throwPiece(UUID uuid){
* @param uuid the UUID of the piece to shield * @param uuid the UUID of the piece to shield
*/ */
public void shieldPiece(UUID uuid){ public void shieldPiece(UUID uuid){
pieces.get(uuid).activateShield(); pieces.get(uuid).activateShield();
} }

View File

@@ -113,6 +113,7 @@ public Vector3f getLocation(){
protected void controlUpdate(float delta) { protected void controlUpdate(float delta) {
if(shieldRing != null){ if(shieldRing != null){
shieldRing.rotate(0, 0, delta * SHIELD_SPEED); shieldRing.rotate(0, 0, delta * SHIELD_SPEED);
shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0,0,SHIELD_Z)));
} }
} }

View File

@@ -87,6 +87,7 @@ public void selectCard(BonusCard card){
@Override @Override
public void received(PlayCardMessage msg){ public void received(PlayCardMessage msg){
if(msg.getCard().getCard().equals(BonusCard.TURBO)){ if(msg.getCard().getCard().equals(BonusCard.TURBO)){
logic.getGame().setDiceModifier(msg.getDiceModifier());
parent.getParent().getPlayPowerCard().setPlayCard(msg); parent.getParent().getPlayPowerCard().setPlayCard(msg);
parent.getParent().setState(parent.getParent().getPlayPowerCard()); parent.getParent().setState(parent.getParent().getPlayPowerCard());
} }

View File

@@ -92,9 +92,9 @@ public Game() {
* This method initializes the draw pile with the predefined number of bonus cards. * This method initializes the draw pile with the predefined number of bonus cards.
*/ */
private void initializeDrawPile() { private void initializeDrawPile() {
// this.addBonusCards(new TurboCard(), AMOUNT_OF_TURBO_CARDS); this.addBonusCards(new TurboCard(), AMOUNT_OF_TURBO_CARDS);
// this.addBonusCards(new SwapCard(), AMOUNT_OF_SWAP_CARDS); // this.addBonusCards(new SwapCard(), AMOUNT_OF_SWAP_CARDS);
this.addBonusCards(new ShieldCard(), AMOUNT_OF_SHIELD_CARDS); // this.addBonusCards(new ShieldCard(), AMOUNT_OF_SHIELD_CARDS);
Collections.shuffle(this.drawPile); Collections.shuffle(this.drawPile);
} }

View File

@@ -1,29 +0,0 @@
package pp.mdga.notification;
import java.util.UUID;
/**
* Notification that a piece has no shield.
*/
public class NoShieldNotification extends Notification{
/**
* The id of the piece that has no shield.
*/
private final UUID pieceId;
/**
* Constructor.
* @param pieceId the id of the piece that has no shield.
*/
public NoShieldNotification(UUID pieceId) {
this.pieceId = pieceId;
}
/**
* Get the id of the piece that has no shield.
* @return the id of the piece that has no shield.
*/
public UUID getPieceId() {
return pieceId;
}
}