You could add it to an array, set a constant SWORDPOWER to its index, and do this:
int SwordPower(){ return CharacterArray[SWORDPOWER]; }...for the same effect...or...
const int WARRIOR = 0; const int RANGER = 1; const int BARD = 2; const int THIEF = 3; const int MAGE = 4; int SwordPower(int charClass){ return CharacterArray[SWORDPOWER+CLASS]; }...to modify the damage based on class. I suppose that breaks the scope of your header a bit though, but it's pretty much what I'd do in that situation.
ZC RNG can be broken in general, but speed of swing should have an equal chance to produce repeated values of '1'; and '6', which should balance around 3.5.
If your enemy had 14 HP, it should take 4 attacks on average to kill it. You may want to calculate the raw average when assigning HP, for this reason. If you want to expect five attacks, it should have 17 or 18 HP, but larger numbers produce better results with variance.
You could also restrict the RNG, by putting a timer on changing the value, and calling a function to roll the value that is smart; that only produces a new result when the timer expires. That could expand the variance a bit; but you could also go the Golden Axe method, and give smaller spreads when the timer is high, and larger spreads when low.
If you don't understand that reference, let me know, and I'll explain it; but I'm going to add functions for that to RPG.zh, now that I've thought of it.
I'd like to calculate damage based on how precise the collision was, in an ideal world, and slashing swords have too large a hitbox IMO. One of the things that I'd like to do with cripted sworfds, is more precisely define their hitbox; but I'm the bloke who wants to code AI enemies with swords of their own, as in Z3, for parrying blows.
Edited by ZoriaRPG, 11 May 2015 - 11:54 AM.