Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (health > 0 && enemyHealth > 0) {
- System.out.println("You have " + health + " hp.");
- System.out.println("---------------------");
- System.out.println("Your enemy has " + enemyHealth + " hp.");
- System.out.println("---------------------");
- System.out.println("Choose an attack: \n-Basic attack \n-Heavy attack \n-Fireball \n-Force pulse \n-Heal \n-Greater heal \n-Impale \n-Snipe \n-Slash");
- attack = scnr.nextLine().toLowerCase();
- switch (attack) {
- case "basic attack": enemyHealth -= basicattack(0); break;
- case "heavy attack": enemyHealth -= heavyattack(0); break;
- case "fireball": enemyHealth -= fireball(0); break;
- case "force pulse": enemyHealth -= forcepulse(0); break;
- case "heal": enemyHealth -= heal(0); break;
- case "greater heal": enemyHealth -= greaterheal(0); break;
- case "impale": enemyHealth -= impale(0); break;
- case "snipe": enemyHealth -= snipe(0); break;
- case "slash": enemyHealth -= slash(0); break;
- }
- low = 1;
- high = 3;
- result = r.nextInt(high-low) + low;
- switch (result) {
- case 1: health -= basicattack(1); break;
- case 2: health -= heavyattack(1); break;
- case 3: health -= slash(1); break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement