fixed shield state for waiting state
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
import pp.mdga.game.Node;
|
import pp.mdga.game.Node;
|
||||||
import pp.mdga.game.Piece;
|
import pp.mdga.game.Piece;
|
||||||
import pp.mdga.game.PieceState;
|
import pp.mdga.game.PieceState;
|
||||||
|
import pp.mdga.game.ShieldState;
|
||||||
import pp.mdga.message.server.*;
|
import pp.mdga.message.server.*;
|
||||||
import pp.mdga.notification.*;
|
import pp.mdga.notification.*;
|
||||||
|
|
||||||
@@ -34,12 +35,6 @@ public void received(CeremonyMessage msg) {
|
|||||||
logic.setState(logic.getCeremony());
|
logic.setState(logic.getCeremony());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void received(DiceNowMessage msg) {
|
|
||||||
logic.addNotification(new DiceNowNotification());
|
|
||||||
parent.setState(parent.getTurn());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void received(DieMessage msg) {
|
public void received(DieMessage msg) {
|
||||||
logic.getGame().setDiceEyes(msg.getDiceEye());
|
logic.getGame().setDiceEyes(msg.getDiceEye());
|
||||||
@@ -72,6 +67,13 @@ public void received(ActivePlayerMessage msg) {
|
|||||||
logic.getGame().setActiveColor(msg.getColor());
|
logic.getGame().setActiveColor(msg.getColor());
|
||||||
if(msg.getColor() == logic.getGame().getPlayers().get(logic.getOwnPlayerId()).getColor()) {
|
if(msg.getColor() == logic.getGame().getPlayers().get(logic.getOwnPlayerId()).getColor()) {
|
||||||
parent.setState(parent.getTurn());
|
parent.setState(parent.getTurn());
|
||||||
|
} else {
|
||||||
|
for (Piece piece : logic.getGame().getActivePlayer().getPieces()){
|
||||||
|
if (piece.isShielded() || piece.isSuppressed()){
|
||||||
|
logic.addNotification(new RemoveShieldNotification(piece.getUuid()));
|
||||||
|
piece.setShield(ShieldState.NONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,6 +141,15 @@ public void received(MoveMessage msg) {
|
|||||||
}
|
}
|
||||||
//set new node
|
//set new node
|
||||||
logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece);
|
logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece);
|
||||||
|
if (logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].isStart()){
|
||||||
|
if (piece.isShielded()){
|
||||||
|
piece.setShield(ShieldState.SUPPRESSED);
|
||||||
|
logic.addNotification(new ShieldSuppressedNotification(piece.getUuid()));
|
||||||
|
}
|
||||||
|
} else if (piece.isSuppressed()){
|
||||||
|
piece.setShield(ShieldState.ACTIVE);
|
||||||
|
logic.addNotification(new ShieldActiveNotification(piece.getUuid()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
System.out.println("send AnimationEndMessage");
|
System.out.println("send AnimationEndMessage");
|
||||||
logic.getGame().setTurboFlag(false);
|
logic.getGame().setTurboFlag(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user