Fixed like 3 naming/logical errors in ShipWarfare

This commit is contained in:
KahootChampion
2019-02-22 00:20:57 -07:00
parent 4b047f46c4
commit 0bcdbd1af8
3 changed files with 125 additions and 53 deletions

174
.idea/workspace.xml generated
View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="">
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="Sloppy but completed ShipWarfare class">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Player.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Player.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TaipanClone/ShipWarfare.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/TaipanClone/ShipWarfare.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ShipWarfare.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfare.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TaipanShop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TaipanShop.java" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -33,8 +32,8 @@
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1419">
<caret line="12" column="30" selection-start-line="12" selection-start-column="30" selection-end-line="12" selection-end-column="30" />
<state relative-caret-position="111">
<caret line="248" column="36" lean-forward="true" selection-start-line="248" selection-start-column="36" selection-end-line="248" selection-end-column="36" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@@ -42,11 +41,29 @@
</provider>
</entry>
</file>
<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="165">
<caret line="11" column="15" selection-start-line="11" selection-start-column="15" selection-end-line="11" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-4525">
<caret line="71" column="19" selection-start-line="71" selection-start-column="16" selection-end-line="71" selection-end-column="19" />
</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="265">
<caret line="66" column="1" lean-forward="true" selection-start-line="66" selection-start-column="1" selection-end-line="66" selection-end-column="1" />
<state relative-caret-position="225">
<caret line="16" lean-forward="true" selection-start-line="5" selection-start-column="3" selection-end-line="16" />
</state>
</provider>
</entry>
@@ -63,8 +80,32 @@
<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="148">
<caret line="10" column="24" selection-start-line="10" selection-start-column="24" selection-end-line="10" selection-end-column="24" />
<state relative-caret-position="1935">
<caret line="129" column="30" selection-start-line="129" selection-start-column="30" selection-end-line="129" selection-end-column="30" />
<folding>
<element signature="e#769#770#0" expanded="true" />
<element signature="e#796#797#0" expanded="true" />
<element signature="e#836#837#0" expanded="true" />
<element signature="e#868#869#0" expanded="true" />
<element signature="e#894#895#0" expanded="true" />
<element signature="e#919#920#0" expanded="true" />
<element signature="e#1010#1011#0" expanded="true" />
<element signature="e#1037#1038#0" expanded="true" />
<element signature="e#1174#1175#0" expanded="true" />
<element signature="e#1202#1203#0" expanded="true" />
<element signature="e#1348#1349#0" expanded="true" />
<element signature="e#1380#1381#0" expanded="true" />
<element signature="e#1545#1546#0" expanded="true" />
<element signature="e#1576#1577#0" expanded="true" />
<element signature="e#1739#1740#0" expanded="true" />
<element signature="e#1773#1774#0" expanded="true" />
<element signature="e#1948#1949#0" expanded="true" />
<element signature="e#1979#1980#0" expanded="true" />
<element signature="e#2139#2140#0" expanded="true" />
<element signature="e#2170#2171#0" expanded="true" />
<element signature="e#2326#2327#0" expanded="true" />
<element signature="e#2353#2354#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@@ -80,20 +121,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>name</find>
<find>bank</find>
<find>player.getMoney() += num *</find>
<find>opiumHeld</find>
<find>player.</find>
<find>ARR</find>
<find>ARRG!</find>
<find>exit</find>
<find>exitValue</find>
<find>setG</find>
<find>hp</find>
<find>o</find>
<find>oh no</find>
<find>shi</find>
<find>ships rem</find>
<find>phew</find>
<find>heal</find>
@@ -104,12 +131,26 @@
<find>chanceOfRun</find>
<find>chance</find>
<find>get</find>
<find>set</find>
<find>Peasant</find>
<find>d</find>
<find>captain</find>
<find>printf</find>
<find>liu</find>
<find>howmuchRun</find>
<find>setPlayer</find>
<find>setNumOf</find>
<find>setNumOfLitty</find>
<find>setNumOfLitt</find>
<find>setG</find>
<find>setMoney</find>
<find>setN</find>
<find>setNum</find>
<find>set</find>
<find>peasant</find>
<find>startingPeasantShips</find>
<find>startingLittyShips</find>
<find>destroy</find>
<find>litty</find>
</findStrings>
<replaceStrings>
<replace>player.getName()</replace>
@@ -122,6 +163,7 @@
<replace>litty</replace>
<replace>Liitty</replace>
<replace>Litty</replace>
<replace>player.set</replace>
<replace>%s</replace>
</replaceStrings>
</component>
@@ -135,6 +177,7 @@
<option value="$PROJECT_DIR$/src/Test.java" />
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
<option value="$PROJECT_DIR$/src/Player.java" />
<option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
</list>
</option>
@@ -173,7 +216,7 @@
<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="1550817767263" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1550819711332" />
<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" />
@@ -242,10 +285,10 @@
<recent_temporary>
<list>
<item itemvalue="Application.ShipWarfare" />
<item itemvalue="Application.Main" />
<item itemvalue="Application.Test" />
<item itemvalue="Application.Player" />
<item itemvalue="Application.TaipanShop" />
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
@@ -264,7 +307,7 @@
<workItem from="1550550806467" duration="577000" />
<workItem from="1550552635138" duration="118000" />
<workItem from="1550553016386" duration="7671000" />
<workItem from="1550672213804" duration="27182000" />
<workItem from="1550672213804" duration="29369000" />
</task>
<task id="LOCAL-00001" summary="Added troll comments">
<created>1550458807806</created>
@@ -336,14 +379,22 @@
<option name="project" value="LOCAL" />
<updated>1550810365166</updated>
</task>
<option name="localTasksCounter" value="11" />
<task id="LOCAL-00011" summary="Sloppy but completed ShipWarfare class">
<created>1550817871034</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1550817871034</updated>
</task>
<option name="localTasksCounter" value="12" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="36007000" />
<option name="totallyTimeSpent" value="38194000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="709" extended-state="0" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2819063" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
@@ -352,9 +403,10 @@
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Duplicate detector" weight="0.32901135" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.3273906" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3273906" />
<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" />
@@ -392,7 +444,8 @@
<MESSAGE value="Perhaps done basic ship warfare?" />
<MESSAGE value="Perhaps done basic ship warfare? (still must add Liu yen difficulty, ships running away, and Loot)" />
<MESSAGE value="Added loot. Still need to have ships escape sometimes and Liu yen" />
<option name="LAST_COMMIT_MESSAGE" value="Added loot. Still need to have ships escape sometimes and Liu yen" />
<MESSAGE value="Sloppy but completed ShipWarfare class" />
<option name="LAST_COMMIT_MESSAGE" value="Sloppy but completed ShipWarfare class" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/TaipanClone.iml">
@@ -417,41 +470,60 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="265">
<caret line="66" column="1" lean-forward="true" selection-start-line="66" selection-start-column="1" selection-end-line="66" selection-end-column="1" />
<state relative-caret-position="225">
<caret line="16" lean-forward="true" selection-start-line="5" selection-start-column="3" selection-end-line="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="173">
<caret line="137" lean-forward="true" selection-start-line="137" selection-end-line="137" />
<folding>
<element signature="e#333#334#0" expanded="true" />
<element signature="e#366#367#0" expanded="true" />
<element signature="e#535#536#0" expanded="true" />
<element signature="e#568#569#0" expanded="true" />
<element signature="e#736#737#0" expanded="true" />
<element signature="e#768#769#0" expanded="true" />
<element signature="e#931#932#0" expanded="true" />
<element signature="e#963#964#0" expanded="true" />
<element signature="e#1129#1130#0" expanded="true" />
<element signature="e#1164#1165#0" expanded="true" />
</folding>
<state relative-caret-position="-4525">
<caret line="71" column="19" selection-start-line="71" selection-start-column="16" selection-end-line="71" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="148">
<caret line="10" column="24" selection-start-line="10" selection-start-column="24" selection-end-line="10" selection-end-column="24" />
<state relative-caret-position="1935">
<caret line="129" column="30" selection-start-line="129" selection-start-column="30" selection-end-line="129" selection-end-column="30" />
<folding>
<element signature="e#769#770#0" expanded="true" />
<element signature="e#796#797#0" expanded="true" />
<element signature="e#836#837#0" expanded="true" />
<element signature="e#868#869#0" expanded="true" />
<element signature="e#894#895#0" expanded="true" />
<element signature="e#919#920#0" expanded="true" />
<element signature="e#1010#1011#0" expanded="true" />
<element signature="e#1037#1038#0" expanded="true" />
<element signature="e#1174#1175#0" expanded="true" />
<element signature="e#1202#1203#0" expanded="true" />
<element signature="e#1348#1349#0" expanded="true" />
<element signature="e#1380#1381#0" expanded="true" />
<element signature="e#1545#1546#0" expanded="true" />
<element signature="e#1576#1577#0" expanded="true" />
<element signature="e#1739#1740#0" expanded="true" />
<element signature="e#1773#1774#0" expanded="true" />
<element signature="e#1948#1949#0" expanded="true" />
<element signature="e#1979#1980#0" expanded="true" />
<element signature="e#2139#2140#0" expanded="true" />
<element signature="e#2170#2171#0" expanded="true" />
<element signature="e#2326#2327#0" expanded="true" />
<element signature="e#2353#2354#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="15" selection-start-line="11" selection-start-column="15" selection-end-line="11" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1419">
<caret line="12" column="30" selection-start-line="12" selection-start-column="30" selection-end-line="12" selection-end-column="30" />
<state relative-caret-position="111">
<caret line="248" column="36" lean-forward="true" selection-start-line="248" selection-start-column="36" selection-end-line="248" selection-end-column="36" />
<folding>
<element signature="imports" expanded="true" />
</folding>

View File

@@ -17,7 +17,7 @@ public class ShipWarfare extends Player {
Scanner userResponse = new Scanner(System.in);
setNumOfPeasantShips(numOfShips());
System.out.printf("By Golly! We have $%,d and are being attacked by %d Merchant ships\nCurrently our ship status is %d%%\n", getMoney(), numOfLittyShips, getHP());
System.out.printf("By Golly! We have $%,d and are being attacked by %d Merchant ships\nCurrently our ship status is %d%%\n", getMoney(), numOfPeasantShips, getHP());
fightOrRunMessage();
while (true) {
@@ -239,7 +239,7 @@ public class ShipWarfare extends Player {
if (exitValue == 1) {
System.out.printf("\nGot eem\nVictory!\nIt appears we have defeated the enemy fleet and made it out at %d%% ship status\n", getHP());
calculateLoot = (randomValue.nextInt(startingPeasantShips) + startingPeasantShips) * 100;
calculateLoot = (randomValue.nextInt(startingLittyShips) + startingLittyShips) * 300;
setMoney(getMoney() + calculateLoot);
System.out.printf("We got $%,d!\n", calculateLoot);
return true;