I am making a text-based C++ RPG and I am trying to figure out how to work out the amount of damage that the enemy hits you for. My idea is something like this.
Damage done = randomIntBetween10and20*enemyLevel
This way it doesn't always hit for a set amount each time and allows there to be Critical Strikes (For example, if the hit is above 15 I would class that as a Critical Strike)
I'm new to C++ so I'm not quite sure how I can do this, any help would be greatly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…