mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +02:00
Change shake probability to match Gen 6
This commit is contained in:
parent
f0ae36de6c
commit
fc42937cc8
@ -51,8 +51,8 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||
const catchRate = pokemon.species.catchRate;
|
||||
const pokeballMultiplier = getPokeballCatchMultiplier(this.pokeballType);
|
||||
const statusMultiplier = pokemon.status ? getStatusEffectCatchRateMultiplier(pokemon.status.effect) : 1;
|
||||
const x = Math.round((((_3m - _2h) * catchRate * pokeballMultiplier) / _3m) * statusMultiplier);
|
||||
const y = Math.round(65536 / Math.sqrt(Math.sqrt(255 / x)));
|
||||
const modifiedCatchRate = Math.round((((_3m - _2h) * catchRate * pokeballMultiplier) / _3m) * statusMultiplier);
|
||||
const shakeProbability = Math.round(65536 * Math.pow((modifiedCatchRate / 1044480), 0.1875));
|
||||
const fpOffset = pokemon.getFieldPositionOffset();
|
||||
|
||||
const pokeballAtlasKey = getPokeballAtlasKey(this.pokeballType);
|
||||
@ -114,7 +114,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||
shakeCounter.stop();
|
||||
this.failCatch(shakeCount);
|
||||
} else if (shakeCount++ < 3) {
|
||||
if (pokeballMultiplier === -1 || pokemon.randSeedInt(65536) < y) {
|
||||
if (pokeballMultiplier === -1 || pokemon.randSeedInt(65536) < shakeProbability) {
|
||||
this.scene.playSound("se/pb_move");
|
||||
} else {
|
||||
shakeCounter.stop();
|
||||
|
Loading…
Reference in New Issue
Block a user