From 9feac6e90e7c382dbc126d9d462096ca379889cc Mon Sep 17 00:00:00 2001
From: KahootChampion
Date: Sat, 9 Mar 2019 22:52:30 -0700
Subject: [PATCH] Forces you to fight in ShipWarfareGUI unfortunately
---
.idea/workspace.xml | 47 ++++++++++++++++++++++++-----------------
src/ShipWarfareGUI.java | 14 ++++++------
2 files changed, 36 insertions(+), 25 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 827b9ae..234d2ae 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,7 +3,6 @@
-
@@ -32,12 +31,12 @@
-
-
+
+
-
-
+
+
@@ -86,9 +85,6 @@
- shop
- being
- label0
hBox
<
winO
@@ -116,6 +112,9 @@
destr
destro
hitco
+ setNum
+ game
+ numOf
HP
@@ -157,6 +156,8 @@
+
+
@@ -173,15 +174,13 @@
-
-
-
+
@@ -283,6 +282,8 @@
+
+
1550458470138
@@ -410,17 +411,24 @@
1552187032139
-
+
+ 1552195966566
+
+
+
+ 1552195966566
+
+
-
+
-
+
@@ -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();