diff --git a/docs/linting.md b/docs/linting.md index 39b30b7a1c0..ff512740a80 100644 --- a/docs/linting.md +++ b/docs/linting.md @@ -1,40 +1,34 @@ -# ESLint +# Biome + ## Key Features 1. **Automation**: - - A pre-commit hook has been added to automatically run ESLint on the added or modified files, ensuring code quality before commits. + - A pre-commit hook has been added to automatically run Biome on the added or modified files, ensuring code quality before commits. 2. **Manual Usage**: - - If you prefer not to use the pre-commit hook, you can manually run ESLint to automatically fix issues using the command: + - If you prefer not to use the pre-commit hook, you can manually run biome to automatically fix issues using the command: + ```sh - npx eslint --fix . or npm run eslint + npx @biomejs/biome --write ``` + - Running this command will lint all files in the repository. 3. **GitHub Action**: - - A GitHub Action has been added to automatically run ESLint on every push and pull request, ensuring code quality in the CI/CD pipeline. + - A GitHub Action has been added to automatically run Biome on every push and pull request, ensuring code quality in the CI/CD pipeline. -## Summary of ESLint Rules +If you are getting linting errors from biome and want to see which files they are coming from, you can find that out by running biome in a way that is configured to only show the errors for that specific rule: ``npx @biomejs/biome lint --only=category/ruleName`` -1. **General Rules**: - - **Equality**: Use `===` and `!==` instead of `==` and `!=` (`eqeqeq`). - - **Indentation**: Enforce 2-space indentation (`indent`). - - **Quotes**: Use doublequotes for strings (`quotes`). - - **Variable Declarations**: - - Disallow `var`; use `let` or `const` (`no-var`). - - Prefer `const` for variables that are never reassigned (`prefer-const`). - - **Unused Variables**: Allow unused function parameters but enforce error for other unused variables (`@typescript-eslint/no-unused-vars`). - - **End of Line**: Ensure at least one newline at the end of files (`eol-last`). - - **Curly Braces**: Enforce the use of curly braces for all control statements (`curly`). - - **Brace Style**: Use one true brace style (`1tbs`) for TypeScript-specific syntax (`@typescript-eslint/brace-style`). +## Summary of Biome Rules -2. **TypeScript-Specific Rules**: - - **Semicolons**: - - Enforce semicolons for TypeScript-specific syntax (`@typescript-eslint/semi`). - - Disallow unnecessary semicolons (`@typescript-eslint/no-extra-semi`). +We use the [recommended ruleset](https://biomejs.dev/linter/rules/) for Biome, with some customizations to better suit our project's needs. -## Benefits +For a complete list of rules and their configurations, refer to the `biome.jsonc` file in the project root. -- **Consistency**: Ensures consistent coding style across the project. -- **Code Quality**: Helps catch potential errors and improve overall code quality. -- **Readability**: Makes the codebase easier to read and maintain. \ No newline at end of file +Some things to consider: + +- We have disabled rules that prioritize style over performance, such as `useTemplate` +- Some rules are currently marked as warnings (`warn`) to allow for gradual refactoring without blocking development. Do not write new code that triggers these warnings. +- The linter is configured to ignore specific files and folders, such as large or complex files that are pending refactors, to improve performance and focus on actionable areas. + +Formatting is also handled by Biome. You should not have to worry about manually formatting your code. diff --git a/package.json b/package.json index 4758e6c5182..341bca80c2e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.8.4", + "version": "1.8.5", "type": "module", "scripts": { "start": "vite", diff --git a/public/images/inputs/keyboard.json b/public/images/inputs/keyboard.json index c9b3c79fbfb..1e8e415b72f 100644 --- a/public/images/inputs/keyboard.json +++ b/public/images/inputs/keyboard.json @@ -516,8 +516,36 @@ "trimmed": true, "spriteSourceSize": { "x": 0, "y": 0, "w": 28, "h": 11 }, "sourceSize": { "w": 28, "h": 11 } + }, + "BACK_SLASH.png": { + "frame": { "x": 147, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "FORWARD_SLASH.png": { + "frame": { "x": 144, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "COMMA.png": { + "frame": { "x": 144, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "PERIOD.png": { + "frame": { "x": 143, "y": 22, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } } - }, + }, "meta": { "app": "https://www.aseprite.org/", "version": "1.3.7-dev", diff --git a/public/images/inputs/keyboard.png b/public/images/inputs/keyboard.png index e4d849be0fb..0c33e579006 100644 Binary files a/public/images/inputs/keyboard.png and b/public/images/inputs/keyboard.png differ diff --git a/src/configs/inputs/cfg_keyboard_qwerty.ts b/src/configs/inputs/cfg_keyboard_qwerty.ts index 2ad04ab418d..4f0353971e0 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -31,6 +31,7 @@ const cfg_keyboard_qwerty = { KEY_X: Phaser.Input.Keyboard.KeyCodes.X, KEY_Y: Phaser.Input.Keyboard.KeyCodes.Y, KEY_Z: Phaser.Input.Keyboard.KeyCodes.Z, + KEY_0: Phaser.Input.Keyboard.KeyCodes.ZERO, KEY_1: Phaser.Input.Keyboard.KeyCodes.ONE, KEY_2: Phaser.Input.Keyboard.KeyCodes.TWO, @@ -41,11 +42,7 @@ const cfg_keyboard_qwerty = { KEY_7: Phaser.Input.Keyboard.KeyCodes.SEVEN, KEY_8: Phaser.Input.Keyboard.KeyCodes.EIGHT, KEY_9: Phaser.Input.Keyboard.KeyCodes.NINE, - KEY_CTRL: Phaser.Input.Keyboard.KeyCodes.CTRL, - KEY_DEL: Phaser.Input.Keyboard.KeyCodes.DELETE, - KEY_END: Phaser.Input.Keyboard.KeyCodes.END, - KEY_ENTER: Phaser.Input.Keyboard.KeyCodes.ENTER, - KEY_ESC: Phaser.Input.Keyboard.KeyCodes.ESC, + KEY_F1: Phaser.Input.Keyboard.KeyCodes.F1, KEY_F2: Phaser.Input.Keyboard.KeyCodes.F2, KEY_F3: Phaser.Input.Keyboard.KeyCodes.F3, @@ -58,24 +55,41 @@ const cfg_keyboard_qwerty = { KEY_F10: Phaser.Input.Keyboard.KeyCodes.F10, KEY_F11: Phaser.Input.Keyboard.KeyCodes.F11, KEY_F12: Phaser.Input.Keyboard.KeyCodes.F12, - KEY_HOME: Phaser.Input.Keyboard.KeyCodes.HOME, - KEY_INSERT: Phaser.Input.Keyboard.KeyCodes.INSERT, + KEY_PAGE_DOWN: Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN, KEY_PAGE_UP: Phaser.Input.Keyboard.KeyCodes.PAGE_UP, + + KEY_CTRL: Phaser.Input.Keyboard.KeyCodes.CTRL, + KEY_DEL: Phaser.Input.Keyboard.KeyCodes.DELETE, + KEY_END: Phaser.Input.Keyboard.KeyCodes.END, + KEY_ENTER: Phaser.Input.Keyboard.KeyCodes.ENTER, + KEY_ESC: Phaser.Input.Keyboard.KeyCodes.ESC, + KEY_HOME: Phaser.Input.Keyboard.KeyCodes.HOME, + KEY_INSERT: Phaser.Input.Keyboard.KeyCodes.INSERT, + KEY_PLUS: Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD, // Assuming numpad plus KEY_MINUS: Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT, // Assuming numpad minus KEY_QUOTATION: Phaser.Input.Keyboard.KeyCodes.QUOTES, KEY_SHIFT: Phaser.Input.Keyboard.KeyCodes.SHIFT, + KEY_SPACE: Phaser.Input.Keyboard.KeyCodes.SPACE, KEY_TAB: Phaser.Input.Keyboard.KeyCodes.TAB, KEY_TILDE: Phaser.Input.Keyboard.KeyCodes.BACKTICK, + KEY_ARROW_UP: Phaser.Input.Keyboard.KeyCodes.UP, KEY_ARROW_DOWN: Phaser.Input.Keyboard.KeyCodes.DOWN, KEY_ARROW_LEFT: Phaser.Input.Keyboard.KeyCodes.LEFT, KEY_ARROW_RIGHT: Phaser.Input.Keyboard.KeyCodes.RIGHT, + KEY_LEFT_BRACKET: Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET, KEY_RIGHT_BRACKET: Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET, + KEY_SEMICOLON: Phaser.Input.Keyboard.KeyCodes.SEMICOLON, + KEY_COMMA: Phaser.Input.Keyboard.KeyCodes.COMMA, + KEY_PERIOD: Phaser.Input.Keyboard.KeyCodes.PERIOD, + KEY_BACK_SLASH: Phaser.Input.Keyboard.KeyCodes.BACK_SLASH, + KEY_FORWARD_SLASH: Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH, + KEY_BACKSPACE: Phaser.Input.Keyboard.KeyCodes.BACKSPACE, KEY_ALT: Phaser.Input.Keyboard.KeyCodes.ALT, }, @@ -160,6 +174,10 @@ const cfg_keyboard_qwerty = { KEY_RIGHT_BRACKET: "RIGHT_BRACKET.png", KEY_SEMICOLON: "SEMICOLON.png", + KEY_COMMA: "COMMA.png", + KEY_PERIOD: "PERIOD.png", + KEY_BACK_SLASH: "BACK_SLASH.png", + KEY_FORWARD_SLASH: "FORWARD_SLASH.png", KEY_BACKSPACE: "BACK.png", KEY_ALT: "ALT.png", diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index b018a87a08d..9a6094f4649 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -3172,6 +3172,7 @@ export class PreSetStatusAbAttr extends AbAttr { */ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { protected immuneEffects: StatusEffect[]; + private lastEffect: StatusEffect; /** * @param immuneEffects - The status effects to which the Pokémon is immune. @@ -3197,6 +3198,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { */ override applyPreSetStatus(pokemon: Pokemon, passive: boolean, simulated: boolean, effect: StatusEffect, cancelled: BooleanHolder, args: any[]): void { cancelled.value = true; + this.lastEffect = effect; } getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { @@ -3204,7 +3206,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { i18next.t("abilityTriggers:statusEffectImmunityWithName", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), abilityName, - statusEffectName: getStatusEffectDescriptor(args[0] as StatusEffect) + statusEffectName: getStatusEffectDescriptor(this.lastEffect) }) : i18next.t("abilityTriggers:statusEffectImmunity", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 903b2726676..bc047762fb6 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -7665,20 +7665,6 @@ export class AverageStatsAttr extends MoveEffectAttr { } } -export class DiscourageFrequentUseAttr extends MoveAttr { - getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number { - const lastMoves = user.getLastXMoves(4); - console.log(lastMoves); - for (let m = 0; m < lastMoves.length; m++) { - if (lastMoves[m].move === move.id) { - return (4 - (m + 1)) * -10; - } - } - - return 0; - } -} - export class MoneyAttr extends MoveEffectAttr { constructor() { super(true, {firstHitOnly: true }); @@ -10517,8 +10503,7 @@ export function initMoves() { } else { return 1; } - }) - .attr(DiscourageFrequentUseAttr), + }), new AttackMove(Moves.SNIPE_SHOT, PokemonType.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 8) .attr(HighCritAttr) diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index 65051b937f8..67904fc856c 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -424,6 +424,7 @@ export async function initBattleWithEnemyConfig(partyConfig: EnemyPartyConfig): console.log( `Pokemon: ${getPokemonNameWithAffix(enemyPokemon)}`, `| Species ID: ${enemyPokemon.species.speciesId}`, + `| Level: ${enemyPokemon.level}`, `| Nature: ${getNatureName(enemyPokemon.nature, true, true, true)}`, ); console.log(`Stats (IVs): ${stats}`); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2de8cc150c9..f6810ad38e1 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -12,7 +12,6 @@ import BattleInfo, { import type Move from "#app/data/moves/move"; import { HighCritAttr, - StatChangeBeforeDmgCalcAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, @@ -70,10 +69,8 @@ import { EFFECTIVE_STATS, } from "#enums/stat"; import { - DamageMoneyRewardModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, - EnemyEndureChanceModifier, EnemyFusionChanceModifier, HiddenAbilityRateBoosterModifier, BaseStatModifier, @@ -119,7 +116,6 @@ import { TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, - TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, @@ -188,7 +184,7 @@ import { PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr, applyAllyStatMultiplierAbAttrs, AllyStatMultiplierAbAttr, - MoveAbilityBypassAbAttr + MoveAbilityBypassAbAttr, } from "#app/data/abilities/ability"; import { allAbilities } from "#app/data/data-lists"; import type PokemonData from "#app/system/pokemon-data"; @@ -202,7 +198,7 @@ import { EVOLVE_MOVE, RELEARN_MOVE, } from "#app/data/balance/pokemon-level-moves"; -import { DamageAchv, achvs } from "#app/system/achv"; +import { achvs } from "#app/system/achv"; import type { StarterDataEntry, StarterMoveset } from "#app/system/game-data"; import { DexAttr } from "#app/system/game-data"; import { @@ -248,7 +244,7 @@ import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; import { CustomPokemonData } from "#app/data/custom-pokemon-data"; import { SwitchType } from "#enums/switch-type"; import { SpeciesFormKey } from "#enums/species-form-key"; -import {getStatusEffectOverlapText } from "#app/data/status-effect"; +import { getStatusEffectOverlapText } from "#app/data/status-effect"; import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE, @@ -7030,6 +7026,15 @@ export class EnemyPokemon extends Pokemon { } speciesId = prevolution; } + + if (this.hasTrainer() && globalScene.currentBattle) { + const { waveIndex } = globalScene.currentBattle; + const ivs: number[] = []; + while (ivs.length < 6) { + ivs.push(this.randSeedIntRange(Math.floor(waveIndex / 10), 31)); + } + this.ivs = ivs; + } } this.aiType = diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 6fd11c416a2..20ed69119f9 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -2,7 +2,12 @@ import { BattlerIndex } from "#app/battle"; import { BattleType } from "#enums/battle-type"; import { globalScene } from "#app/global-scene"; import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; -import { applyAbAttrs, SyncEncounterNatureAbAttr, applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/abilities/ability"; +import { + applyAbAttrs, + SyncEncounterNatureAbAttr, + applyPreSummonAbAttrs, + PreSummonAbAttr, +} from "#app/data/abilities/ability"; import { initEncounterAnims, loadEncounterAnimAssets } from "#app/data/battle-anims"; import { getCharVariantFromDialogue } from "#app/data/dialogue"; import { getEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; @@ -196,6 +201,7 @@ export class EncounterPhase extends BattlePhase { console.log( `Pokemon: ${getPokemonNameWithAffix(enemyPokemon)}`, `| Species ID: ${enemyPokemon.species.speciesId}`, + `| Level: ${enemyPokemon.level}`, `| Nature: ${getNatureName(enemyPokemon.nature, true, true, true)}`, ); console.log(`Stats (IVs): ${stats}`); diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 01085834ba5..4b4e62db71b 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -859,7 +859,7 @@ export class MoveEffectPhase extends PokemonPhase { }); if (isCritical) { - globalScene.queueMessage(i18next.t("battle:criticalHit")); + globalScene.queueMessage(i18next.t("battle:hitResultCriticalHit")); } if (damage <= 0) { diff --git a/src/plugins/api/pokerogue-system-savedata-api.ts b/src/plugins/api/pokerogue-system-savedata-api.ts index 659584776c4..d6fbb39ae0a 100644 --- a/src/plugins/api/pokerogue-system-savedata-api.ts +++ b/src/plugins/api/pokerogue-system-savedata-api.ts @@ -15,14 +15,17 @@ export class PokerogueSystemSavedataApi extends ApiBase { /** * Get a system savedata. * @param params The {@linkcode GetSystemSavedataRequest} to send - * @returns The system savedata as `string` or `null` on error + * @returns The system savedata as `string` or either the status code or `null` on error */ - public async get(params: GetSystemSavedataRequest) { + public async get(params: GetSystemSavedataRequest): Promise { try { const urlSearchParams = this.toUrlSearchParams(params); const response = await this.doGet(`/savedata/system/get?${urlSearchParams}`); const rawSavedata = await response.text(); - + if (!response.ok) { + console.warn("Could not get system savedata!", response.status, rawSavedata); + return response.status; + } return rawSavedata; } catch (err) { console.warn("Could not get system savedata!", err); diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 8b7987556ee..8573c774054 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -462,8 +462,13 @@ export class GameData { if (!bypassLogin) { pokerogueApi.savedata.system.get({ clientSessionId }).then(saveDataOrErr => { - if (!saveDataOrErr || saveDataOrErr.length === 0 || saveDataOrErr[0] !== "{") { - if (saveDataOrErr?.startsWith("sql: no rows in result set")) { + if ( + typeof saveDataOrErr === "number" || + !saveDataOrErr || + saveDataOrErr.length === 0 || + saveDataOrErr[0] !== "{" + ) { + if (saveDataOrErr === 404) { globalScene.queueMessage( "Save data could not be found. If this is a new account, you can safely ignore this message.", null, @@ -471,7 +476,7 @@ export class GameData { ); return resolve(true); } - if (saveDataOrErr?.includes("Too many connections")) { + if (typeof saveDataOrErr === "string" && saveDataOrErr?.includes("Too many connections")) { globalScene.queueMessage( "Too many people are trying to connect and the server is overloaded. Please try again later.", null, @@ -479,7 +484,6 @@ export class GameData { ); return resolve(false); } - console.error(saveDataOrErr); return resolve(false); } @@ -1500,7 +1504,7 @@ export class GameData { link.remove(); }; if (!bypassLogin && dataType < GameDataType.SETTINGS) { - let promise: Promise = Promise.resolve(null); + let promise: Promise = Promise.resolve(null); if (dataType === GameDataType.SYSTEM) { promise = pokerogueApi.savedata.system.get({ clientSessionId }); @@ -1512,7 +1516,7 @@ export class GameData { } promise.then(response => { - if (!response?.length || response[0] !== "{") { + if (typeof response === "number" || !response?.length || response[0] !== "{") { console.error(response); resolve(false); return; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index d0b85544494..4888e14b24f 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -292,6 +292,13 @@ export default class PokedexPageUiHandler extends MessageUiHandler { starterSelectBg.setOrigin(0, 0); this.starterSelectContainer.add(starterSelectBg); + this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); + this.pokemonSprite.setPipeline(globalScene.spritePipeline, { + tone: [0.0, 0.0, 0.0, 0.0], + ignoreTimeTint: true, + }); + this.starterSelectContainer.add(this.pokemonSprite); + this.shinyOverlay = globalScene.add.image(6, 6, "summary_overlay_shiny"); this.shinyOverlay.setOrigin(0, 0); this.shinyOverlay.setVisible(false); @@ -343,13 +350,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.starterSelectContainer.add(starterBoxContainer); - this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); - this.pokemonSprite.setPipeline(globalScene.spritePipeline, { - tone: [0.0, 0.0, 0.0, 0.0], - ignoreTimeTint: true, - }); - this.starterSelectContainer.add(this.pokemonSprite); - this.type1Icon = globalScene.add.sprite(8, 98, getLocalizedSpriteKey("types")); this.type1Icon.setScale(0.5); this.type1Icon.setOrigin(0, 0); diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 1902c691715..7c345f1735e 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -596,6 +596,13 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.iconAnimHandler = new PokemonIconAnimHandler(); this.iconAnimHandler.setup(); + this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); + this.pokemonSprite.setPipeline(globalScene.spritePipeline, { + tone: [0.0, 0.0, 0.0, 0.0], + ignoreTimeTint: true, + }); + this.starterSelectContainer.add(this.pokemonSprite); + this.pokemonNumberText = addTextObject(17, 1, "0000", TextStyle.SUMMARY); this.pokemonNumberText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonNumberText); @@ -825,13 +832,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { return icon; }); - this.pokemonSprite = globalScene.add.sprite(53, 63, "pkmn__sub"); - this.pokemonSprite.setPipeline(globalScene.spritePipeline, { - tone: [0.0, 0.0, 0.0, 0.0], - ignoreTimeTint: true, - }); - this.starterSelectContainer.add(this.pokemonSprite); - this.type1Icon = globalScene.add.sprite(8, 98, getLocalizedSpriteKey("types")); this.type1Icon.setScale(0.5); this.type1Icon.setOrigin(0, 0); diff --git a/test/field/pokemon.test.ts b/test/field/pokemon.test.ts index 85128a31f7f..f763ab2c401 100644 --- a/test/field/pokemon.test.ts +++ b/test/field/pokemon.test.ts @@ -209,4 +209,19 @@ describe("Spec - Pokemon", () => { expect(types[1]).toBe(PokemonType.DARK); }); }); + + it.each([5, 25, 55, 95, 145, 195])( + "should set minimum IVs for enemy trainer pokemon based on wave (%i)", + async wave => { + game.override.startingWave(wave); + await game.classicMode.startBattle([Species.FEEBAS]); + const { waveIndex } = game.scene.currentBattle; + + for (const pokemon of game.scene.getEnemyParty()) { + for (const index in pokemon.ivs) { + expect(pokemon.ivs[index]).toBeGreaterThanOrEqual(Math.floor(waveIndex / 10)); + } + } + }, + ); });