This reverts commit 759e4d0288
.
This commit is contained in:
parent
10dd16fa1e
commit
160a5ce5aa
|
@ -4890,10 +4890,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onComplete: () => {
|
onComplete: () => this.catch()
|
||||||
this.scene.gameData.setPokemonCaught(pokemon);
|
|
||||||
this.catch();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4934,6 +4931,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||||
|
|
||||||
catch() {
|
catch() {
|
||||||
const pokemon = this.getPokemon() as EnemyPokemon;
|
const pokemon = this.getPokemon() as EnemyPokemon;
|
||||||
|
this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex));
|
||||||
|
|
||||||
const speciesForm = !pokemon.fusionSpecies ? pokemon.getSpeciesForm() : pokemon.getFusionSpeciesForm();
|
const speciesForm = !pokemon.fusionSpecies ? pokemon.getSpeciesForm() : pokemon.getFusionSpeciesForm();
|
||||||
|
|
||||||
|
@ -4959,7 +4957,6 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||||
|
|
||||||
this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => {
|
this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => {
|
||||||
const end = () => {
|
const end = () => {
|
||||||
this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex));
|
|
||||||
this.scene.pokemonInfoContainer.hide();
|
this.scene.pokemonInfoContainer.hide();
|
||||||
this.removePb();
|
this.removePb();
|
||||||
this.end();
|
this.end();
|
||||||
|
@ -4988,18 +4985,12 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Promise.all([pokemon.hideInfo()]).then(() => {
|
Promise.all([pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
||||||
if (this.scene.getParty().length === 6) {
|
if (this.scene.getParty().length === 6) {
|
||||||
const promptRelease = () => {
|
const promptRelease = () => {
|
||||||
this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => {
|
this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => {
|
||||||
this.scene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
|
this.scene.pokemonInfoContainer.makeRoomForConfirmUi();
|
||||||
this.scene.ui.setMode(Mode.CONFIRM, () => {
|
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.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => {
|
||||||
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
if (slotIndex < 6) {
|
if (slotIndex < 6) {
|
||||||
|
|
|
@ -20,45 +20,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
show(args: any[]): boolean {
|
show(args: any[]): boolean {
|
||||||
if (args.length === 3 && args[0].toString().includes("newPokemon")) {
|
if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) {
|
||||||
const config: OptionSelectConfig = {
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: i18next.t("partyUiHandler:SUMMARY"),
|
|
||||||
handler: () => {
|
|
||||||
args[0]();
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
label: i18next.t("menu:yes"),
|
|
||||||
handler: () => {
|
|
||||||
args[1]();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
label: i18next.t("menu:no"),
|
|
||||||
handler: () => {
|
|
||||||
args[2]();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
delay: args.length >= 7 && args[6] !== null ? args[6] as integer : 0
|
|
||||||
};
|
|
||||||
|
|
||||||
super.show([ config ]);
|
|
||||||
|
|
||||||
this.switchCheck = args.length >= 4 && args[3] !== null && args[3] as boolean;
|
|
||||||
|
|
||||||
const xOffset = (args.length >= 5 && args[4] !== null ? args[4] as number : 0);
|
|
||||||
const yOffset = (args.length >= 6 && args[5] !== null ? args[5] as number : 0);
|
|
||||||
|
|
||||||
this.optionSelectContainer.setPosition((this.scene.game.canvas.width / 6) - 1 + xOffset, -48 + yOffset);
|
|
||||||
|
|
||||||
this.setCursor(this.switchCheck ? this.switchCheckCursor : 0);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) {
|
|
||||||
const config: OptionSelectConfig = {
|
const config: OptionSelectConfig = {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
|
@ -92,6 +54,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,14 +364,13 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
makeRoomForConfirmUi(speedMultiplier: number = 1, fromCatch: boolean = false): Promise<void> {
|
makeRoomForConfirmUi(speedMultiplier: number = 1): Promise<void> {
|
||||||
const xPosition = fromCatch ? this.initialX - this.infoWindowWidth - 65 : this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth;
|
|
||||||
return new Promise<void>(resolve => {
|
return new Promise<void>(resolve => {
|
||||||
this.scene.tweens.add({
|
this.scene.tweens.add({
|
||||||
targets: this,
|
targets: this,
|
||||||
duration: Utils.fixedInt(Math.floor(150 / speedMultiplier)),
|
duration: Utils.fixedInt(Math.floor(150 / speedMultiplier)),
|
||||||
ease: "Cubic.easeInOut",
|
ease: "Cubic.easeInOut",
|
||||||
x: xPosition,
|
x: this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ export default class SummaryUiHandler extends UiHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
const fromPartyMode = ui.handlers[Mode.PARTY].active;
|
|
||||||
let success = false;
|
let success = false;
|
||||||
let error = false;
|
let error = false;
|
||||||
|
|
||||||
|
@ -485,13 +485,8 @@ export default class SummaryUiHandler extends UiHandler {
|
||||||
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
|
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
|
||||||
this.hideMoveSelect();
|
this.hideMoveSelect();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!fromPartyMode) {
|
|
||||||
ui.setMode(Mode.MESSAGE);
|
|
||||||
} else {
|
|
||||||
ui.setMode(Mode.PARTY);
|
ui.setMode(Mode.PARTY);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
success = true;
|
success = true;
|
||||||
} else {
|
} else {
|
||||||
const pages = Utils.getEnumValues(Page);
|
const pages = Utils.getEnumValues(Page);
|
||||||
|
@ -500,8 +495,6 @@ export default class SummaryUiHandler extends UiHandler {
|
||||||
case Button.DOWN:
|
case Button.DOWN:
|
||||||
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
|
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
|
||||||
break;
|
break;
|
||||||
} else if (!fromPartyMode) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
const isDown = button === Button.DOWN;
|
const isDown = button === Button.DOWN;
|
||||||
const party = this.scene.getParty();
|
const party = this.scene.getParty();
|
||||||
|
|
Loading…
Reference in New Issue