diff --git a/src/phases.ts b/src/phases.ts index d4b6657f0f4..5e46133ed48 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1788,7 +1788,7 @@ export class CommandPhase extends FieldPhase { if (!batonPass) enemyField.forEach(enemyPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trapped)); if (batonPass || (!trapTag && !trapped.value)) { - this.scene.currentBattle.turnCommands[args[1]] = isSwitch + this.scene.currentBattle.turnCommands[this.fieldIndex] = isSwitch ? { command: Command.POKEMON, cursor: cursor, args: args } : { command: Command.RUN }; success = true; @@ -1955,14 +1955,10 @@ export class TurnStartPhase extends FieldPhase { start() { super.start(); - const field = this.scene.getField(); const order = this.getOrder(); - const moveOrder = order.slice(0); - console.log('field', field); - console.log('moveOrder', moveOrder); - // if (this.scene.currentBattle.turn === 1 && field.) + const moveOrder = order.slice(0); moveOrder.sort((a, b) => { const aCommand = this.scene.currentBattle.turnCommands[a]; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index e0c16fc0b67..dc57dd9e7a1 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -95,7 +95,6 @@ export default class PartyUiHandler extends MessageUiHandler { private moveSelectFilter: PokemonMoveSelectFilter; private tmMoveId: Moves; private showMovePp: boolean; - private slots: Map = new Map(); private iconAnimHandler: PokemonIconAnimHandler; @@ -292,11 +291,8 @@ export default class PartyUiHandler extends MessageUiHandler { this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeItemTrigger, false, true); break; } - } else if (this.cursor) { - this.doSwitch(this.cursor, option); - // (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, this.cursor, option === PartyOption.PASS_BATON, option); - } - + } else if (this.cursor) + (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, this.cursor, option === PartyOption.PASS_BATON); } if (this.partyUiMode !== PartyUiMode.MODIFIER && this.partyUiMode !== PartyUiMode.TM_MODIFIER && this.partyUiMode !== PartyUiMode.MOVE_MODIFIER) ui.playSelect(); @@ -374,11 +370,7 @@ export default class PartyUiHandler extends MessageUiHandler { } else if (this.partyUiMode === PartyUiMode.FAINT_SWITCH) ui.playError(); else if (this.cursor === 6) { - console.log('done'); - if (this.slots[PartyOption.SEND_OUT_1]) - (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, this.slots[PartyOption.SEND_OUT_1], false, PartyOption.SEND_OUT_1); - if (this.slots[PartyOption.SEND_OUT_2]) - (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, this.slots[PartyOption.SEND_OUT_2], false, PartyOption.SEND_OUT_2); + console.log('DONE'); } else return this.processInput(Button.CANCEL); return true; @@ -541,7 +533,7 @@ export default class PartyUiHandler extends MessageUiHandler { } showOptions() { - if (this.cursor === 6 || this.cursor === 7) + if (this.cursor === 6) return; this.optionsMode = true; @@ -760,11 +752,6 @@ export default class PartyUiHandler extends MessageUiHandler { this.partySlots[this.transferCursor].setTransfer(false); } - doSwitch(slotIndex: integer, target: integer): void { - if (target !== PartyOption.SEND_OUT_1 && target !== PartyOption.SEND_OUT_2) return; - this.slots[target] = slotIndex; - } - doRelease(slotIndex: integer): void { this.showText(this.getReleaseMessage(this.scene.getParty()[slotIndex].name), null, () => { this.clearPartySlots();