Fined minor bugs in shipwarfareGUI including the "gun frustration" variable
This commit is contained in:
40
.idea/workspace.xml
generated
40
.idea/workspace.xml
generated
@@ -1,9 +1,7 @@
|
|||||||
<?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="" />
|
||||||
<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/" />
|
||||||
@@ -30,12 +28,12 @@
|
|||||||
<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="244">
|
<state relative-caret-position="5531">
|
||||||
<caret line="485" column="20" lean-forward="true" selection-end-line="702" selection-end-column="1" />
|
<caret line="703" column="1" selection-start-line="703" selection-start-column="1" selection-end-line="703" 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#18236#18237#0" expanded="true" />
|
||||||
<element signature="e#18454#18455#0" expanded="true" />
|
<element signature="e#18274#18275#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
@@ -150,7 +148,6 @@
|
|||||||
<foldersAlwaysOnTop value="true" />
|
<foldersAlwaysOnTop value="true" />
|
||||||
</navigator>
|
</navigator>
|
||||||
<panes>
|
<panes>
|
||||||
<pane id="PackagesPane" />
|
|
||||||
<pane id="ProjectPane">
|
<pane id="ProjectPane">
|
||||||
<subPane>
|
<subPane>
|
||||||
<expand>
|
<expand>
|
||||||
@@ -167,6 +164,7 @@
|
|||||||
<select />
|
<select />
|
||||||
</subPane>
|
</subPane>
|
||||||
</pane>
|
</pane>
|
||||||
|
<pane id="PackagesPane" />
|
||||||
<pane id="Scope" />
|
<pane id="Scope" />
|
||||||
</panes>
|
</panes>
|
||||||
</component>
|
</component>
|
||||||
@@ -286,6 +284,7 @@
|
|||||||
<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" />
|
<workItem from="1552238757321" duration="742000" />
|
||||||
|
<workItem from="1552240770629" duration="40000" />
|
||||||
</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>
|
||||||
@@ -469,17 +468,24 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1552238814974</updated>
|
<updated>1552238814974</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="27" />
|
<task id="LOCAL-00027" summary="Fixed probability of ships running away">
|
||||||
|
<created>1552240801199</created>
|
||||||
|
<option name="number" value="00027" />
|
||||||
|
<option name="presentableId" value="LOCAL-00027" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1552240801199</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="28" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="63382000" />
|
<option name="totallyTimeSpent" value="63422000" />
|
||||||
</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.26242372" />
|
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2667829" />
|
||||||
<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" />
|
||||||
@@ -576,7 +582,6 @@
|
|||||||
<ignored-roots>
|
<ignored-roots>
|
||||||
<path value="$PROJECT_DIR$" />
|
<path value="$PROJECT_DIR$" />
|
||||||
</ignored-roots>
|
</ignored-roots>
|
||||||
<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" />
|
||||||
<MESSAGE value="Added some stuff for the Travel Class" />
|
<MESSAGE value="Added some stuff for the Travel Class" />
|
||||||
@@ -601,7 +606,8 @@
|
|||||||
<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" />
|
||||||
<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." />
|
||||||
<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." />
|
<MESSAGE value="Fixed probability of ships running away" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Fixed probability of ships running away" />
|
||||||
</component>
|
</component>
|
||||||
<component name="editorHistoryManager">
|
<component name="editorHistoryManager">
|
||||||
<entry file="uml://JAVA/ShipWarfare">
|
<entry file="uml://JAVA/ShipWarfare">
|
||||||
@@ -697,12 +703,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="244">
|
<state relative-caret-position="5531">
|
||||||
<caret line="485" column="20" lean-forward="true" selection-end-line="702" selection-end-column="1" />
|
<caret line="703" column="1" selection-start-line="703" selection-start-column="1" selection-end-line="703" 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#18236#18237#0" expanded="true" />
|
||||||
<element signature="e#18454#18455#0" expanded="true" />
|
<element signature="e#18274#18275#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
private int startingLittyShips = 0;
|
private int startingLittyShips = 0;
|
||||||
private int howMuchRun = 0;
|
private int howMuchRun = 0;
|
||||||
private String pirateName = "Liu Yen";
|
private String pirateName = "Liu Yen";
|
||||||
private Boolean isScreenFull = false;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -169,7 +168,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* setter method that takes in an integer as an argument
|
* setter method that takes in an integer as an argument
|
||||||
*
|
|
||||||
* @param numOfLittyShips the number of ships to be used in the litty fleet attack
|
* @param numOfLittyShips the number of ships to be used in the litty fleet attack
|
||||||
*/
|
*/
|
||||||
public void setNumOfLittyShips(int numOfLittyShips) {
|
public void setNumOfLittyShips(int numOfLittyShips) {
|
||||||
@@ -180,7 +178,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* setter method that takes in an integer as an argument
|
* setter method that takes in an integer as an argument
|
||||||
*
|
|
||||||
* @param numOfPeasantShips the number of ships to be used in the peasant fleet attack
|
* @param numOfPeasantShips the number of ships to be used in the peasant fleet attack
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -196,7 +193,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of ships that attack is based on the amount of money one has on hand
|
* The number of ships that attack is based on the amount of money one has on hand
|
||||||
*
|
|
||||||
* @return the number of ships which will attack
|
* @return the number of ships which will attack
|
||||||
*/
|
*/
|
||||||
public int numOfShips() {
|
public int numOfShips() {
|
||||||
@@ -224,7 +220,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* One in 10 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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -243,7 +238,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
/**
|
/**
|
||||||
* The user faces off against the litty ships and either prevails, dies, or runs away
|
* The user faces off against the litty ships and either prevails, dies, or runs away
|
||||||
* The loot for defeating a litty fleet is much higher than that of a peasant one
|
* The loot for defeating a litty fleet is much higher than that of a peasant one
|
||||||
*
|
|
||||||
* @return true if the user wins, loses, or flees, it returns false otherwise
|
* @return true if the user wins, loses, or flees, it returns false otherwise
|
||||||
* @throws Exception in case of errors due to the
|
* @throws Exception in case of errors due to the
|
||||||
*/
|
*/
|
||||||
@@ -360,7 +354,9 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sets most of the labels to false exceptf for he fight or run label
|
||||||
|
*/
|
||||||
public void wipe() {
|
public void wipe() {
|
||||||
title.setVisible(false);
|
title.setVisible(false);
|
||||||
runAwayOrLeft.setVisible(false);
|
runAwayOrLeft.setVisible(false);
|
||||||
@@ -371,6 +367,9 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* sets most of the labels to false including the fight or run label
|
||||||
|
*/
|
||||||
public void completeWipe() {
|
public void completeWipe() {
|
||||||
title.setVisible(false);
|
title.setVisible(false);
|
||||||
chooseFightOrRun.setVisible(false);
|
chooseFightOrRun.setVisible(false);
|
||||||
@@ -385,7 +384,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The user faces off against the peasant ships and either prevails, dies, or runs away
|
* The user faces off against the peasant ships and either prevails, dies, or runs away
|
||||||
*
|
|
||||||
* @return true if the user wins, loses, or flees, it returns false otherwise
|
* @return true if the user wins, loses, or flees, it returns false otherwise
|
||||||
* @throws Exception in case of errors due to the delay
|
* @throws Exception in case of errors due to the delay
|
||||||
*/
|
*/
|
||||||
@@ -395,7 +393,7 @@ public class ShipWarfareGUI extends Application {
|
|||||||
int chanceOfEnemyRun = 0;
|
int chanceOfEnemyRun = 0;
|
||||||
int hitCounter = 0;
|
int hitCounter = 0;
|
||||||
int missCounter = 0;
|
int missCounter = 0;
|
||||||
boolean gunFrustration = true;
|
boolean gunFrustration = false;
|
||||||
|
|
||||||
title.setVisible(true);
|
title.setVisible(true);
|
||||||
chooseFightOrRun.setVisible(true);
|
chooseFightOrRun.setVisible(true);
|
||||||
@@ -533,38 +531,9 @@ public class ShipWarfareGUI extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Main G
|
|
||||||
private int counter = 0;
|
private int counter = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* delays for a specific amount of seconds, takes an integer as an argument
|
|
||||||
*
|
|
||||||
* @param num the seconds to delay
|
|
||||||
* @throws Exception in case of errors due to the delay
|
|
||||||
*/
|
|
||||||
|
|
||||||
public void delayForSeconds(int num) {
|
|
||||||
try {
|
|
||||||
TimeUnit.SECONDS.sleep(num);
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setLabel1(String sysOut) {
|
|
||||||
report.setText(sysOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
public void peasantFleet() throws Exception {
|
|
||||||
ShipWarfare attackShip = new ShipWarfare(player);
|
|
||||||
attackShip.peasantFleetAttack();
|
|
||||||
player = attackShip.getPlayer();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public void start(Stage stage) throws Exception {
|
public void start(Stage stage) throws Exception {
|
||||||
setNumOfPeasantShips(numOfShips());
|
setNumOfPeasantShips(numOfShips());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user