mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 21:42:20 +02:00
Fixed lint issue; ran biome on entire repository
This commit is contained in:
parent
b1c50dd69f
commit
26d1d1b848
@ -2539,17 +2539,11 @@ export class AllyStatMultiplierAbAttr extends AbAttr {
|
||||
* @extends AbAttr
|
||||
*/
|
||||
export class ExecutedMoveAbAttr extends AbAttr {
|
||||
canApplyExecutedMove(
|
||||
_pokemon: Pokemon,
|
||||
_simulated: boolean,
|
||||
): boolean {
|
||||
canApplyExecutedMove(_pokemon: Pokemon, _simulated: boolean): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
applyExecutedMove(
|
||||
_pokemon: Pokemon,
|
||||
_simulated: boolean,
|
||||
): void {}
|
||||
applyExecutedMove(_pokemon: Pokemon, _simulated: boolean): void {}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2557,7 +2551,7 @@ export class ExecutedMoveAbAttr extends AbAttr {
|
||||
* @extends ExecutedMoveAbAttr
|
||||
*/
|
||||
export class GorillaTacticsAbAttr extends ExecutedMoveAbAttr {
|
||||
constructor(showAbility: boolean = false) {
|
||||
constructor(showAbility = false) {
|
||||
super(showAbility);
|
||||
}
|
||||
|
||||
@ -7785,7 +7779,7 @@ export function applyPreAttackAbAttrs(
|
||||
export function applyExecutedMoveAbAttrs(
|
||||
attrType: Constructor<ExecutedMoveAbAttr>,
|
||||
pokemon: Pokemon,
|
||||
simulated: boolean = false,
|
||||
simulated = false,
|
||||
...args: any[]
|
||||
): void {
|
||||
applyAbAttrsInternal<ExecutedMoveAbAttr>(
|
||||
|
@ -147,16 +147,6 @@ export interface TerrainBattlerTag {
|
||||
* Players and enemies should not be allowed to select restricted moves.
|
||||
*/
|
||||
export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
||||
constructor(
|
||||
tagType: BattlerTagType,
|
||||
lapseType: BattlerTagLapseType | BattlerTagLapseType[],
|
||||
turnCount: number,
|
||||
sourceMove?: MoveId,
|
||||
sourceId?: number,
|
||||
) {
|
||||
super(tagType, lapseType, turnCount, sourceMove, sourceId);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||
if (lapseType === BattlerTagLapseType.PRE_MOVE) {
|
||||
@ -1492,16 +1482,6 @@ export class WrapTag extends DamagingTrapTag {
|
||||
}
|
||||
|
||||
export abstract class VortexTrapTag extends DamagingTrapTag {
|
||||
constructor(
|
||||
tagType: BattlerTagType,
|
||||
commonAnim: CommonAnim,
|
||||
turnCount: number,
|
||||
sourceMove: MoveId,
|
||||
sourceId: number,
|
||||
) {
|
||||
super(tagType, commonAnim, turnCount, sourceMove, sourceId);
|
||||
}
|
||||
|
||||
getTrapMessage(pokemon: Pokemon): string {
|
||||
return i18next.t("battlerTags:vortexOnTrap", {
|
||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||
|
@ -261,7 +261,7 @@ export class Arena {
|
||||
return 5;
|
||||
}
|
||||
break;
|
||||
case SpeciesId.LYCANROC:
|
||||
case SpeciesId.LYCANROC: {
|
||||
const timeOfDay = this.getTimeOfDay();
|
||||
switch (timeOfDay) {
|
||||
case TimeOfDay.DAY:
|
||||
@ -273,6 +273,7 @@ export class Arena {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -149,7 +149,7 @@ export class CommandPhase extends FieldPhase {
|
||||
|
||||
switch (command) {
|
||||
case Command.TERA:
|
||||
case Command.FIGHT:
|
||||
case Command.FIGHT: {
|
||||
let useStruggle = false;
|
||||
const turnMove: TurnMove | undefined = args.length === 2 ? (args[1] as TurnMove) : undefined;
|
||||
if (
|
||||
@ -233,7 +233,8 @@ export class CommandPhase extends FieldPhase {
|
||||
);
|
||||
}
|
||||
break;
|
||||
case Command.BALL:
|
||||
}
|
||||
case Command.BALL: {
|
||||
const notInDex =
|
||||
globalScene
|
||||
.getEnemyField()
|
||||
@ -337,8 +338,9 @@ export class CommandPhase extends FieldPhase {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Command.POKEMON:
|
||||
case Command.RUN:
|
||||
case Command.RUN: {
|
||||
const isSwitch = command === Command.POKEMON;
|
||||
const { currentBattle, arena } = globalScene;
|
||||
const mysteryEncounterFleeAllowed = currentBattle.mysteryEncounter?.fleeAllowed;
|
||||
@ -445,6 +447,7 @@ export class CommandPhase extends FieldPhase {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
|
@ -1,10 +1,6 @@
|
||||
let manifest: object;
|
||||
|
||||
export default class CacheBustedLoaderPlugin extends Phaser.Loader.LoaderPlugin {
|
||||
constructor(scene: Phaser.Scene) {
|
||||
super(scene);
|
||||
}
|
||||
|
||||
get manifest() {
|
||||
return manifest;
|
||||
}
|
||||
|
@ -174,7 +174,24 @@ export async function initI18n(): Promise<void> {
|
||||
"es-MX": ["es-ES", "en"],
|
||||
default: ["en"],
|
||||
},
|
||||
supportedLngs: ["en", "es-ES", "es-MX", "fr", "it", "de", "zh-CN", "zh-TW", "pt-BR", "ko", "ja", "ca", "da", "tr", "ro", "ru"],
|
||||
supportedLngs: [
|
||||
"en",
|
||||
"es-ES",
|
||||
"es-MX",
|
||||
"fr",
|
||||
"it",
|
||||
"de",
|
||||
"zh-CN",
|
||||
"zh-TW",
|
||||
"pt-BR",
|
||||
"ko",
|
||||
"ja",
|
||||
"ca",
|
||||
"da",
|
||||
"tr",
|
||||
"ro",
|
||||
"ru",
|
||||
],
|
||||
backend: {
|
||||
loadPath(lng: string, [ns]: string[]) {
|
||||
let fileName: string;
|
||||
|
@ -32,7 +32,10 @@ const pressAction = i18next.t("settings:pressActionToAssign");
|
||||
|
||||
export const settingGamepadOptions = {
|
||||
[SettingGamepad.Controller]: [i18next.t("settings:controllerDefault"), i18next.t("settings:controllerChange")],
|
||||
[SettingGamepad.Gamepad_Support]: [i18next.t("settings:gamepadSupportAuto"), i18next.t("settings:gamepadSupportDisabled")],
|
||||
[SettingGamepad.Gamepad_Support]: [
|
||||
i18next.t("settings:gamepadSupportAuto"),
|
||||
i18next.t("settings:gamepadSupportDisabled"),
|
||||
],
|
||||
[SettingGamepad.Button_Up]: [`KEY ${Button.UP.toString()}`, pressAction],
|
||||
[SettingGamepad.Button_Down]: [`KEY ${Button.DOWN.toString()}`, pressAction],
|
||||
[SettingGamepad.Button_Left]: [`KEY ${Button.LEFT.toString()}`, pressAction],
|
||||
|
@ -959,7 +959,7 @@ export function setSetting(setting: string, value: number): boolean {
|
||||
},
|
||||
{
|
||||
label: "Türkçe (Needs Help)",
|
||||
handler: () => changeLocaleHandler("tr")
|
||||
handler: () => changeLocaleHandler("tr"),
|
||||
},
|
||||
{
|
||||
label: "Русский (Needs Help)",
|
||||
@ -967,11 +967,11 @@ export function setSetting(setting: string, value: number): boolean {
|
||||
},
|
||||
{
|
||||
label: "Dansk (Needs Help)",
|
||||
handler: () => changeLocaleHandler("da")
|
||||
handler: () => changeLocaleHandler("da"),
|
||||
},
|
||||
{
|
||||
label: "Română (Needs Help)",
|
||||
handler: () => changeLocaleHandler("ro")
|
||||
handler: () => changeLocaleHandler("ro"),
|
||||
},
|
||||
{
|
||||
label: i18next.t("settings:back"),
|
||||
|
@ -56,10 +56,6 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler {
|
||||
protected defaultTextStyle: TextStyle = TextStyle.WINDOW;
|
||||
protected textContent: string;
|
||||
|
||||
constructor(mode: UiMode | null) {
|
||||
super(mode);
|
||||
}
|
||||
|
||||
abstract getWindowWidth(): number;
|
||||
|
||||
getWindowHeight(): number {
|
||||
|
@ -69,7 +69,7 @@ export default class AdminUiHandler extends FormModalUiHandler {
|
||||
case AdminMode.SEARCH:
|
||||
inputFieldConfigs.push({ label: "Username" });
|
||||
break;
|
||||
case AdminMode.ADMIN:
|
||||
case AdminMode.ADMIN: {
|
||||
const adminResult = this.adminResult ?? {
|
||||
username: "",
|
||||
discordId: "",
|
||||
@ -90,6 +90,7 @@ export default class AdminUiHandler extends FormModalUiHandler {
|
||||
inputFieldConfigs.push({ label: "Last played", isReadOnly: true });
|
||||
inputFieldConfigs.push({ label: "Registered", isReadOnly: true });
|
||||
break;
|
||||
}
|
||||
}
|
||||
return inputFieldConfigs;
|
||||
}
|
||||
|
@ -169,12 +169,13 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
||||
entryContainer.add(scoreLabel);
|
||||
|
||||
switch (this.category) {
|
||||
case ScoreboardCategory.DAILY:
|
||||
case ScoreboardCategory.DAILY: {
|
||||
const waveLabel = addTextObject(68, 0, wave, TextStyle.WINDOW, {
|
||||
fontSize: "54px",
|
||||
});
|
||||
entryContainer.add(waveLabel);
|
||||
break;
|
||||
}
|
||||
case ScoreboardCategory.WEEKLY:
|
||||
scoreLabel.x -= 16;
|
||||
break;
|
||||
|
@ -131,7 +131,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
gachaInfoContainer.add(gachaUpLabel);
|
||||
|
||||
switch (gachaType as GachaType) {
|
||||
case GachaType.LEGENDARY:
|
||||
case GachaType.LEGENDARY: {
|
||||
if (["de", "es-ES"].includes(currentLanguage)) {
|
||||
gachaUpLabel.setAlign("center");
|
||||
gachaUpLabel.setY(0);
|
||||
@ -152,6 +152,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
|
||||
gachaInfoContainer.add(pokemonIcon);
|
||||
break;
|
||||
}
|
||||
case GachaType.MOVE:
|
||||
if (["de", "es-ES", "fr", "pt-BR", "ru"].includes(currentLanguage)) {
|
||||
gachaUpLabel.setAlign("center");
|
||||
@ -623,11 +624,12 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
updateGachaInfo(gachaType: GachaType): void {
|
||||
const infoContainer = this.gachaInfoContainers[gachaType];
|
||||
switch (gachaType as GachaType) {
|
||||
case GachaType.LEGENDARY:
|
||||
case GachaType.LEGENDARY: {
|
||||
const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(new Date().getTime()));
|
||||
const pokemonIcon = infoContainer.getAt(1) as Phaser.GameObjects.Sprite;
|
||||
pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
||||
error = true;
|
||||
}
|
||||
break;
|
||||
case MenuOptions.LOG_OUT:
|
||||
case MenuOptions.LOG_OUT: {
|
||||
success = true;
|
||||
const doLogout = () => {
|
||||
ui.setMode(UiMode.LOADING, {
|
||||
@ -718,6 +718,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
||||
doLogout();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (button === Button.CANCEL) {
|
||||
success = true;
|
||||
|
@ -1388,7 +1388,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
case PartyOption.MOVE_1:
|
||||
case PartyOption.MOVE_2:
|
||||
case PartyOption.MOVE_3:
|
||||
case PartyOption.MOVE_4:
|
||||
case PartyOption.MOVE_4: {
|
||||
const move = pokemon.moveset[option - PartyOption.MOVE_1];
|
||||
if (this.showMovePp) {
|
||||
const maxPP = move.getMovePp();
|
||||
@ -1398,7 +1398,8 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
optionName = move.getName();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon);
|
||||
if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) {
|
||||
const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM];
|
||||
@ -1413,6 +1414,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (this.partyUiMode === PartyUiMode.REMEMBER_MOVE_MODIFIER) {
|
||||
const learnableLevelMoves = pokemon.getLearnableLevelMoves();
|
||||
|
@ -567,7 +567,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
case GameModes.SPLICED_ENDLESS:
|
||||
modeText.appendText(`${i18next.t("gameMode:endlessSpliced")}`, false);
|
||||
break;
|
||||
case GameModes.CHALLENGE:
|
||||
case GameModes.CHALLENGE: {
|
||||
modeText.appendText(`${i18next.t("gameMode:challenge")}`, false);
|
||||
modeText.appendText(`${i18next.t("runHistory:challengeRules")}: `);
|
||||
modeText.setWrapMode(1); // wrap by word
|
||||
@ -582,6 +582,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GameModes.ENDLESS:
|
||||
modeText.appendText(`${i18next.t("gameMode:endless")}`, false);
|
||||
break;
|
||||
@ -687,7 +688,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
case Challenges.SINGLE_GENERATION:
|
||||
rules.push(i18next.t(`runHistory:challengeMonoGen${this.runInfo.challenges[i].value}`));
|
||||
break;
|
||||
case Challenges.SINGLE_TYPE:
|
||||
case Challenges.SINGLE_TYPE: {
|
||||
const typeRule = PokemonType[this.runInfo.challenges[i].value - 1];
|
||||
const typeTextColor = `[color=${TypeColor[typeRule]}]`;
|
||||
const typeShadowColor = `[shadow=${TypeShadow[typeRule]}]`;
|
||||
@ -695,16 +696,18 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
typeTextColor + typeShadowColor + i18next.t(`pokemonInfo:Type.${typeRule}`)! + "[/color]" + "[/shadow]";
|
||||
rules.push(typeText);
|
||||
break;
|
||||
}
|
||||
case Challenges.INVERSE_BATTLE:
|
||||
rules.push(i18next.t("challenges:inverseBattle.shortName"));
|
||||
break;
|
||||
default:
|
||||
default: {
|
||||
const localisationKey = Challenges[this.runInfo.challenges[i].id]
|
||||
.split("_")
|
||||
.map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()))
|
||||
.join("");
|
||||
rules.push(i18next.t(`challenges:${localisationKey}.name`));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -332,12 +332,13 @@ export default class AbstractSettingsUiHandler extends MessageUiHandler {
|
||||
case Button.CYCLE_SHINY:
|
||||
success = this.navigationContainer.navigate(button);
|
||||
break;
|
||||
case Button.ACTION:
|
||||
case Button.ACTION: {
|
||||
const setting: Setting = this.settings[cursor];
|
||||
if (setting?.activatable) {
|
||||
success = this.activateSetting(setting);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1759,7 +1759,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
}
|
||||
} else if (this.randomCursorObj.visible) {
|
||||
switch (button) {
|
||||
case Button.ACTION:
|
||||
case Button.ACTION: {
|
||||
if (this.starterSpecies.length >= 6) {
|
||||
error = true;
|
||||
break;
|
||||
@ -1811,6 +1811,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
case Button.UP:
|
||||
this.randomCursorObj.setVisible(false);
|
||||
this.filterBarCursor = this.filterBar.numFilters - 1;
|
||||
|
@ -10,10 +10,6 @@ import { UiMode } from "#enums/ui-mode";
|
||||
export default class TestDialogueUiHandler extends FormModalUiHandler {
|
||||
keys: string[];
|
||||
|
||||
constructor(mode) {
|
||||
super(mode);
|
||||
}
|
||||
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user