Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/workspace.xml
This commit is contained in:
2019-03-09 23:27:03 -07:00
2 changed files with 331 additions and 592 deletions

665
.idea/workspace.xml generated
View File

@@ -1,19 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="BookmarkManager">
<bookmark url="file://$PROJECT_DIR$/src/ShipWarfareGUI.java" line="590" />
</component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="Added some logic to ShipWarfareGUI"> <list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/StartGUI.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/TravelGUI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<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$/out/production/TaipanClone/ShipWarfare.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/TaipanClone/ShipWarfare.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/ShipWarfareGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfareGUI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ShopGUI" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShopGUI.java" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/out/" /> <ignored path="$PROJECT_DIR$/out/" />
<ignored path="C:\Users\Harkamal Randhawa\IdeaProjects\TaipanClone\.idea\shelf/" /> <ignored path="C:\Users\Harkamal Randhawa\IdeaProjects\TaipanClone\.idea\shelf/" />
<ignored path="$PROJECT_DIR$/.idea/shelf/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -23,157 +17,59 @@
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.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="279"> <state relative-caret-position="5025">
<caret line="682" selection-start-line="682" selection-end-line="682" /> <caret line="353" column="100" selection-end-line="503" />
<folding>
<element signature="e#763#794#0" expanded="true" />
<element signature="e#1208#1209#0" expanded="true" />
<element signature="e#1236#1237#0" expanded="true" />
<element signature="e#17682#17683#0" expanded="true" />
<element signature="e#17720#17721#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="117">
<caret line="458" selection-start-line="458" selection-end-line="466" selection-end-column="11" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1879#2020#0" />
<element signature="e#2026#2140#0" />
<element signature="e#2026#2268#0" />
<element signature="e#2274#2524#0" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#2887#0" />
<element signature="e#2663#3001#0" />
<element signature="e#3007#3133#0" />
<element signature="e#3205#3412#0" />
<element signature="e#3205#3546#0" />
<element signature="e#3552#3676#0" />
<element signature="e#3746#3950#0" />
<element signature="e#3746#4079#0" />
<element signature="e#4022#4073#1" />
<element signature="e#4085#4209#0" />
<element signature="e#4279#4483#0" />
<element signature="e#4279#4612#0" />
<element signature="e#4618#4757#0" />
<element signature="e#4833#5046#0" />
<element signature="e#4833#5190#0" />
<element signature="e#5196#5297#0" />
<element signature="e#5196#7354#0" />
<element signature="e#10976#16179#0" />
<element signature="e#11276#11422#1" />
<element signature="e#11480#11600#1" />
<element signature="e#11645#11797#1" />
<element signature="e#12094#12214#1" />
<element signature="e#12258#12409#1" />
<element signature="e#12704#12824#1" />
<element signature="e#12867#13018#1" />
<element signature="e#13325#13445#1" />
<element signature="e#13704#16173#1" />
<element signature="e#13801#13949#1" />
<element signature="e#14007#14138#1" />
<element signature="e#14183#14336#1" />
<element signature="e#14624#14755#1" />
<element signature="e#14799#14951#1" />
<element signature="e#15237#15368#1" />
<element signature="class#20468:20804" />
<element signature="class#20968:21155" />
<element signature="class#21497:21689" />
<element signature="class#21854:22047" />
<element signature="class#22296:22485" />
<element signature="class#22689:22842" />
<element signature="class#23135:23794" />
<element signature="class#24032:24686" />
<element signature="class#24848:25502" />
<element signature="class#25837:26512" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding>
</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="1564">
<caret line="95" column="19" selection-start-line="95" selection-start-column="19" selection-end-line="95" selection-end-column="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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="51">
<caret line="3" selection-start-line="3" selection-end-line="35" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2567">
<caret line="174" column="38" selection-start-line="174" selection-start-column="23" selection-end-line="174" selection-end-column="38" />
<folding>
<element signature="e#1244#1245#0" expanded="true" />
<element signature="e#1272#1273#0" expanded="true" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#3001#0" />
<element signature="e#6546#8362#1" />
<element signature="docComment;method#seaAtlas#0;class#TravelGUI#0" />
<element signature="method#seaAtlas#0;class#TravelGUI#0" />
<element signature="docComment;method#randomEventSea#0;class#TravelGUI#0" />
<element signature="method#randomEventSea#0;class#TravelGUI#0" />
<element signature="docComment;method#disaster#0;class#TravelGUI#0" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding> </folding>
</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/StartGUI.java"> <entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="230"> <state relative-caret-position="608">
<caret line="147" column="20" selection-start-line="147" selection-start-column="20" selection-end-line="147" selection-end-column="20" /> <caret line="47" lean-forward="true" selection-start-line="47" selection-end-line="47" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#639#640#0" expanded="true" /> <element signature="e#17426#17427#0" expanded="true" />
<element signature="e#667#668#0" expanded="true" /> <element signature="e#17464#17465#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </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="-1934">
<caret line="56" column="5" selection-start-line="56" selection-start-column="5" selection-end-line="56" selection-end-column="5" />
</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="-421"> <state relative-caret-position="135">
<caret line="2" column="41" selection-start-line="2" selection-start-column="41" selection-end-line="2" selection-end-column="41" /> <caret line="9" column="4" selection-end-line="55" />
</state>
</provider>
</entry>
</file>
<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/ShopGUI">
<provider selected="true" editor-type-id="text-editor" />
</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="135">
<caret line="9" column="32" selection-start-line="9" selection-start-column="32" selection-end-line="9" selection-end-column="32" />
</state> </state>
</provider> </provider>
</entry> </entry>
@@ -183,55 +79,54 @@
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="JavaFXApplication" />
<option value="Class" /> <option value="Class" />
</list> </list>
</option> </option>
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>setVisible</find> <find>hBox</find>
<find>button</find> <find>&lt;</find>
<find>textField</find> <find>winO</find>
<find>quitButton</find> <find>destroy</find>
<find>initial</find> <find>get</find>
<find>Text</find> <find>user</find>
<find>TextField</find> <find>setNumOfP</find>
<find>setTe</find> <find>setUs</find>
<find>number</find> <find>starting</find>
<find>textOut</find> <find>numOfpeasantShips</find>
<find>text</find> <find>startingPeasantShips</find>
<find>//</find> <find>startingLittyShips</find>
<find>defaultTextOut</find> <find>howMuchRun</find>
<find>getText</find> <find>pirateName</find>
<find>numberInput</find> <find>player</find>
<find>handle</find> <find>numOfPeasantShips</find>
<find>event</find> <find>peasant</find>
<find>System.out.println(</find> <find>litty</find>
<find>Where</find> <find>userAttacks</find>
<find>sea</find> <find>numOfLittyShips</find>
<find>hon</find> <find>delay</find>
<find>setVis</find> <find>Hp</find>
<find>Tex</find> <find>shipwarfare</find>
<find>VBox</find> <find>destroyPeasa</find>
<find>ToggleGroup</find> <find>destr</find>
<find>field</find> <find>destro</find>
<find>startButton</find> <find>hitco</find>
<find>visib</find> <find>setNum</find>
<find>random</find> <find>game</find>
<find>quit</find> <find>numOf</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>HP</replace> <replace>HP</replace>
<replace>p1.get</replace> <replace>p1.get</replace>
<replace>p1.set</replace> <replace>p1.set</replace>
<replace>//delayForSeconds</replace> <replace>shipWarfare.getHowMuchRun()</replace>
<replace>textOut.setText(&quot; &quot; +</replace> <replace>shipWarfare.isUserAttacks()</replace>
<replace>textOut.setText(&quot; &quot; +</replace> <replace>shipWarfare.getNumOfPeasantShips()</replace>
</replaceStrings> </replaceStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="UPDATE_TYPE" value="MERGE" /> <option name="UPDATE_TYPE" value="REBASE" />
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
@@ -239,36 +134,30 @@
<list> <list>
<option value="$PROJECT_DIR$/src/Core.java" /> <option value="$PROJECT_DIR$/src/Core.java" />
<option value="$PROJECT_DIR$/src/Game.java" /> <option value="$PROJECT_DIR$/src/Game.java" />
<option value="$PROJECT_DIR$/src/Player.java" /> <option value="$PROJECT_DIR$/src/Start.java" />
<option value="$PROJECT_DIR$/src/TaipanShop.java" /> <option value="$PROJECT_DIR$/src/TaipanShop.java" />
<option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/Travel.java" /> <option value="$PROJECT_DIR$/src/Travel.java" />
<option value="$PROJECT_DIR$/src/GUI.java" /> <option value="$PROJECT_DIR$/src/Player.java" />
<option value="$PROJECT_DIR$/src/fxmlControllers/shipFXML.java" />
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.fxml" />
<option value="$PROJECT_DIR$/src/ShipWarfare.java" /> <option value="$PROJECT_DIR$/src/ShipWarfare.java" />
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" /> <option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
<option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/Start.java" />
<option value="$PROJECT_DIR$/src/ShopGUI.java" />
<option value="$PROJECT_DIR$/src/TravelGUI.java" />
<option value="$PROJECT_DIR$/src/StartGUI.java" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds">
<option name="x" value="2279" /> <option name="x" value="48" />
<option name="y" value="264" /> <option name="y" value="23" />
<option name="width" value="854" /> <option name="width" value="1189" />
<option name="height" value="505" /> <option name="height" value="652" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView"> <component name="ProjectView">
<navigator proportions="" version="1"> <navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@@ -285,18 +174,15 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="ChangesTree.GroupingKeys" value="" /> <property name="ChangesTree.GroupingKeys" value="" />
<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="1552199149371" /> <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1552196488451" />
<property name="extract.method.default.visibility" value="private" /> <property name="extract.method.default.visibility" value="private" />
<property name="last_opened_file_path" value="$USER_HOME$/Documents/GitHub/Cpsc233" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../GitHub/Cpsc233" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Project" /> <property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
@@ -314,9 +200,16 @@
</list> </list>
</option> </option>
</component> </component>
<component name="RunManager" selected="Application.StartGUI"> <component name="RunManager" selected="Application.ShipWarfareGUI">
<configuration name="GUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="Game" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="GUI" /> <option name="MAIN_CLASS_NAME" value="Game" />
<module name="TaipanClone" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="ShipWarfare" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ShipWarfare" />
<module name="TaipanClone" /> <module name="TaipanClone" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
@@ -329,41 +222,34 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="ShopGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="TaipanShop" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ShopGUI" /> <option name="MAIN_CLASS_NAME" value="TaipanShop" />
<module name="TaipanClone" /> <module name="TaipanClone" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="StartGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="StartGUI" /> <option name="MAIN_CLASS_NAME" value="main" />
<module name="TaipanClone" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TravelGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TravelGUI" />
<module name="TaipanClone" /> <module name="TaipanClone" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<list> <list>
<item itemvalue="Application.ShopGUI" /> <item itemvalue="Application.ShipWarfare" />
<item itemvalue="Application.TaipanShop" />
<item itemvalue="Application.Game" />
<item itemvalue="Application.main" />
<item itemvalue="Application.ShipWarfareGUI" /> <item itemvalue="Application.ShipWarfareGUI" />
<item itemvalue="Application.GUI" />
<item itemvalue="Application.TravelGUI" />
<item itemvalue="Application.StartGUI" />
</list> </list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Application.StartGUI" />
<item itemvalue="Application.TravelGUI" />
<item itemvalue="Application.ShopGUI" />
<item itemvalue="Application.ShipWarfareGUI" /> <item itemvalue="Application.ShipWarfareGUI" />
<item itemvalue="Application.GUI" /> <item itemvalue="Application.main" />
<item itemvalue="Application.TaipanShop" />
<item itemvalue="Application.Game" />
<item itemvalue="Application.ShipWarfare" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@@ -388,11 +274,16 @@
<workItem from="1550810552736" duration="1982000" /> <workItem from="1550810552736" duration="1982000" />
<workItem from="1550878072546" duration="2009000" /> <workItem from="1550878072546" duration="2009000" />
<workItem from="1551065104002" duration="1313000" /> <workItem from="1551065104002" duration="1313000" />
<workItem from="1551158469442" duration="5961000" /> <workItem from="1551158469442" duration="4822000" />
<workItem from="1551516759745" duration="56000" /> <workItem from="1552183127375" duration="5000" />
<workItem from="1552008296567" duration="595000" /> <workItem from="1552183173819" duration="43000" />
<workItem from="1552080169924" duration="15810000" /> <workItem from="1552183247090" duration="42000" />
<workItem from="1552165217689" duration="26528000" /> <workItem from="1552183350012" duration="132000" />
<workItem from="1552183501892" duration="5000" />
<workItem from="1552187010251" duration="1043000" />
<workItem from="1552195875453" duration="55000" />
<workItem from="1552195941602" duration="33000" />
<workItem from="1552195980542" duration="513000" />
</task> </task>
<task id="LOCAL-00001" summary="This should fix the ShipWarfare file and bring it up to date with the rest of the file."> <task id="LOCAL-00001" summary="This should fix the ShipWarfare file and bring it up to date with the rest of the file.">
<created>1550458470138</created> <created>1550458470138</created>
@@ -471,52 +362,73 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1551162699319</updated> <updated>1551162699319</updated>
</task> </task>
<task id="LOCAL-00012" summary="Fixed some little problems with documenting."> <task id="LOCAL-00012" summary="Added time stuff to Shipwarfare GUI">
<created>1551163347576</created> <created>1552168801248</created>
<option name="number" value="00012" /> <option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" /> <option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1551163347576</updated> <updated>1552168801248</updated>
</task> </task>
<task id="LOCAL-00013" summary="Fixed some little problems with documenting."> <task id="LOCAL-00013" summary="Notified of getting attacked">
<created>1551163654726</created> <created>1552172956109</created>
<option name="number" value="00013" /> <option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" /> <option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1551163654726</updated> <updated>1552172956109</updated>
</task> </task>
<task id="LOCAL-00014" summary="Basic layout for ShipwarefareGUI."> <task id="LOCAL-00014" summary="Added fight stuff">
<created>1552166044309</created> <created>1552173216531</created>
<option name="number" value="00014" /> <option name="number" value="00014" />
<option name="presentableId" value="LOCAL-00014" /> <option name="presentableId" value="LOCAL-00014" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552166044309</updated> <updated>1552173216532</updated>
</task> </task>
<task id="LOCAL-00015" summary="Added basic functionality with KahootChampion"> <task id="LOCAL-00015" summary="Made ShipWarfare easier to access by ShipWarfareGUI">
<created>1552166883461</created> <created>1552181324520</created>
<option name="number" value="00015" /> <option name="number" value="00015" />
<option name="presentableId" value="LOCAL-00015" /> <option name="presentableId" value="LOCAL-00015" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552166883461</updated> <updated>1552181324520</updated>
</task> </task>
<task id="LOCAL-00016" summary="Added some logic to ShipWarfareGUI"> <task id="LOCAL-00016" summary="Missed one statement that I needed to encapsulate">
<created>1552167207982</created> <created>1552181613507</created>
<option name="number" value="00016" /> <option name="number" value="00016" />
<option name="presentableId" value="LOCAL-00016" /> <option name="presentableId" value="LOCAL-00016" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552167207982</updated> <updated>1552181613507</updated>
</task> </task>
<option name="localTasksCounter" value="17" /> <task id="LOCAL-00017" summary="Messed up player by setting money to 1000">
<created>1552181667375</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1552181667376</updated>
</task>
<task id="LOCAL-00018" summary="Please find error">
<created>1552187032139</created>
<option name="number" value="00018" />
<option name="presentableId" value="LOCAL-00018" />
<option name="project" value="LOCAL" />
<updated>1552187032139</updated>
</task>
<task id="LOCAL-00019" summary="Super broken but fight button is in progress for shipwarfare">
<created>1552195966566</created>
<option name="number" value="00019" />
<option name="presentableId" value="LOCAL-00019" />
<option name="project" value="LOCAL" />
<updated>1552195966566</updated>
</task>
<option name="localTasksCounter" value="20" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="86614000" /> <option name="totallyTimeSpent" value="58950000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="1672" y="264" width="1376" height="744" extended-state="6" /> <frame x="48" y="23" width="1189" height="652" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16945289" /> <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.23016565" />
<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" />
@@ -525,7 +437,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" weight="0.32922733" /> <window_info anchor="bottom" id="Find" order="1" weight="0.32922733" />
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49924013" visible="true" weight="0.049099836" /> <window_info anchor="bottom" id="Run" order="2" weight="0.9357143" />
<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" />
@@ -534,8 +446,8 @@
<window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49938875" weight="0.32922733" /> <window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49938875" weight="0.32922733" />
<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.32922733" /> <window_info anchor="bottom" id="Terminal" order="10" weight="0.32922733" />
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.5007599" side_tool="true" weight="0.54664487" /> <window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50061125" side_tool="true" weight="0.32922733" />
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.49938875" weight="0.32922733" /> <window_info anchor="bottom" id="Messages" order="12" sideWeight="0.49938875" weight="0.32857144" />
<window_info anchor="bottom" id="Duplicate detector" order="13" weight="0.32922733" /> <window_info anchor="bottom" id="Duplicate detector" order="13" weight="0.32922733" />
<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" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" /> <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
@@ -593,6 +505,22 @@
</list> </list>
</option> </option>
</component> </component>
<component name="Vcs.Log.Tabs.Properties">
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list />
</value>
</entry>
<entry key="User">
<value>
<list />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<ignored-roots> <ignored-roots>
<path value="$PROJECT_DIR$" /> <path value="$PROJECT_DIR$" />
@@ -608,11 +536,16 @@
<MESSAGE value="Fixed stupid problem where you can't access methods above yours" /> <MESSAGE value="Fixed stupid problem where you can't access methods above yours" />
<MESSAGE value="Brought back Vikram's changes" /> <MESSAGE value="Brought back Vikram's changes" />
<MESSAGE value="Fixed the commenting on a lot of the code. Also added some stuff to Travel, fixed some bugs." /> <MESSAGE value="Fixed the commenting on a lot of the code. Also added some stuff to Travel, fixed some bugs." />
<MESSAGE value="Fixed some little problems with documenting." /> <MESSAGE value="Added time stuff to Shipwarfare GUI" />
<MESSAGE value="Basic layout for ShipwarefareGUI." /> <MESSAGE value="Nitified of getting attacked" />
<MESSAGE value="Added basic functionality with KahootChampion" /> <MESSAGE value="Notified of getting attacked" />
<MESSAGE value="Added some logic to ShipWarfareGUI" /> <MESSAGE value="Added fight stuff" />
<option name="LAST_COMMIT_MESSAGE" value="Added some logic to ShipWarfareGUI" /> <MESSAGE value="Made ShipWarfare easier to access by ShipWarfareGUI" />
<MESSAGE value="Missed one statement that I needed to encapsulate" />
<MESSAGE value="Messed up player by setting money to 1000" />
<MESSAGE value="Please find error" />
<MESSAGE value="Super broken but fight button is in progress for shipwarfare" />
<option name="LAST_COMMIT_MESSAGE" value="Super broken but fight button is in progress for shipwarfare" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="uml://JAVA/ShipWarfare"> <entry file="uml://JAVA/ShipWarfare">
@@ -654,246 +587,68 @@
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/Game.java" /> <entry file="file://$PROJECT_DIR$/src/Game.java" />
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml"> <entry file="file://$PROJECT_DIR$/src/Warehouse.java" />
<provider selected="true" editor-type-id="text-editor" /> <entry file="file://$PROJECT_DIR$/src/Bank.java" />
</entry> <entry file="file://$PROJECT_DIR$/src/TaipanShop.java" />
<entry file="file://$PROJECT_DIR$/src/Bank.java"> <entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17"> <state relative-caret-position="27">
<caret line="7" column="6" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" /> <caret line="125" column="63" selection-start-line="125" selection-start-column="63" selection-end-line="125" selection-end-column="63" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Warehouse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="3" selection-start-line="2" selection-start-column="3" selection-end-line="2" selection-end-column="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUIBase.java" />
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="715" column="22" selection-start-line="715" selection-start-column="12" selection-end-line="715" selection-end-column="22" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_141/javafx-src.zip!/javafx/application/Application.java"> <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/javafx-src.zip!/com/sun/glass/ui/InvokeLaterDispatcher.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199"> <state relative-caret-position="140">
<caret line="253" selection-start-line="253" selection-end-line="253" /> <caret line="110" column="19" selection-start-line="110" selection-start-column="19" selection-end-line="110" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/Battle.fxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="54" selection-start-line="13" selection-end-line="14" />
</state>
</provider>
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/DialogueJHare.fxml">
<provider selected="true" editor-type-id="text-editor" />
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/DialogueLRam.fxml">
<provider selected="true" editor-type-id="text-editor" />
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/fxmlController/Dialogue0Controller.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="method#handleButtonNext#0;class#Dialogue0Controller#0" />
<element signature="method#dialogue#0;class#Dialogue0Controller#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/DialogueLJi.fxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="15" lean-forward="true" selection-start-line="17" selection-start-column="15" selection-end-line="17" selection-end-column="15" />
</state>
</provider>
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.fxml" />
<entry file="file://$PROJECT_DIR$/src/GUI.java" />
<entry file="file://$PROJECT_DIR$/src/fxmlControllers/shopFXML.java" />
<entry file="file://$PROJECT_DIR$/src/fxmlControllers/shipFXML.java" />
<entry file="file://$PROJECT_DIR$/src/ShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5508">
<caret line="324" column="43" selection-start-line="324" selection-start-column="43" selection-end-line="324" selection-end-column="43" />
</state> </state>
</provider> </provider>
</entry> </entry>
<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="-986"> <state relative-caret-position="5025">
<caret line="22" column="34" lean-forward="true" selection-start-line="22" selection-start-column="34" selection-end-line="22" selection-end-column="34" /> <caret line="353" column="100" selection-end-line="503" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_141/javafx-src.zip!/javafx/event/EventHandler.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="44" column="9" selection-start-line="44" selection-start-column="9" selection-end-line="44" selection-end-column="9" />
</state>
</provider>
</entry>
<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="-421"> <state relative-caret-position="135">
<caret line="2" column="41" selection-start-line="2" selection-start-column="41" selection-end-line="2" selection-end-column="41" /> <caret line="9" column="4" selection-end-line="55" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1934">
<caret line="56" column="5" selection-start-line="56" selection-start-column="5" selection-end-line="56" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="279">
<caret line="682" selection-start-line="682" selection-end-line="682" />
<folding>
<element signature="e#763#794#0" expanded="true" />
<element signature="e#1208#1209#0" expanded="true" />
<element signature="e#1236#1237#0" expanded="true" />
<element signature="e#17682#17683#0" expanded="true" />
<element signature="e#17720#17721#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="117">
<caret line="458" selection-start-line="458" selection-end-line="466" selection-end-column="11" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1879#2020#0" />
<element signature="e#2026#2140#0" />
<element signature="e#2026#2268#0" />
<element signature="e#2274#2524#0" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#2887#0" />
<element signature="e#2663#3001#0" />
<element signature="e#3007#3133#0" />
<element signature="e#3205#3412#0" />
<element signature="e#3205#3546#0" />
<element signature="e#3552#3676#0" />
<element signature="e#3746#3950#0" />
<element signature="e#3746#4079#0" />
<element signature="e#4022#4073#1" />
<element signature="e#4085#4209#0" />
<element signature="e#4279#4483#0" />
<element signature="e#4279#4612#0" />
<element signature="e#4618#4757#0" />
<element signature="e#4833#5046#0" />
<element signature="e#4833#5190#0" />
<element signature="e#5196#5297#0" />
<element signature="e#5196#7354#0" />
<element signature="e#10976#16179#0" />
<element signature="e#11276#11422#1" />
<element signature="e#11480#11600#1" />
<element signature="e#11645#11797#1" />
<element signature="e#12094#12214#1" />
<element signature="e#12258#12409#1" />
<element signature="e#12704#12824#1" />
<element signature="e#12867#13018#1" />
<element signature="e#13325#13445#1" />
<element signature="e#13704#16173#1" />
<element signature="e#13801#13949#1" />
<element signature="e#14007#14138#1" />
<element signature="e#14183#14336#1" />
<element signature="e#14624#14755#1" />
<element signature="e#14799#14951#1" />
<element signature="e#15237#15368#1" />
<element signature="class#20468:20804" />
<element signature="class#20968:21155" />
<element signature="class#21497:21689" />
<element signature="class#21854:22047" />
<element signature="class#22296:22485" />
<element signature="class#22689:22842" />
<element signature="class#23135:23794" />
<element signature="class#24032:24686" />
<element signature="class#24848:25502" />
<element signature="class#25837:26512" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1564">
<caret line="95" column="19" selection-start-line="95" selection-start-column="19" selection-end-line="95" selection-end-column="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/Start.java"> <entry file="file://$PROJECT_DIR$/src/Start.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51"> <state relative-caret-position="15">
<caret line="3" selection-start-line="3" selection-end-line="35" /> <caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_141/javafx-src.zip!/com/sun/glass/ui/View.java"> <entry file="file://$PROJECT_DIR$/src/ShopGUI">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4262"> <state relative-caret-position="135">
<caret line="554" selection-start-line="554" selection-end-line="554" /> <caret line="9" column="32" selection-start-line="9" selection-start-column="32" selection-end-line="9" selection-end-column="32" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java"> <entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2567"> <state relative-caret-position="608">
<caret line="174" column="38" selection-start-line="174" selection-start-column="23" selection-end-line="174" selection-end-column="38" /> <caret line="47" lean-forward="true" selection-start-line="47" selection-end-line="47" />
<folding>
<element signature="e#1244#1245#0" expanded="true" />
<element signature="e#1272#1273#0" expanded="true" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#3001#0" />
<element signature="e#6546#8362#1" />
<element signature="docComment;method#seaAtlas#0;class#TravelGUI#0" />
<element signature="method#seaAtlas#0;class#TravelGUI#0" />
<element signature="docComment;method#randomEventSea#0;class#TravelGUI#0" />
<element signature="method#randomEventSea#0;class#TravelGUI#0" />
<element signature="docComment;method#disaster#0;class#TravelGUI#0" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StartGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="230">
<caret line="147" column="20" selection-start-line="147" selection-start-column="20" selection-end-line="147" selection-end-column="20" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#639#640#0" expanded="true" /> <element signature="e#17426#17427#0" expanded="true" />
<element signature="e#667#668#0" expanded="true" /> <element signature="e#17464#17465#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>

View File

@@ -29,16 +29,22 @@ import static javafx.application.Application.launch;
public class ShipWarfareGUI extends Application { public class ShipWarfareGUI extends Application {
private Player player = new Player(); private Player player = new Player();
private ShipWarfare shipWarfare = new ShipWarfare(player); private ShipWarfare shipWarfare = new ShipWarfare(player);
private HBox hBox; private HBox hBox;
private Button button1; private Button fightButton;
private Button button2; private Button runButton;
private VBox vBox; private VBox vBox;
private Label label1; private Label title;
private Label label; private Label chooseFightOrRun;
private VBox vBox0; private Label report;
private Label label0; private Label runAwayOrLeft;
private Label shipsRemaining;
private Label HPLeft;
private Label gunsLeftOrTaken;
private Label continueToFight;
public static void main(String args[]) { public static void main(String args[]) {
@@ -53,14 +59,6 @@ public class ShipWarfareGUI extends Application {
private int howMuchRun = 0; private int howMuchRun = 0;
private String pirateName = "Liu Yen"; private String pirateName = "Liu Yen";
/**
* Class Constructor that takes in a type player as a parameter
* @param player object of the class Player
*/
public ShipWarfareGUI(Player player) {
Player playerDummy = new Player(player);
this.player = playerDummy;
}
/** /**
* setter method for player * setter method for player
@@ -88,15 +86,13 @@ public class ShipWarfareGUI extends Application {
Scanner userResponse = new Scanner(System.in); Scanner userResponse = new Scanner(System.in);
setNumOfPeasantShips(numOfShips()); 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", player.getMoney(), numOfPeasantShips, player.getHP()); title.setText(String.format("By Golly! We have $%,d and are being attacked by %d Merchant ships\nCurrently our ship status is %d%%\n", player.getMoney(), numOfPeasantShips, player.getHP()));
fightOrRunMessage(); fightOrRunMessage();
while (true) { while (true) {
String response = userResponse.nextLine(); String response = userResponse.nextLine();
if (response.equalsIgnoreCase("f")) { if (response.equalsIgnoreCase("f")) {
userAttacks = true; userAttacks = true;
System.out.println("Ohh, fight ehh?"); System.out.println("Ohh, fight ehh?");
delayForSeconds(1);
boolean winOrLose = destroyPeasantShipsOrEscape(); boolean winOrLose = destroyPeasantShipsOrEscape();
if (winOrLose == true) { if (winOrLose == true) {
break; break;
@@ -147,7 +143,6 @@ public class ShipWarfareGUI extends Application {
break; break;
} else { } else {
System.out.println("Phew! Got away safely"); System.out.println("Phew! Got away safely");
delayForSeconds(2);
break; break;
} }
@@ -263,13 +258,10 @@ public class ShipWarfareGUI extends Application {
break; break;
} }
System.out.println("Got eem"); System.out.println("Got eem");
delayForSeconds(1);
} else if (hitOrMiss == 2) { } else if (hitOrMiss == 2) {
System.out.printf("ARRG! We missed %s\n", player.getName()); System.out.printf("ARRG! We missed %s\n", player.getName());
delayForSeconds(1);
} else { } else {
System.out.println("Darn! Their fleet tanked our attack"); System.out.println("Darn! Their fleet tanked our attack");
delayForSeconds(1);
} }
@@ -279,7 +271,6 @@ public class ShipWarfareGUI extends Application {
} }
} else { } else {
System.out.printf("%s! We don't have any GUNS!!!!\n",player.getName()); System.out.printf("%s! We don't have any GUNS!!!!\n",player.getName());
delayForSeconds(1);
} }
@@ -306,7 +297,6 @@ public class ShipWarfareGUI extends Application {
System.out.printf("%d ships remaining\n", numOfLittyShips); System.out.printf("%d ships remaining\n", numOfLittyShips);
System.out.println("Oh no, they are taking the offensive!"); System.out.println("Oh no, they are taking the offensive!");
delayForSeconds(1);
//Computer volley //Computer volley
int takeGunChance = randomValue.nextInt(4) + 1; int takeGunChance = randomValue.nextInt(4) + 1;
if (takeGunChance == 1 && player.getGuns() > 0) { if (takeGunChance == 1 && player.getGuns() > 0) {
@@ -320,7 +310,6 @@ public class ShipWarfareGUI extends Application {
break; break;
} }
System.out.printf("EEK, our current ship status is %d%% \n", player.getHP()); System.out.printf("EEK, our current ship status is %d%% \n", player.getHP());
delayForSeconds(1);
if (userAttacks == false) { if (userAttacks == false) {
userAttacks = true; userAttacks = true;
} }
@@ -331,10 +320,8 @@ public class ShipWarfareGUI extends Application {
if (response.equalsIgnoreCase("r")) { if (response.equalsIgnoreCase("r")) {
if (runFromShips() == false) { if (runFromShips() == false) {
System.out.println("Couldn't run away"); System.out.println("Couldn't run away");
delayForSeconds(1);
} else { } else {
System.out.println("Phew! Got away safely"); System.out.println("Phew! Got away safely");
delayForSeconds(2);
break; break;
} }
} }
@@ -345,11 +332,9 @@ public class ShipWarfareGUI extends Application {
if (exitValue == 1) { 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", 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());
delayForSeconds(1);
calculateLoot = (randomValue.nextInt(startingLittyShips) + startingLittyShips) * 300; calculateLoot = (randomValue.nextInt(startingLittyShips) + startingLittyShips) * 300;
player.setMoney(player.getMoney() + calculateLoot); player.setMoney(player.getMoney() + calculateLoot);
System.out.printf("We got $%,d!\n", calculateLoot); System.out.printf("We got $%,d!\n", calculateLoot);
delayForSeconds(2);
return true; return true;
} else if (exitValue == 2) { } else if (exitValue == 2) {
player.gameOver(); player.gameOver();
@@ -357,7 +342,6 @@ public class ShipWarfareGUI extends Application {
return true; return true;
} else if (exitValue == 3) { } else if (exitValue == 3) {
System.out.printf("We made it out at %d%% ship status!\n", player.getHP()); System.out.printf("We made it out at %d%% ship status!\n", player.getHP());
delayForSeconds(2);
return true; return true;
} }
return false; return false;
@@ -371,11 +355,23 @@ public class ShipWarfareGUI extends Application {
* @throws Exception in case of errors due to the delay * @throws Exception in case of errors due to the delay
*/ */
public void wipe(){
title.setVisible(false);
runAwayOrLeft.setVisible(false);
shipsRemaining.setVisible(false);
HPLeft.setVisible(false);
gunsLeftOrTaken.setVisible(false);
continueToFight.setVisible(false);
}
public boolean destroyPeasantShipsOrEscape() throws Exception { public boolean destroyPeasantShipsOrEscape() throws Exception {
int calculateLoot = 0; int calculateLoot = 0;
int chanceOfEnemyRun = 0; int chanceOfEnemyRun = 0;
int hitCounter=0; int hitCounter=0;
int missCounter=0; int missCounter=0;
boolean gunFrustration= false;
Scanner userInput = new Scanner(System.in); Scanner userInput = new Scanner(System.in);
@@ -396,10 +392,8 @@ public class ShipWarfareGUI extends Application {
break; break;
} }
hitCounter++; hitCounter++;
delayForSeconds(1);
} else { } else {
missCounter++;
delayForSeconds(1);
} }
@@ -407,11 +401,10 @@ public class ShipWarfareGUI extends Application {
continue; continue;
} }
} }
label1.setText(String.format("Report:\nShips we hit: %d\nShots missed: %d", hitCounter,missCounter)); report.setText(String.format("Report: Ships we hit: %d Shots missed: %d", hitCounter,missCounter));
} }
else{ else{
label1.setText("We don't have any guns!!!"); report.setText("We don't have any guns!!!");
delayForSeconds(1);
} }
@@ -429,23 +422,20 @@ public class ShipWarfareGUI extends Application {
setNumOfPeasantShips(numOfPeasantShips - howMuchRun); setNumOfPeasantShips(numOfPeasantShips - howMuchRun);
if (userAttacks == true) { if (userAttacks == true) {
System.out.printf("Ahhh, %d ships ran away %s!\n", howMuchRun, player.getName()); runAwayOrLeft.setText(String.format("Ahhh, %d ships ran away %s! ", howMuchRun, player.getName()));
} else { } else {
System.out.printf("Escaped %d of them!\n", howMuchRun); runAwayOrLeft.setText(String.format("Escaped %d of them! ", howMuchRun));
} }
} }
} }
} }
System.out.printf("%d ships remaining\n", numOfPeasantShips); shipsRemaining.setText(String.format("%d ships remaining and they look angry!", numOfPeasantShips));
delayForSeconds(1);
System.out.println("Oh no, they are taking the offensive!");
delayForSeconds(1);
//Computer volley //Computer volley
int takeGunChance = randomValue.nextInt(4) + 1; int takeGunChance = randomValue.nextInt(4) + 1;
if (takeGunChance == 1 && player.getGuns() > 0) { if (takeGunChance == 1 && player.getGuns() > 0) {
player.setGuns(player.getGuns() - 1); player.setGuns(player.getGuns() - 1);
System.out.println("Dang it! They destroyed one of our guns"); gunFrustration=true;
} else { } else {
player.setHP(player.getHP() - (1 + randomValue.nextInt(10))); player.setHP(player.getHP() - (1 + randomValue.nextInt(10)));
} }
@@ -453,42 +443,55 @@ public class ShipWarfareGUI extends Application {
exitValue = 2; exitValue = 2;
break; break;
} }
System.out.printf("EEK, our current ship status is %d%% \n", player.getHP()); if(gunFrustration==true){
delayForSeconds(1); gunsLeftOrTaken.setText(String.format("Dang it! We only have %d guns left", player.getGuns()));
}
else{
gunsLeftOrTaken.setText(String.format("We still have %d guns left", player.getGuns()));
}
HPLeft.setText(String.format("EEK, our current ship status is %d%% ", player.getHP()));
if (userAttacks == false) { if (userAttacks == false) {
userAttacks = true; userAttacks = true;
} }
System.out.printf("Shall we continue to fight? Enter \"f\" to fight, and \"r\" to run (We have %d gun(s) left)\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()) {
String response = userInput.nextLine();
if (response.equalsIgnoreCase("r")) {
if (runFromShips() == false) { if (runFromShips() == false) {
System.out.println("Couldn't run away"); wipe();
chooseFightOrRun.setText("Couldn't run away");
} else { } else {
exitValue = 3; exitValue = 3;
break; break;
} }
} }
else if(fightButton.isPressed()){
title.setText("AYYYYYYYYYYY");
}
else{
}
} }
if (exitValue == 1) { 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()); 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());
delayForSeconds(1);
calculateLoot = (randomValue.nextInt(startingPeasantShips) + startingPeasantShips) * 100; calculateLoot = (randomValue.nextInt(startingPeasantShips) + startingPeasantShips) * 100;
player.setMoney(player.getMoney() + calculateLoot); player.setMoney(player.getMoney() + calculateLoot);
System.out.printf("We got $%,d!", calculateLoot); report.setText(String.format("We got $%,d! ",calculateLoot));
delayForSeconds(2);
return true; return true;
} else if (exitValue == 2) { } else if (exitValue == 2) {
player.gameOver(); player.gameOver();
return true; return true;
} else if (exitValue == 3) { } else if (exitValue == 3) {
System.out.printf("We made it out at %d%% ship status!\n", player.getHP()); System.out.printf("We made it out at %d%% ship status!\n", player.getHP());
delayForSeconds(2);
return true; return true;
} }
return false; return false;
@@ -521,7 +524,7 @@ public class ShipWarfareGUI extends Application {
public void setLabel1(String sysOut) { public void setLabel1(String sysOut) {
label1.setText(sysOut); report.setText(sysOut);
} }
/* /*
@@ -533,7 +536,7 @@ public class ShipWarfareGUI extends Application {
*/ */
public void start(Stage stage) throws Exception { public void start(Stage stage) throws Exception {
shipWarfare.setNumOfPeasantShips(shipWarfare.numOfShips()); setNumOfPeasantShips(numOfShips());
BorderPane BorderPane = new BorderPane(); BorderPane BorderPane = new BorderPane();
@@ -543,13 +546,19 @@ public class ShipWarfareGUI extends Application {
gridPane.setVgap(5.0); gridPane.setVgap(5.0);
hBox = new HBox(); hBox = new HBox();
button1 = new Button(); fightButton = new Button();
button2 = new Button(); runButton = new Button();
vBox = new VBox(); vBox = new VBox();
label1 = new Label(); title = new Label();
label = new Label(); chooseFightOrRun = new Label();
vBox0 = new VBox(); report = new Label();
label0 = new Label(); runAwayOrLeft = new Label();
shipsRemaining = new Label();
HPLeft = new Label();
gunsLeftOrTaken = new Label();
continueToFight = new Label();
BorderPane.setPrefHeight(400.0); BorderPane.setPrefHeight(400.0);
BorderPane.setPrefWidth(600.0); BorderPane.setPrefWidth(600.0);
@@ -558,16 +567,22 @@ public class ShipWarfareGUI extends Application {
hBox.setPrefWidth(200.0); hBox.setPrefWidth(200.0);
hBox.setSpacing(10.0); hBox.setSpacing(10.0);
button1.setAlignment(javafx.geometry.Pos.CENTER); title.setAlignment(javafx.geometry.Pos.TOP_CENTER);
button1.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER); title.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
button1.setId("Button1"); title.setId("Label1");
button1.setMnemonicParsing(false); title.setText(String.format("%d ships attacking. Would you like to Fight or Run?",numOfPeasantShips));
button1.setText("Fight"); title.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
button2.setAlignment(javafx.geometry.Pos.CENTER); fightButton.setAlignment(javafx.geometry.Pos.CENTER);
button2.setId("Button2"); fightButton.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
button2.setMnemonicParsing(false); fightButton.setId("Button1");
button2.setText("Run"); fightButton.setMnemonicParsing(false);
fightButton.setText("Fight");
runButton.setAlignment(javafx.geometry.Pos.CENTER);
runButton.setId("Button2");
runButton.setMnemonicParsing(false);
runButton.setText("Run");
BorderPane.setBottom(hBox); BorderPane.setBottom(hBox);
BorderPane.setAlignment(vBox, javafx.geometry.Pos.CENTER); BorderPane.setAlignment(vBox, javafx.geometry.Pos.CENTER);
@@ -576,76 +591,45 @@ public class ShipWarfareGUI extends Application {
vBox.setPrefWidth(100.0); vBox.setPrefWidth(100.0);
vBox.setSpacing(20.0); vBox.setSpacing(20.0);
label1.setAlignment(javafx.geometry.Pos.TOP_CENTER); report.setAlignment(javafx.geometry.Pos.TOP_CENTER);
label1.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER); report.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
label1.setId("Label1"); report.setId("Label1");
label1.setPadding(new Insets(6.0, 0.0, 0.0, 0.0)); report.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
vBox.setPadding(new Insets(0.0, 0.0, 10.0, 0.0)); vBox.setPadding(new Insets(0.0, 0.0, 10.0, 0.0));
BorderPane.setTop(vBox); BorderPane.setTop(vBox);
BorderPane.setPadding(new Insets(6.0, 0.0, 0.0, 0.0)); BorderPane.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
vBox0.setAlignment(javafx.geometry.Pos.TOP_CENTER);
vBox0.setPrefHeight(200.0);
vBox0.setPrefWidth(100.0);
vBox0.setSpacing(5.0);
hBox.getChildren().add(button1); hBox.getChildren().add(fightButton);
hBox.getChildren().add(button2); hBox.getChildren().add(runButton);
vBox.getChildren().add(label1); vBox.getChildren().add(title);
vBox.getChildren().add(label); vBox.getChildren().add(chooseFightOrRun);
vBox0.getChildren().add(label0); vBox.getChildren().add(report);
vBox.getChildren().add(vBox0); vBox.getChildren().add(runAwayOrLeft);
int calculateLoot = 0; vBox.getChildren().add(shipsRemaining);
int chanceOfEnemyRun = 0; vBox.getChildren().add(HPLeft);
vBox.getChildren().add(gunsLeftOrTaken);
vBox.getChildren().add(continueToFight);
//label1.setText(String.format("By Golly! We have $%,d and are being attacked by %d Merchant ships\nCurrently our ship status is %d%%\n", player.getMoney(), shipWarfare.getNumOfPeasantShips(), player.getHP()));
label.setText("What would you like to do?");
//report.setText(String.format("By Golly! We have $%,d and are being attacked by %d Merchant ships\nCurrently our ship status is %d%%\n", player.getMoney(), shipWarfare.getNumOfPeasantShips(), player.getHP()));
//Fight //Fight
button1.setOnAction(new EventHandler<ActionEvent>() { fightButton.setOnAction(new EventHandler<ActionEvent>() {
@Override @Override
public void handle(ActionEvent event) { public void handle(ActionEvent event) {
counter++; counter++;
if (counter == 1) { if (counter == 1) {
label.setText("Ohh, Fight ehh?"); chooseFightOrRun.setText("Ohh, Fight ehh?");
try {
destroyPeasantShipsOrEscape();
}
catch(Exception e){
int hitCounter=0;
int missCounter=0;
Random randomValue = new Random();
int exitValue = 0;
while (exitValue == 0) {
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;
}
hitCounter++;
delayForSeconds(1);
} else {
missCounter++;
delayForSeconds(1);
}
} else {
continue;
}
}
label1.setText(String.format("Report:\nShips we hit: %d\nShots missed: %d", hitCounter, missCounter));
} else {
label1.setText("We don't have any guns!!!");
delayForSeconds(1);
}
} }
@@ -653,30 +637,30 @@ public class ShipWarfareGUI extends Application {
} }
if (counter == 2) { if (counter == 2) {
System.out.println("You pressed the button twice."); System.out.println("You pressed the button twice.");
button1.setVisible(false); fightButton.setVisible(false);
button2.setVisible(false); runButton.setVisible(false);
button1.setDisable(true); fightButton.setDisable(true);
button2.setDisable(true); runButton.setDisable(true);
} }
} }
}); });
//Flee //Flee
button2.setOnAction(new EventHandler<ActionEvent>() { runButton.setOnAction(new EventHandler<ActionEvent>() {
@Override @Override
public void handle(ActionEvent event) { public void handle(ActionEvent event) {
counter++; counter++;
if (counter == 1) { if (counter == 1) {
label1.setText("Ohh, Run ehh?"); chooseFightOrRun.setText("Ohh, Run ehh?");
} }
if (counter == 2) { if (counter == 2) {
System.out.println("You pressed the button twice."); System.out.println("You pressed the button twice.");
button1.setVisible(false); fightButton.setVisible(false);
button2.setVisible(false); runButton.setVisible(false);
button1.setDisable(true); fightButton.setDisable(true);
button2.setDisable(true); runButton.setDisable(true);
} }
} }
}); });