I\'m a web-game developer and I got a problem with random numbers. Let\'s say that a player has 20% chance to get a critical hit with his sword. That means, 1 out of 5 hits
What about making the chance of critical depend on the last N attacks. One simple scheme is some kind of markov chain: http://en.wikipedia.org/wiki/Markov_chain but the code is very simple anyway.
IF turns_since_last_critical < M THEN
critial = false
turns_since_last_critical++;
ELSE
critial = IsCritical(chance);
IF Critial THEN
turns_since_last_critica = 0;
ELSE
turns_since_last_critica++;
END IF;
END IF;
Of course you must make your maths because the chance of a critical is lower than the chance of a critical once you know that it has been enough turns since the last one