Update crit chance to gen 7 odds

pull/156/head
Flashfyre 2024-04-16 12:14:33 -04:00
parent 257e222b83
commit 05bb384934
2 changed files with 3 additions and 1 deletions

View File

@ -212,6 +212,8 @@ export default class Battle {
}
randSeedInt(scene: BattleScene, range: integer, min: integer = 0): integer {
if (range <= 1)
return min;
let ret: integer;
const tempRngCounter = scene.rngCounter;
const tempSeedOverride = scene.rngSeedOverride;

View File

@ -1213,7 +1213,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
if (source.getTag(BattlerTagType.CRIT_BOOST))
critLevel.value += 2;
const critChance = Math.ceil(16 / Math.pow(2, critLevel.value));
const critChance = [24, 8, 2, 1][Math.max(0, Math.min(critLevel.value, 3))];
isCritical = !source.getTag(BattlerTagType.NO_CRIT) && (critChance === 1 || !this.scene.randBattleSeedInt(critChance));
if (isCritical) {
const blockCrit = new Utils.BooleanHolder(false);