Added some content to the textgame files and added some stuff to the logic files. Also fixed formating in TravelGUI

This commit is contained in:
2019-04-07 16:35:22 -06:00
parent f37aa91fad
commit 26064ebac3
14 changed files with 1906 additions and 385 deletions

View File

@@ -1,4 +1,27 @@
package logic;
public class GameEndLogic extends Player{
/**
* Calculates the networth of the player by the end of the game
* @return the total networth of the player
*/
public int getNetWorth() {
int netWorthInt;
netWorthInt = getMoney() + (getOpiumHeld() * 16000) + (getSilkHeld() * 160) + (getArmsHeld() * 160) + (getGeneralHeld() * 8);
netWorthInt += (getwOpium() * 16000) + (getwSilk() * 160) + (getwArms() * 160) + (getwGeneral() * 8);
netWorthInt -= getDebt();
return netWorthInt;
}
/**
* If health is below or equal to 0 then the game will either show the gameOver screen or the win screen
* @return the endGame message
*/
public String endGameText() {
if (getHP() <= 0) {
return "Game Over!";
} else {
return "Congratulations!";
}
}
}