From 3fea384dc1e6742478fd5e1b13526eb86c93bd23 Mon Sep 17 00:00:00 2001 From: SeafoamQueen <167576411+SeafoamQueen@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:26:04 -0400 Subject: [PATCH] [Feature] Added Battle Style setting (#1872) * Added Battle Style setting with Shift and Set options * Changed 'Shift' option to 'Switch' to match the Gen 8 setting. --- src/battle-scene.ts | 6 ++++++ src/phases.ts | 5 +++++ src/system/settings/settings.ts | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 38882cf3e68..a873fab80b2 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -145,6 +145,12 @@ export default class BattleScene extends SceneBase { public fusionPaletteSwaps: boolean = true; public enableTouchControls: boolean = false; public enableVibration: boolean = false; + /** + * Determines the selected battle style. + * - 0 = 'Shift' + * - 1 = 'Set' - The option to switch the active pokemon at the start of a battle will not display. + */ + public battleStyle: integer = 0; public disableMenu: boolean = false; diff --git a/src/phases.ts b/src/phases.ts index 45acc79ca01..c43ab6e1c7f 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1667,6 +1667,11 @@ export class CheckSwitchPhase extends BattlePhase { const pokemon = this.scene.getPlayerField()[this.fieldIndex]; + if (this.scene.battleStyle === 1) { + super.end(); + return; + } + if (this.scene.field.getAll().indexOf(pokemon) === -1) { this.scene.unshiftPhase(new SummonMissingPhase(this.scene, this.fieldIndex)); super.end(); diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index 3cd578dbaf4..75fc8185c89 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -42,6 +42,7 @@ export const SettingKeys = { EXP_Gains_Speed: "EXP_GAINS_SPEED", EXP_Party_Display: "EXP_PARTY_DISPLAY", Skip_Seen_Dialogues: "SKIP_SEEN_DIALOGUES", + Battle_Style: "BATTLE_STYLE", Enable_Retries: "ENABLE_RETRIES", Tutorials: "TUTORIALS", Touch_Controls: "TOUCH_CONTROLS", @@ -107,6 +108,13 @@ export const Setting: Array = [ default: 0, type: SettingType.GENERAL }, + { + key: SettingKeys.Battle_Style, + label: "Battle Style", + options: ["Switch", "Set"], + default: 0, + type: SettingType.GENERAL + }, { key: SettingKeys.Enable_Retries, label: "Enable Retries", @@ -348,6 +356,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer): case SettingKeys.Skip_Seen_Dialogues: scene.skipSeenDialogues = Setting[index].options[value] === "On"; break; + case SettingKeys.Battle_Style: + scene.battleStyle = value; + break; case SettingKeys.Candy_Upgrade_Notification: if (scene.candyUpgradeNotification === value) { break;