Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Battle1
- {
- static String EnemyPoke = "Zebstrika";
- static Scanner scan = new Scanner(System.in);
- public static void main(String[] args)
- {
- PokemonQ1();
- String poke1 = userPoke();
- PokemonQ1Mk2(poke1);
- int PokeLevel = Level();
- int AttackLevel = Attack();
- int DefenseLevel = Defense();
- int BaseLevel = Base();
- int STABtf = STAB();
- int HP = Health();
- double modifier = 0;
- modifier = ModiferCalculation(STAB);
- DamageCalculations(PokeLevel, AttackLevel, DefenseLevel, BaseLevel, modifier);
- }
- public static void PokemonQ1()
- {
- System.out.println("Another Trainer is Issuing a Challenge! \n");
- System.out.println("Zebstrika Appeared.\n");
- System.out.println("Which Pokemon do you choose?\n");
- }
- public static String userPoke()
- {
- Scanner scanner = new Scanner(System.in);
- String poke1 = scanner.nextLine();
- return poke1;
- }
- public static void PokemonQ1Mk2(String poke1)
- {
- System.out.println(" ");
- System.out.println("You chose " + poke1 + "! \n");
- System.out.println("It's a battle between " + poke1 + " and " + EnemyPoke + "!" + " Go! \n");
- }
- public static int Level()
- {
- System.out.println("Level:");
- int PokeLevel = scan.nextInt();
- return PokeLevel;
- }
- public static int Attack()
- {
- System.out.println("Attack:");
- int AttackLevel = scan.nextInt();
- return AttackLevel;
- }
- public static int Defense()
- {
- System.out.println("Defense:");
- int DefenseLevel = scan.nextInt();
- return DefenseLevel;
- }
- public static int Base()
- {
- System.out.println("Base:");
- int BaseLevel = scan.nextInt();
- return BaseLevel;
- }
- public static int STAB()
- {
- System.out.println("STAB:");
- int STABtf = scan.nextInt();
- return STABtf;
- }
- public static int Health()
- {
- System.out.println("HP:");
- int HP = scan.nextInt();
- return HP;
- }
- public static double ModiferCalculation(double STABtf)
- {
- double r = (double) (Math.random() * (1.0 - 0.85)) + 0.85;
- double modifier = (double) (r * STABtf);
- return modifier;
- }
- public static void DamageCalculations(int PokeLevel, int AttackLevel, int DefenseLevel, int BaseLevel, double Modifier)
- {
- double DamageDealt = (double) ((2 * PokeLevel * 10 / 250) * (AttackLevel / DefenseLevel) * BaseLevel + 2) * Modifier;
- System.out.println("Damage Dealt:" + DamageDealt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement