954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Text RPG damage

hi all, this is the same game (if you can call it that yet) that I asked for help with last time (but I sorted it out myself) this time the problem is getting hp off of a monster/character in the combat header Ive already got a damage function that works out how much hp to take off, and wether its a critical hit, the problem is that they are all in different headers and I cant get the referance function to work properly (I think) the fuction that Im tring to get to work is in comment so it will compile anyway. any help appreciated
PS same as last time, to view the files, right click save as, otherwise they dont seem to work!!!

Attachments main.cpp_.txt (1.75KB) character.h_.txt (0.99KB) monster.h_.txt (0.97KB) combat.h_.txt (1.35KB)
Raptoricus
Newbie Poster
6 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Ive done it again :), kindof a noobie error problem 1:
didnt make a takeHP function in monster class
2: After I did I had some learning to do about how to add new variables into an existing function

in conclusion:

made function: takeHP2(int amount){setHP2()-amount};
//set hp sets a new amount of hp
then used it like so in combat function:
takeHP2(amount); //Id already worked out a damage amount function

hope some of my self solved posts help some people sometime, its been a learning experience for me :)

Raptoricus
Newbie Poster
6 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You