forked from github/server
no more than 4 critical hits
This commit is contained in:
parent
83d40962d2
commit
5778bc2c93
|
@ -1205,11 +1205,12 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
|
||||||
if (type != AT_COMBATSPELL && type != AT_SPELL) {
|
if (type != AT_COMBATSPELL && type != AT_SPELL) {
|
||||||
if (rule_damage & DAMAGE_CRITICAL) {
|
if (rule_damage & DAMAGE_CRITICAL) {
|
||||||
double kritchance = (sk * 3 - sd) / 200.0;
|
double kritchance = (sk * 3 - sd) / 200.0;
|
||||||
|
int maxk = 4;
|
||||||
|
|
||||||
kritchance = MAX(kritchance, 0.005);
|
kritchance = MAX(kritchance, 0.005);
|
||||||
kritchance = MIN(0.9, kritchance);
|
kritchance = MIN(0.9, kritchance);
|
||||||
|
|
||||||
while (chance(kritchance)) {
|
while (maxk-- && chance(kritchance)) {
|
||||||
da += dice_rand(damage);
|
da += dice_rand(damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue