diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 935cb4a..7f3d045 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -10,4 +10,9 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 4158879..4e0bf3c 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -16,5 +16,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/Main.java b/Java-Knight/src/main/java/org/project/Main.java
index 6bde20e..37f12b7 100644
--- a/Java-Knight/src/main/java/org/project/Main.java
+++ b/Java-Knight/src/main/java/org/project/Main.java
@@ -1,15 +1,185 @@
package org.project;
+import org.project.entity.enemies.*;
+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.armors.Armor;
+import org.project.item.armors.KnightArmor;
+import org.project.item.weapons.Sword;
+import org.project.item.weapons.Weapon;
import org.project.location.Location;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Scanner;
public class Main {
- public static void main(String[] args) {
- // TODO: ADD LOCATIONS TO YOUR GAME
- List locations = new ArrayList<>();
- // TODO: IMPLEMENT GAMEPLAY
+ public static void printBorder() {
+ for (int i = 0; i < 40; i++)
+ System.out.print("-");
+ System.out.println();
+ }
+
+ public static void printBorder(int x) {
+ for (int i = 0; i < 15; i++)
+ System.out.println();
+ for (int i = 0; i < x; i++)
+ System.out.print("-");
+ System.out.println();
+ }
+
+ public static int moveSelector() {
+ System.out.println("Choose your move:");
+ System.out.println("1. Light attack (Mana: 0) | 2. Normal attack (mana: 2) | 3. Heavy attack (mana: 3)");
+ System.out.println("4. Heal (5 mana) | 5. Skip");
+ Scanner in = new Scanner(System.in);
+ while (true) {
+ int answer = in.nextInt();
+ if (answer == 1 || answer == 2 || answer == 3 || answer == 4 || answer == 5)
+ return answer;
+ System.out.println("Invalid input try again.");
+ }
+ }
+
+ private static void fightEnemy(Player player, Location location, String enemyName, String locationDesc) {
+ String RED = "\u001B[31m";
+ String YELLOW = "\u001B[33m";
+ String RESET = "\u001B[0m";
+
+ System.out.printf("You're in the %s fighting a %s%s%s!\n", locationDesc, RED, enemyName, RESET);
+
+ while (player.isAlive() && location.getEnemy().getHP() > 0) {
+ // Player's turn: up to 5 actions
+ for (int i = 0; i < 5; i++) {
+ System.out.printf("%s | %sHP%s: %d, %sMP%s: %d\n",
+ player.getName(), RED, RESET, player.getHP(), YELLOW, RESET, player.getMP());
+ printBorder();
+ System.out.printf("%s | %sHP%s: %d, %sMP%s: %d\n",
+ enemyName, RED, RESET, location.getEnemy().getHP(), YELLOW, RESET, location.getEnemy().getMP());
+ System.out.println();
+
+ switch (moveSelector()) {
+ case 1: // Base Attack
+ location.getEnemy().takeDamage(player.getBaseDamage());
+ break;
+ case 2: // Normal Attack (2 mana)
+ if (player.useMana(2)) {
+ player.attack(location.getEnemy());
+ } else {
+ System.out.println("Not enough mana for Normal Attack!");
+ i--;
+ }
+ break;
+ case 3: // Heavy Attack (3 mana)
+ if (player.useMana(3)) {
+ player.heavyAttack(location.getEnemy());
+ } else {
+ System.out.println("Not enough mana for Heavy Attack!");
+ i--;
+ }
+ break;
+ case 4: // Heal (5 mana)
+ if (player.useMana(5)) {
+ player.heal(20);
+ } else {
+ System.out.println("Not enough mana to Heal!");
+ i--;
+ }
+ break;
+ }
+ printBorder();
+
+ // If enemy died or player died, end the player's turn early
+ if (location.getEnemy().getHP() <= 0 || !player.isAlive()) {
+ location.getEnemy().getKilled();
+ i = 5;
+ }
+ }
+
+ // Enemy's turn
+ if (location.getEnemy().getHP() > 0) {
+ for (int i = 0; i < 5; i++) {
+ location.getEnemy().attack(player);
+ printBorder();
+ if (!player.isAlive())
+ break;
+ }
+ }
+
+ // Restore mana after each full round
+ player.fillMana(6);
+ }
+ }
+
+ public static void main(String[] args) {
+ String RED = "\u001B[31m";
+ String YELLOW = "\u001B[33m";
+ String RESET = "\u001B[0m";
+ String GREEN = "\u001B[32m";
+
+ printBorder();
+ Scanner input = new Scanner(System.in);
+ System.out.println("Enter your name:");
+ String name = input.next();
+ printBorder();
+
+ Weapon sword = new Sword();
+ Armor armor = new KnightArmor();
+ Player player = null;
+
+ while (true) {
+ System.out.println("Chose your character:");
+ System.out.printf("1. Knight | %sHP%s: 100, %sMP%s: 10\n", RED, RESET, YELLOW, RESET);
+ System.out.printf("2. Wizard | %sHP%s: 150, %sMP%s: 10\n", RED, RESET, YELLOW, RESET);
+ System.out.printf("3. Assassin | %sHP%s: 80 , %sMP%s: 20\n", RED, RESET, YELLOW, RESET);
+ player = switch (input.nextInt()) {
+ case 1 -> new Knight(name, sword, armor);
+ case 2 -> new Wizard(name, sword, armor);
+ case 3 -> new Assassin(name, sword, armor);
+ default -> null;
+ };
+ if (player == null) {
+ System.out.println("Invalid input try again.");
+ } else
+ break;
+ }
+
+ Location overworld = new Location("Overworld", new Vampire(sword));
+ Location village = new Location("Village", new Goblin(sword));
+ Location nether = new Location("Nether", new Skeleton(sword));
+ Location end = new Location("End", new Dragon());
+
+ // Fight each enemy
+ fightEnemy(player, overworld, "Vampire", "Overworld");
+ if (!player.isAlive()) {
+ System.out.println("You lost!");
+ return;
+ }
+
+ fightEnemy(player, village, "Goblin", "Village");
+ if (!player.isAlive()) {
+ System.out.println("You lost!");
+ return;
+ }
+
+ fightEnemy(player, nether, "Skeleton", "Nether");
+ if (!player.isAlive()) {
+ System.out.println("You lost!");
+ return;
+ }
+ fightEnemy(player, end, "Dragon","End");
+ if (!player.isAlive()) {
+ System.out.println("You lost!");
+ return;
+ }
+ printBorder();
+ System.out.println(GREEN + " " + RESET);
+ System.out.println(RED + " VICTORY! " + RESET);
+ System.out.println(GREEN + " You have conquered all enemies! " + RESET);
+ System.out.println(GREEN + " The realm is safe, brave warrior. " + RESET);
+ System.out.println();
+ printBorder();
+
}
}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/entity/Entity.java b/Java-Knight/src/main/java/org/project/entity/Entity.java
index 2a060f9..63a2a6c 100644
--- a/Java-Knight/src/main/java/org/project/entity/Entity.java
+++ b/Java-Knight/src/main/java/org/project/entity/Entity.java
@@ -1,9 +1,8 @@
package org.project.entity;
public interface Entity {
- void attack(Entity target);
- void defend();
+ void attack(Entity target);
void heal(int health);
@@ -14,8 +13,4 @@ public interface Entity {
int getMaxHP();
int getMaxMP();
-
- /*
- TODO: ADD OTHER REQUIRED AND BONUS METHODS
- */
}
diff --git a/Java-Knight/src/main/java/org/project/entity/enemies/Dragon.java b/Java-Knight/src/main/java/org/project/entity/enemies/Dragon.java
new file mode 100644
index 0000000..956da6f
--- /dev/null
+++ b/Java-Knight/src/main/java/org/project/entity/enemies/Dragon.java
@@ -0,0 +1,60 @@
+package org.project.entity.enemies;
+
+import org.project.entity.Entity;
+import org.project.item.weapons.DragonBreath;
+import org.project.item.weapons.Weapon;
+
+public class Dragon extends Enemy{
+ public Dragon() {
+ int baseDamage = 2;
+ int hp = 500;
+ int mp = 1000;
+ Weapon weapon1 = new DragonBreath();
+ super(hp, mp, weapon1, baseDamage);
+ }
+
+ @Override
+ public void takeDamage(int damage) {
+ super.takeDamage(damage);
+ if(!isAlive)
+ getKilled();
+ }
+
+ @Override
+ public void getKilled() {
+ isAlive = false;
+ }
+
+ @Override
+ public void attack(Entity target) {
+ target.takeDamage((weapon.getDamage() + getBaseDamage()));
+ System.out.println("\u001B[31mDragon breathes a raging fire!\u001B[0m");
+ System.out.printf("\u001B[31mYou took %d damage.\u001B[0m\n", weapon.getDamage() + getBaseDamage());
+ }
+
+ @Override
+ public void heal(int health) {
+ if (getHP() + health > getMaxHP())
+ setHP(getMaxHP());
+ else
+ setHP(getHP()+ health);
+ }
+
+ @Override
+ public void fillMana(int mana) {
+ if (getMP() + mana > getMaxMP())
+ setMP(getMaxMP());
+ else
+ setMP(getMP()+ mana);
+ }
+
+ @Override
+ public int getMaxHP() {
+ return 500;
+ }
+
+ @Override
+ public int getMaxMP() {
+ return 1000;
+ }
+}
diff --git a/Java-Knight/src/main/java/org/project/entity/enemies/Enemy.java b/Java-Knight/src/main/java/org/project/entity/enemies/Enemy.java
index e019acb..190afca 100644
--- a/Java-Knight/src/main/java/org/project/entity/enemies/Enemy.java
+++ b/Java-Knight/src/main/java/org/project/entity/enemies/Enemy.java
@@ -1,34 +1,58 @@
package org.project.entity.enemies;
+import org.project.entity.Entity;
import org.project.item.weapons.Weapon;
-// TODO: UPDATE IMPLEMENTATION
-public abstract class Enemy {
+public abstract class Enemy implements Entity {
Weapon weapon;
+ boolean isAlive;
private int hp;
private int mp;
+ private int baseDamage;
- public Enemy(int hp, int mp, Weapon weapon) {
+ public Enemy(int hp, int mp, Weapon weapon, int baseDamage) {
+ this.baseDamage = baseDamage;
+ isAlive = true;
this.hp = hp;
this.mp = mp;
-
this.weapon = weapon;
}
+ public void setHP(int hp) {
+ this.hp = hp;
+ }
+
+ public void setMP(int mp) {
+ this.mp = mp;
+ }
+
@Override
public void takeDamage(int damage) {
+ if (0 >= (hp - damage)) {
+ isAlive = false;
+ hp = 0;
+ System.out.println("\u001B[32myou killed your enemy\u001B[0m");
+ return;
+ }
hp -= damage;
+ System.out.printf("\u001B[31mEnemy took %d damage.\u001B[0m\n", damage);
}
- public int getHp() {
+ public abstract void getKilled();
+
+ public int getHP() {
return hp;
}
- public int getMp() {
+ public int getMP() {
return mp;
}
+ public int getBaseDamage() {
+ return baseDamage;
+ }
+
public Weapon getWeapon() {
return weapon;
}
-}
+}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/entity/enemies/Goblin.java b/Java-Knight/src/main/java/org/project/entity/enemies/Goblin.java
new file mode 100644
index 0000000..0c13a35
--- /dev/null
+++ b/Java-Knight/src/main/java/org/project/entity/enemies/Goblin.java
@@ -0,0 +1,57 @@
+package org.project.entity.enemies;
+
+import org.project.entity.Entity;
+import org.project.item.weapons.Weapon;
+import java.util.Random;
+
+public class Goblin extends Enemy {
+ public Goblin(Weapon weapon) {
+ int hp = 30;
+ int mp = 50;
+ super(hp, mp, weapon, 10);
+ }
+
+ @Override
+ public void getKilled() {
+ isAlive = false;
+ }
+
+ @Override
+ public void attack(Entity target) {
+ Random rand = new Random();
+ if (rand.nextBoolean()) {
+ target.takeDamage((weapon.getDamage() + getBaseDamage()) * 2);
+ System.out.println("\u001B[33mGoblin did critical Hit!!!!!\u001B[0m");
+ System.out.printf("\u001B[31mYou took %d damage.\u001B[0m\n", (weapon.getDamage() + getBaseDamage()) * 2);
+ } else {
+ target.takeDamage(weapon.getDamage() + getBaseDamage());
+ System.out.printf("\u001B[31mYou took %d damage.\u001B[0m\n", weapon.getDamage() + getBaseDamage());
+ }
+ }
+
+ @Override
+ public void heal(int health) {
+ if (getHP() + health > getMaxHP())
+ setHP(getMaxHP());
+ else
+ setHP(getHP() + health);
+ }
+
+ @Override
+ public void fillMana(int mana) {
+ if (getMP() + mana > getMaxMP())
+ setMP(getMaxMP());
+ else
+ setMP(getMP() + mana);
+ }
+
+ @Override
+ public int getMaxHP() {
+ return 30;
+ }
+
+ @Override
+ public int getMaxMP() {
+ return 50;
+ }
+}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/entity/enemies/Skeleton.java b/Java-Knight/src/main/java/org/project/entity/enemies/Skeleton.java
index 8a6a555..a60c6d9 100644
--- a/Java-Knight/src/main/java/org/project/entity/enemies/Skeleton.java
+++ b/Java-Knight/src/main/java/org/project/entity/enemies/Skeleton.java
@@ -1,6 +1,65 @@
package org.project.entity.enemies;
-// TODO: UPDATE IMPLEMENTATION
-public class Skeleton {
- // TODO: DESIGN ENEMY AND IMPLEMENT THE CONSTRUCTOR
-}
+import org.project.entity.Entity;
+import org.project.item.weapons.Weapon;
+
+public class Skeleton extends Enemy {
+ int timesDied;
+
+ public Skeleton(Weapon weapon) {
+ int hp = 50;
+ int mp = 50;
+ timesDied = 0;
+ super(hp, mp, weapon, 10);
+ }
+
+ @Override
+ public void takeDamage(int damage) {
+ super.takeDamage(damage);
+ if (!isAlive)
+ getKilled();
+ }
+
+ @Override
+ public void getKilled() {
+ if (timesDied == 0) {
+ timesDied += 1;
+ setHP(getMaxHP() / 2);
+ System.out.println("\u001B[33myour enemy revived itself!!!\u001B[0m");
+ return;
+ }
+ isAlive = false;
+ }
+
+ @Override
+ public void attack(Entity target) {
+ target.takeDamage((weapon.getDamage() + getBaseDamage()));
+ System.out.printf("\u001B[31mYou took %d damage.\u001B[0m\n", weapon.getDamage() + getBaseDamage());
+ }
+
+ @Override
+ public void heal(int health) {
+ if (getHP() + health > getMaxHP())
+ setHP(getMaxHP());
+ else
+ setHP(getHP() + health);
+ }
+
+ @Override
+ public void fillMana(int mana) {
+ if (getMP() + mana > getMaxMP())
+ setMP(getMaxMP());
+ else
+ setMP(getMP() + mana);
+ }
+
+ @Override
+ public int getMaxHP() {
+ return 50;
+ }
+
+ @Override
+ public int getMaxMP() {
+ return 50;
+ }
+}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/entity/enemies/Vampire.java b/Java-Knight/src/main/java/org/project/entity/enemies/Vampire.java
new file mode 100644
index 0000000..4eb0ec7
--- /dev/null
+++ b/Java-Knight/src/main/java/org/project/entity/enemies/Vampire.java
@@ -0,0 +1,52 @@
+package org.project.entity.enemies;
+
+import org.project.entity.Entity;
+import org.project.item.weapons.Weapon;
+
+public class Vampire extends Enemy {
+ public Vampire(Weapon weapon) {
+ int maxHP = 50;
+ int maxMP = 50;
+ super(maxHP, maxMP, weapon, 8);
+ }
+
+ @Override
+ public void getKilled() {
+ isAlive = false;
+ }
+
+ @Override
+ public void attack(Entity target) {
+ target.takeDamage((weapon.getDamage() + getBaseDamage()));
+ System.out.println("\u001B[35mVampire stole your HP\u001B[0m");
+ System.out.printf("\u001B[32mVampire: +%d hp\u001B[0m\n", (int) ((weapon.getDamage() + getBaseDamage()) * 0.5));
+ this.heal((int) ((weapon.getDamage() + getBaseDamage()) * 0.5));
+ System.out.printf("\u001B[31mYou took %d damage.\u001B[0m\n", (int) (weapon.getDamage() + getBaseDamage()));
+ }
+
+ @Override
+ public void heal(int health) {
+ if (getHP() + health > getMaxHP())
+ setHP(getMaxHP());
+ else
+ setHP(getHP() + health);
+ }
+
+ @Override
+ public void fillMana(int mana) {
+ if (getMP() + mana > getMaxMP())
+ setMP(getMaxMP());
+ else
+ setMP(getMP() + mana);
+ }
+
+ @Override
+ public int getMaxHP() {
+ return 50;
+ }
+
+ @Override
+ public int getMaxMP() {
+ return 50;
+ }
+}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/entity/players/Assassin.java b/Java-Knight/src/main/java/org/project/entity/players/Assassin.java
new file mode 100644
index 0000000..3be8871
--- /dev/null
+++ b/Java-Knight/src/main/java/org/project/entity/players/Assassin.java
@@ -0,0 +1,14 @@
+package org.project.entity.players;
+
+import org.project.item.armors.Armor;
+import org.project.item.weapons.Weapon;
+
+public class Assassin extends Player{
+
+ public Assassin(String name, Weapon weapon, Armor armor) {
+ int hp = 80;
+ int mp = 20;
+ int baseDamage = 5;
+ super(name, hp, mp, baseDamage, weapon, armor);
+ }
+}
diff --git a/Java-Knight/src/main/java/org/project/entity/players/Knight.java b/Java-Knight/src/main/java/org/project/entity/players/Knight.java
index 14d8fa2..eca6ac4 100644
--- a/Java-Knight/src/main/java/org/project/entity/players/Knight.java
+++ b/Java-Knight/src/main/java/org/project/entity/players/Knight.java
@@ -1,6 +1,14 @@
package org.project.entity.players;
-// TODO: UPDATE IMPLEMENTATION
-public class Knight {
- // TODO: DESIGN KNIGHT'S WEAPON AND ARMOR AND IMPLEMENT THE CONSTRUCTOR
+import org.project.item.armors.Armor;
+import org.project.item.weapons.Weapon;
+
+public class Knight extends Player {
+
+ public Knight(String name, Weapon weapon, Armor armor) {
+ int hp = 100;
+ int mp = 10;
+ int baseDamage = 10;
+ super(name, hp, mp, baseDamage, weapon, armor);
+ }
}
diff --git a/Java-Knight/src/main/java/org/project/entity/players/Player.java b/Java-Knight/src/main/java/org/project/entity/players/Player.java
index ff5385c..0e0fcf6 100644
--- a/Java-Knight/src/main/java/org/project/entity/players/Player.java
+++ b/Java-Knight/src/main/java/org/project/entity/players/Player.java
@@ -4,8 +4,7 @@ import org.project.entity.Entity;
import org.project.item.armors.Armor;
import org.project.item.weapons.Weapon;
-// TODO: UPDATE IMPLEMENTATION
-public abstract class Player {
+public abstract class Player implements Entity {
protected String name;
Weapon weapon;
Armor armor;
@@ -13,30 +12,42 @@ public abstract class Player {
private int maxHP;
private int mp;
private int maxMP;
+ private int baseDamage;
+ private boolean isAlive;
- public Player(String name, int hp, int mp, Weapon weapon, Armor armor) {
+ public int getBaseDamage() {
+ return baseDamage;
+ }
+
+ public Player(String name, int hp, int mp, int baseDamage, Weapon weapon, Armor armor) {
this.name = name;
this.hp = hp;
this.mp = mp;
-
+ this.maxHP = hp;
+ this.maxMP = mp;
+ this.baseDamage = baseDamage;
this.weapon = weapon;
this.armor = armor;
+ this.isAlive = true;
}
@Override
public void attack(Entity target) {
- target.takeDamage(weapon.getDamage());
+ target.takeDamage(weapon.getDamage() + this.baseDamage);
}
- @Override
- public void defend() {
- // TODO
+ public void heavyAttack(Entity target) {
+ target.takeDamage(weapon.getDamage() + this.baseDamage + 7);
}
-
@Override
public void takeDamage(int damage) {
- hp -= damage - armor.getDefense();
+ if (damage - armor.getDefense() > 0) {
+ hp -= damage - armor.getDefense();
+ if (hp <= 0) {
+ getKilled();
+ }
+ }
}
@Override
@@ -45,6 +56,7 @@ public abstract class Player {
if (hp > maxHP) {
hp = maxHP;
}
+ System.out.println("\u001B[32myou Healed yourself!\u001B[0m");
}
@Override
@@ -52,15 +64,16 @@ public abstract class Player {
mp += mana;
if (mp > maxMP) {
mp = maxMP;
- }
+ System.out.println("\u001B[33myour Mana got spilled.\u001B[0m");
+ } else
+ System.out.printf("\u001B[36m+%d Mana\u001B[0m\n", mana);
}
-
public String getName() {
return name;
}
- public int getHp() {
+ public int getHP() {
return hp;
}
@@ -69,7 +82,7 @@ public abstract class Player {
return maxHP;
}
- public int getMp() {
+ public int getMP() {
return mp;
}
@@ -86,4 +99,21 @@ public abstract class Player {
return armor;
}
-}
+ public boolean isAlive() {
+ return isAlive;
+ }
+
+ public void getKilled() {
+ isAlive = false;
+ System.out.println("\u001B[31mYou died!\u001B[0m");
+ }
+
+ public boolean useMana(int mana) {
+ if (mp - mana < 0)
+ return false;
+ else {
+ mp -= mana;
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/entity/players/Wizard.java b/Java-Knight/src/main/java/org/project/entity/players/Wizard.java
new file mode 100644
index 0000000..612ecec
--- /dev/null
+++ b/Java-Knight/src/main/java/org/project/entity/players/Wizard.java
@@ -0,0 +1,13 @@
+package org.project.entity.players;
+
+import org.project.item.armors.Armor;
+import org.project.item.weapons.Weapon;
+
+public class Wizard extends Player{
+ public Wizard(String name, Weapon weapon, Armor armor) {
+ int hp = 150;
+ int mp = 10;
+ int baseDamage = 4;
+ super(name, hp, mp, baseDamage, weapon, armor);
+ }
+}
diff --git a/Java-Knight/src/main/java/org/project/item/Item.java b/Java-Knight/src/main/java/org/project/item/Item.java
index 6d6b5ad..e2bec96 100644
--- a/Java-Knight/src/main/java/org/project/item/Item.java
+++ b/Java-Knight/src/main/java/org/project/item/Item.java
@@ -4,8 +4,4 @@ import org.project.entity.Entity;
public interface Item {
void use(Entity target);
-
- /*
- TODO: ADD OTHER REQUIRED AND BONUS METHODS
- */
}
diff --git a/Java-Knight/src/main/java/org/project/item/armors/Armor.java b/Java-Knight/src/main/java/org/project/item/armors/Armor.java
index 7ca8774..5fbe893 100644
--- a/Java-Knight/src/main/java/org/project/item/armors/Armor.java
+++ b/Java-Knight/src/main/java/org/project/item/armors/Armor.java
@@ -1,6 +1,5 @@
package org.project.item.armors;
-// TODO: UPDATE IMPLEMENTATION
public abstract class Armor {
private int defense;
private int maxDefense;
@@ -21,7 +20,6 @@ public abstract class Armor {
}
}
- // TODO: (BONUS) UPDATE THE REPAIR METHOD
public void repair() {
isBroke = false;
defense = maxDefense;
diff --git a/Java-Knight/src/main/java/org/project/item/armors/KnightArmor.java b/Java-Knight/src/main/java/org/project/item/armors/KnightArmor.java
index eb59a46..f4422ab 100644
--- a/Java-Knight/src/main/java/org/project/item/armors/KnightArmor.java
+++ b/Java-Knight/src/main/java/org/project/item/armors/KnightArmor.java
@@ -1,6 +1,9 @@
package org.project.item.armors;
-// TODO: UPDATE IMPLEMENTATION
-public class KnightArmor {
- // TODO: DESIGN ARMOR'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR
+public class KnightArmor extends Armor{
+ public KnightArmor() {
+ int defense = 6;
+ int durability = 20;
+ super(defense, durability);
+ }
}
\ No newline at end of file
diff --git a/Java-Knight/src/main/java/org/project/item/consumables/Consumable.java b/Java-Knight/src/main/java/org/project/item/consumables/Consumable.java
index 028e13d..f3bdb46 100644
--- a/Java-Knight/src/main/java/org/project/item/consumables/Consumable.java
+++ b/Java-Knight/src/main/java/org/project/item/consumables/Consumable.java
@@ -1,8 +1,7 @@
package org.project.item.consumables;
-// TODO: UPDATE IMPLEMENTATION
-public abstract class Consumable {
- /*
- TODO: ADD OTHER REQUIRED AND BONUS METHODS
- */
+import org.project.item.Item;
+
+public abstract class Consumable implements Item {
+
}
diff --git a/Java-Knight/src/main/java/org/project/item/consumables/Flask.java b/Java-Knight/src/main/java/org/project/item/consumables/Flask.java
index c0e7a6d..2a16a24 100644
--- a/Java-Knight/src/main/java/org/project/item/consumables/Flask.java
+++ b/Java-Knight/src/main/java/org/project/item/consumables/Flask.java
@@ -2,13 +2,8 @@ package org.project.item.consumables;
import org.project.entity.Entity;
-// TODO: UPDATE IMPLEMENTATION
-public class Flask {
- /*
- THIS IS AN EXAMPLE OF A CONSUMABLE DESIGN.
- */
+public class Flask extends Consumable{
- // TODO: UPDATE USE METHOD
@Override
public void use(Entity target) {
target.heal(target.getMaxHP() / 10);
diff --git a/Java-Knight/src/main/java/org/project/item/weapons/DragonBreath.java b/Java-Knight/src/main/java/org/project/item/weapons/DragonBreath.java
new file mode 100644
index 0000000..d4d556a
--- /dev/null
+++ b/Java-Knight/src/main/java/org/project/item/weapons/DragonBreath.java
@@ -0,0 +1,7 @@
+package org.project.item.weapons;
+
+public class DragonBreath extends Weapon{
+ public DragonBreath() {
+ super(8, 0);
+ }
+}
diff --git a/Java-Knight/src/main/java/org/project/item/weapons/Sword.java b/Java-Knight/src/main/java/org/project/item/weapons/Sword.java
index 96226ee..a8eeacc 100644
--- a/Java-Knight/src/main/java/org/project/item/weapons/Sword.java
+++ b/Java-Knight/src/main/java/org/project/item/weapons/Sword.java
@@ -4,8 +4,7 @@ import org.project.entity.Entity;
import java.util.ArrayList;
-// TODO: UPDATE IMPLEMENTATION
-public class Sword {
+public class Sword extends Weapon{
/*
THIS IS AN EXAMPLE OF A WEAPON DESIGN.
*/
@@ -13,10 +12,11 @@ public class Sword {
int abilityCharge;
public Sword() {
- // TODO: DESIGN SWORD'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR
+ int damage = 2;
+ int manaCost = 10;
+ super(damage, manaCost);
}
- // TODO: (BONUS) UPDATE THE UNIQUE ABILITY
public void uniqueAbility(ArrayList targets) {
abilityCharge += 2;
for (Entity target : targets) {
diff --git a/Java-Knight/src/main/java/org/project/item/weapons/Weapon.java b/Java-Knight/src/main/java/org/project/item/weapons/Weapon.java
index cb9fcf2..d348de0 100644
--- a/Java-Knight/src/main/java/org/project/item/weapons/Weapon.java
+++ b/Java-Knight/src/main/java/org/project/item/weapons/Weapon.java
@@ -1,16 +1,12 @@
package org.project.item.weapons;
import org.project.entity.Entity;
+import org.project.item.Item;
-// TODO: UPDATE IMPLEMENTATION
-public abstract class Weapon {
+public abstract class Weapon implements Item {
private int damage;
private int manaCost;
- /*
- TODO: ADD OTHER REQUIRED AND BONUS ATTRIBUTES
- */
-
public Weapon(int damage, int manaCost) {
this.damage = damage;
this.manaCost = manaCost;
@@ -29,7 +25,4 @@ public abstract class Weapon {
return manaCost;
}
- /*
- TODO: ADD OTHER REQUIRED AND BONUS METHODS
- */
}
diff --git a/Java-Knight/src/main/java/org/project/location/Location.java b/Java-Knight/src/main/java/org/project/location/Location.java
index b0b4b98..9aa7d3b 100644
--- a/Java-Knight/src/main/java/org/project/location/Location.java
+++ b/Java-Knight/src/main/java/org/project/location/Location.java
@@ -2,27 +2,20 @@ package org.project.location;
import org.project.entity.enemies.Enemy;
-import java.util.ArrayList;
-
public class Location {
private String name;
+ private Enemy enemy;
- private ArrayList enemies;
-
- public Location(ArrayList locations, ArrayList enemies) {
- this.locations = locations;
- this.enemies = enemies;
+ public Location(String name,Enemy enemy) {
+ this.enemy = enemy;
+ this.name = name;
}
public String getName() {
return name;
}
- public ArrayList getLocations() {
- return locations;
- }
-
- public ArrayList getEnemies() {
- return enemies;
+ public Enemy getEnemy() {
+ return enemy;
}
}
diff --git a/Java-Knight/target/classes/org/project/Main.class b/Java-Knight/target/classes/org/project/Main.class
new file mode 100644
index 0000000..d2572c6
Binary files /dev/null and b/Java-Knight/target/classes/org/project/Main.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/Entity.class b/Java-Knight/target/classes/org/project/entity/Entity.class
new file mode 100644
index 0000000..04b6b10
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/Entity.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/enemies/Dragon.class b/Java-Knight/target/classes/org/project/entity/enemies/Dragon.class
new file mode 100644
index 0000000..d3e2646
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/enemies/Dragon.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/enemies/Enemy.class b/Java-Knight/target/classes/org/project/entity/enemies/Enemy.class
new file mode 100644
index 0000000..65b8894
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/enemies/Enemy.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/enemies/Goblin.class b/Java-Knight/target/classes/org/project/entity/enemies/Goblin.class
new file mode 100644
index 0000000..71d4743
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/enemies/Goblin.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/enemies/Skeleton.class b/Java-Knight/target/classes/org/project/entity/enemies/Skeleton.class
new file mode 100644
index 0000000..101099e
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/enemies/Skeleton.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/enemies/Vampire.class b/Java-Knight/target/classes/org/project/entity/enemies/Vampire.class
new file mode 100644
index 0000000..ba0fcdb
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/enemies/Vampire.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/players/Assassin.class b/Java-Knight/target/classes/org/project/entity/players/Assassin.class
new file mode 100644
index 0000000..4548756
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/players/Assassin.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/players/Knight.class b/Java-Knight/target/classes/org/project/entity/players/Knight.class
new file mode 100644
index 0000000..ecf0228
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/players/Knight.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/players/Player.class b/Java-Knight/target/classes/org/project/entity/players/Player.class
new file mode 100644
index 0000000..f97c4ba
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/players/Player.class differ
diff --git a/Java-Knight/target/classes/org/project/entity/players/Wizard.class b/Java-Knight/target/classes/org/project/entity/players/Wizard.class
new file mode 100644
index 0000000..f85c43e
Binary files /dev/null and b/Java-Knight/target/classes/org/project/entity/players/Wizard.class differ
diff --git a/Java-Knight/target/classes/org/project/item/Item.class b/Java-Knight/target/classes/org/project/item/Item.class
new file mode 100644
index 0000000..3db1242
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/Item.class differ
diff --git a/Java-Knight/target/classes/org/project/item/armors/Armor.class b/Java-Knight/target/classes/org/project/item/armors/Armor.class
new file mode 100644
index 0000000..b9768d9
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/armors/Armor.class differ
diff --git a/Java-Knight/target/classes/org/project/item/armors/KnightArmor.class b/Java-Knight/target/classes/org/project/item/armors/KnightArmor.class
new file mode 100644
index 0000000..c74e05a
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/armors/KnightArmor.class differ
diff --git a/Java-Knight/target/classes/org/project/item/consumables/Consumable.class b/Java-Knight/target/classes/org/project/item/consumables/Consumable.class
new file mode 100644
index 0000000..17c7d2f
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/consumables/Consumable.class differ
diff --git a/Java-Knight/target/classes/org/project/item/consumables/Flask.class b/Java-Knight/target/classes/org/project/item/consumables/Flask.class
new file mode 100644
index 0000000..c0dfc59
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/consumables/Flask.class differ
diff --git a/Java-Knight/target/classes/org/project/item/weapons/DragonBreath.class b/Java-Knight/target/classes/org/project/item/weapons/DragonBreath.class
new file mode 100644
index 0000000..710127d
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/weapons/DragonBreath.class differ
diff --git a/Java-Knight/target/classes/org/project/item/weapons/Sword.class b/Java-Knight/target/classes/org/project/item/weapons/Sword.class
new file mode 100644
index 0000000..fb7097e
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/weapons/Sword.class differ
diff --git a/Java-Knight/target/classes/org/project/item/weapons/Weapon.class b/Java-Knight/target/classes/org/project/item/weapons/Weapon.class
new file mode 100644
index 0000000..5ee77ce
Binary files /dev/null and b/Java-Knight/target/classes/org/project/item/weapons/Weapon.class differ
diff --git a/Java-Knight/target/classes/org/project/location/Location.class b/Java-Knight/target/classes/org/project/location/Location.class
new file mode 100644
index 0000000..37a85cf
Binary files /dev/null and b/Java-Knight/target/classes/org/project/location/Location.class differ
diff --git a/README.md b/README.md
index 1e2c975..c1c8469 100644
--- a/README.md
+++ b/README.md
@@ -1,175 +1,181 @@
-# Fourth Assignment - Java Knight ⚔️
-A turn-based RPG with Roguelike elements which can be run in the terminal.
+# Java RPG Project
-### **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!*
+A small console-based Java RPG where the player selects a character class and fights a fixed sequence of enemies: Vampire, Goblin, Skeleton, and Dragon.
-### **Introduction**
-Welcome to **Java knight**, a turn-based RPG inspired by Roguelike games! In this assignment, you will develop a **text-based role-playing game (RPG)**. This project is designed to rigorously test your understanding of **Object-Oriented Programming (OOP) principles**.
+## Gameplay
-⚠️ **REQUIREMENT:** You **must** utilize all the OOP concepts you have learned so far—including *Inheritance, Interfaces, Abstract Classes, Encapsulation, Polymorphism, Overloading, and Overriding*. It is extremely important that you use everything in its right place. Your design and architecture will be graded based on how well you apply these principles to avoid code duplication and maintain a clean structure.
+The game flow is handled in `Main.java`:
-🎯 **Your goal is not just to complete the assignment but to learn and apply OOP effectively!**
+1. The player enters a name.
+2. The player chooses a class:
+ - Knight
+ - Wizard
+ - Assassin
+3. The game creates four locations and enemies:
+ - Overworld -> Vampire
+ - Village -> Goblin
+ - Nether -> Skeleton
+ - End -> Dragon
+4. The player fights each enemy in sequence.
+5. If the player dies, the game ends.
+6. If all enemies are defeated, the player wins.
-### **What is a Turn-Based Game?**
-In this combat system, two sides - which are usually the player's side and the enemy's side - attack each other in turns. The side which is not attacking can perform actions to avoid or deflect the enemy's attack.
+## Combat System
-### **Core Mechanics:**
-- **Turn-based combat** – Players and monsters take turns attacking each other.
-- **Character classes with Unique Traits** – Players can choose from archetypes like **Knight, Assassin, or Wizard**, each starting with distinctly different base stats.
-- **Unified Mana/Stamina System** – All player classes use a unified resource (Mana/Stamina) to perform actions.
-- **Standardized Action Set** – Every player character has exactly 5 specific actions available during their turn.
-- **Experience & Leveling System** – Earn XP based on enemy strength to automatically level up and increase your base stats.
-- **Progression System** – You cannot fight the Dragon immediately. You must farm enemies for a chance to drop their specific key, collect all three, and grow stronger first.
+Each battle is turn-based.
----
+### Player actions
-## Tasks 📝
+The player can choose from:
-### 1️⃣ Step 1: Fork & Setup 🍴
-1. **Fork** this repository and clone it to your local machine.
-```bash
-git clone https://git.meshcomp.ir/AdvancedProgramming1404/HW-04-JAVA-KNIGHT.git
-```
-2. Create a new branch named `develop` and switch to it.
-```bash
-git checkout -b develop
-```
-### 2️⃣ Step 2: Implement the Class Hierarchy 🌲
+- light attack
+- normal attack
+- heavy attack
+- heal
+- skip
-A well-structured OOP hierarchy is crucial. Avoid duplicating code by placing shared logic in abstract classes.
+### Enemy actions
-- **Entities & Locations:** You have `Entity`, `Item`(Bonus) , and `Location`.
-- **Players:** `Player` is an abstract class implementing `Entity`. Subclasses: `Wizard`, `Knight`, `Assassin`.
- - **Base Stat Differences:** Each class must have distinct starting stats. For example:
- - **Knight:** Highest Base Damage.
- - **Wizard:** Highest Max Health (HP).
- - **Assassin:** Highest Max Stamina/Mana.
-- **Enemies:** `Enemy` is an abstract class implementing `Entity`. Subclasses: `Skeleton`, `Goblin`, `Vampire`, and **`Dragon`**.
- - **The Boss:** Even though `Dragon` is the final boss, it **must** be a subclass of `Enemy` to inherit common combat properties, while possessing extremely high stats and unique mechanics.
-- **Item (Bonus):** `Consumable`, `Armor`, `Weapon` are abstract classes implementing `Item`. example :
- - KnightArmor extends Armor - you can add more subclasses of Armor for extra score
- - Sword extends Weapon - you can add more subclasses of Weapon for extra score
- - Flask extends Consumable - you can add more subclasses of Consumable for extra score
+Enemies attack after the player’s turn. Some enemies have special behavior:
-
+- Vampire can restore health while attacking
+- Goblin can land critical hits
+- Skeleton revives once after being defeated
+- Dragon acts as a boss enemy with high HP
-### 3️⃣ Step 3: Implement Player & Monster Methods 🏹
+## Core Interfaces and Classes
-**Player Actions (The Rule of Five):**
-Every player class **must** implement exactly the following 5 actions (You can use an interface like `ICombatActions`). Every action (except Light Attack) consumes a specific amount of Mana/Stamina. The **Special Ability** must consume the *highest* amount of Mana compared to the others.
-1. **Light Attack:** Deals moderate damage and costs **NO Mana**. (Note: If the player runs out of Mana/Stamina, this is the ONLY action they can perform.)
-2. **Heavy Attack:** Deals high damage, medium Mana cost.
-3. **Defend:** Completely blocks or significantly reduces the damage of the enemy's *next* strike. Medium Mana cost.
-4. **Heal:** Restores a portion of the player's HP. Medium-high Mana cost.
-5. **Special Ability:** A unique class-based ultimate move (Highest Mana cost):
- - **Wizard** 🧙♂️: Casts a devastating spell that damages the enemy while simultaneously replenishing some HP.
- - **Assassin** 🗡️: Turns invisible, dodging the next incoming attack completely and guaranteeing a *Critical Hit* on their next turn.
- - **Knight** ⚔️: Performs a shield bash that stuns the enemy, forcing them to skip their next turn while dealing heavy damage.
+### `Entity`
+Common contract for all combatants.
-**Monster Abilities:**
-- **Goblin** 👹: High critical hit chance but low health.
-- **Skeleton** ☠️: Can resurrect once per battle with 50% HP.
-- **Vampire** 🦇: Lifesteal ability – a portion of the damage it deals to the player is added back to its own health.
-- **Dragon (Final Boss)** 🐉: Immune to normal defense. Its fiery breath bypasses shields and deals massive damage.
+It defines shared behavior such as:
-🔹 Make sure each entity **prints messages** when performing actions. example output (while in combat) :
+- `attack(Entity target)`
+- `heal(int health)`
+- `fillMana(int mana)`
+- `takeDamage(int damage)`
+- `getMaxHP()`
+- `getMaxMP()`
-```bash
-You chose to FIGHT!
+### `Player`
+Abstract base class for all player characters.
-[Ser Duncan - 45/45 HP | 40/40 Mana]
-[Goblin - 30/30 HP]
+It stores:
----
+- name
+- weapon
+- armor
+- current and maximum HP/MP
+- base damage
+- alive status
-Your Turn:
-1. Light Attack | 2. Heavy Attack (-8 Mana) | 3. Defend (-6 Mana) | 4. Heal (-12 Mana) | 5. Shield Bash (-15 Mana)
-```
+It also provides:
-```bash
-→ Chose: Light Attack
-⚔️ Ser Duncan (Knight) used Light Attack! (0 Mana)
-Goblin took 10 damage!
-Goblin has 20/30 HP remaining.
-Ser Duncan Mana: 40/40
-```
-```
-Goblin's Turn :
-👹 Goblin used Critical Strike!
-💥 Critical hit! Ser Duncan took 20 damage!
-Ser Duncan has 25/45 HP remaining.
-```
-🔹 *Narrative Console:* Use ANSI escape codes to print colorful narrative logs (e.g., Red for damage, Blue for Mana usage, Green for healing).
+- normal attack
+- heavy attack
+- damage handling with armor defense
+- healing
+- mana restoration
+### `Enemy`
+Abstract base class for enemies.
-### 4️⃣ Step 4: Implement the Game Loop & Progression 🎮
+It stores:
-1. **The Core Loop:** The game starts with the player entering a location. A random standard enemy (`Goblin`, `Skeleton`, or `Vampire`) spawns immediately.
-2. **Player Choices:** Before engaging, the player is presented with the following options:
- - **1. Fight the enemy:** Enter the turn-based combat sequence.
- - **2. Move to another location:** Skip the current enemy and spawn a new random one.
- - **3. Go to the Castle to fight the Dragon:** *(Note: This option must remain strictly hidden or locked until the player has successfully collected all 3 keys).*
-3. **The Key Drop Logic (RNG Gatekeeping):**
- - When the player defeats an enemy, there is a **specific percentage chance (e.g., 20%)** that it will drop the unique key associated with its species (Goblin Key, Skeleton Key, Vampire Key).
- - **One Key Per Species:** Once a player obtains a specific key (e.g., Goblin Key), subsequent enemies of that same type (other Goblins) will **never** drop a key again.
- - The player **must collect all 3 distinct keys** to unlock Option 3 and enter the Castle.
-4. **Post-Combat Recovery:** After each successful battle, the player's HP and Mana bars must automatically replenish (either fully or partially) to their base amounts so they are ready for the next encounter.
-5. **Experience & Leveling System:**
- - Defeating an enemy grants **XP**. The amount of XP must scale proportionally to the enemy's power level.
- - Upon reaching an XP threshold, the player levels up. **Leveling up must automatically increase the player's Max HP and Max Stamina/Mana**, making them strong enough to eventually face the Dragon.
-6. **Final Boss Fight:** Once the 3 Keys are obtained and the player chooses to go to the Castle, they will face the Dragon. Defeating the Dragon breaks the curse, resulting in **Victory**. Dying at any point results in **Game Over**.
+- weapon
+- HP/MP
+- base damage
+- alive status
-🔹 Example game loop structure:
+It handles damage directly and leaves defeat behavior to subclasses through `getKilled()`.
-```java
-while (player.isAlive() && enemy.isAlive())
- player.attack(enemy);
- if (enemy.isAlive()) {
- enemy.attack(player);
- }
-}
-```
+## Player Classes
+### `Knight`
+- HP: 100
+- MP: 10
+- Base damage: 10
-### 5️⃣ Step 5: Extra Features & Bonus Tasks ⭐
-*(Optional for extra credit)*
+A durable melee fighter with strong base damage.
-✅ **Dynamic Economy & Merchant System:** Implement coins that drop from enemies. Add a "Visit Merchant" option to the main loop where players can spend coins to buy specific weapons, armors, or consumables.
-✅ **Multiple Weapons & Inventory:** Players can buy, store, and swap between multiple weapons or use consumables mid-combat.
-✅ **Multiplayer/Party Mode:** Allow multiple players to team up and fight multiple enemies together. The Dragon's breath attack will damage the entire party simultaneously.
-✅ **PvP Mode:** Implement a **Player vs. Player** combat system.
+### `Wizard`
+- HP: 150
+- MP: 10
+- Base damage: 4
-### 6️⃣ Step 6: Write a Comprehensive README 📄
-As the final mandatory step of your development, you must replace the default `README.md` with your own comprehensive documentation. Your README should include:
-- A brief introduction to the game.
-- How to compile and run your project from the terminal.
-- An explanation of the classes, design patterns, and OOP principles you used.
-- A brief guide on how to play (controls, stats, classes).
+A high-HP character using the shared `Player` behavior.
----
+### `Assassin`
+- HP: 80
+- MP: 20
+- Base damage: 5
-## Evaluation Criteria ⚖
+A lighter character with more mana than the Knight.
-| **Criteria** | **Points** |
-|-------------------------------------------------------------|------------|
-| Proper use of OOP principles | **50** |
-| Working combat mechanics, Leveling System & Enemy abilities | **20** |
-| Clear and Comprehensive `README.md` | **20** |
-| Code readability, documentation, and comments | **10** |
-| Meaningful, interactive, & colored console outputs | **10** |
-| Inventory (item) and Merchant System (bonus) | **20** |
-| Other Extra features (bonus tasks) | **20** |
-| **Total Score** | **150** |
+## Enemy Classes
-## Tips 🚀
-- **Follow OOP principles**: Avoid redundant code by using inheritance properly. Think carefully about what belongs in an abstract class vs. a specific subclass. Make sure you use overriding and overloading correctly.
-- **Test your code**: Run different scenarios (fighting, running out of mana, leveling up, dying) to ensure everything works as expected.
-- **Ask for help**: If you're stuck, reach out to your classmates or mentors.
+### `Vampire`
+- HP: 50
+- MP: 50
-## Submission ⌛
-- **Deadline**: Submit your assignment before **21 Ordibehesht (May 11th, 2026)**.
-- **Submission Format**: Push your code to your forked repository, create a PR, and ensure your comprehensive `README.md` is included in the root directory.
+Attacks and restores part of the damage dealt as health.
-
-###### - Born of God and Void. You shall seal the blinding light that plagues their dreams. You are the Vessel. You are the Java Knight.
\ No newline at end of file
+### `Goblin`
+- HP: 30
+- MP: 50
+
+Randomly performs either a normal or critical attack.
+
+### `Skeleton`
+- HP: 50
+- MP: 50
+- Base damage: 10
+
+Revives once after death, then dies permanently the second time.
+
+### `Dragon`
+- HP: 500
+- Base damage: 2
+
+A boss-style enemy with a fire-breath themed attack and custom death handling.
+
+## Items
+
+### `Weapon`
+Abstract item type for damage-dealing equipment.
+
+It includes:
+
+- damage
+- mana cost
+
+### `Sword`
+A weapon with low damage and a mana cost.
+
+It also includes a unique ability that can damage multiple targets.
+
+### `DragonBreath`
+A stronger weapon used for dragon-related combat behavior.
+
+## Armor
+
+### `Armor`
+Abstract armor type with:
+
+- defense
+- maximum defense
+- durability
+- maximum durability
+- broken state
+
+Armor can be repaired, and when durability reaches zero, its defense drops to zero.
+
+### `KnightArmor`
+A concrete armor type used by the player in the main game flow.
+
+#### `Flask`
+A healing item that restores a fraction of the target’s maximum HP.
+
+## Location
+
+`Location` is a simple class that stores a location name and one enemy.
\ No newline at end of file