Revert "added Done button in pokemon selection menu and choosing which pokemon to replace"

This reverts commit ff562af446.
This commit is contained in:
Greenlamp 2024-05-06 21:19:22 +02:00
parent f2139bb99a
commit 90f0d7e72e
2 changed files with 14 additions and 89 deletions

View File

@ -1936,10 +1936,8 @@ export class SelectTargetPhase extends PokemonPhase {
if (cursor === -1) { if (cursor === -1) {
this.scene.currentBattle.turnCommands[this.fieldIndex] = null; this.scene.currentBattle.turnCommands[this.fieldIndex] = null;
this.scene.unshiftPhase(new CommandPhase(this.scene, this.fieldIndex)); this.scene.unshiftPhase(new CommandPhase(this.scene, this.fieldIndex));
} else { } else
turnCommand.targets = [cursor]; turnCommand.targets = [ cursor ];
this.scene.hasFreeSwitch = false;
}
if (turnCommand.command === Command.BALL && this.fieldIndex) if (turnCommand.command === Command.BALL && this.fieldIndex)
this.scene.currentBattle.turnCommands[this.fieldIndex - 1].skip = true; this.scene.currentBattle.turnCommands[this.fieldIndex - 1].skip = true;
this.end(); this.end();

View File

@ -36,8 +36,6 @@ export enum PartyUiMode {
export enum PartyOption { export enum PartyOption {
CANCEL = -1, CANCEL = -1,
SEND_OUT, SEND_OUT,
SEND_OUT_1,
SEND_OUT_2,
PASS_BATON, PASS_BATON,
APPLY, APPLY,
TEACH, TEACH,
@ -53,7 +51,7 @@ export enum PartyOption {
MOVE_1 = 3000, MOVE_1 = 3000,
MOVE_2, MOVE_2,
MOVE_3, MOVE_3,
MOVE_4, MOVE_4
} }
export type PartySelectCallback = (cursor: integer, option: PartyOption) => void; export type PartySelectCallback = (cursor: integer, option: PartyOption) => void;
@ -72,7 +70,6 @@ export default class PartyUiHandler extends MessageUiHandler {
private partySlotsContainer: Phaser.GameObjects.Container; private partySlotsContainer: Phaser.GameObjects.Container;
private partySlots: PartySlot[]; private partySlots: PartySlot[];
private partyCancelButton: PartyCancelButton; private partyCancelButton: PartyCancelButton;
private partyDoneButton: PartyDoneButton;
private partyMessageBox: Phaser.GameObjects.NineSlice; private partyMessageBox: Phaser.GameObjects.NineSlice;
private optionsMode: boolean; private optionsMode: boolean;
@ -156,13 +153,10 @@ export default class PartyUiHandler extends MessageUiHandler {
this.message = partyMessageText; this.message = partyMessageText;
const partyCancelButton = new PartyCancelButton(this.scene, 291, -9); const partyCancelButton = new PartyCancelButton(this.scene, 291, -16);
const partyDoneButton = new PartyDoneButton(this.scene, 291, -26);
partyContainer.add(partyCancelButton); partyContainer.add(partyCancelButton);
partyContainer.add(partyDoneButton);
this.partyCancelButton = partyCancelButton; this.partyCancelButton = partyCancelButton;
this.partyDoneButton = partyDoneButton;
this.optionsContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -1); this.optionsContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -1);
partyContainer.add(this.optionsContainer); partyContainer.add(this.optionsContainer);
@ -369,9 +363,7 @@ export default class PartyUiHandler extends MessageUiHandler {
ui.playSelect(); ui.playSelect();
} else if (this.partyUiMode === PartyUiMode.FAINT_SWITCH) } else if (this.partyUiMode === PartyUiMode.FAINT_SWITCH)
ui.playError(); ui.playError();
else if (this.cursor === 6) { else
console.log('DONE');
} else
return this.processInput(Button.CANCEL); return this.processInput(Button.CANCEL);
return true; return true;
} else if (button === Button.CANCEL) { } else if (button === Button.CANCEL) {
@ -398,27 +390,26 @@ export default class PartyUiHandler extends MessageUiHandler {
switch (button) { switch (button) {
case Button.UP: case Button.UP:
if (this.cursor === 7) success = this.setCursor(6); success = this.setCursor(this.cursor ? this.cursor < 6 ? this.cursor - 1 : slotCount - 1 : 6);
else success = this.setCursor(this.cursor ? this.cursor < 6 ? this.cursor - 1 : slotCount - 1 : 7);
break; break;
case Button.DOWN: case Button.DOWN:
if (this.cursor === 6) success = this.setCursor(7); success = this.setCursor(this.cursor < 6 ? this.cursor < slotCount - 1 ? this.cursor + 1 : 6 : 0);
else success = this.setCursor(this.cursor < 6 ? this.cursor < slotCount - 1 ? this.cursor + 1 : 6 : 0);
break; break;
case Button.LEFT: case Button.LEFT:
if (this.cursor >= battlerCount && this.cursor <= 7) if (this.cursor >= battlerCount && this.cursor <= 6)
success = this.setCursor(0); success = this.setCursor(0);
break; break;
case Button.RIGHT: case Button.RIGHT:
if (slotCount === battlerCount){ if (slotCount === battlerCount){
success = this.setCursor(6); success = this.setCursor(6);
break; break;
} else if (battlerCount >= 2 && slotCount > battlerCount && this.getCursor() === 0 && this.lastCursor === 1){ } else if (battlerCount >= 2 && slotCount > battlerCount && this.getCursor() === 0 && this.lastCursor === 1){
success = this.setCursor(2); success = this.setCursor(2);
break; break;
} else if (slotCount > battlerCount && this.cursor < battlerCount) } else if (slotCount > battlerCount && this.cursor < battlerCount){
success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount); success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount);
break; break;
}
} }
} }
@ -434,8 +425,6 @@ export default class PartyUiHandler extends MessageUiHandler {
if (this.cursor < 6 && this.cursor >= party.length) if (this.cursor < 6 && this.cursor >= party.length)
this.cursor = party.length - 1; this.cursor = party.length - 1;
else if (this.cursor === 6) else if (this.cursor === 6)
this.partyDoneButton.select();
else if (this.cursor === 7)
this.partyCancelButton.select(); this.partyCancelButton.select();
for (let p in party) { for (let p in party) {
@ -493,24 +482,12 @@ export default class PartyUiHandler extends MessageUiHandler {
this.cursor = cursor; this.cursor = cursor;
if (this.lastCursor < 6) if (this.lastCursor < 6)
this.partySlots[this.lastCursor].deselect(); this.partySlots[this.lastCursor].deselect();
else if (this.lastCursor === 6){ else if (this.lastCursor === 6)
this.partyCancelButton.deselect(); this.partyCancelButton.deselect();
} else if (this.lastCursor === 7){ if (cursor < 6)
this.partyDoneButton.deselect();
}
if (cursor < 6) {
this.partySlots[cursor].select(); this.partySlots[cursor].select();
this.partyCancelButton.deselect(); else if (cursor === 6)
this.partyDoneButton.deselect();
}
else if (cursor === 6){
this.partyCancelButton.deselect();
this.partyDoneButton.select();
}
else if (cursor === 7) {
this.partyDoneButton.deselect();
this.partyCancelButton.select(); this.partyCancelButton.select();
}
} }
} }
@ -590,8 +567,6 @@ export default class PartyUiHandler extends MessageUiHandler {
case PartyUiMode.POST_BATTLE_SWITCH: case PartyUiMode.POST_BATTLE_SWITCH:
if (this.cursor >= this.scene.currentBattle.getBattlerCount()) { if (this.cursor >= this.scene.currentBattle.getBattlerCount()) {
this.options.push(PartyOption.SEND_OUT); this.options.push(PartyOption.SEND_OUT);
this.options.push(PartyOption.SEND_OUT_1);
this.options.push(PartyOption.SEND_OUT_2);
if (this.partyUiMode !== PartyUiMode.FAINT_SWITCH if (this.partyUiMode !== PartyUiMode.FAINT_SWITCH
&& this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier && this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier
&& (m as SwitchEffectTransferModifier).pokemonId === this.scene.getPlayerField()[this.fieldIndex].id)) && (m as SwitchEffectTransferModifier).pokemonId === this.scene.getPlayerField()[this.fieldIndex].id))
@ -1083,52 +1058,4 @@ class PartyCancelButton extends Phaser.GameObjects.Container {
this.partyCancelBg.setFrame('party_cancel'); this.partyCancelBg.setFrame('party_cancel');
this.partyCancelPb.setFrame('party_pb'); this.partyCancelPb.setFrame('party_pb');
} }
}
class PartyDoneButton extends Phaser.GameObjects.Container {
private selected: boolean;
private partyDoneBg: Phaser.GameObjects.Sprite;
private partyDonePb: Phaser.GameObjects.Sprite;
constructor(scene: BattleScene, x: number, y: number) {
super(scene, x, y);
this.setup();
}
setup() {
const partyDoneBg = this.scene.add.sprite(0, 0, 'party_cancel');
this.add(partyDoneBg);
this.partyDoneBg = partyDoneBg;
const partyDonePb = this.scene.add.sprite(-17, 0, 'party_pb');
this.add(partyDonePb);
this.partyDonePb = partyDonePb;
const partyCancelText = addTextObject(this.scene, -7, -6, 'Done', TextStyle.PARTY);
this.add(partyCancelText);
}
select() {
if (this.selected)
return;
this.selected = true;
this.partyDoneBg.setFrame(`party_cancel_sel`);
this.partyDonePb.setFrame('party_pb_sel');
}
deselect() {
if (!this.selected)
return;
this.selected = false;
this.partyDoneBg.setFrame('party_cancel');
this.partyDonePb.setFrame('party_pb');
}
} }