Fix crash when encountering a shiny
This commit is contained in:
parent
d556f5aca1
commit
7cd45b30eb
|
@ -312,15 +312,6 @@ export class NextEncounterPhase extends EncounterPhase {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
end() {
|
||||
this.scene.getEnemyField().forEach((enemyPokemon, e) => {
|
||||
if (enemyPokemon.shiny)
|
||||
this.scene.unshiftPhase(new ShinySparklePhase(this.scene, BattlerIndex.ENEMY + e));
|
||||
});
|
||||
|
||||
super.end();
|
||||
}
|
||||
}
|
||||
|
||||
export class NewBiomeEncounterPhase extends NextEncounterPhase {
|
||||
|
@ -2342,7 +2333,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||
this.end();
|
||||
};
|
||||
const removePokemon = () => {
|
||||
this.scene.getPlayerField().forEach(playerPokemon => playerPokemon.removeTagsBySourceId(pokemon.id));
|
||||
this.scene.getPlayerField().filter(p => p.isActive()).forEach(playerPokemon => playerPokemon.removeTagsBySourceId(pokemon.id));
|
||||
pokemon.hp = 0;
|
||||
pokemon.trySetStatus(StatusEffect.FAINT);
|
||||
this.scene.clearEnemyModifiers();
|
||||
|
|
|
@ -167,7 +167,7 @@ export default class BattleScene extends Phaser.Scene {
|
|||
this.loadImage('overlay_exp', 'ui');
|
||||
this.loadImage('icon_owned', 'ui');
|
||||
this.loadImage('ability_bar', 'ui');
|
||||
this.loadImage('shiny', 'ui');
|
||||
this.loadImage('shiny_star', 'ui', 'shiny.png');
|
||||
|
||||
this.loadImage('party_bg', 'ui');
|
||||
this.loadImage('party_bg_double', 'ui');
|
||||
|
|
|
@ -663,7 +663,7 @@ class PartySlot extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
if (this.pokemon.shiny) {
|
||||
const shinyStar = this.scene.add.image(0, 0, 'shiny');
|
||||
const shinyStar = this.scene.add.image(0, 0, 'shiny_star');
|
||||
shinyStar.setOrigin(0, 0);
|
||||
shinyStar.setPositionRelative(slotLevelLabel, this.slotIndex >= battlerCount ? 35 : 67, this.slotIndex >= battlerCount ? -1 : -18);
|
||||
|
||||
|
|
Loading…
Reference in New Issue