Fixed probability of ships running away
This commit is contained in:
64
.idea/workspace.xml
generated
64
.idea/workspace.xml
generated
@@ -2,7 +2,7 @@
|
|||||||
<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="">
|
||||||
<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>
|
</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/" />
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</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="true">
|
<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="255">
|
<state relative-caret-position="255">
|
||||||
@@ -27,13 +27,15 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<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="483">
|
<state relative-caret-position="244">
|
||||||
<caret line="665" column="1" selection-start-line="665" selection-start-column="1" selection-end-line="665" selection-end-column="1" />
|
<caret line="485" column="20" lean-forward="true" selection-end-line="702" selection-end-column="1" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
|
<element signature="e#18416#18417#0" expanded="true" />
|
||||||
|
<element signature="e#18454#18455#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
@@ -77,9 +79,6 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="FindInProjectRecents">
|
<component name="FindInProjectRecents">
|
||||||
<findStrings>
|
<findStrings>
|
||||||
<find>numOfpeasantShips</find>
|
|
||||||
<find>startingPeasantShips</find>
|
|
||||||
<find>startingLittyShips</find>
|
|
||||||
<find>howMuchRun</find>
|
<find>howMuchRun</find>
|
||||||
<find>pirateName</find>
|
<find>pirateName</find>
|
||||||
<find>player</find>
|
<find>player</find>
|
||||||
@@ -107,6 +106,9 @@
|
|||||||
<find>We survive</find>
|
<find>We survive</find>
|
||||||
<find>total of</find>
|
<find>total of</find>
|
||||||
<find>int numOfShips</find>
|
<find>int numOfShips</find>
|
||||||
|
<find>runFromShips()</find>
|
||||||
|
<find>dang it!</find>
|
||||||
|
<find>dang it</find>
|
||||||
</findStrings>
|
</findStrings>
|
||||||
<replaceStrings>
|
<replaceStrings>
|
||||||
<replace>HP</replace>
|
<replace>HP</replace>
|
||||||
@@ -131,8 +133,8 @@
|
|||||||
<option value="$PROJECT_DIR$/src/main.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/Player.java" />
|
<option value="$PROJECT_DIR$/src/Player.java" />
|
||||||
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
|
|
||||||
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
||||||
|
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@@ -283,6 +285,7 @@
|
|||||||
<workItem from="1552203562938" duration="2174000" />
|
<workItem from="1552203562938" duration="2174000" />
|
||||||
<workItem from="1552207404121" duration="54000" />
|
<workItem from="1552207404121" duration="54000" />
|
||||||
<workItem from="1552210170594" duration="72000" />
|
<workItem from="1552210170594" duration="72000" />
|
||||||
|
<workItem from="1552238757321" duration="742000" />
|
||||||
</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>
|
||||||
@@ -459,17 +462,24 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1552210228514</updated>
|
<updated>1552210228514</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="26" />
|
<task id="LOCAL-00026" summary="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.">
|
||||||
|
<created>1552238814974</created>
|
||||||
|
<option name="number" value="00026" />
|
||||||
|
<option name="presentableId" value="LOCAL-00026" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1552238814974</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="27" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="62640000" />
|
<option name="totallyTimeSpent" value="63382000" />
|
||||||
</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 active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2580645" />
|
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26242372" />
|
||||||
<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" />
|
||||||
@@ -566,7 +576,6 @@
|
|||||||
<ignored-roots>
|
<ignored-roots>
|
||||||
<path value="$PROJECT_DIR$" />
|
<path value="$PROJECT_DIR$" />
|
||||||
</ignored-roots>
|
</ignored-roots>
|
||||||
<MESSAGE value="This should fix the ShipWarfare file and bring it up to date with the rest of the file." />
|
|
||||||
<MESSAGE value="Created Core class" />
|
<MESSAGE value="Created Core class" />
|
||||||
<MESSAGE value="Fixed the setters to be greater than 0" />
|
<MESSAGE value="Fixed the setters to be greater than 0" />
|
||||||
<MESSAGE value="Created Player class" />
|
<MESSAGE value="Created Player class" />
|
||||||
@@ -591,7 +600,8 @@
|
|||||||
<MESSAGE value="Fixed numOfShips method for ShipWarfareGUI" />
|
<MESSAGE value="Fixed numOfShips method for ShipWarfareGUI" />
|
||||||
<MESSAGE value="Fixed the loot system a bit" />
|
<MESSAGE value="Fixed the loot system a bit" />
|
||||||
<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" />
|
||||||
<option name="LAST_COMMIT_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." />
|
||||||
|
<option name="LAST_COMMIT_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." />
|
||||||
</component>
|
</component>
|
||||||
<component name="editorHistoryManager">
|
<component name="editorHistoryManager">
|
||||||
<entry file="uml://JAVA/ShipWarfare">
|
<entry file="uml://JAVA/ShipWarfare">
|
||||||
@@ -654,6 +664,16 @@
|
|||||||
</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">
|
<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="135">
|
<state relative-caret-position="135">
|
||||||
@@ -677,20 +697,12 @@
|
|||||||
</entry>
|
</entry>
|
||||||
<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="483">
|
<state relative-caret-position="244">
|
||||||
<caret line="665" column="1" selection-start-line="665" selection-start-column="1" selection-end-line="665" selection-end-column="1" />
|
<caret line="485" column="20" lean-forward="true" selection-end-line="702" selection-end-column="1" />
|
||||||
<folding>
|
|
||||||
<element signature="imports" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<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>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
|
<element signature="e#18416#18417#0" expanded="true" />
|
||||||
|
<element signature="e#18454#18455#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
Binary file not shown.
@@ -223,7 +223,7 @@ public class ShipWarfareGUI extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One in two chance of running away
|
* One in 10 chance of running away
|
||||||
*
|
*
|
||||||
* @return true if the user is allowed to run, false if not, the "default" is false
|
* @return true if the user is allowed to run, false if not, the "default" is false
|
||||||
*/
|
*/
|
||||||
@@ -231,7 +231,7 @@ public class ShipWarfareGUI extends Application {
|
|||||||
public boolean runFromShips() {
|
public boolean runFromShips() {
|
||||||
userAttacks = false;
|
userAttacks = false;
|
||||||
Random randomValue = new Random();
|
Random randomValue = new Random();
|
||||||
int runSuccessChance = randomValue.nextInt(2) + 1;
|
int runSuccessChance = randomValue.nextInt(10) + 1;
|
||||||
if (runSuccessChance == 2) {
|
if (runSuccessChance == 2) {
|
||||||
return true;
|
return true;
|
||||||
} else if (runSuccessChance == 1) {
|
} else if (runSuccessChance == 1) {
|
||||||
@@ -459,10 +459,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
runAwayOrLeft.setText(String.format("Cowards! %d ships ran away %s! ", howMuchRun, player.getName()));
|
runAwayOrLeft.setText(String.format("Cowards! %d ships ran away %s! ", howMuchRun, player.getName()));
|
||||||
//runAwayOrLeft.setVisible(true);
|
//runAwayOrLeft.setVisible(true);
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
runAwayOrLeft.setText(String.format("Escaped %d of them %s! ", howMuchRun, player.getName()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
report.setText((String.format("Escaped %d of them %s!", howMuchRun,player.getName())));
|
report.setText((String.format("Escaped %d of them %s!", howMuchRun,player.getName())));
|
||||||
@@ -656,7 +652,8 @@ public class ShipWarfareGUI extends Application {
|
|||||||
destroyPeasantShipsOrEscape();
|
destroyPeasantShipsOrEscape();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
if (counter == 2) {
|
|
||||||
|
if (counter >= 2) {
|
||||||
title.setVisible(false);
|
title.setVisible(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -685,6 +682,10 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (counter>=2){
|
||||||
|
title.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user