A lot of errors but easily fixable SHipwarfareGUI
This commit is contained in:
151
.idea/workspace.xml
generated
151
.idea/workspace.xml
generated
@@ -1,7 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<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="Just checking">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/ShipWarfareGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfareGUI.java" afterDir="false" />
|
||||||
|
</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/" />
|
<ignored path="$PROJECT_DIR$/.idea/shelf/" />
|
||||||
@@ -13,55 +16,32 @@
|
|||||||
</component>
|
</component>
|
||||||
<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">
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="255">
|
|
||||||
<caret line="17" column="35" selection-start-line="17" selection-start-column="35" selection-end-line="17" selection-end-column="35" />
|
|
||||||
<folding>
|
|
||||||
<element signature="imports" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file pinned="false" current-in-tab="true">
|
<file pinned="false" current-in-tab="true">
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.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="5531">
|
<state relative-caret-position="360">
|
||||||
<caret line="703" column="1" selection-start-line="703" selection-start-column="1" selection-end-line="703" selection-end-column="1" />
|
<caret line="314" selection-start-line="314" selection-end-line="314" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
<element signature="e#18236#18237#0" expanded="true" />
|
|
||||||
<element signature="e#18274#18275#0" expanded="true" />
|
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</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/MainGUI.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="135">
|
<state relative-caret-position="378">
|
||||||
<caret line="9" column="4" selection-end-line="55" />
|
<caret line="55" column="28" selection-start-line="53" selection-start-column="7" selection-end-line="55" selection-end-column="28" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/src/Start.java">
|
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="15">
|
<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" />
|
<caret line="37" column="36" selection-start-line="37" selection-start-column="20" selection-end-line="37" selection-end-column="36" />
|
||||||
</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="120">
|
|
||||||
<caret line="8" column="29" selection-start-line="8" selection-start-column="29" selection-end-line="8" selection-end-column="29" />
|
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -77,8 +57,6 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="FindInProjectRecents">
|
<component name="FindInProjectRecents">
|
||||||
<findStrings>
|
<findStrings>
|
||||||
<find>howMuchRun</find>
|
|
||||||
<find>pirateName</find>
|
|
||||||
<find>player</find>
|
<find>player</find>
|
||||||
<find>numOfPeasantShips</find>
|
<find>numOfPeasantShips</find>
|
||||||
<find>peasant</find>
|
<find>peasant</find>
|
||||||
@@ -107,6 +85,8 @@
|
|||||||
<find>runFromShips()</find>
|
<find>runFromShips()</find>
|
||||||
<find>dang it!</find>
|
<find>dang it!</find>
|
||||||
<find>dang it</find>
|
<find>dang it</find>
|
||||||
|
<find>destroy</find>
|
||||||
|
<find>destroyPeas</find>
|
||||||
</findStrings>
|
</findStrings>
|
||||||
<replaceStrings>
|
<replaceStrings>
|
||||||
<replace>HP</replace>
|
<replace>HP</replace>
|
||||||
@@ -172,7 +152,7 @@
|
|||||||
<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="1552200809349" />
|
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1552268422526" />
|
||||||
<property name="extract.method.default.visibility" value="private" />
|
<property name="extract.method.default.visibility" value="private" />
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../GitHub/Cpsc233" />
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/../GitHub/Cpsc233" />
|
||||||
<property name="project.structure.last.edited" value="Project" />
|
<property name="project.structure.last.edited" value="Project" />
|
||||||
@@ -192,7 +172,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager" selected="Application.ShipWarfareGUI">
|
<component name="RunManager" selected="Application.MainGUI">
|
||||||
<configuration name="Game" 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="Game" />
|
<option name="MAIN_CLASS_NAME" value="Game" />
|
||||||
<module name="TaipanClone" />
|
<module name="TaipanClone" />
|
||||||
@@ -200,8 +180,8 @@
|
|||||||
<option name="Make" enabled="true" />
|
<option name="Make" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="ShipWarfare" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
<configuration name="MainGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
<option name="MAIN_CLASS_NAME" value="ShipWarfare" />
|
<option name="MAIN_CLASS_NAME" value="MainGUI" />
|
||||||
<module name="TaipanClone" />
|
<module name="TaipanClone" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="Make" enabled="true" />
|
<option name="Make" enabled="true" />
|
||||||
@@ -229,19 +209,19 @@
|
|||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<list>
|
<list>
|
||||||
<item itemvalue="Application.ShipWarfare" />
|
|
||||||
<item itemvalue="Application.TaipanShop" />
|
<item itemvalue="Application.TaipanShop" />
|
||||||
<item itemvalue="Application.Game" />
|
<item itemvalue="Application.Game" />
|
||||||
<item itemvalue="Application.main" />
|
<item itemvalue="Application.main" />
|
||||||
<item itemvalue="Application.ShipWarfareGUI" />
|
<item itemvalue="Application.ShipWarfareGUI" />
|
||||||
|
<item itemvalue="Application.MainGUI" />
|
||||||
</list>
|
</list>
|
||||||
<recent_temporary>
|
<recent_temporary>
|
||||||
<list>
|
<list>
|
||||||
|
<item itemvalue="Application.MainGUI" />
|
||||||
<item itemvalue="Application.ShipWarfareGUI" />
|
<item itemvalue="Application.ShipWarfareGUI" />
|
||||||
<item itemvalue="Application.main" />
|
<item itemvalue="Application.main" />
|
||||||
<item itemvalue="Application.TaipanShop" />
|
<item itemvalue="Application.TaipanShop" />
|
||||||
<item itemvalue="Application.Game" />
|
<item itemvalue="Application.Game" />
|
||||||
<item itemvalue="Application.ShipWarfare" />
|
|
||||||
</list>
|
</list>
|
||||||
</recent_temporary>
|
</recent_temporary>
|
||||||
</component>
|
</component>
|
||||||
@@ -285,6 +265,8 @@
|
|||||||
<workItem from="1552210170594" duration="72000" />
|
<workItem from="1552210170594" duration="72000" />
|
||||||
<workItem from="1552238757321" duration="742000" />
|
<workItem from="1552238757321" duration="742000" />
|
||||||
<workItem from="1552240770629" duration="40000" />
|
<workItem from="1552240770629" duration="40000" />
|
||||||
|
<workItem from="1552241394045" duration="178000" />
|
||||||
|
<workItem from="1552254283748" duration="5646000" />
|
||||||
</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>
|
||||||
@@ -475,17 +457,31 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1552240801199</updated>
|
<updated>1552240801199</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="28" />
|
<task id="LOCAL-00028" summary="Fined minor bugs in shipwarfareGUI including the "gun frustration" variable">
|
||||||
|
<created>1552241433802</created>
|
||||||
|
<option name="number" value="00028" />
|
||||||
|
<option name="presentableId" value="LOCAL-00028" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1552241433802</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00029" summary="Just checking">
|
||||||
|
<created>1552254331758</created>
|
||||||
|
<option name="number" value="00029" />
|
||||||
|
<option name="presentableId" value="LOCAL-00029" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1552254331759</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="30" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="63422000" />
|
<option name="totallyTimeSpent" value="69246000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<frame x="48" y="23" width="1189" height="652" extended-state="0" />
|
<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.2667829" />
|
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2755013" />
|
||||||
<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" />
|
||||||
@@ -582,9 +578,6 @@
|
|||||||
<ignored-roots>
|
<ignored-roots>
|
||||||
<path value="$PROJECT_DIR$" />
|
<path value="$PROJECT_DIR$" />
|
||||||
</ignored-roots>
|
</ignored-roots>
|
||||||
<MESSAGE value="Fixed the setters to be greater than 0" />
|
|
||||||
<MESSAGE value="Created Player class" />
|
|
||||||
<MESSAGE value="Added some stuff for the Travel Class" />
|
|
||||||
<MESSAGE value="Added disasters as well as removing a bug from the flee method in Haris's code" />
|
<MESSAGE value="Added disasters as well as removing a bug from the flee method in Haris's code" />
|
||||||
<MESSAGE value="Fixed a bunch of stuff inside of Travel, but also discovered a MASSIVE problem with our code" />
|
<MESSAGE value="Fixed a bunch of stuff inside of Travel, but also discovered a MASSIVE problem with our code" />
|
||||||
<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" />
|
||||||
@@ -607,7 +600,10 @@
|
|||||||
<MESSAGE value="Completely ruined shipWarfare with a previous edit, fixed it and added a better loot feature for peasant ships" />
|
<MESSAGE value="Completely ruined shipWarfare with a previous edit, fixed it and added a better loot feature for peasant ships" />
|
||||||
<MESSAGE value="Basic functionality of buttons completed, think all I have to do now is to find a way to break the code when the user wins, loses or runs away." />
|
<MESSAGE value="Basic functionality of buttons completed, think all I have to do now is to find a way to break the code when the user wins, loses or runs away." />
|
||||||
<MESSAGE value="Fixed probability of ships running away" />
|
<MESSAGE value="Fixed probability of ships running away" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="Fixed probability of ships running away" />
|
<MESSAGE value="Fined minor bugs in shipwarfareGUI" />
|
||||||
|
<MESSAGE value="Fined minor bugs in shipwarfareGUI including the "gun frustration" variable" />
|
||||||
|
<MESSAGE value="Just checking" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Just checking" />
|
||||||
</component>
|
</component>
|
||||||
<component name="editorHistoryManager">
|
<component name="editorHistoryManager">
|
||||||
<entry file="uml://JAVA/ShipWarfare">
|
<entry file="uml://JAVA/ShipWarfare">
|
||||||
@@ -670,23 +666,6 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShopGUI" />
|
<entry file="file://$PROJECT_DIR$/src/ShopGUI" />
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="255">
|
|
||||||
<caret line="17" column="35" selection-start-line="17" selection-start-column="35" selection-end-line="17" selection-end-column="35" />
|
|
||||||
<folding>
|
|
||||||
<element signature="imports" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/main.java">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="135">
|
|
||||||
<caret line="9" column="4" selection-end-line="55" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</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="15">
|
<state relative-caret-position="15">
|
||||||
@@ -701,14 +680,50 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.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="5531">
|
<state relative-caret-position="195">
|
||||||
<caret line="703" column="1" selection-start-line="703" selection-start-column="1" selection-end-line="703" selection-end-column="1" />
|
<caret line="13" column="5" lean-forward="true" selection-start-line="13" selection-start-column="5" selection-end-line="13" 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="-1074">
|
||||||
|
<caret line="17" column="35" selection-start-line="17" selection-start-column="35" selection-end-line="17" selection-end-column="35" />
|
||||||
|
<folding>
|
||||||
|
<element signature="imports" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/TaipanShopGUI.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="-11142">
|
||||||
|
<caret line="17" column="13" selection-start-line="17" selection-start-column="13" selection-end-line="17" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="15">
|
||||||
|
<caret line="37" column="36" selection-start-line="37" selection-start-column="20" selection-end-line="37" selection-end-column="36" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/MainGUI.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="378">
|
||||||
|
<caret line="55" column="28" selection-start-line="53" selection-start-column="7" selection-end-line="55" selection-end-column="28" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="360">
|
||||||
|
<caret line="314" selection-start-line="314" selection-end-line="314" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
<element signature="e#18236#18237#0" expanded="true" />
|
|
||||||
<element signature="e#18274#18275#0" expanded="true" />
|
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ public class ShipWarfareGUI {
|
|||||||
private Label gunsLeftOrTaken;
|
private Label gunsLeftOrTaken;
|
||||||
private Label continueToFight;
|
private Label continueToFight;
|
||||||
private int counter1;
|
private int counter1;
|
||||||
|
private Button continueButton;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/**
|
/**
|
||||||
@@ -175,6 +178,8 @@ public class ShipWarfareGUI {
|
|||||||
HPLeft.setVisible(true);
|
HPLeft.setVisible(true);
|
||||||
gunsLeftOrTaken.setVisible(true);
|
gunsLeftOrTaken.setVisible(true);
|
||||||
continueToFight.setVisible(true);
|
continueToFight.setVisible(true);
|
||||||
|
continueButton.setVisible(false);
|
||||||
|
|
||||||
|
|
||||||
runAwayOrLeft.setText("No ships ran away");
|
runAwayOrLeft.setText("No ships ran away");
|
||||||
|
|
||||||
@@ -270,12 +275,14 @@ public class ShipWarfareGUI {
|
|||||||
calculateLoot = (startingPeasantShips *100) + randomValue.nextInt(startingPeasantShips) *200;
|
calculateLoot = (startingPeasantShips *100) + randomValue.nextInt(startingPeasantShips) *200;
|
||||||
player.setMoney(player.getMoney() + calculateLoot);
|
player.setMoney(player.getMoney() + calculateLoot);
|
||||||
report.setText(String.format("Our firm has earned $%,d in loot! ", calculateLoot));
|
report.setText(String.format("Our firm has earned $%,d in loot! ", calculateLoot));
|
||||||
|
continueButton.setVisible(true);
|
||||||
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());
|
||||||
|
continueButton.setVisible(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -302,6 +309,10 @@ public class ShipWarfareGUI {
|
|||||||
HPLeft = new Label();
|
HPLeft = new Label();
|
||||||
gunsLeftOrTaken = new Label();
|
gunsLeftOrTaken = new Label();
|
||||||
continueToFight = new Label();
|
continueToFight = new Label();
|
||||||
|
continueButton = new Button();
|
||||||
|
|
||||||
|
continueButton.setVisible(false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BorderPane.setPrefHeight(400.0);
|
BorderPane.setPrefHeight(400.0);
|
||||||
@@ -317,6 +328,9 @@ public class ShipWarfareGUI {
|
|||||||
title.setText(String.format("%d ships attacking. Would you like to Fight or Run?",numOfPeasantShips));
|
title.setText(String.format("%d ships attacking. Would you like to Fight or Run?",numOfPeasantShips));
|
||||||
title.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
|
title.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
|
||||||
|
|
||||||
|
continueButton.setMnemonicParsing(false);
|
||||||
|
continueButton.setText("Continue?");
|
||||||
|
|
||||||
fightButton.setAlignment(javafx.geometry.Pos.CENTER);
|
fightButton.setAlignment(javafx.geometry.Pos.CENTER);
|
||||||
fightButton.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
|
fightButton.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
|
||||||
fightButton.setId("Button1");
|
fightButton.setId("Button1");
|
||||||
@@ -353,6 +367,8 @@ public class ShipWarfareGUI {
|
|||||||
vBox.getChildren().add(HPLeft);
|
vBox.getChildren().add(HPLeft);
|
||||||
vBox.getChildren().add(gunsLeftOrTaken);
|
vBox.getChildren().add(gunsLeftOrTaken);
|
||||||
vBox.getChildren().add(continueToFight);
|
vBox.getChildren().add(continueToFight);
|
||||||
|
vBox.getChildren().add(continueButton);
|
||||||
|
|
||||||
|
|
||||||
//Fight
|
//Fight
|
||||||
fightButton.setOnAction(new EventHandler<ActionEvent>() {
|
fightButton.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
@@ -361,7 +377,20 @@ public class ShipWarfareGUI {
|
|||||||
counter++;
|
counter++;
|
||||||
chooseFightOrRun.setText("Ohh, Fight ehh?");
|
chooseFightOrRun.setText("Ohh, Fight ehh?");
|
||||||
try {
|
try {
|
||||||
destroyPeasantShipsOrEscape();
|
if (destroyPeasantShipsOrEscape()){
|
||||||
|
completeWipe();
|
||||||
|
continueButton.setVisible(true);
|
||||||
|
continueButton.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handle(ActionEvent event) {
|
||||||
|
TaipanShopGUI shop = new TaipanShopGUI(player);
|
||||||
|
shop.initializeShop(stage);
|
||||||
|
stage.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,12 +413,27 @@ public class ShipWarfareGUI {
|
|||||||
chooseFightOrRun.setVisible(false);
|
chooseFightOrRun.setVisible(false);
|
||||||
report.setText(("Couldn't run away"));
|
report.setText(("Couldn't run away"));
|
||||||
try {
|
try {
|
||||||
destroyPeasantShipsOrEscape();
|
if(destroyPeasantShipsOrEscape()==true){
|
||||||
|
completeWipe();
|
||||||
|
continueButton.setVisible(true);
|
||||||
|
continueButton.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
|
@Override
|
||||||
|
public void handle(ActionEvent event) {
|
||||||
|
TaipanShopGUI shop = new TaipanShopGUI(player);
|
||||||
|
shop.initializeShop(stage);
|
||||||
|
stage.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
completeWipe();
|
completeWipe();
|
||||||
report.setText("Phew! Got away safely");
|
report.setText("Phew! Got away safely");
|
||||||
|
TaipanShopGUI shop = new TaipanShopGUI(player);
|
||||||
|
shop.initializeShop(stage);
|
||||||
|
stage.show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user