Added a message to indicate items were transferred to new Pokemon

This commit is contained in:
Jacob Knispel 2024-05-21 02:11:12 -05:00
parent 1a6d337aa5
commit b843d95ebc

View File

@ -4326,12 +4326,23 @@ export class AttemptCapturePhase extends PokemonPhase {
this.scene.ui.showText(`Your party is full.\nRelease a Pokémon to make room for ${pokemon.name}?`, null, () => { this.scene.ui.showText(`Your party is full.\nRelease a Pokémon to make room for ${pokemon.name}?`, null, () => {
this.scene.ui.setMode(Mode.CONFIRM, () => { this.scene.ui.setMode(Mode.CONFIRM, () => {
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (releasedPokemonSlotIndex: integer, _option: PartyOption) => { this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (releasedPokemonSlotIndex: integer, _option: PartyOption) => {
const releasedItems = releasedPokemonSlotIndex < 6 ? this.scene.getParty()[releasedPokemonSlotIndex].getTransferrableHeldItems() : []; const releasedPokemon = releasedPokemonSlotIndex < 6 ? this.scene.getParty()[releasedPokemonSlotIndex] : null;
const releasedItems = releasedPokemon?.getTransferrableHeldItems();
this.scene.ui.setMode(Mode.MESSAGE).then(() => { this.scene.ui.setMode(Mode.MESSAGE).then(() => {
if (releasedPokemonSlotIndex < 6) if (releasedPokemonSlotIndex < 6) {
addToParty(releasedItems); if (releasedItems != null && releasedItems.length > 0) {
else this.scene.ui.showText(`You transferred all items held by ${releasedPokemon.name} to ${pokemon.name}.`, null, () => {
addToParty(releasedItems);
}, 0, true);
}
else {
this.scene.ui.clearText();
addToParty();
}
}
else {
promptRelease(); promptRelease();
}
}); });
}); });
}, () => { }, () => {