From d558e7cf0cc1289be6ce2bf77aebff84469054af Mon Sep 17 00:00:00 2001 From: KahootChampion Date: Sun, 10 Mar 2019 01:44:02 -0700 Subject: [PATCH] Fixed the loot system a bit --- .idea/workspace.xml | 66 ++++++++++++++++------------------------- src/ShipWarfareGUI.java | 11 ++++--- 2 files changed, 33 insertions(+), 44 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a33200b..cf4458d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,12 +1,7 @@ - - - - - - + @@ -18,7 +13,7 @@ - + @@ -30,23 +25,6 @@ - - - - - - - - - - - - - - - - - @@ -288,7 +266,7 @@ - + 1550458470138 @@ -444,11 +422,18 @@ - - @@ -574,7 +559,8 @@ - @@ -651,16 +637,6 @@ - - - - - - - - - - @@ -670,8 +646,8 @@ - - + + @@ -683,6 +659,16 @@ + + + + + + + + + + diff --git a/src/ShipWarfareGUI.java b/src/ShipWarfareGUI.java index 9b251bf..6f32a61 100644 --- a/src/ShipWarfareGUI.java +++ b/src/ShipWarfareGUI.java @@ -42,6 +42,7 @@ public class ShipWarfareGUI extends Application { private Label HPLeft; private Label gunsLeftOrTaken; private Label continueToFight; + private int counter1; public static void main(String args[]) { @@ -181,9 +182,12 @@ public class ShipWarfareGUI extends Application { * @param numOfPeasantShips the number of ships to be used in the peasant fleet attack */ - public void setNumOfPeasantShips(int numOfPeasantShips) { + public void setNumOfPeasantShips(int numOfPeasantShips){ + counter1++; this.numOfPeasantShips = numOfPeasantShips; - startingPeasantShips = numOfPeasantShips; + if(counter1==1) { + startingPeasantShips = numOfPeasantShips; + } } @@ -487,8 +491,7 @@ public class ShipWarfareGUI extends Application { if (exitValue == 1) { wipe(); chooseFightOrRun.setText(String.format("Ayy We won! We survived at %d%% ship status!", player.getHP())); - System.out.printf("\nGot eem\nVictory!\nIt appears we have defeated the enemy fleet and made it out at %d%% ship status\n", player.getHP()); - calculateLoot = (randomValue.nextInt(startingPeasantShips) + startingPeasantShips) * 100; + calculateLoot = (startingPeasantShips *100) + randomValue.nextInt(startingPeasantShips) *200; player.setMoney(player.getMoney() + calculateLoot); report.setText(String.format("We got $%,d! ", calculateLoot)); return true;