[Refactor] Move enum BattleStyle into separated file (#1906)
* Move enum BattleStyle into separated file * Move enum BattleStyle into separated file * Move enum BattleStyle into separated file * Update battle-style.ts * Replace shift into switch
This commit is contained in:
parent
a85a2a9b8b
commit
c929bbd23a
|
@ -63,6 +63,7 @@ import { Abilities } from "./data/enums/abilities";
|
||||||
import ArenaFlyout from "./ui/arena-flyout";
|
import ArenaFlyout from "./ui/arena-flyout";
|
||||||
import { EaseType } from "./ui/enums/ease-type";
|
import { EaseType } from "./ui/enums/ease-type";
|
||||||
import { ExpNotification } from "./enums/exp-notification";
|
import { ExpNotification } from "./enums/exp-notification";
|
||||||
|
import { BattleStyle } from "./enums/battle-style";
|
||||||
|
|
||||||
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
||||||
|
|
||||||
|
@ -156,10 +157,10 @@ export default class BattleScene extends SceneBase {
|
||||||
public enableVibration: boolean = false;
|
public enableVibration: boolean = false;
|
||||||
/**
|
/**
|
||||||
* Determines the selected battle style.
|
* Determines the selected battle style.
|
||||||
* - 0 = 'Shift'
|
* - 0 = 'Switch'
|
||||||
* - 1 = 'Set' - The option to switch the active pokemon at the start of a battle will not display.
|
* - 1 = 'Set' - The option to switch the active pokemon at the start of a battle will not display.
|
||||||
*/
|
*/
|
||||||
public battleStyle: integer = 0;
|
public battleStyle: integer = BattleStyle.SWITCH;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines whether or not to show type effectiveness hints
|
* Defines whether or not to show type effectiveness hints
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/**
|
||||||
|
* Determines the selected battle style.
|
||||||
|
* - 'Switch' - The option to switch the active pokemon at the start of a battle will be displayed.
|
||||||
|
* - 'Set' - The option to switch the active pokemon at the start of a battle will not display.
|
||||||
|
*/
|
||||||
|
export enum BattleStyle {
|
||||||
|
SWITCH,
|
||||||
|
SET
|
||||||
|
}
|
|
@ -64,6 +64,7 @@ import { TextStyle, addTextObject } from "./ui/text";
|
||||||
import { Type } from "./data/type";
|
import { Type } from "./data/type";
|
||||||
import { BerryUsedEvent, EncounterPhaseEvent, MoveUsedEvent, TurnEndEvent, TurnInitEvent } from "./events/battle-scene";
|
import { BerryUsedEvent, EncounterPhaseEvent, MoveUsedEvent, TurnEndEvent, TurnInitEvent } from "./events/battle-scene";
|
||||||
import { ExpNotification } from "./enums/exp-notification";
|
import { ExpNotification } from "./enums/exp-notification";
|
||||||
|
import { BattleStyle } from "./enums/battle-style";
|
||||||
|
|
||||||
|
|
||||||
export class LoginPhase extends Phase {
|
export class LoginPhase extends Phase {
|
||||||
|
@ -1747,7 +1748,7 @@ export class CheckSwitchPhase extends BattlePhase {
|
||||||
|
|
||||||
const pokemon = this.scene.getPlayerField()[this.fieldIndex];
|
const pokemon = this.scene.getPlayerField()[this.fieldIndex];
|
||||||
|
|
||||||
if (this.scene.battleStyle === 1) {
|
if (this.scene.battleStyle === BattleStyle.SET) {
|
||||||
super.end();
|
super.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue