Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
HastiKarimi committed Jun 26, 2021
2 parents 746abaf + edef74f commit e4956fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/java/controller/game/MainPhaseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class MainPhaseController {
public MainPhaseController(RoundController controller) {
this.controller = controller;
this.player = controller.getCurrentPlayer();
SummonController.resetNumOfNormalSummons();
}


Expand Down
10 changes: 8 additions & 2 deletions src/main/java/controller/game/RoundController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class RoundController {
private Player rival;
private Player winner;
private Player loser;
private boolean isDraw = false;

private Phase currentPhase;
private ActionsOnRival actionsOnRival;
Expand Down Expand Up @@ -175,13 +176,18 @@ public void setRoundWinner(RoundResult roundResult) { //I think it needs an inpu
loser = currentPlayer;
break;
case DRAW:
//todo
isDraw = true;
break;
}
}

public void announceRoundWinner() {
if (winner == null || loser == null) return;//todo!
//todo: draw isn't complete but:
if (isDraw) {
Print.print("Draw!");
return;
}
if (winner == null || loser == null) return;
this.duelMenuController.handleRoundWinner(winner.getOwner(), loser.getOwner(), winner.getLifePoint(), loser.getLifePoint(), 1, 0, this.roundIndex);
//todo: not sure what to put as the scores!
}
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/controller/game/SummonController.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import java.util.ArrayList;

public class SummonController {

private final Monster monster;
private int numOfNormalSummons;
private static int numOfNormalSummons = 0;
private final RoundController controller;
private MonsterCardInUse monsterCardInUse;
private final Board board;
Expand All @@ -27,13 +28,16 @@ public class SummonController {

public SummonController(MonsterCardInUse monsterCardInUse, Monster monster, RoundController controller, ArrayList<CardInUse> summonedCards) {
this.monster = monster;
this.numOfNormalSummons = 0;
this.controller = controller;
this.monsterCardInUse = monsterCardInUse;
this.board = controller.getCurrentPlayerBoard();
this.summonedCards = summonedCards;
}

public static void resetNumOfNormalSummons() {
numOfNormalSummons = 0;
}

public void normal() throws AlreadyDoneAction, NotEnoughTributes {
if (numOfNormalSummons != 0) {
if (!hasExtraSummonPermission || monster.getLevel() >= 5) throw new AlreadyDoneAction("summoned");
Expand Down

0 comments on commit e4956fb

Please sign in to comment.