feat: add hide unimplemented moves setting
parent
aeeebcbf38
commit
f275701a5e
|
@ -93,6 +93,7 @@ export default class BattleScene extends SceneBase {
|
|||
public seVolume: number = 1;
|
||||
public gameSpeed: integer = 1;
|
||||
public damageNumbersMode: integer = 0;
|
||||
public hideUnimplementedMoves: boolean = true;
|
||||
public showLevelUpStats: boolean = true;
|
||||
public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1";
|
||||
public enableRetries: boolean = false;
|
||||
|
|
|
@ -99,6 +99,7 @@ export default class Move implements Localizable {
|
|||
private conditions: MoveCondition[];
|
||||
private flags: integer;
|
||||
private nameAppend: string;
|
||||
private implemented: boolean = true;
|
||||
|
||||
constructor(id: Moves, type: Type, category: MoveCategory, defaultMoveTarget: MoveTarget, power: integer, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) {
|
||||
this.id = id;
|
||||
|
@ -191,6 +192,10 @@ export default class Move implements Localizable {
|
|||
return false;
|
||||
}
|
||||
|
||||
isImplemented(): boolean {
|
||||
return this.implemented;
|
||||
}
|
||||
|
||||
isTypeImmune(type: Type): boolean {
|
||||
switch (type) {
|
||||
case Type.GRASS:
|
||||
|
@ -216,6 +221,7 @@ export default class Move implements Localizable {
|
|||
|
||||
unimplemented(): this {
|
||||
this.nameAppend += ' (N)';
|
||||
this.implemented = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1017,7 +1017,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
getLevelMoves(startingLevel?: integer, includeEvolutionMoves: boolean = false, simulateEvolutionChain: boolean = false): LevelMoves {
|
||||
const ret: LevelMoves = [];
|
||||
let ret: LevelMoves = [];
|
||||
let levelMoves: LevelMoves = [];
|
||||
if (!startingLevel)
|
||||
startingLevel = this.level;
|
||||
|
@ -1077,6 +1077,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.scene.hideUnimplementedMoves) {
|
||||
ret = ret.filter(([, move]) => allMoves[move].isImplemented())
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ export enum Setting {
|
|||
Sprite_Set = "SPRITE_SET",
|
||||
Move_Animations = "MOVE_ANIMATIONS",
|
||||
Show_Stats_on_Level_Up = "SHOW_LEVEL_UP_STATS",
|
||||
Hide_Unimplemented_Moves = "IGNORE_UNIMPLEMENTED_MOVES",
|
||||
EXP_Gains_Speed = "EXP_GAINS_SPEED",
|
||||
EXP_Party_Display = "EXP_PARTY_DISPLAY",
|
||||
HP_Bar_Speed = "HP_BAR_SPEED",
|
||||
|
@ -53,6 +54,7 @@ export const settingOptions: SettingOptions = {
|
|||
[Setting.Sprite_Set]: ['Consistent', 'Mixed Animated'],
|
||||
[Setting.Move_Animations]: ['Off', 'On'],
|
||||
[Setting.Show_Stats_on_Level_Up]: ['Off', 'On'],
|
||||
[Setting.Hide_Unimplemented_Moves]: ['Off', 'On'],
|
||||
[Setting.EXP_Gains_Speed]: ['Normal', 'Fast', 'Faster', 'Skip'],
|
||||
[Setting.EXP_Party_Display]: ['Normal', 'Level Up Notification', 'Skip'],
|
||||
[Setting.HP_Bar_Speed]: ['Normal', 'Fast', 'Faster', 'Instant'],
|
||||
|
@ -78,6 +80,7 @@ export const settingDefaults: SettingDefaults = {
|
|||
[Setting.Sprite_Set]: 0,
|
||||
[Setting.Move_Animations]: 1,
|
||||
[Setting.Show_Stats_on_Level_Up]: 1,
|
||||
[Setting.Hide_Unimplemented_Moves]: 0,
|
||||
[Setting.EXP_Gains_Speed]: 0,
|
||||
[Setting.EXP_Party_Display]: 0,
|
||||
[Setting.HP_Bar_Speed]: 0,
|
||||
|
@ -89,7 +92,7 @@ export const settingDefaults: SettingDefaults = {
|
|||
[Setting.Vibration]: 0
|
||||
};
|
||||
|
||||
export const reloadSettings: Setting[] = [Setting.UI_Theme, Setting.Language, Setting.Sprite_Set];
|
||||
export const reloadSettings: Setting[] = [Setting.UI_Theme, Setting.Hide_Unimplemented_Moves, Setting.Language, Setting.Sprite_Set];
|
||||
|
||||
export function setSetting(scene: BattleScene, setting: Setting, value: integer): boolean {
|
||||
switch (setting) {
|
||||
|
@ -134,6 +137,9 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
|
|||
case Setting.Show_Stats_on_Level_Up:
|
||||
scene.showLevelUpStats = settingOptions[setting][value] === 'On';
|
||||
break;
|
||||
case Setting.Hide_Unimplemented_Moves:
|
||||
scene.hideUnimplementedMoves = settingOptions[setting][value] === 'On'
|
||||
break;
|
||||
case Setting.EXP_Gains_Speed:
|
||||
scene.expGainsSpeed = value;
|
||||
break;
|
||||
|
|
|
@ -1597,6 +1597,10 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.scene.hideUnimplementedMoves) {
|
||||
this.speciesStarterMoves = this.speciesStarterMoves.filter(move => allMoves[move].isImplemented())
|
||||
}
|
||||
|
||||
const speciesMoveData = this.scene.gameData.starterData[species.speciesId].moveset;
|
||||
let moveData: StarterMoveset = speciesMoveData
|
||||
? Array.isArray(speciesMoveData)
|
||||
|
|
Loading…
Reference in New Issue