Implement remaining game mechanics and fixed known bugs

This commit is contained in:
2026-05-08 19:33:52 +03:30
parent b97c9aa938
commit eaa0640a9c
38 changed files with 420 additions and 78 deletions
@@ -1,4 +1,89 @@
package org.project;
import java.util.Scanner;
public class Help {
private Scanner scanner;
public Help(){
this.scanner = new Scanner(System.in);
}
public void showHelp() {
while(true) {
System.out.println("\n"+"===== Help Menu =====");
System.out.println("What do you need help with, sir?");
System.out.println("1-What is Java-Knight?");
System.out.println("2-How to play");
System.out.println("0-Back");
System.out.println("=======================");
int choice = getValidIntInput();
switch (choice) {
case 1: javaKnight(); break;
case 2: howTo(); break;
case 0: return;
default:
System.out.println("Invalid choice. Please choose a number between 0-2.");
}
}
}
private void javaKnight() {
System.out.println("""
Prologue: The Legend of Javanest
For centuries, the land of Javanest lived in peace, until a magical Dragon attacked,
plunging the realm into absolute darkness. With a wicked curse,
the Dragon transformed the innocent people into horrific monsters:
Goblins, Skeletons, and Vampires. Retreating to its impenetrable Castle,
the Dragon divided the three keys to its lair and hid them among these cursed creatures.
Now, it is your duty to step up and save the land. You must battle these monsters,
recover the unique key from each monster type, and finally slay the Dragon to
break the curse and restore peace to Javanest!
""");
System.out.println("\nPress ENTER to go back...");
scanner.nextLine();
}
private void howTo() {
System.out.println("=== HOW TO PLAY ===");
System.out.println();
System.out.println("Goal Defeat enemies to collect three unique keys (Goblin, Skeleton, Vampire), then storm the castle and slay the Dragon.");
System.out.println();
System.out.println("Choose Your Class Start as one of three heroes:");
System.out.println(" - Knight High damage.");
System.out.println(" - Assassin High stamina.");
System.out.println(" - Wizard High health.");
System.out.println();
System.out.println("Combat (Turn-Based) On your turn, choose one action:");
System.out.println(" 1. Light Attack Moderate damage, costs no mana (your fallback when out of mana).");
System.out.println(" 2. Heavy Attack High damage, costs mana.");
System.out.println(" 3. Special Ability Unique class move (highest mana cost).");
System.out.println(" 4. Defend Reduces or blocks the next enemy attack.");
System.out.println(" 5. Heal Restores HP, costs mana.");
System.out.println();
System.out.println("Progression");
System.out.println(" - After each victory, your HP and mana fully recover.");
System.out.println(" - Defeating enemies grants XP → leveling up increases max HP/mana.");
System.out.println(" - Each enemy has a chance (~20%) to drop its unique key. You only need one key per enemy type.");
System.out.println();
System.out.println("Locked Path The castle option is hidden until you collect all three keys. Only then can you face the final Dragon.");
System.out.println();
System.out.println("Game Over If your HP reaches zero, the game ends.");
System.out.println();
System.out.println("> \"Collect the keys. Break the curse. Save Javanest.\"");
System.out.println("\nPress ENTER to go back...");
scanner.nextLine();
}
private int getValidIntInput() {
while (!scanner.hasNextInt()) {
System.out.print("Please enter a valid number: ");
scanner.next();
}
int input = scanner.nextInt();
scanner.nextLine(); // Clear buffer
return input;
}
}
@@ -1,7 +1,9 @@
package org.project;
import org.project.entity.players.Assassin;
import org.project.entity.players.Knight;
import org.project.entity.players.Player;
import org.project.entity.players.Wizard;
import org.project.item.weapons.Sword;
import java.util.Scanner;
@@ -9,6 +11,7 @@ import java.util.Scanner;
public class Menu {
private Scanner scanner = new Scanner(System.in);
private MenuActions actions = new MenuActions();
private Help helpMenu = new Help();
public void start() {
while (true) {
@@ -24,7 +27,7 @@ public class Menu {
switch(choice) {
case 0: return;
case 1: startMenu(); break;
case 2: showHelp(); break;
case 2: helpMenu.showHelp(); break;
default:
System.out.println("Invalid choice, please choose a number between 0-2");
}
@@ -55,13 +58,13 @@ public class Menu {
while (keepAsking) {
int choice = getValidIntInput();
switch (choice) {
case 1: character = new Knight(name, 1000, 1000, new Sword(), 5, 5);
case 1: character = new Knight(name);
System.out.println("You are a knight!");
keepAsking = false; break;
case 2: character = new Knight(name);
case 2: character = new Wizard(name);
System.out.println("You are a wizard!");
keepAsking = false; break;
case 3: character = new Knight(name);
case 3: character = new Assassin(name);
System.out.println("You are an assassin!");
keepAsking = false; break;
case 0: keepAsking = false; break;
@@ -71,17 +74,7 @@ public class Menu {
return character;
}
private void showHelp() {
System.out.println("\n"+"===== Java Knight =====");
System.out.println("Help menu");
System.out.println("What do you need help with, sir?");
System.out.println("1-What is Java-Knight?");
System.out.println("2-How to play");
System.out.println("3-About characters");
System.out.println("4-General tips");
System.out.println("0-Back");
System.out.println("=======================");
}
private int getValidIntInput() {
while (!scanner.hasNextInt()) {
System.out.print("Please enter a valid number: ");
@@ -1,8 +1,7 @@
package org.project;
import org.project.entity.Entity;
import org.project.entity.enemies.Enemy;
import org.project.entity.enemies.Skeleton;
import org.project.entity.enemies.*;
import org.project.entity.players.Player;
import org.project.location.Location;
@@ -11,12 +10,21 @@ import java.util.Random;
import java.util.Scanner;
public class MenuActions {
private ArrayList<Location> locations = new ArrayList<>();
Scanner scanner = new Scanner(System.in);
private ArrayList<Location> locations;
Scanner scanner;
public MenuActions() {
this.scanner = new Scanner(System.in);
this.locations = new ArrayList<>();
}
public void startGame(Player player) {
while (player.getKeysCollected() < 3) {
System.out.println("Keys collected: " + player.getKeysCollected());
while (player.getKeysCollectedCount() < 3) {
// System.out.println("Keys collected: " + player.getStringKeysCollected());
// if (askInventory(player)) {
//
// };
askInventory(player);
Enemy enemy = chooseEnemy();
Entity winner = fight(player, enemy);
@@ -25,7 +33,21 @@ public class MenuActions {
break;
}
}
if (player.getKeysCollectedCount() == 3) {
askInventory(player);
System.out.println("Congratulations! You have successfully collected all 3 keys\n" +
"You may now fight the Dragon");
System.out.println("Make sure to upgrade before entering the castle!");
askInventory(player);
System.out.println("Entering the castle...");
Entity winner = fight(player, new Dragon());
if (winner != player) {
System.out.println("You were killed by the dragon. Game over!\nreturning to main menu...");
} else {
System.out.println("Congratulations! You killed the dragon and saved Javanest!");
}
}
}
private Enemy chooseEnemy() {
@@ -60,23 +82,43 @@ public class MenuActions {
public Entity fight(Player player, Enemy enemy) {
player.heal(player.getMaxHP());
player.fillMana(player.getMaxMP());
Entity winner = null;
Entity winner;
while (true) {
playerTurn(player, enemy);
if (enemy.getHp() == 0) {
winner = player;
System.out.println(player.getName() + " won the fight!");
player.setXp(player.getXp()+5);
System.out.println(player.getName() + " got 5 XP for winning the fight!");
System.out.println("Keys collected: " + player.getKeysCollected());
if (!(enemy instanceof Dragon)) {
player.setXp(player.getXp()+5);
System.out.println(player.getName() + " got 5 XP for winning the fight!");
}
if (enemy instanceof Skeleton) {
boolean hasKey = ((Skeleton) enemy).generateKey();
if (hasKey) {
player.collectKey();
player.collectKey((Skeleton) enemy);
player.setXp(player.getXp()+20);
System.out.println(player.getName() + " got a key and 20 XP!");
System.out.println(player.getName() + " got a Skeleton key and 20 XP!");
}
}
if (enemy instanceof Goblin) {
boolean hasKey = ((Goblin) enemy).generateKey();
if (hasKey) {
player.collectKey((Goblin) enemy);
player.setXp(player.getXp()+10);
System.out.println(player.getName() + " got a Goblin key and 10 XP!");
}
}
if (enemy instanceof Vampire) {
boolean hasKey = ((Vampire) enemy).generateKey();
if (hasKey) {
player.collectKey((Vampire) enemy);
player.setXp(player.getXp()+30);
System.out.println(player.getName() + " got a Vampire key and 30 XP!");
}
}
System.out.println("Keys collected: " + player.getStringKeysCollected());
return winner;
}
enemyTurn(player, enemy);
@@ -96,25 +138,28 @@ public class MenuActions {
// System.out.println("1-Light attack, mana cost: 0");
// System.out.println("2-Heavy attack, mana cost: ");
// System.out.println("3-Special Ability, mana cost: ");
// System.out.println("4-Defend, mana cost: 10");
// System.out.println("5-Heal, mana cost: 20");
// System.out.println("4-Defend, mana cost: 10"); disabled
// System.out.println("5-Heal, mana cost: 20"); disabled
while (true) {
Random random = new Random();
int choice = random.nextInt(5) + 1;
int choice = random.nextInt(3) + 1;
switch (choice) {
case 1: enemy.getWeapon().lightAttack(player); return;
case 1: enemy.getWeapon().lightAttack(player);
System.out.println(enemy.getType() + "attacked(light)!"); return;
case 2: if(enemy.getMp() >= enemy.getWeapon().getManaCost()) {
enemy.getWeapon().heavyAttack(enemy, player); return;
enemy.getWeapon().heavyAttack(enemy, player);
System.out.println(enemy.getType() + "attacked(Heavy)!"); return;
} break;
case 3: if (enemy.getMp() >= enemy.getWeapon().getSpecialMana()){
enemy.getWeapon().useSpecialAbility(enemy, player); return;
} break;
case 4: if (enemy.getMp() >= enemy.getDefendManaCost()) {
enemy.defend(); return;
} break;
case 5: if (enemy.getMp() >= enemy.getHealManaCost()) {
enemy.heal(20); return;
enemy.getWeapon().useSpecialAbility(enemy, player);
System.out.println(enemy.getType() + "used special ability!"); return;
} break;
// case 4: if (enemy.getMp() >= enemy.getDefendManaCost()) {
// enemy.defend(); return;
// } break;
// case 5: if (enemy.getMp() >= enemy.getHealManaCost()) {
// enemy.heal(20); return;
// } break;
default:
System.out.println("Invalid choice");
}
@@ -168,20 +213,21 @@ public class MenuActions {
}
private void askInventory(Player player) {
System.out.println("Choose an option: ");
System.out.println("1- Go to the inventory");
System.out.println("2- Continue to next fight");
whileLoop:
while (true) {
System.out.println("Choose an option: ");
System.out.println("1- Go to the inventory");
System.out.println("2- Continue to next fight");
int choice = getValidIntInput();
switch (choice) {
case 1: shop(player);
case 1: shop(player); break;
case 2: return;
default:
System.out.println("Invalid choice, please choose a number (1 or 2)."); break;
}
}
}
private void shop(Player player) {
@@ -1,4 +1,28 @@
package org.project.entity.enemies;
public class Dragon {
import org.project.item.weapons.BoneHarpoon;
import org.project.item.weapons.TailScythe;
import org.project.item.weapons.Weapon;
public class Dragon extends Enemy{
private static int DEFAULT_HP = 200;
private static int DEFAULT_MP = 200;
private static TailScythe DEFAULT_WEAPON = new TailScythe();
private static int DEFAULT_HEAL_MANA_COST = 20;
private static int DEFAULT_DEFEND_MANA_COST = 20;
public Dragon() {
super(DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Dragon(String name, int hp, int mp, Weapon weapon,
int healManaCost, int defendManaCost) {
super(hp, mp, weapon, healManaCost, defendManaCost);
}
@Override
public String getType() {
return "Dragon";
}
}
@@ -1,4 +1,59 @@
package org.project.entity.enemies;
public class Goblin {
import org.project.item.weapons.BoneHarpoon;
import org.project.item.weapons.GoblinSickle;
import org.project.item.weapons.Weapon;
import java.util.Random;
public class Goblin extends Enemy implements Key{
private static int DEFAULT_HP = 80;
private static int DEFAULT_MP = 120;
private static GoblinSickle DEFAULT_WEAPON = new GoblinSickle();
private static int DEFAULT_HEAL_MANA_COST = 30;
private static int DEFAULT_DEFEND_MANA_COST = 20;
private static int keysRemaining = 1;
public Goblin() {
super(DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Goblin(String name, int hp, int mp, Weapon weapon,
int healManaCost, int defendManaCost) {
super(hp, mp, weapon, healManaCost, defendManaCost);
}
@Override
public String getType() {
return "Goblin" ;
}
@Override
public boolean generateKey() {
if (keysRemaining > 0) {
Random random = new Random();
int dice = random.nextInt(1);
if (dice == 0) {
decreaseKey();
return true;
}
}
return false;
}
@Override
public void decreaseKey() {
keysRemaining -= 1;
}
@Override
public int getKeysRemaining() {
return keysRemaining;
}
@Override
public String getKeyType() {
return "Goblin";
}
}
@@ -4,4 +4,5 @@ public interface Key {
boolean generateKey();
void decreaseKey();
int getKeysRemaining();
String getKeyType();
}
@@ -13,7 +13,6 @@ public class Skeleton extends Enemy implements Key {
private static int DEFAULT_HEAL_MANA_COST = 30;
private static int DEFAULT_DEFEND_MANA_COST = 20;
private static int keysRemaining = 1;
private boolean hasKey = false;
public Skeleton() {
super(DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
@@ -34,8 +33,8 @@ public class Skeleton extends Enemy implements Key {
public boolean generateKey() {
if (keysRemaining > 0) {
Random random = new Random();
int dice = random.nextInt(5);
if (dice == 1) {
int dice = random.nextInt(1);
if (dice == 0) {
decreaseKey();
return true;
}
@@ -52,5 +51,10 @@ public class Skeleton extends Enemy implements Key {
public int getKeysRemaining() {
return keysRemaining;
}
@Override
public String getKeyType() {
return "Skeleton";
}
// TODO: DESIGN ENEMY AND IMPLEMENT THE CONSTRUCTOR
}
@@ -1,4 +1,59 @@
package org.project.entity.enemies;
public class Vampire {
import org.project.item.weapons.GoblinSickle;
import org.project.item.weapons.MirrorClaws;
import org.project.item.weapons.Weapon;
import java.util.Random;
public class Vampire extends Enemy implements Key{
private static int DEFAULT_HP = 150;
private static int DEFAULT_MP = 150;
private static MirrorClaws DEFAULT_WEAPON = new MirrorClaws();
private static int DEFAULT_HEAL_MANA_COST = 30;
private static int DEFAULT_DEFEND_MANA_COST = 20;
private static int keysRemaining = 1;
public Vampire() {
super(DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Vampire(String name, int hp, int mp, Weapon weapon,
int healManaCost, int defendManaCost) {
super(hp, mp, weapon, healManaCost, defendManaCost);
}
@Override
public String getType() {
return "Vampire" ;
}
@Override
public boolean generateKey() {
if (keysRemaining > 0) {
Random random = new Random();
int dice = random.nextInt(1);
if (dice == 0) {
decreaseKey();
return true;
}
}
return false;
}
@Override
public void decreaseKey() {
keysRemaining -= 1;
}
@Override
public int getKeysRemaining() {
return keysRemaining;
}
@Override
public String getKeyType() {
return "Vampire";
}
}
@@ -1,4 +1,36 @@
package org.project.entity.players;
public class Assassin {
import org.project.item.weapons.Sword;
import org.project.item.weapons.Weapon;
public class Assassin extends Player {
private static int DEFAULT_HP = 80;
private static int DEFAULT_MP = 100;
private static Sword DEFAULT_WEAPON = new Sword();
private static String DEFAULT_NAME = "Hasan";
private static int DEFAULT_HEAL_MANA_COST = 20;
private static int DEFAULT_DEFEND_MANA_COST = 15;
public Assassin() {
super(DEFAULT_NAME, DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Assassin(String name) {
super(name, DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Assassin(String name, int hp, int mp, Weapon weapon,
int healManaCost, int defendManaCost) {
super(name, hp, mp, weapon, healManaCost, defendManaCost);
}
@Override
public String getType() {
return "Assassin" ;
}
}
@@ -1,13 +1,12 @@
package org.project.entity.players;
import org.project.item.armors.Armor;
import org.project.item.weapons.Sword;
import org.project.item.weapons.Weapon;
// TODO: UPDATE IMPLEMENTATION
public class Knight extends Player {
private static int DEFAULT_HP = 100;
private static int DEFAULT_MP = 100;
private static int DEFAULT_MP = 80;
private static Sword DEFAULT_WEAPON = new Sword();
private static String DEFAULT_NAME = "Ser Duncan";
private static int DEFAULT_HEAL_MANA_COST = 30;
@@ -1,9 +1,11 @@
package org.project.entity.players;
import org.project.entity.Entity;
import org.project.item.armors.Armor;
import org.project.entity.enemies.Key;
import org.project.item.weapons.Weapon;
import java.util.ArrayList;
// TODO: UPDATE IMPLEMENTATION
public abstract class Player implements Entity{
protected String name;
@@ -16,8 +18,9 @@ public abstract class Player implements Entity{
private boolean isDefendingThisTurn = false;
private int healManaCost;
private int defendManaCost;
private int keysCollected;
private int keysCollectedCount;
private int xp = 0;
private ArrayList<String> keysByType = new ArrayList<>();
public Player(String name, int hp, int mp, Weapon weapon,
int healManaCost, int defendManaCost) {
@@ -27,18 +30,20 @@ public abstract class Player implements Entity{
this.maxHP = hp;
this.maxMP = mp;
this.weapon = weapon;
this.keysCollected = 0;
this.keysCollectedCount = 0;
this.healManaCost = healManaCost;
this.defendManaCost = defendManaCost;
}
public void collectKey() {
keysCollected += 1;
public void collectKey(Key enemy) {
addKey(enemy.getKeyType());
keysCollectedCount += 1;
}
@Override
public void defend() {
isDefendingThisTurn = true;
this.reduceMana(this.getDefendManaCost());
}
@@ -121,8 +126,8 @@ public abstract class Player implements Entity{
return weapon;
}
public int getKeysCollected() {
return keysCollected;
public int getKeysCollectedCount() {
return keysCollectedCount;
}
@Override
@@ -154,9 +159,17 @@ public abstract class Player implements Entity{
this.setMaxMP(this.getMaxMP() + amount);
}
}
public int getDefendManaCost() {
return defendManaCost;
}
public void addKey(String type) {
keysByType.add(type);
}
public String getStringKeysCollected() {
String result = "Count: " + keysCollectedCount + " ";
for (String key: keysByType) {
result += " " + key + " key";
}
return result;
}
}
@@ -1,4 +1,36 @@
package org.project.entity.players;
public class Wizard {
import org.project.item.weapons.Fireball;
import org.project.item.weapons.Weapon;
public class Wizard extends Player{
private static int DEFAULT_HP = 90;
private static int DEFAULT_MP = 90;
private static Fireball DEFAULT_WEAPON = new Fireball();
private static String DEFAULT_NAME = "Merlin";
private static int DEFAULT_HEAL_MANA_COST = 25;
private static int DEFAULT_DEFEND_MANA_COST = 25;
public Wizard() {
super(DEFAULT_NAME, DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Wizard(String name) {
super(name, DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
}
public Wizard(String name, int hp, int mp, Weapon weapon,
int healManaCost, int defendManaCost) {
super(name, hp, mp, weapon, healManaCost, defendManaCost);
}
@Override
public String getType() {
return "Wizard" ;
}
}
@@ -3,7 +3,7 @@ package org.project.item.weapons;
import org.project.entity.Entity;
public class BoneHarpoon extends Weapon{
private static int DEFAULT_DAMAGE = 10;
private static int DEFAULT_DAMAGE = 15;
private static int DEFAULT_MANACOST = 10;
private static int DEFAULT_SPECIAL_MANA = 20;
@@ -3,9 +3,9 @@ package org.project.item.weapons;
import org.project.entity.Entity;
public class Dagger extends Weapon{
private static int DEFAULT_DAMAGE = 20;
private static int DEFAULT_MANACOST = 20;
private static int DEFAULT_SPECIAL_MANA = 20;
private static int DEFAULT_DAMAGE = 15;
private static int DEFAULT_MANACOST = 15;
private static int DEFAULT_SPECIAL_MANA = 30;
public Dagger() {
@@ -15,7 +15,7 @@ public class Dagger extends Weapon{
@Override
public void useSpecialAbility(Entity attacker, Entity target) {
target.takeDamage(50);
attacker.reduceMana(this.getManaCost() + 10);
attacker.reduceMana(this.getSpecialMana());
}
@Override
public String getType() {
@@ -3,9 +3,9 @@ package org.project.item.weapons;
import org.project.entity.Entity;
public class Fireball extends Weapon{
private static int DEFAULT_DAMAGE = 20;
private static int DEFAULT_DAMAGE = 15;
private static int DEFAULT_MANACOST = 20;
private static int DEFAULT_SPECIAL_MANA = 20;
private static int DEFAULT_SPECIAL_MANA = 25;
public Fireball() {
@@ -14,7 +14,7 @@ public class Fireball extends Weapon{
@Override
public void useSpecialAbility(Entity attacker, Entity target) {
target.takeDamage(this.getDamage() * 3);
attacker.reduceMana(this.getManaCost() + 10);
attacker.reduceMana(this.getSpecialMana());
}
@Override
public String getType() {
@@ -4,7 +4,7 @@ import org.project.entity.Entity;
public class GoblinSickle extends Weapon {
private static int DEFAULT_DAMAGE = 10;
private static int DEFAULT_MANACOST = 15;
private static int DEFAULT_MANACOST = 10;
private static int DEFAULT_SPECIAL_MANA = 20;
@@ -15,6 +15,7 @@ public class GoblinSickle extends Weapon {
@Override
public void useSpecialAbility(Entity attacker, Entity target) {
target.takeDamage(this.getDamage()*2);
attacker.reduceMana(this.getSpecialMana());
}
@Override
public String getType() {
@@ -16,7 +16,7 @@ public class MirrorClaws extends Weapon{
public void useSpecialAbility(Entity attacker, Entity target) {
target.takeDamage(this.getDamage());
target.reduceMana(30);
attacker.reduceMana(this.getManaCost() + 10);
attacker.reduceMana(this.getSpecialMana());
}
@Override
public String getType() {
@@ -18,7 +18,7 @@ public class Sword extends Weapon {
@Override
public void useSpecialAbility(Entity attacker, Entity target) {
target.takeDamage(this.getDamage()* 2 + 5);
attacker.reduceMana(this.getManaCost());
attacker.reduceMana(this.getSpecialMana());
}
@Override
public String getType() {
@@ -1,7 +1,9 @@
package org.project.location;
import org.project.entity.enemies.Enemy;
import org.project.entity.enemies.Goblin;
import org.project.entity.enemies.Skeleton;
import org.project.entity.enemies.Vampire;
import org.project.item.weapons.BoneHarpoon;
import org.project.item.weapons.Sword;
import org.project.item.weapons.Weapon;
@@ -37,8 +39,8 @@ public class Location {
Enemy e = null;
switch (enemyId) {
case 0: e = new Skeleton(); break;
case 1: e = new Skeleton(); break;
case 2: e = new Skeleton(); break;
case 1: e = new Goblin(); break;
case 2: e = new Vampire(); break;
}
this.enemies.add(e);
}
@@ -47,11 +49,11 @@ public class Location {
this.enemies.add(e);
}
private void addGoblin() {
Enemy e = null;
Enemy e = new Goblin();
this.enemies.add(e);
}
private void addVampire() {
Enemy e = null;
Enemy e = new Vampire();
this.enemies.add(e);
}
public static String pickName() {
Binary file not shown.
Binary file not shown.