A turn-based RPG inspired by Souls-like games which can be run in terminal
Welcome to Java-Ring, a turn-based RPG inspired by Souls-like games! In this assignment, you will develop a text-based role-playing game (RPG) that follows a structured combat system where players engage in battles against powerful monsters. This project is designed to reinforce your understanding of Object-Oriented Programming (OOP) principles, including inheritance, polymorphism, and interfaces.
Your task is to implement a class hierarchy for different game entities, including players and monsters, each with unique abilities and attributes. By the end of this project, you will have a functional game system where players can fight monsters in a turn-based combat system, reinforcing your understanding of OOP design in a practical way.
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.
- Turn-based combat – Players and monsters take turns attacking each other.
- Weapons system – Each player and monster must have at least one weapon. (For extra points, students can implement multiple weapons per entity.)
- Character classes – Players can choose from different warrior archetypes, such as Knight, Assassin, or Wizard, each with unique abilities.
- Monsters classes – Monsters like Dragons, Goblins, and Skeletons which have distinct attack patterns.
- Damage system – Each weapon deals a specific amount of damage, reducing the opponent’s health.
- Battle to the death – The combat continues until one side is completely defeated.
Through this assignment, you will:
- Learn and apply inheritance to structure a game class hierarchy.
- Understand and implement interfaces and abstract classes.
- Use polymorphism to handle interactions between game entities.
- Practice code reusability and modularity in Java.
- Develop a terminal-based game that showcases OOP concepts.
- Develop a creative gameplay to make it a playable simple game.
- Fork this repository and clone it to your local machine.
- Create a new branch named develop and switch to it.
- You must implement the class hierarchy as shown in the diagram below:
-
Class Descriptions:
- We have Entity, Object & Location in game
- Player & Enemy are abstract classes that implement Entity
- There are 3 classes: Wizard, Knight and Assassin which extend Player (or more if you want)
- There are 3 classes: Skeleton, Goblin and Dragon which extend Enemy (or more if you want)
- Consumable, Armor & Weapon are abstract classes that implement Object
- Flask extends Consumable - you can add more subclasses of Consumable for extra score
- 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
Each class should have the appropriate attributes and methods.
Basic Actions:
- Attacking: Players and monsters can attack their opponents.
- Defending: Reduce or block incoming damage. (Implementing this action grants extra score!)
- Being Killed: When health reaches zero, the entity is defeated.
- Healing: Players can heal, and some monsters (not all) have the ability to heal.
Unique Abilities:
-
Each class of players and monsters has its own unique abilities:
-
Players' Unique Abilities
- Wizard 🧙♂️: Can cast a special spell that heals himself while also damaging the enemy.
- Assassin 🗡️: Can become invisible, making him immune to enemy attacks while dealing increased damage when attacking in this state.
- Knight ⚔️: Can perform a strong kick that deals extra damage but can only be used after a certain number of rounds (cannot use it every turn).
-
Monsters' Unique Abilities
- Goblin 👹: Has no unique abilities.
- Dragon 🐉: Can bypass shields; damaging players even if they are defending. If there are multiple players in the game (extra score scenario), the dragon’s ability damages all players simultaneously.
- Skeleton ☠️: Can resurrect once after being defeated, returning to battle with a portion of its health restored.
-
🔹 Make sure each entity prints messages when performing actions:
Arthur attacked GoblinArthur (Knight) attacked Goblin!
Goblin took 15 damage!
Goblin has 35 health remaining.Create a simple turn-based combat system in a main game loop:
- Players choose a character (Assassin, Knight, or Wizard).
- The player enters the starting location.
- A random monster (Goblin, Dragon, or Skeleton) is generated.
- Player can choose to fight the monster or move to another location.
- In the fight, the player and the monster take turns attacking each other.
- If the player defeat the monster, they'll be rewarded and they can proceed.
- Game ends when either the player dies.
🔹 Example game loop structure:
while (player.isAlive() && enemy.isAlive()) {
player.attack(enemy);
if (enemy.isAlive()) {
enemy.attack(player);
}
}Want to earn extra points? Try implementing one of these:
✅ Defending Mechanic 🛡️ (Extra Score!)
- Implement a defending action that allows players to block or reduce incoming damage.
✅ Multiple Weapons System ⚔️ (Extra Score!)
- Players and monsters can switch between different weapons during combat instead of being limited to one.
✅ Multiple Players Mode 👥 (Extra Score!)
- Implement a party-based battle system where multiple players can fight against monsters together.
✅ Dragon’s Multi-Target Attack 🐉 (Extra Score!)
- If there are multiple players in the battle, the dragon’s unique ability should damage all players simultaneously instead of just one.
✅ (Bonus) Inventory System
- Allow players to pick up and use items like different classes of shields and more potions.
✅ (Bonus) Experience & Leveling System
- Players gain XP from battles and level up, increasing their attack power.
✅ (Bonus) PvP Mode
- Implement a Player vs. Player combat system.
By implementing any of these extra features, you can earn additional points to boost your final score! 🚀
Your assignment will be graded based on the following criteria:
| Criteria | Points |
|---|---|
| Correct class hierarchy implementation | 30 |
| Proper use of OOP principles (inheritance, interfaces) | 30 |
| Working combat system with player & monster interactions | 20 |
| Meaningful console outputs for actions | 10 |
| Code readability, documentation, and comments | 10 |
| Extra features (bonus tasks) | 10 |
| Total Score | 110 |
- Deadline: Submit your assignment before March 19th, 2025.
- Submission Format:
- Push your code to your forked repository.
- Create a pull request to the main branch.
- Include a README.md with explanations of your implementation.
📌 Note: Late submissions may receive deductions!
- Follow OOP principles: Avoid redundant code by using inheritance properly.
- Test your code: Run different scenarios to ensure everything works as expected.
- Ask for help: If you're stuck, reach out to your classmates or mentors.
🎯 Your goal is not just to complete the assignment but to learn and apply OOP effectively!
Good luck, and have fun coding! 🚀

