Starting from:

$30

CPE212-Project 2 Class Inheritance Solved

In this project you will be implementing a very basic command line RPG game with two or more characters that will battle and support each other. You will be writing 7 classes to complete this assignment. These classes will be called Character, Warrior, Mage, Rogue, Cleric, Goblin and Inventory. You will be given the header files for each of the mentioned classes and they contain detailed descriptions of what is needed as well as the makefile and test files. Below are some key details for each class. 

Character Class
The Character class is the parent class for all of the other classes except for the Inventory class. All of the other classes will inherit from this class. Note that there are several virtual classes that must be implemented in the inherited classes. 

 

 

             

Inventory Class
The Inventory class is inherited from all of the other classes as each of the characters contain an inventory. The inventory is very simple at the moment with only two methods. 

 

Warrior Class
The Warrior class inherits from both the Character and Inventory classes and represents a warrior in the game. The warrior has the unique characteristic of strength. This class also has the unique skill of PowerAttack which takes in a pointer to the character to be attacked. 

                            

Mage Class
The Mage class inherits from both the Character and Inventory classes and represents a warrior in the game. The warrior has the unique characteristic of intelligence. This class also has the unique skill of Fireball which takes in a pointer to the character to be attacked.

                                

Rogue Class
The Rogue class inherits from both the Character and Inventory classes and represents a warrior in the game. The warrior has the unique characteristic of dexterity. This class also has the unique skill of BackStab which takes in a pointer to the character to be attacked.

                            

             

Cleric Class
The Cleric class inherits from both the Character and Inventory classes and represents a warrior in the game. The warrior has the unique characteristic of willpower. This class also has the unique skill of Heal which takes in a pointer to the character to be healed.

                           

Goblin Class
The Goblin class inherits from both the Character and Inventory classes and represents a warrior in the game. The warrior has the unique characteristic of attack. This class also has the unique skill of SneakAttack which takes in a pointer to the character to be attacked.

                           

PROJECT TESTING
To run the sample solution you must first login to the blackhawk.ece.uah.edu system and issue the following command:

 

-bash-4.2$  cd /your/project02/location

-bash-4.2$  /home/work/cpe212-01-20s/project02/Game inputfilename

where the inputfilename is the name of one of the provided input files (for example, test_inventory.txt). Your current working directory must contain the input files for this to work.

 

A test script can also be found with the following:

-bash-4.2$  cd /your/project02/location

-bash-4.2$  /home/facstaff/taf0004/CPE212SP20/Project02/preview02.bash

PROJECT INSTRUCTIONS
Compilation
This project consists of eight C++ files so you do not want to compile and link these files manually.  The makefile contains the sequence of commands required to compile and assemble (link) your executable program.  The provided file works on blackhawk.  So, for this assignment, all you must do to compile the program is to use the following command at the Linux command line

-bash-4.2$ make

which will create an executable named  project02 from the provided files main.cpp and the files you have written.  

If your program compiled successfully, you may then type

-bash-4.2$ ./Game   NameOfInputFile

to execute your program assuming that the input file is located in the same directory with the executable.   (For example,   ./Game  test_inventory.txt  )

To force all files to be recompiled and relinked, type the following sequence of commands at the Linux prompt.

-bash-4.2$ make clean

-bash-4.2$ make

File Constraints
On Project02, all allowable include files are already specified in the provided source code materials.  

Card header files such as “character.h”, “inventory.h”, or the classes header file are allowed

No additional include files are allowed!!!

Failure to follow these directions will result in zero (0) credit on this assignment.

           

Debugging
Your program must be fully commented (including variable and parameter declarations, function descriptions, descriptions of logical blocks of code, etc.)  in order to receive debugging assistance from the instructor and teaching assistants.  See Canvas for an example of an acceptable commenting style.

More products