From edef74f5305f216a9fd97e80e50cb3d26cee35d0 Mon Sep 17 00:00:00 2001 From: Negarbsh Date: Sat, 26 Jun 2021 23:56:20 +0430 Subject: [PATCH] something else --- src/main/java/controller/game/MainPhaseController.java | 1 + src/main/java/controller/game/RoundController.java | 10 ++++++++-- src/main/java/controller/game/SummonController.java | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/controller/game/MainPhaseController.java b/src/main/java/controller/game/MainPhaseController.java index 03b2806..143e893 100644 --- a/src/main/java/controller/game/MainPhaseController.java +++ b/src/main/java/controller/game/MainPhaseController.java @@ -29,6 +29,7 @@ public class MainPhaseController { public MainPhaseController(RoundController controller) { this.controller = controller; this.player = controller.getCurrentPlayer(); + SummonController.resetNumOfNormalSummons(); } diff --git a/src/main/java/controller/game/RoundController.java b/src/main/java/controller/game/RoundController.java index 42bdfc3..bd1d0e0 100644 --- a/src/main/java/controller/game/RoundController.java +++ b/src/main/java/controller/game/RoundController.java @@ -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; @@ -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! } diff --git a/src/main/java/controller/game/SummonController.java b/src/main/java/controller/game/SummonController.java index 0db7db8..32367a8 100644 --- a/src/main/java/controller/game/SummonController.java +++ b/src/main/java/controller/game/SummonController.java @@ -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; @@ -27,13 +28,16 @@ public class SummonController { public SummonController(MonsterCardInUse monsterCardInUse, Monster monster, RoundController controller, ArrayList 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");