From 1bb00d0d01197467af806678b1a40f3ba936a69d Mon Sep 17 00:00:00 2001 From: KahootChampion Date: Sat, 9 Mar 2019 22:32:45 -0700 Subject: [PATCH 1/2] Super broken but fight button is in progress for shipwarfare --- .idea/workspace.xml | 95 ++++--- out/production/TaipanClone/ShipWarfare.class | Bin 8124 -> 8386 bytes src/ShipWarfareGUI.java | 254 +++++++++---------- 3 files changed, 175 insertions(+), 174 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3bc1b50..827b9ae 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,6 +3,8 @@ + + @@ -27,21 +29,21 @@ - + - - + + - - + + - + @@ -84,10 +86,6 @@ - GetGuns - set - TaipanShop - shop() shop being label0 @@ -100,7 +98,6 @@ setNumOfP setUs starting - destro numOfpeasantShips startingPeasantShips startingLittyShips @@ -114,6 +111,11 @@ numOfLittyShips delay Hp + shipwarfare + destroyPeasa + destr + destro + hitco HP @@ -137,9 +139,9 @@ @@ -155,7 +157,6 @@ - @@ -172,6 +173,7 @@ - - - + @@ -283,6 +282,8 @@ + + 1550458470138 @@ -410,17 +411,24 @@ - - - + @@ -536,7 +544,8 @@ - @@ -634,12 +643,12 @@ - - + + - - + + diff --git a/src/ShipWarfareGUI.java b/src/ShipWarfareGUI.java index 21cf3db..ac44710 100644 --- a/src/ShipWarfareGUI.java +++ b/src/ShipWarfareGUI.java @@ -422,15 +422,15 @@ public class ShipWarfareGUI extends Application { setNumOfPeasantShips(numOfPeasantShips - howMuchRun); if (userAttacks == true) { - runAwayOrLeft.setText(String.format("Ahhh, %d ships ran away %s!\n", howMuchRun, player.getName())); + runAwayOrLeft.setText(String.format("Ahhh, %d ships ran away %s! ", howMuchRun, player.getName())); } else { - runAwayOrLeft.setText(String.format("Escaped %d of them!\n", howMuchRun)); + runAwayOrLeft.setText(String.format("Escaped %d of them! ", howMuchRun)); } } } } - shipsRemaining.setText(String.format("%d ships remaining and they look angry!\n", numOfPeasantShips)); + shipsRemaining.setText(String.format("%d ships remaining and they look angry!", numOfPeasantShips)); //Computer volley int takeGunChance = randomValue.nextInt(4) + 1; if (takeGunChance == 1 && player.getGuns() > 0) { @@ -450,12 +450,12 @@ public class ShipWarfareGUI extends Application { gunsLeftOrTaken.setText(String.format("We still have %d guns left", player.getGuns())); } - HPLeft.setText(String.format("EEK, our current ship status is %d%% \n", player.getHP())); + HPLeft.setText(String.format("EEK, our current ship status is %d%% ", player.getHP())); if (userAttacks == false) { userAttacks = true; } - continueToFight.setText(String.format("Shall we continue to fight? (Click the fight button or the run button)\n", player.getGuns())); + continueToFight.setText(String.format("Shall we continue to fight? (Click the fight button or the run button)", player.getGuns())); if (runButton.isPressed()) { @@ -480,10 +480,12 @@ 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; player.setMoney(player.getMoney() + calculateLoot); - System.out.printf("We got $%,d!", calculateLoot); + report.setText(String.format("We got $%,d! ",calculateLoot)); return true; } else if (exitValue == 2) { player.gameOver();