Fixed ESLint issue + addressed OrangeRed review

This commit is contained in:
Frutescens 2024-07-02 14:54:31 -07:00
parent df74afe0de
commit c283877d7f

View File

@ -4890,7 +4890,11 @@ export class AttemptCapturePhase extends PokemonPhase {
});
}
},
onComplete: () => this.catch()
onComplete: () => {
this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex));
this.scene.gameData.setPokemonCaught(pokemon);
this.catch();
}
});
};
@ -4985,12 +4989,18 @@ export class AttemptCapturePhase extends PokemonPhase {
}
});
};
Promise.all([pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon)]).then(() => {
Promise.all([pokemon.hideInfo()]).then(() => {
if (this.scene.getParty().length === 6) {
const promptRelease = () => {
this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => {
this.scene.pokemonInfoContainer.makeRoomForConfirmUi();
this.scene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
this.scene.ui.setMode(Mode.CONFIRM, () => {
const newPokemon = this.scene.addPlayerPokemon(pokemon.species, pokemon.level, pokemon.abilityIndex, pokemon.formIndex, pokemon.gender, pokemon.shiny, pokemon.variant, pokemon.ivs, pokemon.nature, pokemon);
this.scene.ui.setMode(Mode.SUMMARY, newPokemon).then(() => {
this.catch();
return;
});
}, () => {
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => {
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
if (slotIndex < 6) {