Add powercard drawing
This commit is contained in:
@@ -87,7 +87,7 @@ public Game() {
|
|||||||
gameStatistics = new Statistic();
|
gameStatistics = new Statistic();
|
||||||
initializeDrawPile();
|
initializeDrawPile();
|
||||||
board = new Board();
|
board = new Board();
|
||||||
die = new Die(5, 5,5,5,5,5,5,5,5,3, 6 ,5,5,5,5,5,5,5,5,3 );
|
die = new Die();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -160,6 +160,19 @@ public void received(RequestMoveMessage msg, int from){
|
|||||||
System.out.println("Server: SelectPieceMessage: received(RequestMoveMessage): pieceState: wichtig"+piece.getState());
|
System.out.println("Server: SelectPieceMessage: received(RequestMoveMessage): pieceState: wichtig"+piece.getState());
|
||||||
boolean homeMove = isHomeMove.get(indexOfPiece);
|
boolean homeMove = isHomeMove.get(indexOfPiece);
|
||||||
int targIdx = targetIndex.get(indexOfPiece);
|
int targIdx = targetIndex.get(indexOfPiece);
|
||||||
|
|
||||||
|
Node targetNode = logic.getGame().getBoard().getInfield()[targIdx];
|
||||||
|
|
||||||
|
if(targetNode.isBonus()) {
|
||||||
|
for (Player p : logic.getGame().getPlayersAsList()) {
|
||||||
|
if(p.getColor() == logic.getGame().getActiveColor()) {
|
||||||
|
logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(logic.getGame().draw()));
|
||||||
|
} else {
|
||||||
|
logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Node oldNode = logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(movePiece)];
|
Node oldNode = logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(movePiece)];
|
||||||
oldNode.clearOccupant();
|
oldNode.clearOccupant();
|
||||||
|
|||||||
@@ -70,6 +70,16 @@ public void received(RequestMoveMessage msg, int from){
|
|||||||
//move piece to targetNode
|
//move piece to targetNode
|
||||||
targetNode.setOccupant(piece);
|
targetNode.setOccupant(piece);
|
||||||
|
|
||||||
|
if(targetNode.isBonus()) {
|
||||||
|
for (Player p : logic.getGame().getPlayersAsList()) {
|
||||||
|
if(p.getColor() == logic.getGame().getActiveColor()) {
|
||||||
|
logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(logic.getGame().draw()));
|
||||||
|
} else {
|
||||||
|
logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.choosePieceAutomaton.getTurnAutomaton().setCurrentState(this.choosePieceAutomaton.getTurnAutomaton().getMovePieceState());
|
this.choosePieceAutomaton.getTurnAutomaton().setCurrentState(this.choosePieceAutomaton.getTurnAutomaton().getMovePieceState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user