CS591 The Quest Spring 2020
This assignment is to implement a role playing game in Java using Object Oriented principles and design. This is a magical game full of spells, heroes and monsters.
The heroes and the monsters live in a world represented by a square grid of fixed dimensions. The heroes are able to fight the monsters using weapons, armors, potions and spells. The heroes can also augment their powers by purchasing items to assist in their quest. Every time the heroes win, they gain some experience and some money. When they accumulate enough experience they level up which means that their skills become stronger. The goal of the game is for the heroes to reach a very high level of experience.
I. The Market
There is a market where the heroes can buy weapons, armors, spells and potions:
A weapon can be used by a hero to attack a monster. A weapon has a name, a price and a minimum hero level required to be used by a hero. It has a specific amount of damage that it can inflict, and it may require just one or both of the hero’s hands (for simplicity you can assume that a hero can hold at most one weapon at a time).
An armor, which when worn by a hero, reduces the incoming damage from enemy’s attacks. An armor has a price, a name and a minimum hero level as a requirement to be used.
A potion can be used by a hero in order to increase one of their statistics by some amount. Potions are one-use items which means that once they are used they cannot be reused. Potions as well have a price, a name and a minimum hero level as a requirement to be used. You can assume for simplicity that the level requirement is enforced during the purchase (i.e. when a hero tries to buy an item with a level requirement bigger than their level they get rejected by the market).
A spell represents a magic attack and can be executed by a hero. A spell has a name, a price and a minimum hero level required to be used by a hero. A spell has a damage range and an amount of magic energy (called mana) that it requires in order to get casted. After the cast of the spell this amount of mana is deducted by the hero. The level of damage a spell causes depends on the dexterity skill level of the hero. Spells:
o An ice spell, apart from the damage it causes it also reduces the damage range of the enemy.
o Afirespell,apartfromthedamageitcausesitalsoreducesthedefenselevel of the enemy.
o A lightning spell, apart from the damage it causes it also reduces the dodge chance of the enemy.
II. The Heroes and Monsters
The heroes have a name, a level and some health power (called HP). This value (hp) is not capped. In our game you can assume that the hero’s hp can continue to increase without any upper bound. However, when their hp becomes equal to zero the hero faints. The heroes
CS591 The Quest Spring 2020
also have a special power called mana (which is also uncapped) and some skills that effect their fighting efficiency. Those skills are strength, dexterity and agility.
o Ahero’sstrengthisaddedtotheamountofdamagetheydealwhenusingaweapon. o Ahero’sdexterityisaddedtotheamountofdamagetheydealwhencastingaspell. o A hero’s agility increases their chance to dodge an incoming attack.
A hero has some money and some experience. When a hero accumulates enough experience they level up. During each of those times the levels of the skills of the hero get increased by some number.
There are three types of heroes: warriors, sorcerers and paladins: o Warriors are favored on the strength and the agility.
o Sorcerers are favored on the dexterity and the agility.
o Paladins are favored on the strength and the dexterity.
Favored means that their starting statistics on those sectors will be increased and that every time they level up those statistics will be further boosted.
Monsters have a base damage that they can cause, an amount of defense which is deducted from the damage of an incoming attack and a chance to dodge an incoming attack. There are three kinds of monsters: dragons, exoskeletons and spirits.
o Dragons have a higher damage,
o exoskeletons have increased defense and o spirits have higher dodge chance.
Monsters have a name, some hp and a level.
III. The World of Play
The world of the game is represented by a grid of specific dimensions. At any given moment the team of heroes (which are at most three and at least one) is placed in a specific tile of the grid and they can move by one tile/cell up or down or left or right. Some tiles of the grid might not be accessible or might be markets or might be just common tiles/cells. The heroes cannot move on a non-accessible tile. The heroes can buy items from the market if they have enough money to do so. Each hero has her/his private wallet and does not wish to share her/his money with any other hero. Moreover, they can sell items to the half of the price they were bought. Those transactions must take place through a special menu where the player will be able to see all the items available for selling or buying as well as the information of those items (price, required hero level etc.). Finally, every time the heroes visit a common tile there is a chance that they will engage in a fight with monsters that will have the same level as the level of the highest leveled hero. The fight starts automatically as soon as the heroes move to that tile (if it is one of their unlucky tiles). When the heroes do not buy or sell items and do not fight they should be able to check their inventories, to change the weapon they hold and the armor they wear. They should also be able to consume a potion. The player should be able at any moment to display information related to the heroes like their level, their hp, their mana, their current exp and their skill levels.
CS591 The Quest Spring 2020
The player should be able at any moment to display the map (grid). There should a comprehensive way of visually representing all the tiles and their properties (whether the heroes are in a specific tile, if a tile is accessible and if it contains a market). The player should be able at any moment to quit the game.
IV. The Fight
A fight takes place between heroes and monsters. A fight consists of multiple rounds. The first to attack is always the team of heroes. The fight ends only when the hp of either all the monsters or all the heroes is zeroed. If the heroes win the fight then they earn some money based on the level and the number of monsters that they faced in that fight. If the monsters win the fight the heroes lose half of their money. The heroes regain some of their hp at every round if they are still alive. If after the end of a fight (won by the heroes) a hero’s hp is zero the hero gets revived by the other hero(es) and gets back half of his/her hp but doesn’t gain any exp. During a round of the fight, when it is the turn of the heroes, the player chooses for each hero whether they will do a regular attack or if they will cast a spell or if they will use a potion or if they will change their armor/weapon. At each round a hero can perform only one of the above. At each round the player can display the stats of a hero or a monster. You can assume that all of the fights will be either 1v1, 2v2 or 3v3 depending on the number of the heroes the player wants to start their game with. (So, for example if the player decided to start their adventure with two heroes, then every time the heroes get in a fight the fight will be against exactly two monsters. For more simplicity you can assume that the first hero will always attack the first monster and the second hero the second monster. However, do not forget to think of the case that one of them faints and the alive hero has to fight both of the monsters – or the opposite.)
Some notes regarding the logistics of the rules:
A spell’s final damage can be calculated by the following formula: spells_base_damage + (dexterity/10000)*spells_base_damage.
You can assume that hp of both heroes and monsters can be calculated as: 100*their_level
When a hero levels up then this formula is used to reset calculate her/his hp.
You can assume that the mana of the heroes when they level up can be calculated as: current_mana + current_mana*0.1.
You can assume that the damage a hero causes with an attack with their weapon can be calculated as: (strength + weapon damage)*0.05.
You can assume that a hero has a probability of dodging an attack which can be calculated as: agility*0.02.
You can assume that a hero needs to acquire their_current_level*10 experience points to level up.
CS591 The Quest Spring 2020
You can assume that when a hero levels up all of their skills get increased by 5% and their favored skills get an extra 5% increase.
You can assume that during every round of a fight the heroes regain 5% of their hp and 5% of their mana.
You can assume that after every successful fight each hero who did not faint gains 150 coins and 2 exp for their troubles.
You can assume that the level of the enemy’s skill deterioration that is caused from each of the spells is equal to 10%.
A sample dimension size in which the game can be played is 8×8. In this size our suggestion is to have (randomly assigned) 20% non-accessible cells, 30% markets and 50% common cells.
A personal note for those who may want to explore a more colorful terminal experience:
Although you are not expected to do so, you may want to use some colors to represent different messages or map visualizations on the terminal. This can be done quite easily if you follow the instructions of this link.