implement Dragon class

This commit is contained in:
2026-05-10 11:57:40 +03:30
parent 3ab38fddce
commit 7c60722ff2
15 changed files with 70 additions and 2 deletions
@@ -108,7 +108,8 @@ public class Main {
while (player.isAlive() && enemy.isAlive()) {
if (turn == 0) {
turn = 1;
System.out.println("choose your action:\n1.light attack 2.heavy attack 3.defend 4.heal 5.special ability");
System.out.println("choose your action:\n1.light attack 2.heavy attack " +
"3.defend 4.heal 5.special ability 6.flask");
choice = sc.nextInt();
switch (choice) {
case 1:
@@ -131,8 +132,15 @@ public class Main {
player.specialAbility(enemy);
if (player.isSuccessfulAction()) break;
else {turn = 0; continue;}
case 6:
player.getFlask().use(player);
break;
default:
System.out.println("invalid choice");
turn = 0;
continue;
}
System.out.println("[" + player.getClass().getSimpleName() + " - " + player.getHP() + "/" + player.getMaxHP()
+ " HP | " + player.getMP() + "/" + player.getMaxMP() + " Mana" + "]");