import java.io.*;
class GameManager {
private static BufferedReader stdin;
GameManager GameManager = new GameManager();
Robot Robot = new Robot(1,2,3,4,5,0,1,2,3,4);
GameManager() throws IOException {
stdin = new BufferedReader(new InputStreamReader(System.in));
money = 200;
attack = 0;
defense = 0;
lives = 3;
}
void AddAttack(int amount) {
attack =+ amount;
}
void AddDefense(int amount) {
defense =+ amount;
}
void Lives() {
lives = lives - 1;
if (lives == 0) {
System.out.println("Game Over");
} else {
}
}
void MinusMoney(int amount) {
money =+ amount;
}
void AddMoney(int amount) {
money += amount;
}
void Status() {
System.out.println("Current Status");
System.out.println("Lives: "+lives);
System.out.println("Money: $"+money);
System.out.println("Attack: "+attack);
System.out.println("Defense: "+defense);
}
void ShopOrBattle() {
System.out.print("Would you like battle or shop?");
String ShopBattle = stdin.readLine();
if (ShopBattle.equals("battle")||ShopBattle.equals("Battle")) {
System.out.println("Which robot would you like to battle?\n");
System.out.println("Robot 1");
System.out.println("Robot 2");
System.out.println("Robot 3");
System.out.println("Robot 4");
System.out.println("Robot 5");
String robotString = stdin.readLine();
int robotInt = Integer.parseInt(robotString);
if (robotInt == 1) {
System.out.println("\nBattling Robot 1");
Robot.Robot1();
} else if (robotInt == 2) {
System.out.println("\nBattling Robot 2");
Robot.Robot2();
} else if (robotInt == 3) {
System.out.println("\nBattling Robot 3");
Robot.Robot3();
} else if (robotInt == 4) {
System.out.println("\nBattling Robot 4");
Robot.Robot4();
} else if (robotInt == 5) {
System.out.println("\nBattling Robot 5");
Robot.Robot5();
} else {
System.out.println("Please enter the number of the robot you wish to battle");
GameManager.ShopOrBattle();
}
} else if (ShopBattle.equals("shop")||ShopBattle.equals("Shop")) {
System.out.println("This is the Shop, what would you like to purchase?\n");
System.out.println("1. Armour $100");
System.out.println("2. Sword $200");
System.out.println("3. Chain $300");
System.out.println("4. Gun $400");
String buy1 = stdin.readLine();
int buy = Integer.parseInt(buy1);
if (buy == 1){
if (money >= 100) {
defense = defense++;
money = money - 100;
System.out.println("Purchase Successful");
} else {
System.out.println("You do not have enough money");
}
} else if (buy == 2) {
if (money >= 200) {
attack = attack ++ ;
money = money - 200;
System.out.println("Purchase Successful");
} else {
System.out.println("You do not have enough money");
}
} else if (buy == 3) {
if (money >= 300) {
attack = attack + 2;
money = money - 300;
System.out.println("Purchase Successful");
} else {
System.out.println("You do not have enough money");
}
} else if (buy == 3) {
if (money >= 300) {
attack = attack + 3;
money = money - 300;
System.out.println("Purchase Successful");
} else {
System.out.println("You do not have enough money");
}
} else if (buy == 4) {
if (money >= 400) {
attack = attack + 4;
money = money - 400;
System.out.println("Purchase Successful");
} else {
System.out.println("You do not have enough money");
}
}
} else {
System.out.println("Please enter either shop or battle");
ShopBattle = stdin.readLine();
GameManager.ShopOrBattle();
}
}
}