From 3c05eb267aa2f31a060891364411f6b8e2f778a3 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:47:38 -0800 Subject: [PATCH] Fix `getFormSpriteKey()` and `.concat()` usage Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com> --- src/battle-scene.ts | 4 ++-- src/battle.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 6075d944772..67b01fb8fdb 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2981,8 +2981,8 @@ export default class BattleScene extends SceneBase { */ getActiveKeys(): string[] { const keys: string[] = []; - const activePokemon: (PlayerPokemon | EnemyPokemon)[] = this.getParty(); - activePokemon.concat(this.getEnemyParty()); + let activePokemon: (PlayerPokemon | EnemyPokemon)[] = this.getParty(); + activePokemon = activePokemon.concat(this.getEnemyParty()); activePokemon.forEach((p) => { keys.push(p.getSpriteKey(true)); if (p instanceof PlayerPokemon) { diff --git a/src/battle.ts b/src/battle.ts index 12d02553ba1..0356772bb07 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -233,7 +233,7 @@ export default class Battle { const wildOpponents = scene.getEnemyParty(); for (const pokemon of wildOpponents) { if (this.battleSpec === BattleSpec.FINAL_BOSS) { - if (pokemon.species.getFormSpriteKey() === SpeciesFormKey.ETERNAMAX) { + if (pokemon.species.getFormSpriteKey(pokemon.formIndex) === SpeciesFormKey.ETERNAMAX) { return "battle_final"; } return "battle_final_encounter"; @@ -299,7 +299,7 @@ export default class Battle { return "battle_legendary_sinnoh"; case Species.DIALGA: case Species.PALKIA: - if (pokemon.species.getFormSpriteKey() === SpeciesFormKey.ORIGIN) { + if (pokemon.species.getFormSpriteKey(pokemon.formIndex) === SpeciesFormKey.ORIGIN) { return "battle_legendary_origin_forme"; } return "battle_legendary_dia_pal";