diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 3f00a012ee3..6f2f293d099 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -1038,8 +1038,7 @@ export abstract class BattleAnim { let t = 0; for (const frame of frames) { - let x = frame.x; - let y = frame.y; + let { x , y } = frame; const scaleX = (frame.zoomX / 100) * (!frame.mirror ? 1 : -1); const scaleY = (frame.zoomY / 100); x += targetInitialX; diff --git a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts index 705ba3296a4..b99a7092902 100644 --- a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts +++ b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts @@ -36,7 +36,7 @@ const DAMAGE_PERCENTAGE: number = 20; export const FieryFalloutEncounter: IMysteryEncounter = MysteryEncounterBuilder.withEncounterType(MysteryEncounterType.FIERY_FALLOUT) .withEncounterTier(MysteryEncounterTier.COMMON) - .withSceneWaveRangeRequirement(40, 180) // waves 10 to 180 + .withSceneWaveRangeRequirement(40, 180) .withCatchAllowed(true) .withIntroSpriteConfigs([]) // Set in onInit() .withAnimations(EncounterAnim.MAGMA_BG, EncounterAnim.MAGMA_SPOUT) @@ -186,7 +186,8 @@ export const FieryFalloutEncounter: IMysteryEncounter = // Burn random member const burnable = nonFireTypes.filter(p => isNullOrUndefined(p.status) || isNullOrUndefined(p.status.effect) || p.status?.effect === StatusEffect.BURN); if (burnable?.length > 0) { - const chosenPokemon = burnable[randSeedInt(burnable.length - 1)]; + const roll = randSeedInt(burnable.length); + const chosenPokemon = burnable[roll]; if (chosenPokemon.trySetStatus(StatusEffect.BURN)) { // Burn applied encounter.setDialogueToken("burnedPokemon", chosenPokemon.name); diff --git a/src/test/utils/overridesHelper.ts b/src/test/utils/overridesHelper.ts index ff32f41e849..257ec523399 100644 --- a/src/test/utils/overridesHelper.ts +++ b/src/test/utils/overridesHelper.ts @@ -21,7 +21,7 @@ export class OverridesHelper { * @param percentage the encounter chance in % * @returns spy instance */ - mysteryEncounterChance(percentage: number): MockInstance { + mysteryEncounterChance(percentage: number) { const maxRate: number = 256; // 100% const rate = maxRate * (percentage / 100); const spy = vi.spyOn(Overrides, "MYSTERY_ENCOUNTER_RATE_OVERRIDE", "get").mockReturnValue(rate); @@ -66,7 +66,7 @@ export class OverridesHelper { * @param wave the wave (index) to set. Classic: `1`-`200` * @returns spy instance */ - startingWave(wave: number): MockInstance { + startingWave(wave: number) { const spy = vi.spyOn(Overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(wave); this.log(`Starting wave set to ${wave}!`); return spy; @@ -88,7 +88,7 @@ export class OverridesHelper { * @param type weather type to set * @returns spy instance */ - weather(type: WeatherType): MockInstance { + weather(type: WeatherType) { const spy = vi.spyOn(Overrides, "WEATHER_OVERRIDE", "get").mockReturnValue(type); this.log(`Weather set to ${Weather[type]} (=${type})!`); return spy; @@ -99,7 +99,7 @@ export class OverridesHelper { * @param seed the seed to set * @returns spy instance */ - seed(seed: string): MockInstance { + seed(seed: string) { const spy = vi.spyOn(this.game.scene, "resetSeed").mockImplementation(() => { this.game.scene.waveSeed = seed; Phaser.Math.RND.sow([seed]);