Files
HW-04-JAVA-KNIGHT-Saeed/README.md
T

66 lines
3.0 KiB
Markdown

# ⚔️ Java Knight: The Legend of Javanest
Java Knight is a turn-based, console-based RPG built in Java. Players take on the role of a hero tasked with saving the land of Javanest by defeating monsters, collecting mystical keys, and ultimately slaying the Dragon.
---
## 🚀 Quick Start
**Prerequisites:** Java JDK 8 or higher.
1. **Navigate to the source root:**
```bash
cd your-project-folder/src
```
2. **Compile the project:**
```bash
javac org/project/Main.java
```
3. **Run the game:**
```bash
java org.project.Main
```
---
## ⚙️ Game Mechanics
- **Progression & XP:** After each victory, your HP and Mana are fully recovered. Defeating enemies grants Experience Points (XP).
- **The Shop:** Between fights, you can visit the inventory to convert XP into permanent stat upgrades. 1 XP can be exchanged for either 1 Max HP or 1 Max MP.
- **The Hunt for Keys:** To reach the end-game, you must collect three unique keys (Goblin, Skeleton, and Vampire). These have a chance to drop after defeating the respective enemy type.
- **The Castle:** The path to the final boss is locked until all three keys are in your possession. Only then can you enter the castle to face the Dragon.
---
## 🎮 How to Play
### Hero Classes
- **Knight:** Balanced stats with high-damage melee capabilities.
- **Assassin:** High stamina/mana efficiency with lower costs for defending.
- **Wizard:** High mana pool and powerful magical abilities.
### Combat Actions
On your turn, choose one of the following:
1. **Light Attack:** Moderate damage; costs **0 Mana**.
2. **Heavy Attack:** High damage; costs Mana.
3. **Special Ability:** Unique class-based move; highest Mana cost.
4. **Defend:** Reduces or blocks the next enemy attack; costs Mana.
5. **Heal:** Restores HP during combat; costs Mana.
---
## 🛠 Technical Architecture & OOP Principles
This project demonstrates core Object-Oriented Programming principles:
- **Inheritance:** Uses hierarchies for `Player` (Knight/Wizard/Assassin) and `Enemy` (Goblin/Skeleton/Vampire/Dragon) to share common logic while allowing unique overrides.
- **Polymorphism:** The combat engine handles any `Entity` implementation. The `Weapon` system allows different damage behaviors to be executed through a single interface.
- **Encapsulation:** Core stats like HP, Mana, and XP are protected. Data integrity is maintained through getters, setters, and specialized methods like `takeDamage()` and `reduceMana()`.
- **Abstraction:** The `Weapon`, `Enemy`, and `Player` classes are abstract, ensuring that specific game entities must follow a strict template while hiding the complexity of underlying calculations.
- **Interfaces:** The `Entity`, `Item`, and `Key` interfaces decouple behaviors from the class hierarchy, allowing for flexible interaction between different game objects.
<br/>
![cover](Readme_Pictures/image.png)
###### - Born of God and Void. You shall seal the blinding light that plagues their dreams. You are the Vessel. You are the Java Knight.