[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.
This commit is contained in:
SeafoamQueen 2024-06-06 11:26:04 -04:00 committed by GitHub
parent cb27fc2b06
commit 3fea384dc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View File

@ -145,6 +145,12 @@ export default class BattleScene extends SceneBase {
public fusionPaletteSwaps: boolean = true; public fusionPaletteSwaps: boolean = true;
public enableTouchControls: boolean = false; public enableTouchControls: boolean = false;
public enableVibration: 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; public disableMenu: boolean = false;

View File

@ -1667,6 +1667,11 @@ export class CheckSwitchPhase extends BattlePhase {
const pokemon = this.scene.getPlayerField()[this.fieldIndex]; const pokemon = this.scene.getPlayerField()[this.fieldIndex];
if (this.scene.battleStyle === 1) {
super.end();
return;
}
if (this.scene.field.getAll().indexOf(pokemon) === -1) { if (this.scene.field.getAll().indexOf(pokemon) === -1) {
this.scene.unshiftPhase(new SummonMissingPhase(this.scene, this.fieldIndex)); this.scene.unshiftPhase(new SummonMissingPhase(this.scene, this.fieldIndex));
super.end(); super.end();

View File

@ -42,6 +42,7 @@ export const SettingKeys = {
EXP_Gains_Speed: "EXP_GAINS_SPEED", EXP_Gains_Speed: "EXP_GAINS_SPEED",
EXP_Party_Display: "EXP_PARTY_DISPLAY", EXP_Party_Display: "EXP_PARTY_DISPLAY",
Skip_Seen_Dialogues: "SKIP_SEEN_DIALOGUES", Skip_Seen_Dialogues: "SKIP_SEEN_DIALOGUES",
Battle_Style: "BATTLE_STYLE",
Enable_Retries: "ENABLE_RETRIES", Enable_Retries: "ENABLE_RETRIES",
Tutorials: "TUTORIALS", Tutorials: "TUTORIALS",
Touch_Controls: "TOUCH_CONTROLS", Touch_Controls: "TOUCH_CONTROLS",
@ -107,6 +108,13 @@ export const Setting: Array<Setting> = [
default: 0, default: 0,
type: SettingType.GENERAL type: SettingType.GENERAL
}, },
{
key: SettingKeys.Battle_Style,
label: "Battle Style",
options: ["Switch", "Set"],
default: 0,
type: SettingType.GENERAL
},
{ {
key: SettingKeys.Enable_Retries, key: SettingKeys.Enable_Retries,
label: "Enable Retries", label: "Enable Retries",
@ -348,6 +356,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
case SettingKeys.Skip_Seen_Dialogues: case SettingKeys.Skip_Seen_Dialogues:
scene.skipSeenDialogues = Setting[index].options[value] === "On"; scene.skipSeenDialogues = Setting[index].options[value] === "On";
break; break;
case SettingKeys.Battle_Style:
scene.battleStyle = value;
break;
case SettingKeys.Candy_Upgrade_Notification: case SettingKeys.Candy_Upgrade_Notification:
if (scene.candyUpgradeNotification === value) { if (scene.candyUpgradeNotification === value) {
break; break;