mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +02:00
Integer to number in bounceanim signature
This commit is contained in:
parent
ddf9e6792a
commit
8fa75f6874
@ -106,7 +106,7 @@ export function getCriticalCaptureChance(scene: BattleScene, modifiedCatchRate:
|
|||||||
return Math.floor(catchingCharmMultiplier.value * dexMultiplier * Math.min(255, modifiedCatchRate) / 6);
|
return Math.floor(catchingCharmMultiplier.value * dexMultiplier * Math.min(255, modifiedCatchRate) / 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function doPokeballBounceAnim(scene: BattleScene, pokeball: Phaser.GameObjects.Sprite, y1: number, y2: number, baseBounceDuration: integer, callback: Function, isCritical: boolean = false) {
|
export function doPokeballBounceAnim(scene: BattleScene, pokeball: Phaser.GameObjects.Sprite, y1: number, y2: number, baseBounceDuration: number, callback: Function, isCritical: boolean = false) {
|
||||||
let bouncePower = 1;
|
let bouncePower = 1;
|
||||||
let bounceYOffset = y1;
|
let bounceYOffset = y1;
|
||||||
let bounceY = y2;
|
let bounceY = y2;
|
||||||
|
@ -98,13 +98,13 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
this.scene.time.delayedCall(17, () => this.pokeball.setTexture("pb", `${pokeballAtlasKey}`));
|
this.scene.time.delayedCall(17, () => this.pokeball.setTexture("pb", `${pokeballAtlasKey}`));
|
||||||
|
|
||||||
const doShake = () => {
|
const doShake = () => {
|
||||||
// After the overall catch rate check, the game does 4 shake checks before confirming the catch.
|
// After the overall catch rate check, the game does 3 shake checks before confirming the catch.
|
||||||
let shakeCount = 0;
|
let shakeCount = 0;
|
||||||
const pbX = this.pokeball.x;
|
const pbX = this.pokeball.x;
|
||||||
const shakeCounter = this.scene.tweens.addCounter({
|
const shakeCounter = this.scene.tweens.addCounter({
|
||||||
from: 0,
|
from: 0,
|
||||||
to: 1,
|
to: 1,
|
||||||
repeat: isCritical ? 2 : 4, // Critical captures only perform 2 shake checks
|
repeat: isCritical ? 2 : 4, // Critical captures only perform 1 shake check
|
||||||
yoyo: true,
|
yoyo: true,
|
||||||
ease: "Cubic.easeOut",
|
ease: "Cubic.easeOut",
|
||||||
duration: 250,
|
duration: 250,
|
||||||
|
Loading…
Reference in New Issue
Block a user