Ive done part a2 but i need help doing part 3
Individual Assignment Due 4/22-4/26 Riders of Fortune 3.0: You will be enhancing your Riders of Fortune game to have include the following: Use the map implementation of either assignment Well of Reflection alignment change should work. Class Implementation of Player You should build on your implementation of assignment 2. For this assignment it must support the Player Class to maintain the following: · Player HP · Player XP · Player Alignment Create Object Classes for your Enemy You will create a base class called Enemy. This class will have the following configuration · Constructor(PlayerXP): The constructor will initiate the HP of the enemy. Player XPEnemy HP 1 Random value (1-5) 2 Random value (1-10) 3 Random value (1-15) …etc · Private Member HP: Health Points. The amount will be based on the player’s XP based on the given scale below: · getHP(): An accessor function to retrieve the enemy’s HP. · setHP(): A mutator function to set the HP. · Virtual method: attack(Player obj): This method will be implemented in the derived classes and returns a damage against the player. You will then use your base class to implement subclasses of the following enemies as derived classes: Raging Reapers: The Reaper class will have the following implementation of attack (Player Obj): If the player has an alignment of “Good”, the attack will be half the player’s current HP. Otherwise the attack will be a random number from 1 to 25% of the player’s HP (only integer). Specification and Implementation Separation. You will separate your Enemy and Player class into an implementation file (.cpp) and a specification file (.h) Implement “Mystic Blacksmith” Weapon Stack. When you land in a space you will have a random chance to encounter a new space, “The Mystic Blacksmith”. The blacksmith has a stack which will allow you to leave multiple weapons in the stack to increase their modifier value. If you choose to leave your weapon with the Blacksmith, you will lose the ability to use it until you next encounter him and pick it back up When you retrieve the weapon in from the blacksmith, the modifier will be + the number of turns that weapon has been with the blacksmith (a turn is defined by the number of times Example: On turn 5, you left a Mace with modifier 4. During turn 10, you find the Blacksmith again and retrieve the Mace. The Mace will now have a modifier of 9 (4 plus 5 turn difference). Use the STL’s implementation of a Stack to do this. Exception Handling: You will add the following custom Exception: WeaponsLimit: Limit the Weapons that can be carried to 5. If more than 5 weapons are attempted to be carried, throw the WeaponsLimit exception, which will display a message to the user that they have reached their max. Lake of Despair: If in the menu: 1) Travel to another space on the board 2) Dismount and explore the current space 3) Save your game You choose #1, there will be a chance you will fall into the Lake of Despair. You will create a recursive function called leaveDespair() which will roll the dice. A value of 1,2,4, and 5 will keep you in the Lake of despair and cause you to roll again. A value of 3 and 6 will let you exit. You will create leaveDespair() to be a recursive function, such that it will call itself if you don’t roll a 3 or a 6 and rolls again. Grading Criteria: · Enemy Base Class Implementation (5 pts) · Derived Class Raging Reapers Implementation (5 pts) · Specification and Implementation separation for Player and Enemy (5 pts) · Mystic Blacksmith Stack Implementation (5 pts) · Exception Handling implementation (5 pts) · Lake of Despair Recursion Implementation (5 pts) Individual Assignment Due 3/25 Congratulations, your game “Riders of Fortune” was a success. The Magic Gaming company wants a sequel and you listen to the fans and decide to help Yarra continue his adventure. For version 2.0 “ROF 2: Dungeon Escape” you will need to make the create the following: Game Modes When you start the game, you will have the following menu: Welcome to Riders of Fortune 2.0: Dungeon Escape. Choose to: 1) Start a New Game 2) Load a Saved Game If the player chooses 1, the game will start as normal. If player chooses 2 it will load the current game state from saveGame.txt Main character You will use Object Orientation to create a player object. The player will now contain the following traits. · HP: Health Points. This amount will start with 100 (max) and will decrease when attacked. If it reaches 0, the player will die. It can also be restored. · XP: Experience Points: This amount will start at 0 and grow as needed. · BoardPosition: The space where the player is on board. · Equipped Weapon: The Equipped Weapon. · Alignment: GOOD or EVIL. Default to GOOD. Implement an Enumerator for these states. · WeaponCollection: The weapons that have been acquired. · ItemCollection: The items that have been acquired. The player object will also have the following methods or actions: · WeaponDamage(weapon) : This will execute an attack on an enemy and will return the damage. · UseItem(item) : This will allow the player to consume an item and its effects. · ChangeAlignment(alignment): Changes the player’s alignment. Turns You will use a pointer to keep track of the number of Turns that the player takes to escape. The Game Board You will now create a map which allows the player to move continuously, as follows: S * * * W * * CPlaces Legend: * *S = Player Start * *C = Cathedral E GG = Graveyard * *W = Well of reflection * *E = Dungeon Exit * * G * * * W * * C The player starts in S and can continue to move forward to different spaces on the board. When the player gets to a corner of the board, they must continue to move forward vertically or horizontally in a positive direction. The player can overlap the board as many times as they want, but they must move in a positive direction. As in project 1, you will provide the player with a menu: 1) Travel to another space on the board 2) Dismount and explore the current space 3) Save your game When a player lands on a place, the following effects will occur to the player: Cathedral: If your alignment is good, you will gain 20% HP, else you will lose 20% HP (round up to the next integer, do not pass max limit). Graveyard: If your alignment is evil, you will gain 20% HP, else you will lose 20% HP (round up to the next integer, do not pass max limit). Well of Reflection: Increases your XP by 2 and your alignment is changed. Dungeon Exit: This will allow you to exit the dungeon if your XP is 20 or higher and you have found a magic relic. Landing on any other places will result in one of the following random events: 1) An enemy appears and a battle takes place. 2) You find an item 3) You find a weapon Saving the Game If the player chooses to save the game, the state of the game will be written to a file called saveGame This file will only need to hold one saved state a time, so saving will overwrite the existing save. You must save the following data for the player: Player Turns, HP, XP, Board Position, Alignment, Weapon Collection, Item Collection, Equipped Weapon Display You must display the following when the player is playing: Player Turns, HP, XP, Board Position, Alignment, Equipped Weapon Enemy Battles The battle will now last multiple rounds, so they will continue until either the enemy dies or the player dies. The player can now choose to ATTACK or USE ITEM Attack: If the user chooses to attack, Display the weapons that the user currently has and ask the player to choose a weapon. Once the user chooses the weapon use that weapons modifier for that attack. An attack from the enemy will result in HP damage. Defeating an enemy will increase the XP of the player by 30% of their current amount (Use the integer value and round up). Use item: The player can choose to use a potion. If they have any in their collection and the effects will be applied. Enemy HP The enemies themselves will have HP which is random value that increases as the player’s XP increases and will be immune to a weapon type. Example: Player XPEnemy HP 1 Random value (1-5) 2 Random value (1-10) 3 Random value (1-15) Etc… When you fight an enemy, randomly pick a weapon type that the enemy is immune to. Weapons (Struct Implementation and Vector Implementation) Create a Weapon Struct to hold a Weapon which has the attributes: Weapon Type and Attack modifier. You will randomly find one of these weapons types: · Crossbow (+3 modifier) · Flail (+5 modifier) · Broad Sword (+8 modifier) · Morning Star (+13 modifier) · Holy Staff (+21 modifier) When the weapon is found, it is added to a vector. Keep these in a vector, display a list of the weapons type to the user and ask them to select a weapon. Retrieve the weapon and use its modifier in your attack. Items (Dynamic Allocation) Your item bag will start out with 5 slots, so use an array of 5 to create the item bag. As you land on an item space, you will You will randomly obtain one of these items: 1) Potion 1: Increases HP by 5 when used. 2) Potion 2: Increases HP by 10 when used. 3) Magic Relic: Allowed you to pass through the dragon entrance (E) If you reach your item bag