Skip to content

Commit

Permalink
Merge pull request #380 from Advanced-Programming-2021/gui
Browse files Browse the repository at this point in the history
debug changePosition, DO after attack - added icon for Graveyard window
  • Loading branch information
kysre authored Jul 9, 2021
2 parents f9df1b4 + 07cc2ee commit ff4a202
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/model/card/MonsterCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void changePosition() {
this.position = PositionMonsters.ATTACK;
} else {
this.position = PositionMonsters.DEFENSE;
this.defenceMode = DefensePosition.DO;
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/model/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public int attackToOpponentCardInAttackPosition(MonsterCard playerCard, MonsterC

public int attackToOpponentCardInDefensePosition(MonsterCard playerCard, MonsterCard opponentCard,
GameBoard playerGameBoard, GameBoard opponentGameBoard) {
int result = 0;
int result;
playerCard.attackMonster(opponentCard);
if (opponentCard.getDefenceMode() == DefensePosition.DO) {
if (opponentCard.getDefense() < playerCard.getAttack()) {
Expand All @@ -450,6 +450,7 @@ public int attackToOpponentCardInDefensePosition(MonsterCard playerCard, Monster
result = 10;
} else result = 11;
} else {
opponentCard.setDefenceMode(DefensePosition.DO);
this.lastOpponentMonsterCard = opponentCard;
if (opponentCard.getDefense() < playerCard.getAttack()) {
result = 12;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/view/gui/DuelMenuGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ public void updateSelectedCard() {
public void showGraveyard() {
showGraveyardPopupWindow = new Stage();
showGraveyardPopupWindow.initModality(Modality.APPLICATION_MODAL);
showGraveyardPopupWindow.getIcons().add(GetImage.getGameIcon());
showGraveyardPopupWindow.setTitle("Graveyard");

BorderPane borderPane = new BorderPane();
Text text = new Text("your graveyard");
text.setFont(new Font("Arial", 14));
Expand Down

0 comments on commit ff4a202

Please sign in to comment.