Update crit chance to gen 7 odds
parent
257e222b83
commit
05bb384934
|
@ -212,6 +212,8 @@ export default class Battle {
|
||||||
}
|
}
|
||||||
|
|
||||||
randSeedInt(scene: BattleScene, range: integer, min: integer = 0): integer {
|
randSeedInt(scene: BattleScene, range: integer, min: integer = 0): integer {
|
||||||
|
if (range <= 1)
|
||||||
|
return min;
|
||||||
let ret: integer;
|
let ret: integer;
|
||||||
const tempRngCounter = scene.rngCounter;
|
const tempRngCounter = scene.rngCounter;
|
||||||
const tempSeedOverride = scene.rngSeedOverride;
|
const tempSeedOverride = scene.rngSeedOverride;
|
||||||
|
|
|
@ -1213,7 +1213,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
}
|
}
|
||||||
if (source.getTag(BattlerTagType.CRIT_BOOST))
|
if (source.getTag(BattlerTagType.CRIT_BOOST))
|
||||||
critLevel.value += 2;
|
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));
|
isCritical = !source.getTag(BattlerTagType.NO_CRIT) && (critChance === 1 || !this.scene.randBattleSeedInt(critChance));
|
||||||
if (isCritical) {
|
if (isCritical) {
|
||||||
const blockCrit = new Utils.BooleanHolder(false);
|
const blockCrit = new Utils.BooleanHolder(false);
|
||||||
|
|
Loading…
Reference in New Issue