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