Project #37593 - c++ polymorphism

So we need to take a game that was designed last week (description of the last weeks game and game.cpp file are attached as well) and do the following changes.

1.     You will modify the game by making your parent class an abstract class. That means you should create NO objects of that class. This is the MAIN requirement of this assignment.

2.     You must make (at least) 3 changes to your class hierarchy. You must use virtual functions, overriding, and/or redefining.

3.     You must use at least one virtual function

4.     You should include at least one new class that is a subclass of an existing class. For example you could add MegaMan.He should probably be a derived class of Barbarian (i.e. human), you can add this functionality to any class. Most of those changes would be inside the take damage function (or whatever you called it).

Mega  Man  

Any  damage  that  would  normally  be  

applied  to  strength  gets  diverted  to  an  

energy  store.    The  energy  store  can  be  

used  to  make  an  enhanced  attack.    Any  

damage  received  in  excess  of  the  store  is  

applied  to  strength  as  usual.

 

5.     In addition to attack and defense there should be bites venomous option. The creature’s attack would need to be modified to indicate the venom. All classes would need to be modified to reflect the ongoing effect of the venom. A  single  bite,  sting,  spit  whatever  inserts  venom  in  the  target.  For  a  specified  number  of  turns  applies  constant  or  degrading  damage  to  the  target’s  strength.    As  it’s  not  physical  energy Mega  Man  cannot  divert  the  damage  to  the  energy  store  but  is  taken  against  strength.  

 

6.     Add enchanted weapons. The most detailed would be for them to be a separate class. For our purposes maybe just create an EnchantedHobbit class? That hobbit might inflict double damage.

 

7.     Add spinach. You would need to add this as an option to all classes. HINT

So where would you need to put it? If a creature eats spinach before (during?) combat, it  attack rolls double (triple?) (quadruple?)? In the cartoons, it does wear off, but for our purposes you can ignore  that.

Subject Computer
Due By (Pacific Time) 08/13/2014 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy