Before abandoning destroyLittyShipsOrEscape separation

This commit is contained in:
KahootChampion
2019-04-06 21:50:54 -06:00
parent 5d0e349ffb
commit f8ee683728
2 changed files with 12 additions and 4 deletions

View File

@@ -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());
}
}

View File

@@ -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) {