diff --git a/src/ShipWarfareGUI.java b/src/ShipWarfareGUI.java index 40258d5..a6f7aba 100644 --- a/src/ShipWarfareGUI.java +++ b/src/ShipWarfareGUI.java @@ -398,7 +398,7 @@ public class ShipWarfareGUI extends Player { } catch (Exception e) { e.printStackTrace(); } - if (checkIfDone != 4) { + if (winOrLose(primaryStage)==false) { report.setVisible(true); title.setVisible(true); shipsRemaining.setVisible(true); @@ -490,7 +490,16 @@ public class ShipWarfareGUI extends Player { gunsLeftOrTaken.setVisible(true); if (!winOrLose(primaryStage)) { - usAgainstEnemyDivisor.setVisible(false); + usAgainstEnemyDivisor.setVisible(true); + shipsRemaining.setVisible(true); + gunsLeftOrTaken.setVisible(true); + ShipWarfareGUILogic logic = new ShipWarfareGUILogic(getPlayer()); + logic.setPlayer(getPlayer()); + System.out.println(logic.getReportMessage()); + + shipsRemaining.setText(logic.getShipsRemainingMessage()); + gunsLeftOrTaken.setText(logic.getGunsLeftOrTakenMessage()); + } } diff --git a/src/ShipWarfareGUILogic.java b/src/ShipWarfareGUILogic.java index 59916e1..ce3e597 100644 --- a/src/ShipWarfareGUILogic.java +++ b/src/ShipWarfareGUILogic.java @@ -243,11 +243,10 @@ public class ShipWarfareGUILogic extends Player { this.setGuns(getGuns() - 1); gunFrustration = true; } else { - if (numOfLittyShips > 0) { + if (getNumOfLittyShips() > 0) { int HPTaken = randomValue.nextInt(10); this.setHP(getHP() - (HPTaken)); - } } if (getHP() <= 0) {