mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
[Misc] Run biome on all files; update some rules to be errors now
https://github.com/pagefaultgames/pokerogue/pull/5962/ * Fixed lint issue; ran biome on entire repository * Fixed biome.jsonc * Trimmed trailing whitespace... again... * Fixed PR template md * Fixed package json * Fixed void return issues + ran biome again * ran biome
This commit is contained in:
parent
9a525ac8fd
commit
a41de39d4f
@ -218,7 +218,7 @@ module.exports = {
|
|||||||
module systems it knows of. It's the default because it's the safe option
|
module systems it knows of. It's the default because it's the safe option
|
||||||
It might come at a performance penalty, though.
|
It might come at a performance penalty, though.
|
||||||
moduleSystems: ['amd', 'cjs', 'es6', 'tsd']
|
moduleSystems: ['amd', 'cjs', 'es6', 'tsd']
|
||||||
|
|
||||||
As in practice only commonjs ('cjs') and ecmascript modules ('es6')
|
As in practice only commonjs ('cjs') and ecmascript modules ('es6')
|
||||||
are widely used, you can limit the moduleSystems to those.
|
are widely used, you can limit the moduleSystems to those.
|
||||||
*/
|
*/
|
||||||
@ -226,7 +226,7 @@ module.exports = {
|
|||||||
// moduleSystems: ['cjs', 'es6'],
|
// moduleSystems: ['cjs', 'es6'],
|
||||||
|
|
||||||
/* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/main/'
|
/* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/main/'
|
||||||
to open it on your online repo or `vscode://file/${process.cwd()}/` to
|
to open it on your online repo or `vscode://file/${process.cwd()}/` to
|
||||||
open it in visual studio code),
|
open it in visual studio code),
|
||||||
*/
|
*/
|
||||||
// prefix: `vscode://file/${process.cwd()}/`,
|
// prefix: `vscode://file/${process.cwd()}/`,
|
||||||
@ -271,7 +271,7 @@ module.exports = {
|
|||||||
to './webpack.conf.js'.
|
to './webpack.conf.js'.
|
||||||
|
|
||||||
The (optional) `env` and `arguments` attributes contain the parameters
|
The (optional) `env` and `arguments` attributes contain the parameters
|
||||||
to be passed if your webpack config is a function and takes them (see
|
to be passed if your webpack config is a function and takes them (see
|
||||||
webpack documentation for details)
|
webpack documentation for details)
|
||||||
*/
|
*/
|
||||||
// webpackConfig: {
|
// webpackConfig: {
|
||||||
@ -322,8 +322,8 @@ module.exports = {
|
|||||||
A list of alias fields in package.jsons
|
A list of alias fields in package.jsons
|
||||||
See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and
|
See [this specification](https://github.com/defunctzombie/package-browser-field-spec) and
|
||||||
the webpack [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields)
|
the webpack [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealiasfields)
|
||||||
documentation
|
documentation
|
||||||
|
|
||||||
Defaults to an empty array (= don't use alias fields).
|
Defaults to an empty array (= don't use alias fields).
|
||||||
*/
|
*/
|
||||||
// aliasFields: ["browser"],
|
// aliasFields: ["browser"],
|
||||||
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
# Art Team
|
# Art Team
|
||||||
/public/**/*.png @pagefaultgames/art-team
|
/public/**/*.png @pagefaultgames/art-team
|
||||||
/public/**/*.json @pagefaultgames/art-team
|
/public/**/*.json @pagefaultgames/art-team
|
||||||
/public/images @pagefaultgames/art-team
|
/public/images @pagefaultgames/art-team
|
||||||
/public/battle-anims @pagefaultgames/art-team
|
/public/battle-anims @pagefaultgames/art-team
|
||||||
|
|
||||||
|
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
|||||||
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
||||||
- name: Deploy build on server
|
- name: Deploy build on server
|
||||||
if: github.event_name == 'push' && github.ref_name == 'main'
|
if: github.event_name == 'push' && github.ref_name == 'main'
|
||||||
run: |
|
run: |
|
||||||
rsync --del --no-times --checksum -vrm dist/* ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.DESTINATION_DIR }}
|
rsync --del --no-times --checksum -vrm dist/* ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.DESTINATION_DIR }}
|
||||||
ssh -t ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "~/prmanifest --inpath ${{ secrets.DESTINATION_DIR }} --outpath ${{ secrets.DESTINATION_DIR }}/manifest.json"
|
ssh -t ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "~/prmanifest --inpath ${{ secrets.DESTINATION_DIR }} --outpath ${{ secrets.DESTINATION_DIR }}/manifest.json"
|
||||||
- name: Purge Cloudflare Cache
|
- name: Purge Cloudflare Cache
|
||||||
|
2
.github/workflows/quality.yml
vendored
2
.github/workflows/quality.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Node.js dependencies # Step to install Node.js dependencies
|
- name: Install Node.js dependencies # Step to install Node.js dependencies
|
||||||
run: npm ci # Use 'npm ci' to install dependencies
|
run: npm ci # Use 'npm ci' to install dependencies
|
||||||
|
|
||||||
- name: eslint # Step to run linters
|
- name: eslint # Step to run linters
|
||||||
run: npm run eslint-ci
|
run: npm run eslint-ci
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@
|
|||||||
"correctness": {
|
"correctness": {
|
||||||
"noUndeclaredVariables": "off",
|
"noUndeclaredVariables": "off",
|
||||||
"noUnusedVariables": "error",
|
"noUnusedVariables": "error",
|
||||||
"noSwitchDeclarations": "warn", // TODO: refactor and make this an error
|
"noSwitchDeclarations": "error",
|
||||||
"noVoidTypeReturn": "warn", // TODO: Refactor and make this an error
|
"noVoidTypeReturn": "error",
|
||||||
"noUnusedImports": "error"
|
"noUnusedImports": "error"
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
@ -85,7 +85,7 @@
|
|||||||
"useLiteralKeys": "off",
|
"useLiteralKeys": "off",
|
||||||
"noForEach": "off", // Foreach vs for of is not that simple.
|
"noForEach": "off", // Foreach vs for of is not that simple.
|
||||||
"noUselessSwitchCase": "off", // Explicit > Implicit
|
"noUselessSwitchCase": "off", // Explicit > Implicit
|
||||||
"noUselessConstructor": "warn", // TODO: Refactor and make this an error
|
"noUselessConstructor": "error",
|
||||||
"noBannedTypes": "warn" // TODO: Refactor and make this an error
|
"noBannedTypes": "warn" // TODO: Refactor and make this an error
|
||||||
},
|
},
|
||||||
"nursery": {
|
"nursery": {
|
||||||
|
2
global.d.ts
vendored
2
global.d.ts
vendored
@ -7,7 +7,7 @@ declare global {
|
|||||||
* Only used in testing.
|
* Only used in testing.
|
||||||
* Can technically be undefined/null but for ease of use we are going to assume it is always defined.
|
* Can technically be undefined/null but for ease of use we are going to assume it is always defined.
|
||||||
* Used to load i18n files exclusively.
|
* Used to load i18n files exclusively.
|
||||||
*
|
*
|
||||||
* To set up your own server in a test see `game_data.test.ts`
|
* To set up your own server in a test see `game_data.test.ts`
|
||||||
*/
|
*/
|
||||||
var server: SetupServerApi;
|
var server: SetupServerApi;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"eslint": "eslint --fix .",
|
"eslint": "eslint --fix .",
|
||||||
"eslint-ci": "eslint .",
|
"eslint-ci": "eslint .",
|
||||||
"biome": "biome check --write --changed --no-errors-on-unmatched",
|
"biome": "biome check --write --changed --no-errors-on-unmatched",
|
||||||
"biome-ci": "biome ci --diagnostic-level=error --reporter=github --changed --no-errors-on-unmatched",
|
"biome-ci": "biome ci --diagnostic-level=error --reporter=github --no-errors-on-unmatched",
|
||||||
"docs": "typedoc",
|
"docs": "typedoc",
|
||||||
"depcruise": "depcruise src",
|
"depcruise": "depcruise src",
|
||||||
"depcruise:graph": "depcruise src --output-type dot | node dependency-graph.js > dependency-graph.svg",
|
"depcruise:graph": "depcruise src --output-type dot | node dependency-graph.js > dependency-graph.svg",
|
||||||
|
@ -29,4 +29,4 @@ export type ModifierString = keyof ModifierConstructorMap;
|
|||||||
|
|
||||||
export type ModifierPool = {
|
export type ModifierPool = {
|
||||||
[tier: string]: WeightedModifierType[];
|
[tier: string]: WeightedModifierType[];
|
||||||
}
|
};
|
||||||
|
@ -125,16 +125,6 @@ export interface TerrainBattlerTag {
|
|||||||
* Players and enemies should not be allowed to select restricted moves.
|
* Players and enemies should not be allowed to select restricted moves.
|
||||||
*/
|
*/
|
||||||
export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
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 */
|
||||||
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
if (lapseType === BattlerTagLapseType.PRE_MOVE) {
|
if (lapseType === BattlerTagLapseType.PRE_MOVE) {
|
||||||
@ -1470,16 +1460,6 @@ export class WrapTag extends DamagingTrapTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export abstract class VortexTrapTag 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 {
|
getTrapMessage(pokemon: Pokemon): string {
|
||||||
return i18next.t("battlerTags:vortexOnTrap", {
|
return i18next.t("battlerTags:vortexOnTrap", {
|
||||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||||
|
@ -11,10 +11,7 @@ import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requir
|
|||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import type { ModifierTypeOption } from "#app/modifier/modifier-type";
|
import type { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
import {
|
import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||||
getPlayerModifierTypeOptions,
|
|
||||||
regenerateModifierPoolThresholds,
|
|
||||||
} from "#app/modifier/modifier-type";
|
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -7,10 +7,7 @@ import { TrainerSlot } from "#enums/trainer-slot";
|
|||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import { MusicPreference } from "#app/system/settings/settings";
|
import { MusicPreference } from "#app/system/settings/settings";
|
||||||
import type { ModifierTypeOption } from "#app/modifier/modifier-type";
|
import type { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
import {
|
import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||||
getPlayerModifierTypeOptions,
|
|
||||||
regenerateModifierPoolThresholds,
|
|
||||||
} from "#app/modifier/modifier-type";
|
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -262,7 +262,7 @@ export class Arena {
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SpeciesId.LYCANROC:
|
case SpeciesId.LYCANROC: {
|
||||||
const timeOfDay = this.getTimeOfDay();
|
const timeOfDay = this.getTimeOfDay();
|
||||||
switch (timeOfDay) {
|
switch (timeOfDay) {
|
||||||
case TimeOfDay.DAY:
|
case TimeOfDay.DAY:
|
||||||
@ -274,6 +274,7 @@ export class Arena {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4385,14 +4385,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
// biome-ignore lint: there are a ton of issues..
|
// biome-ignore lint: there are a ton of issues..
|
||||||
faintCry(callback: Function): void {
|
faintCry(callback: Function): void {
|
||||||
if (this.fusionSpecies && this.getSpeciesForm() !== this.getFusionSpeciesForm()) {
|
if (this.fusionSpecies && this.getSpeciesForm() !== this.getFusionSpeciesForm()) {
|
||||||
return this.fusionFaintCry(callback);
|
this.fusionFaintCry(callback);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const key = this.species.getCryKey(this.formIndex);
|
const key = this.species.getCryKey(this.formIndex);
|
||||||
let rate = 0.85;
|
let rate = 0.85;
|
||||||
const cry = globalScene.playSound(key, { rate: rate }) as AnySound;
|
const cry = globalScene.playSound(key, { rate: rate }) as AnySound;
|
||||||
if (!cry || globalScene.fieldVolume === 0) {
|
if (!cry || globalScene.fieldVolume === 0) {
|
||||||
return callback();
|
callback();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const sprite = this.getSprite();
|
const sprite = this.getSprite();
|
||||||
const tintSprite = this.getTintSprite();
|
const tintSprite = this.getTintSprite();
|
||||||
@ -4460,7 +4462,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
rate: rate,
|
rate: rate,
|
||||||
}) as AnySound;
|
}) as AnySound;
|
||||||
if (!cry || !fusionCry || globalScene.fieldVolume === 0) {
|
if (!cry || !fusionCry || globalScene.fieldVolume === 0) {
|
||||||
return callback();
|
callback();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
fusionCry.stop();
|
fusionCry.stop();
|
||||||
duration = Math.min(duration, fusionCry.totalDuration * 1000);
|
duration = Math.min(duration, fusionCry.totalDuration * 1000);
|
||||||
|
@ -272,7 +272,7 @@ class DefaultOverrides {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set all non-scripted waves to use the selected battle type.
|
* Set all non-scripted waves to use the selected battle type.
|
||||||
*
|
*
|
||||||
* Ignored if set to {@linkcode BattleType.TRAINER} and `DISABLE_STANDARD_TRAINERS_OVERRIDE` is `true`.
|
* Ignored if set to {@linkcode BattleType.TRAINER} and `DISABLE_STANDARD_TRAINERS_OVERRIDE` is `true`.
|
||||||
*/
|
*/
|
||||||
readonly BATTLE_TYPE_OVERRIDE: Exclude<BattleType, BattleType.CLEAR> | null = null;
|
readonly BATTLE_TYPE_OVERRIDE: Exclude<BattleType, BattleType.CLEAR> | null = null;
|
||||||
@ -298,4 +298,4 @@ export type RandomTrainerOverride = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** The type of the {@linkcode DefaultOverrides} class */
|
/** The type of the {@linkcode DefaultOverrides} class */
|
||||||
export type OverridesType = typeof DefaultOverrides;
|
export type OverridesType = typeof DefaultOverrides;
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import {
|
import { regenerateModifierPoolThresholds, getEnemyBuffModifierForWave } from "#app/modifier/modifier-type";
|
||||||
regenerateModifierPoolThresholds,
|
|
||||||
getEnemyBuffModifierForWave,
|
|
||||||
} from "#app/modifier/modifier-type";
|
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import { EnemyPersistentModifier } from "#app/modifier/modifier";
|
import { EnemyPersistentModifier } from "#app/modifier/modifier";
|
||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
|
@ -149,7 +149,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case Command.TERA:
|
case Command.TERA:
|
||||||
case Command.FIGHT:
|
case Command.FIGHT: {
|
||||||
let useStruggle = false;
|
let useStruggle = false;
|
||||||
const turnMove: TurnMove | undefined = args.length === 2 ? (args[1] as TurnMove) : undefined;
|
const turnMove: TurnMove | undefined = args.length === 2 ? (args[1] as TurnMove) : undefined;
|
||||||
if (
|
if (
|
||||||
@ -233,7 +233,8 @@ export class CommandPhase extends FieldPhase {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Command.BALL:
|
}
|
||||||
|
case Command.BALL: {
|
||||||
const notInDex =
|
const notInDex =
|
||||||
globalScene
|
globalScene
|
||||||
.getEnemyField()
|
.getEnemyField()
|
||||||
@ -337,8 +338,9 @@ export class CommandPhase extends FieldPhase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Command.POKEMON:
|
case Command.POKEMON:
|
||||||
case Command.RUN:
|
case Command.RUN: {
|
||||||
const isSwitch = command === Command.POKEMON;
|
const isSwitch = command === Command.POKEMON;
|
||||||
const { currentBattle, arena } = globalScene;
|
const { currentBattle, arena } = globalScene;
|
||||||
const mysteryEncounterFleeAllowed = currentBattle.mysteryEncounter?.fleeAllowed;
|
const mysteryEncounterFleeAllowed = currentBattle.mysteryEncounter?.fleeAllowed;
|
||||||
@ -445,6 +447,7 @@ export class CommandPhase extends FieldPhase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
@ -135,7 +135,8 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.showMoveText();
|
this.showMoveText();
|
||||||
this.showFailedText();
|
this.showFailedText();
|
||||||
}
|
}
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pokemon.turnData.acted = true;
|
this.pokemon.turnData.acted = true;
|
||||||
@ -310,7 +311,8 @@ export class MovePhase extends BattlePhase {
|
|||||||
if (fail) {
|
if (fail) {
|
||||||
this.showMoveText();
|
this.showMoveText();
|
||||||
this.showFailedText();
|
this.showFailedText();
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,8 @@ export class PokemonAnimPhase extends BattlePhase {
|
|||||||
private doSubstituteAddAnim(): void {
|
private doSubstituteAddAnim(): void {
|
||||||
const substitute = this.pokemon.getTag(SubstituteTag);
|
const substitute = this.pokemon.getTag(SubstituteTag);
|
||||||
if (isNullOrUndefined(substitute)) {
|
if (isNullOrUndefined(substitute)) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getSprite = () => {
|
const getSprite = () => {
|
||||||
@ -116,12 +117,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
|||||||
|
|
||||||
private doSubstitutePreMoveAnim(): void {
|
private doSubstitutePreMoveAnim(): void {
|
||||||
if (this.fieldAssets.length !== 1) {
|
if (this.fieldAssets.length !== 1) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const subSprite = this.fieldAssets[0];
|
const subSprite = this.fieldAssets[0];
|
||||||
if (subSprite === undefined) {
|
if (subSprite === undefined) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.tweens.add({
|
globalScene.tweens.add({
|
||||||
@ -145,12 +148,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
|||||||
|
|
||||||
private doSubstitutePostMoveAnim(): void {
|
private doSubstitutePostMoveAnim(): void {
|
||||||
if (this.fieldAssets.length !== 1) {
|
if (this.fieldAssets.length !== 1) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const subSprite = this.fieldAssets[0];
|
const subSprite = this.fieldAssets[0];
|
||||||
if (subSprite === undefined) {
|
if (subSprite === undefined) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.tweens.add({
|
globalScene.tweens.add({
|
||||||
@ -174,12 +179,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
|||||||
|
|
||||||
private doSubstituteRemoveAnim(): void {
|
private doSubstituteRemoveAnim(): void {
|
||||||
if (this.fieldAssets.length !== 1) {
|
if (this.fieldAssets.length !== 1) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const subSprite = this.fieldAssets[0];
|
const subSprite = this.fieldAssets[0];
|
||||||
if (subSprite === undefined) {
|
if (subSprite === undefined) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getSprite = () => {
|
const getSprite = () => {
|
||||||
@ -244,12 +251,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
|||||||
|
|
||||||
private doCommanderApplyAnim(): void {
|
private doCommanderApplyAnim(): void {
|
||||||
if (!globalScene.currentBattle?.double) {
|
if (!globalScene.currentBattle?.double) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const dondozo = this.pokemon.getAlly();
|
const dondozo = this.pokemon.getAlly();
|
||||||
|
|
||||||
if (dondozo?.species?.speciesId !== SpeciesId.DONDOZO) {
|
if (dondozo?.species?.speciesId !== SpeciesId.DONDOZO) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tatsugiriX = this.pokemon.x + this.pokemon.getSprite().x;
|
const tatsugiriX = this.pokemon.x + this.pokemon.getSprite().x;
|
||||||
@ -329,7 +338,8 @@ export class PokemonAnimPhase extends BattlePhase {
|
|||||||
const tatsugiri = this.pokemon.getAlly();
|
const tatsugiri = this.pokemon.getAlly();
|
||||||
if (isNullOrUndefined(tatsugiri)) {
|
if (isNullOrUndefined(tatsugiri)) {
|
||||||
console.warn("Aborting COMMANDER_REMOVE anim: Tatsugiri is undefined");
|
console.warn("Aborting COMMANDER_REMOVE anim: Tatsugiri is undefined");
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tatsuSprite = globalScene.addPokemonSprite(
|
const tatsuSprite = globalScene.addPokemonSprite(
|
||||||
|
@ -29,7 +29,8 @@ export class PokemonTransformPhase extends PokemonPhase {
|
|||||||
const target = globalScene.getField(true).find(p => p.getBattlerIndex() === this.targetIndex);
|
const target = globalScene.getField(true).find(p => p.getBattlerIndex() === this.targetIndex);
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.summonData.speciesForm = target.getSpeciesForm();
|
user.summonData.speciesForm = target.getSpeciesForm();
|
||||||
|
@ -29,7 +29,8 @@ export class QuietFormChangePhase extends BattlePhase {
|
|||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
if (this.pokemon.formIndex === this.pokemon.species.forms.findIndex(f => f.formKey === this.formChange.formKey)) {
|
if (this.pokemon.formIndex === this.pokemon.species.forms.findIndex(f => f.formKey === this.formChange.formKey)) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const preName = getPokemonNameWithAffix(this.pokemon);
|
const preName = getPokemonNameWithAffix(this.pokemon);
|
||||||
|
@ -51,7 +51,7 @@ float hue2rgb(float f1, float f2, float hue) {
|
|||||||
|
|
||||||
vec3 rgb2hsl(vec3 color) {
|
vec3 rgb2hsl(vec3 color) {
|
||||||
vec3 hsl;
|
vec3 hsl;
|
||||||
|
|
||||||
float fmin = min(min(color.r, color.g), color.b);
|
float fmin = min(min(color.r, color.g), color.b);
|
||||||
float fmax = max(max(color.r, color.g), color.b);
|
float fmax = max(max(color.r, color.g), color.b);
|
||||||
float delta = fmax - fmin;
|
float delta = fmax - fmin;
|
||||||
@ -66,7 +66,7 @@ vec3 rgb2hsl(vec3 color) {
|
|||||||
hsl.y = delta / (fmax + fmin);
|
hsl.y = delta / (fmax + fmin);
|
||||||
else
|
else
|
||||||
hsl.y = delta / (2.0 - fmax - fmin);
|
hsl.y = delta / (2.0 - fmax - fmin);
|
||||||
|
|
||||||
float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
|
float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
|
||||||
float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
|
float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
|
||||||
float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;
|
float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;
|
||||||
@ -89,24 +89,24 @@ vec3 rgb2hsl(vec3 color) {
|
|||||||
|
|
||||||
vec3 hsl2rgb(vec3 hsl) {
|
vec3 hsl2rgb(vec3 hsl) {
|
||||||
vec3 rgb;
|
vec3 rgb;
|
||||||
|
|
||||||
if (hsl.y == 0.0)
|
if (hsl.y == 0.0)
|
||||||
rgb = vec3(hsl.z);
|
rgb = vec3(hsl.z);
|
||||||
else {
|
else {
|
||||||
float f2;
|
float f2;
|
||||||
|
|
||||||
if (hsl.z < 0.5)
|
if (hsl.z < 0.5)
|
||||||
f2 = hsl.z * (1.0 + hsl.y);
|
f2 = hsl.z * (1.0 + hsl.y);
|
||||||
else
|
else
|
||||||
f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);
|
f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);
|
||||||
|
|
||||||
float f1 = 2.0 * hsl.z - f2;
|
float f1 = 2.0 * hsl.z - f2;
|
||||||
|
|
||||||
rgb.r = hue2rgb(f1, f2, hsl.x + (1.0/3.0));
|
rgb.r = hue2rgb(f1, f2, hsl.x + (1.0/3.0));
|
||||||
rgb.g = hue2rgb(f1, f2, hsl.x);
|
rgb.g = hue2rgb(f1, f2, hsl.x);
|
||||||
rgb.b = hue2rgb(f1, f2, hsl.x - (1.0/3.0));
|
rgb.b = hue2rgb(f1, f2, hsl.x - (1.0/3.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ vec3 rgb2hsl(vec3 color) {
|
|||||||
hsl.y = delta / (fmax + fmin);
|
hsl.y = delta / (fmax + fmin);
|
||||||
else
|
else
|
||||||
hsl.y = delta / (2.0 - fmax - fmin);
|
hsl.y = delta / (2.0 - fmax - fmin);
|
||||||
|
|
||||||
float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
|
float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
|
||||||
float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
|
float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
|
||||||
float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;
|
float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;
|
||||||
@ -106,24 +106,24 @@ vec3 rgb2hsl(vec3 color) {
|
|||||||
|
|
||||||
vec3 hsl2rgb(vec3 hsl) {
|
vec3 hsl2rgb(vec3 hsl) {
|
||||||
vec3 rgb;
|
vec3 rgb;
|
||||||
|
|
||||||
if (hsl.y == 0.0)
|
if (hsl.y == 0.0)
|
||||||
rgb = vec3(hsl.z);
|
rgb = vec3(hsl.z);
|
||||||
else {
|
else {
|
||||||
float f2;
|
float f2;
|
||||||
|
|
||||||
if (hsl.z < 0.5)
|
if (hsl.z < 0.5)
|
||||||
f2 = hsl.z * (1.0 + hsl.y);
|
f2 = hsl.z * (1.0 + hsl.y);
|
||||||
else
|
else
|
||||||
f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);
|
f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);
|
||||||
|
|
||||||
float f1 = 2.0 * hsl.z - f2;
|
float f1 = 2.0 * hsl.z - f2;
|
||||||
|
|
||||||
rgb.r = hue2rgb(f1, f2, hsl.x + (1.0/3.0));
|
rgb.r = hue2rgb(f1, f2, hsl.x + (1.0/3.0));
|
||||||
rgb.g = hue2rgb(f1, f2, hsl.x);
|
rgb.g = hue2rgb(f1, f2, hsl.x);
|
||||||
rgb.b= hue2rgb(f1, f2, hsl.x - (1.0/3.0));
|
rgb.b= hue2rgb(f1, f2, hsl.x - (1.0/3.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,24 @@ export async function initI18n(): Promise<void> {
|
|||||||
"es-MX": ["es-ES", "en"],
|
"es-MX": ["es-ES", "en"],
|
||||||
default: ["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: {
|
backend: {
|
||||||
loadPath(lng: string, [ns]: string[]) {
|
loadPath(lng: string, [ns]: string[]) {
|
||||||
let fileName: string;
|
let fileName: string;
|
||||||
|
@ -32,7 +32,10 @@ const pressAction = i18next.t("settings:pressActionToAssign");
|
|||||||
|
|
||||||
export const settingGamepadOptions = {
|
export const settingGamepadOptions = {
|
||||||
[SettingGamepad.Controller]: [i18next.t("settings:controllerDefault"), i18next.t("settings:controllerChange")],
|
[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_Up]: [`KEY ${Button.UP.toString()}`, pressAction],
|
||||||
[SettingGamepad.Button_Down]: [`KEY ${Button.DOWN.toString()}`, pressAction],
|
[SettingGamepad.Button_Down]: [`KEY ${Button.DOWN.toString()}`, pressAction],
|
||||||
[SettingGamepad.Button_Left]: [`KEY ${Button.LEFT.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)",
|
label: "Türkçe (Needs Help)",
|
||||||
handler: () => changeLocaleHandler("tr")
|
handler: () => changeLocaleHandler("tr"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Русский (Needs Help)",
|
label: "Русский (Needs Help)",
|
||||||
@ -967,11 +967,11 @@ export function setSetting(setting: string, value: number): boolean {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Dansk (Needs Help)",
|
label: "Dansk (Needs Help)",
|
||||||
handler: () => changeLocaleHandler("da")
|
handler: () => changeLocaleHandler("da"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Română (Needs Help)",
|
label: "Română (Needs Help)",
|
||||||
handler: () => changeLocaleHandler("ro")
|
handler: () => changeLocaleHandler("ro"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18next.t("settings:back"),
|
label: i18next.t("settings:back"),
|
||||||
|
@ -56,10 +56,6 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler {
|
|||||||
protected defaultTextStyle: TextStyle = TextStyle.WINDOW;
|
protected defaultTextStyle: TextStyle = TextStyle.WINDOW;
|
||||||
protected textContent: string;
|
protected textContent: string;
|
||||||
|
|
||||||
constructor(mode: UiMode | null) {
|
|
||||||
super(mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract getWindowWidth(): number;
|
abstract getWindowWidth(): number;
|
||||||
|
|
||||||
getWindowHeight(): number {
|
getWindowHeight(): number {
|
||||||
|
@ -69,7 +69,7 @@ export default class AdminUiHandler extends FormModalUiHandler {
|
|||||||
case AdminMode.SEARCH:
|
case AdminMode.SEARCH:
|
||||||
inputFieldConfigs.push({ label: "Username" });
|
inputFieldConfigs.push({ label: "Username" });
|
||||||
break;
|
break;
|
||||||
case AdminMode.ADMIN:
|
case AdminMode.ADMIN: {
|
||||||
const adminResult = this.adminResult ?? {
|
const adminResult = this.adminResult ?? {
|
||||||
username: "",
|
username: "",
|
||||||
discordId: "",
|
discordId: "",
|
||||||
@ -90,6 +90,7 @@ export default class AdminUiHandler extends FormModalUiHandler {
|
|||||||
inputFieldConfigs.push({ label: "Last played", isReadOnly: true });
|
inputFieldConfigs.push({ label: "Last played", isReadOnly: true });
|
||||||
inputFieldConfigs.push({ label: "Registered", isReadOnly: true });
|
inputFieldConfigs.push({ label: "Registered", isReadOnly: true });
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return inputFieldConfigs;
|
return inputFieldConfigs;
|
||||||
}
|
}
|
||||||
|
@ -169,12 +169,13 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
|||||||
entryContainer.add(scoreLabel);
|
entryContainer.add(scoreLabel);
|
||||||
|
|
||||||
switch (this.category) {
|
switch (this.category) {
|
||||||
case ScoreboardCategory.DAILY:
|
case ScoreboardCategory.DAILY: {
|
||||||
const waveLabel = addTextObject(68, 0, wave, TextStyle.WINDOW, {
|
const waveLabel = addTextObject(68, 0, wave, TextStyle.WINDOW, {
|
||||||
fontSize: "54px",
|
fontSize: "54px",
|
||||||
});
|
});
|
||||||
entryContainer.add(waveLabel);
|
entryContainer.add(waveLabel);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case ScoreboardCategory.WEEKLY:
|
case ScoreboardCategory.WEEKLY:
|
||||||
scoreLabel.x -= 16;
|
scoreLabel.x -= 16;
|
||||||
break;
|
break;
|
||||||
|
@ -131,7 +131,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
|||||||
gachaInfoContainer.add(gachaUpLabel);
|
gachaInfoContainer.add(gachaUpLabel);
|
||||||
|
|
||||||
switch (gachaType as GachaType) {
|
switch (gachaType as GachaType) {
|
||||||
case GachaType.LEGENDARY:
|
case GachaType.LEGENDARY: {
|
||||||
if (["de", "es-ES"].includes(currentLanguage)) {
|
if (["de", "es-ES"].includes(currentLanguage)) {
|
||||||
gachaUpLabel.setAlign("center");
|
gachaUpLabel.setAlign("center");
|
||||||
gachaUpLabel.setY(0);
|
gachaUpLabel.setY(0);
|
||||||
@ -152,6 +152,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
gachaInfoContainer.add(pokemonIcon);
|
gachaInfoContainer.add(pokemonIcon);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case GachaType.MOVE:
|
case GachaType.MOVE:
|
||||||
if (["de", "es-ES", "fr", "pt-BR", "ru"].includes(currentLanguage)) {
|
if (["de", "es-ES", "fr", "pt-BR", "ru"].includes(currentLanguage)) {
|
||||||
gachaUpLabel.setAlign("center");
|
gachaUpLabel.setAlign("center");
|
||||||
@ -623,11 +624,12 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
|||||||
updateGachaInfo(gachaType: GachaType): void {
|
updateGachaInfo(gachaType: GachaType): void {
|
||||||
const infoContainer = this.gachaInfoContainers[gachaType];
|
const infoContainer = this.gachaInfoContainers[gachaType];
|
||||||
switch (gachaType as GachaType) {
|
switch (gachaType as GachaType) {
|
||||||
case GachaType.LEGENDARY:
|
case GachaType.LEGENDARY: {
|
||||||
const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(new Date().getTime()));
|
const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(new Date().getTime()));
|
||||||
const pokemonIcon = infoContainer.getAt(1) as Phaser.GameObjects.Sprite;
|
const pokemonIcon = infoContainer.getAt(1) as Phaser.GameObjects.Sprite;
|
||||||
pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false));
|
pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MenuOptions.LOG_OUT:
|
case MenuOptions.LOG_OUT: {
|
||||||
success = true;
|
success = true;
|
||||||
const doLogout = () => {
|
const doLogout = () => {
|
||||||
ui.setMode(UiMode.LOADING, {
|
ui.setMode(UiMode.LOADING, {
|
||||||
@ -718,6 +718,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||||||
doLogout();
|
doLogout();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (button === Button.CANCEL) {
|
} else if (button === Button.CANCEL) {
|
||||||
success = true;
|
success = true;
|
||||||
|
@ -1385,7 +1385,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
case PartyOption.MOVE_1:
|
case PartyOption.MOVE_1:
|
||||||
case PartyOption.MOVE_2:
|
case PartyOption.MOVE_2:
|
||||||
case PartyOption.MOVE_3:
|
case PartyOption.MOVE_3:
|
||||||
case PartyOption.MOVE_4:
|
case PartyOption.MOVE_4: {
|
||||||
const move = pokemon.moveset[option - PartyOption.MOVE_1];
|
const move = pokemon.moveset[option - PartyOption.MOVE_1];
|
||||||
if (this.showMovePp) {
|
if (this.showMovePp) {
|
||||||
const maxPP = move.getMovePp();
|
const maxPP = move.getMovePp();
|
||||||
@ -1395,7 +1395,8 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
optionName = move.getName();
|
optionName = move.getName();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon);
|
const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon);
|
||||||
if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) {
|
if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) {
|
||||||
const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM];
|
const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM];
|
||||||
@ -1410,6 +1411,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (this.partyUiMode === PartyUiMode.REMEMBER_MOVE_MODIFIER) {
|
} else if (this.partyUiMode === PartyUiMode.REMEMBER_MOVE_MODIFIER) {
|
||||||
const learnableLevelMoves = pokemon.getLearnableLevelMoves();
|
const learnableLevelMoves = pokemon.getLearnableLevelMoves();
|
||||||
|
@ -567,7 +567,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
case GameModes.SPLICED_ENDLESS:
|
case GameModes.SPLICED_ENDLESS:
|
||||||
modeText.appendText(`${i18next.t("gameMode:endlessSpliced")}`, false);
|
modeText.appendText(`${i18next.t("gameMode:endlessSpliced")}`, false);
|
||||||
break;
|
break;
|
||||||
case GameModes.CHALLENGE:
|
case GameModes.CHALLENGE: {
|
||||||
modeText.appendText(`${i18next.t("gameMode:challenge")}`, false);
|
modeText.appendText(`${i18next.t("gameMode:challenge")}`, false);
|
||||||
modeText.appendText(`${i18next.t("runHistory:challengeRules")}: `);
|
modeText.appendText(`${i18next.t("runHistory:challengeRules")}: `);
|
||||||
modeText.setWrapMode(1); // wrap by word
|
modeText.setWrapMode(1); // wrap by word
|
||||||
@ -582,6 +582,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case GameModes.ENDLESS:
|
case GameModes.ENDLESS:
|
||||||
modeText.appendText(`${i18next.t("gameMode:endless")}`, false);
|
modeText.appendText(`${i18next.t("gameMode:endless")}`, false);
|
||||||
break;
|
break;
|
||||||
@ -687,7 +688,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
case Challenges.SINGLE_GENERATION:
|
case Challenges.SINGLE_GENERATION:
|
||||||
rules.push(i18next.t(`runHistory:challengeMonoGen${this.runInfo.challenges[i].value}`));
|
rules.push(i18next.t(`runHistory:challengeMonoGen${this.runInfo.challenges[i].value}`));
|
||||||
break;
|
break;
|
||||||
case Challenges.SINGLE_TYPE:
|
case Challenges.SINGLE_TYPE: {
|
||||||
const typeRule = PokemonType[this.runInfo.challenges[i].value - 1];
|
const typeRule = PokemonType[this.runInfo.challenges[i].value - 1];
|
||||||
const typeTextColor = `[color=${TypeColor[typeRule]}]`;
|
const typeTextColor = `[color=${TypeColor[typeRule]}]`;
|
||||||
const typeShadowColor = `[shadow=${TypeShadow[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]";
|
typeTextColor + typeShadowColor + i18next.t(`pokemonInfo:Type.${typeRule}`)! + "[/color]" + "[/shadow]";
|
||||||
rules.push(typeText);
|
rules.push(typeText);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Challenges.INVERSE_BATTLE:
|
case Challenges.INVERSE_BATTLE:
|
||||||
rules.push(i18next.t("challenges:inverseBattle.shortName"));
|
rules.push(i18next.t("challenges:inverseBattle.shortName"));
|
||||||
break;
|
break;
|
||||||
default:
|
default: {
|
||||||
const localisationKey = Challenges[this.runInfo.challenges[i].id]
|
const localisationKey = Challenges[this.runInfo.challenges[i].id]
|
||||||
.split("_")
|
.split("_")
|
||||||
.map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()))
|
.map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()))
|
||||||
.join("");
|
.join("");
|
||||||
rules.push(i18next.t(`challenges:${localisationKey}.name`));
|
rules.push(i18next.t(`challenges:${localisationKey}.name`));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,12 +332,13 @@ export default class AbstractSettingsUiHandler extends MessageUiHandler {
|
|||||||
case Button.CYCLE_SHINY:
|
case Button.CYCLE_SHINY:
|
||||||
success = this.navigationContainer.navigate(button);
|
success = this.navigationContainer.navigate(button);
|
||||||
break;
|
break;
|
||||||
case Button.ACTION:
|
case Button.ACTION: {
|
||||||
const setting: Setting = this.settings[cursor];
|
const setting: Setting = this.settings[cursor];
|
||||||
if (setting?.activatable) {
|
if (setting?.activatable) {
|
||||||
success = this.activateSetting(setting);
|
success = this.activateSetting(setting);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ export default class MoveTouchControlsHandler {
|
|||||||
<div id="cancelButton" class="button">${i18next.t("settings:touchCancel")}</div>
|
<div id="cancelButton" class="button">${i18next.t("settings:touchCancel")}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<div class="orientation-label">
|
<div class="orientation-label">
|
||||||
${i18next.t("settings:orientation")}
|
${i18next.t("settings:orientation")}
|
||||||
<span id="orientation">
|
<span id="orientation">
|
||||||
${this.isLandscapeMode ? i18next.t("settings:landscape") : i18next.t("settings:portrait")}
|
${this.isLandscapeMode ? i18next.t("settings:landscape") : i18next.t("settings:portrait")}
|
||||||
|
@ -1763,7 +1763,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
} else if (this.randomCursorObj.visible) {
|
} else if (this.randomCursorObj.visible) {
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case Button.ACTION:
|
case Button.ACTION: {
|
||||||
if (this.starterSpecies.length >= 6) {
|
if (this.starterSpecies.length >= 6) {
|
||||||
error = true;
|
error = true;
|
||||||
break;
|
break;
|
||||||
@ -1815,6 +1815,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Button.UP:
|
case Button.UP:
|
||||||
this.randomCursorObj.setVisible(false);
|
this.randomCursorObj.setVisible(false);
|
||||||
this.filterBarCursor = this.filterBar.numFilters - 1;
|
this.filterBarCursor = this.filterBar.numFilters - 1;
|
||||||
|
@ -10,10 +10,6 @@ import { UiMode } from "#enums/ui-mode";
|
|||||||
export default class TestDialogueUiHandler extends FormModalUiHandler {
|
export default class TestDialogueUiHandler extends FormModalUiHandler {
|
||||||
keys: string[];
|
keys: string[];
|
||||||
|
|
||||||
constructor(mode) {
|
|
||||||
super(mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
super.setup();
|
super.setup();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user