For this assignment, you will need to make the create the following:
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
You will use Object Orientation to create a player object. The player will now contain the following traits.
The player object will also have the following methods or actions:
You will use a pointer to keep track of the number of Turns that the player takes to escape.
You will now create a map which allows the player to move continuously, as follows:
S * * * W * * C Places Legend:
* * S = Player Start
* * C = Cathedral
E G G = 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:
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
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
You must display the following when the player is playing:
Player Turns, HP, XP, Board Position, Alignment, Equipped Weapon
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.
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 XP Enemy 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.
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:
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.
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 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 limit, you will have to create a new bag with space for 5 more items and move all the items to the new bag.
HINT: If you find more items than its current size, you will dynamically allocate a new array to hold the n+ 5 items. Continue to do this every time you an additional reach your arrays limit. Review Chapter 9 for ideas.
To exit the dungeon, you must meet the following conditions:
1) Reach an XP of 20 or higher
2) land on the dungeon exit
3) have obtained the magic relic item.
If the player has all the requirements, they will exit the dungeon and have completed the game.