quote:Original post by null_void
I know you weren''t asking me, but that''s what I would do. I''d make the function virtual so that ''special'' Entity types could override the attack method.
what do you mean by... well all of that?
quote:Original post by null_void
I know you weren''t asking me, but that''s what I would do. I''d make the function virtual so that ''special'' Entity types could override the attack method.
quote:Original post by graveyard filla
if i were to do that i would have to implement some sort of damage mod variable... maybe pass it by refernce or maybe ill just make it a member variable of the entity class
also... if i wanted to do a damage mod thing.... i would have to use a double to calculate the damage mod like damage*1.06 for 6% damage increase........... but a player health has to be a whole number (integer) so how do i have the final damage be an int but its calculated with a double? would i get warnings or errors or what? not only that, but wouldnt it round the .06 to 0 and give me no damage mod. just wonderin how i could do this. thanks
quote:Original post by graveyard fillaquote:Original post by null_void
I know you weren't asking me, but that's what I would do. I'd make the function virtual so that 'special' Entity types could override the attack method.
what do you mean by... well all of that?
quote:Original post by null_void
I know you weren't asking me, but that's what I would do.
quote:Original post by null_void
I'd make the function virtual so that 'special' Entity types could override the attack method.
quote:Original post by graveyard filla
also... if i wanted to do a damage mod thing.... i would have to use a double to calculate the damage mod like damage*1.06 for 6% damage increase........... but a player health has to be a whole number (integer) so how do i have the final damage be an int but its calculated with a double? would i get warnings or errors or what? not only that, but wouldnt it round the .06 to 0 and give me no damage mod. just wonderin how i could do this. thanks
int moddeddamage = damage * 106 / 100;