Fixed ShipWarfare bug about one-shotting.

This commit is contained in:
KahootChampion
2019-03-10 22:43:25 -06:00
parent 666e409e74
commit c6df980f8e
4 changed files with 125 additions and 172 deletions

View File

@@ -250,7 +250,10 @@ public class ShipWarfareGUI {
player.setGuns(player.getGuns() - 1);
gunFrustration = true;
} else {
player.setHP(player.getHP() - (1 + randomValue.nextInt(10)));
if (numOfPeasantShips>0) {
player.setHP(player.getHP() - (1 + randomValue.nextInt(10)));
}
}
if (player.getHP() <= 0) {
exitValue = 2;
@@ -290,6 +293,12 @@ public class ShipWarfareGUI {
return false;
}
/**
* Sets up the graphical part of ShipWarfare
* @param stage sets the stage to which we will execute the scene of the ShipWarfare class
* @return
*/
public Stage initializeShip(Stage stage){
setNumOfPeasantShips(numOfShips());