Sneaky bug in shipWarfare regarding having 0 guns is now fixed.
This commit is contained in:
153
.idea/workspace.xml
generated
153
.idea/workspace.xml
generated
@@ -3,7 +3,7 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Warehouse.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Warehouse.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/ShipWarfare.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfare.java" afterDir="false" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/out/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
@@ -27,57 +27,21 @@
|
||||
<select />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Start.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="15">
|
||||
<caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1860">
|
||||
<caret line="150" column="4" selection-start-line="150" selection-start-column="4" selection-end-line="150" selection-end-column="4" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<leaf>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="480">
|
||||
<caret line="32" selection-start-line="32" selection-end-line="32" />
|
||||
<state relative-caret-position="285">
|
||||
<caret line="19" column="5" lean-forward="true" selection-start-line="19" selection-start-column="5" selection-end-line="19" selection-end-column="5" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/Warehouse.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="260">
|
||||
<caret line="154" column="82" selection-start-line="154" selection-start-column="82" selection-end-line="154" selection-end-column="82" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Travel.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="150">
|
||||
<caret line="11" selection-start-line="11" selection-end-line="11" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-2290">
|
||||
<caret line="212" selection-start-line="212" selection-end-line="212" />
|
||||
<state relative-caret-position="242">
|
||||
<caret line="327" lean-forward="true" selection-start-line="327" selection-end-line="327" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -85,15 +49,6 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/loanShark.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-5">
|
||||
<caret line="2" column="24" lean-forward="true" selection-start-line="2" selection-start-column="24" selection-end-line="2" selection-end-column="24" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
@@ -105,7 +60,6 @@
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>guns</find>
|
||||
<find>duplic</find>
|
||||
<find>chanceOfRun</find>
|
||||
<find>chance</find>
|
||||
@@ -135,6 +89,7 @@
|
||||
<find>System.out.println("\n*** PLACEHOLDER FOR LOAN SHARK ***\n");</find>
|
||||
<find>keep</find>
|
||||
<find>showWa</find>
|
||||
<find>player.get</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>player.getName()</replace>
|
||||
@@ -160,15 +115,15 @@
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/src/Test.java" />
|
||||
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
||||
<option value="$PROJECT_DIR$/src/Player.java" />
|
||||
<option value="$PROJECT_DIR$/src/Start.java" />
|
||||
<option value="$PROJECT_DIR$/src/Bank.java" />
|
||||
<option value="$PROJECT_DIR$/src/Travel.java" />
|
||||
<option value="$PROJECT_DIR$/src/loanShark.java" />
|
||||
<option value="$PROJECT_DIR$/src/main.java" />
|
||||
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
|
||||
<option value="$PROJECT_DIR$/src/Warehouse.java" />
|
||||
<option value="$PROJECT_DIR$/src/Start.java" />
|
||||
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@@ -183,7 +138,6 @@
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
@@ -201,12 +155,13 @@
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="PackagesPane" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1551065866043" />
|
||||
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1551066288602" />
|
||||
<property name="extract.method.default.visibility" value="public" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="project.structure.last.edited" value="Project" />
|
||||
@@ -302,6 +257,8 @@
|
||||
<workItem from="1550879399892" duration="1335000" />
|
||||
<workItem from="1550899071486" duration="108000" />
|
||||
<workItem from="1550954455279" duration="500000" />
|
||||
<workItem from="1551066469788" duration="198000" />
|
||||
<workItem from="1551066703607" duration="1375000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Added troll comments">
|
||||
<created>1550458807806</created>
|
||||
@@ -443,17 +400,24 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1551065447444</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="21" />
|
||||
<task id="LOCAL-00021" summary="Forgot a try catch in warehouse">
|
||||
<created>1551065880809</created>
|
||||
<option name="number" value="00021" />
|
||||
<option name="presentableId" value="LOCAL-00021" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1551065880809</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="22" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="45820000" />
|
||||
<option name="totallyTimeSpent" value="47819000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="0" y="23" width="1280" height="709" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.3101777" />
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.31987077" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Image Layers" order="2" />
|
||||
<window_info id="Designer" order="3" />
|
||||
@@ -462,7 +426,7 @@
|
||||
<window_info id="Favorites" order="6" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.4989339" weight="0.3241491" />
|
||||
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.4983845" visible="true" weight="0.3241491" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
@@ -471,7 +435,7 @@
|
||||
<window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49946696" weight="0.32901135" />
|
||||
<window_info anchor="bottom" id="Database Changes" order="9" />
|
||||
<window_info anchor="bottom" id="Terminal" order="10" weight="0.32936078" />
|
||||
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.5010661" side_tool="true" visible="true" weight="0.32719395" />
|
||||
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.5016155" side_tool="true" weight="0.3241491" />
|
||||
<window_info anchor="bottom" id="Messages" order="12" weight="0.048622366" />
|
||||
<window_info anchor="bottom" id="Duplicate detector" order="13" weight="0.32901135" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
@@ -509,7 +473,8 @@
|
||||
<MESSAGE value="Worked On Sid's class a bit" />
|
||||
<MESSAGE value="Think I fixed Sid's code" />
|
||||
<MESSAGE value="Small thing, changed an output of warehouse a bit, shows user its the warehosue they are concerned with." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Small thing, changed an output of warehouse a bit, shows user its the warehosue they are concerned with." />
|
||||
<MESSAGE value="Forgot a try catch in warehouse" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Forgot a try catch in warehouse" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/TaipanClone.iml">
|
||||
@@ -536,27 +501,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1860">
|
||||
<caret line="150" column="4" selection-start-line="150" selection-start-column="4" selection-end-line="150" selection-end-column="4" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="480">
|
||||
<caret line="32" selection-start-line="32" selection-end-line="32" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Start.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="15">
|
||||
<caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="269">
|
||||
@@ -564,16 +508,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-2290">
|
||||
<caret line="212" selection-start-line="212" selection-end-line="212" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/loanShark.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-5">
|
||||
@@ -581,13 +515,44 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Start.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="270">
|
||||
<caret line="33" column="9" lean-forward="true" selection-start-line="33" selection-start-column="9" selection-end-line="33" selection-end-column="9" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="540">
|
||||
<caret line="150" column="4" selection-start-line="150" selection-start-column="4" selection-end-line="150" selection-end-column="4" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Warehouse.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="260">
|
||||
<state relative-caret-position="2310">
|
||||
<caret line="154" column="82" selection-start-line="154" selection-start-column="82" selection-end-line="154" selection-end-column="82" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="285">
|
||||
<caret line="19" column="5" lean-forward="true" selection-start-line="19" selection-start-column="5" selection-end-line="19" selection-end-column="5" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="242">
|
||||
<caret line="327" lean-forward="true" selection-start-line="327" selection-end-line="327" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
|
||||
@@ -15,12 +15,12 @@ public class ShipWarfare extends Player {
|
||||
private int numOfLittyShips = 0;
|
||||
private boolean userAttacks = true;
|
||||
private int startingPeasantShips = 0;
|
||||
private int startingLittyShips =0;
|
||||
private int startingLittyShips = 0;
|
||||
private int howMuchRun = 0;
|
||||
private String pirateName = "Liu Yen";
|
||||
private Player player;
|
||||
|
||||
public ShipWarfare(Player player){
|
||||
public ShipWarfare(Player player) {
|
||||
Player playerDummy = new Player(player);
|
||||
this.player = playerDummy;
|
||||
}
|
||||
@@ -30,11 +30,11 @@ public class ShipWarfare extends Player {
|
||||
this.player = playerDummy;
|
||||
}
|
||||
|
||||
public Player getPlayer(){
|
||||
public Player getPlayer() {
|
||||
Player playerDummy = new Player(player);
|
||||
return playerDummy;
|
||||
}
|
||||
|
||||
|
||||
//This fleet is easy to defeat as a maximum of 15 ships can run away each volley, they can not tank hits
|
||||
public void peasantFleetAttack() throws Exception {
|
||||
Scanner userResponse = new Scanner(System.in);
|
||||
@@ -70,6 +70,7 @@ public class ShipWarfare extends Player {
|
||||
|
||||
|
||||
}
|
||||
|
||||
//This fleet is difficult to defeat as a maximum of 10 ships can run away each volley, they can tank hits
|
||||
public void littyFleetAttack() throws Exception {
|
||||
Scanner userResponse = new Scanner(System.in);
|
||||
@@ -180,29 +181,33 @@ public class ShipWarfare extends Player {
|
||||
|
||||
//Player volley
|
||||
while (exitValue == 0) {
|
||||
for (int j = 0; j < player.getGuns(); j++) {
|
||||
if (userAttacks == true) {
|
||||
int hitOrMiss = randomValue.nextInt(3) + 1;
|
||||
if (hitOrMiss == 1) {
|
||||
numOfLittyShips--;
|
||||
if (numOfLittyShips <= 0) {
|
||||
exitValue = 1;
|
||||
break;
|
||||
if (player.getGuns() > 0) {
|
||||
for (int j = 0; j < player.getGuns(); j++) {
|
||||
if (userAttacks == true) {
|
||||
int hitOrMiss = randomValue.nextInt(3) + 1;
|
||||
if (hitOrMiss == 1) {
|
||||
numOfLittyShips--;
|
||||
if (numOfLittyShips <= 0) {
|
||||
exitValue = 1;
|
||||
break;
|
||||
}
|
||||
System.out.println("Got eem");
|
||||
delayForASecond();
|
||||
} else if (hitOrMiss == 2) {
|
||||
System.out.printf("ARRG! We missed %s\n", getName());
|
||||
delayForASecond();
|
||||
} else {
|
||||
System.out.println("Darn! Their fleet tanked our attack");
|
||||
delayForASecond();
|
||||
}
|
||||
System.out.println("Got eem");
|
||||
delayForASecond();
|
||||
} else if (hitOrMiss == 2) {
|
||||
System.out.printf("ARRG! We missed %s\n", getName());
|
||||
delayForASecond();
|
||||
|
||||
|
||||
} else {
|
||||
System.out.println("Darn! Their fleet tanked our attack");
|
||||
delayForASecond();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
System.out.println("Captain! We don't have any GUNS!!!!");
|
||||
}
|
||||
|
||||
|
||||
@@ -210,17 +215,19 @@ public class ShipWarfare extends Player {
|
||||
exitValue = 1;
|
||||
break;
|
||||
}
|
||||
chanceOfEnemyRun = randomValue.nextInt(2) + 1;
|
||||
if (chanceOfEnemyRun == 2) {
|
||||
howMuchRun = randomValue.nextInt(10) + 1;
|
||||
if (howMuchRun != 0 && howMuchRun < numOfLittyShips) {
|
||||
if (player.getGuns() > 0) {
|
||||
if (chanceOfEnemyRun == 2) {
|
||||
chanceOfEnemyRun = randomValue.nextInt(2) + 1;
|
||||
howMuchRun = randomValue.nextInt(10) + 1;
|
||||
if (howMuchRun != 0 && howMuchRun < numOfLittyShips) {
|
||||
|
||||
|
||||
setNumOfLittyShips(numOfLittyShips - howMuchRun);
|
||||
if (userAttacks == true) {
|
||||
System.out.printf("Cowards! %d ships ran away %s!\n", howMuchRun, getName());
|
||||
} else {
|
||||
System.out.printf("Escaped %d of them!\n", howMuchRun);
|
||||
setNumOfLittyShips(numOfLittyShips - howMuchRun);
|
||||
if (userAttacks == true) {
|
||||
System.out.printf("Cowards! %d ships ran away %s!\n", howMuchRun, getName());
|
||||
} else {
|
||||
System.out.printf("Escaped %d of them!\n", howMuchRun);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,44 +299,53 @@ public class ShipWarfare extends Player {
|
||||
|
||||
//Player volley
|
||||
while (exitValue == 0) {
|
||||
for (int j = 0; j < player.getGuns(); j++) {
|
||||
if (userAttacks == true) {
|
||||
int hitOrMiss = randomValue.nextInt(2) + 1;
|
||||
if (hitOrMiss == 2) {
|
||||
numOfPeasantShips--;
|
||||
if (numOfPeasantShips <= 0) {
|
||||
exitValue = 1;
|
||||
break;
|
||||
if (player.getGuns() > 0) {
|
||||
|
||||
for (int j = 0; j < player.getGuns(); j++) {
|
||||
if (userAttacks == true) {
|
||||
int hitOrMiss = randomValue.nextInt(2) + 1;
|
||||
if (hitOrMiss == 2) {
|
||||
numOfPeasantShips--;
|
||||
if (numOfPeasantShips <= 0) {
|
||||
exitValue = 1;
|
||||
break;
|
||||
}
|
||||
System.out.println("Got eem");
|
||||
delayForASecond();
|
||||
} else {
|
||||
System.out.printf("ARRG! We missed %s\n", getName());
|
||||
delayForASecond();
|
||||
}
|
||||
System.out.println("Got eem");
|
||||
delayForASecond();
|
||||
|
||||
|
||||
} else {
|
||||
System.out.printf("ARRG! We missed %s\n", getName());
|
||||
delayForASecond();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else{
|
||||
System.out.println("Captain! We don't have any GUNS!!!!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (numOfPeasantShips <= 0) {
|
||||
exitValue = 1;
|
||||
break;
|
||||
}
|
||||
chanceOfEnemyRun = randomValue.nextInt(2) + 1;
|
||||
if (chanceOfEnemyRun == 2) {
|
||||
howMuchRun = randomValue.nextInt(15) + 1;
|
||||
if (howMuchRun != 0 && howMuchRun < numOfPeasantShips) {
|
||||
if (player.getGuns() > 0) {
|
||||
chanceOfEnemyRun = randomValue.nextInt(2) + 1;
|
||||
if (chanceOfEnemyRun == 2) {
|
||||
howMuchRun = randomValue.nextInt(15) + 1;
|
||||
if (howMuchRun != 0 && howMuchRun < numOfPeasantShips) {
|
||||
|
||||
|
||||
setNumOfPeasantShips(numOfPeasantShips - howMuchRun);
|
||||
if (userAttacks == true) {
|
||||
System.out.printf("Ahhh, %d ships ran away %s!\n", howMuchRun, getName());
|
||||
} else {
|
||||
System.out.printf("Escaped %d of them!\n", howMuchRun);
|
||||
setNumOfPeasantShips(numOfPeasantShips - howMuchRun);
|
||||
if (userAttacks == true) {
|
||||
System.out.printf("Ahhh, %d ships ran away %s!\n", howMuchRun, getName());
|
||||
} else {
|
||||
System.out.printf("Escaped %d of them!\n", howMuchRun);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user