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!!!

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.