diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml index 44df0310557..0894032c8ad 100644 --- a/.github/workflows/deploy-beta.yml +++ b/.github/workflows/deploy-beta.yml @@ -11,7 +11,7 @@ on: jobs: deploy: - if: github.repository == 'pagefaultgames/pokerogue' && github.ref_name == ${{ vars.BETA_DEPLOY_BRANCH || 'beta' }} + if: github.repository == 'pagefaultgames/pokerogue' && github.ref_name == (vars.BETA_DEPLOY_BRANCH || 'beta') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f4ee992cb3..7092b40b1b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,8 @@ Thank you for taking the time to contribute, every little bit helps. This project is entirely open-source and unmonetized - community contributions are what keep it alive! -Please make sure you understand everything relevant to your changes from the [Table of Contents](#-table-of-contents), and absolutely *feel free to reach out reach out in the **#dev-corner** channel on [Discord](https://discord.gg/pokerogue)*. We are here to help and the better you understand what you're working on, the easier it will be for it to find its way into the game. +Please make sure you understand everything relevant to your changes from the [Table of Contents](#-table-of-contents), and absolutely *feel free to reach out in the **#dev-corner** channel on [Discord](https://discord.gg/pokerogue)*. +We are here to help and the better you understand what you're working on, the easier it will be for it to find its way into the game. ## 📄 Table of Contents @@ -11,7 +12,6 @@ Please make sure you understand everything relevant to your changes from the [Ta - [Getting Started](#-getting-started) - [Documentation](#-documentation) - [Testing Your Changes](#-testing-your-changes) -- [Localization](#-localization) - [Development Save File (Unlock Everything)](#-development-save-file) ## 🛠️ Development Basics @@ -26,17 +26,14 @@ If you have the motivation and experience with Typescript/Javascript (or are wil - node: >=22.14.0 - [manage with pnpm](https://pnpm.io/cli/env) | [manage with fnm](https://github.com/Schniz/fnm) | [manage with nvm](https://github.com/nvm-sh/nvm) - pnpm: 10.x - [how to install](https://pnpm.io/installation) (not recommended to install via `npm` on Windows native) | [alternate method - volta.sh](https://volta.sh/) +- The repository [forked](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and [cloned](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) locally on your device ### Running Locally -1. Clone the repo and in the root directory run `pnpm install` +1. Run `pnpm install` from the repository root - *if you run into any errors, reach out in the **#dev-corner** channel on Discord* 2. Run `pnpm start:dev` to locally run the project at `localhost:8000` -### Linting - -Check out our [in-depth file](./docs/linting.md) on linting and formatting! - ## 🚀 Getting Started A great way to develop an understanding of how the project works is to look at test cases (located in [the `test` folder](./test/)). @@ -60,8 +57,13 @@ You are free to comment on any issue so that you may be assigned to it and we ca ## 📚 Documentation You can find the auto-generated documentation [here](https://pagefaultgames.github.io/pokerogue/main/index.html). -For information on enemy AI, check out the [enemy-ai.md](./docs/enemy-ai.md) file. -For detailed guidelines on documenting your code, refer to the [comments.md](./docs/comments.md) file. + +Additionally, the [docs folder](./docs) contains a variety of in-depth documents and guides useful for aspiring contributors. +Notable topics include: +- [Commenting your code](./docs/comments.md) +- [Linting & Formatting](./docs/linting.md) +- [Localization](./docs/localization.md) +- [Enemy AI move selection](./docs/enemy-ai.md) Again, if you have unanswered questions please feel free to ask! @@ -101,62 +103,6 @@ Most non-trivial changes (*especially bug fixes*) should come along with new tes - As much as possible, are unit tests. If you have made two distinct changes, they should be tested in two separate cases. - Test edge cases. A good strategy is to think of edge cases beforehand and create tests for them using `it.todo`. Once the edge case has been handled, you can remove the `todo` marker. -## 📜 Localization - -The project intends for all text to be localized. That is, strings are pulled from translation files using keys (depending on the current language) and *never* hardcoded as a particular language. Note that there is a PDF in a message pinned in **#dev-corner** which gives the following information in greater detail. - -### Setting Up and Updating the Locales Submodule -> The locales (translation) files are set up as a git submodule. A project-in-a-project, if you will. - -To fetch translations when you first start development in your fork or to update them on your local branch, run: -```bash -git submodule update --progress --init --recursive -``` - -### How Localizations Work -> This project uses the [i18next](https://www.i18next.com/) library to integrate translations from public/locales -into the source code based on the user's settings or location. The basic process for -fetching translated text is as follows: -1. The source code fetches text by a given key, e.g. - - ```ts - i18next.t("fileName:keyName", { arg1: "Hello", arg2: "an example", ... }) - ``` -2. The game looks up the key in the corresponding JSON file in the user's -language, e.g. - - ```ts - // from "en/file-name.json"... - "keyName": "{{arg1}}! This is {{arg2}} of translated text!" - ``` - If the key doesn't exist for the user's language, the game will default to the -corresponding English key (in the case of LATAM Spanish, it will first default to ES Spanish). - -3. The game shows the text to the user: - - ```ts - "Hello! This is an example of translated text!" - ``` -### Adding Translated Text -> If your feature involves new or modified text in any form, then you will be modifying the [locales](https://github.com/pagefaultgames/pokerogue-locales) repository. ***Never hardcode new text in any language!*** - -The workflow is: - -1. Make a pull request to the main repository for your new feature. -If this feature requires new text, the text should be integrated into the code with a new i18next key pointing to where you plan to add it into the pokerogue-locales repository. - -2. Make another pull request -- this time to the [pokerogue-locales](https://github.com/pagefaultgames/pokerogue-locales) -repository -- adding a new entry to the English locale with text for each key -you added to your main PR. You *only* need to add the English key and value - the translation team will handle the rest. - -3. If your feature is pulled from the mainline Pokémon games (e.g. a Move or Ability implementation), add a source link for any added text within the locale PR. -[Poké Corpus](https://abcboy101.github.io/poke-corpus) is a great resource for finding text from the latest mainline games; otherwise, a YouTube video link showing the text in mainline is sufficient. - -4. Ping @lugiadrien in **#dev-corner** or the current callout thread to make sure your locales PR is seen. -It'll be merged into the locales repository after any necessary corrections, at which point you can test it in your main PR (after updating locales from remote) - -5. The Dev team will approve your main PR, and your changes will be in the beta environment! - ## 😈 Development Save File > Some issues may require you to have unlocks on your save file which go beyond normal overrides. For this reason, the repository contains a [save file](../test/testUtils/saves/everything.psrv) with _everything_ unlocked (even ones not legitimately obtainable, like unimplemented variant shinies). diff --git a/biome.jsonc b/biome.jsonc index e517d3a18d0..ed5db201824 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -38,14 +38,13 @@ ] }, - // TODO: Configure and enable import sorting "assist": { "actions": { "source": { "organizeImports": { - "level": "off", + "level": "on", "options": { - "groups": [] + "groups": [":ALIAS:", ":NODE:", ":PACKAGE_WITH_PROTOCOL:", ":PACKAGE:", ":PATH:"] } } } @@ -70,7 +69,10 @@ }, "style": { "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome - "useBlockStatements": "error", + "useBlockStatements": { + "level": "error", + "fix": "safe" + }, "useConst": "error", "useImportType": "error", "noNonNullAssertion": "off", // TODO: Turn this on ASAP and fix all non-null assertions in non-test files diff --git a/dependency-graph.js b/dependency-graph.js deleted file mode 100644 index dff960d8781..00000000000 --- a/dependency-graph.js +++ /dev/null @@ -1,13 +0,0 @@ -import { Graphviz } from "@hpcc-js/wasm/graphviz"; - -const graphviz = await Graphviz.load(); - -const inputFile = []; -for await (const chunk of process.stdin) { - inputFile.push(chunk); -} - -const file = Buffer.concat(inputFile).toString("utf-8"); - -const svg = graphviz.dot(file, "svg"); -process.stdout.write(svg); diff --git a/docs/localization.md b/docs/localization.md new file mode 100644 index 00000000000..0fe950a361d --- /dev/null +++ b/docs/localization.md @@ -0,0 +1,142 @@ +# Localization 101 + +PokéRogue's localization team puts immense effort into making the game accessible around the world, supporting over 12 different languages at the time of writing this document. +As a developer, it's important to help maintain global accessibility by effectively coordinating with the Translation Team on any new features or enhancements. + +This document aims to cover everything you need to know to help keep the integration process for localization smooth and simple. + +# Prerequisites +Before you continue, this document assumes: +- You have already forked the repository and set up a development environment according to [CONTRIBUTING.md](../CONTRIBUTING.md). +- You have a basic level of familiarity with Git commands and GitHub repositories. +- You have joined the [community Discord](https://discord.gg/pokerogue) and have access to `#dev-corner` and related channels via **[#select-roles](https://discord.com/channels/1125469663833370665/1194825607738052621)**. +This is the easiest way to keep in touch with both the Translation Team and other like-minded contributors! + +# About the `pokerogue-locales` submodule + +PokéRogue's translations are managed under a separate dedicated repository, [`pokerogue-locales`](https://github.com/pagefaultgames/pokerogue-locales/). +This repository is integrated into the main one as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) within the `public/locales` folder. + +## What Is a Submodule? + +In essence, a submodule is a way for one repository (i.e. `pokerogue`) to use another repository (i.e. `pokerogue-locales`) internally. +The parent repo (the "superproject") houses a cloned version of the 2nd repository (the "submodule") inside it, making locales effectively a "repository within a repository", so to speak. + +>[!TIP] +> Many popular IDEs have integrated `git` support with special handling around submodules: +> ![Image showing Visual Studio Code's `git` integration in the File Explorer. A blue "S" in the top right hand corner indicates the `public/locales` folder is a submodule.](https://github.com/user-attachments/assets/bd42d354-c65b-4cbe-8873-23d760dc1714 "What the `public/locales` submodule looks like in VS Code's File Explorer") +> +> ![Image showing Visual Studio Code's Source Control tab. A separate dropdown can be seen for each individual submodule.](https://github.com/user-attachments/assets/8b4d3f64-aec1-4474-91df-03dc1252a2fa "Making commits on submodules without even changing directories!") + +## Fetching Changes from Submodules + +The following command will initialize your branch's locales repository and update its HEAD: +```bash +git submodule update --init --recursive +``` + +> [!TIP] +> This command is run _automatically_ after cloning, merging or changing branches, so you should rarely have to run it manually. + +> [!IMPORTANT] +> If you run into issues with the `locales` submodule, try deleting the `.git/modules/public` and `public/locales` folders before re-running the command. + +## How Are Translations Integrated? + +This project uses the [i18next library](https://www.i18next.com/) to integrate translations from `public/locales` into the source code. +The basic process for fetching translated text goes roughly as follows: +1. The source code fetches text by a given key. + ```ts + globalScene.phaseManager.queueMessage( + i18next.t("fileName:keyName", { arg1: "Hello", arg2: "an example", ... }) + ); + ``` +2. The game looks up the key in the corresponding JSON file for the user's language. + ```jsonc + // from "en/file-name.json"... + { + "keyName": "{{arg1}}! This is {{arg2}} of translated text!" + } + ``` + If the key doesn't exist for the given language, the game will default to an appropriate fallback (usually the corresponding English key). +3. The game shows the translated text to the user. + ```ts + "Hello! This is an example of translated text!" + ``` + +# Submitting Locales Changes +If you have a feature or enhancement that requires additions or changes to in-game text, you will need to make a fork of the `pokerogue-locales` repo and submit your text changes as a pull request _in addition_ to your pull request to the main project. +Since these two PRs aren't _technically_ linked, it's important to coordinate with the Translation Team to ensure that both PRs are integrated safely into the project. + +> [!CAUTION] +> **DO NOT HARDCODE PLAYER-FACING TEXT INTO THE CODE!** + +## Making Changes + +One perk of submodules is you don't actually _need_ to clone the locales repository to start contributing - initializing the submodule already does that for you. + +Given `pokerogue-locales` is a full-fledged `git` repository _inside_ `pokerogue`, making changes is roughly the same as normal, merely using `public/locales` as your root directory. + +> [!WARNING] +> Make sure to checkout or rebase onto `upstream/HEAD` **BEFORE** creating a PR! +> The checked-out commit is based on the superproject's SHA-1 by default, so hastily making changes may see you basing your commits on last week's `HEAD`. + +## Requirements for Adding Translated Text +When your new feature or enhancement requires adding a new locales key **without changing text in existing keys**, we require the following workflow with regards to localization: +1. You (the developer) make a pull request to the main repository for your new feature. +If this feature requires new text, the text should be integrated into the code with a new `i18next` key pointing to where you plan to add it into the locales repository. +2. You then make another pull request — this time to the `pokerogue-locales` repository — adding a new entry with text for each key you added to your main PR. + - You must add the corresponding **English keys** while making the PR; the Translation Team can take care of the rest[^2]. + - For any feature pulled from the mainline Pokémon games (e.g. a Move or Ability implementation), it's best practice to include a source link for any added text. + [Poké Corpus](https://abcboy101.github.io/poke-corpus/) is a great resource for finding text from the mainline games; otherwise, a video/picture showing the text being displayed should suffice. + - You should also [notify the current Head of Translation](#notifying-translation) to ensure a fast response. +3. At this point, you may begin [testing locales integration in your main PR](#documenting-locales-changes). +4. The Translation Team will approve the locale PR (after corrections, if necessary), then merge it into `pokerogue-locales`. +5. The Dev Team will approve your main PR for your feature, then merge it into PokéRogue's beta environment. + +[^2]: For those wondering, the reason for choosing English specifically is due to it being the master language set in Pontoon (the program used by the Translation Team to perform locale updates). +If a key is present in any language _except_ the master language, it won't appear anywhere else in the translation tool, rendering missing English keys quite a hassle. + +### Requirements for Modifying Translated Text + +PRs that modify existing text have different risks with respect to coordination between development and translation, so their requirements are slightly different: +- As above, you set up 2 PRs: one for the feature itself in the main repo, and another for the associated locales changes in the locale repo. +- Now, however, you need to have your main PR be approved by the Dev Team **before** your corresponding locale changes are merged in. +- After your main PR is approved, the Translation Team will merge your locale PR, and you may update the submodule and post video evidence of integration into the **locales PR**. +- A Lead or Senior Translator from the Translation Team will then approve your main PR (if all is well), clearing your feature for merging into `beta`. + +## Documenting Locales Changes + +After making a PR involving any outwards-facing behavior (but _especially_ locales-related ones), it's generally considered good practice to attach proof of those changes working in-game. + +The basic procedure is roughly as follows: +1. Update your locales submodule to point to **the branch you used to make the locales PR**. \ + Many IDEs with `git` integration support doing this from the GUI, \ + or you can simply do it via command-line: + ```bash + cd public/locales + git checkout your-branch-name-here + ``` +2. Set some of the [in-game overrides](../CONTRIBUTING.md#1---manual-testing) inside `overrides.ts` to values corresponding to the interactions being tested. +3. Start a local dev server (`pnpm start:dev`) and open localhost in your browser. +4. Take screenshots or record a video of the locales changes being displayed in-game using the software of your choice[^2]. + +[^2]: For those lacking a screen capture device, [OBS Studio](https://obsproject.com) is a popular open-source option. + +> [!NOTE] +> For those aiming to film their changes, bear in mind that GitHub has a hard **10mB limit** on uploaded media content. +> If your video is too large, consider making it shorter or downscaling the quality. + +## Notifying Translation +Put simply, stating that a PR exists makes it much easier to review and merge. + +The easiest way to do this is by **pinging the current Head of Translation** in the [community Discord](https://discord.gg/pokerogue) (ideally in `#dev-corner` or similar). + + +> [!IMPORTANT] +> The current Head of Translation is: \ +> ** @lugiadrien ** + +# Closing Remarks +If you have any questions about the developer process for localization, don't hesitate to ask! +Feel free to contact us on Discord - the Dev Team and Translation Team will be happy to answer any questions. diff --git a/package.json b/package.json index 43736c10db6..64f2f9786db 100644 --- a/package.json +++ b/package.json @@ -21,44 +21,42 @@ "biome-ci": "biome ci --diagnostic-level=error --reporter=github --no-errors-on-unmatched", "docs": "typedoc", "depcruise": "depcruise src test", - "depcruise:graph": "depcruise src --output-type dot | node dependency-graph.js > dependency-graph.svg", - "postinstall": "lefthook install && lefthook run post-merge", + "postinstall": "lefthook install; git submodule update --init --recursive", "update-version:patch": "pnpm version patch --force --no-git-tag-version", "update-version:minor": "pnpm version minor --force --no-git-tag-version", "update-locales:remote": "git submodule update --progress --init --recursive --force --remote" }, "devDependencies": { "@biomejs/biome": "2.0.0", - "@hpcc-js/wasm": "^2.22.4", "@types/jsdom": "^21.1.7", - "@types/node": "^22.13.14", - "@vitest/coverage-istanbul": "^3.0.9", + "@types/node": "^22.16.3", + "@vitest/coverage-istanbul": "^3.2.4", "chalk": "^5.4.1", - "dependency-cruiser": "^16.3.10", - "inquirer": "^12.4.2", - "jsdom": "^26.0.0", - "lefthook": "^1.11.5", - "msw": "^2.7.3", + "dependency-cruiser": "^16.10.4", + "inquirer": "^12.7.0", + "jsdom": "^26.1.0", + "lefthook": "^1.12.2", + "msw": "^2.10.4", "phaser3spectorjs": "^0.0.8", - "typedoc": "^0.28.1", - "typescript": "^5.8.2", - "vite": "^6.3.4", + "typedoc": "^0.28.7", + "typescript": "^5.8.3", + "vite": "^6.3.5", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^3.0.9", + "vitest": "^3.2.4", "vitest-canvas-mock": "^0.3.3" }, "dependencies": { "@material/material-color-utilities": "^0.2.7", "compare-versions": "^6.1.1", "crypto-js": "^4.2.0", - "i18next": "^24.2.2", - "i18next-browser-languagedetector": "^8.0.4", + "i18next": "^24.2.3", + "i18next-browser-languagedetector": "^8.2.0", "i18next-http-backend": "^3.0.2", "i18next-korean-postposition-processor": "^1.0.0", - "json-stable-stringify": "^1.2.0", + "json-stable-stringify": "^1.3.0", "jszip": "^3.10.1", - "phaser": "^3.88.2", - "phaser3-rex-plugins": "^1.80.15" + "phaser": "^3.90.0", + "phaser3-rex-plugins": "^1.80.16" }, "engines": { "node": ">=22.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d218bc00eb..9f465c56778 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,84 +18,81 @@ importers: specifier: ^4.2.0 version: 4.2.0 i18next: - specifier: ^24.2.2 - version: 24.2.3(typescript@5.8.2) + specifier: ^24.2.3 + version: 24.2.3(typescript@5.8.3) i18next-browser-languagedetector: - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^8.2.0 + version: 8.2.0 i18next-http-backend: specifier: ^3.0.2 version: 3.0.2 i18next-korean-postposition-processor: specifier: ^1.0.0 - version: 1.0.0(i18next@24.2.3(typescript@5.8.2)) + version: 1.0.0(i18next@24.2.3(typescript@5.8.3)) json-stable-stringify: - specifier: ^1.2.0 - version: 1.2.1 + specifier: ^1.3.0 + version: 1.3.0 jszip: specifier: ^3.10.1 version: 3.10.1 phaser: - specifier: ^3.88.2 - version: 3.88.2 + specifier: ^3.90.0 + version: 3.90.0 phaser3-rex-plugins: - specifier: ^1.80.15 - version: 1.80.15(graphology-types@0.24.8) + specifier: ^1.80.16 + version: 1.80.16(graphology-types@0.24.8) devDependencies: '@biomejs/biome': specifier: 2.0.0 version: 2.0.0 - '@hpcc-js/wasm': - specifier: ^2.22.4 - version: 2.22.4 '@types/jsdom': specifier: ^21.1.7 version: 21.1.7 '@types/node': - specifier: ^22.13.14 - version: 22.13.14 + specifier: ^22.16.3 + version: 22.16.3 '@vitest/coverage-istanbul': - specifier: ^3.0.9 - version: 3.0.9(vitest@3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1)) + specifier: ^3.2.4 + version: 3.2.4(vitest@3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0)) chalk: specifier: ^5.4.1 version: 5.4.1 dependency-cruiser: - specifier: ^16.3.10 - version: 16.3.10 + specifier: ^16.10.4 + version: 16.10.4 inquirer: - specifier: ^12.4.2 - version: 12.5.0(@types/node@22.13.14) + specifier: ^12.7.0 + version: 12.7.0(@types/node@22.16.3) jsdom: - specifier: ^26.0.0 - version: 26.0.0 + specifier: ^26.1.0 + version: 26.1.0 lefthook: - specifier: ^1.11.5 - version: 1.11.6 + specifier: ^1.12.2 + version: 1.12.2 msw: - specifier: ^2.7.3 - version: 2.7.3(@types/node@22.13.14)(typescript@5.8.2) + specifier: ^2.10.4 + version: 2.10.4(@types/node@22.16.3)(typescript@5.8.3) phaser3spectorjs: specifier: ^0.0.8 version: 0.0.8 typedoc: - specifier: ^0.28.1 - version: 0.28.1(typescript@5.8.2) + specifier: ^0.28.7 + version: 0.28.7(typescript@5.8.3) typescript: - specifier: ^5.8.2 - version: 5.8.2 + specifier: ^5.8.3 + version: 5.8.3 vite: - specifier: ^6.3.4 - version: 6.3.4(@types/node@22.13.14)(yaml@2.7.1) + specifier: ^6.3.5 + version: 6.3.5(@types/node@22.16.3)(yaml@2.8.0) vite-tsconfig-paths: specifier: ^5.1.4 - version: 5.1.4(typescript@5.8.2)(vite@6.3.4(@types/node@22.13.14)(yaml@2.7.1)) + version: 5.1.4(typescript@5.8.3)(vite@6.3.5(@types/node@22.16.3)(yaml@2.8.0)) vitest: - specifier: ^3.0.9 - version: 3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1) + specifier: ^3.2.4 + version: 3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0) vitest-canvas-mock: specifier: ^0.3.3 - version: 0.3.3(vitest@3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1)) + version: 0.3.3(vitest@3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0)) packages: @@ -103,59 +100,43 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@asamuzakjp/css-color@3.1.1': - resolution: {integrity: sha512-hpRD68SV2OMcZCsrbdkccTw5FXjNDLo5OuqSHyHZfwweGsDWZwDJ2+gONyNAbazZclobMirACLw0lk8WVxIqxA==} + '@asamuzakjp/css-color@3.2.0': + resolution: {integrity: sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==} '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.24.9': - resolution: {integrity: sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng==} + '@babel/compat-data@7.28.0': + resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==} engines: {node: '>=6.9.0'} - '@babel/core@7.24.9': - resolution: {integrity: sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==} + '@babel/core@7.28.0': + resolution: {integrity: sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==} engines: {node: '>=6.9.0'} - '@babel/generator@7.24.10': - resolution: {integrity: sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg==} + '@babel/generator@7.28.0': + resolution: {integrity: sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.24.8': - resolution: {integrity: sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==} + '@babel/helper-compilation-targets@7.27.2': + resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} - '@babel/helper-environment-visitor@7.24.7': - resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} + '@babel/helper-globals@7.28.0': + resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} - '@babel/helper-function-name@7.24.7': - resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} + '@babel/helper-module-imports@7.27.1': + resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} - '@babel/helper-hoist-variables@7.24.7': - resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.24.7': - resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-transforms@7.24.9': - resolution: {integrity: sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw==} + '@babel/helper-module-transforms@7.27.3': + resolution: {integrity: sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.24.7': - resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-split-export-declaration@7.24.7': - resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.27.1': resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} @@ -164,33 +145,33 @@ packages: resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.24.8': - resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} '@babel/helpers@7.27.6': resolution: {integrity: sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==} engines: {node: '>=6.9.0'} - '@babel/parser@7.27.5': - resolution: {integrity: sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==} + '@babel/parser@7.28.0': + resolution: {integrity: sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/runtime@7.27.0': - resolution: {integrity: sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==} + '@babel/runtime@7.27.6': + resolution: {integrity: sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==} engines: {node: '>=6.9.0'} '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.24.8': - resolution: {integrity: sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ==} + '@babel/traverse@7.28.0': + resolution: {integrity: sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==} engines: {node: '>=6.9.0'} - '@babel/types@7.27.6': - resolution: {integrity: sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==} + '@babel/types@7.28.1': + resolution: {integrity: sha512-x0LvFTekgSX+83TI28Y9wYPUfzrnl2aT5+5QLnO6v7mSJYtEEevuDRN0F0uSHRk1G1IWZC43o00Y0xDDrpBGPQ==} engines: {node: '>=6.9.0'} '@biomejs/biome@2.0.0': @@ -259,189 +240,191 @@ packages: resolution: {integrity: sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==} engines: {node: '>=18'} - '@csstools/css-calc@2.1.2': - resolution: {integrity: sha512-TklMyb3uBB28b5uQdxjReG4L80NxAqgrECqLZFQbyLekwwlcDDS8r3f07DKqeo8C4926Br0gf/ZDe17Zv4wIuw==} + '@csstools/css-calc@2.1.4': + resolution: {integrity: sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-parser-algorithms': ^3.0.4 - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-color-parser@3.0.8': - resolution: {integrity: sha512-pdwotQjCCnRPuNi06jFuP68cykU1f3ZWExLe/8MQ1LOs8Xq+fTkYgd+2V8mWUWMrOn9iS2HftPVaMZDaXzGbhQ==} + '@csstools/css-color-parser@3.0.10': + resolution: {integrity: sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-parser-algorithms': ^3.0.4 - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-parser-algorithms@3.0.4': - resolution: {integrity: sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==} + '@csstools/css-parser-algorithms@3.0.5': + resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} engines: {node: '>=18'} peerDependencies: - '@csstools/css-tokenizer': ^3.0.3 + '@csstools/css-tokenizer': ^3.0.4 - '@csstools/css-tokenizer@3.0.3': - resolution: {integrity: sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==} + '@csstools/css-tokenizer@3.0.4': + resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} engines: {node: '>=18'} - '@esbuild/aix-ppc64@0.25.2': - resolution: {integrity: sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==} + '@esbuild/aix-ppc64@0.25.6': + resolution: {integrity: sha512-ShbM/3XxwuxjFiuVBHA+d3j5dyac0aEVVq1oluIDf71hUw0aRF59dV/efUsIwFnR6m8JNM2FjZOzmaZ8yG61kw==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.25.2': - resolution: {integrity: sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==} + '@esbuild/android-arm64@0.25.6': + resolution: {integrity: sha512-hd5zdUarsK6strW+3Wxi5qWws+rJhCCbMiC9QZyzoxfk5uHRIE8T287giQxzVpEvCwuJ9Qjg6bEjcRJcgfLqoA==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.25.2': - resolution: {integrity: sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==} + '@esbuild/android-arm@0.25.6': + resolution: {integrity: sha512-S8ToEOVfg++AU/bHwdksHNnyLyVM+eMVAOf6yRKFitnwnbwwPNqKr3srzFRe7nzV69RQKb5DgchIX5pt3L53xg==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.25.2': - resolution: {integrity: sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==} + '@esbuild/android-x64@0.25.6': + resolution: {integrity: sha512-0Z7KpHSr3VBIO9A/1wcT3NTy7EB4oNC4upJ5ye3R7taCc2GUdeynSLArnon5G8scPwaU866d3H4BCrE5xLW25A==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.25.2': - resolution: {integrity: sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==} + '@esbuild/darwin-arm64@0.25.6': + resolution: {integrity: sha512-FFCssz3XBavjxcFxKsGy2DYK5VSvJqa6y5HXljKzhRZ87LvEi13brPrf/wdyl/BbpbMKJNOr1Sd0jtW4Ge1pAA==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.25.2': - resolution: {integrity: sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==} + '@esbuild/darwin-x64@0.25.6': + resolution: {integrity: sha512-GfXs5kry/TkGM2vKqK2oyiLFygJRqKVhawu3+DOCk7OxLy/6jYkWXhlHwOoTb0WqGnWGAS7sooxbZowy+pK9Yg==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.25.2': - resolution: {integrity: sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==} + '@esbuild/freebsd-arm64@0.25.6': + resolution: {integrity: sha512-aoLF2c3OvDn2XDTRvn8hN6DRzVVpDlj2B/F66clWd/FHLiHaG3aVZjxQX2DYphA5y/evbdGvC6Us13tvyt4pWg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.25.2': - resolution: {integrity: sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==} + '@esbuild/freebsd-x64@0.25.6': + resolution: {integrity: sha512-2SkqTjTSo2dYi/jzFbU9Plt1vk0+nNg8YC8rOXXea+iA3hfNJWebKYPs3xnOUf9+ZWhKAaxnQNUf2X9LOpeiMQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.25.2': - resolution: {integrity: sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==} + '@esbuild/linux-arm64@0.25.6': + resolution: {integrity: sha512-b967hU0gqKd9Drsh/UuAm21Khpoh6mPBSgz8mKRq4P5mVK8bpA+hQzmm/ZwGVULSNBzKdZPQBRT3+WuVavcWsQ==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.25.2': - resolution: {integrity: sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==} + '@esbuild/linux-arm@0.25.6': + resolution: {integrity: sha512-SZHQlzvqv4Du5PrKE2faN0qlbsaW/3QQfUUc6yO2EjFcA83xnwm91UbEEVx4ApZ9Z5oG8Bxz4qPE+HFwtVcfyw==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.25.2': - resolution: {integrity: sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==} + '@esbuild/linux-ia32@0.25.6': + resolution: {integrity: sha512-aHWdQ2AAltRkLPOsKdi3xv0mZ8fUGPdlKEjIEhxCPm5yKEThcUjHpWB1idN74lfXGnZ5SULQSgtr5Qos5B0bPw==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.25.2': - resolution: {integrity: sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==} + '@esbuild/linux-loong64@0.25.6': + resolution: {integrity: sha512-VgKCsHdXRSQ7E1+QXGdRPlQ/e08bN6WMQb27/TMfV+vPjjTImuT9PmLXupRlC90S1JeNNW5lzkAEO/McKeJ2yg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.25.2': - resolution: {integrity: sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==} + '@esbuild/linux-mips64el@0.25.6': + resolution: {integrity: sha512-WViNlpivRKT9/py3kCmkHnn44GkGXVdXfdc4drNmRl15zVQ2+D2uFwdlGh6IuK5AAnGTo2qPB1Djppj+t78rzw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.25.2': - resolution: {integrity: sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==} + '@esbuild/linux-ppc64@0.25.6': + resolution: {integrity: sha512-wyYKZ9NTdmAMb5730I38lBqVu6cKl4ZfYXIs31Baf8aoOtB4xSGi3THmDYt4BTFHk7/EcVixkOV2uZfwU3Q2Jw==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.25.2': - resolution: {integrity: sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==} + '@esbuild/linux-riscv64@0.25.6': + resolution: {integrity: sha512-KZh7bAGGcrinEj4qzilJ4hqTY3Dg2U82c8bv+e1xqNqZCrCyc+TL9AUEn5WGKDzm3CfC5RODE/qc96OcbIe33w==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.25.2': - resolution: {integrity: sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==} + '@esbuild/linux-s390x@0.25.6': + resolution: {integrity: sha512-9N1LsTwAuE9oj6lHMyyAM+ucxGiVnEqUdp4v7IaMmrwb06ZTEVCIs3oPPplVsnjPfyjmxwHxHMF8b6vzUVAUGw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.25.2': - resolution: {integrity: sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==} + '@esbuild/linux-x64@0.25.6': + resolution: {integrity: sha512-A6bJB41b4lKFWRKNrWoP2LHsjVzNiaurf7wyj/XtFNTsnPuxwEBWHLty+ZE0dWBKuSK1fvKgrKaNjBS7qbFKig==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.25.2': - resolution: {integrity: sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==} + '@esbuild/netbsd-arm64@0.25.6': + resolution: {integrity: sha512-IjA+DcwoVpjEvyxZddDqBY+uJ2Snc6duLpjmkXm/v4xuS3H+3FkLZlDm9ZsAbF9rsfP3zeA0/ArNDORZgrxR/Q==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.25.2': - resolution: {integrity: sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==} + '@esbuild/netbsd-x64@0.25.6': + resolution: {integrity: sha512-dUXuZr5WenIDlMHdMkvDc1FAu4xdWixTCRgP7RQLBOkkGgwuuzaGSYcOpW4jFxzpzL1ejb8yF620UxAqnBrR9g==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.25.2': - resolution: {integrity: sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==} + '@esbuild/openbsd-arm64@0.25.6': + resolution: {integrity: sha512-l8ZCvXP0tbTJ3iaqdNf3pjaOSd5ex/e6/omLIQCVBLmHTlfXW3zAxQ4fnDmPLOB1x9xrcSi/xtCWFwCZRIaEwg==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.25.2': - resolution: {integrity: sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==} + '@esbuild/openbsd-x64@0.25.6': + resolution: {integrity: sha512-hKrmDa0aOFOr71KQ/19JC7az1P0GWtCN1t2ahYAf4O007DHZt/dW8ym5+CUdJhQ/qkZmI1HAF8KkJbEFtCL7gw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.25.2': - resolution: {integrity: sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==} + '@esbuild/openharmony-arm64@0.25.6': + resolution: {integrity: sha512-+SqBcAWoB1fYKmpWoQP4pGtx+pUUC//RNYhFdbcSA16617cchuryuhOCRpPsjCblKukAckWsV+aQ3UKT/RMPcA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.25.6': + resolution: {integrity: sha512-dyCGxv1/Br7MiSC42qinGL8KkG4kX0pEsdb0+TKhmJZgCUDBGmyo1/ArCjNGiOLiIAgdbWgmWgib4HoCi5t7kA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.25.2': - resolution: {integrity: sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==} + '@esbuild/win32-arm64@0.25.6': + resolution: {integrity: sha512-42QOgcZeZOvXfsCBJF5Afw73t4veOId//XD3i+/9gSkhSV6Gk3VPlWncctI+JcOyERv85FUo7RxuxGy+z8A43Q==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.25.2': - resolution: {integrity: sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==} + '@esbuild/win32-ia32@0.25.6': + resolution: {integrity: sha512-4AWhgXmDuYN7rJI6ORB+uU9DHLq/erBbuMoAuB4VWJTu5KtCgcKYPynF0YI1VkBNuEfjNlLrFr9KZPJzrtLkrQ==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.25.2': - resolution: {integrity: sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==} + '@esbuild/win32-x64@0.25.6': + resolution: {integrity: sha512-NgJPHHbEpLQgDH2MjQu90pzW/5vvXIZ7KOnPyNBm92A6WgZ/7b6fJyUBjoumLqeOQQGqY2QjQxRo97ah4Sj0cA==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@gerrit0/mini-shiki@3.2.2': - resolution: {integrity: sha512-vaZNGhGLKMY14HbF53xxHNgFO9Wz+t5lTlGNpl2N9xFiKQ0I5oIe0vKjU9dh7Nb3Dw6lZ7wqUE0ri+zcdpnK+Q==} + '@gerrit0/mini-shiki@3.7.0': + resolution: {integrity: sha512-7iY9wg4FWXmeoFJpUL2u+tsmh0d0jcEJHAIzVxl3TG4KL493JNnisdLAILZ77zcD+z3J0keEXZ+lFzUgzQzPDg==} - '@hpcc-js/wasm@2.22.4': - resolution: {integrity: sha512-58JkRkxZffiBAbZhc7z+9iaaAOmn1cyxLL3rRwsUvco/I0Wwb7uVAlHM9HiU6XASe2k11jrIjCFff1t9QKjlqg==} - hasBin: true - - '@inquirer/checkbox@4.1.4': - resolution: {integrity: sha512-d30576EZdApjAMceijXA5jDzRQHT/MygbC+J8I7EqA6f/FRpYxlRtRJbHF8gHeWYeSdOuTEJqonn7QLB1ELezA==} + '@inquirer/checkbox@4.1.9': + resolution: {integrity: sha512-DBJBkzI5Wx4jFaYm221LHvAhpKYkhVS0k9plqHwaHhofGNxvYB7J3Bz8w+bFJ05zaMb0sZNHo4KdmENQFlNTuQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -449,8 +432,8 @@ packages: '@types/node': optional: true - '@inquirer/confirm@5.1.8': - resolution: {integrity: sha512-dNLWCYZvXDjO3rnQfk2iuJNL4Ivwz/T2+C3+WnNfJKsNGSuOs3wAo2F6e0p946gtSAk31nZMfW+MRmYaplPKsg==} + '@inquirer/confirm@5.1.13': + resolution: {integrity: sha512-EkCtvp67ICIVVzjsquUiVSd+V5HRGOGQfsqA4E4vMWhYnB7InUL0pa0TIWt1i+OfP16Gkds8CdIu6yGZwOM1Yw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -458,8 +441,8 @@ packages: '@types/node': optional: true - '@inquirer/core@10.1.9': - resolution: {integrity: sha512-sXhVB8n20NYkUBfDYgizGHlpRVaCRjtuzNZA6xpALIUbkgfd2Hjz+DfEN6+h1BRnuxw0/P4jCIMjMsEOAMwAJw==} + '@inquirer/core@10.1.14': + resolution: {integrity: sha512-Ma+ZpOJPewtIYl6HZHZckeX1STvDnHTCB2GVINNUlSEn2Am6LddWwfPkIGY0IUFVjUUrr/93XlBwTK6mfLjf0A==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -467,8 +450,8 @@ packages: '@types/node': optional: true - '@inquirer/editor@4.2.9': - resolution: {integrity: sha512-8HjOppAxO7O4wV1ETUlJFg6NDjp/W2NP5FB9ZPAcinAlNT4ZIWOLe2pUVwmmPRSV0NMdI5r/+lflN55AwZOKSw==} + '@inquirer/editor@4.2.14': + resolution: {integrity: sha512-yd2qtLl4QIIax9DTMZ1ZN2pFrrj+yL3kgIWxm34SS6uwCr0sIhsNyudUjAo5q3TqI03xx4SEBkUJqZuAInp9uA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -476,8 +459,8 @@ packages: '@types/node': optional: true - '@inquirer/expand@4.0.11': - resolution: {integrity: sha512-OZSUW4hFMW2TYvX/Sv+NnOZgO8CHT2TU1roUCUIF2T+wfw60XFRRp9MRUPCT06cRnKL+aemt2YmTWwt7rOrNEA==} + '@inquirer/expand@4.0.16': + resolution: {integrity: sha512-oiDqafWzMtofeJyyGkb1CTPaxUkjIcSxePHHQCfif8t3HV9pHcw1Kgdw3/uGpDvaFfeTluwQtWiqzPVjAqS3zA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -485,12 +468,12 @@ packages: '@types/node': optional: true - '@inquirer/figures@1.0.11': - resolution: {integrity: sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==} + '@inquirer/figures@1.0.12': + resolution: {integrity: sha512-MJttijd8rMFcKJC8NYmprWr6hD3r9Gd9qUC0XwPNwoEPWSMVJwA2MlXxF+nhZZNMY+HXsWa+o7KY2emWYIn0jQ==} engines: {node: '>=18'} - '@inquirer/input@4.1.8': - resolution: {integrity: sha512-WXJI16oOZ3/LiENCAxe8joniNp8MQxF6Wi5V+EBbVA0ZIOpFcL4I9e7f7cXse0HJeIPCWO8Lcgnk98juItCi7Q==} + '@inquirer/input@4.2.0': + resolution: {integrity: sha512-opqpHPB1NjAmDISi3uvZOTrjEEU5CWVu/HBkDby8t93+6UxYX0Z7Ps0Ltjm5sZiEbWenjubwUkivAEYQmy9xHw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -498,8 +481,8 @@ packages: '@types/node': optional: true - '@inquirer/number@3.0.11': - resolution: {integrity: sha512-pQK68CsKOgwvU2eA53AG/4npRTH2pvs/pZ2bFvzpBhrznh8Mcwt19c+nMO7LHRr3Vreu1KPhNBF3vQAKrjIulw==} + '@inquirer/number@3.0.16': + resolution: {integrity: sha512-kMrXAaKGavBEoBYUCgualbwA9jWUx2TjMA46ek+pEKy38+LFpL9QHlTd8PO2kWPUgI/KB+qi02o4y2rwXbzr3Q==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -507,8 +490,8 @@ packages: '@types/node': optional: true - '@inquirer/password@4.0.11': - resolution: {integrity: sha512-dH6zLdv+HEv1nBs96Case6eppkRggMe8LoOTl30+Gq5Wf27AO/vHFgStTVz4aoevLdNXqwE23++IXGw4eiOXTg==} + '@inquirer/password@4.0.16': + resolution: {integrity: sha512-g8BVNBj5Zeb5/Y3cSN+hDUL7CsIFDIuVxb9EPty3lkxBaYpjL5BNRKSYOF9yOLe+JOcKFd+TSVeADQ4iSY7rbg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -516,8 +499,8 @@ packages: '@types/node': optional: true - '@inquirer/prompts@7.4.0': - resolution: {integrity: sha512-EZiJidQOT4O5PYtqnu1JbF0clv36oW2CviR66c7ma4LsupmmQlUwmdReGKRp456OWPWMz3PdrPiYg3aCk3op2w==} + '@inquirer/prompts@7.6.0': + resolution: {integrity: sha512-jAhL7tyMxB3Gfwn4HIJ0yuJ5pvcB5maYUcouGcgd/ub79f9MqZ+aVnBtuFf+VC2GTkCBF+R+eo7Vi63w5VZlzw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -525,8 +508,8 @@ packages: '@types/node': optional: true - '@inquirer/rawlist@4.0.11': - resolution: {integrity: sha512-uAYtTx0IF/PqUAvsRrF3xvnxJV516wmR6YVONOmCWJbbt87HcDHLfL9wmBQFbNJRv5kCjdYKrZcavDkH3sVJPg==} + '@inquirer/rawlist@4.1.4': + resolution: {integrity: sha512-5GGvxVpXXMmfZNtvWw4IsHpR7RzqAR624xtkPd1NxxlV5M+pShMqzL4oRddRkg8rVEOK9fKdJp1jjVML2Lr7TQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -534,8 +517,8 @@ packages: '@types/node': optional: true - '@inquirer/search@3.0.11': - resolution: {integrity: sha512-9CWQT0ikYcg6Ls3TOa7jljsD7PgjcsYEM0bYE+Gkz+uoW9u8eaJCRHJKkucpRE5+xKtaaDbrND+nPDoxzjYyew==} + '@inquirer/search@3.0.16': + resolution: {integrity: sha512-POCmXo+j97kTGU6aeRjsPyuCpQQfKcMXdeTMw708ZMtWrj5aykZvlUxH4Qgz3+Y1L/cAVZsSpA+UgZCu2GMOMg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -543,8 +526,8 @@ packages: '@types/node': optional: true - '@inquirer/select@4.1.0': - resolution: {integrity: sha512-z0a2fmgTSRN+YBuiK1ROfJ2Nvrpij5lVN3gPDkQGhavdvIVGHGW29LwYZfM/j42Ai2hUghTI/uoBuTbrJk42bA==} + '@inquirer/select@4.2.4': + resolution: {integrity: sha512-unTppUcTjmnbl/q+h8XeQDhAqIOmwWYWNyiiP2e3orXrg6tOaa5DHXja9PChCSbChOsktyKgOieRZFnajzxoBg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -552,8 +535,8 @@ packages: '@types/node': optional: true - '@inquirer/type@3.0.5': - resolution: {integrity: sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg==} + '@inquirer/type@3.0.7': + resolution: {integrity: sha512-PfunHQcjwnju84L+ycmcMKB/pTPIngjUJvfnRhKY6FKPuYXlM4aQCb/nIdTFR6BEhMjFvngzvng/vBAJMZpLSA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -569,29 +552,24 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} - engines: {node: '>=6.0.0'} + '@jridgewell/gen-mapping@0.3.12': + resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} + '@jridgewell/sourcemap-codec@1.5.4': + resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jridgewell/trace-mapping@0.3.29': + resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==} '@material/material-color-utilities@0.2.7': resolution: {integrity: sha512-0FCeqG6WvK4/Cc06F/xXMd/pv4FeisI0c1tUpBbfhA2n9Y8eZEv4Karjbmf2ZqQCPUWMrGp8A571tCjizxoTiQ==} - '@mswjs/interceptors@0.37.6': - resolution: {integrity: sha512-wK+5pLK5XFmgtH3aQ2YVvA3HohS3xqV/OxuVOdNx9Wpnz7VE/fnC+e1A7ln6LFYeck7gOJ/dsZV6OLplOtAJ2w==} + '@mswjs/interceptors@0.39.2': + resolution: {integrity: sha512-RuzCup9Ct91Y7V79xwCb146RaBRHZ7NBbrIUySumd1rpKqHL5OonaqrGIbug5hNwP/fRyxFMA6ISgw4FTtYFYg==} engines: {node: '>=18'} '@open-draft/deferred-promise@2.2.0': @@ -603,130 +581,176 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + '@oxlint/darwin-arm64@1.6.0': + resolution: {integrity: sha512-m3wyqBh1TOHjpr/dXeIZY7OoX+MQazb+bMHQdDtwUvefrafUx+5YHRvulYh1sZSQ449nQ3nk3qj5qj535vZRjg==} + cpu: [arm64] + os: [darwin] + + '@oxlint/darwin-x64@1.6.0': + resolution: {integrity: sha512-75fJfF/9xNypr7cnOYoZBhfmG1yP7ex3pUOeYGakmtZRffO9z1i1quLYhjZsmaDXsAIZ3drMhenYHMmFKS3SRg==} + cpu: [x64] + os: [darwin] + + '@oxlint/linux-arm64-gnu@1.6.0': + resolution: {integrity: sha512-YhXGf0FXa72bEt4F7eTVKx5X3zWpbAOPnaA/dZ6/g8tGhw1m9IFjrabVHFjzcx3dQny4MgA59EhyElkDvpUe8A==} + cpu: [arm64] + os: [linux] + + '@oxlint/linux-arm64-musl@1.6.0': + resolution: {integrity: sha512-T3JDhx8mjGjvh5INsPZJrlKHmZsecgDYvtvussKRdkc1Nnn7WC+jH9sh5qlmYvwzvmetlPVNezAoNvmGO9vtMg==} + cpu: [arm64] + os: [linux] + + '@oxlint/linux-x64-gnu@1.6.0': + resolution: {integrity: sha512-Dx7ghtAl8aXBdqofJpi338At6lkeCtTfoinTYQXd9/TEJx+f+zCGNlQO6nJz3ydJBX48FDuOFKkNC+lUlWrd8w==} + cpu: [x64] + os: [linux] + + '@oxlint/linux-x64-musl@1.6.0': + resolution: {integrity: sha512-7KvMGdWmAZtAtg6IjoEJHKxTXdAcrHnUnqfgs0JpXst7trquV2mxBeRZusQXwxpu4HCSomKMvJfsp1qKaqSFDg==} + cpu: [x64] + os: [linux] + + '@oxlint/win32-arm64@1.6.0': + resolution: {integrity: sha512-iSGC9RwX+dl7o5KFr5aH7Gq3nFbkq/3Gda6mxNPMvNkWrgXdIyiINxpyD8hJu566M+QSv1wEAu934BZotFDyoQ==} + cpu: [arm64] + os: [win32] + + '@oxlint/win32-x64@1.6.0': + resolution: {integrity: sha512-jOj3L/gfLc0IwgOTkZMiZ5c673i/hbAmidlaylT0gE6H18hln9HxPgp5GCf4E4y6mwEJlW8QC5hQi221+9otdA==} + cpu: [x64] + os: [win32] + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/rollup-android-arm-eabi@4.40.1': - resolution: {integrity: sha512-kxz0YeeCrRUHz3zyqvd7n+TVRlNyTifBsmnmNPtk3hQURUyG9eAB+usz6DAwagMusjx/zb3AjvDUvhFGDAexGw==} + '@rollup/rollup-android-arm-eabi@4.45.0': + resolution: {integrity: sha512-2o/FgACbji4tW1dzXOqAV15Eu7DdgbKsF2QKcxfG4xbh5iwU7yr5RRP5/U+0asQliSYv5M4o7BevlGIoSL0LXg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.40.1': - resolution: {integrity: sha512-PPkxTOisoNC6TpnDKatjKkjRMsdaWIhyuMkA4UsBXT9WEZY4uHezBTjs6Vl4PbqQQeu6oION1w2voYZv9yquCw==} + '@rollup/rollup-android-arm64@4.45.0': + resolution: {integrity: sha512-PSZ0SvMOjEAxwZeTx32eI/j5xSYtDCRxGu5k9zvzoY77xUNssZM+WV6HYBLROpY5CkXsbQjvz40fBb7WPwDqtQ==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.40.1': - resolution: {integrity: sha512-VWXGISWFY18v/0JyNUy4A46KCFCb9NVsH+1100XP31lud+TzlezBbz24CYzbnA4x6w4hx+NYCXDfnvDVO6lcAA==} + '@rollup/rollup-darwin-arm64@4.45.0': + resolution: {integrity: sha512-BA4yPIPssPB2aRAWzmqzQ3y2/KotkLyZukVB7j3psK/U3nVJdceo6qr9pLM2xN6iRP/wKfxEbOb1yrlZH6sYZg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.40.1': - resolution: {integrity: sha512-nIwkXafAI1/QCS7pxSpv/ZtFW6TXcNUEHAIA9EIyw5OzxJZQ1YDrX+CL6JAIQgZ33CInl1R6mHet9Y/UZTg2Bw==} + '@rollup/rollup-darwin-x64@4.45.0': + resolution: {integrity: sha512-Pr2o0lvTwsiG4HCr43Zy9xXrHspyMvsvEw4FwKYqhli4FuLE5FjcZzuQ4cfPe0iUFCvSQG6lACI0xj74FDZKRA==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.40.1': - resolution: {integrity: sha512-BdrLJ2mHTrIYdaS2I99mriyJfGGenSaP+UwGi1kB9BLOCu9SR8ZpbkmmalKIALnRw24kM7qCN0IOm6L0S44iWw==} + '@rollup/rollup-freebsd-arm64@4.45.0': + resolution: {integrity: sha512-lYE8LkE5h4a/+6VnnLiL14zWMPnx6wNbDG23GcYFpRW1V9hYWHAw9lBZ6ZUIrOaoK7NliF1sdwYGiVmziUF4vA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.40.1': - resolution: {integrity: sha512-VXeo/puqvCG8JBPNZXZf5Dqq7BzElNJzHRRw3vjBE27WujdzuOPecDPc/+1DcdcTptNBep3861jNq0mYkT8Z6Q==} + '@rollup/rollup-freebsd-x64@4.45.0': + resolution: {integrity: sha512-PVQWZK9sbzpvqC9Q0GlehNNSVHR+4m7+wET+7FgSnKG3ci5nAMgGmr9mGBXzAuE5SvguCKJ6mHL6vq1JaJ/gvw==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.40.1': - resolution: {integrity: sha512-ehSKrewwsESPt1TgSE/na9nIhWCosfGSFqv7vwEtjyAqZcvbGIg4JAcV7ZEh2tfj/IlfBeZjgOXm35iOOjadcg==} + '@rollup/rollup-linux-arm-gnueabihf@4.45.0': + resolution: {integrity: sha512-hLrmRl53prCcD+YXTfNvXd776HTxNh8wPAMllusQ+amcQmtgo3V5i/nkhPN6FakW+QVLoUUr2AsbtIRPFU3xIA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.40.1': - resolution: {integrity: sha512-m39iO/aaurh5FVIu/F4/Zsl8xppd76S4qoID8E+dSRQvTyZTOI2gVk3T4oqzfq1PtcvOfAVlwLMK3KRQMaR8lg==} + '@rollup/rollup-linux-arm-musleabihf@4.45.0': + resolution: {integrity: sha512-XBKGSYcrkdiRRjl+8XvrUR3AosXU0NvF7VuqMsm7s5nRy+nt58ZMB19Jdp1RdqewLcaYnpk8zeVs/4MlLZEJxw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.40.1': - resolution: {integrity: sha512-Y+GHnGaku4aVLSgrT0uWe2o2Rq8te9hi+MwqGF9r9ORgXhmHK5Q71N757u0F8yU1OIwUIFy6YiJtKjtyktk5hg==} + '@rollup/rollup-linux-arm64-gnu@4.45.0': + resolution: {integrity: sha512-fRvZZPUiBz7NztBE/2QnCS5AtqLVhXmUOPj9IHlfGEXkapgImf4W9+FSkL8cWqoAjozyUzqFmSc4zh2ooaeF6g==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.40.1': - resolution: {integrity: sha512-jEwjn3jCA+tQGswK3aEWcD09/7M5wGwc6+flhva7dsQNRZZTe30vkalgIzV4tjkopsTS9Jd7Y1Bsj6a4lzz8gQ==} + '@rollup/rollup-linux-arm64-musl@4.45.0': + resolution: {integrity: sha512-Btv2WRZOcUGi8XU80XwIvzTg4U6+l6D0V6sZTrZx214nrwxw5nAi8hysaXj/mctyClWgesyuxbeLylCBNauimg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.40.1': - resolution: {integrity: sha512-ySyWikVhNzv+BV/IDCsrraOAZ3UaC8SZB67FZlqVwXwnFhPihOso9rPOxzZbjp81suB1O2Topw+6Ug3JNegejQ==} + '@rollup/rollup-linux-loongarch64-gnu@4.45.0': + resolution: {integrity: sha512-Li0emNnwtUZdLwHjQPBxn4VWztcrw/h7mgLyHiEI5Z0MhpeFGlzaiBHpSNVOMB/xucjXTTcO+dhv469Djr16KA==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.40.1': - resolution: {integrity: sha512-BvvA64QxZlh7WZWqDPPdt0GH4bznuL6uOO1pmgPnnv86rpUpc8ZxgZwcEgXvo02GRIZX1hQ0j0pAnhwkhwPqWg==} + '@rollup/rollup-linux-powerpc64le-gnu@4.45.0': + resolution: {integrity: sha512-sB8+pfkYx2kvpDCfd63d5ScYT0Fz1LO6jIb2zLZvmK9ob2D8DeVqrmBDE0iDK8KlBVmsTNzrjr3G1xV4eUZhSw==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.40.1': - resolution: {integrity: sha512-EQSP+8+1VuSulm9RKSMKitTav89fKbHymTf25n5+Yr6gAPZxYWpj3DzAsQqoaHAk9YX2lwEyAf9S4W8F4l3VBQ==} + '@rollup/rollup-linux-riscv64-gnu@4.45.0': + resolution: {integrity: sha512-5GQ6PFhh7E6jQm70p1aW05G2cap5zMOvO0se5JMecHeAdj5ZhWEHbJ4hiKpfi1nnnEdTauDXxPgXae/mqjow9w==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.40.1': - resolution: {integrity: sha512-n/vQ4xRZXKuIpqukkMXZt9RWdl+2zgGNx7Uda8NtmLJ06NL8jiHxUawbwC+hdSq1rrw/9CghCpEONor+l1e2gA==} + '@rollup/rollup-linux-riscv64-musl@4.45.0': + resolution: {integrity: sha512-N/euLsBd1rekWcuduakTo/dJw6U6sBP3eUq+RXM9RNfPuWTvG2w/WObDkIvJ2KChy6oxZmOSC08Ak2OJA0UiAA==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.40.1': - resolution: {integrity: sha512-h8d28xzYb98fMQKUz0w2fMc1XuGzLLjdyxVIbhbil4ELfk5/orZlSTpF/xdI9C8K0I8lCkq+1En2RJsawZekkg==} + '@rollup/rollup-linux-s390x-gnu@4.45.0': + resolution: {integrity: sha512-2l9sA7d7QdikL0xQwNMO3xURBUNEWyHVHfAsHsUdq+E/pgLTUcCE+gih5PCdmyHmfTDeXUWVhqL0WZzg0nua3g==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.40.1': - resolution: {integrity: sha512-XiK5z70PEFEFqcNj3/zRSz/qX4bp4QIraTy9QjwJAb/Z8GM7kVUsD0Uk8maIPeTyPCP03ChdI+VVmJriKYbRHQ==} + '@rollup/rollup-linux-x64-gnu@4.45.0': + resolution: {integrity: sha512-XZdD3fEEQcwG2KrJDdEQu7NrHonPxxaV0/w2HpvINBdcqebz1aL+0vM2WFJq4DeiAVT6F5SUQas65HY5JDqoPw==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.40.1': - resolution: {integrity: sha512-2BRORitq5rQ4Da9blVovzNCMaUlyKrzMSvkVR0D4qPuOy/+pMCrh1d7o01RATwVy+6Fa1WBw+da7QPeLWU/1mQ==} + '@rollup/rollup-linux-x64-musl@4.45.0': + resolution: {integrity: sha512-7ayfgvtmmWgKWBkCGg5+xTQ0r5V1owVm67zTrsEY1008L5ro7mCyGYORomARt/OquB9KY7LpxVBZes+oSniAAQ==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.40.1': - resolution: {integrity: sha512-b2bcNm9Kbde03H+q+Jjw9tSfhYkzrDUf2d5MAd1bOJuVplXvFhWz7tRtWvD8/ORZi7qSCy0idW6tf2HgxSXQSg==} + '@rollup/rollup-win32-arm64-msvc@4.45.0': + resolution: {integrity: sha512-B+IJgcBnE2bm93jEW5kHisqvPITs4ddLOROAcOc/diBgrEiQJJ6Qcjby75rFSmH5eMGrqJryUgJDhrfj942apQ==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.40.1': - resolution: {integrity: sha512-DfcogW8N7Zg7llVEfpqWMZcaErKfsj9VvmfSyRjCyo4BI3wPEfrzTtJkZG6gKP/Z92wFm6rz2aDO7/JfiR/whA==} + '@rollup/rollup-win32-ia32-msvc@4.45.0': + resolution: {integrity: sha512-+CXwwG66g0/FpWOnP/v1HnrGVSOygK/osUbu3wPRy8ECXjoYKjRAyfxYpDQOfghC5qPJYLPH0oN4MCOjwgdMug==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.40.1': - resolution: {integrity: sha512-ECyOuDeH3C1I8jH2MK1RtBJW+YPMvSfT0a5NN0nHfQYnDSJ6tUiZH3gzwVP5/Kfh/+Tt7tpWVF9LXNTnhTJ3kA==} + '@rollup/rollup-win32-x64-msvc@4.45.0': + resolution: {integrity: sha512-SRf1cytG7wqcHVLrBc9VtPK4pU5wxiB/lNIkNmW2ApKXIg+RpqwHfsaEK+e7eH4A1BpI6BX/aBWXxZCIrJg3uA==} cpu: [x64] os: [win32] - '@shikijs/engine-oniguruma@3.2.1': - resolution: {integrity: sha512-wZZAkayEn6qu2+YjenEoFqj0OyQI64EWsNR6/71d1EkG4sxEOFooowKivsWPpaWNBu3sxAG+zPz5kzBL/SsreQ==} + '@shikijs/engine-oniguruma@3.7.0': + resolution: {integrity: sha512-5BxcD6LjVWsGu4xyaBC5bu8LdNgPCVBnAkWTtOCs/CZxcB22L8rcoWfv7Hh/3WooVjBZmFtyxhgvkQFedPGnFw==} - '@shikijs/langs@3.2.1': - resolution: {integrity: sha512-If0iDHYRSGbihiA8+7uRsgb1er1Yj11pwpX1c6HLYnizDsKAw5iaT3JXj5ZpaimXSWky/IhxTm7C6nkiYVym+A==} + '@shikijs/langs@3.7.0': + resolution: {integrity: sha512-1zYtdfXLr9xDKLTGy5kb7O0zDQsxXiIsw1iIBcNOO8Yi5/Y1qDbJ+0VsFoqTlzdmneO8Ij35g7QKF8kcLyznCQ==} - '@shikijs/themes@3.2.1': - resolution: {integrity: sha512-k5DKJUT8IldBvAm8WcrDT5+7GA7se6lLksR+2E3SvyqGTyFMzU2F9Gb7rmD+t+Pga1MKrYFxDIeyWjMZWM6uBQ==} + '@shikijs/themes@3.7.0': + resolution: {integrity: sha512-VJx8497iZPy5zLiiCTSIaOChIcKQwR0FebwE9S3rcN0+J/GTWwQ1v/bqhTbpbY3zybPKeO8wdammqkpXc4NVjQ==} - '@shikijs/types@3.2.1': - resolution: {integrity: sha512-/NTWAk4KE2M8uac0RhOsIhYQf4pdU0OywQuYDGIGAJ6Mjunxl2cGiuLkvu4HLCMn+OTTLRWkjZITp+aYJv60yA==} + '@shikijs/types@3.7.0': + resolution: {integrity: sha512-MGaLeaRlSWpnP0XSAum3kP3a8vtcTsITqoEPYdt3lQG3YCdQH4DnEhodkYcNMcU0uW0RffhoD1O3e0vG5eSBBg==} '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + '@types/cookie@0.6.0': resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} - '@types/estree@1.0.7': - resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} @@ -734,11 +758,11 @@ packages: '@types/jsdom@21.1.7': resolution: {integrity: sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==} - '@types/node@22.13.14': - resolution: {integrity: sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==} + '@types/node@22.16.3': + resolution: {integrity: sha512-sr4Xz74KOUeYadexo1r8imhRtlVXcs+j3XK3TcoiYk7B1t3YRVJgtaD3cwX73NYb71pmVuMLNRhJ9XKdoDB74g==} - '@types/statuses@2.0.5': - resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} + '@types/statuses@2.0.6': + resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} @@ -746,39 +770,39 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@vitest/coverage-istanbul@3.0.9': - resolution: {integrity: sha512-/TXh2qmOhclmVPjOnPTpIO4Xr6l2P5EwyXQygenwq4/ZQ/vPsrz+GCRZF9kBeQi6xrGcHv368Si9PGImWQawVg==} + '@vitest/coverage-istanbul@3.2.4': + resolution: {integrity: sha512-IDlpuFJiWU9rhcKLkpzj8mFu/lpe64gVgnV15ZOrYx1iFzxxrxCzbExiUEKtwwXRvEiEMUS6iZeYgnMxgbqbxQ==} peerDependencies: - vitest: 3.0.9 + vitest: 3.2.4 - '@vitest/expect@3.0.9': - resolution: {integrity: sha512-5eCqRItYgIML7NNVgJj6TVCmdzE7ZVgJhruW0ziSQV4V7PvLkDL1bBkBdcTs/VuIz0IxPb5da1IDSqc1TR9eig==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} - '@vitest/mocker@3.0.9': - resolution: {integrity: sha512-ryERPIBOnvevAkTq+L1lD+DTFBRcjueL9lOUfXsLfwP92h4e+Heb+PjiqS3/OURWPtywfafK0kj++yDFjWUmrA==} + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 peerDependenciesMeta: msw: optional: true vite: optional: true - '@vitest/pretty-format@3.0.9': - resolution: {integrity: sha512-OW9F8t2J3AwFEwENg3yMyKWweF7oRJlMyHOMIhO5F3n0+cgQAJZBjNgrF8dLwFTEXl5jUqBLXd9QyyKv8zEcmA==} + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} - '@vitest/runner@3.0.9': - resolution: {integrity: sha512-NX9oUXgF9HPfJSwl8tUZCMP1oGx2+Sf+ru6d05QjzQz4OwWg0psEzwY6VexP2tTHWdOkhKHUIZH+fS6nA7jfOw==} + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} - '@vitest/snapshot@3.0.9': - resolution: {integrity: sha512-AiLUiuZ0FuA+/8i19mTYd+re5jqjEc2jZbgJ2up0VY0Ddyyxg/uUtBDpIFAy4uzKaQxOW8gMgBdAJJ2ydhu39A==} + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} - '@vitest/spy@3.0.9': - resolution: {integrity: sha512-/CcK2UDl0aQ2wtkp3YVWldrpLRNCfVcIOFGlVGKO4R5eajsH393Z1yiXLVQ7vWsj26JOEjeZI0x5sm5P4OGUNQ==} + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} - '@vitest/utils@3.0.9': - resolution: {integrity: sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==} + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} acorn-jsx-walk@2.0.0: resolution: {integrity: sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA==} @@ -788,21 +812,21 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn-loose@8.4.0: - resolution: {integrity: sha512-M0EUka6rb+QC4l9Z3T0nJEzNOO7JcoJlYMrBlyBCiFSXRyxjLKayd4TbQs2FDRWQU1h9FR7QVNHt+PEaoNL5rQ==} + acorn-loose@8.5.2: + resolution: {integrity: sha512-PPvV6g8UGMGgjrMu+n/f9E/tCSkNQ2Y97eFvuVdJfG11+xdIeDcLyNdC8SHcrHbRqkfwLASdplyR6B6sKM1U4A==} engines: {node: '>=0.4.0'} - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} engines: {node: '>=0.4.0'} - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} hasBin: true - agent-base@7.1.3: - resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} ajv@8.17.1: @@ -816,8 +840,8 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} ansi-styles@4.3.0: @@ -835,17 +859,14 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} brace-expansion@2.0.2: resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} - browserslist@4.23.2: - resolution: {integrity: sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==} + browserslist@4.25.1: + resolution: {integrity: sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -865,12 +886,12 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - caniuse-lite@1.0.30001642: - resolution: {integrity: sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==} + caniuse-lite@1.0.30001727: + resolution: {integrity: sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==} - chai@5.2.0: - resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==} - engines: {node: '>=12'} + chai@5.2.1: + resolution: {integrity: sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==} + engines: {node: '>=18'} chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} @@ -902,12 +923,8 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - commander@12.1.0: - resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + commander@13.1.0: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} engines: {node: '>=18'} compare-versions@6.1.1: @@ -936,8 +953,8 @@ packages: cssfontparser@1.2.1: resolution: {integrity: sha512-6tun4LoZnj7VN6YeegOVb67KBX/7JJsqvj+pv3ZA7F878/eN33AbGa5b/S/wXxS/tcp8nc40xRUrsPlxIyNUPg==} - cssstyle@4.3.0: - resolution: {integrity: sha512-6r0NiY0xizYqfBvWp1G7WXJ06/bZyrk7Dc6PHql82C/pKGUTKu4yAX4Y8JPamb1ob9nBKuxWzCGTRuGwU3yxJQ==} + cssstyle@4.6.0: + resolution: {integrity: sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==} engines: {node: '>=18'} dagre@0.8.5: @@ -947,8 +964,8 @@ packages: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} - debug@4.4.0: - resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -956,8 +973,8 @@ packages: supports-color: optional: true - decimal.js@10.4.3: - resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} @@ -967,12 +984,8 @@ packages: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - dependency-cruiser@16.3.10: - resolution: {integrity: sha512-WkCnibHBfvaiaQ+S46LZ6h4AR6oj42Vsf5/0Vgtrwdwn7ZekMJdZ/ALoTwNp/RaGlKW+MbV/fhSZOvmhAWVWzQ==} + dependency-cruiser@16.10.4: + resolution: {integrity: sha512-hrxVOjIm8idZ9ZVDGSyyG3SHiNcEUPhL6RTEmO/3wfQWLepH5pA3nuDMMrcJ1DkZztFA7xg3tk8OVO+MmwwH9w==} engines: {node: ^18.17||>=20} hasBin: true @@ -983,8 +996,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.4.830: - resolution: {integrity: sha512-TrPKKH20HeN0J1LHzsYLs2qwXrp8TF4nHdu4sq61ozGbzMpWhI7iIOPYPPkxeq1azMT9PZ8enPFcftbs/Npcjg==} + electron-to-chromium@1.5.182: + resolution: {integrity: sha512-Lv65Btwv9W4J9pyODI6EWpdnhfvrve/us5h1WspW8B2Fb0366REPtY3hX7ounk1CkV/TBjWCEvCBBbYbmV0qCA==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -992,14 +1005,18 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - enhanced-resolve@5.17.1: - resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} + enhanced-resolve@5.18.2: + resolution: {integrity: sha512-6Jw4sE1maoRJo3q8MsSIn2onJFbLTOjY9hlx4DZXmOKvLRd1Ok2kXmAGXaafL2+ijsJZ1ClYbl/pmqr9+k4iUQ==} engines: {node: '>=10.13.0'} entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} + entities@6.0.1: + resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} + engines: {node: '>=0.12'} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -1008,24 +1025,20 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} - es-module-lexer@1.6.0: - resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} - es-set-tostringtag@2.1.0: - resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} - engines: {node: '>= 0.4'} - - esbuild@0.25.2: - resolution: {integrity: sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==} + esbuild@0.25.6: + resolution: {integrity: sha512-GVuzuUwtdsghE3ocJ9Bs8PNoF13HNQ5TXbEi2AhvVb8xU1Iwt9Fos9FEamfoee+u/TOsn7GUWc04lz46n2bbTg==} engines: {node: '>=18'} hasBin: true - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} estree-walker@3.0.3: @@ -1041,8 +1054,8 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - expect-type@1.1.0: - resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} + expect-type@1.2.2: + resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} engines: {node: '>=12.0.0'} external-editor@3.1.0: @@ -1052,25 +1065,21 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-uri@3.0.1: - resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} + fast-uri@3.0.6: + resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} - fdir@6.4.4: - resolution: {integrity: sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==} + fdir@6.4.6: + resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: picomatch: optional: true - foreground-child@3.2.1: - resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.2: - resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} - engines: {node: '>= 6'} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -1103,10 +1112,6 @@ packages: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} engines: {node: '>=18'} - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} @@ -1128,8 +1133,8 @@ packages: peerDependencies: graphology-types: '>=0.24.0' - graphql@16.9.0: - resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==} + graphql@16.11.0: + resolution: {integrity: sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -1143,10 +1148,6 @@ packages: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} - has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} - hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -1169,8 +1170,8 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} - i18next-browser-languagedetector@8.0.4: - resolution: {integrity: sha512-f3frU3pIxD50/Tz20zx9TD9HobKYg47fmAETb117GKGPrhwcSSPJDoCposXlVycVebQ9GQohC3Efbpq7/nnJ5w==} + i18next-browser-languagedetector@8.2.0: + resolution: {integrity: sha512-P+3zEKLnOF0qmiesW383vsLdtQVyKtCNA9cjSoKCppTKPQVfKd2W8hbVo5ZhNJKDqeM7BOcvNoKJOjpHh4Js9g==} i18next-http-backend@2.7.3: resolution: {integrity: sha512-FgZxrXdRA5u44xfYsJlEBL4/KH3f2IluBpgV/7riW0YW2VEyM8FzVt2XHAOi6id0Ppj7vZvCZVpp5LrGXnc8Ig==} @@ -1202,8 +1203,8 @@ packages: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} immediate@3.0.6: @@ -1216,8 +1217,8 @@ packages: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - inquirer@12.5.0: - resolution: {integrity: sha512-aiBBq5aKF1k87MTxXDylLfwpRwToShiHrSv4EmB07EYyLgmnjEz5B3rn0aGw1X3JA/64Ngf2T54oGwc+BCsPIQ==} + inquirer@12.7.0: + resolution: {integrity: sha512-KKFRc++IONSyE2UYw9CJ1V0IWx5yQKomwB+pp3cWomWs+v2+ZsG11G2OVfAjFS6WWCppKw+RfKmpqGfSzD5QBQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -1229,8 +1230,8 @@ packages: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} - is-core-module@2.15.0: - resolution: {integrity: sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} is-fullwidth-code-point@3.0.0: @@ -1289,12 +1290,15 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsdom@26.0.0: - resolution: {integrity: sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw==} + jsdom@26.1.0: + resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==} engines: {node: '>=18'} peerDependencies: canvas: ^3.0.0 @@ -1302,16 +1306,16 @@ packages: canvas: optional: true - jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} hasBin: true json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - json-stable-stringify@1.2.1: - resolution: {integrity: sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==} + json-stable-stringify@1.3.0: + resolution: {integrity: sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==} engines: {node: '>= 0.4'} json5@2.2.3: @@ -1329,58 +1333,58 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} - lefthook-darwin-arm64@1.11.6: - resolution: {integrity: sha512-gWgdWrKgZgX+bKc6Vs/x7JkO+58lLOpRzpteLx//82D0MKVPlNZwjd4zz4AbIBXtM4Hcj+6gSsOzQ7QDXxjVvQ==} + lefthook-darwin-arm64@1.12.2: + resolution: {integrity: sha512-fTxeI9tEskrHjc3QyEO+AG7impBXY2Ed8V5aiRc3fw9POfYtVh9b5jRx90fjk2+ld5hf+Z1DsyyLq/vOHDFskQ==} cpu: [arm64] os: [darwin] - lefthook-darwin-x64@1.11.6: - resolution: {integrity: sha512-Ia0TjTKuYcSaDTuoCnbWtpPZ2VEoKzgn33OB90VjNaSVs4ooE0PIdpO+w00x1elqIaf1pbrpq6HgeB26Du8KbQ==} + lefthook-darwin-x64@1.12.2: + resolution: {integrity: sha512-T1dCDKAAfdHgYZ8qtrS02SJSHoR52RFcrGArFNll9Mu4ZSV19Sp8BO+kTwDUOcLYdcPGNaqOp9PkRBQGZWQC7g==} cpu: [x64] os: [darwin] - lefthook-freebsd-arm64@1.11.6: - resolution: {integrity: sha512-PxIwj+hmjLahyzEmcIfalIBDhgklAQCavwM4sGCgbzDi4/+VQX+4aEs4pQqtd7v3aohmjtO/4n2emzTI8donww==} + lefthook-freebsd-arm64@1.12.2: + resolution: {integrity: sha512-2n9z7Q4BKeMBoB9cuEdv0UBQH82Z4GgBQpCrfjCtyzpDnYQwrH8Tkrlnlko4qPh9MM6nLLGIYMKsA5nltzo8Cg==} cpu: [arm64] os: [freebsd] - lefthook-freebsd-x64@1.11.6: - resolution: {integrity: sha512-3o1lMKxz1VtWaP/o117wgUn3ZOpefMoSf+8LuiTzI3/PDprIuzgyw2nXKlBZAMDpNPHMNnJeQNts9XLMRmkldg==} + lefthook-freebsd-x64@1.12.2: + resolution: {integrity: sha512-1hNY/irY+/3kjRzKoJYxG+m3BYI8QxopJUK1PQnknGo1Wy5u302SdX+tR7pnpz6JM5chrNw4ozSbKKOvdZ5VEw==} cpu: [x64] os: [freebsd] - lefthook-linux-arm64@1.11.6: - resolution: {integrity: sha512-nKPFZ5cA9f5tVn0ybDVqcXXlpTHZqo05N4KQRhWTj5Nem+JoD2YzJIlvZhdJhUrldERqj6deDMXChH5T3z4Rrw==} + lefthook-linux-arm64@1.12.2: + resolution: {integrity: sha512-1W4swYIVRkxq/LFTuuK4oVpd6NtTKY4E3VY2Uq2JDkIOJV46+8qGBF+C/QA9K3O9chLffgN7c+i+NhIuGiZ/Vw==} cpu: [arm64] os: [linux] - lefthook-linux-x64@1.11.6: - resolution: {integrity: sha512-naN8dllLCOEeP+wznLnq+oXrs1dvt/iMLkcl+pOPWLqFccPfDiHzr8V8GslaTa+rSFsAnvjR7SJIOi5C29xedA==} + lefthook-linux-x64@1.12.2: + resolution: {integrity: sha512-J6VGuMfhq5iCsg1Pv7xULbuXC63gP5LaikT0PhkyBNMi3HQneZFDJ8k/sp0Ue9HkQv6QfWIo3/FgB9gz38MCFw==} cpu: [x64] os: [linux] - lefthook-openbsd-arm64@1.11.6: - resolution: {integrity: sha512-dPxhJfYQ667T+U3pz1+O3mTRNHzXH/BvPlXSH+oy8uiSry4AtVNRXkVvXPUcpLlrAy6HuFYodsrpCIlWFeYwiQ==} + lefthook-openbsd-arm64@1.12.2: + resolution: {integrity: sha512-wncDRW3ml24DaOyH22KINumjvCohswbQqbxyH2GORRCykSnE859cTjOrRIchTKBIARF7PSeGPUtS7EK0+oDbaw==} cpu: [arm64] os: [openbsd] - lefthook-openbsd-x64@1.11.6: - resolution: {integrity: sha512-9D26kcSsjiW4D0AuVDdi+0ZqrsOzRWOpMS/kcUbLfrU99yCvma0rMTqKbbDMkVur/znS7qL53oGahXCXDNA+IQ==} + lefthook-openbsd-x64@1.12.2: + resolution: {integrity: sha512-2jDOkCHNnc/oK/vR62hAf3vZb1EQ6Md2GjIlgZ/V7A3ztOsM8QZ5IxwYN3D1UOIR5ZnwMBy7PtmTJC/HJrig5w==} cpu: [x64] os: [openbsd] - lefthook-windows-arm64@1.11.6: - resolution: {integrity: sha512-xdCenr4+BFnfBEhiXj6GJp02EPmcwTAGa7NYm6hVTfDwGXw24tuLv7lpnGjgK3kovN6EukgLH1FYkeyDOBEMnA==} + lefthook-windows-arm64@1.12.2: + resolution: {integrity: sha512-ZMH/q6UNSidhHEG/1QoqIl1n4yPTBWuVmKx5bONtKHicoz4QCQ+QEiNjKsG5OO4C62nfyHGThmweCzZVUQECJw==} cpu: [arm64] os: [win32] - lefthook-windows-x64@1.11.6: - resolution: {integrity: sha512-Fg2GzLhzeDV/GX8+ydrI0wBOytQWpPkNdngx+a8B/feCDbwjAiFklDG5oV4ytuWrtg1JPEEWLJd6nHefj4wtHA==} + lefthook-windows-x64@1.12.2: + resolution: {integrity: sha512-TqT2jIPcTQ9uwaw+v+DTmvnUHM/p7bbsSrPoPX+fRXSGLzFjyiY+12C9dObSwfCQq6rT70xqQJ9AmftJQsa5/Q==} cpu: [x64] os: [win32] - lefthook@1.11.6: - resolution: {integrity: sha512-j0VmMM50WlPDassmgvapRum9po29Tv1BXzBNFpzGkk9E91CEG9jKik/OHyH/r/na+q8qNIUUyPL6QQuTN/UhQQ==} + lefthook@1.12.2: + resolution: {integrity: sha512-2CeTu5NcmoT9YnqsHTq/TF36MlqlzHzhivGx3DrXHwcff4TdvrkIwUTA56huM3Nlo5ODAF/0hlPzaKLmNHCBnQ==} hasBin: true lie@3.3.0: @@ -1392,8 +1396,8 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - loupe@3.1.3: - resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} + loupe@3.1.4: + resolution: {integrity: sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==} lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -1425,18 +1429,10 @@ packages: mdurl@2.0.0: resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} + memoize@10.1.0: + resolution: {integrity: sha512-MMbFhJzh4Jlg/poq1si90XRlTZRDHVqdlz2mPyGJ6kqMpyHUyVpDd5gpFAvVehW64+RA1eKE9Yt8aSLY7w2Kgg==} engines: {node: '>=18'} - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - mimic-function@5.0.1: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} @@ -1458,8 +1454,8 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msw@2.7.3: - resolution: {integrity: sha512-+mycXv8l2fEAjFZ5sjrtjJDmm2ceKGjrNbBr1durRg6VkU9fNUE/gsmQ51hWbHqs+l35W1iM+ZsmOD9Fd6lspw==} + msw@2.10.4: + resolution: {integrity: sha512-6R1or/qyele7q3RyPwNuvc0IxO8L8/Aim6Sz5ncXEgcWUNxSKE+udriTOWHtpMwmfkLYlacA2y7TIx4cL5lgHA==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -1490,8 +1486,8 @@ packages: encoding: optional: true - node-releases@2.0.17: - resolution: {integrity: sha512-Ww6ZlOiEQfPfXM45v17oabk77Z7mg5bOt7AjDyzy7RjK9OrLrLC8dyZQoAPEOtFX9SaNf1Tdvr5gRJWdTJj7GA==} + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} nwsapi@2.2.20: resolution: {integrity: sha512-/ieB+mDe4MrrKMT8z+mQL8klXydZWGR5Dowt4RAGKbJ3kIGEx3X4ljUo+6V73IXtUPWgfOlU5B9MlGxFO5T+cA==} @@ -1510,17 +1506,22 @@ packages: outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} - package-json-from-dist@1.0.0: - resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + oxlint@1.6.0: + resolution: {integrity: sha512-jtaD65PqzIa1udvSxxscTKBxYKuZoFXyKGLiU1Qjo1ulq3uv/fQDtoV1yey1FrQZrQjACGPi1Widsy1TucC7Jg==} + engines: {node: '>=8.*'} + hasBin: true + + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - papaparse@5.4.1: - resolution: {integrity: sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw==} + papaparse@5.5.3: + resolution: {integrity: sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==} - parse5@7.2.1: - resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==} + parse5@7.3.0: + resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} @@ -1539,21 +1540,18 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pathval@2.0.0: - resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} engines: {node: '>= 14.16'} - phaser3-rex-plugins@1.80.15: - resolution: {integrity: sha512-Ur973N1W5st6XEYBcJko8eTcEbdDHMM+m7VqvT3j/EJeJwYyJ3bVb33JJDsFgefk3A2iAz2itP/UY7CzxJOJVA==} + phaser3-rex-plugins@1.80.16: + resolution: {integrity: sha512-c34SfEjdK7rz8EbM7bDmJwB/xCb/YR77IaAaowzqkCLb7pLeI3E8PfLivm882iirN11XOHjYT2uYlvtdbNAtMA==} phaser3spectorjs@0.0.8: resolution: {integrity: sha512-0dSO7/aMjEUPrp5EcjRvRRsEf+jXDbmzalPeJ6VtTB2Pn1PeaKc+qlL/DmO3l1Dvc5lkzc+Sil1Ta+Hkyi5cbA==} - phaser@3.88.2: - resolution: {integrity: sha512-UBgd2sAFuRJbF2xKaQ5jpMWB8oETncChLnymLGHcrnT53vaqiGrQWbUKUDBawKLm24sghjKo4Bf+/xfv8espZQ==} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + phaser@3.90.0: + resolution: {integrity: sha512-/cziz/5ZIn02uDkC9RzN8VF9x3Gs3XdFFf9nkiMEQT3p7hQlWuyjy4QWosU802qqno2YSLn2BfqwOKLv/sSVfQ==} picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1562,10 +1560,15 @@ packages: resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} engines: {node: '>=12'} - postcss@8.5.3: - resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + engines: {node: '>=14'} + hasBin: true + process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -1573,8 +1576,8 @@ packages: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} - psl@1.9.0: - resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + psl@1.15.0: + resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} punycode.js@2.3.1: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} @@ -1594,9 +1597,6 @@ packages: resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} engines: {node: '>= 10.13.0'} - regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - regexp-tree@0.1.27: resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} hasBin: true @@ -1612,20 +1612,21 @@ packages: requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} - resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + resolve@1.22.10: + resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + engines: {node: '>= 0.4'} hasBin: true - rollup@4.40.1: - resolution: {integrity: sha512-C5VvvgCCyfyotVITIAv+4efVytl5F7wt+/I2i9q9GZcEXW9BP52YYOXC58igUi+LFZVHukErIIqQSWwv/M3WRw==} + rollup@4.45.0: + resolution: {integrity: sha512-WLjEcJRIo7i3WDDgOIJqVI2d+lAC3EwvOGy+Xfq6hs+GQuAA4Di/H72xmXkOhrIWFg2PFYSKZYfH0f4vfKXN4A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true rrweb-cssom@0.8.0: resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} + run-async@4.0.4: + resolution: {integrity: sha512-2cgeRHnV11lSXBEhq7sN7a5UVjTKm9JTb9x8ApIT//16D7QL96AgnNeWSGoB4gIHc0iYw/Ha0Z+waBaCYZVNhg==} engines: {node: '>=0.12.0'} rxjs@7.8.2: @@ -1648,8 +1649,8 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.7.1: - resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} + semver@7.7.2: + resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} engines: {node: '>=10'} hasBin: true @@ -1685,12 +1686,12 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - statuses@2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} - std-env@3.8.0: - resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} @@ -1718,6 +1719,9 @@ packages: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1729,8 +1733,8 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - tapable@2.2.1: - resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + tapable@2.2.2: + resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==} engines: {node: '>=6'} teamcity-service-messages@0.1.14: @@ -1746,27 +1750,27 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyglobby@0.2.13: - resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} + tinyglobby@0.2.14: + resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} engines: {node: '>=12.0.0'} - tinypool@1.0.2: - resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} - tinyspy@3.0.2: - resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} engines: {node: '>=14.0.0'} - tldts-core@6.1.85: - resolution: {integrity: sha512-DTjUVvxckL1fIoPSb3KE7ISNtkWSawZdpfxGxwiIrZoO6EbHVDXXUIlIuWympPaeS+BLGyggozX/HTMsRAdsoA==} + tldts-core@6.1.86: + resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} - tldts@6.1.85: - resolution: {integrity: sha512-gBdZ1RjCSevRPFix/hpaUWeak2/RNUZB4/8frF1r5uYMHjFptkiT0JXIebWvgI/0ZHXvxaUDDJshiA0j6GdL3w==} + tldts@6.1.86: + resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} hasBin: true tmp@0.0.33: @@ -1784,12 +1788,12 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - tr46@5.1.0: - resolution: {integrity: sha512-IUWnUK7ADYR5Sl1fZlO1INDUhVhatWl7BtJWsIhwJ0UAK7ilzzIa8uIqOO/aYVWHZPJkKbEL+362wrzoeRF7bw==} + tr46@5.1.1: + resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} engines: {node: '>=18'} - tsconfck@3.1.1: - resolution: {integrity: sha512-00eoI6WY57SvZEVjm13stEVE90VkEdJAFGgpFLTsZbJyW/LwFQ7uQxJHWpZ2hzSWgCPKc9AnBnNP+0X7o3hAmQ==} + tsconfck@3.1.6: + resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} engines: {node: ^18 || >=20} hasBin: true peerDependencies: @@ -1798,8 +1802,8 @@ packages: typescript: optional: true - tsconfig-paths-webpack-plugin@4.1.0: - resolution: {integrity: sha512-xWFISjviPydmtmgeUAuXp4N1fky+VCtfhOkDUFIv5ea7p4wuTomI4QTrXvFBX2S4jZsmyTSrStQl+E+4w+RzxA==} + tsconfig-paths-webpack-plugin@4.2.0: + resolution: {integrity: sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==} engines: {node: '>=10.13.0'} tsconfig-paths@4.2.0: @@ -1813,34 +1817,34 @@ packages: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - type-fest@4.26.1: - resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} - typedoc@0.28.1: - resolution: {integrity: sha512-Mn2VPNMaxoe/hlBiLriG4U55oyAa3Xo+8HbtEwV7F5WEOPXqtxzGuMZhJYHaqFJpajeQ6ZDUC2c990NAtTbdgw==} + typedoc@0.28.7: + resolution: {integrity: sha512-lpz0Oxl6aidFkmS90VQDQjk/Qf2iw0IUvFqirdONBdj7jPSN9mGXhy66BcGNDxx5ZMyKKiBVAREvPEzT6Uxipw==} engines: {node: '>= 18', pnpm: '>= 10'} hasBin: true peerDependencies: typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x - typescript@5.8.2: - resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==} + typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} engines: {node: '>=14.17'} hasBin: true uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} - undici-types@6.20.0: - resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} - update-browserslist-db@1.1.0: - resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} + update-browserslist-db@1.1.3: + resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -1851,8 +1855,8 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - vite-node@3.0.9: - resolution: {integrity: sha512-w3Gdx7jDcuT9cNn9jExXgOyKmf5UOTb6WMHz8LGAm54eS1Elf5OuBhCxl6zJxGhEeIkgsE1WbHuoL0mj/UXqXg==} + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true @@ -1864,8 +1868,8 @@ packages: vite: optional: true - vite@6.3.4: - resolution: {integrity: sha512-BiReIiMS2fyFqbqNT/Qqt4CVITDU9M9vE+DKcVAsB+ZV0wvTKd+3hMbkpxz1b+NmEDMegpVbisKiAZOnvO92Sw==} + vite@6.3.5: + resolution: {integrity: sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: @@ -1909,16 +1913,16 @@ packages: peerDependencies: vitest: '*' - vitest@3.0.9: - resolution: {integrity: sha512-BbcFDqNyBlfSpATmTtXOAOj71RNKDDvjBM/uPfnxxVGrG+FSH2RQIwgeEngTaTkuU/h0ScFvf+tRcKfYXzBybQ==} + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/debug': ^4.1.12 '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.0.9 - '@vitest/ui': 3.0.9 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -1941,8 +1945,8 @@ packages: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} - watskeburt@4.1.0: - resolution: {integrity: sha512-KkY5H51ajqy9HYYI+u9SIURcWnqeVVhdH0I+ab6aXPGHfZYxgRCwnR6Lm3+TYB6jJVt5jFqw4GAKmwf1zHmGQw==} + watskeburt@4.2.3: + resolution: {integrity: sha512-uG9qtQYoHqAsnT711nG5iZc/8M5inSmkGCOp7pFaytKG2aTfIca7p//CjiVzAE4P7hzaYuCozMjNNaLgmhbK5g==} engines: {node: ^18||>=20} hasBin: true @@ -1993,8 +1997,8 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - ws@8.18.0: - resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + ws@8.18.3: + resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -2019,9 +2023,9 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - yaml@2.7.1: - resolution: {integrity: sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==} - engines: {node: '>= 14'} + yaml@2.8.0: + resolution: {integrity: sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==} + engines: {node: '>= 14.6'} hasBin: true yargs-parser@21.1.1: @@ -2040,15 +2044,15 @@ snapshots: '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.12 + '@jridgewell/trace-mapping': 0.3.29 - '@asamuzakjp/css-color@3.1.1': + '@asamuzakjp/css-color@3.2.0': dependencies: - '@csstools/css-calc': 2.1.2(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-color-parser': 3.0.8(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-color-parser': 3.0.10(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 lru-cache: 10.4.3 '@babel/code-frame@7.27.1': @@ -2057,126 +2061,98 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.24.9': {} + '@babel/compat-data@7.28.0': {} - '@babel/core@7.24.9': + '@babel/core@7.28.0': dependencies: '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.27.1 - '@babel/generator': 7.24.10 - '@babel/helper-compilation-targets': 7.24.8 - '@babel/helper-module-transforms': 7.24.9(@babel/core@7.24.9) + '@babel/generator': 7.28.0 + '@babel/helper-compilation-targets': 7.27.2 + '@babel/helper-module-transforms': 7.27.3(@babel/core@7.28.0) '@babel/helpers': 7.27.6 - '@babel/parser': 7.27.5 + '@babel/parser': 7.28.0 '@babel/template': 7.27.2 - '@babel/traverse': 7.24.8 - '@babel/types': 7.27.6 + '@babel/traverse': 7.28.0 + '@babel/types': 7.28.1 convert-source-map: 2.0.0 - debug: 4.4.0 + debug: 4.4.1 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 transitivePeerDependencies: - supports-color - '@babel/generator@7.24.10': + '@babel/generator@7.28.0': dependencies: - '@babel/types': 7.27.6 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 + '@babel/parser': 7.28.0 + '@babel/types': 7.28.1 + '@jridgewell/gen-mapping': 0.3.12 + '@jridgewell/trace-mapping': 0.3.29 + jsesc: 3.1.0 - '@babel/helper-compilation-targets@7.24.8': + '@babel/helper-compilation-targets@7.27.2': dependencies: - '@babel/compat-data': 7.24.9 - '@babel/helper-validator-option': 7.24.8 - browserslist: 4.23.2 + '@babel/compat-data': 7.28.0 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.25.1 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-environment-visitor@7.24.7': - dependencies: - '@babel/types': 7.27.6 + '@babel/helper-globals@7.28.0': {} - '@babel/helper-function-name@7.24.7': + '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.27.6 - - '@babel/helper-hoist-variables@7.24.7': - dependencies: - '@babel/types': 7.27.6 - - '@babel/helper-module-imports@7.24.7': - dependencies: - '@babel/traverse': 7.24.8 - '@babel/types': 7.27.6 + '@babel/traverse': 7.28.0 + '@babel/types': 7.28.1 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.24.9(@babel/core@7.24.9)': + '@babel/helper-module-transforms@7.27.3(@babel/core@7.28.0)': dependencies: - '@babel/core': 7.24.9 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 + '@babel/core': 7.28.0 + '@babel/helper-module-imports': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 + '@babel/traverse': 7.28.0 transitivePeerDependencies: - supports-color - '@babel/helper-simple-access@7.24.7': - dependencies: - '@babel/traverse': 7.24.8 - '@babel/types': 7.27.6 - transitivePeerDependencies: - - supports-color - - '@babel/helper-split-export-declaration@7.24.7': - dependencies: - '@babel/types': 7.27.6 - '@babel/helper-string-parser@7.27.1': {} '@babel/helper-validator-identifier@7.27.1': {} - '@babel/helper-validator-option@7.24.8': {} + '@babel/helper-validator-option@7.27.1': {} '@babel/helpers@7.27.6': dependencies: '@babel/template': 7.27.2 - '@babel/types': 7.27.6 + '@babel/types': 7.28.1 - '@babel/parser@7.27.5': + '@babel/parser@7.28.0': dependencies: - '@babel/types': 7.27.6 + '@babel/types': 7.28.1 - '@babel/runtime@7.27.0': - dependencies: - regenerator-runtime: 0.14.1 + '@babel/runtime@7.27.6': {} '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 - '@babel/parser': 7.27.5 - '@babel/types': 7.27.6 + '@babel/parser': 7.28.0 + '@babel/types': 7.28.1 - '@babel/traverse@7.24.8': + '@babel/traverse@7.28.0': dependencies: '@babel/code-frame': 7.27.1 - '@babel/generator': 7.24.10 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-hoist-variables': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/parser': 7.27.5 - '@babel/types': 7.27.6 - debug: 4.4.0 - globals: 11.12.0 + '@babel/generator': 7.28.0 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.28.0 + '@babel/template': 7.27.2 + '@babel/types': 7.28.1 + debug: 4.4.1 transitivePeerDependencies: - supports-color - '@babel/types@7.27.6': + '@babel/types@7.28.1': dependencies: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 @@ -2222,7 +2198,7 @@ snapshots: '@bundled-es-modules/statuses@1.0.1': dependencies: - statuses: 2.0.1 + statuses: 2.0.2 '@bundled-es-modules/tough-cookie@0.1.6': dependencies: @@ -2231,132 +2207,131 @@ snapshots: '@csstools/color-helpers@5.0.2': {} - '@csstools/css-calc@2.1.2(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-color-parser@3.0.8(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-color-parser@3.0.10(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': dependencies: '@csstools/color-helpers': 5.0.2 - '@csstools/css-calc': 2.1.2(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) - '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3)': + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': dependencies: - '@csstools/css-tokenizer': 3.0.3 + '@csstools/css-tokenizer': 3.0.4 - '@csstools/css-tokenizer@3.0.3': {} + '@csstools/css-tokenizer@3.0.4': {} - '@esbuild/aix-ppc64@0.25.2': + '@esbuild/aix-ppc64@0.25.6': optional: true - '@esbuild/android-arm64@0.25.2': + '@esbuild/android-arm64@0.25.6': optional: true - '@esbuild/android-arm@0.25.2': + '@esbuild/android-arm@0.25.6': optional: true - '@esbuild/android-x64@0.25.2': + '@esbuild/android-x64@0.25.6': optional: true - '@esbuild/darwin-arm64@0.25.2': + '@esbuild/darwin-arm64@0.25.6': optional: true - '@esbuild/darwin-x64@0.25.2': + '@esbuild/darwin-x64@0.25.6': optional: true - '@esbuild/freebsd-arm64@0.25.2': + '@esbuild/freebsd-arm64@0.25.6': optional: true - '@esbuild/freebsd-x64@0.25.2': + '@esbuild/freebsd-x64@0.25.6': optional: true - '@esbuild/linux-arm64@0.25.2': + '@esbuild/linux-arm64@0.25.6': optional: true - '@esbuild/linux-arm@0.25.2': + '@esbuild/linux-arm@0.25.6': optional: true - '@esbuild/linux-ia32@0.25.2': + '@esbuild/linux-ia32@0.25.6': optional: true - '@esbuild/linux-loong64@0.25.2': + '@esbuild/linux-loong64@0.25.6': optional: true - '@esbuild/linux-mips64el@0.25.2': + '@esbuild/linux-mips64el@0.25.6': optional: true - '@esbuild/linux-ppc64@0.25.2': + '@esbuild/linux-ppc64@0.25.6': optional: true - '@esbuild/linux-riscv64@0.25.2': + '@esbuild/linux-riscv64@0.25.6': optional: true - '@esbuild/linux-s390x@0.25.2': + '@esbuild/linux-s390x@0.25.6': optional: true - '@esbuild/linux-x64@0.25.2': + '@esbuild/linux-x64@0.25.6': optional: true - '@esbuild/netbsd-arm64@0.25.2': + '@esbuild/netbsd-arm64@0.25.6': optional: true - '@esbuild/netbsd-x64@0.25.2': + '@esbuild/netbsd-x64@0.25.6': optional: true - '@esbuild/openbsd-arm64@0.25.2': + '@esbuild/openbsd-arm64@0.25.6': optional: true - '@esbuild/openbsd-x64@0.25.2': + '@esbuild/openbsd-x64@0.25.6': optional: true - '@esbuild/sunos-x64@0.25.2': + '@esbuild/openharmony-arm64@0.25.6': optional: true - '@esbuild/win32-arm64@0.25.2': + '@esbuild/sunos-x64@0.25.6': optional: true - '@esbuild/win32-ia32@0.25.2': + '@esbuild/win32-arm64@0.25.6': optional: true - '@esbuild/win32-x64@0.25.2': + '@esbuild/win32-ia32@0.25.6': optional: true - '@gerrit0/mini-shiki@3.2.2': + '@esbuild/win32-x64@0.25.6': + optional: true + + '@gerrit0/mini-shiki@3.7.0': dependencies: - '@shikijs/engine-oniguruma': 3.2.1 - '@shikijs/langs': 3.2.1 - '@shikijs/themes': 3.2.1 - '@shikijs/types': 3.2.1 + '@shikijs/engine-oniguruma': 3.7.0 + '@shikijs/langs': 3.7.0 + '@shikijs/themes': 3.7.0 + '@shikijs/types': 3.7.0 '@shikijs/vscode-textmate': 10.0.2 - '@hpcc-js/wasm@2.22.4': + '@inquirer/checkbox@4.1.9(@types/node@22.16.3)': dependencies: - yargs: 17.7.2 - - '@inquirer/checkbox@4.1.4(@types/node@22.13.14)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/figures': 1.0.12 + '@inquirer/type': 3.0.7(@types/node@22.16.3) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/confirm@5.1.8(@types/node@22.13.14)': + '@inquirer/confirm@5.1.13(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/core@10.1.9(@types/node@22.13.14)': + '@inquirer/core@10.1.14(@types/node@22.16.3)': dependencies: - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/figures': 1.0.12 + '@inquirer/type': 3.0.7(@types/node@22.16.3) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -2364,93 +2339,93 @@ snapshots: wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/editor@4.2.9(@types/node@22.13.14)': + '@inquirer/editor@4.2.14(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) external-editor: 3.1.0 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/expand@4.0.11(@types/node@22.13.14)': + '@inquirer/expand@4.0.16(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/figures@1.0.11': {} + '@inquirer/figures@1.0.12': {} - '@inquirer/input@4.1.8(@types/node@22.13.14)': + '@inquirer/input@4.2.0(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/number@3.0.11(@types/node@22.13.14)': + '@inquirer/number@3.0.16(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/password@4.0.11(@types/node@22.13.14)': + '@inquirer/password@4.0.16(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) ansi-escapes: 4.3.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/prompts@7.4.0(@types/node@22.13.14)': + '@inquirer/prompts@7.6.0(@types/node@22.16.3)': dependencies: - '@inquirer/checkbox': 4.1.4(@types/node@22.13.14) - '@inquirer/confirm': 5.1.8(@types/node@22.13.14) - '@inquirer/editor': 4.2.9(@types/node@22.13.14) - '@inquirer/expand': 4.0.11(@types/node@22.13.14) - '@inquirer/input': 4.1.8(@types/node@22.13.14) - '@inquirer/number': 3.0.11(@types/node@22.13.14) - '@inquirer/password': 4.0.11(@types/node@22.13.14) - '@inquirer/rawlist': 4.0.11(@types/node@22.13.14) - '@inquirer/search': 3.0.11(@types/node@22.13.14) - '@inquirer/select': 4.1.0(@types/node@22.13.14) + '@inquirer/checkbox': 4.1.9(@types/node@22.16.3) + '@inquirer/confirm': 5.1.13(@types/node@22.16.3) + '@inquirer/editor': 4.2.14(@types/node@22.16.3) + '@inquirer/expand': 4.0.16(@types/node@22.16.3) + '@inquirer/input': 4.2.0(@types/node@22.16.3) + '@inquirer/number': 3.0.16(@types/node@22.16.3) + '@inquirer/password': 4.0.16(@types/node@22.16.3) + '@inquirer/rawlist': 4.1.4(@types/node@22.16.3) + '@inquirer/search': 3.0.16(@types/node@22.16.3) + '@inquirer/select': 4.2.4(@types/node@22.16.3) optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/rawlist@4.0.11(@types/node@22.13.14)': + '@inquirer/rawlist@4.1.4(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/search@3.0.11(@types/node@22.13.14)': + '@inquirer/search@3.0.16(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/figures': 1.0.12 + '@inquirer/type': 3.0.7(@types/node@22.16.3) yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/select@4.1.0(@types/node@22.13.14)': + '@inquirer/select@4.2.4(@types/node@22.16.3)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/figures': 1.0.12 + '@inquirer/type': 3.0.7(@types/node@22.16.3) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 - '@inquirer/type@3.0.5(@types/node@22.13.14)': + '@inquirer/type@3.0.7(@types/node@22.16.3)': optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 '@isaacs/cliui@8.0.2': dependencies: @@ -2463,26 +2438,23 @@ snapshots: '@istanbuljs/schema@0.1.3': {} - '@jridgewell/gen-mapping@0.3.5': + '@jridgewell/gen-mapping@0.3.12': dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/trace-mapping': 0.3.29 '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/set-array@1.2.1': {} + '@jridgewell/sourcemap-codec@1.5.4': {} - '@jridgewell/sourcemap-codec@1.5.0': {} - - '@jridgewell/trace-mapping@0.3.25': + '@jridgewell/trace-mapping@0.3.29': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.4 '@material/material-color-utilities@0.2.7': {} - '@mswjs/interceptors@0.37.6': + '@mswjs/interceptors@0.39.2': dependencies: '@open-draft/deferred-promise': 2.2.0 '@open-draft/logger': 0.3.0 @@ -2500,92 +2472,122 @@ snapshots: '@open-draft/until@2.1.0': {} + '@oxlint/darwin-arm64@1.6.0': + optional: true + + '@oxlint/darwin-x64@1.6.0': + optional: true + + '@oxlint/linux-arm64-gnu@1.6.0': + optional: true + + '@oxlint/linux-arm64-musl@1.6.0': + optional: true + + '@oxlint/linux-x64-gnu@1.6.0': + optional: true + + '@oxlint/linux-x64-musl@1.6.0': + optional: true + + '@oxlint/win32-arm64@1.6.0': + optional: true + + '@oxlint/win32-x64@1.6.0': + optional: true + '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/rollup-android-arm-eabi@4.40.1': + '@rollup/rollup-android-arm-eabi@4.45.0': optional: true - '@rollup/rollup-android-arm64@4.40.1': + '@rollup/rollup-android-arm64@4.45.0': optional: true - '@rollup/rollup-darwin-arm64@4.40.1': + '@rollup/rollup-darwin-arm64@4.45.0': optional: true - '@rollup/rollup-darwin-x64@4.40.1': + '@rollup/rollup-darwin-x64@4.45.0': optional: true - '@rollup/rollup-freebsd-arm64@4.40.1': + '@rollup/rollup-freebsd-arm64@4.45.0': optional: true - '@rollup/rollup-freebsd-x64@4.40.1': + '@rollup/rollup-freebsd-x64@4.45.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.40.1': + '@rollup/rollup-linux-arm-gnueabihf@4.45.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.40.1': + '@rollup/rollup-linux-arm-musleabihf@4.45.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.40.1': + '@rollup/rollup-linux-arm64-gnu@4.45.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.40.1': + '@rollup/rollup-linux-arm64-musl@4.45.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.40.1': + '@rollup/rollup-linux-loongarch64-gnu@4.45.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.40.1': + '@rollup/rollup-linux-powerpc64le-gnu@4.45.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.40.1': + '@rollup/rollup-linux-riscv64-gnu@4.45.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.40.1': + '@rollup/rollup-linux-riscv64-musl@4.45.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.40.1': + '@rollup/rollup-linux-s390x-gnu@4.45.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.40.1': + '@rollup/rollup-linux-x64-gnu@4.45.0': optional: true - '@rollup/rollup-linux-x64-musl@4.40.1': + '@rollup/rollup-linux-x64-musl@4.45.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.40.1': + '@rollup/rollup-win32-arm64-msvc@4.45.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.40.1': + '@rollup/rollup-win32-ia32-msvc@4.45.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.40.1': + '@rollup/rollup-win32-x64-msvc@4.45.0': optional: true - '@shikijs/engine-oniguruma@3.2.1': + '@shikijs/engine-oniguruma@3.7.0': dependencies: - '@shikijs/types': 3.2.1 + '@shikijs/types': 3.7.0 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/langs@3.2.1': + '@shikijs/langs@3.7.0': dependencies: - '@shikijs/types': 3.2.1 + '@shikijs/types': 3.7.0 - '@shikijs/themes@3.2.1': + '@shikijs/themes@3.7.0': dependencies: - '@shikijs/types': 3.2.1 + '@shikijs/types': 3.7.0 - '@shikijs/types@3.2.1': + '@shikijs/types@3.7.0': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 '@shikijs/vscode-textmate@10.0.2': {} + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 + '@types/cookie@0.6.0': {} - '@types/estree@1.0.7': {} + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.8': {} '@types/hast@3.0.4': dependencies: @@ -2593,24 +2595,24 @@ snapshots: '@types/jsdom@21.1.7': dependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 '@types/tough-cookie': 4.0.5 - parse5: 7.2.1 + parse5: 7.3.0 - '@types/node@22.13.14': + '@types/node@22.16.3': dependencies: - undici-types: 6.20.0 + undici-types: 6.21.0 - '@types/statuses@2.0.5': {} + '@types/statuses@2.0.6': {} '@types/tough-cookie@4.0.5': {} '@types/unist@3.0.3': {} - '@vitest/coverage-istanbul@3.0.9(vitest@3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1))': + '@vitest/coverage-istanbul@3.2.4(vitest@3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0))': dependencies: '@istanbuljs/schema': 0.1.3 - debug: 4.4.0 + debug: 4.4.1 istanbul-lib-coverage: 3.2.2 istanbul-lib-instrument: 6.0.3 istanbul-lib-report: 3.0.1 @@ -2619,73 +2621,75 @@ snapshots: magicast: 0.3.5 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1) + vitest: 3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0) transitivePeerDependencies: - supports-color - '@vitest/expect@3.0.9': + '@vitest/expect@3.2.4': dependencies: - '@vitest/spy': 3.0.9 - '@vitest/utils': 3.0.9 - chai: 5.2.0 + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.1 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.9(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(vite@6.3.4(@types/node@22.13.14)(yaml@2.7.1))': + '@vitest/mocker@3.2.4(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(vite@6.3.5(@types/node@22.16.3)(yaml@2.8.0))': dependencies: - '@vitest/spy': 3.0.9 + '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - msw: 2.7.3(@types/node@22.13.14)(typescript@5.8.2) - vite: 6.3.4(@types/node@22.13.14)(yaml@2.7.1) + msw: 2.10.4(@types/node@22.16.3)(typescript@5.8.3) + vite: 6.3.5(@types/node@22.16.3)(yaml@2.8.0) - '@vitest/pretty-format@3.0.9': + '@vitest/pretty-format@3.2.4': dependencies: tinyrainbow: 2.0.0 - '@vitest/runner@3.0.9': + '@vitest/runner@3.2.4': dependencies: - '@vitest/utils': 3.0.9 + '@vitest/utils': 3.2.4 pathe: 2.0.3 + strip-literal: 3.0.0 - '@vitest/snapshot@3.0.9': + '@vitest/snapshot@3.2.4': dependencies: - '@vitest/pretty-format': 3.0.9 + '@vitest/pretty-format': 3.2.4 magic-string: 0.30.17 pathe: 2.0.3 - '@vitest/spy@3.0.9': + '@vitest/spy@3.2.4': dependencies: - tinyspy: 3.0.2 + tinyspy: 4.0.3 - '@vitest/utils@3.0.9': + '@vitest/utils@3.2.4': dependencies: - '@vitest/pretty-format': 3.0.9 - loupe: 3.1.3 + '@vitest/pretty-format': 3.2.4 + loupe: 3.1.4 tinyrainbow: 2.0.0 acorn-jsx-walk@2.0.0: {} - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.15.0): dependencies: - acorn: 8.12.1 + acorn: 8.15.0 - acorn-loose@8.4.0: + acorn-loose@8.5.2: dependencies: - acorn: 8.12.1 + acorn: 8.15.0 - acorn-walk@8.3.3: + acorn-walk@8.3.4: dependencies: - acorn: 8.12.1 + acorn: 8.15.0 - acorn@8.12.1: {} + acorn@8.15.0: {} - agent-base@7.1.3: {} + agent-base@7.1.4: {} ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.0.1 + fast-uri: 3.0.6 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -2695,7 +2699,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.0.1: {} + ansi-regex@6.1.0: {} ansi-styles@4.3.0: dependencies: @@ -2707,20 +2711,18 @@ snapshots: assertion-error@2.0.1: {} - asynckit@0.4.0: {} - balanced-match@1.0.2: {} brace-expansion@2.0.2: dependencies: balanced-match: 1.0.2 - browserslist@4.23.2: + browserslist@4.25.1: dependencies: - caniuse-lite: 1.0.30001642 - electron-to-chromium: 1.4.830 - node-releases: 2.0.17 - update-browserslist-db: 1.1.0(browserslist@4.23.2) + caniuse-lite: 1.0.30001727 + electron-to-chromium: 1.5.182 + node-releases: 2.0.19 + update-browserslist-db: 1.1.3(browserslist@4.25.1) cac@6.7.14: {} @@ -2741,15 +2743,15 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - caniuse-lite@1.0.30001642: {} + caniuse-lite@1.0.30001727: {} - chai@5.2.0: + chai@5.2.1: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.3 - pathval: 2.0.0 + loupe: 3.1.4 + pathval: 2.0.1 chalk@4.1.2: dependencies: @@ -2776,11 +2778,7 @@ snapshots: color-name@1.1.4: {} - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - commander@12.1.0: {} + commander@13.1.0: {} compare-versions@6.1.1: {} @@ -2806,9 +2804,9 @@ snapshots: cssfontparser@1.2.1: {} - cssstyle@4.3.0: + cssstyle@4.6.0: dependencies: - '@asamuzakjp/css-color': 3.1.1 + '@asamuzakjp/css-color': 3.2.0 rrweb-cssom: 0.8.0 dagre@0.8.5: @@ -2821,11 +2819,11 @@ snapshots: whatwg-mimetype: 4.0.0 whatwg-url: 14.2.0 - debug@4.4.0: + debug@4.4.1: dependencies: ms: 2.1.3 - decimal.js@10.4.3: {} + decimal.js@10.6.0: {} deep-eql@5.0.2: {} @@ -2835,32 +2833,30 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - delayed-stream@1.0.0: {} - - dependency-cruiser@16.3.10: + dependency-cruiser@16.10.4: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) + acorn: 8.15.0 + acorn-jsx: 5.3.2(acorn@8.15.0) acorn-jsx-walk: 2.0.0 - acorn-loose: 8.4.0 - acorn-walk: 8.3.3 + acorn-loose: 8.5.2 + acorn-walk: 8.3.4 ajv: 8.17.1 - commander: 12.1.0 - enhanced-resolve: 5.17.1 - ignore: 5.3.1 + commander: 13.1.0 + enhanced-resolve: 5.18.2 + ignore: 7.0.5 interpret: 3.1.1 is-installed-globally: 1.0.0 json5: 2.2.3 - memoize: 10.0.0 - picocolors: 1.0.1 + memoize: 10.1.0 + picocolors: 1.1.1 picomatch: 4.0.2 prompts: 2.4.2 rechoir: 0.8.0 safe-regex: 2.1.1 - semver: 7.7.1 + semver: 7.7.2 teamcity-service-messages: 0.1.14 - tsconfig-paths-webpack-plugin: 4.1.0 - watskeburt: 4.1.0 + tsconfig-paths-webpack-plugin: 4.2.0 + watskeburt: 4.2.3 dunder-proto@1.0.1: dependencies: @@ -2870,69 +2866,65 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.4.830: {} + electron-to-chromium@1.5.182: {} emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} - enhanced-resolve@5.17.1: + enhanced-resolve@5.18.2: dependencies: graceful-fs: 4.2.11 - tapable: 2.2.1 + tapable: 2.2.2 entities@4.5.0: {} + entities@6.0.1: {} + es-define-property@1.0.1: {} es-errors@1.3.0: {} - es-module-lexer@1.6.0: {} + es-module-lexer@1.7.0: {} es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 - es-set-tostringtag@2.1.0: - dependencies: - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - has-tostringtag: 1.0.2 - hasown: 2.0.2 - - esbuild@0.25.2: + esbuild@0.25.6: optionalDependencies: - '@esbuild/aix-ppc64': 0.25.2 - '@esbuild/android-arm': 0.25.2 - '@esbuild/android-arm64': 0.25.2 - '@esbuild/android-x64': 0.25.2 - '@esbuild/darwin-arm64': 0.25.2 - '@esbuild/darwin-x64': 0.25.2 - '@esbuild/freebsd-arm64': 0.25.2 - '@esbuild/freebsd-x64': 0.25.2 - '@esbuild/linux-arm': 0.25.2 - '@esbuild/linux-arm64': 0.25.2 - '@esbuild/linux-ia32': 0.25.2 - '@esbuild/linux-loong64': 0.25.2 - '@esbuild/linux-mips64el': 0.25.2 - '@esbuild/linux-ppc64': 0.25.2 - '@esbuild/linux-riscv64': 0.25.2 - '@esbuild/linux-s390x': 0.25.2 - '@esbuild/linux-x64': 0.25.2 - '@esbuild/netbsd-arm64': 0.25.2 - '@esbuild/netbsd-x64': 0.25.2 - '@esbuild/openbsd-arm64': 0.25.2 - '@esbuild/openbsd-x64': 0.25.2 - '@esbuild/sunos-x64': 0.25.2 - '@esbuild/win32-arm64': 0.25.2 - '@esbuild/win32-ia32': 0.25.2 - '@esbuild/win32-x64': 0.25.2 + '@esbuild/aix-ppc64': 0.25.6 + '@esbuild/android-arm': 0.25.6 + '@esbuild/android-arm64': 0.25.6 + '@esbuild/android-x64': 0.25.6 + '@esbuild/darwin-arm64': 0.25.6 + '@esbuild/darwin-x64': 0.25.6 + '@esbuild/freebsd-arm64': 0.25.6 + '@esbuild/freebsd-x64': 0.25.6 + '@esbuild/linux-arm': 0.25.6 + '@esbuild/linux-arm64': 0.25.6 + '@esbuild/linux-ia32': 0.25.6 + '@esbuild/linux-loong64': 0.25.6 + '@esbuild/linux-mips64el': 0.25.6 + '@esbuild/linux-ppc64': 0.25.6 + '@esbuild/linux-riscv64': 0.25.6 + '@esbuild/linux-s390x': 0.25.6 + '@esbuild/linux-x64': 0.25.6 + '@esbuild/netbsd-arm64': 0.25.6 + '@esbuild/netbsd-x64': 0.25.6 + '@esbuild/openbsd-arm64': 0.25.6 + '@esbuild/openbsd-x64': 0.25.6 + '@esbuild/openharmony-arm64': 0.25.6 + '@esbuild/sunos-x64': 0.25.6 + '@esbuild/win32-arm64': 0.25.6 + '@esbuild/win32-ia32': 0.25.6 + '@esbuild/win32-x64': 0.25.6 - escalade@3.1.2: {} + escalade@3.2.0: {} estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 eventemitter3@3.1.2: {} @@ -2940,7 +2932,7 @@ snapshots: events@3.3.0: {} - expect-type@1.1.0: {} + expect-type@1.2.2: {} external-editor@3.1.0: dependencies: @@ -2950,24 +2942,17 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-uri@3.0.1: {} + fast-uri@3.0.6: {} - fdir@6.4.4(picomatch@4.0.2): + fdir@6.4.6(picomatch@4.0.2): optionalDependencies: picomatch: 4.0.2 - foreground-child@3.2.1: + foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.2: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - es-set-tostringtag: 2.1.0 - mime-types: 2.1.35 - fsevents@2.3.3: optional: true @@ -2997,19 +2982,17 @@ snapshots: glob@10.4.5: dependencies: - foreground-child: 3.2.1 + foreground-child: 3.3.1 jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 - package-json-from-dist: 1.0.0 + package-json-from-dist: 1.0.1 path-scurry: 1.11.1 global-directory@4.0.1: dependencies: ini: 4.1.1 - globals@11.12.0: {} - globrex@0.1.2: {} gopd@1.2.0: {} @@ -3028,7 +3011,7 @@ snapshots: graphology-types: 0.24.8 obliterator: 2.0.5 - graphql@16.9.0: {} + graphql@16.11.0: {} has-flag@4.0.0: {} @@ -3038,10 +3021,6 @@ snapshots: has-symbols@1.1.0: {} - has-tostringtag@1.0.2: - dependencies: - has-symbols: 1.1.0 - hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -3056,21 +3035,21 @@ snapshots: http-proxy-agent@7.0.2: dependencies: - agent-base: 7.1.3 - debug: 4.4.0 + agent-base: 7.1.4 + debug: 4.4.1 transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: - agent-base: 7.1.3 - debug: 4.4.0 + agent-base: 7.1.4 + debug: 4.4.1 transitivePeerDependencies: - supports-color - i18next-browser-languagedetector@8.0.4: + i18next-browser-languagedetector@8.2.0: dependencies: - '@babel/runtime': 7.27.0 + '@babel/runtime': 7.27.6 i18next-http-backend@2.7.3: dependencies: @@ -3084,19 +3063,19 @@ snapshots: transitivePeerDependencies: - encoding - i18next-korean-postposition-processor@1.0.0(i18next@24.2.3(typescript@5.8.2)): + i18next-korean-postposition-processor@1.0.0(i18next@24.2.3(typescript@5.8.3)): dependencies: - i18next: 24.2.3(typescript@5.8.2) + i18next: 24.2.3(typescript@5.8.3) i18next@22.5.1: dependencies: - '@babel/runtime': 7.27.0 + '@babel/runtime': 7.27.6 - i18next@24.2.3(typescript@5.8.2): + i18next@24.2.3(typescript@5.8.3): dependencies: - '@babel/runtime': 7.27.0 + '@babel/runtime': 7.27.6 optionalDependencies: - typescript: 5.8.2 + typescript: 5.8.3 iconv-lite@0.4.24: dependencies: @@ -3106,7 +3085,7 @@ snapshots: dependencies: safer-buffer: 2.1.2 - ignore@5.3.1: {} + ignore@7.0.5: {} immediate@3.0.6: {} @@ -3114,21 +3093,21 @@ snapshots: ini@4.1.1: {} - inquirer@12.5.0(@types/node@22.13.14): + inquirer@12.7.0(@types/node@22.16.3): dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.14) - '@inquirer/prompts': 7.4.0(@types/node@22.13.14) - '@inquirer/type': 3.0.5(@types/node@22.13.14) + '@inquirer/core': 10.1.14(@types/node@22.16.3) + '@inquirer/prompts': 7.6.0(@types/node@22.16.3) + '@inquirer/type': 3.0.7(@types/node@22.16.3) ansi-escapes: 4.3.2 mute-stream: 2.0.0 - run-async: 3.0.0 + run-async: 4.0.4 rxjs: 7.8.2 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 interpret@3.1.1: {} - is-core-module@2.15.0: + is-core-module@2.16.1: dependencies: hasown: 2.0.2 @@ -3155,11 +3134,11 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: - '@babel/core': 7.24.9 - '@babel/parser': 7.27.5 + '@babel/core': 7.28.0 + '@babel/parser': 7.28.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.7.1 + semver: 7.7.2 transitivePeerDependencies: - supports-color @@ -3171,8 +3150,8 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: - '@jridgewell/trace-mapping': 0.3.25 - debug: 4.4.0 + '@jridgewell/trace-mapping': 0.3.29 + debug: 4.4.1 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -3195,22 +3174,23 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@4.1.0: dependencies: argparse: 2.0.1 - jsdom@26.0.0: + jsdom@26.1.0: dependencies: - cssstyle: 4.3.0 + cssstyle: 4.6.0 data-urls: 5.0.0 - decimal.js: 10.4.3 - form-data: 4.0.2 + decimal.js: 10.6.0 html-encoding-sniffer: 4.0.0 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 is-potential-custom-element-name: 1.0.1 nwsapi: 2.2.20 - parse5: 7.2.1 + parse5: 7.3.0 rrweb-cssom: 0.8.0 saxes: 6.0.0 symbol-tree: 3.2.4 @@ -3220,18 +3200,18 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.2.0 - ws: 8.18.0 + ws: 8.18.3 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - jsesc@2.5.2: {} + jsesc@3.1.0: {} json-schema-traverse@1.0.0: {} - json-stable-stringify@1.2.1: + json-stable-stringify@1.3.0: dependencies: call-bind: 1.0.8 call-bound: 1.0.4 @@ -3252,48 +3232,48 @@ snapshots: kleur@3.0.3: {} - lefthook-darwin-arm64@1.11.6: + lefthook-darwin-arm64@1.12.2: optional: true - lefthook-darwin-x64@1.11.6: + lefthook-darwin-x64@1.12.2: optional: true - lefthook-freebsd-arm64@1.11.6: + lefthook-freebsd-arm64@1.12.2: optional: true - lefthook-freebsd-x64@1.11.6: + lefthook-freebsd-x64@1.12.2: optional: true - lefthook-linux-arm64@1.11.6: + lefthook-linux-arm64@1.12.2: optional: true - lefthook-linux-x64@1.11.6: + lefthook-linux-x64@1.12.2: optional: true - lefthook-openbsd-arm64@1.11.6: + lefthook-openbsd-arm64@1.12.2: optional: true - lefthook-openbsd-x64@1.11.6: + lefthook-openbsd-x64@1.12.2: optional: true - lefthook-windows-arm64@1.11.6: + lefthook-windows-arm64@1.12.2: optional: true - lefthook-windows-x64@1.11.6: + lefthook-windows-x64@1.12.2: optional: true - lefthook@1.11.6: + lefthook@1.12.2: optionalDependencies: - lefthook-darwin-arm64: 1.11.6 - lefthook-darwin-x64: 1.11.6 - lefthook-freebsd-arm64: 1.11.6 - lefthook-freebsd-x64: 1.11.6 - lefthook-linux-arm64: 1.11.6 - lefthook-linux-x64: 1.11.6 - lefthook-openbsd-arm64: 1.11.6 - lefthook-openbsd-x64: 1.11.6 - lefthook-windows-arm64: 1.11.6 - lefthook-windows-x64: 1.11.6 + lefthook-darwin-arm64: 1.12.2 + lefthook-darwin-x64: 1.12.2 + lefthook-freebsd-arm64: 1.12.2 + lefthook-freebsd-x64: 1.12.2 + lefthook-linux-arm64: 1.12.2 + lefthook-linux-x64: 1.12.2 + lefthook-openbsd-arm64: 1.12.2 + lefthook-openbsd-x64: 1.12.2 + lefthook-windows-arm64: 1.12.2 + lefthook-windows-x64: 1.12.2 lie@3.3.0: dependencies: @@ -3305,7 +3285,7 @@ snapshots: lodash@4.17.21: {} - loupe@3.1.3: {} + loupe@3.1.4: {} lru-cache@10.4.3: {} @@ -3317,17 +3297,17 @@ snapshots: magic-string@0.30.17: dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.4 magicast@0.3.5: dependencies: - '@babel/parser': 7.27.5 - '@babel/types': 7.27.6 + '@babel/parser': 7.28.0 + '@babel/types': 7.28.1 source-map-js: 1.2.1 make-dir@4.0.0: dependencies: - semver: 7.7.1 + semver: 7.7.2 markdown-it@14.1.0: dependencies: @@ -3342,16 +3322,10 @@ snapshots: mdurl@2.0.0: {} - memoize@10.0.0: + memoize@10.1.0: dependencies: mimic-function: 5.0.1 - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - mimic-function@5.0.1: {} minimatch@9.0.5: @@ -3368,28 +3342,28 @@ snapshots: ms@2.1.3: {} - msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2): + msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3): dependencies: '@bundled-es-modules/cookie': 2.0.1 '@bundled-es-modules/statuses': 1.0.1 '@bundled-es-modules/tough-cookie': 0.1.6 - '@inquirer/confirm': 5.1.8(@types/node@22.13.14) - '@mswjs/interceptors': 0.37.6 + '@inquirer/confirm': 5.1.13(@types/node@22.16.3) + '@mswjs/interceptors': 0.39.2 '@open-draft/deferred-promise': 2.2.0 '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 - '@types/statuses': 2.0.5 - graphql: 16.9.0 + '@types/statuses': 2.0.6 + graphql: 16.11.0 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 path-to-regexp: 6.3.0 picocolors: 1.1.1 strict-event-emitter: 0.5.1 - type-fest: 4.26.1 + type-fest: 4.41.0 yargs: 17.7.2 optionalDependencies: - typescript: 5.8.2 + typescript: 5.8.3 transitivePeerDependencies: - '@types/node' @@ -3403,7 +3377,7 @@ snapshots: dependencies: whatwg-url: 5.0.0 - node-releases@2.0.17: {} + node-releases@2.0.19: {} nwsapi@2.2.20: {} @@ -3415,15 +3389,26 @@ snapshots: outvariant@1.4.3: {} - package-json-from-dist@1.0.0: {} + oxlint@1.6.0: + optionalDependencies: + '@oxlint/darwin-arm64': 1.6.0 + '@oxlint/darwin-x64': 1.6.0 + '@oxlint/linux-arm64-gnu': 1.6.0 + '@oxlint/linux-arm64-musl': 1.6.0 + '@oxlint/linux-x64-gnu': 1.6.0 + '@oxlint/linux-x64-musl': 1.6.0 + '@oxlint/win32-arm64': 1.6.0 + '@oxlint/win32-x64': 1.6.0 + + package-json-from-dist@1.0.1: {} pako@1.0.11: {} - papaparse@5.4.1: {} + papaparse@5.5.3: {} - parse5@7.2.1: + parse5@7.3.0: dependencies: - entities: 4.5.0 + entities: 6.0.1 path-key@3.1.1: {} @@ -3438,9 +3423,9 @@ snapshots: pathe@2.0.3: {} - pathval@2.0.0: {} + pathval@2.0.1: {} - phaser3-rex-plugins@1.80.15(graphology-types@0.24.8): + phaser3-rex-plugins@1.80.16(graphology-types@0.24.8): dependencies: dagre: 0.8.5 eventemitter3: 3.1.2 @@ -3449,7 +3434,7 @@ snapshots: i18next-http-backend: 2.7.3 js-yaml: 4.1.0 mustache: 4.2.0 - papaparse: 5.4.1 + papaparse: 5.5.3 webfontloader: 1.6.28 transitivePeerDependencies: - encoding @@ -3457,22 +3442,22 @@ snapshots: phaser3spectorjs@0.0.8: {} - phaser@3.88.2: + phaser@3.90.0: dependencies: eventemitter3: 5.0.1 - picocolors@1.0.1: {} - picocolors@1.1.1: {} picomatch@4.0.2: {} - postcss@8.5.3: + postcss@8.5.6: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 + prettier@3.6.2: {} + process-nextick-args@2.0.1: {} prompts@2.4.2: @@ -3480,7 +3465,9 @@ snapshots: kleur: 3.0.3 sisteransi: 1.0.5 - psl@1.9.0: {} + psl@1.15.0: + dependencies: + punycode: 2.3.1 punycode.js@2.3.1: {} @@ -3500,9 +3487,7 @@ snapshots: rechoir@0.8.0: dependencies: - resolve: 1.22.8 - - regenerator-runtime@0.14.1: {} + resolve: 1.22.10 regexp-tree@0.1.27: {} @@ -3512,41 +3497,44 @@ snapshots: requires-port@1.0.0: {} - resolve@1.22.8: + resolve@1.22.10: dependencies: - is-core-module: 2.15.0 + is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - rollup@4.40.1: + rollup@4.45.0: dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.40.1 - '@rollup/rollup-android-arm64': 4.40.1 - '@rollup/rollup-darwin-arm64': 4.40.1 - '@rollup/rollup-darwin-x64': 4.40.1 - '@rollup/rollup-freebsd-arm64': 4.40.1 - '@rollup/rollup-freebsd-x64': 4.40.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.40.1 - '@rollup/rollup-linux-arm-musleabihf': 4.40.1 - '@rollup/rollup-linux-arm64-gnu': 4.40.1 - '@rollup/rollup-linux-arm64-musl': 4.40.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.40.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.40.1 - '@rollup/rollup-linux-riscv64-gnu': 4.40.1 - '@rollup/rollup-linux-riscv64-musl': 4.40.1 - '@rollup/rollup-linux-s390x-gnu': 4.40.1 - '@rollup/rollup-linux-x64-gnu': 4.40.1 - '@rollup/rollup-linux-x64-musl': 4.40.1 - '@rollup/rollup-win32-arm64-msvc': 4.40.1 - '@rollup/rollup-win32-ia32-msvc': 4.40.1 - '@rollup/rollup-win32-x64-msvc': 4.40.1 + '@rollup/rollup-android-arm-eabi': 4.45.0 + '@rollup/rollup-android-arm64': 4.45.0 + '@rollup/rollup-darwin-arm64': 4.45.0 + '@rollup/rollup-darwin-x64': 4.45.0 + '@rollup/rollup-freebsd-arm64': 4.45.0 + '@rollup/rollup-freebsd-x64': 4.45.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.45.0 + '@rollup/rollup-linux-arm-musleabihf': 4.45.0 + '@rollup/rollup-linux-arm64-gnu': 4.45.0 + '@rollup/rollup-linux-arm64-musl': 4.45.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.45.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.45.0 + '@rollup/rollup-linux-riscv64-gnu': 4.45.0 + '@rollup/rollup-linux-riscv64-musl': 4.45.0 + '@rollup/rollup-linux-s390x-gnu': 4.45.0 + '@rollup/rollup-linux-x64-gnu': 4.45.0 + '@rollup/rollup-linux-x64-musl': 4.45.0 + '@rollup/rollup-win32-arm64-msvc': 4.45.0 + '@rollup/rollup-win32-ia32-msvc': 4.45.0 + '@rollup/rollup-win32-x64-msvc': 4.45.0 fsevents: 2.3.3 rrweb-cssom@0.8.0: {} - run-async@3.0.0: {} + run-async@4.0.4: + dependencies: + oxlint: 1.6.0 + prettier: 3.6.2 rxjs@7.8.2: dependencies: @@ -3566,7 +3554,7 @@ snapshots: semver@6.3.1: {} - semver@7.7.1: {} + semver@7.7.2: {} set-function-length@1.2.2: dependencies: @@ -3595,9 +3583,9 @@ snapshots: stackback@0.0.2: {} - statuses@2.0.1: {} + statuses@2.0.2: {} - std-env@3.8.0: {} + std-env@3.9.0: {} strict-event-emitter@0.5.1: {} @@ -3623,10 +3611,14 @@ snapshots: strip-ansi@7.1.0: dependencies: - ansi-regex: 6.0.1 + ansi-regex: 6.1.0 strip-bom@3.0.0: {} + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -3635,7 +3627,7 @@ snapshots: symbol-tree@3.2.4: {} - tapable@2.2.1: {} + tapable@2.2.2: {} teamcity-service-messages@0.1.14: {} @@ -3649,22 +3641,22 @@ snapshots: tinyexec@0.3.2: {} - tinyglobby@0.2.13: + tinyglobby@0.2.14: dependencies: - fdir: 6.4.4(picomatch@4.0.2) + fdir: 6.4.6(picomatch@4.0.2) picomatch: 4.0.2 - tinypool@1.0.2: {} + tinypool@1.1.1: {} tinyrainbow@2.0.0: {} - tinyspy@3.0.2: {} + tinyspy@4.0.3: {} - tldts-core@6.1.85: {} + tldts-core@6.1.86: {} - tldts@6.1.85: + tldts@6.1.86: dependencies: - tldts-core: 6.1.85 + tldts-core: 6.1.86 tmp@0.0.33: dependencies: @@ -3672,29 +3664,30 @@ snapshots: tough-cookie@4.1.4: dependencies: - psl: 1.9.0 + psl: 1.15.0 punycode: 2.3.1 universalify: 0.2.0 url-parse: 1.5.10 tough-cookie@5.1.2: dependencies: - tldts: 6.1.85 + tldts: 6.1.86 tr46@0.0.3: {} - tr46@5.1.0: + tr46@5.1.1: dependencies: punycode: 2.3.1 - tsconfck@3.1.1(typescript@5.8.2): + tsconfck@3.1.6(typescript@5.8.3): optionalDependencies: - typescript: 5.8.2 + typescript: 5.8.3 - tsconfig-paths-webpack-plugin@4.1.0: + tsconfig-paths-webpack-plugin@4.2.0: dependencies: chalk: 4.1.2 - enhanced-resolve: 5.17.1 + enhanced-resolve: 5.18.2 + tapable: 2.2.2 tsconfig-paths: 4.2.0 tsconfig-paths@4.2.0: @@ -3707,29 +3700,29 @@ snapshots: type-fest@0.21.3: {} - type-fest@4.26.1: {} + type-fest@4.41.0: {} - typedoc@0.28.1(typescript@5.8.2): + typedoc@0.28.7(typescript@5.8.3): dependencies: - '@gerrit0/mini-shiki': 3.2.2 + '@gerrit0/mini-shiki': 3.7.0 lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - typescript: 5.8.2 - yaml: 2.7.1 + typescript: 5.8.3 + yaml: 2.8.0 - typescript@5.8.2: {} + typescript@5.8.3: {} uc.micro@2.1.0: {} - undici-types@6.20.0: {} + undici-types@6.21.0: {} universalify@0.2.0: {} - update-browserslist-db@1.1.0(browserslist@4.23.2): + update-browserslist-db@1.1.3(browserslist@4.25.1): dependencies: - browserslist: 4.23.2 - escalade: 3.1.2 + browserslist: 4.25.1 + escalade: 3.2.0 picocolors: 1.1.1 url-parse@1.5.10: @@ -3739,13 +3732,13 @@ snapshots: util-deprecate@1.0.2: {} - vite-node@3.0.9(@types/node@22.13.14)(yaml@2.7.1): + vite-node@3.2.4(@types/node@22.16.3)(yaml@2.8.0): dependencies: cac: 6.7.14 - debug: 4.4.0 - es-module-lexer: 1.6.0 + debug: 4.4.1 + es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 6.3.4(@types/node@22.13.14)(yaml@2.7.1) + vite: 6.3.5(@types/node@22.16.3)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -3760,60 +3753,63 @@ snapshots: - tsx - yaml - vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.3.4(@types/node@22.13.14)(yaml@2.7.1)): + vite-tsconfig-paths@5.1.4(typescript@5.8.3)(vite@6.3.5(@types/node@22.16.3)(yaml@2.8.0)): dependencies: - debug: 4.4.0 + debug: 4.4.1 globrex: 0.1.2 - tsconfck: 3.1.1(typescript@5.8.2) + tsconfck: 3.1.6(typescript@5.8.3) optionalDependencies: - vite: 6.3.4(@types/node@22.13.14)(yaml@2.7.1) + vite: 6.3.5(@types/node@22.16.3)(yaml@2.8.0) transitivePeerDependencies: - supports-color - typescript - vite@6.3.4(@types/node@22.13.14)(yaml@2.7.1): + vite@6.3.5(@types/node@22.16.3)(yaml@2.8.0): dependencies: - esbuild: 0.25.2 - fdir: 6.4.4(picomatch@4.0.2) + esbuild: 0.25.6 + fdir: 6.4.6(picomatch@4.0.2) picomatch: 4.0.2 - postcss: 8.5.3 - rollup: 4.40.1 - tinyglobby: 0.2.13 + postcss: 8.5.6 + rollup: 4.45.0 + tinyglobby: 0.2.14 optionalDependencies: - '@types/node': 22.13.14 + '@types/node': 22.16.3 fsevents: 2.3.3 - yaml: 2.7.1 + yaml: 2.8.0 - vitest-canvas-mock@0.3.3(vitest@3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1)): + vitest-canvas-mock@0.3.3(vitest@3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0)): dependencies: jest-canvas-mock: 2.5.2 - vitest: 3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1) + vitest: 3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0) - vitest@3.0.9(@types/node@22.13.14)(jsdom@26.0.0)(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(yaml@2.7.1): + vitest@3.2.4(@types/node@22.16.3)(jsdom@26.1.0)(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(yaml@2.8.0): dependencies: - '@vitest/expect': 3.0.9 - '@vitest/mocker': 3.0.9(msw@2.7.3(@types/node@22.13.14)(typescript@5.8.2))(vite@6.3.4(@types/node@22.13.14)(yaml@2.7.1)) - '@vitest/pretty-format': 3.0.9 - '@vitest/runner': 3.0.9 - '@vitest/snapshot': 3.0.9 - '@vitest/spy': 3.0.9 - '@vitest/utils': 3.0.9 - chai: 5.2.0 - debug: 4.4.0 - expect-type: 1.1.0 + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(msw@2.10.4(@types/node@22.16.3)(typescript@5.8.3))(vite@6.3.5(@types/node@22.16.3)(yaml@2.8.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.2.1 + debug: 4.4.1 + expect-type: 1.2.2 magic-string: 0.30.17 pathe: 2.0.3 - std-env: 3.8.0 + picomatch: 4.0.2 + std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 - tinypool: 1.0.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 6.3.4(@types/node@22.13.14)(yaml@2.7.1) - vite-node: 3.0.9(@types/node@22.13.14)(yaml@2.7.1) + vite: 6.3.5(@types/node@22.16.3)(yaml@2.8.0) + vite-node: 3.2.4(@types/node@22.16.3)(yaml@2.8.0) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.13.14 - jsdom: 26.0.0 + '@types/node': 22.16.3 + jsdom: 26.1.0 transitivePeerDependencies: - jiti - less @@ -3832,7 +3828,7 @@ snapshots: dependencies: xml-name-validator: 5.0.0 - watskeburt@4.1.0: {} + watskeburt@4.2.3: {} webfontloader@1.6.28: {} @@ -3848,7 +3844,7 @@ snapshots: whatwg-url@14.2.0: dependencies: - tr46: 5.1.0 + tr46: 5.1.1 webidl-conversions: 7.0.0 whatwg-url@5.0.0: @@ -3883,7 +3879,7 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 - ws@8.18.0: {} + ws@8.18.3: {} xml-name-validator@5.0.0: {} @@ -3893,14 +3889,14 @@ snapshots: yallist@3.1.1: {} - yaml@2.7.1: {} + yaml@2.8.0: {} yargs-parser@21.1.1: {} yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.2 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000000..ec73d96e0db --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,6 @@ +onlyBuiltDependencies: + - esbuild + - msw + - lefthook + +shellEmulator: true diff --git a/public/audio/bgm/abyss.mp3 b/public/audio/bgm/abyss.mp3 index 08882ac7e09..778b2cd77e8 100644 Binary files a/public/audio/bgm/abyss.mp3 and b/public/audio/bgm/abyss.mp3 differ diff --git a/public/audio/bgm/battle_legendary_eternatus_p1.mp3 b/public/audio/bgm/battle_legendary_eternatus_p1.mp3 new file mode 100644 index 00000000000..742a3a198c7 Binary files /dev/null and b/public/audio/bgm/battle_legendary_eternatus_p1.mp3 differ diff --git a/public/audio/bgm/battle_legendary_eternatus_p2.mp3 b/public/audio/bgm/battle_legendary_eternatus_p2.mp3 new file mode 100644 index 00000000000..2015e735840 Binary files /dev/null and b/public/audio/bgm/battle_legendary_eternatus_p2.mp3 differ diff --git a/public/fonts/Galmuri11.subset.woff2 b/public/fonts/Galmuri11.subset.woff2 deleted file mode 100644 index 0b626506255..00000000000 Binary files a/public/fonts/Galmuri11.subset.woff2 and /dev/null differ diff --git a/public/fonts/Galmuri9.subset.woff2 b/public/fonts/Galmuri9.subset.woff2 deleted file mode 100644 index 5475af0cdad..00000000000 Binary files a/public/fonts/Galmuri9.subset.woff2 and /dev/null differ diff --git a/public/fonts/pokemon-bw.ttf b/public/fonts/pokemon-bw.ttf new file mode 100644 index 00000000000..b246be443e2 Binary files /dev/null and b/public/fonts/pokemon-bw.ttf differ diff --git a/public/images/items.json b/public/images/items.json index 4312f2a58c4..7b332442f04 100644 --- a/public/images/items.json +++ b/public/images/items.json @@ -4,8 +4,8 @@ "image": "items.png", "format": "RGBA8888", "size": { - "w": 432, - "h": 432 + "w": 434, + "h": 434 }, "scale": 1, "frames": [ @@ -409,7 +409,7 @@ } }, { - "filename": "choice_specs", + "filename": "chipped_pot", "rotated": false, "trimmed": true, "sourceSize": { @@ -417,16 +417,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 4, - "y": 8, - "w": 24, - "h": 18 + "x": 3, + "y": 6, + "w": 26, + "h": 20 }, "frame": { "x": 0, "y": 414, - "w": 24, - "h": 18 + "w": 26, + "h": 20 } }, { @@ -598,7 +598,7 @@ } }, { - "filename": "chipped_pot", + "filename": "cracked_pot", "rotated": false, "trimmed": true, "sourceSize": { @@ -618,27 +618,6 @@ "h": 20 } }, - { - "filename": "cracked_pot", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 3, - "y": 6, - "w": 26, - "h": 20 - }, - "frame": { - "x": 358, - "y": 0, - "w": 26, - "h": 20 - } - }, { "filename": "legend_plate", "rotated": false, @@ -654,14 +633,35 @@ "h": 20 }, "frame": { - "x": 384, + "x": 358, "y": 0, "w": 25, "h": 20 } }, { - "filename": "big_root", + "filename": "mystical_rock", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 25, + "h": 23 + }, + "frame": { + "x": 383, + "y": 0, + "w": 25, + "h": 23 + } + }, + { + "filename": "blank_plate", "rotated": false, "trimmed": true, "sourceSize": { @@ -671,13 +671,13 @@ "spriteSourceSize": { "x": 4, "y": 4, - "w": 23, + "w": 24, "h": 24 }, "frame": { - "x": 409, + "x": 408, "y": 0, - "w": 23, + "w": 24, "h": 24 } }, @@ -829,7 +829,7 @@ } }, { - "filename": "blank_plate", + "filename": "big_root", "rotated": false, "trimmed": true, "sourceSize": { @@ -839,13 +839,13 @@ "spriteSourceSize": { "x": 4, "y": 4, - "w": 24, + "w": 23, "h": 24 }, "frame": { "x": 22, "y": 290, - "w": 24, + "w": 23, "h": 24 } }, @@ -934,7 +934,7 @@ } }, { - "filename": "exp_balance", + "filename": "fist_plate", "rotated": false, "trimmed": true, "sourceSize": { @@ -943,15 +943,15 @@ }, "spriteSourceSize": { "x": 4, - "y": 5, + "y": 4, "w": 24, - "h": 22 + "h": 24 }, "frame": { - "x": 24, + "x": 26, "y": 410, "w": 24, - "h": 22 + "h": 24 } }, { @@ -997,7 +997,7 @@ } }, { - "filename": "mystical_rock", + "filename": "choice_specs", "rotated": false, "trimmed": true, "sourceSize": { @@ -1006,15 +1006,15 @@ }, "spriteSourceSize": { "x": 4, - "y": 5, - "w": 25, - "h": 23 + "y": 8, + "w": 24, + "h": 18 }, "frame": { "x": 59, "y": 53, - "w": 25, - "h": 23 + "w": 24, + "h": 18 } }, { @@ -1081,7 +1081,7 @@ } }, { - "filename": "fist_plate", + "filename": "flame_plate", "rotated": false, "trimmed": true, "sourceSize": { @@ -1102,7 +1102,7 @@ } }, { - "filename": "flame_plate", + "filename": "focus_band", "rotated": false, "trimmed": true, "sourceSize": { @@ -1123,7 +1123,7 @@ } }, { - "filename": "focus_band", + "filename": "golden_punch", "rotated": false, "trimmed": true, "sourceSize": { @@ -1144,7 +1144,7 @@ } }, { - "filename": "golden_punch", + "filename": "gracidea", "rotated": false, "trimmed": true, "sourceSize": { @@ -1165,7 +1165,7 @@ } }, { - "filename": "gracidea", + "filename": "grip_claw", "rotated": false, "trimmed": true, "sourceSize": { @@ -1185,27 +1185,6 @@ "h": 24 } }, - { - "filename": "grip_claw", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 55, - "y": 76, - "w": 24, - "h": 24 - } - }, { "filename": "icicle_plate", "rotated": false, @@ -1221,8 +1200,8 @@ "h": 24 }, "frame": { - "x": 55, - "y": 100, + "x": 45, + "y": 278, "w": 24, "h": 24 } @@ -1243,7 +1222,7 @@ }, "frame": { "x": 46, - "y": 278, + "y": 302, "w": 24, "h": 24 } @@ -1264,7 +1243,7 @@ }, "frame": { "x": 46, - "y": 302, + "y": 326, "w": 24, "h": 24 } @@ -1285,7 +1264,7 @@ }, "frame": { "x": 46, - "y": 326, + "y": 350, "w": 24, "h": 24 } @@ -1306,13 +1285,13 @@ }, "frame": { "x": 46, - "y": 350, + "y": 374, "w": 24, "h": 24 } }, { - "filename": "lucky_punch_master", + "filename": "silver_powder", "rotated": false, "trimmed": true, "sourceSize": { @@ -1321,14 +1300,119 @@ }, "spriteSourceSize": { "x": 4, - "y": 4, + "y": 11, "w": 24, + "h": 15 + }, + "frame": { + "x": 48, + "y": 71, + "w": 24, + "h": 15 + } + }, + { + "filename": "elixir", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 4, + "w": 18, "h": 24 }, "frame": { - "x": 46, - "y": 374, - "w": 24, + "x": 55, + "y": 86, + "w": 18, + "h": 24 + } + }, + { + "filename": "ether", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 4, + "w": 18, + "h": 24 + }, + "frame": { + "x": 55, + "y": 110, + "w": 18, + "h": 24 + } + }, + { + "filename": "full_restore", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 4, + "w": 18, + "h": 24 + }, + "frame": { + "x": 60, + "y": 134, + "w": 18, + "h": 24 + } + }, + { + "filename": "hp_up", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 63, + "y": 158, + "w": 16, + "h": 24 + } + }, + { + "filename": "iron", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 63, + "y": 182, + "w": 16, "h": 24 } }, @@ -1347,12 +1431,33 @@ "h": 24 }, "frame": { - "x": 48, - "y": 398, + "x": 68, + "y": 206, "w": 23, "h": 24 } }, + { + "filename": "lucky_punch_master", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 68, + "y": 230, + "w": 24, + "h": 24 + } + }, { "filename": "lucky_punch_ultra", "rotated": false, @@ -1368,8 +1473,8 @@ "h": 24 }, "frame": { - "x": 60, - "y": 124, + "x": 68, + "y": 254, "w": 24, "h": 24 } @@ -1389,8 +1494,8 @@ "h": 24 }, "frame": { - "x": 63, - "y": 148, + "x": 69, + "y": 278, "w": 24, "h": 24 } @@ -1410,33 +1515,12 @@ "h": 24 }, "frame": { - "x": 63, - "y": 172, + "x": 70, + "y": 302, "w": 24, "h": 24 } }, - { - "filename": "max_revive", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 4, - "w": 22, - "h": 24 - }, - "frame": { - "x": 68, - "y": 196, - "w": 22, - "h": 24 - } - }, { "filename": "mind_plate", "rotated": false, @@ -1452,8 +1536,8 @@ "h": 24 }, "frame": { - "x": 68, - "y": 220, + "x": 70, + "y": 326, "w": 24, "h": 24 } @@ -1473,8 +1557,8 @@ "h": 24 }, "frame": { - "x": 68, - "y": 244, + "x": 70, + "y": 350, "w": 24, "h": 24 } @@ -1495,7 +1579,7 @@ }, "frame": { "x": 70, - "y": 268, + "y": 374, "w": 24, "h": 24 } @@ -1515,665 +1599,14 @@ "h": 24 }, "frame": { - "x": 70, - "y": 292, + "x": 50, + "y": 398, "w": 24, "h": 24 } }, { - "filename": "scanner", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 70, - "y": 316, - "w": 24, - "h": 24 - } - }, - { - "filename": "silk_scarf", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 70, - "y": 340, - "w": 24, - "h": 24 - } - }, - { - "filename": "sky_plate", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 70, - "y": 364, - "w": 24, - "h": 24 - } - }, - { - "filename": "reveal_glass", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 23, - "h": 24 - }, - "frame": { - "x": 71, - "y": 388, - "w": 23, - "h": 24 - } - }, - { - "filename": "icy_reins_of_unity", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 24, - "h": 20 - }, - "frame": { - "x": 71, - "y": 412, - "w": 24, - "h": 20 - } - }, - { - "filename": "elixir", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 4, - "w": 18, - "h": 24 - }, - "frame": { - "x": 79, - "y": 76, - "w": 18, - "h": 24 - } - }, - { - "filename": "ether", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 4, - "w": 18, - "h": 24 - }, - "frame": { - "x": 79, - "y": 100, - "w": 18, - "h": 24 - } - }, - { - "filename": "full_restore", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 4, - "w": 18, - "h": 24 - }, - "frame": { - "x": 84, - "y": 124, - "w": 18, - "h": 24 - } - }, - { - "filename": "hp_up", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 87, - "y": 148, - "w": 16, - "h": 24 - } - }, - { - "filename": "iron", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 87, - "y": 172, - "w": 16, - "h": 24 - } - }, - { - "filename": "lure", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 17, - "h": 24 - }, - "frame": { - "x": 90, - "y": 196, - "w": 17, - "h": 24 - } - }, - { - "filename": "max_elixir", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 4, - "w": 18, - "h": 24 - }, - "frame": { - "x": 92, - "y": 220, - "w": 18, - "h": 24 - } - }, - { - "filename": "max_ether", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 4, - "w": 18, - "h": 24 - }, - "frame": { - "x": 92, - "y": 244, - "w": 18, - "h": 24 - } - }, - { - "filename": "max_lure", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 17, - "h": 24 - }, - "frame": { - "x": 94, - "y": 268, - "w": 17, - "h": 24 - } - }, - { - "filename": "max_potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 4, - "w": 18, - "h": 24 - }, - "frame": { - "x": 94, - "y": 292, - "w": 18, - "h": 24 - } - }, - { - "filename": "oval_charm", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 21, - "h": 24 - }, - "frame": { - "x": 94, - "y": 316, - "w": 21, - "h": 24 - } - }, - { - "filename": "shiny_charm", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 21, - "h": 24 - }, - "frame": { - "x": 94, - "y": 340, - "w": 21, - "h": 24 - } - }, - { - "filename": "splash_plate", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 94, - "y": 364, - "w": 24, - "h": 24 - } - }, - { - "filename": "spooky_plate", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 94, - "y": 388, - "w": 24, - "h": 24 - } - }, - { - "filename": "metal_powder", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 6, - "w": 24, - "h": 20 - }, - "frame": { - "x": 95, - "y": 412, - "w": 24, - "h": 20 - } - }, - { - "filename": "berry_pouch", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 84, - "y": 53, - "w": 23, - "h": 23 - } - }, - { - "filename": "max_repel", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 97, - "y": 76, - "w": 16, - "h": 24 - } - }, - { - "filename": "pp_max", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 97, - "y": 100, - "w": 16, - "h": 24 - } - }, - { - "filename": "pp_up", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 102, - "y": 124, - "w": 16, - "h": 24 - } - }, - { - "filename": "protein", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 103, - "y": 148, - "w": 16, - "h": 24 - } - }, - { - "filename": "red_orb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 20, - "h": 24 - }, - "frame": { - "x": 103, - "y": 172, - "w": 20, - "h": 24 - } - }, - { - "filename": "repel", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 107, - "y": 196, - "w": 16, - "h": 24 - } - }, - { - "filename": "stone_plate", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 110, - "y": 220, - "w": 24, - "h": 24 - } - }, - { - "filename": "sun_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 110, - "y": 244, - "w": 24, - "h": 24 - } - }, - { - "filename": "toxic_plate", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 111, - "y": 268, - "w": 24, - "h": 24 - } - }, - { - "filename": "zap_plate", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 24 - }, - "frame": { - "x": 112, - "y": 292, - "w": 24, - "h": 24 - } - }, - { - "filename": "black_belt", + "filename": "max_revive", "rotated": false, "trimmed": true, "sourceSize": { @@ -2184,117 +1617,12 @@ "x": 5, "y": 4, "w": 22, - "h": 23 - }, - "frame": { - "x": 115, - "y": 316, - "w": 22, - "h": 23 - } - }, - { - "filename": "bug_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 115, - "y": 339, - "w": 22, - "h": 23 - } - }, - { - "filename": "clefairy_doll", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 24, - "h": 23 - }, - "frame": { - "x": 118, - "y": 362, - "w": 24, - "h": 23 - } - }, - { - "filename": "coin_case", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 24, - "h": 23 - }, - "frame": { - "x": 118, - "y": 385, - "w": 24, - "h": 23 - } - }, - { - "filename": "super_lure", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 17, "h": 24 }, "frame": { - "x": 119, - "y": 408, - "w": 17, - "h": 24 - } - }, - { - "filename": "super_repel", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 136, - "y": 408, - "w": 16, + "x": 74, + "y": 398, + "w": 22, "h": 24 } }, @@ -2320,7 +1648,7 @@ } }, { - "filename": "black_glasses", + "filename": "lure", "rotated": false, "trimmed": true, "sourceSize": { @@ -2328,20 +1656,20 @@ "h": 32 }, "spriteSourceSize": { - "x": 4, - "y": 8, - "w": 23, - "h": 17 + "x": 8, + "y": 4, + "w": 17, + "h": 24 }, "frame": { "x": 86, - "y": 36, - "w": 23, - "h": 17 + "y": 27, + "w": 17, + "h": 24 } }, { - "filename": "expert_belt", + "filename": "scanner", "rotated": false, "trimmed": true, "sourceSize": { @@ -2352,15 +1680,78 @@ "x": 4, "y": 4, "w": 24, + "h": 24 + }, + "frame": { + "x": 103, + "y": 26, + "w": 24, + "h": 24 + } + }, + { + "filename": "clefairy_doll", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 24, "h": 23 }, "frame": { - "x": 109, - "y": 26, + "x": 127, + "y": 36, "w": 24, "h": 23 } }, + { + "filename": "coin_case", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 24, + "h": 23 + }, + "frame": { + "x": 103, + "y": 50, + "w": 24, + "h": 23 + } + }, + { + "filename": "big_nugget", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 83, + "y": 53, + "w": 20, + "h": 20 + } + }, { "filename": "dragon_scale", "rotated": false, @@ -2376,12 +1767,264 @@ "h": 18 }, "frame": { - "x": 133, - "y": 36, + "x": 127, + "y": 59, "w": 24, "h": 18 } }, + { + "filename": "max_elixir", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 4, + "w": 18, + "h": 24 + }, + "frame": { + "x": 151, + "y": 36, + "w": 18, + "h": 24 + } + }, + { + "filename": "adamant_crystal", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 6, + "w": 23, + "h": 21 + }, + "frame": { + "x": 151, + "y": 60, + "w": 23, + "h": 21 + } + }, + { + "filename": "silk_scarf", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 169, + "y": 21, + "w": 24, + "h": 24 + } + }, + { + "filename": "sky_plate", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 193, + "y": 21, + "w": 24, + "h": 24 + } + }, + { + "filename": "splash_plate", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 217, + "y": 21, + "w": 24, + "h": 24 + } + }, + { + "filename": "spooky_plate", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 241, + "y": 21, + "w": 24, + "h": 24 + } + }, + { + "filename": "stone_plate", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 265, + "y": 21, + "w": 24, + "h": 24 + } + }, + { + "filename": "sun_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 289, + "y": 21, + "w": 24, + "h": 24 + } + }, + { + "filename": "oval_charm", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 21, + "h": 24 + }, + "frame": { + "x": 313, + "y": 21, + "w": 21, + "h": 24 + } + }, + { + "filename": "toxic_plate", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 334, + "y": 20, + "w": 24, + "h": 24 + } + }, + { + "filename": "zap_plate", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 24, + "h": 24 + }, + "frame": { + "x": 358, + "y": 20, + "w": 24, + "h": 24 + } + }, + { + "filename": "exp_balance", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 24, + "h": 22 + }, + "frame": { + "x": 382, + "y": 23, + "w": 24, + "h": 22 + } + }, { "filename": "exp_share", "rotated": false, @@ -2397,14 +2040,35 @@ "h": 22 }, "frame": { - "x": 109, - "y": 49, + "x": 406, + "y": 24, "w": 24, "h": 22 } }, { - "filename": "golden_net", + "filename": "candy_overlay", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 12, + "w": 16, + "h": 15 + }, + "frame": { + "x": 169, + "y": 45, + "w": 16, + "h": 15 + } + }, + { + "filename": "expert_belt", "rotated": false, "trimmed": true, "sourceSize": { @@ -2413,98 +2077,14 @@ }, "spriteSourceSize": { "x": 4, - "y": 5, - "w": 24, - "h": 21 - }, - "frame": { - "x": 133, - "y": 54, - "w": 24, - "h": 21 - } - }, - { - "filename": "mystic_water", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 5, - "w": 20, - "h": 23 - }, - "frame": { - "x": 113, - "y": 71, - "w": 20, - "h": 23 - } - }, - { - "filename": "dark_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, "y": 4, - "w": 22, + "w": 24, "h": 23 }, "frame": { - "x": 113, - "y": 94, - "w": 22, - "h": 23 - } - }, - { - "filename": "coupon", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 23, - "h": 19 - }, - "frame": { - "x": 133, - "y": 75, - "w": 23, - "h": 19 - } - }, - { - "filename": "dragon_fang", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 21, - "h": 23 - }, - "frame": { - "x": 135, - "y": 94, - "w": 21, + "x": 185, + "y": 45, + "w": 24, "h": 23 } }, @@ -2523,75 +2103,12 @@ "h": 23 }, "frame": { - "x": 118, - "y": 117, + "x": 209, + "y": 45, "w": 24, "h": 23 } }, - { - "filename": "dynamax_band", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 23, - "h": 23 - }, - "frame": { - "x": 119, - "y": 140, - "w": 23, - "h": 23 - } - }, - { - "filename": "unknown", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 142, - "y": 117, - "w": 16, - "h": 24 - } - }, - { - "filename": "berry_pot", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 5, - "w": 18, - "h": 22 - }, - "frame": { - "x": 142, - "y": 141, - "w": 18, - "h": 22 - } - }, { "filename": "leppa_berry", "rotated": false, @@ -2607,8 +2124,8 @@ "h": 23 }, "frame": { - "x": 123, - "y": 163, + "x": 233, + "y": 45, "w": 24, "h": 23 } @@ -2628,96 +2145,12 @@ "h": 23 }, "frame": { - "x": 123, - "y": 186, + "x": 257, + "y": 45, "w": 24, "h": 23 } }, - { - "filename": "relic_gold", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 9, - "y": 11, - "w": 15, - "h": 11 - }, - "frame": { - "x": 123, - "y": 209, - "w": 15, - "h": 11 - } - }, - { - "filename": "zinc", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 147, - "y": 163, - "w": 16, - "h": 24 - } - }, - { - "filename": "bug_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 147, - "y": 187, - "w": 22, - "h": 22 - } - }, - { - "filename": "peat_block", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 24, - "h": 22 - }, - "frame": { - "x": 138, - "y": 209, - "w": 24, - "h": 22 - } - }, { "filename": "twisted_spoon", "rotated": false, @@ -2733,56 +2166,14 @@ "h": 23 }, "frame": { - "x": 134, - "y": 231, + "x": 281, + "y": 45, "w": 24, "h": 23 } }, { - "filename": "griseous_core", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 135, - "y": 254, - "w": 23, - "h": 23 - } - }, - { - "filename": "silver_powder", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 11, - "w": 24, - "h": 15 - }, - "frame": { - "x": 135, - "y": 277, - "w": 24, - "h": 15 - } - }, - { - "filename": "leek", + "filename": "berry_pouch", "rotated": false, "trimmed": true, "sourceSize": { @@ -2796,98 +2187,14 @@ "h": 23 }, "frame": { - "x": 136, - "y": 292, + "x": 305, + "y": 45, "w": 23, "h": 23 } }, { - "filename": "dragon_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 137, - "y": 315, - "w": 22, - "h": 23 - } - }, - { - "filename": "electric_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 137, - "y": 338, - "w": 22, - "h": 23 - } - }, - { - "filename": "fairy_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 142, - "y": 361, - "w": 22, - "h": 23 - } - }, - { - "filename": "fighting_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 142, - "y": 384, - "w": 22, - "h": 23 - } - }, - { - "filename": "fire_stone", + "filename": "black_belt", "rotated": false, "trimmed": true, "sourceSize": { @@ -2896,19 +2203,19 @@ }, "spriteSourceSize": { "x": 5, - "y": 5, + "y": 4, "w": 22, "h": 23 }, "frame": { - "x": 152, - "y": 407, + "x": 328, + "y": 45, "w": 22, "h": 23 } }, { - "filename": "charcoal", + "filename": "reveal_glass", "rotated": false, "trimmed": true, "sourceSize": { @@ -2916,20 +2223,83 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, + "x": 4, + "y": 4, + "w": 23, + "h": 24 + }, + "frame": { + "x": 350, + "y": 44, + "w": 23, + "h": 24 + } + }, + { + "filename": "dynamax_band", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 4, + "w": 23, + "h": 23 + }, + "frame": { + "x": 373, + "y": 45, + "w": 23, + "h": 23 + } + }, + { + "filename": "peat_block", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, "y": 5, - "w": 22, + "w": 24, "h": 22 }, "frame": { - "x": 162, - "y": 209, - "w": 22, + "x": 396, + "y": 46, + "w": 24, "h": 22 } }, { - "filename": "macho_brace", + "filename": "revive", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 10, + "y": 8, + "w": 12, + "h": 17 + }, + "frame": { + "x": 420, + "y": 46, + "w": 12, + "h": 17 + } + }, + { + "filename": "golden_net", "rotated": false, "trimmed": true, "sourceSize": { @@ -2939,287 +2309,14 @@ "spriteSourceSize": { "x": 4, "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 158, - "y": 231, - "w": 23, - "h": 23 - } - }, - { - "filename": "rare_candy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 158, - "y": 254, - "w": 23, - "h": 23 - } - }, - { - "filename": "fire_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 159, - "y": 277, - "w": 22, - "h": 23 - } - }, - { - "filename": "focus_sash", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 159, - "y": 300, - "w": 22, - "h": 23 - } - }, - { - "filename": "ghost_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 159, - "y": 323, - "w": 22, - "h": 23 - } - }, - { - "filename": "candy_overlay", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 12, - "w": 16, - "h": 15 - }, - "frame": { - "x": 159, - "y": 346, - "w": 16, - "h": 15 - } - }, - { - "filename": "full_heal", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 9, - "y": 4, - "w": 15, - "h": 23 - }, - "frame": { - "x": 164, - "y": 361, - "w": 15, - "h": 23 - } - }, - { - "filename": "grass_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 164, - "y": 384, - "w": 22, - "h": 23 - } - }, - { - "filename": "ground_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 174, - "y": 407, - "w": 22, - "h": 23 - } - }, - { - "filename": "hyper_potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 17, - "h": 23 - }, - "frame": { - "x": 157, - "y": 36, - "w": 17, - "h": 23 - } - }, - { - "filename": "adamant_crystal", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 6, - "w": 23, + "w": 24, "h": 21 }, - "frame": { - "x": 157, - "y": 59, - "w": 23, - "h": 21 - } - }, - { - "filename": "rarer_candy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 156, - "y": 80, - "w": 23, - "h": 23 - } - }, - { - "filename": "healing_charm", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 23, - "h": 22 - }, "frame": { "x": 174, - "y": 21, - "w": 23, - "h": 22 - } - }, - { - "filename": "rusted_sword", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 22 - }, - "frame": { - "x": 197, - "y": 21, - "w": 23, - "h": 22 + "y": 68, + "w": 24, + "h": 21 } }, { @@ -3237,8 +2334,8 @@ "h": 21 }, "frame": { - "x": 220, - "y": 21, + "x": 198, + "y": 68, "w": 23, "h": 21 } @@ -3258,14 +2355,35 @@ "h": 21 }, "frame": { - "x": 243, - "y": 21, + "x": 221, + "y": 68, "w": 23, "h": 21 } }, { - "filename": "moon_stone", + "filename": "griseous_core", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 244, + "y": 68, + "w": 23, + "h": 23 + } + }, + { + "filename": "leek", "rotated": false, "trimmed": true, "sourceSize": { @@ -3274,19 +2392,19 @@ }, "spriteSourceSize": { "x": 4, - "y": 6, + "y": 5, "w": 23, - "h": 21 + "h": 23 }, "frame": { - "x": 266, - "y": 21, + "x": 267, + "y": 68, "w": 23, - "h": 21 + "h": 23 } }, { - "filename": "n_lunarizer", + "filename": "macho_brace", "rotated": false, "trimmed": true, "sourceSize": { @@ -3295,19 +2413,103 @@ }, "spriteSourceSize": { "x": 4, - "y": 6, + "y": 5, "w": 23, - "h": 21 + "h": 23 }, "frame": { - "x": 289, - "y": 21, + "x": 290, + "y": 68, "w": 23, - "h": 21 + "h": 23 } }, { - "filename": "berry_juice", + "filename": "rare_candy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 313, + "y": 68, + "w": 23, + "h": 23 + } + }, + { + "filename": "rarer_candy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 336, + "y": 68, + "w": 23, + "h": 23 + } + }, + { + "filename": "bug_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 359, + "y": 68, + "w": 22, + "h": 23 + } + }, + { + "filename": "dark_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 381, + "y": 68, + "w": 22, + "h": 23 + } + }, + { + "filename": "dragon_fang", "rotated": false, "trimmed": true, "sourceSize": { @@ -3317,18 +2519,18 @@ "spriteSourceSize": { "x": 5, "y": 5, - "w": 22, - "h": 21 + "w": 21, + "h": 23 }, "frame": { - "x": 312, - "y": 21, - "w": 22, - "h": 21 + "x": 403, + "y": 68, + "w": 21, + "h": 23 } }, { - "filename": "dark_memory", + "filename": "relic_gold", "rotated": false, "trimmed": true, "sourceSize": { @@ -3336,20 +2538,20 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 + "x": 9, + "y": 11, + "w": 15, + "h": 11 }, "frame": { - "x": 334, - "y": 20, - "w": 22, - "h": 22 + "x": 50, + "y": 422, + "w": 15, + "h": 11 } }, { - "filename": "dire_hit", + "filename": "icy_reins_of_unity", "rotated": false, "trimmed": true, "sourceSize": { @@ -3357,41 +2559,20 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 + "x": 4, + "y": 7, + "w": 24, + "h": 20 }, "frame": { - "x": 356, - "y": 20, - "w": 22, - "h": 22 + "x": 91, + "y": 73, + "w": 24, + "h": 20 } }, { - "filename": "dna_splicers", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 378, - "y": 20, - "w": 22, - "h": 22 - } - }, - { - "filename": "relic_band", + "filename": "max_ether", "rotated": false, "trimmed": true, "sourceSize": { @@ -3400,15 +2581,78 @@ }, "spriteSourceSize": { "x": 7, - "y": 9, - "w": 17, - "h": 16 + "y": 4, + "w": 18, + "h": 24 }, "frame": { - "x": 174, - "y": 43, - "w": 17, - "h": 16 + "x": 73, + "y": 73, + "w": 18, + "h": 24 + } + }, + { + "filename": "max_potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 4, + "w": 18, + "h": 24 + }, + "frame": { + "x": 73, + "y": 97, + "w": 18, + "h": 24 + } + }, + { + "filename": "dragon_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 91, + "y": 93, + "w": 22, + "h": 23 + } + }, + { + "filename": "metal_powder", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 6, + "w": 24, + "h": 20 + }, + "frame": { + "x": 115, + "y": 77, + "w": 24, + "h": 20 } }, { @@ -3426,12 +2670,33 @@ "h": 20 }, "frame": { - "x": 191, - "y": 43, + "x": 113, + "y": 97, "w": 24, "h": 20 } }, + { + "filename": "berry_juice_bad", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 21 + }, + "frame": { + "x": 91, + "y": 116, + "w": 22, + "h": 21 + } + }, { "filename": "rusted_shield", "rotated": false, @@ -3447,12 +2712,264 @@ "h": 20 }, "frame": { - "x": 400, - "y": 24, + "x": 113, + "y": 117, "w": 24, "h": 20 } }, + { + "filename": "moon_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 6, + "w": 23, + "h": 21 + }, + "frame": { + "x": 78, + "y": 137, + "w": 23, + "h": 21 + } + }, + { + "filename": "electric_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 79, + "y": 158, + "w": 22, + "h": 23 + } + }, + { + "filename": "fairy_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 101, + "y": 137, + "w": 22, + "h": 23 + } + }, + { + "filename": "fighting_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 79, + "y": 181, + "w": 22, + "h": 23 + } + }, + { + "filename": "fire_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 23 + }, + "frame": { + "x": 101, + "y": 160, + "w": 22, + "h": 23 + } + }, + { + "filename": "berry_juice_good", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 21 + }, + "frame": { + "x": 101, + "y": 183, + "w": 22, + "h": 21 + } + }, + { + "filename": "fire_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 91, + "y": 204, + "w": 22, + "h": 23 + } + }, + { + "filename": "shiny_charm", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 21, + "h": 24 + }, + "frame": { + "x": 92, + "y": 227, + "w": 21, + "h": 24 + } + }, + { + "filename": "focus_sash", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 92, + "y": 251, + "w": 22, + "h": 23 + } + }, + { + "filename": "ghost_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 93, + "y": 274, + "w": 22, + "h": 23 + } + }, + { + "filename": "grass_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 94, + "y": 297, + "w": 22, + "h": 23 + } + }, + { + "filename": "ground_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 94, + "y": 320, + "w": 22, + "h": 23 + } + }, { "filename": "ice_tera_shard", "rotated": false, @@ -3468,35 +2985,14 @@ "h": 23 }, "frame": { - "x": 158, - "y": 103, + "x": 94, + "y": 343, "w": 22, "h": 23 } }, { - "filename": "eviolite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 15, - "h": 15 - }, - "frame": { - "x": 158, - "y": 126, - "w": 15, - "h": 15 - } - }, - { - "filename": "dragon_memory", + "filename": "never_melt_ice", "rotated": false, "trimmed": true, "sourceSize": { @@ -3507,15 +3003,120 @@ "x": 5, "y": 5, "w": 22, + "h": 23 + }, + "frame": { + "x": 94, + "y": 366, + "w": 22, + "h": 23 + } + }, + { + "filename": "max_lure", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 17, + "h": 24 + }, + "frame": { + "x": 123, + "y": 137, + "w": 17, + "h": 24 + } + }, + { + "filename": "red_orb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 20, + "h": 24 + }, + "frame": { + "x": 123, + "y": 161, + "w": 20, + "h": 24 + } + }, + { + "filename": "binding_band", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 23, + "h": 20 + }, + "frame": { + "x": 123, + "y": 185, + "w": 23, + "h": 20 + } + }, + { + "filename": "healing_charm", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 23, "h": 22 }, "frame": { - "x": 160, - "y": 141, - "w": 22, + "x": 113, + "y": 205, + "w": 23, "h": 22 } }, + { + "filename": "normal_tera_shard", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 113, + "y": 227, + "w": 22, + "h": 23 + } + }, { "filename": "lansat_berry", "rotated": false, @@ -3531,8 +3132,8 @@ "h": 23 }, "frame": { - "x": 163, - "y": 163, + "x": 114, + "y": 250, "w": 21, "h": 23 } @@ -3552,77 +3153,14 @@ "h": 23 }, "frame": { - "x": 169, - "y": 186, + "x": 115, + "y": 273, "w": 21, "h": 23 } }, { - "filename": "prism_scale", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 9, - "y": 8, - "w": 15, - "h": 15 - }, - "frame": { - "x": 173, - "y": 126, - "w": 15, - "h": 15 - } - }, - { - "filename": "electirizer", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 182, - "y": 141, - "w": 22, - "h": 22 - } - }, - { - "filename": "never_melt_ice", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 23 - }, - "frame": { - "x": 184, - "y": 163, - "w": 22, - "h": 23 - } - }, - { - "filename": "normal_tera_shard", + "filename": "mystic_water", "rotated": false, "trimmed": true, "sourceSize": { @@ -3631,36 +3169,15 @@ }, "spriteSourceSize": { "x": 6, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 190, - "y": 186, - "w": 22, - "h": 23 - } - }, - { - "filename": "electric_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, "y": 5, - "w": 22, - "h": 22 + "w": 20, + "h": 23 }, "frame": { - "x": 184, - "y": 209, - "w": 22, - "h": 22 + "x": 116, + "y": 296, + "w": 20, + "h": 23 } }, { @@ -3678,8 +3195,8 @@ "h": 23 }, "frame": { - "x": 181, - "y": 231, + "x": 116, + "y": 319, "w": 22, "h": 23 } @@ -3699,8 +3216,8 @@ "h": 23 }, "frame": { - "x": 181, - "y": 254, + "x": 116, + "y": 342, "w": 22, "h": 23 } @@ -3720,8 +3237,8 @@ "h": 23 }, "frame": { - "x": 181, - "y": 277, + "x": 116, + "y": 365, "w": 22, "h": 23 } @@ -3741,12 +3258,33 @@ "h": 23 }, "frame": { - "x": 181, - "y": 300, + "x": 96, + "y": 389, "w": 22, "h": 23 } }, + { + "filename": "rusted_sword", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 23, + "h": 22 + }, + "frame": { + "x": 96, + "y": 412, + "w": 23, + "h": 22 + } + }, { "filename": "rock_tera_shard", "rotated": false, @@ -3762,54 +3300,12 @@ "h": 23 }, "frame": { - "x": 181, - "y": 323, + "x": 118, + "y": 388, "w": 22, "h": 23 } }, - { - "filename": "sacred_ash", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 24, - "h": 20 - }, - "frame": { - "x": 180, - "y": 63, - "w": 24, - "h": 20 - } - }, - { - "filename": "shadow_reins_of_unity", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 24, - "h": 20 - }, - "frame": { - "x": 179, - "y": 83, - "w": 24, - "h": 20 - } - }, { "filename": "steel_tera_shard", "rotated": false, @@ -3825,14 +3321,14 @@ "h": 23 }, "frame": { - "x": 180, - "y": 103, + "x": 119, + "y": 411, "w": 22, "h": 23 } }, { - "filename": "apicot_berry", + "filename": "berry_pot", "rotated": false, "trimmed": true, "sourceSize": { @@ -3840,37 +3336,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 19, - "h": 20 + "x": 7, + "y": 5, + "w": 18, + "h": 22 }, "frame": { - "x": 204, - "y": 63, - "w": 19, - "h": 20 - } - }, - { - "filename": "big_nugget", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 203, - "y": 83, - "w": 20, - "h": 20 + "x": 136, + "y": 205, + "w": 18, + "h": 22 } }, { @@ -3888,54 +3363,12 @@ "h": 23 }, "frame": { - "x": 202, - "y": 103, + "x": 135, + "y": 227, "w": 21, "h": 23 } }, - { - "filename": "binding_band", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 23, - "h": 20 - }, - "frame": { - "x": 215, - "y": 43, - "w": 23, - "h": 20 - } - }, - { - "filename": "n_solarizer", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 6, - "w": 23, - "h": 21 - }, - "frame": { - "x": 238, - "y": 42, - "w": 23, - "h": 21 - } - }, { "filename": "stellar_tera_shard", "rotated": false, @@ -3951,8 +3384,8 @@ "h": 23 }, "frame": { - "x": 223, - "y": 63, + "x": 135, + "y": 250, "w": 22, "h": 23 } @@ -3972,12 +3405,306 @@ "h": 23 }, "frame": { - "x": 223, - "y": 86, + "x": 136, + "y": 273, "w": 22, "h": 23 } }, + { + "filename": "wide_lens", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 136, + "y": 296, + "w": 22, + "h": 23 + } + }, + { + "filename": "whipped_dream", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 4, + "w": 21, + "h": 23 + }, + "frame": { + "x": 138, + "y": 319, + "w": 21, + "h": 23 + } + }, + { + "filename": "bug_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 138, + "y": 342, + "w": 22, + "h": 22 + } + }, + { + "filename": "charcoal", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 138, + "y": 364, + "w": 22, + "h": 22 + } + }, + { + "filename": "dark_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 140, + "y": 386, + "w": 22, + "h": 22 + } + }, + { + "filename": "dire_hit", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 141, + "y": 408, + "w": 22, + "h": 22 + } + }, + { + "filename": "blue_orb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 154, + "y": 81, + "w": 20, + "h": 20 + } + }, + { + "filename": "full_heal", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 9, + "y": 4, + "w": 15, + "h": 23 + }, + "frame": { + "x": 139, + "y": 81, + "w": 15, + "h": 23 + } + }, + { + "filename": "super_lure", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 17, + "h": 24 + }, + "frame": { + "x": 137, + "y": 104, + "w": 17, + "h": 24 + } + }, + { + "filename": "dna_splicers", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 154, + "y": 101, + "w": 22, + "h": 22 + } + }, + { + "filename": "dragon_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 176, + "y": 89, + "w": 22, + "h": 22 + } + }, + { + "filename": "electirizer", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 198, + "y": 89, + "w": 22, + "h": 22 + } + }, + { + "filename": "sacred_ash", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 24, + "h": 20 + }, + "frame": { + "x": 220, + "y": 89, + "w": 24, + "h": 20 + } + }, + { + "filename": "shadow_reins_of_unity", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 24, + "h": 20 + }, + "frame": { + "x": 244, + "y": 91, + "w": 24, + "h": 20 + } + }, { "filename": "soft_sand", "rotated": false, @@ -3993,14 +3720,14 @@ "h": 20 }, "frame": { - "x": 261, - "y": 42, + "x": 268, + "y": 91, "w": 24, "h": 20 } }, { - "filename": "reviver_seed", + "filename": "n_lunarizer", "rotated": false, "trimmed": true, "sourceSize": { @@ -4008,20 +3735,20 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, - "y": 8, + "x": 4, + "y": 6, "w": 23, - "h": 20 + "h": 21 }, "frame": { - "x": 285, - "y": 42, + "x": 292, + "y": 91, "w": 23, - "h": 20 + "h": 21 } }, { - "filename": "shell_bell", + "filename": "n_solarizer", "rotated": false, "trimmed": true, "sourceSize": { @@ -4029,16 +3756,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, - "y": 7, + "x": 4, + "y": 6, "w": 23, - "h": 20 + "h": 21 }, "frame": { - "x": 308, - "y": 42, + "x": 315, + "y": 91, "w": 23, - "h": 20 + "h": 21 } }, { @@ -4056,8 +3783,8 @@ "h": 21 }, "frame": { - "x": 331, - "y": 42, + "x": 338, + "y": 91, "w": 23, "h": 21 } @@ -4077,12 +3804,33 @@ "h": 21 }, "frame": { - "x": 354, - "y": 42, + "x": 361, + "y": 91, "w": 22, "h": 21 } }, + { + "filename": "electric_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 383, + "y": 91, + "w": 22, + "h": 22 + } + }, { "filename": "enigma_berry", "rotated": false, @@ -4098,14 +3846,14 @@ "h": 22 }, "frame": { - "x": 376, - "y": 42, + "x": 405, + "y": 91, "w": 22, "h": 22 } }, { - "filename": "deep_sea_scale", + "filename": "black_glasses", "rotated": false, "trimmed": true, "sourceSize": { @@ -4113,16 +3861,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 20 + "x": 4, + "y": 8, + "w": 23, + "h": 17 }, "frame": { - "x": 398, - "y": 44, - "w": 22, - "h": 20 + "x": 176, + "y": 111, + "w": 23, + "h": 17 } }, { @@ -4140,35 +3888,14 @@ "h": 19 }, "frame": { - "x": 223, - "y": 109, + "x": 199, + "y": 111, "w": 22, "h": 19 } }, { - "filename": "potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 17, - "h": 23 - }, - "frame": { - "x": 245, - "y": 63, - "w": 17, - "h": 23 - } - }, - { - "filename": "wide_lens", + "filename": "reviver_seed", "rotated": false, "trimmed": true, "sourceSize": { @@ -4177,439 +3904,19 @@ }, "spriteSourceSize": { "x": 5, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 262, - "y": 62, - "w": 22, - "h": 23 - } - }, - { - "filename": "fairy_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 284, - "y": 62, - "w": 22, - "h": 22 - } - }, - { - "filename": "fighting_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 306, - "y": 62, - "w": 22, - "h": 22 - } - }, - { - "filename": "fire_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 328, - "y": 63, - "w": 22, - "h": 22 - } - }, - { - "filename": "flying_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 350, - "y": 63, - "w": 22, - "h": 22 - } - }, - { - "filename": "sachet", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 4, - "w": 18, - "h": 23 - }, - "frame": { - "x": 245, - "y": 86, - "w": 18, - "h": 23 - } - }, - { - "filename": "whipped_dream", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 4, - "w": 21, - "h": 23 - }, - "frame": { - "x": 263, - "y": 85, - "w": 21, - "h": 23 - } - }, - { - "filename": "ganlon_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 284, - "y": 84, - "w": 22, - "h": 22 - } - }, - { - "filename": "ghost_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 306, - "y": 84, - "w": 22, - "h": 22 - } - }, - { - "filename": "grass_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 328, - "y": 85, - "w": 22, - "h": 22 - } - }, - { - "filename": "ground_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 350, - "y": 85, - "w": 22, - "h": 22 - } - }, - { - "filename": "guard_spec", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 372, - "y": 64, - "w": 22, - "h": 22 - } - }, - { - "filename": "ice_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 394, - "y": 64, - "w": 22, - "h": 22 - } - }, - { - "filename": "ice_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 372, - "y": 86, - "w": 22, - "h": 22 - } - }, - { - "filename": "magmarizer", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 394, - "y": 86, - "w": 22, - "h": 22 - } - }, - { - "filename": "mystery_egg", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, "y": 8, - "w": 16, - "h": 18 - }, - "frame": { - "x": 416, - "y": 64, - "w": 16, - "h": 18 - } - }, - { - "filename": "abomasite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 416, - "y": 82, - "w": 16, - "h": 16 - } - }, - { - "filename": "absolite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 416, - "y": 98, - "w": 16, - "h": 16 - } - }, - { - "filename": "revive", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 10, - "y": 8, - "w": 12, - "h": 17 - }, - "frame": { - "x": 420, - "y": 44, - "w": 12, - "h": 17 - } - }, - { - "filename": "big_mushroom", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 19, - "h": 19 - }, - "frame": { - "x": 245, - "y": 109, - "w": 19, - "h": 19 - } - }, - { - "filename": "blue_orb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, + "w": 23, "h": 20 }, "frame": { - "x": 264, - "y": 108, - "w": 20, + "x": 221, + "y": 109, + "w": 23, "h": 20 } }, { - "filename": "mini_black_hole", + "filename": "coupon", "rotated": false, "trimmed": true, "sourceSize": { @@ -4617,499 +3924,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 + "x": 4, + "y": 7, + "w": 23, + "h": 19 }, "frame": { - "x": 284, - "y": 106, - "w": 22, - "h": 22 - } - }, - { - "filename": "moon_flute", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 306, - "y": 106, - "w": 22, - "h": 22 - } - }, - { - "filename": "liechi_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 21 - }, - "frame": { - "x": 328, - "y": 107, - "w": 22, - "h": 21 - } - }, - { - "filename": "normal_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 350, - "y": 107, - "w": 22, - "h": 22 - } - }, - { - "filename": "poison_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 372, - "y": 108, - "w": 22, - "h": 22 - } - }, - { - "filename": "protector", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 394, - "y": 108, - "w": 22, - "h": 22 - } - }, - { - "filename": "aerodactylite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 416, - "y": 114, - "w": 16, - "h": 16 - } - }, - { - "filename": "psychic_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 179, - "y": 346, - "w": 22, - "h": 22 - } - }, - { - "filename": "aggronite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 179, - "y": 368, - "w": 16, - "h": 16 - } - }, - { - "filename": "super_potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 17, - "h": 23 - }, - "frame": { - "x": 186, - "y": 384, - "w": 17, - "h": 23 - } - }, - { - "filename": "alakazite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 195, - "y": 368, - "w": 16, - "h": 16 - } - }, - { - "filename": "hard_meteorite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 5, - "w": 20, - "h": 22 - }, - "frame": { - "x": 201, - "y": 346, - "w": 20, - "h": 22 - } - }, - { - "filename": "leftovers", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 15, - "h": 22 - }, - "frame": { - "x": 203, - "y": 384, - "w": 15, - "h": 22 - } - }, - { - "filename": "altarianite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 211, - "y": 368, - "w": 16, - "h": 16 - } - }, - { - "filename": "lock_capsule", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 5, - "w": 19, - "h": 22 - }, - "frame": { - "x": 218, - "y": 384, - "w": 19, - "h": 22 - } - }, - { - "filename": "metal_coat", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 5, - "w": 19, - "h": 22 - }, - "frame": { - "x": 196, - "y": 407, - "w": 19, - "h": 22 - } - }, - { - "filename": "rock_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 215, - "y": 406, - "w": 22, - "h": 22 - } - }, - { - "filename": "metronome", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 5, - "w": 17, - "h": 22 - }, - "frame": { - "x": 206, - "y": 209, - "w": 17, - "h": 22 - } - }, - { - "filename": "scroll_of_darkness", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 203, - "y": 231, - "w": 22, - "h": 22 - } - }, - { - "filename": "scroll_of_waters", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 203, - "y": 253, - "w": 22, - "h": 22 - } - }, - { - "filename": "shed_shell", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 203, - "y": 275, - "w": 22, - "h": 22 - } - }, - { - "filename": "starf_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 203, - "y": 297, - "w": 22, - "h": 22 - } - }, - { - "filename": "steel_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 203, - "y": 319, - "w": 22, - "h": 22 - } - }, - { - "filename": "quick_claw", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 19, - "h": 21 - }, - "frame": { - "x": 204, - "y": 126, - "w": 19, - "h": 21 + "x": 244, + "y": 111, + "w": 23, + "h": 19 } }, { @@ -5127,8 +3951,8 @@ "h": 19 }, "frame": { - "x": 223, - "y": 128, + "x": 267, + "y": 111, "w": 23, "h": 19 } @@ -5148,8 +3972,8 @@ "h": 19 }, "frame": { - "x": 246, - "y": 128, + "x": 290, + "y": 112, "w": 23, "h": 19 } @@ -5169,12 +3993,54 @@ "h": 19 }, "frame": { - "x": 269, - "y": 128, + "x": 313, + "y": 112, "w": 23, "h": 19 } }, + { + "filename": "shell_bell", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 7, + "w": 23, + "h": 20 + }, + "frame": { + "x": 336, + "y": 112, + "w": 23, + "h": 20 + } + }, + { + "filename": "deep_sea_scale", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 20 + }, + "frame": { + "x": 359, + "y": 112, + "w": 22, + "h": 20 + } + }, { "filename": "blunder_policy", "rotated": false, @@ -5190,8 +4056,8 @@ "h": 19 }, "frame": { - "x": 292, - "y": 128, + "x": 381, + "y": 113, "w": 22, "h": 19 } @@ -5211,14 +4077,14 @@ "h": 19 }, "frame": { - "x": 314, - "y": 128, + "x": 403, + "y": 113, "w": 22, "h": 19 } }, { - "filename": "ampharosite", + "filename": "fairy_feather", "rotated": false, "trimmed": true, "sourceSize": { @@ -5226,16 +4092,16 @@ "h": 32 }, "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 + "x": 5, + "y": 7, + "w": 22, + "h": 20 }, "frame": { - "x": 204, - "y": 147, - "w": 16, - "h": 16 + "x": 154, + "y": 123, + "w": 22, + "h": 20 } }, { @@ -5253,8 +4119,8 @@ "h": 17 }, "frame": { - "x": 220, - "y": 147, + "x": 176, + "y": 128, "w": 23, "h": 17 } @@ -5274,14 +4140,14 @@ "h": 17 }, "frame": { - "x": 243, - "y": 147, + "x": 199, + "y": 130, "w": 23, "h": 17 } }, { - "filename": "douse_drive", + "filename": "fairy_memory", "rotated": false, "trimmed": true, "sourceSize": { @@ -5289,16 +4155,184 @@ "h": 32 }, "spriteSourceSize": { - "x": 4, - "y": 8, - "w": 23, - "h": 17 + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 222, + "y": 129, + "w": 22, + "h": 22 + } + }, + { + "filename": "fighting_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 244, + "y": 130, + "w": 22, + "h": 22 + } + }, + { + "filename": "fire_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 }, "frame": { "x": 266, - "y": 147, - "w": 23, - "h": 17 + "y": 130, + "w": 22, + "h": 22 + } + }, + { + "filename": "flying_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 288, + "y": 131, + "w": 22, + "h": 22 + } + }, + { + "filename": "ganlon_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 310, + "y": 131, + "w": 22, + "h": 22 + } + }, + { + "filename": "ghost_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 332, + "y": 132, + "w": 22, + "h": 22 + } + }, + { + "filename": "grass_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 354, + "y": 132, + "w": 22, + "h": 22 + } + }, + { + "filename": "ground_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 376, + "y": 132, + "w": 22, + "h": 22 + } + }, + { + "filename": "guard_spec", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 398, + "y": 132, + "w": 22, + "h": 22 } }, { @@ -5316,14 +4350,140 @@ "h": 18 }, "frame": { - "x": 289, - "y": 147, + "x": 140, + "y": 143, "w": 23, "h": 18 } }, { - "filename": "fairy_feather", + "filename": "max_repel", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 143, + "y": 161, + "w": 16, + "h": 24 + } + }, + { + "filename": "apicot_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 20 + }, + "frame": { + "x": 146, + "y": 185, + "w": 19, + "h": 20 + } + }, + { + "filename": "hard_meteorite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 5, + "w": 20, + "h": 22 + }, + "frame": { + "x": 154, + "y": 205, + "w": 20, + "h": 22 + } + }, + { + "filename": "sachet", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 18, + "h": 23 + }, + "frame": { + "x": 156, + "y": 227, + "w": 18, + "h": 23 + } + }, + { + "filename": "hyper_potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 23 + }, + "frame": { + "x": 157, + "y": 250, + "w": 17, + "h": 23 + } + }, + { + "filename": "pp_max", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 158, + "y": 273, + "w": 16, + "h": 24 + } + }, + { + "filename": "ice_memory", "rotated": false, "trimmed": true, "sourceSize": { @@ -5332,19 +4492,586 @@ }, "spriteSourceSize": { "x": 5, - "y": 7, + "y": 5, "w": 22, + "h": 22 + }, + "frame": { + "x": 158, + "y": 297, + "w": 22, + "h": 22 + } + }, + { + "filename": "ice_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 159, + "y": 319, + "w": 22, + "h": 22 + } + }, + { + "filename": "magmarizer", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 160, + "y": 341, + "w": 22, + "h": 22 + } + }, + { + "filename": "mini_black_hole", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 160, + "y": 363, + "w": 22, + "h": 22 + } + }, + { + "filename": "moon_flute", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 162, + "y": 385, + "w": 22, + "h": 22 + } + }, + { + "filename": "normal_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 163, + "y": 407, + "w": 22, + "h": 22 + } + }, + { + "filename": "pp_up", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 159, + "y": 161, + "w": 16, + "h": 24 + } + }, + { + "filename": "candy_jar", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, "h": 20 }, "frame": { - "x": 312, + "x": 165, + "y": 185, + "w": 19, + "h": 20 + } + }, + { + "filename": "protein", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 174, + "y": 205, + "w": 16, + "h": 24 + } + }, + { + "filename": "repel", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 174, + "y": 229, + "w": 16, + "h": 24 + } + }, + { + "filename": "super_repel", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 174, + "y": 253, + "w": 16, + "h": 24 + } + }, + { + "filename": "gb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 174, + "y": 277, + "w": 20, + "h": 20 + } + }, + { + "filename": "leftovers", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 15, + "h": 22 + }, + "frame": { + "x": 180, + "y": 297, + "w": 15, + "h": 22 + } + }, + { + "filename": "lock_capsule", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 5, + "w": 19, + "h": 22 + }, + "frame": { + "x": 181, + "y": 319, + "w": 19, + "h": 22 + } + }, + { + "filename": "metal_coat", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 5, + "w": 19, + "h": 22 + }, + "frame": { + "x": 182, + "y": 341, + "w": 19, + "h": 22 + } + }, + { + "filename": "poison_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 182, + "y": 363, + "w": 22, + "h": 22 + } + }, + { + "filename": "protector", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 184, + "y": 385, + "w": 22, + "h": 22 + } + }, + { + "filename": "psychic_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 185, + "y": 407, + "w": 22, + "h": 22 + } + }, + { + "filename": "relic_band", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 9, + "w": 17, + "h": 16 + }, + "frame": { + "x": 163, + "y": 145, + "w": 17, + "h": 16 + } + }, + { + "filename": "unknown", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 175, + "y": 161, + "w": 16, + "h": 24 + } + }, + { + "filename": "abomasite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 180, + "y": 145, + "w": 16, + "h": 16 + } + }, + { + "filename": "douse_drive", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 8, + "w": 23, + "h": 17 + }, + "frame": { + "x": 196, "y": 147, + "w": 23, + "h": 17 + } + }, + { + "filename": "liechi_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 21 + }, + "frame": { + "x": 191, + "y": 164, + "w": 22, + "h": 21 + } + }, + { + "filename": "malicious_armor", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 20 + }, + "frame": { + "x": 184, + "y": 185, "w": 22, "h": 20 } }, { - "filename": "sun_flute", + "filename": "zinc", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 190, + "y": 205, + "w": 16, + "h": 24 + } + }, + { + "filename": "potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 23 + }, + "frame": { + "x": 190, + "y": 229, + "w": 17, + "h": 23 + } + }, + { + "filename": "super_potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 23 + }, + "frame": { + "x": 190, + "y": 252, + "w": 17, + "h": 23 + } + }, + { + "filename": "metronome", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 5, + "w": 17, + "h": 22 + }, + "frame": { + "x": 194, + "y": 275, + "w": 17, + "h": 22 + } + }, + { + "filename": "rock_memory", "rotated": false, "trimmed": true, "sourceSize": { @@ -5358,14 +5085,14 @@ "h": 22 }, "frame": { - "x": 206, - "y": 164, + "x": 195, + "y": 297, "w": 22, "h": 22 } }, { - "filename": "thick_club", + "filename": "scroll_of_darkness", "rotated": false, "trimmed": true, "sourceSize": { @@ -5379,14 +5106,14 @@ "h": 22 }, "frame": { - "x": 228, - "y": 164, + "x": 200, + "y": 319, "w": 22, "h": 22 } }, { - "filename": "thunder_stone", + "filename": "scroll_of_waters", "rotated": false, "trimmed": true, "sourceSize": { @@ -5400,14 +5127,14 @@ "h": 22 }, "frame": { - "x": 212, - "y": 186, + "x": 201, + "y": 341, "w": 22, "h": 22 } }, { - "filename": "tm_bug", + "filename": "shed_shell", "rotated": false, "trimmed": true, "sourceSize": { @@ -5421,50 +5148,8 @@ "h": 22 }, "frame": { - "x": 250, - "y": 164, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_dark", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 234, - "y": 186, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_dragon", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 223, - "y": 208, + "x": 204, + "y": 363, "w": 22, "h": 22 } @@ -5484,14 +5169,14 @@ "h": 22 }, "frame": { - "x": 225, - "y": 230, + "x": 206, + "y": 385, "w": 20, "h": 22 } }, { - "filename": "tm_electric", + "filename": "starf_berry", "rotated": false, "trimmed": true, "sourceSize": { @@ -5505,978 +5190,12 @@ "h": 22 }, "frame": { - "x": 225, - "y": 252, + "x": 207, + "y": 407, "w": 22, "h": 22 } }, - { - "filename": "tm_fairy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 225, - "y": 274, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_fighting", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 225, - "y": 296, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_fire", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 225, - "y": 318, - "w": 22, - "h": 22 - } - }, - { - "filename": "soothe_bell", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 17, - "h": 22 - }, - "frame": { - "x": 272, - "y": 164, - "w": 17, - "h": 22 - } - }, - { - "filename": "tm_flying", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 256, - "y": 186, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_ghost", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 245, - "y": 208, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_grass", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 245, - "y": 230, - "w": 22, - "h": 22 - } - }, - { - "filename": "sweet_apple", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 21 - }, - "frame": { - "x": 289, - "y": 165, - "w": 22, - "h": 21 - } - }, - { - "filename": "tm_ground", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 278, - "y": 186, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_ice", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 267, - "y": 208, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_normal", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 267, - "y": 230, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_poison", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 247, - "y": 252, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_psychic", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 247, - "y": 274, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_rock", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 247, - "y": 296, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_steel", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 247, - "y": 318, - "w": 22, - "h": 22 - } - }, - { - "filename": "tm_water", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 269, - "y": 252, - "w": 22, - "h": 22 - } - }, - { - "filename": "water_memory", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 269, - "y": 274, - "w": 22, - "h": 22 - } - }, - { - "filename": "water_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 269, - "y": 296, - "w": 22, - "h": 22 - } - }, - { - "filename": "x_accuracy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 269, - "y": 318, - "w": 22, - "h": 22 - } - }, - { - "filename": "malicious_armor", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 20 - }, - "frame": { - "x": 311, - "y": 167, - "w": 22, - "h": 20 - } - }, - { - "filename": "x_attack", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 289, - "y": 208, - "w": 22, - "h": 22 - } - }, - { - "filename": "x_defense", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 289, - "y": 230, - "w": 22, - "h": 22 - } - }, - { - "filename": "syrupy_apple", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 21 - }, - "frame": { - "x": 300, - "y": 187, - "w": 22, - "h": 21 - } - }, - { - "filename": "x_sp_atk", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 291, - "y": 252, - "w": 22, - "h": 22 - } - }, - { - "filename": "x_sp_def", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 291, - "y": 274, - "w": 22, - "h": 22 - } - }, - { - "filename": "x_speed", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 291, - "y": 296, - "w": 22, - "h": 22 - } - }, - { - "filename": "tart_apple", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 21 - }, - "frame": { - "x": 291, - "y": 318, - "w": 22, - "h": 21 - } - }, - { - "filename": "dawn_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 21 - }, - "frame": { - "x": 322, - "y": 187, - "w": 20, - "h": 21 - } - }, - { - "filename": "dusk_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 311, - "y": 208, - "w": 21, - "h": 21 - } - }, - { - "filename": "poison_barb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 311, - "y": 229, - "w": 21, - "h": 21 - } - }, - { - "filename": "flying_tera_shard", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 5, - "w": 20, - "h": 21 - }, - "frame": { - "x": 313, - "y": 250, - "w": 20, - "h": 21 - } - }, - { - "filename": "shiny_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 313, - "y": 271, - "w": 21, - "h": 21 - } - }, - { - "filename": "zoom_lens", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 313, - "y": 292, - "w": 21, - "h": 21 - } - }, - { - "filename": "tera_orb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 20 - }, - "frame": { - "x": 313, - "y": 313, - "w": 22, - "h": 20 - } - }, - { - "filename": "spell_tag", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 19, - "h": 21 - }, - "frame": { - "x": 332, - "y": 208, - "w": 19, - "h": 21 - } - }, - { - "filename": "candy_jar", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 19, - "h": 20 - }, - "frame": { - "x": 332, - "y": 229, - "w": 19, - "h": 20 - } - }, - { - "filename": "gb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 333, - "y": 249, - "w": 20, - "h": 20 - } - }, - { - "filename": "hard_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 19, - "h": 20 - }, - "frame": { - "x": 334, - "y": 269, - "w": 19, - "h": 20 - } - }, - { - "filename": "magnet", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 334, - "y": 289, - "w": 20, - "h": 20 - } - }, - { - "filename": "mb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 335, - "y": 309, - "w": 20, - "h": 20 - } - }, - { - "filename": "golden_egg", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 17, - "h": 20 - }, - "frame": { - "x": 333, - "y": 167, - "w": 17, - "h": 20 - } - }, - { - "filename": "lucky_egg", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 17, - "h": 20 - }, - "frame": { - "x": 334, - "y": 147, - "w": 17, - "h": 20 - } - }, - { - "filename": "masterpiece_teacup", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 7, - "w": 21, - "h": 18 - }, - "frame": { - "x": 336, - "y": 129, - "w": 21, - "h": 18 - } - }, - { - "filename": "pb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 342, - "y": 187, - "w": 20, - "h": 20 - } - }, - { - "filename": "pb_gold", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 350, - "y": 167, - "w": 20, - "h": 20 - } - }, - { - "filename": "pb_silver", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 351, - "y": 147, - "w": 20, - "h": 20 - } - }, { "filename": "shock_drive", "rotated": false, @@ -6492,8 +5211,8 @@ "h": 17 }, "frame": { - "x": 357, - "y": 130, + "x": 219, + "y": 151, "w": 23, "h": 17 } @@ -6513,12 +5232,201 @@ "h": 17 }, "frame": { - "x": 380, - "y": 130, + "x": 242, + "y": 152, "w": 23, "h": 17 } }, + { + "filename": "steel_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 265, + "y": 152, + "w": 22, + "h": 22 + } + }, + { + "filename": "sun_flute", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 287, + "y": 153, + "w": 22, + "h": 22 + } + }, + { + "filename": "thick_club", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 309, + "y": 153, + "w": 22, + "h": 22 + } + }, + { + "filename": "sweet_apple", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 21 + }, + "frame": { + "x": 331, + "y": 154, + "w": 22, + "h": 21 + } + }, + { + "filename": "syrupy_apple", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 21 + }, + "frame": { + "x": 353, + "y": 154, + "w": 22, + "h": 21 + } + }, + { + "filename": "tart_apple", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 21 + }, + "frame": { + "x": 375, + "y": 154, + "w": 22, + "h": 21 + } + }, + { + "filename": "thunder_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 397, + "y": 154, + "w": 22, + "h": 22 + } + }, + { + "filename": "tera_orb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 20 + }, + "frame": { + "x": 213, + "y": 168, + "w": 22, + "h": 20 + } + }, + { + "filename": "tm_bug", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 206, + "y": 188, + "w": 22, + "h": 22 + } + }, { "filename": "upgrade", "rotated": false, @@ -6534,12 +5442,663 @@ "h": 19 }, "frame": { - "x": 371, - "y": 147, + "x": 206, + "y": 210, "w": 22, "h": 19 } }, + { + "filename": "tm_dark", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 207, + "y": 229, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_dragon", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 207, + "y": 251, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_electric", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 211, + "y": 273, + "w": 22, + "h": 22 + } + }, + { + "filename": "soothe_bell", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 22 + }, + "frame": { + "x": 217, + "y": 295, + "w": 17, + "h": 22 + } + }, + { + "filename": "tm_fairy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 235, + "y": 169, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_fighting", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 228, + "y": 191, + "w": 22, + "h": 22 + } + }, + { + "filename": "absolite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 228, + "y": 213, + "w": 16, + "h": 16 + } + }, + { + "filename": "tm_fire", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 229, + "y": 229, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_flying", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 229, + "y": 251, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_ghost", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 233, + "y": 273, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_grass", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 234, + "y": 295, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_ground", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 222, + "y": 317, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_ice", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 223, + "y": 339, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_normal", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 226, + "y": 361, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_poison", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 226, + "y": 383, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_psychic", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 229, + "y": 405, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_rock", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 244, + "y": 317, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_steel", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 245, + "y": 339, + "w": 22, + "h": 22 + } + }, + { + "filename": "tm_water", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 248, + "y": 361, + "w": 22, + "h": 22 + } + }, + { + "filename": "water_memory", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 248, + "y": 383, + "w": 22, + "h": 22 + } + }, + { + "filename": "water_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 251, + "y": 405, + "w": 22, + "h": 22 + } + }, + { + "filename": "eviolite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 15, + "h": 15 + }, + "frame": { + "x": 419, + "y": 154, + "w": 15, + "h": 15 + } + }, + { + "filename": "prism_scale", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 9, + "y": 8, + "w": 15, + "h": 15 + }, + "frame": { + "x": 419, + "y": 169, + "w": 15, + "h": 15 + } + }, + { + "filename": "x_accuracy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 257, + "y": 174, + "w": 22, + "h": 22 + } + }, + { + "filename": "x_attack", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 279, + "y": 175, + "w": 22, + "h": 22 + } + }, + { + "filename": "x_defense", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 301, + "y": 175, + "w": 22, + "h": 22 + } + }, + { + "filename": "x_sp_atk", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 323, + "y": 175, + "w": 22, + "h": 22 + } + }, + { + "filename": "x_sp_def", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 345, + "y": 175, + "w": 22, + "h": 22 + } + }, + { + "filename": "x_speed", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 367, + "y": 175, + "w": 22, + "h": 22 + } + }, + { + "filename": "dusk_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 21, + "h": 21 + }, + "frame": { + "x": 389, + "y": 176, + "w": 21, + "h": 21 + } + }, + { + "filename": "masterpiece_teacup", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 7, + "w": 21, + "h": 18 + }, + "frame": { + "x": 250, + "y": 196, + "w": 21, + "h": 18 + } + }, { "filename": "metal_alloy", "rotated": false, @@ -6555,14 +6114,98 @@ "h": 19 }, "frame": { - "x": 403, - "y": 130, + "x": 271, + "y": 197, "w": 21, "h": 19 } }, { - "filename": "razor_fang", + "filename": "poison_barb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 21, + "h": 21 + }, + "frame": { + "x": 292, + "y": 197, + "w": 21, + "h": 21 + } + }, + { + "filename": "shiny_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 21, + "h": 21 + }, + "frame": { + "x": 313, + "y": 197, + "w": 21, + "h": 21 + } + }, + { + "filename": "zoom_lens", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 21, + "h": 21 + }, + "frame": { + "x": 334, + "y": 197, + "w": 21, + "h": 21 + } + }, + { + "filename": "dawn_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 21 + }, + "frame": { + "x": 355, + "y": 197, + "w": 20, + "h": 21 + } + }, + { + "filename": "flying_tera_shard", "rotated": false, "trimmed": true, "sourceSize": { @@ -6571,19 +6214,40 @@ }, "spriteSourceSize": { "x": 7, - "y": 6, - "w": 18, - "h": 20 + "y": 5, + "w": 20, + "h": 21 }, "frame": { - "x": 351, - "y": 207, - "w": 18, - "h": 20 + "x": 375, + "y": 197, + "w": 20, + "h": 21 } }, { - "filename": "rb", + "filename": "quick_claw", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 21 + }, + "frame": { + "x": 395, + "y": 197, + "w": 19, + "h": 21 + } + }, + { + "filename": "magnet", "rotated": false, "trimmed": true, "sourceSize": { @@ -6597,35 +6261,14 @@ "h": 20 }, "frame": { - "x": 351, - "y": 227, + "x": 414, + "y": 184, "w": 20, "h": 20 } }, { - "filename": "smooth_meteorite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 353, - "y": 247, - "w": 20, - "h": 20 - } - }, - { - "filename": "strange_ball", + "filename": "mb", "rotated": false, "trimmed": true, "sourceSize": { @@ -6639,14 +6282,14 @@ "h": 20 }, "frame": { - "x": 353, - "y": 267, + "x": 414, + "y": 204, "w": 20, "h": 20 } }, { - "filename": "ub", + "filename": "pb", "rotated": false, "trimmed": true, "sourceSize": { @@ -6660,8 +6303,50 @@ "h": 20 }, "frame": { - "x": 354, - "y": 287, + "x": 251, + "y": 214, + "w": 20, + "h": 20 + } + }, + { + "filename": "old_gateau", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 21, + "h": 18 + }, + "frame": { + "x": 271, + "y": 216, + "w": 21, + "h": 18 + } + }, + { + "filename": "pb_gold", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 251, + "y": 234, "w": 20, "h": 20 } @@ -6681,14 +6366,98 @@ "h": 19 }, "frame": { - "x": 355, - "y": 307, + "x": 251, + "y": 254, "w": 20, "h": 19 } }, { - "filename": "old_gateau", + "filename": "pb_silver", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 271, + "y": 234, + "w": 20, + "h": 20 + } + }, + { + "filename": "power_herb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 7, + "w": 20, + "h": 19 + }, + "frame": { + "x": 271, + "y": 254, + "w": 20, + "h": 19 + } + }, + { + "filename": "rb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 255, + "y": 273, + "w": 20, + "h": 20 + } + }, + { + "filename": "spell_tag", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 6, + "w": 19, + "h": 21 + }, + "frame": { + "x": 256, + "y": 293, + "w": 19, + "h": 21 + } + }, + { + "filename": "sharp_meteorite", "rotated": false, "trimmed": true, "sourceSize": { @@ -6702,14 +6471,14 @@ "h": 18 }, "frame": { - "x": 393, - "y": 149, + "x": 292, + "y": 218, "w": 21, "h": 18 } }, { - "filename": "oval_stone", + "filename": "smooth_meteorite", "rotated": false, "trimmed": true, "sourceSize": { @@ -6718,14 +6487,182 @@ }, "spriteSourceSize": { "x": 7, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 291, + "y": 236, + "w": 20, + "h": 20 + } + }, + { + "filename": "unremarkable_teacup", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, "y": 7, - "w": 18, + "w": 21, + "h": 18 + }, + "frame": { + "x": 313, + "y": 218, + "w": 21, + "h": 18 + } + }, + { + "filename": "strange_ball", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 311, + "y": 236, + "w": 20, + "h": 20 + } + }, + { + "filename": "razor_claw", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 7, + "w": 20, "h": 19 }, "frame": { - "x": 414, - "y": 149, - "w": 18, + "x": 334, + "y": 218, + "w": 20, + "h": 19 + } + }, + { + "filename": "ub", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 354, + "y": 218, + "w": 20, + "h": 20 + } + }, + { + "filename": "hard_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 20 + }, + "frame": { + "x": 374, + "y": 218, + "w": 19, + "h": 20 + } + }, + { + "filename": "white_herb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 7, + "w": 20, + "h": 19 + }, + "frame": { + "x": 393, + "y": 218, + "w": 20, + "h": 19 + } + }, + { + "filename": "everstone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 17 + }, + "frame": { + "x": 291, + "y": 256, + "w": 20, + "h": 17 + } + }, + { + "filename": "big_mushroom", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 19 + }, + "frame": { + "x": 275, + "y": 273, + "w": 19, "h": 19 } }, @@ -6744,14 +6681,14 @@ "h": 19 }, "frame": { - "x": 362, - "y": 187, + "x": 275, + "y": 292, "w": 19, "h": 19 } }, { - "filename": "power_herb", + "filename": "golden_egg", "rotated": false, "trimmed": true, "sourceSize": { @@ -6759,20 +6696,20 @@ "h": 32 }, "spriteSourceSize": { - "x": 6, - "y": 7, - "w": 20, - "h": 19 + "x": 7, + "y": 6, + "w": 17, + "h": 20 }, "frame": { - "x": 369, - "y": 206, - "w": 20, - "h": 19 + "x": 294, + "y": 273, + "w": 17, + "h": 20 } }, { - "filename": "razor_claw", + "filename": "razor_fang", "rotated": false, "trimmed": true, "sourceSize": { @@ -6780,20 +6717,20 @@ "h": 32 }, "spriteSourceSize": { - "x": 6, - "y": 7, - "w": 20, - "h": 19 + "x": 7, + "y": 6, + "w": 18, + "h": 20 }, "frame": { - "x": 371, - "y": 225, - "w": 20, - "h": 19 + "x": 311, + "y": 256, + "w": 18, + "h": 20 } }, { - "filename": "white_herb", + "filename": "baton", "rotated": false, "trimmed": true, "sourceSize": { @@ -6801,57 +6738,15 @@ "h": 32 }, "spriteSourceSize": { - "x": 6, + "x": 7, "y": 7, - "w": 20, - "h": 19 - }, - "frame": { - "x": 373, - "y": 244, - "w": 20, - "h": 19 - } - }, - { - "filename": "sharp_meteorite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 21, + "w": 18, "h": 18 }, "frame": { - "x": 373, - "y": 263, - "w": 21, - "h": 18 - } - }, - { - "filename": "unremarkable_teacup", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 7, - "w": 21, - "h": 18 - }, - "frame": { - "x": 374, - "y": 281, - "w": 21, + "x": 294, + "y": 293, + "w": 18, "h": 18 } }, @@ -6870,33 +6765,12 @@ "h": 18 }, "frame": { - "x": 375, - "y": 299, + "x": 331, + "y": 237, "w": 20, "h": 18 } }, - { - "filename": "everstone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 17 - }, - "frame": { - "x": 375, - "y": 317, - "w": 20, - "h": 17 - } - }, { "filename": "wl_antidote", "rotated": false, @@ -6912,8 +6786,8 @@ "h": 18 }, "frame": { - "x": 355, - "y": 326, + "x": 351, + "y": 238, "w": 20, "h": 18 } @@ -6933,12 +6807,54 @@ "h": 18 }, "frame": { - "x": 335, - "y": 329, + "x": 371, + "y": 238, "w": 20, "h": 18 } }, + { + "filename": "aerodactylite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 311, + "y": 276, + "w": 16, + "h": 16 + } + }, + { + "filename": "lucky_egg", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 6, + "w": 17, + "h": 20 + }, + "frame": { + "x": 312, + "y": 292, + "w": 17, + "h": 20 + } + }, { "filename": "wl_burn_heal", "rotated": false, @@ -6954,8 +6870,8 @@ "h": 18 }, "frame": { - "x": 375, - "y": 334, + "x": 413, + "y": 224, "w": 20, "h": 18 } @@ -6975,8 +6891,8 @@ "h": 18 }, "frame": { - "x": 355, - "y": 344, + "x": 393, + "y": 237, "w": 20, "h": 18 } @@ -6996,12 +6912,33 @@ "h": 18 }, "frame": { - "x": 375, - "y": 352, + "x": 413, + "y": 242, "w": 20, "h": 18 } }, + { + "filename": "oval_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 7, + "w": 18, + "h": 19 + }, + "frame": { + "x": 266, + "y": 314, + "w": 18, + "h": 19 + } + }, { "filename": "wl_elixir", "rotated": false, @@ -7017,12 +6954,33 @@ "h": 18 }, "frame": { - "x": 313, - "y": 333, + "x": 284, + "y": 311, "w": 20, "h": 18 } }, + { + "filename": "candy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 11, + "w": 18, + "h": 18 + }, + "frame": { + "x": 267, + "y": 333, + "w": 18, + "h": 18 + } + }, { "filename": "wl_ether", "rotated": false, @@ -7038,12 +6996,96 @@ "h": 18 }, "frame": { - "x": 333, - "y": 347, + "x": 285, + "y": 329, "w": 20, "h": 18 } }, + { + "filename": "aggronite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 304, + "y": 312, + "w": 16, + "h": 16 + } + }, + { + "filename": "dark_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 7, + "w": 18, + "h": 18 + }, + "frame": { + "x": 305, + "y": 328, + "w": 18, + "h": 18 + } + }, + { + "filename": "alakazite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 320, + "y": 312, + "w": 16, + "h": 16 + } + }, + { + "filename": "flame_orb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 7, + "w": 18, + "h": 18 + }, + "frame": { + "x": 323, + "y": 328, + "w": 18, + "h": 18 + } + }, { "filename": "wl_full_heal", "rotated": false, @@ -7059,8 +7101,8 @@ "h": 18 }, "frame": { - "x": 371, - "y": 166, + "x": 285, + "y": 347, "w": 20, "h": 18 } @@ -7080,12 +7122,33 @@ "h": 18 }, "frame": { - "x": 391, - "y": 167, + "x": 305, + "y": 346, "w": 20, "h": 18 } }, + { + "filename": "light_ball", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 7, + "w": 18, + "h": 18 + }, + "frame": { + "x": 325, + "y": 346, + "w": 18, + "h": 18 + } + }, { "filename": "wl_guard_spec", "rotated": false, @@ -7101,8 +7164,8 @@ "h": 18 }, "frame": { - "x": 411, - "y": 168, + "x": 270, + "y": 365, "w": 20, "h": 18 } @@ -7122,14 +7185,14 @@ "h": 18 }, "frame": { - "x": 381, - "y": 185, + "x": 270, + "y": 383, "w": 20, "h": 18 } }, { - "filename": "baton", + "filename": "light_stone", "rotated": false, "trimmed": true, "sourceSize": { @@ -7143,71 +7206,8 @@ "h": 18 }, "frame": { - "x": 389, - "y": 203, - "w": 18, - "h": 18 - } - }, - { - "filename": "candy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 11, - "w": 18, - "h": 18 - }, - "frame": { - "x": 391, - "y": 221, - "w": 18, - "h": 18 - } - }, - { - "filename": "dark_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 7, - "w": 18, - "h": 18 - }, - "frame": { - "x": 393, - "y": 239, - "w": 18, - "h": 18 - } - }, - { - "filename": "flame_orb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 7, - "w": 18, - "h": 18 - }, - "frame": { - "x": 394, - "y": 257, + "x": 290, + "y": 365, "w": 18, "h": 18 } @@ -7227,12 +7227,33 @@ "h": 18 }, "frame": { - "x": 412, - "y": 186, + "x": 308, + "y": 364, "w": 20, "h": 18 } }, + { + "filename": "toxic_orb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 7, + "w": 18, + "h": 18 + }, + "frame": { + "x": 290, + "y": 383, + "w": 18, + "h": 18 + } + }, { "filename": "wl_item_drop", "rotated": false, @@ -7248,8 +7269,8 @@ "h": 18 }, "frame": { - "x": 412, - "y": 204, + "x": 308, + "y": 382, "w": 20, "h": 18 } @@ -7269,12 +7290,33 @@ "h": 18 }, "frame": { - "x": 412, - "y": 222, + "x": 273, + "y": 401, "w": 20, "h": 18 } }, + { + "filename": "mystery_egg", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 18 + }, + "frame": { + "x": 328, + "y": 364, + "w": 16, + "h": 18 + } + }, { "filename": "wl_max_elixir", "rotated": false, @@ -7290,8 +7332,8 @@ "h": 18 }, "frame": { - "x": 412, - "y": 240, + "x": 328, + "y": 382, "w": 20, "h": 18 } @@ -7311,8 +7353,92 @@ "h": 18 }, "frame": { - "x": 412, - "y": 258, + "x": 293, + "y": 401, + "w": 20, + "h": 18 + } + }, + { + "filename": "wl_max_potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 18 + }, + "frame": { + "x": 313, + "y": 400, + "w": 20, + "h": 18 + } + }, + { + "filename": "altarianite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 313, + "y": 418, + "w": 16, + "h": 16 + } + }, + { + "filename": "ampharosite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 329, + "y": 418, + "w": 16, + "h": 16 + } + }, + { + "filename": "wl_max_revive", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 18 + }, + "frame": { + "x": 333, + "y": 400, "w": 20, "h": 18 } @@ -7332,117 +7458,12 @@ "h": 16 }, "frame": { - "x": 395, - "y": 275, + "x": 345, + "y": 418, "w": 16, "h": 16 } }, - { - "filename": "light_ball", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 7, - "w": 18, - "h": 18 - }, - "frame": { - "x": 395, - "y": 291, - "w": 18, - "h": 18 - } - }, - { - "filename": "light_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 7, - "w": 18, - "h": 18 - }, - "frame": { - "x": 395, - "y": 309, - "w": 18, - "h": 18 - } - }, - { - "filename": "toxic_orb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 7, - "w": 18, - "h": 18 - }, - "frame": { - "x": 395, - "y": 327, - "w": 18, - "h": 18 - } - }, - { - "filename": "wl_max_potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 18 - }, - "frame": { - "x": 395, - "y": 345, - "w": 20, - "h": 18 - } - }, - { - "filename": "wl_max_revive", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 18 - }, - "frame": { - "x": 395, - "y": 363, - "w": 20, - "h": 18 - } - }, { "filename": "wl_paralyze_heal", "rotated": false, @@ -7458,8 +7479,8 @@ "h": 18 }, "frame": { - "x": 225, - "y": 340, + "x": 331, + "y": 255, "w": 20, "h": 18 } @@ -7479,8 +7500,8 @@ "h": 18 }, "frame": { - "x": 245, - "y": 340, + "x": 351, + "y": 256, "w": 20, "h": 18 } @@ -7500,8 +7521,8 @@ "h": 18 }, "frame": { - "x": 265, - "y": 340, + "x": 371, + "y": 256, "w": 20, "h": 18 } @@ -7521,8 +7542,8 @@ "h": 18 }, "frame": { - "x": 227, - "y": 358, + "x": 391, + "y": 255, "w": 20, "h": 18 } @@ -7542,8 +7563,8 @@ "h": 18 }, "frame": { - "x": 247, - "y": 358, + "x": 411, + "y": 260, "w": 20, "h": 18 } @@ -7563,8 +7584,8 @@ "h": 16 }, "frame": { - "x": 267, - "y": 358, + "x": 327, + "y": 276, "w": 16, "h": 16 } @@ -7584,8 +7605,8 @@ "h": 16 }, "frame": { - "x": 237, - "y": 376, + "x": 329, + "y": 292, "w": 16, "h": 16 } @@ -7605,8 +7626,8 @@ "h": 16 }, "frame": { - "x": 237, - "y": 392, + "x": 343, + "y": 274, "w": 16, "h": 16 } @@ -7626,8 +7647,8 @@ "h": 16 }, "frame": { - "x": 237, - "y": 408, + "x": 359, + "y": 274, "w": 16, "h": 16 } @@ -7647,8 +7668,8 @@ "h": 16 }, "frame": { - "x": 253, - "y": 376, + "x": 375, + "y": 274, "w": 16, "h": 16 } @@ -7668,8 +7689,8 @@ "h": 16 }, "frame": { - "x": 253, - "y": 392, + "x": 391, + "y": 273, "w": 16, "h": 16 } @@ -7689,8 +7710,8 @@ "h": 16 }, "frame": { - "x": 253, - "y": 408, + "x": 345, + "y": 290, "w": 16, "h": 16 } @@ -7710,8 +7731,8 @@ "h": 16 }, "frame": { - "x": 269, - "y": 374, + "x": 361, + "y": 290, "w": 16, "h": 16 } @@ -7731,8 +7752,8 @@ "h": 16 }, "frame": { - "x": 269, - "y": 390, + "x": 377, + "y": 290, "w": 16, "h": 16 } @@ -7752,8 +7773,8 @@ "h": 16 }, "frame": { - "x": 269, - "y": 406, + "x": 393, + "y": 289, "w": 16, "h": 16 } @@ -7773,8 +7794,8 @@ "h": 16 }, "frame": { - "x": 285, - "y": 340, + "x": 336, + "y": 308, "w": 16, "h": 16 } @@ -7794,8 +7815,8 @@ "h": 16 }, "frame": { - "x": 283, - "y": 358, + "x": 352, + "y": 306, "w": 16, "h": 16 } @@ -7815,8 +7836,8 @@ "h": 16 }, "frame": { - "x": 285, - "y": 374, + "x": 368, + "y": 306, "w": 16, "h": 16 } @@ -7836,8 +7857,8 @@ "h": 16 }, "frame": { - "x": 285, - "y": 390, + "x": 384, + "y": 306, "w": 16, "h": 16 } @@ -7857,8 +7878,8 @@ "h": 16 }, "frame": { - "x": 285, - "y": 406, + "x": 400, + "y": 305, "w": 16, "h": 16 } @@ -7878,8 +7899,8 @@ "h": 16 }, "frame": { - "x": 353, - "y": 362, + "x": 341, + "y": 324, "w": 16, "h": 16 } @@ -7899,8 +7920,8 @@ "h": 16 }, "frame": { - "x": 369, - "y": 370, + "x": 357, + "y": 322, "w": 16, "h": 16 } @@ -7920,8 +7941,8 @@ "h": 16 }, "frame": { - "x": 413, - "y": 276, + "x": 373, + "y": 322, "w": 16, "h": 16 } @@ -7941,8 +7962,8 @@ "h": 16 }, "frame": { - "x": 413, - "y": 292, + "x": 389, + "y": 322, "w": 16, "h": 16 } @@ -7962,8 +7983,8 @@ "h": 16 }, "frame": { - "x": 413, - "y": 308, + "x": 405, + "y": 321, "w": 16, "h": 16 } @@ -7983,8 +8004,8 @@ "h": 16 }, "frame": { - "x": 413, - "y": 324, + "x": 343, + "y": 340, "w": 16, "h": 16 } @@ -8004,8 +8025,8 @@ "h": 16 }, "frame": { - "x": 415, - "y": 340, + "x": 359, + "y": 338, "w": 16, "h": 16 } @@ -8025,8 +8046,8 @@ "h": 16 }, "frame": { - "x": 415, - "y": 356, + "x": 375, + "y": 338, "w": 16, "h": 16 } @@ -8046,8 +8067,8 @@ "h": 16 }, "frame": { - "x": 415, - "y": 372, + "x": 391, + "y": 338, "w": 16, "h": 16 } @@ -8067,8 +8088,8 @@ "h": 16 }, "frame": { - "x": 299, - "y": 356, + "x": 407, + "y": 337, "w": 16, "h": 16 } @@ -8088,8 +8109,8 @@ "h": 16 }, "frame": { - "x": 301, - "y": 372, + "x": 344, + "y": 356, "w": 16, "h": 16 } @@ -8109,8 +8130,8 @@ "h": 16 }, "frame": { - "x": 301, - "y": 388, + "x": 360, + "y": 354, "w": 16, "h": 16 } @@ -8130,8 +8151,8 @@ "h": 16 }, "frame": { - "x": 301, - "y": 404, + "x": 376, + "y": 354, "w": 16, "h": 16 } @@ -8151,8 +8172,8 @@ "h": 16 }, "frame": { - "x": 317, - "y": 351, + "x": 392, + "y": 354, "w": 16, "h": 16 } @@ -8172,8 +8193,8 @@ "h": 16 }, "frame": { - "x": 317, - "y": 367, + "x": 408, + "y": 353, "w": 16, "h": 16 } @@ -8193,8 +8214,8 @@ "h": 16 }, "frame": { - "x": 333, - "y": 365, + "x": 409, + "y": 278, "w": 16, "h": 16 } @@ -8214,8 +8235,8 @@ "h": 16 }, "frame": { - "x": 317, - "y": 383, + "x": 348, + "y": 372, "w": 16, "h": 16 } @@ -8235,8 +8256,8 @@ "h": 16 }, "frame": { - "x": 333, - "y": 381, + "x": 364, + "y": 370, "w": 16, "h": 16 } @@ -8256,8 +8277,8 @@ "h": 16 }, "frame": { - "x": 317, - "y": 399, + "x": 380, + "y": 370, "w": 16, "h": 16 } @@ -8277,8 +8298,8 @@ "h": 16 }, "frame": { - "x": 333, - "y": 397, + "x": 396, + "y": 370, "w": 16, "h": 16 } @@ -8298,8 +8319,8 @@ "h": 16 }, "frame": { - "x": 349, - "y": 378, + "x": 412, + "y": 369, "w": 16, "h": 16 } @@ -8319,8 +8340,8 @@ "h": 16 }, "frame": { - "x": 349, - "y": 394, + "x": 364, + "y": 386, "w": 16, "h": 16 } @@ -8340,7 +8361,7 @@ "h": 16 }, "frame": { - "x": 365, + "x": 380, "y": 386, "w": 16, "h": 16 @@ -8361,8 +8382,8 @@ "h": 16 }, "frame": { - "x": 365, - "y": 402, + "x": 396, + "y": 386, "w": 16, "h": 16 } @@ -8382,8 +8403,8 @@ "h": 16 }, "frame": { - "x": 349, - "y": 410, + "x": 412, + "y": 385, "w": 16, "h": 16 } @@ -8403,8 +8424,8 @@ "h": 16 }, "frame": { - "x": 333, - "y": 413, + "x": 353, + "y": 402, "w": 16, "h": 16 } @@ -8424,8 +8445,8 @@ "h": 16 }, "frame": { - "x": 317, - "y": 415, + "x": 361, + "y": 418, "w": 16, "h": 16 } @@ -8445,8 +8466,8 @@ "h": 16 }, "frame": { - "x": 381, - "y": 386, + "x": 369, + "y": 402, "w": 16, "h": 16 } @@ -8457,6 +8478,6 @@ "meta": { "app": "https://www.codeandweb.com/texturepacker", "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:c228145ca625236e53edc95aac265d56:86524cdf0e3043482141d77259bc4d47:110e074689c9edd2c54833ce2e4d9270$" + "smartupdate": "$TexturePacker:SmartUpdate:9b6fc7b241128f4f61686fe287e090cd:46e9caafcc91f3c30ff85a6e8d3f5227:110e074689c9edd2c54833ce2e4d9270$" } } diff --git a/public/images/items.png b/public/images/items.png index eb9878a5bfc..896bb46c7c2 100644 Binary files a/public/images/items.png and b/public/images/items.png differ diff --git a/public/images/items/berry_juice_bad.png b/public/images/items/berry_juice_bad.png new file mode 100644 index 00000000000..344822c09ea Binary files /dev/null and b/public/images/items/berry_juice_bad.png differ diff --git a/public/images/items/berry_juice.png b/public/images/items/berry_juice_good.png similarity index 100% rename from public/images/items/berry_juice.png rename to public/images/items/berry_juice_good.png diff --git a/public/locales b/public/locales index fade123e20f..288ffa034d0 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit fade123e20ff951e199d7c0466686fe8c5511643 +Subproject commit 288ffa034d07a90ea227710703eb1331b99ffed0 diff --git a/scripts/create-test/create-test.js b/scripts/create-test/create-test.js index 3c667049658..f24aac548fc 100644 --- a/scripts/create-test/create-test.js +++ b/scripts/create-test/create-test.js @@ -1,14 +1,14 @@ -/** +/* * This script creates a test boilerplate file in the appropriate * directory based on the type selected. - * @example pnpm test:create + * Usage: `pnpm test:create` */ -import chalk from "chalk"; -import inquirer from "inquirer"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; +import chalk from "chalk"; +import inquirer from "inquirer"; //#region Constants diff --git a/scripts/create-test/test-boilerplate.ts b/scripts/create-test/test-boilerplate.ts index 1fbd3c8040a..759f3afaec0 100644 --- a/scripts/create-test/test-boilerplate.ts +++ b/scripts/create-test/test-boilerplate.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/scripts/decrypt-save.js b/scripts/decrypt-save.js index a7239a40df6..219cdb47bed 100644 --- a/scripts/decrypt-save.js +++ b/scripts/decrypt-save.js @@ -1,7 +1,8 @@ -import pkg from "crypto-js"; -const { AES, enc } = pkg; -// biome-ignore lint: This is how you import fs from node +// Usage: node decrypt-save.js [save-file] + +// biome-ignore lint/performance/noNamespaceImport: This is how you import fs from node import * as fs from "node:fs"; +import { AES, enc } from "crypto-js"; const SAVE_KEY = "x0i2O7WRiANTqPmZ"; diff --git a/src/@types/PokerogueAccountApi.ts b/src/@types/PokerogueAccountApi.ts index 68d0a5e7730..3b3e74ba41d 100644 --- a/src/@types/PokerogueAccountApi.ts +++ b/src/@types/PokerogueAccountApi.ts @@ -1,4 +1,4 @@ -import type { UserInfo } from "#app/@types/UserInfo"; +import type { UserInfo } from "#types/UserInfo"; export interface AccountInfoResponse extends UserInfo {} diff --git a/src/@types/PokerogueDailyApi.ts b/src/@types/PokerogueDailyApi.ts index 3f3d8eb61ca..838af2a2a34 100644 --- a/src/@types/PokerogueDailyApi.ts +++ b/src/@types/PokerogueDailyApi.ts @@ -1,4 +1,4 @@ -import type { ScoreboardCategory } from "#app/ui/daily-run-scoreboard"; +import type { ScoreboardCategory } from "#ui/daily-run-scoreboard"; export interface GetDailyRankingsRequest { category: ScoreboardCategory; diff --git a/src/@types/PokerogueSavedataApi.ts b/src/@types/PokerogueSavedataApi.ts index a313cd708c7..ebc80ac4ce0 100644 --- a/src/@types/PokerogueSavedataApi.ts +++ b/src/@types/PokerogueSavedataApi.ts @@ -1,4 +1,4 @@ -import type { SessionSaveData, SystemSaveData } from "#app/system/game-data"; +import type { SessionSaveData, SystemSaveData } from "#system/game-data"; export interface UpdateAllSavedataRequest { system: SystemSaveData; diff --git a/src/@types/PokerogueSystemSavedataApi.ts b/src/@types/PokerogueSystemSavedataApi.ts index 8ce160a5ec2..ded22c4c58c 100644 --- a/src/@types/PokerogueSystemSavedataApi.ts +++ b/src/@types/PokerogueSystemSavedataApi.ts @@ -1,4 +1,4 @@ -import type { SystemSaveData } from "#app/system/game-data"; +import type { SystemSaveData } from "#system/game-data"; export interface GetSystemSavedataRequest { clientSessionId: string; diff --git a/src/@types/SessionSaveMigrator.ts b/src/@types/SessionSaveMigrator.ts index c4b0ad8dda4..56518eaa8b7 100644 --- a/src/@types/SessionSaveMigrator.ts +++ b/src/@types/SessionSaveMigrator.ts @@ -1,4 +1,4 @@ -import type { SessionSaveData } from "#app/system/game-data"; +import type { SessionSaveData } from "#system/game-data"; export interface SessionSaveMigrator { version: string; diff --git a/src/@types/SystemSaveMigrator.ts b/src/@types/SystemSaveMigrator.ts index a22b5f6c93d..80fff9c7848 100644 --- a/src/@types/SystemSaveMigrator.ts +++ b/src/@types/SystemSaveMigrator.ts @@ -1,4 +1,4 @@ -import type { SystemSaveData } from "#app/system/game-data"; +import type { SystemSaveData } from "#system/game-data"; export interface SystemSaveMigrator { version: string; diff --git a/src/@types/ability-types.ts b/src/@types/ability-types.ts index 18516fadd40..8daca8a671d 100644 --- a/src/@types/ability-types.ts +++ b/src/@types/ability-types.ts @@ -1,13 +1,13 @@ -import type Move from "#app/data/moves/move"; -import type Pokemon from "#app/field/pokemon"; +import type { AbAttrConstructorMap } from "#abilities/ability"; import type { BattleStat } from "#enums/stat"; -import type { AbAttrConstructorMap } from "#app/data/abilities/ability"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; // intentionally re-export all types from abilities to have this be the centralized place to import ability types -export type * from "#app/data/abilities/ability"; +export type * from "#abilities/ability"; // biome-ignore lint/correctness/noUnusedImports: Used in a tsdoc comment -import type { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; +import type { applyAbAttrs } from "#abilities/apply-ab-attrs"; export type AbAttrCondition = (pokemon: Pokemon) => boolean; export type PokemonAttackCondition = (user: Pokemon | null, target: Pokemon | null, move: Move) => boolean; diff --git a/src/@types/attack-move-result.ts b/src/@types/attack-move-result.ts new file mode 100644 index 00000000000..495bb1e88ff --- /dev/null +++ b/src/@types/attack-move-result.ts @@ -0,0 +1,12 @@ +import type { BattlerIndex } from "#enums/battler-index"; +import type { MoveId } from "#enums/move-id"; +import type { DamageResult } from "#types/damage-result"; + +export interface AttackMoveResult { + move: MoveId; + result: DamageResult; + damage: number; + critical: boolean; + sourceId: number; + sourceBattlerIndex: BattlerIndex; +} diff --git a/src/@types/damage-result.ts b/src/@types/damage-result.ts new file mode 100644 index 00000000000..b6eb6b82770 --- /dev/null +++ b/src/@types/damage-result.ts @@ -0,0 +1,21 @@ +import type { HitResult } from "#enums/hit-result"; + +/** Union type containing all damage-dealing {@linkcode HitResult}s. */ +export type DamageResult = + | HitResult.EFFECTIVE + | HitResult.SUPER_EFFECTIVE + | HitResult.NOT_VERY_EFFECTIVE + | HitResult.ONE_HIT_KO + | HitResult.CONFUSION + | HitResult.INDIRECT_KO + | HitResult.INDIRECT; + +/** Interface containing the results of a damage calculation for a given move. */ +export interface DamageCalculationResult { + /** `true` if the move was cancelled (thus suppressing "No Effect" messages) */ + cancelled: boolean; + /** The effectiveness of the move */ + result: HitResult; + /** The damage dealt by the move */ + damage: number; +} diff --git a/src/@types/enum-types.ts b/src/@types/enum-types.ts new file mode 100644 index 00000000000..84df0a96505 --- /dev/null +++ b/src/@types/enum-types.ts @@ -0,0 +1,18 @@ +/** Union type accepting any TS Enum or `const object`, with or without reverse mapping. */ +export type EnumOrObject = Record; + +/** + * Utility type to extract the enum values from a `const object`, + * or convert an `enum` interface produced by `typeof Enum` into the union type representing its values. + */ +export type EnumValues = E[keyof E]; + +/** + * Generic type constraint representing a TS numeric enum with reverse mappings. + * @example + * TSNumericEnum + */ +export type TSNumericEnum = number extends EnumValues ? T : never; + +/** Generic type constraint representing a non reverse-mapped TS enum or `const object`. */ +export type NormalEnum = Exclude>; diff --git a/src/@types/held-modifier-config.ts b/src/@types/held-modifier-config.ts index 5617cf2446a..46ef67bf515 100644 --- a/src/@types/held-modifier-config.ts +++ b/src/@types/held-modifier-config.ts @@ -1,7 +1,7 @@ -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; -export default interface HeldModifierConfig { +export interface HeldModifierConfig { modifier: PokemonHeldItemModifierType | PokemonHeldItemModifier; stackCount?: number; isTransferable?: boolean; diff --git a/src/@types/illusion-data.ts b/src/@types/illusion-data.ts new file mode 100644 index 00000000000..854c98c8cc9 --- /dev/null +++ b/src/@types/illusion-data.ts @@ -0,0 +1,41 @@ +import type { Gender } from "#data/gender"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import type { PokeballType } from "#enums/pokeball"; +import type { SpeciesId } from "#enums/species-id"; +import type { Variant } from "#sprites/variant"; + +/** + * Data pertaining to a Pokemon's Illusion. + */ +export interface IllusionData { + basePokemon: { + /** The actual name of the Pokemon */ + name: string; + /** The actual nickname of the Pokemon */ + nickname: string; + /** Whether the base pokemon is shiny or not */ + shiny: boolean; + /** The shiny variant of the base pokemon */ + variant: Variant; + /** Whether the fusion species of the base pokemon is shiny or not */ + fusionShiny: boolean; + /** The variant of the fusion species of the base pokemon */ + fusionVariant: Variant; + }; + /** The species of the illusion */ + species: SpeciesId; + /** The formIndex of the illusion */ + formIndex: number; + /** The gender of the illusion */ + gender: Gender; + /** The pokeball of the illusion */ + pokeball: PokeballType; + /** The fusion species of the illusion if it's a fusion */ + fusionSpecies?: PokemonSpecies; + /** The fusionFormIndex of the illusion */ + fusionFormIndex?: number; + /** The fusionGender of the illusion if it's a fusion */ + fusionGender?: Gender; + /** The level of the illusion (not used currently) */ + level?: number; +} diff --git a/src/@types/modifier-types.ts b/src/@types/modifier-types.ts index 80b92c35622..28b39d1a151 100644 --- a/src/@types/modifier-types.ts +++ b/src/@types/modifier-types.ts @@ -1,14 +1,13 @@ -/** - * Re-exports of all the types defined in the modifier module. - */ +// Intentionally re-exports `ModifierConstructorMap` from `modifier.ts` + +import type { Pokemon } from "#field/pokemon"; +import type { ModifierConstructorMap } from "#modifiers/modifier"; +import type { ModifierType, WeightedModifierType } from "#modifiers/modifier-type"; -import type Pokemon from "#app/field/pokemon"; -import type { ModifierConstructorMap } from "#app/modifier/modifier"; -import type { ModifierType, WeightedModifierType } from "#app/modifier/modifier-type"; export type ModifierTypeFunc = () => ModifierType; export type WeightedModifierTypeWeightFunc = (party: Pokemon[], rerollCount?: number) => number; -export type { ModifierConstructorMap } from "#app/modifier/modifier"; +export type { ModifierConstructorMap } from "#modifiers/modifier"; /** * Map of modifier names to their respective instance types diff --git a/src/@types/move-types.ts b/src/@types/move-types.ts index d9a06fd20ee..5f8d7e8777e 100644 --- a/src/@types/move-types.ts +++ b/src/@types/move-types.ts @@ -1,16 +1,16 @@ import type { AttackMove, - StatusMove, - SelfStatusMove, ChargingAttackMove, ChargingSelfStatusMove, - MoveAttrConstructorMap, MoveAttr, -} from "#app/data/moves/move"; + MoveAttrConstructorMap, + SelfStatusMove, + StatusMove, +} from "#moves/move"; export type MoveAttrFilter = (attr: MoveAttr) => boolean; -export type * from "#app/data/moves/move"; +export type * from "#moves/move"; /** * Map of move subclass names to their respective classes. diff --git a/src/@types/trainer-funcs.ts b/src/@types/trainer-funcs.ts index 0546dd53024..aa839cbd158 100644 --- a/src/@types/trainer-funcs.ts +++ b/src/@types/trainer-funcs.ts @@ -1,9 +1,9 @@ -import type { EnemyPokemon } from "#app/field/pokemon"; -import type { PersistentModifier } from "#app/modifier/modifier"; import type { PartyMemberStrength } from "#enums/party-member-strength"; import type { SpeciesId } from "#enums/species-id"; -import type { TrainerConfig } from "../data/trainers/trainer-config"; -import type { TrainerPartyTemplate } from "../data/trainers/TrainerPartyTemplate"; +import type { EnemyPokemon } from "#field/pokemon"; +import type { PersistentModifier } from "#modifiers/modifier"; +import type { TrainerConfig } from "#trainers/trainer-config"; +import type { TrainerPartyTemplate } from "#trainers/trainer-party-template"; export type PartyTemplateFunc = () => TrainerPartyTemplate; export type PartyMemberFunc = (level: number, strength: PartyMemberStrength) => EnemyPokemon; diff --git a/src/@types/turn-move.ts b/src/@types/turn-move.ts new file mode 100644 index 00000000000..a5a69eb3749 --- /dev/null +++ b/src/@types/turn-move.ts @@ -0,0 +1,13 @@ +import type { BattlerIndex } from "#enums/battler-index"; +import type { MoveId } from "#enums/move-id"; +import type { MoveResult } from "#enums/move-result"; +import type { MoveUseMode } from "#enums/move-use-mode"; + +/** A record of a move having been used. */ +export interface TurnMove { + move: MoveId; + targets: BattlerIndex[]; + useMode: MoveUseMode; + result?: MoveResult; + turn?: number; +} diff --git a/src/@types/type-helpers.ts b/src/@types/type-helpers.ts index 2d00b1faf4a..077bef62f1f 100644 --- a/src/@types/type-helpers.ts +++ b/src/@types/type-helpers.ts @@ -2,8 +2,11 @@ * A collection of custom utility types that aid in type checking and ensuring strict type conformity */ -// biome-ignore lint/correctness/noUnusedImports: Used in a tsdoc comment -import type { AbAttr } from "./ability-types"; +// biome-ignore-start lint/correctness/noUnusedImports: Used in a tsdoc comment +import type { AbAttr } from "#abilities/ability"; +// biome-ignore-end lint/correctness/noUnusedImports: Used in a tsdoc comment + +import type { EnumValues } from "#types/enum-types"; /** * Exactly matches the type of the argument, preventing adding additional properties. @@ -11,7 +14,7 @@ import type { AbAttr } from "./ability-types"; * ⚠️ Should never be used with `extends`, as this will nullify the exactness of the type. * * As an example, used to ensure that the parameters of {@linkcode AbAttr.canApply} and {@linkcode AbAttr.getTriggerMessage} are compatible with - * the type of the apply method + * the type of its {@linkcode AbAttr.apply | apply} method. * * @typeParam T - The type to match exactly */ @@ -26,9 +29,18 @@ export type Exact = { export type Closed = X; /** - * Remove `readonly` from all properties of the provided type - * @typeParam T - The type to make mutable + * Remove `readonly` from all properties of the provided type. + * @typeParam T - The type to make mutable. */ export type Mutable = { -readonly [P in keyof T]: T[P]; }; + +/** + * Type helper to obtain the keys associated with a given value inside a `const object`. + * @typeParam O - The type of the object + * @typeParam V - The type of one of O's values + */ +export type InferKeys, V extends EnumValues> = { + [K in keyof O]: O[K] extends V ? K : never; +}[keyof O]; diff --git a/src/account.ts b/src/account.ts index 3416fa6ed5e..1bfb756b284 100644 --- a/src/account.ts +++ b/src/account.ts @@ -1,7 +1,7 @@ -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import type { UserInfo } from "#app/@types/UserInfo"; -import { bypassLogin } from "./global-vars/bypass-login"; -import { randomString } from "#app/utils/common"; +import { pokerogueApi } from "#api/pokerogue-api"; +import { bypassLogin } from "#app/global-vars/bypass-login"; +import type { UserInfo } from "#types/UserInfo"; +import { randomString } from "#utils/common"; export let loggedInUser: UserInfo | null = null; // This is a random string that is used to identify the client session - unique per session (tab or window) so that the game will only save on the one that the server is expecting diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 2ac13033412..ad0c9d84aba 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1,26 +1,84 @@ -import Phaser from "phaser"; -import UI from "#app/ui/ui"; -import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonSpeciesFilter } from "#app/data/pokemon-species"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { allSpecies } from "#app/data/data-lists"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import type { FixedBattleConfig } from "#app/battle"; +import { Battle } from "#app/battle"; import { - fixedInt, - getIvsFromId, - randSeedInt, - getEnumValues, - randomString, - NumberHolder, - shiftCharCodes, - formatMoney, - isNullOrUndefined, - BooleanHolder, - type Constructor, -} from "#app/utils/common"; -import { deepMergeSpriteData } from "#app/utils/data"; -import type { Modifier, ModifierPredicate, TurnHeldItemTransferModifier } from "./modifier/modifier"; + ANTI_VARIANCE_WEIGHT_MODIFIER, + AVERAGE_ENCOUNTERS_PER_RUN_TARGET, + BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT, + MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT, +} from "#app/constants"; +import type { GameMode } from "#app/game-mode"; +import { getGameMode } from "#app/game-mode"; +import { timedEventManager } from "#app/global-event-manager"; +import { initGlobalScene } from "#app/global-scene"; +import { starterColors } from "#app/global-vars/starter-colors"; +import { InputsController } from "#app/inputs-controller"; +import { LoadingScene } from "#app/loading-scene"; +import Overrides from "#app/overrides"; +import type { Phase } from "#app/phase"; +import { PhaseManager } from "#app/phase-manager"; +import { FieldSpritePipeline } from "#app/pipelines/field-sprite"; +import { InvertPostFX } from "#app/pipelines/invert"; +import { SpritePipeline } from "#app/pipelines/sprite"; +import { SceneBase } from "#app/scene-base"; +import { startingWave } from "#app/starting-wave"; +import { TimedEventManager } from "#app/timed-event-manager"; +import { UiInputs } from "#app/ui-inputs"; +import { biomeDepths, getBiomeName } from "#balance/biomes"; +import { pokemonPrevolutions } from "#balance/pokemon-evolutions"; +import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#balance/starters"; +import { + initCommonAnims, + initMoveAnim, + loadCommonAnimAssets, + loadMoveAnimAssets, + populateAnims, +} from "#data/battle-anims"; +import { allAbilities, allMoves, allSpecies, modifierTypes } from "#data/data-lists"; +import { battleSpecDialogue } from "#data/dialogue"; +import type { SpeciesFormChangeTrigger } from "#data/form-change-triggers"; +import { SpeciesFormChangeManualTrigger, SpeciesFormChangeTimeOfDayTrigger } from "#data/form-change-triggers"; +import { Gender } from "#data/gender"; +import type { SpeciesFormChange } from "#data/pokemon-forms"; +import { pokemonFormChanges } from "#data/pokemon-forms"; +import type { PokemonSpecies, PokemonSpeciesFilter } from "#data/pokemon-species"; +import { getTypeRgb } from "#data/type"; +import { BattleSpec } from "#enums/battle-spec"; +import { BattleStyle } from "#enums/battle-style"; +import { BattleType } from "#enums/battle-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BiomeId } from "#enums/biome-id"; +import { EaseType } from "#enums/ease-type"; +import { ExpGainsSpeed } from "#enums/exp-gains-speed"; +import type { ExpNotification } from "#enums/exp-notification"; +import { FormChangeItem } from "#enums/form-change-item"; +import { GameModes } from "#enums/game-modes"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { MoneyFormat } from "#enums/money-format"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PlayerGender } from "#enums/player-gender"; +import { PokeballType } from "#enums/pokeball"; +import type { PokemonAnimType } from "#enums/pokemon-anim-type"; +import { PokemonType } from "#enums/pokemon-type"; +import { ShopCursorTarget } from "#enums/shop-cursor-target"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import type { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { TrainerVariant } from "#enums/trainer-variant"; +import { UiTheme } from "#enums/ui-theme"; +import { NewArenaEvent } from "#events/battle-scene"; +import { Arena, ArenaBase } from "#field/arena"; +import { DamageNumberHandler } from "#field/damage-number-handler"; +import type { Pokemon } from "#field/pokemon"; +import { EnemyPokemon, PlayerPokemon } from "#field/pokemon"; +import { PokemonSpriteSparkleHandler } from "#field/pokemon-sprite-sparkle-handler"; +import { Trainer } from "#field/trainer"; +import type { Modifier, ModifierPredicate, TurnHeldItemTransferModifier } from "#modifiers/modifier"; import { ConsumableModifier, ConsumablePokemonModifier, @@ -38,22 +96,7 @@ import { PokemonHpRestoreModifier, PokemonIncrementingStatModifier, RememberMoveModifier, -} from "./modifier/modifier"; -import { PokeballType } from "#enums/pokeball"; -import { - initCommonAnims, - initMoveAnim, - loadCommonAnimAssets, - loadMoveAnimAssets, - populateAnims, -} from "#app/data/battle-anims"; -import type { Phase } from "#app/phase"; -import { initGameSpeed } from "#app/system/game-speed"; -import { Arena, ArenaBase } from "#app/field/arena"; -import { GameData } from "#app/system/game-data"; -import { addTextObject, getTextColor, TextStyle } from "#app/ui/text"; -import { allMoves } from "./data/data-lists"; -import { MusicPreference } from "#app/system/settings/settings"; +} from "#modifiers/modifier"; import { getDefaultModifierTypeForTier, getEnemyModifierTypesForWave, @@ -61,113 +104,61 @@ import { getLuckTextTint, getPartyLuckValue, PokemonHeldItemModifierType, -} from "#app/modifier/modifier-type"; -import { getModifierType } from "./utils/modifier-utils"; -import { modifierTypes } from "./data/data-lists"; -import { getModifierPoolForType } from "./utils/modifier-utils"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import AbilityBar from "#app/ui/ability-bar"; -import { applyAbAttrs } from "./data/abilities/apply-ab-attrs"; -import { allAbilities } from "./data/data-lists"; -import type { FixedBattleConfig } from "#app/battle"; -import Battle from "#app/battle"; -import { BattleType } from "#enums/battle-type"; -import type { GameMode } from "#app/game-mode"; -import { getGameMode } from "#app/game-mode"; -import { GameModes } from "#enums/game-modes"; -import FieldSpritePipeline from "#app/pipelines/field-sprite"; -import SpritePipeline from "#app/pipelines/sprite"; -import PartyExpBar from "#app/ui/party-exp-bar"; -import type { TrainerSlot } from "./enums/trainer-slot"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import Trainer from "#app/field/trainer"; -import { TrainerVariant } from "#enums/trainer-variant"; -import type TrainerData from "#app/system/trainer-data"; -import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import PokeballTray from "#app/ui/pokeball-tray"; -import InvertPostFX from "#app/pipelines/invert"; -import type { Achv } from "#app/system/achv"; -import { achvs, ModifierAchv, MoneyAchv } from "#app/system/achv"; -import type { Voucher } from "#app/system/voucher"; -import { vouchers } from "#app/system/voucher"; -import { Gender } from "#app/data/gender"; -import type UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; -import { addUiThemeOverrides } from "#app/ui/ui-theme"; -import type PokemonData from "#app/system/pokemon-data"; -import { Nature } from "#enums/nature"; -import type { SpeciesFormChange } from "#app/data/pokemon-forms"; -import type { SpeciesFormChangeTrigger } from "./data/pokemon-forms/form-change-triggers"; -import { pokemonFormChanges } from "#app/data/pokemon-forms"; -import { SpeciesFormChangeTimeOfDayTrigger } from "./data/pokemon-forms/form-change-triggers"; -import { SpeciesFormChangeManualTrigger } from "./data/pokemon-forms/form-change-triggers"; -import { FormChangeItem } from "#enums/form-change-item"; -import { getTypeRgb } from "#app/data/type"; -import { PokemonType } from "#enums/pokemon-type"; -import PokemonSpriteSparkleHandler from "#app/field/pokemon-sprite-sparkle-handler"; -import CharSprite from "#app/ui/char-sprite"; -import DamageNumberHandler from "#app/field/damage-number-handler"; -import PokemonInfoContainer from "#app/ui/pokemon-info-container"; -import { biomeDepths, getBiomeName } from "#app/data/balance/biomes"; -import { SceneBase } from "#app/scene-base"; -import CandyBar from "#app/ui/candy-bar"; -import type { Variant } from "#app/sprites/variant"; -import { variantData, clearVariantData } from "#app/sprites/variant"; -import type { Localizable } from "#app/@types/locales"; -import Overrides from "#app/overrides"; -import { InputsController } from "#app/inputs-controller"; -import { UiInputs } from "#app/ui-inputs"; -import { NewArenaEvent } from "#app/events/battle-scene"; -import { ArenaFlyout } from "#app/ui/arena-flyout"; -import { EaseType } from "#enums/ease-type"; -import { BattleSpec } from "#enums/battle-spec"; -import { BattleStyle } from "#enums/battle-style"; -import { BiomeId } from "#enums/biome-id"; -import type { ExpNotification } from "#enums/exp-notification"; -import { MoneyFormat } from "#enums/money-format"; -import { MoveId } from "#enums/move-id"; -import { PlayerGender } from "#enums/player-gender"; -import { SpeciesId } from "#enums/species-id"; -import { UiTheme } from "#enums/ui-theme"; -import { TimedEventManager } from "#app/timed-event-manager"; -import type { PokemonAnimType } from "#enums/pokemon-anim-type"; -import i18next from "i18next"; -import { TrainerType } from "#enums/trainer-type"; -import { battleSpecDialogue } from "#app/data/dialogue"; -import { LoadingScene } from "#app/loading-scene"; -import type { MovePhase } from "#app/phases/move-phase"; -import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { allMysteryEncounters, mysteryEncountersByBiome } from "#app/data/mystery-encounters/mystery-encounters"; +} from "#modifiers/modifier-type"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterSaveData } from "#mystery-encounters/mystery-encounter-save-data"; +import { allMysteryEncounters, mysteryEncountersByBiome } from "#mystery-encounters/mystery-encounters"; +import type { MovePhase } from "#phases/move-phase"; +import { expSpriteKeys } from "#sprites/sprite-keys"; +import { hasExpSprite } from "#sprites/sprite-utils"; +import type { Variant } from "#sprites/variant"; +import { clearVariantData, variantData } from "#sprites/variant"; +import type { Achv } from "#system/achv"; +import { achvs, ModifierAchv, MoneyAchv } from "#system/achv"; +import { GameData } from "#system/game-data"; +import { initGameSpeed } from "#system/game-speed"; +import type { PokemonData } from "#system/pokemon-data"; +import { MusicPreference } from "#system/settings"; +import type { TrainerData } from "#system/trainer-data"; +import type { Voucher } from "#system/voucher"; +import { vouchers } from "#system/voucher"; +import { trainerConfigs } from "#trainers/trainer-config"; +import type { HeldModifierConfig } from "#types/held-modifier-config"; +import type { Localizable } from "#types/locales"; +import { AbilityBar } from "#ui/ability-bar"; +import { ArenaFlyout } from "#ui/arena-flyout"; +import { CandyBar } from "#ui/candy-bar"; +import { CharSprite } from "#ui/char-sprite"; +import { PartyExpBar } from "#ui/party-exp-bar"; +import { PokeballTray } from "#ui/pokeball-tray"; +import { PokemonInfoContainer } from "#ui/pokemon-info-container"; +import { addTextObject, getTextColor, TextStyle } from "#ui/text"; +import { UI } from "#ui/ui"; +import { addUiThemeOverrides } from "#ui/ui-theme"; import { - ANTI_VARIANCE_WEIGHT_MODIFIER, - AVERAGE_ENCOUNTERS_PER_RUN_TARGET, - BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT, - MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT, -} from "./constants"; -import { MysteryEncounterSaveData } from "#app/data/mystery-encounters/mystery-encounter-save-data"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import type HeldModifierConfig from "#app/@types/held-modifier-config"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import { ExpGainsSpeed } from "#enums/exp-gains-speed"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters"; -import { StatusEffect } from "#enums/status-effect"; -import { initGlobalScene } from "#app/global-scene"; -import { expSpriteKeys } from "./sprites/sprite-keys"; -import { hasExpSprite } from "./sprites/sprite-utils"; -import { timedEventManager } from "./global-event-manager"; -import { starterColors } from "./global-vars/starter-colors"; -import { startingWave } from "./starting-wave"; -import { PhaseManager } from "./phase-manager"; + BooleanHolder, + type Constructor, + fixedInt, + formatMoney, + getIvsFromId, + isBetween, + isNullOrUndefined, + NumberHolder, + randomString, + randSeedInt, + shiftCharCodes, +} from "#utils/common"; +import { deepMergeSpriteData } from "#utils/data"; +import { getEnumValues } from "#utils/enums"; +import { getModifierPoolForType, getModifierType } from "#utils/modifier-utils"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; +import Phaser from "phaser"; +import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; +import type UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; const DEBUG_RNG = false; -const OPP_IVS_OVERRIDE_VALIDATED: number[] = ( - Array.isArray(Overrides.OPP_IVS_OVERRIDE) ? Overrides.OPP_IVS_OVERRIDE : new Array(6).fill(Overrides.OPP_IVS_OVERRIDE) -).map(iv => (Number.isNaN(iv) || iv === null || iv > 31 ? -1 : iv)); - export interface PokeballCounts { [pb: string]: number; } @@ -179,7 +170,7 @@ export interface InfoToggle { isActive(): boolean; } -export default class BattleScene extends SceneBase { +export class BattleScene extends SceneBase { public rexUI: UIPlugin; public inputController: InputsController; public uiInputs: UiInputs; @@ -800,12 +791,14 @@ export default class BattleScene extends SceneBase { // TODO: Add `undefined` to return type /** * Returns an array of PlayerPokemon of length 1 or 2 depending on if in a double battle or not. - * Does not actually check if the pokemon are on the field or not. + * @param active - (Default `false`) Whether to consider only {@linkcode Pokemon.isActive | active} on-field pokemon * @returns array of {@linkcode PlayerPokemon} */ - public getPlayerField(): PlayerPokemon[] { + public getPlayerField(active = false): PlayerPokemon[] { const party = this.getPlayerParty(); - return party.slice(0, Math.min(party.length, this.currentBattle?.double ? 2 : 1)); + return party + .slice(0, Math.min(party.length, this.currentBattle?.double ? 2 : 1)) + .filter(p => !active || p.isActive()); } public getEnemyParty(): EnemyPokemon[] { @@ -885,8 +878,8 @@ export default class BattleScene extends SceneBase { } // store info toggles to be accessible by the ui - addInfoToggle(infoToggle: InfoToggle): void { - this.infoToggles.push(infoToggle); + addInfoToggle(...infoToggles: InfoToggle[]): void { + this.infoToggles.push(...infoToggles); } // return the stored info toggles; used by ui-inputs @@ -934,9 +927,32 @@ export default class BattleScene extends SceneBase { nature, dataSource, ); + if (postProcess) { postProcess(pokemon); } + + if (Overrides.IVS_OVERRIDE === null) { + // do nothing + } else if (Array.isArray(Overrides.IVS_OVERRIDE)) { + if (Overrides.IVS_OVERRIDE.length !== 6) { + throw new Error("The Player IVs override must be an array of length 6 or a number!"); + } + if (Overrides.IVS_OVERRIDE.some(value => !isBetween(value, 0, 31))) { + throw new Error("All IVs in the player IV override must be between 0 and 31!"); + } + pokemon.ivs = Overrides.IVS_OVERRIDE; + } else { + if (!isBetween(Overrides.IVS_OVERRIDE, 0, 31)) { + throw new Error("The Player IV override must be a value between 0 and 31!"); + } + pokemon.ivs = new Array(6).fill(Overrides.IVS_OVERRIDE); + } + + if (Overrides.NATURE_OVERRIDE !== null) { + pokemon.nature = Overrides.NATURE_OVERRIDE; + } + pokemon.init(); return pokemon; } @@ -981,10 +997,25 @@ export default class BattleScene extends SceneBase { postProcess(pokemon); } - for (let i = 0; i < pokemon.ivs.length; i++) { - if (OPP_IVS_OVERRIDE_VALIDATED[i] > -1) { - pokemon.ivs[i] = OPP_IVS_OVERRIDE_VALIDATED[i]; + if (Overrides.ENEMY_IVS_OVERRIDE === null) { + // do nothing + } else if (Array.isArray(Overrides.ENEMY_IVS_OVERRIDE)) { + if (Overrides.ENEMY_IVS_OVERRIDE.length !== 6) { + throw new Error("The Enemy IVs override must be an array of length 6 or a number!"); } + if (Overrides.ENEMY_IVS_OVERRIDE.some(value => !isBetween(value, 0, 31))) { + throw new Error("All IVs in the enemy IV override must be between 0 and 31!"); + } + pokemon.ivs = Overrides.ENEMY_IVS_OVERRIDE; + } else { + if (!isBetween(Overrides.ENEMY_IVS_OVERRIDE, 0, 31)) { + throw new Error("The Enemy IV override must be a value between 0 and 31!"); + } + pokemon.ivs = new Array(6).fill(Overrides.ENEMY_IVS_OVERRIDE); + } + + if (Overrides.ENEMY_NATURE_OVERRIDE !== null) { + pokemon.nature = Overrides.ENEMY_NATURE_OVERRIDE; } pokemon.init(); @@ -2147,6 +2178,7 @@ export default class BattleScene extends SceneBase { ), ] : allSpecies.filter(s => s.isCatchable()); + // TODO: should this use `randSeedItem`? return filteredSpecies[randSeedInt(filteredSpecies.length)]; } @@ -2172,6 +2204,7 @@ export default class BattleScene extends SceneBase { } } + // TODO: should this use `randSeedItem`? return biomes[randSeedInt(biomes.length)]; } @@ -2488,6 +2521,10 @@ export default class BattleScene extends SceneBase { return 10.344; case "battle_legendary_zac_zam": //SWSH Zacian & Zamazenta Battle return 11.424; + case "battle_legendary_eternatus_p1": //SWSH Eternatus Battle + return 11.102; + case "battle_legendary_eternatus_p2": //SWSH Eternamax Eternatus Battle + return 0.0; case "battle_legendary_glas_spec": //SWSH Glastrier & Spectrier Battle return 12.503; case "battle_legendary_calyrex": //SWSH Calyrex Battle @@ -3691,6 +3728,7 @@ export default class BattleScene extends SceneBase { console.log("No Mystery Encounters found, falling back to Mysterious Challengers."); return allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHALLENGERS]; } + // TODO: should this use `randSeedItem`? encounter = availableEncounters[randSeedInt(availableEncounters.length)]; // New encounter object to not dirty flags encounter = new MysteryEncounter(encounter); diff --git a/src/battle.ts b/src/battle.ts index 45373402e12..7b6a58cbaca 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -1,40 +1,37 @@ +import type { GameMode } from "#app/game-mode"; import { globalScene } from "#app/global-scene"; -import type { Command } from "#enums/command"; -import { - randomString, - getEnumValues, - NumberHolder, - randSeedInt, - shiftCharCodes, - randSeedItem, - randInt, - randSeedFloat, -} from "#app/utils/common"; -import Trainer from "./field/trainer"; -import { TrainerVariant } from "#enums/trainer-variant"; -import type { GameMode } from "./game-mode"; -import { MoneyMultiplierModifier, type PokemonHeldItemModifier } from "./modifier/modifier"; -import type { PokeballType } from "#enums/pokeball"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { SpeciesFormKey } from "#enums/species-form-key"; -import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; +import type { Command } from "#enums/command"; import type { MoveId } from "#enums/move-id"; -import { PlayerGender } from "#enums/player-gender"; -import { MusicPreference } from "#app/system/settings/settings"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import type { PokeballType } from "#enums/pokeball"; +import { SpeciesFormKey } from "#enums/species-form-key"; import { SpeciesId } from "#enums/species-id"; import { TrainerType } from "#enums/trainer-type"; -import i18next from "#app/plugins/i18n"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import type { CustomModifierSettings } from "#app/modifier/modifier-type"; -import { ModifierTier } from "#enums/modifier-tier"; -import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { BattleType } from "#enums/battle-type"; -import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; -import { BattlerIndex } from "#enums/battler-index"; +import { TrainerVariant } from "#enums/trainer-variant"; +import type { EnemyPokemon, PlayerPokemon, Pokemon } from "#field/pokemon"; +import { Trainer } from "#field/trainer"; +import { MoneyMultiplierModifier, type PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { CustomModifierSettings } from "#modifiers/modifier-type"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import i18next from "#plugins/i18n"; +import { MusicPreference } from "#system/settings"; +import { trainerConfigs } from "#trainers/trainer-config"; +import type { TurnMove } from "#types/turn-move"; +import { + NumberHolder, + randInt, + randomString, + randSeedFloat, + randSeedInt, + randSeedItem, + shiftCharCodes, +} from "#utils/common"; +import { getEnumValues } from "#utils/enums"; export interface TurnCommand { command: Command; @@ -54,7 +51,7 @@ interface TurnCommands { [key: number]: TurnCommand | null; } -export default class Battle { +export class Battle { protected gameMode: GameMode; public waveIndex: number; public battleType: BattleType; @@ -94,6 +91,12 @@ export default class Battle { /** If the current battle is a Mystery Encounter, this will always be defined */ public mysteryEncounter?: MysteryEncounter; + /** + * Tracker for whether the last run attempt failed. + * @defaultValue `false` + */ + public failedRunAway = false; + private rngCounter = 0; constructor(gameMode: GameMode, waveIndex: number, battleType: BattleType, trainer?: Trainer, double = false) { @@ -375,6 +378,11 @@ export default class Battle { case SpeciesId.ZACIAN: case SpeciesId.ZAMAZENTA: return "battle_legendary_zac_zam"; + case SpeciesId.ETERNATUS: + if (pokemon.getFormKey() === "eternamax") { + return "battle_legendary_eternatus_p2"; + } + return "battle_legendary_eternatus_p1"; case SpeciesId.GLASTRIER: case SpeciesId.SPECTRIER: return "battle_legendary_glas_spec"; @@ -566,369 +574,3 @@ export function getRandomTrainerFunc( return new Trainer(trainerTypes[rand], trainerGender); }; } - -export interface FixedBattleConfigs { - [key: number]: FixedBattleConfig; -} -/** - * Youngster/Lass on 5 - * Rival on 8, 55, 95, 145, 195 - * Evil team grunts on 35, 62, 64, and 112 - * Evil team admin on 66 and 114 - * Evil leader on 115, 165 - * E4 on 182, 184, 186, 188 - * Champion on 190 - */ -export const classicFixedBattles: FixedBattleConfigs = { - [ClassicFixedBossWaves.TOWN_YOUNGSTER]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => new Trainer(TrainerType.YOUNGSTER, randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT), - ), - [ClassicFixedBossWaves.RIVAL_1]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => - new Trainer( - TrainerType.RIVAL, - globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, - ), - ), - [ClassicFixedBossWaves.RIVAL_2]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => - new Trainer( - TrainerType.RIVAL_2, - globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, - ), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], - allowLuckUpgrades: false, - }), - [ClassicFixedBossWaves.EVIL_GRUNT_1]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - getRandomTrainerFunc( - [ - TrainerType.ROCKET_GRUNT, - TrainerType.MAGMA_GRUNT, - TrainerType.AQUA_GRUNT, - TrainerType.GALACTIC_GRUNT, - TrainerType.PLASMA_GRUNT, - TrainerType.FLARE_GRUNT, - TrainerType.AETHER_GRUNT, - TrainerType.SKULL_GRUNT, - TrainerType.MACRO_GRUNT, - TrainerType.STAR_GRUNT, - ], - true, - ), - ), - [ClassicFixedBossWaves.RIVAL_3]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => - new Trainer( - TrainerType.RIVAL_3, - globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, - ), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], - allowLuckUpgrades: false, - }), - [ClassicFixedBossWaves.EVIL_GRUNT_2]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc( - [ - TrainerType.ROCKET_GRUNT, - TrainerType.MAGMA_GRUNT, - TrainerType.AQUA_GRUNT, - TrainerType.GALACTIC_GRUNT, - TrainerType.PLASMA_GRUNT, - TrainerType.FLARE_GRUNT, - TrainerType.AETHER_GRUNT, - TrainerType.SKULL_GRUNT, - TrainerType.MACRO_GRUNT, - TrainerType.STAR_GRUNT, - ], - true, - ), - ), - [ClassicFixedBossWaves.EVIL_GRUNT_3]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc( - [ - TrainerType.ROCKET_GRUNT, - TrainerType.MAGMA_GRUNT, - TrainerType.AQUA_GRUNT, - TrainerType.GALACTIC_GRUNT, - TrainerType.PLASMA_GRUNT, - TrainerType.FLARE_GRUNT, - TrainerType.AETHER_GRUNT, - TrainerType.SKULL_GRUNT, - TrainerType.MACRO_GRUNT, - TrainerType.STAR_GRUNT, - ], - true, - ), - ), - [ClassicFixedBossWaves.EVIL_ADMIN_1]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc( - [ - [TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL], - [TrainerType.TABITHA, TrainerType.COURTNEY], - [TrainerType.MATT, TrainerType.SHELLY], - [TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN], - [TrainerType.ZINZOLIN, TrainerType.COLRESS], - [TrainerType.XEROSIC, TrainerType.BRYONY], - TrainerType.FABA, - TrainerType.PLUMERIA, - TrainerType.OLEANA, - [TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI], - ], - true, - ), - ), - [ClassicFixedBossWaves.RIVAL_4]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => - new Trainer( - TrainerType.RIVAL_4, - globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, - ), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], - allowLuckUpgrades: false, - }), - [ClassicFixedBossWaves.EVIL_GRUNT_4]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc( - [ - TrainerType.ROCKET_GRUNT, - TrainerType.MAGMA_GRUNT, - TrainerType.AQUA_GRUNT, - TrainerType.GALACTIC_GRUNT, - TrainerType.PLASMA_GRUNT, - TrainerType.FLARE_GRUNT, - TrainerType.AETHER_GRUNT, - TrainerType.SKULL_GRUNT, - TrainerType.MACRO_GRUNT, - TrainerType.STAR_GRUNT, - ], - true, - ), - ), - [ClassicFixedBossWaves.EVIL_ADMIN_2]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc( - [ - [TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL], - [TrainerType.TABITHA, TrainerType.COURTNEY], - [TrainerType.MATT, TrainerType.SHELLY], - [TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN], - [TrainerType.ZINZOLIN, TrainerType.COLRESS], - [TrainerType.XEROSIC, TrainerType.BRYONY], - TrainerType.FABA, - TrainerType.PLUMERIA, - TrainerType.OLEANA, - [TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI], - ], - true, - 1, - ), - ), - [ClassicFixedBossWaves.EVIL_BOSS_1]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.ROCKET_BOSS_GIOVANNI_1, - TrainerType.MAXIE, - TrainerType.ARCHIE, - TrainerType.CYRUS, - TrainerType.GHETSIS, - TrainerType.LYSANDRE, - TrainerType.LUSAMINE, - TrainerType.GUZMA, - TrainerType.ROSE, - TrainerType.PENNY, - ]), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ - ModifierTier.ROGUE, - ModifierTier.ROGUE, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ], - allowLuckUpgrades: false, - }), - [ClassicFixedBossWaves.RIVAL_5]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => - new Trainer( - TrainerType.RIVAL_5, - globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, - ), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ - ModifierTier.ROGUE, - ModifierTier.ROGUE, - ModifierTier.ROGUE, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ], - allowLuckUpgrades: false, - }), - [ClassicFixedBossWaves.EVIL_BOSS_2]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.ROCKET_BOSS_GIOVANNI_2, - TrainerType.MAXIE_2, - TrainerType.ARCHIE_2, - TrainerType.CYRUS_2, - TrainerType.GHETSIS_2, - TrainerType.LYSANDRE_2, - TrainerType.LUSAMINE_2, - TrainerType.GUZMA_2, - TrainerType.ROSE_2, - TrainerType.PENNY_2, - ]), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ - ModifierTier.ROGUE, - ModifierTier.ROGUE, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ], - allowLuckUpgrades: false, - }), - [ClassicFixedBossWaves.ELITE_FOUR_1]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.LORELEI, - TrainerType.WILL, - TrainerType.SIDNEY, - TrainerType.AARON, - TrainerType.SHAUNTAL, - TrainerType.MALVA, - [TrainerType.HALA, TrainerType.MOLAYNE], - TrainerType.MARNIE_ELITE, - TrainerType.RIKA, - TrainerType.CRISPIN, - ]), - ), - [ClassicFixedBossWaves.ELITE_FOUR_2]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.BRUNO, - TrainerType.KOGA, - TrainerType.PHOEBE, - TrainerType.BERTHA, - TrainerType.MARSHAL, - TrainerType.SIEBOLD, - TrainerType.OLIVIA, - TrainerType.NESSA_ELITE, - TrainerType.POPPY, - TrainerType.AMARYS, - ]), - ), - [ClassicFixedBossWaves.ELITE_FOUR_3]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.AGATHA, - TrainerType.BRUNO, - TrainerType.GLACIA, - TrainerType.FLINT, - TrainerType.GRIMSLEY, - TrainerType.WIKSTROM, - TrainerType.ACEROLA, - [TrainerType.BEA_ELITE, TrainerType.ALLISTER_ELITE], - TrainerType.LARRY_ELITE, - TrainerType.LACEY, - ]), - ), - [ClassicFixedBossWaves.ELITE_FOUR_4]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.LANCE, - TrainerType.KAREN, - TrainerType.DRAKE, - TrainerType.LUCIAN, - TrainerType.CAITLIN, - TrainerType.DRASNA, - TrainerType.KAHILI, - TrainerType.RAIHAN_ELITE, - TrainerType.HASSEL, - TrainerType.DRAYTON, - ]), - ), - [ClassicFixedBossWaves.CHAMPION]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) - .setGetTrainerFunc( - getRandomTrainerFunc([ - TrainerType.BLUE, - [TrainerType.RED, TrainerType.LANCE_CHAMPION], - [TrainerType.STEVEN, TrainerType.WALLACE], - TrainerType.CYNTHIA, - [TrainerType.ALDER, TrainerType.IRIS], - TrainerType.DIANTHA, - [TrainerType.KUKUI, TrainerType.HAU], - [TrainerType.LEON, TrainerType.MUSTARD], - [TrainerType.GEETA, TrainerType.NEMONA], - TrainerType.KIERAN, - ]), - ), - [ClassicFixedBossWaves.RIVAL_6]: new FixedBattleConfig() - .setBattleType(BattleType.TRAINER) - .setGetTrainerFunc( - () => - new Trainer( - TrainerType.RIVAL_6, - globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, - ), - ) - .setCustomModifierRewards({ - guaranteedModifierTiers: [ - ModifierTier.ROGUE, - ModifierTier.ROGUE, - ModifierTier.ULTRA, - ModifierTier.ULTRA, - ModifierTier.GREAT, - ModifierTier.GREAT, - ], - allowLuckUpgrades: false, - }), -}; diff --git a/src/configs/inputs/cfg_keyboard_qwerty.ts b/src/configs/inputs/cfg_keyboard_qwerty.ts index 4f0353971e0..bca4f828d34 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -1,5 +1,5 @@ import { Button } from "#enums/buttons"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; +import { SettingKeyboard } from "#system/settings-keyboard"; const cfg_keyboard_qwerty = { padID: "default", diff --git a/src/configs/inputs/pad_dualshock.ts b/src/configs/inputs/pad_dualshock.ts index 51af1b2defd..100baa5efad 100644 --- a/src/configs/inputs/pad_dualshock.ts +++ b/src/configs/inputs/pad_dualshock.ts @@ -1,5 +1,5 @@ -import { SettingGamepad } from "../../system/settings/settings-gamepad"; import { Button } from "#enums/buttons"; +import { SettingGamepad } from "#system/settings-gamepad"; /** * Dualshock mapping diff --git a/src/configs/inputs/pad_generic.ts b/src/configs/inputs/pad_generic.ts index e47b7ce1ace..fc70f55fc7a 100644 --- a/src/configs/inputs/pad_generic.ts +++ b/src/configs/inputs/pad_generic.ts @@ -1,5 +1,5 @@ -import { SettingGamepad } from "../../system/settings/settings-gamepad"; import { Button } from "#enums/buttons"; +import { SettingGamepad } from "#system/settings-gamepad"; /** * Generic pad mapping diff --git a/src/configs/inputs/pad_procon.ts b/src/configs/inputs/pad_procon.ts index 61558c7365e..5667db01a85 100644 --- a/src/configs/inputs/pad_procon.ts +++ b/src/configs/inputs/pad_procon.ts @@ -1,5 +1,5 @@ -import { SettingGamepad } from "#app/system/settings/settings-gamepad"; import { Button } from "#enums/buttons"; +import { SettingGamepad } from "#system/settings-gamepad"; /** * Nintendo Pro Controller mapping diff --git a/src/configs/inputs/pad_unlicensedSNES.ts b/src/configs/inputs/pad_unlicensedSNES.ts index d0c4f41c8f5..7d5dc055507 100644 --- a/src/configs/inputs/pad_unlicensedSNES.ts +++ b/src/configs/inputs/pad_unlicensedSNES.ts @@ -1,5 +1,5 @@ -import { SettingGamepad } from "../../system/settings/settings-gamepad"; import { Button } from "#enums/buttons"; +import { SettingGamepad } from "#system/settings-gamepad"; /** * 081f-e401 - UnlicensedSNES diff --git a/src/configs/inputs/pad_xbox360.ts b/src/configs/inputs/pad_xbox360.ts index 60cbd9ab181..7c719e77446 100644 --- a/src/configs/inputs/pad_xbox360.ts +++ b/src/configs/inputs/pad_xbox360.ts @@ -1,5 +1,5 @@ -import { SettingGamepad } from "../../system/settings/settings-gamepad"; import { Button } from "#enums/buttons"; +import { SettingGamepad } from "#system/settings-gamepad"; /** * Generic pad mapping diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 5e7e1c2992a..ff459f24193 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -1,92 +1,80 @@ -import { MoveResult } from "#enums/move-result"; -import { HitResult } from "#enums/hit-result"; -import { - BooleanHolder, - NumberHolder, - toDmgValue, - isNullOrUndefined, - randSeedItem, - randSeedInt, - randSeedFloat, - coerceArray, -} from "#app/utils/common"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { GroundedTag } from "#app/data/battler-tags"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { - getNonVolatileStatusEffects, - getStatusEffectDescriptor, - getStatusEffectHealText, -} from "#app/data/status-effect"; -import { Gender } from "#app/data/gender"; -import { applyMoveAttrs } from "../moves/apply-attrs"; -import { allMoves } from "../data-lists"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { TerrainType } from "#app/data/terrain"; -import { pokemonFormChanges } from "../pokemon-forms"; -import { - SpeciesFormChangeWeatherTrigger, - SpeciesFormChangeAbilityTrigger, -} from "../pokemon-forms/form-change-triggers"; -import i18next from "i18next"; -import { Command } from "#enums/command"; -import { BerryModifierType } from "#app/modifier/modifier-type"; -import { getPokeballName } from "#app/data/pokeball"; -import { BattleType } from "#enums/battle-type"; -import { globalScene } from "#app/global-scene"; -import { allAbilities } from "#app/data/data-lists"; +/* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */ +import type { BattleScene } from "#app/battle-scene"; +import type { SpeciesFormChangeRevertWeatherFormTrigger } from "#data/form-change-triggers"; +/* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */ -// Enum imports -import { Stat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey } from "#enums/stat"; -import { PokemonType } from "#enums/pokemon-type"; -import { PokemonAnimType } from "#enums/pokemon-anim-type"; -import { StatusEffect } from "#enums/status-effect"; -import { WeatherType } from "#enums/weather-type"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import type { ArenaTrapTag, SuppressAbilitiesTag } from "#data/arena-tag"; +import type { BattlerTag } from "#data/battler-tags"; +import { GroundedTag } from "#data/battler-tags"; +import { getBerryEffectFunc } from "#data/berry"; +import { allAbilities, allMoves } from "#data/data-lists"; +import { SpeciesFormChangeAbilityTrigger, SpeciesFormChangeWeatherTrigger } from "#data/form-change-triggers"; +import { Gender } from "#data/gender"; +import { getPokeballName } from "#data/pokeball"; +import { pokemonFormChanges } from "#data/pokemon-forms"; +import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#data/status-effect"; +import { TerrainType } from "#data/terrain"; +import type { Weather } from "#data/weather"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { SwitchType } from "#enums/switch-type"; +import type { BerryType } from "#enums/berry-type"; +import { Command } from "#enums/command"; +import { HitResult } from "#enums/hit-result"; +import { MoveCategory } from "#enums/MoveCategory"; import { MoveFlags } from "#enums/MoveFlags"; import { MoveTarget } from "#enums/MoveTarget"; -import { MoveCategory } from "#enums/MoveCategory"; import { CommonAnim } from "#enums/move-anims-common"; -import { getBerryEffectFunc } from "#app/data/berry"; -import { BerryUsedEvent } from "#app/events/battle-scene"; -import { noAbilityTypeOverrideMoves } from "#app/data/moves/invalid-moves"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { MoveUseMode } from "#enums/move-use-mode"; - -// Type imports -import type { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; +import { PokemonAnimType } from "#enums/pokemon-anim-type"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; import type { BattleStat, EffectiveStat } from "#enums/stat"; -import type { BerryType } from "#enums/berry-type"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "../moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import type { Weather } from "#app/data/weather"; -import type { BattlerTag } from "#app/data/battler-tags"; +import { BATTLE_STATS, EFFECTIVE_STATS, getStatKey, Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { SwitchType } from "#enums/switch-type"; +import { WeatherType } from "#enums/weather-type"; +import { BerryUsedEvent } from "#events/battle-scene"; +import type { EnemyPokemon, Pokemon } from "#field/pokemon"; +import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "#modifiers/modifier"; +import { BerryModifierType } from "#modifiers/modifier-type"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import { noAbilityTypeOverrideMoves } from "#moves/invalid-moves"; +import type { Move } from "#moves/move"; +import type { PokemonMove } from "#moves/pokemon-move"; +import type { StatStageChangePhase } from "#phases/stat-stage-change-phase"; import type { AbAttrCondition, + AbAttrMap, + AbAttrString, + PokemonAttackCondition, PokemonDefendCondition, PokemonStatStageChangeCondition, - PokemonAttackCondition, - AbAttrString, - AbAttrMap, -} from "#app/@types/ability-types"; -import type { BattlerIndex } from "#enums/battler-index"; -import type Move from "#app/data/moves/move"; -import type { ArenaTrapTag, SuppressAbilitiesTag } from "#app/data/arena-tag"; -import type { Constructor } from "#app/utils/common"; -import type { Localizable } from "#app/@types/locales"; -import { applyAbAttrs } from "./apply-ab-attrs"; -import type { Closed, Exact } from "#app/@types/type-helpers"; +} from "#types/ability-types"; +import type { Localizable } from "#types/locales"; +import type { Closed, Exact } from "#types/type-helpers"; +import type { Constructor } from "#utils/common"; +import { + BooleanHolder, + coerceArray, + isNullOrUndefined, + NumberHolder, + randSeedFloat, + randSeedInt, + randSeedItem, + toDmgValue, +} from "#utils/common"; +import i18next from "i18next"; -// biome-ignore-start lint/correctness/noUnusedImports: Used in TSDoc -import type BattleScene from "#app/battle-scene"; -import type { SpeciesFormChangeRevertWeatherFormTrigger } from "../pokemon-forms/form-change-triggers"; -// biome-ignore-end lint/correctness/noUnusedImports: Used in TSDoc export class Ability implements Localizable { public id: AbilityId; @@ -1194,7 +1182,16 @@ export class PostDefendContactApplyTagChanceAbAttr extends PostDefendAbAttr { } } -export class PostDefendCritStatStageChangeAbAttr extends PostDefendAbAttr { +/** + * Set stat stages when the user gets hit by a critical hit + * + * @privateremarks + * It is the responsibility of the caller to ensure that this ability attribute is only applied + * when the user has been hit by a critical hit; such an event is not checked here. + * + * @sealed + */ +export class PostReceiveCritStatStageChangeAbAttr extends AbAttr { private stat: BattleStat; private stages: number; @@ -1216,12 +1213,6 @@ export class PostDefendCritStatStageChangeAbAttr extends PostDefendAbAttr { ); } } - - override getCondition(): AbAttrCondition { - return (pokemon: Pokemon) => - pokemon.turnData.attacksReceived.length !== 0 && - pokemon.turnData.attacksReceived[pokemon.turnData.attacksReceived.length - 1].critical; - } } export class PostDefendContactDamageAbAttr extends PostDefendAbAttr { @@ -1607,37 +1598,38 @@ export class MoveTypeChangeAbAttr extends PreAttackAbAttr { } } -/** Ability attribute for changing a pokemon's type before using a move */ +/** + * Attribute to change the user's type to that of the move currently being executed. + * Used by {@linkcode AbilityId.PROTEAN} and {@linkcode AbilityId.LIBERO}. + */ export class PokemonTypeChangeAbAttr extends PreAttackAbAttr { - private moveType: PokemonType; - + private moveType: PokemonType = PokemonType.UNKNOWN; constructor() { super(true); } override canApply({ move, pokemon }: AugmentMoveInteractionAbAttrParams): boolean { if ( - !pokemon.isTerastallized && - move.id !== MoveId.STRUGGLE && - /** + pokemon.isTerastallized || + move.id === MoveId.STRUGGLE || + /* * Skip moves that call other moves because these moves generate a following move that will trigger this ability attribute - * @see {@link https://bulbapedia.bulbagarden.net/wiki/Category:Moves_that_call_other_moves} + * See: https://bulbapedia.bulbagarden.net/wiki/Category:Moves_that_call_other_moves */ - !move.findAttr( - attr => - attr.is("RandomMovesetMoveAttr") || - attr.is("RandomMoveAttr") || - attr.is("NaturePowerAttr") || - attr.is("CopyMoveAttr"), - ) + move.hasAttr("CallMoveAttr") || + move.hasAttr("NaturePowerAttr") // TODO: remove this line when nature power is made to extend from `CallMoveAttr` ) { - const moveType = pokemon.getMoveType(move); - if (pokemon.getTypes().some(t => t !== moveType)) { - this.moveType = moveType; - return true; - } + return false; } - return false; + + // Skip changing type if we're already of the given type as-is + const moveType = pokemon.getMoveType(move); + if (pokemon.getTypes().every(t => t === moveType)) { + return false; + } + + this.moveType = moveType; + return true; } override apply({ simulated, pokemon, move }: AugmentMoveInteractionAbAttrParams): void { @@ -3047,61 +3039,40 @@ export class PostSummonCopyAllyStatsAbAttr extends PostSummonAbAttr { * Attribute used by {@linkcode AbilityId.IMPOSTER} to transform into a random opposing pokemon on entry. */ export class PostSummonTransformAbAttr extends PostSummonAbAttr { + private targetIndex: BattlerIndex = BattlerIndex.ATTACKER; constructor() { super(true, false); } - private getTarget(targets: Pokemon[]): Pokemon { - let target: Pokemon = targets[0]; - if (targets.length > 1) { - globalScene.executeWithSeedOffset(() => { - // in a double battle, if one of the opposing pokemon is fused the other one will be chosen - // if both are fused, then Imposter will fail below - if (targets[0].fusionSpecies) { - target = targets[1]; - return; - } - if (targets[1].fusionSpecies) { - target = targets[0]; - return; - } - target = randSeedItem(targets); - }, globalScene.currentBattle.waveIndex); - } else { - target = targets[0]; + /** + * Return the correct opponent for Imposter to copy, barring enemies with fusions, substitutes and illusions. + * @param user - The {@linkcode Pokemon} with this ability. + * @returns The {@linkcode Pokemon} to transform into, or `undefined` if none are eligible. + * @remarks + * This sets the private `targetIndex` field to the target's {@linkcode BattlerIndex} on success. + */ + private getTarget(user: Pokemon): Pokemon | undefined { + // As opposed to the mainline behavior of "always copy the opposite slot", + // PKR Imposter instead attempts to copy a random eligible opposing Pokemon meeting Transform's criteria. + // If none are eligible to copy, it will not activate. + const targets = user.getOpponents().filter(opp => user.canTransformInto(opp)); + if (targets.length === 0) { + return undefined; } - target = target!; - - return target; + const mon = targets[user.randBattleSeedInt(targets.length)]; + this.targetIndex = mon.getBattlerIndex(); + return mon; } - override canApply({ pokemon, simulated }: AbAttrBaseParams): boolean { - const targets = pokemon.getOpponents(); - const target = this.getTarget(targets); + override canApply({ pokemon }: AbAttrBaseParams): boolean { + const target = this.getTarget(pokemon); - if (target.summonData.illusion) { - return false; - } - - // TODO: Consider moving the simulated check to the apply method - if (simulated || !targets.length) { - return !!simulated; - } - - // transforming from or into fusion pokemon causes various problems (including crashes and save corruption) - return !(this.getTarget(targets).fusionSpecies || pokemon.fusionSpecies); + return !!target; } override apply({ pokemon }: AbAttrBaseParams): void { - const target = this.getTarget(pokemon.getOpponents()); - - globalScene.phaseManager.unshiftNew( - "PokemonTransformPhase", - pokemon.getBattlerIndex(), - target.getBattlerIndex(), - true, - ); + globalScene.phaseManager.unshiftNew("PokemonTransformPhase", pokemon.getBattlerIndex(), this.targetIndex, true); } } @@ -3164,7 +3135,7 @@ export class PostSummonFormChangeByWeatherAbAttr extends PostSummonAbAttr { /** * Attribute implementing the effects of {@link https://bulbapedia.bulbagarden.net/wiki/Commander_(Ability) | Commander}. * When the source of an ability with this attribute detects a Dondozo as their active ally, the source "jumps - * into the Dondozo's mouth," sharply boosting the Dondozo's stats, cancelling the source's moves, and + * into the Dondozo's mouth", sharply boosting the Dondozo's stats, cancelling the source's moves, and * causing attacks that target the source to always miss. */ export class CommanderAbAttr extends AbAttr { @@ -6417,7 +6388,7 @@ const AbilityAttrs = Object.freeze({ PostDefendContactApplyStatusEffectAbAttr, EffectSporeAbAttr, PostDefendContactApplyTagChanceAbAttr, - PostDefendCritStatStageChangeAbAttr, + PostReceiveCritStatStageChangeAbAttr, PostDefendContactDamageAbAttr, PostDefendPerishSongAbAttr, PostDefendWeatherChangeAbAttr, @@ -6886,7 +6857,7 @@ export function initAbilities() { new Ability(AbilityId.GLUTTONY, 4) .attr(ReduceBerryUseThresholdAbAttr), new Ability(AbilityId.ANGER_POINT, 4) - .attr(PostDefendCritStatStageChangeAbAttr, Stat.ATK, 6), + .attr(PostReceiveCritStatStageChangeAbAttr, Stat.ATK, 12), new Ability(AbilityId.UNBURDEN, 4) .attr(PostItemLostApplyBattlerTagAbAttr, BattlerTagType.UNBURDEN) .bypassFaint() // Allows reviver seed to activate Unburden @@ -7101,7 +7072,8 @@ export function initAbilities() { .bypassFaint(), new Ability(AbilityId.IMPOSTER, 5) .attr(PostSummonTransformAbAttr) - .uncopiable(), + .uncopiable() + .edgeCase(), // Should copy rage fist hit count, etc (see Transform edge case for full list) new Ability(AbilityId.INFILTRATOR, 5) .attr(InfiltratorAbAttr) .partial(), // does not bypass Mist @@ -7177,8 +7149,10 @@ export function initAbilities() { new Ability(AbilityId.CHEEK_POUCH, 6) .attr(HealFromBerryUseAbAttr, 1 / 3), new Ability(AbilityId.PROTEAN, 6) - .attr(PokemonTypeChangeAbAttr), - //.condition((p) => !p.summonData.abilitiesApplied.includes(AbilityId.PROTEAN)), //Gen 9 Implementation + .attr(PokemonTypeChangeAbAttr) + // .condition((p) => !p.summonData.abilitiesApplied.includes(Abilities.PROTEAN)) //Gen 9 Implementation + // TODO: needs testing on interaction with weather blockage + .edgeCase(), new Ability(AbilityId.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (_target, _user, move) => move.category === MoveCategory.PHYSICAL, 0.5) .ignorable(), @@ -7263,11 +7237,14 @@ export function initAbilities() { new Ability(AbilityId.MERCILESS, 7) .attr(ConditionalCritAbAttr, (_user, target, _move) => target?.status?.effect === StatusEffect.TOXIC || target?.status?.effect === StatusEffect.POISON), new Ability(AbilityId.SHIELDS_DOWN, 7, -1) - .attr(PostBattleInitFormChangeAbAttr, () => 0) + // Change into Meteor Form on switch-in or turn end if HP >= 50%, + // or Core Form if HP <= 50%. + .attr(PostBattleInitFormChangeAbAttr, p => p.formIndex % 7) .attr(PostSummonFormChangeAbAttr, p => p.formIndex % 7 + (p.getHpRatio() <= 0.5 ? 7 : 0)) .attr(PostTurnFormChangeAbAttr, p => p.formIndex % 7 + (p.getHpRatio() <= 0.5 ? 7 : 0)) - .conditionalAttr(p => p.formIndex !== 7, StatusEffectImmunityAbAttr) - .conditionalAttr(p => p.formIndex !== 7, BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) + // All variants of Meteor Form are immune to status effects & Yawn + .conditionalAttr(p => p.formIndex < 7, StatusEffectImmunityAbAttr) + .conditionalAttr(p => p.formIndex < 7, BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) .attr(NoFusionAbilityAbAttr) .attr(NoTransformAbilityAbAttr) .uncopiable() @@ -7333,12 +7310,11 @@ export function initAbilities() { .unsuppressable() .bypassFaint(), new Ability(AbilityId.POWER_CONSTRUCT, 7) - .conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostBattleInitFormChangeAbAttr, () => 2) - .conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostBattleInitFormChangeAbAttr, () => 3) - .conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "complete" ? 4 : 2) - .conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "complete" ? 4 : 2) - .conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "10-complete" ? 5 : 3) - .conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "10-complete" ? 5 : 3) + // Change to 10% complete or 50% complete on switchout/turn end if at <50% HP; + // revert to 10% PC or 50% PC before a new battle starts + .conditionalAttr(p => p.formIndex === 4 || p.formIndex === 5, PostBattleInitFormChangeAbAttr, p => p.formIndex - 2) + .conditionalAttr(p => p.getHpRatio() <= 0.5 && (p.formIndex === 2 || p.formIndex === 3), PostSummonFormChangeAbAttr, p => p.formIndex + 2) + .conditionalAttr(p => p.getHpRatio() <= 0.5 && (p.formIndex === 2 || p.formIndex === 3), PostTurnFormChangeAbAttr, p => p.formIndex + 2) .attr(NoFusionAbilityAbAttr) .uncopiable() .unreplaceable() @@ -7429,8 +7405,10 @@ export function initAbilities() { new Ability(AbilityId.DAUNTLESS_SHIELD, 8) .attr(PostSummonStatStageChangeAbAttr, [ Stat.DEF ], 1, true), new Ability(AbilityId.LIBERO, 8) - .attr(PokemonTypeChangeAbAttr), - //.condition((p) => !p.summonData.abilitiesApplied.includes(AbilityId.LIBERO)), //Gen 9 Implementation + .attr(PokemonTypeChangeAbAttr) + //.condition((p) => !p.summonData.abilitiesApplied.includes(Abilities.LIBERO)), //Gen 9 Implementation + // TODO: needs testing on interaction with weather blockage + .edgeCase(), new Ability(AbilityId.BALL_FETCH, 8) .attr(FetchBallAbAttr) .condition(getOncePerBattleCondition(AbilityId.BALL_FETCH)), diff --git a/src/data/abilities/apply-ab-attrs.ts b/src/data/abilities/apply-ab-attrs.ts index 1571d64d170..e8f01a4bb36 100644 --- a/src/data/abilities/apply-ab-attrs.ts +++ b/src/data/abilities/apply-ab-attrs.ts @@ -1,6 +1,5 @@ -import type { AbAttrParamMap } from "#app/@types/ability-types"; -import type { AbAttrBaseParams, AbAttrString, CallableAbAttrString } from "#app/@types/ability-types"; import { globalScene } from "#app/global-scene"; +import type { AbAttrBaseParams, AbAttrParamMap, AbAttrString, CallableAbAttrString } from "#types/ability-types"; function applySingleAbAttrs( attrType: T, diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 48fdebd745f..0c369f8b22d 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -1,26 +1,26 @@ +import { applyAbAttrs, applyOnGainAbAttrs, applyOnLoseAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import type { Arena } from "#app/field/arena"; -import { PokemonType } from "#enums/pokemon-type"; -import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils/common"; -import { allMoves } from "./data-lists"; -import { MoveTarget } from "#enums/MoveTarget"; -import { MoveCategory } from "#enums/MoveCategory"; import { getPokemonNameWithAffix } from "#app/messages"; -import type Pokemon from "#app/field/pokemon"; -import { HitResult } from "#enums/hit-result"; -import { StatusEffect } from "#enums/status-effect"; -import type { BattlerIndex } from "#enums/battler-index"; -import { applyAbAttrs, applyOnGainAbAttrs, applyOnLoseAbAttrs } from "./abilities/apply-ab-attrs"; -import { Stat } from "#enums/stat"; -import { CommonBattleAnim } from "#app/data/battle-anims"; -import { CommonAnim } from "#enums/move-anims-common"; -import i18next from "i18next"; +import { CommonBattleAnim } from "#data/battle-anims"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { ArenaTagType } from "#enums/arena-tag-type"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { MoveId } from "#enums/move-id"; import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import type { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { HitResult } from "#enums/hit-result"; +import { MoveCategory } from "#enums/MoveCategory"; +import { MoveTarget } from "#enums/MoveTarget"; +import { CommonAnim } from "#enums/move-anims-common"; +import { MoveId } from "#enums/move-id"; import { MoveUseMode } from "#enums/move-use-mode"; +import { PokemonType } from "#enums/pokemon-type"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import type { Arena } from "#field/arena"; +import type { Pokemon } from "#field/pokemon"; +import { BooleanHolder, NumberHolder, toDmgValue } from "#utils/common"; +import i18next from "i18next"; export abstract class ArenaTag { constructor( @@ -1117,7 +1117,6 @@ export class TrickRoomTag extends ArenaTag { globalScene.phaseManager.queueMessage( i18next.t("arenaTag:trickRoomOnAdd", { moveName: this.getMoveName(), - opponentDesc: source.getOpponentDescriptor(), }), ); } diff --git a/src/data/balance/biomes.ts b/src/data/balance/biomes.ts index 713ab9637ab..32195b90e43 100644 --- a/src/data/balance/biomes.ts +++ b/src/data/balance/biomes.ts @@ -1,13 +1,13 @@ -import { PokemonType } from "#enums/pokemon-type"; -import { randSeedInt, getEnumValues } from "#app/utils/common"; -import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import i18next from "i18next"; +import type { SpeciesFormEvolution } from "#balance/pokemon-evolutions"; +import { pokemonEvolutions } from "#balance/pokemon-evolutions"; import { BiomeId } from "#enums/biome-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; import { TimeOfDay } from "#enums/time-of-day"; import { TrainerType } from "#enums/trainer-type"; -// import beautify from "json-beautify"; +import { randSeedInt } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import i18next from "i18next"; export function getBiomeName(biome: BiomeId | -1) { if (biome === -1) { @@ -126,7 +126,7 @@ export const biomePokemonPools: BiomePokemonPools = { [BiomeId.TOWN]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [ - { 1: [ SpeciesId.CATERPIE ], 7: [ SpeciesId.METAPOD ]}, + { 1: [ SpeciesId.CATERPIE ], 7: [ SpeciesId.METAPOD ] }, SpeciesId.SENTRET, SpeciesId.LEDYBA, SpeciesId.HOPPIP, @@ -134,12 +134,12 @@ export const biomePokemonPools: BiomePokemonPools = { SpeciesId.STARLY, SpeciesId.PIDOVE, SpeciesId.COTTONEE, - { 1: [ SpeciesId.SCATTERBUG ], 9: [ SpeciesId.SPEWPA ]}, + { 1: [ SpeciesId.SCATTERBUG ], 9: [ SpeciesId.SPEWPA ] }, SpeciesId.YUNGOOS, SpeciesId.SKWOVET ], [TimeOfDay.DAY]: [ - { 1: [ SpeciesId.CATERPIE ], 7: [ SpeciesId.METAPOD ]}, + { 1: [ SpeciesId.CATERPIE ], 7: [ SpeciesId.METAPOD ] }, SpeciesId.SENTRET, SpeciesId.HOPPIP, SpeciesId.SUNKERN, @@ -147,12 +147,12 @@ export const biomePokemonPools: BiomePokemonPools = { SpeciesId.STARLY, SpeciesId.PIDOVE, SpeciesId.COTTONEE, - { 1: [ SpeciesId.SCATTERBUG ], 9: [ SpeciesId.SPEWPA ]}, + { 1: [ SpeciesId.SCATTERBUG ], 9: [ SpeciesId.SPEWPA ] }, SpeciesId.YUNGOOS, SpeciesId.SKWOVET ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.WEEDLE ], 7: [ SpeciesId.KAKUNA ]}, SpeciesId.POOCHYENA, SpeciesId.PATRAT, SpeciesId.PURRLOIN, SpeciesId.BLIPBUG ], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.WEEDLE ], 7: [ SpeciesId.KAKUNA ]}, SpeciesId.HOOTHOOT, SpeciesId.SPINARAK, SpeciesId.POOCHYENA, SpeciesId.CASCOON, SpeciesId.PATRAT, SpeciesId.PURRLOIN, SpeciesId.BLIPBUG ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.WEEDLE ], 7: [ SpeciesId.KAKUNA ] }, SpeciesId.POOCHYENA, SpeciesId.PATRAT, SpeciesId.PURRLOIN, SpeciesId.BLIPBUG ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.WEEDLE ], 7: [ SpeciesId.KAKUNA ] }, SpeciesId.HOOTHOOT, SpeciesId.SPINARAK, SpeciesId.POOCHYENA, SpeciesId.CASCOON, SpeciesId.PATRAT, SpeciesId.PURRLOIN, SpeciesId.BLIPBUG ], [TimeOfDay.ALL]: [ SpeciesId.PIDGEY, SpeciesId.RATTATA, SpeciesId.SPEAROW, SpeciesId.ZIGZAGOON, SpeciesId.WURMPLE, SpeciesId.TAILLOW, SpeciesId.BIDOOF, SpeciesId.LILLIPUP, SpeciesId.FLETCHLING, SpeciesId.WOOLOO, SpeciesId.LECHONK ] }, [BiomePoolTier.UNCOMMON]: { @@ -162,56 +162,56 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.EKANS, SpeciesId.ODDISH, SpeciesId.PARAS, SpeciesId.VENONAT, SpeciesId.MEOWTH, SpeciesId.SEEDOT, SpeciesId.SHROOMISH, SpeciesId.KRICKETOT, SpeciesId.VENIPEDE ], [TimeOfDay.ALL]: [ SpeciesId.NINCADA, SpeciesId.WHISMUR, SpeciesId.FIDOUGH ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.TANDEMAUS ], [TimeOfDay.DAY]: [ SpeciesId.TANDEMAUS ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ABRA, SpeciesId.SURSKIT, SpeciesId.ROOKIDEE ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.EEVEE, SpeciesId.RALTS ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.TANDEMAUS ], [TimeOfDay.DAY]: [ SpeciesId.TANDEMAUS ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ABRA, SpeciesId.SURSKIT, SpeciesId.ROOKIDEE ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.EEVEE, SpeciesId.RALTS ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.PLAINS]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.SENTRET ], 15: [ SpeciesId.FURRET ]}, { 1: [ SpeciesId.YUNGOOS ], 30: [ SpeciesId.GUMSHOOS ]}, { 1: [ SpeciesId.SKWOVET ], 24: [ SpeciesId.GREEDENT ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.SENTRET ], 15: [ SpeciesId.FURRET ]}, { 1: [ SpeciesId.YUNGOOS ], 30: [ SpeciesId.GUMSHOOS ]}, { 1: [ SpeciesId.SKWOVET ], 24: [ SpeciesId.GREEDENT ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.MEOWTH ], 28: [ SpeciesId.PERSIAN ]}, { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.ZUBAT ], 22: [ SpeciesId.GOLBAT ]}, { 1: [ SpeciesId.MEOWTH ], 28: [ SpeciesId.PERSIAN ]}, { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.ZIGZAGOON ], 20: [ SpeciesId.LINOONE ]}, { 1: [ SpeciesId.BIDOOF ], 15: [ SpeciesId.BIBAREL ]}, { 1: [ SpeciesId.LECHONK ], 18: [ SpeciesId.OINKOLOGNE ]}] + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.SENTRET ], 15: [ SpeciesId.FURRET ] }, { 1: [ SpeciesId.YUNGOOS ], 20: [ SpeciesId.GUMSHOOS ] }, { 1: [ SpeciesId.SKWOVET ], 24: [ SpeciesId.GREEDENT ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.SENTRET ], 15: [ SpeciesId.FURRET ] }, { 1: [ SpeciesId.YUNGOOS ], 20: [ SpeciesId.GUMSHOOS ] }, { 1: [ SpeciesId.SKWOVET ], 24: [ SpeciesId.GREEDENT ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.MEOWTH ], 28: [ SpeciesId.PERSIAN ] }, { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.ZUBAT ], 22: [ SpeciesId.GOLBAT ] }, { 1: [ SpeciesId.MEOWTH ], 28: [ SpeciesId.PERSIAN ] }, { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.ZIGZAGOON ], 20: [ SpeciesId.LINOONE ] }, { 1: [ SpeciesId.BIDOOF ], 15: [ SpeciesId.BIBAREL ] }, { 1: [ SpeciesId.LECHONK ], 18: [ SpeciesId.OINKOLOGNE ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [ - { 1: [ SpeciesId.DODUO ], 31: [ SpeciesId.DODRIO ]}, - { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ]}, - { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ]}, - { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ]}, - { 1: [ SpeciesId.PAWMI ], 18: [ SpeciesId.PAWMO ], 32: [ SpeciesId.PAWMOT ]} + { 1: [ SpeciesId.DODUO ], 31: [ SpeciesId.DODRIO ] }, + { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ] }, + { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ] }, + { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ] }, + { 1: [ SpeciesId.PAWMI ], 18: [ SpeciesId.PAWMO ], 32: [ SpeciesId.PAWMOT ] } ], [TimeOfDay.DAY]: [ - { 1: [ SpeciesId.DODUO ], 31: [ SpeciesId.DODRIO ]}, - { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ]}, - { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ]}, - { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ]}, - { 1: [ SpeciesId.ROCKRUFF ], 25: [ SpeciesId.LYCANROC ]}, - { 1: [ SpeciesId.PAWMI ], 18: [ SpeciesId.PAWMO ], 32: [ SpeciesId.PAWMOT ]} + { 1: [ SpeciesId.DODUO ], 31: [ SpeciesId.DODRIO ] }, + { 1: [ SpeciesId.POOCHYENA ], 18: [ SpeciesId.MIGHTYENA ] }, + { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ] }, + { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ] }, + { 1: [ SpeciesId.ROCKRUFF ], 25: [ SpeciesId.LYCANROC ] }, + { 1: [ SpeciesId.PAWMI ], 18: [ SpeciesId.PAWMO ], 32: [ SpeciesId.PAWMOT ] } ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.MANKEY ], 28: [ SpeciesId.PRIMEAPE ], 75: [ SpeciesId.ANNIHILAPE ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.MANKEY ], 28: [ SpeciesId.PRIMEAPE ], 75: [ SpeciesId.ANNIHILAPE ]}], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.MANKEY ], 28: [ SpeciesId.PRIMEAPE ], 75: [ SpeciesId.ANNIHILAPE ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.MANKEY ], 28: [ SpeciesId.PRIMEAPE ], 75: [ SpeciesId.ANNIHILAPE ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.PIDGEY ], 18: [ SpeciesId.PIDGEOTTO ], 36: [ SpeciesId.PIDGEOT ]}, - { 1: [ SpeciesId.SPEAROW ], 20: [ SpeciesId.FEAROW ]}, + { 1: [ SpeciesId.PIDGEY ], 18: [ SpeciesId.PIDGEOTTO ], 36: [ SpeciesId.PIDGEOT ] }, + { 1: [ SpeciesId.SPEAROW ], 20: [ SpeciesId.FEAROW ] }, SpeciesId.PIKACHU, - { 1: [ SpeciesId.FLETCHLING ], 17: [ SpeciesId.FLETCHINDER ], 35: [ SpeciesId.TALONFLAME ]} + { 1: [ SpeciesId.FLETCHLING ], 17: [ SpeciesId.FLETCHINDER ], 35: [ SpeciesId.TALONFLAME ] } ] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.PALDEA_TAUROS ], [TimeOfDay.DAY]: [ SpeciesId.PALDEA_TAUROS ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.SHINX ], 15: [ SpeciesId.LUXIO ], 30: [ SpeciesId.LUXRAY ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.SHINX ], 15: [ SpeciesId.LUXIO ], 30: [ SpeciesId.LUXRAY ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.ABRA ], 16: [ SpeciesId.KADABRA ]}, { 1: [ SpeciesId.BUNEARY ], 20: [ SpeciesId.LOPUNNY ]}, { 1: [ SpeciesId.ROOKIDEE ], 18: [ SpeciesId.CORVISQUIRE ], 38: [ SpeciesId.CORVIKNIGHT ]}] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.SHINX ], 15: [ SpeciesId.LUXIO ], 30: [ SpeciesId.LUXRAY ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.SHINX ], 15: [ SpeciesId.LUXIO ], 30: [ SpeciesId.LUXRAY ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.ABRA ], 16: [ SpeciesId.KADABRA ] }, { 1: [ SpeciesId.BUNEARY ], 20: [ SpeciesId.LOPUNNY ] }, { 1: [ SpeciesId.ROOKIDEE ], 18: [ SpeciesId.CORVISQUIRE ], 38: [ SpeciesId.CORVIKNIGHT ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FARFETCHD, SpeciesId.LICKITUNG, SpeciesId.CHANSEY, SpeciesId.EEVEE, SpeciesId.SNORLAX, { 1: [ SpeciesId.DUNSPARCE ], 62: [ SpeciesId.DUDUNSPARCE ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, SpeciesId.LATIAS, SpeciesId.LATIOS ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FARFETCHD, SpeciesId.LICKITUNG, SpeciesId.CHANSEY, SpeciesId.EEVEE, SpeciesId.SNORLAX, { 1: [ SpeciesId.DUNSPARCE ], 62: [ SpeciesId.DUDUNSPARCE ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, SpeciesId.LATIAS, SpeciesId.LATIOS ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.DODRIO, SpeciesId.FURRET, SpeciesId.GUMSHOOS, SpeciesId.GREEDENT ], [TimeOfDay.DAY]: [ SpeciesId.DODRIO, SpeciesId.FURRET, SpeciesId.GUMSHOOS, SpeciesId.GREEDENT ], @@ -226,22 +226,22 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FARFETCHD, SpeciesId.SNORLAX, SpeciesId.LICKILICKY, SpeciesId.DUDUNSPARCE ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LATIAS, SpeciesId.LATIOS ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LATIAS, SpeciesId.LATIOS ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.GRASS]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.HOPPIP ], 18: [ SpeciesId.SKIPLOOM ]}, SpeciesId.SUNKERN, SpeciesId.COTTONEE, SpeciesId.PETILIL ], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.HOPPIP ], 18: [ SpeciesId.SKIPLOOM ]}, SpeciesId.SUNKERN, SpeciesId.COTTONEE, SpeciesId.PETILIL ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ]}, { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ]}, { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.HOPPIP ], 18: [ SpeciesId.SKIPLOOM ] }, SpeciesId.SUNKERN, SpeciesId.COTTONEE, SpeciesId.PETILIL ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.HOPPIP ], 18: [ SpeciesId.SKIPLOOM ] }, SpeciesId.SUNKERN, SpeciesId.COTTONEE, SpeciesId.PETILIL ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ] }, { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ] }, { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ] } ], [TimeOfDay.ALL]: [] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ]}, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ]}, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ] }, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ] }, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ] } ], [TimeOfDay.ALL]: [] }, [BiomePoolTier.RARE]: { @@ -249,28 +249,28 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BULBASAUR ], 16: [ SpeciesId.IVYSAUR ], 32: [ SpeciesId.VENUSAUR ]}, SpeciesId.GROWLITHE, { 1: [ SpeciesId.TURTWIG ], 18: [ SpeciesId.GROTLE ], 32: [ SpeciesId.TORTERRA ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BULBASAUR ], 16: [ SpeciesId.IVYSAUR ], 32: [ SpeciesId.VENUSAUR ] }, SpeciesId.GROWLITHE, { 1: [ SpeciesId.TURTWIG ], 18: [ SpeciesId.GROTLE ], 32: [ SpeciesId.TORTERRA ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SUDOWOODO ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VIRIZION ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.JUMPLUFF, SpeciesId.SUNFLORA, SpeciesId.WHIMSICOTT ], [TimeOfDay.DAY]: [ SpeciesId.JUMPLUFF, SpeciesId.SUNFLORA, SpeciesId.WHIMSICOTT ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VENUSAUR, SpeciesId.SUDOWOODO, SpeciesId.TORTERRA ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VIRIZION ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SUDOWOODO ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VIRIZION ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.JUMPLUFF, SpeciesId.SUNFLORA, SpeciesId.WHIMSICOTT ], [TimeOfDay.DAY]: [ SpeciesId.JUMPLUFF, SpeciesId.SUNFLORA, SpeciesId.WHIMSICOTT ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VENUSAUR, SpeciesId.SUDOWOODO, SpeciesId.TORTERRA ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VIRIZION ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.TALL_GRASS]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.BOUNSWEET ], 18: [ SpeciesId.STEENEE ], 58: [ SpeciesId.TSAREENA ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.NIDORAN_F ], 16: [ SpeciesId.NIDORINA ]}, { 1: [ SpeciesId.NIDORAN_M ], 16: [ SpeciesId.NIDORINO ]}, { 1: [ SpeciesId.BOUNSWEET ], 18: [ SpeciesId.STEENEE ], 58: [ SpeciesId.TSAREENA ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.ODDISH ], 21: [ SpeciesId.GLOOM ]}, { 1: [ SpeciesId.KRICKETOT ], 10: [ SpeciesId.KRICKETUNE ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.ODDISH ], 21: [ SpeciesId.GLOOM ]}, { 1: [ SpeciesId.KRICKETOT ], 10: [ SpeciesId.KRICKETUNE ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.NINCADA ], 20: [ SpeciesId.NINJASK ]}, { 1: [ SpeciesId.FOMANTIS ], 44: [ SpeciesId.LURANTIS ]}, { 1: [ SpeciesId.NYMBLE ], 24: [ SpeciesId.LOKIX ]}] + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.BOUNSWEET ], 18: [ SpeciesId.STEENEE ], 58: [ SpeciesId.TSAREENA ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.NIDORAN_F ], 16: [ SpeciesId.NIDORINA ] }, { 1: [ SpeciesId.NIDORAN_M ], 16: [ SpeciesId.NIDORINO ] }, { 1: [ SpeciesId.BOUNSWEET ], 18: [ SpeciesId.STEENEE ], 58: [ SpeciesId.TSAREENA ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.ODDISH ], 21: [ SpeciesId.GLOOM ] }, { 1: [ SpeciesId.KRICKETOT ], 10: [ SpeciesId.KRICKETUNE ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.ODDISH ], 21: [ SpeciesId.GLOOM ] }, { 1: [ SpeciesId.KRICKETOT ], 10: [ SpeciesId.KRICKETUNE ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.NINCADA ], 20: [ SpeciesId.NINJASK ] }, { 1: [ SpeciesId.FOMANTIS ], 34: [ SpeciesId.LURANTIS ] }, { 1: [ SpeciesId.NYMBLE ], 24: [ SpeciesId.LOKIX ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.PARAS ], 24: [ SpeciesId.PARASECT ]}, { 1: [ SpeciesId.VENONAT ], 31: [ SpeciesId.VENOMOTH ]}, { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ]}], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.PARAS ], 24: [ SpeciesId.PARASECT ] }, { 1: [ SpeciesId.VENONAT ], 31: [ SpeciesId.VENOMOTH ] }, { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ] } ], [TimeOfDay.ALL]: [ SpeciesId.VULPIX ] }, [BiomePoolTier.RARE]: { @@ -278,10 +278,10 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.PINSIR, { 1: [ SpeciesId.CHIKORITA ], 16: [ SpeciesId.BAYLEEF ], 32: [ SpeciesId.MEGANIUM ]}, { 1: [ SpeciesId.GIRAFARIG ], 62: [ SpeciesId.FARIGIRAF ]}, SpeciesId.ZANGOOSE, SpeciesId.KECLEON, SpeciesId.TROPIUS ] + [TimeOfDay.ALL]: [ SpeciesId.PINSIR, { 1: [ SpeciesId.CHIKORITA ], 16: [ SpeciesId.BAYLEEF ], 32: [ SpeciesId.MEGANIUM ] }, { 1: [ SpeciesId.GIRAFARIG ], 62: [ SpeciesId.FARIGIRAF ] }, SpeciesId.ZANGOOSE, SpeciesId.KECLEON, SpeciesId.TROPIUS ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SCYTHER, SpeciesId.SHEDINJA, SpeciesId.ROTOM ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SCYTHER, SpeciesId.SHEDINJA, SpeciesId.ROTOM ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.TSAREENA ], [TimeOfDay.DAY]: [ SpeciesId.NIDOQUEEN, SpeciesId.NIDOKING, SpeciesId.TSAREENA ], @@ -289,87 +289,87 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.VILEPLUME, SpeciesId.KRICKETUNE ], [TimeOfDay.ALL]: [ SpeciesId.NINJASK, SpeciesId.ZANGOOSE, SpeciesId.KECLEON, SpeciesId.LURANTIS, SpeciesId.LOKIX ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.BELLOSSOM ], [TimeOfDay.DAY]: [ SpeciesId.BELLOSSOM ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.PINSIR, SpeciesId.MEGANIUM, SpeciesId.FARIGIRAF ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.BELLOSSOM ], [TimeOfDay.DAY]: [ SpeciesId.BELLOSSOM ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.PINSIR, SpeciesId.MEGANIUM, SpeciesId.FARIGIRAF ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.METROPOLIS]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.YAMPER ], 25: [ SpeciesId.BOLTUND ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.YAMPER ], 25: [ SpeciesId.BOLTUND ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.HOUNDOUR ], 24: [ SpeciesId.HOUNDOOM ]}, { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.RATTATA ], 20: [ SpeciesId.RATICATE ]}, { 1: [ SpeciesId.ZIGZAGOON ], 20: [ SpeciesId.LINOONE ]}, { 1: [ SpeciesId.LILLIPUP ], 16: [ SpeciesId.HERDIER ], 32: [ SpeciesId.STOUTLAND ]}] + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.YAMPER ], 25: [ SpeciesId.BOLTUND ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.YAMPER ], 25: [ SpeciesId.BOLTUND ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.HOUNDOUR ], 24: [ SpeciesId.HOUNDOOM ] }, { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.RATTATA ], 20: [ SpeciesId.RATICATE ] }, { 1: [ SpeciesId.ZIGZAGOON ], 20: [ SpeciesId.LINOONE ] }, { 1: [ SpeciesId.LILLIPUP ], 16: [ SpeciesId.HERDIER ], 32: [ SpeciesId.STOUTLAND ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ]}, SpeciesId.INDEEDEE ], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ]}, SpeciesId.INDEEDEE ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.ESPURR ], 25: [ SpeciesId.MEOWSTIC ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.ESPURR ], 25: [ SpeciesId.MEOWSTIC ]}], - [TimeOfDay.ALL]: [ SpeciesId.PIKACHU, { 1: [ SpeciesId.GLAMEOW ], 38: [ SpeciesId.PURUGLY ]}, SpeciesId.FURFROU, { 1: [ SpeciesId.FIDOUGH ], 26: [ SpeciesId.DACHSBUN ]}, SpeciesId.SQUAWKABILLY ] + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ] }, SpeciesId.INDEEDEE ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ] }, SpeciesId.INDEEDEE ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.ESPURR ], 25: [ SpeciesId.MEOWSTIC ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.ESPURR ], 25: [ SpeciesId.MEOWSTIC ] } ], + [TimeOfDay.ALL]: [ SpeciesId.PIKACHU, { 1: [ SpeciesId.GLAMEOW ], 38: [ SpeciesId.PURUGLY ] }, SpeciesId.FURFROU, { 1: [ SpeciesId.FIDOUGH ], 26: [ SpeciesId.DACHSBUN ] }, SpeciesId.SQUAWKABILLY ] }, [BiomePoolTier.RARE]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.TANDEMAUS ], 25: [ SpeciesId.MAUSHOLD ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.TANDEMAUS ], 25: [ SpeciesId.MAUSHOLD ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.TANDEMAUS ], 25: [ SpeciesId.MAUSHOLD ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.TANDEMAUS ], 25: [ SpeciesId.MAUSHOLD ] } ], [TimeOfDay.DUSK]: [ SpeciesId.MORPEKO ], [TimeOfDay.NIGHT]: [ SpeciesId.MORPEKO ], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.VAROOM ], 40: [ SpeciesId.REVAVROOM ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.VAROOM ], 40: [ SpeciesId.REVAVROOM ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, SpeciesId.EEVEE, SpeciesId.SMEARGLE ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CASTFORM ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.BOLTUND ], [TimeOfDay.DAY]: [ SpeciesId.BOLTUND ], [TimeOfDay.DUSK]: [ SpeciesId.MEOWSTIC ], [TimeOfDay.NIGHT]: [ SpeciesId.MEOWSTIC ], [TimeOfDay.ALL]: [ SpeciesId.STOUTLAND, SpeciesId.FURFROU, SpeciesId.DACHSBUN ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.MAUSHOLD ], [TimeOfDay.DAY]: [ SpeciesId.MAUSHOLD ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CASTFORM, SpeciesId.REVAVROOM ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, SpeciesId.EEVEE, SpeciesId.SMEARGLE ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CASTFORM ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.BOLTUND ], [TimeOfDay.DAY]: [ SpeciesId.BOLTUND ], [TimeOfDay.DUSK]: [ SpeciesId.MEOWSTIC ], [TimeOfDay.NIGHT]: [ SpeciesId.MEOWSTIC ], [TimeOfDay.ALL]: [ SpeciesId.STOUTLAND, SpeciesId.FURFROU, SpeciesId.DACHSBUN ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.MAUSHOLD ], [TimeOfDay.DAY]: [ SpeciesId.MAUSHOLD ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CASTFORM, SpeciesId.REVAVROOM ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.FOREST]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [ SpeciesId.BUTTERFREE, - { 1: [ SpeciesId.BELLSPROUT ], 21: [ SpeciesId.WEEPINBELL ]}, - { 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ]}, + { 1: [ SpeciesId.BELLSPROUT ], 21: [ SpeciesId.WEEPINBELL ] }, + { 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ] }, SpeciesId.PETILIL, - { 1: [ SpeciesId.DEERLING ], 34: [ SpeciesId.SAWSBUCK ]}, + { 1: [ SpeciesId.DEERLING ], 34: [ SpeciesId.SAWSBUCK ] }, SpeciesId.VIVILLON ], [TimeOfDay.DAY]: [ SpeciesId.BUTTERFREE, - { 1: [ SpeciesId.BELLSPROUT ], 21: [ SpeciesId.WEEPINBELL ]}, + { 1: [ SpeciesId.BELLSPROUT ], 21: [ SpeciesId.WEEPINBELL ] }, SpeciesId.BEAUTIFLY, - { 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ]}, + { 1: [ SpeciesId.COMBEE ], 21: [ SpeciesId.VESPIQUEN ] }, SpeciesId.PETILIL, - { 1: [ SpeciesId.DEERLING ], 34: [ SpeciesId.SAWSBUCK ]}, + { 1: [ SpeciesId.DEERLING ], 34: [ SpeciesId.SAWSBUCK ] }, SpeciesId.VIVILLON ], [TimeOfDay.DUSK]: [ SpeciesId.BEEDRILL, - { 1: [ SpeciesId.PINECO ], 31: [ SpeciesId.FORRETRESS ]}, - { 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ]}, - { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ]}, - { 1: [ SpeciesId.VENIPEDE ], 22: [ SpeciesId.WHIRLIPEDE ], 30: [ SpeciesId.SCOLIPEDE ]} + { 1: [ SpeciesId.PINECO ], 31: [ SpeciesId.FORRETRESS ] }, + { 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ] }, + { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ] }, + { 1: [ SpeciesId.VENIPEDE ], 22: [ SpeciesId.WHIRLIPEDE ], 30: [ SpeciesId.SCOLIPEDE ] } ], [TimeOfDay.NIGHT]: [ SpeciesId.BEEDRILL, - { 1: [ SpeciesId.VENONAT ], 31: [ SpeciesId.VENOMOTH ]}, - { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ]}, - { 1: [ SpeciesId.PINECO ], 31: [ SpeciesId.FORRETRESS ]}, + { 1: [ SpeciesId.VENONAT ], 31: [ SpeciesId.VENOMOTH ] }, + { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ] }, + { 1: [ SpeciesId.PINECO ], 31: [ SpeciesId.FORRETRESS ] }, SpeciesId.DUSTOX, - { 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ]}, - { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ]}, - { 1: [ SpeciesId.VENIPEDE ], 22: [ SpeciesId.WHIRLIPEDE ], 30: [ SpeciesId.SCOLIPEDE ]} + { 1: [ SpeciesId.SEEDOT ], 14: [ SpeciesId.NUZLEAF ] }, + { 1: [ SpeciesId.SHROOMISH ], 23: [ SpeciesId.BRELOOM ] }, + { 1: [ SpeciesId.VENIPEDE ], 22: [ SpeciesId.WHIRLIPEDE ], 30: [ SpeciesId.SCOLIPEDE ] } ], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.TAROUNTULA ], 15: [ SpeciesId.SPIDOPS ]}, { 1: [ SpeciesId.NYMBLE ], 24: [ SpeciesId.LOKIX ]}, { 1: [ SpeciesId.SHROODLE ], 28: [ SpeciesId.GRAFAIAI ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.TAROUNTULA ], 15: [ SpeciesId.SPIDOPS ] }, { 1: [ SpeciesId.NYMBLE ], 24: [ SpeciesId.LOKIX ] }, { 1: [ SpeciesId.SHROODLE ], 28: [ SpeciesId.GRAFAIAI ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [ SpeciesId.ROSELIA, SpeciesId.MOTHIM, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ]}], - [TimeOfDay.DAY]: [ SpeciesId.ROSELIA, SpeciesId.MOTHIM, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ]}, { 1: [ SpeciesId.DOTTLER ], 30: [ SpeciesId.ORBEETLE ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.HOOTHOOT ], 20: [ SpeciesId.NOCTOWL ]}, { 1: [ SpeciesId.ROCKRUFF ], 25: [ SpeciesId.LYCANROC ]}, { 1: [ SpeciesId.DOTTLER ], 30: [ SpeciesId.ORBEETLE ]}], + [TimeOfDay.DAWN]: [ SpeciesId.ROSELIA, SpeciesId.MOTHIM, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ] } ], + [TimeOfDay.DAY]: [ SpeciesId.ROSELIA, SpeciesId.MOTHIM, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ] }, { 1: [ SpeciesId.DOTTLER ], 30: [ SpeciesId.ORBEETLE ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.HOOTHOOT ], 20: [ SpeciesId.NOCTOWL ] }, { 1: [ SpeciesId.ROCKRUFF ], 25: [ SpeciesId.LYCANROC ] }, { 1: [ SpeciesId.DOTTLER ], 30: [ SpeciesId.ORBEETLE ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ]}, - { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ]}, - { 1: [ SpeciesId.BURMY ], 20: [ SpeciesId.WORMADAM ]}, - { 1: [ SpeciesId.PANSAGE ], 30: [ SpeciesId.SIMISAGE ]} + { 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ] }, + { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ] }, + { 1: [ SpeciesId.BURMY ], 20: [ SpeciesId.WORMADAM ] }, + { 1: [ SpeciesId.PANSAGE ], 30: [ SpeciesId.SIMISAGE ] } ] }, [BiomePoolTier.RARE]: { @@ -379,18 +379,18 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.SCYTHER ], [TimeOfDay.ALL]: [ SpeciesId.HERACROSS, - { 1: [ SpeciesId.TREECKO ], 16: [ SpeciesId.GROVYLE ], 36: [ SpeciesId.SCEPTILE ]}, + { 1: [ SpeciesId.TREECKO ], 16: [ SpeciesId.GROVYLE ], 36: [ SpeciesId.SCEPTILE ] }, SpeciesId.TROPIUS, SpeciesId.KARRABLAST, SpeciesId.SHELMET, - { 1: [ SpeciesId.CHESPIN ], 16: [ SpeciesId.QUILLADIN ], 36: [ SpeciesId.CHESNAUGHT ]}, - { 1: [ SpeciesId.ROWLET ], 17: [ SpeciesId.DARTRIX ], 34: [ SpeciesId.DECIDUEYE ]}, + { 1: [ SpeciesId.CHESPIN ], 16: [ SpeciesId.QUILLADIN ], 36: [ SpeciesId.CHESNAUGHT ] }, + { 1: [ SpeciesId.ROWLET ], 17: [ SpeciesId.DARTRIX ], 34: [ SpeciesId.DECIDUEYE ] }, SpeciesId.SQUAWKABILLY, - { 1: [ SpeciesId.TOEDSCOOL ], 30: [ SpeciesId.TOEDSCRUEL ]} + { 1: [ SpeciesId.TOEDSCOOL ], 30: [ SpeciesId.TOEDSCRUEL ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.BLOODMOON_URSALUNA ], [TimeOfDay.ALL]: [ SpeciesId.DURANT ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KARTANA, SpeciesId.WO_CHIEN ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.BLOODMOON_URSALUNA ], [TimeOfDay.ALL]: [ SpeciesId.DURANT ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KARTANA, SpeciesId.WO_CHIEN ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.VICTREEBEL, SpeciesId.MOTHIM, SpeciesId.VESPIQUEN, SpeciesId.LILLIGANT, SpeciesId.SAWSBUCK ], [TimeOfDay.DAY]: [ SpeciesId.VICTREEBEL, SpeciesId.BEAUTIFLY, SpeciesId.MOTHIM, SpeciesId.VESPIQUEN, SpeciesId.LILLIGANT, SpeciesId.SAWSBUCK ], @@ -405,29 +405,29 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.LYCANROC, SpeciesId.BLOODMOON_URSALUNA ], [TimeOfDay.ALL]: [ SpeciesId.HERACROSS, SpeciesId.SCEPTILE, SpeciesId.ESCAVALIER, SpeciesId.ACCELGOR, SpeciesId.DURANT, SpeciesId.CHESNAUGHT, SpeciesId.DECIDUEYE, SpeciesId.TOEDSCRUEL ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KARTANA, SpeciesId.WO_CHIEN ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CALYREX ]} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KARTANA, SpeciesId.WO_CHIEN ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CALYREX ] } }, [BiomeId.SEA]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ]}, { 1: [ SpeciesId.WINGULL ], 25: [ SpeciesId.PELIPPER ]}, SpeciesId.CRAMORANT, { 1: [ SpeciesId.FINIZEN ], 38: [ SpeciesId.PALAFIN ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ]}, { 1: [ SpeciesId.WINGULL ], 25: [ SpeciesId.PELIPPER ]}, SpeciesId.CRAMORANT, { 1: [ SpeciesId.FINIZEN ], 38: [ SpeciesId.PALAFIN ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.INKAY ], 30: [ SpeciesId.MALAMAR ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.FINNEON ], 31: [ SpeciesId.LUMINEON ]}, { 1: [ SpeciesId.INKAY ], 30: [ SpeciesId.MALAMAR ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.TENTACOOL ], 30: [ SpeciesId.TENTACRUEL ]}, { 1: [ SpeciesId.MAGIKARP ], 20: [ SpeciesId.GYARADOS ]}, { 1: [ SpeciesId.BUIZEL ], 26: [ SpeciesId.FLOATZEL ]}] + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ] }, { 1: [ SpeciesId.WINGULL ], 25: [ SpeciesId.PELIPPER ] }, SpeciesId.CRAMORANT, { 1: [ SpeciesId.FINIZEN ], 38: [ SpeciesId.PALAFIN ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ] }, { 1: [ SpeciesId.WINGULL ], 25: [ SpeciesId.PELIPPER ] }, SpeciesId.CRAMORANT, { 1: [ SpeciesId.FINIZEN ], 38: [ SpeciesId.PALAFIN ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.INKAY ], 30: [ SpeciesId.MALAMAR ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.FINNEON ], 31: [ SpeciesId.LUMINEON ] }, { 1: [ SpeciesId.INKAY ], 30: [ SpeciesId.MALAMAR ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.TENTACOOL ], 30: [ SpeciesId.TENTACRUEL ] }, { 1: [ SpeciesId.MAGIKARP ], 20: [ SpeciesId.GYARADOS ] }, { 1: [ SpeciesId.BUIZEL ], 26: [ SpeciesId.FLOATZEL ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ]}, SpeciesId.SHELLDER, { 1: [ SpeciesId.CARVANHA ], 30: [ SpeciesId.SHARPEDO ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ]}, SpeciesId.SHELLDER, { 1: [ SpeciesId.CHINCHOU ], 27: [ SpeciesId.LANTURN ]}, { 1: [ SpeciesId.CARVANHA ], 30: [ SpeciesId.SHARPEDO ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ] }, SpeciesId.SHELLDER, { 1: [ SpeciesId.CARVANHA ], 30: [ SpeciesId.SHARPEDO ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ] }, SpeciesId.SHELLDER, { 1: [ SpeciesId.CHINCHOU ], 27: [ SpeciesId.LANTURN ] }, { 1: [ SpeciesId.CARVANHA ], 30: [ SpeciesId.SHARPEDO ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.POLIWAG ], 25: [ SpeciesId.POLIWHIRL ]}, - { 1: [ SpeciesId.HORSEA ], 32: [ SpeciesId.SEADRA ]}, - { 1: [ SpeciesId.GOLDEEN ], 33: [ SpeciesId.SEAKING ]}, - { 1: [ SpeciesId.WAILMER ], 40: [ SpeciesId.WAILORD ]}, - { 1: [ SpeciesId.PANPOUR ], 30: [ SpeciesId.SIMIPOUR ]}, - { 1: [ SpeciesId.WATTREL ], 25: [ SpeciesId.KILOWATTREL ]} + { 1: [ SpeciesId.POLIWAG ], 25: [ SpeciesId.POLIWHIRL ] }, + { 1: [ SpeciesId.HORSEA ], 32: [ SpeciesId.SEADRA ] }, + { 1: [ SpeciesId.GOLDEEN ], 33: [ SpeciesId.SEAKING ] }, + { 1: [ SpeciesId.WAILMER ], 40: [ SpeciesId.WAILORD ] }, + { 1: [ SpeciesId.PANPOUR ], 30: [ SpeciesId.SIMIPOUR ] }, + { 1: [ SpeciesId.WATTREL ], 25: [ SpeciesId.KILOWATTREL ] } ] }, [BiomePoolTier.RARE]: { @@ -435,10 +435,10 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.LAPRAS, { 1: [ SpeciesId.PIPLUP ], 16: [ SpeciesId.PRINPLUP ], 36: [ SpeciesId.EMPOLEON ]}, { 1: [ SpeciesId.POPPLIO ], 17: [ SpeciesId.BRIONNE ], 34: [ SpeciesId.PRIMARINA ]}] + [TimeOfDay.ALL]: [ SpeciesId.LAPRAS, { 1: [ SpeciesId.PIPLUP ], 16: [ SpeciesId.PRINPLUP ], 36: [ SpeciesId.EMPOLEON ] }, { 1: [ SpeciesId.POPPLIO ], 17: [ SpeciesId.BRIONNE ], 34: [ SpeciesId.PRIMARINA ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KINGDRA, SpeciesId.ROTOM, { 1: [ SpeciesId.TIRTOUGA ], 37: [ SpeciesId.CARRACOSTA ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KINGDRA, SpeciesId.ROTOM, { 1: [ SpeciesId.TIRTOUGA ], 37: [ SpeciesId.CARRACOSTA ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.PELIPPER, SpeciesId.CRAMORANT, SpeciesId.PALAFIN ], [TimeOfDay.DAY]: [ SpeciesId.PELIPPER, SpeciesId.CRAMORANT, SpeciesId.PALAFIN ], @@ -446,34 +446,34 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.SHARPEDO, SpeciesId.LUMINEON, SpeciesId.MALAMAR ], [TimeOfDay.ALL]: [ SpeciesId.TENTACRUEL, SpeciesId.FLOATZEL, SpeciesId.SIMIPOUR, SpeciesId.KILOWATTREL ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KINGDRA, SpeciesId.EMPOLEON, SpeciesId.PRIMARINA ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LUGIA ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KINGDRA, SpeciesId.EMPOLEON, SpeciesId.PRIMARINA ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LUGIA ] } }, [BiomeId.SWAMP]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.WOOPER ], 20: [ SpeciesId.QUAGSIRE ]}, { 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.WOOPER ], 20: [ SpeciesId.QUAGSIRE ]}, { 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ]}, { 1: [ SpeciesId.PALDEA_WOOPER ], 20: [ SpeciesId.CLODSIRE ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ]}, { 1: [ SpeciesId.PALDEA_WOOPER ], 20: [ SpeciesId.CLODSIRE ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.WOOPER ], 20: [ SpeciesId.QUAGSIRE ] }, { 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.WOOPER ], 20: [ SpeciesId.QUAGSIRE ] }, { 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ] }, { 1: [ SpeciesId.PALDEA_WOOPER ], 20: [ SpeciesId.CLODSIRE ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ] }, { 1: [ SpeciesId.PALDEA_WOOPER ], 20: [ SpeciesId.CLODSIRE ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.POLIWAG ], 25: [ SpeciesId.POLIWHIRL ]}, - { 1: [ SpeciesId.GULPIN ], 26: [ SpeciesId.SWALOT ]}, - { 1: [ SpeciesId.SHELLOS ], 30: [ SpeciesId.GASTRODON ]}, - { 1: [ SpeciesId.TYMPOLE ], 25: [ SpeciesId.PALPITOAD ], 36: [ SpeciesId.SEISMITOAD ]} + { 1: [ SpeciesId.POLIWAG ], 25: [ SpeciesId.POLIWHIRL ] }, + { 1: [ SpeciesId.GULPIN ], 26: [ SpeciesId.SWALOT ] }, + { 1: [ SpeciesId.SHELLOS ], 30: [ SpeciesId.GASTRODON ] }, + { 1: [ SpeciesId.TYMPOLE ], 25: [ SpeciesId.PALPITOAD ], 36: [ SpeciesId.SEISMITOAD ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.CROAGUNK ], 37: [ SpeciesId.TOXICROAK ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.CROAGUNK ], 37: [ SpeciesId.TOXICROAK ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.EKANS ], 22: [ SpeciesId.ARBOK ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.CROAGUNK ], 37: [ SpeciesId.TOXICROAK ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.CROAGUNK ], 37: [ SpeciesId.TOXICROAK ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.PSYDUCK ], 33: [ SpeciesId.GOLDUCK ]}, - { 1: [ SpeciesId.BARBOACH ], 30: [ SpeciesId.WHISCASH ]}, - { 1: [ SpeciesId.SKORUPI ], 40: [ SpeciesId.DRAPION ]}, + { 1: [ SpeciesId.PSYDUCK ], 33: [ SpeciesId.GOLDUCK ] }, + { 1: [ SpeciesId.BARBOACH ], 30: [ SpeciesId.WHISCASH ] }, + { 1: [ SpeciesId.SKORUPI ], 40: [ SpeciesId.DRAPION ] }, SpeciesId.STUNFISK, - { 1: [ SpeciesId.MAREANIE ], 38: [ SpeciesId.TOXAPEX ]} + { 1: [ SpeciesId.MAREANIE ], 38: [ SpeciesId.TOXAPEX ] } ] }, [BiomePoolTier.RARE]: { @@ -481,16 +481,16 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.TOTODILE ], 18: [ SpeciesId.CROCONAW ], 30: [ SpeciesId.FERALIGATR ]}, { 1: [ SpeciesId.MUDKIP ], 16: [ SpeciesId.MARSHTOMP ], 36: [ SpeciesId.SWAMPERT ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.TOTODILE ], 18: [ SpeciesId.CROCONAW ], 30: [ SpeciesId.FERALIGATR ] }, { 1: [ SpeciesId.MUDKIP ], 16: [ SpeciesId.MARSHTOMP ], 36: [ SpeciesId.SWAMPERT ] } ] }, [BiomePoolTier.SUPER_RARE]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.GALAR_SLOWPOKE ], 40: [ SpeciesId.GALAR_SLOWBRO ]}, { 1: [ SpeciesId.HISUI_SLIGGOO ], 80: [ SpeciesId.HISUI_GOODRA ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.GALAR_SLOWPOKE ], 40: [ SpeciesId.GALAR_SLOWBRO ]}, { 1: [ SpeciesId.HISUI_SLIGGOO ], 80: [ SpeciesId.HISUI_GOODRA ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.GALAR_SLOWPOKE ], 40: [ SpeciesId.GALAR_SLOWBRO ] }, { 1: [ SpeciesId.HISUI_SLIGGOO ], 80: [ SpeciesId.HISUI_GOODRA ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.GALAR_SLOWPOKE ], 40: [ SpeciesId.GALAR_SLOWBRO ] }, { 1: [ SpeciesId.HISUI_SLIGGOO ], 80: [ SpeciesId.HISUI_GOODRA ] } ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.POLITOED, SpeciesId.GALAR_STUNFISK ] }, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AZELF, SpeciesId.POIPOLE ]}, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AZELF, { 1: [ SpeciesId.POIPOLE ], 60: [ SpeciesId.NAGANADEL ] } ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.QUAGSIRE, SpeciesId.LUDICOLO ], [TimeOfDay.DAY]: [ SpeciesId.QUAGSIRE, SpeciesId.LUDICOLO ], @@ -505,22 +505,22 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FERALIGATR, SpeciesId.POLITOED, SpeciesId.SWAMPERT, SpeciesId.GALAR_STUNFISK ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AZELF, SpeciesId.NAGANADEL ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AZELF, { 1: [ SpeciesId.POIPOLE ], 60: [ SpeciesId.NAGANADEL ] } ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.BEACH]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.STARYU ], 30: [ SpeciesId.STARMIE ] } ], [TimeOfDay.DUSK]: [ SpeciesId.SHELLDER ], [TimeOfDay.NIGHT]: [ SpeciesId.SHELLDER ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.KRABBY ], 28: [ SpeciesId.KINGLER ]}, - { 1: [ SpeciesId.CORPHISH ], 30: [ SpeciesId.CRAWDAUNT ]}, - { 1: [ SpeciesId.DWEBBLE ], 34: [ SpeciesId.CRUSTLE ]}, - { 1: [ SpeciesId.BINACLE ], 39: [ SpeciesId.BARBARACLE ]}, - { 1: [ SpeciesId.MAREANIE ], 38: [ SpeciesId.TOXAPEX ]}, - { 1: [ SpeciesId.WIGLETT ], 26: [ SpeciesId.WUGTRIO ]} + { 1: [ SpeciesId.KRABBY ], 28: [ SpeciesId.KINGLER ] }, + { 1: [ SpeciesId.CORPHISH ], 30: [ SpeciesId.CRAWDAUNT ] }, + { 1: [ SpeciesId.DWEBBLE ], 34: [ SpeciesId.CRUSTLE ] }, + { 1: [ SpeciesId.BINACLE ], 39: [ SpeciesId.BARBARACLE ] }, + { 1: [ SpeciesId.MAREANIE ], 38: [ SpeciesId.TOXAPEX ] }, + { 1: [ SpeciesId.WIGLETT ], 26: [ SpeciesId.WUGTRIO ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -528,11 +528,11 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BURMY ], 20: [ SpeciesId.WORMADAM ]}, { 1: [ SpeciesId.CLAUNCHER ], 37: [ SpeciesId.CLAWITZER ]}, { 1: [ SpeciesId.SANDYGAST ], 42: [ SpeciesId.PALOSSAND ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BURMY ], 20: [ SpeciesId.WORMADAM ] }, { 1: [ SpeciesId.CLAUNCHER ], 37: [ SpeciesId.CLAWITZER ] }, { 1: [ SpeciesId.SANDYGAST ], 42: [ SpeciesId.PALOSSAND ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.QUAXLY ], 16: [ SpeciesId.QUAXWELL ], 36: [ SpeciesId.QUAQUAVAL ]}, SpeciesId.TATSUGIRI ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.TIRTOUGA ], 37: [ SpeciesId.CARRACOSTA ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CRESSELIA, SpeciesId.KELDEO, SpeciesId.TAPU_FINI ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.QUAXLY ], 16: [ SpeciesId.QUAXWELL ], 36: [ SpeciesId.QUAQUAVAL ] }, SpeciesId.TATSUGIRI ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.TIRTOUGA ], 37: [ SpeciesId.CARRACOSTA ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CRESSELIA, SpeciesId.KELDEO, SpeciesId.TAPU_FINI ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.STARMIE ], [TimeOfDay.DAY]: [ SpeciesId.STARMIE ], @@ -540,29 +540,29 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.CLOYSTER ], [TimeOfDay.ALL]: [ SpeciesId.KINGLER, SpeciesId.CRAWDAUNT, SpeciesId.WORMADAM, SpeciesId.CRUSTLE, SpeciesId.BARBARACLE, SpeciesId.CLAWITZER, SpeciesId.TOXAPEX, SpeciesId.PALOSSAND ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CARRACOSTA, SpeciesId.QUAQUAVAL ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CRESSELIA, SpeciesId.KELDEO, SpeciesId.TAPU_FINI ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CARRACOSTA, SpeciesId.QUAQUAVAL ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CRESSELIA, SpeciesId.KELDEO, SpeciesId.TAPU_FINI ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.LAKE]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ]}, { 1: [ SpeciesId.DUCKLETT ], 35: [ SpeciesId.SWANNA ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ]}, { 1: [ SpeciesId.DUCKLETT ], 35: [ SpeciesId.SWANNA ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.MARILL ], 18: [ SpeciesId.AZUMARILL ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.MARILL ], 18: [ SpeciesId.AZUMARILL ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ] }, { 1: [ SpeciesId.DUCKLETT ], 35: [ SpeciesId.SWANNA ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.LOTAD ], 14: [ SpeciesId.LOMBRE ] }, { 1: [ SpeciesId.DUCKLETT ], 35: [ SpeciesId.SWANNA ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.MARILL ], 18: [ SpeciesId.AZUMARILL ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.MARILL ], 18: [ SpeciesId.AZUMARILL ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.PSYDUCK ], 33: [ SpeciesId.GOLDUCK ]}, - { 1: [ SpeciesId.GOLDEEN ], 33: [ SpeciesId.SEAKING ]}, - { 1: [ SpeciesId.MAGIKARP ], 20: [ SpeciesId.GYARADOS ]}, - { 1: [ SpeciesId.CHEWTLE ], 22: [ SpeciesId.DREDNAW ]} + { 1: [ SpeciesId.PSYDUCK ], 33: [ SpeciesId.GOLDUCK ] }, + { 1: [ SpeciesId.GOLDEEN ], 33: [ SpeciesId.SEAKING ] }, + { 1: [ SpeciesId.MAGIKARP ], 20: [ SpeciesId.GYARADOS ] }, + { 1: [ SpeciesId.CHEWTLE ], 22: [ SpeciesId.DREDNAW ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.DEWPIDER ], 22: [ SpeciesId.ARAQUANID ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.DEWPIDER ], 22: [ SpeciesId.ARAQUANID ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.DEWPIDER ], 22: [ SpeciesId.ARAQUANID ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.DEWPIDER ], 22: [ SpeciesId.ARAQUANID ] } ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ]}, { 1: [ SpeciesId.WOOPER ], 20: [ SpeciesId.QUAGSIRE ]}, { 1: [ SpeciesId.SURSKIT ], 22: [ SpeciesId.MASQUERAIN ]}, SpeciesId.WISHIWASHI, SpeciesId.FLAMIGO ] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.SLOWPOKE ], 37: [ SpeciesId.SLOWBRO ] }, { 1: [ SpeciesId.WOOPER ], 20: [ SpeciesId.QUAGSIRE ] }, { 1: [ SpeciesId.SURSKIT ], 22: [ SpeciesId.MASQUERAIN ] }, SpeciesId.WISHIWASHI, SpeciesId.FLAMIGO ] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], @@ -570,14 +570,14 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.SQUIRTLE ], 16: [ SpeciesId.WARTORTLE ], 36: [ SpeciesId.BLASTOISE ]}, - { 1: [ SpeciesId.OSHAWOTT ], 17: [ SpeciesId.DEWOTT ], 36: [ SpeciesId.SAMUROTT ]}, - { 1: [ SpeciesId.FROAKIE ], 16: [ SpeciesId.FROGADIER ], 36: [ SpeciesId.GRENINJA ]}, - { 1: [ SpeciesId.SOBBLE ], 16: [ SpeciesId.DRIZZILE ], 35: [ SpeciesId.INTELEON ]} + { 1: [ SpeciesId.SQUIRTLE ], 16: [ SpeciesId.WARTORTLE ], 36: [ SpeciesId.BLASTOISE ] }, + { 1: [ SpeciesId.OSHAWOTT ], 17: [ SpeciesId.DEWOTT ], 36: [ SpeciesId.SAMUROTT ] }, + { 1: [ SpeciesId.FROAKIE ], 16: [ SpeciesId.FROGADIER ], 36: [ SpeciesId.GRENINJA ] }, + { 1: [ SpeciesId.SOBBLE ], 16: [ SpeciesId.DRIZZILE ], 35: [ SpeciesId.INTELEON ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VAPOREON, SpeciesId.SLOWKING ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SUICUNE, SpeciesId.MESPRIT ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.VAPOREON, SpeciesId.SLOWKING ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SUICUNE, SpeciesId.MESPRIT ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.SWANNA, SpeciesId.ARAQUANID ], [TimeOfDay.DAY]: [ SpeciesId.SWANNA, SpeciesId.ARAQUANID ], @@ -585,9 +585,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.AZUMARILL ], [TimeOfDay.ALL]: [ SpeciesId.GOLDUCK, SpeciesId.SLOWBRO, SpeciesId.SEAKING, SpeciesId.GYARADOS, SpeciesId.MASQUERAIN, SpeciesId.WISHIWASHI, SpeciesId.DREDNAW ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLASTOISE, SpeciesId.VAPOREON, SpeciesId.SLOWKING, SpeciesId.SAMUROTT, SpeciesId.GRENINJA, SpeciesId.INTELEON ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SUICUNE, SpeciesId.MESPRIT ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLASTOISE, SpeciesId.VAPOREON, SpeciesId.SLOWKING, SpeciesId.SAMUROTT, SpeciesId.GRENINJA, SpeciesId.INTELEON ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SUICUNE, SpeciesId.MESPRIT ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.SEABED]: { [BiomePoolTier.COMMON]: { @@ -596,12 +596,12 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.CHINCHOU ], 27: [ SpeciesId.LANTURN ]}, + { 1: [ SpeciesId.CHINCHOU ], 27: [ SpeciesId.LANTURN ] }, SpeciesId.REMORAID, SpeciesId.CLAMPERL, SpeciesId.BASCULIN, - { 1: [ SpeciesId.FRILLISH ], 40: [ SpeciesId.JELLICENT ]}, - { 1: [ SpeciesId.ARROKUDA ], 26: [ SpeciesId.BARRASKEWDA ]}, + { 1: [ SpeciesId.FRILLISH ], 40: [ SpeciesId.JELLICENT ] }, + { 1: [ SpeciesId.ARROKUDA ], 26: [ SpeciesId.BARRASKEWDA ] }, SpeciesId.VELUZA ] }, @@ -611,12 +611,12 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.TENTACOOL ], 30: [ SpeciesId.TENTACRUEL ]}, + { 1: [ SpeciesId.TENTACOOL ], 30: [ SpeciesId.TENTACRUEL ] }, SpeciesId.SHELLDER, - { 1: [ SpeciesId.WAILMER ], 40: [ SpeciesId.WAILORD ]}, + { 1: [ SpeciesId.WAILMER ], 40: [ SpeciesId.WAILORD ] }, SpeciesId.LUVDISC, - { 1: [ SpeciesId.SHELLOS ], 30: [ SpeciesId.GASTRODON ]}, - { 1: [ SpeciesId.SKRELP ], 48: [ SpeciesId.DRAGALGE ]}, + { 1: [ SpeciesId.SHELLOS ], 30: [ SpeciesId.GASTRODON ] }, + { 1: [ SpeciesId.SKRELP ], 48: [ SpeciesId.DRAGALGE ] }, SpeciesId.PINCURCHIN, SpeciesId.DONDOZO ] @@ -626,7 +626,7 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.QWILFISH, SpeciesId.CORSOLA, SpeciesId.OCTILLERY, { 1: [ SpeciesId.MANTYKE ], 52: [ SpeciesId.MANTINE ]}, SpeciesId.ALOMOMOLA, { 1: [ SpeciesId.TYNAMO ], 39: [ SpeciesId.EELEKTRIK ]}, SpeciesId.DHELMISE ] + [TimeOfDay.ALL]: [ SpeciesId.QWILFISH, SpeciesId.CORSOLA, SpeciesId.OCTILLERY, { 1: [ SpeciesId.MANTYKE ], 52: [ SpeciesId.MANTINE ] }, SpeciesId.ALOMOMOLA, { 1: [ SpeciesId.TYNAMO ], 39: [ SpeciesId.EELEKTRIK ] }, SpeciesId.DHELMISE ] }, [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], @@ -634,16 +634,16 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.OMANYTE ], 40: [ SpeciesId.OMASTAR ]}, - { 1: [ SpeciesId.KABUTO ], 40: [ SpeciesId.KABUTOPS ]}, + { 1: [ SpeciesId.OMANYTE ], 40: [ SpeciesId.OMASTAR ] }, + { 1: [ SpeciesId.KABUTO ], 40: [ SpeciesId.KABUTOPS ] }, SpeciesId.RELICANTH, SpeciesId.PYUKUMUKU, - { 1: [ SpeciesId.GALAR_CORSOLA ], 38: [ SpeciesId.CURSOLA ]}, + { 1: [ SpeciesId.GALAR_CORSOLA ], 38: [ SpeciesId.CURSOLA ] }, SpeciesId.ARCTOVISH, SpeciesId.HISUI_QWILFISH ] }, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FEEBAS, SpeciesId.NIHILEGO ]}, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FEEBAS, SpeciesId.NIHILEGO ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -658,56 +658,56 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.OMASTAR, SpeciesId.KABUTOPS, SpeciesId.RELICANTH, SpeciesId.EELEKTROSS, SpeciesId.PYUKUMUKU, SpeciesId.DHELMISE, SpeciesId.CURSOLA, SpeciesId.ARCTOVISH, SpeciesId.BASCULEGION, SpeciesId.OVERQWIL ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MILOTIC, SpeciesId.NIHILEGO ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KYOGRE ]} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MILOTIC, SpeciesId.NIHILEGO ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KYOGRE ] } }, [BiomeId.MOUNTAIN]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [ - { 1: [ SpeciesId.TAILLOW ], 22: [ SpeciesId.SWELLOW ]}, - { 1: [ SpeciesId.SWABLU ], 35: [ SpeciesId.ALTARIA ]}, - { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ]}, - { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ]}, - { 1: [ SpeciesId.FLETCHLING ], 17: [ SpeciesId.FLETCHINDER ], 35: [ SpeciesId.TALONFLAME ]} + { 1: [ SpeciesId.TAILLOW ], 22: [ SpeciesId.SWELLOW ] }, + { 1: [ SpeciesId.SWABLU ], 35: [ SpeciesId.ALTARIA ] }, + { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ] }, + { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ] }, + { 1: [ SpeciesId.FLETCHLING ], 17: [ SpeciesId.FLETCHINDER ], 35: [ SpeciesId.TALONFLAME ] } ], [TimeOfDay.DAY]: [ - { 1: [ SpeciesId.TAILLOW ], 22: [ SpeciesId.SWELLOW ]}, - { 1: [ SpeciesId.SWABLU ], 35: [ SpeciesId.ALTARIA ]}, - { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ]}, - { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ]}, - { 1: [ SpeciesId.FLETCHLING ], 17: [ SpeciesId.FLETCHINDER ], 35: [ SpeciesId.TALONFLAME ]} + { 1: [ SpeciesId.TAILLOW ], 22: [ SpeciesId.SWELLOW ] }, + { 1: [ SpeciesId.SWABLU ], 35: [ SpeciesId.ALTARIA ] }, + { 1: [ SpeciesId.STARLY ], 14: [ SpeciesId.STARAVIA ], 34: [ SpeciesId.STARAPTOR ] }, + { 1: [ SpeciesId.PIDOVE ], 21: [ SpeciesId.TRANQUILL ], 32: [ SpeciesId.UNFEZANT ] }, + { 1: [ SpeciesId.FLETCHLING ], 17: [ SpeciesId.FLETCHINDER ], 35: [ SpeciesId.TALONFLAME ] } ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ]}, { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ]}, { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ]}, { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ]}, { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.PIDGEY ], 18: [ SpeciesId.PIDGEOTTO ], 36: [ SpeciesId.PIDGEOT ]}, { 1: [ SpeciesId.SPEAROW ], 20: [ SpeciesId.FEAROW ]}, { 1: [ SpeciesId.SKIDDO ], 32: [ SpeciesId.GOGOAT ]}] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ] }, { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ] }, { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ] }, { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ] }, { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.PIDGEY ], 18: [ SpeciesId.PIDGEOTTO ], 36: [ SpeciesId.PIDGEOT ] }, { 1: [ SpeciesId.SPEAROW ], 20: [ SpeciesId.FEAROW ] }, { 1: [ SpeciesId.SKIDDO ], 32: [ SpeciesId.GOGOAT ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [ - { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ]}, - { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ]}, - { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ]}, - { 1: [ SpeciesId.RUFFLET ], 54: [ SpeciesId.BRAVIARY ]}, - { 1: [ SpeciesId.ROOKIDEE ], 18: [ SpeciesId.CORVISQUIRE ], 38: [ SpeciesId.CORVIKNIGHT ]}, - { 1: [ SpeciesId.FLITTLE ], 35: [ SpeciesId.ESPATHRA ]}, + { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ] }, + { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ] }, + { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ] }, + { 1: [ SpeciesId.RUFFLET ], 54: [ SpeciesId.BRAVIARY ] }, + { 1: [ SpeciesId.ROOKIDEE ], 18: [ SpeciesId.CORVISQUIRE ], 38: [ SpeciesId.CORVIKNIGHT ] }, + { 1: [ SpeciesId.FLITTLE ], 35: [ SpeciesId.ESPATHRA ] }, SpeciesId.BOMBIRDIER ], [TimeOfDay.DAY]: [ - { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ]}, - { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ]}, - { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ]}, - { 1: [ SpeciesId.RUFFLET ], 54: [ SpeciesId.BRAVIARY ]}, - { 1: [ SpeciesId.ROOKIDEE ], 18: [ SpeciesId.CORVISQUIRE ], 38: [ SpeciesId.CORVIKNIGHT ]}, - { 1: [ SpeciesId.FLITTLE ], 35: [ SpeciesId.ESPATHRA ]}, + { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ] }, + { 1: [ SpeciesId.ARON ], 32: [ SpeciesId.LAIRON ], 42: [ SpeciesId.AGGRON ] }, + { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ] }, + { 1: [ SpeciesId.RUFFLET ], 54: [ SpeciesId.BRAVIARY ] }, + { 1: [ SpeciesId.ROOKIDEE ], 18: [ SpeciesId.CORVISQUIRE ], 38: [ SpeciesId.CORVIKNIGHT ] }, + { 1: [ SpeciesId.FLITTLE ], 35: [ SpeciesId.ESPATHRA ] }, SpeciesId.BOMBIRDIER ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.VULLABY ], 54: [ SpeciesId.MANDIBUZZ ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.VULLABY ], 54: [ SpeciesId.MANDIBUZZ ]}], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.VULLABY ], 54: [ SpeciesId.MANDIBUZZ ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.VULLABY ], 54: [ SpeciesId.MANDIBUZZ ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.MACHOP ], 28: [ SpeciesId.MACHOKE ]}, - { 1: [ SpeciesId.GEODUDE ], 25: [ SpeciesId.GRAVELER ]}, - { 1: [ SpeciesId.NATU ], 25: [ SpeciesId.XATU ]}, - { 1: [ SpeciesId.SLUGMA ], 38: [ SpeciesId.MAGCARGO ]}, - { 1: [ SpeciesId.NACLI ], 24: [ SpeciesId.NACLSTACK ], 38: [ SpeciesId.GARGANACL ]} + { 1: [ SpeciesId.MACHOP ], 28: [ SpeciesId.MACHOKE ] }, + { 1: [ SpeciesId.GEODUDE ], 25: [ SpeciesId.GRAVELER ] }, + { 1: [ SpeciesId.NATU ], 25: [ SpeciesId.XATU ] }, + { 1: [ SpeciesId.SLUGMA ], 38: [ SpeciesId.MAGCARGO ] }, + { 1: [ SpeciesId.NACLI ], 24: [ SpeciesId.NACLSTACK ], 38: [ SpeciesId.GARGANACL ] } ] }, [BiomePoolTier.RARE]: { @@ -715,7 +715,7 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.MURKROW ], - [TimeOfDay.ALL]: [ SpeciesId.SKARMORY, { 1: [ SpeciesId.TORCHIC ], 16: [ SpeciesId.COMBUSKEN ], 36: [ SpeciesId.BLAZIKEN ]}, { 1: [ SpeciesId.SPOINK ], 32: [ SpeciesId.GRUMPIG ]}, SpeciesId.HAWLUCHA, SpeciesId.KLAWF ] + [TimeOfDay.ALL]: [ SpeciesId.SKARMORY, { 1: [ SpeciesId.TORCHIC ], 16: [ SpeciesId.COMBUSKEN ], 36: [ SpeciesId.BLAZIKEN ] }, { 1: [ SpeciesId.SPOINK ], 32: [ SpeciesId.GRUMPIG ] }, SpeciesId.HAWLUCHA, SpeciesId.KLAWF ] }, [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], @@ -723,16 +723,16 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.LARVITAR ], 30: [ SpeciesId.PUPITAR ]}, - { 1: [ SpeciesId.CRANIDOS ], 30: [ SpeciesId.RAMPARDOS ]}, - { 1: [ SpeciesId.SHIELDON ], 30: [ SpeciesId.BASTIODON ]}, - { 1: [ SpeciesId.GIBLE ], 24: [ SpeciesId.GABITE ], 48: [ SpeciesId.GARCHOMP ]}, + { 1: [ SpeciesId.LARVITAR ], 30: [ SpeciesId.PUPITAR ] }, + { 1: [ SpeciesId.CRANIDOS ], 30: [ SpeciesId.RAMPARDOS ] }, + { 1: [ SpeciesId.SHIELDON ], 30: [ SpeciesId.BASTIODON ] }, + { 1: [ SpeciesId.GIBLE ], 24: [ SpeciesId.GABITE ], 48: [ SpeciesId.GARCHOMP ] }, SpeciesId.ROTOM, SpeciesId.ARCHEOPS, - { 1: [ SpeciesId.AXEW ], 38: [ SpeciesId.FRAXURE ]} + { 1: [ SpeciesId.AXEW ], 38: [ SpeciesId.FRAXURE ] } ] }, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TORNADUS, SpeciesId.TING_LU, SpeciesId.OGERPON ]}, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TORNADUS, SpeciesId.TING_LU, SpeciesId.OGERPON ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.SWELLOW, SpeciesId.ALTARIA, SpeciesId.STARAPTOR, SpeciesId.UNFEZANT, SpeciesId.BRAVIARY, SpeciesId.TALONFLAME, SpeciesId.CORVIKNIGHT, SpeciesId.ESPATHRA ], [TimeOfDay.DAY]: [ SpeciesId.SWELLOW, SpeciesId.ALTARIA, SpeciesId.STARAPTOR, SpeciesId.UNFEZANT, SpeciesId.BRAVIARY, SpeciesId.TALONFLAME, SpeciesId.CORVIKNIGHT, SpeciesId.ESPATHRA ], @@ -740,39 +740,39 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.MANDIBUZZ ], [TimeOfDay.ALL]: [ SpeciesId.PIDGEOT, SpeciesId.FEAROW, SpeciesId.SKARMORY, SpeciesId.AGGRON, SpeciesId.GOGOAT, SpeciesId.GARGANACL ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.HISUI_BRAVIARY ], [TimeOfDay.DAY]: [ SpeciesId.HISUI_BRAVIARY ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLAZIKEN, SpeciesId.RAMPARDOS, SpeciesId.BASTIODON, SpeciesId.HAWLUCHA ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM, SpeciesId.TORNADUS, SpeciesId.TING_LU, SpeciesId.OGERPON ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HO_OH ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.HISUI_BRAVIARY ], [TimeOfDay.DAY]: [ SpeciesId.HISUI_BRAVIARY ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLAZIKEN, SpeciesId.RAMPARDOS, SpeciesId.BASTIODON, SpeciesId.HAWLUCHA ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM, SpeciesId.TORNADUS, SpeciesId.TING_LU, SpeciesId.OGERPON ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HO_OH ] } }, [BiomeId.BADLANDS]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.PHANPY ], 25: [ SpeciesId.DONPHAN ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.PHANPY ], 25: [ SpeciesId.DONPHAN ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.PHANPY ], 25: [ SpeciesId.DONPHAN ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.PHANPY ], 25: [ SpeciesId.DONPHAN ] } ], [TimeOfDay.DUSK]: [], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.CUBONE ], 28: [ SpeciesId.MAROWAK ]}], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.CUBONE ], 28: [ SpeciesId.MAROWAK ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.DIGLETT ], 26: [ SpeciesId.DUGTRIO ]}, - { 1: [ SpeciesId.GEODUDE ], 25: [ SpeciesId.GRAVELER ]}, - { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ]}, - { 1: [ SpeciesId.DRILBUR ], 31: [ SpeciesId.EXCADRILL ]}, - { 1: [ SpeciesId.MUDBRAY ], 30: [ SpeciesId.MUDSDALE ]} + { 1: [ SpeciesId.DIGLETT ], 26: [ SpeciesId.DUGTRIO ] }, + { 1: [ SpeciesId.GEODUDE ], 25: [ SpeciesId.GRAVELER ] }, + { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ] }, + { 1: [ SpeciesId.DRILBUR ], 31: [ SpeciesId.EXCADRILL ] }, + { 1: [ SpeciesId.MUDBRAY ], 30: [ SpeciesId.MUDSDALE ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.SIZZLIPEDE ], 28: [ SpeciesId.CENTISKORCH ]}, { 1: [ SpeciesId.CAPSAKID ], 30: [ SpeciesId.SCOVILLAIN ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.SIZZLIPEDE ], 28: [ SpeciesId.CENTISKORCH ]}, { 1: [ SpeciesId.CAPSAKID ], 30: [ SpeciesId.SCOVILLAIN ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.SIZZLIPEDE ], 28: [ SpeciesId.CENTISKORCH ] }, { 1: [ SpeciesId.CAPSAKID ], 30: [ SpeciesId.SCOVILLAIN ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.SIZZLIPEDE ], 28: [ SpeciesId.CENTISKORCH ] }, { 1: [ SpeciesId.CAPSAKID ], 30: [ SpeciesId.SCOVILLAIN ] } ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.SANDSHREW ], 22: [ SpeciesId.SANDSLASH ]}, - { 1: [ SpeciesId.NUMEL ], 33: [ SpeciesId.CAMERUPT ]}, - { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ]}, - { 1: [ SpeciesId.CUFANT ], 34: [ SpeciesId.COPPERAJAH ]} + { 1: [ SpeciesId.SANDSHREW ], 22: [ SpeciesId.SANDSLASH ] }, + { 1: [ SpeciesId.NUMEL ], 33: [ SpeciesId.CAMERUPT ] }, + { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ] }, + { 1: [ SpeciesId.CUFANT ], 34: [ SpeciesId.COPPERAJAH ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ONIX, SpeciesId.GLIGAR, { 1: [ SpeciesId.POLTCHAGEIST ], 30: [ SpeciesId.SINISTCHA ]}]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LANDORUS, SpeciesId.OKIDOGI ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ONIX, SpeciesId.GLIGAR, { 1: [ SpeciesId.POLTCHAGEIST ], 30: [ SpeciesId.SINISTCHA ] } ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LANDORUS, SpeciesId.OKIDOGI ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.DONPHAN, SpeciesId.CENTISKORCH, SpeciesId.SCOVILLAIN ], [TimeOfDay.DAY]: [ SpeciesId.DONPHAN, SpeciesId.CENTISKORCH, SpeciesId.SCOVILLAIN ], @@ -780,9 +780,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.MAROWAK ], [TimeOfDay.ALL]: [ SpeciesId.DUGTRIO, SpeciesId.GOLEM, SpeciesId.RHYPERIOR, SpeciesId.GLISCOR, SpeciesId.EXCADRILL, SpeciesId.MUDSDALE, SpeciesId.COPPERAJAH ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.STEELIX, SpeciesId.SINISTCHA ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LANDORUS, SpeciesId.OKIDOGI ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GROUDON ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.STEELIX, SpeciesId.SINISTCHA ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.LANDORUS, SpeciesId.OKIDOGI ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GROUDON ] } }, [BiomeId.CAVE]: { [BiomePoolTier.COMMON]: { @@ -791,27 +791,27 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.ZUBAT ], 22: [ SpeciesId.GOLBAT ]}, - { 1: [ SpeciesId.PARAS ], 24: [ SpeciesId.PARASECT ]}, - { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ]}, - { 1: [ SpeciesId.WHISMUR ], 20: [ SpeciesId.LOUDRED ], 40: [ SpeciesId.EXPLOUD ]}, - { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ]}, - { 1: [ SpeciesId.WOOBAT ], 20: [ SpeciesId.SWOOBAT ]}, - { 1: [ SpeciesId.BUNNELBY ], 20: [ SpeciesId.DIGGERSBY ]}, - { 1: [ SpeciesId.NACLI ], 24: [ SpeciesId.NACLSTACK ], 38: [ SpeciesId.GARGANACL ]} + { 1: [ SpeciesId.ZUBAT ], 22: [ SpeciesId.GOLBAT ] }, + { 1: [ SpeciesId.PARAS ], 24: [ SpeciesId.PARASECT ] }, + { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ] }, + { 1: [ SpeciesId.WHISMUR ], 20: [ SpeciesId.LOUDRED ], 40: [ SpeciesId.EXPLOUD ] }, + { 1: [ SpeciesId.ROGGENROLA ], 25: [ SpeciesId.BOLDORE ] }, + { 1: [ SpeciesId.WOOBAT ], 20: [ SpeciesId.SWOOBAT ] }, + { 1: [ SpeciesId.BUNNELBY ], 20: [ SpeciesId.DIGGERSBY ] }, + { 1: [ SpeciesId.NACLI ], 24: [ SpeciesId.NACLSTACK ], 38: [ SpeciesId.GARGANACL ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.ROCKRUFF ], 25: [ SpeciesId.LYCANROC ]}], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.ROCKRUFF ], 25: [ SpeciesId.LYCANROC ] } ], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.GEODUDE ], 25: [ SpeciesId.GRAVELER ]}, - { 1: [ SpeciesId.MAKUHITA ], 24: [ SpeciesId.HARIYAMA ]}, + { 1: [ SpeciesId.GEODUDE ], 25: [ SpeciesId.GRAVELER ] }, + { 1: [ SpeciesId.MAKUHITA ], 24: [ SpeciesId.HARIYAMA ] }, SpeciesId.NOSEPASS, - { 1: [ SpeciesId.NOIBAT ], 48: [ SpeciesId.NOIVERN ]}, - { 1: [ SpeciesId.WIMPOD ], 30: [ SpeciesId.GOLISOPOD ]} + { 1: [ SpeciesId.NOIBAT ], 48: [ SpeciesId.NOIVERN ] }, + { 1: [ SpeciesId.WIMPOD ], 30: [ SpeciesId.GOLISOPOD ] } ] }, [BiomePoolTier.RARE]: { @@ -819,10 +819,10 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.ONIX, { 1: [ SpeciesId.FERROSEED ], 40: [ SpeciesId.FERROTHORN ]}, SpeciesId.CARBINK, { 1: [ SpeciesId.GLIMMET ], 35: [ SpeciesId.GLIMMORA ]}] + [TimeOfDay.ALL]: [ SpeciesId.ONIX, { 1: [ SpeciesId.FERROSEED ], 40: [ SpeciesId.FERROTHORN ] }, SpeciesId.CARBINK, { 1: [ SpeciesId.GLIMMET ], 35: [ SpeciesId.GLIMMORA ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SHUCKLE ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UXIE ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SHUCKLE ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UXIE ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -830,34 +830,34 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.PARASECT, SpeciesId.ONIX, SpeciesId.CROBAT, SpeciesId.URSARING, SpeciesId.EXPLOUD, SpeciesId.PROBOPASS, SpeciesId.GIGALITH, SpeciesId.SWOOBAT, SpeciesId.DIGGERSBY, SpeciesId.NOIVERN, SpeciesId.GOLISOPOD, SpeciesId.GARGANACL ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.LYCANROC ], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SHUCKLE, SpeciesId.FERROTHORN, SpeciesId.GLIMMORA ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UXIE ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TERAPAGOS ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.LYCANROC ], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SHUCKLE, SpeciesId.FERROTHORN, SpeciesId.GLIMMORA ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UXIE ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TERAPAGOS ] } }, [BiomeId.DESERT]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [ SpeciesId.TRAPINCH, { 1: [ SpeciesId.HIPPOPOTAS ], 34: [ SpeciesId.HIPPOWDON ]}, { 1: [ SpeciesId.RELLOR ], 29: [ SpeciesId.RABSCA ]}], - [TimeOfDay.DAY]: [ SpeciesId.TRAPINCH, { 1: [ SpeciesId.HIPPOPOTAS ], 34: [ SpeciesId.HIPPOWDON ]}, { 1: [ SpeciesId.RELLOR ], 29: [ SpeciesId.RABSCA ]}], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.CACNEA ], 32: [ SpeciesId.CACTURNE ]}, { 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.CACNEA ], 32: [ SpeciesId.CACTURNE ]}, { 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.SANDSHREW ], 22: [ SpeciesId.SANDSLASH ]}, { 1: [ SpeciesId.SKORUPI ], 40: [ SpeciesId.DRAPION ]}, { 1: [ SpeciesId.SILICOBRA ], 36: [ SpeciesId.SANDACONDA ]}] + [TimeOfDay.DAWN]: [ SpeciesId.TRAPINCH, { 1: [ SpeciesId.HIPPOPOTAS ], 34: [ SpeciesId.HIPPOWDON ] }, { 1: [ SpeciesId.RELLOR ], 29: [ SpeciesId.RABSCA ] } ], + [TimeOfDay.DAY]: [ SpeciesId.TRAPINCH, { 1: [ SpeciesId.HIPPOPOTAS ], 34: [ SpeciesId.HIPPOWDON ] }, { 1: [ SpeciesId.RELLOR ], 29: [ SpeciesId.RABSCA ] } ], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.CACNEA ], 32: [ SpeciesId.CACTURNE ] }, { 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.CACNEA ], 32: [ SpeciesId.CACTURNE ] }, { 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.SANDSHREW ], 22: [ SpeciesId.SANDSLASH ] }, { 1: [ SpeciesId.SKORUPI ], 40: [ SpeciesId.DRAPION ] }, { 1: [ SpeciesId.SILICOBRA ], 36: [ SpeciesId.SANDACONDA ] } ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ]}, SpeciesId.HELIOPTILE ], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ]}, SpeciesId.HELIOPTILE ], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ] }, SpeciesId.HELIOPTILE ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.SANDILE ], 29: [ SpeciesId.KROKOROK ], 40: [ SpeciesId.KROOKODILE ] }, SpeciesId.HELIOPTILE ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.MARACTUS, { 1: [ SpeciesId.BRAMBLIN ], 30: [ SpeciesId.BRAMBLEGHAST ]}, SpeciesId.ORTHWORM ] + [TimeOfDay.ALL]: [ SpeciesId.MARACTUS, { 1: [ SpeciesId.BRAMBLIN ], 30: [ SpeciesId.BRAMBLEGHAST ] }, SpeciesId.ORTHWORM ] }, [BiomePoolTier.RARE]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.VIBRAVA ], 45: [ SpeciesId.FLYGON ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.VIBRAVA ], 45: [ SpeciesId.FLYGON ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.VIBRAVA ], 45: [ SpeciesId.FLYGON ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.VIBRAVA ], 45: [ SpeciesId.FLYGON ] } ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.DARUMAKA ], 35: [ SpeciesId.DARMANITAN ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.DARUMAKA ], 35: [ SpeciesId.DARMANITAN ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.LILEEP ], 40: [ SpeciesId.CRADILY ]}, { 1: [ SpeciesId.ANORITH ], 40: [ SpeciesId.ARMALDO ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIROCK, SpeciesId.TAPU_BULU, SpeciesId.PHEROMOSA ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.LILEEP ], 40: [ SpeciesId.CRADILY ] }, { 1: [ SpeciesId.ANORITH ], 40: [ SpeciesId.ARMALDO ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIROCK, SpeciesId.TAPU_BULU, SpeciesId.PHEROMOSA ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.HIPPOWDON, SpeciesId.HELIOLISK, SpeciesId.RABSCA ], [TimeOfDay.DAY]: [ SpeciesId.HIPPOWDON, SpeciesId.HELIOLISK, SpeciesId.RABSCA ], @@ -865,9 +865,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.CACTURNE, SpeciesId.KROOKODILE ], [TimeOfDay.ALL]: [ SpeciesId.SANDSLASH, SpeciesId.DRAPION, SpeciesId.DARMANITAN, SpeciesId.MARACTUS, SpeciesId.SANDACONDA, SpeciesId.BRAMBLEGHAST ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CRADILY, SpeciesId.ARMALDO ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIROCK, SpeciesId.TAPU_BULU, SpeciesId.PHEROMOSA ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CRADILY, SpeciesId.ARMALDO ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIROCK, SpeciesId.TAPU_BULU, SpeciesId.PHEROMOSA ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.ICE_CAVE]: { [BiomePoolTier.COMMON]: { @@ -876,14 +876,14 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.SEEL ], 34: [ SpeciesId.DEWGONG ]}, - { 1: [ SpeciesId.SWINUB ], 33: [ SpeciesId.PILOSWINE ]}, - { 1: [ SpeciesId.SNOVER ], 40: [ SpeciesId.ABOMASNOW ]}, - { 1: [ SpeciesId.VANILLITE ], 35: [ SpeciesId.VANILLISH ], 47: [ SpeciesId.VANILLUXE ]}, - { 1: [ SpeciesId.CUBCHOO ], 37: [ SpeciesId.BEARTIC ]}, - { 1: [ SpeciesId.BERGMITE ], 37: [ SpeciesId.AVALUGG ]}, + { 1: [ SpeciesId.SEEL ], 34: [ SpeciesId.DEWGONG ] }, + { 1: [ SpeciesId.SWINUB ], 33: [ SpeciesId.PILOSWINE ] }, + { 1: [ SpeciesId.SNOVER ], 40: [ SpeciesId.ABOMASNOW ] }, + { 1: [ SpeciesId.VANILLITE ], 35: [ SpeciesId.VANILLISH ], 47: [ SpeciesId.VANILLUXE ] }, + { 1: [ SpeciesId.CUBCHOO ], 37: [ SpeciesId.BEARTIC ] }, + { 1: [ SpeciesId.BERGMITE ], 37: [ SpeciesId.AVALUGG ] }, SpeciesId.CRABRAWLER, - { 1: [ SpeciesId.SNOM ], 20: [ SpeciesId.FROSMOTH ]} + { 1: [ SpeciesId.SNOM ], 20: [ SpeciesId.FROSMOTH ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -893,15 +893,15 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SNEASEL, - { 1: [ SpeciesId.SNORUNT ], 42: [ SpeciesId.GLALIE ]}, - { 1: [ SpeciesId.SPHEAL ], 32: [ SpeciesId.SEALEO ], 44: [ SpeciesId.WALREIN ]}, + { 1: [ SpeciesId.SNORUNT ], 42: [ SpeciesId.GLALIE ] }, + { 1: [ SpeciesId.SPHEAL ], 32: [ SpeciesId.SEALEO ], 44: [ SpeciesId.WALREIN ] }, SpeciesId.EISCUE, - { 1: [ SpeciesId.CETODDLE ], 30: [ SpeciesId.CETITAN ]} + { 1: [ SpeciesId.CETODDLE ], 30: [ SpeciesId.CETITAN ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JYNX, SpeciesId.LAPRAS, SpeciesId.FROSLASS, SpeciesId.CRYOGONAL ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DELIBIRD, SpeciesId.ROTOM, { 1: [ SpeciesId.AMAURA ], 59: [ SpeciesId.AURORUS ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ARTICUNO, SpeciesId.REGICE ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JYNX, SpeciesId.LAPRAS, SpeciesId.FROSLASS, SpeciesId.CRYOGONAL ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DELIBIRD, SpeciesId.ROTOM, { 1: [ SpeciesId.AMAURA ], 39: [ SpeciesId.AURORUS ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ARTICUNO, SpeciesId.REGICE ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -909,46 +909,46 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DEWGONG, SpeciesId.GLALIE, SpeciesId.WALREIN, SpeciesId.WEAVILE, SpeciesId.MAMOSWINE, SpeciesId.FROSLASS, SpeciesId.VANILLUXE, SpeciesId.BEARTIC, SpeciesId.CRYOGONAL, SpeciesId.AVALUGG, SpeciesId.CRABOMINABLE, SpeciesId.CETITAN ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JYNX, SpeciesId.LAPRAS, SpeciesId.GLACEON, SpeciesId.AURORUS ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ARTICUNO, SpeciesId.REGICE, SpeciesId.ROTOM ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KYUREM ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JYNX, SpeciesId.LAPRAS, SpeciesId.GLACEON, SpeciesId.AURORUS ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ARTICUNO, SpeciesId.REGICE, SpeciesId.ROTOM ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KYUREM ] } }, [BiomeId.MEADOW]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.LEDYBA ], 18: [ SpeciesId.LEDIAN ]}, SpeciesId.ROSELIA, SpeciesId.COTTONEE, SpeciesId.MINCCINO ], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.LEDYBA ], 18: [ SpeciesId.LEDIAN ] }, SpeciesId.ROSELIA, SpeciesId.COTTONEE, SpeciesId.MINCCINO ], [TimeOfDay.DAY]: [ SpeciesId.ROSELIA, SpeciesId.COTTONEE, SpeciesId.MINCCINO ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.BLITZLE ], 27: [ SpeciesId.ZEBSTRIKA ]}, - { 1: [ SpeciesId.FLABEBE ], 19: [ SpeciesId.FLOETTE ]}, - { 1: [ SpeciesId.CUTIEFLY ], 25: [ SpeciesId.RIBOMBEE ]}, - { 1: [ SpeciesId.GOSSIFLEUR ], 20: [ SpeciesId.ELDEGOSS ]}, - { 1: [ SpeciesId.WOOLOO ], 24: [ SpeciesId.DUBWOOL ]} + { 1: [ SpeciesId.BLITZLE ], 27: [ SpeciesId.ZEBSTRIKA ] }, + { 1: [ SpeciesId.FLABEBE ], 19: [ SpeciesId.FLOETTE ] }, + { 1: [ SpeciesId.CUTIEFLY ], 25: [ SpeciesId.RIBOMBEE ] }, + { 1: [ SpeciesId.GOSSIFLEUR ], 20: [ SpeciesId.ELDEGOSS ] }, + { 1: [ SpeciesId.WOOLOO ], 24: [ SpeciesId.DUBWOOL ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [ - { 1: [ SpeciesId.PONYTA ], 40: [ SpeciesId.RAPIDASH ]}, - { 1: [ SpeciesId.SNUBBULL ], 23: [ SpeciesId.GRANBULL ]}, - { 1: [ SpeciesId.SKITTY ], 30: [ SpeciesId.DELCATTY ]}, + { 1: [ SpeciesId.PONYTA ], 40: [ SpeciesId.RAPIDASH ] }, + { 1: [ SpeciesId.SNUBBULL ], 23: [ SpeciesId.GRANBULL ] }, + { 1: [ SpeciesId.SKITTY ], 30: [ SpeciesId.DELCATTY ] }, SpeciesId.BOUFFALANT, - { 1: [ SpeciesId.SMOLIV ], 25: [ SpeciesId.DOLLIV ], 35: [ SpeciesId.ARBOLIVA ]} + { 1: [ SpeciesId.SMOLIV ], 25: [ SpeciesId.DOLLIV ], 35: [ SpeciesId.ARBOLIVA ] } ], [TimeOfDay.DAY]: [ - { 1: [ SpeciesId.PONYTA ], 40: [ SpeciesId.RAPIDASH ]}, - { 1: [ SpeciesId.SNUBBULL ], 23: [ SpeciesId.GRANBULL ]}, - { 1: [ SpeciesId.SKITTY ], 30: [ SpeciesId.DELCATTY ]}, + { 1: [ SpeciesId.PONYTA ], 40: [ SpeciesId.RAPIDASH ] }, + { 1: [ SpeciesId.SNUBBULL ], 23: [ SpeciesId.GRANBULL ] }, + { 1: [ SpeciesId.SKITTY ], 30: [ SpeciesId.DELCATTY ] }, SpeciesId.BOUFFALANT, - { 1: [ SpeciesId.SMOLIV ], 25: [ SpeciesId.DOLLIV ], 35: [ SpeciesId.ARBOLIVA ]} + { 1: [ SpeciesId.SMOLIV ], 25: [ SpeciesId.DOLLIV ], 35: [ SpeciesId.ARBOLIVA ] } ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.JIGGLYPUFF ], 30: [ SpeciesId.WIGGLYTUFF ]}, - { 1: [ SpeciesId.MAREEP ], 15: [ SpeciesId.FLAAFFY ], 30: [ SpeciesId.AMPHAROS ]}, - { 1: [ SpeciesId.RALTS ], 20: [ SpeciesId.KIRLIA ], 30: [ SpeciesId.GARDEVOIR ]}, - { 1: [ SpeciesId.GLAMEOW ], 38: [ SpeciesId.PURUGLY ]}, + { 1: [ SpeciesId.JIGGLYPUFF ], 30: [ SpeciesId.WIGGLYTUFF ] }, + { 1: [ SpeciesId.MAREEP ], 15: [ SpeciesId.FLAAFFY ], 30: [ SpeciesId.AMPHAROS ] }, + { 1: [ SpeciesId.RALTS ], 20: [ SpeciesId.KIRLIA ], 30: [ SpeciesId.GARDEVOIR ] }, + { 1: [ SpeciesId.GLAMEOW ], 38: [ SpeciesId.PURUGLY ] }, SpeciesId.ORICORIO ] }, @@ -957,10 +957,10 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.VOLBEAT, SpeciesId.ILLUMISE ], - [TimeOfDay.ALL]: [ SpeciesId.TAUROS, SpeciesId.EEVEE, SpeciesId.MILTANK, SpeciesId.SPINDA, { 1: [ SpeciesId.APPLIN ], 30: [ SpeciesId.DIPPLIN ]}, { 1: [ SpeciesId.SPRIGATITO ], 16: [ SpeciesId.FLORAGATO ], 36: [ SpeciesId.MEOWSCARADA ]}] + [TimeOfDay.ALL]: [ SpeciesId.TAUROS, SpeciesId.EEVEE, SpeciesId.MILTANK, SpeciesId.SPINDA, { 1: [ SpeciesId.APPLIN ], 30: [ SpeciesId.DIPPLIN ] }, { 1: [ SpeciesId.SPRIGATITO ], 16: [ SpeciesId.FLORAGATO ], 36: [ SpeciesId.MEOWSCARADA ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CHANSEY, SpeciesId.SYLVEON ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MELOETTA ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CHANSEY, SpeciesId.SYLVEON ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MELOETTA ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.LEDIAN, SpeciesId.GRANBULL, SpeciesId.DELCATTY, SpeciesId.ROSERADE, SpeciesId.CINCCINO, SpeciesId.BOUFFALANT, SpeciesId.ARBOLIVA ], [TimeOfDay.DAY]: [ SpeciesId.GRANBULL, SpeciesId.DELCATTY, SpeciesId.ROSERADE, SpeciesId.CINCCINO, SpeciesId.BOUFFALANT, SpeciesId.ARBOLIVA ], @@ -968,9 +968,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TAUROS, SpeciesId.MILTANK, SpeciesId.GARDEVOIR, SpeciesId.PURUGLY, SpeciesId.ZEBSTRIKA, SpeciesId.FLORGES, SpeciesId.RIBOMBEE, SpeciesId.DUBWOOL ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.HISUI_LILLIGANT ], [TimeOfDay.DAY]: [ SpeciesId.HISUI_LILLIGANT ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLISSEY, SpeciesId.SYLVEON, SpeciesId.FLAPPLE, SpeciesId.APPLETUN, SpeciesId.MEOWSCARADA, SpeciesId.HYDRAPPLE ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MELOETTA ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SHAYMIN ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.HISUI_LILLIGANT ], [TimeOfDay.DAY]: [ SpeciesId.HISUI_LILLIGANT ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLISSEY, SpeciesId.SYLVEON, SpeciesId.FLAPPLE, SpeciesId.APPLETUN, SpeciesId.MEOWSCARADA, SpeciesId.HYDRAPPLE ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MELOETTA ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SHAYMIN ] } }, [BiomeId.POWER_PLANT]: { [BiomePoolTier.COMMON]: { @@ -980,20 +980,20 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.PIKACHU, - { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ]}, - { 1: [ SpeciesId.VOLTORB ], 30: [ SpeciesId.ELECTRODE ]}, - { 1: [ SpeciesId.ELECTRIKE ], 26: [ SpeciesId.MANECTRIC ]}, - { 1: [ SpeciesId.SHINX ], 15: [ SpeciesId.LUXIO ], 30: [ SpeciesId.LUXRAY ]}, + { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ] }, + { 1: [ SpeciesId.VOLTORB ], 30: [ SpeciesId.ELECTRODE ] }, + { 1: [ SpeciesId.ELECTRIKE ], 26: [ SpeciesId.MANECTRIC ] }, + { 1: [ SpeciesId.SHINX ], 15: [ SpeciesId.LUXIO ], 30: [ SpeciesId.LUXRAY ] }, SpeciesId.DEDENNE, - { 1: [ SpeciesId.GRUBBIN ], 20: [ SpeciesId.CHARJABUG ]}, - { 1: [ SpeciesId.PAWMI ], 18: [ SpeciesId.PAWMO ], 32: [ SpeciesId.PAWMOT ]}, - { 1: [ SpeciesId.TADBULB ], 30: [ SpeciesId.BELLIBOLT ]} + { 1: [ SpeciesId.GRUBBIN ], 20: [ SpeciesId.CHARJABUG ] }, + { 1: [ SpeciesId.PAWMI ], 18: [ SpeciesId.PAWMO ], 32: [ SpeciesId.PAWMOT ] }, + { 1: [ SpeciesId.TADBULB ], 30: [ SpeciesId.BELLIBOLT ] } ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ELECTABUZZ, SpeciesId.PLUSLE, SpeciesId.MINUN, SpeciesId.PACHIRISU, SpeciesId.EMOLGA, SpeciesId.TOGEDEMARU ]}, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.MAREEP ], 15: [ SpeciesId.FLAAFFY ]}]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JOLTEON, SpeciesId.HISUI_VOLTORB ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.RAIKOU, SpeciesId.THUNDURUS, SpeciesId.XURKITREE, SpeciesId.ZERAORA, SpeciesId.REGIELEKI ]}, + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ELECTABUZZ, SpeciesId.PLUSLE, SpeciesId.MINUN, SpeciesId.PACHIRISU, SpeciesId.EMOLGA, SpeciesId.TOGEDEMARU ] }, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.MAREEP ], 15: [ SpeciesId.FLAAFFY ] } ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JOLTEON, SpeciesId.HISUI_VOLTORB ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.RAIKOU, SpeciesId.THUNDURUS, SpeciesId.XURKITREE, SpeciesId.ZERAORA, SpeciesId.REGIELEKI ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -1001,9 +1001,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.RAICHU, SpeciesId.MANECTRIC, SpeciesId.LUXRAY, SpeciesId.MAGNEZONE, SpeciesId.ELECTIVIRE, SpeciesId.DEDENNE, SpeciesId.VIKAVOLT, SpeciesId.TOGEDEMARU, SpeciesId.PAWMOT, SpeciesId.BELLIBOLT ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JOLTEON, SpeciesId.AMPHAROS, SpeciesId.HISUI_ELECTRODE ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZAPDOS, SpeciesId.RAIKOU, SpeciesId.THUNDURUS, SpeciesId.XURKITREE, SpeciesId.ZERAORA, SpeciesId.REGIELEKI ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZEKROM ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.JOLTEON, SpeciesId.AMPHAROS, SpeciesId.HISUI_ELECTRODE ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZAPDOS, SpeciesId.RAIKOU, SpeciesId.THUNDURUS, SpeciesId.XURKITREE, SpeciesId.ZERAORA, SpeciesId.REGIELEKI ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZEKROM ] } }, [BiomeId.VOLCANO]: { [BiomePoolTier.COMMON]: { @@ -1014,32 +1014,32 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.ALL]: [ SpeciesId.VULPIX, SpeciesId.GROWLITHE, - { 1: [ SpeciesId.PONYTA ], 40: [ SpeciesId.RAPIDASH ]}, - { 1: [ SpeciesId.SLUGMA ], 38: [ SpeciesId.MAGCARGO ]}, - { 1: [ SpeciesId.NUMEL ], 33: [ SpeciesId.CAMERUPT ]}, - { 1: [ SpeciesId.SALANDIT ], 33: [ SpeciesId.SALAZZLE ]}, - { 1: [ SpeciesId.ROLYCOLY ], 18: [ SpeciesId.CARKOL ], 34: [ SpeciesId.COALOSSAL ]} + { 1: [ SpeciesId.PONYTA ], 40: [ SpeciesId.RAPIDASH ] }, + { 1: [ SpeciesId.SLUGMA ], 38: [ SpeciesId.MAGCARGO ] }, + { 1: [ SpeciesId.NUMEL ], 33: [ SpeciesId.CAMERUPT ] }, + { 1: [ SpeciesId.SALANDIT ], 33: [ SpeciesId.SALAZZLE ] }, + { 1: [ SpeciesId.ROLYCOLY ], 18: [ SpeciesId.CARKOL ], 34: [ SpeciesId.COALOSSAL ] } ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MAGMAR, SpeciesId.TORKOAL, { 1: [ SpeciesId.PANSEAR ], 30: [ SpeciesId.SIMISEAR ]}, SpeciesId.HEATMOR, SpeciesId.TURTONATOR ]}, + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MAGMAR, SpeciesId.TORKOAL, { 1: [ SpeciesId.PANSEAR ], 30: [ SpeciesId.SIMISEAR ] }, SpeciesId.HEATMOR, SpeciesId.TURTONATOR ] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.CHARMANDER ], 16: [ SpeciesId.CHARMELEON ], 36: [ SpeciesId.CHARIZARD ]}, - { 1: [ SpeciesId.CYNDAQUIL ], 14: [ SpeciesId.QUILAVA ], 36: [ SpeciesId.TYPHLOSION ]}, - { 1: [ SpeciesId.CHIMCHAR ], 14: [ SpeciesId.MONFERNO ], 36: [ SpeciesId.INFERNAPE ]}, - { 1: [ SpeciesId.TEPIG ], 17: [ SpeciesId.PIGNITE ], 36: [ SpeciesId.EMBOAR ]}, - { 1: [ SpeciesId.FENNEKIN ], 16: [ SpeciesId.BRAIXEN ], 36: [ SpeciesId.DELPHOX ]}, - { 1: [ SpeciesId.LITTEN ], 17: [ SpeciesId.TORRACAT ], 34: [ SpeciesId.INCINEROAR ]}, - { 1: [ SpeciesId.SCORBUNNY ], 16: [ SpeciesId.RABOOT ], 35: [ SpeciesId.CINDERACE ]}, - { 1: [ SpeciesId.CHARCADET ], 30: [ SpeciesId.ARMAROUGE ]} + { 1: [ SpeciesId.CHARMANDER ], 16: [ SpeciesId.CHARMELEON ], 36: [ SpeciesId.CHARIZARD ] }, + { 1: [ SpeciesId.CYNDAQUIL ], 14: [ SpeciesId.QUILAVA ], 36: [ SpeciesId.TYPHLOSION ] }, + { 1: [ SpeciesId.CHIMCHAR ], 14: [ SpeciesId.MONFERNO ], 36: [ SpeciesId.INFERNAPE ] }, + { 1: [ SpeciesId.TEPIG ], 17: [ SpeciesId.PIGNITE ], 36: [ SpeciesId.EMBOAR ] }, + { 1: [ SpeciesId.FENNEKIN ], 16: [ SpeciesId.BRAIXEN ], 36: [ SpeciesId.DELPHOX ] }, + { 1: [ SpeciesId.LITTEN ], 17: [ SpeciesId.TORRACAT ], 34: [ SpeciesId.INCINEROAR ] }, + { 1: [ SpeciesId.SCORBUNNY ], 16: [ SpeciesId.RABOOT ], 35: [ SpeciesId.CINDERACE ] }, + { 1: [ SpeciesId.CHARCADET ], 30: [ SpeciesId.ARMAROUGE ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FLAREON, SpeciesId.ROTOM, { 1: [ SpeciesId.LARVESTA ], 59: [ SpeciesId.VOLCARONA ]}, SpeciesId.HISUI_GROWLITHE ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ENTEI, SpeciesId.HEATRAN, SpeciesId.VOLCANION, SpeciesId.CHI_YU ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.FLAREON, SpeciesId.ROTOM, { 1: [ SpeciesId.LARVESTA ], 59: [ SpeciesId.VOLCARONA ] }, SpeciesId.HISUI_GROWLITHE ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ENTEI, SpeciesId.HEATRAN, SpeciesId.VOLCANION, SpeciesId.CHI_YU ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -1054,8 +1054,8 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CHARIZARD, SpeciesId.FLAREON, SpeciesId.TYPHLOSION, SpeciesId.INFERNAPE, SpeciesId.EMBOAR, SpeciesId.VOLCARONA, SpeciesId.DELPHOX, SpeciesId.INCINEROAR, SpeciesId.CINDERACE, SpeciesId.ARMAROUGE, SpeciesId.HISUI_ARCANINE ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MOLTRES, SpeciesId.ENTEI, SpeciesId.ROTOM, SpeciesId.HEATRAN, SpeciesId.VOLCANION, SpeciesId.CHI_YU ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.RESHIRAM ]} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MOLTRES, SpeciesId.ENTEI, SpeciesId.ROTOM, SpeciesId.HEATRAN, SpeciesId.VOLCANION, SpeciesId.CHI_YU ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.RESHIRAM ] } }, [BiomeId.GRAVEYARD]: { [BiomePoolTier.COMMON]: { @@ -1064,14 +1064,14 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.GASTLY ], 25: [ SpeciesId.HAUNTER ]}, - { 1: [ SpeciesId.SHUPPET ], 37: [ SpeciesId.BANETTE ]}, - { 1: [ SpeciesId.DUSKULL ], 37: [ SpeciesId.DUSCLOPS ]}, - { 1: [ SpeciesId.DRIFLOON ], 28: [ SpeciesId.DRIFBLIM ]}, - { 1: [ SpeciesId.LITWICK ], 41: [ SpeciesId.LAMPENT ]}, + { 1: [ SpeciesId.GASTLY ], 25: [ SpeciesId.HAUNTER ] }, + { 1: [ SpeciesId.SHUPPET ], 37: [ SpeciesId.BANETTE ] }, + { 1: [ SpeciesId.DUSKULL ], 37: [ SpeciesId.DUSCLOPS ] }, + { 1: [ SpeciesId.DRIFLOON ], 28: [ SpeciesId.DRIFBLIM ] }, + { 1: [ SpeciesId.LITWICK ], 41: [ SpeciesId.LAMPENT ] }, SpeciesId.PHANTUMP, SpeciesId.PUMPKABOO, - { 1: [ SpeciesId.GREAVARD ], 60: [ SpeciesId.HOUNDSTONE ]} + { 1: [ SpeciesId.GREAVARD ], 30: [ SpeciesId.HOUNDSTONE ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1079,11 +1079,11 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.CUBONE ], 28: [ SpeciesId.MAROWAK ]}, { 1: [ SpeciesId.YAMASK ], 34: [ SpeciesId.COFAGRIGUS ]}, { 1: [ SpeciesId.SINISTEA ], 30: [ SpeciesId.POLTEAGEIST ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.CUBONE ], 28: [ SpeciesId.MAROWAK ] }, { 1: [ SpeciesId.YAMASK ], 34: [ SpeciesId.COFAGRIGUS ] }, { 1: [ SpeciesId.SINISTEA ], 30: [ SpeciesId.POLTEAGEIST ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MISDREAVUS, SpeciesId.MIMIKYU, { 1: [ SpeciesId.FUECOCO ], 16: [ SpeciesId.CROCALOR ], 36: [ SpeciesId.SKELEDIRGE ]}, SpeciesId.CERULEDGE ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SPIRITOMB ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MARSHADOW, SpeciesId.SPECTRIER ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MISDREAVUS, SpeciesId.MIMIKYU, { 1: [ SpeciesId.FUECOCO ], 16: [ SpeciesId.CROCALOR ], 36: [ SpeciesId.SKELEDIRGE ] }, SpeciesId.CERULEDGE ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SPIRITOMB ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MARSHADOW, SpeciesId.SPECTRIER ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.MAROWAK ], [TimeOfDay.DAY]: [ SpeciesId.MAROWAK ], @@ -1091,9 +1091,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GENGAR, SpeciesId.BANETTE, SpeciesId.DRIFBLIM, SpeciesId.MISMAGIUS, SpeciesId.DUSKNOIR, SpeciesId.CHANDELURE, SpeciesId.TREVENANT, SpeciesId.GOURGEIST, SpeciesId.MIMIKYU, SpeciesId.POLTEAGEIST, SpeciesId.HOUNDSTONE ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SKELEDIRGE, SpeciesId.CERULEDGE, SpeciesId.HISUI_TYPHLOSION ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MARSHADOW, SpeciesId.SPECTRIER ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GIRATINA ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.SKELEDIRGE, SpeciesId.CERULEDGE, SpeciesId.HISUI_TYPHLOSION ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MARSHADOW, SpeciesId.SPECTRIER ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GIRATINA ] } }, [BiomeId.DOJO]: { [BiomePoolTier.COMMON]: { @@ -1102,11 +1102,11 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.MANKEY ], 28: [ SpeciesId.PRIMEAPE ], 75: [ SpeciesId.ANNIHILAPE ]}, - { 1: [ SpeciesId.MAKUHITA ], 24: [ SpeciesId.HARIYAMA ]}, - { 1: [ SpeciesId.MEDITITE ], 37: [ SpeciesId.MEDICHAM ]}, - { 1: [ SpeciesId.STUFFUL ], 27: [ SpeciesId.BEWEAR ]}, - { 1: [ SpeciesId.CLOBBOPUS ], 55: [ SpeciesId.GRAPPLOCT ]} + { 1: [ SpeciesId.MANKEY ], 28: [ SpeciesId.PRIMEAPE ], 75: [ SpeciesId.ANNIHILAPE ] }, + { 1: [ SpeciesId.MAKUHITA ], 24: [ SpeciesId.HARIYAMA ] }, + { 1: [ SpeciesId.MEDITITE ], 37: [ SpeciesId.MEDICHAM ] }, + { 1: [ SpeciesId.STUFFUL ], 27: [ SpeciesId.BEWEAR ] }, + { 1: [ SpeciesId.CLOBBOPUS ], 35: [ SpeciesId.GRAPPLOCT ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1114,11 +1114,11 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.CROAGUNK ], 37: [ SpeciesId.TOXICROAK ]}, { 1: [ SpeciesId.SCRAGGY ], 39: [ SpeciesId.SCRAFTY ]}, { 1: [ SpeciesId.MIENFOO ], 50: [ SpeciesId.MIENSHAO ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.CROAGUNK ], 37: [ SpeciesId.TOXICROAK ] }, { 1: [ SpeciesId.SCRAGGY ], 39: [ SpeciesId.SCRAFTY ] }, { 1: [ SpeciesId.MIENFOO ], 50: [ SpeciesId.MIENSHAO ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.LUCARIO, SpeciesId.THROH, SpeciesId.SAWK, { 1: [ SpeciesId.PANCHAM ], 52: [ SpeciesId.PANGORO ]}]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONTOP, SpeciesId.GALLADE, SpeciesId.GALAR_FARFETCHD ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TERRAKION, SpeciesId.KUBFU, SpeciesId.GALAR_ZAPDOS ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.LUCARIO, SpeciesId.THROH, SpeciesId.SAWK, { 1: [ SpeciesId.PANCHAM ], 52: [ SpeciesId.PANGORO ] } ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONTOP, SpeciesId.GALLADE, SpeciesId.GALAR_FARFETCHD ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TERRAKION, { 1: [ SpeciesId.KUBFU ], 60: [ SpeciesId.URSHIFU] }, SpeciesId.GALAR_ZAPDOS ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -1126,9 +1126,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.HARIYAMA, SpeciesId.MEDICHAM, SpeciesId.LUCARIO, SpeciesId.TOXICROAK, SpeciesId.THROH, SpeciesId.SAWK, SpeciesId.SCRAFTY, SpeciesId.MIENSHAO, SpeciesId.BEWEAR, SpeciesId.GRAPPLOCT, SpeciesId.ANNIHILAPE ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONTOP, SpeciesId.GALLADE, SpeciesId.PANGORO, SpeciesId.SIRFETCHD, SpeciesId.HISUI_DECIDUEYE ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TERRAKION, SpeciesId.URSHIFU ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZAMAZENTA, SpeciesId.GALAR_ZAPDOS ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HITMONTOP, SpeciesId.GALLADE, SpeciesId.PANGORO, SpeciesId.SIRFETCHD, SpeciesId.HISUI_DECIDUEYE ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TERRAKION, { 1: [ SpeciesId.KUBFU ], 60: [ SpeciesId.URSHIFU] } ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZAMAZENTA, SpeciesId.GALAR_ZAPDOS ] } }, [BiomeId.FACTORY]: { [BiomePoolTier.COMMON]: { @@ -1137,21 +1137,21 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.MACHOP ], 28: [ SpeciesId.MACHOKE ]}, - { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ]}, - { 1: [ SpeciesId.VOLTORB ], 30: [ SpeciesId.ELECTRODE ]}, - { 1: [ SpeciesId.TIMBURR ], 25: [ SpeciesId.GURDURR ]}, - { 1: [ SpeciesId.KLINK ], 38: [ SpeciesId.KLANG ], 49: [ SpeciesId.KLINKLANG ]} + { 1: [ SpeciesId.MACHOP ], 28: [ SpeciesId.MACHOKE ] }, + { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ] }, + { 1: [ SpeciesId.VOLTORB ], 30: [ SpeciesId.ELECTRODE ] }, + { 1: [ SpeciesId.TIMBURR ], 25: [ SpeciesId.GURDURR ] }, + { 1: [ SpeciesId.KLINK ], 38: [ SpeciesId.KLANG ], 49: [ SpeciesId.KLINKLANG ] } ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BRONZOR ], 33: [ SpeciesId.BRONZONG ]}, SpeciesId.KLEFKI ]}, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.PORYGON ], 30: [ SpeciesId.PORYGON2 ]}]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BELDUM ], 20: [ SpeciesId.METANG ], 45: [ SpeciesId.METAGROSS ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GENESECT, SpeciesId.MAGEARNA ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KLINKLANG, SpeciesId.KLEFKI ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GENESECT, SpeciesId.MAGEARNA ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BRONZOR ], 33: [ SpeciesId.BRONZONG ] }, SpeciesId.KLEFKI ] }, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.PORYGON ], 30: [ SpeciesId.PORYGON2 ] } ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BELDUM ], 20: [ SpeciesId.METANG ], 45: [ SpeciesId.METAGROSS ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GENESECT, SpeciesId.MAGEARNA ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KLINKLANG, SpeciesId.KLEFKI ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GENESECT, SpeciesId.MAGEARNA ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.RUINS]: { [BiomePoolTier.COMMON]: { @@ -1160,12 +1160,12 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.DROWZEE ], 26: [ SpeciesId.HYPNO ]}, - { 1: [ SpeciesId.NATU ], 25: [ SpeciesId.XATU ]}, + { 1: [ SpeciesId.DROWZEE ], 26: [ SpeciesId.HYPNO ] }, + { 1: [ SpeciesId.NATU ], 25: [ SpeciesId.XATU ] }, SpeciesId.UNOWN, - { 1: [ SpeciesId.SPOINK ], 32: [ SpeciesId.GRUMPIG ]}, - { 1: [ SpeciesId.BALTOY ], 36: [ SpeciesId.CLAYDOL ]}, - { 1: [ SpeciesId.ELGYEM ], 42: [ SpeciesId.BEHEEYEM ]} + { 1: [ SpeciesId.SPOINK ], 32: [ SpeciesId.GRUMPIG ] }, + { 1: [ SpeciesId.BALTOY ], 36: [ SpeciesId.CLAYDOL ] }, + { 1: [ SpeciesId.ELGYEM ], 42: [ SpeciesId.BEHEEYEM ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1173,58 +1173,58 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.ABRA ], 16: [ SpeciesId.KADABRA ]}, SpeciesId.SIGILYPH, { 1: [ SpeciesId.TINKATINK ], 24: [ SpeciesId.TINKATUFF ], 38: [ SpeciesId.TINKATON ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.ABRA ], 16: [ SpeciesId.KADABRA ] }, SpeciesId.SIGILYPH, { 1: [ SpeciesId.TINKATINK ], 24: [ SpeciesId.TINKATUFF ], 38: [ SpeciesId.TINKATON ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MR_MIME, SpeciesId.WOBBUFFET, { 1: [ SpeciesId.GOTHITA ], 32: [ SpeciesId.GOTHORITA ], 41: [ SpeciesId.GOTHITELLE ]}, SpeciesId.STONJOURNER ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MR_MIME, SpeciesId.WOBBUFFET, { 1: [ SpeciesId.GOTHITA ], 32: [ SpeciesId.GOTHORITA ], 41: [ SpeciesId.GOTHITELLE ] }, SpeciesId.STONJOURNER ] }, [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.ESPEON ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.GALAR_YAMASK ], 34: [ SpeciesId.RUNERIGUS ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.GALAR_YAMASK ], 34: [ SpeciesId.RUNERIGUS ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.ARCHEN ], 37: [ SpeciesId.ARCHEOPS ]}] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.GALAR_YAMASK ], 34: [ SpeciesId.RUNERIGUS ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.GALAR_YAMASK ], 34: [ SpeciesId.RUNERIGUS ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.ARCHEN ], 37: [ SpeciesId.ARCHEOPS ] } ] }, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGISTEEL, SpeciesId.FEZANDIPITI ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ALAKAZAM, SpeciesId.HYPNO, SpeciesId.XATU, SpeciesId.GRUMPIG, SpeciesId.CLAYDOL, SpeciesId.SIGILYPH, SpeciesId.GOTHITELLE, SpeciesId.BEHEEYEM, SpeciesId.TINKATON ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.ESPEON ], [TimeOfDay.DUSK]: [ SpeciesId.RUNERIGUS ], [TimeOfDay.NIGHT]: [ SpeciesId.RUNERIGUS ], [TimeOfDay.ALL]: [ SpeciesId.MR_MIME, SpeciesId.WOBBUFFET, SpeciesId.ARCHEOPS ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGISTEEL, SpeciesId.FEZANDIPITI ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KORAIDON ]} + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGISTEEL, SpeciesId.FEZANDIPITI ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ALAKAZAM, SpeciesId.HYPNO, SpeciesId.XATU, SpeciesId.GRUMPIG, SpeciesId.CLAYDOL, SpeciesId.SIGILYPH, SpeciesId.GOTHITELLE, SpeciesId.BEHEEYEM, SpeciesId.TINKATON ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.ESPEON ], [TimeOfDay.DUSK]: [ SpeciesId.RUNERIGUS ], [TimeOfDay.NIGHT]: [ SpeciesId.RUNERIGUS ], [TimeOfDay.ALL]: [ SpeciesId.MR_MIME, SpeciesId.WOBBUFFET, SpeciesId.ARCHEOPS ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGISTEEL, SpeciesId.FEZANDIPITI ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KORAIDON ] } }, [BiomeId.WASTELAND]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [ - { 1: [ SpeciesId.BAGON ], 30: [ SpeciesId.SHELGON ], 50: [ SpeciesId.SALAMENCE ]}, - { 1: [ SpeciesId.GOOMY ], 40: [ SpeciesId.SLIGGOO ], 80: [ SpeciesId.GOODRA ]}, - { 1: [ SpeciesId.JANGMO_O ], 35: [ SpeciesId.HAKAMO_O ], 45: [ SpeciesId.KOMMO_O ]} + { 1: [ SpeciesId.BAGON ], 30: [ SpeciesId.SHELGON ], 50: [ SpeciesId.SALAMENCE ] }, + { 1: [ SpeciesId.GOOMY ], 40: [ SpeciesId.SLIGGOO ], 80: [ SpeciesId.GOODRA ] }, + { 1: [ SpeciesId.JANGMO_O ], 35: [ SpeciesId.HAKAMO_O ], 45: [ SpeciesId.KOMMO_O ] } ], [TimeOfDay.DAY]: [ - { 1: [ SpeciesId.BAGON ], 30: [ SpeciesId.SHELGON ], 50: [ SpeciesId.SALAMENCE ]}, - { 1: [ SpeciesId.GOOMY ], 40: [ SpeciesId.SLIGGOO ], 80: [ SpeciesId.GOODRA ]}, - { 1: [ SpeciesId.JANGMO_O ], 35: [ SpeciesId.HAKAMO_O ], 45: [ SpeciesId.KOMMO_O ]} + { 1: [ SpeciesId.BAGON ], 30: [ SpeciesId.SHELGON ], 50: [ SpeciesId.SALAMENCE ] }, + { 1: [ SpeciesId.GOOMY ], 40: [ SpeciesId.SLIGGOO ], 80: [ SpeciesId.GOODRA ] }, + { 1: [ SpeciesId.JANGMO_O ], 35: [ SpeciesId.HAKAMO_O ], 45: [ SpeciesId.KOMMO_O ] } ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.LARVITAR ], 30: [ SpeciesId.PUPITAR ], 55: [ SpeciesId.TYRANITAR ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.LARVITAR ], 30: [ SpeciesId.PUPITAR ], 55: [ SpeciesId.TYRANITAR ]}], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.LARVITAR ], 30: [ SpeciesId.PUPITAR ], 55: [ SpeciesId.TYRANITAR ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.LARVITAR ], 30: [ SpeciesId.PUPITAR ], 55: [ SpeciesId.TYRANITAR ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.VIBRAVA ], 45: [ SpeciesId.FLYGON ]}, - { 1: [ SpeciesId.GIBLE ], 24: [ SpeciesId.GABITE ], 48: [ SpeciesId.GARCHOMP ]}, - { 1: [ SpeciesId.AXEW ], 38: [ SpeciesId.FRAXURE ], 48: [ SpeciesId.HAXORUS ]} + { 1: [ SpeciesId.VIBRAVA ], 45: [ SpeciesId.FLYGON ] }, + { 1: [ SpeciesId.GIBLE ], 24: [ SpeciesId.GABITE ], 48: [ SpeciesId.GARCHOMP ] }, + { 1: [ SpeciesId.AXEW ], 38: [ SpeciesId.FRAXURE ], 48: [ SpeciesId.HAXORUS ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.DEINO ], 50: [ SpeciesId.ZWEILOUS ], 64: [ SpeciesId.HYDREIGON ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.DEINO ], 50: [ SpeciesId.ZWEILOUS ], 64: [ SpeciesId.HYDREIGON ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.SWABLU ], 35: [ SpeciesId.ALTARIA ]}, SpeciesId.DRAMPA, SpeciesId.CYCLIZAR ] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.DEINO ], 50: [ SpeciesId.ZWEILOUS ], 64: [ SpeciesId.HYDREIGON ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.DEINO ], 50: [ SpeciesId.ZWEILOUS ], 64: [ SpeciesId.HYDREIGON ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.SWABLU ], 35: [ SpeciesId.ALTARIA ] }, SpeciesId.DRAMPA, SpeciesId.CYCLIZAR ] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.DREEPY ], 50: [ SpeciesId.DRAKLOAK ], 60: [ SpeciesId.DRAGAPULT ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.DREEPY ], 50: [ SpeciesId.DRAKLOAK ], 60: [ SpeciesId.DRAGAPULT ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.DRATINI ], 30: [ SpeciesId.DRAGONAIR ], 55: [ SpeciesId.DRAGONITE ]}, { 1: [ SpeciesId.FRIGIBAX ], 35: [ SpeciesId.ARCTIBAX ], 54: [ SpeciesId.BAXCALIBUR ]}] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.DREEPY ], 50: [ SpeciesId.DRAKLOAK ], 60: [ SpeciesId.DRAGAPULT ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.DREEPY ], 50: [ SpeciesId.DRAKLOAK ], 60: [ SpeciesId.DRAGAPULT ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.DRATINI ], 30: [ SpeciesId.DRAGONAIR ], 55: [ SpeciesId.DRAGONITE ] }, { 1: [ SpeciesId.FRIGIBAX ], 35: [ SpeciesId.ARCTIBAX ], 54: [ SpeciesId.BAXCALIBUR ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AERODACTYL, SpeciesId.DRUDDIGON, { 1: [ SpeciesId.TYRUNT ], 59: [ SpeciesId.TYRANTRUM ]}, SpeciesId.DRACOZOLT, SpeciesId.DRACOVISH ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIDRAGO ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AERODACTYL, SpeciesId.DRUDDIGON, { 1: [ SpeciesId.TYRUNT ], 39: [ SpeciesId.TYRANTRUM ] }, SpeciesId.DRACOZOLT, SpeciesId.DRACOVISH ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIDRAGO ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.SALAMENCE, SpeciesId.GOODRA, SpeciesId.KOMMO_O ], [TimeOfDay.DAY]: [ SpeciesId.SALAMENCE, SpeciesId.GOODRA, SpeciesId.KOMMO_O ], @@ -1232,9 +1232,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.TYRANITAR, SpeciesId.DRAGAPULT ], [TimeOfDay.ALL]: [ SpeciesId.DRAGONITE, SpeciesId.FLYGON, SpeciesId.GARCHOMP, SpeciesId.HAXORUS, SpeciesId.DRAMPA, SpeciesId.BAXCALIBUR ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AERODACTYL, SpeciesId.DRUDDIGON, SpeciesId.TYRANTRUM, SpeciesId.DRACOZOLT, SpeciesId.DRACOVISH ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIDRAGO ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DIALGA ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AERODACTYL, SpeciesId.DRUDDIGON, SpeciesId.TYRANTRUM, SpeciesId.DRACOZOLT, SpeciesId.DRACOVISH ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIDRAGO ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DIALGA ] } }, [BiomeId.ABYSS]: { [BiomePoolTier.COMMON]: { @@ -1244,25 +1244,25 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MURKROW, - { 1: [ SpeciesId.HOUNDOUR ], 24: [ SpeciesId.HOUNDOOM ]}, + { 1: [ SpeciesId.HOUNDOUR ], 24: [ SpeciesId.HOUNDOOM ] }, SpeciesId.SABLEYE, - { 1: [ SpeciesId.PURRLOIN ], 20: [ SpeciesId.LIEPARD ]}, - { 1: [ SpeciesId.PAWNIARD ], 52: [ SpeciesId.BISHARP ], 64: [ SpeciesId.KINGAMBIT ]}, - { 1: [ SpeciesId.NICKIT ], 18: [ SpeciesId.THIEVUL ]}, - { 1: [ SpeciesId.IMPIDIMP ], 32: [ SpeciesId.MORGREM ], 42: [ SpeciesId.GRIMMSNARL ]}, - { 1: [ SpeciesId.MASCHIFF ], 30: [ SpeciesId.MABOSSTIFF ]} + { 1: [ SpeciesId.PURRLOIN ], 20: [ SpeciesId.LIEPARD ] }, + { 1: [ SpeciesId.PAWNIARD ], 52: [ SpeciesId.BISHARP ], 64: [ SpeciesId.KINGAMBIT ] }, + { 1: [ SpeciesId.NICKIT ], 18: [ SpeciesId.THIEVUL ] }, + { 1: [ SpeciesId.IMPIDIMP ], 32: [ SpeciesId.MORGREM ], 42: [ SpeciesId.GRIMMSNARL ] }, + { 1: [ SpeciesId.MASCHIFF ], 30: [ SpeciesId.MABOSSTIFF ] } ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.ABSOL, SpeciesId.SPIRITOMB, { 1: [ SpeciesId.ZORUA ], 30: [ SpeciesId.ZOROARK ]}, { 1: [ SpeciesId.DEINO ], 50: [ SpeciesId.ZWEILOUS ], 64: [ SpeciesId.HYDREIGON ]}] + [TimeOfDay.ALL]: [ SpeciesId.ABSOL, SpeciesId.SPIRITOMB, { 1: [ SpeciesId.ZORUA ], 30: [ SpeciesId.ZOROARK ] }, { 1: [ SpeciesId.DEINO ], 50: [ SpeciesId.ZWEILOUS ], 64: [ SpeciesId.HYDREIGON ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UMBREON ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DARKRAI, SpeciesId.GALAR_MOLTRES ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UMBREON ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DARKRAI, SpeciesId.GALAR_MOLTRES ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -1270,9 +1270,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HOUNDOOM, SpeciesId.SABLEYE, SpeciesId.ABSOL, SpeciesId.HONCHKROW, SpeciesId.SPIRITOMB, SpeciesId.LIEPARD, SpeciesId.ZOROARK, SpeciesId.HYDREIGON, SpeciesId.THIEVUL, SpeciesId.GRIMMSNARL, SpeciesId.MABOSSTIFF, SpeciesId.KINGAMBIT ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UMBREON, SpeciesId.HISUI_SAMUROTT ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DARKRAI ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.PALKIA, SpeciesId.YVELTAL, SpeciesId.GALAR_MOLTRES ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.UMBREON, SpeciesId.HISUI_SAMUROTT ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DARKRAI ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.PALKIA, SpeciesId.YVELTAL, SpeciesId.GALAR_MOLTRES ] } }, [BiomeId.SPACE]: { [BiomePoolTier.COMMON]: { @@ -1280,22 +1280,22 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DAY]: [ SpeciesId.SOLROCK ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.LUNATONE ], - [TimeOfDay.ALL]: [ SpeciesId.CLEFAIRY, { 1: [ SpeciesId.BRONZOR ], 33: [ SpeciesId.BRONZONG ]}, { 1: [ SpeciesId.MUNNA ], 30: [ SpeciesId.MUSHARNA ]}, SpeciesId.MINIOR ] + [TimeOfDay.ALL]: [ SpeciesId.CLEFAIRY, { 1: [ SpeciesId.BRONZOR ], 33: [ SpeciesId.BRONZONG ] }, { 1: [ SpeciesId.MUNNA ], 30: [ SpeciesId.MUSHARNA ] }, SpeciesId.MINIOR ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BALTOY ], 36: [ SpeciesId.CLAYDOL ]}, { 1: [ SpeciesId.ELGYEM ], 42: [ SpeciesId.BEHEEYEM ]}]}, + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BALTOY ], 36: [ SpeciesId.CLAYDOL ] }, { 1: [ SpeciesId.ELGYEM ], 42: [ SpeciesId.BEHEEYEM ] } ] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BELDUM ], 20: [ SpeciesId.METANG ], 45: [ SpeciesId.METAGROSS ]}, SpeciesId.SIGILYPH, { 1: [ SpeciesId.SOLOSIS ], 32: [ SpeciesId.DUOSION ], 41: [ SpeciesId.REUNICLUS ]}] + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BELDUM ], 20: [ SpeciesId.METANG ], 45: [ SpeciesId.METAGROSS ] }, SpeciesId.SIGILYPH, { 1: [ SpeciesId.SOLOSIS ], 32: [ SpeciesId.DUOSION ], 41: [ SpeciesId.REUNICLUS ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.PORYGON ], 30: [ SpeciesId.PORYGON2 ]}]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.COSMOG ], 43: [ SpeciesId.COSMOEM ]}, SpeciesId.CELESTEELA ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.SOLROCK ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.LUNATONE ], [TimeOfDay.ALL]: [ SpeciesId.CLEFABLE, SpeciesId.BRONZONG, SpeciesId.MUSHARNA, SpeciesId.REUNICLUS, SpeciesId.MINIOR ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.METAGROSS, SpeciesId.PORYGON_Z ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CELESTEELA ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.SOLGALEO ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.LUNALA ], [TimeOfDay.ALL]: [ SpeciesId.RAYQUAZA, SpeciesId.NECROZMA ]} + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.PORYGON ], 30: [ SpeciesId.PORYGON2 ] } ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.COSMOG ], 23: [ SpeciesId.COSMOEM ] }, SpeciesId.CELESTEELA ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.SOLROCK ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.LUNATONE ], [TimeOfDay.ALL]: [ SpeciesId.CLEFABLE, SpeciesId.BRONZONG, SpeciesId.MUSHARNA, SpeciesId.REUNICLUS, SpeciesId.MINIOR ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.METAGROSS, SpeciesId.PORYGON_Z ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CELESTEELA ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [ SpeciesId.SOLGALEO ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [ SpeciesId.LUNALA ], [TimeOfDay.ALL]: [ SpeciesId.RAYQUAZA, SpeciesId.NECROZMA ] } }, [BiomeId.CONSTRUCTION_SITE]: { [BiomePoolTier.COMMON]: { @@ -1304,10 +1304,10 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.MACHOP ], 28: [ SpeciesId.MACHOKE ]}, - { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ]}, - { 1: [ SpeciesId.DRILBUR ], 31: [ SpeciesId.EXCADRILL ]}, - { 1: [ SpeciesId.TIMBURR ], 25: [ SpeciesId.GURDURR ]} + { 1: [ SpeciesId.MACHOP ], 28: [ SpeciesId.MACHOKE ] }, + { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ] }, + { 1: [ SpeciesId.DRILBUR ], 31: [ SpeciesId.EXCADRILL ] }, + { 1: [ SpeciesId.TIMBURR ], 25: [ SpeciesId.GURDURR ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1316,60 +1316,60 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.GRIMER ], 38: [ SpeciesId.MUK ]}, - { 1: [ SpeciesId.KOFFING ], 35: [ SpeciesId.WEEZING ]}, - { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ]}, - { 1: [ SpeciesId.SCRAGGY ], 39: [ SpeciesId.SCRAFTY ]} + { 1: [ SpeciesId.GRIMER ], 38: [ SpeciesId.MUK ] }, + { 1: [ SpeciesId.KOFFING ], 35: [ SpeciesId.WEEZING ] }, + { 1: [ SpeciesId.RHYHORN ], 42: [ SpeciesId.RHYDON ] }, + { 1: [ SpeciesId.SCRAGGY ], 39: [ SpeciesId.SCRAFTY ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.GALAR_MEOWTH ], 28: [ SpeciesId.PERRSERKER ]}], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ONIX, SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.DURALUDON ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, SpeciesId.HITMONTOP ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.COBALION, SpeciesId.STAKATAKA ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MACHAMP, SpeciesId.CONKELDURR ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.PERRSERKER ], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ARCHALUDON ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.COBALION, SpeciesId.STAKATAKA ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.GALAR_MEOWTH ], 28: [ SpeciesId.PERRSERKER ] } ], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ONIX, SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.DURALUDON ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, SpeciesId.HITMONTOP ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.COBALION, SpeciesId.STAKATAKA ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MACHAMP, SpeciesId.CONKELDURR ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.PERRSERKER ], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ARCHALUDON ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.COBALION, SpeciesId.STAKATAKA ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.JUNGLE]: { [BiomePoolTier.COMMON]: { - [TimeOfDay.DAWN]: [ SpeciesId.VESPIQUEN, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ]}, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ]}], - [TimeOfDay.DAY]: [ SpeciesId.VESPIQUEN, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ]}, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ]}], - [TimeOfDay.DUSK]: [ SpeciesId.SHROOMISH, { 1: [ SpeciesId.PURRLOIN ], 20: [ SpeciesId.LIEPARD ]}, { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ]}, SpeciesId.SHROOMISH, { 1: [ SpeciesId.PURRLOIN ], 20: [ SpeciesId.LIEPARD ]}, { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ]}], - [TimeOfDay.ALL]: [ SpeciesId.AIPOM, { 1: [ SpeciesId.BLITZLE ], 27: [ SpeciesId.ZEBSTRIKA ]}, { 1: [ SpeciesId.PIKIPEK ], 14: [ SpeciesId.TRUMBEAK ], 28: [ SpeciesId.TOUCANNON ]}] + [TimeOfDay.DAWN]: [ SpeciesId.VESPIQUEN, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ] }, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ] } ], + [TimeOfDay.DAY]: [ SpeciesId.VESPIQUEN, { 1: [ SpeciesId.CHERUBI ], 25: [ SpeciesId.CHERRIM ] }, { 1: [ SpeciesId.SEWADDLE ], 20: [ SpeciesId.SWADLOON ], 30: [ SpeciesId.LEAVANNY ] } ], + [TimeOfDay.DUSK]: [ SpeciesId.SHROOMISH, { 1: [ SpeciesId.PURRLOIN ], 20: [ SpeciesId.LIEPARD ] }, { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ] }, SpeciesId.SHROOMISH, { 1: [ SpeciesId.PURRLOIN ], 20: [ SpeciesId.LIEPARD ] }, { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ] } ], + [TimeOfDay.ALL]: [ SpeciesId.AIPOM, { 1: [ SpeciesId.BLITZLE ], 27: [ SpeciesId.ZEBSTRIKA ] }, { 1: [ SpeciesId.PIKIPEK ], 14: [ SpeciesId.TRUMBEAK ], 28: [ SpeciesId.TOUCANNON ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [ SpeciesId.EXEGGCUTE, SpeciesId.TROPIUS, SpeciesId.COMBEE, SpeciesId.KOMALA ], [TimeOfDay.DAY]: [ SpeciesId.EXEGGCUTE, SpeciesId.TROPIUS, SpeciesId.COMBEE, SpeciesId.KOMALA ], - [TimeOfDay.DUSK]: [ SpeciesId.TANGELA, { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ]}, { 1: [ SpeciesId.PANCHAM ], 52: [ SpeciesId.PANGORO ]}], - [TimeOfDay.NIGHT]: [ SpeciesId.TANGELA, { 1: [ SpeciesId.PANCHAM ], 52: [ SpeciesId.PANGORO ]}], + [TimeOfDay.DUSK]: [ SpeciesId.TANGELA, { 1: [ SpeciesId.SPINARAK ], 22: [ SpeciesId.ARIADOS ] }, { 1: [ SpeciesId.PANCHAM ], 52: [ SpeciesId.PANGORO ] } ], + [TimeOfDay.NIGHT]: [ SpeciesId.TANGELA, { 1: [ SpeciesId.PANCHAM ], 52: [ SpeciesId.PANGORO ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.PANSAGE ], 30: [ SpeciesId.SIMISAGE ]}, - { 1: [ SpeciesId.PANSEAR ], 30: [ SpeciesId.SIMISEAR ]}, - { 1: [ SpeciesId.PANPOUR ], 30: [ SpeciesId.SIMIPOUR ]}, - { 1: [ SpeciesId.JOLTIK ], 36: [ SpeciesId.GALVANTULA ]}, - { 1: [ SpeciesId.LITLEO ], 35: [ SpeciesId.PYROAR ]}, - { 1: [ SpeciesId.FOMANTIS ], 44: [ SpeciesId.LURANTIS ]}, + { 1: [ SpeciesId.PANSAGE ], 30: [ SpeciesId.SIMISAGE ] }, + { 1: [ SpeciesId.PANSEAR ], 30: [ SpeciesId.SIMISEAR ] }, + { 1: [ SpeciesId.PANPOUR ], 30: [ SpeciesId.SIMIPOUR ] }, + { 1: [ SpeciesId.JOLTIK ], 36: [ SpeciesId.GALVANTULA ] }, + { 1: [ SpeciesId.LITLEO ], 35: [ SpeciesId.PYROAR ] }, + { 1: [ SpeciesId.FOMANTIS ], 34: [ SpeciesId.LURANTIS ] }, SpeciesId.FALINKS ] }, [BiomePoolTier.RARE]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ]}, SpeciesId.PASSIMIAN, { 1: [ SpeciesId.GALAR_PONYTA ], 40: [ SpeciesId.GALAR_RAPIDASH ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ]}, SpeciesId.PASSIMIAN ], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ] }, SpeciesId.PASSIMIAN, { 1: [ SpeciesId.GALAR_PONYTA ], 40: [ SpeciesId.GALAR_RAPIDASH ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.FOONGUS ], 39: [ SpeciesId.AMOONGUSS ] }, SpeciesId.PASSIMIAN ], [TimeOfDay.DUSK]: [ SpeciesId.ORANGURU ], [TimeOfDay.NIGHT]: [ SpeciesId.ORANGURU ], [TimeOfDay.ALL]: [ SpeciesId.SCYTHER, SpeciesId.YANMA, - { 1: [ SpeciesId.SLAKOTH ], 18: [ SpeciesId.VIGOROTH ], 36: [ SpeciesId.SLAKING ]}, + { 1: [ SpeciesId.SLAKOTH ], 18: [ SpeciesId.VIGOROTH ], 36: [ SpeciesId.SLAKING ] }, SpeciesId.SEVIPER, SpeciesId.CARNIVINE, - { 1: [ SpeciesId.SNIVY ], 17: [ SpeciesId.SERVINE ], 36: [ SpeciesId.SERPERIOR ]}, - { 1: [ SpeciesId.GROOKEY ], 16: [ SpeciesId.THWACKEY ], 35: [ SpeciesId.RILLABOOM ]} + { 1: [ SpeciesId.SNIVY ], 17: [ SpeciesId.SERVINE ], 36: [ SpeciesId.SERPERIOR ] }, + { 1: [ SpeciesId.GROOKEY ], 16: [ SpeciesId.THWACKEY ], 35: [ SpeciesId.RILLABOOM ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KANGASKHAN, SpeciesId.CHATOT, SpeciesId.KLEAVOR ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TAPU_LELE, SpeciesId.BUZZWOLE, SpeciesId.ZARUDE, SpeciesId.MUNKIDORI ]}, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KANGASKHAN, SpeciesId.CHATOT, SpeciesId.KLEAVOR ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TAPU_LELE, SpeciesId.BUZZWOLE, SpeciesId.ZARUDE, SpeciesId.MUNKIDORI ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.EXEGGUTOR, SpeciesId.TROPIUS, SpeciesId.CHERRIM, SpeciesId.LEAVANNY, SpeciesId.KOMALA ], [TimeOfDay.DAY]: [ SpeciesId.EXEGGUTOR, SpeciesId.TROPIUS, SpeciesId.CHERRIM, SpeciesId.LEAVANNY, SpeciesId.KOMALA ], @@ -1384,8 +1384,8 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KANGASKHAN, SpeciesId.SCIZOR, SpeciesId.SLAKING, SpeciesId.LEAFEON, SpeciesId.SERPERIOR, SpeciesId.RILLABOOM ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TAPU_LELE, SpeciesId.BUZZWOLE, SpeciesId.ZARUDE, SpeciesId.MUNKIDORI ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KLEAVOR ]} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TAPU_LELE, SpeciesId.BUZZWOLE, SpeciesId.ZARUDE, SpeciesId.MUNKIDORI ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.KLEAVOR ] } }, [BiomeId.FAIRY_CAVE]: { [BiomePoolTier.COMMON]: { @@ -1394,14 +1394,14 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.JIGGLYPUFF ], 30: [ SpeciesId.WIGGLYTUFF ]}, - { 1: [ SpeciesId.MARILL ], 18: [ SpeciesId.AZUMARILL ]}, + { 1: [ SpeciesId.JIGGLYPUFF ], 30: [ SpeciesId.WIGGLYTUFF ] }, + { 1: [ SpeciesId.MARILL ], 18: [ SpeciesId.AZUMARILL ] }, SpeciesId.MAWILE, - { 1: [ SpeciesId.SPRITZEE ], 40: [ SpeciesId.AROMATISSE ]}, - { 1: [ SpeciesId.SWIRLIX ], 40: [ SpeciesId.SLURPUFF ]}, - { 1: [ SpeciesId.CUTIEFLY ], 25: [ SpeciesId.RIBOMBEE ]}, - { 1: [ SpeciesId.MORELULL ], 24: [ SpeciesId.SHIINOTIC ]}, - { 1: [ SpeciesId.MILCERY ], 30: [ SpeciesId.ALCREMIE ]} + { 1: [ SpeciesId.SPRITZEE ], 40: [ SpeciesId.AROMATISSE ] }, + { 1: [ SpeciesId.SWIRLIX ], 40: [ SpeciesId.SLURPUFF ] }, + { 1: [ SpeciesId.CUTIEFLY ], 25: [ SpeciesId.RIBOMBEE ] }, + { 1: [ SpeciesId.MORELULL ], 24: [ SpeciesId.SHIINOTIC ] }, + { 1: [ SpeciesId.MILCERY ], 30: [ SpeciesId.ALCREMIE ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1412,15 +1412,15 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.ALL]: [ SpeciesId.CLEFAIRY, SpeciesId.TOGETIC, - { 1: [ SpeciesId.RALTS ], 20: [ SpeciesId.KIRLIA ], 30: [ SpeciesId.GARDEVOIR ]}, + { 1: [ SpeciesId.RALTS ], 20: [ SpeciesId.KIRLIA ], 30: [ SpeciesId.GARDEVOIR ] }, SpeciesId.CARBINK, SpeciesId.COMFEY, - { 1: [ SpeciesId.HATENNA ], 32: [ SpeciesId.HATTREM ], 42: [ SpeciesId.HATTERENE ]} + { 1: [ SpeciesId.HATENNA ], 32: [ SpeciesId.HATTREM ], 42: [ SpeciesId.HATTERENE ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AUDINO, SpeciesId.ETERNAL_FLOETTE ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DIANCIE, SpeciesId.ENAMORUS ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.AUDINO ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ETERNAL_FLOETTE ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DIANCIE, SpeciesId.ENAMORUS ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], @@ -1428,9 +1428,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.WIGGLYTUFF, SpeciesId.MAWILE, SpeciesId.TOGEKISS, SpeciesId.AUDINO, SpeciesId.AROMATISSE, SpeciesId.SLURPUFF, SpeciesId.CARBINK, SpeciesId.RIBOMBEE, SpeciesId.SHIINOTIC, SpeciesId.COMFEY, SpeciesId.HATTERENE, SpeciesId.ALCREMIE ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ETERNAL_FLOETTE ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DIANCIE, SpeciesId.ENAMORUS ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.XERNEAS ]} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ETERNAL_FLOETTE ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DIANCIE, SpeciesId.ENAMORUS ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.XERNEAS ] } }, [BiomeId.TEMPLE]: { [BiomePoolTier.COMMON]: { @@ -1439,12 +1439,12 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.GASTLY ], 25: [ SpeciesId.HAUNTER ]}, - { 1: [ SpeciesId.NATU ], 25: [ SpeciesId.XATU ]}, - { 1: [ SpeciesId.DUSKULL ], 37: [ SpeciesId.DUSCLOPS ]}, - { 1: [ SpeciesId.YAMASK ], 34: [ SpeciesId.COFAGRIGUS ]}, - { 1: [ SpeciesId.GOLETT ], 43: [ SpeciesId.GOLURK ]}, - { 1: [ SpeciesId.HONEDGE ], 35: [ SpeciesId.DOUBLADE ]} + { 1: [ SpeciesId.GASTLY ], 25: [ SpeciesId.HAUNTER ] }, + { 1: [ SpeciesId.NATU ], 25: [ SpeciesId.XATU ] }, + { 1: [ SpeciesId.DUSKULL ], 37: [ SpeciesId.DUSCLOPS ] }, + { 1: [ SpeciesId.YAMASK ], 34: [ SpeciesId.COFAGRIGUS ] }, + { 1: [ SpeciesId.GOLETT ], 43: [ SpeciesId.GOLURK ] }, + { 1: [ SpeciesId.HONEDGE ], 35: [ SpeciesId.DOUBLADE ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1453,86 +1453,86 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.CUBONE ], 28: [ SpeciesId.MAROWAK ]}, - { 1: [ SpeciesId.BALTOY ], 36: [ SpeciesId.CLAYDOL ]}, - { 1: [ SpeciesId.CHINGLING ], 20: [ SpeciesId.CHIMECHO ]}, - { 1: [ SpeciesId.SKORUPI ], 40: [ SpeciesId.DRAPION ]}, - { 1: [ SpeciesId.LITWICK ], 41: [ SpeciesId.LAMPENT ]} + { 1: [ SpeciesId.CUBONE ], 28: [ SpeciesId.MAROWAK ] }, + { 1: [ SpeciesId.BALTOY ], 36: [ SpeciesId.CLAYDOL ] }, + { 1: [ SpeciesId.CHINGLING ], 20: [ SpeciesId.CHIMECHO ] }, + { 1: [ SpeciesId.SKORUPI ], 40: [ SpeciesId.DRAPION ] }, + { 1: [ SpeciesId.LITWICK ], 41: [ SpeciesId.LAMPENT ] } ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.GIMMIGHOUL ], 40: [ SpeciesId.GHOLDENGO ]}]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HOOPA, SpeciesId.TAPU_KOKO ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CHIMECHO, SpeciesId.COFAGRIGUS, SpeciesId.GOLURK, SpeciesId.AEGISLASH ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GHOLDENGO ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HOOPA, SpeciesId.TAPU_KOKO ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIGIGAS ]} + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.GIMMIGHOUL ], 40: [ SpeciesId.GHOLDENGO ] } ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HOOPA, SpeciesId.TAPU_KOKO ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.CHIMECHO, SpeciesId.COFAGRIGUS, SpeciesId.GOLURK, SpeciesId.AEGISLASH ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GHOLDENGO ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.HOOPA, SpeciesId.TAPU_KOKO ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.REGIGIGAS ] } }, [BiomeId.SLUM]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ]}], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.PATRAT ], 20: [ SpeciesId.WATCHOG ] } ], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.RATTATA ], 20: [ SpeciesId.RATICATE ]}, - { 1: [ SpeciesId.GRIMER ], 38: [ SpeciesId.MUK ]}, - { 1: [ SpeciesId.KOFFING ], 35: [ SpeciesId.WEEZING ]}, - { 1: [ SpeciesId.TRUBBISH ], 36: [ SpeciesId.GARBODOR ]} + { 1: [ SpeciesId.RATTATA ], 20: [ SpeciesId.RATICATE ] }, + { 1: [ SpeciesId.GRIMER ], 38: [ SpeciesId.MUK ] }, + { 1: [ SpeciesId.KOFFING ], 35: [ SpeciesId.WEEZING ] }, + { 1: [ SpeciesId.TRUBBISH ], 36: [ SpeciesId.GARBODOR ] } ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.STUNKY ], 34: [ SpeciesId.SKUNTANK ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.STUNKY ], 34: [ SpeciesId.SKUNTANK ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.BURMY ], 20: [ SpeciesId.WORMADAM ]}] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.STUNKY ], 34: [ SpeciesId.SKUNTANK ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.STUNKY ], 34: [ SpeciesId.SKUNTANK ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.BURMY ], 20: [ SpeciesId.WORMADAM ] } ] }, [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [ SpeciesId.TOXTRICITY, { 1: [ SpeciesId.GALAR_LINOONE ], 65: [ SpeciesId.OBSTAGOON ]}, SpeciesId.GALAR_ZIGZAGOON ], - [TimeOfDay.NIGHT]: [ SpeciesId.TOXTRICITY, { 1: [ SpeciesId.GALAR_LINOONE ], 65: [ SpeciesId.OBSTAGOON ]}, SpeciesId.GALAR_ZIGZAGOON ], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.VAROOM ], 40: [ SpeciesId.REVAVROOM ]}] + [TimeOfDay.DUSK]: [ SpeciesId.TOXTRICITY, { 1: [ SpeciesId.GALAR_LINOONE ], 35: [ SpeciesId.OBSTAGOON ] }, SpeciesId.GALAR_ZIGZAGOON ], + [TimeOfDay.NIGHT]: [ SpeciesId.TOXTRICITY, { 1: [ SpeciesId.GALAR_LINOONE ], 35: [ SpeciesId.OBSTAGOON ] }, SpeciesId.GALAR_ZIGZAGOON ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.VAROOM ], 40: [ SpeciesId.REVAVROOM ] } ] }, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GUZZLORD ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.SKUNTANK, SpeciesId.WATCHOG ], [TimeOfDay.NIGHT]: [ SpeciesId.SKUNTANK, SpeciesId.WATCHOG ], [TimeOfDay.ALL]: [ SpeciesId.MUK, SpeciesId.WEEZING, SpeciesId.WORMADAM, SpeciesId.GARBODOR ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.TOXTRICITY, SpeciesId.OBSTAGOON ], [TimeOfDay.NIGHT]: [ SpeciesId.TOXTRICITY, SpeciesId.OBSTAGOON ], [TimeOfDay.ALL]: [ SpeciesId.REVAVROOM, SpeciesId.GALAR_WEEZING ]}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GUZZLORD ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GUZZLORD ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.SKUNTANK, SpeciesId.WATCHOG ], [TimeOfDay.NIGHT]: [ SpeciesId.SKUNTANK, SpeciesId.WATCHOG ], [TimeOfDay.ALL]: [ SpeciesId.MUK, SpeciesId.WEEZING, SpeciesId.WORMADAM, SpeciesId.GARBODOR ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [ SpeciesId.TOXTRICITY, SpeciesId.OBSTAGOON ], [TimeOfDay.NIGHT]: [ SpeciesId.TOXTRICITY, SpeciesId.OBSTAGOON ], [TimeOfDay.ALL]: [ SpeciesId.REVAVROOM, SpeciesId.GALAR_WEEZING ] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GUZZLORD ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.SNOWY_FOREST]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ]}, { 1: [ SpeciesId.SNOM ], 20: [ SpeciesId.FROSMOTH ]}], - [TimeOfDay.NIGHT]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ]}, { 1: [ SpeciesId.SNOM ], 20: [ SpeciesId.FROSMOTH ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.SWINUB ], 33: [ SpeciesId.PILOSWINE ]}, { 1: [ SpeciesId.SNOVER ], 40: [ SpeciesId.ABOMASNOW ]}, SpeciesId.EISCUE ] + [TimeOfDay.DUSK]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ] }, { 1: [ SpeciesId.SNOM ], 20: [ SpeciesId.FROSMOTH ] } ], + [TimeOfDay.NIGHT]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ] }, { 1: [ SpeciesId.SNOM ], 20: [ SpeciesId.FROSMOTH ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.SWINUB ], 33: [ SpeciesId.PILOSWINE ] }, { 1: [ SpeciesId.SNOVER ], 40: [ SpeciesId.ABOMASNOW ] }, SpeciesId.EISCUE ] }, [BiomePoolTier.UNCOMMON]: { - [TimeOfDay.DAWN]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ]}, SpeciesId.STANTLER ], - [TimeOfDay.DAY]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ]}, SpeciesId.STANTLER ], + [TimeOfDay.DAWN]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ] }, SpeciesId.STANTLER ], + [TimeOfDay.DAY]: [ SpeciesId.SNEASEL, { 1: [ SpeciesId.TEDDIURSA ], 30: [ SpeciesId.URSARING ] }, SpeciesId.STANTLER ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.RARE]: { - [TimeOfDay.DAWN]: [{ 1: [ SpeciesId.GALAR_DARUMAKA ], 30: [ SpeciesId.GALAR_DARMANITAN ]}], - [TimeOfDay.DAY]: [{ 1: [ SpeciesId.GALAR_DARUMAKA ], 30: [ SpeciesId.GALAR_DARMANITAN ]}], + [TimeOfDay.DAWN]: [ { 1: [ SpeciesId.GALAR_DARUMAKA ], 30: [ SpeciesId.GALAR_DARMANITAN ] } ], + [TimeOfDay.DAY]: [ { 1: [ SpeciesId.GALAR_DARUMAKA ], 30: [ SpeciesId.GALAR_DARMANITAN ] } ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], - [TimeOfDay.ALL]: [ SpeciesId.DELIBIRD, { 1: [ SpeciesId.ALOLA_SANDSHREW ], 30: [ SpeciesId.ALOLA_SANDSLASH ]}, { 1: [ SpeciesId.ALOLA_VULPIX ], 30: [ SpeciesId.ALOLA_NINETALES ]}] + [TimeOfDay.ALL]: [ SpeciesId.DELIBIRD, { 1: [ SpeciesId.ALOLA_SANDSHREW ], 30: [ SpeciesId.ALOLA_SANDSLASH ] }, { 1: [ SpeciesId.ALOLA_VULPIX ], 30: [ SpeciesId.ALOLA_NINETALES ] } ] }, [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.HISUI_SNEASEL ], [TimeOfDay.DAY]: [ SpeciesId.HISUI_SNEASEL ], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.HISUI_ZORUA ], 30: [ SpeciesId.HISUI_ZOROARK ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.HISUI_ZORUA ], 30: [ SpeciesId.HISUI_ZOROARK ]}], - [TimeOfDay.ALL]: [{ 1: [ SpeciesId.GALAR_MR_MIME ], 42: [ SpeciesId.MR_RIME ]}, SpeciesId.ARCTOZOLT, SpeciesId.HISUI_AVALUGG ] + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.HISUI_ZORUA ], 30: [ SpeciesId.HISUI_ZOROARK ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.HISUI_ZORUA ], 30: [ SpeciesId.HISUI_ZOROARK ] } ], + [TimeOfDay.ALL]: [ { 1: [ SpeciesId.GALAR_MR_MIME ], 42: [ SpeciesId.MR_RIME ] }, SpeciesId.ARCTOZOLT, SpeciesId.HISUI_AVALUGG ] }, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GLASTRIER, SpeciesId.CHIEN_PAO, SpeciesId.GALAR_ARTICUNO ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.WYRDEER ], [TimeOfDay.DAY]: [ SpeciesId.WYRDEER ], [TimeOfDay.DUSK]: [ SpeciesId.FROSMOTH ], [TimeOfDay.NIGHT]: [ SpeciesId.FROSMOTH ], [TimeOfDay.ALL]: [ SpeciesId.ABOMASNOW, SpeciesId.URSALUNA ]}, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GLASTRIER, SpeciesId.CHIEN_PAO, SpeciesId.GALAR_ARTICUNO ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.WYRDEER ], [TimeOfDay.DAY]: [ SpeciesId.WYRDEER ], [TimeOfDay.DUSK]: [ SpeciesId.FROSMOTH ], [TimeOfDay.NIGHT]: [ SpeciesId.FROSMOTH ], [TimeOfDay.ALL]: [ SpeciesId.ABOMASNOW, SpeciesId.URSALUNA ] }, [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [ SpeciesId.SNEASLER, SpeciesId.GALAR_DARMANITAN ], [TimeOfDay.DAY]: [ SpeciesId.SNEASLER, SpeciesId.GALAR_DARMANITAN ], @@ -1540,22 +1540,22 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.HISUI_ZOROARK ], [TimeOfDay.ALL]: [ SpeciesId.MR_RIME, SpeciesId.ARCTOZOLT, SpeciesId.ALOLA_SANDSLASH, SpeciesId.ALOLA_NINETALES ] }, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GLASTRIER, SpeciesId.CHIEN_PAO ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZACIAN, SpeciesId.GALAR_ARTICUNO ]} + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.GLASTRIER, SpeciesId.CHIEN_PAO ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ZACIAN, SpeciesId.GALAR_ARTICUNO ] } }, [BiomeId.ISLAND]: { [BiomePoolTier.COMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], - [TimeOfDay.DUSK]: [{ 1: [ SpeciesId.ALOLA_RATTATA ], 30: [ SpeciesId.ALOLA_RATICATE ]}, { 1: [ SpeciesId.ALOLA_MEOWTH ], 30: [ SpeciesId.ALOLA_PERSIAN ]}], - [TimeOfDay.NIGHT]: [{ 1: [ SpeciesId.ALOLA_RATTATA ], 30: [ SpeciesId.ALOLA_RATICATE ]}, { 1: [ SpeciesId.ALOLA_MEOWTH ], 30: [ SpeciesId.ALOLA_PERSIAN ]}], + [TimeOfDay.DUSK]: [ { 1: [ SpeciesId.ALOLA_RATTATA ], 20: [ SpeciesId.ALOLA_RATICATE ] }, { 1: [ SpeciesId.ALOLA_MEOWTH ], 30: [ SpeciesId.ALOLA_PERSIAN ] } ], + [TimeOfDay.NIGHT]: [ { 1: [ SpeciesId.ALOLA_RATTATA ], 20: [ SpeciesId.ALOLA_RATICATE ] }, { 1: [ SpeciesId.ALOLA_MEOWTH ], 30: [ SpeciesId.ALOLA_PERSIAN ] } ], [TimeOfDay.ALL]: [ SpeciesId.ORICORIO, - { 1: [ SpeciesId.ALOLA_SANDSHREW ], 30: [ SpeciesId.ALOLA_SANDSLASH ]}, - { 1: [ SpeciesId.ALOLA_VULPIX ], 30: [ SpeciesId.ALOLA_NINETALES ]}, - { 1: [ SpeciesId.ALOLA_DIGLETT ], 26: [ SpeciesId.ALOLA_DUGTRIO ]}, - { 1: [ SpeciesId.ALOLA_GEODUDE ], 25: [ SpeciesId.ALOLA_GRAVELER ], 40: [ SpeciesId.ALOLA_GOLEM ]}, - { 1: [ SpeciesId.ALOLA_GRIMER ], 38: [ SpeciesId.ALOLA_MUK ]} + { 1: [ SpeciesId.ALOLA_SANDSHREW ], 30: [ SpeciesId.ALOLA_SANDSLASH ] }, + { 1: [ SpeciesId.ALOLA_VULPIX ], 30: [ SpeciesId.ALOLA_NINETALES ] }, + { 1: [ SpeciesId.ALOLA_DIGLETT ], 26: [ SpeciesId.ALOLA_DUGTRIO ] }, + { 1: [ SpeciesId.ALOLA_GEODUDE ], 25: [ SpeciesId.ALOLA_GRAVELER ], 40: [ SpeciesId.ALOLA_GOLEM ] }, + { 1: [ SpeciesId.ALOLA_GRIMER ], 38: [ SpeciesId.ALOLA_MUK ] } ] }, [BiomePoolTier.UNCOMMON]: { @@ -1565,9 +1565,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.ALOLA_MAROWAK ], [TimeOfDay.ALL]: [ SpeciesId.BRUXISH ] }, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLACEPHALON ]}, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLACEPHALON ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ SpeciesId.ALOLA_RAICHU, SpeciesId.ALOLA_EXEGGUTOR ], [TimeOfDay.DAY]: [ SpeciesId.ALOLA_RAICHU, SpeciesId.ALOLA_EXEGGUTOR ], @@ -1575,9 +1575,9 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.NIGHT]: [ SpeciesId.ALOLA_RATICATE, SpeciesId.ALOLA_PERSIAN, SpeciesId.ALOLA_MAROWAK ], [TimeOfDay.ALL]: [ SpeciesId.ORICORIO, SpeciesId.BRUXISH, SpeciesId.ALOLA_SANDSLASH, SpeciesId.ALOLA_NINETALES, SpeciesId.ALOLA_DUGTRIO, SpeciesId.ALOLA_GOLEM, SpeciesId.ALOLA_MUK ] }, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLACEPHALON ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.BLACEPHALON ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } }, [BiomeId.LABORATORY]: { [BiomePoolTier.COMMON]: { @@ -1586,21 +1586,21 @@ export const biomePokemonPools: BiomePokemonPools = { [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ - { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ]}, - { 1: [ SpeciesId.GRIMER ], 38: [ SpeciesId.MUK ]}, - { 1: [ SpeciesId.VOLTORB ], 30: [ SpeciesId.ELECTRODE ]}, - { 1: [ SpeciesId.BRONZOR ], 33: [ SpeciesId.BRONZONG ]}, - { 1: [ SpeciesId.KLINK ], 38: [ SpeciesId.KLANG ], 49: [ SpeciesId.KLINKLANG ]} + { 1: [ SpeciesId.MAGNEMITE ], 30: [ SpeciesId.MAGNETON ] }, + { 1: [ SpeciesId.GRIMER ], 38: [ SpeciesId.MUK ] }, + { 1: [ SpeciesId.VOLTORB ], 30: [ SpeciesId.ELECTRODE ] }, + { 1: [ SpeciesId.BRONZOR ], 33: [ SpeciesId.BRONZONG ] }, + { 1: [ SpeciesId.KLINK ], 38: [ SpeciesId.KLANG ], 49: [ SpeciesId.KLINKLANG ] } ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [{ 1: [ SpeciesId.SOLOSIS ], 32: [ SpeciesId.DUOSION ], 41: [ SpeciesId.REUNICLUS ]}]}, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, { 1: [ SpeciesId.PORYGON ], 30: [ SpeciesId.PORYGON2 ]}]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM ]}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.TYPE_NULL ]}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MUK, SpeciesId.ELECTRODE, SpeciesId.BRONZONG, SpeciesId.MAGNEZONE, SpeciesId.PORYGON_Z, SpeciesId.REUNICLUS, SpeciesId.KLINKLANG ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM, SpeciesId.ZYGARDE, SpeciesId.SILVALLY ]}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MEWTWO, SpeciesId.MIRAIDON ]} + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [ SpeciesId.SOLOSIS ], 32: [ SpeciesId.DUOSION ], 41: [ SpeciesId.REUNICLUS ] } ] }, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.DITTO, { 1: [ SpeciesId.PORYGON ], 30: [ SpeciesId.PORYGON2 ] } ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM ] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ { 1: [SpeciesId.TYPE_NULL], 60: [ SpeciesId.SILVALLY ] } ] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MUK, SpeciesId.ELECTRODE, SpeciesId.BRONZONG, SpeciesId.MAGNEZONE, SpeciesId.PORYGON_Z, SpeciesId.REUNICLUS, SpeciesId.KLINKLANG ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROTOM, SpeciesId.ZYGARDE, { 1: [SpeciesId.TYPE_NULL], 60: [ SpeciesId.SILVALLY ] } ] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.MEWTWO, SpeciesId.MIRAIDON ] } }, [BiomeId.END]: { [BiomePoolTier.COMMON]: { @@ -1623,14 +1623,14 @@ export const biomePokemonPools: BiomePokemonPools = { SpeciesId.IRON_THORNS ] }, - [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROARING_MOON, SpeciesId.IRON_VALIANT ]}, - [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.WALKING_WAKE, SpeciesId.IRON_LEAVES, SpeciesId.GOUGING_FIRE, SpeciesId.RAGING_BOLT, SpeciesId.IRON_BOULDER, SpeciesId.IRON_CROWN ]}, - [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ETERNATUS ]}, - [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []}, - [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: []} + [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ROARING_MOON, SpeciesId.IRON_VALIANT ] }, + [BiomePoolTier.RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.WALKING_WAKE, SpeciesId.IRON_LEAVES, SpeciesId.GOUGING_FIRE, SpeciesId.RAGING_BOLT, SpeciesId.IRON_BOULDER, SpeciesId.IRON_CROWN ] }, + [BiomePoolTier.SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ SpeciesId.ETERNATUS ] }, + [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, + [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } } }; @@ -6969,7 +6969,7 @@ export function initBiomes() { ] ], [ SpeciesId.ETERNAL_FLOETTE, PokemonType.FAIRY, -1, [ - [ BiomeId.FAIRY_CAVE, BiomePoolTier.RARE ], + [ BiomeId.FAIRY_CAVE, BiomePoolTier.SUPER_RARE ], [ BiomeId.FAIRY_CAVE, BiomePoolTier.BOSS_RARE ] ] ], @@ -7708,10 +7708,10 @@ export function initBiomes() { const traverseBiome = (biome: BiomeId, depth: number) => { if (biome === BiomeId.END) { - const biomeList = Object.keys(BiomeId).filter(key => !Number.isNaN(Number(key))); + const biomeList = getEnumValues(BiomeId) biomeList.pop(); // Removes BiomeId.END from the list const randIndex = randSeedInt(biomeList.length, 1); // Will never be BiomeId.TOWN - biome = BiomeId[biomeList[randIndex]]; + biome = biomeList[randIndex]; } const linkedBiomes: (BiomeId | [ BiomeId, number ])[] = Array.isArray(biomeLinks[biome]) ? biomeLinks[biome] as (BiomeId | [ BiomeId, number ])[] @@ -7871,7 +7871,7 @@ export function initBiomes() { // const trainerOutput = {}; // for (const b of Object.keys(biomePokemonPools)) { - // const biome = Biome[b]; + // const biome = BiomeId[b]; // pokemonOutput[biome] = {}; // trainerOutput[biome] = {}; @@ -7887,12 +7887,12 @@ export function initBiomes() { // for (const f of biomePokemonPools[b][t][tod]) { // if (typeof f === "number") { - // pokemonOutput[biome][tier][timeOfDay].push(Species[f]); + // pokemonOutput[biome][tier][timeOfDay].push(SpeciesId[f]); // } else { // const tree = {}; // for (const l of Object.keys(f)) { - // tree[l] = f[l].map(s => Species[s]); + // tree[l] = f[l].map(s => SpeciesId[s]); // } // pokemonOutput[biome][tier][timeOfDay].push(tree); diff --git a/src/data/balance/egg-moves.ts b/src/data/balance/egg-moves.ts index fa89e558ba7..f5026abe2ef 100644 --- a/src/data/balance/egg-moves.ts +++ b/src/data/balance/egg-moves.ts @@ -1,8 +1,8 @@ -import { allMoves } from "../data-lists"; -import { getEnumKeys, getEnumValues } from "#app/utils/common"; +import { allMoves } from "#data/data-lists"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; - +import { toReadableString } from "#utils/common"; +import { getEnumKeys, getEnumValues } from "#utils/enums"; export const speciesEggMoves = { [SpeciesId.BULBASAUR]: [ MoveId.SAPPY_SEED, MoveId.MALIGNANT_CHAIN, MoveId.EARTH_POWER, MoveId.MATCHA_GOTCHA ], @@ -26,14 +26,14 @@ export const speciesEggMoves = { [SpeciesId.MEOWTH]: [ MoveId.HEART_STAMP, MoveId.SWORDS_DANCE, MoveId.SIZZLY_SLIDE, MoveId.TAIL_SLAP ], [SpeciesId.PSYDUCK]: [ MoveId.FROST_BREATH, MoveId.AQUA_STEP, MoveId.MYSTICAL_POWER, MoveId.BOUNCY_BUBBLE ], [SpeciesId.MANKEY]: [ MoveId.DRAIN_PUNCH, MoveId.SLACK_OFF, MoveId.METEOR_MASH, MoveId.NO_RETREAT ], - [SpeciesId.GROWLITHE]: [ MoveId.ZING_ZAP, MoveId.PARTING_SHOT, MoveId.MORNING_SUN, MoveId.SACRED_FIRE ], + [SpeciesId.GROWLITHE]: [ MoveId.ZING_ZAP, MoveId.DRAGON_DANCE, MoveId.MORNING_SUN, MoveId.SACRED_FIRE ], [SpeciesId.POLIWAG]: [ MoveId.SLACK_OFF, MoveId.WILDBOLT_STORM, MoveId.DRAIN_PUNCH, MoveId.SURGING_STRIKES ], [SpeciesId.ABRA]: [ MoveId.AURA_SPHERE, MoveId.BADDY_BAD, MoveId.ICE_BEAM, MoveId.PSYSTRIKE ], [SpeciesId.MACHOP]: [ MoveId.COMBAT_TORQUE, MoveId.METEOR_MASH, MoveId.MOUNTAIN_GALE, MoveId.FISSURE ], [SpeciesId.BELLSPROUT]: [ MoveId.SOLAR_BLADE, MoveId.STRENGTH_SAP, MoveId.FIRE_LASH, MoveId.VICTORY_DANCE ], [SpeciesId.TENTACOOL]: [ MoveId.BANEFUL_BUNKER, MoveId.MALIGNANT_CHAIN, MoveId.BOUNCY_BUBBLE, MoveId.STRENGTH_SAP ], [SpeciesId.GEODUDE]: [ MoveId.FLARE_BLITZ, MoveId.HEAD_SMASH, MoveId.SHORE_UP, MoveId.SHELL_SMASH ], - [SpeciesId.PONYTA]: [ MoveId.HEADLONG_RUSH, MoveId.FIRE_LASH, MoveId.SWORDS_DANCE, MoveId.VOLT_TACKLE ], + [SpeciesId.PONYTA]: [ MoveId.HEADLONG_RUSH, MoveId.HIGH_JUMP_KICK, MoveId.SWORDS_DANCE, MoveId.VOLT_TACKLE ], [SpeciesId.SLOWPOKE]: [ MoveId.SPLISHY_SPLASH, MoveId.FROST_BREATH, MoveId.SHED_TAIL, MoveId.MYSTICAL_POWER ], [SpeciesId.MAGNEMITE]: [ MoveId.PARABOLIC_CHARGE, MoveId.FLAMETHROWER, MoveId.ICE_BEAM, MoveId.THUNDERCLAP ], [SpeciesId.FARFETCHD]: [ MoveId.IVY_CUDGEL, MoveId.TRIPLE_ARROWS, MoveId.DRILL_RUN, MoveId.VICTORY_DANCE ], @@ -63,9 +63,9 @@ export const speciesEggMoves = { [SpeciesId.LAPRAS]: [ MoveId.RECOVER, MoveId.FREEZE_DRY, MoveId.SCALD, MoveId.SHELL_SMASH ], [SpeciesId.DITTO]: [ MoveId.MIMIC, MoveId.SKETCH, MoveId.METRONOME, MoveId.IMPRISON ], [SpeciesId.EEVEE]: [ MoveId.WISH, MoveId.NO_RETREAT, MoveId.ZIPPY_ZAP, MoveId.BOOMBURST ], - [SpeciesId.PORYGON]: [ MoveId.THUNDERCLAP, MoveId.AURA_SPHERE, MoveId.FLAMETHROWER, MoveId.TECHNO_BLAST ], + [SpeciesId.PORYGON]: [ MoveId.THUNDERCLAP, MoveId.DAZZLING_GLEAM, MoveId.FLAMETHROWER, MoveId.TECHNO_BLAST ], [SpeciesId.OMANYTE]: [ MoveId.FREEZE_DRY, MoveId.GIGA_DRAIN, MoveId.POWER_GEM, MoveId.STEAM_ERUPTION ], - [SpeciesId.KABUTO]: [ MoveId.CEASELESS_EDGE, MoveId.HIGH_HORSEPOWER, MoveId.CRABHAMMER, MoveId.MIGHTY_CLEAVE ], + [SpeciesId.KABUTO]: [ MoveId.CEASELESS_EDGE, MoveId.HIGH_HORSEPOWER, MoveId.MIGHTY_CLEAVE, MoveId.CRABHAMMER ], [SpeciesId.AERODACTYL]: [ MoveId.FLOATY_FALL, MoveId.HIGH_HORSEPOWER, MoveId.STONE_AXE, MoveId.SWORDS_DANCE ], [SpeciesId.ARTICUNO]: [ MoveId.EARTH_POWER, MoveId.CALM_MIND, MoveId.AURORA_VEIL, MoveId.AEROBLAST ], [SpeciesId.ZAPDOS]: [ MoveId.BLEAKWIND_STORM, MoveId.CALM_MIND, MoveId.SANDSEAR_STORM, MoveId.ELECTRO_SHOT ], @@ -75,8 +75,8 @@ export const speciesEggMoves = { [SpeciesId.MEW]: [ MoveId.PHOTON_GEYSER, MoveId.MOONBLAST, MoveId.ASTRAL_BARRAGE, MoveId.SHELL_SMASH ], [SpeciesId.CHIKORITA]: [ MoveId.SAPPY_SEED, MoveId.STONE_AXE, MoveId.DRAGON_DANCE, MoveId.SPORE ], - [SpeciesId.CYNDAQUIL]: [ MoveId.NASTY_PLOT, MoveId.EARTH_POWER, MoveId.FIERY_DANCE, MoveId.ELECTRO_DRIFT ], - [SpeciesId.TOTODILE]: [ MoveId.THUNDER_PUNCH, MoveId.DRAGON_DANCE, MoveId.PLAY_ROUGH, MoveId.SURGING_STRIKES ], + [SpeciesId.CYNDAQUIL]: [ MoveId.BURNING_BULWARK, MoveId.EARTH_POWER, MoveId.FIERY_DANCE, MoveId.ELECTRO_DRIFT ], + [SpeciesId.TOTODILE]: [ MoveId.THUNDER_FANG, MoveId.DRAGON_DANCE, MoveId.DRAIN_PUNCH, MoveId.SURGING_STRIKES ], [SpeciesId.SENTRET]: [ MoveId.TIDY_UP, MoveId.FAKE_OUT, MoveId.NUZZLE, MoveId.EXTREME_SPEED ], [SpeciesId.HOOTHOOT]: [ MoveId.TAKE_HEART, MoveId.ESPER_WING, MoveId.AEROBLAST, MoveId.BOOMBURST ], [SpeciesId.LEDYBA]: [ MoveId.POLLEN_PUFF, MoveId.MAT_BLOCK, MoveId.PARTING_SHOT, MoveId.SPORE ], @@ -97,7 +97,7 @@ export const speciesEggMoves = { [SpeciesId.MISDREAVUS]: [ MoveId.TAKE_HEART, MoveId.MOONBLAST, MoveId.AURA_SPHERE, MoveId.MOONGEIST_BEAM ], [SpeciesId.UNOWN]: [ MoveId.NATURE_POWER, MoveId.COSMIC_POWER, MoveId.ANCIENT_POWER, MoveId.MYSTICAL_POWER ], [SpeciesId.GIRAFARIG]: [ MoveId.MYSTICAL_POWER, MoveId.NIGHT_DAZE, MoveId.RECOVER, MoveId.BOOMBURST ], - [SpeciesId.PINECO]: [ MoveId.METAL_BURST, MoveId.SHORE_UP, MoveId.BODY_PRESS, MoveId.DIAMOND_STORM ], + [SpeciesId.PINECO]: [ MoveId.METAL_BURST, MoveId.RECOVER, MoveId.LEECH_LIFE, MoveId.SPIN_OUT ], [SpeciesId.DUNSPARCE]: [ MoveId.WICKED_TORQUE, MoveId.MAGICAL_TORQUE, MoveId.BLAZING_TORQUE, MoveId.EXTREME_SPEED ], [SpeciesId.GLIGAR]: [ MoveId.FLOATY_FALL, MoveId.THOUSAND_WAVES, MoveId.SPIKY_SHIELD, MoveId.MIGHTY_CLEAVE ], [SpeciesId.SNUBBULL]: [ MoveId.FACADE, MoveId.HIGH_HORSEPOWER, MoveId.SWORDS_DANCE, MoveId.EXTREME_SPEED ], @@ -111,12 +111,12 @@ export const speciesEggMoves = { [SpeciesId.CORSOLA]: [ MoveId.SCALD, MoveId.FREEZE_DRY, MoveId.STRENGTH_SAP, MoveId.SALT_CURE ], [SpeciesId.REMORAID]: [ MoveId.WATER_SHURIKEN, MoveId.TAKE_HEART, MoveId.SHELL_SIDE_ARM, MoveId.BOUNCY_BUBBLE ], [SpeciesId.DELIBIRD]: [ MoveId.BONEMERANG, MoveId.FLOATY_FALL, MoveId.VICTORY_DANCE, MoveId.GLACIAL_LANCE ], - [SpeciesId.SKARMORY]: [ MoveId.ROOST, MoveId.BODY_PRESS, MoveId.SPIKY_SHIELD, MoveId.BEAK_BLAST ], + [SpeciesId.SKARMORY]: [ MoveId.ROOST, MoveId.BODY_PRESS, MoveId.CEASELESS_EDGE, MoveId.BEAK_BLAST ], [SpeciesId.HOUNDOUR]: [ MoveId.FIERY_WRATH, MoveId.THUNDERBOLT, MoveId.MOONBLAST, MoveId.ARMOR_CANNON ], [SpeciesId.PHANPY]: [ MoveId.SHORE_UP, MoveId.SWORDS_DANCE, MoveId.MOUNTAIN_GALE, MoveId.COLLISION_COURSE ], [SpeciesId.STANTLER]: [ MoveId.THUNDEROUS_KICK, MoveId.PHOTON_GEYSER, MoveId.SWORDS_DANCE, MoveId.BOOMBURST ], [SpeciesId.SMEARGLE]: [ MoveId.CONVERSION, MoveId.BURNING_BULWARK, MoveId.SALT_CURE, MoveId.DARK_VOID ], - [SpeciesId.TYROGUE]: [ MoveId.VICTORY_DANCE, MoveId.THUNDEROUS_KICK, MoveId.METEOR_MASH, MoveId.WICKED_BLOW ], + [SpeciesId.TYROGUE]: [ MoveId.DARKEST_LARIAT, MoveId.THUNDEROUS_KICK, MoveId.METEOR_MASH, MoveId.VICTORY_DANCE ], [SpeciesId.SMOOCHUM]: [ MoveId.LUSTER_PURGE, MoveId.AURA_SPHERE, MoveId.FREEZE_DRY, MoveId.QUIVER_DANCE ], [SpeciesId.ELEKID]: [ MoveId.FIRE_LASH, MoveId.ZING_ZAP, MoveId.MOUNTAIN_GALE, MoveId.SHIFT_GEAR ], [SpeciesId.MAGBY]: [ MoveId.THUNDERCLAP, MoveId.EARTH_POWER, MoveId.ENERGY_BALL, MoveId.BLUE_FLARE ], @@ -142,7 +142,7 @@ export const speciesEggMoves = { [SpeciesId.RALTS]: [ MoveId.PSYBLADE, MoveId.BITTER_BLADE, MoveId.NO_RETREAT, MoveId.BOOMBURST ], [SpeciesId.SURSKIT]: [ MoveId.POLLEN_PUFF, MoveId.FIERY_DANCE, MoveId.BOUNCY_BUBBLE, MoveId.AEROBLAST ], [SpeciesId.SHROOMISH]: [ MoveId.ACCELEROCK, MoveId.TRAILBLAZE, MoveId.STORM_THROW, MoveId.SAPPY_SEED ], - [SpeciesId.SLAKOTH]: [ MoveId.FACADE, MoveId.DRAIN_PUNCH, MoveId.KNOCK_OFF, MoveId.SKILL_SWAP ], + [SpeciesId.SLAKOTH]: [ MoveId.CRUSH_GRIP, MoveId.DRAIN_PUNCH, MoveId.PARTING_SHOT, MoveId.SKILL_SWAP ], [SpeciesId.NINCADA]: [ MoveId.BULLDOZE, MoveId.STICKY_WEB, MoveId.SHADOW_BONE, MoveId.SHELL_SMASH ], [SpeciesId.WHISMUR]: [ MoveId.ALLURING_VOICE, MoveId.SHIFT_GEAR, MoveId.SPARKLING_ARIA, MoveId.TORCH_SONG ], [SpeciesId.MAKUHITA]: [ MoveId.COMBAT_TORQUE, MoveId.SLACK_OFF, MoveId.HEAT_CRASH, MoveId.DOUBLE_IRON_BASH ], @@ -167,7 +167,7 @@ export const speciesEggMoves = { [SpeciesId.SPINDA]: [ MoveId.SUPERPOWER, MoveId.SLACK_OFF, MoveId.FLEUR_CANNON, MoveId.V_CREATE ], [SpeciesId.TRAPINCH]: [ MoveId.FIRE_LASH, MoveId.DRAGON_DARTS, MoveId.THOUSAND_ARROWS, MoveId.DRAGON_ENERGY ], [SpeciesId.CACNEA]: [ MoveId.EARTH_POWER, MoveId.CEASELESS_EDGE, MoveId.NIGHT_DAZE, MoveId.IVY_CUDGEL ], - [SpeciesId.SWABLU]: [ MoveId.ROOST, MoveId.NASTY_PLOT, MoveId.FLOATY_FALL, MoveId.BOOMBURST ], + [SpeciesId.SWABLU]: [ MoveId.ROOST, MoveId.TAKE_HEART, MoveId.AEROBLAST, MoveId.BOOMBURST ], [SpeciesId.ZANGOOSE]: [ MoveId.FACADE, MoveId.HIGH_HORSEPOWER, MoveId.EXTREME_SPEED, MoveId.TIDY_UP ], [SpeciesId.SEVIPER]: [ MoveId.ICE_BEAM, MoveId.BITTER_BLADE, MoveId.SUCKER_PUNCH, MoveId.NO_RETREAT ], [SpeciesId.LUNATONE]: [ MoveId.REVELATION_DANCE, MoveId.MOONGEIST_BEAM, MoveId.SHELL_SMASH, MoveId.LUMINA_CRASH ], @@ -203,13 +203,13 @@ export const speciesEggMoves = { [SpeciesId.JIRACHI]: [ MoveId.TACHYON_CUTTER, MoveId.TRIPLE_ARROWS, MoveId.ROCK_SLIDE, MoveId.SHELL_SMASH ], [SpeciesId.DEOXYS]: [ MoveId.COLLISION_COURSE, MoveId.FUSION_FLARE, MoveId.PARTING_SHOT, MoveId.LUMINA_CRASH ], - [SpeciesId.TURTWIG]: [ MoveId.SHELL_SMASH, MoveId.MIGHTY_CLEAVE, MoveId.ICE_SPINNER, MoveId.SAPPY_SEED ], + [SpeciesId.TURTWIG]: [ MoveId.SHELL_SMASH, MoveId.STONE_AXE, MoveId.ICE_SPINNER, MoveId.SAPPY_SEED ], [SpeciesId.CHIMCHAR]: [ MoveId.THUNDERBOLT, MoveId.SECRET_SWORD, MoveId.TRIPLE_AXEL, MoveId.SACRED_FIRE ], [SpeciesId.PIPLUP]: [ MoveId.KINGS_SHIELD, MoveId.TACHYON_CUTTER, MoveId.FREEZE_DRY, MoveId.STEAM_ERUPTION ], [SpeciesId.STARLY]: [ MoveId.SWORDS_DANCE, MoveId.HEAD_CHARGE, MoveId.FLARE_BLITZ, MoveId.EXTREME_SPEED ], [SpeciesId.BIDOOF]: [ MoveId.EXTREME_SPEED, MoveId.COSMIC_POWER, MoveId.POWER_TRIP, MoveId.AQUA_STEP ], [SpeciesId.KRICKETOT]: [ MoveId.BONEMERANG, MoveId.VICTORY_DANCE, MoveId.STONE_AXE, MoveId.POPULATION_BOMB ], - [SpeciesId.SHINX]: [ MoveId.FIRE_LASH, MoveId.TRIPLE_AXEL, MoveId.ZIPPY_ZAP, MoveId.BOLT_STRIKE ], + [SpeciesId.SHINX]: [ MoveId.THUNDEROUS_KICK, MoveId.TRIPLE_AXEL, MoveId.ZIPPY_ZAP, MoveId.BOLT_STRIKE ], [SpeciesId.BUDEW]: [ MoveId.FIERY_DANCE, MoveId.ACID_SPRAY, MoveId.BOUNCY_BUBBLE, MoveId.QUIVER_DANCE ], [SpeciesId.CRANIDOS]: [ MoveId.VOLT_TACKLE, MoveId.ACCELEROCK, MoveId.FLARE_BLITZ, MoveId.SHIFT_GEAR ], [SpeciesId.SHIELDON]: [ MoveId.SHORE_UP, MoveId.BODY_PRESS, MoveId.KINGS_SHIELD, MoveId.DIAMOND_STORM ], @@ -253,14 +253,14 @@ export const speciesEggMoves = { [SpeciesId.PHIONE]: [ MoveId.BOUNCY_BUBBLE, MoveId.FREEZE_DRY, MoveId.STORED_POWER, MoveId.ORIGIN_PULSE ], [SpeciesId.MANAPHY]: [ MoveId.BOUNCY_BUBBLE, MoveId.FROST_BREATH, MoveId.WILDBOLT_STORM, MoveId.ORIGIN_PULSE ], [SpeciesId.DARKRAI]: [ MoveId.FIERY_WRATH, MoveId.MOONBLAST, MoveId.FIERY_DANCE, MoveId.MAKE_IT_RAIN ], - [SpeciesId.SHAYMIN]: [ MoveId.MATCHA_GOTCHA, MoveId.FIERY_DANCE, MoveId.AEROBLAST, MoveId.QUIVER_DANCE ], + [SpeciesId.SHAYMIN]: [ MoveId.MATCHA_GOTCHA, MoveId.HEAT_WAVE, MoveId.AEROBLAST, MoveId.QUIVER_DANCE ], [SpeciesId.ARCEUS]: [ MoveId.NO_RETREAT, MoveId.COLLISION_COURSE, MoveId.ASTRAL_BARRAGE, MoveId.MULTI_ATTACK ], [SpeciesId.VICTINI]: [ MoveId.BLUE_FLARE, MoveId.BOLT_STRIKE, MoveId.LUSTER_PURGE, MoveId.VICTORY_DANCE ], [SpeciesId.SNIVY]: [ MoveId.FLAMETHROWER, MoveId.CLANGING_SCALES, MoveId.MAKE_IT_RAIN, MoveId.FLEUR_CANNON ], [SpeciesId.TEPIG]: [ MoveId.WAVE_CRASH, MoveId.VOLT_TACKLE, MoveId.AXE_KICK, MoveId.VICTORY_DANCE ], [SpeciesId.OSHAWOTT]: [ MoveId.FREEZE_DRY, MoveId.SHELL_SIDE_ARM, MoveId.SACRED_SWORD, MoveId.SHELL_SMASH ], - [SpeciesId.PATRAT]: [ MoveId.FAKE_OUT, MoveId.SWORDS_DANCE, MoveId.DYNAMIC_PUNCH, MoveId.EXTREME_SPEED ], + [SpeciesId.PATRAT]: [ MoveId.FAKE_OUT, MoveId.INSTRUCT, MoveId.DYNAMIC_PUNCH, MoveId.EXTREME_SPEED ], [SpeciesId.LILLIPUP]: [ MoveId.CLOSE_COMBAT, MoveId.BODY_SLAM, MoveId.HIGH_HORSEPOWER, MoveId.LAST_RESPECTS ], [SpeciesId.PURRLOIN]: [ MoveId.ENCORE, MoveId.OBSTRUCT, MoveId.PARTING_SHOT, MoveId.WICKED_BLOW ], [SpeciesId.PANSAGE]: [ MoveId.SWORDS_DANCE, MoveId.FIRE_LASH, MoveId.EARTHQUAKE, MoveId.IVY_CUDGEL ], @@ -269,7 +269,7 @@ export const speciesEggMoves = { [SpeciesId.MUNNA]: [ MoveId.COSMIC_POWER, MoveId.AURA_SPHERE, MoveId.LUNAR_BLESSING, MoveId.MYSTICAL_POWER ], [SpeciesId.PIDOVE]: [ MoveId.SLASH, MoveId.TIDY_UP, MoveId.FLOATY_FALL, MoveId.TRIPLE_ARROWS ], [SpeciesId.BLITZLE]: [ MoveId.HORN_LEECH, MoveId.SWORDS_DANCE, MoveId.FLARE_BLITZ, MoveId.BOLT_STRIKE ], - [SpeciesId.ROGGENROLA]: [ MoveId.BODY_PRESS, MoveId.CURSE, MoveId.SHORE_UP, MoveId.DIAMOND_STORM ], + [SpeciesId.ROGGENROLA]: [ MoveId.BODY_PRESS, MoveId.SPIKY_SHIELD, MoveId.SHORE_UP, MoveId.DIAMOND_STORM ], [SpeciesId.WOOBAT]: [ MoveId.ESPER_WING, MoveId.STORED_POWER, MoveId.MYSTICAL_FIRE, MoveId.OBLIVION_WING ], [SpeciesId.DRILBUR]: [ MoveId.METEOR_MASH, MoveId.ICE_SPINNER, MoveId.SHIFT_GEAR, MoveId.THOUSAND_ARROWS ], [SpeciesId.AUDINO]: [ MoveId.TAKE_HEART, MoveId.MOONBLAST, MoveId.WISH, MoveId.MATCHA_GOTCHA ], @@ -298,7 +298,7 @@ export const speciesEggMoves = { [SpeciesId.SOLOSIS]: [ MoveId.MIST_BALL, MoveId.SPEED_SWAP, MoveId.FLAMETHROWER, MoveId.LIGHT_OF_RUIN ], [SpeciesId.DUCKLETT]: [ MoveId.SPLISHY_SPLASH, MoveId.SANDSEAR_STORM, MoveId.WILDBOLT_STORM, MoveId.QUIVER_DANCE ], [SpeciesId.VANILLITE]: [ MoveId.EARTH_POWER, MoveId.AURORA_VEIL, MoveId.CALM_MIND, MoveId.SPARKLY_SWIRL ], - [SpeciesId.DEERLING]: [ MoveId.TIDY_UP, MoveId.HEADBUTT, MoveId.COMBAT_TORQUE, MoveId.FLOWER_TRICK ], + [SpeciesId.DEERLING]: [ MoveId.TIDY_UP, MoveId.HEADBUTT, MoveId.AXE_KICK, MoveId.FLOWER_TRICK ], [SpeciesId.EMOLGA]: [ MoveId.ICICLE_CRASH, MoveId.ZING_ZAP, MoveId.FLOATY_FALL, MoveId.ELECTRIFY ], [SpeciesId.KARRABLAST]: [ MoveId.LEECH_LIFE, MoveId.BITTER_BLADE, MoveId.OBSTRUCT, MoveId.DOUBLE_IRON_BASH ], [SpeciesId.FOONGUS]: [ MoveId.POLLEN_PUFF, MoveId.PARTING_SHOT, MoveId.FOUL_PLAY, MoveId.SAPPY_SEED ], @@ -322,8 +322,8 @@ export const speciesEggMoves = { [SpeciesId.BOUFFALANT]: [ MoveId.HORN_LEECH, MoveId.HIGH_JUMP_KICK, MoveId.HEAD_SMASH, MoveId.FLARE_BLITZ ], [SpeciesId.RUFFLET]: [ MoveId.FLOATY_FALL, MoveId.AURA_SPHERE, MoveId.NO_RETREAT, MoveId.BOLT_BEAK ], [SpeciesId.VULLABY]: [ MoveId.FOUL_PLAY, MoveId.BODY_PRESS, MoveId.ROOST, MoveId.RUINATION ], - [SpeciesId.HEATMOR]: [ MoveId.EARTH_POWER, MoveId.OVERHEAT, MoveId.THUNDERBOLT, MoveId.V_CREATE ], - [SpeciesId.DURANT]: [ MoveId.HIGH_HORSEPOWER, MoveId.FIRST_IMPRESSION, MoveId.SWORDS_DANCE, MoveId.BEHEMOTH_BASH ], + [SpeciesId.HEATMOR]: [ MoveId.EARTH_POWER, MoveId.OVERHEAT, MoveId.SUPERCELL_SLAM, MoveId.V_CREATE ], + [SpeciesId.DURANT]: [ MoveId.HIGH_HORSEPOWER, MoveId.FIRST_IMPRESSION, MoveId.U_TURN, MoveId.BEHEMOTH_BASH ], [SpeciesId.DEINO]: [ MoveId.FIERY_WRATH, MoveId.ESPER_WING, MoveId.SLUDGE_BOMB, MoveId.FICKLE_BEAM ], [SpeciesId.LARVESTA]: [ MoveId.THUNDERBOLT, MoveId.DAZZLING_GLEAM, MoveId.EARTH_POWER, MoveId.HYDRO_STEAM ], [SpeciesId.COBALION]: [ MoveId.BEHEMOTH_BLADE, MoveId.MIGHTY_CLEAVE, MoveId.CEASELESS_EDGE, MoveId.VICTORY_DANCE ], @@ -381,8 +381,8 @@ export const speciesEggMoves = { [SpeciesId.ROWLET]: [ MoveId.THOUSAND_ARROWS, MoveId.SHADOW_BONE, MoveId.FIRST_IMPRESSION, MoveId.VICTORY_DANCE ], [SpeciesId.LITTEN]: [ MoveId.SUCKER_PUNCH, MoveId.PARTING_SHOT, MoveId.SLACK_OFF, MoveId.SACRED_FIRE ], [SpeciesId.POPPLIO]: [ MoveId.PSYCHIC_NOISE, MoveId.MOONLIGHT, MoveId.OVERDRIVE, MoveId.TORCH_SONG ], - [SpeciesId.PIKIPEK]: [ MoveId.DUAL_WINGBEAT, MoveId.BONE_RUSH, MoveId.BURNING_BULWARK, MoveId.POPULATION_BOMB ], - [SpeciesId.YUNGOOS]: [ MoveId.EXTREME_SPEED, MoveId.KNOCK_OFF, MoveId.TIDY_UP, MoveId.MULTI_ATTACK ], + [SpeciesId.PIKIPEK]: [ MoveId.TRAILBLAZE, MoveId.BONE_RUSH, MoveId.BURNING_BULWARK, MoveId.POPULATION_BOMB ], + [SpeciesId.YUNGOOS]: [ MoveId.FAKE_OUT, MoveId.HIGH_HORSEPOWER, MoveId.TIDY_UP, MoveId.EXTREME_SPEED ], [SpeciesId.GRUBBIN]: [ MoveId.ICE_BEAM, MoveId.EARTH_POWER, MoveId.CALM_MIND, MoveId.THUNDERCLAP ], [SpeciesId.CRABRAWLER]: [ MoveId.JET_PUNCH, MoveId.SHORE_UP, MoveId.MACH_PUNCH, MoveId.SURGING_STRIKES ], [SpeciesId.ORICORIO]: [ MoveId.QUIVER_DANCE, MoveId.FIERY_DANCE, MoveId.THUNDERCLAP, MoveId.OBLIVION_WING ], @@ -396,7 +396,7 @@ export const speciesEggMoves = { [SpeciesId.MORELULL]: [ MoveId.CALM_MIND, MoveId.SAPPY_SEED, MoveId.DRAINING_KISS, MoveId.MATCHA_GOTCHA ], [SpeciesId.SALANDIT]: [ MoveId.SCALD, MoveId.MALIGNANT_CHAIN, MoveId.CORE_ENFORCER, MoveId.ERUPTION ], [SpeciesId.STUFFUL]: [ MoveId.DRAIN_PUNCH, MoveId.METEOR_MASH, MoveId.TRIPLE_AXEL, MoveId.RAGE_FIST ], - [SpeciesId.BOUNSWEET]: [ MoveId.TRIPLE_AXEL, MoveId.AQUA_STEP, MoveId.THUNDEROUS_KICK, MoveId.SAPPY_SEED ], + [SpeciesId.BOUNSWEET]: [ MoveId.TRIPLE_AXEL, MoveId.AQUA_STEP, MoveId.THUNDEROUS_KICK, MoveId.FLOWER_TRICK ], [SpeciesId.COMFEY]: [ MoveId.REVIVAL_BLESSING, MoveId.TAKE_HEART, MoveId.STRENGTH_SAP, MoveId.MATCHA_GOTCHA ], [SpeciesId.ORANGURU]: [ MoveId.JUNGLE_HEALING, MoveId.YAWN, MoveId.FOLLOW_ME, MoveId.LUMINA_CRASH ], [SpeciesId.PASSIMIAN]: [ MoveId.PYRO_BALL, MoveId.SUCKER_PUNCH, MoveId.ZING_ZAP, MoveId.VICTORY_DANCE ], @@ -423,7 +423,7 @@ export const speciesEggMoves = { [SpeciesId.PHEROMOSA]: [ MoveId.SECRET_SWORD, MoveId.MAKE_IT_RAIN, MoveId.ATTACK_ORDER, MoveId.DIAMOND_STORM ], [SpeciesId.XURKITREE]: [ MoveId.FLAMETHROWER, MoveId.GIGA_DRAIN, MoveId.TAIL_GLOW, MoveId.THUNDERCLAP ], [SpeciesId.CELESTEELA]: [ MoveId.RECOVER, MoveId.BUZZY_BUZZ, MoveId.EARTH_POWER, MoveId.OBLIVION_WING ], - [SpeciesId.KARTANA]: [ MoveId.MIGHTY_CLEAVE, MoveId.DUAL_CHOP, MoveId.BITTER_BLADE, MoveId.BEHEMOTH_BLADE ], + [SpeciesId.KARTANA]: [ MoveId.MIGHTY_CLEAVE, MoveId.DUAL_CHOP, MoveId.BEHEMOTH_BLADE, MoveId.BITTER_BLADE ], [SpeciesId.GUZZLORD]: [ MoveId.SUCKER_PUNCH, MoveId.COMEUPPANCE, MoveId.SLACK_OFF, MoveId.SHED_TAIL ], [SpeciesId.NECROZMA]: [ MoveId.DYNAMAX_CANNON, MoveId.SACRED_FIRE, MoveId.ASTRAL_BARRAGE, MoveId.CLANGOROUS_SOUL ], [SpeciesId.MAGEARNA]: [ MoveId.STRENGTH_SAP, MoveId.EARTH_POWER, MoveId.MOONBLAST, MoveId.MAKE_IT_RAIN ], @@ -431,23 +431,23 @@ export const speciesEggMoves = { [SpeciesId.POIPOLE]: [ MoveId.MALIGNANT_CHAIN, MoveId.ICE_BEAM, MoveId.ARMOR_CANNON, MoveId.CLANGING_SCALES ], [SpeciesId.STAKATAKA]: [ MoveId.HEAVY_SLAM, MoveId.SHORE_UP, MoveId.CURSE, MoveId.SALT_CURE ], [SpeciesId.BLACEPHALON]: [ MoveId.STEEL_BEAM, MoveId.MOONBLAST, MoveId.CHLOROBLAST, MoveId.MOONGEIST_BEAM ], - [SpeciesId.ZERAORA]: [ MoveId.SWORDS_DANCE, MoveId.U_TURN, MoveId.COLLISION_COURSE, MoveId.TRIPLE_AXEL ], + [SpeciesId.ZERAORA]: [ MoveId.SWORDS_DANCE, MoveId.FIRE_LASH, MoveId.COLLISION_COURSE, MoveId.TRIPLE_AXEL ], [SpeciesId.MELTAN]: [ MoveId.BULLET_PUNCH, MoveId.DRAIN_PUNCH, MoveId.BULK_UP, MoveId.PLASMA_FISTS ], [SpeciesId.ALOLA_RATTATA]: [ MoveId.FALSE_SURRENDER, MoveId.PSYCHIC_FANGS, MoveId.COIL, MoveId.EXTREME_SPEED ], [SpeciesId.ALOLA_SANDSHREW]: [ MoveId.SPIKY_SHIELD, MoveId.LIQUIDATION, MoveId.SHIFT_GEAR, MoveId.GLACIAL_LANCE ], - [SpeciesId.ALOLA_VULPIX]: [ MoveId.MOONBLAST, MoveId.GLARE, MoveId.MYSTICAL_FIRE, MoveId.REVIVAL_BLESSING ], + [SpeciesId.ALOLA_VULPIX]: [ MoveId.MOONBLAST, MoveId.GLARE, MoveId.MYSTICAL_FIRE, MoveId.LUNAR_BLESSING ], [SpeciesId.ALOLA_DIGLETT]: [ MoveId.THOUSAND_WAVES, MoveId.SWORDS_DANCE, MoveId.TRIPLE_DIVE, MoveId.PYRO_BALL ], [SpeciesId.ALOLA_MEOWTH]: [ MoveId.BADDY_BAD, MoveId.BUZZY_BUZZ, MoveId.PARTING_SHOT, MoveId.MAKE_IT_RAIN ], - [SpeciesId.ALOLA_GEODUDE]: [ MoveId.THOUSAND_WAVES, MoveId.BULK_UP, MoveId.STONE_AXE, MoveId.EXTREME_SPEED ], + [SpeciesId.ALOLA_GEODUDE]: [ MoveId.LANDS_WRATH, MoveId.FUSION_BOLT, MoveId.STONE_AXE, MoveId.EXTREME_SPEED ], [SpeciesId.ALOLA_GRIMER]: [ MoveId.SUCKER_PUNCH, MoveId.BARB_BARRAGE, MoveId.RECOVER, MoveId.SURGING_STRIKES ], [SpeciesId.GROOKEY]: [ MoveId.ROCK_SLIDE, MoveId.PLAY_ROUGH, MoveId.GRASSY_GLIDE, MoveId.CLANGOROUS_SOUL ], - [SpeciesId.SCORBUNNY]: [ MoveId.EXTREME_SPEED, MoveId.HIGH_JUMP_KICK, MoveId.TRIPLE_AXEL, MoveId.BOLT_STRIKE ], + [SpeciesId.SCORBUNNY]: [ MoveId.EXTREME_SPEED, MoveId.HIGH_JUMP_KICK, MoveId.SUPERCELL_SLAM, MoveId.TRIPLE_AXEL ], [SpeciesId.SOBBLE]: [ MoveId.AEROBLAST, MoveId.FROST_BREATH, MoveId.ENERGY_BALL, MoveId.NASTY_PLOT ], [SpeciesId.SKWOVET]: [ MoveId.SUCKER_PUNCH, MoveId.SLACK_OFF, MoveId.COIL, MoveId.POPULATION_BOMB ], [SpeciesId.ROOKIDEE]: [ MoveId.ROOST, MoveId.BODY_PRESS, MoveId.KINGS_SHIELD, MoveId.BEHEMOTH_BASH ], [SpeciesId.BLIPBUG]: [ MoveId.HEAL_ORDER, MoveId.LUSTER_PURGE, MoveId.SLEEP_POWDER, MoveId.TAIL_GLOW ], - [SpeciesId.NICKIT]: [ MoveId.BADDY_BAD, MoveId.FLAMETHROWER, MoveId.SPARKLY_SWIRL, MoveId.MAKE_IT_RAIN ], + [SpeciesId.NICKIT]: [ MoveId.BADDY_BAD, MoveId.MYSTICAL_FIRE, MoveId.SPARKLY_SWIRL, MoveId.MAKE_IT_RAIN ], [SpeciesId.GOSSIFLEUR]: [ MoveId.PARTING_SHOT, MoveId.STRENGTH_SAP, MoveId.SAPPY_SEED, MoveId.SEED_FLARE ], [SpeciesId.WOOLOO]: [ MoveId.NUZZLE, MoveId.MILK_DRINK, MoveId.BODY_PRESS, MoveId.MULTI_ATTACK ], [SpeciesId.CHEWTLE]: [ MoveId.ICE_FANG, MoveId.PSYCHIC_FANGS, MoveId.SHELL_SMASH, MoveId.MIGHTY_CLEAVE ], @@ -467,7 +467,7 @@ export const speciesEggMoves = { [SpeciesId.FALINKS]: [ MoveId.BATON_PASS, MoveId.POWER_TRIP, MoveId.COMBAT_TORQUE, MoveId.HEAL_ORDER ], [SpeciesId.PINCURCHIN]: [ MoveId.TRICK_ROOM, MoveId.VOLT_SWITCH, MoveId.STRENGTH_SAP, MoveId.THUNDERCLAP ], [SpeciesId.SNOM]: [ MoveId.FROST_BREATH, MoveId.HEAL_ORDER, MoveId.EARTH_POWER, MoveId.SPORE ], - [SpeciesId.STONJOURNER]: [ MoveId.BODY_PRESS, MoveId.HELPING_HAND, MoveId.ACCELEROCK, MoveId.DIAMOND_STORM ], + [SpeciesId.STONJOURNER]: [ MoveId.AXE_KICK, MoveId.HELPING_HAND, MoveId.ACCELEROCK, MoveId.DIAMOND_STORM ], [SpeciesId.EISCUE]: [ MoveId.TRIPLE_AXEL, MoveId.AQUA_STEP, MoveId.AXE_KICK, MoveId.SHELL_SMASH ], [SpeciesId.INDEEDEE]: [ MoveId.MATCHA_GOTCHA, MoveId.EXPANDING_FORCE, MoveId.MOONBLAST, MoveId.REVIVAL_BLESSING ], [SpeciesId.MORPEKO]: [ MoveId.TRIPLE_AXEL, MoveId.OBSTRUCT, MoveId.SWORDS_DANCE, MoveId.COLLISION_COURSE ], @@ -478,8 +478,8 @@ export const speciesEggMoves = { [SpeciesId.ARCTOVISH]: [ MoveId.ICE_FANG, MoveId.THUNDER_FANG, MoveId.HIGH_HORSEPOWER, MoveId.SHIFT_GEAR ], [SpeciesId.DURALUDON]: [ MoveId.CORE_ENFORCER, MoveId.BODY_PRESS, MoveId.RECOVER, MoveId.TACHYON_CUTTER ], [SpeciesId.DREEPY]: [ MoveId.SHADOW_BONE, MoveId.POWER_UP_PUNCH, MoveId.FIRE_LASH, MoveId.DIRE_CLAW ], - [SpeciesId.ZACIAN]: [ MoveId.MAGICAL_TORQUE, MoveId.MIGHTY_CLEAVE, MoveId.BITTER_BLADE, MoveId.PRECIPICE_BLADES ], - [SpeciesId.ZAMAZENTA]: [ MoveId.BULK_UP, MoveId.BODY_PRESS, MoveId.SLACK_OFF, MoveId.DIAMOND_STORM ], + [SpeciesId.ZACIAN]: [ MoveId.MAGICAL_TORQUE, MoveId.MIGHTY_CLEAVE, MoveId.EARTHQUAKE, MoveId.BITTER_BLADE ], + [SpeciesId.ZAMAZENTA]: [ MoveId.BULK_UP, MoveId.BODY_PRESS, MoveId.POWER_TRIP, MoveId.SLACK_OFF ], [SpeciesId.ETERNATUS]: [ MoveId.BODY_PRESS, MoveId.NASTY_PLOT, MoveId.MALIGNANT_CHAIN, MoveId.DRAGON_ENERGY ], [SpeciesId.KUBFU]: [ MoveId.METEOR_MASH, MoveId.DRAIN_PUNCH, MoveId.JET_PUNCH, MoveId.DRAGON_DANCE ], [SpeciesId.ZARUDE]: [ MoveId.SAPPY_SEED, MoveId.MIGHTY_CLEAVE, MoveId.WICKED_BLOW, MoveId.VICTORY_DANCE ], @@ -511,18 +511,18 @@ export const speciesEggMoves = { [SpeciesId.FUECOCO]: [ MoveId.ALLURING_VOICE, MoveId.SLACK_OFF, MoveId.OVERDRIVE, MoveId.MOONGEIST_BEAM ], [SpeciesId.QUAXLY]: [ MoveId.DRAGON_DANCE, MoveId.TRIPLE_AXEL, MoveId.POWER_TRIP, MoveId.THUNDEROUS_KICK ], [SpeciesId.LECHONK]: [ MoveId.MILK_DRINK, MoveId.PSYSHIELD_BASH, MoveId.BLAZING_TORQUE, MoveId.FILLET_AWAY ], - [SpeciesId.TAROUNTULA]: [ MoveId.STONE_AXE, MoveId.LEECH_LIFE, MoveId.THIEF, MoveId.SPORE ], + [SpeciesId.TAROUNTULA]: [ MoveId.STONE_AXE, MoveId.LEECH_LIFE, MoveId.FAKE_OUT, MoveId.SPORE ], [SpeciesId.NYMBLE]: [ MoveId.KNOCK_OFF, MoveId.FELL_STINGER, MoveId.ATTACK_ORDER, MoveId.WICKED_BLOW ], [SpeciesId.PAWMI]: [ MoveId.DRAIN_PUNCH, MoveId.METEOR_MASH, MoveId.JET_PUNCH, MoveId.PLASMA_FISTS ], [SpeciesId.TANDEMAUS]: [ MoveId.BATON_PASS, MoveId.COVET, MoveId.SIZZLY_SLIDE, MoveId.REVIVAL_BLESSING ], [SpeciesId.FIDOUGH]: [ MoveId.SOFT_BOILED, MoveId.HIGH_HORSEPOWER, MoveId.SIZZLY_SLIDE, MoveId.TIDY_UP ], [SpeciesId.SMOLIV]: [ MoveId.STRENGTH_SAP, MoveId.EARTH_POWER, MoveId.CALM_MIND, MoveId.BOOMBURST ], [SpeciesId.SQUAWKABILLY]: [ MoveId.PARTING_SHOT, MoveId.EARTHQUAKE, MoveId.FLARE_BLITZ, MoveId.EXTREME_SPEED ], - [SpeciesId.NACLI]: [ MoveId.BODY_PRESS, MoveId.TOXIC, MoveId.CURSE, MoveId.DIAMOND_STORM ], + [SpeciesId.NACLI]: [ MoveId.KNOCK_OFF, MoveId.TOXIC, MoveId.SAND_TOMB, MoveId.DIAMOND_STORM ], [SpeciesId.CHARCADET]: [ MoveId.SACRED_SWORD, MoveId.PHOTON_GEYSER, MoveId.MOONBLAST, MoveId.SPECTRAL_THIEF ], [SpeciesId.TADBULB]: [ MoveId.PARABOLIC_CHARGE, MoveId.SCALD, MoveId.EARTH_POWER, MoveId.ELECTRO_SHOT ], [SpeciesId.WATTREL]: [ MoveId.NASTY_PLOT, MoveId.SPLISHY_SPLASH, MoveId.SANDSEAR_STORM, MoveId.WILDBOLT_STORM ], - [SpeciesId.MASCHIFF]: [ MoveId.PARTING_SHOT, MoveId.COMBAT_TORQUE, MoveId.PSYCHIC_FANGS, MoveId.NO_RETREAT ], + [SpeciesId.MASCHIFF]: [ MoveId.PARTING_SHOT, MoveId.LEECH_LIFE, MoveId.PSYCHIC_FANGS, MoveId.NO_RETREAT ], [SpeciesId.SHROODLE]: [ MoveId.GASTRO_ACID, MoveId.PARTING_SHOT, MoveId.TOXIC, MoveId.SKETCH ], [SpeciesId.BRAMBLIN]: [ MoveId.TAILWIND, MoveId.STRENGTH_SAP, MoveId.FLOWER_TRICK, MoveId.LAST_RESPECTS ], [SpeciesId.TOEDSCOOL]: [ MoveId.STRENGTH_SAP, MoveId.TOPSY_TURVY, MoveId.SAPPY_SEED, MoveId.TAIL_GLOW ], @@ -535,7 +535,7 @@ export const speciesEggMoves = { [SpeciesId.BOMBIRDIER]: [ MoveId.FLOATY_FALL, MoveId.SWORDS_DANCE, MoveId.SUCKER_PUNCH, MoveId.MIGHTY_CLEAVE ], [SpeciesId.FINIZEN]: [ MoveId.TRIPLE_AXEL, MoveId.DRAIN_PUNCH, MoveId.HEADLONG_RUSH, MoveId.SURGING_STRIKES ], [SpeciesId.VAROOM]: [ MoveId.COMBAT_TORQUE, MoveId.U_TURN, MoveId.BLAZING_TORQUE, MoveId.NOXIOUS_TORQUE ], - [SpeciesId.CYCLIZAR]: [ MoveId.PARTING_SHOT, MoveId.FIRE_LASH, MoveId.MAGICAL_TORQUE, MoveId.GLAIVE_RUSH ], + [SpeciesId.CYCLIZAR]: [ MoveId.PARTING_SHOT, MoveId.FIRE_LASH, MoveId.HIGH_HORSEPOWER, MoveId.MAGICAL_TORQUE ], [SpeciesId.ORTHWORM]: [ MoveId.SIZZLY_SLIDE, MoveId.COIL, MoveId.BODY_PRESS, MoveId.SHORE_UP ], [SpeciesId.GLIMMET]: [ MoveId.CALM_MIND, MoveId.GIGA_DRAIN, MoveId.FIERY_DANCE, MoveId.MALIGNANT_CHAIN ], [SpeciesId.GREAVARD]: [ MoveId.SHADOW_BONE, MoveId.SIZZLY_SLIDE, MoveId.SHORE_UP, MoveId.COLLISION_COURSE ], @@ -548,7 +548,7 @@ export const speciesEggMoves = { [SpeciesId.SCREAM_TAIL]: [ MoveId.TORCH_SONG, MoveId.GLITZY_GLOW, MoveId.MOONLIGHT, MoveId.SPARKLY_SWIRL ], [SpeciesId.BRUTE_BONNET]: [ MoveId.SAPPY_SEED, MoveId.STRENGTH_SAP, MoveId.EARTHQUAKE, MoveId.WICKED_BLOW ], [SpeciesId.FLUTTER_MANE]: [ MoveId.MOONLIGHT, MoveId.NASTY_PLOT, MoveId.EARTH_POWER, MoveId.MOONGEIST_BEAM ], - [SpeciesId.SLITHER_WING]: [ MoveId.MIGHTY_CLEAVE, MoveId.THUNDEROUS_KICK, MoveId.FIRE_LASH, MoveId.VICTORY_DANCE ], + [SpeciesId.SLITHER_WING]: [ MoveId.ROCK_SLIDE, MoveId.THUNDEROUS_KICK, MoveId.SUNSTEEL_STRIKE, MoveId.VICTORY_DANCE ], [SpeciesId.SANDY_SHOCKS]: [ MoveId.MORNING_SUN, MoveId.ICE_BEAM, MoveId.NASTY_PLOT, MoveId.THUNDERCLAP ], [SpeciesId.IRON_TREADS]: [ MoveId.FUSION_BOLT, MoveId.SHIFT_GEAR, MoveId.SHORE_UP, MoveId.SUNSTEEL_STRIKE ], [SpeciesId.IRON_BUNDLE]: [ MoveId.EARTH_POWER, MoveId.SPLISHY_SPLASH, MoveId.VOLT_SWITCH, MoveId.NASTY_PLOT ], @@ -563,7 +563,7 @@ export const speciesEggMoves = { [SpeciesId.TING_LU]: [ MoveId.SHORE_UP, MoveId.CEASELESS_EDGE, MoveId.SAPPY_SEED, MoveId.PRECIPICE_BLADES ], [SpeciesId.CHI_YU]: [ MoveId.FIERY_WRATH, MoveId.HYDRO_STEAM, MoveId.MORNING_SUN, MoveId.BLUE_FLARE ], [SpeciesId.ROARING_MOON]: [ MoveId.FIRE_LASH, MoveId.DRAGON_HAMMER, MoveId.METEOR_MASH, MoveId.DRAGON_ASCENT ], - [SpeciesId.IRON_VALIANT]: [ MoveId.PLASMA_FISTS, MoveId.NO_RETREAT, MoveId.SECRET_SWORD, MoveId.MAGICAL_TORQUE ], + [SpeciesId.IRON_VALIANT]: [ MoveId.PHOTON_GEYSER, MoveId.NO_RETREAT, MoveId.SECRET_SWORD, MoveId.MAGICAL_TORQUE ], [SpeciesId.KORAIDON]: [ MoveId.SUNSTEEL_STRIKE, MoveId.SOLAR_BLADE, MoveId.DRAGON_DARTS, MoveId.BITTER_BLADE ], [SpeciesId.MIRAIDON]: [ MoveId.FROST_BREATH, MoveId.WILDBOLT_STORM, MoveId.SPACIAL_REND, MoveId.RISING_VOLTAGE ], [SpeciesId.WALKING_WAKE]: [ MoveId.BOUNCY_BUBBLE, MoveId.FUSION_FLARE, MoveId.SLUDGE_WAVE, MoveId.CORE_ENFORCER ], @@ -573,7 +573,7 @@ export const speciesEggMoves = { [SpeciesId.MUNKIDORI]: [ MoveId.TWIN_BEAM, MoveId.HEAT_WAVE, MoveId.EARTH_POWER, MoveId.MALIGNANT_CHAIN ], [SpeciesId.FEZANDIPITI]: [ MoveId.BARB_BARRAGE, MoveId.BONEMERANG, MoveId.TRIPLE_AXEL, MoveId.VICTORY_DANCE ], [SpeciesId.OGERPON]: [ MoveId.SLEEP_POWDER, MoveId.BONEMERANG, MoveId.TRIPLE_AXEL, MoveId.FLOWER_TRICK ], - [SpeciesId.GOUGING_FIRE]: [ MoveId.EXTREME_SPEED, MoveId.BULK_UP, MoveId.SACRED_FIRE, MoveId.GLAIVE_RUSH ], + [SpeciesId.GOUGING_FIRE]: [ MoveId.EXTREME_SPEED, MoveId.DRAGON_DANCE, MoveId.ZING_ZAP, MoveId.SACRED_FIRE ], [SpeciesId.RAGING_BOLT]: [ MoveId.NASTY_PLOT, MoveId.FLAMETHROWER, MoveId.MORNING_SUN, MoveId.ELECTRO_DRIFT ], [SpeciesId.IRON_BOULDER]: [ MoveId.PSYBLADE, MoveId.KOWTOW_CLEAVE, MoveId.STONE_AXE, MoveId.BITTER_BLADE ], [SpeciesId.IRON_CROWN]: [ MoveId.NASTY_PLOT, MoveId.SECRET_SWORD, MoveId.PSYSTRIKE, MoveId.ELECTRO_DRIFT ], @@ -584,17 +584,24 @@ export const speciesEggMoves = { [SpeciesId.BLOODMOON_URSALUNA]: [ MoveId.NASTY_PLOT, MoveId.ROCK_POLISH, MoveId.SANDSEAR_STORM, MoveId.BOOMBURST ] }; +/** + * Parse a CSV-separated list of Egg Moves (such as one sourced from a Google Sheets) + * into code able to form the `speciesEggMoves` const object as above. + * @param content - The CSV-formatted string to convert into code. + */ +// TODO: Move this into the scripts folder and stop running it on initialization function parseEggMoves(content: string): void { let output = ""; const speciesNames = getEnumKeys(SpeciesId); const speciesValues = getEnumValues(SpeciesId); + const moveNames = allMoves.map(m => m.name.replace(/ \([A-Z]\)$/, "").toLowerCase()); const lines = content.split(/\n/g); for (const line of lines) { const cols = line.split(",").slice(0, 5); - const moveNames = allMoves.map(m => m.name.replace(/ \([A-Z]\)$/, "").toLowerCase()); - const enumSpeciesName = cols[0].toUpperCase().replace(/[ -]/g, "_"); + const enumSpeciesName = cols[0].toUpperCase().replace(/[ -]/g, "_") as keyof typeof SpeciesId; + // TODO: This should use reverse mapping instead of `indexOf` const species = speciesValues[speciesNames.indexOf(enumSpeciesName)]; const eggMoves: MoveId[] = []; @@ -602,14 +609,16 @@ function parseEggMoves(content: string): void { for (let m = 0; m < 4; m++) { const moveName = cols[m + 1].trim(); const moveIndex = moveName !== "N/A" ? moveNames.indexOf(moveName.toLowerCase()) : -1; - eggMoves.push(moveIndex > -1 ? moveIndex as MoveId : MoveId.NONE); - if (moveIndex === -1) { console.warn(moveName, "could not be parsed"); } + + eggMoves.push(moveIndex > -1 ? moveIndex as MoveId : MoveId.NONE); } - if (eggMoves.find(m => m !== MoveId.NONE)) { + if (eggMoves.every(m => m === MoveId.NONE)) { + console.warn(`Species ${toReadableString(SpeciesId[species])} could not be parsed, excluding from output...`) + } else { output += `[SpeciesId.${SpeciesId[species]}]: [ ${eggMoves.map(m => `MoveId.${MoveId[m]}`).join(", ")} ],\n`; } } diff --git a/src/data/balance/passives.ts b/src/data/balance/passives.ts index 80790b44735..0a76b3036b9 100644 --- a/src/data/balance/passives.ts +++ b/src/data/balance/passives.ts @@ -178,9 +178,9 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.QUILAVA]: { 0: AbilityId.DROUGHT }, [SpeciesId.TYPHLOSION]: { 0: AbilityId.DROUGHT }, [SpeciesId.HISUI_TYPHLOSION]: { 0: AbilityId.DROUGHT }, - [SpeciesId.TOTODILE]: { 0: AbilityId.TOUGH_CLAWS }, - [SpeciesId.CROCONAW]: { 0: AbilityId.TOUGH_CLAWS }, - [SpeciesId.FERALIGATR]: { 0: AbilityId.TOUGH_CLAWS }, + [SpeciesId.TOTODILE]: { 0: AbilityId.STRONG_JAW }, + [SpeciesId.CROCONAW]: { 0: AbilityId.STRONG_JAW }, + [SpeciesId.FERALIGATR]: { 0: AbilityId.STRONG_JAW }, [SpeciesId.SENTRET]: { 0: AbilityId.PICKUP }, [SpeciesId.FURRET]: { 0: AbilityId.PICKUP }, [SpeciesId.HOOTHOOT]: { 0: AbilityId.AERILATE }, @@ -252,7 +252,7 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.REMORAID]: { 0: AbilityId.SIMPLE }, [SpeciesId.OCTILLERY]: { 0: AbilityId.SIMPLE }, [SpeciesId.DELIBIRD]: { 0: AbilityId.HUGE_POWER }, - [SpeciesId.SKARMORY]: { 0: AbilityId.LIGHTNING_ROD }, + [SpeciesId.SKARMORY]: { 0: AbilityId.STAMINA }, [SpeciesId.HOUNDOUR]: { 0: AbilityId.BALL_FETCH }, [SpeciesId.HOUNDOOM]: { 0: AbilityId.LIGHTNING_ROD, 1: AbilityId.LIGHTNING_ROD }, [SpeciesId.PHANPY]: { 0: AbilityId.STURDY }, @@ -319,9 +319,9 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.MASQUERAIN]: { 0: AbilityId.WATER_BUBBLE }, [SpeciesId.SHROOMISH]: { 0: AbilityId.GUTS }, [SpeciesId.BRELOOM]: { 0: AbilityId.GUTS }, - [SpeciesId.SLAKOTH]: { 0: AbilityId.GUTS }, - [SpeciesId.VIGOROTH]: { 0: AbilityId.GUTS }, - [SpeciesId.SLAKING]: { 0: AbilityId.GUTS }, + [SpeciesId.SLAKOTH]: { 0: AbilityId.COMATOSE }, + [SpeciesId.VIGOROTH]: { 0: AbilityId.TOUGH_CLAWS }, + [SpeciesId.SLAKING]: { 0: AbilityId.COMATOSE }, [SpeciesId.NINCADA]: { 0: AbilityId.TECHNICIAN }, [SpeciesId.NINJASK]: { 0: AbilityId.TECHNICIAN }, [SpeciesId.SHEDINJA]: { 0: AbilityId.MAGIC_GUARD }, @@ -421,7 +421,7 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.KYOGRE]: { 0: AbilityId.MOLD_BREAKER, 1: AbilityId.TERAVOLT }, [SpeciesId.GROUDON]: { 0: AbilityId.MOLD_BREAKER, 1: AbilityId.TURBOBLAZE }, [SpeciesId.RAYQUAZA]: { 0: AbilityId.UNNERVE, 1: AbilityId.UNNERVE }, - [SpeciesId.JIRACHI]: { 0: AbilityId.COMATOSE }, + [SpeciesId.JIRACHI]: { 0: AbilityId.PURIFYING_SALT }, [SpeciesId.DEOXYS]: { 0: AbilityId.PROTEAN, 1: AbilityId.ADAPTABILITY, 2: AbilityId.REGENERATOR, 3: AbilityId.SHADOW_SHIELD }, [SpeciesId.TURTWIG]: { 0: AbilityId.SOLID_ROCK }, @@ -689,9 +689,9 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.FENNEKIN]: { 0: AbilityId.FLUFFY }, [SpeciesId.BRAIXEN]: { 0: AbilityId.PSYCHIC_SURGE }, [SpeciesId.DELPHOX]: { 0: AbilityId.PSYCHIC_SURGE }, - [SpeciesId.FROAKIE]: { 0: AbilityId.STAKEOUT, 1: AbilityId.STAKEOUT }, - [SpeciesId.FROGADIER]: { 0: AbilityId.STAKEOUT, 1: AbilityId.STAKEOUT }, - [SpeciesId.GRENINJA]: { 0: AbilityId.STAKEOUT, 1: AbilityId.STAKEOUT, 2: AbilityId.STAKEOUT }, + [SpeciesId.FROAKIE]: { 0: AbilityId.TECHNICIAN, 1: AbilityId.STAKEOUT }, + [SpeciesId.FROGADIER]: { 0: AbilityId.TECHNICIAN, 1: AbilityId.STAKEOUT }, + [SpeciesId.GRENINJA]: { 0: AbilityId.TECHNICIAN, 1: AbilityId.STAKEOUT, 2: AbilityId.SUPER_LUCK }, [SpeciesId.BUNNELBY]: { 0: AbilityId.INNER_FOCUS }, [SpeciesId.DIGGERSBY]: { 0: AbilityId.THICK_FAT }, [SpeciesId.FLETCHLING]: { 0: AbilityId.FLAME_BODY }, @@ -763,9 +763,9 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.DARTRIX]: { 0: AbilityId.WIND_RIDER }, [SpeciesId.DECIDUEYE]: { 0: AbilityId.SNIPER }, [SpeciesId.HISUI_DECIDUEYE]: { 0: AbilityId.SNIPER }, - [SpeciesId.LITTEN]: { 0: AbilityId.OPPORTUNIST }, - [SpeciesId.TORRACAT]: { 0: AbilityId.OPPORTUNIST }, - [SpeciesId.INCINEROAR]: { 0: AbilityId.OPPORTUNIST }, + [SpeciesId.LITTEN]: { 0: AbilityId.TOUGH_CLAWS }, + [SpeciesId.TORRACAT]: { 0: AbilityId.TOUGH_CLAWS }, + [SpeciesId.INCINEROAR]: { 0: AbilityId.TOUGH_CLAWS }, [SpeciesId.POPPLIO]: { 0: AbilityId.PUNK_ROCK }, [SpeciesId.BRIONNE]: { 0: AbilityId.PUNK_ROCK }, [SpeciesId.PRIMARINA]: { 0: AbilityId.PUNK_ROCK }, @@ -815,7 +815,7 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.MINIOR]: { 0: AbilityId.STURDY, 1: AbilityId.STURDY, 2: AbilityId.STURDY, 3: AbilityId.STURDY, 4: AbilityId.STURDY, 5: AbilityId.STURDY, 6: AbilityId.STURDY, 7: AbilityId.AERILATE, 8: AbilityId.AERILATE, 9: AbilityId.AERILATE, 10: AbilityId.AERILATE, 11: AbilityId.AERILATE, 12: AbilityId.AERILATE, 13: AbilityId.AERILATE }, [SpeciesId.KOMALA]: { 0: AbilityId.GUTS }, [SpeciesId.TURTONATOR]: { 0: AbilityId.DAUNTLESS_SHIELD }, - [SpeciesId.TOGEDEMARU]: { 0: AbilityId.ROUGH_SKIN }, + [SpeciesId.TOGEDEMARU]: { 0: AbilityId.CHEEK_POUCH }, [SpeciesId.MIMIKYU]: { 0: AbilityId.TOUGH_CLAWS, 1: AbilityId.TOUGH_CLAWS }, [SpeciesId.BRUXISH]: { 0: AbilityId.MULTISCALE }, [SpeciesId.DRAMPA]: { 0: AbilityId.THICK_FAT }, @@ -856,8 +856,8 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.ALOLA_NINETALES]: { 0: AbilityId.ICE_BODY }, [SpeciesId.ALOLA_DIGLETT]: { 0: AbilityId.STURDY }, [SpeciesId.ALOLA_DUGTRIO]: { 0: AbilityId.STURDY }, - [SpeciesId.ALOLA_MEOWTH]: { 0: AbilityId.DARK_AURA }, - [SpeciesId.ALOLA_PERSIAN]: { 0: AbilityId.DARK_AURA }, + [SpeciesId.ALOLA_MEOWTH]: { 0: AbilityId.DAZZLING }, + [SpeciesId.ALOLA_PERSIAN]: { 0: AbilityId.DAZZLING }, [SpeciesId.ALOLA_GEODUDE]: { 0: AbilityId.DRY_SKIN }, [SpeciesId.ALOLA_GRAVELER]: { 0: AbilityId.DRY_SKIN }, [SpeciesId.ALOLA_GOLEM]: { 0: AbilityId.DRY_SKIN }, @@ -867,9 +867,9 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.GROOKEY]: { 0: AbilityId.PICKPOCKET }, [SpeciesId.THWACKEY]: { 0: AbilityId.PICKPOCKET }, [SpeciesId.RILLABOOM]: { 0: AbilityId.GRASS_PELT, 1: AbilityId.GRASS_PELT }, - [SpeciesId.SCORBUNNY]: { 0: AbilityId.SHEER_FORCE }, - [SpeciesId.RABOOT]: { 0: AbilityId.SHEER_FORCE }, - [SpeciesId.CINDERACE]: { 0: AbilityId.NO_GUARD, 1: AbilityId.NO_GUARD }, + [SpeciesId.SCORBUNNY]: { 0: AbilityId.OPPORTUNIST }, + [SpeciesId.RABOOT]: { 0: AbilityId.OPPORTUNIST }, + [SpeciesId.CINDERACE]: { 0: AbilityId.OPPORTUNIST, 1: AbilityId.OPPORTUNIST }, [SpeciesId.SOBBLE]: { 0: AbilityId.SUPER_LUCK }, [SpeciesId.DRIZZILE]: { 0: AbilityId.SUPER_LUCK }, [SpeciesId.INTELEON]: { 0: AbilityId.SUPER_LUCK, 1: AbilityId.SUPER_LUCK }, @@ -1041,7 +1041,7 @@ export const starterPassiveAbilities: StarterPassiveAbilities = { [SpeciesId.WIGLETT]: { 0: AbilityId.STURDY }, [SpeciesId.WUGTRIO]: { 0: AbilityId.STURDY }, [SpeciesId.BOMBIRDIER]: { 0: AbilityId.UNBURDEN }, - [SpeciesId.FINIZEN]: { 0: AbilityId.SWIFT_SWIM }, + [SpeciesId.FINIZEN]: { 0: AbilityId.FRIEND_GUARD }, [SpeciesId.PALAFIN]: { 0: AbilityId.EMERGENCY_EXIT, 1: AbilityId.IRON_FIST }, [SpeciesId.VAROOM]: { 0: AbilityId.LEVITATE }, [SpeciesId.REVAVROOM]: { 0: AbilityId.LEVITATE, 1: AbilityId.DARK_AURA, 2: AbilityId.FLASH_FIRE, 3: AbilityId.MERCILESS, 4: AbilityId.FILTER, 5: AbilityId.SCRAPPY }, diff --git a/src/data/balance/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts index 8714d6c0c9a..c632889326d 100644 --- a/src/data/balance/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -1,21 +1,21 @@ import { globalScene } from "#app/global-scene"; -import { Gender, getGenderSymbol } from "#app/data/gender"; -import { PokeballType } from "#enums/pokeball"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonType } from "#enums/pokemon-type"; -import { coerceArray, isNullOrUndefined, randSeedInt } from "#app/utils/common"; -import { WeatherType } from "#enums/weather-type"; -import { Nature } from "#enums/nature"; +import { speciesStarterCosts } from "#balance/starters"; +import { allMoves } from "#data/data-lists"; +import { Gender, getGenderSymbol } from "#data/gender"; import { BiomeId } from "#enums/biome-id"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; +import { Nature } from "#enums/nature"; +import { PokeballType } from "#enums/pokeball"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesFormKey } from "#enums/species-form-key"; +import { SpeciesId } from "#enums/species-id"; import { TimeOfDay } from "#enums/time-of-day"; -import type { SpeciesStatBoosterItem, SpeciesStatBoosterModifierType } from "#app/modifier/modifier-type"; -import { speciesStarterCosts } from "./starters"; +import { WeatherType } from "#enums/weather-type"; +import type { Pokemon } from "#field/pokemon"; +import type { SpeciesStatBoosterItem, SpeciesStatBoosterModifierType } from "#modifiers/modifier-type"; +import { coerceArray, isNullOrUndefined, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { allMoves } from "#app/data/data-lists"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; export enum SpeciesWildEvolutionDelay { NONE, @@ -1630,7 +1630,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(SpeciesId.TSAREENA, 28, null, {key: EvoCondKey.MOVE, move: MoveId.STOMP}, SpeciesWildEvolutionDelay.LONG) ], [SpeciesId.POIPOLE]: [ - new SpeciesEvolution(SpeciesId.NAGANADEL, 1, null, {key: EvoCondKey.MOVE, move: MoveId.DRAGON_PULSE}, SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(SpeciesId.NAGANADEL, 1, null, {key: EvoCondKey.MOVE, move: MoveId.DRAGON_PULSE}, SpeciesWildEvolutionDelay.VERY_LONG) ], [SpeciesId.ALOLA_SANDSHREW]: [ new SpeciesEvolution(SpeciesId.ALOLA_SANDSLASH, 1, EvolutionItem.ICE_STONE, null, SpeciesWildEvolutionDelay.LONG) @@ -1845,7 +1845,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(SpeciesId.LEAVANNY, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 120}, SpeciesWildEvolutionDelay.LONG) ], [SpeciesId.TYPE_NULL]: [ - new SpeciesEvolution(SpeciesId.SILVALLY, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 100}, SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(SpeciesId.SILVALLY, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 100}, SpeciesWildEvolutionDelay.VERY_LONG) ], [SpeciesId.ALOLA_MEOWTH]: [ new SpeciesEvolution(SpeciesId.ALOLA_PERSIAN, 1, null, {key: EvoCondKey.FRIENDSHIP, value: 120}, SpeciesWildEvolutionDelay.LONG) diff --git a/src/data/balance/species-egg-tiers.ts b/src/data/balance/species-egg-tiers.ts index 4d953921e92..4c125fb07fa 100644 --- a/src/data/balance/species-egg-tiers.ts +++ b/src/data/balance/species-egg-tiers.ts @@ -1,5 +1,5 @@ -import { SpeciesId } from "#enums/species-id"; import { EggTier } from "#enums/egg-type"; +import { SpeciesId } from "#enums/species-id"; /** * Map of all starters and their respective {@linkcode EggTier}, which determines the type of egg the starter hatches from. diff --git a/src/data/balance/starters.ts b/src/data/balance/starters.ts index 2db10f2e67a..8b91c12ae2d 100644 --- a/src/data/balance/starters.ts +++ b/src/data/balance/starters.ts @@ -234,7 +234,7 @@ export const speciesStarterCosts = { [SpeciesId.KYOGRE]: 9, [SpeciesId.GROUDON]: 9, [SpeciesId.RAYQUAZA]: 9, - [SpeciesId.JIRACHI]: 7, + [SpeciesId.JIRACHI]: 6, [SpeciesId.DEOXYS]: 7, [SpeciesId.TURTWIG]: 3, @@ -319,7 +319,7 @@ export const speciesStarterCosts = { [SpeciesId.SANDILE]: 4, [SpeciesId.DARUMAKA]: 4, [SpeciesId.MARACTUS]: 2, - [SpeciesId.DWEBBLE]: 2, + [SpeciesId.DWEBBLE]: 3, [SpeciesId.SCRAGGY]: 3, [SpeciesId.SIGILYPH]: 4, [SpeciesId.YAMASK]: 3, diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index bed17fb0ebc..d26f0700f7f 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -1,22 +1,15 @@ import { globalScene } from "#app/global-scene"; -import { allMoves } from "#app/data/data-lists"; -import { MoveFlags } from "#enums/MoveFlags"; -import type Pokemon from "#app/field/pokemon"; -import { - type nil, - getFrameMs, - getEnumKeys, - getEnumValues, - animationFileName, - coerceArray, - isNullOrUndefined, -} from "#app/utils/common"; +import { allMoves } from "#data/data-lists"; import type { BattlerIndex } from "#enums/battler-index"; -import { MoveId } from "#enums/move-id"; -import Phaser from "phaser"; -import { EncounterAnim } from "#enums/encounter-anims"; -import { AnimBlendType, AnimFrameTarget, AnimFocus, ChargeAnim, CommonAnim } from "#enums/move-anims-common"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { EncounterAnim } from "#enums/encounter-anims"; +import { MoveFlags } from "#enums/MoveFlags"; +import { AnimBlendType, AnimFocus, AnimFrameTarget, ChargeAnim, CommonAnim } from "#enums/move-anims-common"; +import { MoveId } from "#enums/move-id"; +import type { Pokemon } from "#field/pokemon"; +import { animationFileName, coerceArray, getFrameMs, isNullOrUndefined, type nil } from "#utils/common"; +import { getEnumKeys, getEnumValues } from "#utils/enums"; +import Phaser from "phaser"; export class AnimConfig { public id: number; @@ -880,6 +873,10 @@ export abstract class BattleAnim { targetSprite.pipelineData["tone"] = [0.0, 0.0, 0.0, 0.0]; targetSprite.setAngle(0); + // Remove animation event listeners to enable sprites to be freed. + userSprite.off("animationupdate"); + targetSprite.off("animationupdate"); + /** * This and `targetSpriteToShow` are used to restore context lost * from the `isOppAnim` swap. Using these references instead of `this.user` @@ -1402,10 +1399,10 @@ export class EncounterBattleAnim extends BattleAnim { export async function populateAnims() { const commonAnimNames = getEnumKeys(CommonAnim).map(k => k.toLowerCase()); const commonAnimMatchNames = commonAnimNames.map(k => k.replace(/_/g, "")); - const commonAnimIds = getEnumValues(CommonAnim) as CommonAnim[]; + const commonAnimIds = getEnumValues(CommonAnim); const chargeAnimNames = getEnumKeys(ChargeAnim).map(k => k.toLowerCase()); const chargeAnimMatchNames = chargeAnimNames.map(k => k.replace(/_/g, " ")); - const chargeAnimIds = getEnumValues(ChargeAnim) as ChargeAnim[]; + const chargeAnimIds = getEnumValues(ChargeAnim); const commonNamePattern = /name: (?:Common:)?(Opp )?(.*)/; const moveNameToId = {}; for (const move of getEnumValues(MoveId).slice(1)) { diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 7e9b9825e06..72fa6eaa64b 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1,39 +1,37 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import Overrides from "#app/overrides"; -import { applyAbAttrs } from "./abilities/apply-ab-attrs"; -import { allAbilities } from "./data-lists"; -import { CommonBattleAnim, MoveChargeAnim } from "#app/data/battle-anims"; -import { ChargeAnim, CommonAnim } from "#enums/move-anims-common"; -import type Move from "#app/data/moves/move"; -import { applyMoveAttrs } from "./moves/apply-attrs"; -import { allMoves } from "./data-lists"; -import { MoveFlags } from "#enums/MoveFlags"; -import { MoveCategory } from "#enums/MoveCategory"; -import { SpeciesFormChangeAbilityTrigger } from "./pokemon-forms/form-change-triggers"; -import { getStatusEffectHealText } from "#app/data/status-effect"; -import { TerrainType } from "#app/data/terrain"; -import { PokemonType } from "#enums/pokemon-type"; -import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#enums/move-result"; -import { HitResult } from "#enums/hit-result"; import { getPokemonNameWithAffix } from "#app/messages"; -import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import type { MovePhase } from "#app/phases/move-phase"; -import type { StatStageChangeCallback } from "#app/phases/stat-stage-change-phase"; -import i18next from "#app/plugins/i18n"; -import { BooleanHolder, coerceArray, getFrameMs, NumberHolder, toDmgValue } from "#app/utils/common"; +import Overrides from "#app/overrides"; +import { CommonBattleAnim, MoveChargeAnim } from "#data/battle-anims"; +import { allAbilities, allMoves } from "#data/data-lists"; +import { SpeciesFormChangeAbilityTrigger } from "#data/form-change-triggers"; +import { getStatusEffectHealText } from "#data/status-effect"; +import { TerrainType } from "#data/terrain"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { HitResult } from "#enums/hit-result"; +import { MoveCategory } from "#enums/MoveCategory"; +import { MoveFlags } from "#enums/MoveFlags"; +import { ChargeAnim, CommonAnim } from "#enums/move-anims-common"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { PokemonAnimType } from "#enums/pokemon-anim-type"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import { EFFECTIVE_STATS, getStatKey, Stat, type BattleStat, type EffectiveStat } from "#enums/stat"; +import { type BattleStat, EFFECTIVE_STATS, type EffectiveStat, getStatKey, Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; -import { isNullOrUndefined } from "#app/utils/common"; -import { MoveUseMode } from "#enums/move-use-mode"; -import { invalidEncoreMoves } from "./moves/invalid-moves"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; +import type { Pokemon } from "#field/pokemon"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import { invalidEncoreMoves } from "#moves/invalid-moves"; +import type { Move } from "#moves/move"; +import type { MoveEffectPhase } from "#phases/move-effect-phase"; +import type { MovePhase } from "#phases/move-phase"; +import type { StatStageChangeCallback } from "#phases/stat-stage-change-phase"; +import i18next from "#plugins/i18n"; +import { BooleanHolder, coerceArray, getFrameMs, isNullOrUndefined, NumberHolder, toDmgValue } from "#utils/common"; /** * A {@linkcode BattlerTag} represents a semi-persistent effect that can be attached to a {@linkcode Pokemon}. @@ -673,7 +671,12 @@ export class ConfusedTag extends BattlerTag { } canAdd(pokemon: Pokemon): boolean { - return globalScene.arena.terrain?.terrainType !== TerrainType.MISTY || !pokemon.isGrounded(); + const blockedByTerrain = pokemon.isGrounded() && globalScene.arena.terrain?.terrainType === TerrainType.MISTY; + if (blockedByTerrain) { + pokemon.queueStatusImmuneMessage(false, TerrainType.MISTY); + return false; + } + return true; } onAdd(pokemon: Pokemon): void { diff --git a/src/data/berry.ts b/src/data/berry.ts index be6e5c28f84..61235b75e21 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -1,14 +1,14 @@ -import { getPokemonNameWithAffix } from "../messages"; -import type Pokemon from "../field/pokemon"; -import { HitResult } from "#enums/hit-result"; -import { getStatusEffectHealText } from "./status-effect"; -import { NumberHolder, toDmgValue, randSeedInt } from "#app/utils/common"; -import { applyAbAttrs } from "./abilities/apply-ab-attrs"; -import i18next from "i18next"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { getStatusEffectHealText } from "#data/status-effect"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; -import { Stat, type BattleStat } from "#app/enums/stat"; -import { globalScene } from "#app/global-scene"; +import { HitResult } from "#enums/hit-result"; +import { type BattleStat, Stat } from "#enums/stat"; +import type { Pokemon } from "#field/pokemon"; +import { NumberHolder, randSeedInt, toDmgValue } from "#utils/common"; +import i18next from "i18next"; export function getBerryName(berryType: BerryType): string { return i18next.t(`berry:${BerryType[berryType]}.name`); diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 3fdd83c185d..938ee482d01 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -1,33 +1,33 @@ -import { BooleanHolder, type NumberHolder, randSeedItem } from "#app/utils/common"; -import { deepCopy } from "#app/utils/data"; -import i18next from "i18next"; -import type { DexAttrProps, GameData } from "#app/system/game-data"; -import { defaultStarterSpecies } from "#app/constants"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "./moves/pokemon-move"; import type { FixedBattleConfig } from "#app/battle"; import { getRandomTrainerFunc } from "#app/battle"; -import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; +import { defaultStarterSpecies } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { pokemonEvolutions } from "#balance/pokemon-evolutions"; +import { speciesStarterCosts } from "#balance/starters"; +import { pokemonFormChanges } from "#data/pokemon-forms"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { getPokemonSpeciesForm } from "#data/pokemon-species"; import { BattleType } from "#enums/battle-type"; -import Trainer from "#app/field/trainer"; -import { TrainerVariant } from "#enums/trainer-variant"; -import { PokemonType } from "#enums/pokemon-type"; +import { ChallengeType } from "#enums/challenge-type"; import { Challenges } from "#enums/challenges"; +import { TypeColor, TypeShadow } from "#enums/color"; +import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; +import { ModifierTier } from "#enums/modifier-tier"; +import type { MoveId } from "#enums/move-id"; +import type { MoveSourceType } from "#enums/move-source-type"; +import { Nature } from "#enums/nature"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; import { TrainerType } from "#enums/trainer-type"; -import { Nature } from "#enums/nature"; -import type { MoveId } from "#enums/move-id"; -import { TypeColor, TypeShadow } from "#enums/color"; -import { ModifierTier } from "#enums/modifier-tier"; -import { globalScene } from "#app/global-scene"; -import { pokemonFormChanges } from "./pokemon-forms"; -import { pokemonEvolutions } from "./balance/pokemon-evolutions"; -import { ChallengeType } from "#enums/challenge-type"; -import type { MoveSourceType } from "#enums/move-source-type"; +import { TrainerVariant } from "#enums/trainer-variant"; +import type { Pokemon } from "#field/pokemon"; +import { Trainer } from "#field/trainer"; +import { PokemonMove } from "#moves/pokemon-move"; +import type { DexAttrProps, GameData } from "#system/game-data"; +import { BooleanHolder, type NumberHolder, randSeedItem } from "#utils/common"; +import { deepCopy } from "#utils/data"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; /** A constant for the default max cost of the starting party before a run */ const DEFAULT_PARTY_MAX_COST = 10; diff --git a/src/data/custom-pokemon-data.ts b/src/data/custom-pokemon-data.ts deleted file mode 100644 index 252e302ccf3..00000000000 --- a/src/data/custom-pokemon-data.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { AbilityId } from "#enums/ability-id"; -import type { PokemonType } from "#enums/pokemon-type"; -import type { Nature } from "#enums/nature"; - -/** - * Data that can customize a Pokemon in non-standard ways from its Species. - * Includes abilities, nature, changed types, etc. - */ -export class CustomPokemonData { - // TODO: Change the default value for all these from -1 to something a bit more sensible - /** - * The scale at which to render this Pokemon's sprite. - */ - public spriteScale = -1; - public ability: AbilityId | -1; - public passive: AbilityId | -1; - public nature: Nature | -1; - public types: PokemonType[]; - /** Deprecated but needed for session save migration */ - // TODO: Remove this once pre-session migration is implemented - public hitsRecCount: number | null = null; - - constructor(data?: CustomPokemonData | Partial) { - this.spriteScale = data?.spriteScale ?? -1; - this.ability = data?.ability ?? -1; - this.passive = data?.passive ?? -1; - this.nature = data?.nature ?? -1; - this.types = data?.types ?? []; - this.hitsRecCount = data?.hitsRecCount ?? null; - } -} diff --git a/src/data/daily-run.ts b/src/data/daily-run.ts index e869ba7f28f..9a6f560933a 100644 --- a/src/data/daily-run.ts +++ b/src/data/daily-run.ts @@ -1,15 +1,16 @@ +import { pokerogueApi } from "#api/pokerogue-api"; +import { globalScene } from "#app/global-scene"; +import { speciesStarterCosts } from "#balance/starters"; +import type { PokemonSpeciesForm } from "#data/pokemon-species"; +import { getPokemonSpeciesForm, PokemonSpecies } from "#data/pokemon-species"; +import { BiomeId } from "#enums/biome-id"; import { PartyMemberStrength } from "#enums/party-member-strength"; import type { SpeciesId } from "#enums/species-id"; -import { globalScene } from "#app/global-scene"; -import { PlayerPokemon } from "#app/field/pokemon"; -import type { Starter } from "#app/ui/starter-select-ui-handler"; -import { randSeedGauss, randSeedInt, randSeedItem, getEnumValues } from "#app/utils/common"; -import type { PokemonSpeciesForm } from "#app/data/pokemon-species"; -import PokemonSpecies, { getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import { BiomeId } from "#enums/biome-id"; +import { PlayerPokemon } from "#field/pokemon"; +import type { Starter } from "#ui/starter-select-ui-handler"; +import { randSeedGauss, randSeedInt, randSeedItem } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; export interface DailyRunConfig { seed: number; @@ -165,5 +166,6 @@ export function getDailyStartingBiome(): BiomeId { } // Fallback in case something went wrong + // TODO: should this use `randSeedItem`? return biomes[randSeedInt(biomes.length)]; } diff --git a/src/data/data-lists.ts b/src/data/data-lists.ts index ed172846fe1..ae3d0acc77f 100644 --- a/src/data/data-lists.ts +++ b/src/data/data-lists.ts @@ -1,7 +1,7 @@ -import type PokemonSpecies from "#app/data/pokemon-species"; -import type { ModifierTypes } from "#app/modifier/modifier-type"; -import type { Ability } from "./abilities/ability"; -import type Move from "./moves/move"; +import type { Ability } from "#abilities/ability"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import type { ModifierTypes } from "#modifiers/modifier-type"; +import type { Move } from "#moves/move"; export const allAbilities: Ability[] = []; export const allMoves: Move[] = []; diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index 6bb96f0efb2..406e72ee82b 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -1,6 +1,6 @@ import { BattleSpec } from "#enums/battle-spec"; import { TrainerType } from "#enums/trainer-type"; -import { trainerConfigs } from "./trainers/trainer-config"; +import { trainerConfigs } from "#trainers/trainer-config"; export interface TrainerTypeMessages { encounter?: string | string[]; @@ -1744,6 +1744,7 @@ export function getCharVariantFromDialogue(message: string): string { } export function initTrainerTypeDialogue(): void { + // TODO: this should not be using `Object.Keys` const trainerTypes = Object.keys(trainerTypeDialogue).map(t => Number.parseInt(t) as TrainerType); for (const trainerType of trainerTypes) { const messages = trainerTypeDialogue[trainerType]; diff --git a/src/data/egg-hatch-data.ts b/src/data/egg-hatch-data.ts index e81ae69515c..6aead19eb7f 100644 --- a/src/data/egg-hatch-data.ts +++ b/src/data/egg-hatch-data.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { StarterDataEntry } from "#app/system/game-data"; -import type { DexEntry } from "#app/@types/dex-data"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { StarterDataEntry } from "#system/game-data"; +import type { DexEntry } from "#types/dex-data"; /** * Stores data associated with a specific egg and the hatched pokemon diff --git a/src/data/egg.ts b/src/data/egg.ts index 1ef08a4f1da..2c567686fc2 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -1,43 +1,43 @@ -import type BattleScene from "#app/battle-scene"; +import type { BattleScene } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { VariantTier } from "#enums/variant-tier"; -import { randInt, randomString, randSeedInt, getIvsFromId } from "#app/utils/common"; import Overrides from "#app/overrides"; -import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import i18next from "i18next"; -import { EggTier } from "#enums/egg-type"; -import { SpeciesId } from "#enums/species-id"; -import { EggSourceType } from "#enums/egg-source-types"; +import { pokemonPrevolutions } from "#balance/pokemon-evolutions"; import { - MANAPHY_EGG_MANAPHY_RATE, - SAME_SPECIES_EGG_HA_RATE, - GACHA_EGG_HA_RATE, - GACHA_DEFAULT_RARE_EGGMOVE_RATE, - SAME_SPECIES_EGG_RARE_EGGMOVE_RATE, - GACHA_MOVE_UP_RARE_EGGMOVE_RATE, - GACHA_DEFAULT_SHINY_RATE, - GACHA_SHINY_UP_SHINY_RATE, - SAME_SPECIES_EGG_SHINY_RATE, - EGG_PITY_LEGENDARY_THRESHOLD, EGG_PITY_EPIC_THRESHOLD, + EGG_PITY_LEGENDARY_THRESHOLD, EGG_PITY_RARE_THRESHOLD, - SHINY_VARIANT_CHANCE, - SHINY_EPIC_CHANCE, GACHA_DEFAULT_COMMON_EGG_THRESHOLD, - GACHA_DEFAULT_RARE_EGG_THRESHOLD, GACHA_DEFAULT_EPIC_EGG_THRESHOLD, + GACHA_DEFAULT_RARE_EGG_THRESHOLD, + GACHA_DEFAULT_RARE_EGGMOVE_RATE, + GACHA_DEFAULT_SHINY_RATE, + GACHA_EGG_HA_RATE, GACHA_LEGENDARY_UP_THRESHOLD_OFFSET, - HATCH_WAVES_MANAPHY_EGG, + GACHA_MOVE_UP_RARE_EGGMOVE_RATE, + GACHA_SHINY_UP_SHINY_RATE, HATCH_WAVES_COMMON_EGG, - HATCH_WAVES_RARE_EGG, HATCH_WAVES_EPIC_EGG, HATCH_WAVES_LEGENDARY_EGG, -} from "#app/data/balance/rates"; -import { speciesEggTiers } from "#app/data/balance/species-egg-tiers"; + HATCH_WAVES_MANAPHY_EGG, + HATCH_WAVES_RARE_EGG, + MANAPHY_EGG_MANAPHY_RATE, + SAME_SPECIES_EGG_HA_RATE, + SAME_SPECIES_EGG_RARE_EGGMOVE_RATE, + SAME_SPECIES_EGG_SHINY_RATE, + SHINY_EPIC_CHANCE, + SHINY_VARIANT_CHANCE, +} from "#balance/rates"; +import { speciesEggTiers } from "#balance/species-egg-tiers"; +import { speciesStarterCosts } from "#balance/starters"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { EggSourceType } from "#enums/egg-source-types"; +import { EggTier } from "#enums/egg-type"; +import { SpeciesId } from "#enums/species-id"; +import { VariantTier } from "#enums/variant-tier"; +import type { PlayerPokemon } from "#field/pokemon"; +import { getIvsFromId, randInt, randomString, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; export const EGG_SEED = 1073741824; @@ -294,7 +294,7 @@ export class Egg { public getEggDescriptor(): string { if (this.isManaphyEgg()) { - return "Manaphy"; + return i18next.t("egg:manaphyTier"); } switch (this.tier) { case EggTier.RARE: diff --git a/src/data/moves/apply-attrs.ts b/src/data/moves/apply-attrs.ts index 98e7b6d791f..3162ba02bde 100644 --- a/src/data/moves/apply-attrs.ts +++ b/src/data/moves/apply-attrs.ts @@ -1,11 +1,11 @@ -/** +/* * Module holding functions to apply move attributes. * Must not import anything that is not a type. */ -import type Pokemon from "#app/field/pokemon"; -import type { default as Move, MoveAttr } from "./move"; -import type { ChargingMove } from "#app/@types/move-types"; -import type { MoveAttrFilter, MoveAttrString } from "#app/@types/move-types"; + +import type { Pokemon } from "#field/pokemon"; +import type { Move, MoveAttr } from "#moves/move"; +import type { ChargingMove, MoveAttrFilter, MoveAttrString } from "#types/move-types"; function applyMoveAttrsInternal( attrFilter: MoveAttrFilter, diff --git a/src/data/moves/move-utils.ts b/src/data/moves/move-utils.ts index 20723ab0347..39891f595aa 100644 --- a/src/data/moves/move-utils.ts +++ b/src/data/moves/move-utils.ts @@ -1,14 +1,13 @@ -import type Pokemon from "#app/field/pokemon"; +import { allMoves } from "#data/data-lists"; import type { BattlerIndex } from "#enums/battler-index"; -import type { MoveId } from "#enums/move-id"; -import type { MoveTargetSet, UserMoveConditionFunc } from "./move"; -import type Move from "./move"; -import { NumberHolder, isNullOrUndefined } from "#app/utils/common"; -import { MoveTarget } from "#enums/MoveTarget"; -import { PokemonType } from "#enums/pokemon-type"; -import { allMoves } from "#app/data/data-lists"; -import { applyMoveAttrs } from "./apply-attrs"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveTarget } from "#enums/MoveTarget"; +import type { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; +import type { Pokemon } from "#field/pokemon"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import type { Move, MoveTargetSet, UserMoveConditionFunc } from "#moves/move"; +import { isNullOrUndefined, NumberHolder } from "#utils/common"; /** * Return whether the move targets the field diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index db69e61ef53..9ff38a46878 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -1,5 +1,14 @@ -import { MoveChargeAnim } from "../battle-anims"; -import { ChargeAnim } from "#enums/move-anims-common"; +import { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "#abilities/ability"; +import { + applyAbAttrs +} from "#abilities/apply-ab-attrs"; +import { loggedInUser } from "#app/account"; +import type { GameMode } from "#app/game-mode"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import type { ArenaTrapTag } from "#data/arena-tag"; +import { WeakenMoveTypeTag } from "#data/arena-tag"; +import { MoveChargeAnim } from "#data/battle-anims"; import { CommandedTag, EncoreTag, @@ -11,31 +20,53 @@ import { SubstituteTag, TrappedTag, TypeBoostTag, -} from "../battler-tags"; -import { getPokemonNameWithAffix } from "../../messages"; -import type { AttackMoveResult, TurnMove } from "../../field/pokemon"; -import type Pokemon from "../../field/pokemon"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "./pokemon-move"; -import { MoveResult } from "#enums/move-result"; -import { HitResult } from "#enums/hit-result"; -import { FieldPosition } from "#enums/field-position"; +} from "#data/battler-tags"; +import { getBerryEffectFunc } from "#data/berry"; +import { applyChallenges } from "#data/challenge"; +import { allAbilities, allMoves } from "#data/data-lists"; +import { SpeciesFormChangeRevertWeatherFormTrigger } from "#data/form-change-triggers"; import { getNonVolatileStatusEffects, getStatusEffectHealText, isNonVolatileStatusEffect, -} from "../status-effect"; -import { getTypeDamageMultiplier } from "../type"; -import { PokemonType } from "#enums/pokemon-type"; -import { BooleanHolder, NumberHolder, isNullOrUndefined, toDmgValue, randSeedItem, randSeedInt, getEnumValues, toReadableString, type Constructor, randSeedFloat } from "#app/utils/common"; -import { WeatherType } from "#enums/weather-type"; -import type { ArenaTrapTag } from "../arena-tag"; -import { WeakenMoveTypeTag } from "../arena-tag"; +} from "#data/status-effect"; +import { TerrainType } from "#data/terrain"; +import { getTypeDamageMultiplier } from "#data/type"; +import { AbilityId } from "#enums/ability-id"; import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattleType } from "#enums/battle-type"; +import type { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BiomeId } from "#enums/biome-id"; +import { ChallengeType } from "#enums/challenge-type"; +import { Command } from "#enums/command"; +import { FieldPosition } from "#enums/field-position"; +import { HitResult } from "#enums/hit-result"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { ChargeAnim } from "#enums/move-anims-common"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { isVirtual, MoveUseMode } from "#enums/move-use-mode"; +import { MoveCategory } from "#enums/MoveCategory"; +import { MoveEffectTrigger } from "#enums/MoveEffectTrigger"; +import { MoveFlags } from "#enums/MoveFlags"; +import { MoveTarget } from "#enums/MoveTarget"; +import { MultiHitType } from "#enums/MultiHitType"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; import { - applyAbAttrs -} from "../abilities/apply-ab-attrs"; -import { allAbilities, allMoves } from "../data-lists"; + BATTLE_STATS, + type BattleStat, + type EffectiveStat, + getStatKey, + Stat, +} from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { SwitchType } from "#enums/switch-type"; +import { WeatherType } from "#enums/weather-type"; +import { MoveUsedEvent } from "#events/battle-scene"; +import type { EnemyPokemon, Pokemon } from "#field/pokemon"; import { AttackTypeBoosterModifier, BerryModifier, @@ -43,52 +74,22 @@ import { PokemonMoveAccuracyBoosterModifier, PokemonMultiHitModifier, PreserveBerryModifier, -} from "../../modifier/modifier"; -import type { BattlerIndex } from "#enums/battler-index"; -import { BattleType } from "#enums/battle-type"; -import { TerrainType } from "../terrain"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { Command } from "#enums/command"; +} from "#modifiers/modifier"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSketchMoves, invalidSleepTalkMoves } from "#moves/invalid-moves"; +import { frenzyMissFunc, getMoveTargets } from "#moves/move-utils"; +import { PokemonMove } from "#moves/pokemon-move"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { MovePhase } from "#phases/move-phase"; +import { PokemonHealPhase } from "#phases/pokemon-heal-phase"; +import { SwitchSummonPhase } from "#phases/switch-summon-phase"; +import type { AttackMoveResult } from "#types/attack-move-result"; +import type { Localizable } from "#types/locales"; +import type { ChargingMove, MoveAttrMap, MoveAttrString, MoveClassMap, MoveKindString } from "#types/move-types"; +import type { TurnMove } from "#types/turn-move"; +import { BooleanHolder, type Constructor, isNullOrUndefined, NumberHolder, randSeedFloat, randSeedInt, randSeedItem, toDmgValue, toReadableString } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; import i18next from "i18next"; -import type { Localizable } from "#app/@types/locales"; -import { getBerryEffectFunc } from "../berry"; -import { AbilityId } from "#enums/ability-id"; -import { ArenaTagType } from "#enums/arena-tag-type"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { BiomeId } from "#enums/biome-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { MoveUsedEvent } from "#app/events/battle-scene"; -import { - BATTLE_STATS, - type BattleStat, - type EffectiveStat, - getStatKey, - Stat, -} from "#app/enums/stat"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; -import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; -import { SpeciesFormChangeRevertWeatherFormTrigger } from "../pokemon-forms/form-change-triggers"; -import type { GameMode } from "#app/game-mode"; -import { applyChallenges } from "../challenge"; -import { ChallengeType } from "#enums/challenge-type"; -import { SwitchType } from "#enums/switch-type"; -import { StatusEffect } from "#enums/status-effect"; -import { globalScene } from "#app/global-scene"; -import { loggedInUser } from "#app/account"; -import { MoveCategory } from "#enums/MoveCategory"; -import { MoveTarget } from "#enums/MoveTarget"; -import { MoveFlags } from "#enums/MoveFlags"; -import { MoveEffectTrigger } from "#enums/MoveEffectTrigger"; -import { MultiHitType } from "#enums/MultiHitType"; -import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves, invalidSketchMoves } from "./invalid-moves"; -import { isVirtual, MoveUseMode } from "#enums/move-use-mode"; -import type { ChargingMove, MoveAttrMap, MoveAttrString, MoveKindString, MoveClassMap } from "#app/@types/move-types"; -import { applyMoveAttrs } from "./apply-attrs"; -import { frenzyMissFunc, getMoveTargets } from "./move-utils"; -import { AbAttrBaseParams, AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "../abilities/ability"; /** * A function used to conditionally determine execution of a given {@linkcode MoveAttr}. @@ -97,7 +98,7 @@ import { AbAttrBaseParams, AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrPar type MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => boolean; export type UserMoveConditionFunc = (user: Pokemon, move: Move) => boolean; -export default abstract class Move implements Localizable { +export abstract class Move implements Localizable { public id: MoveId; public name: string; private _type: PokemonType; @@ -680,13 +681,7 @@ export default abstract class Move implements Localizable { * @returns boolean: false if any of the apply()'s return false, else true */ applyConditions(user: Pokemon, target: Pokemon, move: Move): boolean { - for (const condition of this.conditions) { - if (!condition.apply(user, target, move)) { - return false; - } - } - - return true; + return this.conditions.every(cond => cond.apply(user, target, move)); } /** @@ -4049,30 +4044,6 @@ export class OpponentHighHpPowerAttr extends VariablePowerAttr { } } -/** - * Attribute to double this move's power if the target hasn't acted yet in the current turn. - * Used by {@linkcode Moves.BOLT_BEAK} and {@linkcode Moves.FISHIOUS_REND} - */ -export class FirstAttackDoublePowerAttr extends VariablePowerAttr { - /** - * Double this move's power if the user is acting before the target. - * @param user - Unused - * @param target - The {@linkcode Pokemon} being targeted by this move - * @param move - Unused - * @param args `[0]` - A {@linkcode NumberHolder} containing move base power - * @returns Whether the attribute was successfully applied - */ - apply(_user: Pokemon, target: Pokemon, move: Move, args: [NumberHolder]): boolean { - if (target.turnData.acted) { - return false; - } - - args[0].value *= 2; - return true; - } -} - - export class TurnDamagedDoublePowerAttr extends VariablePowerAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { if (user.turnData.attacksReceived.find(r => r.damage && r.sourceId === target.id)) { @@ -7535,7 +7506,9 @@ export class SuppressAbilitiesIfActedAttr extends MoveEffectAttr { } /** - * Used by Transform + * Attribute used to transform into the target on move use. + * + * Used for {@linkcode MoveId.TRANSFORM}. */ export class TransformAttr extends MoveEffectAttr { override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { @@ -7544,11 +7517,12 @@ export class TransformAttr extends MoveEffectAttr { } globalScene.phaseManager.unshiftNew("PokemonTransformPhase", user.getBattlerIndex(), target.getBattlerIndex()); - - globalScene.phaseManager.queueMessage(i18next.t("moveTriggers:transformedIntoTarget", { pokemonName: getPokemonNameWithAffix(user), targetName: getPokemonNameWithAffix(target) })); - return true; } + + getCondition(): MoveConditionFunc { + return (user, target) => user.canTransformInto(target) + } } /** @@ -8266,7 +8240,6 @@ const MoveAttrs = Object.freeze({ CompareWeightPowerAttr, HpPowerAttr, OpponentHighHpPowerAttr, - FirstAttackDoublePowerAttr, TurnDamagedDoublePowerAttr, MagnitudePowerAttr, AntiSunlightPowerDecreaseAttr, @@ -8813,12 +8786,12 @@ export function initMoves() { .makesContact(false), new StatusMove(MoveId.TRANSFORM, PokemonType.NORMAL, -1, 10, -1, 0, 1) .attr(TransformAttr) - .condition((user, target, move) => !target.getTag(BattlerTagType.SUBSTITUTE)) - .condition((user, target, move) => !target.summonData.illusion && !user.summonData.illusion) - // transforming from or into fusion pokemon causes various problems (such as crashes) - .condition((user, target, move) => !target.getTag(BattlerTagType.SUBSTITUTE) && !user.fusionSpecies && !target.fusionSpecies) .ignoresProtect() - // Transforming should copy the target's rage fist hit count + /* Transform: + * Does not copy the target's rage fist hit count + * Does not copy the target's volatile status conditions (ie BattlerTags) + * Renders user typeless when copying typeless opponent (should revert to original typing) + */ .edgeCase(), new AttackMove(MoveId.BUBBLE, PokemonType.WATER, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1) .attr(StatStageChangeAttr, [ Stat.SPD ], -1) @@ -9568,7 +9541,8 @@ export function initMoves() { new AttackMove(MoveId.CLOSE_COMBAT, PokemonType.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 4) .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true), new AttackMove(MoveId.PAYBACK, PokemonType.DARK, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 4) - .attr(MovePowerMultiplierAttr, (user, target, move) => target.getLastXMoves(1).find(m => m.turn === globalScene.currentBattle.turn) || globalScene.currentBattle.turnCommands[target.getBattlerIndex()]?.command === Command.BALL ? 2 : 1), + // Payback boosts power on item use + .attr(MovePowerMultiplierAttr, (_user, target) => target.turnData.acted || globalScene.currentBattle.turnCommands[target.getBattlerIndex()]?.command === Command.BALL ? 2 : 1), new AttackMove(MoveId.ASSURANCE, PokemonType.DARK, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 4) .attr(MovePowerMultiplierAttr, (user, target, move) => target.turnData.damageTaken > 0 ? 2 : 1), new StatusMove(MoveId.EMBARGO, PokemonType.DARK, 100, 15, -1, 0, 4) @@ -10780,9 +10754,9 @@ export function initMoves() { .condition(failIfGhostTypeCondition) .attr(AddBattlerTagAttr, BattlerTagType.OCTOLOCK, false, true, 1), new AttackMove(MoveId.BOLT_BEAK, PokemonType.ELECTRIC, MoveCategory.PHYSICAL, 85, 100, 10, -1, 0, 8) - .attr(FirstAttackDoublePowerAttr), + .attr(MovePowerMultiplierAttr, (_user, target) => target.turnData.acted ? 1 : 2), new AttackMove(MoveId.FISHIOUS_REND, PokemonType.WATER, MoveCategory.PHYSICAL, 85, 100, 10, -1, 0, 8) - .attr(FirstAttackDoublePowerAttr) + .attr(MovePowerMultiplierAttr, (_user, target) => target.turnData.acted ? 1 : 2) .bitingMove(), new StatusMove(MoveId.COURT_CHANGE, PokemonType.NORMAL, 100, 10, -1, 0, 8) .attr(SwapArenaTagsAttr, [ ArenaTagType.AURORA_VEIL, ArenaTagType.LIGHT_SCREEN, ArenaTagType.MIST, ArenaTagType.REFLECT, ArenaTagType.SPIKES, ArenaTagType.STEALTH_ROCK, ArenaTagType.STICKY_WEB, ArenaTagType.TAILWIND, ArenaTagType.TOXIC_SPIKES ]), diff --git a/src/data/moves/pokemon-move.ts b/src/data/moves/pokemon-move.ts index ab774c9fff9..ec5ae195bd6 100644 --- a/src/data/moves/pokemon-move.ts +++ b/src/data/moves/pokemon-move.ts @@ -1,8 +1,8 @@ -import type Pokemon from "#app/field/pokemon"; -import { toDmgValue } from "#app/utils/common"; +import { allMoves } from "#data/data-lists"; import type { MoveId } from "#enums/move-id"; -import { allMoves } from "../data-lists"; -import type Move from "./move"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { toDmgValue } from "#utils/common"; /** * Wrapper class for the {@linkcode Move} class for Pokemon to interact with. diff --git a/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts b/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts index 7a1c9821e89..5b2805f9310 100644 --- a/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts +++ b/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts @@ -1,27 +1,27 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { modifierTypes } from "#data/data-lists"; +import type { IEggOptions } from "#data/egg"; +import { EggSourceType } from "#enums/egg-source-types"; +import { EggTier } from "#enums/egg-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerType } from "#enums/trainer-type"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { initBattleWithEnemyConfig, leaveEncounterWithoutBattle, setEncounterRewards, transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { TrainerType } from "#enums/trainer-type"; -import { SpeciesId } from "#enums/species-id"; -import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { randSeedInt } from "#app/utils/common"; +} from "#mystery-encounters/encounter-phase-utils"; +import { getSpriteKeysFromSpecies } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { randSeedInt } from "#utils/common"; import i18next from "i18next"; -import type { IEggOptions } from "#app/data/egg"; -import { EggSourceType } from "#enums/egg-source-types"; -import { EggTier } from "#enums/egg-type"; -import { ModifierTier } from "#enums/modifier-tier"; -import { modifierTypes } from "#app/data/data-lists"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/aTrainersTest"; diff --git a/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts b/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts index bec75288837..d6058eb9eaf 100644 --- a/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts +++ b/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts @@ -1,44 +1,44 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import type { BerryType } from "#enums/berry-type"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TrainerSlot } from "#enums/trainer-slot"; +import type { Pokemon } from "#field/pokemon"; +import { EnemyPokemon } from "#field/pokemon"; +import { BerryModifier, PokemonInstantReviveModifier } from "#modifiers/modifier"; +import type { BerryModifierType, PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, initBattleWithEnemyConfig, leaveEncounterWithoutBattle, setEncounterRewards, transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import type { BerryModifierType, PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { PersistentModifierRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { BerryModifier, PokemonInstantReviveModifier } from "#app/modifier/modifier"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoveId } from "#enums/move-id"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { randInt } from "#app/utils/common"; -import { BattlerIndex } from "#enums/battler-index"; +} from "#mystery-encounters/encounter-phase-utils"; import { applyModifierTypeToPlayerPokemon, catchPokemon, getHighestLevelPlayerPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { PokeballType } from "#enums/pokeball"; -import type HeldModifierConfig from "#app/@types/held-modifier-config"; -import type { BerryType } from "#enums/berry-type"; -import { Stat } from "#enums/stat"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { PersistentModifierRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import type { HeldModifierConfig } from "#types/held-modifier-config"; +import { randInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { MoveUseMode } from "#enums/move-use-mode"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounters/absoluteAvarice"; diff --git a/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts b/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts index f8a904cdb45..619acabe200 100644 --- a/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts +++ b/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts @@ -1,28 +1,28 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { speciesStarterCosts } from "#balance/starters"; +import { modifierTypes } from "#data/data-lists"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; import { generateModifierType, leaveEncounterWithoutBattle, setEncounterExp, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { modifierTypes } from "#app/data/data-lists"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; +} from "#mystery-encounters/encounter-phase-utils"; +import { getHighestStatTotalPlayerPokemon } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; import { AbilityRequirement, CombinationPokemonRequirement, MoveRequirement, -} from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { getHighestStatTotalPlayerPokemon } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { EXTORTION_ABILITIES, EXTORTION_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +} from "#mystery-encounters/mystery-encounter-requirements"; +import { EXTORTION_ABILITIES, EXTORTION_MOVES } from "#mystery-encounters/requirement-groups"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; /** the i18n namespace for this encounter */ diff --git a/src/data/mystery-encounters/encounters/berries-abound-encounter.ts b/src/data/mystery-encounters/encounters/berries-abound-encounter.ts index d86a8439804..a827c3fcc0a 100644 --- a/src/data/mystery-encounters/encounters/berries-abound-encounter.ts +++ b/src/data/mystery-encounters/encounters/berries-abound-encounter.ts @@ -1,5 +1,20 @@ -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { modifierTypes } from "#data/data-lists"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PERMANENT_STATS, Stat } from "#enums/stat"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { BerryModifier } from "#modifiers/modifier"; +import type { BerryModifierType, ModifierTypeOption } from "#modifiers/modifier-type"; +import { regenerateModifierPoolThresholds } from "#modifiers/modifier-type"; +import { queueEncounterMessage, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, generateModifierTypeOption, @@ -8,36 +23,21 @@ import { leaveEncounterWithoutBattle, setEncounterExp, setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type"; -import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { randSeedInt } from "#app/utils/common"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +} from "#mystery-encounters/encounter-phase-utils"; import { applyModifierTypeToPlayerPokemon, getEncounterPokemonLevelForWave, getHighestStatPlayerPokemon, getSpriteKeysFromPokemon, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import PokemonData from "#app/system/pokemon-data"; -import { BerryModifier } from "#app/modifier/modifier"; -import i18next from "#app/plugins/i18n"; -import { BerryType } from "#enums/berry-type"; -import { PERMANENT_STATS, Stat } from "#enums/stat"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import i18next from "#plugins/i18n"; +import { PokemonData } from "#system/pokemon-data"; +import { randSeedItem } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/berriesAbound"; @@ -311,7 +311,7 @@ export const BerriesAboundEncounter: MysteryEncounter = MysteryEncounterBuilder. .build(); function tryGiveBerry(prioritizedPokemon?: PlayerPokemon) { - const berryType = randSeedInt(Object.keys(BerryType).filter(s => !Number.isNaN(Number(s))).length) as BerryType; + const berryType = randSeedItem(getEnumValues(BerryType)); const berry = generateModifierType(modifierTypes.BERRY, [berryType]) as BerryModifierType; const party = globalScene.getPlayerParty(); diff --git a/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts b/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts index df06f40c159..d60ebe690ac 100644 --- a/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts +++ b/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts @@ -1,4 +1,29 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { allMoves, modifierTypes } from "#data/data-lists"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; +import { + AttackTypeBoosterModifier, + BypassSpeedChanceModifier, + ContactHeldItemTransferChanceModifier, + GigantamaxAccessModifier, + MegaEvolutionAccessModifier, +} from "#modifiers/modifier"; +import type { AttackTypeBoosterModifierType, ModifierTypeOption } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { getEncounterText, showEncounterDialogue } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, generateModifierTypeOption, @@ -8,51 +33,23 @@ import { selectPokemonForOption, setEncounterRewards, transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { getRandomPartyMemberFunc, trainerConfigs } from "#app/data/trainers/trainer-config"; -import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { PartyMemberStrength } from "#enums/party-member-strength"; -import { globalScene } from "#app/global-scene"; -import { isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils/common"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { TrainerType } from "#enums/trainer-type"; -import { SpeciesId } from "#enums/species-id"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { getEncounterText, showEncounterDialogue } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { MoveId } from "#enums/move-id"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +} from "#mystery-encounters/encounter-phase-utils"; +import { getSpriteKeysFromSpecies } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; import { AttackTypeBoosterHeldItemTypeRequirement, CombinationPokemonRequirement, HeldItemRequirement, TypeRequirement, -} from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { PokemonType } from "#enums/pokemon-type"; -import type { AttackTypeBoosterModifierType, ModifierTypeOption } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { - AttackTypeBoosterModifier, - BypassSpeedChanceModifier, - ContactHeldItemTransferChanceModifier, - GigantamaxAccessModifier, - MegaEvolutionAccessModifier, -} from "#app/modifier/modifier"; +} from "#mystery-encounters/mystery-encounter-requirements"; +import { getRandomPartyMemberFunc, trainerConfigs } from "#trainers/trainer-config"; +import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/trainer-party-template"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { MoveInfoOverlay } from "#ui/move-info-overlay"; +import { isNullOrUndefined, randSeedInt, randSeedShuffle } from "#utils/common"; import i18next from "i18next"; -import MoveInfoOverlay from "#app/ui/move-info-overlay"; -import { allMoves } from "#app/data/data-lists"; -import { ModifierTier } from "#enums/modifier-tier"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/bugTypeSuperfan"; @@ -292,6 +289,7 @@ export const BugTypeSuperfanEncounter: MysteryEncounter = MysteryEncounterBuilde // Init the moves available for tutor const moveTutorOptions: PokemonMove[] = []; + // TODO: should this use `randSeedItem`? moveTutorOptions.push(new PokemonMove(PHYSICAL_TUTOR_MOVES[randSeedInt(PHYSICAL_TUTOR_MOVES.length)])); moveTutorOptions.push(new PokemonMove(SPECIAL_TUTOR_MOVES[randSeedInt(SPECIAL_TUTOR_MOVES.length)])); moveTutorOptions.push(new PokemonMove(STATUS_TUTOR_MOVES[randSeedInt(STATUS_TUTOR_MOVES.length)])); @@ -389,6 +387,7 @@ export const BugTypeSuperfanEncounter: MysteryEncounter = MysteryEncounterBuilde specialOptions.push(rareFormChangeModifier); } if (specialOptions.length > 0) { + // TODO: should this use `randSeedItem`? modifierOptions.push(specialOptions[randSeedInt(specialOptions.length)]); } diff --git a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts index 818318bb499..1c3335b859f 100644 --- a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts +++ b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts @@ -1,4 +1,32 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { EncounterBattleAnim } from "#data/battle-anims"; +import { allAbilities, modifierTypes } from "#data/data-lists"; +import { CustomPokemonData } from "#data/pokemon-data"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BerryType } from "#enums/berry-type"; +import { Challenges } from "#enums/challenges"; +import { EncounterAnim } from "#enums/encounter-anims"; +import { MoveCategory } from "#enums/MoveCategory"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerType } from "#enums/trainer-type"; +import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon } from "#field/pokemon"; +import { BerryModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { showEncounterDialogue, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, initBattleWithEnemyConfig, @@ -7,49 +35,20 @@ import { selectPokemonForOption, setEncounterRewards, transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { ModifierTier } from "#enums/modifier-tier"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { PartyMemberStrength } from "#enums/party-member-strength"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { SpeciesId } from "#enums/species-id"; -import { TrainerType } from "#enums/trainer-type"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { AbilityId } from "#enums/ability-id"; +} from "#mystery-encounters/encounter-phase-utils"; import { applyAbilityOverrideToPokemon, applyModifierTypeToPlayerPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { PokemonType } from "#enums/pokemon-type"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { randSeedInt, randSeedShuffle } from "#app/utils/common"; -import { showEncounterDialogue, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { UiMode } from "#enums/ui-mode"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/trainer-party-template"; +import type { OptionSelectConfig } from "#ui/abstact-option-select-ui-handler"; +import { randSeedInt, randSeedShuffle } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import type { OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { BerryModifier } from "#app/modifier/modifier"; -import { BerryType } from "#enums/berry-type"; -import { BattlerIndex } from "#enums/battler-index"; -import { MoveId } from "#enums/move-id"; -import { EncounterBattleAnim } from "#app/data/battle-anims"; -import { MoveCategory } from "#enums/MoveCategory"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { EncounterAnim } from "#enums/encounter-anims"; -import { Challenges } from "#enums/challenges"; -import { MoveUseMode } from "#enums/move-use-mode"; -import { allAbilities, modifierTypes } from "#app/data/data-lists"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/clowningAround"; @@ -139,6 +138,7 @@ export const ClowningAroundEncounter: MysteryEncounter = MysteryEncounterBuilder clownConfig.partyTemplateFunc = null; // Overrides party template func if it exists // Generate random ability for Blacephalon from pool + // TODO: should this use `randSeedItem`? const ability = RANDOM_ABILITY_POOL[randSeedInt(RANDOM_ABILITY_POOL.length)]; encounter.setDialogueToken("ability", allAbilities[ability].name); encounter.misc = { ability }; diff --git a/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts b/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts index cf24d1dd7e0..94006a43837 100644 --- a/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts +++ b/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts @@ -1,46 +1,45 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { globalScene } from "#app/global-scene"; -import { EncounterBattleAnim } from "#app/data/battle-anims"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MoveRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { DANCING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import { getEncounterText, queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - initBattleWithEnemyConfig, - leaveEncounterWithoutBattle, - selectPokemonForOption, - setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - catchPokemon, - getEncounterPokemonLevelForWave, - STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { TrainerSlot } from "#enums/trainer-slot"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { modifierTypes } from "#app/data/data-lists"; -import PokemonData from "#app/system/pokemon-data"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; +import { globalScene } from "#app/global-scene"; +import { EncounterBattleAnim } from "#data/battle-anims"; +import { modifierTypes } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BiomeId } from "#enums/biome-id"; import { EncounterAnim } from "#enums/encounter-anims"; import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { PokeballType } from "#enums/pokeball"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; +import { TrainerSlot } from "#enums/trainer-slot"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { EnemyPokemon } from "#field/pokemon"; +import { PokemonMove } from "#moves/pokemon-move"; +import { getEncounterText, queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; +import { + initBattleWithEnemyConfig, + leaveEncounterWithoutBattle, + selectPokemonForOption, + setEncounterRewards, +} from "#mystery-encounters/encounter-phase-utils"; +import { + catchPokemon, + getEncounterPokemonLevelForWave, + STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER, +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoveRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { DANCING_MOVES } from "#mystery-encounters/requirement-groups"; +import { PokemonData } from "#system/pokemon-data"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { MoveUseMode } from "#enums/move-use-mode"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounters/dancingLessons"; diff --git a/src/data/mystery-encounters/encounters/dark-deal-encounter.ts b/src/data/mystery-encounters/encounters/dark-deal-encounter.ts index 4056ba3532e..29517ac2531 100644 --- a/src/data/mystery-encounters/encounters/dark-deal-encounter.ts +++ b/src/data/mystery-encounters/encounters/dark-deal-encounter.ts @@ -1,25 +1,22 @@ -import type { PokemonType } from "#enums/pokemon-type"; -import { isNullOrUndefined, randSeedInt } from "#app/utils/common"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { globalScene } from "#app/global-scene"; -import { modifierTypes } from "#app/data/data-lists"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type { EnemyPartyConfig, EnemyPokemonConfig } from "../utils/encounter-phase-utils"; -import { initBattleWithEnemyConfig, leaveEncounterWithoutBattle } from "../utils/encounter-phase-utils"; -import { - getRandomPlayerPokemon, - getRandomSpeciesByStarterCost, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { PokemonFormChangeItemModifier } from "#app/modifier/modifier"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; import { Challenges } from "#enums/challenges"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import type { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; +import { PokemonFormChangeItemModifier } from "#modifiers/modifier"; +import type { EnemyPartyConfig, EnemyPokemonConfig } from "#mystery-encounters/encounter-phase-utils"; +import { initBattleWithEnemyConfig, leaveEncounterWithoutBattle } from "#mystery-encounters/encounter-phase-utils"; +import { getRandomPlayerPokemon, getRandomSpeciesByStarterCost } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { isNullOrUndefined, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** i18n namespace for encounter */ const namespace = "mysteryEncounters/darkDeal"; diff --git a/src/data/mystery-encounters/encounters/delibirdy-encounter.ts b/src/data/mystery-encounters/encounters/delibirdy-encounter.ts index 842fc9d73bd..66f50f134dd 100644 --- a/src/data/mystery-encounters/encounters/delibirdy-encounter.ts +++ b/src/data/mystery-encounters/encounters/delibirdy-encounter.ts @@ -1,42 +1,41 @@ -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { - CombinationPokemonRequirement, - HeldItemRequirement, - MoneyRequirement, -} from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { getEncounterText, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { - generateModifierType, - leaveEncounterWithoutBattle, - selectPokemonForOption, - updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { applyModifierTypeToPlayerPokemon } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import type { PokemonHeldItemModifier, PokemonInstantReviveModifier } from "#app/modifier/modifier"; +import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifier, PokemonInstantReviveModifier } from "#modifiers/modifier"; import { BerryModifier, HealingBoosterModifier, LevelIncrementBoosterModifier, MoneyMultiplierModifier, PreserveBerryModifier, -} from "#app/modifier/modifier"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import i18next from "#app/plugins/i18n"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import { randSeedItem } from "#app/utils/common"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { timedEventManager } from "#app/global-event-manager"; +} from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { getEncounterText, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import { + generateModifierType, + leaveEncounterWithoutBattle, + selectPokemonForOption, + updatePlayerMoney, +} from "#mystery-encounters/encounter-phase-utils"; +import { applyModifierTypeToPlayerPokemon } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { + CombinationPokemonRequirement, + HeldItemRequirement, + MoneyRequirement, +} from "#mystery-encounters/mystery-encounter-requirements"; +import i18next from "#plugins/i18n"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { randSeedItem } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounters/delibirdy"; diff --git a/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts b/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts index 46152a7dc41..a45c5301a3e 100644 --- a/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts +++ b/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts @@ -1,16 +1,13 @@ -import { - leaveEncounterWithoutBattle, - setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { ModifierTypeFunc } from "#app/@types/modifier-types"; -import { modifierTypes } from "#app/data/data-lists"; -import { randSeedInt } from "#app/utils/common"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { modifierTypes } from "#data/data-lists"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { leaveEncounterWithoutBattle, setEncounterRewards } from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import type { ModifierTypeFunc } from "#types/modifier-types"; +import { randSeedInt } from "#utils/common"; /** i18n namespace for encounter */ const namespace = "mysteryEncounters/departmentStoreSale"; diff --git a/src/data/mystery-encounters/encounters/field-trip-encounter.ts b/src/data/mystery-encounters/encounters/field-trip-encounter.ts index 6ab0f8a6a4b..84374c87e58 100644 --- a/src/data/mystery-encounters/encounters/field-trip-encounter.ts +++ b/src/data/mystery-encounters/encounters/field-trip-encounter.ts @@ -1,25 +1,25 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; import { MoveCategory } from "#enums/MoveCategory"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Stat } from "#enums/stat"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { PokemonMove } from "#moves/pokemon-move"; import { generateModifierTypeOption, leaveEncounterWithoutBattle, selectPokemonForOption, setEncounterExp, setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import { modifierTypes } from "#app/data/data-lists"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { Stat } from "#enums/stat"; +} from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; import i18next from "i18next"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; /** i18n namespace for the encounter */ const namespace = "mysteryEncounters/fieldTrip"; diff --git a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts index e8900f8def4..7d2583a00cb 100644 --- a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts +++ b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts @@ -1,52 +1,52 @@ -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { EncounterBattleAnim } from "#data/battle-anims"; +import { allAbilities, modifierTypes } from "#data/data-lists"; +import { Gender } from "#data/gender"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { EncounterAnim } from "#enums/encounter-anims"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { WeatherType } from "#enums/weather-type"; +import type { Pokemon } from "#field/pokemon"; +import type { AttackTypeBoosterModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { + generateModifierType, initBattleWithEnemyConfig, - loadCustomMovesForEncounter, leaveEncounterWithoutBattle, + loadCustomMovesForEncounter, setEncounterExp, setEncounterRewards, transitionMysteryEncounterIntroVisuals, - generateModifierType, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { - AbilityRequirement, - CombinationPokemonRequirement, - TypeRequirement, -} from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { SpeciesId } from "#enums/species-id"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { Gender } from "#app/data/gender"; -import { PokemonType } from "#enums/pokemon-type"; -import { BattlerIndex } from "#enums/battler-index"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { MoveId } from "#enums/move-id"; -import { EncounterBattleAnim } from "#app/data/battle-anims"; -import { WeatherType } from "#enums/weather-type"; -import { isNullOrUndefined, randSeedInt } from "#app/utils/common"; -import { StatusEffect } from "#enums/status-effect"; -import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; +} from "#mystery-encounters/encounter-phase-utils"; import { applyAbilityOverrideToPokemon, applyDamageToPokemon, applyModifierTypeToPlayerPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { EncounterAnim } from "#enums/encounter-anims"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { Stat } from "#enums/stat"; -import { FIRE_RESISTANT_ABILITIES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import { MoveUseMode } from "#enums/move-use-mode"; -import { allAbilities, modifierTypes } from "#app/data/data-lists"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { + AbilityRequirement, + CombinationPokemonRequirement, + TypeRequirement, +} from "#mystery-encounters/mystery-encounter-requirements"; +import { FIRE_RESISTANT_ABILITIES } from "#mystery-encounters/requirement-groups"; +import { isNullOrUndefined, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/fieryFallout"; diff --git a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts index c53ff610c48..6ee2ebcdf67 100644 --- a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts +++ b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts @@ -1,35 +1,35 @@ -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import type { Pokemon } from "#field/pokemon"; +import type { ModifierTypeOption } from "#modifiers/modifier-type"; +import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#modifiers/modifier-type"; +import { queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { getRandomEncounterSpecies, initBattleWithEnemyConfig, leaveEncounterWithoutBattle, setEncounterExp, setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import type Pokemon from "#app/field/pokemon"; -import { ModifierTier } from "#enums/modifier-tier"; -import type { ModifierTypeOption } from "#app/modifier/modifier-type"; -import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MoveRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +} from "#mystery-encounters/encounter-phase-utils"; import { getEncounterPokemonLevelForWave, getSpriteKeysFromPokemon, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import PokemonData from "#app/system/pokemon-data"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { randSeedInt } from "#app/utils/common"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoveRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { STEALING_MOVES } from "#mystery-encounters/requirement-groups"; +import { PokemonData } from "#system/pokemon-data"; +import { randSeedInt } from "#utils/common"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/fightOrFlight"; diff --git a/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts b/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts index 9611560fe62..bf376c04843 100644 --- a/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts +++ b/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts @@ -1,35 +1,34 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { modifierTypes } from "#data/data-lists"; +import { SpeciesFormChangeActiveTrigger } from "#data/form-change-triggers"; +import { getPokeballAtlasKey, getPokeballTintColor } from "#data/pokeball"; +import { FieldPosition } from "#enums/field-position"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PlayerGender } from "#enums/player-gender"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { addPokeballOpenParticles } from "#field/anims"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { queueEncounterMessage, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; import { leaveEncounterWithoutBattle, selectPokemonForOption, setEncounterRewards, transitionMysteryEncounterIntroVisuals, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { TrainerSlot } from "#enums/trainer-slot"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { SpeciesId } from "#enums/species-id"; +} from "#mystery-encounters/encounter-phase-utils"; +import { isPokemonValidForEncounterOptionSelection } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoneyRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { PlayerGender } from "#enums/player-gender"; -import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball"; -import { addPokeballOpenParticles } from "#app/field/anims"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { modifierTypes } from "#app/data/data-lists"; -import { Nature } from "#enums/nature"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/funAndGames"; diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index 6bbc1a68772..b914927123a 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -1,58 +1,50 @@ -import { - leaveEncounterWithoutBattle, - selectPokemonForOption, - setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { ModifierTier } from "#enums/modifier-tier"; -import { MusicPreference } from "#app/system/settings/settings"; -import type { ModifierTypeOption } from "#app/modifier/modifier-type"; -import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { timedEventManager } from "#app/global-event-manager"; import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { SpeciesId } from "#enums/species-id"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { allSpecies } from "#app/data/data-lists"; -import { getTypeRgb } from "#app/data/type"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; +import { allSpecies } from "#data/data-lists"; +import { Gender, getGenderSymbol } from "#data/gender"; +import { getNatureName } from "#data/nature"; +import { getPokeballAtlasKey, getPokeballTintColor } from "#data/pokeball"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { getTypeRgb } from "#data/type"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { ModifierTier } from "#enums/modifier-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { - NumberHolder, - isNullOrUndefined, - randInt, - randSeedInt, - randSeedShuffle, - randSeedItem, -} from "#app/utils/common"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import type { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { doShinySparkleAnim } from "#field/anims"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { EnemyPokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; import { HiddenAbilityRateBoosterModifier, PokemonFormChangeItemModifier, ShinyRateBoosterModifier, SpeciesStatBoosterModifier, -} from "#app/modifier/modifier"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import PokemonData from "#app/system/pokemon-data"; +} from "#modifiers/modifier"; +import type { ModifierTypeOption } from "#modifiers/modifier-type"; +import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { getEncounterText, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import { + leaveEncounterWithoutBattle, + selectPokemonForOption, + setEncounterRewards, +} from "#mystery-encounters/encounter-phase-utils"; +import { addPokemonDataToDexAndValidateAchievements } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { PokemonData } from "#system/pokemon-data"; +import { MusicPreference } from "#system/settings"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { isNullOrUndefined, NumberHolder, randInt, randSeedInt, randSeedItem, randSeedShuffle } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { Gender, getGenderSymbol } from "#app/data/gender"; -import { getNatureName } from "#app/data/nature"; -import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball"; -import { getEncounterText, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { addPokemonDataToDexAndValidateAchievements } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import type { PokeballType } from "#enums/pokeball"; -import { doShinySparkleAnim } from "#app/field/anims"; -import { TrainerType } from "#enums/trainer-type"; -import { timedEventManager } from "#app/global-event-manager"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/globalTradeSystem"; diff --git a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts index 2b54b0a42f5..10f45c21b68 100644 --- a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts +++ b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts @@ -1,17 +1,17 @@ -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { leaveEncounterWithoutBattle, setEncounterExp } from "../utils/encounter-phase-utils"; -import { applyDamageToPokemon } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { globalScene } from "#app/global-scene"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { PokemonMove } from "#moves/pokemon-move"; +import { leaveEncounterWithoutBattle, setEncounterExp } from "#mystery-encounters/encounter-phase-utils"; +import { applyDamageToPokemon } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; const OPTION_1_REQUIRED_MOVE = MoveId.SURF; const OPTION_2_REQUIRED_MOVE = MoveId.FLY; diff --git a/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts b/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts index ae3d905cf91..6f15f150d8b 100644 --- a/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts +++ b/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts @@ -1,22 +1,21 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - initBattleWithEnemyConfig, - setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { trainerPartyTemplates } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; import { ModifierTier } from "#enums/modifier-tier"; -import { modifierTypes } from "#app/data/data-lists"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { PartyMemberStrength } from "#enums/party-member-strength"; -import { globalScene } from "#app/global-scene"; -import { randSeedInt } from "#app/utils/common"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; +import { initBattleWithEnemyConfig, setEncounterRewards } from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { + TrainerPartyCompoundTemplate, + TrainerPartyTemplate, + trainerPartyTemplates, +} from "#trainers/trainer-party-template"; +import { randSeedInt } from "#utils/common"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/mysteriousChallengers"; diff --git a/src/data/mystery-encounters/encounters/mysterious-chest-encounter.ts b/src/data/mystery-encounters/encounters/mysterious-chest-encounter.ts index 321e65d7008..1bc2404dc27 100644 --- a/src/data/mystery-encounters/encounters/mysterious-chest-encounter.ts +++ b/src/data/mystery-encounters/encounters/mysterious-chest-encounter.ts @@ -1,28 +1,25 @@ -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - initBattleWithEnemyConfig, - leaveEncounterWithoutBattle, - setEncounterRewards, - transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - getHighestLevelPlayerPokemon, - koPlayerPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; import { ModifierTier } from "#enums/modifier-tier"; -import { randSeedInt } from "#app/utils/common"; import { MoveId } from "#enums/move-id"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; +import { queueEncounterMessage, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; +import { + initBattleWithEnemyConfig, + leaveEncounterWithoutBattle, + setEncounterRewards, + transitionMysteryEncounterIntroVisuals, +} from "#mystery-encounters/encounter-phase-utils"; +import { getHighestLevelPlayerPokemon, koPlayerPokemon } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** i18n namespace for encounter */ const namespace = "mysteryEncounters/mysteriousChest"; diff --git a/src/data/mystery-encounters/encounters/part-timer-encounter.ts b/src/data/mystery-encounters/encounters/part-timer-encounter.ts index 1074eaf8c81..a865de3b19d 100644 --- a/src/data/mystery-encounters/encounters/part-timer-encounter.ts +++ b/src/data/mystery-encounters/encounters/part-timer-encounter.ts @@ -1,4 +1,11 @@ -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Stat } from "#enums/stat"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { showEncounterDialogue, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; import { leaveEncounterWithoutBattle, selectPokemonForOption, @@ -6,22 +13,14 @@ import { setEncounterRewards, transitionMysteryEncounterIntroVisuals, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MoveRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { Stat } from "#enums/stat"; -import { CHARMING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import { showEncounterDialogue, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; +} from "#mystery-encounters/encounter-phase-utils"; +import { isPokemonValidForEncounterOptionSelection } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoveRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { CHARMING_MOVES } from "#mystery-encounters/requirement-groups"; import i18next from "i18next"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/partTimer"; diff --git a/src/data/mystery-encounters/encounters/safari-zone-encounter.ts b/src/data/mystery-encounters/encounters/safari-zone-encounter.ts index 207e6ca400d..c3400b41327 100644 --- a/src/data/mystery-encounters/encounters/safari-zone-encounter.ts +++ b/src/data/mystery-encounters/encounters/safari-zone-encounter.ts @@ -1,36 +1,36 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { NON_LEGEND_PARADOX_POKEMON } from "#balance/special-species-groups"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PlayerGender } from "#enums/player-gender"; +import { PokeballType } from "#enums/pokeball"; +import { TrainerSlot } from "#enums/trainer-slot"; +import type { EnemyPokemon } from "#field/pokemon"; +import { HiddenAbilityRateBoosterModifier, IvScannerModifier } from "#modifiers/modifier"; +import { getEncounterText, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; import { initSubsequentOptionSelect, leaveEncounterWithoutBattle, transitionMysteryEncounterIntroVisuals, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { HiddenAbilityRateBoosterModifier, IvScannerModifier } from "#app/modifier/modifier"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { PokeballType } from "#enums/pokeball"; -import { PlayerGender } from "#enums/player-gender"; -import { NumberHolder, randSeedInt } from "#app/utils/common"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; +} from "#mystery-encounters/encounter-phase-utils"; import { doPlayerFlee, doPokemonFlee, getRandomSpeciesByStarterCost, trainerThrowPokeball, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { getEncounterText, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-groups"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import type { MysteryEncounterOption } from "#mystery-encounters/mystery-encounter-option"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoneyRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { NumberHolder, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/safariZone"; diff --git a/src/data/mystery-encounters/encounters/shady-vitamin-dealer-encounter.ts b/src/data/mystery-encounters/encounters/shady-vitamin-dealer-encounter.ts index 967c105c740..47317c12b50 100644 --- a/src/data/mystery-encounters/encounters/shady-vitamin-dealer-encounter.ts +++ b/src/data/mystery-encounters/encounters/shady-vitamin-dealer-encounter.ts @@ -1,32 +1,31 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { getNatureName } from "#data/nature"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import type { Nature } from "#enums/nature"; +import { SpeciesId } from "#enums/species-id"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { getEncounterText, queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; import { generateModifierType, leaveEncounterWithoutBattle, selectPokemonForOption, setEncounterExp, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { modifierTypes } from "#app/data/data-lists"; -import { randSeedInt } from "#app/utils/common"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { getEncounterText, queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; +} from "#mystery-encounters/encounter-phase-utils"; import { applyDamageToPokemon, applyModifierTypeToPlayerPokemon, isPokemonValidForEncounterOptionSelection, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import type { Nature } from "#enums/nature"; -import { getNatureName } from "#app/data/nature"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoneyRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { randSeedInt } from "#utils/common"; import i18next from "i18next"; /** the i18n namespace for this encounter */ diff --git a/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts b/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts index 4169fd6d7c5..cddfef1ef76 100644 --- a/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts +++ b/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts @@ -1,15 +1,22 @@ -import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { CustomPokemonData } from "#data/pokemon-data"; +import { AiType } from "#enums/ai-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BerryType } from "#enums/berry-type"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MoveRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import type { EnemyPartyConfig, EnemyPokemonConfig } from "../utils/encounter-phase-utils"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig, EnemyPokemonConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, initBattleWithEnemyConfig, @@ -17,21 +24,14 @@ import { loadCustomMovesForEncounter, setEncounterExp, setEncounterRewards, -} from "../utils/encounter-phase-utils"; -import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { Nature } from "#enums/nature"; -import { MoveId } from "#enums/move-id"; -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { AiType } from "#enums/ai-type"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { BerryType } from "#enums/berry-type"; -import { Stat } from "#enums/stat"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import { randSeedInt } from "#app/utils/common"; -import { MoveUseMode } from "#enums/move-use-mode"; +} from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoveRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { STEALING_MOVES } from "#mystery-encounters/requirement-groups"; +import { randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** i18n namespace for the encounter */ const namespace = "mysteryEncounters/slumberingSnorlax"; diff --git a/src/data/mystery-encounters/encounters/teleporting-hijinks-encounter.ts b/src/data/mystery-encounters/encounters/teleporting-hijinks-encounter.ts index 9c9232612c6..b547064fd66 100644 --- a/src/data/mystery-encounters/encounters/teleporting-hijinks-encounter.ts +++ b/src/data/mystery-encounters/encounters/teleporting-hijinks-encounter.ts @@ -1,4 +1,21 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { modifierTypes } from "#data/data-lists"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BiomeId } from "#enums/biome-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokemonType } from "#enums/pokemon-type"; +import { Stat } from "#enums/stat"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { getBiomeKey } from "#field/arena"; +import type { Pokemon } from "#field/pokemon"; +import { EnemyPokemon } from "#field/pokemon"; +import { getPartyLuckValue } from "#modifiers/modifier-type"; +import { queueEncounterMessage, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierTypeOption, initBattleWithEnemyConfig, @@ -6,34 +23,17 @@ import { setEncounterRewards, transitionMysteryEncounterIntroVisuals, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { randSeedInt } from "#app/utils/common"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MoneyRequirement, WaveModulusRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import PokemonData from "#app/system/pokemon-data"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { BiomeId } from "#enums/biome-id"; -import { getBiomeKey } from "#app/field/arena"; -import { PokemonType } from "#enums/pokemon-type"; -import { getPartyLuckValue } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { Stat } from "#enums/stat"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +} from "#mystery-encounters/encounter-phase-utils"; import { getEncounterPokemonLevelForWave, STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoneyRequirement, WaveModulusRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { PokemonData } from "#system/pokemon-data"; +import { randSeedInt } from "#utils/common"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounters/teleportingHijinks"; @@ -190,6 +190,7 @@ async function doBiomeTransitionDialogueAndBattleInit() { // Calculate new biome (cannot be current biome) const filteredBiomes = BIOME_CANDIDATES.filter(b => globalScene.arena.biomeType !== b); + // TODO: should this use `randSeedItem`? const newBiome = filteredBiomes[randSeedInt(filteredBiomes.length)]; // Show dialogue and transition biome diff --git a/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts b/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts index 03c09f6918e..235bd322ef8 100644 --- a/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts @@ -1,34 +1,34 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { globalScene } from "#app/global-scene"; +import { speciesStarterCosts } from "#balance/starters"; +import { modifierTypes } from "#data/data-lists"; +import type { IEggOptions } from "#data/egg"; +import { getPokeballTintColor } from "#data/pokeball"; +import { BiomeId } from "#enums/biome-id"; +import { EggSourceType } from "#enums/egg-source-types"; +import { EggTier } from "#enums/egg-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerType } from "#enums/trainer-type"; +import type { PlayerPokemon } from "#field/pokemon"; +import { getEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { handleMysteryEncounterBattleFailed, initBattleWithEnemyConfig, setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import { randSeedShuffle } from "#app/utils/common"; -import type MysteryEncounter from "../mystery-encounter"; -import { MysteryEncounterBuilder } from "../mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { BiomeId } from "#enums/biome-id"; -import { TrainerType } from "#enums/trainer-type"; +} from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { randSeedShuffle } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { SpeciesId } from "#enums/species-id"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { Nature } from "#enums/nature"; -import { MoveId } from "#enums/move-id"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { getEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { IEggOptions } from "#app/data/egg"; -import { EggSourceType } from "#enums/egg-source-types"; -import { EggTier } from "#enums/egg-type"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { modifierTypes } from "#app/data/data-lists"; -import { PokemonType } from "#enums/pokemon-type"; -import { getPokeballTintColor } from "#app/data/pokeball"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/theExpertPokemonBreeder"; diff --git a/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts b/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts index c3bcf9ceb24..91662993a51 100644 --- a/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-pokemon-salesman-encounter.ts @@ -1,35 +1,35 @@ +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { NON_LEGEND_PARADOX_POKEMON, NON_LEGEND_ULTRA_BEASTS } from "#balance/special-species-groups"; +import { speciesStarterCosts } from "#balance/starters"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { AbilityId } from "#enums/ability-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import type { EnemyPokemon } from "#field/pokemon"; +import { PlayerPokemon } from "#field/pokemon"; +import { showEncounterDialogue } from "#mystery-encounters/encounter-dialogue-utils"; import { leaveEncounterWithoutBattle, transitionMysteryEncounterIntroVisuals, updatePlayerMoney, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { isNullOrUndefined, randSeedInt, randSeedItem } from "#app/utils/common"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; +} from "#mystery-encounters/encounter-phase-utils"; import { catchPokemon, getRandomSpeciesByStarterCost, getSpriteKeysFromPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { SpeciesId } from "#enums/species-id"; -import { PokeballType } from "#enums/pokeball"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { PlayerPokemon } from "#app/field/pokemon"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { showEncounterDialogue } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import PokemonData from "#app/system/pokemon-data"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { AbilityId } from "#enums/ability-id"; -import { NON_LEGEND_PARADOX_POKEMON, NON_LEGEND_ULTRA_BEASTS } from "#app/data/balance/special-species-groups"; -import { timedEventManager } from "#app/global-event-manager"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoneyRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { PokemonData } from "#system/pokemon-data"; +import { isNullOrUndefined, randSeedInt, randSeedItem } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounters/thePokemonSalesman"; diff --git a/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts b/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts index 37d16075543..568dc5de8b1 100644 --- a/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts @@ -1,34 +1,34 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - initBattleWithEnemyConfig, - loadCustomMovesForEncounter, - leaveEncounterWithoutBattle, - setEncounterRewards, - transitionMysteryEncounterIntroVisuals, - generateModifierType, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { SpeciesId } from "#enums/species-id"; -import { Nature } from "#enums/nature"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { modifyPlayerPokemonBST } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { MoveId } from "#enums/move-id"; +import { modifierTypes } from "#data/data-lists"; +import { CustomPokemonData } from "#data/pokemon-data"; import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import { Stat } from "#enums/stat"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { MoveId } from "#enums/move-id"; import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import type { Pokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { queueEncounterMessage, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; +import { + generateModifierType, + initBattleWithEnemyConfig, + leaveEncounterWithoutBattle, + loadCustomMovesForEncounter, + setEncounterRewards, + transitionMysteryEncounterIntroVisuals, +} from "#mystery-encounters/encounter-phase-utils"; +import { modifyPlayerPokemonBST } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/theStrongStuff"; @@ -54,7 +54,7 @@ export const TheStrongStuffEncounter: MysteryEncounter = MysteryEncounterBuilder .withFleeAllowed(false) .withIntroSpriteConfigs([ { - spriteKey: "berry_juice", + spriteKey: "berry_juice_good", fileRoot: "items", hasShadow: true, isItem: true, @@ -171,11 +171,11 @@ export const TheStrongStuffEncounter: MysteryEncounter = MysteryEncounterBuilder sortedParty.forEach((pokemon, index) => { if (index < 2) { // -15 to the two highest BST mons - modifyPlayerPokemonBST(pokemon, -HIGH_BST_REDUCTION_VALUE); + modifyPlayerPokemonBST(pokemon, false); encounter.setDialogueToken("highBstPokemon" + (index + 1), pokemon.getNameToRender()); } else { // +10 for the rest - modifyPlayerPokemonBST(pokemon, BST_INCREASE_VALUE); + modifyPlayerPokemonBST(pokemon, true); } }); diff --git a/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts b/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts index 6d28a710953..e17bf0575d7 100644 --- a/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts @@ -1,4 +1,24 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { SpeciesFormChangeAbilityTrigger } from "#data/form-change-triggers"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TrainerType } from "#enums/trainer-type"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { showEncounterDialogue, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, generateModifierTypeOption, @@ -6,31 +26,11 @@ import { leaveEncounterWithoutBattle, setEncounterRewards, transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { TrainerType } from "#enums/trainer-type"; -import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoveId } from "#enums/move-id"; -import { Nature } from "#enums/nature"; -import { PokemonType } from "#enums/pokemon-type"; -import { BerryType } from "#enums/berry-type"; -import { Stat } from "#enums/stat"; -import { SpeciesFormChangeAbilityTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { showEncounterDialogue, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +} from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { ModifierTier } from "#enums/modifier-tier"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { BattlerTagType } from "#enums/battler-tag-type"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/theWinstrateChallenge"; diff --git a/src/data/mystery-encounters/encounters/training-session-encounter.ts b/src/data/mystery-encounters/encounters/training-session-encounter.ts index 04e64083602..393f8a24e51 100644 --- a/src/data/mystery-encounters/encounters/training-session-encounter.ts +++ b/src/data/mystery-encounters/encounters/training-session-encounter.ts @@ -1,36 +1,36 @@ -import type { Ability } from "#app/data/abilities/ability"; -import { allAbilities } from "#app/data/data-lists"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import type { Ability } from "#abilities/ability"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { speciesStarterCosts } from "#balance/starters"; +import { allAbilities } from "#data/data-lists"; +import { getNatureName } from "#data/nature"; +import { AbilityAttr } from "#enums/ability-attr"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { getStatKey } from "#enums/stat"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; +import { queueEncounterMessage, showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { initBattleWithEnemyConfig, leaveEncounterWithoutBattle, selectPokemonForOption, setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { getNatureName } from "#app/data/nature"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { AbilityAttr } from "#enums/ability-attr"; -import PokemonData from "#app/system/pokemon-data"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import { isNullOrUndefined, randSeedShuffle } from "#app/utils/common"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import type HeldModifierConfig from "#app/@types/held-modifier-config"; +} from "#mystery-encounters/encounter-phase-utils"; +import { isPokemonValidForEncounterOptionSelection } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { PokemonData } from "#system/pokemon-data"; +import type { HeldModifierConfig } from "#types/held-modifier-config"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { isNullOrUndefined, randSeedShuffle } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; import i18next from "i18next"; -import { getStatKey } from "#enums/stat"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import type { Nature } from "#enums/nature"; /** The i18n namespace for the encounter */ const namespace = "mysteryEncounters/trainingSession"; @@ -184,10 +184,9 @@ export const TrainingSessionEncounter: MysteryEncounter = MysteryEncounterBuilde .withPreOptionPhase(async (): Promise => { // Open menu for selecting pokemon and Nature const encounter = globalScene.currentBattle.mysteryEncounter!; - const natures = new Array(25).fill(null).map((_val, i) => i as Nature); const onPokemonSelected = (pokemon: PlayerPokemon) => { // Return the options for nature selection - return natures.map((nature: Nature) => { + return getEnumValues(Nature).map((nature: Nature) => { const option: OptionSelectItem = { label: getNatureName(nature, true, true, true, globalScene.uiTheme), handler: () => { diff --git a/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts b/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts index e2a740c4900..452a9a8bb4b 100644 --- a/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts +++ b/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts @@ -1,4 +1,19 @@ -import type { EnemyPartyConfig, EnemyPokemonConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { HitHealModifier, PokemonHeldItemModifier, TurnHealModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig, EnemyPokemonConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, initBattleWithEnemyConfig, @@ -6,29 +21,14 @@ import { loadCustomMovesForEncounter, setEncounterRewards, transitionMysteryEncounterIntroVisuals, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { SpeciesId } from "#enums/species-id"; -import { HitHealModifier, PokemonHeldItemModifier, TurnHealModifier } from "#app/modifier/modifier"; -import { applyModifierTypeToPlayerPokemon } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import i18next from "#app/plugins/i18n"; -import { ModifierTier } from "#enums/modifier-tier"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoveId } from "#enums/move-id"; -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { randSeedInt } from "#app/utils/common"; -import { MoveUseMode } from "#enums/move-use-mode"; +} from "#mystery-encounters/encounter-phase-utils"; +import { applyModifierTypeToPlayerPokemon } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import i18next from "#plugins/i18n"; +import { randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounters/trashToTreasure"; diff --git a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts index 44e578540dd..c9e2ffedeec 100644 --- a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts +++ b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts @@ -1,42 +1,38 @@ -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; +import { globalScene } from "#app/global-scene"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import type { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokeballType } from "#enums/pokeball"; +import { Stat } from "#enums/stat"; +import type { EnemyPokemon, Pokemon } from "#field/pokemon"; +import { BerryModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import { queueEncounterMessage } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; import { getRandomEncounterSpecies, initBattleWithEnemyConfig, leaveEncounterWithoutBattle, setEncounterExp, setEncounterRewards, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { CHARMING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; -import type Pokemon from "#app/field/pokemon"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { - MoveRequirement, - PersistentModifierRequirement, -} from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +} from "#mystery-encounters/encounter-phase-utils"; import { catchPokemon, getHighestLevelPlayerPokemon, getSpriteKeysFromPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import PokemonData from "#app/system/pokemon-data"; -import { isNullOrUndefined, randSeedInt } from "#app/utils/common"; -import type { MoveId } from "#enums/move-id"; -import { BattlerIndex } from "#enums/battler-index"; -import { PokeballType } from "#enums/pokeball"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { BerryModifier } from "#app/modifier/modifier"; -import { Stat } from "#enums/stat"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; -import { MoveUseMode } from "#enums/move-use-mode"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import { MoveRequirement, PersistentModifierRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { CHARMING_MOVES } from "#mystery-encounters/requirement-groups"; +import { PokemonData } from "#system/pokemon-data"; +import { isNullOrUndefined, randSeedInt } from "#utils/common"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/uncommonBreed"; diff --git a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts index 1ba756c7f5d..1164d2ca7ca 100644 --- a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts +++ b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts @@ -1,49 +1,46 @@ -import { PokemonType } from "#enums/pokemon-type"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type { EnemyPartyConfig, EnemyPokemonConfig } from "../utils/encounter-phase-utils"; +import { allSpecies, modifierTypes } from "#data/data-lists"; +import { getLevelTotalExp } from "#data/exp"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { Challenges } from "#enums/challenges"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { PlayerGender } from "#enums/player-gender"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerType } from "#enums/trainer-type"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; +import { HiddenAbilityRateBoosterModifier, PokemonFormChangeItemModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { EnemyPartyConfig, EnemyPokemonConfig } from "#mystery-encounters/encounter-phase-utils"; import { generateModifierType, initBattleWithEnemyConfig, leaveEncounterWithoutBattle, setEncounterRewards, -} from "../utils/encounter-phase-utils"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { NumberHolder, isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils/common"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { allSpecies } from "#app/data/data-lists"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { HiddenAbilityRateBoosterModifier, PokemonFormChangeItemModifier } from "#app/modifier/modifier"; -import { achvs } from "#app/system/achv"; -import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import i18next from "#app/plugins/i18n"; +} from "#mystery-encounters/encounter-phase-utils"; import { doPokemonTransformationSequence, TransformationScreenPosition, -} from "#app/data/mystery-encounters/utils/encounter-transformation-sequence"; -import { getLevelTotalExp } from "#app/data/exp"; -import { Stat } from "#enums/stat"; -import { Challenges } from "#enums/challenges"; -import { ModifierTier } from "#enums/modifier-tier"; -import { PlayerGender } from "#enums/player-gender"; -import { TrainerType } from "#enums/trainer-type"; -import PokemonData from "#app/system/pokemon-data"; -import { Nature } from "#enums/nature"; -import type HeldModifierConfig from "#app/@types/held-modifier-config"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { PartyMemberStrength } from "#enums/party-member-strength"; +} from "#mystery-encounters/encounter-transformation-sequence"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; +import i18next from "#plugins/i18n"; +import { achvs } from "#system/achv"; +import { PokemonData } from "#system/pokemon-data"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { TrainerPartyTemplate } from "#trainers/trainer-party-template"; +import type { HeldModifierConfig } from "#types/held-modifier-config"; +import { isNullOrUndefined, NumberHolder, randSeedInt, randSeedShuffle } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** i18n namespace for encounter */ const namespace = "mysteryEncounters/weirdDream"; @@ -104,8 +101,6 @@ const EXCLUDED_TRANSFORMATION_SPECIES = [ const SUPER_LEGENDARY_BST_THRESHOLD = 600; const NON_LEGENDARY_BST_THRESHOLD = 570; -const OLD_GATEAU_STATS_UP = 20; - /** 0-100 */ const PERCENT_LEVEL_LOSS_ON_REFUSE = 10; @@ -275,12 +270,8 @@ export const WeirdDreamEncounter: MysteryEncounter = MysteryEncounterBuilder.wit } // Any pokemon that is below 570 BST gets +20 permanent BST to 3 stats if (shouldGetOldGateau(newPokemon)) { - const stats = getOldGateauBoostedStats(newPokemon); newPokemonHeldItemConfigs.push({ - modifier: generateModifierType(modifierTypes.MYSTERY_ENCOUNTER_OLD_GATEAU, [ - OLD_GATEAU_STATS_UP, - stats, - ]) as PokemonHeldItemModifierType, + modifier: generateModifierType(modifierTypes.MYSTERY_ENCOUNTER_OLD_GATEAU) as PokemonHeldItemModifierType, stackCount: 1, isTransferable: false, }); @@ -314,6 +305,7 @@ export const WeirdDreamEncounter: MysteryEncounter = MysteryEncounterBuilder.wit // One random pokemon will get its passive unlocked const passiveDisabledPokemon = globalScene.getPlayerParty().filter(p => !p.passive); if (passiveDisabledPokemon?.length > 0) { + // TODO: should this use `randSeedItem`? const enablePassiveMon = passiveDisabledPokemon[randSeedInt(passiveDisabledPokemon.length)]; enablePassiveMon.passive = true; enablePassiveMon.updateInfo(true); @@ -461,11 +453,7 @@ async function doNewTeamPostProcess(transformations: PokemonTransformation[]) { } // Any pokemon that is below 570 BST gets +20 permanent BST to 3 stats if (shouldGetOldGateau(newPokemon)) { - const stats = getOldGateauBoostedStats(newPokemon); - const modType = modifierTypes - .MYSTERY_ENCOUNTER_OLD_GATEAU() - .generateType(globalScene.getPlayerParty(), [OLD_GATEAU_STATS_UP, stats]) - ?.withIdFromFunc(modifierTypes.MYSTERY_ENCOUNTER_OLD_GATEAU); + const modType = modifierTypes.MYSTERY_ENCOUNTER_OLD_GATEAU(); const modifier = modType?.newModifier(newPokemon); if (modifier) { globalScene.addModifier(modifier, false, false, false, true); @@ -479,6 +467,7 @@ async function doNewTeamPostProcess(transformations: PokemonTransformation[]) { // One random pokemon will get its passive unlocked const passiveDisabledPokemon = globalScene.getPlayerParty().filter(p => !p.passive); if (passiveDisabledPokemon?.length > 0) { + // TODO: should this use `randSeedItem`? const enablePassiveMon = passiveDisabledPokemon[randSeedInt(passiveDisabledPokemon.length)]; enablePassiveMon.passive = true; await enablePassiveMon.updateInfo(true); @@ -616,22 +605,6 @@ function shouldGetOldGateau(pokemon: Pokemon): boolean { return pokemon.getSpeciesForm().getBaseStatTotal() < NON_LEGENDARY_BST_THRESHOLD; } -/** - * Get the lowest of HP/Spd, lowest of Atk/SpAtk, and lowest of Def/SpDef - * @returns Array of 3 {@linkcode Stat}s to boost - */ -function getOldGateauBoostedStats(pokemon: Pokemon): Stat[] { - const stats: Stat[] = []; - const baseStats = pokemon.getSpeciesForm().baseStats.slice(0); - // HP or Speed - stats.push(baseStats[Stat.HP] < baseStats[Stat.SPD] ? Stat.HP : Stat.SPD); - // Attack or SpAtk - stats.push(baseStats[Stat.ATK] < baseStats[Stat.SPATK] ? Stat.ATK : Stat.SPATK); - // Def or SpDef - stats.push(baseStats[Stat.DEF] < baseStats[Stat.SPDEF] ? Stat.DEF : Stat.SPDEF); - return stats; -} - function getTransformedSpecies( originalBst: number, bstSearchRange: [number, number], diff --git a/src/data/mystery-encounters/mystery-encounter-dialogue.ts b/src/data/mystery-encounters/mystery-encounter-dialogue.ts index 71e1b382f61..42383940755 100644 --- a/src/data/mystery-encounters/mystery-encounter-dialogue.ts +++ b/src/data/mystery-encounters/mystery-encounter-dialogue.ts @@ -1,4 +1,4 @@ -import type { TextStyle } from "#app/ui/text"; +import type { TextStyle } from "#ui/text"; export class TextDisplay { speaker?: string; @@ -67,7 +67,7 @@ export class EncounterOptionsDialogue { } * */ -export default class MysteryEncounterDialogue { +export class MysteryEncounterDialogue { intro?: TextDisplay[]; encounterOptionsDialogue?: EncounterOptionsDialogue; outro?: TextDisplay[]; diff --git a/src/data/mystery-encounters/mystery-encounter-option.ts b/src/data/mystery-encounters/mystery-encounter-option.ts index 53b53392bb8..504310eeabd 100644 --- a/src/data/mystery-encounters/mystery-encounter-option.ts +++ b/src/data/mystery-encounters/mystery-encounter-option.ts @@ -1,19 +1,18 @@ -import type { OptionTextDisplay } from "#app/data/mystery-encounters/mystery-encounter-dialogue"; -import type { MoveId } from "#enums/move-id"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; import { globalScene } from "#app/global-scene"; +import type { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import type { PokemonType } from "#enums/pokemon-type"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { CanLearnMoveRequirementOptions } from "#mystery-encounters/can-learn-move-requirement"; +import { CanLearnMoveRequirement } from "#mystery-encounters/can-learn-move-requirement"; +import type { OptionTextDisplay } from "#mystery-encounters/mystery-encounter-dialogue"; import { EncounterPokemonRequirement, EncounterSceneRequirement, MoneyRequirement, TypeRequirement, -} from "#app/data/mystery-encounters/mystery-encounter-requirements"; -import type { CanLearnMoveRequirementOptions } from "./requirements/can-learn-move-requirement"; -import { CanLearnMoveRequirement } from "./requirements/can-learn-move-requirement"; -import { isNullOrUndefined, randSeedInt } from "#app/utils/common"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +} from "#mystery-encounters/mystery-encounter-requirements"; +import { isNullOrUndefined, randSeedInt } from "#utils/common"; // biome-ignore lint/suspicious/noConfusingVoidType: void unions in callbacks are OK export type OptionPhaseCallback = () => Promise; @@ -39,7 +38,7 @@ export interface IMysteryEncounterOption { onPostOptionPhase?: OptionPhaseCallback; } -export default class MysteryEncounterOption implements IMysteryEncounterOption { +export class MysteryEncounterOption implements IMysteryEncounterOption { optionMode: MysteryEncounterOptionMode; hasDexProgress: boolean; requirements: EncounterSceneRequirement[]; @@ -145,11 +144,13 @@ export default class MysteryEncounterOption implements IMysteryEncounterOption { } if (truePrimaryPool.length > 0) { // always choose from the non-overlapping pokemon first + // TODO: should this use `randSeedItem`? this.primaryPokemon = truePrimaryPool[randSeedInt(truePrimaryPool.length)]; return true; } // if there are multiple overlapping pokemon, we're okay - just choose one and take it out of the supporting pokemon pool if (overlap.length > 1 || this.secondaryPokemon.length - overlap.length >= 1) { + // TODO: should this use `randSeedItem`? this.primaryPokemon = overlap[randSeedInt(overlap.length)]; this.secondaryPokemon = this.secondaryPokemon.filter(supp => supp !== this.primaryPokemon); return true; diff --git a/src/data/mystery-encounters/mystery-encounter-requirements.ts b/src/data/mystery-encounters/mystery-encounter-requirements.ts index 07fd155b2b2..d71964db4b8 100644 --- a/src/data/mystery-encounters/mystery-encounter-requirements.ts +++ b/src/data/mystery-encounters/mystery-encounter-requirements.ts @@ -1,21 +1,21 @@ import { globalScene } from "#app/global-scene"; -import { allAbilities } from "../data-lists"; -import { Nature } from "#enums/nature"; -import { pokemonFormChanges } from "#app/data/pokemon-forms"; -import { SpeciesFormChangeItemTrigger } from "../pokemon-forms/form-change-triggers"; -import { FormChangeItem } from "#enums/form-change-item"; -import { StatusEffect } from "#enums/status-effect"; -import { PokemonType } from "#enums/pokemon-type"; -import { WeatherType } from "#enums/weather-type"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { AttackTypeBoosterModifier } from "#app/modifier/modifier"; -import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type"; -import { coerceArray, isNullOrUndefined } from "#app/utils/common"; +import { allAbilities } from "#data/data-lists"; +import { SpeciesFormChangeItemTrigger } from "#data/form-change-triggers"; +import { pokemonFormChanges } from "#data/pokemon-forms"; import type { AbilityId } from "#enums/ability-id"; +import { FormChangeItem } from "#enums/form-change-item"; import { MoveId } from "#enums/move-id"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; import { TimeOfDay } from "#enums/time-of-day"; +import { WeatherType } from "#enums/weather-type"; +import type { PlayerPokemon } from "#field/pokemon"; +import { AttackTypeBoosterModifier } from "#modifiers/modifier"; +import type { AttackTypeBoosterModifierType } from "#modifiers/modifier-type"; +import { coerceArray, isNullOrUndefined } from "#utils/common"; export interface EncounterRequirement { meetsRequirement(): boolean; // Boolean to see if a requirement is met diff --git a/src/data/mystery-encounters/mystery-encounter-save-data.ts b/src/data/mystery-encounters/mystery-encounter-save-data.ts index 20c10c7c5b9..f04abccba5f 100644 --- a/src/data/mystery-encounters/mystery-encounter-save-data.ts +++ b/src/data/mystery-encounters/mystery-encounter-save-data.ts @@ -1,7 +1,7 @@ -import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT } from "#app/constants"; -import { isNullOrUndefined } from "#app/utils/common"; import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { isNullOrUndefined } from "#utils/common"; export class SeenEncounterData { type: MysteryEncounterType; diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index fa97a7f4d40..a2ca2b20ce7 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -1,18 +1,22 @@ -import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "../moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import { capitalizeFirstLetter, coerceArray, isNullOrUndefined } from "#app/utils/common"; +import { globalScene } from "#app/global-scene"; +import type { BattlerIndex } from "#enums/battler-index"; +import type { Challenges } from "#enums/challenges"; +import type { EncounterAnim } from "#enums/encounter-anims"; +import type { GameModes } from "#enums/game-modes"; +import type { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import type { MysteryEncounterSpriteConfig } from "#app/field/mystery-encounter-intro"; -import MysteryEncounterIntroVisuals from "#app/field/mystery-encounter-intro"; -import { randSeedInt } from "#app/utils/common"; import type { StatusEffect } from "#enums/status-effect"; -import type { OptionTextDisplay } from "./mystery-encounter-dialogue"; -import type MysteryEncounterDialogue from "./mystery-encounter-dialogue"; -import type { OptionPhaseCallback } from "./mystery-encounter-option"; -import type MysteryEncounterOption from "./mystery-encounter-option"; -import { MysteryEncounterOptionBuilder } from "./mystery-encounter-option"; +import type { MysteryEncounterSpriteConfig } from "#field/mystery-encounter-intro"; +import { MysteryEncounterIntroVisuals } from "#field/mystery-encounter-intro"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonMove } from "#moves/pokemon-move"; +import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounterDialogue, OptionTextDisplay } from "#mystery-encounters/mystery-encounter-dialogue"; +import type { MysteryEncounterOption, OptionPhaseCallback } from "#mystery-encounters/mystery-encounter-option"; +import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option"; import { EncounterPokemonRequirement, EncounterSceneRequirement, @@ -20,16 +24,8 @@ import { PartySizeRequirement, StatusEffectRequirement, WaveRangeRequirement, -} from "./mystery-encounter-requirements"; -import type { BattlerIndex } from "#enums/battler-index"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import type { GameModes } from "#enums/game-modes"; -import type { EncounterAnim } from "#enums/encounter-anims"; -import type { Challenges } from "#enums/challenges"; -import { globalScene } from "#app/global-scene"; -import type { MoveUseMode } from "#enums/move-use-mode"; +} from "#mystery-encounters/mystery-encounter-requirements"; +import { capitalizeFirstLetter, coerceArray, isNullOrUndefined, randSeedInt } from "#utils/common"; export interface EncounterStartOfBattleEffect { sourcePokemon?: Pokemon; @@ -91,7 +87,7 @@ export interface IMysteryEncounter { * These objects will be saved as part of session data any time the player is on a floor with an encounter * Unless you know what you're doing, you should use MysteryEncounterBuilder to create an instance for this class */ -export default class MysteryEncounter implements IMysteryEncounter { +export class MysteryEncounter implements IMysteryEncounter { // #region Required params encounterType: MysteryEncounterType; @@ -385,6 +381,7 @@ export default class MysteryEncounter implements IMysteryEncounter { // If there are multiple overlapping pokemon, we're okay - just choose one and take it out of the primary pokemon pool if (overlap.length > 1 || this.secondaryPokemon.length - overlap.length >= 1) { // is this working? + // TODO: should this use `randSeedItem`? this.primaryPokemon = overlap[randSeedInt(overlap.length, 0)]; this.secondaryPokemon = this.secondaryPokemon.filter(supp => supp !== this.primaryPokemon); return true; @@ -395,6 +392,7 @@ export default class MysteryEncounter implements IMysteryEncounter { return false; } // this means we CAN have the same pokemon be a primary and secondary pokemon, so just choose any qualifying one randomly. + // TODO: should this use `randSeedItem`? this.primaryPokemon = qualified[randSeedInt(qualified.length, 0)]; return true; } diff --git a/src/data/mystery-encounters/mystery-encounters.ts b/src/data/mystery-encounters/mystery-encounters.ts index 5ee289a6c56..34eac5cab94 100644 --- a/src/data/mystery-encounters/mystery-encounters.ts +++ b/src/data/mystery-encounters/mystery-encounters.ts @@ -1,38 +1,38 @@ +import { getBiomeName } from "#balance/biomes"; import { BiomeId } from "#enums/biome-id"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { DarkDealEncounter } from "./encounters/dark-deal-encounter"; -import { DepartmentStoreSaleEncounter } from "./encounters/department-store-sale-encounter"; -import { FieldTripEncounter } from "./encounters/field-trip-encounter"; -import { FightOrFlightEncounter } from "./encounters/fight-or-flight-encounter"; -import { LostAtSeaEncounter } from "./encounters/lost-at-sea-encounter"; -import { MysteriousChallengersEncounter } from "./encounters/mysterious-challengers-encounter"; -import { MysteriousChestEncounter } from "./encounters/mysterious-chest-encounter"; -import { ShadyVitaminDealerEncounter } from "./encounters/shady-vitamin-dealer-encounter"; -import { SlumberingSnorlaxEncounter } from "./encounters/slumbering-snorlax-encounter"; -import { TrainingSessionEncounter } from "./encounters/training-session-encounter"; -import type MysteryEncounter from "./mystery-encounter"; -import { SafariZoneEncounter } from "#app/data/mystery-encounters/encounters/safari-zone-encounter"; -import { FieryFalloutEncounter } from "#app/data/mystery-encounters/encounters/fiery-fallout-encounter"; -import { TheStrongStuffEncounter } from "#app/data/mystery-encounters/encounters/the-strong-stuff-encounter"; -import { ThePokemonSalesmanEncounter } from "#app/data/mystery-encounters/encounters/the-pokemon-salesman-encounter"; -import { AnOfferYouCantRefuseEncounter } from "#app/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter"; -import { DelibirdyEncounter } from "#app/data/mystery-encounters/encounters/delibirdy-encounter"; -import { AbsoluteAvariceEncounter } from "#app/data/mystery-encounters/encounters/absolute-avarice-encounter"; -import { ATrainersTestEncounter } from "#app/data/mystery-encounters/encounters/a-trainers-test-encounter"; -import { TrashToTreasureEncounter } from "#app/data/mystery-encounters/encounters/trash-to-treasure-encounter"; -import { BerriesAboundEncounter } from "#app/data/mystery-encounters/encounters/berries-abound-encounter"; -import { ClowningAroundEncounter } from "#app/data/mystery-encounters/encounters/clowning-around-encounter"; -import { PartTimerEncounter } from "#app/data/mystery-encounters/encounters/part-timer-encounter"; -import { DancingLessonsEncounter } from "#app/data/mystery-encounters/encounters/dancing-lessons-encounter"; -import { WeirdDreamEncounter } from "#app/data/mystery-encounters/encounters/weird-dream-encounter"; -import { TheWinstrateChallengeEncounter } from "#app/data/mystery-encounters/encounters/the-winstrate-challenge-encounter"; -import { TeleportingHijinksEncounter } from "#app/data/mystery-encounters/encounters/teleporting-hijinks-encounter"; -import { BugTypeSuperfanEncounter } from "#app/data/mystery-encounters/encounters/bug-type-superfan-encounter"; -import { FunAndGamesEncounter } from "#app/data/mystery-encounters/encounters/fun-and-games-encounter"; -import { UncommonBreedEncounter } from "#app/data/mystery-encounters/encounters/uncommon-breed-encounter"; -import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encounters/global-trade-system-encounter"; -import { TheExpertPokemonBreederEncounter } from "#app/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter"; -import { getBiomeName } from "#app/data/balance/biomes"; +import { ATrainersTestEncounter } from "#mystery-encounters/a-trainers-test-encounter"; +import { AbsoluteAvariceEncounter } from "#mystery-encounters/absolute-avarice-encounter"; +import { AnOfferYouCantRefuseEncounter } from "#mystery-encounters/an-offer-you-cant-refuse-encounter"; +import { BerriesAboundEncounter } from "#mystery-encounters/berries-abound-encounter"; +import { BugTypeSuperfanEncounter } from "#mystery-encounters/bug-type-superfan-encounter"; +import { ClowningAroundEncounter } from "#mystery-encounters/clowning-around-encounter"; +import { DancingLessonsEncounter } from "#mystery-encounters/dancing-lessons-encounter"; +import { DarkDealEncounter } from "#mystery-encounters/dark-deal-encounter"; +import { DelibirdyEncounter } from "#mystery-encounters/delibirdy-encounter"; +import { DepartmentStoreSaleEncounter } from "#mystery-encounters/department-store-sale-encounter"; +import { FieldTripEncounter } from "#mystery-encounters/field-trip-encounter"; +import { FieryFalloutEncounter } from "#mystery-encounters/fiery-fallout-encounter"; +import { FightOrFlightEncounter } from "#mystery-encounters/fight-or-flight-encounter"; +import { FunAndGamesEncounter } from "#mystery-encounters/fun-and-games-encounter"; +import { GlobalTradeSystemEncounter } from "#mystery-encounters/global-trade-system-encounter"; +import { LostAtSeaEncounter } from "#mystery-encounters/lost-at-sea-encounter"; +import { MysteriousChallengersEncounter } from "#mystery-encounters/mysterious-challengers-encounter"; +import { MysteriousChestEncounter } from "#mystery-encounters/mysterious-chest-encounter"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { PartTimerEncounter } from "#mystery-encounters/part-timer-encounter"; +import { SafariZoneEncounter } from "#mystery-encounters/safari-zone-encounter"; +import { ShadyVitaminDealerEncounter } from "#mystery-encounters/shady-vitamin-dealer-encounter"; +import { SlumberingSnorlaxEncounter } from "#mystery-encounters/slumbering-snorlax-encounter"; +import { TeleportingHijinksEncounter } from "#mystery-encounters/teleporting-hijinks-encounter"; +import { TheExpertPokemonBreederEncounter } from "#mystery-encounters/the-expert-pokemon-breeder-encounter"; +import { ThePokemonSalesmanEncounter } from "#mystery-encounters/the-pokemon-salesman-encounter"; +import { TheStrongStuffEncounter } from "#mystery-encounters/the-strong-stuff-encounter"; +import { TheWinstrateChallengeEncounter } from "#mystery-encounters/the-winstrate-challenge-encounter"; +import { TrainingSessionEncounter } from "#mystery-encounters/training-session-encounter"; +import { TrashToTreasureEncounter } from "#mystery-encounters/trash-to-treasure-encounter"; +import { UncommonBreedEncounter } from "#mystery-encounters/uncommon-breed-encounter"; +import { WeirdDreamEncounter } from "#mystery-encounters/weird-dream-encounter"; export const EXTREME_ENCOUNTER_BIOMES = [ BiomeId.SEA, diff --git a/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts b/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts index 0123ea7d6ba..26602b8ae31 100644 --- a/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts +++ b/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts @@ -1,9 +1,9 @@ -import type { MoveId } from "#enums/move-id"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { coerceArray, isNullOrUndefined } from "#app/utils/common"; -import { EncounterPokemonRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; import { globalScene } from "#app/global-scene"; +import type { MoveId } from "#enums/move-id"; +import type { PlayerPokemon } from "#field/pokemon"; +import { PokemonMove } from "#moves/pokemon-move"; +import { EncounterPokemonRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import { coerceArray, isNullOrUndefined } from "#utils/common"; /** * {@linkcode CanLearnMoveRequirement} options diff --git a/src/data/mystery-encounters/requirements/requirement-groups.ts b/src/data/mystery-encounters/requirements/requirement-groups.ts index 0140a5fe320..8981dfe173c 100644 --- a/src/data/mystery-encounters/requirements/requirement-groups.ts +++ b/src/data/mystery-encounters/requirements/requirement-groups.ts @@ -1,5 +1,5 @@ -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; /** * Moves that "steal" things diff --git a/src/data/mystery-encounters/utils/encounter-dialogue-utils.ts b/src/data/mystery-encounters/utils/encounter-dialogue-utils.ts index e1055f57496..4f4af94a88d 100644 --- a/src/data/mystery-encounters/utils/encounter-dialogue-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-dialogue-utils.ts @@ -1,8 +1,8 @@ import { globalScene } from "#app/global-scene"; -import type { TextStyle } from "#app/ui/text"; -import { getTextWithColors } from "#app/ui/text"; import { UiTheme } from "#enums/ui-theme"; -import { isNullOrUndefined } from "#app/utils/common"; +import type { TextStyle } from "#ui/text"; +import { getTextWithColors } from "#ui/text"; +import { isNullOrUndefined } from "#utils/common"; import i18next from "i18next"; /** diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index f698f636cac..6b085978b27 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -1,58 +1,57 @@ -import type Battle from "#app/battle"; -import { BattleType } from "#enums/battle-type"; -import { biomeLinks, BiomePoolTier } from "#app/data/balance/biomes"; -import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option"; +import type { Battle } from "#app/battle"; import { AVERAGE_ENCOUNTERS_PER_RUN_TARGET, WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/constants"; -import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; +import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { BiomePoolTier, biomeLinks } from "#balance/biomes"; +import { initMoveAnim, loadMoveAnimAssets } from "#data/battle-anims"; +import { modifierTypes } from "#data/data-lists"; +import type { IEggOptions } from "#data/egg"; +import { Egg } from "#data/egg"; +import type { Gender } from "#data/gender"; +import { getNatureName } from "#data/nature"; +import type { CustomPokemonData } from "#data/pokemon-data"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { Status } from "#data/status-effect"; import type { AiType } from "#enums/ai-type"; -import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { BattleType } from "#enums/battle-type"; +import type { BattlerTagType } from "#enums/battler-tag-type"; +import { BiomeId } from "#enums/biome-id"; import { FieldPosition } from "#enums/field-position"; -import type { CustomModifierSettings, ModifierType } from "#app/modifier/modifier-type"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import type { MoveId } from "#enums/move-id"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import type { Nature } from "#enums/nature"; +import { PokemonType } from "#enums/pokemon-type"; +import { StatusEffect } from "#enums/status-effect"; +import { TrainerSlot } from "#enums/trainer-slot"; +import type { TrainerType } from "#enums/trainer-type"; +import { TrainerVariant } from "#enums/trainer-variant"; +import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { EnemyPokemon } from "#field/pokemon"; +import { Trainer } from "#field/trainer"; +import type { CustomModifierSettings, ModifierType } from "#modifiers/modifier-type"; import { getPartyLuckValue, ModifierTypeGenerator, ModifierTypeOption, regenerateModifierPoolThresholds, -} from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import type PokemonData from "#app/system/pokemon-data"; -import type { OptionSelectConfig, OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import type { PartyOption, PokemonSelectFilter } from "#app/ui/party-ui-handler"; -import { PartyUiMode } from "#app/ui/party-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { isNullOrUndefined, randSeedInt, randomString, randSeedItem, coerceArray } from "#app/utils/common"; -import type { BattlerTagType } from "#enums/battler-tag-type"; -import { BiomeId } from "#enums/biome-id"; -import type { TrainerType } from "#enums/trainer-type"; +} from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { showEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { MysteryEncounterOption } from "#mystery-encounters/mystery-encounter-option"; +import type { Variant } from "#sprites/variant"; +import type { PokemonData } from "#system/pokemon-data"; +import type { TrainerConfig } from "#trainers/trainer-config"; +import { trainerConfigs } from "#trainers/trainer-config"; +import type { HeldModifierConfig } from "#types/held-modifier-config"; +import type { OptionSelectConfig, OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import type { PartyOption, PokemonSelectFilter } from "#ui/party-ui-handler"; +import { PartyUiMode } from "#ui/party-ui-handler"; +import { coerceArray, isNullOrUndefined, randomString, randSeedInt, randSeedItem } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import Trainer from "#app/field/trainer"; -import { TrainerVariant } from "#enums/trainer-variant"; -import type { Gender } from "#app/data/gender"; -import type { Nature } from "#enums/nature"; -import type { MoveId } from "#enums/move-id"; -import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import { Status } from "#app/data/status-effect"; -import type { TrainerConfig } from "#app/data/trainers/trainer-config"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { TrainerSlot } from "#enums/trainer-slot"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import type { IEggOptions } from "#app/data/egg"; -import { Egg } from "#app/data/egg"; -import type { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import type HeldModifierConfig from "#app/@types/held-modifier-config"; -import type { Variant } from "#app/sprites/variant"; -import { StatusEffect } from "#enums/status-effect"; -import { globalScene } from "#app/global-scene"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { PokemonType } from "#enums/pokemon-type"; -import { getNatureName } from "#app/data/nature"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { timedEventManager } from "#app/global-event-manager"; /** * Animates exclamation sprite over trainer's head at start of encounter @@ -1099,8 +1098,10 @@ export function calculateMEAggregateStats(baseSpawnWeight: number) { if (biomes! && biomes.length > 0) { const specialBiomes = biomes.filter(b => alwaysPickTheseBiomes.includes(b)); if (specialBiomes.length > 0) { + // TODO: should this use `randSeedItem`? currentBiome = specialBiomes[randSeedInt(specialBiomes.length)]; } else { + // TODO: should this use `randSeedItem`? currentBiome = biomes[randSeedInt(biomes.length)]; } } diff --git a/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts b/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts index f6ac5b0d38b..e4211baa78a 100644 --- a/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts @@ -1,42 +1,41 @@ import { globalScene } from "#app/global-scene"; -import i18next from "i18next"; -import { isNullOrUndefined, randSeedInt } from "#app/utils/common"; -import { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { speciesStarterCosts } from "#balance/starters"; +import { modifierTypes } from "#data/data-lists"; +import { Gender } from "#data/gender"; import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, -} from "#app/data/pokeball"; +} from "#data/pokeball"; +import { CustomPokemonData } from "#data/pokemon-data"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { getStatusEffectCatchRateMultiplier } from "#data/status-effect"; +import type { AbilityId } from "#enums/ability-id"; import { PlayerGender } from "#enums/player-gender"; -import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims"; -import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; -import { achvs } from "#app/system/achv"; -import { UiMode } from "#enums/ui-mode"; -import type { PartyOption } from "#app/ui/party-ui-handler"; -import { PartyUiMode } from "#app/ui/party-ui-handler"; -import { SpeciesId } from "#enums/species-id"; +import type { PokeballType } from "#enums/pokeball"; import type { PokemonType } from "#enums/pokemon-type"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; +import { SpeciesId } from "#enums/species-id"; +import type { PermanentStat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { UiMode } from "#enums/ui-mode"; +import { addPokeballCaptureStars, addPokeballOpenParticles } from "#field/anims"; +import type { EnemyPokemon, PlayerPokemon, Pokemon } from "#field/pokemon"; +import { PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; import { getEncounterText, queueEncounterMessage, showEncounterText, -} from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { getPokemonNameWithAffix } from "#app/messages"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { Gender } from "#app/data/gender"; -import type { PermanentStat } from "#enums/stat"; -import { SummaryUiMode } from "#app/ui/summary-ui-handler"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import type { AbilityId } from "#enums/ability-id"; -import type { PokeballType } from "#enums/pokeball"; -import { StatusEffect } from "#enums/status-effect"; +} from "#mystery-encounters/encounter-dialogue-utils"; +import { achvs } from "#system/achv"; +import type { PartyOption } from "#ui/party-ui-handler"; +import { PartyUiMode } from "#ui/party-ui-handler"; +import { SummaryUiMode } from "#ui/summary-ui-handler"; +import { isNullOrUndefined, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; /** Will give +1 level every 10 waves */ export const STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER = 1; @@ -111,20 +110,24 @@ export function getRandomPlayerPokemon( // If there is only 1 legal/unfainted mon left, select from fainted legal mons const faintedLegalMons = party.filter(p => (!isAllowed || p.isAllowedInChallenge()) && p.isFainted()); if (faintedLegalMons.length > 0) { + // TODO: should this use `randSeedItem`? chosenIndex = randSeedInt(faintedLegalMons.length); chosenPokemon = faintedLegalMons[chosenIndex]; } } if (!chosenPokemon && fullyLegalMons.length > 0) { + // TODO: should this use `randSeedItem`? chosenIndex = randSeedInt(fullyLegalMons.length); chosenPokemon = fullyLegalMons[chosenIndex]; } if (!chosenPokemon && isAllowed && allowedOnlyMons.length > 0) { + // TODO: should this use `randSeedItem`? chosenIndex = randSeedInt(allowedOnlyMons.length); chosenPokemon = allowedOnlyMons[chosenIndex]; } if (!chosenPokemon) { // If no other options worked, returns fully random + // TODO: should this use `randSeedItem`? chosenIndex = randSeedInt(party.length); chosenPokemon = party[chosenIndex]; } @@ -375,10 +378,10 @@ export function applyHealToPokemon(pokemon: PlayerPokemon, heal: number) { * @param pokemon * @param value */ -export async function modifyPlayerPokemonBST(pokemon: PlayerPokemon, value: number) { +export async function modifyPlayerPokemonBST(pokemon: PlayerPokemon, good: boolean) { const modType = modifierTypes .MYSTERY_ENCOUNTER_SHUCKLE_JUICE() - .generateType(globalScene.getPlayerParty(), [value]) + .generateType(globalScene.getPlayerParty(), [good ? 10 : -15]) ?.withIdFromFunc(modifierTypes.MYSTERY_ENCOUNTER_SHUCKLE_JUICE); const modifier = modType?.newModifier(pokemon); if (modifier) { @@ -518,7 +521,7 @@ export function trainerThrowPokeball( repeatDelay: 500, onUpdate: t => { if (shakeCount && shakeCount < 4) { - const value = t.getValue(); + const value = t.getValue() ?? 0; const directionMultiplier = shakeCount % 2 === 1 ? 1 : -1; pokeball.setX(pbX + value * 4 * directionMultiplier); pokeball.setAngle(value * 27.5 * directionMultiplier); diff --git a/src/data/mystery-encounters/utils/encounter-transformation-sequence.ts b/src/data/mystery-encounters/utils/encounter-transformation-sequence.ts index ebef47eac2d..718d97c0875 100644 --- a/src/data/mystery-encounters/utils/encounter-transformation-sequence.ts +++ b/src/data/mystery-encounters/utils/encounter-transformation-sequence.ts @@ -1,8 +1,8 @@ -import type { PlayerPokemon } from "#app/field/pokemon"; -import { getFrameMs } from "#app/utils/common"; -import { cos, sin } from "#app/field/anims"; -import { getTypeRgb } from "#app/data/type"; import { globalScene } from "#app/global-scene"; +import { getTypeRgb } from "#data/type"; +import { cos, sin } from "#field/anims"; +import type { PlayerPokemon } from "#field/pokemon"; +import { getFrameMs } from "#utils/common"; export enum TransformationScreenPosition { CENTER, @@ -127,7 +127,7 @@ export function doPokemonTransformationSequence( to: 1, duration: 1000, onUpdate: t => { - pokemonTintSprite.setAlpha(t.getValue()); + pokemonTintSprite.setAlpha(t.getValue() ?? 1); }, onComplete: () => { pokemonSprite.setVisible(false); diff --git a/src/data/nature.ts b/src/data/nature.ts index 83b3ee7538d..4f4e627daf3 100644 --- a/src/data/nature.ts +++ b/src/data/nature.ts @@ -1,9 +1,9 @@ -import { toReadableString } from "#app/utils/common"; -import { TextStyle, getBBCodeFrag } from "../ui/text"; import { Nature } from "#enums/nature"; +import { EFFECTIVE_STATS, getShortenedStatKey, Stat } from "#enums/stat"; import { UiTheme } from "#enums/ui-theme"; +import { getBBCodeFrag, TextStyle } from "#ui/text"; +import { toReadableString } from "#utils/common"; import i18next from "i18next"; -import { Stat, EFFECTIVE_STATS, getShortenedStatKey } from "#enums/stat"; export function getNatureName( nature: Nature, diff --git a/src/data/phase-priority-queue.ts b/src/data/phase-priority-queue.ts index b815a6ac34f..88361b0f4fa 100644 --- a/src/data/phase-priority-queue.ts +++ b/src/data/phase-priority-queue.ts @@ -1,12 +1,12 @@ import { globalScene } from "#app/global-scene"; import type { Phase } from "#app/phase"; -import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-phase"; -import type { PostSummonPhase } from "#app/phases/post-summon-phase"; -import { PostSummonActivateAbilityPhase } from "#app/phases/post-summon-activate-ability-phase"; -import { Stat } from "#enums/stat"; -import { BooleanHolder } from "#app/utils/common"; -import { TrickRoomTag } from "#app/data/arena-tag"; +import { TrickRoomTag } from "#data/arena-tag"; import { DynamicPhaseType } from "#enums/dynamic-phase-type"; +import { Stat } from "#enums/stat"; +import { ActivatePriorityQueuePhase } from "#phases/activate-priority-queue-phase"; +import { PostSummonActivateAbilityPhase } from "#phases/post-summon-activate-ability-phase"; +import type { PostSummonPhase } from "#phases/post-summon-phase"; +import { BooleanHolder } from "#utils/common"; /** * Stores a list of {@linkcode Phase}s diff --git a/src/data/pokeball.ts b/src/data/pokeball.ts index a479fd8068a..50ea5076aee 100644 --- a/src/data/pokeball.ts +++ b/src/data/pokeball.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import { NumberHolder } from "#app/utils/common"; import { PokeballType } from "#enums/pokeball"; +import { NumberHolder } from "#utils/common"; import i18next from "i18next"; export const MAX_PER_TYPE_POKEBALLS: number = 99; diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index ea129454034..6d1db296e55 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,14 +1,5 @@ -import type Pokemon from "../field/pokemon"; -import { allMoves } from "./data-lists"; -import { MoveCategory } from "#enums/MoveCategory"; -import type { Constructor, nil } from "#app/utils/common"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { WeatherType } from "#enums/weather-type"; -import { SpeciesFormKey } from "#enums/species-form-key"; import { globalScene } from "#app/global-scene"; -import { FormChangeItem } from "#enums/form-change-item"; +import { allMoves } from "#data/data-lists"; import { MeloettaFormChangePostMoveTrigger, SpeciesDefaultFormMatchTrigger, @@ -24,7 +15,16 @@ import { SpeciesFormChangeTeraTrigger, type SpeciesFormChangeTrigger, SpeciesFormChangeWeatherTrigger, -} from "./pokemon-forms/form-change-triggers"; +} from "#data/form-change-triggers"; +import { AbilityId } from "#enums/ability-id"; +import { FormChangeItem } from "#enums/form-change-item"; +import { MoveCategory } from "#enums/MoveCategory"; +import { MoveId } from "#enums/move-id"; +import { SpeciesFormKey } from "#enums/species-form-key"; +import { SpeciesId } from "#enums/species-id"; +import { WeatherType } from "#enums/weather-type"; +import type { Pokemon } from "#field/pokemon"; +import type { Constructor, nil } from "#utils/common"; export type SpeciesFormChangeConditionPredicate = (p: Pokemon) => boolean; export type SpeciesFormChangeConditionEnforceFunc = (p: Pokemon) => void; diff --git a/src/data/pokemon-forms/form-change-triggers.ts b/src/data/pokemon-forms/form-change-triggers.ts index 3726781d9e3..75734bf085b 100644 --- a/src/data/pokemon-forms/form-change-triggers.ts +++ b/src/data/pokemon-forms/form-change-triggers.ts @@ -1,18 +1,18 @@ -import i18next from "i18next"; -import { coerceArray, type Constructor } from "#app/utils/common"; -import type { TimeOfDay } from "#enums/time-of-day"; -import type Pokemon from "#app/field/pokemon"; -import type { SpeciesFormChange } from "#app/data/pokemon-forms"; -import type { PokemonFormChangeItemModifier } from "#app/modifier/modifier"; -import { getPokemonNameWithAffix } from "#app/messages"; import { globalScene } from "#app/global-scene"; -import { FormChangeItem } from "#enums/form-change-item"; +import { getPokemonNameWithAffix } from "#app/messages"; +import type { SpeciesFormChange } from "#data/pokemon-forms"; import { AbilityId } from "#enums/ability-id"; import { Challenges } from "#enums/challenges"; +import { FormChangeItem } from "#enums/form-change-item"; import { MoveId } from "#enums/move-id"; import { SpeciesFormKey } from "#enums/species-form-key"; import { StatusEffect } from "#enums/status-effect"; +import type { TimeOfDay } from "#enums/time-of-day"; import { WeatherType } from "#enums/weather-type"; +import type { Pokemon } from "#field/pokemon"; +import type { PokemonFormChangeItemModifier } from "#modifiers/modifier"; +import { type Constructor, coerceArray } from "#utils/common"; +import i18next from "i18next"; export abstract class SpeciesFormChangeTrigger { public description = ""; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index d2a48495195..140b03e6d4c 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1,49 +1,45 @@ -import type { Localizable } from "#app/@types/locales"; -import { AbilityId } from "#enums/ability-id"; -import { PartyMemberStrength } from "#enums/party-member-strength"; -import { SpeciesId } from "#enums/species-id"; -import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities"; -import i18next from "i18next"; import type { AnySound } from "#app/battle-scene"; -import { globalScene } from "#app/global-scene"; import type { GameMode } from "#app/game-mode"; -import type { StarterMoveset } from "#app/system/game-data"; -import { DexAttr } from "#enums/dex-attr"; -import { - isNullOrUndefined, - capitalizeString, - randSeedInt, - randSeedGauss, - randSeedItem, - randSeedFloat, -} from "#app/utils/common"; -import { uncatchableSpecies } from "#app/data/balance/biomes"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { GrowthRate } from "#app/data/exp"; -import type { EvolutionLevel } from "#app/data/balance/pokemon-evolutions"; -import { - SpeciesWildEvolutionDelay, - pokemonEvolutions, - pokemonPrevolutions, -} from "#app/data/balance/pokemon-evolutions"; -import { PokemonType } from "#enums/pokemon-type"; -import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; +import { globalScene } from "#app/global-scene"; +import { uncatchableSpecies } from "#balance/biomes"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { starterPassiveAbilities } from "#balance/passives"; +import type { EvolutionLevel } from "#balance/pokemon-evolutions"; +import { pokemonEvolutions, pokemonPrevolutions, SpeciesWildEvolutionDelay } from "#balance/pokemon-evolutions"; +import type { LevelMoves } from "#balance/pokemon-level-moves"; import { pokemonFormLevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves, -} from "#app/data/balance/pokemon-level-moves"; -import type { Stat } from "#enums/stat"; -import type { Variant, VariantSet } from "#app/sprites/variant"; -import { populateVariantColorCache, variantColorCache, variantData } from "#app/sprites/variant"; -import { speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters"; +} from "#balance/pokemon-level-moves"; +import { POKERUS_STARTER_COUNT, speciesStarterCosts } from "#balance/starters"; +import { allSpecies } from "#data/data-lists"; +import { GrowthRate } from "#data/exp"; +import { Gender } from "#data/gender"; +import { AbilityId } from "#enums/ability-id"; +import { DexAttr } from "#enums/dex-attr"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesFormKey } from "#enums/species-form-key"; -import { starterPassiveAbilities } from "#app/data/balance/passives"; -import { loadPokemonVariantAssets } from "#app/sprites/pokemon-sprite"; -import { hasExpSprite } from "#app/sprites/sprite-utils"; -import { Gender } from "./gender"; -import { allSpecies } from "#app/data/data-lists"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; +import { SpeciesId } from "#enums/species-id"; +import type { Stat } from "#enums/stat"; +import { loadPokemonVariantAssets } from "#sprites/pokemon-sprite"; +import { hasExpSprite } from "#sprites/sprite-utils"; +import type { Variant, VariantSet } from "#sprites/variant"; +import { populateVariantColorCache, variantColorCache, variantData } from "#sprites/variant"; +import type { StarterMoveset } from "#system/game-data"; +import type { Localizable } from "#types/locales"; +import { + capitalizeString, + isNullOrUndefined, + randSeedFloat, + randSeedGauss, + randSeedInt, + randSeedItem, +} from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { argbFromRgba, QuantizerCelebi, rgbaFromArgb } from "@material/material-color-utilities"; +import i18next from "i18next"; export enum Region { NORMAL, @@ -759,7 +755,7 @@ export abstract class PokemonSpeciesForm { } } -export default class PokemonSpecies extends PokemonSpeciesForm implements Localizable { +export class PokemonSpecies extends PokemonSpeciesForm implements Localizable { public name: string; readonly subLegendary: boolean; readonly legendary: boolean; diff --git a/src/data/pokemon/pokemon-data.ts b/src/data/pokemon/pokemon-data.ts new file mode 100644 index 00000000000..6ae86bed5e7 --- /dev/null +++ b/src/data/pokemon/pokemon-data.ts @@ -0,0 +1,208 @@ +import { type BattlerTag, loadBattlerTag } from "#data/battler-tags"; +import type { Gender } from "#data/gender"; +import { PokemonMove } from "#data/moves/pokemon-move"; +import type { PokemonSpeciesForm } from "#data/pokemon-species"; +import type { TypeDamageMultiplier } from "#data/type"; +import type { AbilityId } from "#enums/ability-id"; +import type { BerryType } from "#enums/berry-type"; +import type { MoveId } from "#enums/move-id"; +import type { Nature } from "#enums/nature"; +import type { PokemonType } from "#enums/pokemon-type"; +import type { AttackMoveResult } from "#types/attack-move-result"; +import type { IllusionData } from "#types/illusion-data"; +import type { TurnMove } from "#types/turn-move"; +import { isNullOrUndefined } from "#utils/common"; + +/** + * Permanent data that can customize a Pokemon in non-standard ways from its Species. + * Includes abilities, nature, changed types, etc. + */ +export class CustomPokemonData { + // TODO: Change the default value for all these from -1 to something a bit more sensible + /** + * The scale at which to render this Pokemon's sprite. + */ + public spriteScale = -1; + public ability: AbilityId | -1; + public passive: AbilityId | -1; + public nature: Nature | -1; + public types: PokemonType[]; + /** Deprecated but needed for session save migration */ + // TODO: Remove this once pre-session migration is implemented + public hitsRecCount: number | null = null; + + constructor(data?: CustomPokemonData | Partial) { + this.spriteScale = data?.spriteScale ?? -1; + this.ability = data?.ability ?? -1; + this.passive = data?.passive ?? -1; + this.nature = data?.nature ?? -1; + this.types = data?.types ?? []; + this.hitsRecCount = data?.hitsRecCount ?? null; + } +} + +/** + * Persistent in-battle data for a {@linkcode Pokemon}. + * Resets on switch or new battle. + */ +export class PokemonSummonData { + /** [Atk, Def, SpAtk, SpDef, Spd, Acc, Eva] */ + public statStages: number[] = [0, 0, 0, 0, 0, 0, 0]; + /** + * A queue of moves yet to be executed, used by charging, recharging and frenzy moves. + * So long as this array is nonempty, this Pokemon's corresponding `CommandPhase` will be skipped over entirely + * in favor of using the queued move. + * TODO: Clean up a lot of the code surrounding the move queue. + */ + public moveQueue: TurnMove[] = []; + public tags: BattlerTag[] = []; + public abilitySuppressed = false; + + // Overrides for transform. + // TODO: Move these into a separate class & add rage fist hit count + public speciesForm: PokemonSpeciesForm | null = null; + public fusionSpeciesForm: PokemonSpeciesForm | null = null; + public ability: AbilityId | undefined; + public passiveAbility: AbilityId | undefined; + public gender: Gender | undefined; + public fusionGender: Gender | undefined; + public stats: number[] = [0, 0, 0, 0, 0, 0]; + public moveset: PokemonMove[] | null; + + // If not initialized this value will not be populated from save data. + public types: PokemonType[] = []; + public addedType: PokemonType | null = null; + + /** Data pertaining to this pokemon's illusion. */ + public illusion: IllusionData | null = null; + public illusionBroken = false; + + /** Array containing all berries eaten in the last turn; used by {@linkcode AbilityId.CUD_CHEW} */ + public berriesEatenLast: BerryType[] = []; + + /** + * An array of all moves this pokemon has used since entering the battle. + * Used for most moves and abilities that check prior move usage or copy already-used moves. + */ + public moveHistory: TurnMove[] = []; + + constructor(source?: PokemonSummonData | Partial) { + if (isNullOrUndefined(source)) { + return; + } + + // TODO: Rework this into an actual generic function for use elsewhere + for (const [key, value] of Object.entries(source)) { + if (isNullOrUndefined(value) && this.hasOwnProperty(key)) { + continue; + } + + if (key === "moveset") { + this.moveset = value?.map((m: any) => PokemonMove.loadMove(m)); + continue; + } + + if (key === "tags") { + // load battler tags + this.tags = value.map((t: BattlerTag) => loadBattlerTag(t)); + continue; + } + this[key] = value; + } + } +} + +// TODO: Merge this inside `summmonData` but exclude from save if/when a save data serializer is added +export class PokemonTempSummonData { + /** + * The number of turns this pokemon has spent without switching out. + * Only currently used for positioning the battle cursor. + */ + turnCount = 1; + + /** + * The number of turns this pokemon has spent in the active position since the start of the wave + * without switching out. + * Reset on switch and new wave, but not stored in `SummonData` to avoid being written to the save file. + + * Used to evaluate "first turn only" conditions such as + * {@linkcode MoveId.FAKE_OUT | Fake Out} and {@linkcode MoveId.FIRST_IMPRESSION | First Impression}). + */ + waveTurnCount = 1; +} + +/** + * Persistent data for a {@linkcode Pokemon}. + * Resets at the start of a new battle (but not on switch). + */ +export class PokemonBattleData { + /** Counter tracking direct hits this Pokemon has received during this battle; used for {@linkcode MoveId.RAGE_FIST} */ + public hitCount = 0; + /** Whether this Pokemon has eaten a berry this battle; used for {@linkcode MoveId.BELCH} */ + public hasEatenBerry = false; + /** Array containing all berries eaten and not yet recovered during this current battle; used by {@linkcode AbilityId.HARVEST} */ + public berriesEaten: BerryType[] = []; + + constructor(source?: PokemonBattleData | Partial) { + if (!isNullOrUndefined(source)) { + this.hitCount = source.hitCount ?? 0; + this.hasEatenBerry = source.hasEatenBerry ?? false; + this.berriesEaten = source.berriesEaten ?? []; + } + } +} + +/** + * Temporary data for a {@linkcode Pokemon}. + * Resets on new wave/battle start (but not on switch). + */ +export class PokemonWaveData { + /** Whether the pokemon has endured due to a {@linkcode BattlerTagType.ENDURE_TOKEN} */ + public endured = false; + /** + * A set of all the abilities this {@linkcode Pokemon} has used in this wave. + * Used to track once per battle conditions, as well as (hopefully) by the updated AI for move effectiveness. + */ + public abilitiesApplied: Set = new Set(); + /** Whether the pokemon's ability has been revealed or not */ + public abilityRevealed = false; +} + +/** + * Temporary data for a {@linkcode Pokemon}. + * Resets at the start of a new turn, as well as on switch. + */ +export class PokemonTurnData { + public acted = false; + /** How many times the current move should hit the target(s) */ + public hitCount = 0; + /** + * - `-1` = Calculate how many hits are left + * - `0` = Move is finished + */ + public hitsLeft = -1; + public totalDamageDealt = 0; + public singleHitDamageDealt = 0; + public damageTaken = 0; + public attacksReceived: AttackMoveResult[] = []; + public order: number; + public statStagesIncreased = false; + public statStagesDecreased = false; + public moveEffectiveness: TypeDamageMultiplier | null = null; + public combiningPledge?: MoveId; + public switchedInThisTurn = false; + public failedRunAway = false; + public joinedRound = false; + /** + * The amount of times this Pokemon has acted again and used a move in the current turn. + * Used to make sure multi-hits occur properly when the user is + * forced to act again in the same turn, and **must be incremented** by any effects that grant extra actions. + */ + public extraTurns = 0; + /** + * All berries eaten by this pokemon in this turn. + * Saved into {@linkcode PokemonSummonData | SummonData} by {@linkcode AbilityId.CUD_CHEW} on turn end. + * @see {@linkcode PokemonSummonData.berriesEatenLast} + */ + public berriesEaten: BerryType[] = []; +} diff --git a/src/data/status-effect.ts b/src/data/status-effect.ts index a90304c9f7d..211e265ccf6 100644 --- a/src/data/status-effect.ts +++ b/src/data/status-effect.ts @@ -1,5 +1,5 @@ -import { randIntRange } from "#app/utils/common"; import { StatusEffect } from "#enums/status-effect"; +import { randIntRange } from "#utils/common"; import type { ParseKeys } from "i18next"; import i18next from "i18next"; diff --git a/src/data/terrain.ts b/src/data/terrain.ts index b3ee62ac2f9..f44fd4f35e7 100644 --- a/src/data/terrain.ts +++ b/src/data/terrain.ts @@ -1,7 +1,8 @@ -import type Pokemon from "../field/pokemon"; -import type Move from "./moves/move"; -import { PokemonType } from "#enums/pokemon-type"; +import { getPokemonNameWithAffix } from "#app/messages"; import type { BattlerIndex } from "#enums/battler-index"; +import { PokemonType } from "#enums/pokemon-type"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; import i18next from "i18next"; export enum TerrainType { @@ -96,3 +97,76 @@ export function getTerrainColor(terrainType: TerrainType): [number, number, numb return [0, 0, 0]; } + +/** + * Return the message associated with a terrain effect starting. + * @param terrainType - The {@linkcode TerrainType} starting. + * @returns A string containing the appropriate terrain start text. + */ +export function getTerrainStartMessage(terrainType: TerrainType): string { + switch (terrainType) { + case TerrainType.MISTY: + return i18next.t("terrain:mistyStartMessage"); + case TerrainType.ELECTRIC: + return i18next.t("terrain:electricStartMessage"); + case TerrainType.GRASSY: + return i18next.t("terrain:grassyStartMessage"); + case TerrainType.PSYCHIC: + return i18next.t("terrain:psychicStartMessage"); + case TerrainType.NONE: + default: + terrainType satisfies TerrainType.NONE; + console.warn(`${terrainType} unexpectedly provided as terrain type to getTerrainStartMessage!`); + return ""; + } +} + +/** + * Return the message associated with a terrain effect ceasing to exist. + * @param terrainType - The {@linkcode TerrainType} being cleared. + * @returns A string containing the appropriate terrain clear text. + */ +export function getTerrainClearMessage(terrainType: TerrainType): string { + switch (terrainType) { + case TerrainType.MISTY: + return i18next.t("terrain:mistyClearMessage"); + case TerrainType.ELECTRIC: + return i18next.t("terrain:electricClearMessage"); + case TerrainType.GRASSY: + return i18next.t("terrain:grassyClearMessage"); + case TerrainType.PSYCHIC: + return i18next.t("terrain:psychicClearMessage"); + case TerrainType.NONE: + default: + terrainType satisfies TerrainType.NONE; + console.warn(`${terrainType} unexpectedly provided as terrain type to getTerrainClearMessage!`); + return ""; + } +} + +/** + * Return the message associated with a terrain-induced move/effect blockage. + * @param pokemon - The {@linkcode Pokemon} being protected. + * @param terrainType - The {@linkcode TerrainType} in question + * @returns A string containing the appropriate terrain block text. + */ +export function getTerrainBlockMessage(pokemon: Pokemon, terrainType: TerrainType): string { + switch (terrainType) { + case TerrainType.MISTY: + return i18next.t("terrain:mistyBlockMessage", { + pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), + }); + case TerrainType.ELECTRIC: + case TerrainType.GRASSY: + case TerrainType.PSYCHIC: + return i18next.t("terrain:defaultBlockMessage", { + pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), + terrainName: getTerrainName(terrainType), + }); + case TerrainType.NONE: + default: + terrainType satisfies TerrainType.NONE; + console.warn(`${terrainType} unexpectedly provided as terrain type to getTerrainBlockMessage!`); + return ""; + } +} diff --git a/src/data/trainer-names.ts b/src/data/trainer-names.ts index 8714dad0fc9..6b882d1ddc1 100644 --- a/src/data/trainer-names.ts +++ b/src/data/trainer-names.ts @@ -1,5 +1,5 @@ import { TrainerType } from "#enums/trainer-type"; -import { toReadableString } from "#app/utils/common"; +import { toReadableString } from "#utils/common"; class TrainerNameConfig { public urls: string[]; diff --git a/src/data/trainers/evil-admin-trainer-pools.ts b/src/data/trainers/evil-admin-trainer-pools.ts index 74ee3e8cb3d..ad08a17d29f 100644 --- a/src/data/trainers/evil-admin-trainer-pools.ts +++ b/src/data/trainers/evil-admin-trainer-pools.ts @@ -1,6 +1,6 @@ -import type { TrainerTierPools } from "#app/@types/trainer-funcs"; -import { TrainerPoolTier } from "#enums/trainer-pool-tier"; import { SpeciesId } from "#enums/species-id"; +import { TrainerPoolTier } from "#enums/trainer-pool-tier"; +import type { TrainerTierPools } from "#types/trainer-funcs"; /** Team Rocket's admin trainer pool. */ const ROCKET: TrainerTierPools = { diff --git a/src/data/trainers/fixed-battle-configs.ts b/src/data/trainers/fixed-battle-configs.ts new file mode 100644 index 00000000000..bb6d591654b --- /dev/null +++ b/src/data/trainers/fixed-battle-configs.ts @@ -0,0 +1,376 @@ +import { FixedBattleConfig, getRandomTrainerFunc } from "#app/battle"; +import { Trainer } from "#app/field/trainer"; +import { globalScene } from "#app/global-scene"; +import { randSeedInt } from "#app/utils/common"; +import { BattleType } from "#enums/battle-type"; +import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; +import { ModifierTier } from "#enums/modifier-tier"; +import { PlayerGender } from "#enums/player-gender"; +import { TrainerType } from "#enums/trainer-type"; +import { TrainerVariant } from "#enums/trainer-variant"; + +export interface FixedBattleConfigs { + [key: number]: FixedBattleConfig; +} +/** + * Youngster/Lass on 5 + * Rival on 8, 55, 95, 145, 195 + * Evil team grunts on 35, 62, 64, and 112 + * Evil team admin on 66 and 114 + * Evil leader on 115, 165 + * E4 on 182, 184, 186, 188 + * Champion on 190 + */ +export const classicFixedBattles: FixedBattleConfigs = { + [ClassicFixedBossWaves.TOWN_YOUNGSTER]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => new Trainer(TrainerType.YOUNGSTER, randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT), + ), + [ClassicFixedBossWaves.RIVAL_1]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => + new Trainer( + TrainerType.RIVAL, + globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, + ), + ), + [ClassicFixedBossWaves.RIVAL_2]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => + new Trainer( + TrainerType.RIVAL_2, + globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, + ), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], + allowLuckUpgrades: false, + }), + [ClassicFixedBossWaves.EVIL_GRUNT_1]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + getRandomTrainerFunc( + [ + TrainerType.ROCKET_GRUNT, + TrainerType.MAGMA_GRUNT, + TrainerType.AQUA_GRUNT, + TrainerType.GALACTIC_GRUNT, + TrainerType.PLASMA_GRUNT, + TrainerType.FLARE_GRUNT, + TrainerType.AETHER_GRUNT, + TrainerType.SKULL_GRUNT, + TrainerType.MACRO_GRUNT, + TrainerType.STAR_GRUNT, + ], + true, + ), + ), + [ClassicFixedBossWaves.RIVAL_3]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => + new Trainer( + TrainerType.RIVAL_3, + globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, + ), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], + allowLuckUpgrades: false, + }), + [ClassicFixedBossWaves.EVIL_GRUNT_2]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc( + [ + TrainerType.ROCKET_GRUNT, + TrainerType.MAGMA_GRUNT, + TrainerType.AQUA_GRUNT, + TrainerType.GALACTIC_GRUNT, + TrainerType.PLASMA_GRUNT, + TrainerType.FLARE_GRUNT, + TrainerType.AETHER_GRUNT, + TrainerType.SKULL_GRUNT, + TrainerType.MACRO_GRUNT, + TrainerType.STAR_GRUNT, + ], + true, + ), + ), + [ClassicFixedBossWaves.EVIL_GRUNT_3]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc( + [ + TrainerType.ROCKET_GRUNT, + TrainerType.MAGMA_GRUNT, + TrainerType.AQUA_GRUNT, + TrainerType.GALACTIC_GRUNT, + TrainerType.PLASMA_GRUNT, + TrainerType.FLARE_GRUNT, + TrainerType.AETHER_GRUNT, + TrainerType.SKULL_GRUNT, + TrainerType.MACRO_GRUNT, + TrainerType.STAR_GRUNT, + ], + true, + ), + ), + [ClassicFixedBossWaves.EVIL_ADMIN_1]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc( + [ + [TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL], + [TrainerType.TABITHA, TrainerType.COURTNEY], + [TrainerType.MATT, TrainerType.SHELLY], + [TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN], + [TrainerType.ZINZOLIN, TrainerType.COLRESS], + [TrainerType.XEROSIC, TrainerType.BRYONY], + TrainerType.FABA, + TrainerType.PLUMERIA, + TrainerType.OLEANA, + [TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI], + ], + true, + ), + ), + [ClassicFixedBossWaves.RIVAL_4]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => + new Trainer( + TrainerType.RIVAL_4, + globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, + ), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], + allowLuckUpgrades: false, + }), + [ClassicFixedBossWaves.EVIL_GRUNT_4]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc( + [ + TrainerType.ROCKET_GRUNT, + TrainerType.MAGMA_GRUNT, + TrainerType.AQUA_GRUNT, + TrainerType.GALACTIC_GRUNT, + TrainerType.PLASMA_GRUNT, + TrainerType.FLARE_GRUNT, + TrainerType.AETHER_GRUNT, + TrainerType.SKULL_GRUNT, + TrainerType.MACRO_GRUNT, + TrainerType.STAR_GRUNT, + ], + true, + ), + ), + [ClassicFixedBossWaves.EVIL_ADMIN_2]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc( + [ + [TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL], + [TrainerType.TABITHA, TrainerType.COURTNEY], + [TrainerType.MATT, TrainerType.SHELLY], + [TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN], + [TrainerType.ZINZOLIN, TrainerType.COLRESS], + [TrainerType.XEROSIC, TrainerType.BRYONY], + TrainerType.FABA, + TrainerType.PLUMERIA, + TrainerType.OLEANA, + [TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI], + ], + true, + 1, + ), + ), + [ClassicFixedBossWaves.EVIL_BOSS_1]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.ROCKET_BOSS_GIOVANNI_1, + TrainerType.MAXIE, + TrainerType.ARCHIE, + TrainerType.CYRUS, + TrainerType.GHETSIS, + TrainerType.LYSANDRE, + TrainerType.LUSAMINE, + TrainerType.GUZMA, + TrainerType.ROSE, + TrainerType.PENNY, + ]), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ + ModifierTier.ROGUE, + ModifierTier.ROGUE, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ], + allowLuckUpgrades: false, + }), + [ClassicFixedBossWaves.RIVAL_5]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => + new Trainer( + TrainerType.RIVAL_5, + globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, + ), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ + ModifierTier.ROGUE, + ModifierTier.ROGUE, + ModifierTier.ROGUE, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ], + allowLuckUpgrades: false, + }), + [ClassicFixedBossWaves.EVIL_BOSS_2]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.ROCKET_BOSS_GIOVANNI_2, + TrainerType.MAXIE_2, + TrainerType.ARCHIE_2, + TrainerType.CYRUS_2, + TrainerType.GHETSIS_2, + TrainerType.LYSANDRE_2, + TrainerType.LUSAMINE_2, + TrainerType.GUZMA_2, + TrainerType.ROSE_2, + TrainerType.PENNY_2, + ]), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ + ModifierTier.ROGUE, + ModifierTier.ROGUE, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ], + allowLuckUpgrades: false, + }), + [ClassicFixedBossWaves.ELITE_FOUR_1]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.LORELEI, + TrainerType.WILL, + TrainerType.SIDNEY, + TrainerType.AARON, + TrainerType.SHAUNTAL, + TrainerType.MALVA, + [TrainerType.HALA, TrainerType.MOLAYNE], + TrainerType.MARNIE_ELITE, + TrainerType.RIKA, + TrainerType.CRISPIN, + ]), + ), + [ClassicFixedBossWaves.ELITE_FOUR_2]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.BRUNO, + TrainerType.KOGA, + TrainerType.PHOEBE, + TrainerType.BERTHA, + TrainerType.MARSHAL, + TrainerType.SIEBOLD, + TrainerType.OLIVIA, + TrainerType.NESSA_ELITE, + TrainerType.POPPY, + TrainerType.AMARYS, + ]), + ), + [ClassicFixedBossWaves.ELITE_FOUR_3]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.AGATHA, + TrainerType.BRUNO, + TrainerType.GLACIA, + TrainerType.FLINT, + TrainerType.GRIMSLEY, + TrainerType.WIKSTROM, + TrainerType.ACEROLA, + [TrainerType.BEA_ELITE, TrainerType.ALLISTER_ELITE], + TrainerType.LARRY_ELITE, + TrainerType.LACEY, + ]), + ), + [ClassicFixedBossWaves.ELITE_FOUR_4]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.LANCE, + TrainerType.KAREN, + TrainerType.DRAKE, + TrainerType.LUCIAN, + TrainerType.CAITLIN, + TrainerType.DRASNA, + TrainerType.KAHILI, + TrainerType.RAIHAN_ELITE, + TrainerType.HASSEL, + TrainerType.DRAYTON, + ]), + ), + [ClassicFixedBossWaves.CHAMPION]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1) + .setGetTrainerFunc( + getRandomTrainerFunc([ + TrainerType.BLUE, + [TrainerType.RED, TrainerType.LANCE_CHAMPION], + [TrainerType.STEVEN, TrainerType.WALLACE], + TrainerType.CYNTHIA, + [TrainerType.ALDER, TrainerType.IRIS], + TrainerType.DIANTHA, + [TrainerType.KUKUI, TrainerType.HAU], + [TrainerType.LEON, TrainerType.MUSTARD], + [TrainerType.GEETA, TrainerType.NEMONA], + TrainerType.KIERAN, + ]), + ), + [ClassicFixedBossWaves.RIVAL_6]: new FixedBattleConfig() + .setBattleType(BattleType.TRAINER) + .setGetTrainerFunc( + () => + new Trainer( + TrainerType.RIVAL_6, + globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT, + ), + ) + .setCustomModifierRewards({ + guaranteedModifierTiers: [ + ModifierTier.ROGUE, + ModifierTier.ROGUE, + ModifierTier.ULTRA, + ModifierTier.ULTRA, + ModifierTier.GREAT, + ModifierTier.GREAT, + ], + allowLuckUpgrades: false, + }), +}; diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index 7c8b5b29fcd..4e88399bec3 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -1,23 +1,28 @@ +import { timedEventManager } from "#app/global-event-manager"; import { globalScene } from "#app/global-scene"; -import { modifierTypes } from "../data-lists"; -import { PokemonMove } from "../moves/pokemon-move"; -import { - toReadableString, - isNullOrUndefined, - randSeedItem, - randSeedInt, - coerceArray, - randSeedIntRange, -} from "#app/utils/common"; -import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { tmSpecies } from "#app/data/balance/tms"; -import { doubleBattleDialogue } from "../double-battle-dialogue"; +import { pokemonEvolutions, pokemonPrevolutions } from "#balance/pokemon-evolutions"; +import { signatureSpecies } from "#balance/signature-species"; +import { tmSpecies } from "#balance/tms"; +import { modifierTypes } from "#data/data-lists"; +import { doubleBattleDialogue } from "#data/double-battle-dialogue"; +import { Gender } from "#data/gender"; +import type { PokemonSpecies, PokemonSpeciesFilter } from "#data/pokemon-species"; +import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { PokeballType } from "#enums/pokeball"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TeraAIMode } from "#enums/tera-ai-mode"; +import { TrainerPoolTier } from "#enums/trainer-pool-tier"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; import { TrainerVariant } from "#enums/trainer-variant"; -import { getIsInitialized, initI18n } from "#app/plugins/i18n"; -import i18next from "i18next"; -import { Gender } from "#app/data/gender"; -import { signatureSpecies } from "../balance/signature-species"; +import type { EnemyPokemon } from "#field/pokemon"; +import { PokemonMove } from "#moves/pokemon-move"; +import { getIsInitialized, initI18n } from "#plugins/i18n"; +import type { EvilTeam } from "#trainers/evil-admin-trainer-pools"; +import { evilAdminTrainerPools } from "#trainers/evil-admin-trainer-pools"; import { getEvilGruntPartyTemplate, getGymLeaderPartyTemplate, @@ -25,37 +30,27 @@ import { TrainerPartyCompoundTemplate, TrainerPartyTemplate, trainerPartyTemplates, -} from "./TrainerPartyTemplate"; -import { evilAdminTrainerPools } from "./evil-admin-trainer-pools"; - -// Enum imports -import { PartyMemberStrength } from "#enums/party-member-strength"; -import { SpeciesId } from "#enums/species-id"; -import { PokeballType } from "#enums/pokeball"; -import { PokemonType } from "#enums/pokemon-type"; -import { MoveId } from "#enums/move-id"; -import { AbilityId } from "#enums/ability-id"; -import { TeraAIMode } from "#enums/tera-ai-mode"; -import { TrainerPoolTier } from "#enums/trainer-pool-tier"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { TrainerType } from "#enums/trainer-type"; -import { timedEventManager } from "#app/global-event-manager"; - -// Type imports -import type { PokemonSpeciesFilter } from "#app/data/pokemon-species"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import type { ModifierTypeFunc } from "#app/@types/modifier-types"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import type { EvilTeam } from "./evil-admin-trainer-pools"; +} from "#trainers/trainer-party-template"; +import type { ModifierTypeFunc } from "#types/modifier-types"; import type { - PartyMemberFunc, - GenModifiersFunc, GenAIFunc, - PartyTemplateFunc, - TrainerTierPools, - TrainerConfigs, + GenModifiersFunc, + PartyMemberFunc, PartyMemberFuncs, -} from "../../@types/trainer-funcs"; + PartyTemplateFunc, + TrainerConfigs, + TrainerTierPools, +} from "#types/trainer-funcs"; +import { + coerceArray, + isNullOrUndefined, + randSeedInt, + randSeedIntRange, + randSeedItem, + toReadableString, +} from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; /** Minimum BST for Pokemon generated onto the Elite Four's teams */ const ELITE_FOUR_MINIMUM_BST = 460; diff --git a/src/data/trainers/TrainerPartyTemplate.ts b/src/data/trainers/trainer-party-template.ts similarity index 100% rename from src/data/trainers/TrainerPartyTemplate.ts rename to src/data/trainers/trainer-party-template.ts index 135fe669825..d4e7fe7a261 100644 --- a/src/data/trainers/TrainerPartyTemplate.ts +++ b/src/data/trainers/trainer-party-template.ts @@ -1,8 +1,8 @@ -import { startingWave } from "#app/starting-wave"; import { globalScene } from "#app/global-scene"; -import { PartyMemberStrength } from "#enums/party-member-strength"; -import { GameModes } from "#enums/game-modes"; +import { startingWave } from "#app/starting-wave"; import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; +import { GameModes } from "#enums/game-modes"; +import { PartyMemberStrength } from "#enums/party-member-strength"; export class TrainerPartyTemplate { public size: number; diff --git a/src/data/weather.ts b/src/data/weather.ts index 425e15b12a8..62a03aa0832 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -1,16 +1,15 @@ -import { BiomeId } from "#enums/biome-id"; -import { WeatherType } from "#enums/weather-type"; -import { getPokemonNameWithAffix } from "../messages"; -import type Pokemon from "../field/pokemon"; -import { PokemonType } from "#enums/pokemon-type"; -import type Move from "./moves/move"; -import { randSeedInt } from "#app/utils/common"; -import { TerrainType, getTerrainName } from "./terrain"; -import i18next from "i18next"; -import { globalScene } from "#app/global-scene"; -import type { Arena } from "#app/field/arena"; +import type { SuppressWeatherEffectAbAttr } from "#abilities/ability"; import { timedEventManager } from "#app/global-event-manager"; -import type { SuppressWeatherEffectAbAttr } from "./abilities/ability"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { BiomeId } from "#enums/biome-id"; +import { PokemonType } from "#enums/pokemon-type"; +import { WeatherType } from "#enums/weather-type"; +import type { Arena } from "#field/arena"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { randSeedInt } from "#utils/common"; +import i18next from "i18next"; export class Weather { public weatherType: WeatherType; @@ -235,50 +234,6 @@ export function getWeatherBlockMessage(weatherType: WeatherType): string { return i18next.t("weather:defaultEffectMessage"); } -export function getTerrainStartMessage(terrainType: TerrainType): string | null { - switch (terrainType) { - case TerrainType.MISTY: - return i18next.t("terrain:mistyStartMessage"); - case TerrainType.ELECTRIC: - return i18next.t("terrain:electricStartMessage"); - case TerrainType.GRASSY: - return i18next.t("terrain:grassyStartMessage"); - case TerrainType.PSYCHIC: - return i18next.t("terrain:psychicStartMessage"); - default: - console.warn("getTerrainStartMessage not defined. Using default null"); - return null; - } -} - -export function getTerrainClearMessage(terrainType: TerrainType): string | null { - switch (terrainType) { - case TerrainType.MISTY: - return i18next.t("terrain:mistyClearMessage"); - case TerrainType.ELECTRIC: - return i18next.t("terrain:electricClearMessage"); - case TerrainType.GRASSY: - return i18next.t("terrain:grassyClearMessage"); - case TerrainType.PSYCHIC: - return i18next.t("terrain:psychicClearMessage"); - default: - console.warn("getTerrainClearMessage not defined. Using default null"); - return null; - } -} - -export function getTerrainBlockMessage(pokemon: Pokemon, terrainType: TerrainType): string { - if (terrainType === TerrainType.MISTY) { - return i18next.t("terrain:mistyBlockMessage", { - pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), - }); - } - return i18next.t("terrain:defaultBlockMessage", { - pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), - terrainName: getTerrainName(terrainType), - }); -} - export interface WeatherPoolEntry { weatherType: WeatherType; weight: number; diff --git a/src/enums/gacha-types.ts b/src/enums/gacha-types.ts index c8beff5cad2..cd0bc67eae0 100644 --- a/src/enums/gacha-types.ts +++ b/src/enums/gacha-types.ts @@ -1,5 +1,7 @@ -export enum GachaType { - MOVE, - LEGENDARY, - SHINY -} +export const GachaType = Object.freeze({ + MOVE: 0, + LEGENDARY: 1, + SHINY: 2 +}); + +export type GachaType = typeof GachaType[keyof typeof GachaType]; diff --git a/src/enums/move-use-mode.ts b/src/enums/move-use-mode.ts index 31694ad4081..1bb9d6374b7 100644 --- a/src/enums/move-use-mode.ts +++ b/src/enums/move-use-mode.ts @@ -1,4 +1,4 @@ -import type { PostDancingMoveAbAttr } from "#app/data/abilities/ability"; +import type { PostDancingMoveAbAttr } from "#abilities/ability"; import type { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; /** diff --git a/src/events/arena.ts b/src/events/arena.ts index 3b65506db98..5415b8eb026 100644 --- a/src/events/arena.ts +++ b/src/events/arena.ts @@ -1,6 +1,6 @@ +import type { TerrainType } from "#data/terrain"; import type { ArenaTagSide } from "#enums/arena-tag-side"; import type { ArenaTagType } from "#enums/arena-tag-type"; -import type { TerrainType } from "#app/data/terrain"; import type { WeatherType } from "#enums/weather-type"; /** Alias for all {@linkcode ArenaEvent} type strings */ diff --git a/src/events/battle-scene.ts b/src/events/battle-scene.ts index 83d260bd7d2..29aee1053cd 100644 --- a/src/events/battle-scene.ts +++ b/src/events/battle-scene.ts @@ -1,5 +1,5 @@ -import type Move from "../data/moves/move"; -import type { BerryModifier } from "../modifier/modifier"; +import type { BerryModifier } from "#modifiers/modifier"; +import type { Move } from "#moves/move"; /** Alias for all {@linkcode BattleScene} events */ export enum BattleSceneEventType { diff --git a/src/field/anims.ts b/src/field/anims.ts index 2fd23e4262b..82aa7b7e894 100644 --- a/src/field/anims.ts +++ b/src/field/anims.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { PokeballType } from "#enums/pokeball"; -import type { Variant } from "#app/sprites/variant"; -import { getFrameMs, randGauss } from "#app/utils/common"; +import type { Variant } from "#sprites/variant"; +import { getFrameMs, randGauss } from "#utils/common"; export function addPokeballOpenParticles(x: number, y: number, pokeballType: PokeballType): void { switch (pokeballType) { @@ -150,7 +150,7 @@ function doFanOutParticle( } export function addPokeballCaptureStars(pokeball: Phaser.GameObjects.Sprite): void { - const addParticle = () => { + const addParticle = (): void => { const particle = globalScene.add.sprite(pokeball.x, pokeball.y, "pb_particles", "4.png"); particle.setOrigin(pokeball.originX, pokeball.originY); particle.setAlpha(0.5); @@ -188,7 +188,9 @@ export function addPokeballCaptureStars(pokeball: Phaser.GameObjects.Sprite): vo }); }; - new Array(3).fill(null).map(() => addParticle()); + for (let i = 0; i < 3; i++) { + addParticle(); + } } export function sin(index: number, amplitude: number): number { diff --git a/src/field/arena.ts b/src/field/arena.ts index 6893678d4a8..2e15ef3fede 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -1,42 +1,37 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import type { BiomeTierTrainerPools, PokemonPools } from "#app/data/balance/biomes"; -import { biomePokemonPools, BiomePoolTier, biomeTrainerPools } from "#app/data/balance/biomes"; -import { randSeedInt, NumberHolder, isNullOrUndefined, type Constructor } from "#app/utils/common"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; +import Overrides from "#app/overrides"; +import type { BiomeTierTrainerPools, PokemonPools } from "#balance/biomes"; +import { BiomePoolTier, biomePokemonPools, biomeTrainerPools } from "#balance/biomes"; +import type { ArenaTag } from "#data/arena-tag"; +import { ArenaTrapTag, getArenaTag } from "#data/arena-tag"; +import { SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "#data/form-change-triggers"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { getTerrainClearMessage, getTerrainStartMessage, Terrain, TerrainType } from "#data/terrain"; import { - getTerrainClearMessage, - getTerrainStartMessage, + getLegendaryWeatherContinuesMessage, getWeatherClearMessage, getWeatherStartMessage, - getLegendaryWeatherContinuesMessage, Weather, -} from "#app/data/weather"; -import { CommonAnim } from "#enums/move-anims-common"; -import type { PokemonType } from "#enums/pokemon-type"; -import type Move from "#app/data/moves/move"; -import type { ArenaTag } from "#app/data/arena-tag"; -import { ArenaTrapTag, getArenaTag } from "#app/data/arena-tag"; +} from "#data/weather"; +import { AbilityId } from "#enums/ability-id"; import { ArenaTagSide } from "#enums/arena-tag-side"; -import type { BattlerIndex } from "#enums/battler-index"; -import { Terrain, TerrainType } from "#app/data/terrain"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import type Pokemon from "#app/field/pokemon"; -import Overrides from "#app/overrides"; -import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena"; import type { ArenaTagType } from "#enums/arena-tag-type"; +import type { BattlerIndex } from "#enums/battler-index"; import { BiomeId } from "#enums/biome-id"; +import { CommonAnim } from "#enums/move-anims-common"; import type { MoveId } from "#enums/move-id"; +import type { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; import { TimeOfDay } from "#enums/time-of-day"; import { TrainerType } from "#enums/trainer-type"; -import { AbilityId } from "#enums/ability-id"; -import { - SpeciesFormChangeRevertWeatherFormTrigger, - SpeciesFormChangeWeatherTrigger, -} from "#app/data/pokemon-forms/form-change-triggers"; import { WeatherType } from "#enums/weather-type"; -import { FieldEffectModifier } from "#app/modifier/modifier"; +import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#events/arena"; +import type { Pokemon } from "#field/pokemon"; +import { FieldEffectModifier } from "#modifiers/modifier"; +import type { Move } from "#moves/move"; +import { type Constructor, isNullOrUndefined, NumberHolder, randSeedInt } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; export class Arena { public biomeType: BiomeId; @@ -148,6 +143,7 @@ export class Arena { if (!tierPool.length) { ret = globalScene.randomSpecies(waveIndex, level); } else { + // TODO: should this use `randSeedItem`? const entry = tierPool[randSeedInt(tierPool.length)]; let species: SpeciesId; if (typeof entry === "number") { @@ -159,6 +155,7 @@ export class Arena { if (level >= levelThreshold) { const speciesIds = entry[levelThreshold]; if (speciesIds.length > 1) { + // TODO: should this use `randSeedItem`? species = speciesIds[randSeedInt(speciesIds.length)]; } else { species = speciesIds[0]; @@ -171,19 +168,11 @@ export class Arena { ret = getPokemonSpecies(species!); if (ret.subLegendary || ret.legendary || ret.mythical) { - switch (true) { - case ret.baseTotal >= 720: - regen = level < 90; - break; - case ret.baseTotal >= 670: - regen = level < 70; - break; - case ret.baseTotal >= 580: - regen = level < 50; - break; - default: - regen = level < 30; - break; + const waveDifficulty = globalScene.gameMode.getWaveForDifficulty(waveIndex); + if (ret.baseTotal >= 660) { + regen = waveDifficulty < 80; // Wave 50+ in daily (however, max Daily wave is 50 currently so not possible) + } else { + regen = waveDifficulty < 55; // Wave 25+ in daily } } } @@ -445,9 +434,9 @@ export class Arena { CommonAnim.MISTY_TERRAIN + (terrain - 1), ); } - globalScene.phaseManager.queueMessage(getTerrainStartMessage(terrain)!); // TODO: is this bang correct? + globalScene.phaseManager.queueMessage(getTerrainStartMessage(terrain)); } else { - globalScene.phaseManager.queueMessage(getTerrainClearMessage(oldTerrainType)!); // TODO: is this bang correct? + globalScene.phaseManager.queueMessage(getTerrainClearMessage(oldTerrainType)); } globalScene @@ -501,38 +490,37 @@ export class Arena { getTrainerChance(): number { switch (this.biomeType) { case BiomeId.METROPOLIS: - return 2; - case BiomeId.SLUM: - case BiomeId.BEACH: case BiomeId.DOJO: - case BiomeId.CONSTRUCTION_SITE: return 4; case BiomeId.PLAINS: case BiomeId.GRASS: + case BiomeId.BEACH: case BiomeId.LAKE: case BiomeId.CAVE: + case BiomeId.DESERT: + case BiomeId.CONSTRUCTION_SITE: + case BiomeId.SLUM: return 6; case BiomeId.TALL_GRASS: case BiomeId.FOREST: - case BiomeId.SEA: case BiomeId.SWAMP: case BiomeId.MOUNTAIN: case BiomeId.BADLANDS: - case BiomeId.DESERT: case BiomeId.MEADOW: case BiomeId.POWER_PLANT: - case BiomeId.GRAVEYARD: case BiomeId.FACTORY: case BiomeId.SNOWY_FOREST: return 8; + case BiomeId.SEA: case BiomeId.ICE_CAVE: case BiomeId.VOLCANO: + case BiomeId.GRAVEYARD: case BiomeId.RUINS: case BiomeId.WASTELAND: case BiomeId.JUNGLE: case BiomeId.FAIRY_CAVE: + case BiomeId.ISLAND: return 12; - case BiomeId.SEABED: case BiomeId.ABYSS: case BiomeId.SPACE: case BiomeId.TEMPLE: @@ -899,7 +887,7 @@ export class Arena { case BiomeId.WASTELAND: return 6.336; case BiomeId.ABYSS: - return 5.13; + return 20.113; case BiomeId.SPACE: return 20.036; case BiomeId.CONSTRUCTION_SITE: @@ -983,14 +971,15 @@ export class ArenaBase extends Phaser.GameObjects.Container { this.base = globalScene.addFieldSprite(0, 0, "plains_a", undefined, 1); this.base.setOrigin(0, 0); - this.props = !player - ? new Array(3).fill(null).map(() => { - const ret = globalScene.addFieldSprite(0, 0, "plains_b", undefined, 1); - ret.setOrigin(0, 0); - ret.setVisible(false); - return ret; - }) - : []; + this.props = []; + if (!player) { + for (let i = 0; i < 3; i++) { + const ret = globalScene.addFieldSprite(0, 0, "plains_b", undefined, 1); + ret.setOrigin(0, 0); + ret.setVisible(false); + this.props.push(ret); + } + } } setBiome(biome: BiomeId, propValue?: number): void { diff --git a/src/field/damage-number-handler.ts b/src/field/damage-number-handler.ts index b8b3ed76e18..acb279a17a0 100644 --- a/src/field/damage-number-handler.ts +++ b/src/field/damage-number-handler.ts @@ -1,14 +1,14 @@ -import { TextStyle, addTextObject } from "../ui/text"; -import type { DamageResult } from "./pokemon"; -import type Pokemon from "./pokemon"; -import { HitResult } from "#enums/hit-result"; -import { formatStat, fixedInt } from "#app/utils/common"; -import type { BattlerIndex } from "#enums/battler-index"; import { globalScene } from "#app/global-scene"; +import type { BattlerIndex } from "#enums/battler-index"; +import { HitResult } from "#enums/hit-result"; +import type { Pokemon } from "#field/pokemon"; +import type { DamageResult } from "#types/damage-result"; +import { addTextObject, TextStyle } from "#ui/text"; +import { fixedInt, formatStat } from "#utils/common"; type TextAndShadowArr = [string | null, string | null]; -export default class DamageNumberHandler { +export class DamageNumberHandler { private damageNumbers: Map; constructor() { diff --git a/src/field/mystery-encounter-intro.ts b/src/field/mystery-encounter-intro.ts index f6702c690bd..d3776f349e6 100644 --- a/src/field/mystery-encounter-intro.ts +++ b/src/field/mystery-encounter-intro.ts @@ -1,13 +1,14 @@ -import type { GameObjects } from "phaser"; import { globalScene } from "#app/global-scene"; -import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; import type { SpeciesId } from "#enums/species-id"; -import { isNullOrUndefined } from "#app/utils/common"; -import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import type { Variant } from "#app/sprites/variant"; -import { doShinySparkleAnim } from "#app/field/anims"; -import { loadPokemonVariantAssets } from "#app/sprites/pokemon-sprite"; -import PlayAnimationConfig = Phaser.Types.Animations.PlayAnimationConfig; +import { doShinySparkleAnim } from "#field/anims"; +import { getSpriteKeysFromSpecies } from "#mystery-encounters/encounter-pokemon-utils"; +import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { loadPokemonVariantAssets } from "#sprites/pokemon-sprite"; +import type { Variant } from "#sprites/variant"; +import { isNullOrUndefined } from "#utils/common"; +import type { GameObjects } from "phaser"; + +type PlayAnimationConfig = Phaser.Types.Animations.PlayAnimationConfig; type KnownFileRoot = | "arenas" @@ -77,7 +78,7 @@ export class MysteryEncounterSpriteConfig { * These slide in with the field as part of standard field change cycle, and will typically be hidden after the player has selected an option for the encounter * Note: intro visuals are not "Trainers" or any other specific game object, though they may contain trainer sprites */ -export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Container { +export class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Container { public encounter: MysteryEncounter; public spriteConfigs: MysteryEncounterSpriteConfig[]; public enterFromRight: boolean; diff --git a/src/field/pokemon-sprite-sparkle-handler.ts b/src/field/pokemon-sprite-sparkle-handler.ts index bda9414bb92..725229ce723 100644 --- a/src/field/pokemon-sprite-sparkle-handler.ts +++ b/src/field/pokemon-sprite-sparkle-handler.ts @@ -1,8 +1,8 @@ import { globalScene } from "#app/global-scene"; -import Pokemon from "./pokemon"; -import { fixedInt, coerceArray, randInt } from "#app/utils/common"; +import { Pokemon } from "#field/pokemon"; +import { coerceArray, fixedInt, randInt } from "#utils/common"; -export default class PokemonSpriteSparkleHandler { +export class PokemonSpriteSparkleHandler { private sprites: Set; setup(): void { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f62542fcaac..1453f61aad4 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1,180 +1,179 @@ -import Phaser from "phaser"; -import type { AnySound } from "#app/battle-scene"; -import type BattleScene from "#app/battle-scene"; +import type { Ability, PreAttackModifyDamageAbAttrParams } from "#abilities/ability"; +import { applyAbAttrs, applyOnGainAbAttrs, applyOnLoseAbAttrs } from "#abilities/apply-ab-attrs"; +import type { AnySound, BattleScene } from "#app/battle-scene"; +import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; +import { timedEventManager } from "#app/global-event-manager"; import { globalScene } from "#app/global-scene"; -import type { Variant } from "#app/sprites/variant"; -import { populateVariantColors, variantColorCache } from "#app/sprites/variant"; -import { variantData } from "#app/sprites/variant"; -import BattleInfo from "#app/ui/battle-info/battle-info"; -import { EnemyBattleInfo } from "#app/ui/battle-info/enemy-battle-info"; -import { PlayerBattleInfo } from "#app/ui/battle-info/player-battle-info"; -import type Move from "#app/data/moves/move"; -import { getMoveTargets } from "#app/data/moves/move-utils"; -import { applyMoveAttrs } from "#app/data/moves/apply-attrs"; -import { allMoves } from "#app/data/data-lists"; -import { MoveTarget } from "#enums/MoveTarget"; -import { MoveCategory } from "#enums/MoveCategory"; -import type { PokemonSpeciesForm } from "#app/data/pokemon-species"; -import { default as PokemonSpecies, getFusedSpeciesName, getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters"; -import { - NumberHolder, - randSeedInt, - getIvsFromId, - BooleanHolder, - randSeedItem, - isNullOrUndefined, - getEnumValues, - toDmgValue, - fixedInt, - rgbaToInt, - rgbHexToRgba, - rgbToHsv, - deltaRgb, - isBetween, - randSeedFloat, - type Constructor, - randSeedIntRange, - coerceArray, -} from "#app/utils/common"; -import type { TypeDamageMultiplier } from "#app/data/type"; -import { getTypeDamageMultiplier, getTypeRgb } from "#app/data/type"; -import { PokemonType } from "#enums/pokemon-type"; -import { getLevelTotalExp } from "#app/data/exp"; -import { - Stat, - type PermanentStat, - type BattleStat, - type EffectiveStat, - PERMANENT_STATS, - BATTLE_STATS, - EFFECTIVE_STATS, -} from "#enums/stat"; -import { - EnemyDamageBoosterModifier, - EnemyDamageReducerModifier, - EnemyFusionChanceModifier, - HiddenAbilityRateBoosterModifier, - BaseStatModifier, - PokemonFriendshipBoosterModifier, - PokemonHeldItemModifier, - PokemonNatureWeightModifier, - ShinyRateBoosterModifier, - SurviveDamageModifier, - TempStatStageBoosterModifier, - TempCritBoosterModifier, - StatBoosterModifier, - CritBoosterModifier, - PokemonBaseStatFlatModifier, - PokemonBaseStatTotalModifier, - PokemonIncrementingStatModifier, - EvoTrackerModifier, - PokemonMultiHitModifier, -} from "#app/modifier/modifier"; -import { PokeballType } from "#enums/pokeball"; -import { Gender } from "#app/data/gender"; -import { Status, getRandomStatus } from "#app/data/status-effect"; -import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; +import { getPokemonNameWithAffix } from "#app/messages"; +import Overrides from "#app/overrides"; +import { speciesEggMoves } from "#balance/egg-moves"; +import type { SpeciesFormEvolution } from "#balance/pokemon-evolutions"; import { + FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions, - FusionSpeciesFormEvolution, validateShedinjaEvo, -} from "#app/data/balance/pokemon-evolutions"; -import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "#app/data/balance/tms"; +} from "#balance/pokemon-evolutions"; +import type { LevelMoves } from "#balance/pokemon-level-moves"; +import { EVOLVE_MOVE, RELEARN_MOVE } from "#balance/pokemon-level-moves"; +import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE, SHINY_EPIC_CHANCE, SHINY_VARIANT_CHANCE } from "#balance/rates"; +import { getStarterValueFriendshipCap, speciesStarterCosts } from "#balance/starters"; +import { reverseCompatibleTms, tmPoolTiers, tmSpecies } from "#balance/tms"; +import type { SuppressAbilitiesTag } from "#data/arena-tag"; +import { NoCritTag, WeakenMoveScreenTag } from "#data/arena-tag"; import { - BattlerTag, - EncoreTag, - GroundedTag, - HighestStatBoostTag, - SubstituteTag, - TypeImmuneTag, - getBattlerTag, - SemiInvulnerableTag, - MoveRestrictionBattlerTag, - ExposedTag, - DragonCheerTag, - CritBoostTag, - TrappedTag, - TarShotTag, AutotomizedTag, - PowerTrickTag, - loadBattlerTag, + BattlerTag, + CritBoostTag, + DragonCheerTag, + EncoreTag, + ExposedTag, + GroundedTag, type GrudgeTag, -} from "../data/battler-tags"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { WeatherType } from "#enums/weather-type"; -import { NoCritTag, WeakenMoveScreenTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import type { SuppressAbilitiesTag } from "#app/data/arena-tag"; -import type { Ability, PreAttackModifyDamageAbAttrParams } from "#app/data/abilities/ability"; -import { applyAbAttrs, applyOnGainAbAttrs, applyOnLoseAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { allAbilities } from "#app/data/data-lists"; -import type PokemonData from "#app/system/pokemon-data"; -import { BattlerIndex } from "#enums/battler-index"; -import { UiMode } from "#enums/ui-mode"; -import type { PartyOption } from "#app/ui/party-ui-handler"; -import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler"; -import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; -import { EVOLVE_MOVE, RELEARN_MOVE } from "#app/data/balance/pokemon-level-moves"; -import { achvs } from "#app/system/achv"; -import type { StarterDataEntry, StarterMoveset } from "#app/system/game-data"; -import { DexAttr } from "#enums/dex-attr"; -import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities"; -import { getNatureStatMultiplier } from "#app/data/nature"; -import type { SpeciesFormChange } from "#app/data/pokemon-forms"; + getBattlerTag, + HighestStatBoostTag, + MoveRestrictionBattlerTag, + PowerTrickTag, + SemiInvulnerableTag, + SubstituteTag, + TarShotTag, + TrappedTag, + TypeImmuneTag, +} from "#data/battler-tags"; +import { applyChallenges } from "#data/challenge"; +import { allAbilities, allMoves } from "#data/data-lists"; +import { getLevelTotalExp } from "#data/exp"; import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeLapseTeraTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, -} from "#app/data/pokemon-forms/form-change-triggers"; -import { TerrainType } from "#app/data/terrain"; -import type { TrainerSlot } from "#enums/trainer-slot"; -import Overrides from "#app/overrides"; -import i18next from "i18next"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { ModifierTier } from "#enums/modifier-tier"; -import { applyChallenges } from "#app/data/challenge"; -import { ChallengeType } from "#enums/challenge-type"; +} from "#data/form-change-triggers"; +import { Gender } from "#data/gender"; +import { getNatureStatMultiplier } from "#data/nature"; +import { + CustomPokemonData, + PokemonBattleData, + PokemonSummonData, + PokemonTempSummonData, + PokemonTurnData, + PokemonWaveData, +} from "#data/pokemon-data"; +import type { SpeciesFormChange } from "#data/pokemon-forms"; +import type { PokemonSpeciesForm } from "#data/pokemon-species"; +import { getFusedSpeciesName, getPokemonSpeciesForm, PokemonSpecies } from "#data/pokemon-species"; +import { getRandomStatus, getStatusEffectOverlapText, Status } from "#data/status-effect"; +import { getTerrainBlockMessage, TerrainType } from "#data/terrain"; +import type { TypeDamageMultiplier } from "#data/type"; +import { getTypeDamageMultiplier, getTypeRgb } from "#data/type"; import { AbilityId } from "#enums/ability-id"; +import { AiType } from "#enums/ai-type"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import type { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { getPokemonNameWithAffix } from "#app/messages"; +import { ChallengeType } from "#enums/challenge-type"; import { Challenges } from "#enums/challenges"; -import { PokemonAnimType } from "#enums/pokemon-anim-type"; -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 { - BASE_HIDDEN_ABILITY_CHANCE, - BASE_SHINY_CHANCE, - SHINY_EPIC_CHANCE, - SHINY_VARIANT_CHANCE, -} from "#app/data/balance/rates"; -import { Nature } from "#enums/nature"; -import { StatusEffect } from "#enums/status-effect"; -import { doShinySparkleAnim } from "#app/field/anims"; -import { MoveFlags } from "#enums/MoveFlags"; -import { timedEventManager } from "#app/global-event-manager"; -import { loadMoveAnimations } from "#app/sprites/pokemon-asset-loader"; -import { isVirtual, isIgnorePP, MoveUseMode } from "#enums/move-use-mode"; +import { DexAttr } from "#enums/dex-attr"; import { FieldPosition } from "#enums/field-position"; -import { LearnMoveSituation } from "#enums/learn-move-situation"; import { HitResult } from "#enums/hit-result"; -import { AiType } from "#enums/ai-type"; -import type { MoveResult } from "#enums/move-result"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import type { AbAttrMap, AbAttrString, TypeMultiplierAbAttrParams } from "#app/@types/ability-types"; +import { LearnMoveSituation } from "#enums/learn-move-situation"; +import { MoveCategory } from "#enums/MoveCategory"; +import { MoveFlags } from "#enums/MoveFlags"; +import { MoveTarget } from "#enums/MoveTarget"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { isIgnorePP, isVirtual, MoveUseMode } from "#enums/move-use-mode"; +import { Nature } from "#enums/nature"; +import { PokeballType } from "#enums/pokeball"; +import { PokemonAnimType } from "#enums/pokemon-anim-type"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesFormKey } from "#enums/species-form-key"; +import { SpeciesId } from "#enums/species-id"; +import { + BATTLE_STATS, + type BattleStat, + EFFECTIVE_STATS, + type EffectiveStat, + PERMANENT_STATS, + type PermanentStat, + Stat, +} from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { SwitchType } from "#enums/switch-type"; +import type { TrainerSlot } from "#enums/trainer-slot"; +import { UiMode } from "#enums/ui-mode"; +import { WeatherType } from "#enums/weather-type"; +import { doShinySparkleAnim } from "#field/anims"; +import { + BaseStatModifier, + CritBoosterModifier, + EnemyDamageBoosterModifier, + EnemyDamageReducerModifier, + EnemyFusionChanceModifier, + EvoTrackerModifier, + HiddenAbilityRateBoosterModifier, + PokemonBaseStatFlatModifier, + PokemonBaseStatTotalModifier, + PokemonFriendshipBoosterModifier, + PokemonHeldItemModifier, + PokemonIncrementingStatModifier, + PokemonMultiHitModifier, + PokemonNatureWeightModifier, + ShinyRateBoosterModifier, + StatBoosterModifier, + SurviveDamageModifier, + TempCritBoosterModifier, + TempStatStageBoosterModifier, +} from "#modifiers/modifier"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import type { Move } from "#moves/move"; +import { getMoveTargets } from "#moves/move-utils"; +import { PokemonMove } from "#moves/pokemon-move"; +import { loadMoveAnimations } from "#sprites/pokemon-asset-loader"; +import type { Variant } from "#sprites/variant"; +import { populateVariantColors, variantColorCache, variantData } from "#sprites/variant"; +import { achvs } from "#system/achv"; +import type { StarterDataEntry, StarterMoveset } from "#system/game-data"; +import type { PokemonData } from "#system/pokemon-data"; +import type { AbAttrMap, AbAttrString, TypeMultiplierAbAttrParams } from "#types/ability-types"; +import type { DamageCalculationResult, DamageResult } from "#types/damage-result"; +import type { IllusionData } from "#types/illusion-data"; +import type { TurnMove } from "#types/turn-move"; +import { BattleInfo } from "#ui/battle-info"; +import { EnemyBattleInfo } from "#ui/enemy-battle-info"; +import type { PartyOption } from "#ui/party-ui-handler"; +import { PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; +import { PlayerBattleInfo } from "#ui/player-battle-info"; +import { + BooleanHolder, + type Constructor, + coerceArray, + deltaRgb, + fixedInt, + getIvsFromId, + isBetween, + isNullOrUndefined, + NumberHolder, + randSeedFloat, + randSeedInt, + randSeedIntRange, + randSeedItem, + rgbaToInt, + rgbHexToRgba, + rgbToHsv, + toDmgValue, +} from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { argbFromRgba, QuantizerCelebi, rgbaFromArgb } from "@material/material-color-utilities"; +import i18next from "i18next"; +import Phaser from "phaser"; +import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; /** Base typeclass for damage parameter methods, used for DRY */ type damageParams = { @@ -206,7 +205,7 @@ type getBaseDamageParams = Omit; /** Type for the parameters of {@linkcode Pokemon#getAttackDamage | getAttackDamage} */ type getAttackDamageParams = Omit; -export default abstract class Pokemon extends Phaser.GameObjects.Container { +export abstract class Pokemon extends Phaser.GameObjects.Container { /** * This pokemon's {@link https://bulbapedia.bulbagarden.net/wiki/Personality_value | Personality value/PID}, * used to determine various parameters of this Pokemon. @@ -559,7 +558,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { getDexAttr(): bigint { let ret = 0n; - ret |= this.gender !== Gender.FEMALE ? DexAttr.MALE : DexAttr.FEMALE; + if (this.gender !== Gender.GENDERLESS) { + ret |= this.gender !== Gender.FEMALE ? DexAttr.MALE : DexAttr.FEMALE; + } ret |= !this.shiny ? DexAttr.NON_SHINY : DexAttr.SHINY; ret |= this.variant >= 2 ? DexAttr.VARIANT_3 : this.variant === 1 ? DexAttr.VARIANT_2 : DexAttr.DEFAULT_VARIANT; ret |= globalScene.gameData.getFormAttr(this.formIndex); @@ -1047,6 +1048,39 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return species; } + /** + * Getter function that returns whether this {@linkcode Pokemon} is currently transformed into another one + * (such as by the effects of {@linkcode MoveId.TRANSFORM} or {@linkcode AbilityId.IMPOSTER}. + * @returns Whether this Pokemon is currently transformed. + */ + isTransformed(): boolean { + return this.summonData.speciesForm !== null; + } + + /** + * Return whether this Pokemon can transform into an opposing Pokemon. + * @param target - The {@linkcode Pokemon} being transformed into + * @returns Whether this Pokemon can transform into `target`. + */ + canTransformInto(target: Pokemon): boolean { + return !( + // Neither pokemon can be already transformed + ( + this.isTransformed() || + target.isTransformed() || + // Neither pokemon can be behind an illusion + target.summonData.illusion || + this.summonData.illusion || + // The target cannot be behind a substitute + target.getTag(BattlerTagType.SUBSTITUTE) || + // Transforming to/from fusion pokemon causes various problems (crashes, etc.) + // TODO: Consider lifting restriction once bug is fixed + this.isFusion() || + target.isFusion() + ) + ); + } + /** * @param {boolean} useIllusion - Whether we want the fusionSpeciesForm of the illusion or not. */ @@ -1261,39 +1295,39 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { /** * Retrieves the entire set of stats of this {@linkcode Pokemon}. - * @param bypassSummonData - whether to use actual stats or in-battle overriden stats from Transform; default `true` - * @returns the numeric values of this {@linkcode Pokemon}'s stats + * @param bypassSummonData - Whether to prefer actual stats (`true`) or in-battle overridden stats (`false`); default `true` + * @returns The numeric values of this {@linkcode Pokemon}'s stats as an array. */ getStats(bypassSummonData = true): number[] { - if (!bypassSummonData && this.summonData.stats) { - return this.summonData.stats; + if (!bypassSummonData) { + // Only grab summon data stats if nonzero + return this.summonData.stats.map((s, i) => s || this.stats[i]); } return this.stats; } /** * Retrieves the corresponding {@linkcode PermanentStat} of the {@linkcode Pokemon}. - * @param stat the desired {@linkcode PermanentStat} - * @param bypassSummonData prefer actual stats (`true` by default) or in-battle overridden stats (`false`) - * @returns the numeric value of the desired {@linkcode Stat} + * @param stat - The {@linkcode PermanentStat} to retrieve + * @param bypassSummonData - Whether to prefer actual stats (`true`) or in-battle overridden stats (`false`); default `true` + * @returns The numeric value of the desired {@linkcode Stat}. */ getStat(stat: PermanentStat, bypassSummonData = true): number { - if (!bypassSummonData && this.summonData.stats[stat] !== 0) { - return this.summonData.stats[stat]; + if (!bypassSummonData) { + // 0 = no override + return this.summonData.stats[stat] || this.stats[stat]; } return this.stats[stat]; } /** - * Writes the value to the corrseponding {@linkcode PermanentStat} of the {@linkcode Pokemon}. - * - * Note that this does nothing if {@linkcode value} is less than 0. - * @param stat the desired {@linkcode PermanentStat} to be overwritten - * @param value the desired numeric value - * @param bypassSummonData write to actual stats (`true` by default) or in-battle overridden stats (`false`) + * Change one of this {@linkcode Pokemon}'s {@linkcode PermanentStat}s to the specified value. + * @param stat - The {@linkcode PermanentStat} to be overwritten + * @param value - The stat value to set. Ignored if `<=0` + * @param bypassSummonData - Whether to write to actual stats (`true`) or in-battle overridden stats (`false`); default `true` */ setStat(stat: PermanentStat, value: number, bypassSummonData = true): void { - if (value < 0) { + if (value <= 0) { return; } @@ -1309,31 +1343,25 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @returns the numeric values of the {@linkcode Pokemon}'s in-battle stat stages if available, a fresh stat stage array otherwise */ getStatStages(): number[] { - return this.summonData ? this.summonData.statStages : [0, 0, 0, 0, 0, 0, 0]; + return this.summonData.statStages; } /** - * Retrieves the in-battle stage of the specified {@linkcode BattleStat}. - * @param stat the {@linkcode BattleStat} whose stage is desired - * @returns the stage of the desired {@linkcode BattleStat} if available, 0 otherwise + * Retrieve the value of the given stat stage for this {@linkcode Pokemon}. + * @param stat - The {@linkcode BattleStat} to retrieve the stat stage for + * @returns The value of the desired stat stage as a number within the range `[-6, +6]`. */ getStatStage(stat: BattleStat): number { - return this.summonData ? this.summonData.statStages[stat - 1] : 0; + return this.summonData.statStages[stat - 1]; } /** - * Writes the value to the in-battle stage of the corresponding {@linkcode BattleStat} of the {@linkcode Pokemon}. - * - * Note that, if the value is not within a range of [-6, 6], it will be forced to the closest range bound. - * @param stat the {@linkcode BattleStat} whose stage is to be overwritten - * @param value the desired numeric value + * Sets this {@linkcode Pokemon}'s in-battle stat stage to the corresponding value. + * @param stat - The {@linkcode BattleStat} whose stage is to be overwritten + * @param value - The value of the stat stage to set, forcibly clamped within the range `[-6, +6]`. */ setStatStage(stat: BattleStat, value: number): void { - if (value >= -6) { - this.summonData.statStages[stat - 1] = Math.min(value, 6); - } else { - this.summonData.statStages[stat - 1] = Math.max(value, -6); - } + this.summonData.statStages[stat - 1] = Phaser.Math.Clamp(value, -6, 6); } /** @@ -2493,41 +2521,50 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @returns A score value based on how favorable this Pokemon is when fighting the given Pokemon */ getMatchupScore(opponent: Pokemon): number { - const types = this.getTypes(true); - - const enemyTypes = opponent.getTypes(true, true, false, true); + const enemyTypes = opponent.getTypes(true, false, false, true); /** Is this Pokemon faster than the opponent? */ const outspeed = (this.isActive(true) ? this.getEffectiveStat(Stat.SPD, opponent) : this.getStat(Stat.SPD, false)) >= opponent.getEffectiveStat(Stat.SPD, this); - /** - * Based on how effective this Pokemon's types are offensively against the opponent's types. - * This score is increased by 25 percent if this Pokemon is faster than the opponent. - */ - let atkScore = - opponent.getAttackTypeEffectiveness(types[0], this, false, true, undefined, true) * (outspeed ? 1.25 : 1); + /** * Based on how effectively this Pokemon defends against the opponent's types. * This score cannot be higher than 4. */ let defScore = 1 / Math.max(this.getAttackTypeEffectiveness(enemyTypes[0], opponent), 0.25); - if (types.length > 1) { - atkScore *= opponent.getAttackTypeEffectiveness(types[1], this); - } if (enemyTypes.length > 1) { defScore *= 1 / Math.max(this.getAttackTypeEffectiveness(enemyTypes[1], opponent, false, false, undefined, true), 0.25); } - atkScore *= 1.25; //give more value for the pokemon's typing + const moveset = this.moveset; let moveAtkScoreLength = 0; + let atkScore = 0; + // TODO: this calculation needs to consider more factors; it's currently very simplistic for (const move of moveset) { - if (move.getMove().category === MoveCategory.SPECIAL || move.getMove().category === MoveCategory.PHYSICAL) { - atkScore += opponent.getAttackTypeEffectiveness(move.getMove().type, this, false, true, undefined, true); - moveAtkScoreLength++; + const resolvedMove = move.getMove(); + // NOTE: Counter and Mirror Coat are considered as attack moves here + if (resolvedMove.category === MoveCategory.STATUS || move.getPpRatio() <= 0) { + continue; } + const moveType = resolvedMove.type; + let thisScore = opponent.getAttackTypeEffectiveness(moveType, this, false, true, undefined, true); + + // Add STAB multiplier for attack type effectiveness. + // For now, simply don't apply STAB to moves that may change type + if (this.getTypes(true).includes(moveType) && !move.getMove().hasAttr("VariableMoveTypeAttr")) { + thisScore *= 1.5; + } + + atkScore += thisScore; + moveAtkScoreLength++; } - atkScore = atkScore / (moveAtkScoreLength + 1); //calculate the median for the attack score + // Get average attack score of all damaging moves (|| 1 prevents division by zero)) + // TODO: Averaging the attack score is excessively simplistic, and doesn't reflect the AI's move selection logic + // e.g. if the mon has one 4x effective move and three 0.5x effective moves, this score would be ~1.375 + // which does not seem fair, given that if the AI were to switch, in all likelihood it would use the 4x move. + // We could consider a weighted average... + atkScore /= moveAtkScoreLength || 1; /** * Based on this Pokemon's HP ratio compared to that of the opponent. * This ratio is multiplied by 1.5 if this Pokemon outspeeds the opponent; @@ -2535,6 +2572,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { */ const hpRatio = this.getHpRatio(); const oppHpRatio = opponent.getHpRatio(); + // TODO: use better logic for predicting whether the pokemon "is dying" + // E.g., perhaps check if it would faint if the opponent were to use the same move it just used + // (twice if the user is slower) const isDying = hpRatio <= 0.2; let hpDiffRatio = hpRatio + (1 - oppHpRatio); if (isDying && this.isActive(true)) { @@ -2544,15 +2584,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { //It might not be a worthy sacrifice if it doesn't outspeed or doesn't do enough damage hpDiffRatio *= 0.85; } else { - hpDiffRatio = Math.min(1 - hpRatio + (outspeed ? 0.2 : 0.1), 1); + hpDiffRatio = 1 - hpRatio + (outspeed ? 0.2 : 0.1); } } else if (outspeed) { - hpDiffRatio = Math.min(hpDiffRatio * 1.25, 1); + hpDiffRatio = hpDiffRatio * 1.25; } else if (hpRatio > 0.2 && hpRatio <= 0.4) { - //Might be considered to be switched because it's not in low enough health - hpDiffRatio = Math.min(hpDiffRatio * 0.5, 1); + // Might be considered to be switched because it's not in low enough health + hpDiffRatio = hpDiffRatio * 0.5; } - return (atkScore + defScore) * hpDiffRatio; + return (atkScore + defScore) * Math.min(hpDiffRatio, 1); } getEvolution(): SpeciesFormEvolution | null { @@ -3337,16 +3377,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @param onField - whether to also check if the pokemon is currently on the field (defaults to true) */ getOpponents(onField = true): Pokemon[] { - return ((this.isPlayer() ? globalScene.getEnemyField() : globalScene.getPlayerField()) as Pokemon[]).filter(p => + return (this.isPlayer() ? globalScene.getEnemyField() : globalScene.getPlayerField()).filter(p => p.isActive(onField), ); } getOpponentDescriptor(): string { - const opponents = this.getOpponents(); - if (opponents.length === 1) { - return opponents[0].name; - } return this.isPlayer() ? i18next.t("arenaTag:opposingTeam") : i18next.t("arenaTag:yourTeam"); } @@ -4655,16 +4691,37 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { ); } - queueImmuneMessage(quiet: boolean, effect?: StatusEffect): void { - if (!effect || quiet) { + /** + * Display an immunity message for a failed status application. + * @param quiet - Whether to suppress message and return early + * @param reason - The reason for the status application failure - + * can be "overlap" (already has same status), "other" (generic fail message) + * or a {@linkcode TerrainType} for terrain-based blockages. + * Defaults to "other". + */ + queueStatusImmuneMessage( + quiet: boolean, + reason: "overlap" | "other" | Exclude = "other", + ): void { + if (quiet) { return; } - const message = - effect && this.status?.effect === effect - ? getStatusEffectOverlapText(effect ?? StatusEffect.NONE, getPokemonNameWithAffix(this)) - : i18next.t("abilityTriggers:moveImmunity", { - pokemonNameWithAffix: getPokemonNameWithAffix(this), - }); + + let message: string; + if (reason === "overlap") { + // "XYZ is already XXX!" + message = getStatusEffectOverlapText(this.status?.effect ?? StatusEffect.NONE, getPokemonNameWithAffix(this)); + } else if (typeof reason === "number") { + // "XYZ was protected by the XXX terrain!" / + // "XYZ surrounds itself with a protective mist!" + message = getTerrainBlockMessage(this, reason); + } else { + // "It doesn't affect XXX!" + message = i18next.t("abilityTriggers:moveImmunity", { + pokemonNameWithAffix: getPokemonNameWithAffix(this), + }); + } + globalScene.phaseManager.queueMessage(message); } @@ -4686,11 +4743,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { ): boolean { if (effect !== StatusEffect.FAINT) { if (overrideStatus ? this.status?.effect === effect : this.status) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet, overrideStatus ? "overlap" : "other"); // having different status displays generic fail message return false; } if (this.isGrounded() && !ignoreField && globalScene.arena.terrain?.terrainType === TerrainType.MISTY) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet, TerrainType.MISTY); return false; } } @@ -4727,7 +4784,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) { if (poisonImmunity.includes(true)) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet); return false; } } @@ -4735,13 +4792,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } case StatusEffect.PARALYSIS: if (this.isOfType(PokemonType.ELECTRIC)) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet); return false; } break; case StatusEffect.SLEEP: if (this.isGrounded() && globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet, TerrainType.ELECTRIC); return false; } break; @@ -4752,13 +4809,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { globalScene?.arena?.weather?.weatherType && [WeatherType.SUNNY, WeatherType.HARSH_SUN].includes(globalScene.arena.weather.weatherType)) ) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet); return false; } break; case StatusEffect.BURN: if (this.isOfType(PokemonType.FIRE)) { - this.queueImmuneMessage(quiet, effect); + this.queueStatusImmuneMessage(quiet); return false; } break; @@ -6791,241 +6848,3 @@ export class EnemyPokemon extends Pokemon { this.battleInfo.toggleFlyout(visible); } } - -/** - * Illusion property - */ -interface IllusionData { - basePokemon: { - /** The actual name of the Pokemon */ - name: string; - /** The actual nickname of the Pokemon */ - nickname: string; - /** Whether the base pokemon is shiny or not */ - shiny: boolean; - /** The shiny variant of the base pokemon */ - variant: Variant; - /** Whether the fusion species of the base pokemon is shiny or not */ - fusionShiny: boolean; - /** The variant of the fusion species of the base pokemon */ - fusionVariant: Variant; - }; - /** The species of the illusion */ - species: SpeciesId; - /** The formIndex of the illusion */ - formIndex: number; - /** The gender of the illusion */ - gender: Gender; - /** The pokeball of the illusion */ - pokeball: PokeballType; - /** The fusion species of the illusion if it's a fusion */ - fusionSpecies?: PokemonSpecies; - /** The fusionFormIndex of the illusion */ - fusionFormIndex?: number; - /** The fusionGender of the illusion if it's a fusion */ - fusionGender?: Gender; - /** The level of the illusion (not used currently) */ - level?: number; -} - -export interface TurnMove { - move: MoveId; - targets: BattlerIndex[]; - useMode: MoveUseMode; - result?: MoveResult; - turn?: number; -} - -export interface AttackMoveResult { - move: MoveId; - result: DamageResult; - damage: number; - critical: boolean; - sourceId: number; - sourceBattlerIndex: BattlerIndex; -} - -/** - * Persistent in-battle data for a {@linkcode Pokemon}. - * Resets on switch or new battle. - */ -export class PokemonSummonData { - /** [Atk, Def, SpAtk, SpDef, Spd, Acc, Eva] */ - public statStages: number[] = [0, 0, 0, 0, 0, 0, 0]; - /** - * A queue of moves yet to be executed, used by charging, recharging and frenzy moves. - * So long as this array is nonempty, this Pokemon's corresponding `CommandPhase` will be skipped over entirely - * in favor of using the queued move. - * TODO: Clean up a lot of the code surrounding the move queue. - */ - public moveQueue: TurnMove[] = []; - public tags: BattlerTag[] = []; - public abilitySuppressed = false; - - // Overrides for transform. - // TODO: Move these into a separate class & add rage fist hit count - public speciesForm: PokemonSpeciesForm | null = null; - public fusionSpeciesForm: PokemonSpeciesForm | null = null; - public ability: AbilityId | undefined; - public passiveAbility: AbilityId | undefined; - public gender: Gender | undefined; - public fusionGender: Gender | undefined; - public stats: number[] = [0, 0, 0, 0, 0, 0]; - public moveset: PokemonMove[] | null; - - // If not initialized this value will not be populated from save data. - public types: PokemonType[] = []; - public addedType: PokemonType | null = null; - - /** Data pertaining to this pokemon's illusion. */ - public illusion: IllusionData | null = null; - public illusionBroken = false; - - /** Array containing all berries eaten in the last turn; used by {@linkcode AbilityId.CUD_CHEW} */ - public berriesEatenLast: BerryType[] = []; - - /** - * An array of all moves this pokemon has used since entering the battle. - * Used for most moves and abilities that check prior move usage or copy already-used moves. - */ - public moveHistory: TurnMove[] = []; - - constructor(source?: PokemonSummonData | Partial) { - if (isNullOrUndefined(source)) { - return; - } - - // TODO: Rework this into an actual generic function for use elsewhere - for (const [key, value] of Object.entries(source)) { - if (isNullOrUndefined(value) && this.hasOwnProperty(key)) { - continue; - } - - if (key === "moveset") { - this.moveset = value?.map((m: any) => PokemonMove.loadMove(m)); - continue; - } - - if (key === "tags") { - // load battler tags - this.tags = value.map((t: BattlerTag) => loadBattlerTag(t)); - continue; - } - this[key] = value; - } - } -} - -// TODO: Merge this inside `summmonData` but exclude from save if/when a save data serializer is added -export class PokemonTempSummonData { - /** - * The number of turns this pokemon has spent without switching out. - * Only currently used for positioning the battle cursor. - */ - turnCount = 1; - - /** - * The number of turns this pokemon has spent in the active position since the start of the wave - * without switching out. - * Reset on switch and new wave, but not stored in `SummonData` to avoid being written to the save file. - - * Used to evaluate "first turn only" conditions such as - * {@linkcode MoveId.FAKE_OUT | Fake Out} and {@linkcode MoveId.FIRST_IMPRESSION | First Impression}). - */ - waveTurnCount = 1; -} - -/** - * Persistent data for a {@linkcode Pokemon}. - * Resets at the start of a new battle (but not on switch). - */ -export class PokemonBattleData { - /** Counter tracking direct hits this Pokemon has received during this battle; used for {@linkcode MoveId.RAGE_FIST} */ - public hitCount = 0; - /** Whether this Pokemon has eaten a berry this battle; used for {@linkcode MoveId.BELCH} */ - public hasEatenBerry = false; - /** Array containing all berries eaten and not yet recovered during this current battle; used by {@linkcode AbilityId.HARVEST} */ - public berriesEaten: BerryType[] = []; - - constructor(source?: PokemonBattleData | Partial) { - if (!isNullOrUndefined(source)) { - this.hitCount = source.hitCount ?? 0; - this.hasEatenBerry = source.hasEatenBerry ?? false; - this.berriesEaten = source.berriesEaten ?? []; - } - } -} - -/** - * Temporary data for a {@linkcode Pokemon}. - * Resets on new wave/battle start (but not on switch). - */ -export class PokemonWaveData { - /** Whether the pokemon has endured due to a {@linkcode BattlerTagType.ENDURE_TOKEN} */ - public endured = false; - /** - * A set of all the abilities this {@linkcode Pokemon} has used in this wave. - * Used to track once per battle conditions, as well as (hopefully) by the updated AI for move effectiveness. - */ - public abilitiesApplied: Set = new Set(); - /** Whether the pokemon's ability has been revealed or not */ - public abilityRevealed = false; -} - -/** - * Temporary data for a {@linkcode Pokemon}. - * Resets at the start of a new turn, as well as on switch. - */ -export class PokemonTurnData { - public acted = false; - /** How many times the current move should hit the target(s) */ - public hitCount = 0; - /** - * - `-1` = Calculate how many hits are left - * - `0` = Move is finished - */ - public hitsLeft = -1; - public totalDamageDealt = 0; - public singleHitDamageDealt = 0; - public damageTaken = 0; - public attacksReceived: AttackMoveResult[] = []; - public order: number; - public statStagesIncreased = false; - public statStagesDecreased = false; - public moveEffectiveness: TypeDamageMultiplier | null = null; - public combiningPledge?: MoveId; - public switchedInThisTurn = false; - public failedRunAway = false; - public joinedRound = false; - /** - * The amount of times this Pokemon has acted again and used a move in the current turn. - * Used to make sure multi-hits occur properly when the user is - * forced to act again in the same turn, and **must be incremented** by any effects that grant extra actions. - */ - public extraTurns = 0; - /** - * All berries eaten by this pokemon in this turn. - * Saved into {@linkcode PokemonSummonData | SummonData} by {@linkcode AbilityId.CUD_CHEW} on turn end. - * @see {@linkcode PokemonSummonData.berriesEatenLast} - */ - public berriesEaten: BerryType[] = []; -} - -export type DamageResult = - | HitResult.EFFECTIVE - | HitResult.SUPER_EFFECTIVE - | HitResult.NOT_VERY_EFFECTIVE - | HitResult.ONE_HIT_KO - | HitResult.CONFUSION - | HitResult.INDIRECT_KO - | HitResult.INDIRECT; - -/** Interface containing the results of a damage calculation for a given move */ -export interface DamageCalculationResult { - /** `true` if the move was cancelled (thus suppressing "No Effect" messages) */ - cancelled: boolean; - /** The effectiveness of the move */ - result: HitResult; - /** The damage dealt by the move */ - damage: number; -} diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 8ac896e2717..7186cc4e928 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -1,29 +1,31 @@ import { globalScene } from "#app/global-scene"; -import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import type { TrainerConfig } from "#app/data/trainers/trainer-config"; -import type { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { trainerPartyTemplates } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { TrainerPoolTier } from "#enums/trainer-pool-tier"; -import { TeraAIMode } from "#enums/tera-ai-mode"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { randSeedWeightedItem, randSeedItem, randSeedInt } from "#app/utils/common"; -import type { PersistentModifier } from "#app/modifier/modifier"; -import { ArenaTrapTag } from "#app/data/arena-tag"; +import { pokemonPrevolutions } from "#balance/pokemon-evolutions"; +import { signatureSpecies } from "#balance/signature-species"; +import { ArenaTrapTag } from "#data/arena-tag"; +import type { PokemonSpecies } from "#data/pokemon-species"; import { ArenaTagSide } from "#enums/arena-tag-side"; -import { getIsInitialized, initI18n } from "#app/plugins/i18n"; -import i18next from "i18next"; import { PartyMemberStrength } from "#enums/party-member-strength"; import { SpeciesId } from "#enums/species-id"; +import { TeraAIMode } from "#enums/tera-ai-mode"; +import { TrainerPoolTier } from "#enums/trainer-pool-tier"; +import { TrainerSlot } from "#enums/trainer-slot"; import { TrainerType } from "#enums/trainer-type"; -import { signatureSpecies } from "#app/data/balance/signature-species"; import { TrainerVariant } from "#enums/trainer-variant"; +import type { EnemyPokemon } from "#field/pokemon"; +import type { PersistentModifier } from "#modifiers/modifier"; +import { getIsInitialized, initI18n } from "#plugins/i18n"; +import type { TrainerConfig } from "#trainers/trainer-config"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { + TrainerPartyCompoundTemplate, + type TrainerPartyTemplate, + trainerPartyTemplates, +} from "#trainers/trainer-party-template"; +import { randSeedInt, randSeedItem, randSeedWeightedItem } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; -export default class Trainer extends Phaser.GameObjects.Container { +export class Trainer extends Phaser.GameObjects.Container { public config: TrainerConfig; public variant: TrainerVariant; public partyTemplateIndex: number; @@ -421,7 +423,8 @@ export default class Trainer extends Phaser.GameObjects.Container { // If useNewSpeciesPool is true, we need to generate a new species from the new species pool, otherwise we generate a random species let species = useNewSpeciesPool - ? getPokemonSpecies(newSpeciesPool[Math.floor(randSeedInt(newSpeciesPool.length))]) + ? // TODO: should this use `randSeedItem`? + getPokemonSpecies(newSpeciesPool[Math.floor(randSeedInt(newSpeciesPool.length))]) : template.isSameSpecies(index) && index > offset ? getPokemonSpecies( battle.enemyParty[offset].species.getTrainerSpeciesForLevel( @@ -619,6 +622,8 @@ export default class Trainer extends Phaser.GameObjects.Container { if (maxScorePartyMemberIndexes.length > 1) { let rand: number; + // TODO: should this use `randSeedItem`? + globalScene.executeWithSeedOffset( () => (rand = randSeedInt(maxScorePartyMemberIndexes.length)), globalScene.currentBattle.turn << 2, diff --git a/src/game-mode.ts b/src/game-mode.ts index da6ef62e33c..c5ab120e218 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -1,21 +1,21 @@ -import i18next from "i18next"; -import type { FixedBattleConfigs } from "./battle"; -import { classicFixedBattles, FixedBattleConfig } from "./battle"; -import type { Challenge } from "./data/challenge"; -import { allChallenges, applyChallenges, copyChallenge } from "./data/challenge"; -import { ChallengeType } from "#enums/challenge-type"; -import type PokemonSpecies from "./data/pokemon-species"; -import { allSpecies } from "#app/data/data-lists"; -import type { Arena } from "./field/arena"; -import Overrides from "#app/overrides"; -import { isNullOrUndefined, randSeedInt, randSeedItem } from "#app/utils/common"; -import { BiomeId } from "#enums/biome-id"; -import { SpeciesId } from "#enums/species-id"; -import { Challenges } from "./enums/challenges"; +import { FixedBattleConfig } from "#app/battle"; +import { CHALLENGE_MODE_MYSTERY_ENCOUNTER_WAVES, CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import { getDailyStartingBiome } from "./data/daily-run"; -import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES, CHALLENGE_MODE_MYSTERY_ENCOUNTER_WAVES } from "./constants"; +import Overrides from "#app/overrides"; +import type { Challenge } from "#data/challenge"; +import { allChallenges, applyChallenges, copyChallenge } from "#data/challenge"; +import { getDailyStartingBiome } from "#data/daily-run"; +import { allSpecies } from "#data/data-lists"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { BiomeId } from "#enums/biome-id"; +import { ChallengeType } from "#enums/challenge-type"; +import { Challenges } from "#enums/challenges"; import { GameModes } from "#enums/game-modes"; +import { SpeciesId } from "#enums/species-id"; +import type { Arena } from "#field/arena"; +import { classicFixedBattles, type FixedBattleConfigs } from "#trainers/fixed-battle-configs"; +import { isNullOrUndefined, randSeedInt, randSeedItem } from "#utils/common"; +import i18next from "i18next"; interface GameModeConfig { isClassic?: boolean; @@ -164,14 +164,14 @@ export class GameMode implements GameModeConfig { if (waveIndex % 10 !== 1 && waveIndex % 10) { /** * Do not check X1 floors since there's a bug that stops trainer sprites from appearing - * after a X0 full party heal + * after a X0 full party heal, this also allows for a smoother biome transition for general gameplay feel */ const trainerChance = arena.getTrainerChance(); let allowTrainerBattle = true; if (trainerChance) { const waveBase = Math.floor(waveIndex / 10) * 10; - // Stop generic trainers from spawning in within 3 waves of a trainer battle - for (let w = Math.max(waveIndex - 3, waveBase + 2); w <= Math.min(waveIndex + 3, waveBase + 9); w++) { + // Stop generic trainers from spawning in within 2 waves of a fixed trainer battle + for (let w = Math.max(waveIndex - 2, waveBase + 2); w <= Math.min(waveIndex + 2, waveBase + 9); w++) { if (w === waveIndex) { continue; } diff --git a/src/global-event-manager.ts b/src/global-event-manager.ts index 3df3d17b5e9..5b67b4a6cc6 100644 --- a/src/global-event-manager.ts +++ b/src/global-event-manager.ts @@ -1,3 +1,3 @@ -import { TimedEventManager } from "./timed-event-manager"; +import { TimedEventManager } from "#app/timed-event-manager"; export const timedEventManager = new TimedEventManager(); diff --git a/src/global-scene.ts b/src/global-scene.ts index 76071bd7fac..3cc5a904db7 100644 --- a/src/global-scene.ts +++ b/src/global-scene.ts @@ -1,4 +1,4 @@ -import type BattleScene from "#app/battle-scene"; +import type { BattleScene } from "#app/battle-scene"; export let globalScene: BattleScene; diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index 388802f467e..1607e4ee74f 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -1,23 +1,23 @@ -import Phaser from "phaser"; -import { getEnumValues } from "#app/utils/common"; -import { deepCopy } from "#app/utils/data"; -import pad_generic from "./configs/inputs/pad_generic"; -import pad_unlicensedSNES from "./configs/inputs/pad_unlicensedSNES"; -import pad_xbox360 from "./configs/inputs/pad_xbox360"; -import pad_dualshock from "./configs/inputs/pad_dualshock"; -import pad_procon from "./configs/inputs/pad_procon"; -import { UiMode } from "#enums/ui-mode"; -import type SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; -import type SettingsKeyboardUiHandler from "./ui/settings/settings-keyboard-ui-handler"; -import cfg_keyboard_qwerty from "./configs/inputs/cfg_keyboard_qwerty"; -import { assign, getButtonWithKeycode, getIconForLatestInput, swap } from "#app/configs/inputs/configHandler"; import { globalScene } from "#app/global-scene"; -import type { SettingGamepad } from "#app/system/settings/settings-gamepad"; -import type { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import TouchControl from "#app/touch-controls"; +import { TouchControl } from "#app/touch-controls"; import { Button } from "#enums/buttons"; import { Device } from "#enums/devices"; -import MoveTouchControlsHandler from "./ui/settings/move-touch-controls-handler"; +import { UiMode } from "#enums/ui-mode"; +import cfg_keyboard_qwerty from "#inputs/cfg_keyboard_qwerty"; +import { assign, getButtonWithKeycode, getIconForLatestInput, swap } from "#inputs/configHandler"; +import pad_dualshock from "#inputs/pad_dualshock"; +import pad_generic from "#inputs/pad_generic"; +import pad_procon from "#inputs/pad_procon"; +import pad_unlicensedSNES from "#inputs/pad_unlicensedSNES"; +import pad_xbox360 from "#inputs/pad_xbox360"; +import type { SettingGamepad } from "#system/settings-gamepad"; +import type { SettingKeyboard } from "#system/settings-keyboard"; +import { MoveTouchControlsHandler } from "#ui/move-touch-controls-handler"; +import type { SettingsGamepadUiHandler } from "#ui/settings-gamepad-ui-handler"; +import type { SettingsKeyboardUiHandler } from "#ui/settings-keyboard-ui-handler"; +import { deepCopy } from "#utils/data"; +import { getEnumValues } from "#utils/enums"; +import Phaser from "phaser"; export interface DeviceMapping { [key: string]: number; diff --git a/src/loading-scene.ts b/src/loading-scene.ts index f67d19e1027..eb6883e0c68 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -1,28 +1,29 @@ -import { GachaType } from "#enums/gacha-types"; -import { getBiomeHasProps } from "#app/field/arena"; -import CacheBustedLoaderPlugin from "#app/plugins/cache-busted-loader-plugin"; +import { initAbilities } from "#abilities/ability"; +import { timedEventManager } from "#app/global-event-manager"; import { SceneBase } from "#app/scene-base"; -import { WindowVariant, getWindowVariantSuffix } from "#app/ui/ui-theme"; import { isMobile } from "#app/touch-controls"; -import { localPing, getEnumValues, hasAllLocalizedSprites, getEnumKeys } from "#app/utils/common"; -import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions"; -import { initBiomes } from "#app/data/balance/biomes"; -import { initEggMoves } from "#app/data/balance/egg-moves"; -import { initPokemonForms } from "#app/data/pokemon-forms"; -import { initSpecies } from "#app/data/pokemon-species"; -import { initMoves } from "#app/data/moves/move"; -import { initAbilities } from "#app/data/abilities/ability"; -import { initAchievements } from "#app/system/achv"; -import { initTrainerTypeDialogue } from "#app/data/dialogue"; -import { initChallenges } from "#app/data/challenge"; -import i18next from "i18next"; -import { initStatsKeys } from "#app/ui/game-stats-ui-handler"; -import { initVouchers } from "#app/system/voucher"; +import { initBiomes } from "#balance/biomes"; +import { initEggMoves } from "#balance/egg-moves"; +import { initPokemonPrevolutions, initPokemonStarters } from "#balance/pokemon-evolutions"; +import { initChallenges } from "#data/challenge"; +import { initTrainerTypeDialogue } from "#data/dialogue"; +import { initPokemonForms } from "#data/pokemon-forms"; +import { initSpecies } from "#data/pokemon-species"; import { BiomeId } from "#enums/biome-id"; -import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters"; -import { timedEventManager } from "./global-event-manager"; -import { initModifierPools } from "./modifier/init-modifier-pools"; -import { initModifierTypes } from "./modifier/modifier-type"; +import { GachaType } from "#enums/gacha-types"; +import { getBiomeHasProps } from "#field/arena"; +import { initModifierPools } from "#modifiers/init-modifier-pools"; +import { initModifierTypes } from "#modifiers/modifier-type"; +import { initMoves } from "#moves/move"; +import { initMysteryEncounters } from "#mystery-encounters/mystery-encounters"; +import { CacheBustedLoaderPlugin } from "#plugins/cache-busted-loader-plugin"; +import { initAchievements } from "#system/achv"; +import { initVouchers } from "#system/voucher"; +import { initStatsKeys } from "#ui/game-stats-ui-handler"; +import { getWindowVariantSuffix, WindowVariant } from "#ui/ui-theme"; +import { hasAllLocalizedSprites, localPing } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import i18next from "i18next"; export class LoadingScene extends SceneBase { public static readonly KEY = "loading"; @@ -270,7 +271,7 @@ export class LoadingScene extends SceneBase { this.loadAtlas("egg_icons", "egg"); this.loadAtlas("egg_shard", "egg"); this.loadAtlas("egg_lightrays", "egg"); - for (const gt of getEnumKeys(GachaType)) { + for (const gt of Object.keys(GachaType)) { const key = gt.toLowerCase(); this.loadImage(`gacha_${key}`, "egg"); this.loadAtlas(`gacha_underlay_${key}`, "egg"); diff --git a/src/main.ts b/src/main.ts index 38bfcbe5636..6c0fcacd521 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,11 +1,11 @@ +import { InvertPostFX } from "#app/pipelines/invert"; +import { initI18n } from "#app/plugins/i18n"; +import { version } from "#package.json"; import Phaser from "phaser"; -import InvertPostFX from "./pipelines/invert"; -import { version } from "../package.json"; -import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; import BBCodeTextPlugin from "phaser3-rex-plugins/plugins/bbcodetext-plugin"; import InputTextPlugin from "phaser3-rex-plugins/plugins/inputtext-plugin"; import TransitionImagePackPlugin from "phaser3-rex-plugins/templates/transitionimagepack/transitionimagepack-plugin"; -import { initI18n } from "./plugins/i18n"; +import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; // Catch global errors and display them in an alert so users can report the issue. window.onerror = (_message, _source, _lineno, _colno, error) => { @@ -46,7 +46,7 @@ let game; const startGame = async (manifest?: any) => { await initI18n(); const LoadingScene = (await import("./loading-scene")).LoadingScene; - const BattleScene = (await import("./battle-scene")).default; + const BattleScene = (await import("./battle-scene")).BattleScene; game = new Phaser.Game({ type: Phaser.WEBGL, parent: "app", diff --git a/src/messages.ts b/src/messages.ts index 21473eb8361..177b4cc9b05 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; import { BattleSpec } from "#enums/battle-spec"; -import type Pokemon from "./field/pokemon"; +import type { Pokemon } from "#field/pokemon"; import i18next from "i18next"; /** diff --git a/src/modifier/init-modifier-pools.ts b/src/modifier/init-modifier-pools.ts index 60697333600..316d4dae741 100644 --- a/src/modifier/init-modifier-pools.ts +++ b/src/modifier/init-modifier-pools.ts @@ -1,31 +1,37 @@ -import type Pokemon from "#app/field/pokemon"; +/* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */ +import type { initModifierTypes } from "#modifiers/modifier-type"; +/* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */ + +import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { pokemonEvolutions } from "#balance/pokemon-evolutions"; +import { modifierTypes } from "#data/data-lists"; +import { MAX_PER_TYPE_POKEBALLS } from "#data/pokeball"; +import { AbilityId } from "#enums/ability-id"; +import { BerryType } from "#enums/berry-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { Unlockables } from "#enums/unlockables"; +import type { Pokemon } from "#field/pokemon"; +import { + BerryModifier, + DoubleBattleChanceBoosterModifier, + SpeciesCritBoosterModifier, + TurnStatusEffectModifier, +} from "#modifiers/modifier"; import { dailyStarterModifierPool, enemyBuffModifierPool, modifierPool, trainerModifierPool, wildModifierPool, -} from "#app/modifier/modifier-pools"; -import { globalScene } from "#app/global-scene"; -import { DoubleBattleChanceBoosterModifier, SpeciesCritBoosterModifier, TurnStatusEffectModifier } from "./modifier"; -import { WeightedModifierType } from "./modifier-type"; -import { ModifierTier } from "../enums/modifier-tier"; -import type { WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types"; -import { modifierTypes } from "#app/data/data-lists"; -import { PokeballType } from "#enums/pokeball"; -import { BerryModifier } from "./modifier"; -import { BerryType } from "#enums/berry-type"; -import { SpeciesId } from "#enums/species-id"; -import { timedEventManager } from "#app/global-event-manager"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { Unlockables } from "#enums/unlockables"; -import { isNullOrUndefined } from "#app/utils/common"; -import { MoveId } from "#enums/move-id"; -import { StatusEffect } from "#enums/status-effect"; -import { AbilityId } from "#enums/ability-id"; -import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball"; -// biome-ignore lint/correctness/noUnusedImports: This is used in a tsdoc comment -import type { initModifierTypes } from "./modifier-type"; +} from "#modifiers/modifier-pools"; +import { WeightedModifierType } from "#modifiers/modifier-type"; +import type { WeightedModifierTypeWeightFunc } from "#types/modifier-types"; +import { isNullOrUndefined } from "#utils/common"; /** * Initialize the wild modifier pool diff --git a/src/modifier/modifier-pools.ts b/src/modifier/modifier-pools.ts index 3396dca1f93..d66511e3239 100644 --- a/src/modifier/modifier-pools.ts +++ b/src/modifier/modifier-pools.ts @@ -1,9 +1,9 @@ -/** +/* * Contains modifier pools for different contexts in the game. * Can be safely imported without worrying about circular dependencies. */ -import type { ModifierPool } from "#app/@types/modifier-types"; +import type { ModifierPool } from "#types/modifier-types"; export const modifierPool: ModifierPool = {}; diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index fcbe6b66a4e..b359ec756e6 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,19 +1,32 @@ +import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants"; +import { timedEventManager } from "#app/global-event-manager"; import { globalScene } from "#app/global-scene"; -import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { tmPoolTiers, tmSpecies } from "#app/data/balance/tms"; -import { getBerryEffectDescription, getBerryName } from "#app/data/berry"; -import { allMoves, modifierTypes } from "#app/data/data-lists"; -import { getNatureName, getNatureStatMultiplier } from "#app/data/nature"; -import { getPokeballCatchMultiplier, getPokeballName } from "#app/data/pokeball"; -import { pokemonFormChanges, SpeciesFormChangeCondition } from "#app/data/pokemon-forms"; -import { SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { FormChangeItem } from "#enums/form-change-item"; -import { getStatusEffectDescriptor } from "#app/data/status-effect"; -import { PokemonType } from "#enums/pokemon-type"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; +import Overrides from "#app/overrides"; +import { EvolutionItem, pokemonEvolutions } from "#balance/pokemon-evolutions"; +import { tmPoolTiers, tmSpecies } from "#balance/tms"; +import { getBerryEffectDescription, getBerryName } from "#data/berry"; +import { allMoves, modifierTypes } from "#data/data-lists"; +import { SpeciesFormChangeItemTrigger } from "#data/form-change-triggers"; +import { getNatureName, getNatureStatMultiplier } from "#data/nature"; +import { getPokeballCatchMultiplier, getPokeballName } from "#data/pokeball"; +import { pokemonFormChanges, SpeciesFormChangeCondition } from "#data/pokemon-forms"; +import { getStatusEffectDescriptor } from "#data/status-effect"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; +import { FormChangeItem } from "#enums/form-change-item"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { Nature } from "#enums/nature"; +import { PokeballType } from "#enums/pokeball"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesFormKey } from "#enums/species-form-key"; +import { SpeciesId } from "#enums/species-id"; +import type { PermanentStat, TempBattleStat } from "#enums/stat"; +import { getStatKey, Stat, TEMP_BATTLE_STATS } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import type { EnemyPokemon, PlayerPokemon, Pokemon } from "#field/pokemon"; import { AddPokeballModifier, AddVoucherModifier, @@ -24,6 +37,7 @@ import { BypassSpeedChanceModifier, ContactHeldItemTransferChanceModifier, CritBoosterModifier, + CriticalCatchChanceBoosterModifier, DamageMoneyRewardModifier, DoubleBattleChanceBoosterModifier, EnemyAttackStatusEffectChanceModifier, @@ -31,6 +45,7 @@ import { EnemyDamageReducerModifier, EnemyEndureChanceModifier, EnemyFusionChanceModifier, + type EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, EvolutionItemModifier, @@ -40,6 +55,7 @@ import { ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, + FieldEffectModifier, FlinchChanceModifier, FusePokemonModifier, GigantamaxAccessModifier, @@ -52,10 +68,12 @@ import { LockModifierTiersModifier, MapModifier, MegaEvolutionAccessModifier, + type Modifier, MoneyInterestModifier, MoneyMultiplierModifier, MoneyRewardModifier, MultipleParticipantExpBonusModifier, + type PersistentModifier, PokemonAllMovePpRestoreModifier, PokemonBaseStatFlatModifier, PokemonBaseStatTotalModifier, @@ -83,6 +101,7 @@ import { SurviveDamageModifier, SwitchEffectTransferModifier, TempCritBoosterModifier, + TempExtraModifierModifier, TempStatStageBoosterModifier, TerastallizeAccessModifier, TerrastalizeModifier, @@ -90,44 +109,17 @@ import { TurnHealModifier, TurnHeldItemTransferModifier, TurnStatusEffectModifier, - type EnemyPersistentModifier, - type Modifier, - type PersistentModifier, - TempExtraModifierModifier, - CriticalCatchChanceBoosterModifier, - FieldEffectModifier, -} from "#app/modifier/modifier"; -import { ModifierTier } from "#enums/modifier-tier"; -import Overrides from "#app/overrides"; -import { getVoucherTypeIcon, getVoucherTypeName, VoucherType } from "#app/system/voucher"; -import type { PokemonMoveSelectFilter, PokemonSelectFilter } from "#app/ui/party-ui-handler"; -import PartyUiHandler from "#app/ui/party-ui-handler"; -import { getModifierTierTextTint } from "#app/ui/text"; -import { - formatMoney, - getEnumKeys, - getEnumValues, - isNullOrUndefined, - NumberHolder, - padInt, - randSeedInt, -} from "#app/utils/common"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { BerryType } from "#enums/berry-type"; -import { MoveId } from "#enums/move-id"; -import { Nature } from "#enums/nature"; -import { PokeballType } from "#enums/pokeball"; -import { SpeciesId } from "#enums/species-id"; -import { SpeciesFormKey } from "#enums/species-form-key"; -import type { PermanentStat, TempBattleStat } from "#enums/stat"; -import { getStatKey, Stat, TEMP_BATTLE_STATS } from "#enums/stat"; -import { StatusEffect } from "#enums/status-effect"; +} from "#modifiers/modifier"; +import type { PokemonMove } from "#moves/pokemon-move"; +import { getVoucherTypeIcon, getVoucherTypeName, VoucherType } from "#system/voucher"; +import type { ModifierTypeFunc, WeightedModifierTypeWeightFunc } from "#types/modifier-types"; +import type { PokemonMoveSelectFilter, PokemonSelectFilter } from "#ui/party-ui-handler"; +import { PartyUiHandler } from "#ui/party-ui-handler"; +import { getModifierTierTextTint } from "#ui/text"; +import { formatMoney, isNullOrUndefined, NumberHolder, padInt, randSeedInt, randSeedItem } from "#utils/common"; +import { getEnumKeys, getEnumValues } from "#utils/enums"; +import { getModifierPoolForType, getModifierType } from "#utils/modifier-utils"; import i18next from "i18next"; -import { timedEventManager } from "#app/global-event-manager"; -import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { getModifierPoolForType, getModifierType } from "#app/utils/modifier-utils"; -import type { ModifierTypeFunc, WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types"; const outputModifierData = false; const useMaxWeightForOutput = false; @@ -967,31 +959,23 @@ export class PokemonBaseStatTotalModifierType extends PokemonHeldItemModifierType implements GeneratedPersistentModifierType { - private readonly statModifier: number; + private readonly statModifier: 10 | -15; - constructor(statModifier: number) { + constructor(statModifier: 10 | -15) { super( - "modifierType:ModifierType.MYSTERY_ENCOUNTER_SHUCKLE_JUICE", - "berry_juice", - (_type, args) => new PokemonBaseStatTotalModifier(this, (args[0] as Pokemon).id, this.statModifier), + statModifier > 0 + ? "modifierType:ModifierType.MYSTERY_ENCOUNTER_SHUCKLE_JUICE_GOOD" + : "modifierType:ModifierType.MYSTERY_ENCOUNTER_SHUCKLE_JUICE_BAD", + statModifier > 0 ? "berry_juice_good" : "berry_juice_bad", + (_type, args) => new PokemonBaseStatTotalModifier(this, (args[0] as Pokemon).id, statModifier), ); this.statModifier = statModifier; } override getDescription(): string { - return i18next.t("modifierType:ModifierType.PokemonBaseStatTotalModifierType.description", { - increaseDecrease: i18next.t( - this.statModifier >= 0 - ? "modifierType:ModifierType.PokemonBaseStatTotalModifierType.extra.increase" - : "modifierType:ModifierType.PokemonBaseStatTotalModifierType.extra.decrease", - ), - blessCurse: i18next.t( - this.statModifier >= 0 - ? "modifierType:ModifierType.PokemonBaseStatTotalModifierType.extra.blessed" - : "modifierType:ModifierType.PokemonBaseStatTotalModifierType.extra.cursed", - ), - statValue: this.statModifier, - }); + return this.statModifier > 0 + ? i18next.t("modifierType:ModifierType.MYSTERY_ENCOUNTER_SHUCKLE_JUICE_GOOD.description") + : i18next.t("modifierType:ModifierType.MYSTERY_ENCOUNTER_SHUCKLE_JUICE_BAD.description"); } public getPregenArgs(): any[] { @@ -999,38 +983,6 @@ export class PokemonBaseStatTotalModifierType } } -/** - * Old Gateau item - */ -export class PokemonBaseStatFlatModifierType - extends PokemonHeldItemModifierType - implements GeneratedPersistentModifierType -{ - private readonly statModifier: number; - private readonly stats: Stat[]; - - constructor(statModifier: number, stats: Stat[]) { - super( - "modifierType:ModifierType.MYSTERY_ENCOUNTER_OLD_GATEAU", - "old_gateau", - (_type, args) => new PokemonBaseStatFlatModifier(this, (args[0] as Pokemon).id, this.statModifier, this.stats), - ); - this.statModifier = statModifier; - this.stats = stats; - } - - override getDescription(): string { - return i18next.t("modifierType:ModifierType.PokemonBaseStatFlatModifierType.description", { - stats: this.stats.map(stat => i18next.t(getStatKey(stat))).join("/"), - statValue: this.statModifier, - }); - } - - public getPregenArgs(): any[] { - return [this.statModifier, this.stats]; - } -} - class AllPokemonFullHpRestoreModifierType extends ModifierType { private descriptionKey: string; @@ -1565,6 +1517,7 @@ class TmModifierTypeGenerator extends ModifierTypeGenerator { if (!tierUniqueCompatibleTms.length) { return null; } + // TODO: should this use `randSeedItem`? const randTmIndex = randSeedInt(tierUniqueCompatibleTms.length); return new TmModifierType(tierUniqueCompatibleTms[randTmIndex]); }); @@ -1618,6 +1571,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { return null; } + // TODO: should this use `randSeedItem`? return new EvolutionItemModifierType(evolutionItemPool[randSeedInt(evolutionItemPool.length)]!); // TODO: is the bang correct? }); } @@ -1703,6 +1657,7 @@ export class FormChangeItemModifierTypeGenerator extends ModifierTypeGenerator { return null; } + // TODO: should this use `randSeedItem`? return new FormChangeItemModifierType(formChangeItemPool[randSeedInt(formChangeItemPool.length)]); }); } @@ -1973,7 +1928,7 @@ const modifierTypeInitObj = Object.freeze({ if (pregenArgs && pregenArgs.length === 1 && pregenArgs[0] in Nature) { return new PokemonNatureChangeModifierType(pregenArgs[0] as Nature); } - return new PokemonNatureChangeModifierType(randSeedInt(getEnumValues(Nature).length) as Nature); + return new PokemonNatureChangeModifierType(randSeedItem(getEnumValues(Nature))); }), MYSTICAL_ROCK: () => @@ -2331,17 +2286,16 @@ const modifierTypeInitObj = Object.freeze({ MYSTERY_ENCOUNTER_SHUCKLE_JUICE: () => new ModifierTypeGenerator((_party: Pokemon[], pregenArgs?: any[]) => { if (pregenArgs) { - return new PokemonBaseStatTotalModifierType(pregenArgs[0] as number); + return new PokemonBaseStatTotalModifierType(pregenArgs[0] as 10 | -15); } - return new PokemonBaseStatTotalModifierType(randSeedInt(20, 1)); + return new PokemonBaseStatTotalModifierType(10); }), MYSTERY_ENCOUNTER_OLD_GATEAU: () => - new ModifierTypeGenerator((_party: Pokemon[], pregenArgs?: any[]) => { - if (pregenArgs) { - return new PokemonBaseStatFlatModifierType(pregenArgs[0] as number, pregenArgs[1] as Stat[]); - } - return new PokemonBaseStatFlatModifierType(randSeedInt(20, 1), [Stat.HP, Stat.ATK, Stat.DEF]); - }), + new PokemonHeldItemModifierType( + "modifierType:ModifierType.MYSTERY_ENCOUNTER_OLD_GATEAU", + "old_gateau", + (type, args) => new PokemonBaseStatFlatModifier(type, (args[0] as Pokemon).id), + ), MYSTERY_ENCOUNTER_BLACK_SLUDGE: () => new ModifierTypeGenerator((_party: Pokemon[], pregenArgs?: any[]) => { if (pregenArgs) { @@ -2498,12 +2452,31 @@ export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: Mod } export interface CustomModifierSettings { + /** If specified, will override the next X items to be the specified tier. These can upgrade with luck. */ guaranteedModifierTiers?: ModifierTier[]; + /** If specified, will override the first X items to be specific modifier options (these should be pre-genned). */ guaranteedModifierTypeOptions?: ModifierTypeOption[]; + /** If specified, will override the next X items to be auto-generated from specific modifier functions (these don't have to be pre-genned). */ guaranteedModifierTypeFuncs?: ModifierTypeFunc[]; + /** + * If set to `true`, will fill the remainder of shop items that were not overridden by the 3 options above, up to the `count` param value. + * @example + * ```ts + * count = 4; + * customModifierSettings = { guaranteedModifierTiers: [ModifierTier.GREAT], fillRemaining: true }; + * ``` + * The first item in the shop will be `GREAT` tier, and the remaining `3` items will be generated normally. + * + * If `fillRemaining: false` in the same scenario, only 1 `GREAT` tier item will appear in the shop (regardless of the value of `count`). + * @defaultValue `false` + */ fillRemaining?: boolean; - /** Set to negative value to disable rerolls completely in shop */ + /** If specified, can adjust the amount of money required for a shop reroll. If set to a negative value, the shop will not allow rerolls at all. */ rerollMultiplier?: number; + /** + * If `false`, will prevent set item tiers from upgrading via luck. + * @defaultValue `true` + */ allowLuckUpgrades?: boolean; } @@ -2513,19 +2486,10 @@ export function getModifierTypeFuncById(id: string): ModifierTypeFunc { /** * Generates modifier options for a {@linkcode SelectModifierPhase} - * @param count Determines the number of items to generate - * @param party Party is required for generating proper modifier pools - * @param modifierTiers (Optional) If specified, rolls items in the specified tiers. Commonly used for tier-locking with Lock Capsule. - * @param customModifierSettings (Optional) If specified, can customize the item shop rewards further. - * - `guaranteedModifierTypeOptions?: ModifierTypeOption[]` If specified, will override the first X items to be specific modifier options (these should be pre-genned). - * - `guaranteedModifierTypeFuncs?: ModifierTypeFunc[]` If specified, will override the next X items to be auto-generated from specific modifier functions (these don't have to be pre-genned). - * - `guaranteedModifierTiers?: ModifierTier[]` If specified, will override the next X items to be the specified tier. These can upgrade with luck. - * - `fillRemaining?: boolean` Default 'false'. If set to true, will fill the remainder of shop items that were not overridden by the 3 options above, up to the 'count' param value. - * - Example: `count = 4`, `customModifierSettings = { guaranteedModifierTiers: [ModifierTier.GREAT], fillRemaining: true }`, - * - The first item in the shop will be `GREAT` tier, and the remaining 3 items will be generated normally. - * - If `fillRemaining = false` in the same scenario, only 1 `GREAT` tier item will appear in the shop (regardless of `count` value). - * - `rerollMultiplier?: number` If specified, can adjust the amount of money required for a shop reroll. If set to a negative value, the shop will not allow rerolls at all. - * - `allowLuckUpgrades?: boolean` Default `true`, if `false` will prevent set item tiers from upgrading via luck + * @param count - Determines the number of items to generate + * @param party - Party is required for generating proper modifier pools + * @param modifierTiers - (Optional) If specified, rolls items in the specified tiers. Commonly used for tier-locking with Lock Capsule. + * @param customModifierSettings - See {@linkcode CustomModifierSettings} */ export function getPlayerModifierTypeOptions( count: number, @@ -2536,16 +2500,10 @@ export function getPlayerModifierTypeOptions( const options: ModifierTypeOption[] = []; const retryCount = Math.min(count * 5, 50); if (!customModifierSettings) { - new Array(count).fill(0).map((_, i) => { - options.push( - getModifierTypeOptionWithRetry( - options, - retryCount, - party, - modifierTiers && modifierTiers.length > i ? modifierTiers[i] : undefined, - ), - ); - }); + for (let i = 0; i < count; i++) { + const tier = modifierTiers && modifierTiers.length > i ? modifierTiers[i] : undefined; + options.push(getModifierTypeOptionWithRetry(options, retryCount, party, tier)); + } } else { // Guaranteed mod options first if ( diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 247b64ca2c0..79bd849e5ba 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1,30 +1,29 @@ -import { FusionSpeciesFormEvolution, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { getBerryEffectFunc, getBerryPredicate } from "#app/data/berry"; -import { getLevelTotalExp } from "#app/data/exp"; -import { allMoves, modifierTypes } from "#app/data/data-lists"; -import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball"; -import { SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import type { FormChangeItem } from "#enums/form-change-item"; -import { getStatusEffectHealText } from "#app/data/status-effect"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import { globalScene } from "#app/global-scene"; import { getPokemonNameWithAffix } from "#app/messages"; import Overrides from "#app/overrides"; -import { LearnMoveType } from "#enums/learn-move-type"; -import type { VoucherType } from "#app/system/voucher"; -import { Command } from "#enums/command"; -import { addTextObject, TextStyle } from "#app/ui/text"; -import { BooleanHolder, hslToHex, isNullOrUndefined, NumberHolder, randSeedFloat, toDmgValue } from "#app/utils/common"; +import { FusionSpeciesFormEvolution, pokemonEvolutions } from "#balance/pokemon-evolutions"; +import { FRIENDSHIP_GAIN_FROM_RARE_CANDY } from "#balance/starters"; +import { getBerryEffectFunc, getBerryPredicate } from "#data/berry"; +import { allMoves, modifierTypes } from "#data/data-lists"; +import { getLevelTotalExp } from "#data/exp"; +import { SpeciesFormChangeItemTrigger } from "#data/form-change-triggers"; +import { MAX_PER_TYPE_POKEBALLS } from "#data/pokeball"; +import { getStatusEffectHealText } from "#data/status-effect"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; +import { Color, ShadowColor } from "#enums/color"; +import { Command } from "#enums/command"; +import type { FormChangeItem } from "#enums/form-change-item"; +import { LearnMoveType } from "#enums/learn-move-type"; import type { MoveId } from "#enums/move-id"; import type { Nature } from "#enums/nature"; import type { PokeballType } from "#enums/pokeball"; -import { SpeciesId } from "#enums/species-id"; -import { type PermanentStat, type TempBattleStat, BATTLE_STATS, Stat, TEMP_BATTLE_STATS } from "#enums/stat"; -import { StatusEffect } from "#enums/status-effect"; import type { PokemonType } from "#enums/pokemon-type"; -import i18next from "i18next"; +import { SpeciesId } from "#enums/species-id"; +import { BATTLE_STATS, type PermanentStat, Stat, TEMP_BATTLE_STATS, type TempBattleStat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; import type { DoubleBattleChanceBoosterModifierType, EvolutionItemModifierType, @@ -38,13 +37,13 @@ import type { PokemonMultiHitModifierType, TerastallizeModifierType, TmModifierType, -} from "./modifier-type"; -import { getModifierType } from "#app/utils/modifier-utils"; -import { Color, ShadowColor } from "#enums/color"; -import { FRIENDSHIP_GAIN_FROM_RARE_CANDY } from "#app/data/balance/starters"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { globalScene } from "#app/global-scene"; -import type { ModifierInstanceMap, ModifierString } from "#app/@types/modifier-types"; +} from "#modifiers/modifier-type"; +import type { VoucherType } from "#system/voucher"; +import type { ModifierInstanceMap, ModifierString } from "#types/modifier-types"; +import { addTextObject, TextStyle } from "#ui/text"; +import { BooleanHolder, hslToHex, isNullOrUndefined, NumberHolder, randSeedFloat, toDmgValue } from "#utils/common"; +import { getModifierType } from "#utils/modifier-utils"; +import i18next from "i18next"; export type ModifierPredicate = (modifier: Modifier) => boolean; @@ -952,10 +951,9 @@ export class EvoTrackerModifier extends PokemonHeldItemModifier { export class PokemonBaseStatTotalModifier extends PokemonHeldItemModifier { public override type: PokemonBaseStatTotalModifierType; public isTransferable = false; + public statModifier: 10 | -15; - private statModifier: number; - - constructor(type: PokemonBaseStatTotalModifierType, pokemonId: number, statModifier: number, stackCount?: number) { + constructor(type: PokemonBaseStatTotalModifierType, pokemonId: number, statModifier: 10 | -15, stackCount?: number) { super(type, pokemonId, stackCount); this.statModifier = statModifier; } @@ -1012,31 +1010,14 @@ export class PokemonBaseStatTotalModifier extends PokemonHeldItemModifier { * Currently used by Old Gateau item */ export class PokemonBaseStatFlatModifier extends PokemonHeldItemModifier { - private statModifier: number; - private stats: Stat[]; public isTransferable = false; - constructor(type: ModifierType, pokemonId: number, statModifier: number, stats: Stat[], stackCount?: number) { - super(type, pokemonId, stackCount); - - this.statModifier = statModifier; - this.stats = stats; - } - override matchType(modifier: Modifier): boolean { - return ( - modifier instanceof PokemonBaseStatFlatModifier && - modifier.statModifier === this.statModifier && - this.stats.every(s => modifier.stats.some(stat => s === stat)) - ); + return modifier instanceof PokemonBaseStatFlatModifier; } override clone(): PersistentModifier { - return new PokemonBaseStatFlatModifier(this.type, this.pokemonId, this.statModifier, this.stats, this.stackCount); - } - - override getArgs(): any[] { - return [...super.getArgs(), this.statModifier, this.stats]; + return new PokemonBaseStatFlatModifier(this.type, this.pokemonId, this.stackCount); } /** @@ -1055,11 +1036,13 @@ export class PokemonBaseStatFlatModifier extends PokemonHeldItemModifier { * @param baseStats The base stats of the {@linkcode Pokemon} * @returns always `true` */ - override apply(_pokemon: Pokemon, baseStats: number[]): boolean { + override apply(pokemon: Pokemon, baseStats: number[]): boolean { // Modifies the passed in baseStats[] array by a flat value, only if the stat is specified in this.stats + const stats = this.getStats(pokemon); + const statModifier = 20; baseStats.forEach((v, i) => { - if (this.stats.includes(i)) { - const newVal = Math.floor(v + this.statModifier); + if (stats.includes(i)) { + const newVal = Math.floor(v + statModifier); baseStats[i] = Math.min(Math.max(newVal, 1), 999999); } }); @@ -1067,6 +1050,22 @@ export class PokemonBaseStatFlatModifier extends PokemonHeldItemModifier { return true; } + /** + * Get the lowest of HP/Spd, lowest of Atk/SpAtk, and lowest of Def/SpDef + * @returns Array of 3 {@linkcode Stat}s to boost + */ + getStats(pokemon: Pokemon): Stat[] { + const stats: Stat[] = []; + const baseStats = pokemon.getSpeciesForm().baseStats.slice(0); + // HP or Speed + stats.push(baseStats[Stat.HP] < baseStats[Stat.SPD] ? Stat.HP : Stat.SPD); + // Attack or SpAtk + stats.push(baseStats[Stat.ATK] < baseStats[Stat.SPATK] ? Stat.ATK : Stat.SPATK); + // Def or SpDef + stats.push(baseStats[Stat.DEF] < baseStats[Stat.SPDEF] ? Stat.DEF : Stat.SPDEF); + return stats; + } + override getScoreMultiplier(): number { return 1.1; } diff --git a/src/overrides.ts b/src/overrides.ts index b390b9fa70f..de0d1d3f30a 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -1,18 +1,16 @@ import { type PokeballCounts } from "#app/battle-scene"; -import { EvolutionItem } from "#app/data/balance/pokemon-evolutions"; -import { Gender } from "#app/data/gender"; -import { FormChangeItem } from "#enums/form-change-item"; -import { type ModifierOverride } from "#app/modifier/modifier-type"; -import { Variant } from "#app/sprites/variant"; -import { Unlockables } from "#enums/unlockables"; +import { EvolutionItem } from "#balance/pokemon-evolutions"; +import { Gender } from "#data/gender"; import { AbilityId } from "#enums/ability-id"; import { BattleType } from "#enums/battle-type"; import { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; import { EggTier } from "#enums/egg-type"; +import { FormChangeItem } from "#enums/form-change-item"; import { MoveId } from "#enums/move-id"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; import { PokeballType } from "#enums/pokeball"; import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; @@ -20,8 +18,11 @@ import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import { TimeOfDay } from "#enums/time-of-day"; import { TrainerType } from "#enums/trainer-type"; +import { Unlockables } from "#enums/unlockables"; import { VariantTier } from "#enums/variant-tier"; import { WeatherType } from "#enums/weather-type"; +import { type ModifierOverride } from "#modifiers/modifier-type"; +import { Variant } from "#sprites/variant"; /** * This comment block exists to prevent IDEs from automatically removing unused imports @@ -118,7 +119,13 @@ class DefaultOverrides { * or `false` to force it to never trigger. */ readonly CONFUSION_ACTIVATION_OVERRIDE: boolean | null = null; - + /** + * If non-null, will override random flee attempts to always or never succeed by forcing {@linkcode calculateEscapeChance} to return 100% or 0%. + * Set to `null` to disable. + * + * Is overridden if either player Pokemon has {@linkcode AbilityId.RUN_AWAY | Run Away}. + */ + readonly RUN_SUCCESS_OVERRIDE: boolean | null = null; // ---------------- // PLAYER OVERRIDES // ---------------- @@ -159,10 +166,20 @@ class DefaultOverrides { readonly MOVESET_OVERRIDE: MoveId | Array = []; readonly SHINY_OVERRIDE: boolean | null = null; readonly VARIANT_OVERRIDE: Variant | null = null; + /** + * Overrides the IVs of player pokemon. Values must never be outside the range `0` to `31`! + * - If set to a number between `0` and `31`, set all IVs of all player pokemon to that number. + * - If set to an array, set the IVs of all player pokemon to that array. Array length must be exactly `6`! + * - If set to `null`, disable the override. + */ + readonly IVS_OVERRIDE: number | number[] | null = null; + /** Override the nature of all player pokemon to the specified nature. Disabled if `null`. */ + readonly NATURE_OVERRIDE: Nature | null = null; // -------------------------- // OPPONENT / ENEMY OVERRIDES // -------------------------- + // TODO: rename `OPP_` to `ENEMY_` readonly OPP_SPECIES_OVERRIDE: SpeciesId | number = 0; /** * This will make all opponents fused Pokemon @@ -181,7 +198,15 @@ class DefaultOverrides { readonly OPP_MOVESET_OVERRIDE: MoveId | Array = []; readonly OPP_SHINY_OVERRIDE: boolean | null = null; readonly OPP_VARIANT_OVERRIDE: Variant | null = null; - readonly OPP_IVS_OVERRIDE: number | number[] = []; + /** + * Overrides the IVs of enemy pokemon. Values must never be outside the range `0` to `31`! + * - If set to a number between `0` and `31`, set all IVs of all enemy pokemon to that number. + * - If set to an array, set the IVs of all enemy pokemon to that array. Array length must be exactly `6`! + * - If set to `null`, disable the override. + */ + readonly ENEMY_IVS_OVERRIDE: number | number[] | null = null; + /** Override the nature of all enemy pokemon to the specified nature. Disabled if `null`. */ + readonly ENEMY_NATURE_OVERRIDE: Nature | null = null; readonly OPP_FORM_OVERRIDES: Partial> = {}; /** * Override to give the enemy Pokemon a given amount of health segments diff --git a/src/phase-manager.ts b/src/phase-manager.ts index a4256f110ef..7c1f2986593 100644 --- a/src/phase-manager.ts +++ b/src/phase-manager.ts @@ -1,104 +1,104 @@ -import type { Phase } from "#app/phase"; -import type { default as Pokemon } from "#app/field/pokemon"; -import type { PhaseMap, PhaseString } from "./@types/phase-types"; import { globalScene } from "#app/global-scene"; -import { ActivatePriorityQueuePhase } from "#app/phases/activate-priority-queue-phase"; -import { AddEnemyBuffModifierPhase } from "#app/phases/add-enemy-buff-modifier-phase"; -import { AttemptCapturePhase } from "#app/phases/attempt-capture-phase"; -import { AttemptRunPhase } from "#app/phases/attempt-run-phase"; -import { BattleEndPhase } from "#app/phases/battle-end-phase"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CheckStatusEffectPhase } from "#app/phases/check-status-effect-phase"; -import { CheckSwitchPhase } from "#app/phases/check-switch-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { CommonAnimPhase } from "#app/phases/common-anim-phase"; -import { coerceArray, type Constructor } from "#app/utils/common"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; +import type { Phase } from "#app/phase"; +import { type PhasePriorityQueue, PostSummonPhasePriorityQueue } from "#data/phase-priority-queue"; import type { DynamicPhaseType } from "#enums/dynamic-phase-type"; -import { EggHatchPhase } from "#app/phases/egg-hatch-phase"; -import { EggLapsePhase } from "#app/phases/egg-lapse-phase"; -import { EggSummaryPhase } from "#app/phases/egg-summary-phase"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { EndCardPhase } from "#app/phases/end-card-phase"; -import { EndEvolutionPhase } from "#app/phases/end-evolution-phase"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { EvolutionPhase } from "#app/phases/evolution-phase"; -import { ExpPhase } from "#app/phases/exp-phase"; -import { FaintPhase } from "#app/phases/faint-phase"; -import { FormChangePhase } from "#app/phases/form-change-phase"; -import { GameOverModifierRewardPhase } from "#app/phases/game-over-modifier-reward-phase"; -import { GameOverPhase } from "#app/phases/game-over-phase"; -import { HideAbilityPhase } from "#app/phases/hide-ability-phase"; -import { HidePartyExpBarPhase } from "#app/phases/hide-party-exp-bar-phase"; -import { LearnMovePhase } from "#app/phases/learn-move-phase"; -import { LevelCapPhase } from "#app/phases/level-cap-phase"; -import { LevelUpPhase } from "#app/phases/level-up-phase"; -import { LoadMoveAnimPhase } from "#app/phases/load-move-anim-phase"; -import { LoginPhase } from "#app/phases/login-phase"; -import { MessagePhase } from "#app/phases/message-phase"; -import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase"; -import { MoneyRewardPhase } from "#app/phases/money-reward-phase"; -import { MoveAnimPhase } from "#app/phases/move-anim-phase"; -import { MoveChargePhase } from "#app/phases/move-charge-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { MoveHeaderPhase } from "#app/phases/move-header-phase"; -import { MovePhase } from "#app/phases/move-phase"; +import type { Pokemon } from "#field/pokemon"; +import { ActivatePriorityQueuePhase } from "#phases/activate-priority-queue-phase"; +import { AddEnemyBuffModifierPhase } from "#phases/add-enemy-buff-modifier-phase"; +import { AttemptCapturePhase } from "#phases/attempt-capture-phase"; +import { AttemptRunPhase } from "#phases/attempt-run-phase"; +import { BattleEndPhase } from "#phases/battle-end-phase"; +import { BerryPhase } from "#phases/berry-phase"; +import { CheckStatusEffectPhase } from "#phases/check-status-effect-phase"; +import { CheckSwitchPhase } from "#phases/check-switch-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { CommonAnimPhase } from "#phases/common-anim-phase"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { EggHatchPhase } from "#phases/egg-hatch-phase"; +import { EggLapsePhase } from "#phases/egg-lapse-phase"; +import { EggSummaryPhase } from "#phases/egg-summary-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { EndCardPhase } from "#phases/end-card-phase"; +import { EndEvolutionPhase } from "#phases/end-evolution-phase"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { EvolutionPhase } from "#phases/evolution-phase"; +import { ExpPhase } from "#phases/exp-phase"; +import { FaintPhase } from "#phases/faint-phase"; +import { FormChangePhase } from "#phases/form-change-phase"; +import { GameOverModifierRewardPhase } from "#phases/game-over-modifier-reward-phase"; +import { GameOverPhase } from "#phases/game-over-phase"; +import { HideAbilityPhase } from "#phases/hide-ability-phase"; +import { HidePartyExpBarPhase } from "#phases/hide-party-exp-bar-phase"; +import { LearnMovePhase } from "#phases/learn-move-phase"; +import { LevelCapPhase } from "#phases/level-cap-phase"; +import { LevelUpPhase } from "#phases/level-up-phase"; +import { LoadMoveAnimPhase } from "#phases/load-move-anim-phase"; +import { LoginPhase } from "#phases/login-phase"; +import { MessagePhase } from "#phases/message-phase"; +import { ModifierRewardPhase } from "#phases/modifier-reward-phase"; +import { MoneyRewardPhase } from "#phases/money-reward-phase"; +import { MoveAnimPhase } from "#phases/move-anim-phase"; +import { MoveChargePhase } from "#phases/move-charge-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { MoveHeaderPhase } from "#phases/move-header-phase"; +import { MovePhase } from "#phases/move-phase"; import { - MysteryEncounterPhase, - MysteryEncounterOptionSelectedPhase, MysteryEncounterBattlePhase, + MysteryEncounterBattleStartCleanupPhase, + MysteryEncounterOptionSelectedPhase, + MysteryEncounterPhase, MysteryEncounterRewardsPhase, PostMysteryEncounterPhase, - MysteryEncounterBattleStartCleanupPhase, -} from "#app/phases/mystery-encounter-phases"; -import { NewBattlePhase } from "#app/phases/new-battle-phase"; -import { NewBiomeEncounterPhase } from "#app/phases/new-biome-encounter-phase"; -import { NextEncounterPhase } from "#app/phases/next-encounter-phase"; -import { ObtainStatusEffectPhase } from "#app/phases/obtain-status-effect-phase"; -import { PartyExpPhase } from "#app/phases/party-exp-phase"; -import { PartyHealPhase } from "#app/phases/party-heal-phase"; -import { type PhasePriorityQueue, PostSummonPhasePriorityQueue } from "#app/data/phase-priority-queue"; -import { PokemonAnimPhase } from "#app/phases/pokemon-anim-phase"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; -import { PokemonTransformPhase } from "#app/phases/pokemon-transform-phase"; -import { PostGameOverPhase } from "#app/phases/post-game-over-phase"; -import { PostSummonPhase } from "#app/phases/post-summon-phase"; -import { PostTurnStatusEffectPhase } from "#app/phases/post-turn-status-effect-phase"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { ReloadSessionPhase } from "#app/phases/reload-session-phase"; -import { ResetStatusPhase } from "#app/phases/reset-status-phase"; -import { ReturnPhase } from "#app/phases/return-phase"; -import { RevivalBlessingPhase } from "#app/phases/revival-blessing-phase"; -import { RibbonModifierRewardPhase } from "#app/phases/ribbon-modifier-reward-phase"; -import { ScanIvsPhase } from "#app/phases/scan-ivs-phase"; -import { SelectBiomePhase } from "#app/phases/select-biome-phase"; -import { SelectChallengePhase } from "#app/phases/select-challenge-phase"; -import { SelectGenderPhase } from "#app/phases/select-gender-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import { SelectTargetPhase } from "#app/phases/select-target-phase"; -import { ShinySparklePhase } from "#app/phases/shiny-sparkle-phase"; -import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; -import { ShowPartyExpBarPhase } from "#app/phases/show-party-exp-bar-phase"; -import { ShowTrainerPhase } from "#app/phases/show-trainer-phase"; -import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; -import { SummonMissingPhase } from "#app/phases/summon-missing-phase"; -import { SummonPhase } from "#app/phases/summon-phase"; -import { SwitchBiomePhase } from "#app/phases/switch-biome-phase"; -import { SwitchPhase } from "#app/phases/switch-phase"; -import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; -import { TeraPhase } from "#app/phases/tera-phase"; -import { TitlePhase } from "#app/phases/title-phase"; -import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase"; -import { TrainerVictoryPhase } from "#app/phases/trainer-victory-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; -import { UnavailablePhase } from "#app/phases/unavailable-phase"; -import { UnlockPhase } from "#app/phases/unlock-phase"; -import { VictoryPhase } from "#app/phases/victory-phase"; -import { WeatherEffectPhase } from "#app/phases/weather-effect-phase"; +} from "#phases/mystery-encounter-phases"; +import { NewBattlePhase } from "#phases/new-battle-phase"; +import { NewBiomeEncounterPhase } from "#phases/new-biome-encounter-phase"; +import { NextEncounterPhase } from "#phases/next-encounter-phase"; +import { ObtainStatusEffectPhase } from "#phases/obtain-status-effect-phase"; +import { PartyExpPhase } from "#phases/party-exp-phase"; +import { PartyHealPhase } from "#phases/party-heal-phase"; +import { PokemonAnimPhase } from "#phases/pokemon-anim-phase"; +import { PokemonHealPhase } from "#phases/pokemon-heal-phase"; +import { PokemonTransformPhase } from "#phases/pokemon-transform-phase"; +import { PostGameOverPhase } from "#phases/post-game-over-phase"; +import { PostSummonPhase } from "#phases/post-summon-phase"; +import { PostTurnStatusEffectPhase } from "#phases/post-turn-status-effect-phase"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { ReloadSessionPhase } from "#phases/reload-session-phase"; +import { ResetStatusPhase } from "#phases/reset-status-phase"; +import { ReturnPhase } from "#phases/return-phase"; +import { RevivalBlessingPhase } from "#phases/revival-blessing-phase"; +import { RibbonModifierRewardPhase } from "#phases/ribbon-modifier-reward-phase"; +import { ScanIvsPhase } from "#phases/scan-ivs-phase"; +import { SelectBiomePhase } from "#phases/select-biome-phase"; +import { SelectChallengePhase } from "#phases/select-challenge-phase"; +import { SelectGenderPhase } from "#phases/select-gender-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import { SelectTargetPhase } from "#phases/select-target-phase"; +import { ShinySparklePhase } from "#phases/shiny-sparkle-phase"; +import { ShowAbilityPhase } from "#phases/show-ability-phase"; +import { ShowPartyExpBarPhase } from "#phases/show-party-exp-bar-phase"; +import { ShowTrainerPhase } from "#phases/show-trainer-phase"; +import { StatStageChangePhase } from "#phases/stat-stage-change-phase"; +import { SummonMissingPhase } from "#phases/summon-missing-phase"; +import { SummonPhase } from "#phases/summon-phase"; +import { SwitchBiomePhase } from "#phases/switch-biome-phase"; +import { SwitchPhase } from "#phases/switch-phase"; +import { SwitchSummonPhase } from "#phases/switch-summon-phase"; +import { TeraPhase } from "#phases/tera-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { ToggleDoublePositionPhase } from "#phases/toggle-double-position-phase"; +import { TrainerVictoryPhase } from "#phases/trainer-victory-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { UnavailablePhase } from "#phases/unavailable-phase"; +import { UnlockPhase } from "#phases/unlock-phase"; +import { VictoryPhase } from "#phases/victory-phase"; +import { WeatherEffectPhase } from "#phases/weather-effect-phase"; +import type { PhaseMap, PhaseString } from "#types/phase-types"; +import { type Constructor, coerceArray } from "#utils/common"; /* * Manager for phases used by battle scene. diff --git a/src/phase.ts b/src/phase.ts index 5e81679d29e..46a81dddb6f 100644 --- a/src/phase.ts +++ b/src/phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import type { PhaseMap, PhaseString } from "./@types/phase-types"; +import type { PhaseMap, PhaseString } from "#types/phase-types"; export abstract class Phase { start() {} diff --git a/src/phases/activate-priority-queue-phase.ts b/src/phases/activate-priority-queue-phase.ts index df42c491676..a31d3291a60 100644 --- a/src/phases/activate-priority-queue-phase.ts +++ b/src/phases/activate-priority-queue-phase.ts @@ -1,6 +1,6 @@ -import type { DynamicPhaseType } from "#enums/dynamic-phase-type"; import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; +import type { DynamicPhaseType } from "#enums/dynamic-phase-type"; export class ActivatePriorityQueuePhase extends Phase { public readonly phaseName = "ActivatePriorityQueuePhase"; diff --git a/src/phases/add-enemy-buff-modifier-phase.ts b/src/phases/add-enemy-buff-modifier-phase.ts index 218a3a653ff..5c9a56796d4 100644 --- a/src/phases/add-enemy-buff-modifier-phase.ts +++ b/src/phases/add-enemy-buff-modifier-phase.ts @@ -1,9 +1,9 @@ -import { ModifierTier } from "#enums/modifier-tier"; -import { regenerateModifierPoolThresholds, getEnemyBuffModifierForWave } from "#app/modifier/modifier-type"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { EnemyPersistentModifier } from "#app/modifier/modifier"; -import { Phase } from "#app/phase"; import { globalScene } from "#app/global-scene"; +import { Phase } from "#app/phase"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { EnemyPersistentModifier } from "#modifiers/modifier"; +import { getEnemyBuffModifierForWave, regenerateModifierPoolThresholds } from "#modifiers/modifier-type"; export class AddEnemyBuffModifierPhase extends Phase { public readonly phaseName = "AddEnemyBuffModifierPhase"; diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index f4e6725935a..604d4fd8384 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -1,30 +1,31 @@ -import { BattlerIndex } from "#enums/battler-index"; import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; -import { SubstituteTag } from "#app/data/battler-tags"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { SubstituteTag } from "#data/battler-tags"; +import { Gender } from "#data/gender"; import { doPokeballBounceAnim, + getCriticalCaptureChance, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, - getCriticalCaptureChance, -} from "#app/data/pokeball"; -import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; -import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { PokemonPhase } from "#app/phases/pokemon-phase"; -import { achvs } from "#app/system/achv"; -import type { PartyOption } from "#app/ui/party-ui-handler"; -import { PartyUiMode } from "#app/ui/party-ui-handler"; -import { SummaryUiMode } from "#app/ui/summary-ui-handler"; -import { UiMode } from "#enums/ui-mode"; +} from "#data/pokeball"; +import { getStatusEffectCatchRateMultiplier } from "#data/status-effect"; +import { BattlerIndex } from "#enums/battler-index"; import type { PokeballType } from "#enums/pokeball"; import { StatusEffect } from "#enums/status-effect"; +import { UiMode } from "#enums/ui-mode"; +import { addPokeballCaptureStars, addPokeballOpenParticles } from "#field/anims"; +import type { EnemyPokemon } from "#field/pokemon"; +import { PokemonHeldItemModifier } from "#modifiers/modifier"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import { achvs } from "#system/achv"; +import type { PartyOption } from "#ui/party-ui-handler"; +import { PartyUiMode } from "#ui/party-ui-handler"; +import { SummaryUiMode } from "#ui/summary-ui-handler"; import i18next from "i18next"; -import { globalScene } from "#app/global-scene"; -import { Gender } from "#app/data/gender"; +// TODO: Refactor and split up to allow for overriding capture chance export class AttemptCapturePhase extends PokemonPhase { public readonly phaseName = "AttemptCapturePhase"; private pokeballType: PokeballType; @@ -119,7 +120,7 @@ export class AttemptCapturePhase extends PokemonPhase { repeatDelay: 500, onUpdate: t => { if (shakeCount && shakeCount < (isCritical ? 2 : 4)) { - const value = t.getValue(); + const value = t.getValue() ?? 0; const directionMultiplier = shakeCount % 2 === 1 ? 1 : -1; this.pokeball.setX(pbX + value * 4 * directionMultiplier); this.pokeball.setAngle(value * 27.5 * directionMultiplier); diff --git a/src/phases/attempt-run-phase.ts b/src/phases/attempt-run-phase.ts index ecd64380c31..a59667bdd4e 100644 --- a/src/phases/attempt-run-phase.ts +++ b/src/phases/attempt-run-phase.ts @@ -1,34 +1,33 @@ -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import { globalScene } from "#app/global-scene"; +import Overrides from "#app/overrides"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; -import type { PlayerPokemon, EnemyPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; +import { FieldPhase } from "#phases/field-phase"; +import { NumberHolder } from "#utils/common"; import i18next from "i18next"; -import { NumberHolder } from "#app/utils/common"; -import { PokemonPhase } from "./pokemon-phase"; -import { globalScene } from "#app/global-scene"; -export class AttemptRunPhase extends PokemonPhase { +export class AttemptRunPhase extends FieldPhase { public readonly phaseName = "AttemptRunPhase"; - /** For testing purposes: this is to force the pokemon to fail and escape */ - public forceFailEscape = false; - start() { + public start() { super.start(); - const playerField = globalScene.getPlayerField(); + // Increment escape attempts count on entry + const currentAttempts = globalScene.currentBattle.escapeAttempts++; + + const activePlayerField = globalScene.getPlayerField(true); const enemyField = globalScene.getEnemyField(); - const playerPokemon = this.getPokemon(); + const escapeRoll = globalScene.randBattleSeedInt(100); + const escapeChance = new NumberHolder(this.calculateEscapeChance(currentAttempts)); - const escapeChance = new NumberHolder(0); + activePlayerField.forEach(pokemon => { + applyAbAttrs("RunSuccessAbAttr", { pokemon, chance: escapeChance }); + }); - this.attemptRunAway(playerField, enemyField, escapeChance); - - applyAbAttrs("RunSuccessAbAttr", { pokemon: playerPokemon, chance: escapeChance }); - - if (playerPokemon.randBattleSeedInt(100) < escapeChance.value && !this.forceFailEscape) { - enemyField.forEach(enemyPokemon => applyAbAttrs("PreLeaveFieldAbAttr", { pokemon: enemyPokemon })); + if (escapeRoll < escapeChance.value) { + enemyField.forEach(pokemon => applyAbAttrs("PreLeaveFieldAbAttr", { pokemon })); globalScene.playSound("se/flee"); globalScene.phaseManager.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500); @@ -57,24 +56,35 @@ export class AttemptRunPhase extends PokemonPhase { globalScene.phaseManager.pushNew("NewBattlePhase"); } else { - playerPokemon.turnData.failedRunAway = true; + activePlayerField.forEach(p => { + p.turnData.failedRunAway = true; + }); + globalScene.phaseManager.queueMessage(i18next.t("battle:runAwayCannotEscape"), null, true, 500); } this.end(); } - attemptRunAway(playerField: PlayerPokemon[], enemyField: EnemyPokemon[], escapeChance: NumberHolder) { - /** Sum of the speed of all enemy pokemon on the field */ - const enemySpeed = enemyField.reduce( - (total: number, enemyPokemon: Pokemon) => total + enemyPokemon.getStat(Stat.SPD), - 0, - ); - /** Sum of the speed of all player pokemon on the field */ - const playerSpeed = playerField.reduce( - (total: number, playerPokemon: Pokemon) => total + playerPokemon.getStat(Stat.SPD), - 0, - ); + /** + * Calculate the chance for the player's team to successfully run away from battle. + * + * @param escapeAttempts - The number of prior failed escape attempts in the current battle + * @returns The final escape chance, as percentage out of 100. + */ + public calculateEscapeChance(escapeAttempts: number): number { + // Check for override, guaranteeing or forbidding random flee attempts as applicable. + if (Overrides.RUN_SUCCESS_OVERRIDE !== null) { + return Overrides.RUN_SUCCESS_OVERRIDE ? 100 : 0; + } + + const enemyField = globalScene.getEnemyField(); + const activePlayerField = globalScene.getPlayerField(true); + + // Cf https://bulbapedia.bulbagarden.net/wiki/Escape#Generation_V_onwards + // From gen 5 onwards, running takes the _base_ speed totals of both party sides. + const enemySpeed = enemyField.reduce((total, enemy) => total + enemy.getStat(Stat.SPD), 0); + const playerSpeed = activePlayerField.reduce((total, player) => total + player.getStat(Stat.SPD), 0); /* The way the escape chance works is by looking at the difference between your speed and the enemy field's average speed as a ratio. The higher this ratio, the higher your chance of success. * However, there is a cap for the ratio of your speed vs enemy speed which beyond that point, you won't gain any advantage. It also looks at how many times you've tried to escape. @@ -92,10 +102,8 @@ export class AttemptRunPhase extends PokemonPhase { * From the above, we can calculate the below values */ - let isBoss = false; - for (let e = 0; e < enemyField.length; e++) { - isBoss = isBoss || enemyField[e].isBoss(); // this line checks if any of the enemy pokemon on the field are bosses; if so, the calculation for escaping is different - } + /** Whether at least 1 pokemon on the enemy field is a boss. */ + const isBoss = enemyField.some(e => e.isBoss()); /** The ratio between the speed of your active pokemon and the speed of the enemy field */ const speedRatio = playerSpeed / enemySpeed; @@ -111,8 +119,8 @@ export class AttemptRunPhase extends PokemonPhase { const escapeSlope = (maxChance - minChance) / speedCap; // This will calculate the escape chance given all of the above and clamp it to the range of [`minChance`, `maxChance`] - escapeChance.value = Phaser.Math.Clamp( - Math.round(escapeSlope * speedRatio + minChance + escapeBonus * globalScene.currentBattle.escapeAttempts++), + return Phaser.Math.Clamp( + Math.round(escapeSlope * speedRatio + minChance + escapeBonus * escapeAttempts), minChance, maxChance, ); diff --git a/src/phases/battle-end-phase.ts b/src/phases/battle-end-phase.ts index 297e20cb445..8d199915385 100644 --- a/src/phases/battle-end-phase.ts +++ b/src/phases/battle-end-phase.ts @@ -1,7 +1,7 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier"; -import { BattlePhase } from "./battle-phase"; +import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#modifiers/modifier"; +import { BattlePhase } from "#phases/battle-phase"; export class BattleEndPhase extends BattlePhase { public readonly phaseName = "BattleEndPhase"; diff --git a/src/phases/battle-phase.ts b/src/phases/battle-phase.ts index 7cefd0369d9..26794ed9bc5 100644 --- a/src/phases/battle-phase.ts +++ b/src/phases/battle-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import { TrainerSlot } from "#enums/trainer-slot"; import { Phase } from "#app/phase"; +import { TrainerSlot } from "#enums/trainer-slot"; export abstract class BattlePhase extends Phase { showEnemyTrainer(trainerSlot: TrainerSlot = TrainerSlot.NONE): void { diff --git a/src/phases/berry-phase.ts b/src/phases/berry-phase.ts index 61124a7cda8..941406d0b96 100644 --- a/src/phases/berry-phase.ts +++ b/src/phases/berry-phase.ts @@ -1,13 +1,13 @@ -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { CommonAnim } from "#enums/move-anims-common"; -import { BerryUsedEvent } from "#app/events/battle-scene"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { BerryModifier } from "#app/modifier/modifier"; -import i18next from "i18next"; -import { BooleanHolder } from "#app/utils/common"; -import { FieldPhase } from "./field-phase"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import type Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { CommonAnim } from "#enums/move-anims-common"; +import { BerryUsedEvent } from "#events/battle-scene"; +import type { Pokemon } from "#field/pokemon"; +import { BerryModifier } from "#modifiers/modifier"; +import { FieldPhase } from "#phases/field-phase"; +import { BooleanHolder } from "#utils/common"; +import i18next from "i18next"; /** * The phase after attacks where the pokemon eat berries. diff --git a/src/phases/check-status-effect-phase.ts b/src/phases/check-status-effect-phase.ts index 43495e038e9..bdaa536986a 100644 --- a/src/phases/check-status-effect-phase.ts +++ b/src/phases/check-status-effect-phase.ts @@ -1,6 +1,6 @@ +import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; import type { BattlerIndex } from "#enums/battler-index"; -import { globalScene } from "#app/global-scene"; export class CheckStatusEffectPhase extends Phase { public readonly phaseName = "CheckStatusEffectPhase"; diff --git a/src/phases/check-switch-phase.ts b/src/phases/check-switch-phase.ts index 97f4092096f..f4e8ee56c55 100644 --- a/src/phases/check-switch-phase.ts +++ b/src/phases/check-switch-phase.ts @@ -1,11 +1,11 @@ import { globalScene } from "#app/global-scene"; -import { BattleStyle } from "#app/enums/battle-style"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; import { getPokemonNameWithAffix } from "#app/messages"; -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; -import { BattlePhase } from "./battle-phase"; +import { BattleStyle } from "#enums/battle-style"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { SwitchType } from "#enums/switch-type"; +import { UiMode } from "#enums/ui-mode"; +import { BattlePhase } from "#phases/battle-phase"; +import i18next from "i18next"; export class CheckSwitchPhase extends BattlePhase { public readonly phaseName = "CheckSwitchPhase"; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index 754d54de70a..b90c5a6b00a 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -1,28 +1,29 @@ -import { globalScene } from "#app/global-scene"; import type { TurnCommand } from "#app/battle"; -import { BattleType } from "#enums/battle-type"; -import type { EncoreTag } from "#app/data/battler-tags"; -import { TrappedTag } from "#app/data/battler-tags"; -import type { MoveTargetSet } from "#app/data/moves/move"; -import { getMoveTargets } from "#app/data/moves/move-utils"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BiomeId } from "#enums/biome-id"; -import { MoveId } from "#enums/move-id"; -import { PokeballType } from "#enums/pokeball"; -import type { PlayerPokemon, TurnMove } from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; +import { globalScene } from "#app/global-scene"; import { getPokemonNameWithAffix } from "#app/messages"; -import { Command } from "#enums/command"; -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; -import { FieldPhase } from "./field-phase"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import { isNullOrUndefined } from "#app/utils/common"; +import { speciesStarterCosts } from "#balance/starters"; +import type { EncoreTag } from "#data/battler-tags"; +import { TrappedTag } from "#data/battler-tags"; +import { AbilityId } from "#enums/ability-id"; import { ArenaTagSide } from "#enums/arena-tag-side"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { isVirtual, isIgnorePP, MoveUseMode } from "#enums/move-use-mode"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattleType } from "#enums/battle-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BiomeId } from "#enums/biome-id"; +import { Command } from "#enums/command"; +import { FieldPosition } from "#enums/field-position"; +import { MoveId } from "#enums/move-id"; +import { isIgnorePP, isVirtual, MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { PokeballType } from "#enums/pokeball"; +import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { MoveTargetSet } from "#moves/move"; +import { getMoveTargets } from "#moves/move-utils"; +import { FieldPhase } from "#phases/field-phase"; +import type { TurnMove } from "#types/turn-move"; +import { isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; export class CommandPhase extends FieldPhase { public readonly phaseName = "CommandPhase"; diff --git a/src/phases/common-anim-phase.ts b/src/phases/common-anim-phase.ts index abfe8ed99f0..78da1dcfa2f 100644 --- a/src/phases/common-anim-phase.ts +++ b/src/phases/common-anim-phase.ts @@ -1,8 +1,8 @@ -import type { BattlerIndex } from "#enums/battler-index"; import { globalScene } from "#app/global-scene"; +import { CommonBattleAnim } from "#data/battle-anims"; +import type { BattlerIndex } from "#enums/battler-index"; import type { CommonAnim } from "#enums/move-anims-common"; -import { CommonBattleAnim } from "#app/data/battle-anims"; -import { PokemonPhase } from "./pokemon-phase"; +import { PokemonPhase } from "#phases/pokemon-phase"; export class CommonAnimPhase extends PokemonPhase { // PokemonHealPhase extends CommonAnimPhase, and to make typescript happy, diff --git a/src/phases/damage-anim-phase.ts b/src/phases/damage-anim-phase.ts index aa5a0a6c3e6..a651255baff 100644 --- a/src/phases/damage-anim-phase.ts +++ b/src/phases/damage-anim-phase.ts @@ -1,10 +1,10 @@ import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; import { BattleSpec } from "#enums/battle-spec"; -import type { DamageResult } from "#app/field/pokemon"; +import type { BattlerIndex } from "#enums/battler-index"; import { HitResult } from "#enums/hit-result"; -import { fixedInt } from "#app/utils/common"; -import { PokemonPhase } from "#app/phases/pokemon-phase"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import type { DamageResult } from "#types/damage-result"; +import { fixedInt } from "#utils/common"; export class DamageAnimPhase extends PokemonPhase { public readonly phaseName = "DamageAnimPhase"; diff --git a/src/phases/egg-hatch-phase.ts b/src/phases/egg-hatch-phase.ts index d6c40a1510e..94923ae8c1f 100644 --- a/src/phases/egg-hatch-phase.ts +++ b/src/phases/egg-hatch-phase.ts @@ -1,20 +1,20 @@ import type { AnySound } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import type { Egg } from "#app/data/egg"; -import { EggCountChangedEvent } from "#app/events/egg"; -import type { PlayerPokemon } from "#app/field/pokemon"; import { Phase } from "#app/phase"; -import { achvs } from "#app/system/achv"; -import EggCounterContainer from "#app/ui/egg-counter-container"; -import type EggHatchSceneHandler from "#app/ui/egg-hatch-scene-handler"; -import PokemonInfoContainer from "#app/ui/pokemon-info-container"; +import type { Egg } from "#data/egg"; +import type { EggHatchData } from "#data/egg-hatch-data"; import { UiMode } from "#enums/ui-mode"; +import { EggCountChangedEvent } from "#events/egg"; +import { doShinySparkleAnim } from "#field/anims"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { EggLapsePhase } from "#phases/egg-lapse-phase"; +import { achvs } from "#system/achv"; +import { EggCounterContainer } from "#ui/egg-counter-container"; +import type { EggHatchSceneHandler } from "#ui/egg-hatch-scene-handler"; +import { PokemonInfoContainer } from "#ui/pokemon-info-container"; +import { fixedInt, getFrameMs, randInt } from "#utils/common"; import i18next from "i18next"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { fixedInt, getFrameMs, randInt } from "#app/utils/common"; -import type { EggLapsePhase } from "./egg-lapse-phase"; -import type { EggHatchData } from "#app/data/egg-hatch-data"; -import { doShinySparkleAnim } from "#app/field/anims"; /** * Class that represents egg hatching diff --git a/src/phases/egg-lapse-phase.ts b/src/phases/egg-lapse-phase.ts index 206bef1a33c..4f393bddd36 100644 --- a/src/phases/egg-lapse-phase.ts +++ b/src/phases/egg-lapse-phase.ts @@ -1,13 +1,13 @@ import { globalScene } from "#app/global-scene"; -import type { Egg } from "#app/data/egg"; -import { EGG_SEED } from "#app/data/egg"; -import { Phase } from "#app/phase"; -import i18next from "i18next"; import Overrides from "#app/overrides"; +import { Phase } from "#app/phase"; +import type { Egg } from "#data/egg"; +import { EGG_SEED } from "#data/egg"; +import { EggHatchData } from "#data/egg-hatch-data"; import { UiMode } from "#enums/ui-mode"; -import { achvs } from "#app/system/achv"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { EggHatchData } from "#app/data/egg-hatch-data"; +import type { PlayerPokemon } from "#field/pokemon"; +import { achvs } from "#system/achv"; +import i18next from "i18next"; /** * Phase that handles updating eggs, and hatching any ready eggs diff --git a/src/phases/egg-summary-phase.ts b/src/phases/egg-summary-phase.ts index cc7857426bc..c236c5c3abc 100644 --- a/src/phases/egg-summary-phase.ts +++ b/src/phases/egg-summary-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; +import type { EggHatchData } from "#data/egg-hatch-data"; import { UiMode } from "#enums/ui-mode"; -import type { EggHatchData } from "#app/data/egg-hatch-data"; /** * Class that represents the egg summary phase diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 52c2b2e465d..79da7134e9a 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -1,37 +1,41 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { BattleType } from "#enums/battle-type"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; +import { PLAYER_PARTY_MAX_SIZE, WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -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"; -import { doTrainerExclamation } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { getGoldenBugNetSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { getRandomWeatherType } from "#app/data/weather"; -import { EncounterPhaseEvent } from "#app/events/battle-scene"; -import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; import { getPokemonNameWithAffix } from "#app/messages"; -import { BoostBugSpawnModifier, IvScannerModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier"; -import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; import Overrides from "#app/overrides"; -import { BattlePhase } from "#app/phases/battle-phase"; -import { achvs } from "#app/system/achv"; import { handleTutorial, Tutorial } from "#app/tutorial"; -import { UiMode } from "#enums/ui-mode"; -import { randSeedInt, randSeedItem } from "#app/utils/common"; +import { initEncounterAnims, loadEncounterAnimAssets } from "#data/battle-anims"; +import { getCharVariantFromDialogue } from "#data/dialogue"; +import { getNatureName } from "#data/nature"; +import { getRandomWeatherType } from "#data/weather"; import { BattleSpec } from "#enums/battle-spec"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BiomeId } from "#enums/biome-id"; +import { FieldPosition } from "#enums/field-position"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; import { PlayerGender } from "#enums/player-gender"; import { SpeciesId } from "#enums/species-id"; -import { overrideHeldItems, overrideModifiers } from "#app/modifier/modifier"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { UiMode } from "#enums/ui-mode"; +import { EncounterPhaseEvent } from "#events/battle-scene"; +import type { Pokemon } from "#field/pokemon"; +import { + BoostBugSpawnModifier, + IvScannerModifier, + overrideHeldItems, + overrideModifiers, + TurnHeldItemTransferModifier, +} from "#modifiers/modifier"; +import { regenerateModifierPoolThresholds } from "#modifiers/modifier-type"; +import { getEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import { doTrainerExclamation } from "#mystery-encounters/encounter-phase-utils"; +import { getGoldenBugNetSpecies } from "#mystery-encounters/encounter-pokemon-utils"; +import { BattlePhase } from "#phases/battle-phase"; +import { achvs } from "#system/achv"; +import { randSeedInt, randSeedItem } from "#utils/common"; import i18next from "i18next"; -import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/constants"; -import { getNatureName } from "#app/data/nature"; export class EncounterPhase extends BattlePhase { // Union type is necessary as this is subclassed, and typescript will otherwise complain diff --git a/src/phases/end-card-phase.ts b/src/phases/end-card-phase.ts index bb64969514f..5c3f6e1bf9b 100644 --- a/src/phases/end-card-phase.ts +++ b/src/phases/end-card-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import { PlayerGender } from "#app/enums/player-gender"; import { Phase } from "#app/phase"; -import { addTextObject, TextStyle } from "#app/ui/text"; +import { PlayerGender } from "#enums/player-gender"; +import { addTextObject, TextStyle } from "#ui/text"; import i18next from "i18next"; export class EndCardPhase extends Phase { diff --git a/src/phases/enemy-command-phase.ts b/src/phases/enemy-command-phase.ts index 0dc41a592e0..7e4dff37b0f 100644 --- a/src/phases/enemy-command-phase.ts +++ b/src/phases/enemy-command-phase.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import { BattlerIndex } from "#enums/battler-index"; -import { Command } from "#enums/command"; -import { FieldPhase } from "./field-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { Command } from "#enums/command"; +import { FieldPhase } from "#phases/field-phase"; /** * Phase for determining an enemy AI's action for the next turn. diff --git a/src/phases/enemy-party-member-pokemon-phase.ts b/src/phases/enemy-party-member-pokemon-phase.ts index 5c701f7d73a..2f0ace608ff 100644 --- a/src/phases/enemy-party-member-pokemon-phase.ts +++ b/src/phases/enemy-party-member-pokemon-phase.ts @@ -1,5 +1,5 @@ -import type { EnemyPokemon } from "#app/field/pokemon"; -import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; +import type { EnemyPokemon } from "#field/pokemon"; +import { PartyMemberPokemonPhase } from "#phases/party-member-pokemon-phase"; export abstract class EnemyPartyMemberPokemonPhase extends PartyMemberPokemonPhase { constructor(partyMemberIndex: number) { diff --git a/src/phases/evolution-phase.ts b/src/phases/evolution-phase.ts index 8e4300986b3..f8bee8371f2 100644 --- a/src/phases/evolution-phase.ts +++ b/src/phases/evolution-phase.ts @@ -1,20 +1,19 @@ -import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { Phase } from "#app/phase"; import type { AnySound } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; -import { FusionSpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; -import type EvolutionSceneHandler from "#app/ui/evolution-scene-handler"; -import { fixedInt, getFrameMs, randInt } from "#app/utils/common"; -import { UiMode } from "#enums/ui-mode"; -import { cos, sin } from "#app/field/anims"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { LearnMoveSituation } from "#enums/learn-move-situation"; -import { getTypeRgb } from "#app/data/type"; -import i18next from "i18next"; import { getPokemonNameWithAffix } from "#app/messages"; -import { EVOLVE_MOVE } from "#app/data/balance/pokemon-level-moves"; +import { Phase } from "#app/phase"; +import type { SpeciesFormEvolution } from "#balance/pokemon-evolutions"; +import { FusionSpeciesFormEvolution } from "#balance/pokemon-evolutions"; +import { EVOLVE_MOVE } from "#balance/pokemon-level-moves"; +import { getTypeRgb } from "#data/type"; +import { LearnMoveSituation } from "#enums/learn-move-situation"; +import { UiMode } from "#enums/ui-mode"; +import { cos, sin } from "#field/anims"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { EvolutionSceneHandler } from "#ui/evolution-scene-handler"; +import { fixedInt, getFrameMs, randInt } from "#utils/common"; +import i18next from "i18next"; +import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; export class EvolutionPhase extends Phase { // FormChangePhase inherits from this, but EvolutionPhase is not abstract. @@ -240,7 +239,7 @@ export class EvolutionPhase extends Phase { to: 1, duration: 2000, onUpdate: t => { - this.pokemonTintSprite.setAlpha(t.getValue()); + this.pokemonTintSprite.setAlpha(t.getValue() ?? 1); }, onComplete: () => { this.pokemonSprite.setVisible(false); @@ -388,7 +387,7 @@ export class EvolutionPhase extends Phase { globalScene.ui.showText( i18next.t("menu:evolutionDone", { pokemonName: this.preEvolvedPokemonName, - evolvedPokemonName: this.pokemon.species.getExpandedSpeciesName(), + evolvedPokemonName: this.pokemon.name, }), null, () => this.end(), diff --git a/src/phases/exp-phase.ts b/src/phases/exp-phase.ts index 74768e86186..7ab162c2ac6 100644 --- a/src/phases/exp-phase.ts +++ b/src/phases/exp-phase.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; import { getPokemonNameWithAffix } from "#app/messages"; -import { ExpBoosterModifier } from "#app/modifier/modifier"; +import { ExpBoosterModifier } from "#modifiers/modifier"; +import { PlayerPartyMemberPokemonPhase } from "#phases/player-party-member-pokemon-phase"; +import { NumberHolder } from "#utils/common"; import i18next from "i18next"; -import { NumberHolder } from "#app/utils/common"; -import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; export class ExpPhase extends PlayerPartyMemberPokemonPhase { public readonly phaseName = "ExpPhase"; diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index c2658b62b23..d1bd0ed0804 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -1,26 +1,24 @@ -import type { BattlerIndex } from "#enums/battler-index"; -import { BattleType } from "#enums/battle-type"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { battleSpecDialogue } from "#app/data/dialogue"; -import { allMoves } from "#app/data/data-lists"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { BattleSpec } from "#app/enums/battle-spec"; -import { StatusEffect } from "#app/enums/status-effect"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { HitResult } from "#enums/hit-result"; -import type { PlayerPokemon } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; -import { PokemonInstantReviveModifier } from "#app/modifier/modifier"; -import { SwitchType } from "#enums/switch-type"; -import i18next from "i18next"; -import { PokemonPhase } from "./pokemon-phase"; -import { isNullOrUndefined } from "#app/utils/common"; -import { FRIENDSHIP_LOSS_FROM_FAINT } from "#app/data/balance/starters"; +import { FRIENDSHIP_LOSS_FROM_FAINT } from "#balance/starters"; +import { allMoves } from "#data/data-lists"; +import { battleSpecDialogue } from "#data/dialogue"; +import { SpeciesFormChangeActiveTrigger } from "#data/form-change-triggers"; +import { BattleSpec } from "#enums/battle-spec"; +import { BattleType } from "#enums/battle-type"; +import type { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { HitResult } from "#enums/hit-result"; +import { StatusEffect } from "#enums/status-effect"; +import { SwitchType } from "#enums/switch-type"; +import type { EnemyPokemon, PlayerPokemon, Pokemon } from "#field/pokemon"; +import { PokemonInstantReviveModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import { isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; export class FaintPhase extends PokemonPhase { public readonly phaseName = "FaintPhase"; diff --git a/src/phases/field-phase.ts b/src/phases/field-phase.ts index c37f0e960e7..99de3d9fcf5 100644 --- a/src/phases/field-phase.ts +++ b/src/phases/field-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import type Pokemon from "#app/field/pokemon"; -import { BattlePhase } from "./battle-phase"; +import type { Pokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; type PokemonFunc = (pokemon: Pokemon) => void; diff --git a/src/phases/form-change-phase.ts b/src/phases/form-change-phase.ts index 6d60cacd69d..7b7f5a6dac6 100644 --- a/src/phases/form-change-phase.ts +++ b/src/phases/form-change-phase.ts @@ -1,15 +1,15 @@ import { globalScene } from "#app/global-scene"; -import { fixedInt } from "#app/utils/common"; -import { achvs } from "../system/achv"; -import type { SpeciesFormChange } from "../data/pokemon-forms"; -import { getSpeciesFormChangeMessage } from "#app/data/pokemon-forms/form-change-triggers"; -import type { default as Pokemon, PlayerPokemon } from "../field/pokemon"; -import { UiMode } from "#enums/ui-mode"; -import type PartyUiHandler from "../ui/party-ui-handler"; -import { getPokemonNameWithAffix } from "../messages"; -import { EvolutionPhase } from "./evolution-phase"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { getSpeciesFormChangeMessage } from "#data/form-change-triggers"; +import type { SpeciesFormChange } from "#data/pokemon-forms"; import { BattlerTagType } from "#enums/battler-tag-type"; import { SpeciesFormKey } from "#enums/species-form-key"; +import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import { EvolutionPhase } from "#phases/evolution-phase"; +import { achvs } from "#system/achv"; +import type { PartyUiHandler } from "#ui/party-ui-handler"; +import { fixedInt } from "#utils/common"; export class FormChangePhase extends EvolutionPhase { public readonly phaseName = "FormChangePhase"; diff --git a/src/phases/game-over-modifier-reward-phase.ts b/src/phases/game-over-modifier-reward-phase.ts index 13c8f48abad..f07c7d2adba 100644 --- a/src/phases/game-over-modifier-reward-phase.ts +++ b/src/phases/game-over-modifier-reward-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { UiMode } from "#enums/ui-mode"; +import { ModifierRewardPhase } from "#phases/modifier-reward-phase"; import i18next from "i18next"; -import { ModifierRewardPhase } from "./modifier-reward-phase"; export class GameOverModifierRewardPhase extends ModifierRewardPhase { public readonly phaseName = "GameOverModifierRewardPhase"; diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index 3f92f26b9b9..d4562b5a237 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -1,29 +1,29 @@ +import { pokerogueApi } from "#api/pokerogue-api"; import { clientSessionId } from "#app/account"; -import { BattleType } from "#enums/battle-type"; import { globalScene } from "#app/global-scene"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { getCharVariantFromDialogue } from "#app/data/dialogue"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import type Pokemon from "#app/field/pokemon"; -import { modifierTypes } from "#app/data/data-lists"; -import { BattlePhase } from "#app/phases/battle-phase"; -import type { EndCardPhase } from "#app/phases/end-card-phase"; -import { achvs, ChallengeAchv } from "#app/system/achv"; -import { Unlockables } from "#enums/unlockables"; -import { UiMode } from "#enums/ui-mode"; -import { isLocal, isLocalServerConnected } from "#app/utils/common"; +import { pokemonEvolutions } from "#balance/pokemon-evolutions"; +import { modifierTypes } from "#data/data-lists"; +import { getCharVariantFromDialogue } from "#data/dialogue"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { BattleType } from "#enums/battle-type"; import { PlayerGender } from "#enums/player-gender"; import { TrainerType } from "#enums/trainer-type"; +import { UiMode } from "#enums/ui-mode"; +import { Unlockables } from "#enums/unlockables"; +import type { Pokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; +import type { EndCardPhase } from "#phases/end-card-phase"; +import { achvs, ChallengeAchv } from "#system/achv"; +import { ArenaData } from "#system/arena-data"; +import { ChallengeData } from "#system/challenge-data"; +import type { SessionSaveData } from "#system/game-data"; +import { ModifierData as PersistentModifierData } from "#system/modifier-data"; +import { PokemonData } from "#system/pokemon-data"; +import { TrainerData } from "#system/trainer-data"; +import { trainerConfigs } from "#trainers/trainer-config"; +import { isLocal, isLocalServerConnected } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import type { SessionSaveData } from "#app/system/game-data"; -import PersistentModifierData from "#app/system/modifier-data"; -import PokemonData from "#app/system/pokemon-data"; -import ChallengeData from "#app/system/challenge-data"; -import TrainerData from "#app/system/trainer-data"; -import ArenaData from "#app/system/arena-data"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; export class GameOverPhase extends BattlePhase { public readonly phaseName = "GameOverPhase"; diff --git a/src/phases/hide-party-exp-bar-phase.ts b/src/phases/hide-party-exp-bar-phase.ts index 9ee08280cd4..e59bd02ce60 100644 --- a/src/phases/hide-party-exp-bar-phase.ts +++ b/src/phases/hide-party-exp-bar-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { BattlePhase } from "./battle-phase"; +import { BattlePhase } from "#phases/battle-phase"; export class HidePartyExpBarPhase extends BattlePhase { public readonly phaseName = "HidePartyExpBarPhase"; diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index e24efa63b5a..a714d247730 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -1,18 +1,18 @@ import { globalScene } from "#app/global-scene"; -import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; -import type Move from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { MoveId } from "#enums/move-id"; import { getPokemonNameWithAffix } from "#app/messages"; import Overrides from "#app/overrides"; -import EvolutionSceneHandler from "#app/ui/evolution-scene-handler"; -import { SummaryUiMode } from "#app/ui/summary-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; -import { PlayerPartyMemberPokemonPhase } from "#app/phases/player-party-member-pokemon-phase"; -import type Pokemon from "#app/field/pokemon"; +import { initMoveAnim, loadMoveAnimAssets } from "#data/battle-anims"; +import { allMoves } from "#data/data-lists"; +import { SpeciesFormChangeMoveLearnedTrigger } from "#data/form-change-triggers"; import { LearnMoveType } from "#enums/learn-move-type"; +import { MoveId } from "#enums/move-id"; +import { UiMode } from "#enums/ui-mode"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { PlayerPartyMemberPokemonPhase } from "#phases/player-party-member-pokemon-phase"; +import { EvolutionSceneHandler } from "#ui/evolution-scene-handler"; +import { SummaryUiMode } from "#ui/summary-ui-handler"; +import i18next from "i18next"; export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { public readonly phaseName = "LearnMovePhase"; diff --git a/src/phases/level-cap-phase.ts b/src/phases/level-cap-phase.ts index 12d4d64e8e2..a1f1e07f58d 100644 --- a/src/phases/level-cap-phase.ts +++ b/src/phases/level-cap-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { UiMode } from "#enums/ui-mode"; +import { FieldPhase } from "#phases/field-phase"; import i18next from "i18next"; -import { FieldPhase } from "./field-phase"; export class LevelCapPhase extends FieldPhase { public readonly phaseName = "LevelCapPhase"; diff --git a/src/phases/level-up-phase.ts b/src/phases/level-up-phase.ts index c78a1798304..07a87d73411 100644 --- a/src/phases/level-up-phase.ts +++ b/src/phases/level-up-phase.ts @@ -1,10 +1,10 @@ import { globalScene } from "#app/global-scene"; -import { ExpNotification } from "#app/enums/exp-notification"; -import type { PlayerPokemon } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; -import { PlayerPartyMemberPokemonPhase } from "#app/phases/player-party-member-pokemon-phase"; -import { LevelAchv } from "#app/system/achv"; -import { NumberHolder } from "#app/utils/common"; +import { ExpNotification } from "#enums/exp-notification"; +import type { PlayerPokemon } from "#field/pokemon"; +import { PlayerPartyMemberPokemonPhase } from "#phases/player-party-member-pokemon-phase"; +import { LevelAchv } from "#system/achv"; +import { NumberHolder } from "#utils/common"; import i18next from "i18next"; export class LevelUpPhase extends PlayerPartyMemberPokemonPhase { diff --git a/src/phases/load-move-anim-phase.ts b/src/phases/load-move-anim-phase.ts index c9b78797407..3209e395399 100644 --- a/src/phases/load-move-anim-phase.ts +++ b/src/phases/load-move-anim-phase.ts @@ -1,6 +1,6 @@ -import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; -import type { MoveId } from "#enums/move-id"; import { Phase } from "#app/phase"; +import { initMoveAnim, loadMoveAnimAssets } from "#data/battle-anims"; +import type { MoveId } from "#enums/move-id"; /** * Phase for synchronous move animation loading. diff --git a/src/phases/login-phase.ts b/src/phases/login-phase.ts index de426866baa..f310c60b0d4 100644 --- a/src/phases/login-phase.ts +++ b/src/phases/login-phase.ts @@ -1,12 +1,12 @@ import { updateUserInfo } from "#app/account"; -import { bypassLogin } from "#app/global-vars/bypass-login"; import { globalScene } from "#app/global-scene"; +import { bypassLogin } from "#app/global-vars/bypass-login"; import { Phase } from "#app/phase"; import { handleTutorial, Tutorial } from "#app/tutorial"; import { UiMode } from "#enums/ui-mode"; +import { executeIf, sessionIdKey } from "#utils/common"; +import { getCookie, removeCookie } from "#utils/cookies"; import i18next, { t } from "i18next"; -import { sessionIdKey, executeIf } from "#app/utils/common"; -import { getCookie, removeCookie } from "#app/utils/cookies"; export class LoginPhase extends Phase { public readonly phaseName = "LoginPhase"; diff --git a/src/phases/modifier-reward-phase.ts b/src/phases/modifier-reward-phase.ts index 29bbe215fc0..b84985b7311 100644 --- a/src/phases/modifier-reward-phase.ts +++ b/src/phases/modifier-reward-phase.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import type { ModifierType } from "#app/modifier/modifier-type"; -import type { ModifierTypeFunc } from "#app/@types/modifier-types"; -import { getModifierType } from "#app/utils/modifier-utils"; +import type { ModifierType } from "#modifiers/modifier-type"; +import { BattlePhase } from "#phases/battle-phase"; +import type { ModifierTypeFunc } from "#types/modifier-types"; +import { getModifierType } from "#utils/modifier-utils"; import i18next from "i18next"; -import { BattlePhase } from "./battle-phase"; export class ModifierRewardPhase extends BattlePhase { // RibbonModifierRewardPhase extends ModifierRewardPhase and to make typescript happy diff --git a/src/phases/money-reward-phase.ts b/src/phases/money-reward-phase.ts index 52cb9ecb3ff..61153de8565 100644 --- a/src/phases/money-reward-phase.ts +++ b/src/phases/money-reward-phase.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { MoneyMultiplierModifier } from "#app/modifier/modifier"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { MoneyMultiplierModifier } from "#modifiers/modifier"; +import { BattlePhase } from "#phases/battle-phase"; +import { NumberHolder } from "#utils/common"; import i18next from "i18next"; -import { NumberHolder } from "#app/utils/common"; -import { BattlePhase } from "./battle-phase"; export class MoneyRewardPhase extends BattlePhase { public readonly phaseName = "MoneyRewardPhase"; diff --git a/src/phases/move-anim-phase.ts b/src/phases/move-anim-phase.ts index 383841a0146..b8563fbb997 100644 --- a/src/phases/move-anim-phase.ts +++ b/src/phases/move-anim-phase.ts @@ -1,5 +1,5 @@ -import type { MoveAnim } from "#app/data/battle-anims"; import { Phase } from "#app/phase"; +import type { MoveAnim } from "#data/battle-anims"; /** * Plays the given {@linkcode MoveAnim} sequentially. diff --git a/src/phases/move-charge-phase.ts b/src/phases/move-charge-phase.ts index 51b8fe96ff6..0c83db10511 100644 --- a/src/phases/move-charge-phase.ts +++ b/src/phases/move-charge-phase.ts @@ -1,15 +1,15 @@ import { globalScene } from "#app/global-scene"; +import { MoveChargeAnim } from "#data/battle-anims"; import type { BattlerIndex } from "#enums/battler-index"; -import { MoveChargeAnim } from "#app/data/battle-anims"; -import { applyMoveChargeAttrs } from "#app/data/moves/apply-attrs"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#enums/move-result"; -import { BooleanHolder } from "#app/utils/common"; -import { PokemonPhase } from "#app/phases/pokemon-phase"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveResult } from "#enums/move-result"; import type { MoveUseMode } from "#enums/move-use-mode"; -import type { ChargingMove } from "#app/@types/move-types"; +import type { Pokemon } from "#field/pokemon"; +import { applyMoveChargeAttrs } from "#moves/apply-attrs"; +import type { PokemonMove } from "#moves/pokemon-move"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import type { ChargingMove } from "#types/move-types"; +import { BooleanHolder } from "#utils/common"; /** * Phase for the "charging turn" of two-turn moves (e.g. Dig). diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 610d670dcb9..4446b2071d0 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -1,32 +1,27 @@ -import { BattlerIndex } from "#enums/battler-index"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { ConditionalProtectTag } from "#app/data/arena-tag"; +import { getPokemonNameWithAffix } from "#app/messages"; +import type { Phase } from "#app/phase"; +import { ConditionalProtectTag } from "#data/arena-tag"; +import { MoveAnim } from "#data/battle-anims"; +import { DamageProtectedTag, ProtectedTag, SemiInvulnerableTag, SubstituteTag, TypeBoostTag } from "#data/battler-tags"; +import { SpeciesFormChangePostMoveTrigger } from "#data/form-change-triggers"; +import type { TypeDamageMultiplier } from "#data/type"; import { ArenaTagSide } from "#enums/arena-tag-side"; -import { MoveAnim } from "#app/data/battle-anims"; -import { - DamageProtectedTag, - ProtectedTag, - SemiInvulnerableTag, - SubstituteTag, - TypeBoostTag, -} from "#app/data/battler-tags"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import type { MoveAttr } from "#app/data/moves/move"; -import { getMoveTargets } from "#app/data/moves/move-utils"; -import { applyFilteredMoveAttrs, applyMoveAttrs } from "#app/data/moves/apply-attrs"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { HitCheckResult } from "#enums/hit-check-result"; +import { HitResult } from "#enums/hit-result"; +import { MoveCategory } from "#enums/MoveCategory"; import { MoveEffectTrigger } from "#enums/MoveEffectTrigger"; import { MoveFlags } from "#enums/MoveFlags"; import { MoveTarget } from "#enums/MoveTarget"; -import { MoveCategory } from "#enums/MoveCategory"; -import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { PokemonType } from "#enums/pokemon-type"; -import type { DamageResult, TurnMove } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; +import { MoveId } from "#enums/move-id"; import { MoveResult } from "#enums/move-result"; -import { HitResult } from "#enums/hit-result"; -import { getPokemonNameWithAffix } from "#app/messages"; +import { isReflected, isVirtual, MoveUseMode } from "#enums/move-use-mode"; +import { PokemonType } from "#enums/pokemon-type"; +import type { Pokemon } from "#field/pokemon"; import { ContactHeldItemTransferChanceModifier, DamageMoneyRewardModifier, @@ -35,20 +30,18 @@ import { FlinchChanceModifier, HitHealModifier, PokemonMultiHitModifier, -} from "#app/modifier/modifier"; -import { PokemonPhase } from "#app/phases/pokemon-phase"; -import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#app/utils/common"; -import type { nil } from "#app/utils/common"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { MoveId } from "#enums/move-id"; +} from "#modifiers/modifier"; +import { applyFilteredMoveAttrs, applyMoveAttrs } from "#moves/apply-attrs"; +import type { Move, MoveAttr } from "#moves/move"; +import { getMoveTargets, isFieldTargeted } from "#moves/move-utils"; +import { PokemonMove } from "#moves/pokemon-move"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import { DamageAchv } from "#system/achv"; +import type { DamageResult } from "#types/damage-result"; +import type { TurnMove } from "#types/turn-move"; +import type { nil } from "#utils/common"; +import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#utils/common"; import i18next from "i18next"; -import type { Phase } from "#app/phase"; -import type { TypeDamageMultiplier } from "#app/data/type"; -import { HitCheckResult } from "#enums/hit-check-result"; -import type Move from "#app/data/moves/move"; -import { isFieldTargeted } from "#app/data/moves/move-utils"; -import { DamageAchv } from "#app/system/achv"; -import { isVirtual, isReflected, MoveUseMode } from "#enums/move-use-mode"; export type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier]; @@ -431,9 +424,15 @@ export class MoveEffectPhase extends PokemonPhase { * @param user - The {@linkcode Pokemon} using this phase's invoked move * @param target - {@linkcode Pokemon} the current target of this phase's invoked move * @param hitResult - The {@linkcode HitResult} of the attempted move + * @param wasCritical - `true` if the move was a critical hit */ - protected applyOnGetHitAbEffects(user: Pokemon, target: Pokemon, hitResult: HitResult): void { - applyAbAttrs("PostDefendAbAttr", { pokemon: target, opponent: user, move: this.move, hitResult }); + protected applyOnGetHitAbEffects(user: Pokemon, target: Pokemon, hitResult: HitResult, wasCritical = false): void { + const params = { pokemon: target, opponent: user, move: this.move, hitResult }; + applyAbAttrs("PostDefendAbAttr", params); + + if (wasCritical) { + applyAbAttrs("PostReceiveCritStatStageChangeAbAttr", params); + } target.lapseTags(BattlerTagLapseType.AFTER_HIT); } @@ -787,12 +786,12 @@ export class MoveEffectPhase extends PokemonPhase { this.triggerMoveEffects(MoveEffectTrigger.PRE_APPLY, user, target); - const hitResult = this.applyMove(user, target, effectiveness); + const [hitResult, wasCritical] = this.applyMove(user, target, effectiveness); // Apply effects to the user (always) and the target (if not blocked by substitute). this.triggerMoveEffects(MoveEffectTrigger.POST_APPLY, user, target, firstTarget, true); if (!this.move.hitsSubstitute(user, target)) { - this.applyOnTargetEffects(user, target, hitResult, firstTarget); + this.applyOnTargetEffects(user, target, hitResult, firstTarget, wasCritical); } if (this.lastHit) { globalScene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger); @@ -812,8 +811,9 @@ export class MoveEffectPhase extends PokemonPhase { * @param user - The {@linkcode Pokemon} using this phase's invoked move * @param target - The {@linkcode Pokemon} targeted by the move * @param effectiveness - The effectiveness of the move against the target + * @returns The {@linkcode HitResult} of the move against the target and a boolean indicating whether the target was crit */ - protected applyMoveDamage(user: Pokemon, target: Pokemon, effectiveness: TypeDamageMultiplier): HitResult { + protected applyMoveDamage(user: Pokemon, target: Pokemon, effectiveness: TypeDamageMultiplier): [HitResult, boolean] { const isCritical = target.getCriticalHitResult(user, this.move); /* @@ -844,7 +844,7 @@ export class MoveEffectPhase extends PokemonPhase { const isOneHitKo = result === HitResult.ONE_HIT_KO; if (!dmg) { - return result; + return [result, false]; } target.lapseTags(BattlerTagLapseType.HIT); @@ -872,7 +872,7 @@ export class MoveEffectPhase extends PokemonPhase { } if (damage <= 0) { - return result; + return [result, isCritical]; } if (user.isPlayer()) { @@ -901,7 +901,7 @@ export class MoveEffectPhase extends PokemonPhase { globalScene.applyModifiers(DamageMoneyRewardModifier, true, user, new NumberHolder(damage)); } - return result; + return [result, isCritical]; } /** @@ -955,17 +955,17 @@ export class MoveEffectPhase extends PokemonPhase { * @param target - The {@linkcode Pokemon} struck by the move * @param effectiveness - The effectiveness of the move against the target */ - protected applyMove(user: Pokemon, target: Pokemon, effectiveness: TypeDamageMultiplier): HitResult { + protected applyMove(user: Pokemon, target: Pokemon, effectiveness: TypeDamageMultiplier): [HitResult, boolean] { const moveCategory = user.getMoveCategory(target, this.move); if (moveCategory === MoveCategory.STATUS) { - return HitResult.STATUS; + return [HitResult.STATUS, false]; } const result = this.applyMoveDamage(user, target, effectiveness); if (user.turnData.hitsLeft === 1 || target.isFainted()) { - this.queueHitResultMessage(result); + this.queueHitResultMessage(result[0]); } if (target.isFainted()) { @@ -982,8 +982,15 @@ export class MoveEffectPhase extends PokemonPhase { * @param target - The {@linkcode Pokemon} targeted by the move * @param hitResult - The {@linkcode HitResult} obtained from applying the move * @param firstTarget - `true` if the target is the first Pokemon hit by the attack + * @param wasCritical - `true` if the move was a critical hit */ - protected applyOnTargetEffects(user: Pokemon, target: Pokemon, hitResult: HitResult, firstTarget: boolean): void { + protected applyOnTargetEffects( + user: Pokemon, + target: Pokemon, + hitResult: HitResult, + firstTarget: boolean, + wasCritical = false, + ): void { /** Does {@linkcode hitResult} indicate that damage was dealt to the target? */ const dealsDamage = [ HitResult.EFFECTIVE, @@ -994,7 +1001,7 @@ export class MoveEffectPhase extends PokemonPhase { this.triggerMoveEffects(MoveEffectTrigger.POST_APPLY, user, target, firstTarget, false); this.applyHeldItemFlinchCheck(user, target, dealsDamage); - this.applyOnGetHitAbEffects(user, target, hitResult); + this.applyOnGetHitAbEffects(user, target, hitResult, wasCritical); applyAbAttrs("PostAttackAbAttr", { pokemon: user, opponent: target, move: this.move, hitResult }); // We assume only enemy Pokemon are able to have the EnemyAttackStatusEffectChanceModifier from tokens diff --git a/src/phases/move-end-phase.ts b/src/phases/move-end-phase.ts index 7e1006c74e8..fd893c445ff 100644 --- a/src/phases/move-end-phase.ts +++ b/src/phases/move-end-phase.ts @@ -1,9 +1,9 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { PokemonPhase } from "./pokemon-phase"; import type { BattlerIndex } from "#enums/battler-index"; -import type Pokemon from "#app/field/pokemon"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; +import type { Pokemon } from "#field/pokemon"; +import { PokemonPhase } from "#phases/pokemon-phase"; export class MoveEndPhase extends PokemonPhase { public readonly phaseName = "MoveEndPhase"; diff --git a/src/phases/move-header-phase.ts b/src/phases/move-header-phase.ts index 8c2d184c3f5..5c69dcd1217 100644 --- a/src/phases/move-header-phase.ts +++ b/src/phases/move-header-phase.ts @@ -1,7 +1,7 @@ -import { applyMoveAttrs } from "#app/data/moves/apply-attrs"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import { BattlePhase } from "./battle-phase"; +import type { Pokemon } from "#field/pokemon"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import type { PokemonMove } from "#moves/pokemon-move"; +import { BattlePhase } from "#phases/battle-phase"; export class MoveHeaderPhase extends BattlePhase { public readonly phaseName = "MoveHeaderPhase"; diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index ef376dc5957..09a542861be 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -1,33 +1,34 @@ -import { BattlerIndex } from "#enums/battler-index"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import type { DelayedAttackTag } from "#app/data/arena-tag"; -import { CommonAnim } from "#enums/move-anims-common"; -import { CenterOfAttentionTag } from "#app/data/battler-tags"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { applyMoveAttrs } from "#app/data/moves/apply-attrs"; -import { allMoves } from "#app/data/data-lists"; -import { MoveFlags } from "#enums/MoveFlags"; -import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect"; -import { PokemonType } from "#enums/pokemon-type"; -import { getTerrainBlockMessage, getWeatherBlockMessage } from "#app/data/weather"; -import { MoveUsedEvent } from "#app/events/battle-scene"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#enums/move-result"; import { getPokemonNameWithAffix } from "#app/messages"; import Overrides from "#app/overrides"; -import { BattlePhase } from "#app/phases/battle-phase"; -import { enumValueToKey, NumberHolder } from "#app/utils/common"; +import type { DelayedAttackTag } from "#data/arena-tag"; +import { CenterOfAttentionTag } from "#data/battler-tags"; +import { SpeciesFormChangePreMoveTrigger } from "#data/form-change-triggers"; +import { getStatusEffectActivationText, getStatusEffectHealText } from "#data/status-effect"; +import { getTerrainBlockMessage } from "#data/terrain"; +import { getWeatherBlockMessage } from "#data/weather"; import { AbilityId } from "#enums/ability-id"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveFlags } from "#enums/MoveFlags"; +import { CommonAnim } from "#enums/move-anims-common"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { isIgnorePP, isIgnoreStatus, isReflected, isVirtual, MoveUseMode } from "#enums/move-use-mode"; +import { PokemonType } from "#enums/pokemon-type"; import { StatusEffect } from "#enums/status-effect"; +import { MoveUsedEvent } from "#events/battle-scene"; +import type { Pokemon } from "#field/pokemon"; +import { applyMoveAttrs } from "#moves/apply-attrs"; +import { frenzyMissFunc } from "#moves/move-utils"; +import type { PokemonMove } from "#moves/pokemon-move"; +import { BattlePhase } from "#phases/battle-phase"; +import { NumberHolder } from "#utils/common"; +import { enumValueToKey } from "#utils/enums"; import i18next from "i18next"; -import { isVirtual, isIgnorePP, isReflected, MoveUseMode, isIgnoreStatus } from "#enums/move-use-mode"; -import { frenzyMissFunc } from "#app/data/moves/move-utils"; export class MovePhase extends BattlePhase { public readonly phaseName = "MovePhase"; @@ -35,11 +36,11 @@ export class MovePhase extends BattlePhase { protected _move: PokemonMove; protected _targets: BattlerIndex[]; public readonly useMode: MoveUseMode; // Made public for quash + /** Whether the current move is forced last (used for Quash). */ protected forcedLast: boolean; - - /** Whether the current move should fail but still use PP */ + /** Whether the current move should fail but still use PP. */ protected failed = false; - /** Whether the current move should cancel and retain PP */ + /** Whether the current move should fail and retain PP. */ protected cancelled = false; public get pokemon(): Pokemon { @@ -164,6 +165,7 @@ export class MovePhase extends BattlePhase { this.resolveFinalPreMoveCancellationChecks(); } + // Cancel, charge or use the move as applicable. if (this.cancelled || this.failed) { this.handlePreMoveFailures(); } else if (this.move.getMove().isChargingMove() && !this.pokemon.getTag(BattlerTagType.CHARGING)) { @@ -281,8 +283,7 @@ export class MovePhase extends BattlePhase { protected lapsePreMoveAndMoveTags(): void { this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE); - // TODO: does this intentionally happen before the no targets/MoveId.NONE on queue cancellation case is checked? - // (In other words, check if truant can proc on a move w/o targets) + // This intentionally happens before moves without targets are cancelled (Truant takes priority over lack of targets) if (!isIgnoreStatus(this.useMode) && this.canMove() && !this.cancelled) { this.pokemon.lapseTags(BattlerTagLapseType.MOVE); } @@ -296,44 +297,27 @@ export class MovePhase extends BattlePhase { // form changes happen even before we know that the move wll execute. globalScene.triggerPokemonFormChange(this.pokemon, SpeciesFormChangePreMoveTrigger); - const isDelayedAttack = move.hasAttr("DelayedAttackAttr"); - if (isDelayedAttack) { - // Check the player side arena if future sight is active - const futureSightTags = globalScene.arena.findTags(t => t.tagType === ArenaTagType.FUTURE_SIGHT); - const doomDesireTags = globalScene.arena.findTags(t => t.tagType === ArenaTagType.DOOM_DESIRE); - let fail = false; + // Check the player side arena if another delayed attack is active and hitting the same slot. + if (move.hasAttr("DelayedAttackAttr")) { const currentTargetIndex = targets[0].getBattlerIndex(); - for (const tag of futureSightTags) { - if ((tag as DelayedAttackTag).targetIndex === currentTargetIndex) { - fail = true; - break; - } - } - for (const tag of doomDesireTags) { - if ((tag as DelayedAttackTag).targetIndex === currentTargetIndex) { - fail = true; - break; - } - } - if (fail) { - this.showMoveText(); - this.showFailedText(); - this.end(); + const delayedAttackHittingSameSlot = globalScene.arena.tags.some( + tag => + (tag.tagType === ArenaTagType.FUTURE_SIGHT || tag.tagType === ArenaTagType.DOOM_DESIRE) && + (tag as DelayedAttackTag).targetIndex === currentTargetIndex, + ); + + if (delayedAttackHittingSameSlot) { + this.failMove(true); return; } } - let success = true; - // Check if there are any attributes that can interrupt the move, overriding the fail message. - for (const move of this.move.getMove().getAttrs("PreUseInterruptAttr")) { - if (move.apply(this.pokemon, targets[0], this.move.getMove())) { - success = false; - break; - } - } - - if (success) { - this.showMoveText(); + // Check if the move has any attributes that can interrupt its own use **before** displaying text. + // TODO: This should not rely on direct return values + let failed = move.getAttrs("PreUseInterruptAttr").some(attr => attr.apply(this.pokemon, targets[0], move)); + if (failed) { + this.failMove(false); + return; } // Clear out any two turn moves once they've been used. @@ -341,6 +325,7 @@ export class MovePhase extends BattlePhase { // Move queues should be handled by the calling `CommandPhase` or a manager for it // @ts-expect-error - useMode is readonly and shouldn't normally be assigned to this.useMode = moveQueue.shift()?.useMode ?? this.useMode; + if (this.pokemon.getTag(BattlerTagType.CHARGING)?.sourceMove === this.move.moveId) { this.pokemon.lapseTag(BattlerTagType.CHARGING); } @@ -348,136 +333,145 @@ export class MovePhase extends BattlePhase { if (!isIgnorePP(this.useMode)) { // "commit" to using the move, deducting PP. const ppUsed = 1 + this.getPpIncreaseFromPressure(targets); - this.move.usePp(ppUsed); - globalScene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, move, this.move.ppUsed)); + globalScene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon.id, move, this.move.ppUsed)); } /** * Determine if the move is successful (meaning that its damage/effects can be attempted) * by checking that all of the following are true: * - Conditional attributes of the move are all met - * - The target's `ForceSwitchOutImmunityAbAttr` is not triggered (see {@linkcode Move.prototype.applyConditions}) * - Weather does not block the move * - Terrain does not block the move - * - * TODO: These steps are straightforward, but the implementation below is extremely convoluted. */ /** * Move conditions assume the move has a single target * TODO: is this sustainable? */ - let failedDueToTerrain = false; - let failedDueToWeather = false; - if (success) { - const passesConditions = move.applyConditions(this.pokemon, targets[0], move); - failedDueToWeather = globalScene.arena.isMoveWeatherCancelled(this.pokemon, move); - failedDueToTerrain = globalScene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, move); - success = passesConditions && !failedDueToWeather && !failedDueToTerrain; + const failsConditions = !move.applyConditions(this.pokemon, targets[0], move); + const failedDueToWeather = globalScene.arena.isMoveWeatherCancelled(this.pokemon, move); + const failedDueToTerrain = globalScene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, move); + failed ||= failsConditions || failedDueToWeather || failedDueToTerrain; + + if (failed) { + this.failMove(true, failedDueToWeather, failedDueToTerrain); + return; } - // Update the battle's "last move" pointer, unless we're currently mimicking a move. - if (!allMoves[this.move.moveId].hasAttr("CopyMoveAttr")) { - // The last move used is unaffected by moves that fail - if (success) { - globalScene.currentBattle.lastMove = this.move.moveId; - } + this.executeMove(); + } + + /** Execute the current move and apply its effects. */ + private executeMove() { + const move = this.move.getMove(); + const targets = this.getActiveTargetPokemon(); + + // Update the battle's "last move" pointer unless we're currently mimicking a move or triggering Dancer. + if (!move.hasAttr("CopyMoveAttr") && !isReflected(this.useMode)) { + globalScene.currentBattle.lastMove = move.id; } - /** - * If the move has not failed, trigger ability-based user type changes and then execute it. - * - * Notably, Roar, Whirlwind, Trick-or-Treat, and Forest's Curse will trigger these type changes even - * if the move fails. - */ - if (success) { - const move = this.move.getMove(); - // TODO: Investigate whether PokemonTypeChangeAbAttr can drop the "opponent" parameter - applyAbAttrs("PokemonTypeChangeAbAttr", { pokemon: this.pokemon, move, opponent: targets[0] }); - globalScene.phaseManager.unshiftNew( - "MoveEffectPhase", - this.pokemon.getBattlerIndex(), - this.targets, - move, - this.useMode, - ); - } else { - if ([MoveId.ROAR, MoveId.WHIRLWIND, MoveId.TRICK_OR_TREAT, MoveId.FORESTS_CURSE].includes(this.move.moveId)) { - applyAbAttrs("PokemonTypeChangeAbAttr", { - pokemon: this.pokemon, - move: this.move.getMove(), - opponent: targets[0], - }); - } - - this.pokemon.pushMoveHistory({ - move: this.move.moveId, - targets: this.targets, - result: MoveResult.FAIL, - useMode: this.useMode, - }); - - const failureMessage = move.getFailedText(this.pokemon, targets[0], move); - let failedText: string | undefined; - if (failureMessage) { - failedText = failureMessage; - } else if (failedDueToTerrain) { - failedText = getTerrainBlockMessage(targets[0], globalScene.arena.getTerrainType()); - } else if (failedDueToWeather) { - failedText = getWeatherBlockMessage(globalScene.arena.getWeatherType()); - } - - this.showFailedText(failedText); - - // Remove the user from its semi-invulnerable state (if applicable) - this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); - } + // Trigger ability-based user type changes, display move text and then execute move effects. + // TODO: Investigate whether PokemonTypeChangeAbAttr can drop the "opponent" parameter + applyAbAttrs("PokemonTypeChangeAbAttr", { pokemon: this.pokemon, move, opponent: targets[0] }); + this.showMoveText(); + globalScene.phaseManager.unshiftNew( + "MoveEffectPhase", + this.pokemon.getBattlerIndex(), + this.targets, + move, + this.useMode, + ); // Handle Dancer, which triggers immediately after a move is used (rather than waiting on `this.end()`). // Note the MoveUseMode check here prevents an infinite Dancer loop. + // TODO: This needs to go at the end of `MoveEffectPhase` to check move results const dancerModes: MoveUseMode[] = [MoveUseMode.INDIRECT, MoveUseMode.REFLECTED] as const; if (this.move.getMove().hasFlag(MoveFlags.DANCE_MOVE) && !dancerModes.includes(this.useMode)) { - // TODO: Fix in dancer PR to move to MEP for hit checks globalScene.getField(true).forEach(pokemon => { applyAbAttrs("PostMoveUsedAbAttr", { pokemon, move: this.move, source: this.pokemon, targets: this.targets }); }); } } - /** Queues a {@linkcode MoveChargePhase} for this phase's invoked move. */ + /** + * Fail the move currently being used. + * Handles failure messages, pushing to move history, etc. + * @param showText - Whether to show move text when failing the move. + * @param failedDueToWeather - Whether the move failed due to weather (default `false`) + * @param failedDueToTerrain - Whether the move failed due to terrain (default `false`) + */ + protected failMove(showText: boolean, failedDueToWeather = false, failedDueToTerrain = false) { + const move = this.move.getMove(); + const targets = this.getActiveTargetPokemon(); + + // DO NOT CHANGE THE ORDER OF OPERATIONS HERE! + // Protean is supposed to trigger its effects first, _then_ move text is displayed, + // _then_ any blockage messages are shown. + + // Roar, Whirlwind, Trick-or-Treat, and Forest's Curse will trigger Protean/Libero + // even on failure, as will all moves blocked by terrain. + // TODO: Verify if this also applies to primal weather failures + if ( + failedDueToTerrain || + [MoveId.ROAR, MoveId.WHIRLWIND, MoveId.TRICK_OR_TREAT, MoveId.FORESTS_CURSE].includes(this.move.moveId) + ) { + applyAbAttrs("PokemonTypeChangeAbAttr", { + pokemon: this.pokemon, + move, + opponent: targets[0], + }); + } + + if (showText) { + this.showMoveText(); + } + + this.pokemon.pushMoveHistory({ + move: this.move.moveId, + targets: this.targets, + result: MoveResult.FAIL, + useMode: this.useMode, + }); + + // Use move-specific failure messages if present before checking terrain/weather blockage + // and falling back to the classic "But it failed!". + const failureMessage = + move.getFailedText(this.pokemon, targets[0], move) || + (failedDueToTerrain + ? getTerrainBlockMessage(targets[0], globalScene.arena.getTerrainType()) + : failedDueToWeather + ? getWeatherBlockMessage(globalScene.arena.getWeatherType()) + : i18next.t("battle:attackFailed")); + + this.showFailedText(failureMessage); + + // Remove the user from its semi-invulnerable state (if applicable) + this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); + } + + /** + * Queue a {@linkcode MoveChargePhase} for this phase's invoked move. + * Does NOT consume PP (occurs on the 2nd strike of the move) + */ protected chargeMove() { const move = this.move.getMove(); const targets = this.getActiveTargetPokemon(); - this.showMoveText(); - - // Conditions currently assume single target - // TODO: Is this sustainable? if (!move.applyConditions(this.pokemon, targets[0], move)) { - this.pokemon.pushMoveHistory({ - move: this.move.moveId, - targets: this.targets, - result: MoveResult.FAIL, - useMode: this.useMode, - }); - - const failureMessage = move.getFailedText(this.pokemon, targets[0], move); - this.showMoveText(); - this.showFailedText(failureMessage ?? undefined); - - // Remove the user from its semi-invulnerable state (if applicable) - this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); + this.failMove(true); return; } - // Protean and Libero apply on the charging turn of charge moves + // Protean and Libero apply on the charging turn of charge moves, even before showing usage text applyAbAttrs("PokemonTypeChangeAbAttr", { pokemon: this.pokemon, - move: this.move.getMove(), + move, opponent: targets[0], }); + this.showMoveText(); globalScene.phaseManager.unshiftNew( "MoveChargePhase", this.pokemon.getBattlerIndex(), @@ -488,7 +482,7 @@ export class MovePhase extends BattlePhase { } /** - * Queues a {@linkcode MoveEndPhase} and then ends the phase + * Queue a {@linkcode MoveEndPhase} and then end this phase. */ public end(): void { globalScene.phaseManager.unshiftNew( @@ -502,15 +496,15 @@ export class MovePhase extends BattlePhase { } /** - * Applies PP increasing abilities (currently only {@link AbilityId.PRESSURE Pressure}) if they exist on the target pokemon. + * Applies PP increasing abilities (currently only {@linkcode AbilityId.PRESSURE | Pressure}) if they exist on the target pokemon. * Note that targets must include only active pokemon. * * TODO: This hardcodes the PP increase at 1 per opponent, rather than deferring to the ability. */ public getPpIncreaseFromPressure(targets: Pokemon[]): number { const foesWithPressure = this.pokemon - .getOpponents() - .filter(o => targets.includes(o) && o.isActive(true) && o.hasAbilityWithAttr("IncreasePpAbAttr")); + .getOpponents(true) + .filter(o => targets.includes(o) && o.hasAbilityWithAttr("IncreasePpAbAttr")); return foesWithPressure.length; } @@ -520,105 +514,113 @@ export class MovePhase extends BattlePhase { * - Counterattacks, which pass a special value into the `targets` constructor param (`[`{@linkcode BattlerIndex.ATTACKER}`]`). */ protected resolveRedirectTarget(): void { - if (this.targets.length === 1) { - const currentTarget = this.targets[0]; - const redirectTarget = new NumberHolder(currentTarget); + if (this.targets.length !== 1) { + // Spread moves cannot be redirected + return; + } - // check move redirection abilities of every pokemon *except* the user. - globalScene - .getField(true) - .filter(p => p !== this.pokemon) - .forEach(p => - applyAbAttrs("RedirectMoveAbAttr", { - pokemon: p, - moveId: this.move.moveId, - targetIndex: redirectTarget, - sourcePokemon: this.pokemon, - }), - ); + const currentTarget = this.targets[0]; + const redirectTarget = new NumberHolder(currentTarget); - /** `true` if an Ability is responsible for redirecting the move to another target; `false` otherwise */ - let redirectedByAbility = currentTarget !== redirectTarget.value; + // check move redirection abilities of every pokemon *except* the user. + globalScene + .getField(true) + .filter(p => p !== this.pokemon) + .forEach(pokemon => { + applyAbAttrs("RedirectMoveAbAttr", { + pokemon, + moveId: this.move.moveId, + targetIndex: redirectTarget, + sourcePokemon: this.pokemon, + }); + }); - // check for center-of-attention tags (note that this will override redirect abilities) - this.pokemon.getOpponents().forEach(p => { - const redirectTag = p.getTag(CenterOfAttentionTag); + /** `true` if an Ability is responsible for redirecting the move to another target; `false` otherwise */ + let redirectedByAbility = currentTarget !== redirectTarget.value; - // TODO: don't hardcode this interaction. - // Handle interaction between the rage powder center-of-attention tag and moves used by grass types/overcoat-havers (which are immune to RP's redirect) - if ( - redirectTag && - (!redirectTag.powder || - (!this.pokemon.isOfType(PokemonType.GRASS) && !this.pokemon.hasAbility(AbilityId.OVERCOAT))) - ) { - redirectTarget.value = p.getBattlerIndex(); - redirectedByAbility = false; + // check for center-of-attention tags (note that this will override redirect abilities) + this.pokemon.getOpponents(true).forEach(p => { + const redirectTag = p.getTag(CenterOfAttentionTag); + + // TODO: don't hardcode this interaction. + // Handle interaction between the rage powder center-of-attention tag and moves used by grass types/overcoat-havers (which are immune to RP's redirect) + if ( + redirectTag && + (!redirectTag.powder || + (!this.pokemon.isOfType(PokemonType.GRASS) && !this.pokemon.hasAbility(AbilityId.OVERCOAT))) + ) { + redirectTarget.value = p.getBattlerIndex(); + redirectedByAbility = false; + } + }); + + // TODO: Don't hardcode these ability interactions + if (currentTarget !== redirectTarget.value) { + const bypassRedirectAttrs = this.move.getMove().getAttrs("BypassRedirectAttr"); + bypassRedirectAttrs.forEach(attr => { + if (!attr.abilitiesOnly || redirectedByAbility) { + redirectTarget.value = currentTarget; } }); - if (currentTarget !== redirectTarget.value) { - const bypassRedirectAttrs = this.move.getMove().getAttrs("BypassRedirectAttr"); - bypassRedirectAttrs.forEach(attr => { - if (!attr.abilitiesOnly || redirectedByAbility) { - redirectTarget.value = currentTarget; - } - }); - - if (this.pokemon.hasAbilityWithAttr("BlockRedirectAbAttr")) { - redirectTarget.value = currentTarget; - // TODO: Ability displays should be handled by the ability - globalScene.phaseManager.queueAbilityDisplay( - this.pokemon, - this.pokemon.getPassiveAbility().hasAttr("BlockRedirectAbAttr"), - true, - ); - globalScene.phaseManager.queueAbilityDisplay( - this.pokemon, - this.pokemon.getPassiveAbility().hasAttr("BlockRedirectAbAttr"), - false, - ); - } - - this.targets[0] = redirectTarget.value; + if (this.pokemon.hasAbilityWithAttr("BlockRedirectAbAttr")) { + redirectTarget.value = currentTarget; + // TODO: Ability displays should be handled by the ability + globalScene.phaseManager.queueAbilityDisplay( + this.pokemon, + this.pokemon.getPassiveAbility().hasAttr("BlockRedirectAbAttr"), + true, + ); + globalScene.phaseManager.queueAbilityDisplay( + this.pokemon, + this.pokemon.getPassiveAbility().hasAttr("BlockRedirectAbAttr"), + false, + ); } + + this.targets[0] = redirectTarget.value; } } /** - * Counter-attacking moves pass in `[`{@linkcode BattlerIndex.ATTACKER}`]` into the constructor's `targets` param. - * This function modifies `this.targets` to reflect the actual battler index of the user's last - * attacker. + * Update the targets of any counter-attacking moves with `[`{@linkcode BattlerIndex.ATTACKER}`]` set + * to reflect the actual battler index of the user's last attacker. * - * If there is no last attacker, or they are no longer on the field, a message is displayed and the + * If there is no last attacker or they are no longer on the field, a message is displayed and the * move is marked for failure. + * @todo Make this a feature of the move rather than basing logic on {@linkcode BattlerIndex.ATTACKER} */ protected resolveCounterAttackTarget(): void { - if (this.targets.length === 1 && this.targets[0] === BattlerIndex.ATTACKER) { - if (this.pokemon.turnData.attacksReceived.length) { - this.targets[0] = this.pokemon.turnData.attacksReceived[0].sourceBattlerIndex; + if (this.targets.length !== 1 || this.targets[0] !== BattlerIndex.ATTACKER) { + return; + } - // account for metal burst and comeuppance hitting remaining targets in double battles - // counterattack will redirect to remaining ally if original attacker faints - if (globalScene.currentBattle.double && this.move.getMove().hasFlag(MoveFlags.REDIRECT_COUNTER)) { - if (globalScene.getField()[this.targets[0]].hp === 0) { - const opposingField = this.pokemon.isPlayer() ? globalScene.getEnemyField() : globalScene.getPlayerField(); - this.targets[0] = opposingField.find(p => p.hp > 0)?.getBattlerIndex() ?? BattlerIndex.ATTACKER; - } - } - } + // TODO: This should be covered in move conditions + if (this.pokemon.turnData.attacksReceived.length === 0) { + this.fail(); + this.showMoveText(); + this.showFailedText(); + return; + } - if (this.targets[0] === BattlerIndex.ATTACKER) { - this.fail(); - this.showMoveText(); - this.showFailedText(); - } + this.targets[0] = this.pokemon.turnData.attacksReceived[0].sourceBattlerIndex; + + // account for metal burst and comeuppance hitting remaining targets in double battles + // counterattack will redirect to remaining ally if original attacker faints + if ( + globalScene.currentBattle.double && + this.move.getMove().hasFlag(MoveFlags.REDIRECT_COUNTER) && + globalScene.getField()[this.targets[0]].hp === 0 + ) { + const opposingField = this.pokemon.isPlayer() ? globalScene.getEnemyField() : globalScene.getPlayerField(); + this.targets[0] = opposingField.find(p => p.hp > 0)?.getBattlerIndex() ?? BattlerIndex.ATTACKER; } } /** * Handles the case where the move was cancelled or failed: - * - Uses PP if the move failed (not cancelled) and should use PP (failed moves are not affected by {@link AbilityId.PRESSURE Pressure}) - * - Records a cancelled OR failed move in move history, so abilities like {@link AbilityId.TRUANT Truant} don't trigger on the + * - Uses PP if the move failed (not cancelled) and should use PP (failed moves are not affected by {@linkcode AbilityId.PRESSURE | Pressure}) + * - Records a cancelled OR failed move in move history, so abilities like {@linkcode AbilityId.TRUANT | Truant} don't trigger on the * next turn and soft-lock. * - Lapses `MOVE_EFFECT` tags: * - Semi-invulnerable battler tags (Fly/Dive/etc.) are intended to lapse on move effects, but also need @@ -626,52 +628,55 @@ export class MovePhase extends BattlePhase { * * TODO: ...this seems weird. * - Lapses `AFTER_MOVE` tags: - * - This handles the effects of {@link MoveId.SUBSTITUTE Substitute} + * - This handles the effects of {@linkcode MoveId.SUBSTITUTE | Substitute} * - Removes the second turn of charge moves */ protected handlePreMoveFailures(): void { - if (this.cancelled || this.failed) { - if (this.failed) { - const ppUsed = isIgnorePP(this.useMode) ? 0 : 1; - - if (ppUsed) { - this.move.usePp(); - } - - globalScene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), ppUsed)); - } - - if (this.cancelled && this.pokemon.summonData.tags?.find(t => t.tagType === BattlerTagType.FRENZY)) { - frenzyMissFunc(this.pokemon, this.move.getMove()); - } - - this.pokemon.pushMoveHistory({ - move: MoveId.NONE, - result: MoveResult.FAIL, - targets: this.targets, - useMode: this.useMode, - }); - - this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); - this.pokemon.lapseTags(BattlerTagLapseType.AFTER_MOVE); - - this.pokemon.getMoveQueue().shift(); + if (!this.cancelled && !this.failed) { + return; } + + if (this.failed) { + // TODO: should this consider struggle? + const ppUsed = isIgnorePP(this.useMode) ? 0 : 1; + this.move.usePp(ppUsed); + globalScene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), ppUsed)); + } + + if (this.cancelled && this.pokemon.summonData.tags.some(t => t.tagType === BattlerTagType.FRENZY)) { + frenzyMissFunc(this.pokemon, this.move.getMove()); + } + + this.pokemon.pushMoveHistory({ + move: MoveId.NONE, + result: MoveResult.FAIL, + targets: this.targets, + useMode: this.useMode, + }); + + this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT); + this.pokemon.lapseTags(BattlerTagLapseType.AFTER_MOVE); + + // This clears out 2 turn moves after they've been used + // TODO: Remove post move queue refactor + this.pokemon.getMoveQueue().shift(); } /** - * Displays the move's usage text to the player, unless it's a charge turn (ie: {@link MoveId.SOLAR_BEAM Solar Beam}), - * the pokemon is on a recharge turn (ie: {@link MoveId.HYPER_BEAM Hyper Beam}), or a 2-turn move was interrupted (ie: {@link MoveId.FLY Fly}). + * Displays the move's usage text to the player as applicable for the move being used. */ public showMoveText(): void { - if (this.move.moveId === MoveId.NONE) { - return; - } - - if (this.pokemon.getTag(BattlerTagType.RECHARGING) || this.pokemon.getTag(BattlerTagType.INTERRUPTED)) { + // No text for Moves.NONE, recharging/2-turn moves or interrupted moves + if ( + this.move.moveId === MoveId.NONE || + this.pokemon.getTag(BattlerTagType.RECHARGING) || + this.pokemon.getTag(BattlerTagType.INTERRUPTED) + ) { return; } + // Play message for magic coat reflection + // TODO: This should be done by the move... globalScene.phaseManager.queueMessage( i18next.t(isReflected(this.useMode) ? "battle:magicCoatActivated" : "battle:useMove", { pokemonNameWithAffix: getPokemonNameWithAffix(this.pokemon), @@ -685,7 +690,12 @@ export class MovePhase extends BattlePhase { applyMoveAttrs("PreMoveMessageAttr", this.pokemon, this.pokemon.getOpponents(false)[0], this.move.getMove()); } - public showFailedText(failedText: string = i18next.t("battle:attackFailed")): void { + /** + * Display the text for a move failing to execute. + * @param failedText - The failure text to display; defaults to `"battle:attackFailed"` locale key + * ("But it failed!" in english) + */ + public showFailedText(failedText = i18next.t("battle:attackFailed")): void { globalScene.phaseManager.queueMessage(failedText); } } diff --git a/src/phases/mystery-encounter-phases.ts b/src/phases/mystery-encounter-phases.ts index 9aae796211f..9363efcb460 100644 --- a/src/phases/mystery-encounter-phases.ts +++ b/src/phases/mystery-encounter-phases.ts @@ -1,22 +1,21 @@ -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import type { OptionPhaseCallback } from "#app/data/mystery-encounters/mystery-encounter-option"; -import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option"; -import { SeenEncounterData } from "#app/data/mystery-encounters/mystery-encounter-save-data"; -import { getEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; +import { globalScene } from "#app/global-scene"; +import { Phase } from "#app/phase"; +import { getCharVariantFromDialogue } from "#data/dialogue"; import { BattleSpec } from "#enums/battle-spec"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; import { SwitchType } from "#enums/switch-type"; -import i18next from "i18next"; -import { globalScene } from "#app/global-scene"; -import { getCharVariantFromDialogue } from "../data/dialogue"; -import type { OptionSelectSettings } from "../data/mystery-encounters/utils/encounter-phase-utils"; -import { transitionMysteryEncounterIntroVisuals } from "../data/mystery-encounters/utils/encounter-phase-utils"; import { TrainerSlot } from "#enums/trainer-slot"; -import { IvScannerModifier } from "../modifier/modifier"; -import { Phase } from "../phase"; import { UiMode } from "#enums/ui-mode"; -import { isNullOrUndefined, randSeedItem } from "#app/utils/common"; +import { IvScannerModifier } from "#modifiers/modifier"; +import { getEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { OptionSelectSettings } from "#mystery-encounters/encounter-phase-utils"; +import { transitionMysteryEncounterIntroVisuals } from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounterOption, OptionPhaseCallback } from "#mystery-encounters/mystery-encounter-option"; +import { SeenEncounterData } from "#mystery-encounters/mystery-encounter-save-data"; +import { isNullOrUndefined, randSeedItem } from "#utils/common"; +import i18next from "i18next"; /** * Will handle (in order): diff --git a/src/phases/new-battle-phase.ts b/src/phases/new-battle-phase.ts index 65ecc81df2d..b9a57161bd0 100644 --- a/src/phases/new-battle-phase.ts +++ b/src/phases/new-battle-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { BattlePhase } from "./battle-phase"; +import { BattlePhase } from "#phases/battle-phase"; export class NewBattlePhase extends BattlePhase { public readonly phaseName = "NewBattlePhase"; diff --git a/src/phases/new-biome-encounter-phase.ts b/src/phases/new-biome-encounter-phase.ts index 74476412401..db57671c4e3 100644 --- a/src/phases/new-biome-encounter-phase.ts +++ b/src/phases/new-biome-encounter-phase.ts @@ -1,7 +1,7 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { getRandomWeatherType } from "#app/data/weather"; -import { NextEncounterPhase } from "./next-encounter-phase"; +import { getRandomWeatherType } from "#data/weather"; +import { NextEncounterPhase } from "#phases/next-encounter-phase"; export class NewBiomeEncounterPhase extends NextEncounterPhase { public readonly phaseName = "NewBiomeEncounterPhase"; diff --git a/src/phases/next-encounter-phase.ts b/src/phases/next-encounter-phase.ts index c31b4b5bbc3..02b9dd7ed69 100644 --- a/src/phases/next-encounter-phase.ts +++ b/src/phases/next-encounter-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { EncounterPhase } from "./encounter-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; /** * The phase between defeating an encounter and starting another wild wave. diff --git a/src/phases/obtain-status-effect-phase.ts b/src/phases/obtain-status-effect-phase.ts index 78db8ae0a99..fbadbed205b 100644 --- a/src/phases/obtain-status-effect-phase.ts +++ b/src/phases/obtain-status-effect-phase.ts @@ -1,15 +1,15 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; -import { CommonBattleAnim } from "#app/data/battle-anims"; -import { CommonAnim } from "#enums/move-anims-common"; -import { getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect"; -import { StatusEffect } from "#app/enums/status-effect"; -import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; -import { PokemonPhase } from "./pokemon-phase"; -import { SpeciesFormChangeStatusEffectTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { isNullOrUndefined } from "#app/utils/common"; +import { CommonBattleAnim } from "#data/battle-anims"; +import { SpeciesFormChangeStatusEffectTrigger } from "#data/form-change-triggers"; +import { getStatusEffectObtainText, getStatusEffectOverlapText } from "#data/status-effect"; +import type { BattlerIndex } from "#enums/battler-index"; +import { CommonAnim } from "#enums/move-anims-common"; +import { StatusEffect } from "#enums/status-effect"; +import type { Pokemon } from "#field/pokemon"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import { isNullOrUndefined } from "#utils/common"; export class ObtainStatusEffectPhase extends PokemonPhase { public readonly phaseName = "ObtainStatusEffectPhase"; diff --git a/src/phases/party-heal-phase.ts b/src/phases/party-heal-phase.ts index 765c7dbad8e..80d8b315102 100644 --- a/src/phases/party-heal-phase.ts +++ b/src/phases/party-heal-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import { fixedInt } from "#app/utils/common"; -import { BattlePhase } from "./battle-phase"; +import { BattlePhase } from "#phases/battle-phase"; +import { fixedInt } from "#utils/common"; export class PartyHealPhase extends BattlePhase { public readonly phaseName = "PartyHealPhase"; diff --git a/src/phases/party-member-pokemon-phase.ts b/src/phases/party-member-pokemon-phase.ts index a782eabda38..9536dafda60 100644 --- a/src/phases/party-member-pokemon-phase.ts +++ b/src/phases/party-member-pokemon-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import type Pokemon from "#app/field/pokemon"; -import { FieldPhase } from "./field-phase"; +import type { Pokemon } from "#field/pokemon"; +import { FieldPhase } from "#phases/field-phase"; export abstract class PartyMemberPokemonPhase extends FieldPhase { protected partyMemberIndex: number; diff --git a/src/phases/player-party-member-pokemon-phase.ts b/src/phases/player-party-member-pokemon-phase.ts index d97376a8614..4538bb42325 100644 --- a/src/phases/player-party-member-pokemon-phase.ts +++ b/src/phases/player-party-member-pokemon-phase.ts @@ -1,5 +1,5 @@ -import type { PlayerPokemon } from "#app/field/pokemon"; -import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; +import type { PlayerPokemon } from "#field/pokemon"; +import { PartyMemberPokemonPhase } from "#phases/party-member-pokemon-phase"; export abstract class PlayerPartyMemberPokemonPhase extends PartyMemberPokemonPhase { constructor(partyMemberIndex: number) { diff --git a/src/phases/pokemon-anim-phase.ts b/src/phases/pokemon-anim-phase.ts index 314bddb981d..39e9c609aec 100644 --- a/src/phases/pokemon-anim-phase.ts +++ b/src/phases/pokemon-anim-phase.ts @@ -1,10 +1,10 @@ import { globalScene } from "#app/global-scene"; -import { SubstituteTag } from "#app/data/battler-tags"; -import type Pokemon from "#app/field/pokemon"; -import { BattlePhase } from "#app/phases/battle-phase"; -import { isNullOrUndefined } from "#app/utils/common"; +import { SubstituteTag } from "#data/battler-tags"; import { PokemonAnimType } from "#enums/pokemon-anim-type"; import { SpeciesId } from "#enums/species-id"; +import type { Pokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; +import { isNullOrUndefined } from "#utils/common"; export class PokemonAnimPhase extends BattlePhase { public readonly phaseName = "PokemonAnimPhase"; diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index cf6cf40a923..fa6a3222466 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -1,17 +1,17 @@ import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; -import { CommonAnim } from "#enums/move-anims-common"; -import { getStatusEffectHealText } from "#app/data/status-effect"; -import { StatusEffect } from "#app/enums/status-effect"; -import { HitResult } from "#enums/hit-result"; import { getPokemonNameWithAffix } from "#app/messages"; -import { HealingBoosterModifier } from "#app/modifier/modifier"; -import { HealAchv } from "#app/system/achv"; +import type { HealBlockTag } from "#data/battler-tags"; +import { getStatusEffectHealText } from "#data/status-effect"; +import type { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { HitResult } from "#enums/hit-result"; +import { CommonAnim } from "#enums/move-anims-common"; +import { StatusEffect } from "#enums/status-effect"; +import { HealingBoosterModifier } from "#modifiers/modifier"; +import { CommonAnimPhase } from "#phases/common-anim-phase"; +import { HealAchv } from "#system/achv"; +import { NumberHolder } from "#utils/common"; import i18next from "i18next"; -import { NumberHolder } from "#app/utils/common"; -import { CommonAnimPhase } from "./common-anim-phase"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { HealBlockTag } from "#app/data/battler-tags"; export class PokemonHealPhase extends CommonAnimPhase { public readonly phaseName = "PokemonHealPhase"; diff --git a/src/phases/pokemon-phase.ts b/src/phases/pokemon-phase.ts index cfa30f0d06e..9739c58d667 100644 --- a/src/phases/pokemon-phase.ts +++ b/src/phases/pokemon-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { BattlerIndex } from "#enums/battler-index"; -import type Pokemon from "#app/field/pokemon"; -import { FieldPhase } from "./field-phase"; +import type { Pokemon } from "#field/pokemon"; +import { FieldPhase } from "#phases/field-phase"; export abstract class PokemonPhase extends FieldPhase { /** diff --git a/src/phases/pokemon-transform-phase.ts b/src/phases/pokemon-transform-phase.ts index 938915309d9..143c47886b6 100644 --- a/src/phases/pokemon-transform-phase.ts +++ b/src/phases/pokemon-transform-phase.ts @@ -1,11 +1,11 @@ +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; import type { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; -import { EFFECTIVE_STATS, BATTLE_STATS } from "#enums/stat"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { globalScene } from "#app/global-scene"; -import { PokemonPhase } from "./pokemon-phase"; -import { getPokemonNameWithAffix } from "#app/messages"; +import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; +import { PokemonMove } from "#moves/pokemon-move"; +import { PokemonPhase } from "#phases/pokemon-phase"; import i18next from "i18next"; /** @@ -26,7 +26,7 @@ export class PokemonTransformPhase extends PokemonPhase { public override start(): void { const user = this.getPokemon(); - const target = globalScene.getField(true).find(p => p.getBattlerIndex() === this.targetIndex); + const target = globalScene.getField()[this.targetIndex]; if (!target) { this.end(); @@ -58,6 +58,8 @@ export class PokemonTransformPhase extends PokemonPhase { console.warn(`Transform: somehow iterating over a ${m} value when copying moveset!`); return new PokemonMove(MoveId.NONE); }); + + // TODO: This should fallback to the target's original typing if none are left (from Burn Up, etc.) user.summonData.types = target.getTypes(); const promises = [user.updateInfo()]; diff --git a/src/phases/post-game-over-phase.ts b/src/phases/post-game-over-phase.ts index 8e19dcd5498..3ac112a8a8b 100644 --- a/src/phases/post-game-over-phase.ts +++ b/src/phases/post-game-over-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; -import type { EndCardPhase } from "./end-card-phase"; +import type { EndCardPhase } from "#phases/end-card-phase"; export class PostGameOverPhase extends Phase { public readonly phaseName = "PostGameOverPhase"; diff --git a/src/phases/post-summon-activate-ability-phase.ts b/src/phases/post-summon-activate-ability-phase.ts index b1079a9b3e5..5f790c01ad1 100644 --- a/src/phases/post-summon-activate-ability-phase.ts +++ b/src/phases/post-summon-activate-ability-phase.ts @@ -1,6 +1,6 @@ -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { PostSummonPhase } from "#app/phases/post-summon-phase"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import type { BattlerIndex } from "#enums/battler-index"; +import { PostSummonPhase } from "#phases/post-summon-phase"; /** * Helper to {@linkcode PostSummonPhase} which applies abilities diff --git a/src/phases/post-summon-phase.ts b/src/phases/post-summon-phase.ts index 7f22148fdcf..e0811d0ab93 100644 --- a/src/phases/post-summon-phase.ts +++ b/src/phases/post-summon-phase.ts @@ -1,10 +1,10 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { ArenaTrapTag } from "#app/data/arena-tag"; -import { StatusEffect } from "#app/enums/status-effect"; -import { PokemonPhase } from "./pokemon-phase"; -import { MysteryEncounterPostSummonTag } from "#app/data/battler-tags"; +import { ArenaTrapTag } from "#data/arena-tag"; +import { MysteryEncounterPostSummonTag } from "#data/battler-tags"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; +import { StatusEffect } from "#enums/status-effect"; +import { PokemonPhase } from "#phases/pokemon-phase"; export class PostSummonPhase extends PokemonPhase { public readonly phaseName = "PostSummonPhase"; diff --git a/src/phases/post-turn-status-effect-phase.ts b/src/phases/post-turn-status-effect-phase.ts index fd7dd6ed419..9d5172180b8 100644 --- a/src/phases/post-turn-status-effect-phase.ts +++ b/src/phases/post-turn-status-effect-phase.ts @@ -1,14 +1,14 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { CommonBattleAnim } from "#app/data/battle-anims"; -import { CommonAnim } from "#enums/move-anims-common"; -import { getStatusEffectActivationText } from "#app/data/status-effect"; -import { BattleSpec } from "#app/enums/battle-spec"; -import { StatusEffect } from "#app/enums/status-effect"; import { getPokemonNameWithAffix } from "#app/messages"; -import { BooleanHolder, NumberHolder } from "#app/utils/common"; -import { PokemonPhase } from "./pokemon-phase"; +import { CommonBattleAnim } from "#data/battle-anims"; +import { getStatusEffectActivationText } from "#data/status-effect"; +import { BattleSpec } from "#enums/battle-spec"; +import type { BattlerIndex } from "#enums/battler-index"; +import { CommonAnim } from "#enums/move-anims-common"; +import { StatusEffect } from "#enums/status-effect"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import { BooleanHolder, NumberHolder } from "#utils/common"; export class PostTurnStatusEffectPhase extends PokemonPhase { public readonly phaseName = "PostTurnStatusEffectPhase"; diff --git a/src/phases/quiet-form-change-phase.ts b/src/phases/quiet-form-change-phase.ts index 9c4a0638b54..ef53b16cc56 100644 --- a/src/phases/quiet-form-change-phase.ts +++ b/src/phases/quiet-form-change-phase.ts @@ -1,18 +1,15 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { SemiInvulnerableTag } from "#app/data/battler-tags"; -import type { SpeciesFormChange } from "#app/data/pokemon-forms"; -import { - getSpeciesFormChangeMessage, - SpeciesFormChangeTeraTrigger, -} from "#app/data/pokemon-forms/form-change-triggers"; -import { getTypeRgb } from "#app/data/type"; -import { BattleSpec } from "#app/enums/battle-spec"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; -import { BattlePhase } from "./battle-phase"; -import type { MovePhase } from "./move-phase"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; +import { SemiInvulnerableTag } from "#data/battler-tags"; +import { getSpeciesFormChangeMessage, SpeciesFormChangeTeraTrigger } from "#data/form-change-triggers"; +import type { SpeciesFormChange } from "#data/pokemon-forms"; +import { getTypeRgb } from "#data/type"; +import { BattleSpec } from "#enums/battle-spec"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import type { Pokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; +import type { MovePhase } from "#phases/move-phase"; export class QuietFormChangePhase extends BattlePhase { public readonly phaseName = "QuietFormChangePhase"; diff --git a/src/phases/reload-session-phase.ts b/src/phases/reload-session-phase.ts index ac9337753c4..ac8a6bc2799 100644 --- a/src/phases/reload-session-phase.ts +++ b/src/phases/reload-session-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; import { UiMode } from "#enums/ui-mode"; -import { fixedInt } from "#app/utils/common"; +import { fixedInt } from "#utils/common"; export class ReloadSessionPhase extends Phase { public readonly phaseName = "ReloadSessionPhase"; diff --git a/src/phases/reset-status-phase.ts b/src/phases/reset-status-phase.ts index 779f375d7e2..e15fb7fee85 100644 --- a/src/phases/reset-status-phase.ts +++ b/src/phases/reset-status-phase.ts @@ -1,5 +1,5 @@ -import type Pokemon from "#app/field/pokemon"; -import { BattlePhase } from "#app/phases/battle-phase"; +import type { Pokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; /** * Phase which handles resetting a Pokemon's status to none diff --git a/src/phases/return-phase.ts b/src/phases/return-phase.ts index a8233f98bd1..a8cce72810e 100644 --- a/src/phases/return-phase.ts +++ b/src/phases/return-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; +import { SpeciesFormChangeActiveTrigger } from "#data/form-change-triggers"; import { SwitchType } from "#enums/switch-type"; -import { SwitchSummonPhase } from "./switch-summon-phase"; +import { SwitchSummonPhase } from "#phases/switch-summon-phase"; export class ReturnPhase extends SwitchSummonPhase { public readonly phaseName = "ReturnPhase"; diff --git a/src/phases/revival-blessing-phase.ts b/src/phases/revival-blessing-phase.ts index e3e69f7ef25..0235fb51da3 100644 --- a/src/phases/revival-blessing-phase.ts +++ b/src/phases/revival-blessing-phase.ts @@ -1,12 +1,12 @@ -import { SwitchType } from "#enums/switch-type"; import { globalScene } from "#app/global-scene"; -import type { PartyOption } from "#app/ui/party-ui-handler"; -import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler"; +import { SwitchType } from "#enums/switch-type"; import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; +import type { PartyOption } from "#ui/party-ui-handler"; +import { PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; +import { isNullOrUndefined, toDmgValue } from "#utils/common"; import i18next from "i18next"; -import { toDmgValue, isNullOrUndefined } from "#app/utils/common"; -import { BattlePhase } from "#app/phases/battle-phase"; -import type { PlayerPokemon } from "#app/field/pokemon"; /** * Sets the Party UI and handles the effect of Revival Blessing diff --git a/src/phases/ribbon-modifier-reward-phase.ts b/src/phases/ribbon-modifier-reward-phase.ts index 10d63ba707f..7cf3f7a8071 100644 --- a/src/phases/ribbon-modifier-reward-phase.ts +++ b/src/phases/ribbon-modifier-reward-phase.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import type { ModifierTypeFunc } from "#app/@types/modifier-types"; +import type { PokemonSpecies } from "#data/pokemon-species"; import { UiMode } from "#enums/ui-mode"; +import { ModifierRewardPhase } from "#phases/modifier-reward-phase"; +import type { ModifierTypeFunc } from "#types/modifier-types"; import i18next from "i18next"; -import { ModifierRewardPhase } from "./modifier-reward-phase"; export class RibbonModifierRewardPhase extends ModifierRewardPhase { public readonly phaseName = "RibbonModifierRewardPhase"; diff --git a/src/phases/scan-ivs-phase.ts b/src/phases/scan-ivs-phase.ts index d296d87ca88..e0865feb7ca 100644 --- a/src/phases/scan-ivs-phase.ts +++ b/src/phases/scan-ivs-phase.ts @@ -1,11 +1,11 @@ import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; -import { PERMANENT_STATS, Stat } from "#app/enums/stat"; import { getPokemonNameWithAffix } from "#app/messages"; -import { getTextColor, TextStyle } from "#app/ui/text"; +import type { BattlerIndex } from "#enums/battler-index"; +import { PERMANENT_STATS, Stat } from "#enums/stat"; import { UiMode } from "#enums/ui-mode"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import { getTextColor, TextStyle } from "#ui/text"; import i18next from "i18next"; -import { PokemonPhase } from "./pokemon-phase"; export class ScanIvsPhase extends PokemonPhase { public readonly phaseName = "ScanIvsPhase"; diff --git a/src/phases/select-biome-phase.ts b/src/phases/select-biome-phase.ts index e8b4946b6d1..ab96bf5c45e 100644 --- a/src/phases/select-biome-phase.ts +++ b/src/phases/select-biome-phase.ts @@ -1,11 +1,11 @@ import { globalScene } from "#app/global-scene"; -import { biomeLinks, getBiomeName } from "#app/data/balance/biomes"; +import { biomeLinks, getBiomeName } from "#balance/biomes"; import { BiomeId } from "#enums/biome-id"; -import { MoneyInterestModifier, MapModifier } from "#app/modifier/modifier"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; import { UiMode } from "#enums/ui-mode"; -import { BattlePhase } from "./battle-phase"; -import { randSeedInt } from "#app/utils/common"; +import { MapModifier, MoneyInterestModifier } from "#modifiers/modifier"; +import { BattlePhase } from "#phases/battle-phase"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { randSeedInt } from "#utils/common"; export class SelectBiomePhase extends BattlePhase { public readonly phaseName = "SelectBiomePhase"; @@ -56,6 +56,7 @@ export class SelectBiomePhase extends BattlePhase { delay: 1000, }); } else { + // TODO: should this use `randSeedItem`? setNextBiome(biomes[randSeedInt(biomes.length)]); } } else if (biomeLinks.hasOwnProperty(currentBiome)) { diff --git a/src/phases/select-gender-phase.ts b/src/phases/select-gender-phase.ts index ad8515e312e..d44c308d08c 100644 --- a/src/phases/select-gender-phase.ts +++ b/src/phases/select-gender-phase.ts @@ -1,8 +1,8 @@ import { globalScene } from "#app/global-scene"; -import { PlayerGender } from "#app/enums/player-gender"; import { Phase } from "#app/phase"; -import { SettingKeys } from "#app/system/settings/settings"; +import { PlayerGender } from "#enums/player-gender"; import { UiMode } from "#enums/ui-mode"; +import { SettingKeys } from "#system/settings"; import i18next from "i18next"; export class SelectGenderPhase extends Phase { diff --git a/src/phases/select-modifier-phase.ts b/src/phases/select-modifier-phase.ts index 53e1f5bc282..05c890136ee 100644 --- a/src/phases/select-modifier-phase.ts +++ b/src/phases/select-modifier-phase.ts @@ -1,35 +1,34 @@ import { globalScene } from "#app/global-scene"; -import type { ModifierTier } from "#enums/modifier-tier"; -import type { ModifierTypeOption, ModifierType } from "#app/modifier/modifier-type"; -import { - regenerateModifierPoolThresholds, - getPlayerShopModifierTypeOptionsForWave, - PokemonModifierType, - FusePokemonModifierType, - PokemonMoveModifierType, - TmModifierType, - RememberMoveModifierType, - PokemonPpRestoreModifierType, - PokemonPpUpModifierType, - getPlayerModifierTypeOptions, -} from "#app/modifier/modifier-type"; +import Overrides from "#app/overrides"; import { ModifierPoolType } from "#enums/modifier-pool-type"; -import type { Modifier } from "#app/modifier/modifier"; +import type { ModifierTier } from "#enums/modifier-tier"; +import { UiMode } from "#enums/ui-mode"; +import type { Modifier } from "#modifiers/modifier"; import { ExtraModifierModifier, HealShopCostModifier, PokemonHeldItemModifier, TempExtraModifierModifier, -} from "#app/modifier/modifier"; -import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler"; -import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler"; -import { UiMode } from "#enums/ui-mode"; +} from "#modifiers/modifier"; +import type { CustomModifierSettings, ModifierType, ModifierTypeOption } from "#modifiers/modifier-type"; +import { + FusePokemonModifierType, + getPlayerModifierTypeOptions, + getPlayerShopModifierTypeOptionsForWave, + PokemonModifierType, + PokemonMoveModifierType, + PokemonPpRestoreModifierType, + PokemonPpUpModifierType, + RememberMoveModifierType, + regenerateModifierPoolThresholds, + TmModifierType, +} from "#modifiers/modifier-type"; +import { BattlePhase } from "#phases/battle-phase"; +import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { SHOP_OPTIONS_ROW_LIMIT } from "#ui/modifier-select-ui-handler"; +import { PartyOption, PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; +import { isNullOrUndefined, NumberHolder } from "#utils/common"; import i18next from "i18next"; -import { BattlePhase } from "./battle-phase"; -import Overrides from "#app/overrides"; -import type { CustomModifierSettings } from "#app/modifier/modifier-type"; -import { isNullOrUndefined, NumberHolder } from "#app/utils/common"; export type ModifierSelectCallback = (rowCursor: number, cursor: number) => boolean; @@ -180,7 +179,7 @@ export class SelectModifierPhase extends BattlePhase { } else { this.applyModifier(modifierType.newModifier()!); } - return !cost; + return cost === -1; } // Reroll rewards diff --git a/src/phases/select-starter-phase.ts b/src/phases/select-starter-phase.ts index 76247c14ce0..f8f4eeee4d2 100644 --- a/src/phases/select-starter-phase.ts +++ b/src/phases/select-starter-phase.ts @@ -1,18 +1,18 @@ import { globalScene } from "#app/global-scene"; -import { applyChallenges } from "#app/data/challenge"; -import { ChallengeType } from "#enums/challenge-type"; -import { Gender } from "#app/data/gender"; -import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { overrideHeldItems, overrideModifiers } from "#app/modifier/modifier"; import Overrides from "#app/overrides"; import { Phase } from "#app/phase"; -import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler"; -import type { Starter } from "#app/ui/starter-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; +import { applyChallenges } from "#data/challenge"; +import { SpeciesFormChangeMoveLearnedTrigger } from "#data/form-change-triggers"; +import { Gender } from "#data/gender"; +import { ChallengeType } from "#enums/challenge-type"; import type { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { overrideHeldItems, overrideModifiers } from "#modifiers/modifier"; +import { SaveSlotUiMode } from "#ui/save-slot-select-ui-handler"; +import type { Starter } from "#ui/starter-select-ui-handler"; +import { isNullOrUndefined } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { isNullOrUndefined } from "#app/utils/common"; export class SelectStarterPhase extends Phase { public readonly phaseName = "SelectStarterPhase"; diff --git a/src/phases/select-target-phase.ts b/src/phases/select-target-phase.ts index 6d47ac18021..3805cb919b2 100644 --- a/src/phases/select-target-phase.ts +++ b/src/phases/select-target-phase.ts @@ -1,10 +1,10 @@ import { globalScene } from "#app/global-scene"; +import { allMoves } from "#data/data-lists"; import type { BattlerIndex } from "#enums/battler-index"; import { Command } from "#enums/command"; import { UiMode } from "#enums/ui-mode"; -import { PokemonPhase } from "./pokemon-phase"; -import i18next from "#app/plugins/i18n"; -import { allMoves } from "#app/data/data-lists"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import i18next from "#plugins/i18n"; export class SelectTargetPhase extends PokemonPhase { public readonly phaseName = "SelectTargetPhase"; diff --git a/src/phases/shiny-sparkle-phase.ts b/src/phases/shiny-sparkle-phase.ts index 53866af89e6..0930d536267 100644 --- a/src/phases/shiny-sparkle-phase.ts +++ b/src/phases/shiny-sparkle-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; import type { BattlerIndex } from "#enums/battler-index"; -import { PokemonPhase } from "./pokemon-phase"; +import { PokemonPhase } from "#phases/pokemon-phase"; export class ShinySparklePhase extends PokemonPhase { public readonly phaseName = "ShinySparklePhase"; diff --git a/src/phases/show-ability-phase.ts b/src/phases/show-ability-phase.ts index 0f568819cde..21c3e7341a7 100644 --- a/src/phases/show-ability-phase.ts +++ b/src/phases/show-ability-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; -import { PokemonPhase } from "./pokemon-phase"; import { getPokemonNameWithAffix } from "#app/messages"; +import type { BattlerIndex } from "#enums/battler-index"; +import { PokemonPhase } from "#phases/pokemon-phase"; export class ShowAbilityPhase extends PokemonPhase { public readonly phaseName = "ShowAbilityPhase"; diff --git a/src/phases/show-party-exp-bar-phase.ts b/src/phases/show-party-exp-bar-phase.ts index 4849526b639..f22be5f63e3 100644 --- a/src/phases/show-party-exp-bar-phase.ts +++ b/src/phases/show-party-exp-bar-phase.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import { ExpGainsSpeed } from "#app/enums/exp-gains-speed"; -import { ExpNotification } from "#app/enums/exp-notification"; -import { ExpBoosterModifier } from "#app/modifier/modifier"; -import { NumberHolder } from "#app/utils/common"; -import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; +import { ExpGainsSpeed } from "#enums/exp-gains-speed"; +import { ExpNotification } from "#enums/exp-notification"; +import { ExpBoosterModifier } from "#modifiers/modifier"; +import { PlayerPartyMemberPokemonPhase } from "#phases/player-party-member-pokemon-phase"; +import { NumberHolder } from "#utils/common"; export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase { public readonly phaseName = "ShowPartyExpBarPhase"; diff --git a/src/phases/show-trainer-phase.ts b/src/phases/show-trainer-phase.ts index bae6ecd839c..e012c22116a 100644 --- a/src/phases/show-trainer-phase.ts +++ b/src/phases/show-trainer-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import { PlayerGender } from "#app/enums/player-gender"; -import { BattlePhase } from "./battle-phase"; +import { PlayerGender } from "#enums/player-gender"; +import { BattlePhase } from "#phases/battle-phase"; export class ShowTrainerPhase extends BattlePhase { public readonly phaseName = "ShowTrainerPhase"; diff --git a/src/phases/stat-stage-change-phase.ts b/src/phases/stat-stage-change-phase.ts index 77fb7b38600..140ef841929 100644 --- a/src/phases/stat-stage-change-phase.ts +++ b/src/phases/stat-stage-change-phase.ts @@ -1,23 +1,20 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#enums/battler-index"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { MistTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import type { ArenaTag } from "#app/data/arena-tag"; -import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; -import { ResetNegativeStatStageModifier } from "#app/modifier/modifier"; import { handleTutorial, Tutorial } from "#app/tutorial"; -import { NumberHolder, BooleanHolder, isNullOrUndefined } from "#app/utils/common"; +import type { ArenaTag } from "#data/arena-tag"; +import { MistTag } from "#data/arena-tag"; +import { OctolockTag } from "#data/battler-tags"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import type { BattlerIndex } from "#enums/battler-index"; +import { type BattleStat, getStatKey, getStatStageChangeDescriptionKey, Stat } from "#enums/stat"; +import type { Pokemon } from "#field/pokemon"; +import { ResetNegativeStatStageModifier } from "#modifiers/modifier"; +import { PokemonPhase } from "#phases/pokemon-phase"; +import type { ConditionalUserFieldProtectStatAbAttrParams, PreStatStageChangeAbAttrParams } from "#types/ability-types"; +import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#utils/common"; import i18next from "i18next"; -import { PokemonPhase } from "./pokemon-phase"; -import { Stat, type BattleStat, getStatKey, getStatStageChangeDescriptionKey } from "#enums/stat"; -import { OctolockTag } from "#app/data/battler-tags"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import type { - ConditionalUserFieldProtectStatAbAttrParams, - PreStatStageChangeAbAttrParams, -} from "#app/@types/ability-types"; export type StatStageChangeCallback = ( target: Pokemon | null, diff --git a/src/phases/summon-missing-phase.ts b/src/phases/summon-missing-phase.ts index ce3e982055e..89d36b13597 100644 --- a/src/phases/summon-missing-phase.ts +++ b/src/phases/summon-missing-phase.ts @@ -1,7 +1,7 @@ -import { getPokemonNameWithAffix } from "#app/messages"; -import i18next from "i18next"; -import { SummonPhase } from "./summon-phase"; import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { SummonPhase } from "#phases/summon-phase"; +import i18next from "i18next"; export class SummonMissingPhase extends SummonPhase { public readonly phaseName = "SummonMissingPhase"; diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index 95e4367d8df..e4c8aa9af7a 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -1,17 +1,17 @@ -import { BattleType } from "#enums/battle-type"; -import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { PlayerGender } from "#app/enums/player-gender"; -import { addPokeballOpenParticles } from "#app/field/anims"; -import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; -import { getPokemonNameWithAffix } from "#app/messages"; -import i18next from "i18next"; -import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { SpeciesFormChangeActiveTrigger } from "#data/form-change-triggers"; +import { getPokeballAtlasKey, getPokeballTintColor } from "#data/pokeball"; +import { BattleType } from "#enums/battle-type"; +import { FieldPosition } from "#enums/field-position"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { PlayerGender } from "#enums/player-gender"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { addPokeballOpenParticles } from "#field/anims"; +import type { Pokemon } from "#field/pokemon"; +import { PartyMemberPokemonPhase } from "#phases/party-member-pokemon-phase"; +import i18next from "i18next"; export class SummonPhase extends PartyMemberPokemonPhase { // The union type is needed to keep typescript happy as these phases extend from SummonPhase diff --git a/src/phases/switch-biome-phase.ts b/src/phases/switch-biome-phase.ts index f84f1d517b4..dc2e0fa64d4 100644 --- a/src/phases/switch-biome-phase.ts +++ b/src/phases/switch-biome-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import type { BiomeId } from "#enums/biome-id"; -import { getBiomeKey } from "#app/field/arena"; -import { BattlePhase } from "./battle-phase"; +import { getBiomeKey } from "#field/arena"; +import { BattlePhase } from "#phases/battle-phase"; export class SwitchBiomePhase extends BattlePhase { public readonly phaseName = "SwitchBiomePhase"; diff --git a/src/phases/switch-phase.ts b/src/phases/switch-phase.ts index 8d18e29e6a6..a431d973a02 100644 --- a/src/phases/switch-phase.ts +++ b/src/phases/switch-phase.ts @@ -1,8 +1,8 @@ import { globalScene } from "#app/global-scene"; -import PartyUiHandler, { PartyOption, PartyUiMode } from "#app/ui/party-ui-handler"; -import { UiMode } from "#enums/ui-mode"; import { SwitchType } from "#enums/switch-type"; -import { BattlePhase } from "./battle-phase"; +import { UiMode } from "#enums/ui-mode"; +import { BattlePhase } from "#phases/battle-phase"; +import { PartyOption, PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; /** * Opens the party selector UI and transitions into a {@linkcode SwitchSummonPhase} diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index ccd0681c068..b7460e77569 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -1,17 +1,17 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { allMoves } from "#app/data/data-lists"; -import { getPokeballTintColor } from "#app/data/pokeball"; -import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { TrainerSlot } from "#enums/trainer-slot"; -import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; -import { SwitchEffectTransferModifier } from "#app/modifier/modifier"; +import { SubstituteTag } from "#data/battler-tags"; +import { allMoves } from "#data/data-lists"; +import { SpeciesFormChangeActiveTrigger } from "#data/form-change-triggers"; +import { getPokeballTintColor } from "#data/pokeball"; import { Command } from "#enums/command"; -import i18next from "i18next"; -import { SummonPhase } from "./summon-phase"; -import { SubstituteTag } from "#app/data/battler-tags"; import { SwitchType } from "#enums/switch-type"; +import { TrainerSlot } from "#enums/trainer-slot"; +import type { Pokemon } from "#field/pokemon"; +import { SwitchEffectTransferModifier } from "#modifiers/modifier"; +import { SummonPhase } from "#phases/summon-phase"; +import i18next from "i18next"; export class SwitchSummonPhase extends SummonPhase { public readonly phaseName: "SwitchSummonPhase" | "ReturnPhase" = "SwitchSummonPhase"; diff --git a/src/phases/tera-phase.ts b/src/phases/tera-phase.ts index a6025e20488..84b05d88abe 100644 --- a/src/phases/tera-phase.ts +++ b/src/phases/tera-phase.ts @@ -1,13 +1,13 @@ -import type Pokemon from "#app/field/pokemon"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { BattlePhase } from "./battle-phase"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; -import { PokemonType } from "#enums/pokemon-type"; -import { achvs } from "#app/system/achv"; -import { SpeciesFormChangeTeraTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { CommonBattleAnim } from "#app/data/battle-anims"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { CommonBattleAnim } from "#data/battle-anims"; +import { SpeciesFormChangeTeraTrigger } from "#data/form-change-triggers"; import { CommonAnim } from "#enums/move-anims-common"; +import { PokemonType } from "#enums/pokemon-type"; +import type { Pokemon } from "#field/pokemon"; +import { BattlePhase } from "#phases/battle-phase"; +import { achvs } from "#system/achv"; +import i18next from "i18next"; export class TeraPhase extends BattlePhase { public readonly phaseName = "TeraPhase"; diff --git a/src/phases/title-phase.ts b/src/phases/title-phase.ts index 5e36081b899..42dd761de27 100644 --- a/src/phases/title-phase.ts +++ b/src/phases/title-phase.ts @@ -1,25 +1,25 @@ import { loggedInUser } from "#app/account"; -import { BattleType } from "#enums/battle-type"; -import { fetchDailyRunSeed, getDailyRunStarters } from "#app/data/daily-run"; -import { Gender } from "#app/data/gender"; -import { getBiomeKey } from "#app/field/arena"; import { GameMode, getGameMode } from "#app/game-mode"; -import { GameModes } from "#enums/game-modes"; -import type { Modifier } from "#app/modifier/modifier"; -import { getDailyRunStarterModifiers, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { ModifierPoolType } from "#enums/modifier-pool-type"; -import { Phase } from "#app/phase"; -import type { SessionSaveData } from "#app/system/game-data"; -import { Unlockables } from "#enums/unlockables"; -import { vouchers } from "#app/system/voucher"; -import type { OptionSelectConfig, OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { isLocal, isLocalServerConnected, isNullOrUndefined } from "#app/utils/common"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; import Overrides from "#app/overrides"; +import { Phase } from "#app/phase"; +import { fetchDailyRunSeed, getDailyRunStarters } from "#data/daily-run"; +import { modifierTypes } from "#data/data-lists"; +import { Gender } from "#data/gender"; +import { BattleType } from "#enums/battle-type"; +import { GameModes } from "#enums/game-modes"; +import { ModifierPoolType } from "#enums/modifier-pool-type"; +import { UiMode } from "#enums/ui-mode"; +import { Unlockables } from "#enums/unlockables"; +import { getBiomeKey } from "#field/arena"; +import type { Modifier } from "#modifiers/modifier"; +import { getDailyRunStarterModifiers, regenerateModifierPoolThresholds } from "#modifiers/modifier-type"; +import type { SessionSaveData } from "#system/game-data"; +import { vouchers } from "#system/voucher"; +import type { OptionSelectConfig, OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { SaveSlotUiMode } from "#ui/save-slot-select-ui-handler"; +import { isLocal, isLocalServerConnected, isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; export class TitlePhase extends Phase { public readonly phaseName = "TitlePhase"; diff --git a/src/phases/toggle-double-position-phase.ts b/src/phases/toggle-double-position-phase.ts index 596bf87eb5b..2dcaac52d2f 100644 --- a/src/phases/toggle-double-position-phase.ts +++ b/src/phases/toggle-double-position-phase.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; import { FieldPosition } from "#enums/field-position"; -import { BattlePhase } from "./battle-phase"; +import { BattlePhase } from "#phases/battle-phase"; export class ToggleDoublePositionPhase extends BattlePhase { public readonly phaseName = "ToggleDoublePositionPhase"; diff --git a/src/phases/trainer-victory-phase.ts b/src/phases/trainer-victory-phase.ts index 554b8109f02..6f92dbe496d 100644 --- a/src/phases/trainer-victory-phase.ts +++ b/src/phases/trainer-victory-phase.ts @@ -1,15 +1,15 @@ -import { getCharVariantFromDialogue } from "#app/data/dialogue"; -import { TrainerType } from "#app/enums/trainer-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { vouchers } from "#app/system/voucher"; -import i18next from "i18next"; -import { randSeedItem } from "#app/utils/common"; -import { BattlePhase } from "./battle-phase"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { globalScene } from "#app/global-scene"; -import { BiomeId } from "#enums/biome-id"; -import { achvs } from "#app/system/achv"; import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { getCharVariantFromDialogue } from "#data/dialogue"; +import { BiomeId } from "#enums/biome-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { BattlePhase } from "#phases/battle-phase"; +import { achvs } from "#system/achv"; +import { vouchers } from "#system/voucher"; +import { randSeedItem } from "#utils/common"; +import i18next from "i18next"; export class TrainerVictoryPhase extends BattlePhase { public readonly phaseName = "TrainerVictoryPhase"; diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index b5e56f6d63f..ce3b2958c23 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -1,20 +1,20 @@ -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { TerrainType } from "#app/data/terrain"; -import { WeatherType } from "#app/enums/weather-type"; -import { TurnEndEvent } from "#app/events/battle-scene"; -import type Pokemon from "#app/field/pokemon"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { - TurnHealModifier, - EnemyTurnHealModifier, - EnemyStatusEffectHealChanceModifier, - TurnStatusEffectModifier, - TurnHeldItemTransferModifier, -} from "#app/modifier/modifier"; -import i18next from "i18next"; -import { FieldPhase } from "./field-phase"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { TerrainType } from "#data/terrain"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; +import { WeatherType } from "#enums/weather-type"; +import { TurnEndEvent } from "#events/battle-scene"; +import type { Pokemon } from "#field/pokemon"; +import { + EnemyStatusEffectHealChanceModifier, + EnemyTurnHealModifier, + TurnHealModifier, + TurnHeldItemTransferModifier, + TurnStatusEffectModifier, +} from "#modifiers/modifier"; +import { FieldPhase } from "#phases/field-phase"; +import i18next from "i18next"; export class TurnEndPhase extends FieldPhase { public readonly phaseName = "TurnEndPhase"; diff --git a/src/phases/turn-init-phase.ts b/src/phases/turn-init-phase.ts index 8d0508c5ebb..b2ab096102c 100644 --- a/src/phases/turn-init-phase.ts +++ b/src/phases/turn-init-phase.ts @@ -1,13 +1,13 @@ +import { globalScene } from "#app/global-scene"; import { BattlerIndex } from "#enums/battler-index"; +import { TurnInitEvent } from "#events/battle-scene"; +import type { PlayerPokemon } from "#field/pokemon"; import { handleMysteryEncounterBattleStartEffects, handleMysteryEncounterTurnStartEffects, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { TurnInitEvent } from "#app/events/battle-scene"; -import type { PlayerPokemon } from "#app/field/pokemon"; +} from "#mystery-encounters/encounter-phase-utils"; +import { FieldPhase } from "#phases/field-phase"; import i18next from "i18next"; -import { FieldPhase } from "./field-phase"; -import { globalScene } from "#app/global-scene"; export class TurnInitPhase extends FieldPhase { public readonly phaseName = "TurnInitPhase"; diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index 2c4f2ead82e..0fc126801ec 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -1,17 +1,16 @@ -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { allMoves } from "#app/data/data-lists"; -import { AbilityId } from "#enums/ability-id"; -import { Stat } from "#app/enums/stat"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { BypassSpeedChanceModifier } from "#app/modifier/modifier"; -import { Command } from "#enums/command"; -import { randSeedShuffle, BooleanHolder } from "#app/utils/common"; -import { FieldPhase } from "./field-phase"; -import { BattlerIndex } from "#enums/battler-index"; -import { TrickRoomTag } from "#app/data/arena-tag"; -import { SwitchType } from "#enums/switch-type"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; +import { TrickRoomTag } from "#data/arena-tag"; +import { allMoves } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; +import { Command } from "#enums/command"; +import { Stat } from "#enums/stat"; +import { SwitchType } from "#enums/switch-type"; +import type { Pokemon } from "#field/pokemon"; +import { BypassSpeedChanceModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import { FieldPhase } from "#phases/field-phase"; +import { BooleanHolder, randSeedShuffle } from "#utils/common"; export class TurnStartPhase extends FieldPhase { public readonly phaseName = "TurnStartPhase"; @@ -213,27 +212,8 @@ export class TurnStartPhase extends FieldPhase { break; case Command.RUN: { - let runningPokemon = pokemon; - if (globalScene.currentBattle.double) { - const playerActivePokemon = field.filter(pokemon => { - if (pokemon) { - return pokemon.isPlayer() && pokemon.isActive(); - } - return; - }); - // if only one pokemon is alive, use that one - if (playerActivePokemon.length > 1) { - // find which active pokemon has faster speed - const fasterPokemon = - playerActivePokemon[0].getStat(Stat.SPD) > playerActivePokemon[1].getStat(Stat.SPD) - ? playerActivePokemon[0] - : playerActivePokemon[1]; - // check if either active pokemon has the ability "Run Away" - const hasRunAway = playerActivePokemon.find(p => p.hasAbility(AbilityId.RUN_AWAY)); - runningPokemon = hasRunAway !== undefined ? hasRunAway : fasterPokemon; - } - } - phaseManager.unshiftNew("AttemptRunPhase", runningPokemon.getFieldIndex()); + // Running (like ball throwing) is a team action taking up both Pokemon's turns. + phaseManager.unshiftNew("AttemptRunPhase"); } break; } diff --git a/src/phases/unlock-phase.ts b/src/phases/unlock-phase.ts index 76719847f92..ec3be88d4a5 100644 --- a/src/phases/unlock-phase.ts +++ b/src/phases/unlock-phase.ts @@ -1,8 +1,8 @@ import { globalScene } from "#app/global-scene"; import { Phase } from "#app/phase"; -import type { Unlockables } from "#enums/unlockables"; -import { getUnlockableName } from "#app/system/unlockables"; import { UiMode } from "#enums/ui-mode"; +import type { Unlockables } from "#enums/unlockables"; +import { getUnlockableName } from "#system/unlockables"; import i18next from "i18next"; export class UnlockPhase extends Phase { diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index ae5b727c2a6..4b1a79d7443 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -1,12 +1,12 @@ +import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { modifierTypes } from "#data/data-lists"; +import { BattleType } from "#enums/battle-type"; import type { BattlerIndex } from "#enums/battler-index"; import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; -import { BattleType } from "#enums/battle-type"; -import type { CustomModifierSettings } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { PokemonPhase } from "./pokemon-phase"; -import { handleMysteryEncounterVictory } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { globalScene } from "#app/global-scene"; -import { timedEventManager } from "#app/global-event-manager"; +import type { CustomModifierSettings } from "#modifiers/modifier-type"; +import { handleMysteryEncounterVictory } from "#mystery-encounters/encounter-phase-utils"; +import { PokemonPhase } from "#phases/pokemon-phase"; export class VictoryPhase extends PokemonPhase { public readonly phaseName = "VictoryPhase"; diff --git a/src/phases/weather-effect-phase.ts b/src/phases/weather-effect-phase.ts index 5476ac67672..81db543001b 100644 --- a/src/phases/weather-effect-phase.ts +++ b/src/phases/weather-effect-phase.ts @@ -1,14 +1,14 @@ +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { globalScene } from "#app/global-scene"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { CommonAnim } from "#enums/move-anims-common"; -import type { Weather } from "#app/data/weather"; -import { getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { WeatherType } from "#app/enums/weather-type"; -import type Pokemon from "#app/field/pokemon"; +import type { Weather } from "#data/weather"; +import { getWeatherDamageMessage, getWeatherLapseMessage } from "#data/weather"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { HitResult } from "#enums/hit-result"; -import { BooleanHolder, toDmgValue } from "#app/utils/common"; -import { CommonAnimPhase } from "./common-anim-phase"; +import { CommonAnim } from "#enums/move-anims-common"; +import { WeatherType } from "#enums/weather-type"; +import type { Pokemon } from "#field/pokemon"; +import { CommonAnimPhase } from "#phases/common-anim-phase"; +import { BooleanHolder, toDmgValue } from "#utils/common"; export class WeatherEffectPhase extends CommonAnimPhase { public readonly phaseName = "WeatherEffectPhase"; diff --git a/src/pipelines/field-sprite.ts b/src/pipelines/field-sprite.ts index a6e248c9998..647483d1524 100644 --- a/src/pipelines/field-sprite.ts +++ b/src/pipelines/field-sprite.ts @@ -1,10 +1,11 @@ import { globalScene } from "#app/global-scene"; -import { TerrainType, getTerrainColor } from "../data/terrain"; -import { getCurrentTime } from "#app/utils/common"; +import { getTerrainColor, TerrainType } from "#data/terrain"; +import { getCurrentTime } from "#utils/common"; +import Phaser from "phaser"; import fieldSpriteFragShader from "./glsl/fieldSpriteFragShader.frag?raw"; import spriteVertShader from "./glsl/spriteShader.vert?raw"; -export default class FieldSpritePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { +export class FieldSpritePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { constructor(game: Phaser.Game, config?: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig) { super( config || { diff --git a/src/pipelines/invert.ts b/src/pipelines/invert.ts index 0ebc3ad865f..2414f2cf6b3 100644 --- a/src/pipelines/invert.ts +++ b/src/pipelines/invert.ts @@ -1,7 +1,8 @@ import type { Game } from "phaser"; +import Phaser from "phaser"; import fragShader from "./glsl/invert.frag?raw"; -export default class InvertPostFX extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline { +export class InvertPostFX extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline { constructor(game: Game) { super({ game, diff --git a/src/pipelines/sprite.ts b/src/pipelines/sprite.ts index 307c2cee4cc..596a761b05f 100644 --- a/src/pipelines/sprite.ts +++ b/src/pipelines/sprite.ts @@ -1,14 +1,14 @@ -import { variantColorCache } from "#app/sprites/variant"; -import MysteryEncounterIntroVisuals from "#app/field/mystery-encounter-intro"; -import Pokemon from "#app/field/pokemon"; -import Trainer from "#app/field/trainer"; import { globalScene } from "#app/global-scene"; -import { rgbHexToRgba } from "#app/utils/common"; -import FieldSpritePipeline from "./field-sprite"; +import { FieldSpritePipeline } from "#app/pipelines/field-sprite"; +import { MysteryEncounterIntroVisuals } from "#field/mystery-encounter-intro"; +import { Pokemon } from "#field/pokemon"; +import { Trainer } from "#field/trainer"; +import { variantColorCache } from "#sprites/variant"; +import { rgbHexToRgba } from "#utils/common"; import spriteFragShader from "./glsl/spriteFragShader.frag?raw"; import spriteVertShader from "./glsl/spriteShader.vert?raw"; -export default class SpritePipeline extends FieldSpritePipeline { +export class SpritePipeline extends FieldSpritePipeline { private _tone: number[]; constructor(game: Phaser.Game) { diff --git a/src/plugins/api/api-base.ts b/src/plugins/api/api-base.ts index c7ff4619187..63f56c129f3 100644 --- a/src/plugins/api/api-base.ts +++ b/src/plugins/api/api-base.ts @@ -1,5 +1,5 @@ import { SESSION_ID_COOKIE_NAME } from "#app/constants"; -import { getCookie } from "#app/utils/cookies"; +import { getCookie } from "#utils/cookies"; type DataType = "json" | "form-urlencoded"; diff --git a/src/plugins/api/pokerogue-account-api.ts b/src/plugins/api/pokerogue-account-api.ts index 9cd82c24430..56bdc92b9b9 100644 --- a/src/plugins/api/pokerogue-account-api.ts +++ b/src/plugins/api/pokerogue-account-api.ts @@ -1,12 +1,12 @@ +import { ApiBase } from "#api/api-base"; +import { SESSION_ID_COOKIE_NAME } from "#app/constants"; import type { AccountInfoResponse, AccountLoginRequest, AccountLoginResponse, AccountRegisterRequest, -} from "#app/@types/PokerogueAccountApi"; -import { SESSION_ID_COOKIE_NAME } from "#app/constants"; -import { ApiBase } from "#app/plugins/api/api-base"; -import { removeCookie, setCookie } from "#app/utils/cookies"; +} from "#types/PokerogueAccountApi"; +import { removeCookie, setCookie } from "#utils/cookies"; /** * A wrapper for PokéRogue account API requests. diff --git a/src/plugins/api/pokerogue-admin-api.ts b/src/plugins/api/pokerogue-admin-api.ts index 5923f286430..4e549c7ff53 100644 --- a/src/plugins/api/pokerogue-admin-api.ts +++ b/src/plugins/api/pokerogue-admin-api.ts @@ -1,3 +1,4 @@ +import { ApiBase } from "#api/api-base"; import type { LinkAccountToDiscordIdRequest, LinkAccountToGoogledIdRequest, @@ -5,8 +6,7 @@ import type { SearchAccountResponse, UnlinkAccountFromDiscordIdRequest, UnlinkAccountFromGoogledIdRequest, -} from "#app/@types/PokerogueAdminApi"; -import { ApiBase } from "#app/plugins/api/api-base"; +} from "#types/PokerogueAdminApi"; export class PokerogueAdminApi extends ApiBase { public readonly ERR_USERNAME_NOT_FOUND: string = "Username not found!"; diff --git a/src/plugins/api/pokerogue-api.ts b/src/plugins/api/pokerogue-api.ts index c6dfae019a5..99600a359a2 100644 --- a/src/plugins/api/pokerogue-api.ts +++ b/src/plugins/api/pokerogue-api.ts @@ -1,9 +1,9 @@ -import type { TitleStatsResponse } from "#app/@types/PokerogueApi"; -import { ApiBase } from "#app/plugins/api/api-base"; -import { PokerogueAccountApi } from "#app/plugins/api/pokerogue-account-api"; -import { PokerogueAdminApi } from "#app/plugins/api/pokerogue-admin-api"; -import { PokerogueDailyApi } from "#app/plugins/api/pokerogue-daily-api"; -import { PokerogueSavedataApi } from "#app/plugins/api/pokerogue-savedata-api"; +import { ApiBase } from "#api/api-base"; +import { PokerogueAccountApi } from "#api/pokerogue-account-api"; +import { PokerogueAdminApi } from "#api/pokerogue-admin-api"; +import { PokerogueDailyApi } from "#api/pokerogue-daily-api"; +import { PokerogueSavedataApi } from "#api/pokerogue-savedata-api"; +import type { TitleStatsResponse } from "#types/PokerogueApi"; /** * A wrapper for PokéRogue API requests. diff --git a/src/plugins/api/pokerogue-daily-api.ts b/src/plugins/api/pokerogue-daily-api.ts index c9319ae7fdc..2913c7bd4f2 100644 --- a/src/plugins/api/pokerogue-daily-api.ts +++ b/src/plugins/api/pokerogue-daily-api.ts @@ -1,6 +1,6 @@ -import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#app/@types/PokerogueDailyApi"; -import { ApiBase } from "#app/plugins/api/api-base"; -import type { RankingEntry } from "#app/ui/daily-run-scoreboard"; +import { ApiBase } from "#api/api-base"; +import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#types/PokerogueDailyApi"; +import type { RankingEntry } from "#ui/daily-run-scoreboard"; /** * A wrapper for daily-run PokéRogue API requests. diff --git a/src/plugins/api/pokerogue-savedata-api.ts b/src/plugins/api/pokerogue-savedata-api.ts index b8531e82d4f..bc77de8060b 100644 --- a/src/plugins/api/pokerogue-savedata-api.ts +++ b/src/plugins/api/pokerogue-savedata-api.ts @@ -1,8 +1,8 @@ -import type { UpdateAllSavedataRequest } from "#app/@types/PokerogueSavedataApi"; +import { ApiBase } from "#api/api-base"; +import { PokerogueSessionSavedataApi } from "#api/pokerogue-session-savedata-api"; +import { PokerogueSystemSavedataApi } from "#api/pokerogue-system-savedata-api"; import { MAX_INT_ATTR_VALUE } from "#app/constants"; -import { ApiBase } from "#app/plugins/api/api-base"; -import { PokerogueSessionSavedataApi } from "#app/plugins/api/pokerogue-session-savedata-api"; -import { PokerogueSystemSavedataApi } from "#app/plugins/api/pokerogue-system-savedata-api"; +import type { UpdateAllSavedataRequest } from "#types/PokerogueSavedataApi"; /** * A wrapper for PokéRogue savedata API requests. diff --git a/src/plugins/api/pokerogue-session-savedata-api.ts b/src/plugins/api/pokerogue-session-savedata-api.ts index aac8b9b93ad..a807d4b712c 100644 --- a/src/plugins/api/pokerogue-session-savedata-api.ts +++ b/src/plugins/api/pokerogue-session-savedata-api.ts @@ -1,3 +1,5 @@ +import { ApiBase } from "#api/api-base"; +import type { SessionSaveData } from "#system/game-data"; import type { ClearSessionSavedataRequest, ClearSessionSavedataResponse, @@ -5,9 +7,7 @@ import type { GetSessionSavedataRequest, NewClearSessionSavedataRequest, UpdateSessionSavedataRequest, -} from "#app/@types/PokerogueSessionSavedataApi"; -import { ApiBase } from "#app/plugins/api/api-base"; -import type { SessionSaveData } from "#app/system/game-data"; +} from "#types/PokerogueSessionSavedataApi"; /** * A wrapper for PokéRogue session savedata API requests. diff --git a/src/plugins/api/pokerogue-system-savedata-api.ts b/src/plugins/api/pokerogue-system-savedata-api.ts index d6fbb39ae0a..f87aba81ee9 100644 --- a/src/plugins/api/pokerogue-system-savedata-api.ts +++ b/src/plugins/api/pokerogue-system-savedata-api.ts @@ -1,10 +1,10 @@ +import { ApiBase } from "#api/api-base"; import type { GetSystemSavedataRequest, UpdateSystemSavedataRequest, VerifySystemSavedataRequest, VerifySystemSavedataResponse, -} from "#app/@types/PokerogueSystemSavedataApi"; -import { ApiBase } from "#app/plugins/api/api-base"; +} from "#types/PokerogueSystemSavedataApi"; /** * A wrapper for PokéRogue system savedata API requests. diff --git a/src/plugins/cache-busted-loader-plugin.ts b/src/plugins/cache-busted-loader-plugin.ts index 4ae9b352ae3..4853265ec65 100644 --- a/src/plugins/cache-busted-loader-plugin.ts +++ b/src/plugins/cache-busted-loader-plugin.ts @@ -1,8 +1,8 @@ -import { coerceArray } from "#app/utils/common"; +import { coerceArray } from "#utils/common"; let manifest: object; -export default class CacheBustedLoaderPlugin extends Phaser.Loader.LoaderPlugin { +export class CacheBustedLoaderPlugin extends Phaser.Loader.LoaderPlugin { get manifest() { return manifest; } diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 7d3b30ed5b0..4ee4aa730fb 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -1,9 +1,9 @@ -import { camelCaseToKebabCase } from "#app/utils/common"; +import pkg from "#package.json"; +import { camelCaseToKebabCase } from "#utils/common"; import i18next from "i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import HttpBackend from "i18next-http-backend"; import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor"; -import pkg from "../../package.json"; //#region Interfaces/Types @@ -65,28 +65,27 @@ const fonts: Array = [ unicodeRange: rangesByLanguage.chinese, }), extraOptions: { sizeAdjust: "70%", format: "woff2" }, - only: ["en", "es", "fr", "it", "de", "zh", "pt", "ko", "ca", "da", "tr", "ro", "ru"], + only: ["zh"], }, { face: new FontFace("pkmnems", "url(./fonts/unifont-15.1.05.subset.woff2)", { unicodeRange: rangesByLanguage.chinese, }), extraOptions: { format: "woff2" }, - only: ["en", "es", "fr", "it", "de", "zh", "pt", "ko", "ca", "da", "tr", "ro", "ru"], + only: ["zh"], }, // japanese { - face: new FontFace("emerald", "url(./fonts/Galmuri11.subset.woff2)", { + face: new FontFace("emerald", "url(./fonts/pokemon-bw.ttf)", { unicodeRange: rangesByLanguage.japanese, }), - extraOptions: { sizeAdjust: "66%" }, - only: ["ja"], + only: ["en", "es", "fr", "it", "de", "pt", "ko", "ja", "ca", "da", "tr", "ro", "ru"], }, { - face: new FontFace("pkmnems", "url(./fonts/Galmuri9.subset.woff2)", { + face: new FontFace("pkmnems", "url(./fonts/pokemon-bw.ttf)", { unicodeRange: rangesByLanguage.japanese, }), - only: ["ja"], + only: ["en", "es", "fr", "it", "de", "pt", "ko", "ja", "ca", "da", "tr", "ro", "ru"], }, ]; diff --git a/src/plugins/vite/vite-minify-json-plugin.ts b/src/plugins/vite/vite-minify-json-plugin.ts index 38f299eea50..50f5f87fe7c 100644 --- a/src/plugins/vite/vite-minify-json-plugin.ts +++ b/src/plugins/vite/vite-minify-json-plugin.ts @@ -1,5 +1,5 @@ -import path from "path"; import fs from "fs"; +import path from "path"; import type { Plugin as VitePlugin } from "vite"; /** diff --git a/src/scene-base.ts b/src/scene-base.ts index ccea373fca0..3f2e4409794 100644 --- a/src/scene-base.ts +++ b/src/scene-base.ts @@ -1,4 +1,4 @@ -import { coerceArray } from "#app/utils/common"; +import { coerceArray } from "#utils/common"; export const legacyCompatibleImages: string[] = []; diff --git a/src/sprites/pokemon-asset-loader.ts b/src/sprites/pokemon-asset-loader.ts index 980d242a880..9deb68b7443 100644 --- a/src/sprites/pokemon-asset-loader.ts +++ b/src/sprites/pokemon-asset-loader.ts @@ -1,5 +1,5 @@ +import { initMoveAnim, loadMoveAnimAssets } from "#data/battle-anims"; import type { MoveId } from "#enums/move-id"; -import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; /** * Asynchronously load the animations and assets for the provided moves. diff --git a/src/sprites/pokemon-sprite.ts b/src/sprites/pokemon-sprite.ts index cdf9e3acfa6..5a8d7d53f0c 100644 --- a/src/sprites/pokemon-sprite.ts +++ b/src/sprites/pokemon-sprite.ts @@ -1,10 +1,10 @@ +import type { BattleScene } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import { variantColorCache, variantData } from "#app/sprites/variant"; -import { Gender } from "#app/data/gender"; -import { hasExpSprite } from "./sprite-utils"; -import type { Variant, VariantSet } from "#app/sprites/variant"; -import type Pokemon from "#app/field/pokemon"; -import type BattleScene from "#app/battle-scene"; +import { Gender } from "#data/gender"; +import type { Pokemon } from "#field/pokemon"; +import { hasExpSprite } from "#sprites/sprite-utils"; +import type { Variant, VariantSet } from "#sprites/variant"; +import { variantColorCache, variantData } from "#sprites/variant"; // Regex patterns diff --git a/src/sprites/sprite-utils.ts b/src/sprites/sprite-utils.ts index 563bb1235b5..e5c00d4c914 100644 --- a/src/sprites/sprite-utils.ts +++ b/src/sprites/sprite-utils.ts @@ -1,4 +1,4 @@ -import { expSpriteKeys } from "#app/sprites/sprite-keys"; +import { expSpriteKeys } from "#sprites/sprite-keys"; const expKeyRegex = /^pkmn__?(back__)?(shiny__)?(female__)?(\d+)(-.*?)?(?:_[1-3])?$/; diff --git a/src/sprites/variant.ts b/src/sprites/variant.ts index 985068015c6..28d7ed13839 100644 --- a/src/sprites/variant.ts +++ b/src/sprites/variant.ts @@ -1,8 +1,8 @@ -import { VariantTier } from "#app/enums/variant-tier"; -import { hasExpSprite } from "#app/sprites/sprite-utils"; import { globalScene } from "#app/global-scene"; -import type Pokemon from "#app/field/pokemon"; -import { isNullOrUndefined } from "#app/utils/common"; +import { VariantTier } from "#enums/variant-tier"; +import type { Pokemon } from "#field/pokemon"; +import { hasExpSprite } from "#sprites/sprite-utils"; +import { isNullOrUndefined } from "#utils/common"; export type Variant = 0 | 1 | 2; diff --git a/src/starting-wave.ts b/src/starting-wave.ts index 3d36dabe652..7dbcffebbfe 100644 --- a/src/starting-wave.ts +++ b/src/starting-wave.ts @@ -1,3 +1,3 @@ -import Overrides from "./overrides"; +import Overrides from "#app/overrides"; export const startingWave = Overrides.STARTING_WAVE_OVERRIDE || 1; diff --git a/src/system/achv.ts b/src/system/achv.ts index 90816ff65c3..abe6f264d20 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -1,21 +1,21 @@ -import type { Modifier } from "typescript"; -import { TurnHeldItemTransferModifier } from "../modifier/modifier"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import i18next from "i18next"; -import { NumberHolder } from "#app/utils/common"; -import { PlayerGender } from "#enums/player-gender"; -import type { Challenge } from "#app/data/challenge"; +import { globalScene } from "#app/global-scene"; +import { pokemonEvolutions } from "#balance/pokemon-evolutions"; +import type { Challenge } from "#data/challenge"; import { FlipStatChallenge, FreshStartChallenge, + InverseBattleChallenge, SingleGenerationChallenge, SingleTypeChallenge, - InverseBattleChallenge, -} from "#app/data/challenge"; -import type { ConditionFn } from "#app/@types/common"; -import { Stat, getShortenedStatKey } from "#app/enums/stat"; -import { Challenges } from "#app/enums/challenges"; -import { globalScene } from "#app/global-scene"; +} from "#data/challenge"; +import { Challenges } from "#enums/challenges"; +import { PlayerGender } from "#enums/player-gender"; +import { getShortenedStatKey, Stat } from "#enums/stat"; +import { TurnHeldItemTransferModifier } from "#modifiers/modifier"; +import type { ConditionFn } from "#types/common"; +import { NumberHolder } from "#utils/common"; +import i18next from "i18next"; +import type { Modifier } from "typescript"; export enum AchvTier { COMMON, diff --git a/src/system/arena-data.ts b/src/system/arena-data.ts index 29423d10207..9d15ab50fcc 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -1,11 +1,11 @@ -import { Arena } from "../field/arena"; -import type { ArenaTag } from "../data/arena-tag"; -import { loadArenaTag } from "../data/arena-tag"; +import type { ArenaTag } from "#data/arena-tag"; +import { loadArenaTag } from "#data/arena-tag"; +import { Terrain } from "#data/terrain"; +import { Weather } from "#data/weather"; import type { BiomeId } from "#enums/biome-id"; -import { Weather } from "../data/weather"; -import { Terrain } from "#app/data/terrain"; +import { Arena } from "#field/arena"; -export default class ArenaData { +export class ArenaData { public biome: BiomeId; public weather: Weather | null; public terrain: Terrain | null; diff --git a/src/system/challenge-data.ts b/src/system/challenge-data.ts index 87299ae653a..1d4ab23f523 100644 --- a/src/system/challenge-data.ts +++ b/src/system/challenge-data.ts @@ -1,7 +1,7 @@ -import type { Challenge } from "#app/data/challenge"; -import { copyChallenge } from "#app/data/challenge"; +import type { Challenge } from "#data/challenge"; +import { copyChallenge } from "#data/challenge"; -export default class ChallengeData { +export class ChallengeData { public id: number; public value: number; public severity: number; diff --git a/src/system/egg-data.ts b/src/system/egg-data.ts index 63f9e17d7be..4910d01d5a8 100644 --- a/src/system/egg-data.ts +++ b/src/system/egg-data.ts @@ -1,10 +1,10 @@ +import { EGG_SEED, Egg } from "#data/egg"; +import type { EggSourceType } from "#enums/egg-source-types"; import type { EggTier } from "#enums/egg-type"; import type { SpeciesId } from "#enums/species-id"; import type { VariantTier } from "#enums/variant-tier"; -import { EGG_SEED, Egg } from "../data/egg"; -import type { EggSourceType } from "#app/enums/egg-source-types"; -export default class EggData { +export class EggData { public id: number; public tier: EggTier; public sourceType: EggSourceType; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index d5d4256f7d0..6abb5518d1c 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1,74 +1,73 @@ -import i18next from "i18next"; -import type { PokeballCounts } from "#app/battle-scene"; -import { bypassLogin } from "#app/global-vars/bypass-login"; -import { globalScene } from "#app/global-scene"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { allSpecies } from "#app/data/data-lists"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { randInt, getEnumKeys, isLocal, executeIf, fixedInt, randSeedItem, NumberHolder } from "#app/utils/common"; -import Overrides from "#app/overrides"; -import PokemonData from "#app/system/pokemon-data"; -import PersistentModifierData from "#app/system/modifier-data"; -import ArenaData from "#app/system/arena-data"; -import { Unlockables } from "#enums/unlockables"; -import { getGameMode } from "#app/game-mode"; -import { GameModes } from "#enums/game-modes"; -import { BattleType } from "#enums/battle-type"; -import TrainerData from "#app/system/trainer-data"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; -import { resetSettings, setSetting, SettingKeys } from "#app/system/settings/settings"; -import { achvs } from "#app/system/achv"; -import EggData from "#app/system/egg-data"; -import type { Egg } from "#app/data/egg"; -import { vouchers, VoucherType } from "#app/system/voucher"; -import { AES, enc } from "crypto-js"; -import { UiMode } from "#enums/ui-mode"; +import { pokerogueApi } from "#api/pokerogue-api"; import { clientSessionId, loggedInUser, updateUserInfo } from "#app/account"; -import { Nature } from "#enums/nature"; -import { GameStats } from "#app/system/game-stats"; +import type { PokeballCounts } from "#app/battle-scene"; +import { defaultStarterSpecies, saveKey } from "#app/constants"; +import { getGameMode } from "#app/game-mode"; +import { globalScene } from "#app/global-scene"; +import { bypassLogin } from "#app/global-vars/bypass-login"; +import Overrides from "#app/overrides"; import { Tutorial } from "#app/tutorial"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { allMoves } from "#app/data/data-lists"; -import { TrainerVariant } from "#enums/trainer-variant"; -import type { Variant } from "#app/sprites/variant"; -import { setSettingGamepad, SettingGamepad, settingGamepadDefaults } from "#app/system/settings/settings-gamepad"; -import type { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { setSettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { TagAddedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena"; -// biome-ignore lint/performance/noNamespaceImport: Something weird is going on here and I don't want to touch it -import * as Modifier from "#app/modifier/modifier"; -import { StatusEffect } from "#enums/status-effect"; -import ChallengeData from "#app/system/challenge-data"; -import { Device } from "#enums/devices"; -import { GameDataType } from "#enums/game-data-type"; -import type { MoveId } from "#enums/move-id"; -import { PlayerGender } from "#enums/player-gender"; -import { SpeciesId } from "#enums/species-id"; -import { applyChallenges } from "#app/data/challenge"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { pokemonPrevolutions } from "#balance/pokemon-evolutions"; +import { speciesStarterCosts } from "#balance/starters"; +import { ArenaTrapTag } from "#data/arena-tag"; +import { applyChallenges } from "#data/challenge"; +import { allMoves, allSpecies } from "#data/data-lists"; +import type { Egg } from "#data/egg"; +import { pokemonFormChanges } from "#data/pokemon-forms"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { TerrainType } from "#data/terrain"; +import { AbilityAttr } from "#enums/ability-attr"; +import { BattleType } from "#enums/battle-type"; import { ChallengeType } from "#enums/challenge-type"; +import { Device } from "#enums/devices"; +import { DexAttr } from "#enums/dex-attr"; +import { GameDataType } from "#enums/game-data-type"; +import { GameModes } from "#enums/game-modes"; +import type { MoveId } from "#enums/move-id"; +import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; +import { PlayerGender } from "#enums/player-gender"; +import type { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { TrainerVariant } from "#enums/trainer-variant"; +import { UiMode } from "#enums/ui-mode"; +import { Unlockables } from "#enums/unlockables"; import { WeatherType } from "#enums/weather-type"; -import { TerrainType } from "#app/data/terrain"; -import { RUN_HISTORY_LIMIT } from "#app/ui/run-history-ui-handler"; +import { TagAddedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#events/arena"; +import type { EnemyPokemon, PlayerPokemon, Pokemon } from "#field/pokemon"; +// biome-ignore lint/performance/noNamespaceImport: Something weird is going on here and I don't want to touch it +import * as Modifier from "#modifiers/modifier"; +import { MysteryEncounterSaveData } from "#mystery-encounters/mystery-encounter-save-data"; +import type { Variant } from "#sprites/variant"; +import { achvs } from "#system/achv"; +import { ArenaData } from "#system/arena-data"; +import { ChallengeData } from "#system/challenge-data"; +import { EggData } from "#system/egg-data"; +import { GameStats } from "#system/game-stats"; +import { ModifierData as PersistentModifierData } from "#system/modifier-data"; +import { PokemonData } from "#system/pokemon-data"; +import { resetSettings, SettingKeys, setSetting } from "#system/settings"; +import { SettingGamepad, setSettingGamepad, settingGamepadDefaults } from "#system/settings-gamepad"; +import type { SettingKeyboard } from "#system/settings-keyboard"; +import { setSettingKeyboard } from "#system/settings-keyboard"; +import { TrainerData } from "#system/trainer-data"; import { applySessionVersionMigration, - applySystemVersionMigration, applySettingsVersionMigration, -} from "./version_migration/version_converter"; -import { MysteryEncounterSaveData } from "#app/data/mystery-encounters/mystery-encounter-save-data"; -import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import { ArenaTrapTag } from "#app/data/arena-tag"; -import { pokemonFormChanges } from "#app/data/pokemon-forms"; -import type { PokemonType } from "#enums/pokemon-type"; -import type { DexData, DexEntry } from "../@types/dex-data"; -import { DexAttr } from "#enums/dex-attr"; -import { AbilityAttr } from "#enums/ability-attr"; -import { defaultStarterSpecies, saveKey } from "#app/constants"; -import { encrypt, decrypt } from "#app/utils/data"; + applySystemVersionMigration, +} from "#system/version_converter"; +import { VoucherType, vouchers } from "#system/voucher"; +import { trainerConfigs } from "#trainers/trainer-config"; +import type { DexData, DexEntry } from "#types/dex-data"; +import { RUN_HISTORY_LIMIT } from "#ui/run-history-ui-handler"; +import { executeIf, fixedInt, isLocal, NumberHolder, randInt, randSeedItem } from "#utils/common"; +import { decrypt, encrypt } from "#utils/data"; +import { getEnumKeys } from "#utils/enums"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { AES, enc } from "crypto-js"; +import i18next from "i18next"; function getDataTypeKey(dataType: GameDataType, slotId = 0): string { switch (dataType) { diff --git a/src/system/game-speed.ts b/src/system/game-speed.ts index 207a4fb44a1..283e6461e55 100644 --- a/src/system/game-speed.ts +++ b/src/system/game-speed.ts @@ -1,9 +1,9 @@ -import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; +import type { BattleScene } from "#app/battle-scene"; +import { globalScene } from "#app/global-scene"; +import { FixedInt } from "#utils/common"; import type FadeIn from "phaser3-rex-plugins/plugins/audio/fade/FadeIn"; import type FadeOut from "phaser3-rex-plugins/plugins/audio/fade/FadeOut"; -import type BattleScene from "#app/battle-scene"; -import { globalScene } from "#app/global-scene"; -import { FixedInt } from "#app/utils/common"; +import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; type TweenManager = typeof Phaser.Tweens.TweenManager.prototype; diff --git a/src/system/modifier-data.ts b/src/system/modifier-data.ts index cbda45572ac..135d1907e08 100644 --- a/src/system/modifier-data.ts +++ b/src/system/modifier-data.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import { PersistentModifier } from "#app/modifier/modifier"; -import type { GeneratedPersistentModifierType, ModifierType } from "#app/modifier/modifier-type"; -import { ModifierTypeGenerator, getModifierTypeFuncById } from "#app/modifier/modifier-type"; +import { PersistentModifier } from "#modifiers/modifier"; +import type { GeneratedPersistentModifierType, ModifierType } from "#modifiers/modifier-type"; +import { getModifierTypeFuncById, ModifierTypeGenerator } from "#modifiers/modifier-type"; -export default class ModifierData { +export class ModifierData { public player: boolean; public typeId: string; public typePregenArgs: any[]; diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index 050da57e0be..9cea08bfb13 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -1,22 +1,22 @@ -import { BattleType } from "#enums/battle-type"; import { globalScene } from "#app/global-scene"; -import type { Gender } from "../data/gender"; -import { Nature } from "#enums/nature"; -import { PokeballType } from "#enums/pokeball"; -import { getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { Status } from "../data/status-effect"; -import Pokemon, { EnemyPokemon, PokemonBattleData, PokemonSummonData } from "../field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { TrainerSlot } from "#enums/trainer-slot"; -import type { Variant } from "#app/sprites/variant"; +import type { Gender } from "#data/gender"; +import { CustomPokemonData, PokemonBattleData, PokemonSummonData } from "#data/pokemon-data"; +import { getPokemonSpeciesForm } from "#data/pokemon-species"; +import { Status } from "#data/status-effect"; +import { BattleType } from "#enums/battle-type"; import type { BiomeId } from "#enums/biome-id"; import type { MoveId } from "#enums/move-id"; -import type { SpeciesId } from "#enums/species-id"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; +import { Nature } from "#enums/nature"; +import { PokeballType } from "#enums/pokeball"; import type { PokemonType } from "#enums/pokemon-type"; +import type { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { EnemyPokemon, Pokemon } from "#field/pokemon"; +import { PokemonMove } from "#moves/pokemon-move"; +import type { Variant } from "#sprites/variant"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; -export default class PokemonData { +export class PokemonData { public id: number; public player: boolean; public species: SpeciesId; @@ -105,7 +105,7 @@ export default class PokemonData { // TODO: Can't we move some of this verification stuff to an upgrade script? this.nature = source.nature ?? Nature.HARDY; - this.moveset = source.moveset.map((m: any) => PokemonMove.loadMove(m)); + this.moveset = source.moveset?.map((m: any) => PokemonMove.loadMove(m)) ?? []; this.status = source.status ? new Status(source.status.effect, source.status.toxicTurnCount, source.status.sleepTurnsRemaining) : null; diff --git a/src/system/settings/settings-gamepad.ts b/src/system/settings/settings-gamepad.ts index 8a28e9fbf14..2e25eda7300 100644 --- a/src/system/settings/settings-gamepad.ts +++ b/src/system/settings/settings-gamepad.ts @@ -1,9 +1,9 @@ -import type SettingsGamepadUiHandler from "../../ui/settings/settings-gamepad-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { truncateString } from "../../utils/common"; -import { Button } from "#enums/buttons"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { SettingKeyboard } from "#system/settings-keyboard"; +import type { SettingsGamepadUiHandler } from "#ui/settings-gamepad-ui-handler"; +import { truncateString } from "#utils/common"; import i18next from "i18next"; export enum SettingGamepad { diff --git a/src/system/settings/settings-keyboard.ts b/src/system/settings/settings-keyboard.ts index ec5c9ad6b0e..07f4f86bdb0 100644 --- a/src/system/settings/settings-keyboard.ts +++ b/src/system/settings/settings-keyboard.ts @@ -1,8 +1,8 @@ +import { globalScene } from "#app/global-scene"; import { Button } from "#enums/buttons"; import { UiMode } from "#enums/ui-mode"; -import type SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; +import type { SettingsKeyboardUiHandler } from "#ui/settings-keyboard-ui-handler"; import i18next from "i18next"; -import { globalScene } from "#app/global-scene"; export enum SettingKeyboard { // Default_Layout = "DEFAULT_LAYOUT", diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index ca5395a5af7..19d10baedfd 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -1,35 +1,32 @@ -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; import { hasTouchscreen } from "#app/touch-controls"; -import { updateWindowType } from "#app/ui/ui-theme"; -import { CandyUpgradeNotificationChangedEvent } from "#app/events/battle-scene"; -import type SettingsUiHandler from "#app/ui/settings/settings-ui-handler"; import { EaseType } from "#enums/ease-type"; import { MoneyFormat } from "#enums/money-format"; import { PlayerGender } from "#enums/player-gender"; import { ShopCursorTarget } from "#enums/shop-cursor-target"; -import { isLocal } from "#app/utils/common"; +import { UiMode } from "#enums/ui-mode"; +import { CandyUpgradeNotificationChangedEvent } from "#events/battle-scene"; +import type { SettingsUiHandler } from "#ui/settings-ui-handler"; +import { updateWindowType } from "#ui/ui-theme"; +import { isLocal } from "#utils/common"; +import i18next from "i18next"; -const VOLUME_OPTIONS: SettingOption[] = new Array(11).fill(null).map((_, i) => - i - ? { - value: (i * 10).toString(), - label: (i * 10).toString(), - } - : { - value: "Mute", - label: i18next.t("settings:mute"), - }, -); +const VOLUME_OPTIONS: SettingOption[] = [ + { + value: "Mute", + label: i18next.t("settings:mute"), + }, +]; +for (let i = 1; i < 11; i++) { + const value = (i * 10).toString(); + VOLUME_OPTIONS.push({ value, label: value }); +} -const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).map((_, i) => { +const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = []; +for (let i = 0; i < 9; i++) { const value = ((i + 1) * 10).toString(); - return { - value, - label: value, - }; -}); + SHOP_OVERLAY_OPACITY_OPTIONS.push({ value, label: value }); +} const OFF_ON: SettingOption[] = [ { @@ -183,6 +180,12 @@ export enum MusicPreference { ALLGENS, } +const windowTypeOptions: SettingOption[] = []; +for (let i = 0; i < 5; i++) { + const value = (i + 1).toString(); + windowTypeOptions.push({ value, label: value }); +} + /** * All Settings not related to controls */ @@ -432,13 +435,7 @@ export const Setting: Array = [ { key: SettingKeys.Window_Type, label: i18next.t("settings:windowType"), - options: new Array(5).fill(null).map((_, i) => { - const windowType = (i + 1).toString(); - return { - value: windowType, - label: windowType, - }; - }), + options: windowTypeOptions, default: 0, type: SettingType.DISPLAY, }, diff --git a/src/system/trainer-data.ts b/src/system/trainer-data.ts index 7c9bffd99ee..ce402ff23bf 100644 --- a/src/system/trainer-data.ts +++ b/src/system/trainer-data.ts @@ -1,8 +1,8 @@ import type { TrainerType } from "#enums/trainer-type"; -import Trainer from "../field/trainer"; import { TrainerVariant } from "#enums/trainer-variant"; +import { Trainer } from "#field/trainer"; -export default class TrainerData { +export class TrainerData { public trainerType: TrainerType; public variant: TrainerVariant; public partyTemplateIndex: number; diff --git a/src/system/unlockables.ts b/src/system/unlockables.ts index 72588858eae..647aad9bcdb 100644 --- a/src/system/unlockables.ts +++ b/src/system/unlockables.ts @@ -1,7 +1,7 @@ -import i18next from "i18next"; -import { GameMode } from "../game-mode"; +import { GameMode } from "#app/game-mode"; import { GameModes } from "#enums/game-modes"; import { Unlockables } from "#enums/unlockables"; +import i18next from "i18next"; export function getUnlockableName(unlockable: Unlockables) { switch (unlockable) { diff --git a/src/system/version_migration/version_converter.ts b/src/system/version_migration/version_converter.ts index 789fa96958c..c49490da756 100644 --- a/src/system/version_migration/version_converter.ts +++ b/src/system/version_migration/version_converter.ts @@ -1,11 +1,11 @@ /** biome-ignore-all lint/performance/noNamespaceImport: Convenience */ -import type { SessionSaveMigrator } from "#app/@types/SessionSaveMigrator"; -import type { SettingsSaveMigrator } from "#app/@types/SettingsSaveMigrator"; -import type { SystemSaveMigrator } from "#app/@types/SystemSaveMigrator"; -import type { SessionSaveData, SystemSaveData } from "#app/system/game-data"; +import { version } from "#package.json"; +import type { SessionSaveData, SystemSaveData } from "#system/game-data"; +import type { SessionSaveMigrator } from "#types/SessionSaveMigrator"; +import type { SettingsSaveMigrator } from "#types/SettingsSaveMigrator"; +import type { SystemSaveMigrator } from "#types/SystemSaveMigrator"; import { compareVersions } from "compare-versions"; -import { version } from "../../../package.json"; /* // template for save migrator creation @@ -24,7 +24,7 @@ const systemMigratorA: SystemSaveMigrator = { }, }; -export const systemMigrators: Readonly = [systemMigratorA] as const; +export const systemMigrators: readonly SystemSaveMigrator[] = [systemMigratorA] as const; const sessionMigratorA: SessionSaveMigrator = { version: "A.B.C", @@ -33,7 +33,7 @@ const sessionMigratorA: SessionSaveMigrator = { }, }; -export const sessionMigrators: Readonly = [sessionMigratorA] as const; +export const sessionMigrators: readonly SessionSaveMigrator[] = [sessionMigratorA] as const; const settingsMigratorA: SettingsSaveMigrator = { version: "A.B.C", @@ -43,26 +43,17 @@ const settingsMigratorA: SettingsSaveMigrator = { }, }; -export const settingsMigrators: Readonly = [settingsMigratorA] as const; +export const settingsMigrators: readonly SettingsSaveMigrator[] = [settingsMigratorA] as const; */ -// --- vA.B.C PATCHES --- // -// import * as vA_B_C from "./versions/vA_B_C"; +// Add migrator imports below: +// Example: import * as vA_B_C from "#system/vA_B_C"; -// --- v1.0.4 (and below) PATCHES --- // -import * as v1_0_4 from "./versions/v1_0_4"; - -// --- v1.7.0 PATCHES --- // -import * as v1_7_0 from "./versions/v1_7_0"; - -// --- v1.8.3 PATCHES --- // -import * as v1_8_3 from "./versions/v1_8_3"; - -// --- v1.9.0 PATCHES --- // -import * as v1_9_0 from "./versions/v1_9_0"; - -// --- v1.10.0 PATCHES --- // -import * as v1_10_0 from "./versions/v1_10_0"; +import * as v1_0_4 from "#system/v1_0_4"; +import * as v1_7_0 from "#system/v1_7_0"; +import * as v1_8_3 from "#system/v1_8_3"; +import * as v1_9_0 from "#system/v1_9_0"; +import * as v1_10_0 from "#system/v1_10_0"; /** Current game version */ const LATEST_VERSION = version; diff --git a/src/system/version_migration/versions/v1_0_4.ts b/src/system/version_migration/versions/v1_0_4.ts index a08327a3b70..3523a5b8826 100644 --- a/src/system/version_migration/versions/v1_0_4.ts +++ b/src/system/version_migration/versions/v1_0_4.ts @@ -1,14 +1,14 @@ -import { SettingKeys } from "#app/system/settings/settings"; -import type { SystemSaveData, SessionSaveData } from "#app/system/game-data"; import { defaultStarterSpecies } from "#app/constants"; +import { allSpecies } from "#data/data-lists"; +import { CustomPokemonData } from "#data/pokemon-data"; import { AbilityAttr } from "#enums/ability-attr"; import { DexAttr } from "#enums/dex-attr"; -import { allSpecies } from "#app/data/data-lists"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import { isNullOrUndefined } from "#app/utils/common"; -import type { SystemSaveMigrator } from "#app/@types/SystemSaveMigrator"; -import type { SettingsSaveMigrator } from "#app/@types/SettingsSaveMigrator"; -import type { SessionSaveMigrator } from "#app/@types/SessionSaveMigrator"; +import type { SessionSaveData, SystemSaveData } from "#system/game-data"; +import { SettingKeys } from "#system/settings"; +import type { SessionSaveMigrator } from "#types/SessionSaveMigrator"; +import type { SettingsSaveMigrator } from "#types/SettingsSaveMigrator"; +import type { SystemSaveMigrator } from "#types/SystemSaveMigrator"; +import { isNullOrUndefined } from "#utils/common"; /** * Migrate ability starter data if empty for caught species. @@ -95,7 +95,7 @@ const fixStarterData: SystemSaveMigrator = { }, }; -export const systemMigrators: Readonly = [ +export const systemMigrators: readonly SystemSaveMigrator[] = [ migrateAbilityData, fixLegendaryStats, fixStarterData, @@ -118,7 +118,7 @@ const fixRerollTarget: SettingsSaveMigrator = { }, }; -export const settingsMigrators: Readonly = [fixRerollTarget] as const; +export const settingsMigrators: readonly SettingsSaveMigrator[] = [fixRerollTarget] as const; /** * Converts old lapsing modifiers (battle items, lures, and Dire Hit) and @@ -206,4 +206,4 @@ const migrateCustomPokemonData: SessionSaveMigrator = { }, }; -export const sessionMigrators: Readonly = [migrateModifiers, migrateCustomPokemonData] as const; +export const sessionMigrators: readonly SessionSaveMigrator[] = [migrateModifiers, migrateCustomPokemonData] as const; diff --git a/src/system/version_migration/versions/v1_10_0.ts b/src/system/version_migration/versions/v1_10_0.ts index 4d1dedf701e..66436717639 100644 --- a/src/system/version_migration/versions/v1_10_0.ts +++ b/src/system/version_migration/versions/v1_10_0.ts @@ -1,10 +1,10 @@ -import type { SessionSaveMigrator } from "#app/@types/SessionSaveMigrator"; import type { BattlerIndex } from "#enums/battler-index"; -import type { TurnMove } from "#app/field/pokemon"; -import type { MoveResult } from "#enums/move-result"; -import type { SessionSaveData } from "#app/system/game-data"; -import { MoveUseMode } from "#enums/move-use-mode"; import type { MoveId } from "#enums/move-id"; +import type { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; +import type { SessionSaveData } from "#system/game-data"; +import type { SessionSaveMigrator } from "#types/SessionSaveMigrator"; +import type { TurnMove } from "#types/turn-move"; /** Prior signature of `TurnMove`; used to ensure parity */ interface OldTurnMove { @@ -45,4 +45,4 @@ const fixMoveHistory: SessionSaveMigrator = { }, }; -export const sessionMigrators: Readonly = [fixMoveHistory] as const; +export const sessionMigrators: readonly SessionSaveMigrator[] = [fixMoveHistory] as const; diff --git a/src/system/version_migration/versions/v1_7_0.ts b/src/system/version_migration/versions/v1_7_0.ts index e3c599bf77b..8f757456d0a 100644 --- a/src/system/version_migration/versions/v1_7_0.ts +++ b/src/system/version_migration/versions/v1_7_0.ts @@ -1,11 +1,11 @@ -import type { SessionSaveMigrator } from "#app/@types/SessionSaveMigrator"; -import type { SystemSaveMigrator } from "#app/@types/SystemSaveMigrator"; -import { getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; import { globalScene } from "#app/global-scene"; -import type { SessionSaveData, SystemSaveData } from "#app/system/game-data"; +import { getPokemonSpeciesForm } from "#data/pokemon-species"; import { DexAttr } from "#enums/dex-attr"; -import { isNullOrUndefined } from "#app/utils/common"; +import type { SessionSaveData, SystemSaveData } from "#system/game-data"; +import type { SessionSaveMigrator } from "#types/SessionSaveMigrator"; +import type { SystemSaveMigrator } from "#types/SystemSaveMigrator"; +import { isNullOrUndefined } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** * If a starter is caught, but the only forms registered as caught are not starterSelectable, @@ -37,7 +37,7 @@ const migrateUnselectableForms: SystemSaveMigrator = { }, }; -export const systemMigrators: Readonly = [migrateUnselectableForms] as const; +export const systemMigrators: readonly SystemSaveMigrator[] = [migrateUnselectableForms] as const; const migrateTera: SessionSaveMigrator = { version: "1.7.0", @@ -82,4 +82,4 @@ const migrateTera: SessionSaveMigrator = { }, }; -export const sessionMigrators: Readonly = [migrateTera] as const; +export const sessionMigrators: readonly SessionSaveMigrator[] = [migrateTera] as const; diff --git a/src/system/version_migration/versions/v1_8_3.ts b/src/system/version_migration/versions/v1_8_3.ts index 81430659e0b..e6b5129d9d5 100644 --- a/src/system/version_migration/versions/v1_8_3.ts +++ b/src/system/version_migration/versions/v1_8_3.ts @@ -1,8 +1,8 @@ -import type { SystemSaveMigrator } from "#app/@types/SystemSaveMigrator"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import type { SystemSaveData } from "#app/system/game-data"; import { DexAttr } from "#enums/dex-attr"; import { SpeciesId } from "#enums/species-id"; +import type { SystemSaveData } from "#system/game-data"; +import type { SystemSaveMigrator } from "#types/SystemSaveMigrator"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** * If a starter is caught, but the only forms registered as caught are not starterSelectable, @@ -28,4 +28,4 @@ const migratePichuForms: SystemSaveMigrator = { }, }; -export const systemMigrators: Readonly = [migratePichuForms] as const; +export const systemMigrators: readonly SystemSaveMigrator[] = [migratePichuForms] as const; diff --git a/src/system/version_migration/versions/v1_9_0.ts b/src/system/version_migration/versions/v1_9_0.ts index 0bd5a422ffb..80da5f2996b 100644 --- a/src/system/version_migration/versions/v1_9_0.ts +++ b/src/system/version_migration/versions/v1_9_0.ts @@ -1,8 +1,8 @@ -import type { SessionSaveMigrator } from "#app/@types/SessionSaveMigrator"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import type { SessionSaveData } from "#app/system/game-data"; -import type PokemonData from "#app/system/pokemon-data"; import { MoveId } from "#enums/move-id"; +import { PokemonMove } from "#moves/pokemon-move"; +import type { SessionSaveData } from "#system/game-data"; +import type { PokemonData } from "#system/pokemon-data"; +import type { SessionSaveMigrator } from "#types/SessionSaveMigrator"; /** * Migrate all lingering rage fist data inside `CustomPokemonData`, @@ -38,4 +38,4 @@ const migratePartyData: SessionSaveMigrator = { }, }; -export const sessionMigrators: Readonly = [migratePartyData] as const; +export const sessionMigrators: readonly SessionSaveMigrator[] = [migratePartyData] as const; diff --git a/src/system/voucher.ts b/src/system/voucher.ts index ce10560c3e2..79e95f0b07b 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -1,9 +1,9 @@ -import i18next from "i18next"; -import { AchvTier, achvs, getAchievementDescription } from "./achv"; import type { PlayerGender } from "#enums/player-gender"; import { TrainerType } from "#enums/trainer-type"; -import type { ConditionFn } from "#app/@types/common"; -import { trainerConfigs } from "#app/data/trainers/trainer-config"; +import { AchvTier, achvs, getAchievementDescription } from "#system/achv"; +import { trainerConfigs } from "#trainers/trainer-config"; +import type { ConditionFn } from "#types/common"; +import i18next from "i18next"; export enum VoucherType { REGULAR, diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index f73c6dab1b2..02cb7fe8e0d 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -1,15 +1,15 @@ import { globalScene } from "#app/global-scene"; -import { TextStyle, addTextObject } from "#app/ui/text"; -import type { nil } from "#app/utils/common"; -import { isNullOrUndefined } from "#app/utils/common"; -import i18next from "i18next"; -import { SpeciesId } from "#enums/species-id"; -import type { WeatherPoolEntry } from "#app/data/weather"; -import { WeatherType } from "#enums/weather-type"; -import { CLASSIC_CANDY_FRIENDSHIP_MULTIPLIER } from "./data/balance/starters"; -import { MysteryEncounterType } from "./enums/mystery-encounter-type"; -import { MysteryEncounterTier } from "./enums/mystery-encounter-tier"; +import { CLASSIC_CANDY_FRIENDSHIP_MULTIPLIER } from "#balance/starters"; +import type { WeatherPoolEntry } from "#data/weather"; import { Challenges } from "#enums/challenges"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { WeatherType } from "#enums/weather-type"; +import { addTextObject, TextStyle } from "#ui/text"; +import type { nil } from "#utils/common"; +import { isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; export enum EventType { SHINY, diff --git a/src/touch-controls.ts b/src/touch-controls.ts index 5319976648f..faee9ea232e 100644 --- a/src/touch-controls.ts +++ b/src/touch-controls.ts @@ -1,11 +1,11 @@ import { globalScene } from "#app/global-scene"; import { Button } from "#enums/buttons"; -import EventEmitter = Phaser.Events.EventEmitter; +import type Phaser from "phaser"; const repeatInputDelayMillis = 250; -export default class TouchControl { - events: EventEmitter; +export class TouchControl { + events: Phaser.Events.EventEmitter; private buttonLock: string[] = []; private inputInterval: NodeJS.Timeout[] = []; /** Whether touch controls are disabled */ diff --git a/src/tutorial.ts b/src/tutorial.ts index d9ae3a03290..018d0927da0 100644 --- a/src/tutorial.ts +++ b/src/tutorial.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import AwaitableUiHandler from "./ui/awaitable-ui-handler"; -import type UiHandler from "./ui/ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; import Overrides from "#app/overrides"; +import { UiMode } from "#enums/ui-mode"; +import { AwaitableUiHandler } from "#ui/awaitable-ui-handler"; +import type { UiHandler } from "#ui/ui-handler"; +import i18next from "i18next"; export enum Tutorial { Intro = "INTRO", diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index f7a97ec673c..71c5ac1049e 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -1,19 +1,19 @@ -import type Phaser from "phaser"; -import { UiMode } from "#enums/ui-mode"; -import type { InputsController } from "./inputs-controller"; -import type MessageUiHandler from "./ui/message-ui-handler"; -import StarterSelectUiHandler from "./ui/starter-select-ui-handler"; -import { Setting, SettingKeys, settingIndex } from "./system/settings/settings"; -import SettingsUiHandler from "./ui/settings/settings-ui-handler"; -import { Button } from "#enums/buttons"; -import SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; -import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; import { globalScene } from "#app/global-scene"; -import SettingsDisplayUiHandler from "./ui/settings/settings-display-ui-handler"; -import SettingsAudioUiHandler from "./ui/settings/settings-audio-ui-handler"; -import RunInfoUiHandler from "./ui/run-info-ui-handler"; -import PokedexUiHandler from "./ui/pokedex-ui-handler"; -import PokedexPageUiHandler from "./ui/pokedex-page-ui-handler"; +import type { InputsController } from "#app/inputs-controller"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { Setting, SettingKeys, settingIndex } from "#system/settings"; +import type { MessageUiHandler } from "#ui/message-ui-handler"; +import { PokedexPageUiHandler } from "#ui/pokedex-page-ui-handler"; +import { PokedexUiHandler } from "#ui/pokedex-ui-handler"; +import { RunInfoUiHandler } from "#ui/run-info-ui-handler"; +import { SettingsAudioUiHandler } from "#ui/settings-audio-ui-handler"; +import { SettingsDisplayUiHandler } from "#ui/settings-display-ui-handler"; +import { SettingsGamepadUiHandler } from "#ui/settings-gamepad-ui-handler"; +import { SettingsKeyboardUiHandler } from "#ui/settings-keyboard-ui-handler"; +import { SettingsUiHandler } from "#ui/settings-ui-handler"; +import { StarterSelectUiHandler } from "#ui/starter-select-ui-handler"; +import type Phaser from "phaser"; type ActionKeys = Record void>; diff --git a/src/ui/ability-bar.ts b/src/ui/ability-bar.ts index 5481791de64..79a68e9dce7 100644 --- a/src/ui/ability-bar.ts +++ b/src/ui/ability-bar.ts @@ -1,12 +1,12 @@ import { globalScene } from "#app/global-scene"; -import { TextStyle, addTextObject } from "./text"; +import { addTextObject, TextStyle } from "#ui/text"; import i18next from "i18next"; const barWidth = 118; const screenLeft = 0; const baseY = -116; -export default class AbilityBar extends Phaser.GameObjects.Container { +export class AbilityBar extends Phaser.GameObjects.Container { private abilityBars: Phaser.GameObjects.Image[]; private abilityBarText: Phaser.GameObjects.Text; private player: boolean; diff --git a/src/ui/abstact-option-select-ui-handler.ts b/src/ui/abstact-option-select-ui-handler.ts index e1263bc088c..d93ad8b7665 100644 --- a/src/ui/abstact-option-select-ui-handler.ts +++ b/src/ui/abstact-option-select-ui-handler.ts @@ -1,11 +1,11 @@ import { globalScene } from "#app/global-scene"; -import { TextStyle, addBBCodeTextObject, getTextColor, getTextStyleOptions } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { addWindow } from "./ui-theme"; -import { rgbHexToRgba, fixedInt } from "#app/utils/common"; -import { argbFromRgba } from "@material/material-color-utilities"; import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { addBBCodeTextObject, getTextColor, getTextStyleOptions, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt, rgbHexToRgba } from "#utils/common"; +import { argbFromRgba } from "@material/material-color-utilities"; import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; export interface OptionSelectConfig { @@ -33,7 +33,7 @@ export interface OptionSelectItem { const scrollUpLabel = "↑"; const scrollDownLabel = "↓"; -export default abstract class AbstractOptionSelectUiHandler extends UiHandler { +export abstract class AbstractOptionSelectUiHandler extends UiHandler { protected optionSelectContainer: Phaser.GameObjects.Container; protected optionSelectTextContainer: Phaser.GameObjects.Container; protected optionSelectBg: Phaser.GameObjects.NineSlice; diff --git a/src/ui/achv-bar.ts b/src/ui/achv-bar.ts index 1e068157afa..8e0f2a9404b 100644 --- a/src/ui/achv-bar.ts +++ b/src/ui/achv-bar.ts @@ -1,10 +1,10 @@ import { globalScene } from "#app/global-scene"; -import { Achv, getAchievementDescription } from "../system/achv"; -import { Voucher } from "../system/voucher"; -import { TextStyle, addTextObject } from "./text"; import type { PlayerGender } from "#enums/player-gender"; +import { Achv, getAchievementDescription } from "#system/achv"; +import { Voucher } from "#system/voucher"; +import { addTextObject, TextStyle } from "#ui/text"; -export default class AchvBar extends Phaser.GameObjects.Container { +export class AchvBar extends Phaser.GameObjects.Container { private defaultWidth: number; private defaultHeight: number; diff --git a/src/ui/achvs-ui-handler.ts b/src/ui/achvs-ui-handler.ts index 8588530d370..6b247f6da96 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -1,17 +1,17 @@ -import { Button } from "#enums/buttons"; -import i18next from "i18next"; -import type { Achv } from "#app/system/achv"; -import { achvs, getAchievementDescription } from "#app/system/achv"; -import type { Voucher } from "#app/system/voucher"; -import { getVoucherTypeIcon, getVoucherTypeName, vouchers } from "#app/system/voucher"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import { addTextObject, TextStyle } from "#app/ui/text"; -import type { UiMode } from "#enums/ui-mode"; -import { addWindow } from "#app/ui/ui-theme"; -import { ScrollBar } from "#app/ui/scroll-bar"; -import { PlayerGender } from "#enums/player-gender"; import { globalScene } from "#app/global-scene"; -import type { AchvUnlocks, VoucherUnlocks } from "#app/system/game-data"; +import { Button } from "#enums/buttons"; +import { PlayerGender } from "#enums/player-gender"; +import type { UiMode } from "#enums/ui-mode"; +import type { Achv } from "#system/achv"; +import { achvs, getAchievementDescription } from "#system/achv"; +import type { AchvUnlocks, VoucherUnlocks } from "#system/game-data"; +import type { Voucher } from "#system/voucher"; +import { getVoucherTypeIcon, getVoucherTypeName, vouchers } from "#system/voucher"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { ScrollBar } from "#ui/scroll-bar"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import i18next from "i18next"; const Page = { ACHIEVEMENTS: 0, @@ -27,7 +27,7 @@ const languageSettings: { [key: string]: LanguageSetting } = { de: { TextSize: "80px" }, }; -export default class AchvsUiHandler extends MessageUiHandler { +export class AchvsUiHandler extends MessageUiHandler { private readonly ROWS = 4; private readonly COLS = 17; @@ -81,7 +81,7 @@ export default class AchvsUiHandler extends MessageUiHandler { this.headerBg = addWindow(0, 0, WIDTH - 2, 24); - this.headerText = addTextObject(0, 0, "", TextStyle.SETTINGS_LABEL) + this.headerText = addTextObject(0, 0, "", TextStyle.HEADER_LABEL) .setOrigin(0) .setPositionRelative(this.headerBg, 8, 4); this.headerActionButton = new Phaser.GameObjects.Sprite(globalScene, 0, 0, "keyboard", "ACTION.png") diff --git a/src/ui/admin-ui-handler.ts b/src/ui/admin-ui-handler.ts index c8c8e43802b..3d0a1153127 100644 --- a/src/ui/admin-ui-handler.ts +++ b/src/ui/admin-ui-handler.ts @@ -1,17 +1,17 @@ -import { Button } from "#app/enums/buttons"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import { formatText } from "#app/utils/common"; -import type { InputFieldConfig } from "./form-modal-ui-handler"; -import { FormModalUiHandler } from "./form-modal-ui-handler"; -import type { ModalConfig } from "./modal-ui-handler"; -import { TextStyle } from "./text"; -import { UiMode } from "#enums/ui-mode"; +import { pokerogueApi } from "#api/pokerogue-api"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import type { InputFieldConfig } from "#ui/form-modal-ui-handler"; +import { FormModalUiHandler } from "#ui/form-modal-ui-handler"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { TextStyle } from "#ui/text"; +import { formatText } from "#utils/common"; type AdminUiHandlerService = "discord" | "google"; type AdminUiHandlerServiceMode = "Link" | "Unlink"; -export default class AdminUiHandler extends FormModalUiHandler { +export class AdminUiHandler extends FormModalUiHandler { private adminMode: AdminMode; private adminResult: AdminSearchInfo; private config: ModalConfig; diff --git a/src/ui/arena-flyout.ts b/src/ui/arena-flyout.ts index fec02ffb660..43cc553d936 100644 --- a/src/ui/arena-flyout.ts +++ b/src/ui/arena-flyout.ts @@ -1,23 +1,23 @@ -import { addTextObject, TextStyle } from "./text"; import { globalScene } from "#app/global-scene"; -import { ArenaTrapTag } from "#app/data/arena-tag"; +import { ArenaTrapTag } from "#data/arena-tag"; +import { TerrainType } from "#data/terrain"; import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { WeatherType } from "#enums/weather-type"; -import { TerrainType } from "#app/data/terrain"; -import { addWindow, WindowVariant } from "./ui-theme"; -import type { ArenaEvent } from "#app/events/arena"; +import type { ArenaEvent } from "#events/arena"; import { ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent, -} from "#app/events/arena"; -import type { TurnEndEvent } from "../events/battle-scene"; -import { BattleSceneEventType } from "../events/battle-scene"; -import { ArenaTagType } from "#enums/arena-tag-type"; -import TimeOfDayWidget from "./time-of-day-widget"; -import { toCamelCaseString, formatText, fixedInt } from "#app/utils/common"; +} from "#events/arena"; +import type { TurnEndEvent } from "#events/battle-scene"; +import { BattleSceneEventType } from "#events/battle-scene"; +import { addTextObject, TextStyle } from "#ui/text"; +import { TimeOfDayWidget } from "#ui/time-of-day-widget"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; +import { fixedInt, formatText, toCamelCaseString } from "#utils/common"; import type { ParseKeys } from "i18next"; import i18next from "i18next"; diff --git a/src/ui/autocomplete-ui-handler.ts b/src/ui/autocomplete-ui-handler.ts index ba1802c8582..6016245c38d 100644 --- a/src/ui/autocomplete-ui-handler.ts +++ b/src/ui/autocomplete-ui-handler.ts @@ -1,8 +1,8 @@ import { Button } from "#enums/buttons"; -import AbstractOptionSelectUiHandler from "./abstact-option-select-ui-handler"; import { UiMode } from "#enums/ui-mode"; +import { AbstractOptionSelectUiHandler } from "#ui/abstact-option-select-ui-handler"; -export default class AutoCompleteUiHandler extends AbstractOptionSelectUiHandler { +export class AutoCompleteUiHandler extends AbstractOptionSelectUiHandler { modalContainer: Phaser.GameObjects.Container; constructor(mode: UiMode = UiMode.OPTION_SELECT) { super(mode); diff --git a/src/ui/awaitable-ui-handler.ts b/src/ui/awaitable-ui-handler.ts index 3c577fd4411..e8513b4acc1 100644 --- a/src/ui/awaitable-ui-handler.ts +++ b/src/ui/awaitable-ui-handler.ts @@ -1,9 +1,9 @@ -import type { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { Button } from "#enums/buttons"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import type { UiMode } from "#enums/ui-mode"; +import { UiHandler } from "#ui/ui-handler"; -export default abstract class AwaitableUiHandler extends UiHandler { +export abstract class AwaitableUiHandler extends UiHandler { protected awaitingActionInput: boolean; protected onActionInput: Function | null; public tutorialActive = false; diff --git a/src/ui/ball-ui-handler.ts b/src/ui/ball-ui-handler.ts index 11fb485164a..bde340e3cf7 100644 --- a/src/ui/ball-ui-handler.ts +++ b/src/ui/ball-ui-handler.ts @@ -1,15 +1,15 @@ -import { getPokeballName } from "../data/pokeball"; -import { addTextObject, getTextStyleOptions, TextStyle } from "./text"; +import { globalScene } from "#app/global-scene"; +import { getPokeballName } from "#data/pokeball"; +import { Button } from "#enums/buttons"; import { Command } from "#enums/command"; import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { addWindow } from "./ui-theme"; -import { Button } from "#enums/buttons"; -import type { CommandPhase } from "#app/phases/command-phase"; -import { globalScene } from "#app/global-scene"; +import type { CommandPhase } from "#phases/command-phase"; +import { addTextObject, getTextStyleOptions, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; import i18next from "i18next"; -export default class BallUiHandler extends UiHandler { +export class BallUiHandler extends UiHandler { private pokeballSelectContainer: Phaser.GameObjects.Container; private pokeballSelectBg: Phaser.GameObjects.NineSlice; private countsText: Phaser.GameObjects.Text; @@ -115,7 +115,7 @@ export default class BallUiHandler extends UiHandler { updateCounts() { this.countsText.setText( Object.values(globalScene.pokeballCounts) - .map(c => `x${c}`) + .map(c => `×${c}`) .join("\n"), ); } diff --git a/src/ui/base-stats-overlay.ts b/src/ui/base-stats-overlay.ts index 0541ae766e5..888b87a8d11 100644 --- a/src/ui/base-stats-overlay.ts +++ b/src/ui/base-stats-overlay.ts @@ -1,9 +1,9 @@ -import type { InfoToggle } from "../battle-scene"; -import { TextStyle, addTextObject } from "./text"; -import { addWindow } from "./ui-theme"; -import { fixedInt } from "#app/utils/common"; -import i18next from "i18next"; +import type { InfoToggle } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt } from "#utils/common"; +import i18next from "i18next"; interface BaseStatsOverlaySettings { scale?: number; // scale the box? A scale of 0.5 is recommended diff --git a/src/ui/battle-flyout.ts b/src/ui/battle-flyout.ts index 6f8f6a76b34..083dc7bbf19 100644 --- a/src/ui/battle-flyout.ts +++ b/src/ui/battle-flyout.ts @@ -1,14 +1,14 @@ -import type { EnemyPokemon, default as Pokemon } from "../field/pokemon"; -import { addTextObject, TextStyle } from "./text"; -import { fixedInt } from "#app/utils/common"; import { globalScene } from "#app/global-scene"; -import type Move from "#app/data/moves/move"; -import type { BerryUsedEvent, MoveUsedEvent } from "../events/battle-scene"; -import { BattleSceneEventType } from "../events/battle-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; import { BerryType } from "#enums/berry-type"; import { MoveId } from "#enums/move-id"; import { UiTheme } from "#enums/ui-theme"; -import { getPokemonNameWithAffix } from "#app/messages"; +import type { BerryUsedEvent, MoveUsedEvent } from "#events/battle-scene"; +import { BattleSceneEventType } from "#events/battle-scene"; +import type { EnemyPokemon, Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { addTextObject, TextStyle } from "#ui/text"; +import { fixedInt } from "#utils/common"; /** Container for info about a {@linkcode Move} */ interface MoveInfo { @@ -22,7 +22,7 @@ interface MoveInfo { } /** A Flyout Menu attached to each {@linkcode BattleInfo} object on the field UI */ -export default class BattleFlyout extends Phaser.GameObjects.Container { +export class BattleFlyout extends Phaser.GameObjects.Container { /** Is this object linked to a player's Pokemon? */ private player: boolean; diff --git a/src/ui/battle-info/battle-info.ts b/src/ui/battle-info/battle-info.ts index e67000bb243..4a2a6d1804d 100644 --- a/src/ui/battle-info/battle-info.ts +++ b/src/ui/battle-info/battle-info.ts @@ -1,13 +1,13 @@ -import type { default as Pokemon } from "../../field/pokemon"; -import { getLocalizedSpriteKey, fixedInt, getShinyDescriptor } from "#app/utils/common"; -import { addTextObject, TextStyle } from "../text"; -import { getGenderSymbol, getGenderColor, Gender } from "../../data/gender"; -import { StatusEffect } from "#enums/status-effect"; import { globalScene } from "#app/global-scene"; -import { getTypeRgb } from "#app/data/type"; +import { Gender, getGenderColor, getGenderSymbol } from "#data/gender"; +import { getTypeRgb } from "#data/type"; import { PokemonType } from "#enums/pokemon-type"; -import { getVariantTint } from "#app/sprites/variant"; import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import type { Pokemon } from "#field/pokemon"; +import { getVariantTint } from "#sprites/variant"; +import { addTextObject, TextStyle } from "#ui/text"; +import { fixedInt, getLocalizedSpriteKey, getShinyDescriptor } from "#utils/common"; import i18next from "i18next"; /** @@ -37,7 +37,7 @@ export type BattleInfoParamList = { }; }; -export default abstract class BattleInfo extends Phaser.GameObjects.Container { +export abstract class BattleInfo extends Phaser.GameObjects.Container { public static readonly EXP_GAINS_DURATION_BASE = 1650; protected baseY: number; diff --git a/src/ui/battle-info/enemy-battle-info.ts b/src/ui/battle-info/enemy-battle-info.ts index 7c16f01ac38..5799fb476ef 100644 --- a/src/ui/battle-info/enemy-battle-info.ts +++ b/src/ui/battle-info/enemy-battle-info.ts @@ -1,13 +1,13 @@ import { globalScene } from "#app/global-scene"; -import BattleFlyout from "../battle-flyout"; -import { addTextObject, TextStyle } from "#app/ui/text"; -import { addWindow, WindowVariant } from "#app/ui/ui-theme"; import { Stat } from "#enums/stat"; +import type { EnemyPokemon } from "#field/pokemon"; +import { BattleFlyout } from "#ui/battle-flyout"; +import type { BattleInfoParamList } from "#ui/battle-info"; +import { BattleInfo } from "#ui/battle-info"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; import i18next from "i18next"; -import type { EnemyPokemon } from "#app/field/pokemon"; import type { GameObjects } from "phaser"; -import BattleInfo from "./battle-info"; -import type { BattleInfoParamList } from "./battle-info"; export class EnemyBattleInfo extends BattleInfo { protected player: false = false; diff --git a/src/ui/battle-info/player-battle-info.ts b/src/ui/battle-info/player-battle-info.ts index 634f89b7922..62a2eddecb9 100644 --- a/src/ui/battle-info/player-battle-info.ts +++ b/src/ui/battle-info/player-battle-info.ts @@ -1,10 +1,10 @@ -import { getLevelRelExp, getLevelTotalExp } from "#app/data/exp"; -import type { PlayerPokemon } from "#app/field/pokemon"; import { globalScene } from "#app/global-scene"; +import { getLevelRelExp, getLevelTotalExp } from "#data/exp"; import { ExpGainsSpeed } from "#enums/exp-gains-speed"; import { Stat } from "#enums/stat"; -import BattleInfo from "./battle-info"; -import type { BattleInfoParamList } from "./battle-info"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { BattleInfoParamList } from "#ui/battle-info"; +import { BattleInfo } from "#ui/battle-info"; export class PlayerBattleInfo extends BattleInfo { protected player: true = true; diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index d1102bbe53e..bd524f0bb43 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -1,14 +1,14 @@ import { globalScene } from "#app/global-scene"; -import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import MessageUiHandler from "./message-ui-handler"; -import { addWindow } from "./ui-theme"; -import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { Button } from "#enums/buttons"; +import { getStatKey, PERMANENT_STATS } from "#enums/stat"; +import { UiMode } from "#enums/ui-mode"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; import i18next from "i18next"; -import { PERMANENT_STATS, getStatKey } from "#app/enums/stat"; +import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -export default class BattleMessageUiHandler extends MessageUiHandler { +export class BattleMessageUiHandler extends MessageUiHandler { private levelUpStatsContainer: Phaser.GameObjects.Container; private levelUpStatsIncrContent: Phaser.GameObjects.Text; private levelUpStatsValuesContent: BBCodeText; @@ -96,7 +96,6 @@ export default class BattleMessageUiHandler extends MessageUiHandler { const levelUpStatsLabelsContent = addTextObject(globalScene.game.canvas.width / 6 - 73, -94, "", TextStyle.WINDOW, { maxLines: 6, }); - levelUpStatsLabelsContent.setLineSpacing(i18next.resolvedLanguage === "ja" ? 25 : 5); let levelUpStatsLabelText = ""; for (const s of PERMANENT_STATS) { @@ -123,7 +122,6 @@ export default class BattleMessageUiHandler extends MessageUiHandler { TextStyle.WINDOW, { maxLines: 6 }, ); - levelUpStatsIncrContent.setLineSpacing(i18next.resolvedLanguage === "ja" ? 25 : 5); levelUpStatsContainer.add(levelUpStatsIncrContent); this.levelUpStatsIncrContent = levelUpStatsIncrContent; @@ -135,7 +133,6 @@ export default class BattleMessageUiHandler extends MessageUiHandler { TextStyle.WINDOW, { maxLines: 6, lineSpacing: 5 }, ); - levelUpStatsValuesContent.setLineSpacing(i18next.resolvedLanguage === "ja" ? 25 : 5); levelUpStatsValuesContent.setOrigin(1, 0); levelUpStatsValuesContent.setAlign("right"); levelUpStatsContainer.add(levelUpStatsValuesContent); diff --git a/src/ui/bgm-bar.ts b/src/ui/bgm-bar.ts index e331d82f6d9..d8b6bbe8b8a 100644 --- a/src/ui/bgm-bar.ts +++ b/src/ui/bgm-bar.ts @@ -1,13 +1,13 @@ -import { addTextObject, TextStyle } from "./text"; -import i18next from "i18next"; -import { formatText } from "#app/utils/common"; import { globalScene } from "#app/global-scene"; +import { addTextObject, TextStyle } from "#ui/text"; +import { formatText } from "#utils/common"; +import i18next from "i18next"; const hiddenX = -150; const shownX = 0; const baseY = 0; -export default class BgmBar extends Phaser.GameObjects.Container { +export class BgmBar extends Phaser.GameObjects.Container { private defaultWidth: number; private defaultHeight: number; diff --git a/src/ui/candy-bar.ts b/src/ui/candy-bar.ts index 189a418eec8..ea3500d6c4c 100644 --- a/src/ui/candy-bar.ts +++ b/src/ui/candy-bar.ts @@ -1,11 +1,11 @@ -import { starterColors } from "#app/global-vars/starter-colors"; import { globalScene } from "#app/global-scene"; -import { TextStyle, addTextObject } from "./text"; -import { argbFromRgba } from "@material/material-color-utilities"; -import { rgbHexToRgba } from "#app/utils/common"; +import { starterColors } from "#app/global-vars/starter-colors"; import type { SpeciesId } from "#enums/species-id"; +import { addTextObject, TextStyle } from "#ui/text"; +import { rgbHexToRgba } from "#utils/common"; +import { argbFromRgba } from "@material/material-color-utilities"; -export default class CandyBar extends Phaser.GameObjects.Container { +export class CandyBar extends Phaser.GameObjects.Container { private bg: Phaser.GameObjects.NineSlice; private candyIcon: Phaser.GameObjects.Sprite; private candyOverlayIcon: Phaser.GameObjects.Sprite; diff --git a/src/ui/challenges-select-ui-handler.ts b/src/ui/challenges-select-ui-handler.ts index b02bf4abaef..a827cddc9a7 100644 --- a/src/ui/challenges-select-ui-handler.ts +++ b/src/ui/challenges-select-ui-handler.ts @@ -1,20 +1,20 @@ -import { TextStyle, addTextObject } from "./text"; -import type { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { addWindow } from "./ui-theme"; -import { Button } from "#enums/buttons"; -import i18next from "i18next"; -import type { Challenge } from "#app/data/challenge"; -import { getLocalizedSpriteKey } from "#app/utils/common"; -import { Challenges } from "#app/enums/challenges"; -import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import { Color, ShadowColor } from "#app/enums/color"; import { globalScene } from "#app/global-scene"; +import type { Challenge } from "#data/challenge"; +import { Button } from "#enums/buttons"; +import { Challenges } from "#enums/challenges"; +import { Color, ShadowColor } from "#enums/color"; +import type { UiMode } from "#enums/ui-mode"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import { getLocalizedSpriteKey } from "#utils/common"; +import i18next from "i18next"; +import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; /** * Handles all the UI for choosing optional challenges. */ -export default class GameChallengesUiHandler extends UiHandler { +export class GameChallengesUiHandler extends UiHandler { private challengesContainer: Phaser.GameObjects.Container; private valuesContainer: Phaser.GameObjects.Container; @@ -82,7 +82,7 @@ export default class GameChallengesUiHandler extends UiHandler { headerBg.setName("window-header-bg"); headerBg.setOrigin(0, 0); - const headerText = addTextObject(0, 0, i18next.t("challenges:title"), TextStyle.SETTINGS_LABEL); + const headerText = addTextObject(0, 0, i18next.t("challenges:title"), TextStyle.HEADER_LABEL); headerText.setName("text-header"); headerText.setOrigin(0, 0); headerText.setPositionRelative(headerBg, 8, 4); diff --git a/src/ui/char-sprite.ts b/src/ui/char-sprite.ts index a8451f4bb9c..381421086ff 100644 --- a/src/ui/char-sprite.ts +++ b/src/ui/char-sprite.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import { MissingTextureKey } from "#app/utils/common"; +import { MissingTextureKey } from "#utils/common"; -export default class CharSprite extends Phaser.GameObjects.Container { +export class CharSprite extends Phaser.GameObjects.Container { private sprite: Phaser.GameObjects.Sprite; private transitionSprite: Phaser.GameObjects.Sprite; diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index 8df399b6d9b..2e4acfb7c42 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -1,19 +1,19 @@ -import { addTextObject, TextStyle } from "./text"; -import PartyUiHandler, { PartyUiMode } from "./party-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import i18next from "i18next"; -import { Button } from "#enums/buttons"; -import { getPokemonNameWithAffix } from "#app/messages"; -import type { CommandPhase } from "#app/phases/command-phase"; import { globalScene } from "#app/global-scene"; -import { TerastallizeAccessModifier } from "#app/modifier/modifier"; -import { PokemonType } from "#enums/pokemon-type"; -import { getTypeRgb } from "#app/data/type"; -import { SpeciesId } from "#enums/species-id"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { getTypeRgb } from "#data/type"; +import { Button } from "#enums/buttons"; import { Command } from "#enums/command"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { TerastallizeAccessModifier } from "#modifiers/modifier"; +import type { CommandPhase } from "#phases/command-phase"; +import { PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import i18next from "i18next"; -export default class CommandUiHandler extends UiHandler { +export class CommandUiHandler extends UiHandler { private commandsContainer: Phaser.GameObjects.Container; private cursorObj: Phaser.GameObjects.Image | null; @@ -53,7 +53,12 @@ export default class CommandUiHandler extends UiHandler { this.commandsContainer.add(this.teraButton); for (let c = 0; c < commands.length; c++) { - const commandText = addTextObject(c % 2 === 0 ? 0 : 55.8, c < 2 ? 0 : 16, commands[c], TextStyle.WINDOW); + const commandText = addTextObject( + c % 2 === 0 ? 0 : 55.8, + c < 2 ? 0 : 16, + commands[c], + TextStyle.WINDOW_BATTLE_COMMAND, + ); commandText.setName(commands[c]); this.commandsContainer.add(commandText); } diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 7b5ca3d7e63..b2f35931278 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -1,11 +1,11 @@ -import type { OptionSelectConfig } from "./abstact-option-select-ui-handler"; -import AbstractOptionSelectUiHandler from "./abstact-option-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; -import { Button } from "#enums/buttons"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import type { OptionSelectConfig } from "#ui/abstact-option-select-ui-handler"; +import { AbstractOptionSelectUiHandler } from "#ui/abstact-option-select-ui-handler"; +import i18next from "i18next"; -export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler { +export class ConfirmUiHandler extends AbstractOptionSelectUiHandler { public static readonly windowWidth: number = 48; private switchCheck: boolean; diff --git a/src/ui/daily-run-scoreboard.ts b/src/ui/daily-run-scoreboard.ts index c069c6fffd7..dcd45b40390 100644 --- a/src/ui/daily-run-scoreboard.ts +++ b/src/ui/daily-run-scoreboard.ts @@ -1,9 +1,10 @@ -import i18next from "i18next"; +import { pokerogueApi } from "#api/pokerogue-api"; import { globalScene } from "#app/global-scene"; -import { getEnumKeys, executeIf } from "#app/utils/common"; -import { TextStyle, addTextObject } from "./text"; -import { WindowVariant, addWindow } from "./ui-theme"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; +import { executeIf } from "#utils/common"; +import { getEnumKeys } from "#utils/enums"; +import i18next from "i18next"; export interface RankingEntry { rank: number; diff --git a/src/ui/dropdown.ts b/src/ui/dropdown.ts index 2cbd1f0dfa9..2a100ddbe59 100644 --- a/src/ui/dropdown.ts +++ b/src/ui/dropdown.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import { addTextObject, TextStyle } from "./text"; -import { addWindow, WindowVariant } from "./ui-theme"; -import { ScrollBar } from "#app/ui/scroll-bar"; +import { ScrollBar } from "#ui/scroll-bar"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; import i18next from "i18next"; export enum DropDownState { diff --git a/src/ui/egg-counter-container.ts b/src/ui/egg-counter-container.ts index 7bb32189681..ff536228fde 100644 --- a/src/ui/egg-counter-container.ts +++ b/src/ui/egg-counter-container.ts @@ -1,15 +1,15 @@ import { globalScene } from "#app/global-scene"; -import { addWindow } from "./ui-theme"; -import { addTextObject, TextStyle } from "./text"; -import type { EggCountChangedEvent } from "#app/events/egg"; -import { EggEventType } from "#app/events/egg"; -import type EggHatchSceneHandler from "./egg-hatch-scene-handler"; +import type { EggCountChangedEvent } from "#events/egg"; +import { EggEventType } from "#events/egg"; +import type { EggHatchSceneHandler } from "#ui/egg-hatch-scene-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; /** * A container that displays the count of hatching eggs. * @extends Phaser.GameObjects.Container */ -export default class EggCounterContainer extends Phaser.GameObjects.Container { +export class EggCounterContainer extends Phaser.GameObjects.Container { private readonly WINDOW_DEFAULT_WIDTH = 37; private readonly WINDOW_MEDIUM_WIDTH = 42; private readonly WINDOW_HEIGHT = 26; diff --git a/src/ui/egg-gacha-ui-handler.ts b/src/ui/egg-gacha-ui-handler.ts index 7ff3a1b65ee..19d1efa75dd 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -1,21 +1,22 @@ -import { UiMode } from "#enums/ui-mode"; -import { TextStyle, addTextObject, getEggTierTextTint, getTextStyleOptions } from "./text"; -import MessageUiHandler from "./message-ui-handler"; -import { getEnumValues, getEnumKeys, fixedInt, randSeedShuffle } from "#app/utils/common"; -import type { IEggOptions } from "../data/egg"; -import { Egg, getLegendaryGachaSpeciesForTimestamp } from "../data/egg"; -import { VoucherType, getVoucherTypeIcon } from "../system/voucher"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { addWindow } from "./ui-theme"; -import { Tutorial, handleTutorial } from "../tutorial"; -import { Button } from "#enums/buttons"; -import Overrides from "#app/overrides"; -import { GachaType } from "#app/enums/gacha-types"; -import i18next from "i18next"; -import { EggTier } from "#enums/egg-type"; import { globalScene } from "#app/global-scene"; +import Overrides from "#app/overrides"; +import { handleTutorial, Tutorial } from "#app/tutorial"; +import type { IEggOptions } from "#data/egg"; +import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#data/egg"; +import { Button } from "#enums/buttons"; +import { EggTier } from "#enums/egg-type"; +import { GachaType } from "#enums/gacha-types"; +import { UiMode } from "#enums/ui-mode"; +import { getVoucherTypeIcon, VoucherType } from "#system/voucher"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { addTextObject, getEggTierTextTint, getTextStyleOptions, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt, randSeedShuffle } from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; -export default class EggGachaUiHandler extends MessageUiHandler { +export class EggGachaUiHandler extends MessageUiHandler { private eggGachaContainer: Phaser.GameObjects.Container; private eggGachaMessageBox: Phaser.GameObjects.NineSlice; private eggGachaOptionsContainer: Phaser.GameObjects.Container; @@ -38,6 +39,9 @@ export default class EggGachaUiHandler extends MessageUiHandler { private summaryFinished: boolean; private defaultText: string; + /** The tween chain playing the egg drop animation sequence */ + private eggDropTweenChain?: Phaser.Tweens.TweenChain; + private scale = 0.1666666667; private legendaryExpiration = addTextObject(0, 0, "", TextStyle.WINDOW_ALT); @@ -55,18 +59,124 @@ export default class EggGachaUiHandler extends MessageUiHandler { this.defaultText = i18next.t("egg:selectMachine"); } + private setupGachaType(key: keyof typeof GachaType, gachaType: GachaType): void { + const gachaTypeKey = key.toLowerCase(); + const gachaContainer = globalScene.add.container(180 * gachaType, 18); + + const gacha = globalScene.add.sprite(0, 0, `gacha_${gachaTypeKey}`).setOrigin(0); + + const gachaUnderlay = globalScene.add.sprite(115, 80, `gacha_underlay_${gachaTypeKey}`).setOrigin(0); + + const gachaEggs = globalScene.add.sprite(0, 0, "gacha_eggs").setOrigin(0); + + const gachaGlass = globalScene.add.sprite(0, 0, "gacha_glass").setOrigin(0); + + const gachaInfoContainer = globalScene.add.container(160, 46); + + const currentLanguage = i18next.resolvedLanguage ?? "en"; + let gachaTextStyle = TextStyle.WINDOW_ALT; + let gachaX = 4; + let gachaY = 0; + let pokemonIconX = -20; + let pokemonIconY = 6; + + if (["de", "es-ES", "es-MX", "fr", "ko", "pt-BR", "ja", "ru"].includes(currentLanguage)) { + gachaTextStyle = TextStyle.SMALLER_WINDOW_ALT; + gachaX = 2; + gachaY = 2; + } + + let legendaryLabelX = gachaX; + let legendaryLabelY = gachaY; + if (["de", "es-ES", "es-MX"].includes(currentLanguage)) { + pokemonIconX = -25; + pokemonIconY = 10; + legendaryLabelX = -6; + legendaryLabelY = 0; + } + + const gachaUpLabel = addTextObject(gachaX, gachaY, i18next.t("egg:legendaryUPGacha"), gachaTextStyle).setOrigin(0); + gachaInfoContainer.add(gachaUpLabel); + + switch (gachaType as GachaType) { + case GachaType.LEGENDARY: + { + if (["de", "es-ES"].includes(currentLanguage)) { + gachaUpLabel.setAlign("center"); + } + let xOffset = 0; + const pokemonIcon = globalScene.add.sprite(pokemonIconX, pokemonIconY, "pokemon_icons_0"); + + // Intentionally left as "array includes" instead of an equality check to allow for future languages to reuse + if (["pt-BR"].includes(currentLanguage)) { + xOffset = 2; + pokemonIcon.setX(pokemonIconX - 2); + } + + gachaUpLabel.setX(legendaryLabelX - xOffset).setY(legendaryLabelY); + pokemonIcon.setScale(0.5).setOrigin(0, 0.5); + gachaInfoContainer.add(pokemonIcon); + } + break; + case GachaType.MOVE: + if (["de", "es-ES", "fr", "pt-BR", "ru"].includes(currentLanguage)) { + gachaUpLabel.setAlign("center").setY(0); + } + + gachaUpLabel.setText(i18next.t("egg:moveUPGacha")).setX(0).setOrigin(0.5, 0); + break; + case GachaType.SHINY: + if (["de", "fr", "ko", "ru"].includes(currentLanguage)) { + gachaUpLabel.setAlign("center").setY(0); + } + + gachaUpLabel.setText(i18next.t("egg:shinyUPGacha")).setX(0).setOrigin(0.5, 0); + break; + } + + const gachaKnob = globalScene.add.sprite(191, 89, "gacha_knob"); + + const gachaHatch = globalScene.add.sprite(115, 73, "gacha_hatch"); + gachaHatch.setOrigin(0).setAlpha(0.9); + gachaGlass.setAlpha(0.5); + gachaContainer.add([gachaEggs, gachaUnderlay, gacha, gachaGlass, gachaKnob, gachaHatch, gachaInfoContainer]); + + gachaHatch.on("animationupdate", (_anim, frame) => + gachaUnderlay.setFrame(frame.textureFrame === "4.png" ? "open_hatch" : "default"), + ); + + this.gachaContainers.push(gachaContainer); + this.gachaKnobs.push(gachaKnob); + this.gachaHatches.push(gachaHatch); + this.gachaInfoContainers.push(gachaInfoContainer); + + this.eggGachaContainer.add(gachaContainer); + + if (gachaType === GachaType.LEGENDARY) { + // Expiration timer for the legendary gacha + this.legendaryExpiration + .setText(this.getLegendaryGachaTimeLeft()) + .setFontSize("64px") + .setPositionRelative( + gacha, + gacha.width / 2 - this.legendaryExpiration.displayWidth / 2 + 0.3, + gacha.height / 2 + 12.5, + ); + gachaContainer.add(this.legendaryExpiration); + this.updateLegendaryGacha(); + } + } + setup() { this.gachaCursor = 0; this.scale = getTextStyleOptions(TextStyle.WINDOW, globalScene.uiTheme).scale; const ui = this.getUi(); - this.eggGachaContainer = globalScene.add.container(0, -globalScene.game.canvas.height / 6); - this.eggGachaContainer.setVisible(false); + this.eggGachaContainer = globalScene.add.container(0, -globalScene.game.canvas.height / 6).setVisible(false); ui.add(this.eggGachaContainer); - const bg = globalScene.add.nineslice(0, 0, "default_bg", undefined, 320, 180, 0, 0, 16, 0); - bg.setOrigin(0, 0); + const bg = globalScene.add.nineslice(0, 0, "default_bg", undefined, 320, 180, 0, 0, 16, 0).setOrigin(0); this.eggGachaContainer.add(bg); @@ -86,144 +196,10 @@ export default class EggGachaUiHandler extends MessageUiHandler { }); } - getEnumValues(GachaType).forEach((gachaType, g) => { - const gachaTypeKey = GachaType[gachaType].toString().toLowerCase(); - const gachaContainer = globalScene.add.container(180 * g, 18); + for (const [gachaTypeKey, gachaType] of Object.entries(GachaType)) { + this.setupGachaType(gachaTypeKey as keyof typeof GachaType, gachaType); + } - const gacha = globalScene.add.sprite(0, 0, `gacha_${gachaTypeKey}`); - gacha.setOrigin(0, 0); - - const gachaUnderlay = globalScene.add.sprite(115, 80, `gacha_underlay_${gachaTypeKey}`); - gachaUnderlay.setOrigin(0, 0); - - const gachaEggs = globalScene.add.sprite(0, 0, "gacha_eggs"); - gachaEggs.setOrigin(0, 0); - - const gachaGlass = globalScene.add.sprite(0, 0, "gacha_glass"); - gachaGlass.setOrigin(0, 0); - - const gachaInfoContainer = globalScene.add.container(160, 46); - - const currentLanguage = i18next.resolvedLanguage ?? "en"; - let gachaTextStyle = TextStyle.WINDOW_ALT; - let gachaX = 4; - let gachaY = 0; - let pokemonIconX = -20; - let pokemonIconY = 6; - - if (["de", "es-ES", "es-MX", "fr", "ko", "pt-BR", "ru"].includes(currentLanguage)) { - gachaTextStyle = TextStyle.SMALLER_WINDOW_ALT; - gachaX = 2; - gachaY = 2; - } - - let legendaryLabelX = gachaX; - let legendaryLabelY = gachaY; - if (["de", "es-ES", "es-MX"].includes(currentLanguage)) { - pokemonIconX = -25; - pokemonIconY = 10; - legendaryLabelX = -6; - legendaryLabelY = 0; - } - - const gachaUpLabel = addTextObject(gachaX, gachaY, i18next.t("egg:legendaryUPGacha"), gachaTextStyle); - gachaUpLabel.setOrigin(0, 0); - gachaInfoContainer.add(gachaUpLabel); - - switch (gachaType as GachaType) { - case GachaType.LEGENDARY: { - if (["de", "es-ES"].includes(currentLanguage)) { - gachaUpLabel.setAlign("center"); - gachaUpLabel.setY(0); - } - if (["pt-BR"].includes(currentLanguage)) { - gachaUpLabel.setX(legendaryLabelX - 2); - } else { - gachaUpLabel.setX(legendaryLabelX); - } - gachaUpLabel.setY(legendaryLabelY); - - const pokemonIcon = globalScene.add.sprite(pokemonIconX, pokemonIconY, "pokemon_icons_0"); - if (["pt-BR"].includes(currentLanguage)) { - pokemonIcon.setX(pokemonIconX - 2); - } - pokemonIcon.setScale(0.5); - pokemonIcon.setOrigin(0, 0.5); - - gachaInfoContainer.add(pokemonIcon); - break; - } - case GachaType.MOVE: - if (["de", "es-ES", "fr", "pt-BR", "ru"].includes(currentLanguage)) { - gachaUpLabel.setAlign("center"); - gachaUpLabel.setY(0); - } - - gachaUpLabel.setText(i18next.t("egg:moveUPGacha")); - gachaUpLabel.setX(0); - gachaUpLabel.setOrigin(0.5, 0); - break; - case GachaType.SHINY: - if (["de", "fr", "ko", "ru"].includes(currentLanguage)) { - gachaUpLabel.setAlign("center"); - gachaUpLabel.setY(0); - } - - gachaUpLabel.setText(i18next.t("egg:shinyUPGacha")); - gachaUpLabel.setX(0); - gachaUpLabel.setOrigin(0.5, 0); - break; - } - - const gachaKnob = globalScene.add.sprite(191, 89, "gacha_knob"); - - const gachaHatch = globalScene.add.sprite(115, 73, "gacha_hatch"); - gachaHatch.setOrigin(0, 0); - - gachaContainer.add(gachaEggs); - gachaContainer.add(gachaUnderlay); - gachaContainer.add(gacha); - gachaContainer.add(gachaGlass); - gachaContainer.add(gachaKnob); - gachaContainer.add(gachaHatch); - gachaContainer.add(gachaInfoContainer); - - gachaGlass.setAlpha(0.5); - gachaHatch.setAlpha(0.9); - - gachaHatch.on("animationupdate", (_anim, frame) => - gachaUnderlay.setFrame(frame.textureFrame === "4.png" ? "open_hatch" : "default"), - ); - - this.gachaContainers.push(gachaContainer); - this.gachaKnobs.push(gachaKnob); - this.gachaHatches.push(gachaHatch); - this.gachaInfoContainers.push(gachaInfoContainer); - - this.eggGachaContainer.add(gachaContainer); - - // Expiration timer for the legendary gacha - if (gachaType === GachaType.LEGENDARY) { - this.legendaryExpiration - .setText(this.getLegendaryGachaTimeLeft()) - .setFontSize("64px") - .setPositionRelative( - gacha, - gacha.width / 2 - this.legendaryExpiration.displayWidth / 2 + 0.3, - gacha.height / 2 + 12.5, - ); - gachaContainer.add(this.legendaryExpiration); - } - - this.updateGachaInfo(g); - }); - - this.eggGachaOptionsContainer = globalScene.add.container(); - - this.eggGachaOptionsContainer = globalScene.add.container(globalScene.game.canvas.width / 6, 148); - this.eggGachaContainer.add(this.eggGachaOptionsContainer); - - // Increase egg box width on certain languages let eggGachaOptionSelectWidth = 0; switch (i18next.resolvedLanguage) { case "ru": @@ -233,9 +209,11 @@ export default class EggGachaUiHandler extends MessageUiHandler { eggGachaOptionSelectWidth = 96; } - this.eggGachaOptionSelectBg = addWindow(0, 0, eggGachaOptionSelectWidth, 16 + 576 * this.scale); - this.eggGachaOptionSelectBg.setOrigin(1, 1); - this.eggGachaOptionsContainer.add(this.eggGachaOptionSelectBg); + this.eggGachaOptionSelectBg = addWindow(0, 0, eggGachaOptionSelectWidth, 16 + 576 * this.scale).setOrigin(1); + this.eggGachaOptionsContainer = globalScene.add + .container(globalScene.game.canvas.width / 6, 148) + .add(this.eggGachaOptionSelectBg); + this.eggGachaContainer.add(this.eggGachaOptionsContainer); const multiplierOne = "x1"; const multiplierTen = "x10"; @@ -275,75 +253,66 @@ export default class EggGachaUiHandler extends MessageUiHandler { desc[0] += ["zh", "ko"].includes(resolvedLanguage.substring(0, 2)) ? " " : " "; } if (option.multiplier === multiplierOne) { - desc[0] = " " + desc[0]; + desc[0] += " "; } return ` ${option.multiplier.padEnd(5)}${desc.join(" ")}`; }) .join("\n"); - const optionText = addTextObject(0, 0, `${pullOptionsText}\n${i18next.t("menu:cancel")}`, TextStyle.WINDOW); - - optionText.setLineSpacing(28); - optionText.setFontSize("80px"); + const optionText = addTextObject(0, 0, `${pullOptionsText}\n${i18next.t("menu:cancel")}`, TextStyle.WINDOW) + .setLineSpacing(28) + .setFontSize("80px") + .setPositionRelative(this.eggGachaOptionSelectBg, 16, 9); this.eggGachaOptionsContainer.add(optionText); - optionText.setPositionRelative(this.eggGachaOptionSelectBg, 16, 9); - pullOptions.forEach((option, i) => { - const icon = globalScene.add.sprite(0, 0, "items", option.icon); - icon.setScale(3 * this.scale); - icon.setPositionRelative(this.eggGachaOptionSelectBg, 20, 9 + (48 + i * 96) * this.scale); + const icon = globalScene.add + .sprite(0, 0, "items", option.icon) + .setScale(3 * this.scale) + .setPositionRelative(this.eggGachaOptionSelectBg, 20, 9 + (48 + i * 96) * this.scale); this.eggGachaOptionsContainer.add(icon); }); this.eggGachaContainer.add(this.eggGachaOptionsContainer); - new Array(getEnumKeys(VoucherType).length).fill(null).map((_, i) => { - const container = globalScene.add.container(globalScene.game.canvas.width / 6 - 56 * i, 0); + for (const voucher of getEnumValues(VoucherType)) { + const container = globalScene.add.container(globalScene.game.canvas.width / 6 - 56 * voucher, 0); - const bg = addWindow(0, 0, 56, 22); - bg.setOrigin(1, 0); + const bg = addWindow(0, 0, 56, 22).setOrigin(1, 0); container.add(bg); - const countLabel = addTextObject(-48, 3, "0", TextStyle.WINDOW); - countLabel.setOrigin(0, 0); + const countLabel = addTextObject(-48, 3, "0", TextStyle.WINDOW).setOrigin(0); container.add(countLabel); this.voucherCountLabels.push(countLabel); - const iconImage = getVoucherTypeIcon(i as VoucherType); + const iconImage = getVoucherTypeIcon(voucher); - const icon = globalScene.add.sprite(-19, 2, "items", iconImage); - icon.setOrigin(0, 0); - icon.setScale(0.5); + const icon = globalScene.add.sprite(-19, 2, "items", iconImage).setOrigin(0).setScale(0.5); container.add(icon); this.eggGachaContainer.add(container); - }); + } - this.eggGachaOverlay = globalScene.add.rectangle(0, 0, bg.displayWidth, bg.displayHeight, 0x000000); - this.eggGachaOverlay.setOrigin(0, 0); - this.eggGachaOverlay.setAlpha(0); + this.eggGachaOverlay = globalScene.add + .rectangle(0, 0, bg.displayWidth, bg.displayHeight, 0x000000) + .setOrigin(0) + .setAlpha(0); this.eggGachaContainer.add(this.eggGachaOverlay); - this.eggGachaSummaryContainer = globalScene.add.container(0, 0); - this.eggGachaSummaryContainer.setVisible(false); + this.eggGachaSummaryContainer = globalScene.add.container().setVisible(false); this.eggGachaContainer.add(this.eggGachaSummaryContainer); - const gachaMessageBoxContainer = globalScene.add.container(0, 148); - - const gachaMessageBox = addWindow(0, 0, 320, 32); - gachaMessageBox.setOrigin(0, 0); - gachaMessageBoxContainer.add(gachaMessageBox); + const gachaMessageBox = addWindow(0, 0, 320, 32).setOrigin(0); + const gachaMessageBoxContainer = globalScene.add.container(0, 148).add(gachaMessageBox); this.eggGachaMessageBox = gachaMessageBox; const gachaMessageText = addTextObject(8, 8, "", TextStyle.WINDOW, { maxLines: 2, - }); - gachaMessageText.setOrigin(0, 0); + }).setOrigin(0); gachaMessageBoxContainer.add(gachaMessageText); this.message = gachaMessageText; @@ -363,18 +332,17 @@ export default class EggGachaUiHandler extends MessageUiHandler { this.setGachaCursor(1); - for (let g = 0; g < this.gachaContainers.length; g++) { - this.updateGachaInfo(g); - } + this.updateLegendaryGacha(); this.updateVoucherCounts(); this.getUi().bringToTop(this.eggGachaContainer); - this.eggGachaContainer.setVisible(true); + this.eggGachaContainer.setActive(true).setVisible(true); handleTutorial(Tutorial.Egg_Gacha); + this.legendaryExpiration.setText(this.getLegendaryGachaTimeLeft()); this.legendaryGachaTimer(); return true; @@ -387,142 +355,188 @@ export default class EggGachaUiHandler extends MessageUiHandler { return fixedInt(delay); } - pull(pullCount = 0, count = 0, eggs?: Egg[]): void { - if (Overrides.EGG_GACHA_PULL_COUNT_OVERRIDE && !count) { + private firstDropAnims(): Phaser.Types.Tweens.TweenBuilderConfig[] { + globalScene.playSound("se/gacha_dial"); + return [ + // Tween 1 animates the gacha knob turning left + { + targets: this.gachaKnobs[this.gachaCursor], + duration: this.getDelayValue(350), + angle: 90, + ease: "Cubic.easeInOut", + }, + // Tween 2 animates the gacha knob turning back + { + targets: this.gachaKnobs[this.gachaCursor], + duration: this.getDelayValue(350), + angle: 0, + ease: "Sine.easeInOut", + }, + // Tween 3 is a dummy tween, used to force a delay, that commences the gacha running sound + { + targets: { dummy: 0 }, + dummy: 1, + duration: this.getDelayValue(350), + onStart: () => { + globalScene.playSound("se/gacha_running", { loop: true }); + }, + }, + // Tween 4 is another dummy tween that plays the gacha dispense sound + { + delay: this.getDelayValue(1250), + onStart: () => { + globalScene.playSound("se/gacha_dispense"); + }, + targets: { dummy: 0 }, + dummy: 1, + duration: this.getDelayValue(750), + onComplete: () => { + globalScene.sound.stopByKey("se/gacha_running"); + }, + }, + ]; + } + + private async doPullAnim(egg: Phaser.GameObjects.Sprite, count: number): Promise { + let resolve: (value: void | PromiseLike) => void; + const hatch = this.gachaHatches[this.gachaCursor]; + + /** The rate of animations and tweens that play for drops after the first */ + const rate = count ? 1.25 : 1.0; + if (count) { + hatch.anims.timeScale = rate; + } + const promise: Promise = new Promise(res => { + resolve = res; + }); + + const tweens: Phaser.Types.Tweens.TweenBuilderConfig[] = count ? [] : this.firstDropAnims(); + + tweens.push( + // Tween 1 is responsible for animating the egg dropping from the gacha + { + targets: egg, + duration: this.getDelayValue(350 / rate), + y: 95, + ease: "Bounce.easeOut", + }, + // Tween 2 plays the catch sound and moves the egg up a bit + { + onStart: () => { + globalScene.playSound("se/pb_catch"); + this.gachaHatches[this.gachaCursor].play("open"); + }, + targets: egg, + delay: this.getDelayValue(125 / rate), + duration: this.getDelayValue(350 / rate), + props: { + scale: { value: 0.75, ease: "Sine.easeIn" }, + y: { value: 110, ease: "Back.easeOut" }, + }, + }, + // Tween 3 "closes" the gacha hatch and moves the egg up while enlarging it + { + onStart: () => { + this.gachaHatches[this.gachaCursor].play("close"); + }, + targets: egg, + y: 200, + duration: this.getDelayValue(350 / rate), + ease: "Cubic.easeIn", + }, + ); + + this.eggDropTweenChain = globalScene.tweens.chain({ + onComplete: () => { + this.eggDropTweenChain = undefined; + hatch.anims.timeScale = 1; // Reset the hatch animation time scale + resolve(); + }, + tweens, + }); + + return promise; + } + + /** + * Pulls the specified number of eggs and returns them + * @param pullCount - The number of eggs to pull + * @returns An array of the pulled eggs + */ + private pullEggs(pullCount: number): Egg[] { + const eggs: Egg[] = []; + for (let i = 1; i <= pullCount; i++) { + const eggOptions: IEggOptions = { + pulled: true, + sourceType: this.gachaCursor, + }; + + // Before creating the last egg, check if the guaranteed egg tier was already generated + // if not, override the egg tier + if (i === pullCount) { + const guaranteedEggTier = this.getGuaranteedEggTierFromPullCount(pullCount); + if (guaranteedEggTier !== EggTier.COMMON && !eggs.some(egg => egg.tier >= guaranteedEggTier)) { + eggOptions.tier = guaranteedEggTier; + } + } + + const egg = new Egg(eggOptions); + eggs.push(egg); + } + // Shuffle the eggs in case the guaranteed one got added as last egg + return randSeedShuffle(eggs); + } + + /** + * Handle pulling eggs from the gacha machine; plays the animations, adds the eggs, and saves game data + * @param pullCount - The number of eggs to pull + */ + async pull(pullCount = 0): Promise { + if (Overrides.EGG_GACHA_PULL_COUNT_OVERRIDE) { pullCount = Overrides.EGG_GACHA_PULL_COUNT_OVERRIDE; } + // Set the eggs + const eggs = this.pullEggs(pullCount); + this.eggGachaOptionsContainer.setVisible(false); this.setTransitioning(true); - const doPull = () => { - if (this.transitionCancelled) { - return this.showSummary(eggs!); + const saveSuccess = await (globalScene.currentBattle + ? globalScene.gameData.saveAll(true, true, true) + : globalScene.gameData.saveSystem() + ).then(success => { + if (!success) { + globalScene.reset(true); + return false; } + return true; + }); - const egg = globalScene.add.sprite(127, 75, "egg", `egg_${eggs![count].getKey()}`); - egg.setScale(0.5); - - this.gachaContainers[this.gachaCursor].add(egg); - this.gachaContainers[this.gachaCursor].moveTo(egg, 2); - - const doPullAnim = () => { - globalScene.playSound("se/gacha_running", { loop: true }); - globalScene.time.delayedCall(this.getDelayValue(count ? 500 : 1250), () => { - globalScene.playSound("se/gacha_dispense"); - globalScene.time.delayedCall(this.getDelayValue(750), () => { - globalScene.sound.stopByKey("se/gacha_running"); - globalScene.tweens.add({ - targets: egg, - duration: this.getDelayValue(350), - y: 95, - ease: "Bounce.easeOut", - onComplete: () => { - globalScene.time.delayedCall(this.getDelayValue(125), () => { - globalScene.playSound("se/pb_catch"); - this.gachaHatches[this.gachaCursor].play("open"); - globalScene.tweens.add({ - targets: egg, - duration: this.getDelayValue(350), - scale: 0.75, - ease: "Sine.easeIn", - }); - globalScene.tweens.add({ - targets: egg, - y: 110, - duration: this.getDelayValue(350), - ease: "Back.easeOut", - onComplete: () => { - this.gachaHatches[this.gachaCursor].play("close"); - globalScene.tweens.add({ - targets: egg, - y: 200, - duration: this.getDelayValue(350), - ease: "Cubic.easeIn", - onComplete: () => { - if (++count < pullCount) { - this.pull(pullCount, count, eggs); - } else { - this.showSummary(eggs!); - } - }, - }); - }, - }); - }); - }, - }); - }); - }); - }; - - if (!count) { - globalScene.playSound("se/gacha_dial"); - globalScene.tweens.add({ - targets: this.gachaKnobs[this.gachaCursor], - duration: this.getDelayValue(350), - angle: 90, - ease: "Cubic.easeInOut", - onComplete: () => { - globalScene.tweens.add({ - targets: this.gachaKnobs[this.gachaCursor], - duration: this.getDelayValue(350), - angle: 0, - ease: "Sine.easeInOut", - }); - globalScene.time.delayedCall(this.getDelayValue(350), doPullAnim); - }, - }); - } else { - doPullAnim(); - } - }; - - if (!pullCount) { - pullCount = 1; - } - if (!count) { - count = 0; - } - if (!eggs) { - eggs = []; - for (let i = 1; i <= pullCount; i++) { - const eggOptions: IEggOptions = { - pulled: true, - sourceType: this.gachaCursor, - }; - - // Before creating the last egg, check if the guaranteed egg tier was already generated - // if not, override the egg tier - if (i === pullCount) { - const guaranteedEggTier = this.getGuaranteedEggTierFromPullCount(pullCount); - if (!eggs.some(egg => egg.tier >= guaranteedEggTier) && guaranteedEggTier !== EggTier.COMMON) { - eggOptions.tier = guaranteedEggTier; - } - } - - const egg = new Egg(eggOptions); - eggs.push(egg); - } - // Shuffle the eggs in case the guaranteed one got added as last egg - eggs = randSeedShuffle(eggs); - - (globalScene.currentBattle - ? globalScene.gameData.saveAll(true, true, true) - : globalScene.gameData.saveSystem() - ).then(success => { - if (!success) { - return globalScene.reset(true); - } - doPull(); - }); + if (!saveSuccess) { return; } - doPull(); + const gachaContainer = this.gachaContainers[this.gachaCursor]; + for (let i = 0; i < pullCount; ++i) { + if (this.transitionCancelled) { + break; + } + const eggSprite = globalScene.add.sprite(127, 75, "egg", `egg_${eggs[i].getKey()}`).setScale(0.5); + gachaContainer.addAt(eggSprite, 2); + // biome-ignore lint/nursery/noAwaitInLoop: The point of this loop is to play the animations, one after another + await this.doPullAnim(eggSprite, i).finally(() => gachaContainer.remove(eggSprite, true)); + } + + this.showSummary(eggs); } - getGuaranteedEggTierFromPullCount(pullCount: number): EggTier { + /** + * Get the guaranteed egg tier based on the pull count + * @param pullCount - The number of pulls made + * @returns The guaranteed egg tier for the given pull count + */ + private getGuaranteedEggTierFromPullCount(pullCount: number): EggTier { switch (pullCount) { case 10: return EggTier.RARE; @@ -611,9 +625,7 @@ export default class EggGachaUiHandler extends MessageUiHandler { duration: this.getDelayValue(250), ease: "Cubic.easeIn", onComplete: () => { - this.eggGachaSummaryContainer.setVisible(false); - this.eggGachaSummaryContainer.setAlpha(1); - this.eggGachaSummaryContainer.removeAll(true); + this.eggGachaSummaryContainer.setVisible(false).setAlpha(1).removeAll(true); this.setTransitioning(false); this.summaryFinished = false; this.eggGachaOptionsContainer.setVisible(true); @@ -621,16 +633,14 @@ export default class EggGachaUiHandler extends MessageUiHandler { }); } - updateGachaInfo(gachaType: GachaType): void { - const infoContainer = this.gachaInfoContainers[gachaType]; - switch (gachaType as GachaType) { - case GachaType.LEGENDARY: { - const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(Date.now())); - const pokemonIcon = infoContainer.getAt(1) as Phaser.GameObjects.Sprite; - pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false)); - break; - } - } + /** + * Update the legendary gacha icon based on the current timestamp. + */ + private updateLegendaryGacha(): void { + const infoContainer = this.gachaInfoContainers[GachaType.LEGENDARY]; + const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(Date.now())); + const pokemonIcon = infoContainer.getAt(1) as Phaser.GameObjects.Sprite; + pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false)); } consumeVouchers(voucherType: VoucherType, count: number): void { @@ -684,150 +694,165 @@ export default class EggGachaUiHandler extends MessageUiHandler { this.transitionCancelled = false; } - processInput(button: Button): boolean { + /** + * Convert a cursor index to a voucher type and count + * @param cursor - The cursor index corresponding to the voucher type + * @returns The voucher type, vouchers used, and pulls given, or an empty array if the cursor is not on a voucher + */ + private static cursorToVoucher(cursor: number): [VoucherType, number, number] | undefined { + switch (cursor) { + case 0: + return [VoucherType.REGULAR, 1, 1]; + case 1: + return [VoucherType.REGULAR, 10, 10]; + case 2: + return [VoucherType.PLUS, 1, 5]; + case 3: + return [VoucherType.PREMIUM, 1, 10]; + case 4: + return [VoucherType.GOLDEN, 1, 25]; + } + } + + /** + * Process an action input received during voucher selection. + * + * @remarks + * + * Handles playing the error sound and showing the error message, but does not handle playing the success sound. + * + * @param cursor - The index of the voucher menu option + * @returns True if the success sound should be played, false if the error sound should be played, or undefined if the cursor is out of range. + */ + private handleVoucherSelectAction(cursor: number): boolean | undefined { + // Cursors that are out of range should not be processed + if (cursor < 0 || cursor > 5) { + return; + } const ui = this.getUi(); + const voucher = EggGachaUiHandler.cursorToVoucher(cursor); + if (!voucher) { + ui.revertMode(); + return true; + } + const [voucherType, vouchersConsumed, pulls] = voucher; - let success = false; - let error = false; + let errorKey: string | undefined; + const freePulls = Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE; - if (this.transitioning) { - if (!this.transitionCancelled && (button === Button.ACTION || button === Button.CANCEL)) { - this.transitionCancelled = true; + if (!freePulls && globalScene.gameData.eggs.length + pulls > 99) { + errorKey = "egg:tooManyEggs"; + } else if (!freePulls && !globalScene.gameData.voucherCounts[voucherType]) { + errorKey = "egg:notEnoughVouchers"; + } + + if (errorKey) { + this.showError(i18next.t(errorKey)); + return false; + } + + if (!freePulls) { + this.consumeVouchers(voucherType, vouchersConsumed); + } + + // TODO: Remove this dangling proimse if necessary when the UI's input event handling supports async functions + void this.pull(pulls); + return true; + } + + /** + * Process an input received while the egg gacha UI is transitioning + * + * @param button - The button that was pressed + * @returns - `true` if the success sound should be played, otherwise `undefined` + */ + private processTransitionInput(button: Button): true | undefined { + if (!this.transitionCancelled && (button === Button.ACTION || button === Button.CANCEL)) { + this.transitionCancelled = true; + // When transition is cancelled, ensure the active chain playing the egg drop animation is sped up + // We cannot cancel it, as this would leave sprite positions at their current position in the animation + this.eggDropTweenChain?.setTimeScale(50); + return true; + } + } + + /** + * Process an input received in the normal mode of the egg gacha UI (not transitoning, not summary) + * @param button - The button that was pressed + * @returns `true` if the success sound should be played, `false` if the error sound should be played, or `undefined` no input event occurred. + */ + private processNormalInput(button: Button): boolean | undefined { + const ui = this.getUi(); + let success: boolean | undefined; + switch (button) { + case Button.ACTION: + return this.handleVoucherSelectAction(this.cursor); + case Button.CANCEL: + ui.revertMode(); success = true; - } else { - return false; - } + break; + case Button.UP: + if (this.cursor) { + success = this.setCursor(this.cursor - 1); + } + break; + case Button.DOWN: + if (this.cursor < 5) { + success = this.setCursor(this.cursor + 1); + } + break; + case Button.LEFT: + if (this.gachaCursor) { + success = this.setGachaCursor(this.gachaCursor - 1); + } + break; + case Button.RIGHT: + if (this.gachaCursor < Object.keys(GachaType).length - 1) { + success = this.setGachaCursor(this.gachaCursor + 1); + } + break; + } + + // Return undefined here because we do not play error sound in case of failed directional movements + return success || undefined; + } + + /** + * Handles an input event that occurs while the egg gacha summary is visible + * @param button - The button that was pressed + * @returns `true` if an input event occurred and the select sound should be played, otherwise `undefined` + */ + private processSummaryInput(button: Button): true | undefined { + if (this.summaryFinished && (button === Button.ACTION || button === Button.CANCEL)) { + this.hideSummary(); + return true; + } + } + + /** + * + * @param button - The button that was pressed + * @returns - Whether an input event occured. + */ + processInput(button: Button): boolean { + let success: boolean | undefined; + if (this.transitioning) { + success = this.processTransitionInput(button); + } else if (this.eggGachaSummaryContainer.visible) { + success = this.processSummaryInput(button); } else { - if (this.eggGachaSummaryContainer.visible) { - if (this.summaryFinished && (button === Button.ACTION || button === Button.CANCEL)) { - this.hideSummary(); - success = true; - } - } else { - switch (button) { - case Button.ACTION: - switch (this.cursor) { - case 0: - if ( - !globalScene.gameData.voucherCounts[VoucherType.REGULAR] && - !Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE - ) { - error = true; - this.showError(i18next.t("egg:notEnoughVouchers")); - } else if (globalScene.gameData.eggs.length < 99 || Overrides.UNLIMITED_EGG_COUNT_OVERRIDE) { - if (!Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) { - this.consumeVouchers(VoucherType.REGULAR, 1); - } - this.pull(); - success = true; - } else { - error = true; - this.showError(i18next.t("egg:tooManyEggs")); - } - break; - case 2: - if (!globalScene.gameData.voucherCounts[VoucherType.PLUS] && !Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) { - error = true; - this.showError(i18next.t("egg:notEnoughVouchers")); - } else if (globalScene.gameData.eggs.length < 95 || Overrides.UNLIMITED_EGG_COUNT_OVERRIDE) { - if (!Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) { - this.consumeVouchers(VoucherType.PLUS, 1); - } - this.pull(5); - success = true; - } else { - error = true; - this.showError(i18next.t("egg:tooManyEggs")); - } - break; - case 1: - case 3: - if ( - (this.cursor === 1 && - globalScene.gameData.voucherCounts[VoucherType.REGULAR] < 10 && - !Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) || - (this.cursor === 3 && - !globalScene.gameData.voucherCounts[VoucherType.PREMIUM] && - !Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) - ) { - error = true; - this.showError(i18next.t("egg:notEnoughVouchers")); - } else if (globalScene.gameData.eggs.length < 90 || Overrides.UNLIMITED_EGG_COUNT_OVERRIDE) { - if (this.cursor === 3) { - if (!Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) { - this.consumeVouchers(VoucherType.PREMIUM, 1); - } - } else { - if (!Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) { - this.consumeVouchers(VoucherType.REGULAR, 10); - } - } - this.pull(10); - success = true; - } else { - error = true; - this.showError(i18next.t("egg:tooManyEggs")); - } - break; - case 4: - if ( - !globalScene.gameData.voucherCounts[VoucherType.GOLDEN] && - !Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE - ) { - error = true; - this.showError(i18next.t("egg:notEnoughVouchers")); - } else if (globalScene.gameData.eggs.length < 75 || Overrides.UNLIMITED_EGG_COUNT_OVERRIDE) { - if (!Overrides.EGG_FREE_GACHA_PULLS_OVERRIDE) { - this.consumeVouchers(VoucherType.GOLDEN, 1); - } - this.pull(25); - success = true; - } else { - error = true; - this.showError(i18next.t("egg:tooManyEggs")); - } - break; - case 5: - ui.revertMode(); - success = true; - break; - } - break; - case Button.CANCEL: - this.getUi().revertMode(); - success = true; - break; - case Button.UP: - if (this.cursor) { - success = this.setCursor(this.cursor - 1); - } - break; - case Button.DOWN: - if (this.cursor < 5) { - success = this.setCursor(this.cursor + 1); - } - break; - case Button.LEFT: - if (this.gachaCursor) { - success = this.setGachaCursor(this.gachaCursor - 1); - } - break; - case Button.RIGHT: - if (this.gachaCursor < getEnumKeys(GachaType).length - 1) { - success = this.setGachaCursor(this.gachaCursor + 1); - } - break; - } - } + success = this.processNormalInput(button); } + if (success === undefined) { + return false; + } if (success) { - ui.playSelect(); - } else if (error) { - ui.playError(); + this.getUi().playSelect(); + } else { + this.getUi().playError(); } - - return success || error; + return true; } setCursor(cursor: number): boolean { @@ -898,5 +923,6 @@ export default class EggGachaUiHandler extends MessageUiHandler { this.playTimeTimer.destroy(); this.playTimeTimer = null; } + this.eggGachaContainer.setActive(false); } } diff --git a/src/ui/egg-hatch-scene-handler.ts b/src/ui/egg-hatch-scene-handler.ts index 85c4199ff1d..5b2c9d40cfa 100644 --- a/src/ui/egg-hatch-scene-handler.ts +++ b/src/ui/egg-hatch-scene-handler.ts @@ -1,9 +1,9 @@ -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { Button } from "#enums/buttons"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { UiHandler } from "#ui/ui-handler"; -export default class EggHatchSceneHandler extends UiHandler { +export class EggHatchSceneHandler extends UiHandler { public eggHatchContainer: Phaser.GameObjects.Container; /** diff --git a/src/ui/egg-list-ui-handler.ts b/src/ui/egg-list-ui-handler.ts index 9a1b1f51e25..94d6889ed48 100644 --- a/src/ui/egg-list-ui-handler.ts +++ b/src/ui/egg-list-ui-handler.ts @@ -1,15 +1,15 @@ -import { UiMode } from "#enums/ui-mode"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler"; -import { TextStyle, addTextObject } from "#app/ui/text"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import { addWindow } from "#app/ui/ui-theme"; -import { Button } from "#enums/buttons"; -import i18next from "i18next"; -import ScrollableGridUiHandler from "#app/ui/scrollable-grid-handler"; -import { ScrollBar } from "#app/ui/scroll-bar"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler"; +import { ScrollBar } from "#ui/scroll-bar"; +import { ScrollableGridUiHandler } from "#ui/scrollable-grid-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import i18next from "i18next"; -export default class EggListUiHandler extends MessageUiHandler { +export class EggListUiHandler extends MessageUiHandler { private readonly ROWS = 9; private readonly COLUMNS = 11; @@ -49,11 +49,11 @@ export default class EggListUiHandler extends MessageUiHandler { this.eggNameText = addTextObject(8, 68, "", TextStyle.SUMMARY).setOrigin(0); - this.eggDateText = addTextObject(8, 91, "", TextStyle.TOOLTIP_CONTENT); + this.eggDateText = addTextObject(8, 91, "", TextStyle.EGG_LIST); - this.eggHatchWavesText = addTextObject(8, 108, "", TextStyle.TOOLTIP_CONTENT).setWordWrapWidth(540); + this.eggHatchWavesText = addTextObject(8, 108, "", TextStyle.EGG_LIST).setWordWrapWidth(540); - this.eggGachaInfoText = addTextObject(8, 152, "", TextStyle.TOOLTIP_CONTENT).setWordWrapWidth(540); + this.eggGachaInfoText = addTextObject(8, 152, "", TextStyle.EGG_LIST).setWordWrapWidth(540); this.eggListIconContainer = globalScene.add.container(113, 5); diff --git a/src/ui/egg-summary-ui-handler.ts b/src/ui/egg-summary-ui-handler.ts index 90dc60e16b7..aa4e8974318 100644 --- a/src/ui/egg-summary-ui-handler.ts +++ b/src/ui/egg-summary-ui-handler.ts @@ -1,14 +1,14 @@ -import { UiMode } from "#enums/ui-mode"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; -import MessageUiHandler from "./message-ui-handler"; -import { getEggTierForSpecies } from "../data/egg"; -import { Button } from "#enums/buttons"; -import PokemonHatchInfoContainer from "./pokemon-hatch-info-container"; -import type { EggHatchData } from "#app/data/egg-hatch-data"; -import ScrollableGridUiHandler from "./scrollable-grid-handler"; -import { HatchedPokemonContainer } from "./hatched-pokemon-container"; -import { ScrollBar } from "#app/ui/scroll-bar"; import { globalScene } from "#app/global-scene"; +import { getEggTierForSpecies } from "#data/egg"; +import type { EggHatchData } from "#data/egg-hatch-data"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { HatchedPokemonContainer } from "#ui/hatched-pokemon-container"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { PokemonHatchInfoContainer } from "#ui/pokemon-hatch-info-container"; +import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler"; +import { ScrollBar } from "#ui/scroll-bar"; +import { ScrollableGridUiHandler } from "#ui/scrollable-grid-handler"; const iconContainerX = 112; const iconContainerY = 9; @@ -21,7 +21,7 @@ const iconSize = 18; * Handles navigation and display of each pokemon as a list * Also handles display of the pokemon-hatch-info-container */ -export default class EggSummaryUiHandler extends MessageUiHandler { +export class EggSummaryUiHandler extends MessageUiHandler { /** holds all elements in the scene */ private eggHatchContainer: Phaser.GameObjects.Container; /** holds the icon containers and info container */ diff --git a/src/ui/evolution-scene-handler.ts b/src/ui/evolution-scene-handler.ts index 7372fc6f2b5..5ad4fc6fdf5 100644 --- a/src/ui/evolution-scene-handler.ts +++ b/src/ui/evolution-scene-handler.ts @@ -1,10 +1,10 @@ -import MessageUiHandler from "./message-ui-handler"; -import { TextStyle, addTextObject } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import { Button } from "#enums/buttons"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; -export default class EvolutionSceneHandler extends MessageUiHandler { +export class EvolutionSceneHandler extends MessageUiHandler { public evolutionContainer: Phaser.GameObjects.Container; public messageBg: Phaser.GameObjects.Image; public messageContainer: Phaser.GameObjects.Container; diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 14cd10d0d6f..c5f55cc2f9d 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -1,24 +1,23 @@ import type { InfoToggle } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import { addTextObject, TextStyle } from "./text"; -import { getTypeDamageMultiplierColor } from "#app/data/type"; -import { PokemonType } from "#enums/pokemon-type"; -import { Command } from "#enums/command"; -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { getLocalizedSpriteKey, fixedInt, padInt } from "#app/utils/common"; -import { MoveCategory } from "#enums/MoveCategory"; -import i18next from "i18next"; -import { Button } from "#enums/buttons"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import type { CommandPhase } from "#app/phases/command-phase"; -import MoveInfoOverlay from "./move-info-overlay"; +import { getTypeDamageMultiplierColor } from "#data/type"; import { BattleType } from "#enums/battle-type"; +import { Button } from "#enums/buttons"; +import { Command } from "#enums/command"; +import { MoveCategory } from "#enums/MoveCategory"; import { MoveUseMode } from "#enums/move-use-mode"; +import { PokemonType } from "#enums/pokemon-type"; +import { UiMode } from "#enums/ui-mode"; +import type { EnemyPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonMove } from "#moves/pokemon-move"; +import type { CommandPhase } from "#phases/command-phase"; +import { MoveInfoOverlay } from "#ui/move-info-overlay"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { fixedInt, getLocalizedSpriteKey, padInt } from "#utils/common"; +import i18next from "i18next"; -export default class FightUiHandler extends UiHandler implements InfoToggle { +export class FightUiHandler extends UiHandler implements InfoToggle { public static readonly MOVES_CONTAINER_NAME = "moves"; private movesContainer: Phaser.GameObjects.Container; @@ -42,62 +41,67 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { super(UiMode.FIGHT); } + /** + * Set the visibility of the objects in the move info container. + */ + private setInfoVis(visibility: boolean): void { + this.moveInfoContainer.iterate((o: Phaser.GameObjects.Components.Visible) => o.setVisible(visibility)); + } + setup() { const ui = this.getUi(); - this.movesContainer = globalScene.add.container(18, -38.7); - this.movesContainer.setName(FightUiHandler.MOVES_CONTAINER_NAME); + this.movesContainer = globalScene.add.container(18, -38.7).setName(FightUiHandler.MOVES_CONTAINER_NAME); ui.add(this.movesContainer); - this.moveInfoContainer = globalScene.add.container(1, 0); - this.moveInfoContainer.setName("move-info"); + this.moveInfoContainer = globalScene.add.container(1, 0).setName("move-info"); ui.add(this.moveInfoContainer); - this.typeIcon = globalScene.add.sprite( - globalScene.scaledCanvas.width - 57, - -36, - getLocalizedSpriteKey("types"), - "unknown", - ); - this.typeIcon.setVisible(false); - this.moveInfoContainer.add(this.typeIcon); + this.typeIcon = globalScene.add + .sprite(globalScene.scaledCanvas.width - 57, -36, getLocalizedSpriteKey("types"), "unknown") + .setVisible(false); - this.moveCategoryIcon = globalScene.add.sprite(globalScene.scaledCanvas.width - 25, -36, "categories", "physical"); - this.moveCategoryIcon.setVisible(false); - this.moveInfoContainer.add(this.moveCategoryIcon); + this.moveCategoryIcon = globalScene.add + .sprite(globalScene.scaledCanvas.width - 25, -36, "categories", "physical") + .setVisible(false); - this.ppLabel = addTextObject(globalScene.scaledCanvas.width - 70, -26, "PP", TextStyle.MOVE_INFO_CONTENT); - this.ppLabel.setOrigin(0.0, 0.5); - this.ppLabel.setVisible(false); - this.ppLabel.setText(i18next.t("fightUiHandler:pp")); - this.moveInfoContainer.add(this.ppLabel); + this.ppLabel = addTextObject(globalScene.scaledCanvas.width - 70, -26, "PP", TextStyle.MOVE_INFO_CONTENT) + .setOrigin(0.0, 0.5) + .setVisible(false) + .setText(i18next.t("fightUiHandler:pp")); - this.ppText = addTextObject(globalScene.scaledCanvas.width - 12, -26, "--/--", TextStyle.MOVE_INFO_CONTENT); - this.ppText.setOrigin(1, 0.5); - this.ppText.setVisible(false); - this.moveInfoContainer.add(this.ppText); + this.ppText = addTextObject(globalScene.scaledCanvas.width - 12, -26, "--/--", TextStyle.MOVE_INFO_CONTENT) + .setOrigin(1, 0.5) + .setVisible(false); - this.powerLabel = addTextObject(globalScene.scaledCanvas.width - 70, -18, "POWER", TextStyle.MOVE_INFO_CONTENT); - this.powerLabel.setOrigin(0.0, 0.5); - this.powerLabel.setVisible(false); - this.powerLabel.setText(i18next.t("fightUiHandler:power")); - this.moveInfoContainer.add(this.powerLabel); + this.powerLabel = addTextObject(globalScene.scaledCanvas.width - 70, -18, "POWER", TextStyle.MOVE_INFO_CONTENT) + .setOrigin(0.0, 0.5) + .setVisible(false) + .setText(i18next.t("fightUiHandler:power")); - this.powerText = addTextObject(globalScene.scaledCanvas.width - 12, -18, "---", TextStyle.MOVE_INFO_CONTENT); - this.powerText.setOrigin(1, 0.5); - this.powerText.setVisible(false); - this.moveInfoContainer.add(this.powerText); + this.powerText = addTextObject(globalScene.scaledCanvas.width - 12, -18, "---", TextStyle.MOVE_INFO_CONTENT) + .setOrigin(1, 0.5) + .setVisible(false); - this.accuracyLabel = addTextObject(globalScene.scaledCanvas.width - 70, -10, "ACC", TextStyle.MOVE_INFO_CONTENT); - this.accuracyLabel.setOrigin(0.0, 0.5); - this.accuracyLabel.setVisible(false); - this.accuracyLabel.setText(i18next.t("fightUiHandler:accuracy")); - this.moveInfoContainer.add(this.accuracyLabel); + this.accuracyLabel = addTextObject(globalScene.scaledCanvas.width - 70, -10, "ACC", TextStyle.MOVE_INFO_CONTENT) + .setOrigin(0.0, 0.5) + .setVisible(false) + .setText(i18next.t("fightUiHandler:accuracy")); - this.accuracyText = addTextObject(globalScene.scaledCanvas.width - 12, -10, "---", TextStyle.MOVE_INFO_CONTENT); - this.accuracyText.setOrigin(1, 0.5); - this.accuracyText.setVisible(false); - this.moveInfoContainer.add(this.accuracyText); + this.accuracyText = addTextObject(globalScene.scaledCanvas.width - 12, -10, "---", TextStyle.MOVE_INFO_CONTENT) + .setOrigin(1, 0.5) + .setVisible(false); + + this.moveInfoContainer.add([ + this.typeIcon, + this.moveCategoryIcon, + this.ppLabel, + this.ppText, + this.powerLabel, + this.powerText, + this.accuracyLabel, + this.accuracyText, + ]); // prepare move overlay const overlayScale = 1; @@ -114,15 +118,14 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { }); ui.add(this.moveInfoOverlay); // register the overlay to receive toggle events - globalScene.addInfoToggle(this.moveInfoOverlay); - globalScene.addInfoToggle(this); + globalScene.addInfoToggle(this.moveInfoOverlay, this); } - show(args: any[]): boolean { + override show(args: [number?, Command?]): boolean { super.show(args); - this.fieldIndex = args.length ? (args[0] as number) : 0; - this.fromCommand = args.length > 1 ? (args[1] as Command) : Command.FIGHT; + this.fieldIndex = args[0] ?? 0; + this.fromCommand = args[1] ?? Command.FIGHT; const messageHandler = this.getUi().getMessageHandler(); messageHandler.bg.setVisible(false); @@ -132,7 +135,7 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { if (pokemon.tempSummonData.turnCount <= 1) { this.setCursor(0); } else { - this.setCursor(this.getCursor()); + this.setCursor(this.fieldIndex ? this.cursor2 : this.cursor); } this.displayMoves(); this.toggleInfo(false); // in case cancel was pressed while info toggle is active @@ -147,21 +150,10 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { */ processInput(button: Button): boolean { const ui = this.getUi(); - const cursor = this.getCursor(); let success = false; + const cursor = this.getCursor(); switch (button) { - case Button.CANCEL: - { - // Attempts to back out of the move selection pane are blocked in certain MEs - // TODO: Should we allow showing the summary menu at least? - const { battleType, mysteryEncounter } = globalScene.currentBattle; - if (battleType !== BattleType.MYSTERY_ENCOUNTER || !mysteryEncounter?.skipToFightInput) { - ui.setMode(UiMode.COMMAND, this.fieldIndex); - success = true; - } - } - break; case Button.ACTION: if ( (globalScene.phaseManager.getCurrentPhase() as CommandPhase).handleCommand( @@ -175,6 +167,15 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { ui.playError(); } break; + case Button.CANCEL: { + // Cannot back out of fight menu if skipToFightInput is enabled + const { battleType, mysteryEncounter } = globalScene.currentBattle; + if (battleType !== BattleType.MYSTERY_ENCOUNTER || !mysteryEncounter?.skipToFightInput) { + ui.setMode(UiMode.COMMAND, this.fieldIndex); + success = true; + } + break; + } case Button.UP: if (cursor >= 2) { success = this.setCursor(cursor - 2); @@ -195,8 +196,6 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { success = this.setCursor(cursor + 1); } break; - default: - // other inputs do nothing while in fight menu } if (success) { @@ -206,21 +205,26 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { return success; } + /** + * Adjust the visibility of move names and the cursor icon when the info overlay is toggled + * @param visible - The visibility of the info overlay; the move names and cursor's visibility will be set to the opposite + */ toggleInfo(visible: boolean): void { + // The info overlay will already fade in, so we should hide the move name text and cursor immediately + // rather than adjusting alpha via a tween. if (visible) { - this.movesContainer.setVisible(false); - this.cursorObj?.setVisible(false); + this.movesContainer.setVisible(false).setAlpha(0); + this.cursorObj?.setVisible(false).setAlpha(0); + return; } globalScene.tweens.add({ targets: [this.movesContainer, this.cursorObj], duration: fixedInt(125), ease: "Sine.easeInOut", - alpha: visible ? 0 : 1, + alpha: 1, }); - if (!visible) { - this.movesContainer.setVisible(true); - this.cursorObj?.setVisible(true); - } + this.movesContainer.setVisible(true); + this.cursorObj?.setVisible(true); } isActive(): boolean { @@ -231,6 +235,64 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { return !this.fieldIndex ? this.cursor : this.cursor2; } + /** @returns TextStyle according to percentage of PP remaining */ + private static ppRatioToColor(ppRatio: number): TextStyle { + if (ppRatio > 0.25 && ppRatio <= 0.5) { + return TextStyle.MOVE_PP_HALF_FULL; + } + if (ppRatio > 0 && ppRatio <= 0.25) { + return TextStyle.MOVE_PP_NEAR_EMPTY; + } + if (ppRatio === 0) { + return TextStyle.MOVE_PP_EMPTY; + } + return TextStyle.MOVE_PP_FULL; // default to full if ppRatio is invalid + } + + /** + * Populate the move info overlay with the information of the move at the given cursor index + * @param cursor - The cursor position to set the move info for + */ + private setMoveInfo(cursor: number): void { + const pokemon = (globalScene.phaseManager.getCurrentPhase() as CommandPhase).getPokemon(); + const moveset = pokemon.getMoveset(); + + const hasMove = cursor < moveset.length; + this.setInfoVis(hasMove); + + if (!hasMove) { + return; + } + + const pokemonMove = moveset[cursor]; + const moveType = pokemon.getMoveType(pokemonMove.getMove()); + const textureKey = getLocalizedSpriteKey("types"); + this.typeIcon.setTexture(textureKey, PokemonType[moveType].toLowerCase()).setScale(0.8); + + const moveCategory = pokemonMove.getMove().category; + this.moveCategoryIcon.setTexture("categories", MoveCategory[moveCategory].toLowerCase()).setScale(1.0); + const power = pokemonMove.getMove().power; + const accuracy = pokemonMove.getMove().accuracy; + const maxPP = pokemonMove.getMovePp(); + const pp = maxPP - pokemonMove.ppUsed; + + const ppLeftStr = padInt(pp, 2, " "); + const ppMaxStr = padInt(maxPP, 2, " "); + this.ppText.setText(`${ppLeftStr}/${ppMaxStr}`); + this.powerText.setText(`${power >= 0 ? power : "---"}`); + this.accuracyText.setText(`${accuracy >= 0 ? accuracy : "---"}`); + + const ppColorStyle = FightUiHandler.ppRatioToColor(pp / maxPP); + + //** Changes the text color and shadow according to the determined TextStyle */ + this.ppText.setColor(this.getTextColor(ppColorStyle, false)).setShadowColor(this.getTextColor(ppColorStyle, true)); + this.moveInfoOverlay.show(pokemonMove.getMove()); + + pokemon.getOpponents().forEach(opponent => { + (opponent as EnemyPokemon).updateEffectiveness(this.getEffectivenessText(pokemon, opponent, pokemonMove)); + }); + } + setCursor(cursor: number): boolean { const ui = this.getUi(); @@ -244,6 +306,8 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { } } + this.setMoveInfo(cursor); + if (!this.cursorObj) { const isTera = this.fromCommand === Command.TERA; this.cursorObj = globalScene.add.image(0, 0, isTera ? "cursor_tera" : "cursor"); @@ -251,61 +315,6 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { ui.add(this.cursorObj); } - const pokemon = (globalScene.phaseManager.getCurrentPhase() as CommandPhase).getPokemon(); - const moveset = pokemon.getMoveset(); - - const hasMove = cursor < moveset.length; - - if (hasMove) { - const pokemonMove = moveset[cursor]; - const moveType = pokemon.getMoveType(pokemonMove.getMove()); - const textureKey = getLocalizedSpriteKey("types"); - this.typeIcon.setTexture(textureKey, PokemonType[moveType].toLowerCase()).setScale(0.8); - - const moveCategory = pokemonMove.getMove().category; - this.moveCategoryIcon.setTexture("categories", MoveCategory[moveCategory].toLowerCase()).setScale(1.0); - const power = pokemonMove.getMove().power; - const accuracy = pokemonMove.getMove().accuracy; - const maxPP = pokemonMove.getMovePp(); - const pp = maxPP - pokemonMove.ppUsed; - - const ppLeftStr = padInt(pp, 2, " "); - const ppMaxStr = padInt(maxPP, 2, " "); - this.ppText.setText(`${ppLeftStr}/${ppMaxStr}`); - this.powerText.setText(`${power >= 0 ? power : "---"}`); - this.accuracyText.setText(`${accuracy >= 0 ? accuracy : "---"}`); - - const ppPercentLeft = pp / maxPP; - - //** Determines TextStyle according to percentage of PP remaining */ - let ppColorStyle = TextStyle.MOVE_PP_FULL; - if (ppPercentLeft > 0.25 && ppPercentLeft <= 0.5) { - ppColorStyle = TextStyle.MOVE_PP_HALF_FULL; - } else if (ppPercentLeft > 0 && ppPercentLeft <= 0.25) { - ppColorStyle = TextStyle.MOVE_PP_NEAR_EMPTY; - } else if (ppPercentLeft === 0) { - ppColorStyle = TextStyle.MOVE_PP_EMPTY; - } - - //** Changes the text color and shadow according to the determined TextStyle */ - this.ppText.setColor(this.getTextColor(ppColorStyle, false)); - this.ppText.setShadowColor(this.getTextColor(ppColorStyle, true)); - this.moveInfoOverlay.show(pokemonMove.getMove()); - - pokemon.getOpponents().forEach(opponent => { - (opponent as EnemyPokemon).updateEffectiveness(this.getEffectivenessText(pokemon, opponent, pokemonMove)); - }); - } - - this.typeIcon.setVisible(hasMove); - this.ppLabel.setVisible(hasMove); - this.ppText.setVisible(hasMove); - this.powerLabel.setVisible(hasMove); - this.powerText.setVisible(hasMove); - this.accuracyLabel.setVisible(hasMove); - this.accuracyText.setVisible(hasMove); - this.moveCategoryIcon.setVisible(hasMove); - this.cursorObj.setPosition(13 + (cursor % 2 === 1 ? 114 : 0), -31 + (cursor >= 2 ? 15 : 0)); return changed; @@ -336,14 +345,19 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { const moveset = pokemon.getMoveset(); for (let moveIndex = 0; moveIndex < 4; moveIndex++) { - const moveText = addTextObject(moveIndex % 2 === 0 ? 0 : 114, moveIndex < 2 ? 0 : 16, "-", TextStyle.WINDOW); - moveText.setName("text-empty-move"); + const moveText = addTextObject( + moveIndex % 2 === 0 ? 0 : 114, + moveIndex < 2 ? 0 : 16, + "-", + TextStyle.WINDOW, + ).setName("text-empty-move"); if (moveIndex < moveset.length) { const pokemonMove = moveset[moveIndex]!; // TODO is the bang correct? - moveText.setText(pokemonMove.getName()); - moveText.setName(pokemonMove.getName()); - moveText.setColor(this.getMoveColor(pokemon, pokemonMove) ?? moveText.style.color); + moveText + .setText(pokemonMove.getName()) + .setName(pokemonMove.getName()) + .setColor(this.getMoveColor(pokemon, pokemonMove) ?? moveText.style.color); } this.movesContainer.add(moveText); @@ -386,14 +400,7 @@ export default class FightUiHandler extends UiHandler implements InfoToggle { super.clear(); const messageHandler = this.getUi().getMessageHandler(); this.clearMoves(); - this.typeIcon.setVisible(false); - this.ppLabel.setVisible(false); - this.ppText.setVisible(false); - this.powerLabel.setVisible(false); - this.powerText.setVisible(false); - this.accuracyLabel.setVisible(false); - this.accuracyText.setVisible(false); - this.moveCategoryIcon.setVisible(false); + this.setInfoVis(false); this.moveInfoOverlay.clear(); messageHandler.bg.setVisible(true); this.eraseCursor(); diff --git a/src/ui/filter-bar.ts b/src/ui/filter-bar.ts index 622488c04cd..3961ae3415c 100644 --- a/src/ui/filter-bar.ts +++ b/src/ui/filter-bar.ts @@ -1,11 +1,11 @@ -import type { DropDown } from "./dropdown"; -import { DropDownType } from "./dropdown"; -import type { StarterContainer } from "./starter-container"; -import { addTextObject, getTextColor, TextStyle } from "./text"; -import type { UiTheme } from "#enums/ui-theme"; -import { addWindow, WindowVariant } from "./ui-theme"; import { globalScene } from "#app/global-scene"; import type { DropDownColumn } from "#enums/drop-down-column"; +import type { UiTheme } from "#enums/ui-theme"; +import type { DropDown } from "#ui/dropdown"; +import { DropDownType } from "#ui/dropdown"; +import type { StarterContainer } from "#ui/starter-container"; +import { addTextObject, getTextColor, TextStyle } from "#ui/text"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; export class FilterBar extends Phaser.GameObjects.Container { private window: Phaser.GameObjects.NineSlice; @@ -60,7 +60,7 @@ export class FilterBar extends Phaser.GameObjects.Container { this.columns.push(column); - const filterTypesLabel = addTextObject(0, 3, title, TextStyle.TOOLTIP_CONTENT); + const filterTypesLabel = addTextObject(0, 3, title, TextStyle.FILTER_BAR_MAIN); this.labels.push(filterTypesLabel); this.add(filterTypesLabel); this.dropDowns.push(dropDown); diff --git a/src/ui/filter-text.ts b/src/ui/filter-text.ts index 7e27a806478..4a9012e44fc 100644 --- a/src/ui/filter-text.ts +++ b/src/ui/filter-text.ts @@ -1,12 +1,12 @@ -import type { StarterContainer } from "./starter-container"; -import { addTextObject, getTextColor, TextStyle } from "./text"; -import type { UiTheme } from "#enums/ui-theme"; -import { addWindow, WindowVariant } from "./ui-theme"; -import i18next from "i18next"; -import type AwaitableUiHandler from "./awaitable-ui-handler"; -import type UI from "./ui"; -import { UiMode } from "#enums/ui-mode"; import { globalScene } from "#app/global-scene"; +import { UiMode } from "#enums/ui-mode"; +import type { UiTheme } from "#enums/ui-theme"; +import type { AwaitableUiHandler } from "#ui/awaitable-ui-handler"; +import type { StarterContainer } from "#ui/starter-container"; +import { addTextObject, getTextColor, TextStyle } from "#ui/text"; +import type { UI } from "#ui/ui"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; +import i18next from "i18next"; export enum FilterTextRow { NAME, diff --git a/src/ui/form-modal-ui-handler.ts b/src/ui/form-modal-ui-handler.ts index 8c30b4e0bc4..35965b09b80 100644 --- a/src/ui/form-modal-ui-handler.ts +++ b/src/ui/form-modal-ui-handler.ts @@ -1,12 +1,12 @@ -import type { ModalConfig } from "./modal-ui-handler"; -import { ModalUiHandler } from "./modal-ui-handler"; -import type { UiMode } from "#enums/ui-mode"; -import { TextStyle, addTextInputObject, addTextObject } from "./text"; -import { WindowVariant, addWindow } from "./ui-theme"; -import type InputText from "phaser3-rex-plugins/plugins/inputtext"; -import { fixedInt } from "#app/utils/common"; -import { Button } from "#enums/buttons"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import type { UiMode } from "#enums/ui-mode"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { ModalUiHandler } from "#ui/modal-ui-handler"; +import { addTextInputObject, addTextObject, TextStyle } from "#ui/text"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; +import { fixedInt } from "#utils/common"; +import type InputText from "phaser3-rex-plugins/plugins/inputtext"; export interface FormModalConfig extends ModalConfig { errorMessage?: string; diff --git a/src/ui/game-stats-ui-handler.ts b/src/ui/game-stats-ui-handler.ts index 4213a244fdb..f9087ba7dfa 100644 --- a/src/ui/game-stats-ui-handler.ts +++ b/src/ui/game-stats-ui-handler.ts @@ -1,16 +1,16 @@ -import Phaser from "phaser"; -import { TextStyle, addTextObject } from "#app/ui/text"; -import type { UiMode } from "#enums/ui-mode"; -import UiHandler from "#app/ui/ui-handler"; -import { addWindow } from "#app/ui/ui-theme"; -import { getPlayTimeString, formatFancyLargeNumber, toReadableString } from "#app/utils/common"; -import type { GameData } from "#app/system/game-data"; -import { DexAttr } from "#enums/dex-attr"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import { Button } from "#enums/buttons"; -import i18next from "i18next"; -import { UiTheme } from "#enums/ui-theme"; import { globalScene } from "#app/global-scene"; +import { speciesStarterCosts } from "#balance/starters"; +import { Button } from "#enums/buttons"; +import { DexAttr } from "#enums/dex-attr"; +import type { UiMode } from "#enums/ui-mode"; +import { UiTheme } from "#enums/ui-theme"; +import type { GameData } from "#system/game-data"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import { formatFancyLargeNumber, getPlayTimeString, toReadableString } from "#utils/common"; +import i18next from "i18next"; +import Phaser from "phaser"; interface DisplayStat { label_key?: string; @@ -213,7 +213,7 @@ const displayStats: DisplayStats = { }, }; -export default class GameStatsUiHandler extends UiHandler { +export class GameStatsUiHandler extends UiHandler { private gameStatsContainer: Phaser.GameObjects.Container; private statsContainer: Phaser.GameObjects.Container; @@ -243,7 +243,7 @@ export default class GameStatsUiHandler extends UiHandler { const headerBg = addWindow(0, 0, globalScene.game.canvas.width / 6 - 2, 24); headerBg.setOrigin(0, 0); - const headerText = addTextObject(0, 0, i18next.t("gameStatsUiHandler:stats"), TextStyle.SETTINGS_LABEL); + const headerText = addTextObject(0, 0, i18next.t("gameStatsUiHandler:stats"), TextStyle.HEADER_LABEL); headerText.setOrigin(0, 0); headerText.setPositionRelative(headerBg, 8, 4); @@ -267,10 +267,10 @@ export default class GameStatsUiHandler extends UiHandler { this.statsContainer = globalScene.add.container(0, 0); - new Array(18).fill(null).map((_, s) => { + for (let i = 0; i < 18; i++) { const statLabel = addTextObject( - 8 + (s % 2 === 1 ? statsBgWidth : 0), - 28 + Math.floor(s / 2) * 16, + 8 + (i % 2 === 1 ? statsBgWidth : 0), + 28 + Math.floor(i / 2) * 16, "", TextStyle.STATS_LABEL, ); @@ -278,11 +278,11 @@ export default class GameStatsUiHandler extends UiHandler { this.statsContainer.add(statLabel); this.statLabels.push(statLabel); - const statValue = addTextObject(statsBgWidth * ((s % 2) + 1) - 8, statLabel.y, "", TextStyle.STATS_VALUE); + const statValue = addTextObject(statsBgWidth * ((i % 2) + 1) - 8, statLabel.y, "", TextStyle.STATS_VALUE); statValue.setOrigin(1, 0); this.statsContainer.add(statValue); this.statValues.push(statValue); - }); + } this.gameStatsContainer.add(headerBg); this.gameStatsContainer.add(headerText); diff --git a/src/ui/hatched-pokemon-container.ts b/src/ui/hatched-pokemon-container.ts index 8b9a5309a9c..a5919348a94 100644 --- a/src/ui/hatched-pokemon-container.ts +++ b/src/ui/hatched-pokemon-container.ts @@ -1,11 +1,11 @@ -import type { EggHatchData } from "#app/data/egg-hatch-data"; -import { Gender } from "#app/data/gender"; -import { getVariantTint } from "#app/sprites/variant"; -import { DexAttr } from "#enums/dex-attr"; import { globalScene } from "#app/global-scene"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import type PokemonIconAnimHandler from "./pokemon-icon-anim-handler"; -import { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; +import type { EggHatchData } from "#data/egg-hatch-data"; +import { Gender } from "#data/gender"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { DexAttr } from "#enums/dex-attr"; +import { getVariantTint } from "#sprites/variant"; +import type { PokemonIconAnimHandler } from "#ui/pokemon-icon-anim-handler"; +import { PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler"; /** * A container for a Pokemon's sprite and icons to get displayed in the egg summary screen diff --git a/src/ui/loading-modal-ui-handler.ts b/src/ui/loading-modal-ui-handler.ts index 13dffe5614c..585d70d51db 100644 --- a/src/ui/loading-modal-ui-handler.ts +++ b/src/ui/loading-modal-ui-handler.ts @@ -1,9 +1,9 @@ -import i18next from "i18next"; -import { ModalUiHandler } from "./modal-ui-handler"; -import { addTextObject, TextStyle } from "./text"; import type { UiMode } from "#enums/ui-mode"; +import { ModalUiHandler } from "#ui/modal-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import i18next from "i18next"; -export default class LoadingModalUiHandler extends ModalUiHandler { +export class LoadingModalUiHandler extends ModalUiHandler { constructor(mode: UiMode | null = null) { super(mode); } diff --git a/src/ui/login-form-ui-handler.ts b/src/ui/login-form-ui-handler.ts index 5c48cf55753..417a9031bf7 100644 --- a/src/ui/login-form-ui-handler.ts +++ b/src/ui/login-form-ui-handler.ts @@ -1,14 +1,14 @@ -import type { InputFieldConfig } from "./form-modal-ui-handler"; -import { FormModalUiHandler } from "./form-modal-ui-handler"; -import type { ModalConfig } from "./modal-ui-handler"; -import { fixedInt } from "#app/utils/common"; -import { UiMode } from "#enums/ui-mode"; -import i18next from "i18next"; -import { addTextObject, TextStyle } from "./text"; -import { addWindow } from "./ui-theme"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; +import { pokerogueApi } from "#api/pokerogue-api"; import { globalScene } from "#app/global-scene"; +import { UiMode } from "#enums/ui-mode"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import type { InputFieldConfig } from "#ui/form-modal-ui-handler"; +import { FormModalUiHandler } from "#ui/form-modal-ui-handler"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt } from "#utils/common"; +import i18next from "i18next"; import JSZip from "jszip"; interface BuildInteractableImageOpts { @@ -18,7 +18,7 @@ interface BuildInteractableImageOpts { origin?: { x: number; y: number }; } -export default class LoginFormUiHandler extends FormModalUiHandler { +export class LoginFormUiHandler extends FormModalUiHandler { private readonly ERR_USERNAME: string = "invalid username"; private readonly ERR_PASSWORD: string = "invalid password"; private readonly ERR_ACCOUNT_EXIST: string = "account doesn't exist"; diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 5ab1d4f9e96..4e45dfedcb3 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -1,22 +1,23 @@ -import { bypassLogin } from "#app/global-vars/bypass-login"; +import { pokerogueApi } from "#api/pokerogue-api"; +import { loggedInUser, updateUserInfo } from "#app/account"; import { globalScene } from "#app/global-scene"; -import { TextStyle, addTextObject, getTextStyleOptions } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import { getEnumKeys, isLocal, fixedInt, sessionIdKey } from "#app/utils/common"; -import { isBeta } from "#app/utils/utility-vars"; -import { getCookie } from "#app/utils/cookies"; -import { addWindow, WindowVariant } from "./ui-theme"; -import MessageUiHandler from "./message-ui-handler"; -import type { OptionSelectConfig, OptionSelectItem } from "./abstact-option-select-ui-handler"; -import { Tutorial, handleTutorial } from "../tutorial"; -import { loggedInUser, updateUserInfo } from "../account"; -import i18next from "i18next"; +import { bypassLogin } from "#app/global-vars/bypass-login"; +import { handleTutorial, Tutorial } from "#app/tutorial"; import { Button } from "#enums/buttons"; import { GameDataType } from "#enums/game-data-type"; -import BgmBar from "#app/ui/bgm-bar"; -import type AwaitableUiHandler from "./awaitable-ui-handler"; -import { AdminMode, getAdminModeName } from "./admin-ui-handler"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; +import { UiMode } from "#enums/ui-mode"; +import type { OptionSelectConfig, OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { AdminMode, getAdminModeName } from "#ui/admin-ui-handler"; +import type { AwaitableUiHandler } from "#ui/awaitable-ui-handler"; +import { BgmBar } from "#ui/bgm-bar"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { addTextObject, getTextStyleOptions, TextStyle } from "#ui/text"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; +import { fixedInt, isLocal, sessionIdKey } from "#utils/common"; +import { getCookie } from "#utils/cookies"; +import { getEnumValues } from "#utils/enums"; +import { isBeta } from "#utils/utility-vars"; +import i18next from "i18next"; enum MenuOptions { GAME_SETTINGS, @@ -37,7 +38,7 @@ const githubUrl = "https://github.com/pagefaultgames/pokerogue"; const redditUrl = "https://www.reddit.com/r/pokerogue"; const donateUrl = "https://github.com/sponsors/pagefaultgames"; -export default class MenuUiHandler extends MessageUiHandler { +export class MenuUiHandler extends MessageUiHandler { private readonly textPadding = 8; private readonly defaultMessageBoxWidth = 220; private readonly defaultWordWrapWidth = 1224; @@ -76,11 +77,9 @@ export default class MenuUiHandler extends MessageUiHandler { { condition: bypassLogin, options: [MenuOptions.LOG_OUT] }, ]; - this.menuOptions = getEnumKeys(MenuOptions) - .map(m => Number.parseInt(MenuOptions[m]) as MenuOptions) - .filter(m => { - return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m)); - }); + this.menuOptions = getEnumValues(MenuOptions).filter(m => { + return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m)); + }); } setup(): void { @@ -131,11 +130,9 @@ export default class MenuUiHandler extends MessageUiHandler { { condition: bypassLogin, options: [MenuOptions.LOG_OUT] }, ]; - this.menuOptions = getEnumKeys(MenuOptions) - .map(m => Number.parseInt(MenuOptions[m]) as MenuOptions) - .filter(m => { - return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m)); - }); + this.menuOptions = getEnumValues(MenuOptions).filter(m => { + return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m)); + }); this.optionSelectText = addTextObject( 0, @@ -511,11 +508,9 @@ export default class MenuUiHandler extends MessageUiHandler { this.render(); super.show(args); - this.menuOptions = getEnumKeys(MenuOptions) - .map(m => Number.parseInt(MenuOptions[m]) as MenuOptions) - .filter(m => { - return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m)); - }); + this.menuOptions = getEnumValues(MenuOptions).filter(m => { + return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m)); + }); this.menuContainer.setVisible(true); this.setCursor(0); diff --git a/src/ui/message-ui-handler.ts b/src/ui/message-ui-handler.ts index efa53b63808..57f054c9bf9 100644 --- a/src/ui/message-ui-handler.ts +++ b/src/ui/message-ui-handler.ts @@ -1,9 +1,9 @@ -import AwaitableUiHandler from "./awaitable-ui-handler"; -import type { UiMode } from "#enums/ui-mode"; -import { getFrameMs } from "#app/utils/common"; import { globalScene } from "#app/global-scene"; +import type { UiMode } from "#enums/ui-mode"; +import { AwaitableUiHandler } from "#ui/awaitable-ui-handler"; +import { getFrameMs } from "#utils/common"; -export default abstract class MessageUiHandler extends AwaitableUiHandler { +export abstract class MessageUiHandler extends AwaitableUiHandler { protected textTimer: Phaser.Time.TimerEvent | null; protected textCallbackTimer: Phaser.Time.TimerEvent | null; public pendingPrompt: boolean; diff --git a/src/ui/modal-ui-handler.ts b/src/ui/modal-ui-handler.ts index 56c1c2c3fcf..844f7f43930 100644 --- a/src/ui/modal-ui-handler.ts +++ b/src/ui/modal-ui-handler.ts @@ -1,9 +1,9 @@ -import { TextStyle, addTextObject } from "./text"; -import type { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { WindowVariant, addWindow } from "./ui-theme"; -import type { Button } from "#enums/buttons"; import { globalScene } from "#app/global-scene"; +import type { Button } from "#enums/buttons"; +import type { UiMode } from "#enums/ui-mode"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; export interface ModalConfig { buttonActions: Function[]; diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 7f5bf997f88..264804eb627 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -1,28 +1,28 @@ import { globalScene } from "#app/global-scene"; -import type { ModifierTypeOption } from "../modifier/modifier-type"; -import { getPlayerShopModifierTypeOptionsForWave, TmModifierType } from "../modifier/modifier-type"; -import { getPokeballAtlasKey } from "#app/data/pokeball"; -import { addTextObject, getTextStyleOptions, getModifierTierTextTint, getTextColor, TextStyle } from "./text"; -import AwaitableUiHandler from "./awaitable-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { LockModifierTiersModifier, PokemonHeldItemModifier, HealShopCostModifier } from "../modifier/modifier"; -import { handleTutorial, Tutorial } from "../tutorial"; -import { Button } from "#enums/buttons"; -import MoveInfoOverlay from "./move-info-overlay"; -import { allMoves } from "#app/data/data-lists"; -import { formatMoney, NumberHolder } from "#app/utils/common"; import Overrides from "#app/overrides"; -import i18next from "i18next"; -import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; -import Phaser from "phaser"; +import { handleTutorial, Tutorial } from "#app/tutorial"; +import { allMoves } from "#data/data-lists"; +import { getPokeballAtlasKey } from "#data/pokeball"; +import { Button } from "#enums/buttons"; import type { PokeballType } from "#enums/pokeball"; +import { ShopCursorTarget } from "#enums/shop-cursor-target"; +import { UiMode } from "#enums/ui-mode"; +import { HealShopCostModifier, LockModifierTiersModifier, PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { ModifierTypeOption } from "#modifiers/modifier-type"; +import { getPlayerShopModifierTypeOptionsForWave, TmModifierType } from "#modifiers/modifier-type"; +import { AwaitableUiHandler } from "#ui/awaitable-ui-handler"; +import { MoveInfoOverlay } from "#ui/move-info-overlay"; +import { addTextObject, getModifierTierTextTint, getTextColor, getTextStyleOptions, TextStyle } from "#ui/text"; +import { formatMoney, NumberHolder } from "#utils/common"; +import i18next from "i18next"; +import Phaser from "phaser"; export const SHOP_OPTIONS_ROW_LIMIT = 7; const SINGLE_SHOP_ROW_YOFFSET = 12; const DOUBLE_SHOP_ROW_YOFFSET = 24; const OPTION_BUTTON_YPOSITION = -62; -export default class ModifierSelectUiHandler extends AwaitableUiHandler { +export class ModifierSelectUiHandler extends AwaitableUiHandler { private modifierContainer: Phaser.GameObjects.Container; private rerollButtonContainer: Phaser.GameObjects.Container; private lockRarityButtonContainer: Phaser.GameObjects.Container; @@ -269,13 +269,22 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { globalScene.updateBiomeWaveText(); globalScene.updateMoneyText(); + // DO NOT REMOVE: Fixes bug which allows action input to be processed before the UI is shown, + // causing errors if reroll is selected + this.awaitingActionInput = false; + + // TODO: Replace with `Promise.withResolvers` when possible. + let tweenResolve: () => void; + const tweenPromise = new Promise(resolve => (tweenResolve = resolve)); let i = 0; + // TODO: Rework this bespoke logic for animating the modifier options. globalScene.tweens.addCounter({ ease: "Sine.easeIn", duration: 1250, onUpdate: t => { - const value = t.getValue(); + // The bang here is safe, as `getValue()` only returns null if the tween has been destroyed (which obviously isn't the case inside onUpdate) + const value = t.getValue()!; const index = Math.floor(value * typeOptions.length); if (index > i && index <= typeOptions.length) { const option = this.options[i]; @@ -286,67 +295,77 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { i++; } }, + onComplete: () => { + tweenResolve(); + }, }); - globalScene.time.delayedCall(1000 + maxUpgradeCount * 2000, () => { - for (const shopOption of this.shopOptionsRows.flat()) { - shopOption.show(0, 0); - } + let shopResolve: () => void; + const shopPromise = new Promise(resolve => (shopResolve = resolve)); + tweenPromise.then(() => { + globalScene.time.delayedCall(1000, () => { + for (const shopOption of this.shopOptionsRows.flat()) { + shopOption.show(0, 0); + } + shopResolve(); + }); }); - globalScene.time.delayedCall(4000 + maxUpgradeCount * 2000, () => { - if (partyHasHeldItem) { - this.transferButtonContainer.setAlpha(0); - this.transferButtonContainer.setVisible(true); + shopPromise.then(() => { + globalScene.time.delayedCall(500, () => { + if (partyHasHeldItem) { + this.transferButtonContainer.setAlpha(0); + this.transferButtonContainer.setVisible(true); + globalScene.tweens.add({ + targets: this.transferButtonContainer, + alpha: 1, + duration: 250, + }); + } + + this.rerollButtonContainer.setAlpha(0); + this.checkButtonContainer.setAlpha(0); + this.lockRarityButtonContainer.setAlpha(0); + this.continueButtonContainer.setAlpha(0); + this.rerollButtonContainer.setVisible(true); + this.checkButtonContainer.setVisible(true); + this.continueButtonContainer.setVisible(this.rerollCost < 0); + this.lockRarityButtonContainer.setVisible(canLockRarities); + globalScene.tweens.add({ - targets: this.transferButtonContainer, + targets: [this.checkButtonContainer, this.continueButtonContainer], alpha: 1, duration: 250, }); - } - this.rerollButtonContainer.setAlpha(0); - this.checkButtonContainer.setAlpha(0); - this.lockRarityButtonContainer.setAlpha(0); - this.continueButtonContainer.setAlpha(0); - this.rerollButtonContainer.setVisible(true); - this.checkButtonContainer.setVisible(true); - this.continueButtonContainer.setVisible(this.rerollCost < 0); - this.lockRarityButtonContainer.setVisible(canLockRarities); + globalScene.tweens.add({ + targets: [this.rerollButtonContainer, this.lockRarityButtonContainer], + alpha: this.rerollCost < 0 ? 0.5 : 1, + duration: 250, + }); - globalScene.tweens.add({ - targets: [this.checkButtonContainer, this.continueButtonContainer], - alpha: 1, - duration: 250, - }); + const updateCursorTarget = () => { + if (globalScene.shopCursorTarget === ShopCursorTarget.CHECK_TEAM) { + this.setRowCursor(0); + this.setCursor(2); + } else if (globalScene.shopCursorTarget === ShopCursorTarget.SHOP && globalScene.gameMode.hasNoShop) { + this.setRowCursor(ShopCursorTarget.REWARDS); + this.setCursor(0); + } else { + this.setRowCursor(globalScene.shopCursorTarget); + this.setCursor(0); + } + }; - globalScene.tweens.add({ - targets: [this.rerollButtonContainer, this.lockRarityButtonContainer], - alpha: this.rerollCost < 0 ? 0.5 : 1, - duration: 250, - }); + updateCursorTarget(); - const updateCursorTarget = () => { - if (globalScene.shopCursorTarget === ShopCursorTarget.CHECK_TEAM) { - this.setRowCursor(0); - this.setCursor(2); - } else if (globalScene.shopCursorTarget === ShopCursorTarget.SHOP && globalScene.gameMode.hasNoShop) { - this.setRowCursor(ShopCursorTarget.REWARDS); - this.setCursor(0); - } else { - this.setRowCursor(globalScene.shopCursorTarget); - this.setCursor(0); - } - }; - - updateCursorTarget(); - - handleTutorial(Tutorial.Select_Item).then(res => { - if (res) { - updateCursorTarget(); - } - this.awaitingActionInput = true; - this.onActionInput = args[2]; + handleTutorial(Tutorial.Select_Item).then(res => { + if (res) { + updateCursorTarget(); + } + this.awaitingActionInput = true; + this.onActionInput = args[2]; + }); }); }); @@ -687,7 +706,11 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { scale: 0.01, duration: 250, ease: "Cubic.easeIn", - onComplete: () => options.forEach(o => o.destroy()), + onComplete: () => { + options.forEach(o => { + o.destroy(); + }); + }, }); [ @@ -819,7 +842,7 @@ class ModifierOption extends Phaser.GameObjects.Container { if (!globalScene) { return; } - const value = t.getValue(); + const value = t.getValue()!; if (!bounce && value > lastValue) { globalScene.playSound("se/pb_bounce_1", { volume: 1 / ++bounceCount, @@ -832,41 +855,38 @@ class ModifierOption extends Phaser.GameObjects.Container { }, }); + // TODO: Figure out proper delay between chains and then convert this into a single tween chain + // rather than starting multiple tween chains. for (let u = 0; u < this.modifierTypeOption.upgradeCount; u++) { - const upgradeIndex = u; - globalScene.time.delayedCall( - remainingDuration - 2000 * (this.modifierTypeOption.upgradeCount - (upgradeIndex + 1 + upgradeCountOffset)), - () => { - globalScene.playSound("se/upgrade", { - rate: 1 + 0.25 * upgradeIndex, - }); - this.pbTint.setPosition(this.pb.x, this.pb.y); - this.pbTint.setTintFill(0xffffff); - this.pbTint.setAlpha(0); - this.pbTint.setVisible(true); - globalScene.tweens.add({ + globalScene.tweens.chain({ + tweens: [ + { + delay: remainingDuration - 2000 * (this.modifierTypeOption.upgradeCount - (u + 1 + upgradeCountOffset)), + onStart: () => { + globalScene.playSound("se/upgrade", { + rate: 1 + 0.25 * u, + }); + this.pbTint.setPosition(this.pb.x, this.pb.y).setTintFill(0xffffff).setVisible(true).setAlpha(0); + }, targets: this.pbTint, alpha: 1, duration: 1000, ease: "Sine.easeIn", onComplete: () => { - this.pb.setTexture( - "pb", - this.getPbAtlasKey(-this.modifierTypeOption.upgradeCount + (upgradeIndex + 1)), - ); - globalScene.tweens.add({ - targets: this.pbTint, - alpha: 0, - duration: 750, - ease: "Sine.easeOut", - onComplete: () => { - this.pbTint.setVisible(false); - }, - }); + this.pb.setTexture("pb", this.getPbAtlasKey(-this.modifierTypeOption.upgradeCount + (u + 1))); }, - }); - }, - ); + }, + { + targets: this.pbTint, + alpha: 0, + duration: 750, + ease: "Sine.easeOut", + onComplete: () => { + this.pbTint.setVisible(false); + }, + }, + ], + }); } } diff --git a/src/ui/move-info-overlay.ts b/src/ui/move-info-overlay.ts index 2b230d609fd..1747021b7ec 100644 --- a/src/ui/move-info-overlay.ts +++ b/src/ui/move-info-overlay.ts @@ -1,11 +1,11 @@ import type { InfoToggle } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import { TextStyle, addTextObject } from "./text"; -import { addWindow } from "./ui-theme"; -import { getLocalizedSpriteKey, fixedInt } from "#app/utils/common"; -import type Move from "../data/moves/move"; import { MoveCategory } from "#enums/MoveCategory"; import { PokemonType } from "#enums/pokemon-type"; +import type { Move } from "#moves/move"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt, getLocalizedSpriteKey } from "#utils/common"; import i18next from "i18next"; export interface MoveInfoOverlaySettings { @@ -30,7 +30,7 @@ const DESC_HEIGHT = 48; const BORDER = 8; const GLOBAL_SCALE = 6; -export default class MoveInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle { +export class MoveInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle { public active = false; private move: Move; @@ -80,7 +80,6 @@ export default class MoveInfoOverlay extends Phaser.GameObjects.Container implem }, }, ); - this.desc.setLineSpacing(i18next.resolvedLanguage === "ja" ? 25 : 5); // limit the text rendering, required for scrolling later on const maskPointOrigin = { diff --git a/src/ui/mystery-encounter-ui-handler.ts b/src/ui/mystery-encounter-ui-handler.ts index 7d4ec845209..37f0efb50e4 100644 --- a/src/ui/mystery-encounter-ui-handler.ts +++ b/src/ui/mystery-encounter-ui-handler.ts @@ -1,22 +1,22 @@ -import { addBBCodeTextObject, getBBCodeFrag, TextStyle } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; +import { globalScene } from "#app/global-scene"; +import { getPokeballAtlasKey } from "#data/pokeball"; import { Button } from "#enums/buttons"; -import { addWindow, WindowVariant } from "./ui-theme"; -import type { MysteryEncounterPhase } from "../phases/mystery-encounter-phases"; -import { PartyUiMode } from "./party-ui-handler"; -import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option"; -import { fixedInt, isNullOrUndefined } from "#app/utils/common"; -import { getPokeballAtlasKey } from "../data/pokeball"; -import type { OptionSelectSettings } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { getEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import i18next from "i18next"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { UiMode } from "#enums/ui-mode"; +import { getEncounterText } from "#mystery-encounters/encounter-dialogue-utils"; +import type { OptionSelectSettings } from "#mystery-encounters/encounter-phase-utils"; +import type { MysteryEncounterOption } from "#mystery-encounters/mystery-encounter-option"; +import type { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { PartyUiMode } from "#ui/party-ui-handler"; +import { addBBCodeTextObject, getBBCodeFrag, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow, WindowVariant } from "#ui/ui-theme"; +import { fixedInt, isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import { globalScene } from "#app/global-scene"; -export default class MysteryEncounterUiHandler extends UiHandler { +export class MysteryEncounterUiHandler extends UiHandler { private cursorContainer: Phaser.GameObjects.Container; private cursorObj?: Phaser.GameObjects.Image; @@ -517,7 +517,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { descriptionTextObject.setMask(abilityDescriptionTextMask); - const descriptionLineCount = Math.floor(descriptionTextObject.displayHeight / 10); + const descriptionLineCount = Math.floor(descriptionTextObject.displayHeight / 9.2); if (this.descriptionScrollTween) { this.descriptionScrollTween.remove(); @@ -614,6 +614,8 @@ export default class MysteryEncounterUiHandler extends UiHandler { const tooltipTextObject = addBBCodeTextObject(6, 7, text, TextStyle.TOOLTIP_CONTENT, { wordWrap: { width: 600 }, fontSize: "72px", + padding: { top: 8 }, + lineSpacing: 1.25, }); this.tooltipContainer.add(tooltipTextObject); @@ -627,7 +629,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { const textMask = tooltipTextMaskRect.createGeometryMask(); tooltipTextObject.setMask(textMask); - const tooltipLineCount = Math.floor(tooltipTextObject.displayHeight / 11.2); + const tooltipLineCount = Math.floor(tooltipTextObject.displayHeight / 10.2); if (this.tooltipScrollTween) { this.tooltipScrollTween.remove(); diff --git a/src/ui/party-exp-bar.ts b/src/ui/party-exp-bar.ts index 7b7f5277ca1..0d6ec936a92 100644 --- a/src/ui/party-exp-bar.ts +++ b/src/ui/party-exp-bar.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import type Pokemon from "../field/pokemon"; -import { TextStyle, addTextObject } from "./text"; +import type { Pokemon } from "#field/pokemon"; +import { addTextObject, TextStyle } from "#ui/text"; import i18next from "i18next"; -export default class PartyExpBar extends Phaser.GameObjects.Container { +export class PartyExpBar extends Phaser.GameObjects.Container { private bg: Phaser.GameObjects.NineSlice; private pokemonIcon: Phaser.GameObjects.Container; private expText: Phaser.GameObjects.Text; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index cf6333f4580..ce5f60813c7 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -1,33 +1,33 @@ -import type { PlayerPokemon, TurnMove } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#enums/move-result"; -import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#app/ui/text"; -import { Command } from "#enums/command"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { BooleanHolder, toReadableString, randInt, getLocalizedSpriteKey } from "#app/utils/common"; -import type { PokemonFormChangeItemModifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { allMoves } from "#app/data/data-lists"; -import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { StatusEffect } from "#enums/status-effect"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { addWindow } from "#app/ui/ui-theme"; -import { SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms/form-change-triggers"; -import { FormChangeItem } from "#enums/form-change-item"; -import { getVariantTint } from "#app/sprites/variant"; +import { globalScene } from "#app/global-scene"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { pokemonEvolutions } from "#balance/pokemon-evolutions"; +import { applyChallenges } from "#data/challenge"; +import { allMoves } from "#data/data-lists"; +import { SpeciesFormChangeItemTrigger } from "#data/form-change-triggers"; +import { Gender, getGenderColor, getGenderSymbol } from "#data/gender"; import { Button } from "#enums/buttons"; -import { applyChallenges } from "#app/data/challenge"; import { ChallengeType } from "#enums/challenge-type"; -import MoveInfoOverlay from "#app/ui/move-info-overlay"; +import { Command } from "#enums/command"; +import { FormChangeItem } from "#enums/form-change-item"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon, Pokemon } from "#field/pokemon"; +import type { PokemonFormChangeItemModifier, PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { PokemonMove } from "#moves/pokemon-move"; +import type { CommandPhase } from "#phases/command-phase"; +import { getVariantTint } from "#sprites/variant"; +import type { TurnMove } from "#types/turn-move"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { MoveInfoOverlay } from "#ui/move-info-overlay"; +import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler"; +import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { BooleanHolder, getLocalizedSpriteKey, randInt, toReadableString } from "#utils/common"; import i18next from "i18next"; import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { getPokemonNameWithAffix } from "#app/messages"; -import type { CommandPhase } from "#app/phases/command-phase"; -import { globalScene } from "#app/global-scene"; const defaultMessage = i18next.t("partyUiHandler:choosePokemon"); @@ -144,7 +144,7 @@ export type PokemonModifierTransferSelectFilter = ( ) => string | null; export type PokemonMoveSelectFilter = (pokemonMove: PokemonMove) => string | null; -export default class PartyUiHandler extends MessageUiHandler { +export class PartyUiHandler extends MessageUiHandler { private partyUiMode: PartyUiMode; private fieldIndex: number; @@ -1284,17 +1284,18 @@ export default class PartyUiHandler extends MessageUiHandler { const allowBatonModifierSwitch = this.allowBatonModifierSwitch(); const isBatonPassMove = this.isBatonPassMove(); + if (allowBatonModifierSwitch && !isBatonPassMove) { + // the BATON modifier gives an extra switch option for + // pokemon-command switches, allowing buffs to be optionally passed + this.options.push(PartyOption.PASS_BATON); + } + // isBatonPassMove and allowBatonModifierSwitch shouldn't ever be true // at the same time, because they both explicitly check for a mutually // exclusive partyUiMode. But better safe than sorry. this.options.push( isBatonPassMove && !allowBatonModifierSwitch ? PartyOption.PASS_BATON : PartyOption.SEND_OUT, ); - if (allowBatonModifierSwitch && !isBatonPassMove) { - // the BATON modifier gives an extra switch option for - // pokemon-command switches, allowing buffs to be optionally passed - this.options.push(PartyOption.PASS_BATON); - } } this.addCommonOptions(pokemon); if (this.partyUiMode === PartyUiMode.SWITCH) { @@ -1334,13 +1335,13 @@ export default class PartyUiHandler extends MessageUiHandler { this.addCommonOptions(pokemon); break; case PartyUiMode.CHECK: + this.addCommonOptions(pokemon); if (globalScene.phaseManager.getCurrentPhase()?.is("SelectModifierPhase")) { const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon); for (let i = 0; i < formChangeItemModifiers.length; i++) { this.options.push(PartyOption.FORM_CHANGE_ITEM + i); } } - this.addCommonOptions(pokemon); break; case PartyUiMode.SELECT: this.options.push(PartyOption.SELECT); @@ -1937,7 +1938,7 @@ class PartyCancelButton extends Phaser.GameObjects.Container { this.partyCancelPb = partyCancelPb; - const partyCancelText = addTextObject(-8, -7, i18next.t("partyUiHandler:cancel"), TextStyle.PARTY); + const partyCancelText = addTextObject(-10, -7, i18next.t("partyUiHandler:cancel"), TextStyle.PARTY_CANCEL_BUTTON); this.add(partyCancelText); } diff --git a/src/ui/pokeball-tray.ts b/src/ui/pokeball-tray.ts index 0bf47699cdb..9720aa42090 100644 --- a/src/ui/pokeball-tray.ts +++ b/src/ui/pokeball-tray.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import type Pokemon from "../field/pokemon"; +import type { Pokemon } from "#field/pokemon"; -export default class PokeballTray extends Phaser.GameObjects.Container { +export class PokeballTray extends Phaser.GameObjects.Container { private player: boolean; private bg: Phaser.GameObjects.NineSlice; diff --git a/src/ui/pokedex-info-overlay.ts b/src/ui/pokedex-info-overlay.ts index 2e889f6d2a9..6d3b8f1009f 100644 --- a/src/ui/pokedex-info-overlay.ts +++ b/src/ui/pokedex-info-overlay.ts @@ -1,9 +1,8 @@ -import type { InfoToggle } from "../battle-scene"; -import { TextStyle, addTextObject } from "./text"; -import { addWindow } from "./ui-theme"; -import { fixedInt } from "#app/utils/common"; -import i18next from "i18next"; +import type { InfoToggle } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt } from "#utils/common"; export interface PokedexInfoOverlaySettings { delayVisibility?: boolean; // if true, showing the overlay will only set it to active and populate the fields and the handler using this field has to manually call setVisible later. @@ -22,7 +21,7 @@ const DESC_HEIGHT = 48; const BORDER = 8; const GLOBAL_SCALE = 6; -export default class PokedexInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle { +export class PokedexInfoOverlay extends Phaser.GameObjects.Container implements InfoToggle { public active = false; private desc: Phaser.GameObjects.Text; @@ -55,7 +54,6 @@ export default class PokedexInfoOverlay extends Phaser.GameObjects.Container imp this.desc = addTextObject(BORDER, BORDER - 2, "", TextStyle.BATTLE_INFO, { wordWrap: { width: (this.width - (BORDER - 2) * 2) * GLOBAL_SCALE }, }); - this.desc.setLineSpacing(i18next.resolvedLanguage === "ja" ? 25 : 5); // limit the text rendering, required for scrolling later on this.maskPointOriginX = options?.x || 0; diff --git a/src/ui/pokedex-mon-container.ts b/src/ui/pokedex-mon-container.ts index da79320850d..73799870e6b 100644 --- a/src/ui/pokedex-mon-container.ts +++ b/src/ui/pokedex-mon-container.ts @@ -1,8 +1,8 @@ -import type { Variant } from "#app/sprites/variant"; import { globalScene } from "#app/global-scene"; -import { isNullOrUndefined } from "#app/utils/common"; -import type PokemonSpecies from "../data/pokemon-species"; -import { addTextObject, TextStyle } from "./text"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import type { Variant } from "#sprites/variant"; +import { addTextObject, TextStyle } from "#ui/text"; +import { isNullOrUndefined } from "#utils/common"; interface SpeciesDetails { shiny?: boolean; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 9ec74e70b23..ff96aa55772 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -1,54 +1,58 @@ -import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; -import { pokemonEvolutions, pokemonPrevolutions, pokemonStarters } from "#app/data/balance/pokemon-evolutions"; -import type { Variant } from "#app/sprites/variant"; -import { getVariantTint, getVariantIcon } from "#app/sprites/variant"; -import { argbFromRgba } from "@material/material-color-utilities"; -import i18next from "i18next"; +import { globalScene } from "#app/global-scene"; import { starterColors } from "#app/global-vars/starter-colors"; -import { allAbilities } from "#app/data/data-lists"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; -import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { allMoves } from "#app/data/data-lists"; -import { getNatureName } from "#app/data/nature"; -import type { SpeciesFormChange } from "#app/data/pokemon-forms"; -import { pokemonFormChanges } from "#app/data/pokemon-forms"; -import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; -import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpeciesForm, normalForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { allSpecies } from "#app/data/data-lists"; -import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters"; -import { starterPassiveAbilities } from "#app/data/balance/passives"; -import { PokemonType } from "#enums/pokemon-type"; -import type { StarterAttributes } from "#app/system/game-data"; -import type { DexEntry } from "#app/@types/dex-data"; -import { AbilityAttr } from "#enums/ability-attr"; -import { DexAttr } from "#enums/dex-attr"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import { StatsContainer } from "#app/ui/stats-container"; -import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor, getTextStyleOptions } from "#app/ui/text"; -import { UiMode } from "#enums/ui-mode"; -import { addWindow } from "#app/ui/ui-theme"; -import { Egg } from "#app/data/egg"; import Overrides from "#app/overrides"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { Passive as PassiveAttr } from "#enums/passive"; -import MoveInfoOverlay from "#app/ui/move-info-overlay"; -import PokedexInfoOverlay from "#app/ui/pokedex-info-overlay"; -import { getEggTierForSpecies } from "#app/data/egg"; -import { Device } from "#enums/devices"; -import type { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { Button } from "#enums/buttons"; -import { EggSourceType } from "#enums/egg-source-types"; +import type { BiomeTierTod } from "#balance/biomes"; +import { BiomePoolTier, catchableSpecies } from "#balance/biomes"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { starterPassiveAbilities } from "#balance/passives"; +import type { SpeciesFormEvolution } from "#balance/pokemon-evolutions"; +import { pokemonEvolutions, pokemonPrevolutions, pokemonStarters } from "#balance/pokemon-evolutions"; +import type { LevelMoves } from "#balance/pokemon-level-moves"; +import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#balance/pokemon-level-moves"; import { getPassiveCandyCount, - getValueReductionCandyCounts, getSameSpeciesEggCandyCounts, -} from "#app/data/balance/starters"; + getStarterValueFriendshipCap, + getValueReductionCandyCounts, + speciesStarterCosts, +} from "#balance/starters"; +import { speciesTmMoves } from "#balance/tms"; +import { allAbilities, allMoves, allSpecies } from "#data/data-lists"; +import { Egg, getEggTierForSpecies } from "#data/egg"; +import { GrowthRate, getGrowthRateColor } from "#data/exp"; +import { Gender, getGenderColor, getGenderSymbol } from "#data/gender"; +import { getNatureName } from "#data/nature"; +import type { SpeciesFormChange } from "#data/pokemon-forms"; +import { pokemonFormChanges } from "#data/pokemon-forms"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { getPokemonSpeciesForm, normalForm } from "#data/pokemon-species"; +import { AbilityAttr } from "#enums/ability-attr"; +import type { AbilityId } from "#enums/ability-id"; +import { BiomeId } from "#enums/biome-id"; +import { Button } from "#enums/buttons"; +import { Device } from "#enums/devices"; +import { DexAttr } from "#enums/dex-attr"; +import { EggSourceType } from "#enums/egg-source-types"; +import type { MoveId } from "#enums/move-id"; +import type { Nature } from "#enums/nature"; +import { Passive as PassiveAttr } from "#enums/passive"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TimeOfDay } from "#enums/time-of-day"; +import { UiMode } from "#enums/ui-mode"; +import type { Variant } from "#sprites/variant"; +import { getVariantIcon, getVariantTint } from "#sprites/variant"; +import type { StarterAttributes } from "#system/game-data"; +import { SettingKeyboard } from "#system/settings-keyboard"; +import type { DexEntry } from "#types/dex-data"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { BaseStatsOverlay } from "#ui/base-stats-overlay"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { MoveInfoOverlay } from "#ui/move-info-overlay"; +import { PokedexInfoOverlay } from "#ui/pokedex-info-overlay"; +import { StatsContainer } from "#ui/stats-container"; +import { addBBCodeTextObject, addTextObject, getTextColor, getTextStyleOptions, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; import { BooleanHolder, getLocalizedSpriteKey, @@ -56,17 +60,11 @@ import { padInt, rgbHexToRgba, toReadableString, -} from "#app/utils/common"; -import type { Nature } from "#enums/nature"; -import { getEnumKeys } from "#app/utils/common"; -import { speciesTmMoves } from "#app/data/balance/tms"; -import type { BiomeTierTod } from "#app/data/balance/biomes"; -import { BiomePoolTier, catchableSpecies } from "#app/data/balance/biomes"; -import { BiomeId } from "#enums/biome-id"; -import { TimeOfDay } from "#app/enums/time-of-day"; -import type { AbilityId } from "#enums/ability-id"; -import { BaseStatsOverlay } from "#app/ui/base-stats-overlay"; -import { globalScene } from "#app/global-scene"; +} from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { argbFromRgba } from "@material/material-color-utilities"; +import i18next from "i18next"; import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; interface LanguageSetting { @@ -82,13 +80,21 @@ const languageSettings: { [key: string]: LanguageSetting } = { instructionTextSize: "38px", }, de: { - starterInfoTextSize: "48px", + starterInfoTextSize: "54px", instructionTextSize: "35px", - starterInfoXPos: 33, + starterInfoXPos: 35, }, "es-ES": { - starterInfoTextSize: "56px", - instructionTextSize: "35px", + starterInfoTextSize: "50px", + instructionTextSize: "38px", + starterInfoYOffset: 0.5, + starterInfoXPos: 38, + }, + "es-MX": { + starterInfoTextSize: "50px", + instructionTextSize: "38px", + starterInfoYOffset: 0.5, + starterInfoXPos: 38, }, fr: { starterInfoTextSize: "54px", @@ -98,34 +104,53 @@ const languageSettings: { [key: string]: LanguageSetting } = { starterInfoTextSize: "56px", instructionTextSize: "38px", }, - pt_BR: { - starterInfoTextSize: "47px", - instructionTextSize: "38px", + "pt-BR": { + starterInfoTextSize: "48px", + instructionTextSize: "42px", + starterInfoYOffset: 0.5, starterInfoXPos: 33, }, zh: { - starterInfoTextSize: "47px", - instructionTextSize: "38px", - starterInfoYOffset: 1, - starterInfoXPos: 24, - }, - pt: { - starterInfoTextSize: "48px", - instructionTextSize: "42px", - starterInfoXPos: 33, + starterInfoTextSize: "56px", + instructionTextSize: "36px", + starterInfoXPos: 26, }, ko: { - starterInfoTextSize: "52px", + starterInfoTextSize: "60px", instructionTextSize: "38px", + starterInfoYOffset: -0.5, + starterInfoXPos: 30, }, ja: { - starterInfoTextSize: "51px", - instructionTextSize: "38px", + starterInfoTextSize: "48px", + instructionTextSize: "40px", + starterInfoYOffset: 1, + starterInfoXPos: 32, }, - "ca-ES": { + ca: { + starterInfoTextSize: "48px", + instructionTextSize: "38px", + starterInfoYOffset: 0.5, + starterInfoXPos: 29, + }, + da: { starterInfoTextSize: "56px", instructionTextSize: "38px", }, + tr: { + starterInfoTextSize: "56px", + instructionTextSize: "38px", + }, + ro: { + starterInfoTextSize: "56px", + instructionTextSize: "38px", + }, + ru: { + starterInfoTextSize: "46px", + instructionTextSize: "38px", + starterInfoYOffset: 0.5, + starterInfoXPos: 26, + }, }; const valueReductionMax = 2; @@ -152,7 +177,7 @@ enum MenuOptions { EVOLUTIONS, } -export default class PokedexPageUiHandler extends MessageUiHandler { +export class PokedexPageUiHandler extends MessageUiHandler { private starterSelectContainer: Phaser.GameObjects.Container; private shinyOverlay: Phaser.GameObjects.Image; private pokemonNumberText: Phaser.GameObjects.Text; @@ -309,7 +334,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.shinyOverlay.setVisible(false); this.starterSelectContainer.add(this.shinyOverlay); - this.pokemonNumberText = addTextObject(17, 1, "0000", TextStyle.SUMMARY); + this.pokemonNumberText = addTextObject(17, 1, "0000", TextStyle.SUMMARY_DEX_NUM); this.pokemonNumberText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonNumberText); @@ -328,7 +353,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.pokemonGrowthRateLabelText.setVisible(false); this.starterSelectContainer.add(this.pokemonGrowthRateLabelText); - this.pokemonGrowthRateText = addTextObject(34, 106, "", TextStyle.SUMMARY_PINK, { fontSize: "36px" }); + this.pokemonGrowthRateText = addTextObject(34, 106, "", TextStyle.GROWTH_RATE_TYPE, { fontSize: "36px" }); this.pokemonGrowthRateText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonGrowthRateText); @@ -371,9 +396,15 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.pokemonLuckLabelText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonLuckLabelText); - this.pokemonLuckText = addTextObject(8 + this.pokemonLuckLabelText.displayWidth + 2, 89, "0", TextStyle.WINDOW, { - fontSize: "56px", - }); + this.pokemonLuckText = addTextObject( + 8 + this.pokemonLuckLabelText.displayWidth + 2, + 89, + "0", + TextStyle.LUCK_VALUE, + { + fontSize: "56px", + }, + ); this.pokemonLuckText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonLuckText); @@ -470,7 +501,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("pokedexUiHandler:candyUpgrade"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.candyUpgradeLabel.setName("text-candyUpgrade-label"); @@ -491,7 +522,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("pokedexUiHandler:cycleShiny"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.shinyLabel.setName("text-shiny-label"); @@ -510,7 +541,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("pokedexUiHandler:cycleForm"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.formLabel.setName("text-form-label"); @@ -529,7 +560,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("pokedexUiHandler:cycleGender"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.genderLabel.setName("text-gender-label"); @@ -548,7 +579,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("pokedexUiHandler:cycleVariant"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.variantLabel.setName("text-variant-label"); @@ -557,9 +588,15 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.showBackSpriteIconElement.setName("show-backSprite-icon-element"); this.showBackSpriteIconElement.setScale(0.675); this.showBackSpriteIconElement.setOrigin(0.0, 0.0); - this.showBackSpriteLabel = addTextObject(60, 7, i18next.t("pokedexUiHandler:showBackSprite"), TextStyle.PARTY, { - fontSize: instructionTextSize, - }); + this.showBackSpriteLabel = addTextObject( + 60, + 7, + i18next.t("pokedexUiHandler:showBackSprite"), + TextStyle.INSTRUCTIONS_TEXT, + { + fontSize: instructionTextSize, + }, + ); this.showBackSpriteLabel.setName("show-backSprite-label"); this.starterSelectContainer.add(this.showBackSpriteIconElement); this.starterSelectContainer.add(this.showBackSpriteLabel); @@ -603,7 +640,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.menuContainer.setVisible(false); - this.menuOptions = getEnumKeys(MenuOptions).map(m => Number.parseInt(MenuOptions[m]) as MenuOptions); + this.menuOptions = getEnumValues(MenuOptions); this.optionSelectText = addBBCodeTextObject( 0, @@ -707,7 +744,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.starterAttributes = this.initStarterPrefs(); - this.menuOptions = getEnumKeys(MenuOptions).map(m => Number.parseInt(MenuOptions[m]) as MenuOptions); + this.menuOptions = getEnumValues(MenuOptions); this.menuContainer.setVisible(true); @@ -1899,14 +1936,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler { if (!(passiveAttr & PassiveAttr.UNLOCKED)) { const passiveCost = getPassiveCandyCount(speciesStarterCosts[this.starterId]); options.push({ - label: `x${passiveCost} ${i18next.t("pokedexUiHandler:unlockPassive")}`, + label: `×${passiveCost} ${i18next.t("pokedexUiHandler:unlockPassive")}`, handler: () => { if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= passiveCost) { starterData.passiveAttr |= PassiveAttr.UNLOCKED | PassiveAttr.ENABLED; if (!Overrides.FREE_CANDY_UPGRADE_OVERRIDE) { starterData.candyCount -= passiveCost; } - this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); + this.pokemonCandyCountText.setText(`×${starterData.candyCount}`); globalScene.gameData.saveSystem().then(success => { if (!success) { return globalScene.reset(true); @@ -1931,14 +1968,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler { if (valueReduction < valueReductionMax) { const reductionCost = getValueReductionCandyCounts(speciesStarterCosts[this.starterId])[valueReduction]; options.push({ - label: `x${reductionCost} ${i18next.t("pokedexUiHandler:reduceCost")}`, + label: `×${reductionCost} ${i18next.t("pokedexUiHandler:reduceCost")}`, handler: () => { if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= reductionCost) { starterData.valueReduction++; if (!Overrides.FREE_CANDY_UPGRADE_OVERRIDE) { starterData.candyCount -= reductionCost; } - this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); + this.pokemonCandyCountText.setText(`×${starterData.candyCount}`); globalScene.gameData.saveSystem().then(success => { if (!success) { return globalScene.reset(true); @@ -1960,7 +1997,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { // Same species egg menu option. const sameSpeciesEggCost = getSameSpeciesEggCandyCounts(speciesStarterCosts[this.starterId]); options.push({ - label: `x${sameSpeciesEggCost} ${i18next.t("pokedexUiHandler:sameSpeciesEgg")}`, + label: `×${sameSpeciesEggCost} ${i18next.t("pokedexUiHandler:sameSpeciesEgg")}`, handler: () => { if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= sameSpeciesEggCost) { if (globalScene.gameData.eggs.length >= 99 && !Overrides.UNLIMITED_EGG_COUNT_OVERRIDE) { @@ -1979,7 +2016,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { if (!Overrides.FREE_CANDY_UPGRADE_OVERRIDE) { starterData.candyCount -= sameSpeciesEggCost; } - this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); + this.pokemonCandyCountText.setText(`×${starterData.candyCount}`); const egg = new Egg({ scene: globalScene, @@ -2480,9 +2517,11 @@ export default class PokedexPageUiHandler extends MessageUiHandler { const isFormSeen = this.isSeen(); this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default? - this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false)); + this.pokemonNumberText.setColor( + this.getTextColor(shiny ? TextStyle.SUMMARY_DEX_NUM_GOLD : TextStyle.SUMMARY_DEX_NUM, false), + ); this.pokemonNumberText.setShadowColor( - this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, true), + this.getTextColor(shiny ? TextStyle.SUMMARY_DEX_NUM_GOLD : TextStyle.SUMMARY_DEX_NUM, true), ); const assetLoadCancelled = new BooleanHolder(false); @@ -2634,7 +2673,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.pokemonCandyIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[0]))); this.pokemonCandyOverlayIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[1]))); this.pokemonCandyCountText.setText( - `x${species.speciesId === SpeciesId.PIKACHU ? 0 : globalScene.gameData.starterData[this.starterId].candyCount}`, + `×${species.speciesId === SpeciesId.PIKACHU ? 0 : globalScene.gameData.starterData[this.starterId].candyCount}`, ); this.pokemonCandyContainer.setVisible(true); diff --git a/src/ui/pokedex-scan-ui-handler.ts b/src/ui/pokedex-scan-ui-handler.ts index 2bffc464793..bcf869f6f39 100644 --- a/src/ui/pokedex-scan-ui-handler.ts +++ b/src/ui/pokedex-scan-ui-handler.ts @@ -1,17 +1,15 @@ -import type { InputFieldConfig } from "./form-modal-ui-handler"; -import { FormModalUiHandler } from "./form-modal-ui-handler"; -import type { ModalConfig } from "./modal-ui-handler"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { OptionSelectItem } from "./abstact-option-select-ui-handler"; -import { isNullOrUndefined } from "#app/utils/common"; +import { allAbilities, allMoves, allSpecies } from "#data/data-lists"; import { UiMode } from "#enums/ui-mode"; -import { FilterTextRow } from "./filter-text"; -import { allAbilities } from "#app/data/data-lists"; -import { allMoves } from "#app/data/data-lists"; -import { allSpecies } from "#app/data/data-lists"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { FilterTextRow } from "#ui/filter-text"; +import type { InputFieldConfig } from "#ui/form-modal-ui-handler"; +import { FormModalUiHandler } from "#ui/form-modal-ui-handler"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { isNullOrUndefined } from "#utils/common"; import i18next from "i18next"; -export default class PokedexScanUiHandler extends FormModalUiHandler { +export class PokedexScanUiHandler extends FormModalUiHandler { keys: string[]; reducedKeys: string[]; parallelKeys: string[]; diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 9169ca77999..c2f595cb190 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -1,53 +1,52 @@ -import type { Variant } from "#app/sprites/variant"; -import { getVariantTint, getVariantIcon } from "#app/sprites/variant"; -import { argbFromRgba } from "@material/material-color-utilities"; -import i18next from "i18next"; +import { globalScene } from "#app/global-scene"; import { starterColors } from "#app/global-vars/starter-colors"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves"; -import type { PokemonForm } from "#app/data/pokemon-species"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpeciesForm, getPokerusStarters, normalForm } from "#app/data/pokemon-species"; -import { allSpecies } from "#app/data/data-lists"; -import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters"; -import { catchableSpecies } from "#app/data/balance/biomes"; -import { PokemonType } from "#enums/pokemon-type"; -import type { DexAttrProps, StarterAttributes } from "#app/system/game-data"; -import type { StarterPreferences } from "#app/utils/data"; -import type { DexEntry } from "#app/@types/dex-data"; -import { loadStarterPreferences } from "#app/utils/data"; -import { AbilityAttr } from "#enums/ability-attr"; -import { DexAttr } from "#enums/dex-attr"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler"; -import { TextStyle, addTextObject } from "#app/ui/text"; -import { UiMode } from "#enums/ui-mode"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { Passive as PassiveAttr } from "#enums/passive"; -import type { SpeciesId } from "#enums/species-id"; -import { Button } from "#enums/buttons"; -import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#app/ui/dropdown"; -import { PokedexMonContainer } from "#app/ui/pokedex-mon-container"; -import { FilterBar } from "#app/ui/filter-bar"; -import { DropDownColumn } from "#enums/drop-down-column"; -import { ScrollBar } from "#app/ui/scroll-bar"; -import { AbilityId } from "#enums/ability-id"; +import { catchableSpecies } from "#balance/biomes"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { pokemonStarters } from "#balance/pokemon-evolutions"; +import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#balance/pokemon-level-moves"; import { getPassiveCandyCount, - getValueReductionCandyCounts, getSameSpeciesEggCandyCounts, -} from "#app/data/balance/starters"; -import { BooleanHolder, fixedInt, getLocalizedSpriteKey, padInt, randIntRange, rgbHexToRgba } from "#app/utils/common"; -import type { Nature } from "#enums/nature"; -import { addWindow } from "./ui-theme"; -import type { OptionSelectConfig } from "./abstact-option-select-ui-handler"; -import { FilterText, FilterTextRow } from "./filter-text"; -import { allAbilities } from "#app/data/data-lists"; -import { allMoves } from "#app/data/data-lists"; -import { speciesTmMoves } from "#app/data/balance/tms"; -import { pokemonStarters } from "#app/data/balance/pokemon-evolutions"; + getStarterValueFriendshipCap, + getValueReductionCandyCounts, + POKERUS_STARTER_COUNT, + speciesStarterCosts, +} from "#balance/starters"; +import { speciesTmMoves } from "#balance/tms"; +import { allAbilities, allMoves, allSpecies } from "#data/data-lists"; +import type { PokemonForm, PokemonSpecies } from "#data/pokemon-species"; +import { getPokemonSpeciesForm, getPokerusStarters, normalForm } from "#data/pokemon-species"; +import { AbilityAttr } from "#enums/ability-attr"; +import { AbilityId } from "#enums/ability-id"; import { BiomeId } from "#enums/biome-id"; -import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { DexAttr } from "#enums/dex-attr"; +import { DropDownColumn } from "#enums/drop-down-column"; +import type { Nature } from "#enums/nature"; +import { Passive as PassiveAttr } from "#enums/passive"; +import { PokemonType } from "#enums/pokemon-type"; +import type { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import type { Variant } from "#sprites/variant"; +import { getVariantIcon, getVariantTint } from "#sprites/variant"; +import type { DexAttrProps, StarterAttributes } from "#system/game-data"; +import { SettingKeyboard } from "#system/settings-keyboard"; +import type { DexEntry } from "#types/dex-data"; +import type { OptionSelectConfig } from "#ui/abstact-option-select-ui-handler"; +import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#ui/dropdown"; +import { FilterBar } from "#ui/filter-bar"; +import { FilterText, FilterTextRow } from "#ui/filter-text"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { PokedexMonContainer } from "#ui/pokedex-mon-container"; +import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler"; +import { ScrollBar } from "#ui/scroll-bar"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { BooleanHolder, fixedInt, getLocalizedSpriteKey, padInt, randIntRange, rgbHexToRgba } from "#utils/common"; +import type { StarterPreferences } from "#utils/data"; +import { loadStarterPreferences } from "#utils/data"; +import { argbFromRgba } from "@material/material-color-utilities"; +import i18next from "i18next"; interface LanguageSetting { starterInfoTextSize: string; @@ -157,7 +156,7 @@ interface SpeciesDetails { natureIndex?: number; } -export default class PokedexUiHandler extends MessageUiHandler { +export class PokedexUiHandler extends MessageUiHandler { private starterSelectContainer: Phaser.GameObjects.Container; private starterSelectScrollBar: ScrollBar; private filterBarContainer: Phaser.GameObjects.Container; @@ -471,7 +470,7 @@ export default class PokedexUiHandler extends MessageUiHandler { this.pokemonNameText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonNameText); - this.pokemonFormText = addTextObject(6, 121, "", TextStyle.PARTY, { + this.pokemonFormText = addTextObject(6, 121, "", TextStyle.INSTRUCTIONS_TEXT, { fontSize: textSettings.instructionTextSize, }); this.pokemonFormText.setOrigin(0, 0); @@ -483,13 +482,14 @@ export default class PokedexUiHandler extends MessageUiHandler { starterBoxContainer.add(this.starterSelectScrollBar); - this.pokerusCursorObjs = new Array(POKERUS_STARTER_COUNT).fill(null).map(() => { + this.pokerusCursorObjs = []; + for (let i = 0; i < POKERUS_STARTER_COUNT; i++) { const cursorObj = globalScene.add.image(0, 0, "select_cursor_pokerus"); cursorObj.setVisible(false); cursorObj.setOrigin(0, 0); starterBoxContainer.add(cursorObj); - return cursorObj; - }); + this.pokerusCursorObjs.push(cursorObj); + } this.cursorObj = globalScene.add.image(0, 0, "select_cursor"); this.cursorObj.setOrigin(0, 0); @@ -561,7 +561,7 @@ export default class PokedexUiHandler extends MessageUiHandler { this.goFilterIconElement2.setName("sprite-goFilter2-icon-element"); this.goFilterIconElement2.setScale(0.675); this.goFilterIconElement2.setOrigin(0.0, 0.0); - this.goFilterLabel = addTextObject(30, 2, i18next.t("pokedexUiHandler:goFilters"), TextStyle.PARTY, { + this.goFilterLabel = addTextObject(30, 2, i18next.t("pokedexUiHandler:goFilters"), TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize, }); this.goFilterLabel.setName("text-goFilter-label"); @@ -577,7 +577,7 @@ export default class PokedexUiHandler extends MessageUiHandler { 20, 10, i18next.t("pokedexUiHandler:toggleDecorations"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.toggleDecorationsLabel.setName("text-toggleDecorations-label"); @@ -588,9 +588,15 @@ export default class PokedexUiHandler extends MessageUiHandler { this.showFormTrayIconElement.setName("sprite-showFormTray-icon-element"); this.showFormTrayIconElement.setScale(0.675); this.showFormTrayIconElement.setOrigin(0.0, 0.0); - this.showFormTrayLabel = addTextObject(16, 168, i18next.t("pokedexUiHandler:showForms"), TextStyle.PARTY, { - fontSize: instructionTextSize, - }); + this.showFormTrayLabel = addTextObject( + 16, + 168, + i18next.t("pokedexUiHandler:showForms"), + TextStyle.INSTRUCTIONS_TEXT, + { + fontSize: instructionTextSize, + }, + ); this.showFormTrayLabel.setName("text-showFormTray-label"); this.showFormTrayIconElement.setVisible(false); this.showFormTrayLabel.setVisible(false); diff --git a/src/ui/pokemon-hatch-info-container.ts b/src/ui/pokemon-hatch-info-container.ts index afc58c63953..8bcd62316cd 100644 --- a/src/ui/pokemon-hatch-info-container.ts +++ b/src/ui/pokemon-hatch-info-container.ts @@ -1,24 +1,24 @@ -import PokemonInfoContainer from "#app/ui/pokemon-info-container"; -import { Gender } from "#app/data/gender"; -import { PokemonType } from "#enums/pokemon-type"; -import { rgbHexToRgba, padInt } from "#app/utils/common"; -import { TextStyle, addTextObject } from "#app/ui/text"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { allMoves } from "#app/data/data-lists"; -import { SpeciesId } from "#enums/species-id"; -import { getEggTierForSpecies } from "#app/data/egg"; -import { starterColors } from "#app/global-vars/starter-colors"; import { globalScene } from "#app/global-scene"; +import { starterColors } from "#app/global-vars/starter-colors"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { allMoves } from "#data/data-lists"; +import { getEggTierForSpecies } from "#data/egg"; +import type { EggHatchData } from "#data/egg-hatch-data"; +import { Gender } from "#data/gender"; +import { getPokemonSpeciesForm } from "#data/pokemon-species"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import type { PlayerPokemon } from "#field/pokemon"; +import { PokemonInfoContainer } from "#ui/pokemon-info-container"; +import { addTextObject, TextStyle } from "#ui/text"; +import { padInt, rgbHexToRgba } from "#utils/common"; import { argbFromRgba } from "@material/material-color-utilities"; -import type { EggHatchData } from "#app/data/egg-hatch-data"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { getPokemonSpeciesForm } from "#app/data/pokemon-species"; /** * Class for the hatch info summary of each pokemon * Holds an info container as well as an additional egg sprite, name, egg moves and main sprite */ -export default class PokemonHatchInfoContainer extends PokemonInfoContainer { +export class PokemonHatchInfoContainer extends PokemonInfoContainer { private currentPokemonSprite: Phaser.GameObjects.Sprite; private pokemonNumberText: Phaser.GameObjects.Text; private pokemonNameText: Phaser.GameObjects.Text; @@ -49,13 +49,11 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer { this.pokemonListContainer.add(this.currentPokemonSprite); // setup name and number - this.pokemonNumberText = addTextObject(80, 107.5, "0000", TextStyle.SUMMARY, { fontSize: 74 }); + this.pokemonNumberText = addTextObject(84, 107, "0000", TextStyle.EGG_SUMMARY_DEX, { fontSize: 78 }); this.pokemonNumberText.setOrigin(0, 0); this.pokemonListContainer.add(this.pokemonNumberText); - this.pokemonNameText = addTextObject(7, 107.5, "", TextStyle.SUMMARY, { - fontSize: 74, - }); + this.pokemonNameText = addTextObject(7, 109, "", TextStyle.EGG_SUMMARY_NAME, { fontSize: 64 }); this.pokemonNameText.setOrigin(0, 0); this.pokemonListContainer.add(this.pokemonNameText); @@ -93,7 +91,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer { const eggMoveBg = globalScene.add.nineslice(70, 0, "type_bgs", "unknown", 92, 14, 2, 2, 2, 2); eggMoveBg.setOrigin(1, 0); - const eggMoveLabel = addTextObject(70 - eggMoveBg.width / 2, 0, "???", TextStyle.PARTY); + const eggMoveLabel = addTextObject(70 - eggMoveBg.width / 2, 0, "???", TextStyle.MOVE_LABEL); eggMoveLabel.setOrigin(0.5, 0); this.pokemonEggMoveBgs.push(eggMoveBg); @@ -158,7 +156,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer { this.pokemonCandyIcon.setVisible(true); this.pokemonCandyOverlayIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[1]))); this.pokemonCandyOverlayIcon.setVisible(true); - this.pokemonCandyCountText.setText(`x${globalScene.gameData.starterData[species.speciesId].candyCount}`); + this.pokemonCandyCountText.setText(`×${globalScene.gameData.starterData[species.speciesId].candyCount}`); this.pokemonCandyCountText.setVisible(true); this.pokemonNumberText.setText(padInt(species.speciesId, 4)); diff --git a/src/ui/pokemon-icon-anim-handler.ts b/src/ui/pokemon-icon-anim-handler.ts index 8a206167a94..408e0ebc9d3 100644 --- a/src/ui/pokemon-icon-anim-handler.ts +++ b/src/ui/pokemon-icon-anim-handler.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { fixedInt, coerceArray } from "#app/utils/common"; +import { coerceArray, fixedInt } from "#utils/common"; export enum PokemonIconAnimMode { NONE, @@ -9,7 +9,7 @@ export enum PokemonIconAnimMode { type PokemonIcon = Phaser.GameObjects.Container | Phaser.GameObjects.Sprite; -export default class PokemonIconAnimHandler { +export class PokemonIconAnimHandler { private icons: Map; private toggled: boolean; diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 0056c3e2f11..c95f412c834 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -1,19 +1,19 @@ -import { getVariantTint } from "#app/sprites/variant"; -import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { globalScene } from "#app/global-scene"; -import { Gender, getGenderColor, getGenderSymbol } from "../data/gender"; -import { getNatureName } from "../data/nature"; -import { PokemonType } from "#enums/pokemon-type"; -import type Pokemon from "../field/pokemon"; -import i18next from "i18next"; -import type { StarterDataEntry } from "../system/game-data"; -import type { DexEntry } from "#app/@types/dex-data"; +import { Gender, getGenderColor, getGenderSymbol } from "#data/gender"; +import { getNatureName } from "#data/nature"; import { DexAttr } from "#enums/dex-attr"; -import { fixedInt, getShinyDescriptor } from "#app/utils/common"; -import ConfirmUiHandler from "./confirm-ui-handler"; -import { StatsContainer } from "./stats-container"; -import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text"; -import { addWindow } from "./ui-theme"; +import { PokemonType } from "#enums/pokemon-type"; +import type { Pokemon } from "#field/pokemon"; +import { getVariantTint } from "#sprites/variant"; +import type { StarterDataEntry } from "#system/game-data"; +import type { DexEntry } from "#types/dex-data"; +import { ConfirmUiHandler } from "#ui/confirm-ui-handler"; +import { StatsContainer } from "#ui/stats-container"; +import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt, getShinyDescriptor } from "#utils/common"; +import i18next from "i18next"; +import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; interface LanguageSetting { infoContainerTextSize: string; @@ -22,14 +22,24 @@ interface LanguageSetting { } const languageSettings: { [key: string]: LanguageSetting } = { + en: { + infoContainerTextSize: "64px", + infoContainerLabelXPos: -20, + infoContainerTextXPos: -17, + }, pt: { infoContainerTextSize: "60px", infoContainerLabelXPos: -15, infoContainerTextXPos: -12, }, + ja: { + infoContainerTextSize: "64px", + infoContainerLabelXPos: -27, + infoContainerTextXPos: -25, + }, }; -export default class PokemonInfoContainer extends Phaser.GameObjects.Container { +export class PokemonInfoContainer extends Phaser.GameObjects.Container { private readonly infoWindowWidth = 104; private pokemonFormLabelText: Phaser.GameObjects.Text; @@ -106,7 +116,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { moveBg.setOrigin(1, 0); moveBg.setName("nineslice-move-bg"); - const moveLabel = addTextObject(-moveBg.width / 2, 0, "-", TextStyle.PARTY); + const moveLabel = addTextObject(-moveBg.width / 2, 0, "-", TextStyle.MOVE_LABEL); moveLabel.setOrigin(0.5, 0); moveLabel.setName("text-move-label"); @@ -445,12 +455,12 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.pokemonShinyIcon.setPosition(82, 87); this.pokemonShinyNewIcon.setPosition(72, 87); - this.pokemonFormLabelText.setPosition(infoContainerLabelXPos, 152); - this.pokemonFormText.setPosition(infoContainerTextXPos, 152); - this.pokemonAbilityLabelText.setPosition(infoContainerLabelXPos, 110); - this.pokemonAbilityText.setPosition(infoContainerTextXPos, 110); - this.pokemonNatureLabelText.setPosition(infoContainerLabelXPos, 125); - this.pokemonNatureText.setPosition(infoContainerTextXPos, 125); + this.pokemonFormLabelText.setPosition(infoContainerLabelXPos, 153); + this.pokemonFormText.setPosition(infoContainerTextXPos, 153); + this.pokemonAbilityLabelText.setPosition(infoContainerLabelXPos, 111); + this.pokemonAbilityText.setPosition(infoContainerTextXPos, 111); + this.pokemonNatureLabelText.setPosition(infoContainerLabelXPos, 126); + this.pokemonNatureText.setPosition(infoContainerTextXPos, 126); this.statsContainer.setScale(0.7); this.statsContainer.setPosition(30, -3); diff --git a/src/ui/registration-form-ui-handler.ts b/src/ui/registration-form-ui-handler.ts index a60a53a8e7a..2466603af71 100644 --- a/src/ui/registration-form-ui-handler.ts +++ b/src/ui/registration-form-ui-handler.ts @@ -1,11 +1,11 @@ -import type { InputFieldConfig } from "./form-modal-ui-handler"; -import { FormModalUiHandler } from "./form-modal-ui-handler"; -import type { ModalConfig } from "./modal-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { TextStyle, addTextObject } from "./text"; -import i18next from "i18next"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; +import { pokerogueApi } from "#api/pokerogue-api"; import { globalScene } from "#app/global-scene"; +import { UiMode } from "#enums/ui-mode"; +import type { InputFieldConfig } from "#ui/form-modal-ui-handler"; +import { FormModalUiHandler } from "#ui/form-modal-ui-handler"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import i18next from "i18next"; interface LanguageSetting { inputFieldFontSize?: string; @@ -20,7 +20,7 @@ const languageSettings: { [key: string]: LanguageSetting } = { }, }; -export default class RegistrationFormUiHandler extends FormModalUiHandler { +export class RegistrationFormUiHandler extends FormModalUiHandler { getModalTitle(_config?: ModalConfig): string { return i18next.t("menu:register"); } diff --git a/src/ui/rename-form-ui-handler.ts b/src/ui/rename-form-ui-handler.ts index 7083f83865b..9da5b0e8554 100644 --- a/src/ui/rename-form-ui-handler.ts +++ b/src/ui/rename-form-ui-handler.ts @@ -1,10 +1,10 @@ -import type { InputFieldConfig } from "./form-modal-ui-handler"; -import { FormModalUiHandler } from "./form-modal-ui-handler"; -import type { ModalConfig } from "./modal-ui-handler"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { InputFieldConfig } from "#ui/form-modal-ui-handler"; +import { FormModalUiHandler } from "#ui/form-modal-ui-handler"; +import type { ModalConfig } from "#ui/modal-ui-handler"; import i18next from "i18next"; -import type { PlayerPokemon } from "#app/field/pokemon"; -export default class RenameFormUiHandler extends FormModalUiHandler { +export class RenameFormUiHandler extends FormModalUiHandler { getModalTitle(_config?: ModalConfig): string { return i18next.t("menu:renamePokemon"); } diff --git a/src/ui/run-history-ui-handler.ts b/src/ui/run-history-ui-handler.ts index 06ef590c1e8..f810468aea1 100644 --- a/src/ui/run-history-ui-handler.ts +++ b/src/ui/run-history-ui-handler.ts @@ -1,18 +1,18 @@ import { globalScene } from "#app/global-scene"; -import { GameModes } from "#enums/game-modes"; -import { TextStyle, addTextObject } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import { addWindow } from "./ui-theme"; -import { fixedInt, formatLargeNumber } from "#app/utils/common"; -import type PokemonData from "../system/pokemon-data"; -import MessageUiHandler from "./message-ui-handler"; -import i18next from "i18next"; -import { Button } from "../enums/buttons"; import { BattleType } from "#enums/battle-type"; -import type { RunEntry } from "../system/game-data"; +import { Button } from "#enums/buttons"; +import { GameModes } from "#enums/game-modes"; import { PlayerGender } from "#enums/player-gender"; import { TrainerVariant } from "#enums/trainer-variant"; -import { RunDisplayMode } from "#app/ui/run-info-ui-handler"; +import { UiMode } from "#enums/ui-mode"; +import type { RunEntry } from "#system/game-data"; +import type { PokemonData } from "#system/pokemon-data"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { RunDisplayMode } from "#ui/run-info-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt, formatLargeNumber } from "#utils/common"; +import i18next from "i18next"; export type RunSelectCallback = (cursor: number) => void; @@ -24,7 +24,7 @@ export const RUN_HISTORY_LIMIT: number = 25; * It navigates similarly to the UI of the save slot select menu. * The only valid input buttons are Button.ACTION and Button.CANCEL. */ -export default class RunHistoryUiHandler extends MessageUiHandler { +export class RunHistoryUiHandler extends MessageUiHandler { private readonly maxRows = 3; private runSelectContainer: Phaser.GameObjects.Container; diff --git a/src/ui/run-info-ui-handler.ts b/src/ui/run-info-ui-handler.ts index 76e343d018a..29f95c4e4c8 100644 --- a/src/ui/run-info-ui-handler.ts +++ b/src/ui/run-info-ui-handler.ts @@ -1,32 +1,32 @@ -import { GameModes } from "#enums/game-modes"; -import UiHandler from "./ui-handler"; -import type { SessionSaveData } from "../system/game-data"; -import { TextStyle, addTextObject, addBBCodeTextObject, getTextColor } from "./text"; -import { UiMode } from "#enums/ui-mode"; -import { addWindow } from "./ui-theme"; -import { getPokeballAtlasKey } from "#app/data/pokeball"; -import { formatLargeNumber, getPlayTimeString, formatMoney, formatFancyLargeNumber } from "#app/utils/common"; -import type PokemonData from "../system/pokemon-data"; -import i18next from "i18next"; -import { Button } from "../enums/buttons"; -import { BattleType } from "#enums/battle-type"; -import { TrainerVariant } from "#enums/trainer-variant"; -import { Challenges } from "#enums/challenges"; -import { getLuckString, getLuckTextTint } from "../modifier/modifier-type"; -import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle"; -import { getTypeRgb } from "#app/data/type"; -import { PokemonType } from "#enums/pokemon-type"; -import { TypeColor, TypeShadow } from "#app/enums/color"; -import { getNatureStatMultiplier, getNatureName } from "../data/nature"; -import { getVariantTint } from "#app/sprites/variant"; -// biome-ignore lint/performance/noNamespaceImport: See `src/system/game-data.ts` -import * as Modifier from "#app/modifier/modifier"; -import type { SpeciesId } from "#enums/species-id"; -import { PlayerGender } from "#enums/player-gender"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { getBiomeName } from "#app/data/balance/biomes"; -import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { globalScene } from "#app/global-scene"; +import { getBiomeName } from "#balance/biomes"; +import { getNatureName, getNatureStatMultiplier } from "#data/nature"; +import { getPokeballAtlasKey } from "#data/pokeball"; +import { getTypeRgb } from "#data/type"; +import { BattleType } from "#enums/battle-type"; +import { Button } from "#enums/buttons"; +import { Challenges } from "#enums/challenges"; +import { TypeColor, TypeShadow } from "#enums/color"; +import { GameModes } from "#enums/game-modes"; +import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PlayerGender } from "#enums/player-gender"; +import { PokemonType } from "#enums/pokemon-type"; +import type { SpeciesId } from "#enums/species-id"; +import { TrainerVariant } from "#enums/trainer-variant"; +import { UiMode } from "#enums/ui-mode"; +// biome-ignore lint/performance/noNamespaceImport: See `src/system/game-data.ts` +import * as Modifier from "#modifiers/modifier"; +import { getLuckString, getLuckTextTint } from "#modifiers/modifier-type"; +import { getVariantTint } from "#sprites/variant"; +import type { SessionSaveData } from "#system/game-data"; +import type { PokemonData } from "#system/pokemon-data"; +import { SettingKeyboard } from "#system/settings-keyboard"; +import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import { formatFancyLargeNumber, formatLargeNumber, formatMoney, getPlayTimeString } from "#utils/common"; +import i18next from "i18next"; +import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle"; /** * RunInfoUiMode indicates possible overlays of RunInfoUiHandler. @@ -50,7 +50,7 @@ export enum RunDisplayMode { * I believe that it is possible that the contents/methods of the first page will be placed in their own class that is an extension of RunInfoUiHandler as more pages are added. * For now, I leave as is. */ -export default class RunInfoUiHandler extends UiHandler { +export class RunInfoUiHandler extends UiHandler { protected runDisplayMode: RunDisplayMode; protected runInfo: SessionSaveData; protected isVictory: boolean; @@ -202,7 +202,7 @@ export default class RunInfoUiHandler extends UiHandler { ); this.runContainer.add(abilityButtonContainer); } - const headerText = addTextObject(0, 0, i18next.t("runHistory:runInfo"), TextStyle.SETTINGS_LABEL); + const headerText = addTextObject(0, 0, i18next.t("runHistory:runInfo"), TextStyle.HEADER_LABEL); headerText.setOrigin(0, 0); headerText.setPositionRelative(headerBg, 8, 4); this.runContainer.add(headerText); @@ -603,7 +603,7 @@ export default class RunInfoUiHandler extends UiHandler { // Duration + Money const runInfoTextContainer = globalScene.add.container(0, 0); // Japanese is set to a greater line spacing of 35px in addBBCodeTextObject() if lineSpacing < 12. - const lineSpacing = i18next.resolvedLanguage === "ja" ? 12 : 3; + const lineSpacing = i18next.resolvedLanguage === "ja" ? 3 : 3; const runInfoText = addBBCodeTextObject(7, 0, "", TextStyle.WINDOW, { fontSize: "50px", lineSpacing: lineSpacing, @@ -768,7 +768,7 @@ export default class RunInfoUiHandler extends UiHandler { const pPassiveInfo = pokemon.passive ? passiveLabel + ": " + pokemon.getPassiveAbility().name : ""; const pAbilityInfo = abilityLabel + ": " + pokemon.getAbility().name; // Japanese is set to a greater line spacing of 35px in addBBCodeTextObject() if lineSpacing < 12. - const lineSpacing = i18next.resolvedLanguage === "ja" ? 12 : 3; + const lineSpacing = i18next.resolvedLanguage === "ja" ? 3 : 3; const pokeInfoText = addBBCodeTextObject(0, 0, pName, TextStyle.SUMMARY, { fontSize: textContainerFontSize, lineSpacing: lineSpacing, @@ -866,7 +866,7 @@ export default class RunInfoUiHandler extends UiHandler { moveContainer.setScale(0.5); const moveBg = globalScene.add.nineslice(0, 0, "type_bgs", "unknown", 85, 15, 2, 2, 2, 2); moveBg.setOrigin(1, 0); - const moveLabel = addTextObject(-moveBg.width / 2, 2, "-", TextStyle.PARTY); + const moveLabel = addTextObject(-moveBg.width / 2, 1, "-", TextStyle.MOVE_LABEL); moveLabel.setOrigin(0.5, 0); moveLabel.setName("text-move-label"); pokemonMoveBgs.push(moveBg); diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index 7dee041fa63..bcbe60265cd 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -1,17 +1,17 @@ -import i18next from "i18next"; +import { GameMode } from "#app/game-mode"; import { globalScene } from "#app/global-scene"; import { Button } from "#enums/buttons"; -import { GameMode } from "../game-mode"; -// biome-ignore lint/performance/noNamespaceImport: See `src/system/game-data.ts` -import * as Modifier from "#app/modifier/modifier"; -import type { SessionSaveData } from "../system/game-data"; -import type PokemonData from "../system/pokemon-data"; -import { isNullOrUndefined, fixedInt, getPlayTimeString, formatLargeNumber } from "#app/utils/common"; -import MessageUiHandler from "./message-ui-handler"; -import { TextStyle, addTextObject } from "./text"; import { UiMode } from "#enums/ui-mode"; -import { addWindow } from "./ui-theme"; -import { RunDisplayMode } from "#app/ui/run-info-ui-handler"; +// biome-ignore lint/performance/noNamespaceImport: See `src/system/game-data.ts` +import * as Modifier from "#modifiers/modifier"; +import type { SessionSaveData } from "#system/game-data"; +import type { PokemonData } from "#system/pokemon-data"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { RunDisplayMode } from "#ui/run-info-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import { fixedInt, formatLargeNumber, getPlayTimeString, isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; const SESSION_SLOTS_COUNT = 5; const SLOTS_ON_SCREEN = 3; @@ -23,7 +23,7 @@ export enum SaveSlotUiMode { export type SaveSlotSelectCallback = (cursor: number) => void; -export default class SaveSlotSelectUiHandler extends MessageUiHandler { +export class SaveSlotSelectUiHandler extends MessageUiHandler { private saveSlotSelectContainer: Phaser.GameObjects.Container; private sessionSlotsContainer: Phaser.GameObjects.Container; private saveSlotSelectMessageBox: Phaser.GameObjects.NineSlice; diff --git a/src/ui/saving-icon-handler.ts b/src/ui/saving-icon-handler.ts index 3b7db549a4a..6923017218f 100644 --- a/src/ui/saving-icon-handler.ts +++ b/src/ui/saving-icon-handler.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; -import { fixedInt } from "#app/utils/common"; +import { fixedInt } from "#utils/common"; -export default class SavingIconHandler extends Phaser.GameObjects.Container { +export class SavingIconHandler extends Phaser.GameObjects.Container { private icon: Phaser.GameObjects.Sprite; private animActive: boolean; diff --git a/src/ui/scrollable-grid-handler.ts b/src/ui/scrollable-grid-handler.ts index 54f07d69fb7..3c6458f5083 100644 --- a/src/ui/scrollable-grid-handler.ts +++ b/src/ui/scrollable-grid-handler.ts @@ -1,6 +1,6 @@ import { Button } from "#enums/buttons"; -import type UiHandler from "#app/ui/ui-handler"; -import type { ScrollBar } from "#app/ui/scroll-bar"; +import type { ScrollBar } from "#ui/scroll-bar"; +import type { UiHandler } from "#ui/ui-handler"; type UpdateGridCallbackFunction = () => void; type UpdateDetailsCallbackFunction = (index: number) => void; @@ -16,7 +16,7 @@ type UpdateDetailsCallbackFunction = (index: number) => void; * - in `UiHandler.processInput`: call `processNavigationInput` to have it handle the cursor updates while calling the defined callbacks * - in `UiHandler.clear`: call `reset` */ -export default class ScrollableGridUiHandler { +export class ScrollableGridUiHandler { private readonly ROWS: number; private readonly COLUMNS: number; private handler: UiHandler; diff --git a/src/ui/session-reload-modal-ui-handler.ts b/src/ui/session-reload-modal-ui-handler.ts index f866783afe8..ab1197324a6 100644 --- a/src/ui/session-reload-modal-ui-handler.ts +++ b/src/ui/session-reload-modal-ui-handler.ts @@ -1,9 +1,9 @@ -import type { ModalConfig } from "./modal-ui-handler"; -import { ModalUiHandler } from "./modal-ui-handler"; -import { addTextObject, TextStyle } from "./text"; import type { UiMode } from "#enums/ui-mode"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { ModalUiHandler } from "#ui/modal-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; -export default class SessionReloadModalUiHandler extends ModalUiHandler { +export class SessionReloadModalUiHandler extends ModalUiHandler { constructor(mode: UiMode | null = null) { super(mode); } diff --git a/src/ui/settings/abstract-binding-ui-handler.ts b/src/ui/settings/abstract-binding-ui-handler.ts index a4707418b7c..aaf3572b489 100644 --- a/src/ui/settings/abstract-binding-ui-handler.ts +++ b/src/ui/settings/abstract-binding-ui-handler.ts @@ -1,18 +1,18 @@ -import UiHandler from "../ui-handler"; -import type { UiMode } from "#enums/ui-mode"; -import { addWindow } from "../ui-theme"; -import { addTextObject, TextStyle } from "../text"; -import { Button } from "#enums/buttons"; -import { NavigationManager } from "#app/ui/settings/navigationMenu"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import type { UiMode } from "#enums/ui-mode"; +import { NavigationManager } from "#ui/navigationMenu"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import i18next from "i18next"; type CancelFn = (succes?: boolean) => boolean; /** * Abstract class for handling UI elements related to button bindings. */ -export default abstract class AbstractBindingUiHandler extends UiHandler { +export abstract class AbstractBindingUiHandler extends UiHandler { // Containers for different segments of the UI. protected optionSelectContainer: Phaser.GameObjects.Container; protected actionsContainer: Phaser.GameObjects.Container; diff --git a/src/ui/settings/abstract-control-settings-ui-handler.ts b/src/ui/settings/abstract-control-settings-ui-handler.ts index 769de7993ce..67cc3ad7c03 100644 --- a/src/ui/settings/abstract-control-settings-ui-handler.ts +++ b/src/ui/settings/abstract-control-settings-ui-handler.ts @@ -1,15 +1,15 @@ -import UiHandler from "#app/ui/ui-handler"; -import type { UiMode } from "#enums/ui-mode"; -import type { InterfaceConfig } from "#app/inputs-controller"; -import { addWindow } from "#app/ui/ui-theme"; -import { addTextObject, TextStyle } from "#app/ui/text"; -import { ScrollBar } from "#app/ui/scroll-bar"; -import { getIconWithSettingName } from "#app/configs/inputs/configHandler"; -import NavigationMenu, { NavigationManager } from "#app/ui/settings/navigationMenu"; -import type { Device } from "#enums/devices"; -import { Button } from "#enums/buttons"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; +import type { InterfaceConfig } from "#app/inputs-controller"; +import { Button } from "#enums/buttons"; +import type { Device } from "#enums/devices"; +import type { UiMode } from "#enums/ui-mode"; +import { getIconWithSettingName } from "#inputs/configHandler"; +import { NavigationManager, NavigationMenu } from "#ui/navigationMenu"; +import { ScrollBar } from "#ui/scroll-bar"; +import { addTextObject, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import i18next from "i18next"; export interface InputsIcons { [key: string]: Phaser.GameObjects.Sprite; @@ -27,7 +27,7 @@ export interface LayoutConfig { /** * Abstract class for handling UI elements related to control settings. */ -export default abstract class AbstractControlSettingsUiHandler extends UiHandler { +export abstract class AbstractControlSettingsUiHandler extends UiHandler { protected settingsContainer: Phaser.GameObjects.Container; protected optionsContainer: Phaser.GameObjects.Container; protected navigationContainer: NavigationMenu; diff --git a/src/ui/settings/abstract-settings-ui-handler.ts b/src/ui/settings/abstract-settings-ui-handler.ts index 6db9840a818..303ad229ea6 100644 --- a/src/ui/settings/abstract-settings-ui-handler.ts +++ b/src/ui/settings/abstract-settings-ui-handler.ts @@ -1,20 +1,20 @@ -import { TextStyle, addTextObject } from "#app/ui/text"; -import { UiMode } from "#enums/ui-mode"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import { addWindow } from "#app/ui/ui-theme"; -import { ScrollBar } from "#app/ui/scroll-bar"; -import { Button } from "#enums/buttons"; -import type { InputsIcons } from "#app/ui/settings/abstract-control-settings-ui-handler"; -import NavigationMenu, { NavigationManager } from "#app/ui/settings/navigationMenu"; -import type { SettingType } from "#app/system/settings/settings"; -import { Setting, SettingKeys } from "#app/system/settings/settings"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; +import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import type { SettingType } from "#system/settings"; +import { Setting, SettingKeys } from "#system/settings"; +import type { InputsIcons } from "#ui/abstract-control-settings-ui-handler"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { NavigationManager, NavigationMenu } from "#ui/navigationMenu"; +import { ScrollBar } from "#ui/scroll-bar"; +import { addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; +import i18next from "i18next"; /** * Abstract class for handling UI elements related to settings. */ -export default class AbstractSettingsUiHandler extends MessageUiHandler { +export class AbstractSettingsUiHandler extends MessageUiHandler { private settingsContainer: Phaser.GameObjects.Container; private optionsContainer: Phaser.GameObjects.Container; private messageBoxContainer: Phaser.GameObjects.Container; diff --git a/src/ui/settings/gamepad-binding-ui-handler.ts b/src/ui/settings/gamepad-binding-ui-handler.ts index 9ddb54131d5..c514e93ec51 100644 --- a/src/ui/settings/gamepad-binding-ui-handler.ts +++ b/src/ui/settings/gamepad-binding-ui-handler.ts @@ -1,12 +1,12 @@ -import AbstractBindingUiHandler from "./abstract-binding-ui-handler"; -import type { UiMode } from "#enums/ui-mode"; -import { Device } from "#enums/devices"; -import { getIconWithSettingName, getKeyWithKeycode } from "#app/configs/inputs/configHandler"; -import { addTextObject, TextStyle } from "#app/ui/text"; import { globalScene } from "#app/global-scene"; +import { Device } from "#enums/devices"; +import type { UiMode } from "#enums/ui-mode"; +import { getIconWithSettingName, getKeyWithKeycode } from "#inputs/configHandler"; +import { AbstractBindingUiHandler } from "#ui/abstract-binding-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; import i18next from "i18next"; -export default class GamepadBindingUiHandler extends AbstractBindingUiHandler { +export class GamepadBindingUiHandler extends AbstractBindingUiHandler { constructor(mode: UiMode | null = null) { super(mode); globalScene.input.gamepad?.on("down", this.gamepadButtonDown, this); diff --git a/src/ui/settings/keyboard-binding-ui-handler.ts b/src/ui/settings/keyboard-binding-ui-handler.ts index 183b8269e78..a789225a8ef 100644 --- a/src/ui/settings/keyboard-binding-ui-handler.ts +++ b/src/ui/settings/keyboard-binding-ui-handler.ts @@ -1,12 +1,12 @@ -import AbstractBindingUiHandler from "./abstract-binding-ui-handler"; -import type { UiMode } from "#enums/ui-mode"; -import { getKeyWithKeycode } from "#app/configs/inputs/configHandler"; -import { Device } from "#enums/devices"; -import { addTextObject, TextStyle } from "#app/ui/text"; import { globalScene } from "#app/global-scene"; +import { Device } from "#enums/devices"; +import type { UiMode } from "#enums/ui-mode"; +import { getKeyWithKeycode } from "#inputs/configHandler"; +import { AbstractBindingUiHandler } from "#ui/abstract-binding-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; import i18next from "i18next"; -export default class KeyboardBindingUiHandler extends AbstractBindingUiHandler { +export class KeyboardBindingUiHandler extends AbstractBindingUiHandler { constructor(mode: UiMode | null = null) { super(mode); // Listen to gamepad button down events to initiate binding. diff --git a/src/ui/settings/move-touch-controls-handler.ts b/src/ui/settings/move-touch-controls-handler.ts index f684d27f748..60572529c89 100644 --- a/src/ui/settings/move-touch-controls-handler.ts +++ b/src/ui/settings/move-touch-controls-handler.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import type TouchControl from "#app/touch-controls"; -import type UI from "#app/ui/ui"; +import type { TouchControl } from "#app/touch-controls"; +import type { UI } from "#ui/ui"; import i18next from "i18next"; export const TOUCH_CONTROL_POSITIONS_LANDSCAPE = "touchControlPositionsLandscape"; @@ -24,7 +24,7 @@ type ToolbarRefs = { /** * Handles the dragging of touch controls around the screen. */ -export default class MoveTouchControlsHandler { +export class MoveTouchControlsHandler { /** The element that is currently being dragged */ private draggingElement: HTMLElement | null = null; diff --git a/src/ui/settings/navigationMenu.ts b/src/ui/settings/navigationMenu.ts index be3726bd47d..1303c32d3a5 100644 --- a/src/ui/settings/navigationMenu.ts +++ b/src/ui/settings/navigationMenu.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import { UiMode } from "#enums/ui-mode"; -import type { InputsIcons } from "#app/ui/settings/abstract-control-settings-ui-handler"; -import { addTextObject, setTextStyle, TextStyle } from "#app/ui/text"; -import { addWindow } from "#app/ui/ui-theme"; import { Button } from "#enums/buttons"; +import { UiMode } from "#enums/ui-mode"; +import type { InputsIcons } from "#ui/abstract-control-settings-ui-handler"; +import { addTextObject, setTextStyle, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; import i18next from "i18next"; const LEFT = "LEFT"; @@ -103,7 +103,7 @@ export class NavigationManager { } } -export default class NavigationMenu extends Phaser.GameObjects.Container { +export class NavigationMenu extends Phaser.GameObjects.Container { private navigationIcons: InputsIcons; protected headerTitles: Phaser.GameObjects.Text[] = []; @@ -144,7 +144,7 @@ export default class NavigationMenu extends Phaser.GameObjects.Container { let relative: Phaser.GameObjects.Sprite | Phaser.GameObjects.Text = iconPreviousTab; let relativeWidth: number = iconPreviousTab.width * 6; for (const label of navigationManager.labels) { - const labelText = addTextObject(0, 0, label, TextStyle.SETTINGS_LABEL); + const labelText = addTextObject(0, 0, label, TextStyle.SETTINGS_LABEL_NAVBAR); labelText.setOrigin(0, 0); labelText.setPositionRelative(relative, 6 + relativeWidth / 6, 0); this.add(labelText); diff --git a/src/ui/settings/option-select-ui-handler.ts b/src/ui/settings/option-select-ui-handler.ts index af9760814ac..d7b699e6e50 100644 --- a/src/ui/settings/option-select-ui-handler.ts +++ b/src/ui/settings/option-select-ui-handler.ts @@ -1,7 +1,7 @@ -import AbstractOptionSelectUiHandler from "../abstact-option-select-ui-handler"; import { UiMode } from "#enums/ui-mode"; +import { AbstractOptionSelectUiHandler } from "#ui/abstact-option-select-ui-handler"; -export default class OptionSelectUiHandler extends AbstractOptionSelectUiHandler { +export class OptionSelectUiHandler extends AbstractOptionSelectUiHandler { constructor(mode: UiMode = UiMode.OPTION_SELECT) { super(mode); } diff --git a/src/ui/settings/settings-audio-ui-handler.ts b/src/ui/settings/settings-audio-ui-handler.ts index 019d66d7428..aa55f5489cc 100644 --- a/src/ui/settings/settings-audio-ui-handler.ts +++ b/src/ui/settings/settings-audio-ui-handler.ts @@ -1,9 +1,8 @@ import type { UiMode } from "#enums/ui-mode"; -import AbstractSettingsUiHandler from "./abstract-settings-ui-handler"; -import { SettingType } from "#app/system/settings/settings"; -("#app/inputs-controller"); +import { SettingType } from "#system/settings"; +import { AbstractSettingsUiHandler } from "#ui/abstract-settings-ui-handler"; -export default class SettingsAudioUiHandler extends AbstractSettingsUiHandler { +export class SettingsAudioUiHandler extends AbstractSettingsUiHandler { /** * Creates an instance of SettingsAudioUiHandler. * diff --git a/src/ui/settings/settings-display-ui-handler.ts b/src/ui/settings/settings-display-ui-handler.ts index 0636bd25567..3c261d6ddab 100644 --- a/src/ui/settings/settings-display-ui-handler.ts +++ b/src/ui/settings/settings-display-ui-handler.ts @@ -1,9 +1,8 @@ import type { UiMode } from "#enums/ui-mode"; -import AbstractSettingsUiHandler from "./abstract-settings-ui-handler"; -import { SettingKeys, SettingType } from "#app/system/settings/settings"; -("#app/inputs-controller"); +import { SettingKeys, SettingType } from "#system/settings"; +import { AbstractSettingsUiHandler } from "#ui/abstract-settings-ui-handler"; -export default class SettingsDisplayUiHandler extends AbstractSettingsUiHandler { +export class SettingsDisplayUiHandler extends AbstractSettingsUiHandler { /** * Creates an instance of SettingsGamepadUiHandler. * diff --git a/src/ui/settings/settings-gamepad-ui-handler.ts b/src/ui/settings/settings-gamepad-ui-handler.ts index 7d269deab14..63dd4c74618 100644 --- a/src/ui/settings/settings-gamepad-ui-handler.ts +++ b/src/ui/settings/settings-gamepad-ui-handler.ts @@ -1,21 +1,21 @@ -import { addTextObject, TextStyle } from "../text"; +import { globalScene } from "#app/global-scene"; +import type { InterfaceConfig } from "#app/inputs-controller"; +import { Device } from "#enums/devices"; import type { UiMode } from "#enums/ui-mode"; +import pad_dualshock from "#inputs/pad_dualshock"; +import pad_unlicensedSNES from "#inputs/pad_unlicensedSNES"; +import pad_xbox360 from "#inputs/pad_xbox360"; import { - setSettingGamepad, SettingGamepad, + setSettingGamepad, settingGamepadBlackList, settingGamepadDefaults, settingGamepadOptions, -} from "../../system/settings/settings-gamepad"; -import pad_xbox360 from "#app/configs/inputs/pad_xbox360"; -import pad_dualshock from "#app/configs/inputs/pad_dualshock"; -import pad_unlicensedSNES from "#app/configs/inputs/pad_unlicensedSNES"; -import type { InterfaceConfig } from "#app/inputs-controller"; -import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler"; -import { Device } from "#enums/devices"; -import { truncateString } from "#app/utils/common"; +} from "#system/settings-gamepad"; +import { AbstractControlSettingsUiHandler } from "#ui/abstract-control-settings-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { truncateString } from "#utils/common"; import i18next from "i18next"; -import { globalScene } from "#app/global-scene"; /** * Class representing the settings UI handler for gamepads. @@ -23,7 +23,7 @@ import { globalScene } from "#app/global-scene"; * @extends AbstractControlSettingsUiHandler */ -export default class SettingsGamepadUiHandler extends AbstractControlSettingsUiHandler { +export class SettingsGamepadUiHandler extends AbstractControlSettingsUiHandler { /** * Creates an instance of SettingsGamepadUiHandler. * diff --git a/src/ui/settings/settings-keyboard-ui-handler.ts b/src/ui/settings/settings-keyboard-ui-handler.ts index c334ee8f1fc..581e3e938be 100644 --- a/src/ui/settings/settings-keyboard-ui-handler.ts +++ b/src/ui/settings/settings-keyboard-ui-handler.ts @@ -1,28 +1,28 @@ +import { globalScene } from "#app/global-scene"; +import type { InterfaceConfig } from "#app/inputs-controller"; +import { Device } from "#enums/devices"; import { UiMode } from "#enums/ui-mode"; -import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty"; +import cfg_keyboard_qwerty from "#inputs/cfg_keyboard_qwerty"; +import { deleteBind } from "#inputs/configHandler"; import { - setSettingKeyboard, SettingKeyboard, + setSettingKeyboard, settingKeyboardBlackList, settingKeyboardDefaults, settingKeyboardOptions, -} from "#app/system/settings/settings-keyboard"; -import { reverseValueToKeySetting, truncateString } from "#app/utils/common"; -import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler"; -import type { InterfaceConfig } from "#app/inputs-controller"; -import { addTextObject, TextStyle } from "#app/ui/text"; -import { deleteBind } from "#app/configs/inputs/configHandler"; -import { Device } from "#enums/devices"; -import { NavigationManager } from "#app/ui/settings/navigationMenu"; +} from "#system/settings-keyboard"; +import { AbstractControlSettingsUiHandler } from "#ui/abstract-control-settings-ui-handler"; +import { NavigationManager } from "#ui/navigationMenu"; +import { addTextObject, TextStyle } from "#ui/text"; +import { reverseValueToKeySetting, truncateString } from "#utils/common"; import i18next from "i18next"; -import { globalScene } from "#app/global-scene"; /** * Class representing the settings UI handler for keyboards. * * @extends AbstractControlSettingsUiHandler */ -export default class SettingsKeyboardUiHandler extends AbstractControlSettingsUiHandler { +export class SettingsKeyboardUiHandler extends AbstractControlSettingsUiHandler { /** * Creates an instance of SettingsKeyboardUiHandler. * diff --git a/src/ui/settings/settings-ui-handler.ts b/src/ui/settings/settings-ui-handler.ts index 8d61044ff91..9461e987864 100644 --- a/src/ui/settings/settings-ui-handler.ts +++ b/src/ui/settings/settings-ui-handler.ts @@ -1,8 +1,8 @@ -import { SettingType } from "../../system/settings/settings"; import type { UiMode } from "#enums/ui-mode"; -import AbstractSettingsUiHandler from "./abstract-settings-ui-handler"; +import { SettingType } from "#system/settings"; +import { AbstractSettingsUiHandler } from "#ui/abstract-settings-ui-handler"; -export default class SettingsUiHandler extends AbstractSettingsUiHandler { +export class SettingsUiHandler extends AbstractSettingsUiHandler { /** * Creates an instance of SettingsGamepadUiHandler. * diff --git a/src/ui/starter-container.ts b/src/ui/starter-container.ts index 71e40844f38..4c174dc5955 100644 --- a/src/ui/starter-container.ts +++ b/src/ui/starter-container.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; -import type PokemonSpecies from "../data/pokemon-species"; -import { addTextObject, TextStyle } from "./text"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { addTextObject, TextStyle } from "#ui/text"; export class StarterContainer extends Phaser.GameObjects.Container { public species: PokemonSpecies; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 3cb6222cafa..18a3fbc30a3 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1,67 +1,64 @@ -import type { CandyUpgradeNotificationChangedEvent } from "#app/events/battle-scene"; -import { BattleSceneEventType } from "#app/events/battle-scene"; -import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import type { Variant } from "#app/sprites/variant"; -import { getVariantTint, getVariantIcon } from "#app/sprites/variant"; -import { argbFromRgba } from "@material/material-color-utilities"; -import i18next from "i18next"; -import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import { starterColors } from "#app/global-vars/starter-colors"; +import type { Ability } from "#abilities/ability"; +import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import type { Ability } from "#app/data/abilities/ability"; -import { allAbilities } from "#app/data/data-lists"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; -import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { allMoves } from "#app/data/data-lists"; -import { getNatureName } from "#app/data/nature"; -import { pokemonFormChanges } from "#app/data/pokemon-forms"; -import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; -import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves"; -import type PokemonSpecies from "#app/data/pokemon-species"; -import { getPokemonSpeciesForm, getPokerusStarters } from "#app/data/pokemon-species"; -import { allSpecies } from "#app/data/data-lists"; -import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters"; -import { PokemonType } from "#enums/pokemon-type"; -import { GameModes } from "#enums/game-modes"; -import type { DexAttrProps, StarterMoveset, StarterAttributes } from "#app/system/game-data"; -import type { StarterPreferences } from "#app/utils/data"; -import type { DexEntry } from "#app/@types/dex-data"; -import { loadStarterPreferences, saveStarterPreferences } from "#app/utils/data"; -import { AbilityAttr } from "#enums/ability-attr"; -import { DexAttr } from "#enums/dex-attr"; -import { Tutorial, handleTutorial } from "#app/tutorial"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import MessageUiHandler from "#app/ui/message-ui-handler"; -import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler"; -import { StatsContainer } from "#app/ui/stats-container"; -import { TextStyle, addBBCodeTextObject, addTextObject } from "#app/ui/text"; -import { UiMode } from "#enums/ui-mode"; -import { addWindow } from "#app/ui/ui-theme"; -import { Egg } from "#app/data/egg"; +import { starterColors } from "#app/global-vars/starter-colors"; import Overrides from "#app/overrides"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { Passive as PassiveAttr } from "#enums/passive"; -import { applyChallenges } from "#app/data/challenge"; -import { ChallengeType } from "#enums/challenge-type"; -import MoveInfoOverlay from "#app/ui/move-info-overlay"; -import { getEggTierForSpecies } from "#app/data/egg"; -import { Device } from "#enums/devices"; -import type { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { Button } from "#enums/buttons"; -import { EggSourceType } from "#enums/egg-source-types"; -import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#app/ui/dropdown"; -import { StarterContainer } from "#app/ui/starter-container"; -import { FilterBar } from "#app/ui/filter-bar"; -import { DropDownColumn } from "#enums/drop-down-column"; -import { ScrollBar } from "#app/ui/scroll-bar"; -import { AbilityId } from "#enums/ability-id"; +import { handleTutorial, Tutorial } from "#app/tutorial"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { pokemonPrevolutions } from "#balance/pokemon-evolutions"; +import type { LevelMoves } from "#balance/pokemon-level-moves"; +import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#balance/pokemon-level-moves"; import { getPassiveCandyCount, - getValueReductionCandyCounts, getSameSpeciesEggCandyCounts, -} from "#app/data/balance/starters"; + getStarterValueFriendshipCap, + getValueReductionCandyCounts, + POKERUS_STARTER_COUNT, + speciesStarterCosts, +} from "#balance/starters"; +import { applyChallenges, checkStarterValidForChallenge } from "#data/challenge"; +import { allAbilities, allMoves, allSpecies } from "#data/data-lists"; +import { Egg, getEggTierForSpecies } from "#data/egg"; +import { GrowthRate, getGrowthRateColor } from "#data/exp"; +import { Gender, getGenderColor, getGenderSymbol } from "#data/gender"; +import { getNatureName } from "#data/nature"; +import { pokemonFormChanges } from "#data/pokemon-forms"; +import type { PokemonSpecies } from "#data/pokemon-species"; +import { getPokemonSpeciesForm, getPokerusStarters } from "#data/pokemon-species"; +import { AbilityAttr } from "#enums/ability-attr"; +import { AbilityId } from "#enums/ability-id"; +import { Button } from "#enums/buttons"; +import { ChallengeType } from "#enums/challenge-type"; +import { Device } from "#enums/devices"; +import { DexAttr } from "#enums/dex-attr"; +import { DropDownColumn } from "#enums/drop-down-column"; +import { EggSourceType } from "#enums/egg-source-types"; +import { GameModes } from "#enums/game-modes"; +import type { MoveId } from "#enums/move-id"; +import type { Nature } from "#enums/nature"; +import { Passive as PassiveAttr } from "#enums/passive"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import type { CandyUpgradeNotificationChangedEvent } from "#events/battle-scene"; +import { BattleSceneEventType } from "#events/battle-scene"; +import type { Variant } from "#sprites/variant"; +import { getVariantIcon, getVariantTint } from "#sprites/variant"; +import { achvs } from "#system/achv"; +import type { DexAttrProps, StarterAttributes, StarterMoveset } from "#system/game-data"; +import { SettingKeyboard } from "#system/settings-keyboard"; +import type { DexEntry } from "#types/dex-data"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#ui/dropdown"; +import { FilterBar } from "#ui/filter-bar"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { MoveInfoOverlay } from "#ui/move-info-overlay"; +import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler"; +import { ScrollBar } from "#ui/scroll-bar"; +import { StarterContainer } from "#ui/starter-container"; +import { StatsContainer } from "#ui/stats-container"; +import { addBBCodeTextObject, addTextObject, TextStyle } from "#ui/text"; +import { addWindow } from "#ui/ui-theme"; import { BooleanHolder, fixedInt, @@ -72,12 +69,13 @@ import { randIntRange, rgbHexToRgba, toReadableString, -} from "#app/utils/common"; -import type { Nature } from "#enums/nature"; -import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; -import { achvs } from "#app/system/achv"; +} from "#utils/common"; +import type { StarterPreferences } from "#utils/data"; +import { loadStarterPreferences, saveStarterPreferences } from "#utils/data"; +import { argbFromRgba } from "@material/material-color-utilities"; +import i18next from "i18next"; import type { GameObjects } from "phaser"; -import { checkStarterValidForChallenge } from "#app/data/challenge"; +import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; export type StarterSelectCallback = (starters: Starter[]) => void; @@ -148,10 +146,10 @@ const languageSettings: { [key: string]: LanguageSetting } = { starterInfoXPos: 30, }, ja: { - starterInfoTextSize: "62px", - instructionTextSize: "38px", - starterInfoYOffset: 0.5, - starterInfoXPos: 33, + starterInfoTextSize: "48px", + instructionTextSize: "40px", + starterInfoYOffset: 1, + starterInfoXPos: 32, }, ca: { starterInfoTextSize: "48px", @@ -265,7 +263,7 @@ interface SpeciesDetails { teraType?: PokemonType; } -export default class StarterSelectUiHandler extends MessageUiHandler { +export class StarterSelectUiHandler extends MessageUiHandler { private starterSelectContainer: Phaser.GameObjects.Container; private starterSelectScrollBar: ScrollBar; private filterBarContainer: Phaser.GameObjects.Container; @@ -624,7 +622,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { }); this.starterSelectContainer.add(this.pokemonSprite); - this.pokemonNumberText = addTextObject(17, 1, "0000", TextStyle.SUMMARY); + this.pokemonNumberText = addTextObject(17, 1, "0000", TextStyle.SUMMARY_DEX_NUM); this.pokemonNumberText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonNumberText); @@ -643,7 +641,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonGrowthRateLabelText.setVisible(false); this.starterSelectContainer.add(this.pokemonGrowthRateLabelText); - this.pokemonGrowthRateText = addTextObject(34, 106, "", TextStyle.SUMMARY_PINK, { fontSize: "36px" }); + this.pokemonGrowthRateText = addTextObject(34, 106, "", TextStyle.GROWTH_RATE_TYPE, { fontSize: "36px" }); this.pokemonGrowthRateText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonGrowthRateText); @@ -743,7 +741,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonEggMoveBgs = []; this.pokemonEggMoveLabels = []; - this.valueLimitLabel = addTextObject(teamWindowX + 17, 150, "0/10", TextStyle.TOOLTIP_CONTENT); + this.valueLimitLabel = addTextObject(teamWindowX + 17, 150, "0/10", TextStyle.STARTER_VALUE_LIMIT); this.valueLimitLabel.setOrigin(0.5, 0); this.starterSelectContainer.add(this.valueLimitLabel); @@ -800,21 +798,23 @@ export default class StarterSelectUiHandler extends MessageUiHandler { starterBoxContainer.add(this.starterSelectScrollBar); - this.pokerusCursorObjs = new Array(POKERUS_STARTER_COUNT).fill(null).map(() => { + this.pokerusCursorObjs = []; + for (let i = 0; i < POKERUS_STARTER_COUNT; i++) { const cursorObj = globalScene.add.image(0, 0, "select_cursor_pokerus"); cursorObj.setVisible(false); cursorObj.setOrigin(0, 0); starterBoxContainer.add(cursorObj); - return cursorObj; - }); + this.pokerusCursorObjs.push(cursorObj); + } - this.starterCursorObjs = new Array(6).fill(null).map(() => { + this.starterCursorObjs = []; + for (let i = 0; i < 6; i++) { const cursorObj = globalScene.add.image(0, 0, "select_cursor_highlight"); cursorObj.setVisible(false); cursorObj.setOrigin(0, 0); starterBoxContainer.add(cursorObj); - return cursorObj; - }); + this.starterCursorObjs.push(cursorObj); + } this.cursorObj = globalScene.add.image(0, 0, "select_cursor"); this.cursorObj.setOrigin(0, 0); @@ -843,15 +843,16 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.starterSelectContainer.add(starterBoxContainer); - this.starterIcons = new Array(6).fill(null).map((_, i) => { + this.starterIcons = []; + for (let i = 0; i < 6; i++) { const icon = globalScene.add.sprite(teamWindowX + 7, calcStarterIconY(i), "pokemon_icons_0"); icon.setScale(0.5); icon.setOrigin(0, 0); icon.setFrame("unknown"); this.starterSelectContainer.add(icon); this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.PASSIVE); - return icon; - }); + this.starterIcons.push(icon); + } this.type1Icon = globalScene.add.sprite(8, 98, getLocalizedSpriteKey("types")); this.type1Icon.setScale(0.5); @@ -869,9 +870,15 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonLuckLabelText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonLuckLabelText); - this.pokemonLuckText = addTextObject(8 + this.pokemonLuckLabelText.displayWidth + 2, 89, "0", TextStyle.WINDOW, { - fontSize: "56px", - }); + this.pokemonLuckText = addTextObject( + 8 + this.pokemonLuckLabelText.displayWidth + 2, + 89, + "0", + TextStyle.LUCK_VALUE, + { + fontSize: "56px", + }, + ); this.pokemonLuckText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonLuckText); @@ -944,7 +951,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { const moveBg = globalScene.add.nineslice(0, 0, "type_bgs", "unknown", 92, 14, 2, 2, 2, 2); moveBg.setOrigin(1, 0); - const moveLabel = addTextObject(-moveBg.width / 2, 0, "-", TextStyle.PARTY); + const moveLabel = addTextObject(-moveBg.width / 2, 0, "-", TextStyle.MOVE_LABEL); moveLabel.setOrigin(0.5, 0); this.pokemonMoveBgs.push(moveBg); @@ -961,7 +968,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { -this.pokemonMoveBgs[0].width / 2, 56, "(+0)", - TextStyle.PARTY, + TextStyle.MOVE_LABEL, ); this.pokemonAdditionalMoveCountLabel.setOrigin(0.5, 0); @@ -983,7 +990,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { const eggMoveBg = globalScene.add.nineslice(0, 0, "type_bgs", "unknown", 92, 14, 2, 2, 2, 2); eggMoveBg.setOrigin(1, 0); - const eggMoveLabel = addTextObject(-eggMoveBg.width / 2, 0, "???", TextStyle.PARTY); + const eggMoveLabel = addTextObject(-eggMoveBg.width / 2, 0, "???", TextStyle.MOVE_LABEL); eggMoveLabel.setOrigin(0.5, 0); this.pokemonEggMoveBgs.push(eggMoveBg); @@ -1027,7 +1034,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleShiny"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.shinyLabel.setName("text-shiny-label"); @@ -1046,7 +1053,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleForm"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.formLabel.setName("text-form-label"); @@ -1065,7 +1072,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleGender"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.genderLabel.setName("text-gender-label"); @@ -1084,7 +1091,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleAbility"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.abilityLabel.setName("text-ability-label"); @@ -1103,7 +1110,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleNature"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.natureLabel.setName("text-nature-label"); @@ -1122,7 +1129,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleTera"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.teraLabel.setName("text-tera-label"); @@ -1141,7 +1148,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.filterInstructionRowX + this.instructionRowTextOffset, this.filterInstructionRowY, i18next.t("starterSelectUiHandler:goFilter"), - TextStyle.PARTY, + TextStyle.INSTRUCTIONS_TEXT, { fontSize: instructionTextSize }, ); this.goFilterLabel.setName("text-goFilter-label"); @@ -2202,14 +2209,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler { if (!(passiveAttr & PassiveAttr.UNLOCKED)) { const passiveCost = getPassiveCandyCount(speciesStarterCosts[this.lastSpecies.speciesId]); options.push({ - label: `x${passiveCost} ${i18next.t("starterSelectUiHandler:unlockPassive")}`, + label: `×${passiveCost} ${i18next.t("starterSelectUiHandler:unlockPassive")}`, handler: () => { if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= passiveCost) { starterData.passiveAttr |= PassiveAttr.UNLOCKED | PassiveAttr.ENABLED; if (!Overrides.FREE_CANDY_UPGRADE_OVERRIDE) { starterData.candyCount -= passiveCost; } - this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); + this.pokemonCandyCountText.setText(`×${starterData.candyCount}`); globalScene.gameData.saveSystem().then(success => { if (!success) { return globalScene.reset(true); @@ -2242,14 +2249,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler { valueReduction ]; options.push({ - label: `x${reductionCost} ${i18next.t("starterSelectUiHandler:reduceCost")}`, + label: `×${reductionCost} ${i18next.t("starterSelectUiHandler:reduceCost")}`, handler: () => { if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= reductionCost) { starterData.valueReduction++; if (!Overrides.FREE_CANDY_UPGRADE_OVERRIDE) { starterData.candyCount -= reductionCost; } - this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); + this.pokemonCandyCountText.setText(`×${starterData.candyCount}`); globalScene.gameData.saveSystem().then(success => { if (!success) { return globalScene.reset(true); @@ -2276,7 +2283,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { // Same species egg menu option. const sameSpeciesEggCost = getSameSpeciesEggCandyCounts(speciesStarterCosts[this.lastSpecies.speciesId]); options.push({ - label: `x${sameSpeciesEggCost} ${i18next.t("starterSelectUiHandler:sameSpeciesEgg")}`, + label: `×${sameSpeciesEggCost} ${i18next.t("starterSelectUiHandler:sameSpeciesEgg")}`, handler: () => { if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= sameSpeciesEggCost) { if (globalScene.gameData.eggs.length >= 99 && !Overrides.UNLIMITED_EGG_COUNT_OVERRIDE) { @@ -2295,7 +2302,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { if (!Overrides.FREE_CANDY_UPGRADE_OVERRIDE) { starterData.candyCount -= sameSpeciesEggCost; } - this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); + this.pokemonCandyCountText.setText(`×${starterData.candyCount}`); const egg = new Egg({ species: this.lastSpecies.speciesId, @@ -3564,7 +3571,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonShinyIcon.setY(117); this.pokemonCandyIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[0]))); this.pokemonCandyOverlayIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[1]))); - this.pokemonCandyCountText.setText(`x${globalScene.gameData.starterData[species.speciesId].candyCount}`); + this.pokemonCandyCountText.setText(`×${globalScene.gameData.starterData[species.speciesId].candyCount}`); this.pokemonCandyContainer.setVisible(true); this.pokemonFormText.setY(42); this.pokemonHatchedIcon.setVisible(true); @@ -3818,9 +3825,11 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default? - this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false)); + this.pokemonNumberText.setColor( + this.getTextColor(shiny ? TextStyle.SUMMARY_DEX_NUM_GOLD : TextStyle.SUMMARY_DEX_NUM, false), + ); this.pokemonNumberText.setShadowColor( - this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, true), + this.getTextColor(shiny ? TextStyle.SUMMARY_DEX_NUM_GOLD : TextStyle.SUMMARY_DEX_NUM, true), ); if (forSeen ? this.speciesStarterDexEntry?.seenAttr : this.speciesStarterDexEntry?.caughtAttr) { diff --git a/src/ui/stats-container.ts b/src/ui/stats-container.ts index 8cc74e64e96..6b89e80b80a 100644 --- a/src/ui/stats-container.ts +++ b/src/ui/stats-container.ts @@ -1,8 +1,8 @@ -import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; -import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text"; -import { PERMANENT_STATS, getStatKey } from "#app/enums/stat"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; +import { getStatKey, PERMANENT_STATS } from "#enums/stat"; +import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text"; +import i18next from "i18next"; +import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; const ivChartSize = 24; const ivChartStatCoordMultipliers = [ @@ -19,7 +19,7 @@ const ivLabelOffset = [0, sideLabelOffset, -sideLabelOffset, sideLabelOffset, -s const ivChartLabelyOffset = [0, 5, 0, 5, 0, 0]; // doing this so attack does not overlap with (+N) const ivChartStatIndexes = [0, 1, 2, 5, 4, 3]; // swap special attack and speed -const defaultIvChartData = new Array(12).fill(null).map(() => 0); +const defaultIvChartData: number[] = new Array(12).fill(0); export class StatsContainer extends Phaser.GameObjects.Container { private showDiff: boolean; @@ -86,7 +86,7 @@ export class StatsContainer extends Phaser.GameObjects.Container { 4 + (this.showDiff ? 0 : ivChartLabelyOffset[s]), i18next.t(getStatKey(s)), - TextStyle.TOOLTIP_CONTENT, + TextStyle.STATS_HEXAGON, ); statLabel.setOrigin(0.5); @@ -94,7 +94,7 @@ export class StatsContainer extends Phaser.GameObjects.Container { statLabel.x - (this.showDiff ? 0 : ivLabelOffset[s]), statLabel.y + 8, "0", - TextStyle.TOOLTIP_CONTENT, + TextStyle.STATS_HEXAGON, ); this.ivStatValueTexts[s].setOrigin(0.5); @@ -147,7 +147,7 @@ export class StatsContainer extends Phaser.GameObjects.Container { duration: 1000, ease: "Cubic.easeOut", onUpdate: (tween: Phaser.Tweens.Tween) => { - const progress = tween.getValue(); + const progress = tween.getValue() ?? 1; const interpolatedData = ivChartData.map( (v: number, i: number) => v * progress + lastIvChartData[i] * (1 - progress), ); diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index f108faf1646..da0a7f9a40f 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -1,45 +1,44 @@ -import { starterColors } from "#app/global-vars/starter-colors"; -import { globalScene } from "#app/global-scene"; -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "#app/ui/ui-handler"; -import { - getLocalizedSpriteKey, - rgbHexToRgba, - padInt, - getEnumValues, - fixedInt, - isNullOrUndefined, - toReadableString, - formatStat, - getShinyDescriptor, -} from "#app/utils/common"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters"; -import { argbFromRgba } from "@material/material-color-utilities"; -import { getTypeRgb } from "#app/data/type"; -import { PokemonType } from "#enums/pokemon-type"; -import { TextStyle, addBBCodeTextObject, addTextObject, getBBCodeFrag } from "#app/ui/text"; -import type Move from "#app/data/moves/move"; -import { MoveCategory } from "#enums/MoveCategory"; -import { getPokeballAtlasKey } from "#app/data/pokeball"; -import { getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { getLevelRelExp, getLevelTotalExp } from "#app/data/exp"; -import { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { StatusEffect } from "#enums/status-effect"; -import { getBiomeName } from "#app/data/balance/biomes"; -import { getNatureName, getNatureStatMultiplier } from "#app/data/nature"; +import type { Ability } from "#abilities/ability"; import { loggedInUser } from "#app/account"; -import type { Variant } from "#app/sprites/variant"; -import { getVariantTint } from "#app/sprites/variant"; +import { globalScene } from "#app/global-scene"; +import { starterColors } from "#app/global-vars/starter-colors"; +import { getBiomeName } from "#balance/biomes"; +import { getStarterValueFriendshipCap, speciesStarterCosts } from "#balance/starters"; +import { getLevelRelExp, getLevelTotalExp } from "#data/exp"; +import { getGenderColor, getGenderSymbol } from "#data/gender"; +import { getNatureName, getNatureStatMultiplier } from "#data/nature"; +import { getPokeballAtlasKey } from "#data/pokeball"; +import { getTypeRgb } from "#data/type"; import { Button } from "#enums/buttons"; -import type { Ability } from "#app/data/abilities/ability"; -import i18next from "i18next"; -import { modifierSortFunc } from "#app/modifier/modifier"; -import { PlayerGender } from "#enums/player-gender"; -import { Stat, PERMANENT_STATS, getStatKey } from "#enums/stat"; +import { MoveCategory } from "#enums/MoveCategory"; import { Nature } from "#enums/nature"; -import { achvs } from "#app/system/achv"; +import { PlayerGender } from "#enums/player-gender"; +import { PokemonType } from "#enums/pokemon-type"; +import { getStatKey, PERMANENT_STATS, Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon } from "#field/pokemon"; +import { modifierSortFunc, PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { Move } from "#moves/move"; +import type { PokemonMove } from "#moves/pokemon-move"; +import type { Variant } from "#sprites/variant"; +import { getVariantTint } from "#sprites/variant"; +import { achvs } from "#system/achv"; +import { addBBCodeTextObject, addTextObject, getBBCodeFrag, TextStyle } from "#ui/text"; +import { UiHandler } from "#ui/ui-handler"; +import { + fixedInt, + formatStat, + getLocalizedSpriteKey, + getShinyDescriptor, + isNullOrUndefined, + padInt, + rgbHexToRgba, + toReadableString, +} from "#utils/common"; +import { getEnumValues } from "#utils/enums"; +import { argbFromRgba } from "@material/material-color-utilities"; +import i18next from "i18next"; enum Page { PROFILE, @@ -64,7 +63,7 @@ interface abilityContainer { descriptionText: Phaser.GameObjects.Text | null; } -export default class SummaryUiHandler extends UiHandler { +export class SummaryUiHandler extends UiHandler { private summaryUiMode: SummaryUiMode; private summaryContainer: Phaser.GameObjects.Container; @@ -148,7 +147,7 @@ export default class SummaryUiHandler extends UiHandler { this.tabSprite.setOrigin(1, 1); this.summaryContainer.add(this.tabSprite); - const summaryLabel = addTextObject(4, -165, i18next.t("pokemonSummary:pokemonInfo"), TextStyle.SUMMARY); + const summaryLabel = addTextObject(4, -165, i18next.t("pokemonSummary:pokemonInfo"), TextStyle.SUMMARY_HEADER); summaryLabel.setOrigin(0, 1); this.summaryContainer.add(summaryLabel); @@ -418,7 +417,7 @@ export default class SummaryUiHandler extends UiHandler { } this.candyCountText.setText( - `x${globalScene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].candyCount}`, + `×${globalScene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].candyCount}`, ); this.candyShadow.setCrop(0, 0, 16, candyCropY); @@ -430,7 +429,7 @@ export default class SummaryUiHandler extends UiHandler { this.friendshipShadow.on("pointerout", () => globalScene.ui.hideTooltip()); } - this.friendshipText.setText(`${this.pokemon?.friendship || "0"} / 255`); + this.friendshipText.setText(` ${this.pokemon?.friendship || "0"}/255`); this.friendshipShadow.setCrop(0, 0, 16, 16 - 16 * ((this.pokemon?.friendship || 0) / 255)); @@ -864,7 +863,7 @@ export default class SummaryUiHandler extends UiHandler { 141 + luckLabelText.displayWidth + 2, 28, this.pokemon.getLuck().toString(), - TextStyle.SUMMARY, + TextStyle.LUCK_VALUE, ); luckText.setOrigin(0, 0); luckText.setTint(getVariantTint(Math.min(this.pokemon.getLuck() - 1, 2) as Variant)); @@ -917,11 +916,11 @@ export default class SummaryUiHandler extends UiHandler { abilityInfo.labelImage.setOrigin(0, 0); profileContainer.add(abilityInfo.labelImage); - abilityInfo.nameText = addTextObject(7, 66, abilityInfo.ability?.name!, TextStyle.SUMMARY_ALT); // TODO: is this bang correct? + abilityInfo.nameText = addTextObject(7, 68, abilityInfo.ability?.name!, TextStyle.SUMMARY_ALT); // TODO: is this bang correct? abilityInfo.nameText.setOrigin(0, 1); profileContainer.add(abilityInfo.nameText); - abilityInfo.descriptionText = addTextObject(7, 69, abilityInfo.ability?.description!, TextStyle.WINDOW_ALT, { + abilityInfo.descriptionText = addTextObject(7, 71, abilityInfo.ability?.description!, TextStyle.WINDOW_ALT, { wordWrap: { width: 1224 }, }); // TODO: is this bang correct? abilityInfo.descriptionText.setOrigin(0, 0); @@ -1000,16 +999,16 @@ export default class SummaryUiHandler extends UiHandler { 16 * rowIndex, statName, natureStatMultiplier === 1 - ? TextStyle.SUMMARY + ? TextStyle.SUMMARY_STATS : natureStatMultiplier > 1 - ? TextStyle.SUMMARY_PINK - : TextStyle.SUMMARY_BLUE, + ? TextStyle.SUMMARY_STATS_PINK + : TextStyle.SUMMARY_STATS_BLUE, ); const ivLabel = addTextObject( 115 * colIndex + (colIndex === 1 ? 5 : 0), 16 * rowIndex, statName, - this.pokemon?.ivs[stat] === 31 ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, + this.pokemon?.ivs[stat] === 31 ? TextStyle.SUMMARY_STATS_GOLD : TextStyle.SUMMARY_STATS, ); statLabel.setOrigin(0.5, 0); diff --git a/src/ui/target-select-ui-handler.ts b/src/ui/target-select-ui-handler.ts index 8106e4de2da..5ea89929cda 100644 --- a/src/ui/target-select-ui-handler.ts +++ b/src/ui/target-select-ui-handler.ts @@ -1,18 +1,18 @@ +import { globalScene } from "#app/global-scene"; +import { SubstituteTag } from "#data/battler-tags"; import { BattlerIndex } from "#enums/battler-index"; -import { UiMode } from "#enums/ui-mode"; -import UiHandler from "./ui-handler"; -import { isNullOrUndefined, fixedInt } from "#app/utils/common"; -import { getMoveTargets } from "#app/data/moves/move-utils"; import { Button } from "#enums/buttons"; import type { MoveId } from "#enums/move-id"; -import type Pokemon from "#app/field/pokemon"; -import type { ModifierBar } from "#app/modifier/modifier"; -import { SubstituteTag } from "#app/data/battler-tags"; -import { globalScene } from "#app/global-scene"; +import { UiMode } from "#enums/ui-mode"; +import type { Pokemon } from "#field/pokemon"; +import type { ModifierBar } from "#modifiers/modifier"; +import { getMoveTargets } from "#moves/move-utils"; +import { UiHandler } from "#ui/ui-handler"; +import { fixedInt, isNullOrUndefined } from "#utils/common"; export type TargetSelectCallback = (targets: BattlerIndex[]) => void; -export default class TargetSelectUiHandler extends UiHandler { +export class TargetSelectUiHandler extends UiHandler { private fieldIndex: number; private move: MoveId; private targetSelectCallback: TargetSelectCallback; @@ -157,8 +157,8 @@ export default class TargetSelectUiHandler extends UiHandler { yoyo: true, onUpdate: t => { for (const target of this.targetsHighlighted) { - target.setAlpha(t.getValue()); - this.highlightItems(target.id, t.getValue()); + target.setAlpha(t.getValue() ?? 1); + this.highlightItems(target.id, t.getValue() ?? 1); } }, }); diff --git a/src/ui/test-dialogue-ui-handler.ts b/src/ui/test-dialogue-ui-handler.ts index b1e5047955a..c57c73ca777 100644 --- a/src/ui/test-dialogue-ui-handler.ts +++ b/src/ui/test-dialogue-ui-handler.ts @@ -1,13 +1,13 @@ -import type { InputFieldConfig } from "./form-modal-ui-handler"; -import { FormModalUiHandler } from "./form-modal-ui-handler"; -import type { ModalConfig } from "./modal-ui-handler"; -import i18next from "i18next"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { OptionSelectItem } from "./abstact-option-select-ui-handler"; -import { isNullOrUndefined } from "#app/utils/common"; import { UiMode } from "#enums/ui-mode"; +import type { PlayerPokemon } from "#field/pokemon"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import type { InputFieldConfig } from "#ui/form-modal-ui-handler"; +import { FormModalUiHandler } from "#ui/form-modal-ui-handler"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { isNullOrUndefined } from "#utils/common"; +import i18next from "i18next"; -export default class TestDialogueUiHandler extends FormModalUiHandler { +export class TestDialogueUiHandler extends FormModalUiHandler { keys: string[]; setup() { diff --git a/src/ui/text.ts b/src/ui/text.ts index 76c85bac5cf..b2a1894c85c 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -1,37 +1,58 @@ +import { globalScene } from "#app/global-scene"; import { EggTier } from "#enums/egg-type"; +import { ModifierTier } from "#enums/modifier-tier"; import { UiTheme } from "#enums/ui-theme"; +import i18next from "#plugins/i18n"; import type Phaser from "phaser"; import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; -import InputText from "phaser3-rex-plugins/plugins/inputtext"; -import { globalScene } from "#app/global-scene"; -import { ModifierTier } from "../enums/modifier-tier"; -import i18next from "#app/plugins/i18n"; +import type InputText from "phaser3-rex-plugins/plugins/inputtext"; export enum TextStyle { MESSAGE, WINDOW, WINDOW_ALT, + WINDOW_BATTLE_COMMAND, BATTLE_INFO, PARTY, PARTY_RED, + PARTY_CANCEL_BUTTON, + INSTRUCTIONS_TEXT, + MOVE_LABEL, SUMMARY, + SUMMARY_DEX_NUM, + SUMMARY_DEX_NUM_GOLD, SUMMARY_ALT, + SUMMARY_HEADER, SUMMARY_RED, SUMMARY_BLUE, SUMMARY_PINK, SUMMARY_GOLD, SUMMARY_GRAY, SUMMARY_GREEN, + SUMMARY_STATS, + SUMMARY_STATS_BLUE, + SUMMARY_STATS_PINK, + SUMMARY_STATS_GOLD, + LUCK_VALUE, + STATS_HEXAGON, + GROWTH_RATE_TYPE, MONEY, // Money default styling (pale yellow) MONEY_WINDOW, // Money displayed in Windows (needs different colors based on theme) + HEADER_LABEL, STATS_LABEL, STATS_VALUE, SETTINGS_VALUE, SETTINGS_LABEL, + SETTINGS_LABEL_NAVBAR, SETTINGS_SELECTED, SETTINGS_LOCKED, + EGG_LIST, + EGG_SUMMARY_NAME, + EGG_SUMMARY_DEX, + STARTER_VALUE_LIMIT, TOOLTIP_TITLE, TOOLTIP_CONTENT, + FILTER_BAR_MAIN, MOVE_INFO_CONTENT, MOVE_PP_FULL, MOVE_PP_HALF_FULL, @@ -73,10 +94,6 @@ export function addTextObject( ret.setLineSpacing(scale * 30); } - if (ret.lineSpacing < 12 && i18next.resolvedLanguage === "ja") { - ret.setLineSpacing(ret.lineSpacing + 35); - } - return ret; } @@ -122,10 +139,6 @@ export function addBBCodeTextObject( ret.setLineSpacing(scale * 60); } - if (ret.lineSpacing < 12 && i18next.resolvedLanguage === "ja") { - ret.setLineSpacing(ret.lineSpacing + 35); - } - return ret; } @@ -139,8 +152,7 @@ export function addTextInputObject( ): InputText { const { scale, styleOptions } = getTextStyleOptions(style, globalScene.uiTheme, extraStyleOptions); - const ret = new InputText(globalScene, x, y, width, height, styleOptions as InputText.IConfig); - globalScene.add.existing(ret); + const ret = globalScene.add.rexInputText(x, y, width, height, styleOptions as InputText.IConfig); ret.setScale(scale); return ret; @@ -154,7 +166,7 @@ export function getTextStyleOptions( const lang = i18next.resolvedLanguage; let shadowXpos = 4; let shadowYpos = 5; - let scale = 0.1666666667; + const scale = 0.1666666667; const defaultFontSize = 96; let styleOptions: Phaser.Types.GameObjects.Text.TextStyle = { @@ -166,13 +178,58 @@ export function getTextStyleOptions( }, }; - if (i18next.resolvedLanguage === "ja") { - scale = 0.1388888889; - styleOptions.padding = { top: 2, bottom: 4 }; - } - switch (style) { - case TextStyle.SUMMARY: + case TextStyle.SUMMARY: { + const fontSizeLabel = "96px"; + switch (lang) { + case "ja": + styleOptions.padding = { top: 6, bottom: 4 }; + break; + } + styleOptions.fontSize = fontSizeLabel; + break; + } + // shadowXpos = 5; + // shadowYpos = 5; + // break; + case TextStyle.SUMMARY_HEADER: { + let fontSizeLabel = "96px"; + switch (lang) { + case "ja": + styleOptions.padding = { bottom: 7 }; + fontSizeLabel = "80px"; + break; + } + styleOptions.fontSize = fontSizeLabel; + break; + } + // shadowXpos = 5; + // shadowYpos = 5; + // break; + case TextStyle.SUMMARY_DEX_NUM: { + const fontSizeLabel = "96px"; + switch (lang) { + case "ja": + styleOptions.padding = { top: 2, bottom: 10 }; + break; + } + styleOptions.fontSize = fontSizeLabel; + shadowXpos = 5; + shadowYpos = 5; + break; + } + case TextStyle.SUMMARY_DEX_NUM_GOLD: { + const fontSizeLabel = "96px"; + switch (lang) { + case "ja": + styleOptions.padding = { top: 2, bottom: 10 }; + break; + } + styleOptions.fontSize = fontSizeLabel; + shadowXpos = 5; + shadowYpos = 5; + break; + } case TextStyle.SUMMARY_ALT: case TextStyle.SUMMARY_BLUE: case TextStyle.SUMMARY_RED: @@ -180,6 +237,10 @@ export function getTextStyleOptions( case TextStyle.SUMMARY_GOLD: case TextStyle.SUMMARY_GRAY: case TextStyle.SUMMARY_GREEN: + case TextStyle.SUMMARY_STATS: + case TextStyle.SUMMARY_STATS_BLUE: + case TextStyle.SUMMARY_STATS_PINK: + case TextStyle.SUMMARY_STATS_GOLD: case TextStyle.WINDOW: case TextStyle.WINDOW_ALT: case TextStyle.ME_OPTION_DEFAULT: @@ -187,6 +248,43 @@ export function getTextStyleOptions( shadowXpos = 3; shadowYpos = 3; break; + case TextStyle.LUCK_VALUE: { + const fontSizeLabel = "96px"; + switch (lang) { + case "ja": + styleOptions.padding = { top: -6, bottom: 2 }; + break; + } + styleOptions.fontSize = fontSizeLabel; + shadowXpos = 3; + shadowYpos = 4; + break; + } + case TextStyle.GROWTH_RATE_TYPE: { + switch (lang) { + case "ja": + styleOptions.padding = { left: 24 }; + break; + } + styleOptions.fontSize = defaultFontSize - 30; + shadowXpos = 3; + shadowYpos = 3; + break; + } + case TextStyle.WINDOW_BATTLE_COMMAND: { + let fontSizeLabel = "96px"; + switch (lang) { + case "ja": + styleOptions.padding = { top: 2 }; + fontSizeLabel = "92px"; + break; + } + styleOptions.fontSize = fontSizeLabel; + break; + } + // shadowXpos = 5; + // shadowYpos = 5; + // break; case TextStyle.STATS_LABEL: { let fontSizeLabel = "96px"; switch (lang) { @@ -218,10 +316,80 @@ export function getTextStyleOptions( break; } case TextStyle.MESSAGE: - case TextStyle.SETTINGS_LABEL: - case TextStyle.SETTINGS_LOCKED: - case TextStyle.SETTINGS_SELECTED: + styleOptions.fontSize = defaultFontSize; break; + case TextStyle.HEADER_LABEL: { + switch (lang) { + case "ja": + styleOptions.padding = { top: 6 }; + break; + } + break; + } + case TextStyle.SETTINGS_VALUE: + case TextStyle.SETTINGS_LABEL: { + shadowXpos = 3; + shadowYpos = 3; + let fontSizeValue = "96px"; + switch (lang) { + case "ja": + fontSizeValue = "80px"; + styleOptions.padding = { top: 10 }; + break; + default: + fontSizeValue = "96px"; + break; + } + styleOptions.fontSize = fontSizeValue; + break; + } + case TextStyle.SETTINGS_LABEL_NAVBAR: { + shadowXpos = 3; + shadowYpos = 3; + let fontSizeValue = "96px"; + switch (lang) { + case "ja": + fontSizeValue = "92px"; + break; + default: + fontSizeValue = "96px"; + break; + } + styleOptions.fontSize = fontSizeValue; + break; + } + case TextStyle.SETTINGS_LOCKED: { + shadowXpos = 3; + shadowYpos = 3; + let fontSizeValue = "96px"; + switch (lang) { + case "ja": + fontSizeValue = "80px"; + styleOptions.padding = { top: 10 }; + break; + default: + fontSizeValue = "96px"; + break; + } + styleOptions.fontSize = fontSizeValue; + break; + } + case TextStyle.SETTINGS_SELECTED: { + shadowXpos = 3; + shadowYpos = 3; + let fontSizeValue = "96px"; + switch (lang) { + case "ja": + fontSizeValue = "80px"; + styleOptions.padding = { top: 10 }; + break; + default: + fontSizeValue = "96px"; + break; + } + styleOptions.fontSize = fontSizeValue; + break; + } case TextStyle.BATTLE_INFO: case TextStyle.MONEY: case TextStyle.MONEY_WINDOW: @@ -231,11 +399,108 @@ export function getTextStyleOptions( shadowYpos = 3.5; break; case TextStyle.PARTY: - case TextStyle.PARTY_RED: + case TextStyle.PARTY_RED: { + switch (lang) { + case "ja": + styleOptions.padding = { top: -12, bottom: 4 }; + break; + } styleOptions.fontSize = defaultFontSize - 30; styleOptions.fontFamily = "pkmnems"; break; - case TextStyle.TOOLTIP_CONTENT: + } + case TextStyle.PARTY_CANCEL_BUTTON: { + switch (lang) { + case "ja": + styleOptions.fontSize = defaultFontSize - 42; + styleOptions.padding = { top: 4 }; + break; + default: + styleOptions.fontSize = defaultFontSize - 30; + styleOptions.padding = { left: 12 }; + break; + } + styleOptions.fontFamily = "pkmnems"; + break; + } + case TextStyle.INSTRUCTIONS_TEXT: { + switch (lang) { + case "ja": + styleOptions.padding = { top: -3, bottom: 4 }; + break; + } + styleOptions.fontSize = defaultFontSize - 30; + styleOptions.fontFamily = "pkmnems"; + shadowXpos = 3; + shadowYpos = 3; + break; + } + case TextStyle.MOVE_LABEL: { + switch (lang) { + case "ja": + styleOptions.fontSize = defaultFontSize - 16; + styleOptions.padding = { top: -14, bottom: 8 }; + break; + default: + styleOptions.fontSize = defaultFontSize - 30; + break; + } + styleOptions.fontFamily = "pkmnems"; + break; + } + case TextStyle.EGG_LIST: + styleOptions.fontSize = defaultFontSize - 34; + break; + case TextStyle.EGG_SUMMARY_NAME: { + switch (lang) { + case "ja": + styleOptions.padding = { top: -1 }; + break; + } + break; + } + case TextStyle.EGG_SUMMARY_DEX: { + switch (lang) { + case "ja": + styleOptions.padding = { top: 2 }; + break; + } + break; + } + case TextStyle.STARTER_VALUE_LIMIT: + styleOptions.fontSize = defaultFontSize - 36; + shadowXpos = 3; + shadowYpos = 3; + break; + case TextStyle.TOOLTIP_CONTENT: { + switch (lang) { + case "ja": + styleOptions.fontSize = defaultFontSize - 44; + styleOptions.padding = { top: 10, right: 10 }; + break; + default: + styleOptions.fontSize = defaultFontSize - 32; + break; + } + shadowXpos = 3; + shadowYpos = 3; + break; + } + case TextStyle.FILTER_BAR_MAIN: { + switch (lang) { + case "ja": + styleOptions.fontSize = defaultFontSize - 48; + styleOptions.padding = { top: 10, right: 10 }; + break; + default: + styleOptions.fontSize = defaultFontSize - 32; + break; + } + shadowXpos = 3; + shadowYpos = 3; + break; + } + case TextStyle.STATS_HEXAGON: styleOptions.fontSize = defaultFontSize - 32; shadowXpos = 3; shadowYpos = 3; @@ -330,9 +595,14 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean, uiTheme: Ui case TextStyle.MESSAGE: return !shadow ? "#f8f8f8" : "#6b5a73"; case TextStyle.WINDOW: + case TextStyle.WINDOW_BATTLE_COMMAND: case TextStyle.MOVE_INFO_CONTENT: + case TextStyle.STATS_HEXAGON: case TextStyle.MOVE_PP_FULL: + case TextStyle.EGG_LIST: case TextStyle.TOOLTIP_CONTENT: + case TextStyle.FILTER_BAR_MAIN: + case TextStyle.STARTER_VALUE_LIMIT: case TextStyle.SETTINGS_VALUE: if (isLegacyTheme) { return !shadow ? "#484848" : "#d0d0c8"; @@ -361,12 +631,22 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean, uiTheme: Ui } return !shadow ? "#f8f8f8" : "#6b5a73"; case TextStyle.PARTY: + case TextStyle.PARTY_CANCEL_BUTTON: + case TextStyle.INSTRUCTIONS_TEXT: + case TextStyle.MOVE_LABEL: return !shadow ? "#f8f8f8" : "#707070"; case TextStyle.PARTY_RED: return !shadow ? "#f89890" : "#984038"; case TextStyle.SUMMARY: + case TextStyle.SUMMARY_DEX_NUM: + case TextStyle.SUMMARY_HEADER: + case TextStyle.SUMMARY_STATS: + case TextStyle.EGG_SUMMARY_NAME: + case TextStyle.EGG_SUMMARY_DEX: + case TextStyle.LUCK_VALUE: return !shadow ? "#f8f8f8" : "#636363"; case TextStyle.SUMMARY_ALT: + case TextStyle.GROWTH_RATE_TYPE: if (isLegacyTheme) { return !shadow ? "#f8f8f8" : "#636363"; } @@ -375,10 +655,14 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean, uiTheme: Ui case TextStyle.TOOLTIP_TITLE: return !shadow ? "#e70808" : "#ffbd73"; case TextStyle.SUMMARY_BLUE: + case TextStyle.SUMMARY_STATS_BLUE: return !shadow ? "#40c8f8" : "#006090"; case TextStyle.SUMMARY_PINK: + case TextStyle.SUMMARY_STATS_PINK: return !shadow ? "#f89890" : "#984038"; case TextStyle.SUMMARY_GOLD: + case TextStyle.SUMMARY_DEX_NUM_GOLD: + case TextStyle.SUMMARY_STATS_GOLD: case TextStyle.MONEY: return !shadow ? "#e8e8a8" : "#a0a060"; // Pale Yellow/Gold case TextStyle.MONEY_WINDOW: @@ -399,6 +683,8 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean, uiTheme: Ui case TextStyle.SUMMARY_GREEN: return !shadow ? "#78c850" : "#306850"; case TextStyle.SETTINGS_LABEL: + case TextStyle.SETTINGS_LABEL_NAVBAR: + case TextStyle.HEADER_LABEL: case TextStyle.PERFECT_IV: return !shadow ? "#f8b050" : "#c07800"; case TextStyle.SETTINGS_SELECTED: diff --git a/src/ui/time-of-day-widget.ts b/src/ui/time-of-day-widget.ts index 5f5116a2da0..6deaf1405d7 100644 --- a/src/ui/time-of-day-widget.ts +++ b/src/ui/time-of-day-widget.ts @@ -1,11 +1,11 @@ -import { fixedInt } from "#app/utils/common"; import { globalScene } from "#app/global-scene"; -import { BattleSceneEventType } from "../events/battle-scene"; import { EaseType } from "#enums/ease-type"; import { TimeOfDay } from "#enums/time-of-day"; +import { BattleSceneEventType } from "#events/battle-scene"; +import { fixedInt } from "#utils/common"; /** A small self contained UI element that displays the time of day as an icon */ -export default class TimeOfDayWidget extends Phaser.GameObjects.Container { +export class TimeOfDayWidget extends Phaser.GameObjects.Container { /** The {@linkcode Phaser.GameObjects.Sprite} that represents the foreground of the current time of day */ private readonly timeOfDayIconFgs: Phaser.GameObjects.Sprite[] = new Array(2); /** The {@linkcode Phaser.GameObjects.Sprite} that represents the middle-ground of the current time of day */ diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index 50e77bbdd14..b7c37538a3e 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -1,19 +1,19 @@ -import OptionSelectUiHandler from "./settings/option-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { fixedInt, randInt, randItem } from "#app/utils/common"; -import { TextStyle, addTextObject } from "./text"; -import { getSplashMessages } from "../data/splash-messages"; -import i18next from "i18next"; -import { TimedEventDisplay } from "#app/timed-event-manager"; -import { version } from "../../package.json"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import { globalScene } from "#app/global-scene"; -import type { SpeciesId } from "#enums/species-id"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { PlayerGender } from "#enums/player-gender"; +import { pokerogueApi } from "#api/pokerogue-api"; import { timedEventManager } from "#app/global-event-manager"; +import { globalScene } from "#app/global-scene"; +import { TimedEventDisplay } from "#app/timed-event-manager"; +import { getSplashMessages } from "#data/splash-messages"; +import { PlayerGender } from "#enums/player-gender"; +import type { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { version } from "#package.json"; +import { OptionSelectUiHandler } from "#ui/option-select-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { fixedInt, randInt, randItem } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import i18next from "i18next"; -export default class TitleUiHandler extends OptionSelectUiHandler { +export class TitleUiHandler extends OptionSelectUiHandler { /** If the stats can not be retrieved, use this fallback value */ private static readonly BATTLES_WON_FALLBACK: number = -1; diff --git a/src/ui/ui-handler.ts b/src/ui/ui-handler.ts index d3784c1225c..c7b25c90205 100644 --- a/src/ui/ui-handler.ts +++ b/src/ui/ui-handler.ts @@ -1,13 +1,13 @@ import { globalScene } from "#app/global-scene"; -import type { TextStyle } from "./text"; -import { getTextColor } from "./text"; -import type { UiMode } from "#enums/ui-mode"; import type { Button } from "#enums/buttons"; +import type { UiMode } from "#enums/ui-mode"; +import type { TextStyle } from "#ui/text"; +import { getTextColor } from "#ui/text"; /** * A basic abstract class to act as a holder and processor for UI elements. */ -export default abstract class UiHandler { +export abstract class UiHandler { protected mode: number | null; protected cursor = 0; public active = false; diff --git a/src/ui/ui-theme.ts b/src/ui/ui-theme.ts index c3931aea23b..f2d434c024a 100644 --- a/src/ui/ui-theme.ts +++ b/src/ui/ui-theme.ts @@ -1,6 +1,6 @@ -import { UiTheme } from "#enums/ui-theme"; -import { legacyCompatibleImages } from "#app/scene-base"; import { globalScene } from "#app/global-scene"; +import { legacyCompatibleImages } from "#app/scene-base"; +import { UiTheme } from "#enums/ui-theme"; export enum WindowVariant { NORMAL, diff --git a/src/ui/ui.ts b/src/ui/ui.ts index ad496df6382..394409bcb9d 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -1,63 +1,63 @@ import { globalScene } from "#app/global-scene"; -import type UiHandler from "./ui-handler"; -import BattleMessageUiHandler from "./battle-message-ui-handler"; -import CommandUiHandler from "./command-ui-handler"; -import PartyUiHandler from "./party-ui-handler"; -import FightUiHandler from "./fight-ui-handler"; -import MessageUiHandler from "./message-ui-handler"; -import ConfirmUiHandler from "./confirm-ui-handler"; -import ModifierSelectUiHandler from "./modifier-select-ui-handler"; -import BallUiHandler from "./ball-ui-handler"; -import SummaryUiHandler from "./summary-ui-handler"; -import StarterSelectUiHandler from "./starter-select-ui-handler"; -import EvolutionSceneHandler from "./evolution-scene-handler"; -import TargetSelectUiHandler from "./target-select-ui-handler"; -import SettingsUiHandler from "./settings/settings-ui-handler"; -import SettingsGamepadUiHandler from "./settings/settings-gamepad-ui-handler"; -import GameChallengesUiHandler from "./challenges-select-ui-handler"; -import { TextStyle, addTextObject } from "./text"; -import AchvBar from "./achv-bar"; -import MenuUiHandler from "./menu-ui-handler"; -import AchvsUiHandler from "./achvs-ui-handler"; -import OptionSelectUiHandler from "./settings/option-select-ui-handler"; -import EggHatchSceneHandler from "./egg-hatch-scene-handler"; -import EggListUiHandler from "./egg-list-ui-handler"; -import EggGachaUiHandler from "./egg-gacha-ui-handler"; -import PokedexUiHandler from "./pokedex-ui-handler"; -import { addWindow } from "./ui-theme"; -import LoginFormUiHandler from "./login-form-ui-handler"; -import RegistrationFormUiHandler from "./registration-form-ui-handler"; -import LoadingModalUiHandler from "./loading-modal-ui-handler"; -import { executeIf } from "#app/utils/common"; -import GameStatsUiHandler from "./game-stats-ui-handler"; -import AwaitableUiHandler from "./awaitable-ui-handler"; -import SaveSlotSelectUiHandler from "./save-slot-select-ui-handler"; -import TitleUiHandler from "./title-ui-handler"; -import SavingIconHandler from "./saving-icon-handler"; -import UnavailableModalUiHandler from "./unavailable-modal-ui-handler"; -import SessionReloadModalUiHandler from "./session-reload-modal-ui-handler"; import type { Button } from "#enums/buttons"; -import i18next from "i18next"; -import GamepadBindingUiHandler from "./settings/gamepad-binding-ui-handler"; -import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; -import KeyboardBindingUiHandler from "#app/ui/settings/keyboard-binding-ui-handler"; -import SettingsDisplayUiHandler from "./settings/settings-display-ui-handler"; -import SettingsAudioUiHandler from "./settings/settings-audio-ui-handler"; -import { PlayerGender } from "#enums/player-gender"; -import type BgmBar from "#app/ui/bgm-bar"; -import RenameFormUiHandler from "./rename-form-ui-handler"; -import AdminUiHandler from "./admin-ui-handler"; -import RunHistoryUiHandler from "./run-history-ui-handler"; -import RunInfoUiHandler from "./run-info-ui-handler"; -import EggSummaryUiHandler from "./egg-summary-ui-handler"; -import TestDialogueUiHandler from "#app/ui/test-dialogue-ui-handler"; -import AutoCompleteUiHandler from "./autocomplete-ui-handler"; import { Device } from "#enums/devices"; -import MysteryEncounterUiHandler from "./mystery-encounter-ui-handler"; -import PokedexScanUiHandler from "./pokedex-scan-ui-handler"; -import PokedexPageUiHandler from "./pokedex-page-ui-handler"; -import { NavigationManager } from "./settings/navigationMenu"; +import { PlayerGender } from "#enums/player-gender"; import { UiMode } from "#enums/ui-mode"; +import { AchvBar } from "#ui/achv-bar"; +import { AchvsUiHandler } from "#ui/achvs-ui-handler"; +import { AdminUiHandler } from "#ui/admin-ui-handler"; +import { AutoCompleteUiHandler } from "#ui/autocomplete-ui-handler"; +import { AwaitableUiHandler } from "#ui/awaitable-ui-handler"; +import { BallUiHandler } from "#ui/ball-ui-handler"; +import { BattleMessageUiHandler } from "#ui/battle-message-ui-handler"; +import type { BgmBar } from "#ui/bgm-bar"; +import { GameChallengesUiHandler } from "#ui/challenges-select-ui-handler"; +import { CommandUiHandler } from "#ui/command-ui-handler"; +import { ConfirmUiHandler } from "#ui/confirm-ui-handler"; +import { EggGachaUiHandler } from "#ui/egg-gacha-ui-handler"; +import { EggHatchSceneHandler } from "#ui/egg-hatch-scene-handler"; +import { EggListUiHandler } from "#ui/egg-list-ui-handler"; +import { EggSummaryUiHandler } from "#ui/egg-summary-ui-handler"; +import { EvolutionSceneHandler } from "#ui/evolution-scene-handler"; +import { FightUiHandler } from "#ui/fight-ui-handler"; +import { GameStatsUiHandler } from "#ui/game-stats-ui-handler"; +import { GamepadBindingUiHandler } from "#ui/gamepad-binding-ui-handler"; +import { KeyboardBindingUiHandler } from "#ui/keyboard-binding-ui-handler"; +import { LoadingModalUiHandler } from "#ui/loading-modal-ui-handler"; +import { LoginFormUiHandler } from "#ui/login-form-ui-handler"; +import { MenuUiHandler } from "#ui/menu-ui-handler"; +import { MessageUiHandler } from "#ui/message-ui-handler"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { MysteryEncounterUiHandler } from "#ui/mystery-encounter-ui-handler"; +import { NavigationManager } from "#ui/navigationMenu"; +import { OptionSelectUiHandler } from "#ui/option-select-ui-handler"; +import { PartyUiHandler } from "#ui/party-ui-handler"; +import { PokedexPageUiHandler } from "#ui/pokedex-page-ui-handler"; +import { PokedexScanUiHandler } from "#ui/pokedex-scan-ui-handler"; +import { PokedexUiHandler } from "#ui/pokedex-ui-handler"; +import { RegistrationFormUiHandler } from "#ui/registration-form-ui-handler"; +import { RenameFormUiHandler } from "#ui/rename-form-ui-handler"; +import { RunHistoryUiHandler } from "#ui/run-history-ui-handler"; +import { RunInfoUiHandler } from "#ui/run-info-ui-handler"; +import { SaveSlotSelectUiHandler } from "#ui/save-slot-select-ui-handler"; +import { SavingIconHandler } from "#ui/saving-icon-handler"; +import { SessionReloadModalUiHandler } from "#ui/session-reload-modal-ui-handler"; +import { SettingsAudioUiHandler } from "#ui/settings-audio-ui-handler"; +import { SettingsDisplayUiHandler } from "#ui/settings-display-ui-handler"; +import { SettingsGamepadUiHandler } from "#ui/settings-gamepad-ui-handler"; +import { SettingsKeyboardUiHandler } from "#ui/settings-keyboard-ui-handler"; +import { SettingsUiHandler } from "#ui/settings-ui-handler"; +import { StarterSelectUiHandler } from "#ui/starter-select-ui-handler"; +import { SummaryUiHandler } from "#ui/summary-ui-handler"; +import { TargetSelectUiHandler } from "#ui/target-select-ui-handler"; +import { TestDialogueUiHandler } from "#ui/test-dialogue-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { TitleUiHandler } from "#ui/title-ui-handler"; +import type { UiHandler } from "#ui/ui-handler"; +import { addWindow } from "#ui/ui-theme"; +import { UnavailableModalUiHandler } from "#ui/unavailable-modal-ui-handler"; +import { executeIf } from "#utils/common"; +import i18next from "i18next"; const transitionModes = [ UiMode.SAVE_SLOT, @@ -103,7 +103,7 @@ const noTransitionModes = [ UiMode.RUN_INFO, ]; -export default class UI extends Phaser.GameObjects.Container { +export class UI extends Phaser.GameObjects.Container { private mode: UiMode; private modeChain: UiMode[]; public handlers: UiHandler[]; diff --git a/src/ui/unavailable-modal-ui-handler.ts b/src/ui/unavailable-modal-ui-handler.ts index 5bed55ec24a..420a47664a7 100644 --- a/src/ui/unavailable-modal-ui-handler.ts +++ b/src/ui/unavailable-modal-ui-handler.ts @@ -1,14 +1,14 @@ -import type { ModalConfig } from "./modal-ui-handler"; -import { ModalUiHandler } from "./modal-ui-handler"; -import { addTextObject, TextStyle } from "./text"; -import type { UiMode } from "#enums/ui-mode"; import { updateUserInfo } from "#app/account"; -import { sessionIdKey } from "#app/utils/common"; -import { removeCookie } from "#app/utils/cookies"; -import i18next from "i18next"; import { globalScene } from "#app/global-scene"; +import type { UiMode } from "#enums/ui-mode"; +import type { ModalConfig } from "#ui/modal-ui-handler"; +import { ModalUiHandler } from "#ui/modal-ui-handler"; +import { addTextObject, TextStyle } from "#ui/text"; +import { sessionIdKey } from "#utils/common"; +import { removeCookie } from "#utils/cookies"; +import i18next from "i18next"; -export default class UnavailableModalUiHandler extends ModalUiHandler { +export class UnavailableModalUiHandler extends ModalUiHandler { private reconnectTimer: NodeJS.Timeout | null; private reconnectDuration: number; private reconnectCallback: () => void; diff --git a/src/utils/common.ts b/src/utils/common.ts index 753d6ebb865..e9ba3acb5e5 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,18 +1,26 @@ +import { pokerogueApi } from "#api/pokerogue-api"; import { MoneyFormat } from "#enums/money-format"; import { MoveId } from "#enums/move-id"; +import type { Variant } from "#sprites/variant"; import i18next from "i18next"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import type { Variant } from "#app/sprites/variant"; export type nil = null | undefined; export const MissingTextureKey = "__MISSING"; +// TODO: Draft tests for these utility functions +// TODO: Break up this file +/** + * Convert a `snake_case` string in any capitalization (such as one from an enum reverse mapping) + * into a readable `Title Case` version. + * @param str - The snake case string to be converted. + * @returns The result of converting `str` into title case. + */ export function toReadableString(str: string): string { return str .replace(/_/g, " ") .split(" ") - .map(s => `${s.slice(0, 1)}${s.slice(1).toLowerCase()}`) + .map(s => capitalizeFirstLetter(s.toLowerCase())) .join(" "); } @@ -273,18 +281,6 @@ export function formatStat(stat: number, forHp = false): string { return formatLargeNumber(stat, forHp ? 100000 : 1000000); } -export function getEnumKeys(enumType: any): string[] { - return Object.values(enumType) - .filter(v => Number.isNaN(Number.parseInt(v!.toString()))) - .map(v => v!.toString()); -} - -export function getEnumValues(enumType: any): number[] { - return Object.values(enumType) - .filter(v => !Number.isNaN(Number.parseInt(v!.toString()))) - .map(v => Number.parseInt(v!.toString())); -} - export function executeIf(condition: boolean, promiseFunc: () => Promise): Promise { return condition ? promiseFunc() : new Promise(resolve => resolve(null)); } @@ -341,6 +337,10 @@ export class NumberHolder { constructor(value: number) { this.value = value; } + + valueOf(): number { + return this.value; + } } export class FixedInt { @@ -349,6 +349,10 @@ export class FixedInt { constructor(value: number) { this.value = value; } + + [Symbol.toPrimitive](_hint: string): number { + return this.value; + } } export function fixedInt(value: number): number { @@ -636,25 +640,3 @@ export function coerceArray(input: T): T extends any[] ? T : [T]; export function coerceArray(input: T): T | [T] { return Array.isArray(input) ? input : [input]; } - -/** - * Returns the name of the key that matches the enum [object] value. - * @param input - The enum [object] to check - * @param val - The value to get the key of - * @returns The name of the key with the specified value - * @example - * const thing = { - * one: 1, - * two: 2, - * } as const; - * console.log(enumValueToKey(thing, thing.two)); // output: "two" - * @throws An `Error` if an invalid enum value is passed to the function - */ -export function enumValueToKey>(input: T, val: T[keyof T]): keyof T { - for (const [key, value] of Object.entries(input)) { - if (val === value) { - return key as keyof T; - } - } - throw new Error(`Invalid value passed to \`enumValueToKey\`! Value: ${val}`); -} diff --git a/src/utils/cookies.ts b/src/utils/cookies.ts index b38e941b59a..06391e6f4c7 100644 --- a/src/utils/cookies.ts +++ b/src/utils/cookies.ts @@ -1,4 +1,4 @@ -import { isBeta } from "./utility-vars"; +import { isBeta } from "#utils/utility-vars"; export function setCookie(cName: string, cValue: string): void { const expiration = new Date(); diff --git a/src/utils/data.ts b/src/utils/data.ts index 5a28657d034..932ea38d504 100644 --- a/src/utils/data.ts +++ b/src/utils/data.ts @@ -1,7 +1,7 @@ import { loggedInUser } from "#app/account"; -import type { StarterAttributes } from "#app/system/game-data"; -import { AES, enc } from "crypto-js"; import { saveKey } from "#app/constants"; +import type { StarterAttributes } from "#system/game-data"; +import { AES, enc } from "crypto-js"; /** * Perform a deep copy of an object. diff --git a/src/utils/enums.ts b/src/utils/enums.ts new file mode 100644 index 00000000000..98cb4272ee9 --- /dev/null +++ b/src/utils/enums.ts @@ -0,0 +1,74 @@ +import type { EnumOrObject, EnumValues, NormalEnum, TSNumericEnum } from "#app/@types/enum-types"; +import type { InferKeys } from "#app/@types/type-helpers"; + +/** + * Return the string keys of an Enum object, excluding reverse-mapped numbers. + * @param enumType - The numeric enum to retrieve keys for + * @returns An ordered array of all of `enumType`'s string keys + * @example + * enum fruit { + * apple = 1, + * banana = 2, + * cherry = 3, + * orange = 12, + * }; + * + * console.log(getEnumKeys(fruit)); // output: ["apple", "banana", "cherry", "orange"] + * @remarks + * To retrieve the keys of a {@linkcode NormalEnum}, use {@linkcode Object.keys} instead. + */ +export function getEnumKeys(enumType: TSNumericEnum): (keyof E)[] { + // All enum values are either normal numbers or reverse mapped strings, so we can retrieve the keys by filtering out numbers. + return Object.values(enumType).filter(v => typeof v === "string"); +} + +/** + * Return the numeric values of a numeric Enum object, excluding reverse-mapped strings. + * @param enumType - The enum object to retrieve keys for + * @returns An ordered array of all of `enumType`'s number values + * @example + * enum fruit { + * apple = 1, + * banana = 2, + * cherry = 3, + * orange = 12, + * }; + * + * console.log(getEnumValues(fruit)); // output: [1, 2, 3, 12] + * + * @remarks + * To retrieve the keys of a {@linkcode NormalEnum}, use {@linkcode Object.values} instead. + */ +// NB: This intentionally does not use `EnumValues` as using `E[keyof E]` leads to improved variable highlighting in IDEs. +export function getEnumValues(enumType: TSNumericEnum): E[keyof E][] { + return Object.values(enumType).filter(v => typeof v !== "string") as E[keyof E][]; +} + +/** + * Return the name of the key that matches the given Enum value. + * Can be used to emulate Typescript reverse mapping for `const object`s or string enums. + * @param object - The {@linkcode NormalEnum} to check + * @param val - The value to get the key of + * @returns The name of the key with the specified value + * @example + * const thing = { + * one: 1, + * two: 2, + * } as const; + * console.log(enumValueToKey(thing, 2)); // output: "two" + * @throws Error if an invalid enum value is passed to the function + * @remarks + * If multiple keys map to the same value, the first one (in insertion order) will be retrieved, + * but the return type will be the union of ALL their corresponding keys. + */ +export function enumValueToKey>( + object: NormalEnum, + val: V, +): InferKeys { + for (const [key, value] of Object.entries(object)) { + if (val === value) { + return key as InferKeys; + } + } + throw new Error(`Invalid value passed to \`enumValueToKey\`! Value: ${val}`); +} diff --git a/src/utils/modifier-utils.ts b/src/utils/modifier-utils.ts index 3be4af3730c..58108e7a599 100644 --- a/src/utils/modifier-utils.ts +++ b/src/utils/modifier-utils.ts @@ -1,3 +1,4 @@ +import { modifierTypes } from "#data/data-lists"; import { ModifierPoolType } from "#enums/modifier-pool-type"; import { dailyStarterModifierPool, @@ -5,10 +6,9 @@ import { modifierPool, trainerModifierPool, wildModifierPool, -} from "#app/modifier/modifier-pools"; -import type { ModifierPool, ModifierTypeFunc } from "#app/@types/modifier-types"; -import { modifierTypes } from "#app/data/data-lists"; -import type { ModifierType } from "#app/modifier/modifier-type"; +} from "#modifiers/modifier-pools"; +import type { ModifierType } from "#modifiers/modifier-type"; +import type { ModifierPool, ModifierTypeFunc } from "#types/modifier-types"; export function getModifierPoolForType(poolType: ModifierPoolType): ModifierPool { switch (poolType) { diff --git a/src/utils/pokemon-utils.ts b/src/utils/pokemon-utils.ts index 9f87c36b050..da39cfe11ad 100644 --- a/src/utils/pokemon-utils.ts +++ b/src/utils/pokemon-utils.ts @@ -1,5 +1,5 @@ -import { allSpecies } from "#app/data/data-lists"; -import type PokemonSpecies from "#app/data/pokemon-species"; +import { allSpecies } from "#data/data-lists"; +import type { PokemonSpecies } from "#data/pokemon-species"; import type { SpeciesId } from "#enums/species-id"; /** diff --git a/test/abilities/ability_activation_order.test.ts b/test/abilities/ability_activation_order.test.ts index 0b8e354cc7d..8344ba6be11 100644 --- a/test/abilities/ability_activation_order.test.ts +++ b/test/abilities/ability_activation_order.test.ts @@ -3,7 +3,7 @@ import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/ability_duplication.test.ts b/test/abilities/ability_duplication.test.ts index d392b7043e4..0c88b65a00e 100644 --- a/test/abilities/ability_duplication.test.ts +++ b/test/abilities/ability_duplication.test.ts @@ -1,10 +1,10 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Ability Duplication", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/ability_timing.test.ts b/test/abilities/ability_timing.test.ts index 124591597be..c3e841d8216 100644 --- a/test/abilities/ability_timing.test.ts +++ b/test/abilities/ability_timing.test.ts @@ -1,11 +1,11 @@ -import { BattleStyle } from "#app/enums/battle-style"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import i18next from "#app/plugins/i18n"; -import { UiMode } from "#enums/ui-mode"; import { AbilityId } from "#enums/ability-id"; +import { BattleStyle } from "#enums/battle-style"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { UiMode } from "#enums/ui-mode"; +import { CommandPhase } from "#phases/command-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import i18next from "#plugins/i18n"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/analytic.test.ts b/test/abilities/analytic.test.ts index 5dbf4365186..0bacfe6775b 100644 --- a/test/abilities/analytic.test.ts +++ b/test/abilities/analytic.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { isBetween, toDmgValue } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { isBetween, toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/anger-point.test.ts b/test/abilities/anger-point.test.ts new file mode 100644 index 00000000000..576062eadeb --- /dev/null +++ b/test/abilities/anger-point.test.ts @@ -0,0 +1,78 @@ +import { PostReceiveCritStatStageChangeAbAttr } from "#abilities/ability"; +import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Ability - Anger Point", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .ability(AbilityId.BALL_FETCH) + .battleStyle("single") + .criticalHits(false) + .enemySpecies(SpeciesId.MAGIKARP) + .enemyAbility(AbilityId.BALL_FETCH) + .enemyMoveset(MoveId.SPLASH) + .enemyLevel(100); + }); + + it("should set the user's attack stage to +6 when hit by a critical hit", async () => { + game.override.enemyAbility(AbilityId.ANGER_POINT).moveset(MoveId.FALSE_SWIPE); + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + const enemy = game.scene.getEnemyPokemon()!; + + // minimize the enemy's attack stage to ensure it is always set to +6 + enemy.setStatStage(Stat.ATK, -6); + vi.spyOn(enemy, "getCriticalHitResult").mockReturnValueOnce(true); + game.move.select(MoveId.FALSE_SWIPE); + await game.phaseInterceptor.to("BerryPhase"); + expect(enemy.getStatStage(Stat.ATK)).toBe(6); + }); + + it("should only proc once when a multi-hit move crits on the first hit", async () => { + game.override + .moveset(MoveId.BULLET_SEED) + .enemyLevel(50) + .enemyAbility(AbilityId.ANGER_POINT) + .ability(AbilityId.SKILL_LINK); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getCriticalHitResult").mockReturnValueOnce(true); + const angerPointSpy = vi.spyOn(PostReceiveCritStatStageChangeAbAttr.prototype, "apply"); + game.move.select(MoveId.BULLET_SEED); + await game.phaseInterceptor.to("BerryPhase"); + expect(angerPointSpy).toHaveBeenCalledTimes(1); + }); + + it("should set a contrary user's attack stage to -6 when hit by a critical hit", async () => { + game.override + .enemyAbility(AbilityId.ANGER_POINT) + .enemyPassiveAbility(AbilityId.CONTRARY) + .enemyHasPassiveAbility(true) + .moveset(MoveId.FALSE_SWIPE); + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getCriticalHitResult").mockReturnValueOnce(true); + enemy.setStatStage(Stat.ATK, 6); + game.move.select(MoveId.FALSE_SWIPE); + await game.phaseInterceptor.to("BerryPhase"); + expect(enemy.getStatStage(Stat.ATK)).toBe(-6); + }); +}); diff --git a/test/abilities/arena_trap.test.ts b/test/abilities/arena_trap.test.ts index cc6888be102..c47cf3cd327 100644 --- a/test/abilities/arena_trap.test.ts +++ b/test/abilities/arena_trap.test.ts @@ -1,10 +1,10 @@ -import { allAbilities } from "#app/data/data-lists"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Arena Trap", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/aroma_veil.test.ts b/test/abilities/aroma_veil.test.ts index 56cce749b9f..fb08d60c24f 100644 --- a/test/abilities/aroma_veil.test.ts +++ b/test/abilities/aroma_veil.test.ts @@ -1,13 +1,13 @@ -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerTagType } from "#enums/battler-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerIndex } from "#enums/battler-index"; -import type { PlayerPokemon } from "#app/field/pokemon"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import type { PlayerPokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Aroma Veil", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/aura_break.test.ts b/test/abilities/aura_break.test.ts index 657d363bd97..6f33e3f047f 100644 --- a/test/abilities/aura_break.test.ts +++ b/test/abilities/aura_break.test.ts @@ -1,8 +1,8 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/battery.test.ts b/test/abilities/battery.test.ts index db129e72b0b..13ebd52367a 100644 --- a/test/abilities/battery.test.ts +++ b/test/abilities/battery.test.ts @@ -1,10 +1,10 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/battle_bond.test.ts b/test/abilities/battle_bond.test.ts index adb4a9c6e7a..ef8c2ffed75 100644 --- a/test/abilities/battle_bond.test.ts +++ b/test/abilities/battle_bond.test.ts @@ -1,11 +1,11 @@ -import { allMoves } from "#app/data/data-lists"; -import { MultiHitType } from "#enums/MultiHitType"; -import { Status } from "#app/data/status-effect"; +import { allMoves } from "#data/data-lists"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; +import { MultiHitType } from "#enums/MultiHitType"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - BATTLE BOND", () => { diff --git a/test/abilities/beast_boost.test.ts b/test/abilities/beast_boost.test.ts index 8be9156ce07..0a49728698b 100644 --- a/test/abilities/beast_boost.test.ts +++ b/test/abilities/beast_boost.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/commander.test.ts b/test/abilities/commander.test.ts index 99512d7a733..5ddafc90d05 100644 --- a/test/abilities/commander.test.ts +++ b/test/abilities/commander.test.ts @@ -1,15 +1,15 @@ +import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { PokemonAnimType } from "#enums/pokemon-anim-type"; +import { SpeciesId } from "#enums/species-id"; import type { EffectiveStat } from "#enums/stat"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; -import { MoveResult } from "#enums/move-result"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/competitive.test.ts b/test/abilities/competitive.test.ts index f12b06837dc..7dcc677a74e 100644 --- a/test/abilities/competitive.test.ts +++ b/test/abilities/competitive.test.ts @@ -1,9 +1,9 @@ -import { Stat } from "#enums/stat"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/contrary.test.ts b/test/abilities/contrary.test.ts index 6962abb0fec..7db48dedbfd 100644 --- a/test/abilities/contrary.test.ts +++ b/test/abilities/contrary.test.ts @@ -1,8 +1,8 @@ -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/corrosion.test.ts b/test/abilities/corrosion.test.ts index 2a0464d1146..22abc158fc7 100644 --- a/test/abilities/corrosion.test.ts +++ b/test/abilities/corrosion.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/costar.test.ts b/test/abilities/costar.test.ts index a40d84e72f5..42d8f7811f8 100644 --- a/test/abilities/costar.test.ts +++ b/test/abilities/costar.test.ts @@ -1,10 +1,10 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MessagePhase } from "#app/phases/message-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { CommandPhase } from "#phases/command-phase"; +import { MessagePhase } from "#phases/message-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/abilities/cud_chew.test.ts b/test/abilities/cud_chew.test.ts index e563e7537dd..8fc62b38528 100644 --- a/test/abilities/cud_chew.test.ts +++ b/test/abilities/cud_chew.test.ts @@ -1,5 +1,4 @@ -import { CudChewConsumeBerryAbAttr } from "#app/data/abilities/ability"; -import Pokemon from "#app/field/pokemon"; +import { CudChewConsumeBerryAbAttr } from "#abilities/ability"; import { globalScene } from "#app/global-scene"; import { getPokemonNameWithAffix } from "#app/messages"; import { AbilityId } from "#enums/ability-id"; @@ -7,7 +6,8 @@ import { BerryType } from "#enums/berry-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { Pokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; import i18next from "i18next"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/dancer.test.ts b/test/abilities/dancer.test.ts index 2a4a3c36bcc..86b5b68e901 100644 --- a/test/abilities/dancer.test.ts +++ b/test/abilities/dancer.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; -import type { MovePhase } from "#app/phases/move-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import type { MovePhase } from "#phases/move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/defiant.test.ts b/test/abilities/defiant.test.ts index ef26b5bfca3..44187429e2b 100644 --- a/test/abilities/defiant.test.ts +++ b/test/abilities/defiant.test.ts @@ -1,9 +1,9 @@ -import { Stat } from "#enums/stat"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/desolate-land.test.ts b/test/abilities/desolate-land.test.ts index 90565d9caf8..fc066fa8955 100644 --- a/test/abilities/desolate-land.test.ts +++ b/test/abilities/desolate-land.test.ts @@ -1,13 +1,14 @@ -import { PokeballType } from "#app/enums/pokeball"; -import { WeatherType } from "#app/enums/weather-type"; -import type { CommandPhase } from "#app/phases/command-phase"; -import { Command } from "#enums/command"; +import { globalScene } from "#app/global-scene"; import { AbilityId } from "#enums/ability-id"; +import { Command } from "#enums/command"; import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { WeatherType } from "#enums/weather-type"; +import type { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Desolate Land", () => { let phaserGame: Phaser.Game; @@ -145,6 +146,7 @@ describe("Abilities - Desolate Land", () => { expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN); vi.spyOn(game.scene.getPlayerPokemon()!, "randBattleSeedInt").mockReturnValue(0); + vi.spyOn(globalScene, "randBattleSeedInt").mockReturnValue(0); const commandPhase = game.scene.phaseManager.getCurrentPhase() as CommandPhase; commandPhase.handleCommand(Command.RUN, 0); diff --git a/test/abilities/disguise.test.ts b/test/abilities/disguise.test.ts index 4ccd825e574..94d9dbf1d47 100644 --- a/test/abilities/disguise.test.ts +++ b/test/abilities/disguise.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { toDmgValue } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - Disguise", () => { diff --git a/test/abilities/dry_skin.test.ts b/test/abilities/dry_skin.test.ts index 31620beb9bd..712d3295e6f 100644 --- a/test/abilities/dry_skin.test.ts +++ b/test/abilities/dry_skin.test.ts @@ -1,7 +1,7 @@ -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/early_bird.test.ts b/test/abilities/early_bird.test.ts index dcdfd8e4956..be4a2c802af 100644 --- a/test/abilities/early_bird.test.ts +++ b/test/abilities/early_bird.test.ts @@ -1,10 +1,10 @@ -import { Status } from "#app/data/status-effect"; -import { MoveResult } from "#enums/move-result"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/flash_fire.test.ts b/test/abilities/flash_fire.test.ts index 3be156a1578..d6085c4e591 100644 --- a/test/abilities/flash_fire.test.ts +++ b/test/abilities/flash_fire.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { SpeciesId } from "#enums/species-id"; -import { MovePhase } from "#app/phases/move-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { MovePhase } from "#phases/move-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/flower_gift.test.ts b/test/abilities/flower_gift.test.ts index f072afe7f34..b283729d951 100644 --- a/test/abilities/flower_gift.test.ts +++ b/test/abilities/flower_gift.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allAbilities } from "#app/data/data-lists"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { Stat } from "#app/enums/stat"; -import { WeatherType } from "#app/enums/weather-type"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { WeatherType } from "#enums/weather-type"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/flower_veil.test.ts b/test/abilities/flower_veil.test.ts index 7cabfa23e96..e890ea24fad 100644 --- a/test/abilities/flower_veil.test.ts +++ b/test/abilities/flower_veil.test.ts @@ -1,15 +1,14 @@ -import { BattlerIndex } from "#enums/battler-index"; +import { allAbilities, allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/data-lists"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { allAbilities } from "#app/data/data-lists"; describe("Abilities - Flower Veil", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/forecast.test.ts b/test/abilities/forecast.test.ts index 9111766ebdf..372e32a27fa 100644 --- a/test/abilities/forecast.test.ts +++ b/test/abilities/forecast.test.ts @@ -1,15 +1,15 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allAbilities } from "#app/data/data-lists"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { WeatherType } from "#app/enums/weather-type"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { PostSummonPhase } from "#app/phases/post-summon-phase"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { WeatherType } from "#enums/weather-type"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { MovePhase } from "#phases/move-phase"; +import { PostSummonPhase } from "#phases/post-summon-phase"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/friend_guard.test.ts b/test/abilities/friend_guard.test.ts index c5809e18e96..e26fd5b5f1f 100644 --- a/test/abilities/friend_guard.test.ts +++ b/test/abilities/friend_guard.test.ts @@ -1,13 +1,12 @@ +import { allAbilities, allMoves } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveCategory } from "#enums/MoveCategory"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { BattlerIndex } from "#enums/battler-index"; -import { allAbilities } from "#app/data/data-lists"; -import { allMoves } from "#app/data/data-lists"; -import { MoveCategory } from "#enums/MoveCategory"; describe("Moves - Friend Guard", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/good_as_gold.test.ts b/test/abilities/good_as_gold.test.ts index 89e354b1f34..956553a96d9 100644 --- a/test/abilities/good_as_gold.test.ts +++ b/test/abilities/good_as_gold.test.ts @@ -1,15 +1,15 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allAbilities } from "#app/data/data-lists"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { Stat } from "#app/enums/stat"; -import { StatusEffect } from "#app/enums/status-effect"; -import { WeatherType } from "#app/enums/weather-type"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -45,7 +45,7 @@ describe("Abilities - Good As Gold", () => { const player = game.scene.getPlayerPokemon()!; - game.move.select(MoveId.SPLASH, 0); + game.move.select(MoveId.SPLASH); await game.phaseInterceptor.to("BerryPhase"); @@ -54,12 +54,13 @@ describe("Abilities - Good As Gold", () => { }); it("should block memento and prevent the user from fainting", async () => { - game.override.enemyMoveset([MoveId.MEMENTO]); + game.override.enemyAbility(AbilityId.GOOD_AS_GOLD); await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - game.move.select(MoveId.MEMENTO); + + game.move.use(MoveId.MEMENTO); await game.phaseInterceptor.to("BerryPhase"); - expect(game.scene.getPlayerPokemon()!.isFainted()).toBe(false); - expect(game.scene.getEnemyPokemon()?.getStatStage(Stat.ATK)).toBe(0); + expect(game.field.getPlayerPokemon().isFainted()).toBe(false); + expect(game.field.getEnemyPokemon().getStatStage(Stat.ATK)).toBe(0); }); it("should not block any status moves that target the field, one side, or all pokemon", async () => { diff --git a/test/abilities/gorilla_tactics.test.ts b/test/abilities/gorilla_tactics.test.ts index 330b4f51bcd..05714fe77ea 100644 --- a/test/abilities/gorilla_tactics.test.ts +++ b/test/abilities/gorilla_tactics.test.ts @@ -1,14 +1,14 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; -import { SpeciesId } from "#enums/species-id"; -import { Stat } from "#app/enums/stat"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; import { MoveResult } from "#enums/move-result"; import { MoveUseMode } from "#enums/move-use-mode"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { RandomMoveAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Gorilla Tactics", () => { let phaserGame: Phaser.Game; @@ -28,8 +28,10 @@ describe("Abilities - Gorilla Tactics", () => { game = new GameManager(phaserGame); game.override .battleStyle("single") + .criticalHits(false) .enemyAbility(AbilityId.BALL_FETCH) .enemySpecies(SpeciesId.MAGIKARP) + .enemyMoveset(MoveId.SPLASH) .enemyLevel(30) .moveset([MoveId.SPLASH, MoveId.TACKLE, MoveId.GROWL, MoveId.METRONOME]) .ability(AbilityId.GORILLA_TACTICS); @@ -42,7 +44,6 @@ describe("Abilities - Gorilla Tactics", () => { const initialAtkStat = darmanitan.getStat(Stat.ATK); game.move.select(MoveId.SPLASH); - await game.move.forceEnemyMove(MoveId.SPLASH); await game.toEndOfTurn(); expect(darmanitan.getStat(Stat.ATK, false)).toBeCloseTo(initialAtkStat * 1.5); @@ -59,7 +60,6 @@ describe("Abilities - Gorilla Tactics", () => { // First turn, lock move to Growl game.move.select(MoveId.GROWL); - await game.move.forceEnemyMove(MoveId.SPLASH); await game.toNextTurn(); // Second turn, Growl is interrupted by Disable @@ -72,7 +72,7 @@ describe("Abilities - Gorilla Tactics", () => { // Third turn, Struggle is used game.move.select(MoveId.TACKLE); - await game.move.forceEnemyMove(MoveId.SPLASH); //prevent protect from being used by the enemy + await game.move.forceEnemyMove(MoveId.SPLASH); // prevent disable from being used by the enemy await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to("MoveEndPhase"); @@ -106,11 +106,13 @@ describe("Abilities - Gorilla Tactics", () => { const darmanitan = game.field.getPlayerPokemon(); game.move.select(MoveId.TACKLE); - await game.move.selectEnemyMove(MoveId.PROTECT); + await game.move.forceEnemyMove(MoveId.PROTECT); await game.toEndOfTurn(); expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true); expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false); + const enemy = game.field.getEnemyPokemon(); + expect(enemy.hp).toBe(enemy.getMaxHp()); }); it("should activate when a move is succesfully executed but misses", async () => { @@ -119,7 +121,6 @@ describe("Abilities - Gorilla Tactics", () => { const darmanitan = game.field.getPlayerPokemon(); game.move.select(MoveId.TACKLE); - await game.move.selectEnemyMove(MoveId.SPLASH); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.move.forceMiss(); await game.toEndOfTurn(); diff --git a/test/abilities/guard-dog.test.ts b/test/abilities/guard-dog.test.ts new file mode 100644 index 00000000000..aef8f081975 --- /dev/null +++ b/test/abilities/guard-dog.test.ts @@ -0,0 +1,39 @@ +import { AbilityId } from "#enums/ability-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Ability - Guard Dog", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .ability(AbilityId.GUARD_DOG) + .battleStyle("single") + .enemySpecies(SpeciesId.MAGIKARP) + .enemyAbility(AbilityId.INTIMIDATE); + }); + + it("should raise attack by 1 stage when Intimidated instead of being lowered", async () => { + await game.classicMode.startBattle([SpeciesId.MABOSSTIFF]); + + const mabostiff = game.field.getPlayerPokemon(); + expect(mabostiff.getStatStage(Stat.ATK)).toBe(1); + expect(mabostiff.waveData.abilitiesApplied.has(AbilityId.GUARD_DOG)).toBe(true); + expect(game.phaseInterceptor.log.filter(l => l === "StatStageChangePhase")).toHaveLength(1); + }); +}); diff --git a/test/abilities/gulp_missile.test.ts b/test/abilities/gulp_missile.test.ts index e47b22f0c06..69ed6c51ac9 100644 --- a/test/abilities/gulp_missile.test.ts +++ b/test/abilities/gulp_missile.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import type Pokemon from "#app/field/pokemon"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/harvest.test.ts b/test/abilities/harvest.test.ts index 42c9772bd10..244de383b44 100644 --- a/test/abilities/harvest.test.ts +++ b/test/abilities/harvest.test.ts @@ -1,16 +1,16 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PostTurnRestoreBerryAbAttr } from "#app/data/abilities/ability"; -import type Pokemon from "#app/field/pokemon"; -import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier"; -import type { ModifierOverride } from "#app/modifier/modifier-type"; -import type { BooleanHolder } from "#app/utils/common"; +import { PostTurnRestoreBerryAbAttr } from "#abilities/ability"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BerryType } from "#enums/berry-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { BerryModifier, PreserveBerryModifier } from "#modifiers/modifier"; +import type { ModifierOverride } from "#modifiers/modifier-type"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { BooleanHolder } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/healer.test.ts b/test/abilities/healer.test.ts index b21b04531ec..8ce8b5bada0 100644 --- a/test/abilities/healer.test.ts +++ b/test/abilities/healer.test.ts @@ -1,14 +1,14 @@ +import { PostTurnResetStatusAbAttr } from "#abilities/ability"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; +import { isNullOrUndefined } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { isNullOrUndefined } from "#app/utils/common"; -import { allAbilities } from "#app/data/data-lists"; -import type Pokemon from "#app/field/pokemon"; -import { PostTurnResetStatusAbAttr } from "#app/data/abilities/ability"; describe("Abilities - Healer", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/heatproof.test.ts b/test/abilities/heatproof.test.ts index 39c9dff8289..0d76c1ad40b 100644 --- a/test/abilities/heatproof.test.ts +++ b/test/abilities/heatproof.test.ts @@ -1,10 +1,10 @@ -import { SpeciesId } from "#enums/species-id"; -import { StatusEffect } from "#app/enums/status-effect"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { toDmgValue } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/honey_gather.test.ts b/test/abilities/honey_gather.test.ts index f8700f3e6f7..65c590083f5 100644 --- a/test/abilities/honey_gather.test.ts +++ b/test/abilities/honey_gather.test.ts @@ -1,9 +1,10 @@ -import type { CommandPhase } from "#app/phases/command-phase"; -import { Command } from "#enums/command"; +import Overrides from "#app/overrides"; import { AbilityId } from "#enums/ability-id"; +import { Command } from "#enums/command"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -63,6 +64,8 @@ describe("Abilities - Honey Gather", () => { // something weird is going on with the test framework, so this is required to prevent a crash const enemy = game.scene.getEnemyPokemon()!; vi.spyOn(enemy, "scene", "get").mockReturnValue(game.scene); + // Expects next wave so run must succeed + vi.spyOn(Overrides, "RUN_SUCCESS_OVERRIDE", "get").mockReturnValue(true); const commandPhase = game.scene.phaseManager.getCurrentPhase() as CommandPhase; commandPhase.handleCommand(Command.RUN, 0); diff --git a/test/abilities/hustle.test.ts b/test/abilities/hustle.test.ts index 57a1a2e1d86..94045d231d1 100644 --- a/test/abilities/hustle.test.ts +++ b/test/abilities/hustle.test.ts @@ -1,9 +1,9 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { Stat } from "#app/enums/stat"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/hyper_cutter.test.ts b/test/abilities/hyper_cutter.test.ts index 211be9a0533..212083b62b6 100644 --- a/test/abilities/hyper_cutter.test.ts +++ b/test/abilities/hyper_cutter.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/ice_face.test.ts b/test/abilities/ice_face.test.ts index c42713d7e6c..a0e2a949672 100644 --- a/test/abilities/ice_face.test.ts +++ b/test/abilities/ice_face.test.ts @@ -1,14 +1,14 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -259,7 +259,7 @@ describe("Abilities - Ice Face", () => { const eiscue = game.scene.getEnemyPokemon()!; - expect(eiscue.getTag(BattlerTagType.ICE_FACE)).not.toBe(undefined); + expect(eiscue.getTag(BattlerTagType.ICE_FACE)).toBeDefined(); expect(eiscue.formIndex).toBe(icefaceForm); expect(eiscue.hasAbility(AbilityId.ICE_FACE)).toBe(true); }); @@ -269,13 +269,9 @@ describe("Abilities - Ice Face", () => { await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - game.move.select(MoveId.SIMPLE_BEAM); - - await game.phaseInterceptor.to(TurnInitPhase); - const eiscue = game.scene.getEnemyPokemon()!; - expect(eiscue.getTag(BattlerTagType.ICE_FACE)).not.toBe(undefined); + expect(eiscue.getTag(BattlerTagType.ICE_FACE)).toBeDefined(); expect(eiscue.formIndex).toBe(icefaceForm); expect(game.scene.getPlayerPokemon()!.hasAbility(AbilityId.TRACE)).toBe(true); }); diff --git a/test/abilities/illuminate.test.ts b/test/abilities/illuminate.test.ts index ec4f6436041..0fb31379542 100644 --- a/test/abilities/illuminate.test.ts +++ b/test/abilities/illuminate.test.ts @@ -1,9 +1,9 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - Illuminate", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/illusion.test.ts b/test/abilities/illusion.test.ts index 1c2809ad813..0624c5e19f4 100644 --- a/test/abilities/illusion.test.ts +++ b/test/abilities/illusion.test.ts @@ -1,9 +1,9 @@ -import { Gender } from "#app/data/gender"; -import { PokeballType } from "#app/enums/pokeball"; +import { Gender } from "#data/gender"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/immunity.test.ts b/test/abilities/immunity.test.ts index 063ab57f11a..6f6fac10bf9 100644 --- a/test/abilities/immunity.test.ts +++ b/test/abilities/immunity.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/imposter.test.ts b/test/abilities/imposter.test.ts deleted file mode 100644 index 30491139877..00000000000 --- a/test/abilities/imposter.test.ts +++ /dev/null @@ -1,188 +0,0 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; -import { AbilityId } from "#enums/ability-id"; - -// TODO: Add more tests once Imposter is fully implemented -describe("Abilities - Imposter", () => { - let phaserGame: Phaser.Game; - let game: GameManager; - - beforeAll(() => { - phaserGame = new Phaser.Game({ - type: Phaser.HEADLESS, - }); - }); - - afterEach(() => { - game.phaseInterceptor.restoreOg(); - }); - - beforeEach(() => { - game = new GameManager(phaserGame); - game.override - .battleStyle("single") - .enemySpecies(SpeciesId.MEW) - .enemyLevel(200) - .enemyAbility(AbilityId.BEAST_BOOST) - .enemyPassiveAbility(AbilityId.BALL_FETCH) - .enemyMoveset(MoveId.SPLASH) - .ability(AbilityId.IMPOSTER) - .moveset(MoveId.SPLASH); - }); - - it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => { - await game.classicMode.startBattle([SpeciesId.DITTO]); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - expect(player.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); - expect(player.getAbility()).toBe(enemy.getAbility()); - expect(player.getGender()).toBe(enemy.getGender()); - - expect(player.getStat(Stat.HP, false)).not.toBe(enemy.getStat(Stat.HP)); - for (const s of EFFECTIVE_STATS) { - expect(player.getStat(s, false)).toBe(enemy.getStat(s, false)); - } - - for (const s of BATTLE_STATS) { - expect(player.getStatStage(s)).toBe(enemy.getStatStage(s)); - } - - const playerMoveset = player.getMoveset(); - const enemyMoveset = player.getMoveset(); - - expect(playerMoveset.length).toBe(enemyMoveset.length); - for (let i = 0; i < playerMoveset.length && i < enemyMoveset.length; i++) { - expect(playerMoveset[i]?.moveId).toBe(enemyMoveset[i]?.moveId); - } - - const playerTypes = player.getTypes(); - const enemyTypes = enemy.getTypes(); - - expect(playerTypes.length).toBe(enemyTypes.length); - for (let i = 0; i < playerTypes.length && i < enemyTypes.length; i++) { - expect(playerTypes[i]).toBe(enemyTypes[i]); - } - }); - - it("should copy in-battle overridden stats", async () => { - game.override.enemyMoveset([MoveId.POWER_SPLIT]); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - const avgAtk = Math.floor((player.getStat(Stat.ATK, false) + enemy.getStat(Stat.ATK, false)) / 2); - const avgSpAtk = Math.floor((player.getStat(Stat.SPATK, false) + enemy.getStat(Stat.SPATK, false)) / 2); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(player.getStat(Stat.ATK, false)).toBe(avgAtk); - expect(enemy.getStat(Stat.ATK, false)).toBe(avgAtk); - - expect(player.getStat(Stat.SPATK, false)).toBe(avgSpAtk); - expect(enemy.getStat(Stat.SPATK, false)).toBe(avgSpAtk); - }); - - it("should set each move's pp to a maximum of 5", async () => { - game.override.enemyMoveset([MoveId.SWORDS_DANCE, MoveId.GROWL, MoveId.SKETCH, MoveId.RECOVER]); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - const player = game.scene.getPlayerPokemon()!; - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - player.getMoveset().forEach(move => { - // Should set correct maximum PP without touching `ppUp` - if (move) { - if (move.moveId === MoveId.SKETCH) { - expect(move.getMovePp()).toBe(1); - } else { - expect(move.getMovePp()).toBe(5); - } - expect(move.ppUp).toBe(0); - } - }); - }); - - it("should activate its ability if it copies one that activates on summon", async () => { - game.override.enemyAbility(AbilityId.INTIMIDATE); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to("MoveEndPhase"); - - expect(game.scene.getEnemyPokemon()?.getStatStage(Stat.ATK)).toBe(-1); - }); - - it("should persist transformed attributes across reloads", async () => { - game.override.moveset([MoveId.ABSORB]); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - game.move.select(MoveId.SPLASH); - await game.doKillOpponents(); - await game.toNextWave(); - - expect(game.scene.phaseManager.getCurrentPhase()?.constructor.name).toBe("CommandPhase"); - expect(game.scene.currentBattle.waveIndex).toBe(2); - - await game.reload.reloadSession(); - - const playerReloaded = game.scene.getPlayerPokemon()!; - const playerMoveset = player.getMoveset(); - - expect(playerReloaded.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); - expect(playerReloaded.getAbility()).toBe(enemy.getAbility()); - expect(playerReloaded.getGender()).toBe(enemy.getGender()); - - expect(playerReloaded.getStat(Stat.HP, false)).not.toBe(enemy.getStat(Stat.HP)); - for (const s of EFFECTIVE_STATS) { - expect(playerReloaded.getStat(s, false)).toBe(enemy.getStat(s, false)); - } - - expect(playerMoveset.length).toEqual(1); - expect(playerMoveset[0]?.moveId).toEqual(MoveId.SPLASH); - }); - - it("should stay transformed with the correct form after reload", async () => { - game.override.moveset([MoveId.ABSORB]).enemySpecies(SpeciesId.UNOWN); - await game.classicMode.startBattle([SpeciesId.DITTO]); - - const enemy = game.scene.getEnemyPokemon()!; - - // change form - enemy.species.forms[5]; - enemy.species.formIndex = 5; - - game.move.select(MoveId.SPLASH); - await game.doKillOpponents(); - await game.toNextWave(); - - expect(game.scene.phaseManager.getCurrentPhase()?.constructor.name).toBe("CommandPhase"); - expect(game.scene.currentBattle.waveIndex).toBe(2); - - await game.reload.reloadSession(); - - const playerReloaded = game.scene.getPlayerPokemon()!; - - expect(playerReloaded.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); - expect(playerReloaded.getSpeciesForm().formIndex).toBe(enemy.getSpeciesForm().formIndex); - }); -}); diff --git a/test/abilities/infiltrator.test.ts b/test/abilities/infiltrator.test.ts index a5de035a136..9f1eed466b9 100644 --- a/test/abilities/infiltrator.test.ts +++ b/test/abilities/infiltrator.test.ts @@ -1,13 +1,13 @@ +import { allMoves } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { Stat } from "#enums/stat"; -import { StatusEffect } from "#enums/status-effect"; -import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/insomnia.test.ts b/test/abilities/insomnia.test.ts index 800663823c3..2f683b516eb 100644 --- a/test/abilities/insomnia.test.ts +++ b/test/abilities/insomnia.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/intimidate.test.ts b/test/abilities/intimidate.test.ts index 3dcd9bcd129..9ff408aaeb5 100644 --- a/test/abilities/intimidate.test.ts +++ b/test/abilities/intimidate.test.ts @@ -1,12 +1,10 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { UiMode } from "#enums/ui-mode"; -import { Stat } from "#enums/stat"; -import { getMovePosition } from "#test/testUtils/gameManagerUtils"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - Intimidate", () => { let phaserGame: Phaser.Game; @@ -25,109 +23,68 @@ describe("Abilities - Intimidate", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override + .criticalHits(false) .battleStyle("single") .enemySpecies(SpeciesId.RATTATA) .enemyAbility(AbilityId.INTIMIDATE) - .enemyPassiveAbility(AbilityId.HYDRATION) .ability(AbilityId.INTIMIDATE) - .startingWave(3) + .passiveAbility(AbilityId.NO_GUARD) .enemyMoveset(MoveId.SPLASH); }); - it("should lower ATK stat stage by 1 of enemy Pokemon on entry and player switch", async () => { - await game.classicMode.runToSummon([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]); - game.onNextPrompt( - "CheckSwitchPhase", - UiMode.CONFIRM, - () => { - game.setMode(UiMode.MESSAGE); - game.endPhase(); - }, - () => game.isCurrentPhase("CommandPhase") || game.isCurrentPhase("TurnInitPhase"), - ); - await game.phaseInterceptor.to("CommandPhase", false); + it("should lower all opponents' ATK by 1 stage on entry and switch", async () => { + await game.classicMode.startBattle([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]); - let playerPokemon = game.scene.getPlayerPokemon()!; - const enemyPokemon = game.scene.getEnemyPokemon()!; - - expect(playerPokemon.species.speciesId).toBe(SpeciesId.MIGHTYENA); - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); + const enemy = game.field.getEnemyPokemon(); + expect(enemy.getStatStage(Stat.ATK)).toBe(-1); game.doSwitchPokemon(1); - await game.phaseInterceptor.run("CommandPhase"); - await game.phaseInterceptor.to("CommandPhase"); - - playerPokemon = game.scene.getPlayerPokemon()!; - expect(playerPokemon.species.speciesId).toBe(SpeciesId.POOCHYENA); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0); - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-2); - }); - - it("should lower ATK stat stage by 1 for every enemy Pokemon in a double battle on entry", async () => { - game.override.battleStyle("double").startingWave(3); - await game.classicMode.runToSummon([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]); - game.onNextPrompt( - "CheckSwitchPhase", - UiMode.CONFIRM, - () => { - game.setMode(UiMode.MESSAGE); - game.endPhase(); - }, - () => game.isCurrentPhase("CommandPhase") || game.isCurrentPhase("TurnInitPhase"), - ); - await game.phaseInterceptor.to("CommandPhase", false); - - const playerField = game.scene.getPlayerField()!; - const enemyField = game.scene.getEnemyField()!; - - expect(enemyField[0].getStatStage(Stat.ATK)).toBe(-2); - expect(enemyField[1].getStatStage(Stat.ATK)).toBe(-2); - expect(playerField[0].getStatStage(Stat.ATK)).toBe(-2); - expect(playerField[1].getStatStage(Stat.ATK)).toBe(-2); - }); - - it("should not activate again if there is no switch or new entry", async () => { - game.override.startingWave(2).moveset([MoveId.SPLASH]); - await game.classicMode.startBattle([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]); - - const playerPokemon = game.scene.getPlayerPokemon()!; - const enemyPokemon = game.scene.getEnemyPokemon()!; - - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); - - game.move.select(MoveId.SPLASH); await game.toNextTurn(); - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); + expect(enemy.getStatStage(Stat.ATK)).toBe(-2); }); - it("should lower ATK stat stage by 1 for every switch", async () => { - game.override.moveset([MoveId.SPLASH]).enemyMoveset([MoveId.VOLT_SWITCH]).startingWave(5); - await game.classicMode.startBattle([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]); + it("should lower ATK of all opponents in a double battle", async () => { + game.override.battleStyle("double"); + await game.classicMode.startBattle([SpeciesId.MIGHTYENA]); - const playerPokemon = game.scene.getPlayerPokemon()!; - let enemyPokemon = game.scene.getEnemyPokemon()!; + const [enemy1, enemy2] = game.scene.getEnemyField(); - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); + expect(enemy1.getStatStage(Stat.ATK)).toBe(-1); + expect(enemy2.getStatStage(Stat.ATK)).toBe(-1); + }); - game.move.select(getMovePosition(game.scene, 0, MoveId.SPLASH)); + it("should not trigger on switching moves used by wild Pokemon", async () => { + game.override.enemyMoveset(MoveId.VOLT_SWITCH); + await game.classicMode.startBattle([SpeciesId.VENUSAUR]); + + const player = game.field.getPlayerPokemon(); + expect(player.getStatStage(Stat.ATK)).toBe(-1); + + game.move.use(MoveId.SPLASH); await game.toNextTurn(); - enemyPokemon = game.scene.getEnemyPokemon()!; + // doesn't lower attack due to not actually switching out + expect(player.getStatStage(Stat.ATK)).toBe(-1); + }); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-2); - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + it("should trigger on moves that switch user/target out during trainer battles", async () => { + game.override.startingWave(5).enemyLevel(100); + await game.classicMode.startBattle([SpeciesId.MIGHTYENA]); - game.move.select(MoveId.SPLASH); + const player = game.field.getPlayerPokemon(); + expect(player.getStatStage(Stat.ATK)).toBe(-1); + + game.move.use(MoveId.SPLASH); + await game.move.forceEnemyMove(MoveId.TELEPORT); await game.toNextTurn(); - enemyPokemon = game.scene.getEnemyPokemon()!; + expect(player.getStatStage(Stat.ATK)).toBe(-2); - expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-3); - expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + game.move.use(MoveId.DRAGON_TAIL); + await game.move.forceEnemyMove(MoveId.SPLASH); + await game.toNextTurn(); + + expect(player.getStatStage(Stat.ATK)).toBe(-3); }); }); diff --git a/test/abilities/intrepid_sword.test.ts b/test/abilities/intrepid_sword.test.ts index d9b81e9552e..7465b331791 100644 --- a/test/abilities/intrepid_sword.test.ts +++ b/test/abilities/intrepid_sword.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; -import { CommandPhase } from "#app/phases/command-phase"; import { AbilityId } from "#enums/ability-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/libero.test.ts b/test/abilities/libero.test.ts deleted file mode 100644 index eaa2630e90d..00000000000 --- a/test/abilities/libero.test.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { allMoves } from "#app/data/data-lists"; -import { PokemonType } from "#enums/pokemon-type"; -import { Weather } from "#app/data/weather"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { BiomeId } from "#enums/biome-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; - -describe("Abilities - Libero", () => { - let phaserGame: Phaser.Game; - let game: GameManager; - - beforeAll(() => { - phaserGame = new Phaser.Game({ - type: Phaser.HEADLESS, - }); - }); - - afterEach(() => { - game.phaseInterceptor.restoreOg(); - }); - - beforeEach(() => { - game = new GameManager(phaserGame); - game.override - .battleStyle("single") - .ability(AbilityId.LIBERO) - .startingLevel(100) - .enemySpecies(SpeciesId.RATTATA) - .enemyMoveset(MoveId.ENDURE); - }); - - test("ability applies and changes a pokemon's type", async () => { - game.override.moveset([MoveId.SPLASH]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.SPLASH); - }); - - // Test for Gen9+ functionality, we are using previous funcionality - test.skip("ability applies only once per switch in", async () => { - game.override.moveset([MoveId.SPLASH, MoveId.AGILITY]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.BULBASAUR]); - - let leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.SPLASH); - - game.move.select(MoveId.AGILITY); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO); - const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]]; - const moveType = PokemonType[allMoves[MoveId.AGILITY].type]; - expect(leadPokemonType).not.toBe(moveType); - - await game.toNextTurn(); - game.doSwitchPokemon(1); - await game.toNextTurn(); - game.doSwitchPokemon(1); - await game.toNextTurn(); - - leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.SPLASH); - }); - - test("ability applies correctly even if the pokemon's move has a variable type", async () => { - game.override.moveset([MoveId.WEATHER_BALL]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.scene.arena.weather = new Weather(WeatherType.SUNNY); - game.move.select(MoveId.WEATHER_BALL); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO); - expect(leadPokemon.getTypes()).toHaveLength(1); - const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], - moveType = PokemonType[PokemonType.FIRE]; - expect(leadPokemonType).toBe(moveType); - }); - - test("ability applies correctly even if the type has changed by another ability", async () => { - game.override.moveset([MoveId.TACKLE]).passiveAbility(AbilityId.REFRIGERATE); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO); - expect(leadPokemon.getTypes()).toHaveLength(1); - const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], - moveType = PokemonType[PokemonType.ICE]; - expect(leadPokemonType).toBe(moveType); - }); - - test("ability applies correctly even if the pokemon's move calls another move", async () => { - game.override.moveset([MoveId.NATURE_POWER]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.scene.arena.biomeType = BiomeId.MOUNTAIN; - game.move.select(MoveId.NATURE_POWER); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.AIR_SLASH); - }); - - test("ability applies correctly even if the pokemon's move is delayed / charging", async () => { - game.override.moveset([MoveId.DIG]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.DIG); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.DIG); - }); - - test("ability applies correctly even if the pokemon's move misses", async () => { - game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.SPLASH); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.move.forceMiss(); - await game.phaseInterceptor.to(TurnEndPhase); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon.isFullHp()).toBe(true); - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TACKLE); - }); - - test("ability applies correctly even if the pokemon's move is protected against", async () => { - game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.PROTECT); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TACKLE); - }); - - test("ability applies correctly even if the pokemon's move fails because of type immunity", async () => { - game.override.moveset([MoveId.TACKLE]).enemySpecies(SpeciesId.GASTLY); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TACKLE); - }); - - test("ability is not applied if pokemon's type is the same as the move's type", async () => { - game.override.moveset([MoveId.SPLASH]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - leadPokemon.summonData.types = [allMoves[MoveId.SPLASH].type]; - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO); - }); - - test("ability is not applied if pokemon is terastallized", async () => { - game.override.moveset([MoveId.SPLASH]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - leadPokemon.isTerastallized = true; - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO); - }); - - test("ability is not applied if pokemon uses struggle", async () => { - game.override.moveset([MoveId.STRUGGLE]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.STRUGGLE); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO); - }); - - test("ability is not applied if the pokemon's move fails", async () => { - game.override.moveset([MoveId.BURN_UP]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.BURN_UP); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO); - }); - - test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { - game.override.moveset([MoveId.TRICK_OR_TREAT]).enemySpecies(SpeciesId.GASTLY); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TRICK_OR_TREAT); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TRICK_OR_TREAT); - }); - - test("ability applies correctly and the pokemon curses itself", async () => { - game.override.moveset([MoveId.CURSE]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.CURSE); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.CURSE); - expect(leadPokemon.getTag(BattlerTagType.CURSED)).not.toBe(undefined); - }); -}); - -function testPokemonTypeMatchesDefaultMoveType(pokemon: PlayerPokemon, move: MoveId) { - expect(pokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO); - expect(pokemon.getTypes()).toHaveLength(1); - const pokemonType = PokemonType[pokemon.getTypes()[0]], - moveType = PokemonType[allMoves[move].type]; - expect(pokemonType).toBe(moveType); -} diff --git a/test/abilities/lightningrod.test.ts b/test/abilities/lightningrod.test.ts index 2dc29500454..2d5b6881869 100644 --- a/test/abilities/lightningrod.test.ts +++ b/test/abilities/lightningrod.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -36,10 +36,8 @@ describe("Abilities - Lightningrod", () => { it("should redirect electric type moves", async () => { await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); - const enemy1 = game.scene.getEnemyField()[0]; - const enemy2 = game.scene.getEnemyField()[1]; - - enemy2.summonData.ability = AbilityId.LIGHTNING_ROD; + const [enemy1, enemy2] = game.scene.getEnemyField(); + game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD); game.move.select(MoveId.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -52,10 +50,8 @@ describe("Abilities - Lightningrod", () => { game.override.moveset([MoveId.SPLASH, MoveId.AERIAL_ACE]); await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); - const enemy1 = game.scene.getEnemyField()[0]; - const enemy2 = game.scene.getEnemyField()[1]; - - enemy2.summonData.ability = AbilityId.LIGHTNING_ROD; + const [enemy1, enemy2] = game.scene.getEnemyField(); + game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD); game.move.select(MoveId.AERIAL_ACE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -68,8 +64,7 @@ describe("Abilities - Lightningrod", () => { await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); const enemy2 = game.scene.getEnemyField()[1]; - - enemy2.summonData.ability = AbilityId.LIGHTNING_ROD; + game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD); game.move.select(MoveId.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -81,31 +76,25 @@ describe("Abilities - Lightningrod", () => { it("should not redirect moves changed from electric type via ability", async () => { game.override.ability(AbilityId.NORMALIZE); - await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); - const enemy1 = game.scene.getEnemyField()[0]; - const enemy2 = game.scene.getEnemyField()[1]; - - enemy2.summonData.ability = AbilityId.LIGHTNING_ROD; + const [enemy1, enemy2] = game.scene.getEnemyField(); + game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD); game.move.select(MoveId.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); - game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); await game.phaseInterceptor.to("BerryPhase"); expect(enemy1.isFullHp()).toBe(false); }); it("should redirect moves changed to electric type via ability", async () => { - game.override.ability(AbilityId.GALVANIZE).moveset(MoveId.TACKLE); - await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); + game.override.ability(AbilityId.GALVANIZE); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); - const enemy1 = game.scene.getEnemyField()[0]; - const enemy2 = game.scene.getEnemyField()[1]; + const [enemy1, enemy2] = game.scene.getEnemyField(); + game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD); - enemy2.summonData.ability = AbilityId.LIGHTNING_ROD; - - game.move.select(MoveId.TACKLE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); - game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); + game.move.use(MoveId.TACKLE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); await game.phaseInterceptor.to("BerryPhase"); expect(enemy1.isFullHp()).toBe(true); diff --git a/test/abilities/limber.test.ts b/test/abilities/limber.test.ts index 77acd8b3dab..ed140c09fb1 100644 --- a/test/abilities/limber.test.ts +++ b/test/abilities/limber.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/magic_bounce.test.ts b/test/abilities/magic_bounce.test.ts index 04bfcbbfe8f..84b4cea8376 100644 --- a/test/abilities/magic_bounce.test.ts +++ b/test/abilities/magic_bounce.test.ts @@ -1,15 +1,14 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allAbilities } from "#app/data/data-lists"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { Stat } from "#app/enums/stat"; -import { StatusEffect } from "#app/enums/status-effect"; +import { allAbilities, allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Magic Bounce", () => { @@ -160,7 +159,8 @@ describe("Abilities - Magic Bounce", () => { expect(game.scene.getEnemyPokemon()!.getTag(BattlerTagType.CURSED)).toBeDefined(); }); - it("should not cause encore to be interrupted after bouncing", async () => { + // TODO: enable when Magic Bounce is fixed to properly reset the hit count + it.todo("should not cause encore to be interrupted after bouncing", async () => { game.override.moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE]).enemyMoveset([MoveId.TACKLE, MoveId.GROWL]); // game.override.ability(AbilityId.MOLD_BREAKER); await game.classicMode.startBattle([SpeciesId.MAGIKARP]); @@ -168,7 +168,7 @@ describe("Abilities - Magic Bounce", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; // Give the player MOLD_BREAKER for this turn to bypass Magic Bounce. - vi.spyOn(playerPokemon, "getAbility").mockReturnValue(allAbilities[AbilityId.MOLD_BREAKER]); + const playerAbilitySpy = game.field.mockAbility(playerPokemon, AbilityId.MOLD_BREAKER); // turn 1 game.move.select(MoveId.ENCORE); @@ -178,7 +178,7 @@ describe("Abilities - Magic Bounce", () => { expect(enemyPokemon.getTag(BattlerTagType.ENCORE)!["moveId"]).toBe(MoveId.TACKLE); // turn 2 - vi.spyOn(playerPokemon, "getAbility").mockRestore(); + playerAbilitySpy.mockRestore(); game.move.select(MoveId.GROWL); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to("BerryPhase"); diff --git a/test/abilities/magic_guard.test.ts b/test/abilities/magic_guard.test.ts index f135a761bba..b1b7ee6765b 100644 --- a/test/abilities/magic_guard.test.ts +++ b/test/abilities/magic_guard.test.ts @@ -1,15 +1,15 @@ -import { getArenaTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { getArenaTag } from "#data/arena-tag"; +import { getStatusEffectCatchRateMultiplier } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/magma_armor.test.ts b/test/abilities/magma_armor.test.ts index 0a8f3024291..cc40ea9f679 100644 --- a/test/abilities/magma_armor.test.ts +++ b/test/abilities/magma_armor.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/mimicry.test.ts b/test/abilities/mimicry.test.ts index 7ac7aeb599f..f377ab89ffe 100644 --- a/test/abilities/mimicry.test.ts +++ b/test/abilities/mimicry.test.ts @@ -1,8 +1,8 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { PokemonType } from "#enums/pokemon-type"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/mirror_armor.test.ts b/test/abilities/mirror_armor.test.ts index 71b072c7d06..4d4ee973527 100644 --- a/test/abilities/mirror_armor.test.ts +++ b/test/abilities/mirror_armor.test.ts @@ -1,11 +1,11 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerIndex } from "#enums/battler-index"; // TODO: When Magic Bounce is implemented, make a test for its interaction with mirror guard, use screech diff --git a/test/abilities/mold_breaker.test.ts b/test/abilities/mold_breaker.test.ts index 28a077e8908..c3214cdc224 100644 --- a/test/abilities/mold_breaker.test.ts +++ b/test/abilities/mold_breaker.test.ts @@ -1,9 +1,7 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { globalScene } from "#app/global-scene"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -24,29 +22,28 @@ describe("Abilities - Mold Breaker", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([MoveId.SPLASH]) .ability(AbilityId.MOLD_BREAKER) .battleStyle("single") .criticalHits(false) .enemySpecies(SpeciesId.MAGIKARP) - .enemyAbility(AbilityId.BALL_FETCH) + .enemyAbility(AbilityId.STURDY) .enemyMoveset(MoveId.SPLASH); }); it("should turn off the ignore abilities arena variable after the user's move", async () => { - game.override - .enemyMoveset(MoveId.SPLASH) - .ability(AbilityId.MOLD_BREAKER) - .moveset([MoveId.ERUPTION]) - .startingLevel(100) - .enemyLevel(2); - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - const enemy = game.scene.getEnemyPokemon()!; + await game.classicMode.startBattle([SpeciesId.PINSIR]); - expect(enemy.isFainted()).toBe(false); - game.move.select(MoveId.SPLASH); - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); - await game.phaseInterceptor.to("MoveEndPhase", true); - expect(globalScene.arena.ignoreAbilities).toBe(false); + const player = game.field.getPlayerPokemon(); + const enemy = game.field.getEnemyPokemon(); + + game.move.use(MoveId.X_SCISSOR); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(game.scene.arena.ignoreAbilities).toBe(true); + expect(game.scene.arena.ignoringEffectSource).toBe(player.getBattlerIndex()); + + await game.toEndOfTurn(); + expect(game.scene.arena.ignoreAbilities).toBe(false); + expect(enemy.isFainted()).toBe(true); }); }); diff --git a/test/abilities/moody.test.ts b/test/abilities/moody.test.ts index bca3d57a70a..150456bc0f7 100644 --- a/test/abilities/moody.test.ts +++ b/test/abilities/moody.test.ts @@ -1,8 +1,8 @@ -import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/moxie.test.ts b/test/abilities/moxie.test.ts index a85ed081448..882b4b0df2f 100644 --- a/test/abilities/moxie.test.ts +++ b/test/abilities/moxie.test.ts @@ -1,14 +1,14 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { VictoryPhase } from "#phases/victory-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerIndex } from "#enums/battler-index"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { VictoryPhase } from "#app/phases/victory-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; describe("Abilities - Moxie", () => { let phaserGame: Phaser.Game; @@ -65,8 +65,7 @@ describe("Abilities - Moxie", () => { secondPokemon.hp = 1; - game.move.select(moveToUse); - game.selectTarget(BattlerIndex.PLAYER_2); + game.move.select(moveToUse, BattlerIndex.PLAYER_2); await game.phaseInterceptor.to(TurnEndPhase); diff --git a/test/abilities/mummy.test.ts b/test/abilities/mummy.test.ts index d6c40541d25..6c94fea407b 100644 --- a/test/abilities/mummy.test.ts +++ b/test/abilities/mummy.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/mycelium_might.test.ts b/test/abilities/mycelium_might.test.ts index 56af51c00f7..fa3ab8e5301 100644 --- a/test/abilities/mycelium_might.test.ts +++ b/test/abilities/mycelium_might.test.ts @@ -1,10 +1,10 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; -import { Stat } from "#enums/stat"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/neutralizing_gas.test.ts b/test/abilities/neutralizing_gas.test.ts index f153e71587e..bcc00e4249a 100644 --- a/test/abilities/neutralizing_gas.test.ts +++ b/test/abilities/neutralizing_gas.test.ts @@ -1,13 +1,14 @@ -import { BattlerIndex } from "#enums/battler-index"; -import type { CommandPhase } from "#app/phases/command-phase"; -import { Command } from "#enums/command"; +import { globalScene } from "#app/global-scene"; import { AbilityId } from "#enums/ability-id"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { Command } from "#enums/command"; import { MoveId } from "#enums/move-id"; import { PokeballType } from "#enums/pokeball"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import type { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -164,6 +165,7 @@ describe("Abilities - Neutralizing Gas", () => { expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined(); vi.spyOn(game.scene.getPlayerPokemon()!, "randBattleSeedInt").mockReturnValue(0); + vi.spyOn(globalScene, "randBattleSeedInt").mockReturnValue(0); const commandPhase = game.scene.phaseManager.getCurrentPhase() as CommandPhase; commandPhase.handleCommand(Command.RUN, 0); diff --git a/test/abilities/no_guard.test.ts b/test/abilities/no_guard.test.ts index dc35e0e1b9a..f6f55ce3b80 100644 --- a/test/abilities/no_guard.test.ts +++ b/test/abilities/no_guard.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { HitCheckResult } from "#enums/hit-check-result"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { HitCheckResult } from "#enums/hit-check-result"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - No Guard", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/normal-move-type-change.test.ts b/test/abilities/normal-move-type-change.test.ts index d9e39b32a7c..aa673ddde29 100644 --- a/test/abilities/normal-move-type-change.test.ts +++ b/test/abilities/normal-move-type-change.test.ts @@ -1,15 +1,14 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import { PokemonType } from "#enums/pokemon-type"; +import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants"; +import { allAbilities, allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants"; -import { allAbilities } from "#app/data/data-lists"; -import { toDmgValue } from "#app/utils/common"; /** * Tests for abilities that change the type of normal moves to diff --git a/test/abilities/normalize.test.ts b/test/abilities/normalize.test.ts index 1a4b93f3f32..1128dd1a562 100644 --- a/test/abilities/normalize.test.ts +++ b/test/abilities/normalize.test.ts @@ -1,11 +1,11 @@ import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants"; -import { allMoves } from "#app/data/data-lists"; -import { toDmgValue } from "#app/utils/common"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/oblivious.test.ts b/test/abilities/oblivious.test.ts index dab8394edd0..8b18fe65455 100644 --- a/test/abilities/oblivious.test.ts +++ b/test/abilities/oblivious.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/own_tempo.test.ts b/test/abilities/own_tempo.test.ts index 869953b4e93..bdb247c4987 100644 --- a/test/abilities/own_tempo.test.ts +++ b/test/abilities/own_tempo.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/parental_bond.test.ts b/test/abilities/parental_bond.test.ts index fd914b86100..4937857c8e1 100644 --- a/test/abilities/parental_bond.test.ts +++ b/test/abilities/parental_bond.test.ts @@ -1,12 +1,12 @@ -import { PokemonType } from "#enums/pokemon-type"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { toDmgValue } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -193,6 +193,7 @@ describe("Abilities - Parental Bond", () => { expect(leadPokemon.turnData.hitCount).toBe(2); }); + // TODO: consolidate all these tests into 1 block it("should only trigger post-target move effects once", async () => { game.override.moveset([MoveId.MIND_BLOWN]); @@ -233,42 +234,6 @@ describe("Abilities - Parental Bond", () => { expect(leadPokemon.isOfType(PokemonType.FIRE)).toBe(false); }); - it("Moves boosted by this ability and Multi-Lens should strike 3 times", async () => { - game.override.moveset([MoveId.TACKLE]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - - game.move.select(MoveId.TACKLE); - - await game.phaseInterceptor.to("DamageAnimPhase"); - - expect(leadPokemon.turnData.hitCount).toBe(3); - }); - - it("Seismic Toss boosted by this ability and Multi-Lens should strike 3 times", async () => { - game.override.moveset([MoveId.SEISMIC_TOSS]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - const enemyPokemon = game.scene.getEnemyPokemon()!; - - const enemyStartingHp = enemyPokemon.hp; - - game.move.select(MoveId.SEISMIC_TOSS); - await game.move.forceHit(); - - await game.phaseInterceptor.to("DamageAnimPhase"); - - expect(leadPokemon.turnData.hitCount).toBe(3); - - await game.phaseInterceptor.to("MoveEndPhase", false); - - expect(enemyPokemon.hp).toBe(enemyStartingHp - 200); - }); - it("Hyper Beam boosted by this ability should strike twice, then recharge", async () => { game.override.moveset([MoveId.HYPER_BEAM]); diff --git a/test/abilities/pastel_veil.test.ts b/test/abilities/pastel_veil.test.ts index b8e8873ed36..47fdd751931 100644 --- a/test/abilities/pastel_veil.test.ts +++ b/test/abilities/pastel_veil.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { CommandPhase } from "#phases/command-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/perish_body.test.ts b/test/abilities/perish_body.test.ts index 4852533816b..83a862164a1 100644 --- a/test/abilities/perish_body.test.ts +++ b/test/abilities/perish_body.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/power_construct.test.ts b/test/abilities/power_construct.test.ts index 2ea14597ef9..0917082d7bd 100644 --- a/test/abilities/power_construct.test.ts +++ b/test/abilities/power_construct.test.ts @@ -1,11 +1,11 @@ -import { Status } from "#app/data/status-effect"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Abilities - POWER CONSTRUCT", () => { diff --git a/test/abilities/power_spot.test.ts b/test/abilities/power_spot.test.ts index 11f75588386..f07ece17245 100644 --- a/test/abilities/power_spot.test.ts +++ b/test/abilities/power_spot.test.ts @@ -1,10 +1,10 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/protean-libero.test.ts b/test/abilities/protean-libero.test.ts new file mode 100644 index 00000000000..35be3fcf63d --- /dev/null +++ b/test/abilities/protean-libero.test.ts @@ -0,0 +1,272 @@ +import { allMoves } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import type { PlayerPokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Abilities - Protean/Libero", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleStyle("single") + .ability(AbilityId.PROTEAN) + .startingLevel(100) + .moveset([MoveId.CURSE, MoveId.DIG, MoveId.SPLASH]) + .enemySpecies(SpeciesId.RATTATA) + .enemyMoveset(MoveId.SPLASH); + }); + + /** + * Assert that the protean/libero ability triggered to change the user's type to + * the type of its most recently used move. + * Takes into account type overrides from effects. + * @param pokemon - The {@linkcode PlayerPokemon} being checked. + * @remarks + * This will clear the given Pokemon's `abilitiesApplied` set after being called to allow for easier multi-turn testing. + */ + function expectTypeChange(pokemon: PlayerPokemon) { + expect(pokemon.waveData.abilitiesApplied).toContainEqual(expect.toBeOneOf([AbilityId.PROTEAN, AbilityId.LIBERO])); + const lastMove = allMoves[pokemon.getLastXMoves()[0].move]!; + + const pokemonTypes = pokemon.getTypes().map(pt => PokemonType[pt]); + const moveType = PokemonType[pokemon.getMoveType(lastMove)]; + expect(pokemonTypes).toEqual([moveType]); + pokemon.waveData.abilitiesApplied.clear(); + } + + /** + * Assert that the protean/libero ability did NOT trigger to change the user's type to + * the type of its most recently used move. + * Takes into account type overrides from effects. + * @param pokemon - The {@linkcode PlayerPokemon} being checked. + * @remarks + * This will clear the given Pokemon's `abilitiesApplied` set after being called to allow for easier multi-turn testing. + */ + function expectNoTypeChange(pokemon: PlayerPokemon) { + expect(pokemon.waveData.abilitiesApplied).not.toContainEqual( + expect.toBeOneOf([AbilityId.PROTEAN, AbilityId.LIBERO]), + ); + const lastMove = allMoves[pokemon.getLastXMoves()[0].move]!; + + const pokemonTypes = pokemon.getTypes().map(pt => PokemonType[pt]); + const moveType = PokemonType[pokemon.getMoveType(lastMove, true)]; + expect(pokemonTypes).not.toEqual([moveType]); + pokemon.waveData.abilitiesApplied.clear(); + } + + it.each([ + { name: "Protean", ability: AbilityId.PROTEAN }, + { name: "Libero", ability: AbilityId.PROTEAN }, + ])("$name should change the user's type to the type of the move being used", async ({ ability }) => { + game.override.ability(ability); + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const leadPokemon = game.field.getPlayerPokemon(); + + game.move.use(MoveId.SPLASH); + await game.toEndOfTurn(); + + expectTypeChange(leadPokemon); + }); + + // Test for Gen9+ functionality, we are using previous funcionality + it.skip("should apply only once per switch in", async () => { + game.override.moveset([MoveId.SPLASH, MoveId.AGILITY]); + await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.BULBASAUR]); + + const bulbasaur = game.field.getPlayerPokemon(); + + game.move.select(MoveId.SPLASH); + await game.toEndOfTurn(); + + expectTypeChange(bulbasaur); + + game.move.select(MoveId.AGILITY); + await game.toEndOfTurn(); + + expectNoTypeChange(bulbasaur); + + // switch out and back in + game.doSwitchPokemon(1); + await game.toNextTurn(); + game.doSwitchPokemon(1); + await game.toNextTurn(); + + expect(bulbasaur.isOnField()).toBe(true); + + game.move.select(MoveId.SPLASH); + await game.toEndOfTurn(); + + expectTypeChange(bulbasaur); + }); + + it.each<{ category: string; move?: MoveId; passive?: AbilityId; enemyMove?: MoveId }>([ + { category: "Variable type Moves'", move: MoveId.WEATHER_BALL, passive: AbilityId.DROUGHT }, + { category: "Type Change Abilities'", passive: AbilityId.REFRIGERATE }, + { category: "Move-calling Moves'", move: MoveId.NATURE_POWER, passive: AbilityId.PSYCHIC_SURGE }, + { category: "Ion Deluge's", enemyMove: MoveId.ION_DELUGE }, + { category: "Electrify's", enemyMove: MoveId.ELECTRIFY }, + ])( + "should respect $category final type", + async ({ move = MoveId.TACKLE, passive = AbilityId.NONE, enemyMove = MoveId.SPLASH }) => { + game.override.passiveAbility(passive); + await game.classicMode.startBattle([SpeciesId.LINOONE]); // Pure normal type for move overrides + + const linoone = game.field.getPlayerPokemon(); + + game.move.use(move); + await game.move.forceEnemyMove(enemyMove); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + // We stop before running `TurnEndPhase` so that the effects of `BattlerTag`s (such as from Electrify) + // are still active when checking the move's type + await game.phaseInterceptor.to("TurnEndPhase", false); + + expectTypeChange(linoone); + }, + ); + + it.each<{ cause: string; move?: MoveId; passive?: AbilityId; enemyMove?: MoveId }>([ + { cause: "misses", move: MoveId.FOCUS_BLAST }, + { cause: "is protected against", enemyMove: MoveId.PROTECT }, + { cause: "is ineffective", move: MoveId.EARTHQUAKE }, + { cause: "matches only one of its types", move: MoveId.NIGHT_SLASH }, + { cause: "is blocked by terrain", move: MoveId.SHADOW_SNEAK, passive: AbilityId.PSYCHIC_SURGE }, + ])( + "should still trigger if the user's move $cause", + async ({ move = MoveId.TACKLE, passive = AbilityId.NONE, enemyMove = MoveId.SPLASH }) => { + game.override.passiveAbility(passive).enemySpecies(SpeciesId.SKARMORY); + await game.classicMode.startBattle([SpeciesId.MEOWSCARADA]); + + vi.spyOn(allMoves[MoveId.FOCUS_BLAST], "accuracy", "get").mockReturnValue(0); + + const meow = game.field.getPlayerPokemon(); + + game.move.use(move); + await game.move.forceEnemyMove(enemyMove); + await game.toEndOfTurn(); + + expectTypeChange(meow); + }, + ); + + it.each<{ cause: string; move?: MoveId; tera?: boolean; passive?: AbilityId }>([ + { cause: "user is terastallized to any type", tera: true }, + { cause: "user uses Struggle", move: MoveId.STRUGGLE }, + { cause: "the user's move is blocked by weather", move: MoveId.FIRE_BLAST, passive: AbilityId.PRIMORDIAL_SEA }, + { cause: "the user's move fails", move: MoveId.BURN_UP }, + ])("should not apply if $cause", async ({ move = MoveId.TACKLE, tera = false, passive = AbilityId.NONE }) => { + game.override.enemyPassiveAbility(passive); + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const karp = game.field.getPlayerPokemon(); + + karp.teraType = PokemonType.STEEL; + + game.move.use(move, BattlerIndex.PLAYER, undefined, tera); + await game.toEndOfTurn(); + + expectNoTypeChange(karp); + }); + + it("should not apply if user is already the move's type", async () => { + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const karp = game.field.getPlayerPokemon(); + + game.move.use(MoveId.WATERFALL); + await game.toEndOfTurn(); + + expect(karp.waveData.abilitiesApplied.size).toBe(0); + expect(karp.getTypes()).toEqual([allMoves[MoveId.WATERFALL].type]); + }); + + it.each<{ moveName: string; move: MoveId }>([ + { moveName: "Roar", move: MoveId.ROAR }, + { moveName: "Whirlwind", move: MoveId.WHIRLWIND }, + { moveName: "Forest's Curse", move: MoveId.FORESTS_CURSE }, + { moveName: "Trick-or-Treat", move: MoveId.TRICK_OR_TREAT }, + ])("should still apply if the user's $moveName fails", async ({ move }) => { + game.override.battleType(BattleType.TRAINER).enemySpecies(SpeciesId.TREVENANT); // ghost/grass makes both moves fail + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const leadPokemon = game.field.getPlayerPokemon(); + + game.move.use(move); + // KO all off-field opponents for Whirlwind and co. + for (const enemyMon of game.scene.getEnemyParty()) { + if (!enemyMon.isActive()) { + enemyMon.hp = 0; + } + } + await game.toEndOfTurn(); + + expectTypeChange(leadPokemon); + }); + + it("should trigger on the first turn of charging moves", async () => { + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const karp = game.field.getPlayerPokemon(); + + game.move.select(MoveId.DIG); + await game.toEndOfTurn(); + + expectTypeChange(karp); + + await game.toEndOfTurn(); + expect(karp.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN); + }); + + it("should cause the user to cast Ghost-type Curse on itself", async () => { + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const karp = game.field.getPlayerPokemon(); + expect(karp.isOfType(PokemonType.GHOST)).toBe(false); + + game.move.select(MoveId.CURSE); + await game.toEndOfTurn(); + + expectTypeChange(karp); + expect(karp.getHpRatio(true)).toBeCloseTo(0.25); + expect(karp.getTag(BattlerTagType.CURSED)).toBeDefined(); + }); + + it("should not trigger during Focus Punch's start-of-turn message or being interrupted", async () => { + game.override.moveset(MoveId.FOCUS_PUNCH).enemyMoveset(MoveId.ABSORB); + await game.classicMode.startBattle([SpeciesId.MAGIKARP]); + + const karp = game.field.getPlayerPokemon(); + expect(karp.isOfType(PokemonType.FIGHTING)).toBe(false); + + game.move.select(MoveId.FOCUS_PUNCH); + + await game.phaseInterceptor.to("MessagePhase"); + expect(karp.isOfType(PokemonType.FIGHTING)).toBe(false); + + await game.toEndOfTurn(); + + expectNoTypeChange(karp); + expect(karp.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + }); +}); diff --git a/test/abilities/protean.test.ts b/test/abilities/protean.test.ts deleted file mode 100644 index 09c9addbc35..00000000000 --- a/test/abilities/protean.test.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { allMoves } from "#app/data/data-lists"; -import { PokemonType } from "#enums/pokemon-type"; -import { Weather } from "#app/data/weather"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { BiomeId } from "#enums/biome-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; - -describe("Abilities - Protean", () => { - let phaserGame: Phaser.Game; - let game: GameManager; - - beforeAll(() => { - phaserGame = new Phaser.Game({ - type: Phaser.HEADLESS, - }); - }); - - afterEach(() => { - game.phaseInterceptor.restoreOg(); - }); - - beforeEach(() => { - game = new GameManager(phaserGame); - game.override - .battleStyle("single") - .ability(AbilityId.PROTEAN) - .startingLevel(100) - .enemySpecies(SpeciesId.RATTATA) - .enemyMoveset(MoveId.ENDURE); - }); - - test("ability applies and changes a pokemon's type", async () => { - game.override.moveset([MoveId.SPLASH]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.SPLASH); - }); - - // Test for Gen9+ functionality, we are using previous funcionality - test.skip("ability applies only once per switch in", async () => { - game.override.moveset([MoveId.SPLASH, MoveId.AGILITY]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.BULBASAUR]); - - let leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.SPLASH); - - game.move.select(MoveId.AGILITY); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN); - const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]]; - const moveType = PokemonType[allMoves[MoveId.AGILITY].type]; - expect(leadPokemonType).not.toBe(moveType); - - await game.toNextTurn(); - game.doSwitchPokemon(1); - await game.toNextTurn(); - game.doSwitchPokemon(1); - await game.toNextTurn(); - - leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.SPLASH); - }); - - test("ability applies correctly even if the pokemon's move has a variable type", async () => { - game.override.moveset([MoveId.WEATHER_BALL]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.scene.arena.weather = new Weather(WeatherType.SUNNY); - game.move.select(MoveId.WEATHER_BALL); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN); - expect(leadPokemon.getTypes()).toHaveLength(1); - const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], - moveType = PokemonType[PokemonType.FIRE]; - expect(leadPokemonType).toBe(moveType); - }); - - test("ability applies correctly even if the type has changed by another ability", async () => { - game.override.moveset([MoveId.TACKLE]).passiveAbility(AbilityId.REFRIGERATE); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN); - expect(leadPokemon.getTypes()).toHaveLength(1); - const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], - moveType = PokemonType[PokemonType.ICE]; - expect(leadPokemonType).toBe(moveType); - }); - - test("ability applies correctly even if the pokemon's move calls another move", async () => { - game.override.moveset([MoveId.NATURE_POWER]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.scene.arena.biomeType = BiomeId.MOUNTAIN; - game.move.select(MoveId.NATURE_POWER); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.AIR_SLASH); - }); - - test("ability applies correctly even if the pokemon's move is delayed / charging", async () => { - game.override.moveset([MoveId.DIG]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.DIG); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.DIG); - }); - - test("ability applies correctly even if the pokemon's move misses", async () => { - game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.SPLASH); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.move.forceMiss(); - await game.phaseInterceptor.to(TurnEndPhase); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon.isFullHp()).toBe(true); - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TACKLE); - }); - - test("ability applies correctly even if the pokemon's move is protected against", async () => { - game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.PROTECT); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TACKLE); - }); - - test("ability applies correctly even if the pokemon's move fails because of type immunity", async () => { - game.override.moveset([MoveId.TACKLE]).enemySpecies(SpeciesId.GASTLY); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TACKLE); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TACKLE); - }); - - test("ability is not applied if pokemon's type is the same as the move's type", async () => { - game.override.moveset([MoveId.SPLASH]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - leadPokemon.summonData.types = [allMoves[MoveId.SPLASH].type]; - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN); - }); - - test("ability is not applied if pokemon is terastallized", async () => { - game.override.moveset([MoveId.SPLASH]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - leadPokemon.isTerastallized = true; - - game.move.select(MoveId.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN); - }); - - test("ability is not applied if pokemon uses struggle", async () => { - game.override.moveset([MoveId.STRUGGLE]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.STRUGGLE); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN); - }); - - test("ability is not applied if the pokemon's move fails", async () => { - game.override.moveset([MoveId.BURN_UP]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.BURN_UP); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN); - }); - - test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { - game.override.moveset([MoveId.TRICK_OR_TREAT]).enemySpecies(SpeciesId.GASTLY); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.TRICK_OR_TREAT); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.TRICK_OR_TREAT); - }); - - test("ability applies correctly and the pokemon curses itself", async () => { - game.override.moveset([MoveId.CURSE]); - - await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - game.move.select(MoveId.CURSE); - await game.phaseInterceptor.to(TurnEndPhase); - - testPokemonTypeMatchesDefaultMoveType(leadPokemon, MoveId.CURSE); - expect(leadPokemon.getTag(BattlerTagType.CURSED)).not.toBe(undefined); - }); -}); - -function testPokemonTypeMatchesDefaultMoveType(pokemon: PlayerPokemon, move: MoveId) { - expect(pokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN); - expect(pokemon.getTypes()).toHaveLength(1); - const pokemonType = PokemonType[pokemon.getTypes()[0]], - moveType = PokemonType[allMoves[move].type]; - expect(pokemonType).toBe(moveType); -} diff --git a/test/abilities/protosynthesis.test.ts b/test/abilities/protosynthesis.test.ts index ef860fc0cd5..5629ea503d7 100644 --- a/test/abilities/protosynthesis.test.ts +++ b/test/abilities/protosynthesis.test.ts @@ -1,11 +1,11 @@ import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { Nature } from "#enums/nature"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { BattlerIndex } from "#enums/battler-index"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - Protosynthesis", () => { diff --git a/test/abilities/quick_draw.test.ts b/test/abilities/quick_draw.test.ts index 11418f31375..f881adce5ed 100644 --- a/test/abilities/quick_draw.test.ts +++ b/test/abilities/quick_draw.test.ts @@ -1,9 +1,9 @@ -import { allAbilities } from "#app/data/data-lists"; -import { FaintPhase } from "#app/phases/faint-phase"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { FaintPhase } from "#phases/faint-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; diff --git a/test/abilities/sand_spit.test.ts b/test/abilities/sand_spit.test.ts index 2b519745649..dfd8a342ccc 100644 --- a/test/abilities/sand_spit.test.ts +++ b/test/abilities/sand_spit.test.ts @@ -1,8 +1,8 @@ -import { WeatherType } from "#app/enums/weather-type"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/sand_veil.test.ts b/test/abilities/sand_veil.test.ts index 035b37d85a8..b37901f65c3 100644 --- a/test/abilities/sand_veil.test.ts +++ b/test/abilities/sand_veil.test.ts @@ -1,14 +1,14 @@ -import type { StatMultiplierAbAttrParams } from "#app/@types/ability-types"; -import { allAbilities } from "#app/data/data-lists"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { CommandPhase } from "#phases/command-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { StatMultiplierAbAttrParams } from "#types/ability-types"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; diff --git a/test/abilities/sap_sipper.test.ts b/test/abilities/sap_sipper.test.ts index c70730f0711..a8fe10d7fc5 100644 --- a/test/abilities/sap_sipper.test.ts +++ b/test/abilities/sap_sipper.test.ts @@ -1,16 +1,16 @@ -import { Stat } from "#enums/stat"; -import { TerrainType } from "#app/data/terrain"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { allMoves } from "#data/data-lists"; +import { TerrainType } from "#data/terrain"; import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { RandomMoveAttr } from "#moves/move"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { diff --git a/test/abilities/schooling.test.ts b/test/abilities/schooling.test.ts index 646beafb80f..94bb4cb80f9 100644 --- a/test/abilities/schooling.test.ts +++ b/test/abilities/schooling.test.ts @@ -1,11 +1,11 @@ -import { Status } from "#app/data/status-effect"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Abilities - SCHOOLING", () => { diff --git a/test/abilities/screen_cleaner.test.ts b/test/abilities/screen_cleaner.test.ts index e896d2e51f9..8b53ab30d49 100644 --- a/test/abilities/screen_cleaner.test.ts +++ b/test/abilities/screen_cleaner.test.ts @@ -1,10 +1,10 @@ -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { PostSummonPhase } from "#app/phases/post-summon-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { PostSummonPhase } from "#phases/post-summon-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -28,11 +28,11 @@ describe("Abilities - Screen Cleaner", () => { }); it("removes Aurora Veil", async () => { - game.override.moveset([MoveId.HAIL]).enemyMoveset(MoveId.AURORA_VEIL); + game.override.enemyMoveset(MoveId.AURORA_VEIL); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); - game.move.select(MoveId.HAIL); + game.move.use(MoveId.HAIL); await game.phaseInterceptor.to(TurnEndPhase); expect(game.scene.arena.getTag(ArenaTagType.AURORA_VEIL)).toBeDefined(); @@ -49,7 +49,7 @@ describe("Abilities - Screen Cleaner", () => { await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); - game.move.select(MoveId.SPLASH); + game.move.use(MoveId.SPLASH); await game.phaseInterceptor.to(TurnEndPhase); expect(game.scene.arena.getTag(ArenaTagType.LIGHT_SCREEN)).toBeDefined(); @@ -66,7 +66,7 @@ describe("Abilities - Screen Cleaner", () => { await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); - game.move.select(MoveId.SPLASH); + game.move.use(MoveId.SPLASH); await game.phaseInterceptor.to(TurnEndPhase); expect(game.scene.arena.getTag(ArenaTagType.REFLECT)).toBeDefined(); diff --git a/test/abilities/seed_sower.test.ts b/test/abilities/seed_sower.test.ts index 7a898f5bcf9..8573f0242ea 100644 --- a/test/abilities/seed_sower.test.ts +++ b/test/abilities/seed_sower.test.ts @@ -1,8 +1,8 @@ -import { TerrainType } from "#app/data/terrain"; +import { TerrainType } from "#data/terrain"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/serene_grace.test.ts b/test/abilities/serene_grace.test.ts index 2acf2981537..aaa0f26f78b 100644 --- a/test/abilities/serene_grace.test.ts +++ b/test/abilities/serene_grace.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { allMoves } from "#app/data/data-lists"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Serene Grace", () => { diff --git a/test/abilities/sheer_force.test.ts b/test/abilities/sheer_force.test.ts index e90b8d08611..0b0c0c10ccf 100644 --- a/test/abilities/sheer_force.test.ts +++ b/test/abilities/sheer_force.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/data-lists"; describe("Abilities - Sheer Force", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/shell-armor.test.ts b/test/abilities/shell-armor.test.ts index ea0ed4a95dd..e10c3a90444 100644 --- a/test/abilities/shell-armor.test.ts +++ b/test/abilities/shell-armor.test.ts @@ -1,12 +1,12 @@ -import type Move from "#app/data/moves/move"; -import Pokemon from "#app/field/pokemon"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi, type MockInstance } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from "vitest"; describe("Abilities - Shell Armor", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/shield_dust.test.ts b/test/abilities/shield_dust.test.ts index a7896b9eeb8..371c7d9cf29 100644 --- a/test/abilities/shield_dust.test.ts +++ b/test/abilities/shield_dust.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { NumberHolder } from "#app/utils/common"; +import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/shields_down.test.ts b/test/abilities/shields_down.test.ts index 7b4803915f1..7678c7d8dac 100644 --- a/test/abilities/shields_down.test.ts +++ b/test/abilities/shields_down.test.ts @@ -1,12 +1,12 @@ -import { Status } from "#app/data/status-effect"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Abilities - SHIELDS DOWN", () => { diff --git a/test/abilities/simple.test.ts b/test/abilities/simple.test.ts index 703f8fcffac..a709c8696d3 100644 --- a/test/abilities/simple.test.ts +++ b/test/abilities/simple.test.ts @@ -1,8 +1,8 @@ -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/speed_boost.test.ts b/test/abilities/speed_boost.test.ts index a4445d085f3..975fc8ebecf 100644 --- a/test/abilities/speed_boost.test.ts +++ b/test/abilities/speed_boost.test.ts @@ -1,13 +1,14 @@ -import { Stat } from "#enums/stat"; +import Overrides from "#app/overrides"; import { AbilityId } from "#enums/ability-id"; +import { Command } from "#enums/command"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { AttemptRunPhase } from "#phases/attempt-run-phase"; +import type { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import type { CommandPhase } from "#app/phases/command-phase"; -import { Command } from "#enums/command"; -import { AttemptRunPhase } from "#app/phases/attempt-run-phase"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Speed Boost", () => { let phaserGame: Phaser.Game; @@ -96,12 +97,15 @@ describe("Abilities - Speed Boost", () => { }); it("should not trigger if pokemon fails to escape", async () => { + //Account for doubles, should not trigger on either pokemon + game.override.battleStyle("double"); await game.classicMode.startBattle([SpeciesId.SHUCKLE]); + vi.spyOn(Overrides, "RUN_SUCCESS_OVERRIDE", "get").mockReturnValue(false); + const commandPhase = game.scene.phaseManager.getCurrentPhase() as CommandPhase; commandPhase.handleCommand(Command.RUN, 0); - const runPhase = game.scene.phaseManager.getCurrentPhase() as AttemptRunPhase; - runPhase.forceFailEscape = true; + await game.phaseInterceptor.to(AttemptRunPhase); await game.toNextTurn(); diff --git a/test/abilities/stakeout.test.ts b/test/abilities/stakeout.test.ts index b3844bf17ca..85838a52abe 100644 --- a/test/abilities/stakeout.test.ts +++ b/test/abilities/stakeout.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { isBetween } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { isBetween } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/stall.test.ts b/test/abilities/stall.test.ts index 04a29a4f284..c012586eea5 100644 --- a/test/abilities/stall.test.ts +++ b/test/abilities/stall.test.ts @@ -1,10 +1,10 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; describe("Abilities - Stall", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/steely_spirit.test.ts b/test/abilities/steely_spirit.test.ts index 7a2bd98b6b1..0ca7bebe17a 100644 --- a/test/abilities/steely_spirit.test.ts +++ b/test/abilities/steely_spirit.test.ts @@ -1,9 +1,8 @@ -import { allAbilities } from "#app/data/data-lists"; -import { allMoves } from "#app/data/data-lists"; +import { allAbilities, allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/storm_drain.test.ts b/test/abilities/storm_drain.test.ts index 8eedf0c7ce8..59626546578 100644 --- a/test/abilities/storm_drain.test.ts +++ b/test/abilities/storm_drain.test.ts @@ -1,12 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +// TODO: Condense with lightning rod tests sometime describe("Abilities - Storm Drain", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -39,7 +40,7 @@ describe("Abilities - Storm Drain", () => { const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; - enemy2.summonData.ability = AbilityId.STORM_DRAIN; + game.field.mockAbility(enemy2, AbilityId.STORM_DRAIN); game.move.select(MoveId.WATER_GUN, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -55,7 +56,7 @@ describe("Abilities - Storm Drain", () => { const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; - enemy2.summonData.ability = AbilityId.STORM_DRAIN; + game.field.mockAbility(enemy2, AbilityId.STORM_DRAIN); game.move.select(MoveId.AERIAL_ACE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -68,8 +69,7 @@ describe("Abilities - Storm Drain", () => { await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); const enemy2 = game.scene.getEnemyField()[1]; - - enemy2.summonData.ability = AbilityId.STORM_DRAIN; + game.field.mockAbility(enemy2, AbilityId.STORM_DRAIN); game.move.select(MoveId.WATER_GUN, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -85,8 +85,7 @@ describe("Abilities - Storm Drain", () => { const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; - - enemy2.summonData.ability = AbilityId.STORM_DRAIN; + game.field.mockAbility(enemy2, AbilityId.STORM_DRAIN); game.move.select(MoveId.WATER_GUN, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); @@ -96,16 +95,15 @@ describe("Abilities - Storm Drain", () => { }); it("should redirect moves changed to water type via ability", async () => { - game.override.ability(AbilityId.LIQUID_VOICE).moveset(MoveId.PSYCHIC_NOISE); - await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]); + game.override.ability(AbilityId.LIQUID_VOICE); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; - enemy2.summonData.ability = AbilityId.STORM_DRAIN; + game.field.mockAbility(enemy2, AbilityId.STORM_DRAIN); - game.move.select(MoveId.PSYCHIC_NOISE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); - game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2); + game.move.use(MoveId.ROUND, BattlerIndex.PLAYER, BattlerIndex.ENEMY); await game.phaseInterceptor.to("BerryPhase"); expect(enemy1.isFullHp()).toBe(true); diff --git a/test/abilities/sturdy.test.ts b/test/abilities/sturdy.test.ts index e7b2c05040d..0cde40a91da 100644 --- a/test/abilities/sturdy.test.ts +++ b/test/abilities/sturdy.test.ts @@ -1,10 +1,10 @@ -import type { EnemyPokemon } from "#app/field/pokemon"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { EnemyPokemon } from "#field/pokemon"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/abilities/super_luck.test.ts b/test/abilities/super_luck.test.ts index 60ed2534fe9..954251583f8 100644 --- a/test/abilities/super_luck.test.ts +++ b/test/abilities/super_luck.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/supreme_overlord.test.ts b/test/abilities/supreme_overlord.test.ts index 7143b590f68..b68153a2cc8 100644 --- a/test/abilities/supreme_overlord.test.ts +++ b/test/abilities/supreme_overlord.test.ts @@ -1,13 +1,13 @@ -import { MoveId } from "#enums/move-id"; -import type Move from "#app/data/moves/move"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { SpeciesId } from "#enums/species-id"; import { BattlerIndex } from "#enums/battler-index"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import type { Move } from "#moves/move"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/data-lists"; describe("Abilities - Supreme Overlord", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/sweet_veil.test.ts b/test/abilities/sweet_veil.test.ts index ed9cb20afcc..97ddb2c5f36 100644 --- a/test/abilities/sweet_veil.test.ts +++ b/test/abilities/sweet_veil.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { CommandPhase } from "#phases/command-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/synchronize.test.ts b/test/abilities/synchronize.test.ts index 030509ac4e6..1874560a166 100644 --- a/test/abilities/synchronize.test.ts +++ b/test/abilities/synchronize.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/tera_shell.test.ts b/test/abilities/tera_shell.test.ts index a52a01862ff..bd461e3aeba 100644 --- a/test/abilities/tera_shell.test.ts +++ b/test/abilities/tera_shell.test.ts @@ -1,8 +1,8 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/thermal_exchange.test.ts b/test/abilities/thermal_exchange.test.ts index 70af864d413..5e684b982e7 100644 --- a/test/abilities/thermal_exchange.test.ts +++ b/test/abilities/thermal_exchange.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/trace.test.ts b/test/abilities/trace.test.ts index f17bec159ab..7b87b3669b6 100644 --- a/test/abilities/trace.test.ts +++ b/test/abilities/trace.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/unburden.test.ts b/test/abilities/unburden.test.ts index fff37daff7b..8d738db9076 100644 --- a/test/abilities/unburden.test.ts +++ b/test/abilities/unburden.test.ts @@ -1,15 +1,15 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { StealHeldItemChanceAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import type Pokemon from "#app/field/pokemon"; -import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import type { ContactHeldItemTransferChanceModifier } from "#modifiers/modifier"; +import { StealHeldItemChanceAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/unseen_fist.test.ts b/test/abilities/unseen_fist.test.ts index 26de77d4643..c986a112517 100644 --- a/test/abilities/unseen_fist.test.ts +++ b/test/abilities/unseen_fist.test.ts @@ -1,12 +1,12 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; describe("Abilities - Unseen Fist", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/victory_star.test.ts b/test/abilities/victory_star.test.ts index 4742dd96aa6..aff91a7702b 100644 --- a/test/abilities/victory_star.test.ts +++ b/test/abilities/victory_star.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/vital_spirit.test.ts b/test/abilities/vital_spirit.test.ts index 18764f94a6b..7530b2c6c04 100644 --- a/test/abilities/vital_spirit.test.ts +++ b/test/abilities/vital_spirit.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/volt_absorb.test.ts b/test/abilities/volt_absorb.test.ts index 6bea70ee2a4..12de6ceff87 100644 --- a/test/abilities/volt_absorb.test.ts +++ b/test/abilities/volt_absorb.test.ts @@ -1,13 +1,13 @@ -import { Stat } from "#enums/stat"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerIndex } from "#enums/battler-index"; -import { SpeciesId } from "#enums/species-id"; // See also: TypeImmunityAbAttr describe("Abilities - Volt Absorb", () => { diff --git a/test/abilities/wandering_spirit.test.ts b/test/abilities/wandering_spirit.test.ts index 950cec6d27c..3d26238e970 100644 --- a/test/abilities/wandering_spirit.test.ts +++ b/test/abilities/wandering_spirit.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/water_bubble.test.ts b/test/abilities/water_bubble.test.ts index 455a2e368c4..c8d01eb2800 100644 --- a/test/abilities/water_bubble.test.ts +++ b/test/abilities/water_bubble.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/water_veil.test.ts b/test/abilities/water_veil.test.ts index 2df06ec1a21..dcfe5b60fe9 100644 --- a/test/abilities/water_veil.test.ts +++ b/test/abilities/water_veil.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/wimp_out.test.ts b/test/abilities/wimp_out.test.ts index 1db0b80fcd0..d6e6908e19b 100644 --- a/test/abilities/wimp_out.test.ts +++ b/test/abilities/wimp_out.test.ts @@ -1,16 +1,16 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; -import GameManager from "#test/testUtils/gameManager"; -import { toDmgValue } from "#app/utils/common"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -108,7 +108,7 @@ describe("Abilities - Wimp Out", () => { }); it("Trapping moves do not prevent Wimp Out from activating.", async () => { - game.override.enemyMoveset([MoveId.SPIRIT_SHACKLE]).startingLevel(53).enemyLevel(45); + game.override.enemyMoveset([MoveId.SPIRIT_SHACKLE]).startingLevel(1).passiveAbility(AbilityId.STURDY); await game.classicMode.startBattle([SpeciesId.WIMPOD, SpeciesId.TYRUNT]); game.move.select(MoveId.SPLASH); @@ -123,7 +123,7 @@ describe("Abilities - Wimp Out", () => { }); it("If this Ability activates due to being hit by U-turn or Volt Switch, the user of that move will not be switched out.", async () => { - game.override.startingLevel(95).enemyMoveset([MoveId.U_TURN]); + game.override.startingLevel(1).enemyMoveset([MoveId.U_TURN]).passiveAbility(AbilityId.STURDY); await game.classicMode.startBattle([SpeciesId.WIMPOD, SpeciesId.TYRUNT]); game.move.select(MoveId.SPLASH); diff --git a/test/abilities/wind_power.test.ts b/test/abilities/wind_power.test.ts index 8e657997008..255e8fa69be 100644 --- a/test/abilities/wind_power.test.ts +++ b/test/abilities/wind_power.test.ts @@ -1,9 +1,9 @@ -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/wind_rider.test.ts b/test/abilities/wind_rider.test.ts index ea1747fcae9..e7b55d2ef65 100644 --- a/test/abilities/wind_rider.test.ts +++ b/test/abilities/wind_rider.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/wonder_skin.test.ts b/test/abilities/wonder_skin.test.ts index 177b97ae3b7..f55c303c9e3 100644 --- a/test/abilities/wonder_skin.test.ts +++ b/test/abilities/wonder_skin.test.ts @@ -1,9 +1,9 @@ -import { allMoves } from "#app/data/data-lists"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/zen_mode.test.ts b/test/abilities/zen_mode.test.ts index 5df2b3a6bc7..89dc0690ead 100644 --- a/test/abilities/zen_mode.test.ts +++ b/test/abilities/zen_mode.test.ts @@ -1,9 +1,9 @@ -import { Status } from "#app/data/status-effect"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/abilities/zero_to_hero.test.ts b/test/abilities/zero_to_hero.test.ts index 7d0128a4dbc..84b3ddab60c 100644 --- a/test/abilities/zero_to_hero.test.ts +++ b/test/abilities/zero_to_hero.test.ts @@ -1,11 +1,11 @@ -import { Status } from "#app/data/status-effect"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - ZERO TO HERO", () => { diff --git a/test/account.test.ts b/test/account.test.ts index 77368b0b64c..52d52778dad 100644 --- a/test/account.test.ts +++ b/test/account.test.ts @@ -1,7 +1,7 @@ -import * as bypassLogin from "#app/global-vars/bypass-login"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import { describe, expect, it, vi } from "vitest"; +import { pokerogueApi } from "#api/pokerogue-api"; import { initLoggedInUser, loggedInUser, updateUserInfo } from "#app/account"; +import * as bypassLogin from "#app/global-vars/bypass-login"; +import { describe, expect, it, vi } from "vitest"; describe("account", () => { describe("initLoggedInUser", () => { diff --git a/test/achievements/achievement.test.ts b/test/achievements/achievement.test.ts index 5a74c77fe6a..d736485b25f 100644 --- a/test/achievements/achievement.test.ts +++ b/test/achievements/achievement.test.ts @@ -1,20 +1,20 @@ -import { TurnHeldItemTransferModifier } from "#app/modifier/modifier"; +import type { BattleScene } from "#app/battle-scene"; +import { TurnHeldItemTransferModifier } from "#modifiers/modifier"; import { Achv, AchvTier, + achvs, DamageAchv, HealAchv, LevelAchv, ModifierAchv, MoneyAchv, RibbonAchv, - achvs, -} from "#app/system/achv"; -import { NumberHolder } from "#app/utils/common"; -import GameManager from "#test/testUtils/gameManager"; +} from "#system/achv"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import type BattleScene from "#app/battle-scene"; describe("check some Achievement related stuff", () => { it("should check Achievement creation", () => { diff --git a/test/arena/arena_gravity.test.ts b/test/arena/arena_gravity.test.ts index 36fe0b58308..d1cee1655a1 100644 --- a/test/arena/arena_gravity.test.ts +++ b/test/arena/arena_gravity.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/arena/grassy_terrain.test.ts b/test/arena/grassy_terrain.test.ts index 5f78d8f801d..541402123c4 100644 --- a/test/arena/grassy_terrain.test.ts +++ b/test/arena/grassy_terrain.test.ts @@ -1,8 +1,8 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/arena/weather_fog.test.ts b/test/arena/weather_fog.test.ts index e6984e13bd0..f55a12e3e0f 100644 --- a/test/arena/weather_fog.test.ts +++ b/test/arena/weather_fog.test.ts @@ -1,10 +1,10 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/arena/weather_hail.test.ts b/test/arena/weather_hail.test.ts index 27cf46fa9f2..c6f27f647fe 100644 --- a/test/arena/weather_hail.test.ts +++ b/test/arena/weather_hail.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/arena/weather_sandstorm.test.ts b/test/arena/weather_sandstorm.test.ts index 61001abe1f4..a600aeed000 100644 --- a/test/arena/weather_sandstorm.test.ts +++ b/test/arena/weather_sandstorm.test.ts @@ -1,9 +1,9 @@ import { AbilityId } from "#enums/ability-id"; -import { Stat } from "#app/enums/stat"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/arena/weather_strong_winds.test.ts b/test/arena/weather_strong_winds.test.ts index d0d256816eb..b0b1bca8c4c 100644 --- a/test/arena/weather_strong_winds.test.ts +++ b/test/arena/weather_strong_winds.test.ts @@ -1,10 +1,10 @@ -import { allMoves } from "#app/data/data-lists"; -import { StatusEffect } from "#app/enums/status-effect"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -86,7 +86,7 @@ describe("Weather - Strong Winds", () => { const enemy = game.scene.getEnemyPokemon()!; enemy.hp = 1; - game.move.select(MoveId.SPLASH); + game.move.use(MoveId.SPLASH); await game.phaseInterceptor.to("TurnEndPhase"); expect(game.scene.arena.weather?.weatherType).toBeUndefined(); diff --git a/test/battle-scene.test.ts b/test/battle-scene.test.ts index 44f1364441b..a920c48ea75 100644 --- a/test/battle-scene.test.ts +++ b/test/battle-scene.test.ts @@ -1,6 +1,6 @@ import { LoadingScene } from "#app/loading-scene"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; describe("BattleScene", () => { let phaserGame: Phaser.Game; diff --git a/test/battle/ability_swap.test.ts b/test/battle/ability_swap.test.ts index 3dd92576e3b..525c038d011 100644 --- a/test/battle/ability_swap.test.ts +++ b/test/battle/ability_swap.test.ts @@ -1,9 +1,9 @@ -import { allAbilities } from "#app/data/data-lists"; -import { Stat } from "#app/enums/stat"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/battle/battle-order.test.ts b/test/battle/battle-order.test.ts index 114592c8c8e..a47da66c4d7 100644 --- a/test/battle/battle-order.test.ts +++ b/test/battle/battle-order.test.ts @@ -1,10 +1,10 @@ -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { SelectTargetPhase } from "#app/phases/select-target-phase"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { SelectTargetPhase } from "#phases/select-target-phase"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/battle/battle.test.ts b/test/battle/battle.test.ts index bf2c3968aa6..03e8db3f0c8 100644 --- a/test/battle/battle.test.ts +++ b/test/battle/battle.test.ts @@ -1,30 +1,30 @@ -import { allSpecies } from "#app/data/data-lists"; -import { Stat } from "#enums/stat"; import { getGameMode } from "#app/game-mode"; -import { GameModes } from "#enums/game-modes"; -import { BattleEndPhase } from "#app/phases/battle-end-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { LoginPhase } from "#app/phases/login-phase"; -import { NextEncounterPhase } from "#app/phases/next-encounter-phase"; -import { SelectGenderPhase } from "#app/phases/select-gender-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import { SummonPhase } from "#app/phases/summon-phase"; -import { SwitchPhase } from "#app/phases/switch-phase"; -import { TitlePhase } from "#app/phases/title-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import GameManager from "#test/testUtils/gameManager"; -import { generateStarter } from "#test/testUtils/gameManagerUtils"; -import { UiMode } from "#enums/ui-mode"; +import { allSpecies } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BiomeId } from "#enums/biome-id"; +import { GameModes } from "#enums/game-modes"; import { MoveId } from "#enums/move-id"; import { PlayerGender } from "#enums/player-gender"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { UiMode } from "#enums/ui-mode"; +import { BattleEndPhase } from "#phases/battle-end-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { LoginPhase } from "#phases/login-phase"; +import { NextEncounterPhase } from "#phases/next-encounter-phase"; +import { SelectGenderPhase } from "#phases/select-gender-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import { SummonPhase } from "#phases/summon-phase"; +import { SwitchPhase } from "#phases/switch-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { generateStarter } from "#test/testUtils/gameManagerUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { BiomeId } from "#enums/biome-id"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/test/battle/damage_calculation.test.ts b/test/battle/damage_calculation.test.ts index 19cdf6b9237..fbcefcb0693 100644 --- a/test/battle/damage_calculation.test.ts +++ b/test/battle/damage_calculation.test.ts @@ -1,11 +1,10 @@ -import { allMoves } from "#app/data/data-lists"; -import type { EnemyPersistentModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/data/data-lists"; +import { allMoves, modifierTypes } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { EnemyPersistentModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/battle/double_battle.test.ts b/test/battle/double_battle.test.ts index 8e606a99ae0..7e0aa0f6c69 100644 --- a/test/battle/double_battle.test.ts +++ b/test/battle/double_battle.test.ts @@ -1,13 +1,13 @@ -import { Status } from "#app/data/status-effect"; -import { AbilityId } from "#enums/ability-id"; import { getGameMode } from "#app/game-mode"; +import { Status } from "#data/status-effect"; +import { AbilityId } from "#enums/ability-id"; import { GameModes } from "#enums/game-modes"; -import { BattleEndPhase } from "#app/phases/battle-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { BattleEndPhase } from "#phases/battle-end-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/battle/inverse_battle.test.ts b/test/battle/inverse_battle.test.ts index 66cab3e2d84..f9fd8f80a37 100644 --- a/test/battle/inverse_battle.test.ts +++ b/test/battle/inverse_battle.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; import { AbilityId } from "#enums/ability-id"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { Challenges } from "#enums/challenges"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/battle/special_battle.test.ts b/test/battle/special_battle.test.ts index 4988e526b1e..36b543b0666 100644 --- a/test/battle/special_battle.test.ts +++ b/test/battle/special_battle.test.ts @@ -1,8 +1,8 @@ -import { UiMode } from "#enums/ui-mode"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { UiMode } from "#enums/ui-mode"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/battlerTags/octolock.test.ts b/test/battlerTags/octolock.test.ts index d0214f495fc..5b395a180a2 100644 --- a/test/battlerTags/octolock.test.ts +++ b/test/battlerTags/octolock.test.ts @@ -1,10 +1,10 @@ -import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; -import type Pokemon from "#app/field/pokemon"; -import { OctolockTag, TrappedTag } from "#app/data/battler-tags"; +import { OctolockTag, TrappedTag } from "#data/battler-tags"; import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; -import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { StatStageChangePhase } from "#phases/stat-stage-change-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; describe("BattlerTag - OctolockTag", () => { describe("lapse behavior", () => { diff --git a/test/battlerTags/stockpiling.test.ts b/test/battlerTags/stockpiling.test.ts index 37873db9eab..9024b3edb3c 100644 --- a/test/battlerTags/stockpiling.test.ts +++ b/test/battlerTags/stockpiling.test.ts @@ -1,10 +1,10 @@ -import { StockpilingTag } from "#app/data/battler-tags"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonSummonData } from "#app/field/pokemon"; import * as messages from "#app/messages"; -import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; +import { StockpilingTag } from "#data/battler-tags"; +import { PokemonSummonData } from "#data/pokemon-data"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { StatStageChangePhase } from "#phases/stat-stage-change-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; beforeEach(() => { @@ -101,7 +101,8 @@ describe("BattlerTag - StockpilingTag", () => { }); describe("stack limit, stat tracking, and removal", () => { - it("can be added up to three times, even when one stat does not change", async () => { + // TODO: do we even want this file at all? regardless, this test is broken and is also likely unimportant + it.todo("can be added up to three times, even when one stat does not change", async () => { const mockPokemon = { summonData: new PokemonSummonData(), getBattlerIndex: () => 0, @@ -150,7 +151,7 @@ describe("BattlerTag - StockpilingTag", () => { expect(subject.stockpiledCount).toBe(3); vi.spyOn(game.scene.phaseManager, "unshiftPhase").mockImplementationOnce(_phase => { - throw new Error("Should not be called a fourth time"); + expect.fail("Should not be called a fourth time"); }); // fourth stack should not be applied diff --git a/test/battlerTags/substitute.test.ts b/test/battlerTags/substitute.test.ts index 06aedab19f4..825bebf1a1e 100644 --- a/test/battlerTags/substitute.test.ts +++ b/test/battlerTags/substitute.test.ts @@ -1,16 +1,17 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import type { PokemonTurnData, TurnMove } from "#app/field/pokemon"; -import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#enums/move-result"; -import type BattleScene from "#app/battle-scene"; -import { BindTag, SubstituteTag } from "#app/data/battler-tags"; +import type { BattleScene } from "#app/battle-scene"; +import * as messages from "#app/messages"; +import { BindTag, SubstituteTag } from "#data/battler-tags"; +import { allMoves } from "#data/data-lists"; +import type { PokemonTurnData } from "#data/pokemon-data"; import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { MoveId } from "#enums/move-id"; -import { PokemonAnimType } from "#app/enums/pokemon-anim-type"; -import * as messages from "#app/messages"; -import { allMoves } from "#app/data/data-lists"; -import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveResult } from "#enums/move-result"; +import { PokemonAnimType } from "#enums/pokemon-anim-type"; +import type { Pokemon } from "#field/pokemon"; +import type { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { TurnMove } from "#types/turn-move"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("BattlerTag - SubstituteTag", () => { let phaserGame: Phaser.Game; diff --git a/test/boss-pokemon.test.ts b/test/boss-pokemon.test.ts index 6eb6d262c56..06a2f313016 100644 --- a/test/boss-pokemon.test.ts +++ b/test/boss-pokemon.test.ts @@ -1,12 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import { EFFECTIVE_STATS } from "#app/enums/stat"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { toDmgValue } from "#app/utils/common"; +import { SpeciesId } from "#enums/species-id"; +import { EFFECTIVE_STATS } from "#enums/stat"; +import type { EnemyPokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Boss Pokemon / Shields", () => { let phaserGame: Phaser.Game; diff --git a/test/daily_mode.test.ts b/test/daily_mode.test.ts index 41dcf51ccf6..0fa7c0dc846 100644 --- a/test/daily_mode.test.ts +++ b/test/daily_mode.test.ts @@ -1,14 +1,12 @@ +import { pokerogueApi } from "#api/pokerogue-api"; import { BiomeId } from "#enums/biome-id"; import { MoveId } from "#enums/move-id"; -import { MapModifier } from "#app/modifier/modifier"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; +import { MapModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; - -//const TIMEOUT = 20 * 1000; describe("Daily Mode", () => { let phaserGame: Phaser.Game; diff --git a/test/data/splash_messages.test.ts b/test/data/splash_messages.test.ts index 773b2715825..9763d85a583 100644 --- a/test/data/splash_messages.test.ts +++ b/test/data/splash_messages.test.ts @@ -1,6 +1,6 @@ -import { getSplashMessages } from "#app/data/splash-messages"; -import { describe, expect, it, vi, afterEach, beforeEach } from "vitest"; import * as Constants from "#app/constants"; +import { getSplashMessages } from "#data/splash-messages"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; describe("Data - Splash Messages", () => { it("should contain at least 15 splash messages", () => { diff --git a/test/data/status_effect.test.ts b/test/data/status_effect.test.ts index e697ee3f1c7..2ea4dce4147 100644 --- a/test/data/status_effect.test.ts +++ b/test/data/status_effect.test.ts @@ -1,17 +1,17 @@ import { - Status, getStatusEffectActivationText, getStatusEffectDescriptor, getStatusEffectHealText, getStatusEffectObtainText, getStatusEffectOverlapText, -} from "#app/data/status-effect"; -import { MoveResult } from "#enums/move-result"; + Status, +} from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import { mockI18next } from "#test/testUtils/testUtils"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/eggs/egg.test.ts b/test/eggs/egg.test.ts index 0d5d09c5179..b27124bd786 100644 --- a/test/eggs/egg.test.ts +++ b/test/eggs/egg.test.ts @@ -1,13 +1,13 @@ -import { speciesEggTiers } from "#app/data/balance/species-egg-tiers"; -import { Egg, getLegendaryGachaSpeciesForTimestamp, getValidLegendaryGachaSpecies } from "#app/data/egg"; -import { allSpecies } from "#app/data/data-lists"; -import { EggSourceType } from "#app/enums/egg-source-types"; -import { EggTier } from "#app/enums/egg-type"; -import { VariantTier } from "#app/enums/variant-tier"; -import EggData from "#app/system/egg-data"; -import * as Utils from "#app/utils/common"; +import { speciesEggTiers } from "#balance/species-egg-tiers"; +import { allSpecies } from "#data/data-lists"; +import { Egg, getLegendaryGachaSpeciesForTimestamp, getValidLegendaryGachaSpecies } from "#data/egg"; +import { EggSourceType } from "#enums/egg-source-types"; +import { EggTier } from "#enums/egg-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { VariantTier } from "#enums/variant-tier"; +import { EggData } from "#system/egg-data"; +import { GameManager } from "#test/testUtils/gameManager"; +import * as Utils from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/eggs/manaphy-egg.test.ts b/test/eggs/manaphy-egg.test.ts index a58dfa9beba..319b5a15d7b 100644 --- a/test/eggs/manaphy-egg.test.ts +++ b/test/eggs/manaphy-egg.test.ts @@ -1,8 +1,8 @@ -import { Egg } from "#app/data/egg"; -import { EggSourceType } from "#app/enums/egg-source-types"; -import { EggTier } from "#app/enums/egg-type"; +import { Egg } from "#data/egg"; +import { EggSourceType } from "#enums/egg-source-types"; +import { EggTier } from "#enums/egg-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/endless_boss.test.ts b/test/endless_boss.test.ts index d219cacf317..99c179ceeb6 100644 --- a/test/endless_boss.test.ts +++ b/test/endless_boss.test.ts @@ -1,8 +1,8 @@ import { BiomeId } from "#enums/biome-id"; -import { SpeciesId } from "#enums/species-id"; import { GameModes } from "#enums/game-modes"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; const EndlessBossWave = { Minor: 250, diff --git a/test/enemy_command.test.ts b/test/enemy_command.test.ts index fabb1f1fdb0..249c819a107 100644 --- a/test/enemy_command.test.ts +++ b/test/enemy_command.test.ts @@ -1,13 +1,13 @@ -import type BattleScene from "#app/battle-scene"; -import { allMoves } from "#app/data/data-lists"; -import { MoveCategory } from "#enums/MoveCategory"; +import type { BattleScene } from "#app/battle-scene"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { AiType } from "#enums/ai-type"; +import { MoveCategory } from "#enums/MoveCategory"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import type { EnemyPokemon } from "#app/field/pokemon"; -import { AiType } from "#enums/ai-type"; -import { randSeedInt } from "#app/utils/common"; -import GameManager from "#test/testUtils/gameManager"; +import type { EnemyPokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; +import { randSeedInt } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/escape-calculations.test.ts b/test/escape-calculations.test.ts index 2cc0934f7c1..338d2a1dcfc 100644 --- a/test/escape-calculations.test.ts +++ b/test/escape-calculations.test.ts @@ -1,10 +1,9 @@ -import { AttemptRunPhase } from "#app/phases/attempt-run-phase"; -import type { CommandPhase } from "#app/phases/command-phase"; -import { Command } from "#enums/command"; -import { NumberHolder } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; +import { Command } from "#enums/command"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { AttemptRunPhase } from "#phases/attempt-run-phase"; +import type { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -45,8 +44,6 @@ describe("Escape chance calculations", () => { await game.phaseInterceptor.to(AttemptRunPhase, false); const phase = game.scene.phaseManager.getCurrentPhase() as AttemptRunPhase; - const escapePercentage = new NumberHolder(0); - // this sets up an object for multiple attempts. The pokemonSpeedRatio is your speed divided by the enemy speed, the escapeAttempts are the number of escape attempts and the expectedEscapeChance is the chance it should be escaping const escapeChances: { pokemonSpeedRatio: number; @@ -91,8 +88,8 @@ describe("Escape chance calculations", () => { 20, escapeChances[i].pokemonSpeedRatio * enemySpeed, ]); - phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); - expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance); + const chance = phase.calculateEscapeChance(game.scene.currentBattle.escapeAttempts); + expect(chance).toBe(escapeChances[i].expectedEscapeChance); } }); @@ -118,8 +115,6 @@ describe("Escape chance calculations", () => { await game.phaseInterceptor.to(AttemptRunPhase, false); const phase = game.scene.phaseManager.getCurrentPhase() as AttemptRunPhase; - const escapePercentage = new NumberHolder(0); - // this sets up an object for multiple attempts. The pokemonSpeedRatio is your speed divided by the enemy speed, the escapeAttempts are the number of escape attempts and the expectedEscapeChance is the chance it should be escaping const escapeChances: { pokemonSpeedRatio: number; @@ -172,9 +167,9 @@ describe("Escape chance calculations", () => { 20, escapeChances[i].pokemonSpeedRatio * totalEnemySpeed - playerPokemon[0].stats[5], ]); - phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); + const chance = phase.calculateEscapeChance(game.scene.currentBattle.escapeAttempts); // checks to make sure the escape values are the same - expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance); + expect(chance).toBe(escapeChances[i].expectedEscapeChance); // checks to make sure the sum of the player's speed for all pokemon is equal to the appropriate ratio of the total enemy speed expect(playerPokemon[0].stats[5] + playerPokemon[1].stats[5]).toBe( escapeChances[i].pokemonSpeedRatio * totalEnemySpeed, @@ -197,7 +192,6 @@ describe("Escape chance calculations", () => { await game.phaseInterceptor.to(AttemptRunPhase, false); const phase = game.scene.phaseManager.getCurrentPhase() as AttemptRunPhase; - const escapePercentage = new NumberHolder(0); // this sets up an object for multiple attempts. The pokemonSpeedRatio is your speed divided by the enemy speed, the escapeAttempts are the number of escape attempts and the expectedEscapeChance is the chance it should be escaping const escapeChances: { @@ -256,8 +250,8 @@ describe("Escape chance calculations", () => { 20, escapeChances[i].pokemonSpeedRatio * enemySpeed, ]); - phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); - expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance); + const chance = phase.calculateEscapeChance(game.scene.currentBattle.escapeAttempts); + expect(chance).toBe(escapeChances[i].expectedEscapeChance); } }); @@ -283,7 +277,6 @@ describe("Escape chance calculations", () => { await game.phaseInterceptor.to(AttemptRunPhase, false); const phase = game.scene.phaseManager.getCurrentPhase() as AttemptRunPhase; - const escapePercentage = new NumberHolder(0); // this sets up an object for multiple attempts. The pokemonSpeedRatio is your speed divided by the enemy speed, the escapeAttempts are the number of escape attempts and the expectedEscapeChance is the chance it should be escaping const escapeChances: { @@ -349,9 +342,9 @@ describe("Escape chance calculations", () => { 20, escapeChances[i].pokemonSpeedRatio * totalEnemySpeed - playerPokemon[0].stats[5], ]); - phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); + const chance = phase.calculateEscapeChance(game.scene.currentBattle.escapeAttempts); // checks to make sure the escape values are the same - expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance); + expect(chance).toBe(escapeChances[i].expectedEscapeChance); // checks to make sure the sum of the player's speed for all pokemon is equal to the appropriate ratio of the total enemy speed expect(playerPokemon[0].stats[5] + playerPokemon[1].stats[5]).toBe( escapeChances[i].pokemonSpeedRatio * totalEnemySpeed, diff --git a/test/evolution.test.ts b/test/evolution.test.ts index c4bcca785c1..ffede4d09d6 100644 --- a/test/evolution.test.ts +++ b/test/evolution.test.ts @@ -1,13 +1,9 @@ -import { - pokemonEvolutions, - SpeciesFormEvolution, - SpeciesWildEvolutionDelay, -} from "#app/data/balance/pokemon-evolutions"; +import { pokemonEvolutions, SpeciesFormEvolution, SpeciesWildEvolutionDelay } from "#balance/pokemon-evolutions"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import * as Utils from "#app/utils/common"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import * as Utils from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/field/pokemon-id-checks.test.ts b/test/field/pokemon-id-checks.test.ts index 4023b8d73ad..065a1ffeb7e 100644 --- a/test/field/pokemon-id-checks.test.ts +++ b/test/field/pokemon-id-checks.test.ts @@ -1,13 +1,13 @@ -import type Pokemon from "#app/field/pokemon"; -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; -import { SpeciesId } from "#enums/species-id"; import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import type { Pokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerIndex } from "#enums/battler-index"; describe("Field - Pokemon ID Checks", () => { let phaserGame: Phaser.Game; diff --git a/test/field/pokemon.test.ts b/test/field/pokemon.test.ts index c6524e7397f..8c04dc61b32 100644 --- a/test/field/pokemon.test.ts +++ b/test/field/pokemon.test.ts @@ -1,11 +1,11 @@ -import { SpeciesId } from "#enums/species-id"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { PokeballType } from "#enums/pokeball"; -import type BattleScene from "#app/battle-scene"; +import type { BattleScene } from "#app/battle-scene"; +import { CustomPokemonData } from "#data/pokemon-data"; import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; import { PokemonType } from "#enums/pokemon-type"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Spec - Pokemon", () => { let phaserGame: Phaser.Game; diff --git a/test/final_boss.test.ts b/test/final_boss.test.ts index 071f83285e7..59918d28aa5 100644 --- a/test/final_boss.test.ts +++ b/test/final_boss.test.ts @@ -1,11 +1,11 @@ -import { GameModes } from "#enums/game-modes"; -import { TurnHeldItemTransferModifier } from "#app/modifier/modifier"; import { AbilityId } from "#enums/ability-id"; import { BiomeId } from "#enums/biome-id"; +import { GameModes } from "#enums/game-modes"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnHeldItemTransferModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; const FinalWave = { diff --git a/test/game-mode.test.ts b/test/game-mode.test.ts index c5ce1e02852..52de7e6a705 100644 --- a/test/game-mode.test.ts +++ b/test/game-mode.test.ts @@ -1,9 +1,9 @@ import type { GameMode } from "#app/game-mode"; import { getGameMode } from "#app/game-mode"; import { GameModes } from "#enums/game-modes"; +import { GameManager } from "#test/testUtils/gameManager"; +import * as Utils from "#utils/common"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as Utils from "#app/utils/common"; -import GameManager from "#test/testUtils/gameManager"; describe("game-mode", () => { let phaserGame: Phaser.Game; diff --git a/test/imports.test.ts b/test/imports.test.ts index 8a5c735e950..04e9462d8d0 100644 --- a/test/imports.test.ts +++ b/test/imports.test.ts @@ -1,4 +1,4 @@ -import { initStatsKeys } from "#app/ui/game-stats-ui-handler"; +import { initStatsKeys } from "#ui/game-stats-ui-handler"; import { describe, expect, it } from "vitest"; async function importModule() { diff --git a/test/inputs/inputs.test.ts b/test/inputs/inputs.test.ts index 1f566672f00..ce208d6ce6d 100644 --- a/test/inputs/inputs.test.ts +++ b/test/inputs/inputs.test.ts @@ -1,7 +1,7 @@ -import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty"; -import pad_xbox360 from "#app/configs/inputs/pad_xbox360"; -import GameManager from "#test/testUtils/gameManager"; -import InputsHandler from "#test/testUtils/inputsHandler"; +import cfg_keyboard_qwerty from "#inputs/cfg_keyboard_qwerty"; +import pad_xbox360 from "#inputs/pad_xbox360"; +import { GameManager } from "#test/testUtils/gameManager"; +import { InputsHandler } from "#test/testUtils/inputsHandler"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/internals.test.ts b/test/internals.test.ts index bd603ec22fc..bb3cd89565c 100644 --- a/test/internals.test.ts +++ b/test/internals.test.ts @@ -1,6 +1,6 @@ import { AbilityId } from "#enums/ability-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/items/dire_hit.test.ts b/test/items/dire_hit.test.ts index 25fe9c8b876..2473dd0038e 100644 --- a/test/items/dire_hit.test.ts +++ b/test/items/dire_hit.test.ts @@ -1,25 +1,25 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Button } from "#enums/buttons"; import { MoveId } from "#enums/move-id"; +import { ShopCursorTarget } from "#enums/shop-cursor-target"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { BattleEndPhase } from "#app/phases/battle-end-phase"; -import { TempCritBoosterModifier } from "#app/modifier/modifier"; import { UiMode } from "#enums/ui-mode"; -import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { Button } from "#app/enums/buttons"; -import { CommandPhase } from "#app/phases/command-phase"; -import { NewBattlePhase } from "#app/phases/new-battle-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; +import { TempCritBoosterModifier } from "#modifiers/modifier"; +import { BattleEndPhase } from "#phases/battle-end-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { NewBattlePhase } from "#phases/new-battle-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Dire Hit", () => { let phaserGame: Phaser.Game; let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); @@ -58,8 +58,7 @@ describe("Items - Dire Hit", () => { await game.classicMode.startBattle([SpeciesId.PIKACHU]); - game.move.select(MoveId.SPLASH); - + game.move.use(MoveId.SPLASH); await game.doKillOpponents(); await game.phaseInterceptor.to(BattleEndPhase); diff --git a/test/items/double_battle_chance_booster.test.ts b/test/items/double_battle_chance_booster.test.ts index d1a9e826cda..df6a3c6d7de 100644 --- a/test/items/double_battle_chance_booster.test.ts +++ b/test/items/double_battle_chance_booster.test.ts @@ -1,13 +1,13 @@ +import { Button } from "#enums/buttons"; import { MoveId } from "#enums/move-id"; +import { ShopCursorTarget } from "#enums/shop-cursor-target"; import { SpeciesId } from "#enums/species-id"; -import { DoubleBattleChanceBoosterModifier } from "#app/modifier/modifier"; -import GameManager from "#test/testUtils/gameManager"; +import { UiMode } from "#enums/ui-mode"; +import { DoubleBattleChanceBoosterModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; -import { UiMode } from "#enums/ui-mode"; -import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { Button } from "#app/enums/buttons"; describe("Items - Double Battle Chance Boosters", () => { let phaserGame: Phaser.Game; diff --git a/test/items/eviolite.test.ts b/test/items/eviolite.test.ts index 353cdbf91b4..74aff03616c 100644 --- a/test/items/eviolite.test.ts +++ b/test/items/eviolite.test.ts @@ -1,16 +1,16 @@ -import { StatBoosterModifier } from "#app/modifier/modifier"; -import { NumberHolder, randItem } from "#app/utils/common"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { StatBoosterModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder, randItem } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Eviolite", () => { let phaserGame: Phaser.Game; let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/exp_booster.test.ts b/test/items/exp_booster.test.ts index 44d7721aba2..6c8c16d08f4 100644 --- a/test/items/exp_booster.test.ts +++ b/test/items/exp_booster.test.ts @@ -1,8 +1,8 @@ import { AbilityId } from "#enums/ability-id"; -import { PokemonExpBoosterModifier } from "#app/modifier/modifier"; -import { NumberHolder } from "#app/utils/common"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { PokemonExpBoosterModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("EXP Modifier Items", () => { @@ -10,7 +10,7 @@ describe("EXP Modifier Items", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/grip_claw.test.ts b/test/items/grip_claw.test.ts index 9c3e6548140..6e25cdf6c08 100644 --- a/test/items/grip_claw.test.ts +++ b/test/items/grip_claw.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import type Pokemon from "#app/field/pokemon"; -import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BerryType } from "#enums/berry-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import type { Pokemon } from "#field/pokemon"; +import type { ContactHeldItemTransferChanceModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Grip Claw", () => { @@ -14,7 +14,7 @@ describe("Items - Grip Claw", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/leek.test.ts b/test/items/leek.test.ts index eedb6667b9b..7ee3dff23d6 100644 --- a/test/items/leek.test.ts +++ b/test/items/leek.test.ts @@ -1,9 +1,9 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { randInt } from "#app/utils/common"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { randInt } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Leek", () => { @@ -11,7 +11,7 @@ describe("Items - Leek", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/leftovers.test.ts b/test/items/leftovers.test.ts index 99d2a16ff75..6f80e9a15b1 100644 --- a/test/items/leftovers.test.ts +++ b/test/items/leftovers.test.ts @@ -1,8 +1,8 @@ -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/items/light_ball.test.ts b/test/items/light_ball.test.ts index 6dfed3389b9..eebcc81c224 100644 --- a/test/items/light_ball.test.ts +++ b/test/items/light_ball.test.ts @@ -1,11 +1,11 @@ -import { Stat } from "#enums/stat"; -import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/data/data-lists"; -import i18next from "#app/plugins/i18n"; -import { NumberHolder } from "#app/utils/common"; +import { modifierTypes } from "#data/data-lists"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { Stat } from "#enums/stat"; +import { SpeciesStatBoosterModifier } from "#modifiers/modifier"; +import i18next from "#plugins/i18n"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Light Ball", () => { @@ -13,7 +13,7 @@ describe("Items - Light Ball", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/lock_capsule.test.ts b/test/items/lock_capsule.test.ts index beacc3a3907..e98e6880eb1 100644 --- a/test/items/lock_capsule.test.ts +++ b/test/items/lock_capsule.test.ts @@ -1,10 +1,10 @@ import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; import { ModifierTier } from "#enums/modifier-tier"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { MoveId } from "#enums/move-id"; import { UiMode } from "#enums/ui-mode"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Items - Lock Capsule", () => { @@ -12,7 +12,7 @@ describe("Items - Lock Capsule", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/metal_powder.test.ts b/test/items/metal_powder.test.ts index e731f6e7295..17baa057fd5 100644 --- a/test/items/metal_powder.test.ts +++ b/test/items/metal_powder.test.ts @@ -1,11 +1,11 @@ -import { Stat } from "#enums/stat"; -import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/data/data-lists"; -import i18next from "#app/plugins/i18n"; -import { NumberHolder } from "#app/utils/common"; +import { modifierTypes } from "#data/data-lists"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { Stat } from "#enums/stat"; +import { SpeciesStatBoosterModifier } from "#modifiers/modifier"; +import i18next from "#plugins/i18n"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Metal Powder", () => { @@ -13,7 +13,7 @@ describe("Items - Metal Powder", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/multi_lens.test.ts b/test/items/multi_lens.test.ts index 8a3161970c0..56d452df9d2 100644 --- a/test/items/multi_lens.test.ts +++ b/test/items/multi_lens.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -211,21 +211,4 @@ describe("Items - Multi Lens", () => { // TODO: Update hit count to 1 once Future Sight is fixed to not activate held items if user is off the field expect(enemyPokemon.damageAndUpdate).toHaveBeenCalledTimes(2); }); - - it("should not allow Pollen Puff to heal ally more than once", async () => { - game.override.battleStyle("double").moveset([MoveId.POLLEN_PUFF, MoveId.ENDURE]); - await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.OMANYTE]); - - const [, rightPokemon] = game.scene.getPlayerField(); - - rightPokemon.damageAndUpdate(rightPokemon.hp - 1); - - game.move.select(MoveId.POLLEN_PUFF, 0, BattlerIndex.PLAYER_2); - game.move.select(MoveId.ENDURE, 1); - - await game.toNextTurn(); - - // Pollen Puff heals with a ratio of 0.5, as long as Pollen Puff triggers only once the pokemon will always be <= (0.5 * Max HP) + 1 - expect(rightPokemon.hp).toBeLessThanOrEqual(0.5 * rightPokemon.getMaxHp() + 1); - }); }); diff --git a/test/items/mystical_rock.test.ts b/test/items/mystical_rock.test.ts index 091815aa604..f1e9bb91ecf 100644 --- a/test/items/mystical_rock.test.ts +++ b/test/items/mystical_rock.test.ts @@ -1,9 +1,9 @@ import { globalScene } from "#app/global-scene"; -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Items - Mystical Rock", () => { @@ -11,7 +11,7 @@ describe("Items - Mystical Rock", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/quick_powder.test.ts b/test/items/quick_powder.test.ts index af99f51273d..6c8cb0751c3 100644 --- a/test/items/quick_powder.test.ts +++ b/test/items/quick_powder.test.ts @@ -1,11 +1,11 @@ -import { Stat } from "#enums/stat"; -import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/data/data-lists"; -import i18next from "#app/plugins/i18n"; -import { NumberHolder } from "#app/utils/common"; +import { modifierTypes } from "#data/data-lists"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { Stat } from "#enums/stat"; +import { SpeciesStatBoosterModifier } from "#modifiers/modifier"; +import i18next from "#plugins/i18n"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Quick Powder", () => { @@ -13,7 +13,7 @@ describe("Items - Quick Powder", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/reviver_seed.test.ts b/test/items/reviver_seed.test.ts index f444a6eac66..f0929ee0993 100644 --- a/test/items/reviver_seed.test.ts +++ b/test/items/reviver_seed.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { PokemonInstantReviveModifier } from "#app/modifier/modifier"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { PokemonInstantReviveModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/items/scope_lens.test.ts b/test/items/scope_lens.test.ts index 16be8aab930..866164629f8 100644 --- a/test/items/scope_lens.test.ts +++ b/test/items/scope_lens.test.ts @@ -1,8 +1,8 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Scope Lens", () => { @@ -10,7 +10,7 @@ describe("Items - Scope Lens", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/temp_stat_stage_booster.test.ts b/test/items/temp_stat_stage_booster.test.ts index b8cd0cde4eb..454a469700a 100644 --- a/test/items/temp_stat_stage_booster.test.ts +++ b/test/items/temp_stat_stage_booster.test.ts @@ -1,23 +1,23 @@ -import { BATTLE_STATS, Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import Phase from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { MoveId } from "#enums/move-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; -import { TempStatStageBoosterModifier } from "#app/modifier/modifier"; +import { Button } from "#enums/buttons"; +import { MoveId } from "#enums/move-id"; +import { ShopCursorTarget } from "#enums/shop-cursor-target"; +import { SpeciesId } from "#enums/species-id"; +import { BATTLE_STATS, Stat } from "#enums/stat"; import { UiMode } from "#enums/ui-mode"; -import { Button } from "#app/enums/buttons"; -import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; +import { TempStatStageBoosterModifier } from "#modifiers/modifier"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Temporary Stat Stage Boosters", () => { let phaserGame: Phaser.Game; let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/thick_club.test.ts b/test/items/thick_club.test.ts index bc019ee99f8..3a993d64a0c 100644 --- a/test/items/thick_club.test.ts +++ b/test/items/thick_club.test.ts @@ -1,11 +1,11 @@ -import { Stat } from "#enums/stat"; -import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/data/data-lists"; -import i18next from "#app/plugins/i18n"; -import { NumberHolder, randInt } from "#app/utils/common"; +import { modifierTypes } from "#data/data-lists"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phase from "phaser"; +import { Stat } from "#enums/stat"; +import { SpeciesStatBoosterModifier } from "#modifiers/modifier"; +import i18next from "#plugins/i18n"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder, randInt } from "#utils/common"; +import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Items - Thick Club", () => { @@ -13,7 +13,7 @@ describe("Items - Thick Club", () => { let game: GameManager; beforeAll(() => { - phaserGame = new Phase.Game({ + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); diff --git a/test/items/toxic_orb.test.ts b/test/items/toxic_orb.test.ts index e0d86655028..0f4acedbfb5 100644 --- a/test/items/toxic_orb.test.ts +++ b/test/items/toxic_orb.test.ts @@ -1,9 +1,9 @@ -import i18next from "#app/plugins/i18n"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import i18next from "#plugins/i18n"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/misc.test.ts b/test/misc.test.ts index 12ed165d9d9..5afd8f898c6 100644 --- a/test/misc.test.ts +++ b/test/misc.test.ts @@ -1,5 +1,4 @@ -// import { apiFetch } from "#app/utils"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import { waitUntil } from "#test/testUtils/gameManagerUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/ability-ignore-moves.test.ts b/test/moves/ability-ignore-moves.test.ts new file mode 100644 index 00000000000..99c5b8f8efe --- /dev/null +++ b/test/moves/ability-ignore-moves.test.ts @@ -0,0 +1,108 @@ +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Moves - Ability-Ignoring Moves", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .moveset([MoveId.MOONGEIST_BEAM, MoveId.SUNSTEEL_STRIKE, MoveId.PHOTON_GEYSER, MoveId.METRONOME]) + .ability(AbilityId.BALL_FETCH) + .startingLevel(200) + .battleStyle("single") + .criticalHits(false) + .enemySpecies(SpeciesId.MAGIKARP) + .enemyAbility(AbilityId.STURDY) + .enemyMoveset(MoveId.SPLASH); + }); + + it.each<{ name: string; move: MoveId }>([ + { name: "Sunsteel Strike", move: MoveId.SUNSTEEL_STRIKE }, + { name: "Moongeist Beam", move: MoveId.MOONGEIST_BEAM }, + { name: "Photon Geyser", move: MoveId.PHOTON_GEYSER }, + ])("$name should ignore enemy abilities during move use", async ({ move }) => { + await game.classicMode.startBattle([SpeciesId.NECROZMA]); + + const player = game.field.getPlayerPokemon(); + const enemy = game.field.getEnemyPokemon(); + + game.move.select(move); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(game.scene.arena.ignoreAbilities).toBe(true); + expect(game.scene.arena.ignoringEffectSource).toBe(player.getBattlerIndex()); + + await game.toEndOfTurn(); + expect(game.scene.arena.ignoreAbilities).toBe(false); + expect(enemy.isFainted()).toBe(true); + }); + + it("should not ignore enemy abilities when called by Metronome", async () => { + await game.classicMode.startBattle([SpeciesId.MILOTIC]); + game.move.forceMetronomeMove(MoveId.PHOTON_GEYSER, true); + + const enemy = game.field.getEnemyPokemon(); + game.move.select(MoveId.METRONOME); + await game.toEndOfTurn(); + + expect(enemy.isFainted()).toBe(false); + expect(game.field.getPlayerPokemon().getLastXMoves()[0].move).toBe(MoveId.PHOTON_GEYSER); + }); + + it("should not ignore enemy abilities when called by Mirror Move", async () => { + game.override.moveset(MoveId.MIRROR_MOVE).enemyMoveset(MoveId.SUNSTEEL_STRIKE); + + await game.classicMode.startBattle([SpeciesId.MILOTIC]); + + const enemy = game.field.getEnemyPokemon(); + game.move.select(MoveId.MIRROR_MOVE); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toEndOfTurn(); + + expect(enemy.isFainted()).toBe(false); + expect(game.scene.getPlayerPokemon()?.getLastXMoves()[0].move).toBe(MoveId.SUNSTEEL_STRIKE); + }); + + // TODO: Verify this behavior on cart + it("should ignore enemy abilities when called by Instruct", async () => { + game.override.moveset([MoveId.SUNSTEEL_STRIKE, MoveId.INSTRUCT]).battleStyle("double"); + await game.classicMode.startBattle([SpeciesId.SOLGALEO, SpeciesId.LUNALA]); + + const solgaleo = game.field.getPlayerPokemon(); + + game.move.select(MoveId.SUNSTEEL_STRIKE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.select(MoveId.INSTRUCT, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + await game.phaseInterceptor.to("MoveEffectPhase"); // initial attack + await game.phaseInterceptor.to("MoveEffectPhase"); // instruct + await game.phaseInterceptor.to("MoveEffectPhase"); // instructed move use + + expect(game.scene.arena.ignoreAbilities).toBe(true); + expect(game.scene.arena.ignoringEffectSource).toBe(solgaleo.getBattlerIndex()); + + await game.toEndOfTurn(); + + // Both the initial and redirected instruct use ignored sturdy + const [enemy1, enemy2] = game.scene.getEnemyField(); + expect(enemy1.isFainted()).toBe(true); + expect(enemy2.isFainted()).toBe(true); + }); +}); diff --git a/test/moves/after_you.test.ts b/test/moves/after_you.test.ts index 37186dcc7a5..e961342dc36 100644 --- a/test/moves/after_you.test.ts +++ b/test/moves/after_you.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { MoveResult } from "#enums/move-result"; -import { MovePhase } from "#app/phases/move-phase"; -import { MoveUseMode } from "#enums/move-use-mode"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { MovePhase } from "#phases/move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/alluring_voice.test.ts b/test/moves/alluring_voice.test.ts index ba096391f1b..d72d7b4f906 100644 --- a/test/moves/alluring_voice.test.ts +++ b/test/moves/alluring_voice.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/aromatherapy.test.ts b/test/moves/aromatherapy.test.ts index bfe315a1390..d18f886bff2 100644 --- a/test/moves/aromatherapy.test.ts +++ b/test/moves/aromatherapy.test.ts @@ -1,11 +1,11 @@ -import { StatusEffect } from "#app/enums/status-effect"; -import { CommandPhase } from "#app/phases/command-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Aromatherapy", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/assist.test.ts b/test/moves/assist.test.ts index 27aa5528f17..6ef8946eaf8 100644 --- a/test/moves/assist.test.ts +++ b/test/moves/assist.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { Stat } from "#app/enums/stat"; -import { MoveResult } from "#enums/move-result"; -import { CommandPhase } from "#app/phases/command-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/astonish.test.ts b/test/moves/astonish.test.ts index 48deadf7a01..7db149c9975 100644 --- a/test/moves/astonish.test.ts +++ b/test/moves/astonish.test.ts @@ -1,13 +1,13 @@ -import { allMoves } from "#app/data/data-lists"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; diff --git a/test/moves/aurora_veil.test.ts b/test/moves/aurora_veil.test.ts index b9ae79e4155..24e7b1857cc 100644 --- a/test/moves/aurora_veil.test.ts +++ b/test/moves/aurora_veil.test.ts @@ -1,18 +1,17 @@ -import type BattleScene from "#app/battle-scene"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import type Move from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import type Pokemon from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { NumberHolder } from "#app/utils/common"; +import type { BattleScene } from "#app/battle-scene"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; let globalScene: BattleScene; @@ -52,10 +51,10 @@ describe("Moves - Aurora Veil", () => { game.move.select(moveToUse); - await game.phaseInterceptor.to(TurnEndPhase); + await game.toEndOfTurn(); const mockedDmg = getMockedMoveDamage( - game.scene.getEnemyPokemon()!, - game.scene.getPlayerPokemon()!, + game.field.getEnemyPokemon(), + game.field.getPlayerPokemon(), allMoves[moveToUse], ); @@ -71,10 +70,10 @@ describe("Moves - Aurora Veil", () => { game.move.select(moveToUse); game.move.select(moveToUse, 1); - await game.phaseInterceptor.to(TurnEndPhase); + await game.toEndOfTurn(); const mockedDmg = getMockedMoveDamage( - game.scene.getEnemyPokemon()!, - game.scene.getPlayerPokemon()!, + game.field.getEnemyPokemon(), + game.field.getPlayerPokemon(), allMoves[moveToUse], ); @@ -82,72 +81,48 @@ describe("Moves - Aurora Veil", () => { }); it("reduces damage of special attacks by half in a single battle", async () => { - const moveToUse = MoveId.ABSORB; await game.classicMode.startBattle([SpeciesId.SHUCKLE]); - game.move.select(moveToUse); + game.move.use(MoveId.ABSORB); - await game.phaseInterceptor.to(TurnEndPhase); + await game.toEndOfTurn(); const mockedDmg = getMockedMoveDamage( - game.scene.getEnemyPokemon()!, - game.scene.getPlayerPokemon()!, - allMoves[moveToUse], + game.field.getEnemyPokemon(), + game.field.getPlayerPokemon(), + allMoves[MoveId.ABSORB], ); - expect(mockedDmg).toBe(allMoves[moveToUse].power * singleBattleMultiplier); + expect(mockedDmg).toBe(allMoves[MoveId.ABSORB].power * singleBattleMultiplier); }); it("reduces damage of special attacks by a third in a double battle", async () => { game.override.battleStyle("double"); - - const moveToUse = MoveId.DAZZLING_GLEAM; - await game.classicMode.startBattle([SpeciesId.SHUCKLE, SpeciesId.SHUCKLE]); - - game.move.select(moveToUse); - game.move.select(moveToUse, 1); - - await game.phaseInterceptor.to(TurnEndPhase); - const mockedDmg = getMockedMoveDamage( - game.scene.getEnemyPokemon()!, - game.scene.getPlayerPokemon()!, - allMoves[moveToUse], - ); - - expect(mockedDmg).toBe(allMoves[moveToUse].power * doubleBattleMultiplier); - }); - - it("does not affect physical critical hits", async () => { - game.override.moveset([MoveId.WICKED_BLOW]); - const moveToUse = MoveId.WICKED_BLOW; await game.classicMode.startBattle([SpeciesId.SHUCKLE]); - game.move.select(moveToUse); - await game.phaseInterceptor.to(TurnEndPhase); - + game.move.use(MoveId.ABSORB); + await game.toEndOfTurn(); const mockedDmg = getMockedMoveDamage( - game.scene.getEnemyPokemon()!, - game.scene.getPlayerPokemon()!, - allMoves[moveToUse], + game.field.getEnemyPokemon(), + game.field.getPlayerPokemon(), + allMoves[MoveId.ABSORB], ); - expect(mockedDmg).toBe(allMoves[moveToUse].power); + + expect(mockedDmg).toBe(allMoves[MoveId.ABSORB].power * doubleBattleMultiplier); }); it("does not affect critical hits", async () => { - game.override.moveset([MoveId.FROST_BREATH]); - const moveToUse = MoveId.FROST_BREATH; - vi.spyOn(allMoves[MoveId.FROST_BREATH], "accuracy", "get").mockReturnValue(100); await game.classicMode.startBattle([SpeciesId.SHUCKLE]); - game.move.select(moveToUse); - await game.phaseInterceptor.to(TurnEndPhase); + game.move.use(MoveId.WICKED_BLOW); + await game.toEndOfTurn(); const mockedDmg = getMockedMoveDamage( - game.scene.getEnemyPokemon()!, - game.scene.getPlayerPokemon()!, - allMoves[moveToUse], + game.field.getEnemyPokemon(), + game.field.getPlayerPokemon(), + allMoves[MoveId.WICKED_BLOW], ); - expect(mockedDmg).toBe(allMoves[moveToUse].power); + expect(mockedDmg).toBe(allMoves[MoveId.WICKED_BLOW].power); }); }); diff --git a/test/moves/autotomize.test.ts b/test/moves/autotomize.test.ts index 000dd19b8f5..01021870b88 100644 --- a/test/moves/autotomize.test.ts +++ b/test/moves/autotomize.test.ts @@ -1,9 +1,9 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Autotomize", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/baddy_bad.test.ts b/test/moves/baddy_bad.test.ts index ffdf9f0309c..0af04f0c0c7 100644 --- a/test/moves/baddy_bad.test.ts +++ b/test/moves/baddy_bad.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -33,7 +33,7 @@ describe("Moves - Baddy Bad", () => { game.override.enemyMoveset(MoveId.PROTECT); await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.move.select(MoveId.BADDY_BAD); + game.move.use(MoveId.BADDY_BAD); await game.phaseInterceptor.to("BerryPhase"); expect(game.scene.arena.tags.length).toBe(0); diff --git a/test/moves/baneful_bunker.test.ts b/test/moves/baneful_bunker.test.ts index c9cc2025a58..09050dcbb44 100644 --- a/test/moves/baneful_bunker.test.ts +++ b/test/moves/baneful_bunker.test.ts @@ -1,11 +1,11 @@ +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { BattlerIndex } from "#enums/battler-index"; -import { StatusEffect } from "#app/enums/status-effect"; describe("Moves - Baneful Bunker", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/baton_pass.test.ts b/test/moves/baton_pass.test.ts index 1b1b0620133..af49ac0db9f 100644 --- a/test/moves/baton_pass.test.ts +++ b/test/moves/baton_pass.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/beak_blast.test.ts b/test/moves/beak_blast.test.ts index 2cb9f9bdd6f..60a6bb75066 100644 --- a/test/moves/beak_blast.test.ts +++ b/test/moves/beak_blast.test.ts @@ -1,12 +1,12 @@ -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { StatusEffect } from "#app/enums/status-effect"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { BerryPhase } from "#phases/berry-phase"; +import { MovePhase } from "#phases/move-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/beat_up.test.ts b/test/moves/beat_up.test.ts index 7c4686ab4fa..8387b6f671b 100644 --- a/test/moves/beat_up.test.ts +++ b/test/moves/beat_up.test.ts @@ -1,9 +1,9 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { StatusEffect } from "#app/enums/status-effect"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/belly_drum.test.ts b/test/moves/belly_drum.test.ts index 239b3c3d794..9044e10589f 100644 --- a/test/moves/belly_drum.test.ts +++ b/test/moves/belly_drum.test.ts @@ -1,12 +1,12 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { toDmgValue } from "#app/utils/common"; +import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import { AbilityId } from "#enums/ability-id"; // RATIO : HP Cost of Move const RATIO = 2; diff --git a/test/moves/burning_jealousy.test.ts b/test/moves/burning_jealousy.test.ts index ce0a1ce57c9..9f8dfc29ee4 100644 --- a/test/moves/burning_jealousy.test.ts +++ b/test/moves/burning_jealousy.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { StatusEffect } from "#app/enums/status-effect"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/camouflage.test.ts b/test/moves/camouflage.test.ts index 6f28493b1e5..39bf8f6d5b5 100644 --- a/test/moves/camouflage.test.ts +++ b/test/moves/camouflage.test.ts @@ -1,10 +1,10 @@ +import { TerrainType } from "#data/terrain"; import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { TerrainType } from "#app/data/terrain"; -import { PokemonType } from "#enums/pokemon-type"; import { BattlerIndex } from "#enums/battler-index"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/ceaseless_edge.test.ts b/test/moves/ceaseless_edge.test.ts index 1dec98fe3a8..2d28f4b1a1b 100644 --- a/test/moves/ceaseless_edge.test.ts +++ b/test/moves/ceaseless_edge.test.ts @@ -1,13 +1,13 @@ -import { ArenaTrapTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; +import { ArenaTrapTag } from "#data/arena-tag"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; diff --git a/test/moves/chilly_reception.test.ts b/test/moves/chilly_reception.test.ts index 4d15bfff284..f34e61873cc 100644 --- a/test/moves/chilly_reception.test.ts +++ b/test/moves/chilly_reception.test.ts @@ -1,11 +1,11 @@ -import { RandomMoveAttr } from "#app/data/moves/move"; -import { MoveResult } from "#enums/move-result"; import { getPokemonNameWithAffix } from "#app/messages"; +import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#app/enums/ability-id"; import { WeatherType } from "#enums/weather-type"; -import GameManager from "#test/testUtils/gameManager"; +import { RandomMoveAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import i18next from "i18next"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/chloroblast.test.ts b/test/moves/chloroblast.test.ts index 6c790bac150..c87f79c440a 100644 --- a/test/moves/chloroblast.test.ts +++ b/test/moves/chloroblast.test.ts @@ -1,8 +1,8 @@ -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/clangorous_soul.test.ts b/test/moves/clangorous_soul.test.ts index f08503acdc6..dc208087bb8 100644 --- a/test/moves/clangorous_soul.test.ts +++ b/test/moves/clangorous_soul.test.ts @@ -1,10 +1,10 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; /** HP Cost of Move */ const RATIO = 3; diff --git a/test/moves/copycat.test.ts b/test/moves/copycat.test.ts index 8d135d5e2c7..e6a81cb5627 100644 --- a/test/moves/copycat.test.ts +++ b/test/moves/copycat.test.ts @@ -1,14 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { Stat } from "#app/enums/stat"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; -import { MoveUseMode } from "#enums/move-use-mode"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Copycat", () => { let phaserGame: Phaser.Game; @@ -65,7 +64,7 @@ describe("Moves - Copycat", () => { it("should copy the called move when the last move successfully calls another", async () => { game.override.moveset([MoveId.SPLASH, MoveId.METRONOME]).enemyMoveset(MoveId.COPYCAT); await game.classicMode.startBattle([SpeciesId.DRAMPA]); - vi.spyOn(RandomMoveAttr.prototype, "getMoveOverride").mockReturnValue(MoveId.SWORDS_DANCE); + game.move.forceMetronomeMove(MoveId.SWORDS_DANCE, true); game.move.select(MoveId.METRONOME); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); // Player moves first so enemy can copy Swords Dance diff --git a/test/moves/crafty_shield.test.ts b/test/moves/crafty_shield.test.ts index 12a607a2a1b..b9dbac76b90 100644 --- a/test/moves/crafty_shield.test.ts +++ b/test/moves/crafty_shield.test.ts @@ -1,13 +1,13 @@ +import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { BerryPhase } from "#phases/berry-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; describe("Moves - Crafty Shield", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/defog.test.ts b/test/moves/defog.test.ts index 17dc0613e9b..253eac4f22c 100644 --- a/test/moves/defog.test.ts +++ b/test/moves/defog.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/destiny_bond.test.ts b/test/moves/destiny_bond.test.ts index a78d46b464b..29bbfabb09f 100644 --- a/test/moves/destiny_bond.test.ts +++ b/test/moves/destiny_bond.test.ts @@ -1,16 +1,16 @@ -import type { ArenaTrapTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; +import type { ArenaTrapTag } from "#data/arena-tag"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { PokemonInstantReviveModifier } from "#modifiers/modifier"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { BattlerIndex } from "#enums/battler-index"; -import { StatusEffect } from "#enums/status-effect"; -import { PokemonInstantReviveModifier } from "#app/modifier/modifier"; describe("Moves - Destiny Bond", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/diamond_storm.test.ts b/test/moves/diamond_storm.test.ts index 20067b3a0f3..1eb86f94b76 100644 --- a/test/moves/diamond_storm.test.ts +++ b/test/moves/diamond_storm.test.ts @@ -1,9 +1,9 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/dig.test.ts b/test/moves/dig.test.ts index a80ac0405fe..9d431b78838 100644 --- a/test/moves/dig.test.ts +++ b/test/moves/dig.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import { MoveResult } from "#enums/move-result"; -import { describe, beforeAll, afterEach, beforeEach, it, expect } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Dig", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/disable.test.ts b/test/moves/disable.test.ts index b113acb9525..f6b1c24ac7d 100644 --- a/test/moves/disable.test.ts +++ b/test/moves/disable.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; -import { MoveUseMode } from "#enums/move-use-mode"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { RandomMoveAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { RandomMoveAttr } from "#app/data/moves/move"; describe("Moves - Disable", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/dive.test.ts b/test/moves/dive.test.ts index 9c467976775..c7e4f99f6cb 100644 --- a/test/moves/dive.test.ts +++ b/test/moves/dive.test.ts @@ -1,13 +1,13 @@ -import { BattlerTagType } from "#enums/battler-tag-type"; -import { StatusEffect } from "#enums/status-effect"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Dive", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/doodle.test.ts b/test/moves/doodle.test.ts index 2dbd5c08c8f..5f4b8ab9b39 100644 --- a/test/moves/doodle.test.ts +++ b/test/moves/doodle.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/double_team.test.ts b/test/moves/double_team.test.ts index d1f6c5be3e4..9cdae33af41 100644 --- a/test/moves/double_team.test.ts +++ b/test/moves/double_team.test.ts @@ -1,9 +1,9 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/dragon_cheer.test.ts b/test/moves/dragon_cheer.test.ts index 56feac513a1..7d1f35fe2d4 100644 --- a/test/moves/dragon_cheer.test.ts +++ b/test/moves/dragon_cheer.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/dragon_rage.test.ts b/test/moves/dragon_rage.test.ts index c5bed3377fa..46e7dfa5a21 100644 --- a/test/moves/dragon_rage.test.ts +++ b/test/moves/dragon_rage.test.ts @@ -1,14 +1,14 @@ -import { Stat } from "#enums/stat"; -import { PokemonType } from "#enums/pokemon-type"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import type { EnemyPokemon, PlayerPokemon } from "#field/pokemon"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SpeciesId } from "#enums/species-id"; describe("Moves - Dragon Rage", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/dragon_tail.test.ts b/test/moves/dragon_tail.test.ts index 8c456f27853..c5a77716c56 100644 --- a/test/moves/dragon_tail.test.ts +++ b/test/moves/dragon_tail.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import { Status } from "#app/data/status-effect"; -import { Challenges } from "#enums/challenges"; -import { StatusEffect } from "#enums/status-effect"; -import { PokemonType } from "#enums/pokemon-type"; +import { allMoves } from "#data/data-lists"; +import { Status } from "#data/status-effect"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { Challenges } from "#enums/challenges"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/dynamax_cannon.test.ts b/test/moves/dynamax_cannon.test.ts index 3febf918de8..fcbbccd5123 100644 --- a/test/moves/dynamax_cannon.test.ts +++ b/test/moves/dynamax_cannon.test.ts @@ -1,11 +1,11 @@ +import { allMoves } from "#data/data-lists"; import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveId } from "#enums/move-id"; -import type Move from "#app/data/moves/move"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { Move } from "#moves/move"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/effectiveness.test.ts b/test/moves/effectiveness.test.ts index 58b2d07b1b6..58e041fb5c5 100644 --- a/test/moves/effectiveness.test.ts +++ b/test/moves/effectiveness.test.ts @@ -1,12 +1,12 @@ -import { allMoves } from "#app/data/data-lists"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { TrainerSlot } from "#enums/trainer-slot"; -import { PokemonType } from "#enums/pokemon-type"; +import * as Messages from "#app/messages"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import * as Messages from "#app/messages"; -import GameManager from "#test/testUtils/gameManager"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { GameManager } from "#test/testUtils/gameManager"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import Phaser from "phaser"; import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/electrify.test.ts b/test/moves/electrify.test.ts index b6a3cac9fff..c3aa925a331 100644 --- a/test/moves/electrify.test.ts +++ b/test/moves/electrify.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Electrify", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/electro_shot.test.ts b/test/moves/electro_shot.test.ts index 1d69e9c2fa7..cb696b162d5 100644 --- a/test/moves/electro_shot.test.ts +++ b/test/moves/electro_shot.test.ts @@ -1,13 +1,13 @@ +import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { WeatherType } from "#enums/weather-type"; -import { MoveResult } from "#enums/move-result"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Electro Shot", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/encore.test.ts b/test/moves/encore.test.ts index 772b7c96060..c20dc194ead 100644 --- a/test/moves/encore.test.ts +++ b/test/moves/encore.test.ts @@ -1,10 +1,10 @@ -import { BattlerTagType } from "#enums/battler-tag-type"; -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/endure.test.ts b/test/moves/endure.test.ts index 7738f7426fe..717c9d58211 100644 --- a/test/moves/endure.test.ts +++ b/test/moves/endure.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/entrainment.test.ts b/test/moves/entrainment.test.ts index 65586149492..9d7da455525 100644 --- a/test/moves/entrainment.test.ts +++ b/test/moves/entrainment.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/fairy_lock.test.ts b/test/moves/fairy_lock.test.ts index b9f854cdc93..5f20c39c6f8 100644 --- a/test/moves/fairy_lock.test.ts +++ b/test/moves/fairy_lock.test.ts @@ -1,9 +1,9 @@ -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/fake_out.test.ts b/test/moves/fake_out.test.ts index 4fc83e5aa07..815de9b9225 100644 --- a/test/moves/fake_out.test.ts +++ b/test/moves/fake_out.test.ts @@ -1,6 +1,6 @@ -import GameManager from "#test/testUtils/gameManager"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/false_swipe.test.ts b/test/moves/false_swipe.test.ts index bf9c8307c22..0aa16ff43e1 100644 --- a/test/moves/false_swipe.test.ts +++ b/test/moves/false_swipe.test.ts @@ -1,8 +1,8 @@ -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/fell_stinger.test.ts b/test/moves/fell_stinger.test.ts index 0737db9105f..c3ea17904af 100644 --- a/test/moves/fell_stinger.test.ts +++ b/test/moves/fell_stinger.test.ts @@ -1,13 +1,13 @@ -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import { StatusEffect } from "#app/enums/status-effect"; -import { WeatherType } from "#app/enums/weather-type"; -import { allMoves } from "#app/data/data-lists"; +import { StatusEffect } from "#enums/status-effect"; +import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Fell Stinger", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/fillet_away.test.ts b/test/moves/fillet_away.test.ts index 1e00f2ee02d..3ba4f5740eb 100644 --- a/test/moves/fillet_away.test.ts +++ b/test/moves/fillet_away.test.ts @@ -1,9 +1,9 @@ -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { toDmgValue } from "#app/utils/common"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/moves/first-attack-double-power.test.ts b/test/moves/first-attack-double-power.test.ts new file mode 100644 index 00000000000..7d1d9c4d762 --- /dev/null +++ b/test/moves/first-attack-double-power.test.ts @@ -0,0 +1,121 @@ +import { allMoves } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Moves - Fishious Rend & Bolt Beak", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .ability(AbilityId.STURDY) + .battleStyle("single") + .startingWave(5) + .criticalHits(false) + .enemyLevel(100) + .enemySpecies(SpeciesId.DRACOVISH) + .enemyAbility(AbilityId.BALL_FETCH) + .enemyMoveset(MoveId.SPLASH); + }); + + it.each<{ name: string; move: MoveId }>([ + { name: "Bolt Beak", move: MoveId.BOLT_BEAK }, + { name: "Fishious Rend", move: MoveId.FISHIOUS_REND }, + ])("$name should double power if the user moves before the target", async ({ move }) => { + const powerSpy = vi.spyOn(allMoves[move], "calculateBattlePower"); + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + + // turn 1: enemy, then player (no boost) + game.move.use(move); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[move].power); + + // turn 2: player, then enemy (boost) + game.move.use(move); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[move].power * 2); + }); + + it("should only consider the selected target in Double Battles", async () => { + game.override.battleStyle("double"); + const powerSpy = vi.spyOn(allMoves[MoveId.BOLT_BEAK], "calculateBattlePower"); + await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MILOTIC]); + + // Use move after everyone but P1 and enemy 1 have already moved + game.move.use(MoveId.BOLT_BEAK, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.use(MoveId.SPLASH, BattlerIndex.PLAYER_2); + await game.setTurnOrder([BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.BOLT_BEAK].power * 2); + }); + + it("should double power on the turn the target switches in", async () => { + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + const powerSpy = vi.spyOn(allMoves[MoveId.BOLT_BEAK], "calculateBattlePower"); + + game.move.use(MoveId.BOLT_BEAK); + game.forceEnemyToSwitch(); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.BOLT_BEAK].power * 2); + }); + + it("should double power on forced switch-induced sendouts", async () => { + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + const powerSpy = vi.spyOn(allMoves[MoveId.BOLT_BEAK], "calculateBattlePower"); + + game.move.use(MoveId.BOLT_BEAK); + await game.move.forceEnemyMove(MoveId.U_TURN); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.BOLT_BEAK].power * 2); + }); + + it.each<{ type: string; allyMove: MoveId }>([ + { type: "a Dancer-induced", allyMove: MoveId.FIERY_DANCE }, + { type: "an Instructed", allyMove: MoveId.INSTRUCT }, + ])("should double power if $type move is used as the target's first action that turn", async ({ allyMove }) => { + game.override.battleStyle("double").enemyAbility(AbilityId.DANCER); + const powerSpy = vi.spyOn(allMoves[MoveId.FISHIOUS_REND], "calculateBattlePower"); + await game.classicMode.startBattle([SpeciesId.DRACOVISH, SpeciesId.ARCTOZOLT]); + + // Simulate enemy having used splash last turn to allow Instruct to copy it + const enemy = game.field.getEnemyPokemon(); + enemy.pushMoveHistory({ + move: MoveId.SPLASH, + targets: [BattlerIndex.ENEMY], + turn: game.scene.currentBattle.turn - 1, + useMode: MoveUseMode.NORMAL, + }); + + game.move.use(MoveId.FISHIOUS_REND, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.use(allyMove, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY); + await game.setTurnOrder([BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.FISHIOUS_REND].power); + }); +}); diff --git a/test/moves/fissure.test.ts b/test/moves/fissure.test.ts index 27031a7736d..6fadf867e8a 100644 --- a/test/moves/fissure.test.ts +++ b/test/moves/fissure.test.ts @@ -1,13 +1,13 @@ -import { Stat } from "#enums/stat"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import type { EnemyPokemon, PlayerPokemon } from "#field/pokemon"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { SpeciesId } from "#enums/species-id"; describe("Moves - Fissure", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/flame_burst.test.ts b/test/moves/flame_burst.test.ts index 0a378df1077..76d9a100e37 100644 --- a/test/moves/flame_burst.test.ts +++ b/test/moves/flame_burst.test.ts @@ -1,10 +1,10 @@ -import { allAbilities } from "#app/data/data-lists"; +import { allAbilities } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import type Pokemon from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/flower_shield.test.ts b/test/moves/flower_shield.test.ts index c3c5e5cf870..16a1efacf35 100644 --- a/test/moves/flower_shield.test.ts +++ b/test/moves/flower_shield.test.ts @@ -1,12 +1,12 @@ -import { Stat } from "#enums/stat"; -import { SemiInvulnerableTag } from "#app/data/battler-tags"; -import { PokemonType } from "#enums/pokemon-type"; -import { BiomeId } from "#enums/biome-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { SemiInvulnerableTag } from "#data/battler-tags"; import { AbilityId } from "#enums/ability-id"; +import { BiomeId } from "#enums/biome-id"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/fly.test.ts b/test/moves/fly.test.ts index 7d8a6ee659e..c27db3686b4 100644 --- a/test/moves/fly.test.ts +++ b/test/moves/fly.test.ts @@ -1,14 +1,14 @@ -import { BattlerTagType } from "#enums/battler-tag-type"; -import { StatusEffect } from "#enums/status-effect"; -import { MoveResult } from "#enums/move-result"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Fly", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/focus_punch.test.ts b/test/moves/focus_punch.test.ts index 38b57b201c0..5123e99c6ff 100644 --- a/test/moves/focus_punch.test.ts +++ b/test/moves/focus_punch.test.ts @@ -1,12 +1,12 @@ -import { BerryPhase } from "#app/phases/berry-phase"; -import { MessagePhase } from "#app/phases/message-phase"; -import { MoveHeaderPhase } from "#app/phases/move-header-phase"; -import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { MessagePhase } from "#phases/message-phase"; +import { MoveHeaderPhase } from "#phases/move-header-phase"; +import { SwitchSummonPhase } from "#phases/switch-summon-phase"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import i18next from "i18next"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/follow_me.test.ts b/test/moves/follow_me.test.ts index a99ac0b6c00..891b1844512 100644 --- a/test/moves/follow_me.test.ts +++ b/test/moves/follow_me.test.ts @@ -1,10 +1,10 @@ -import { Stat } from "#enums/stat"; -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/moves/foresight.test.ts b/test/moves/foresight.test.ts index 96a341582f9..3163f65dd79 100644 --- a/test/moves/foresight.test.ts +++ b/test/moves/foresight.test.ts @@ -1,7 +1,7 @@ import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/forests_curse.test.ts b/test/moves/forests_curse.test.ts index 81ced674a33..812d3c57217 100644 --- a/test/moves/forests_curse.test.ts +++ b/test/moves/forests_curse.test.ts @@ -1,8 +1,8 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { PokemonType } from "#enums/pokemon-type"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/freeze_dry.test.ts b/test/moves/freeze_dry.test.ts index f1577d3d6c5..5639330db1b 100644 --- a/test/moves/freeze_dry.test.ts +++ b/test/moves/freeze_dry.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { PokemonType } from "#enums/pokemon-type"; +import { BattlerIndex } from "#enums/battler-index"; import { Challenges } from "#enums/challenges"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/freezy_frost.test.ts b/test/moves/freezy_frost.test.ts index 55f67de085f..9c917ee0854 100644 --- a/test/moves/freezy_frost.test.ts +++ b/test/moves/freezy_frost.test.ts @@ -1,12 +1,12 @@ -import { Stat } from "#enums/stat"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/data-lists"; -import { CommandPhase } from "#app/phases/command-phase"; describe("Moves - Freezy Frost", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/fusion_bolt.test.ts b/test/moves/fusion_bolt.test.ts index c92a483a497..ad6810cb412 100644 --- a/test/moves/fusion_bolt.test.ts +++ b/test/moves/fusion_bolt.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/fusion_flare.test.ts b/test/moves/fusion_flare.test.ts index c0df347fcce..d86f784bce4 100644 --- a/test/moves/fusion_flare.test.ts +++ b/test/moves/fusion_flare.test.ts @@ -1,8 +1,8 @@ -import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/fusion_flare_bolt.test.ts b/test/moves/fusion_flare_bolt.test.ts index 1967e9f12d1..1777eb5e07e 100644 --- a/test/moves/fusion_flare_bolt.test.ts +++ b/test/moves/fusion_flare_bolt.test.ts @@ -1,14 +1,14 @@ -import { Stat } from "#enums/stat"; +import { allMoves } from "#data/data-lists"; import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import type Move from "#app/data/moves/move"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { MovePhase } from "#app/phases/move-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import type { Move } from "#moves/move"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { MovePhase } from "#phases/move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/future_sight.test.ts b/test/moves/future_sight.test.ts index 7de70a88d10..96b71b8b0f1 100644 --- a/test/moves/future_sight.test.ts +++ b/test/moves/future_sight.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/gastro_acid.test.ts b/test/moves/gastro_acid.test.ts index 39167987809..9b8e8f33250 100644 --- a/test/moves/gastro_acid.test.ts +++ b/test/moves/gastro_acid.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { MoveResult } from "#enums/move-result"; import { BattleType } from "#enums/battle-type"; -import GameManager from "#test/testUtils/gameManager"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Gastro Acid", () => { @@ -100,12 +100,12 @@ describe("Moves - Gastro Acid", () => { await game.toNextTurn(); expect(enemyPokemon.summonData.abilitySuppressed).toBe(true); - game.move.select(MoveId.WATER_GUN); + game.move.use(MoveId.WATER_GUN); await game.toNextTurn(); // water gun should've dealt damage due to suppressed Water Absorb - expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp()); - game.move.select(MoveId.SPORE); + game.move.use(MoveId.SPORE); await game.toEndOfTurn(); // Comatose should block stauts effect diff --git a/test/moves/geomancy.test.ts b/test/moves/geomancy.test.ts index 452022b4cf1..100c4d85637 100644 --- a/test/moves/geomancy.test.ts +++ b/test/moves/geomancy.test.ts @@ -1,12 +1,12 @@ -import type { EffectiveStat } from "#enums/stat"; -import { Stat } from "#enums/stat"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { EffectiveStat } from "#enums/stat"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Geomancy", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/gigaton_hammer.test.ts b/test/moves/gigaton_hammer.test.ts index d80743f4ed0..69186886f40 100644 --- a/test/moves/gigaton_hammer.test.ts +++ b/test/moves/gigaton_hammer.test.ts @@ -1,7 +1,7 @@ import { BattlerIndex } from "#enums/battler-index"; -import GameManager from "#test/testUtils/gameManager"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/glaive_rush.test.ts b/test/moves/glaive_rush.test.ts index 0b6f30da71a..a09c35604b9 100644 --- a/test/moves/glaive_rush.test.ts +++ b/test/moves/glaive_rush.test.ts @@ -1,8 +1,8 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/growth.test.ts b/test/moves/growth.test.ts index 6eec30be49f..94df21271a1 100644 --- a/test/moves/growth.test.ts +++ b/test/moves/growth.test.ts @@ -1,12 +1,12 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Growth", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/grudge.test.ts b/test/moves/grudge.test.ts index 36030c88bad..ff18cd5d6a4 100644 --- a/test/moves/grudge.test.ts +++ b/test/moves/grudge.test.ts @@ -1,8 +1,8 @@ import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { BattlerIndex } from "#enums/battler-index"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/guard_split.test.ts b/test/moves/guard_split.test.ts index 878bb80f251..7972296f6ae 100644 --- a/test/moves/guard_split.test.ts +++ b/test/moves/guard_split.test.ts @@ -1,11 +1,11 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Guard Split", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/guard_swap.test.ts b/test/moves/guard_swap.test.ts index d2c33e45df0..eda4349b9f8 100644 --- a/test/moves/guard_swap.test.ts +++ b/test/moves/guard_swap.test.ts @@ -1,12 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat, BATTLE_STATS } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { BATTLE_STATS, Stat } from "#enums/stat"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Guard Swap", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/hard_press.test.ts b/test/moves/hard_press.test.ts index e57c9af981f..f61f5084752 100644 --- a/test/moves/hard_press.test.ts +++ b/test/moves/hard_press.test.ts @@ -1,12 +1,12 @@ -import { allMoves } from "#app/data/data-lists"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { Move } from "#moves/move"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import type Move from "#app/data/moves/move"; describe("Moves - Hard Press", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/haze.test.ts b/test/moves/haze.test.ts index f3e3dafae0a..990bbc62ae8 100644 --- a/test/moves/haze.test.ts +++ b/test/moves/haze.test.ts @@ -1,11 +1,11 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Haze", () => { describe("integration tests", () => { diff --git a/test/moves/heal_bell.test.ts b/test/moves/heal_bell.test.ts index 914307b4795..b6d757300ad 100644 --- a/test/moves/heal_bell.test.ts +++ b/test/moves/heal_bell.test.ts @@ -1,11 +1,11 @@ -import { StatusEffect } from "#app/enums/status-effect"; -import { CommandPhase } from "#app/phases/command-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Heal Bell", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/heal_block.test.ts b/test/moves/heal_block.test.ts index 77a10927930..0f3ff0df683 100644 --- a/test/moves/heal_block.test.ts +++ b/test/moves/heal_block.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -42,7 +42,7 @@ describe("Moves - Heal Block", () => { const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; - player.damageAndUpdate(enemy.getMaxHp() - 1); + player.damageAndUpdate(player.getMaxHp() - 1); game.move.select(MoveId.ABSORB); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); diff --git a/test/moves/heart_swap.test.ts b/test/moves/heart_swap.test.ts index e9e407b6b30..c90b13b88ef 100644 --- a/test/moves/heart_swap.test.ts +++ b/test/moves/heart_swap.test.ts @@ -1,12 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { BATTLE_STATS } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { BATTLE_STATS } from "#enums/stat"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Heart Swap", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/hyper_beam.test.ts b/test/moves/hyper_beam.test.ts index bca7cba4e9a..aa3ecfe910b 100644 --- a/test/moves/hyper_beam.test.ts +++ b/test/moves/hyper_beam.test.ts @@ -1,11 +1,11 @@ -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/imprison.test.ts b/test/moves/imprison.test.ts index 26eadb685f9..0007c07985c 100644 --- a/test/moves/imprison.test.ts +++ b/test/moves/imprison.test.ts @@ -1,11 +1,11 @@ +import { AbilityId } from "#enums/ability-id"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { ArenaTagType } from "#enums/arena-tag-type"; describe("Moves - Imprison", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/instruct.test.ts b/test/moves/instruct.test.ts index d12859301b6..c73091a0eea 100644 --- a/test/moves/instruct.test.ts +++ b/test/moves/instruct.test.ts @@ -1,15 +1,16 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#enums/move-result"; -import type { MovePhase } from "#app/phases/move-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveUseMode } from "#enums/move-use-mode"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import { RandomMoveAttr } from "#moves/move"; +import type { MovePhase } from "#phases/move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { TurnMove } from "#types/turn-move"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; @@ -202,21 +203,32 @@ describe("Moves - Instruct", () => { game.override.battleStyle("double").enemyMoveset(MoveId.SPLASH).enemySpecies(SpeciesId.MAGIKARP).enemyLevel(1); await game.classicMode.startBattle([SpeciesId.HISUI_ELECTRODE, SpeciesId.KOMMO_O]); - const [electrode, kommo_o] = game.scene.getPlayerField()!; - game.move.changeMoveset(electrode, MoveId.CHLOROBLAST); + const [electrode, kommo_o] = game.scene.getPlayerField(); + game.move.changeMoveset(electrode, MoveId.THUNDERBOLT); game.move.changeMoveset(kommo_o, MoveId.INSTRUCT); - game.move.select(MoveId.CHLOROBLAST, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.select(MoveId.THUNDERBOLT, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(MoveId.INSTRUCT, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); - await game.phaseInterceptor.to("BerryPhase"); + await game.toEndOfTurn(); - // Chloroblast always deals 50% max HP% recoil UNLESS you whiff - // due to lack of targets or similar, - // so all we have to do is check whether electrode fainted or not. - // Naturally, both karps should also be dead as well. - expect(electrode.isFainted()).toBe(true); - const [karp1, karp2] = game.scene.getEnemyField()!; + expect(electrode.getMoveHistory()).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + result: MoveResult.SUCCESS, + move: MoveId.THUNDERBOLT, + targets: [BattlerIndex.ENEMY], + useMode: MoveUseMode.NORMAL, + }), + expect.objectContaining({ + result: MoveResult.SUCCESS, + move: MoveId.THUNDERBOLT, + targets: [BattlerIndex.ENEMY_2], + useMode: MoveUseMode.NORMAL, + }), + ]), + ); + const [karp1, karp2] = game.scene.getEnemyField(); expect(karp1.isFainted()).toBe(true); expect(karp2.isFainted()).toBe(true); }); @@ -349,7 +361,7 @@ describe("Moves - Instruct", () => { useMode: MoveUseMode.NORMAL, }); - game.move.select(MoveId.SPLASH); + game.move.use(MoveId.SPLASH); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toEndOfTurn(); expect(game.field.getEnemyPokemon().getLastXMoves()[0].result).toBe(MoveResult.FAIL); diff --git a/test/moves/jaw_lock.test.ts b/test/moves/jaw_lock.test.ts index 4e103c14f98..b5e98fbf6d8 100644 --- a/test/moves/jaw_lock.test.ts +++ b/test/moves/jaw_lock.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { FaintPhase } from "#app/phases/faint-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { BerryPhase } from "#phases/berry-phase"; +import { FaintPhase } from "#phases/faint-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/lash_out.test.ts b/test/moves/lash_out.test.ts index 33a58914978..b529351e01f 100644 --- a/test/moves/lash_out.test.ts +++ b/test/moves/lash_out.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/last-resort.test.ts b/test/moves/last-resort.test.ts index 3cb98a0cd92..4eaf1ee7f5d 100644 --- a/test/moves/last-resort.test.ts +++ b/test/moves/last-resort.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; -import { MoveUseMode } from "#enums/move-use-mode"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/last_respects.test.ts b/test/moves/last_respects.test.ts index 14aa5ad3309..e438971125a 100644 --- a/test/moves/last_respects.test.ts +++ b/test/moves/last_respects.test.ts @@ -1,11 +1,11 @@ -import { MoveId } from "#enums/move-id"; -import { BattlerIndex } from "#enums/battler-index"; -import { SpeciesId } from "#enums/species-id"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; -import { allMoves } from "#app/data/data-lists"; -import type Move from "#app/data/moves/move"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import type { Move } from "#moves/move"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/light_screen.test.ts b/test/moves/light_screen.test.ts index 8c436aacf6a..5dcdc3c271c 100644 --- a/test/moves/light_screen.test.ts +++ b/test/moves/light_screen.test.ts @@ -1,15 +1,15 @@ -import type BattleScene from "#app/battle-scene"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import type Move from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; +import type { BattleScene } from "#app/battle-scene"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import type Pokemon from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { NumberHolder } from "#app/utils/common"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/lucky_chant.test.ts b/test/moves/lucky_chant.test.ts index a57d231134b..afcdd901382 100644 --- a/test/moves/lucky_chant.test.ts +++ b/test/moves/lucky_chant.test.ts @@ -1,10 +1,10 @@ import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { BattlerIndex } from "#enums/battler-index"; describe("Moves - Lucky Chant", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/lunar_blessing.test.ts b/test/moves/lunar_blessing.test.ts index 2709ccbacf3..5d6bc44201d 100644 --- a/test/moves/lunar_blessing.test.ts +++ b/test/moves/lunar_blessing.test.ts @@ -1,9 +1,9 @@ -import { StatusEffect } from "#app/enums/status-effect"; -import { CommandPhase } from "#app/phases/command-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/lunar_dance.test.ts b/test/moves/lunar_dance.test.ts index aea1e31b616..c49baad3e8f 100644 --- a/test/moves/lunar_dance.test.ts +++ b/test/moves/lunar_dance.test.ts @@ -1,11 +1,11 @@ -import { StatusEffect } from "#app/enums/status-effect"; -import { CommandPhase } from "#app/phases/command-phase"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Lunar Dance", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/magic_coat.test.ts b/test/moves/magic_coat.test.ts index 566c206f1ba..4a026ceb84e 100644 --- a/test/moves/magic_coat.test.ts +++ b/test/moves/magic_coat.test.ts @@ -1,15 +1,15 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { Stat } from "#app/enums/stat"; -import { StatusEffect } from "#app/enums/status-effect"; -import { MoveResult } from "#enums/move-result"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Magic Coat", () => { diff --git a/test/moves/magnet_rise.test.ts b/test/moves/magnet_rise.test.ts index d8fc6a74225..0fc96fa1a05 100644 --- a/test/moves/magnet_rise.test.ts +++ b/test/moves/magnet_rise.test.ts @@ -1,8 +1,8 @@ -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { CommandPhase } from "#phases/command-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/make_it_rain.test.ts b/test/moves/make_it_rain.test.ts index 13b8e8f1853..47f1bc89fc1 100644 --- a/test/moves/make_it_rain.test.ts +++ b/test/moves/make_it_rain.test.ts @@ -1,12 +1,12 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { StatStageChangePhase } from "#phases/stat-stage-change-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; describe("Moves - Make It Rain", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/mat_block.test.ts b/test/moves/mat_block.test.ts index d77f538a973..edbe465e500 100644 --- a/test/moves/mat_block.test.ts +++ b/test/moves/mat_block.test.ts @@ -1,13 +1,13 @@ -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BerryPhase } from "#phases/berry-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Moves - Mat Block", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/metal_burst.test.ts b/test/moves/metal_burst.test.ts index 4d07d59c16d..c99b4324878 100644 --- a/test/moves/metal_burst.test.ts +++ b/test/moves/metal_burst.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/metronome.test.ts b/test/moves/metronome.test.ts index 670f7bb9b88..9a9fcdff04a 100644 --- a/test/moves/metronome.test.ts +++ b/test/moves/metronome.test.ts @@ -1,18 +1,18 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { RechargingTag, SemiInvulnerableTag } from "#app/data/battler-tags"; -import type { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; +import { RechargingTag, SemiInvulnerableTag } from "#data/battler-tags"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { Stat } from "#app/enums/stat"; -import { MoveResult } from "#enums/move-result"; -import { CommandPhase } from "#app/phases/command-phase"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { MoveUseMode } from "#enums/move-use-mode"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { MoveUseMode } from "#enums/move-use-mode"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import type { RandomMoveAttr } from "#moves/move"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Metronome", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/miracle_eye.test.ts b/test/moves/miracle_eye.test.ts index 9281931621f..d77da857068 100644 --- a/test/moves/miracle_eye.test.ts +++ b/test/moves/miracle_eye.test.ts @@ -1,8 +1,8 @@ import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/mirror_move.test.ts b/test/moves/mirror_move.test.ts index 03de93c56dc..7f833c08bf5 100644 --- a/test/moves/mirror_move.test.ts +++ b/test/moves/mirror_move.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { Stat } from "#app/enums/stat"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/mist.test.ts b/test/moves/mist.test.ts index 4191aae0a46..b420b234e15 100644 --- a/test/moves/mist.test.ts +++ b/test/moves/mist.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/moongeist_beam.test.ts b/test/moves/moongeist_beam.test.ts deleted file mode 100644 index 367fe67cff5..00000000000 --- a/test/moves/moongeist_beam.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { allMoves } from "#app/data/data-lists"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; - -describe("Moves - Moongeist Beam", () => { - let phaserGame: Phaser.Game; - let game: GameManager; - - beforeAll(() => { - phaserGame = new Phaser.Game({ - type: Phaser.HEADLESS, - }); - }); - - afterEach(() => { - game.phaseInterceptor.restoreOg(); - }); - - beforeEach(() => { - game = new GameManager(phaserGame); - game.override - .moveset([MoveId.MOONGEIST_BEAM, MoveId.METRONOME]) - .ability(AbilityId.BALL_FETCH) - .startingLevel(200) - .battleStyle("single") - .criticalHits(false) - .enemySpecies(SpeciesId.MAGIKARP) - .enemyAbility(AbilityId.STURDY) - .enemyMoveset(MoveId.SPLASH); - }); - - // Also covers Photon Geyser and Sunsteel Strike - it("should ignore enemy abilities", async () => { - await game.classicMode.startBattle([SpeciesId.MILOTIC]); - - const enemy = game.scene.getEnemyPokemon()!; - - game.move.select(MoveId.MOONGEIST_BEAM); - await game.phaseInterceptor.to("BerryPhase"); - - expect(enemy.isFainted()).toBe(true); - }); - - // Also covers Photon Geyser and Sunsteel Strike - it("should not ignore enemy abilities when called by another move, such as metronome", async () => { - await game.classicMode.startBattle([SpeciesId.MILOTIC]); - vi.spyOn(allMoves[MoveId.METRONOME].getAttrs("RandomMoveAttr")[0], "getMoveOverride").mockReturnValue( - MoveId.MOONGEIST_BEAM, - ); - - game.move.select(MoveId.METRONOME); - await game.phaseInterceptor.to("BerryPhase"); - - expect(game.scene.getEnemyPokemon()!.isFainted()).toBe(false); - expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].move).toBe(MoveId.MOONGEIST_BEAM); - }); -}); diff --git a/test/moves/multi_target.test.ts b/test/moves/multi_target.test.ts index bc6b24c474d..a58fb8d3a6b 100644 --- a/test/moves/multi_target.test.ts +++ b/test/moves/multi_target.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; -import { SpeciesId } from "#enums/species-id"; -import { toDmgValue } from "#app/utils/common"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/nightmare.test.ts b/test/moves/nightmare.test.ts index e005def85ad..07579a6790c 100644 --- a/test/moves/nightmare.test.ts +++ b/test/moves/nightmare.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/obstruct.test.ts b/test/moves/obstruct.test.ts index fc534180bef..ef589213c74 100644 --- a/test/moves/obstruct.test.ts +++ b/test/moves/obstruct.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/octolock.test.ts b/test/moves/octolock.test.ts index 2a2f8743ad2..bf2f8dc5865 100644 --- a/test/moves/octolock.test.ts +++ b/test/moves/octolock.test.ts @@ -1,9 +1,9 @@ -import { TrappedTag } from "#app/data/battler-tags"; +import { TrappedTag } from "#data/battler-tags"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/order_up.test.ts b/test/moves/order_up.test.ts index fc505809fe6..2c9702fd6cb 100644 --- a/test/moves/order_up.test.ts +++ b/test/moves/order_up.test.ts @@ -1,12 +1,12 @@ +import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; import { PokemonAnimType } from "#enums/pokemon-anim-type"; +import { SpeciesId } from "#enums/species-id"; import type { EffectiveStat } from "#enums/stat"; import { Stat } from "#enums/stat"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/parting_shot.test.ts b/test/moves/parting_shot.test.ts index fdeab6bfc7c..86a14330a3e 100644 --- a/test/moves/parting_shot.test.ts +++ b/test/moves/parting_shot.test.ts @@ -1,14 +1,14 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { BerryPhase } from "#phases/berry-phase"; +import { FaintPhase } from "#phases/faint-phase"; +import { MessagePhase } from "#phases/message-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, test } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { Stat } from "#enums/stat"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { FaintPhase } from "#app/phases/faint-phase"; -import { MessagePhase } from "#app/phases/message-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Parting Shot", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/payback.test.ts b/test/moves/payback.test.ts new file mode 100644 index 00000000000..20e832288a3 --- /dev/null +++ b/test/moves/payback.test.ts @@ -0,0 +1,69 @@ +import { allMoves } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from "vitest"; + +describe("Move - Payback", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + let powerSpy: MockInstance; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .ability(AbilityId.BALL_FETCH) + .battleStyle("single") + .criticalHits(false) + .enemyLevel(100) + .enemySpecies(SpeciesId.DRACOVISH) + .enemyAbility(AbilityId.BALL_FETCH) + .enemyMoveset(MoveId.SPLASH) + .startingModifier([{ name: "POKEBALL", count: 5 }]); + + powerSpy = vi.spyOn(allMoves[MoveId.PAYBACK], "calculateBattlePower"); + }); + + it("should double power if the user moves after the target", async () => { + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + + // turn 1: enemy, then player (boost) + game.move.use(MoveId.PAYBACK); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.PAYBACK].power * 2); + + // turn 2: player, then enemy (no boost) + game.move.use(MoveId.PAYBACK); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.PAYBACK].power); + }); + + // TODO: Enable test once ability to force catch failure is added + it.todo("should trigger for enemies on player failed ball catch", async () => { + await game.classicMode.startBattle([SpeciesId.FEEBAS]); + + game.doThrowPokeball(PokeballType.POKEBALL); + await game.move.forceEnemyMove(MoveId.PAYBACK); + await game.toEndOfTurn(); + + expect(powerSpy).toHaveLastReturnedWith(allMoves[MoveId.PAYBACK].power * 2); + }); +}); diff --git a/test/moves/plasma_fists.test.ts b/test/moves/plasma_fists.test.ts index 7d1985be13e..7a5ba77b62d 100644 --- a/test/moves/plasma_fists.test.ts +++ b/test/moves/plasma_fists.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Plasma Fists", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/pledge_moves.test.ts b/test/moves/pledge_moves.test.ts index f653e245f6f..bd0c981517c 100644 --- a/test/moves/pledge_moves.test.ts +++ b/test/moves/pledge_moves.test.ts @@ -1,17 +1,16 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allAbilities } from "#app/data/data-lists"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allMoves } from "#app/data/data-lists"; -import { PokemonType } from "#enums/pokemon-type"; -import { ArenaTagType } from "#enums/arena-tag-type"; -import { Stat } from "#enums/stat"; -import { toDmgValue } from "#app/utils/common"; +import { allAbilities, allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Pledge Moves", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/pollen_puff.test.ts b/test/moves/pollen_puff.test.ts index 0a9b6d9cf24..c07afc8493a 100644 --- a/test/moves/pollen_puff.test.ts +++ b/test/moves/pollen_puff.test.ts @@ -1,8 +1,8 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { MoveResult } from "#enums/move-result"; diff --git a/test/moves/powder.test.ts b/test/moves/powder.test.ts index 8f47f2ff428..3e60c0d9fec 100644 --- a/test/moves/powder.test.ts +++ b/test/moves/powder.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; -import { BerryPhase } from "#app/phases/berry-phase"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; +import { MoveResult } from "#enums/move-result"; import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/power_shift.test.ts b/test/moves/power_shift.test.ts index cd5252c3f2f..069d793a794 100644 --- a/test/moves/power_shift.test.ts +++ b/test/moves/power_shift.test.ts @@ -1,8 +1,8 @@ +import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { Stat } from "#app/enums/stat"; -import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/power_split.test.ts b/test/moves/power_split.test.ts index c0fcd317182..ef6fda419ca 100644 --- a/test/moves/power_split.test.ts +++ b/test/moves/power_split.test.ts @@ -1,11 +1,11 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Power Split", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/power_swap.test.ts b/test/moves/power_swap.test.ts index 82662850c77..cdd52fbc524 100644 --- a/test/moves/power_swap.test.ts +++ b/test/moves/power_swap.test.ts @@ -1,12 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat, BATTLE_STATS } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { BATTLE_STATS, Stat } from "#enums/stat"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Power Swap", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/power_trick.test.ts b/test/moves/power_trick.test.ts index af90525d263..29a8107d891 100644 --- a/test/moves/power_trick.test.ts +++ b/test/moves/power_trick.test.ts @@ -1,12 +1,12 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Power Trick", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/protect.test.ts b/test/moves/protect.test.ts index 601afb43ec3..9fd54d44891 100644 --- a/test/moves/protect.test.ts +++ b/test/moves/protect.test.ts @@ -1,15 +1,15 @@ -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; +import { ArenaTrapTag } from "#data/arena-tag"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/data-lists"; -import { ArenaTrapTag } from "#app/data/arena-tag"; import { ArenaTagSide } from "#enums/arena-tag-side"; import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; describe("Moves - Protect", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/psycho_shift.test.ts b/test/moves/psycho_shift.test.ts index e4eb2bd8ef6..6414a91543b 100644 --- a/test/moves/psycho_shift.test.ts +++ b/test/moves/psycho_shift.test.ts @@ -1,8 +1,8 @@ -import { StatusEffect } from "#app/enums/status-effect"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/purify.test.ts b/test/moves/purify.test.ts index 2e8e312f23c..a5d7d86851b 100644 --- a/test/moves/purify.test.ts +++ b/test/moves/purify.test.ts @@ -1,11 +1,11 @@ +import { Status } from "#data/status-effect"; import { BattlerIndex } from "#enums/battler-index"; -import { Status } from "#app/data/status-effect"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import type { EnemyPokemon, PlayerPokemon } from "#field/pokemon"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/moves/quash.test.ts b/test/moves/quash.test.ts index 158c409cf05..632d37a4e13 100644 --- a/test/moves/quash.test.ts +++ b/test/moves/quash.test.ts @@ -1,13 +1,13 @@ -import { SpeciesId } from "#enums/species-id"; -import { MoveId } from "#enums/move-id"; import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; -import { WeatherType } from "#enums/weather-type"; +import { MoveId } from "#enums/move-id"; import { MoveResult } from "#enums/move-result"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { describe, beforeAll, afterEach, beforeEach, it, expect } from "vitest"; import { MoveUseMode } from "#enums/move-use-mode"; +import { SpeciesId } from "#enums/species-id"; +import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Quash", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/quick_guard.test.ts b/test/moves/quick_guard.test.ts index 7146b804ffa..5e2e1ae1f24 100644 --- a/test/moves/quick_guard.test.ts +++ b/test/moves/quick_guard.test.ts @@ -1,12 +1,12 @@ +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; describe("Moves - Quick Guard", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/rage_fist.test.ts b/test/moves/rage_fist.test.ts index 31dd987cb87..d7928ddd310 100644 --- a/test/moves/rage_fist.test.ts +++ b/test/moves/rage_fist.test.ts @@ -1,13 +1,13 @@ -import { BattlerIndex } from "#enums/battler-index"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { allMoves } from "#app/data/data-lists"; -import type Move from "#app/data/moves/move"; -import GameManager from "#test/testUtils/gameManager"; +import type { Move } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { BattleType } from "#enums/battle-type"; describe("Moves - Rage Fist", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/rage_powder.test.ts b/test/moves/rage_powder.test.ts index 845bff33d04..a0b836f0917 100644 --- a/test/moves/rage_powder.test.ts +++ b/test/moves/rage_powder.test.ts @@ -1,8 +1,8 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/moves/reflect.test.ts b/test/moves/reflect.test.ts index ef8c80070bf..47c49ea4d36 100644 --- a/test/moves/reflect.test.ts +++ b/test/moves/reflect.test.ts @@ -1,15 +1,15 @@ -import type BattleScene from "#app/battle-scene"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import type Move from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; +import type { BattleScene } from "#app/battle-scene"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import type Pokemon from "#app/field/pokemon"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { NumberHolder } from "#app/utils/common"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { Pokemon } from "#field/pokemon"; +import type { Move } from "#moves/move"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { NumberHolder } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/reflect_type.test.ts b/test/moves/reflect_type.test.ts index 0915069764c..499c167bee0 100644 --- a/test/moves/reflect_type.test.ts +++ b/test/moves/reflect_type.test.ts @@ -1,8 +1,8 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { PokemonType } from "#enums/pokemon-type"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -30,30 +30,26 @@ describe("Moves - Reflect Type", () => { }); it("will make the user Normal/Grass if targetting a typeless Pokemon affected by Forest's Curse", async () => { - game.override - .moveset([MoveId.FORESTS_CURSE, MoveId.REFLECT_TYPE]) - .startingLevel(60) - .enemySpecies(SpeciesId.CHARMANDER) - .enemyMoveset([MoveId.BURN_UP, MoveId.SPLASH]); + game.override.startingLevel(60).enemySpecies(SpeciesId.CHARMANDER); await game.classicMode.startBattle([SpeciesId.FEEBAS]); - const playerPokemon = game.scene.getPlayerPokemon(); - const enemyPokemon = game.scene.getEnemyPokemon(); + const playerPokemon = game.field.getPlayerPokemon(); + const enemyPokemon = game.field.getEnemyPokemon(); - game.move.select(MoveId.SPLASH); - await game.move.selectEnemyMove(MoveId.BURN_UP); + game.move.use(MoveId.SPLASH); + await game.move.forceEnemyMove(MoveId.BURN_UP); await game.toNextTurn(); - game.move.select(MoveId.FORESTS_CURSE); - await game.move.selectEnemyMove(MoveId.SPLASH); + game.move.use(MoveId.FORESTS_CURSE); + await game.move.forceEnemyMove(MoveId.SPLASH); await game.toNextTurn(); - expect(enemyPokemon?.getTypes().includes(PokemonType.UNKNOWN)).toBe(true); - expect(enemyPokemon?.getTypes().includes(PokemonType.GRASS)).toBe(true); + expect(enemyPokemon.getTypes().includes(PokemonType.UNKNOWN)).toBe(true); + expect(enemyPokemon.getTypes().includes(PokemonType.GRASS)).toBe(true); - game.move.select(MoveId.REFLECT_TYPE); - await game.move.selectEnemyMove(MoveId.SPLASH); + game.move.use(MoveId.REFLECT_TYPE); + await game.move.forceEnemyMove(MoveId.SPLASH); await game.phaseInterceptor.to("TurnEndPhase"); - expect(playerPokemon?.getTypes()[0]).toBe(PokemonType.NORMAL); - expect(playerPokemon?.getTypes().includes(PokemonType.GRASS)).toBe(true); + expect(playerPokemon.getTypes()[0]).toBe(PokemonType.NORMAL); + expect(playerPokemon.getTypes().includes(PokemonType.GRASS)).toBe(true); }); }); diff --git a/test/moves/relic_song.test.ts b/test/moves/relic_song.test.ts index b3dd400a202..36c46769515 100644 --- a/test/moves/relic_song.test.ts +++ b/test/moves/relic_song.test.ts @@ -1,9 +1,9 @@ -import { PokemonType } from "#enums/pokemon-type"; -import { Challenges } from "#app/enums/challenges"; import { AbilityId } from "#enums/ability-id"; +import { Challenges } from "#enums/challenges"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/retaliate.test.ts b/test/moves/retaliate.test.ts index dd5029a7c83..3eefbe3ceb6 100644 --- a/test/moves/retaliate.test.ts +++ b/test/moves/retaliate.test.ts @@ -1,10 +1,10 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; +import { allMoves } from "#data/data-lists"; import { MoveId } from "#enums/move-id"; -import { allMoves } from "#app/data/data-lists"; -import type Move from "#app/data/moves/move"; +import { SpeciesId } from "#enums/species-id"; +import type { Move } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Retaliate", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/revival_blessing.test.ts b/test/moves/revival_blessing.test.ts index 1f2ba869e4f..a9a6bd0fd7d 100644 --- a/test/moves/revival_blessing.test.ts +++ b/test/moves/revival_blessing.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; -import { toDmgValue } from "#app/utils/common"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { toDmgValue } from "#utils/common"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/role_play.test.ts b/test/moves/role_play.test.ts index cfa38ed38b7..dda7f319cd5 100644 --- a/test/moves/role_play.test.ts +++ b/test/moves/role_play.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/rollout.test.ts b/test/moves/rollout.test.ts index 9639a2e5408..46c53b05c6c 100644 --- a/test/moves/rollout.test.ts +++ b/test/moves/rollout.test.ts @@ -1,9 +1,9 @@ -import { allMoves } from "#app/data/data-lists"; -import { CommandPhase } from "#app/phases/command-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/roost.test.ts b/test/moves/roost.test.ts index 7fa52b8f2f7..ba9175dfeb6 100644 --- a/test/moves/roost.test.ts +++ b/test/moves/roost.test.ts @@ -1,11 +1,11 @@ -import { PokemonType } from "#enums/pokemon-type"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { AbilityId } from "#enums/ability-id"; describe("Moves - Roost", () => { let phaserGame: Phaser.Game; @@ -29,7 +29,7 @@ describe("Moves - Roost", () => { .ability(AbilityId.TRIAGE) .startingLevel(100) .enemyLevel(100) - .enemyMoveset(MoveId.SPLASH) + .enemyMoveset(MoveId.SPLASH); }); it("should remove the user's Flying type until end of turn", async () => { @@ -41,16 +41,15 @@ describe("Moves - Roost", () => { game.move.use(MoveId.ROOST); await game.phaseInterceptor.to("MoveEffectPhase"); - // Should lose flying type temporarily expect(hawlucha.getTag(BattlerTagType.ROOSTED)).toBeDefined(); - expect(hawlucha.getTypes()).toEqual([PokemonType.FIGHTING]) + expect(hawlucha.getTypes()).toEqual([PokemonType.FIGHTING]); expect(hawlucha.isGrounded()).toBe(true); await game.toEndOfTurn(); // Should have changed back to fighting/flying - expect(hawlucha.getTypes()).toEqual([PokemonType.FIGHTING, PokemonType.FLYING]) + expect(hawlucha.getTypes()).toEqual([PokemonType.FIGHTING, PokemonType.FLYING]); expect(hawlucha.isGrounded()).toBe(false); }); @@ -82,9 +81,9 @@ describe("Moves - Roost", () => { expect(tornadus.isGrounded()).toBe(true); }); - it.each<{ name: string, move: MoveId, species: SpeciesId }>([ + it.each<{ name: string; move: MoveId; species: SpeciesId }>([ { name: "Burn Up", move: MoveId.BURN_UP, species: SpeciesId.MOLTRES }, - { name: "Double Shock", move: MoveId.DOUBLE_SHOCK, species: SpeciesId.ZAPDOS } + { name: "Double Shock", move: MoveId.DOUBLE_SHOCK, species: SpeciesId.ZAPDOS }, ])("should render user typeless when roosting after using $name", async ({ move, species }) => { await game.classicMode.startBattle([species]); @@ -120,7 +119,7 @@ describe("Moves - Roost", () => { moltres.hp = 1; game.move.use(MoveId.ROOST); - await game.move.forceEnemyMove(MoveId.TRICK_OR_TREAT) + await game.move.forceEnemyMove(MoveId.TRICK_OR_TREAT); await game.toEndOfTurn(false); expect(moltres.getTypes()).toEqual([PokemonType.FIRE, PokemonType.GHOST]); diff --git a/test/moves/round.test.ts b/test/moves/round.test.ts index 8e07a819131..a706fd15e9b 100644 --- a/test/moves/round.test.ts +++ b/test/moves/round.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/safeguard.test.ts b/test/moves/safeguard.test.ts index 91aa298a8ca..2651d8473be 100644 --- a/test/moves/safeguard.test.ts +++ b/test/moves/safeguard.test.ts @@ -1,12 +1,12 @@ +import { allAbilities } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; -import { allAbilities } from "#app/data/data-lists"; -import { StatusEffect } from "#app/enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { AbilityId } from "#enums/ability-id"; describe("Moves - Safeguard", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/scale_shot.test.ts b/test/moves/scale_shot.test.ts index e2c86091378..4e420f6b3ef 100644 --- a/test/moves/scale_shot.test.ts +++ b/test/moves/scale_shot.test.ts @@ -1,16 +1,16 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Scale Shot", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/secret_power.test.ts b/test/moves/secret_power.test.ts index adb91162ae8..8ec69fb276a 100644 --- a/test/moves/secret_power.test.ts +++ b/test/moves/secret_power.test.ts @@ -1,17 +1,16 @@ +import { allAbilities, allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BiomeId } from "#enums/biome-id"; import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/data-lists"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { StatusEffect } from "#enums/status-effect"; -import { BattlerIndex } from "#enums/battler-index"; -import { ArenaTagType } from "#enums/arena-tag-type"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { allAbilities } from "#app/data/data-lists"; describe("Moves - Secret Power", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/shed_tail.test.ts b/test/moves/shed_tail.test.ts index 81ab9215bc9..8a837a642c9 100644 --- a/test/moves/shed_tail.test.ts +++ b/test/moves/shed_tail.test.ts @@ -1,11 +1,11 @@ -import { SubstituteTag } from "#app/data/battler-tags"; -import { MoveResult } from "#enums/move-result"; +import { SubstituteTag } from "#data/battler-tags"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Shed Tail", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/shell_side_arm.test.ts b/test/moves/shell_side_arm.test.ts index 35246e10e3f..685cebce4cf 100644 --- a/test/moves/shell_side_arm.test.ts +++ b/test/moves/shell_side_arm.test.ts @@ -1,11 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import type { ShellSideArmCategoryAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import type Move from "#app/data/moves/move"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { Move, ShellSideArmCategoryAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/shell_trap.test.ts b/test/moves/shell_trap.test.ts index a3f55cef10f..c484d1195aa 100644 --- a/test/moves/shell_trap.test.ts +++ b/test/moves/shell_trap.test.ts @@ -1,12 +1,12 @@ +import { allMoves } from "#data/data-lists"; import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { MoveResult } from "#enums/move-result"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { BerryPhase } from "#phases/berry-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { MovePhase } from "#phases/move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/simple_beam.test.ts b/test/moves/simple_beam.test.ts index f8549944ed9..106977aea84 100644 --- a/test/moves/simple_beam.test.ts +++ b/test/moves/simple_beam.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/sketch.test.ts b/test/moves/sketch.test.ts index 5e9ce9a9e84..10ad31c35eb 100644 --- a/test/moves/sketch.test.ts +++ b/test/moves/sketch.test.ts @@ -1,15 +1,15 @@ +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; import { MoveResult } from "#enums/move-result"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; +import { RandomMoveAttr } from "#moves/move"; +import { PokemonMove } from "#moves/pokemon-move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { StatusEffect } from "#app/enums/status-effect"; -import { BattlerIndex } from "#enums/battler-index"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; describe("Moves - Sketch", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/skill_swap.test.ts b/test/moves/skill_swap.test.ts index 7c2e6f5fd0a..d5ba509b0df 100644 --- a/test/moves/skill_swap.test.ts +++ b/test/moves/skill_swap.test.ts @@ -1,8 +1,8 @@ -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/sleep_talk.test.ts b/test/moves/sleep_talk.test.ts index 84e9d509a03..972c54463e2 100644 --- a/test/moves/sleep_talk.test.ts +++ b/test/moves/sleep_talk.test.ts @@ -1,10 +1,10 @@ -import { Stat } from "#app/enums/stat"; -import { StatusEffect } from "#app/enums/status-effect"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/solar_beam.test.ts b/test/moves/solar_beam.test.ts index 55d2ee5d13c..32400abfc0f 100644 --- a/test/moves/solar_beam.test.ts +++ b/test/moves/solar_beam.test.ts @@ -1,13 +1,13 @@ -import { allMoves } from "#app/data/data-lists"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { WeatherType } from "#enums/weather-type"; -import { MoveResult } from "#enums/move-result"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { WeatherType } from "#enums/weather-type"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Solar Beam", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/sparkly_swirl.test.ts b/test/moves/sparkly_swirl.test.ts index d1cbdd70107..b81bda66c56 100644 --- a/test/moves/sparkly_swirl.test.ts +++ b/test/moves/sparkly_swirl.test.ts @@ -1,10 +1,10 @@ -import { allMoves } from "#app/data/data-lists"; -import { StatusEffect } from "#app/enums/status-effect"; -import { CommandPhase } from "#app/phases/command-phase"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/spectral_thief.test.ts b/test/moves/spectral_thief.test.ts index e7b19eda506..acb3e22cf6c 100644 --- a/test/moves/spectral_thief.test.ts +++ b/test/moves/spectral_thief.test.ts @@ -1,11 +1,11 @@ +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; -import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/data-lists"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/speed_swap.test.ts b/test/moves/speed_swap.test.ts index 3723e7db740..e0c06bfb0f7 100644 --- a/test/moves/speed_swap.test.ts +++ b/test/moves/speed_swap.test.ts @@ -1,11 +1,11 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat } from "#enums/stat"; import { AbilityId } from "#enums/ability-id"; +import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Speed Swap", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/spikes.test.ts b/test/moves/spikes.test.ts index 49492701d18..424aecb5c3c 100644 --- a/test/moves/spikes.test.ts +++ b/test/moves/spikes.test.ts @@ -1,11 +1,12 @@ +import { ArenaTrapTag } from "#data/arena-tag"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { ArenaTrapTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; describe("Moves - Spikes", () => { let phaserGame: Phaser.Game; @@ -80,14 +81,19 @@ describe("Moves - Spikes", () => { expect(enemy.hp).toBeLessThan(enemy.getMaxHp()); }); - it("should work when all targets fainted", async () => { - game.override.enemySpecies(SpeciesId.DIGLETT).battleStyle("double").startingLevel(50); - await game.classicMode.startBattle([SpeciesId.RAYQUAZA, SpeciesId.ROWLET]); + // TODO: re-enable after re-fixing hazards moves + it.todo("should work when all targets fainted", async () => { + game.override.enemySpecies(SpeciesId.DIGLETT).battleStyle("double").startingLevel(1000); + await game.classicMode.startBattle([SpeciesId.RAYQUAZA, SpeciesId.SHUCKLE]); - game.move.select(MoveId.EARTHQUAKE); - game.move.select(MoveId.SPIKES, 1); - await game.phaseInterceptor.to("TurnEndPhase"); + const [enemy1, enemy2] = game.scene.getEnemyField(); + game.move.use(MoveId.HYPER_VOICE, BattlerIndex.PLAYER); + game.move.use(MoveId.SPIKES, BattlerIndex.PLAYER_2); + await game.toEndOfTurn(); + + expect(enemy1.isFainted()).toBe(true); + expect(enemy2.isFainted()).toBe(true); expect(game.scene.arena.getTagOnSide(ArenaTrapTag, ArenaTagSide.ENEMY)).toBeDefined(); }); }); diff --git a/test/moves/spotlight.test.ts b/test/moves/spotlight.test.ts index a9e8cd7e2b6..4feff5eb719 100644 --- a/test/moves/spotlight.test.ts +++ b/test/moves/spotlight.test.ts @@ -1,8 +1,8 @@ import { BattlerIndex } from "#enums/battler-index"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; diff --git a/test/moves/steamroller.test.ts b/test/moves/steamroller.test.ts index 4eb011c47f5..a9da98c1429 100644 --- a/test/moves/steamroller.test.ts +++ b/test/moves/steamroller.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { DamageCalculationResult } from "#app/field/pokemon"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { DamageCalculationResult } from "#types/damage-result"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/stockpile.test.ts b/test/moves/stockpile.test.ts index 3ad47d8d85e..d2465446ff6 100644 --- a/test/moves/stockpile.test.ts +++ b/test/moves/stockpile.test.ts @@ -1,12 +1,12 @@ -import { Stat } from "#enums/stat"; -import { StockpilingTag } from "#app/data/battler-tags"; -import { MoveResult } from "#enums/move-result"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { StockpilingTag } from "#data/battler-tags"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { CommandPhase } from "#phases/command-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/struggle.test.ts b/test/moves/struggle.test.ts index e1373b29d33..2d624f6d338 100644 --- a/test/moves/struggle.test.ts +++ b/test/moves/struggle.test.ts @@ -1,7 +1,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/substitute.test.ts b/test/moves/substitute.test.ts index 182fefb74d7..39418fb5b99 100644 --- a/test/moves/substitute.test.ts +++ b/test/moves/substitute.test.ts @@ -1,21 +1,21 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { SubstituteTag, TrappedTag } from "#app/data/battler-tags"; -import { StealHeldItemChanceAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import { MoveResult } from "#enums/move-result"; -import type { CommandPhase } from "#app/phases/command-phase"; -import GameManager from "#test/testUtils/gameManager"; -import { Command } from "#enums/command"; -import { UiMode } from "#enums/ui-mode"; +import { SubstituteTag, TrappedTag } from "#data/battler-tags"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; +import { Command } from "#enums/command"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; +import { UiMode } from "#enums/ui-mode"; +import { StealHeldItemChanceAttr } from "#moves/move"; +import type { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/synchronoise.test.ts b/test/moves/synchronoise.test.ts index 9068a40693b..fe4a316a32a 100644 --- a/test/moves/synchronoise.test.ts +++ b/test/moves/synchronoise.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/syrup_bomb.test.ts b/test/moves/syrup_bomb.test.ts index 4b2821b439c..f45070d81a5 100644 --- a/test/moves/syrup_bomb.test.ts +++ b/test/moves/syrup_bomb.test.ts @@ -1,11 +1,11 @@ +import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#enums/battler-tag-type"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { BattlerIndex } from "#enums/battler-index"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - SYRUP BOMB", () => { diff --git a/test/moves/tackle.test.ts b/test/moves/tackle.test.ts index f3c0db85a39..998afd23f9d 100644 --- a/test/moves/tackle.test.ts +++ b/test/moves/tackle.test.ts @@ -1,9 +1,9 @@ -import { Stat } from "#enums/stat"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/tail_whip.test.ts b/test/moves/tail_whip.test.ts index e98194b52dd..272816a88a6 100644 --- a/test/moves/tail_whip.test.ts +++ b/test/moves/tail_whip.test.ts @@ -1,12 +1,12 @@ -import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Tail whip", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/tailwind.test.ts b/test/moves/tailwind.test.ts index 874934fc8f3..1c8701de5bc 100644 --- a/test/moves/tailwind.test.ts +++ b/test/moves/tailwind.test.ts @@ -1,10 +1,10 @@ -import { ArenaTagSide } from "#enums/arena-tag-side"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/tar_shot.test.ts b/test/moves/tar_shot.test.ts index 8d5ea4b3582..c2ae397e43a 100644 --- a/test/moves/tar_shot.test.ts +++ b/test/moves/tar_shot.test.ts @@ -1,10 +1,10 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { Stat } from "#app/enums/stat"; import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BattlerIndex } from "#enums/battler-index"; +import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/taunt.test.ts b/test/moves/taunt.test.ts index fabb95f98b2..ba76551708b 100644 --- a/test/moves/taunt.test.ts +++ b/test/moves/taunt.test.ts @@ -1,11 +1,11 @@ -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { MoveResult } from "#enums/move-result"; -import { BattlerTagType } from "#enums/battler-tag-type"; describe("Moves - Taunt", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/telekinesis.test.ts b/test/moves/telekinesis.test.ts index 5c9f1e22395..92d7f8cc885 100644 --- a/test/moves/telekinesis.test.ts +++ b/test/moves/telekinesis.test.ts @@ -1,13 +1,13 @@ -import { BattlerTagType } from "#enums/battler-tag-type"; -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; -import { MoveResult } from "#enums/move-result"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Telekinesis", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/tera_blast.test.ts b/test/moves/tera_blast.test.ts index fbebd428cfd..d6c16c31544 100644 --- a/test/moves/tera_blast.test.ts +++ b/test/moves/tera_blast.test.ts @@ -1,13 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { Stat } from "#enums/stat"; -import type { TeraMoveCategoryAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; -import type Move from "#app/data/moves/move"; -import { PokemonType } from "#enums/pokemon-type"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import type { Move, TeraMoveCategoryAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/tera_starstorm.test.ts b/test/moves/tera_starstorm.test.ts index 2eaf2ec0372..a63573b360d 100644 --- a/test/moves/tera_starstorm.test.ts +++ b/test/moves/tera_starstorm.test.ts @@ -1,11 +1,11 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { PokemonType } from "#enums/pokemon-type"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Moves - Tera Starstorm", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/thousand_arrows.test.ts b/test/moves/thousand_arrows.test.ts index 9ecdd94a94f..3c7bacfbb2b 100644 --- a/test/moves/thousand_arrows.test.ts +++ b/test/moves/thousand_arrows.test.ts @@ -1,10 +1,10 @@ import { AbilityId } from "#enums/ability-id"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BerryPhase } from "#phases/berry-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/throat_chop.test.ts b/test/moves/throat_chop.test.ts index aa92f657c86..1a17cb1fba2 100644 --- a/test/moves/throat_chop.test.ts +++ b/test/moves/throat_chop.test.ts @@ -1,11 +1,11 @@ +import { AbilityId } from "#enums/ability-id"; import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { Stat } from "#app/enums/stat"; -import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Stat } from "#enums/stat"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Throat Chop", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/thunder_wave.test.ts b/test/moves/thunder_wave.test.ts index 7d2692fdfa3..06a24e454fa 100644 --- a/test/moves/thunder_wave.test.ts +++ b/test/moves/thunder_wave.test.ts @@ -1,9 +1,9 @@ -import type { EnemyPokemon } from "#app/field/pokemon"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import type { EnemyPokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/tidy_up.test.ts b/test/moves/tidy_up.test.ts index 69c9df42b36..c96718e2332 100644 --- a/test/moves/tidy_up.test.ts +++ b/test/moves/tidy_up.test.ts @@ -1,14 +1,14 @@ -import { Stat } from "#enums/stat"; -import { ArenaTagType } from "#app/enums/arena-tag-type"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { SubstituteTag } from "#data/battler-tags"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SubstituteTag } from "#app/data/battler-tags"; -import { SpeciesId } from "#enums/species-id"; describe("Moves - Tidy Up", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/torment.test.ts b/test/moves/torment.test.ts index e4d926d9601..71a4f3cb504 100644 --- a/test/moves/torment.test.ts +++ b/test/moves/torment.test.ts @@ -1,12 +1,12 @@ -import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; -import GameManager from "#test/testUtils/gameManager"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { SpeciesId } from "#enums/species-id"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { MoveResult } from "#enums/move-result"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; describe("Moves - Torment", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/toxic.test.ts b/test/moves/toxic.test.ts index a7ba52eb963..5aaa4e3e85d 100644 --- a/test/moves/toxic.test.ts +++ b/test/moves/toxic.test.ts @@ -1,11 +1,11 @@ +import { allMoves } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { StatusEffect } from "#enums/status-effect"; -import { BattlerIndex } from "#enums/battler-index"; -import { allMoves } from "#app/data/data-lists"; describe("Moves - Toxic", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/toxic_spikes.test.ts b/test/moves/toxic_spikes.test.ts index bf1f5acc1cb..69f09ce966a 100644 --- a/test/moves/toxic_spikes.test.ts +++ b/test/moves/toxic_spikes.test.ts @@ -1,14 +1,14 @@ -import type { ArenaTrapTag } from "#app/data/arena-tag"; -import { ArenaTagSide } from "#enums/arena-tag-side"; -import type { SessionSaveData } from "#app/system/game-data"; -import { GameData } from "#app/system/game-data"; -import { decrypt, encrypt } from "#app/utils/data"; +import type { ArenaTrapTag } from "#data/arena-tag"; import { AbilityId } from "#enums/ability-id"; +import { ArenaTagSide } from "#enums/arena-tag-side"; import { ArenaTagType } from "#enums/arena-tag-type"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import type { SessionSaveData } from "#system/game-data"; +import { GameData } from "#system/game-data"; +import { GameManager } from "#test/testUtils/gameManager"; +import { decrypt, encrypt } from "#utils/data"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/transform-imposter.test.ts b/test/moves/transform-imposter.test.ts new file mode 100644 index 00000000000..c12542e64e9 --- /dev/null +++ b/test/moves/transform-imposter.test.ts @@ -0,0 +1,379 @@ +import { Status } from "#data/status-effect"; +import { AbilityId } from "#enums/ability-id"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; +import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { Stat } from "#enums/stat"; +import { StatusEffect } from "#enums/status-effect"; +import type { EnemyPokemon } from "#field/pokemon"; +import { Pokemon } from "#field/pokemon"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from "vitest"; + +// TODO: Add more tests once Transform/Imposter are fully implemented +describe("Transforming Effects", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleStyle("single") + .enemySpecies(SpeciesId.MEW) + .enemyLevel(200) + .enemyAbility(AbilityId.BEAST_BOOST) + .enemyPassiveAbility(AbilityId.BALL_FETCH) + .enemyMoveset(MoveId.SPLASH) + .ability(AbilityId.STURDY); + }); + + // Contains logic shared by both Transform and Impostor (for brevity) + describe("Phases - PokemonTransformPhase", async () => { + it("should copy target's species, ability, gender, all stats except HP, all stat stages, moveset and types", async () => { + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const ditto = game.field.getPlayerPokemon(); + const mew = game.field.getEnemyPokemon(); + + mew.setStatStage(Stat.ATK, 4); + + game.move.use(MoveId.SPLASH); + game.scene.phaseManager.unshiftNew("PokemonTransformPhase", ditto.getBattlerIndex(), mew.getBattlerIndex()); + await game.toEndOfTurn(); + + expect(ditto.isTransformed()).toBe(true); + expect(ditto.getSpeciesForm().speciesId).toBe(mew.getSpeciesForm().speciesId); + expect(ditto.getAbility()).toBe(mew.getAbility()); + expect(ditto.getGender()).toBe(mew.getGender()); + + const playerStats = ditto.getStats(false); + const enemyStats = mew.getStats(false); + // HP stays the same; all other stats should carry over + expect(playerStats[0]).not.toBe(enemyStats[0]); + expect(playerStats.slice(1)).toEqual(enemyStats.slice(1)); + + // Stat stages/moveset IDs + expect(ditto.getStatStages()).toEqual(mew.getStatStages()); + + expect(ditto.getMoveset().map(m => m.moveId)).toEqual(ditto.getMoveset().map(m => m.moveId)); + + expect(ditto.getTypes()).toEqual(mew.getTypes()); + }); + + // TODO: This is not implemented + it.todo("should copy the target's original typing if target is typeless", async () => { + game.override.enemySpecies(SpeciesId.MAGMAR); + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const ditto = game.field.getPlayerPokemon(); + const magmar = game.field.getEnemyPokemon(); + + game.move.use(MoveId.TRANSFORM); + await game.move.forceEnemyMove(MoveId.BURN_UP); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toEndOfTurn(); + + expect(magmar.getTypes()).toEqual([PokemonType.UNKNOWN]); + expect(ditto.getTypes()).toEqual([PokemonType.FIRE]); + }); + + it("should not consider the target's Tera Type when copying types", async () => { + game.override.enemySpecies(SpeciesId.MAGMAR); + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const ditto = game.field.getPlayerPokemon(); + const magmar = game.field.getEnemyPokemon(); + magmar.isTerastallized = true; + magmar.teraType = PokemonType.DARK; + + game.move.use(MoveId.TRANSFORM); + await game.toEndOfTurn(); + + expect(ditto.getTypes(true)).toEqual([PokemonType.FIRE]); + }); + + // TODO: This is not currently implemented + it.todo("should copy volatile status effects", async () => { + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const ditto = game.field.getPlayerPokemon(); + const mew = game.field.getEnemyPokemon(); + mew.addTag(BattlerTagType.SEEDED, 0, MoveId.LEECH_SEED, ditto.id); + mew.addTag(BattlerTagType.CONFUSED, 4, MoveId.AXE_KICK, ditto.id); + + game.move.use(MoveId.TRANSFORM); + await game.toEndOfTurn(); + + expect(ditto.getTag(BattlerTagType.SEEDED)).toBeDefined(); + expect(ditto.getTag(BattlerTagType.CONFUSED)).toBeDefined(); + }); + + // TODO: This is not implemented + it.todo("should copy the target's rage fist hit count"); + + it("should not copy friendship, held items, nickname, level or non-volatile status effects", async () => { + game.override.enemyHeldItems([{ name: "BERRY", count: 1, type: BerryType.SITRUS }]); + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const ditto = game.field.getPlayerPokemon(); + const mew = game.field.getEnemyPokemon(); + + mew.status = new Status(StatusEffect.POISON); + mew.friendship = 255; + mew.nickname = btoa(unescape(encodeURIComponent("Pink Furry Cat Thing"))); + + game.move.use(MoveId.TRANSFORM); + await game.toEndOfTurn(); + + expect(ditto.status?.effect).toBeUndefined(); + expect(ditto.getNameToRender()).not.toBe(mew.getNameToRender()); + expect(ditto.level).not.toBe(mew.level); + expect(ditto.friendship).not.toBe(mew.friendship); + expect(ditto.getHeldItems()).not.toEqual(mew.getHeldItems()); + }); + + it("should copy in-battle overridden stats", async () => { + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const player = game.field.getPlayerPokemon(); + const enemy = game.field.getEnemyPokemon(); + + const oldAtk = player.getStat(Stat.ATK); + const avgAtk = Math.floor((player.getStat(Stat.ATK, false) + enemy.getStat(Stat.ATK, false)) / 2); + + game.move.use(MoveId.TRANSFORM); + await game.move.forceEnemyMove(MoveId.POWER_SPLIT); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toEndOfTurn(); + + expect(player.getStat(Stat.ATK, false)).toBe(avgAtk); + expect(enemy.getStat(Stat.ATK, false)).toBe(avgAtk); + expect(avgAtk).not.toBe(oldAtk); + }); + + it("should set each move's pp to a maximum of 5 without affecting PP ups", async () => { + game.override.enemyMoveset([MoveId.SWORDS_DANCE, MoveId.GROWL, MoveId.SKETCH, MoveId.RECOVER]); + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const player = game.field.getPlayerPokemon(); + + game.move.use(MoveId.TRANSFORM); + await game.toEndOfTurn(); + + player.getMoveset().forEach(move => { + // Should set correct maximum PP without touching `ppUp` + if (move) { + if (move.moveId === MoveId.SKETCH) { + expect(move.getMovePp()).toBe(1); + } else { + expect(move.getMovePp()).toBe(5); + } + expect(move.ppUp).toBe(0); + } + }); + }); + + it("should activate its ability if it copies one that activates on summon", async () => { + game.override.enemyAbility(AbilityId.INTIMIDATE); + await game.classicMode.startBattle([SpeciesId.DITTO]); + + game.move.use(MoveId.TRANSFORM); + game.phaseInterceptor.clearLogs(); + await game.toEndOfTurn(); + + expect(game.field.getEnemyPokemon().getStatStage(Stat.ATK)).toBe(-1); + expect(game.phaseInterceptor.log).toContain("StatStageChangePhase"); + }); + + it("should persist transformed attributes across reloads", async () => { + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const player = game.field.getPlayerPokemon(); + const enemy = game.field.getEnemyPokemon(); + + game.move.use(MoveId.TRANSFORM); + await game.move.forceEnemyMove(MoveId.MEMENTO); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toNextWave(); + + expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase"); + expect(game.scene.currentBattle.waveIndex).toBe(2); + + await game.reload.reloadSession(); + + const playerReloaded = game.field.getPlayerPokemon(); + const playerMoveset = player.getMoveset(); + + expect(playerReloaded.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); + expect(playerReloaded.getAbility()).toBe(enemy.getAbility()); + expect(playerReloaded.getGender()).toBe(enemy.getGender()); + + expect(playerMoveset.map(m => m.moveId)).toEqual([MoveId.MEMENTO]); + }); + + it("should stay transformed with the correct form after reload", async () => { + game.override.enemySpecies(SpeciesId.DARMANITAN); + await game.classicMode.startBattle([SpeciesId.DITTO]); + + const player = game.field.getPlayerPokemon(); + const enemy = game.field.getEnemyPokemon(); + + // change form + enemy.species.formIndex = 1; + + game.move.use(MoveId.TRANSFORM); + await game.move.forceEnemyMove(MoveId.MEMENTO); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toNextWave(); + + expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase"); + expect(game.scene.currentBattle.waveIndex).toBe(2); + + expect(player.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); + expect(player.getSpeciesForm().formIndex).toBe(enemy.getSpeciesForm().formIndex); + + await game.reload.reloadSession(); + + const playerReloaded = game.field.getPlayerPokemon(); + expect(playerReloaded.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); + expect(playerReloaded.getSpeciesForm().formIndex).toBe(enemy.getSpeciesForm().formIndex); + }); + }); + + describe("Moves - Transform", () => { + it.each<{ cause: string; callback: (p: Pokemon) => void; player?: boolean }>([ + { + cause: "user is fused", + callback: p => vi.spyOn(p, "isFusion").mockReturnValue(true), + }, + { + cause: "target is fused", + callback: p => vi.spyOn(p, "isFusion").mockReturnValue(true), + player: false, + }, + { + cause: "user is transformed", + callback: p => vi.spyOn(p, "isTransformed").mockReturnValue(true), + }, + { + cause: "target is transformed", + callback: p => vi.spyOn(p, "isTransformed").mockReturnValue(true), + player: false, + }, + { + cause: "user has illusion", + callback: p => p.setIllusion(game.scene.getEnemyParty()[1]), + }, + { + cause: "target has illusion", + callback: p => p.setIllusion(game.scene.getEnemyParty()[1]), + player: false, + }, + { + cause: "target is behind a substitute", + callback: p => p.addTag(BattlerTagType.SUBSTITUTE, 1, MoveId.SUBSTITUTE, p.id), + player: false, + }, + ])("should fail if $cause", async ({ callback, player = true }) => { + game.override.battleType(BattleType.TRAINER); // ensures 2 enemy pokemon for illusion + await game.classicMode.startBattle([SpeciesId.DITTO, SpeciesId.ABOMASNOW]); + + callback(player ? game.field.getPlayerPokemon() : game.field.getEnemyPokemon()); + + game.move.use(MoveId.TRANSFORM); + await game.toEndOfTurn(); + + const ditto = game.field.getPlayerPokemon(); + expect(ditto.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(game.phaseInterceptor.log).not.toContain("PokemonTransformPhase"); + }); + }); + + describe("Abilities - Imposter", () => { + beforeEach(async () => { + game.override.ability(AbilityId.NONE); + // Mock ability index to always be HA (ensuring Ditto has Imposter and nobody else). + ( + vi.spyOn(Pokemon.prototype as any, "generateAbilityIndex") as MockInstance< + (typeof Pokemon.prototype)["generateAbilityIndex"] + > + ).mockReturnValue(3); + }); + + it.each<{ name: string; callback: (p: EnemyPokemon) => void }>([ + { + name: "opponents with substitutes", + callback: p => p.addTag(BattlerTagType.SUBSTITUTE, 1, MoveId.SUBSTITUTE, p.id), + }, + { name: "fused opponents", callback: p => vi.spyOn(p, "isFusion").mockReturnValue(true) }, + { + name: "opponents with illusions", + callback: p => p.setIllusion(game.scene.getEnemyParty()[1]), // doesn't really matter what the illusion is, merely that it exists + }, + ])("should ignore $name during target selection", async ({ callback }) => { + game.override.battleStyle("double"); + await game.classicMode.startBattle([SpeciesId.GYARADOS, SpeciesId.MILOTIC, SpeciesId.DITTO]); + + const ditto = game.scene.getPlayerParty()[2]; + + const [enemy1, enemy2] = game.scene.getEnemyField(); + // Override enemy 1 to be a fusion/illusion + callback(enemy1); + + expect(ditto.canTransformInto(enemy1)).toBe(false); + expect(ditto.canTransformInto(enemy2)).toBe(true); + + // Switch out to Ditto + game.doSwitchPokemon(2); + game.move.use(MoveId.SPLASH, BattlerIndex.PLAYER_2); + await game.toEndOfTurn(); + + expect(ditto.isActive()).toBe(true); + expect(ditto.isTransformed()).toBe(true); + expect(ditto.getSpeciesForm().speciesId).toBe(enemy2.getSpeciesForm().speciesId); + expect(game.phaseInterceptor.log).toContain("ShowAbilityPhase"); + expect(game.phaseInterceptor.log).toContain("PokemonTransformPhase"); + }); + + it("should not activate if both opponents are fused or have illusions", async () => { + game.override.battleStyle("double"); + await game.classicMode.startBattle([SpeciesId.GYARADOS, SpeciesId.MILOTIC, SpeciesId.DITTO]); + + const [gyarados, , ditto] = game.scene.getPlayerParty(); + const [enemy1, enemy2] = game.scene.getEnemyParty(); + // Override enemy 1 to be a fusion & enemy 2 to have illusion + vi.spyOn(enemy1, "isFusion").mockReturnValue(true); + enemy2.setIllusion(gyarados); + + expect(ditto.canTransformInto(enemy1)).toBe(false); + expect(ditto.canTransformInto(enemy2)).toBe(false); + + // Switch out to Ditto + game.doSwitchPokemon(2); + game.move.use(MoveId.SPLASH, BattlerIndex.PLAYER_2); + await game.toEndOfTurn(); + + expect(ditto.isActive()).toBe(true); + expect(ditto.isTransformed()).toBe(false); + expect(ditto.getSpeciesForm().speciesId).toBe(SpeciesId.DITTO); + expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase"); + expect(game.phaseInterceptor.log).not.toContain("PokemonTransformPhase"); + }); + }); +}); diff --git a/test/moves/transform.test.ts b/test/moves/transform.test.ts deleted file mode 100644 index 4fbaf0136ab..00000000000 --- a/test/moves/transform.test.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { MoveId } from "#enums/move-id"; -import { Stat, EFFECTIVE_STATS } from "#enums/stat"; -import { AbilityId } from "#enums/ability-id"; -import { BattlerIndex } from "#enums/battler-index"; - -// TODO: Add more tests once Transform is fully implemented -describe("Moves - Transform", () => { - let phaserGame: Phaser.Game; - let game: GameManager; - - beforeAll(() => { - phaserGame = new Phaser.Game({ - type: Phaser.HEADLESS, - }); - }); - - afterEach(() => { - game.phaseInterceptor.restoreOg(); - }); - - beforeEach(() => { - game = new GameManager(phaserGame); - game.override - .battleStyle("single") - .enemySpecies(SpeciesId.MEW) - .enemyLevel(200) - .enemyAbility(AbilityId.BEAST_BOOST) - .enemyPassiveAbility(AbilityId.BALL_FETCH) - .enemyMoveset(MoveId.SPLASH) - .ability(AbilityId.INTIMIDATE) - .moveset([MoveId.TRANSFORM]); - }); - - it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => { - await game.classicMode.startBattle([SpeciesId.DITTO]); - - game.move.select(MoveId.TRANSFORM); - await game.phaseInterceptor.to(TurnEndPhase); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - expect(player.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); - expect(player.getAbility()).toBe(enemy.getAbility()); - expect(player.getGender()).toBe(enemy.getGender()); - - // copies all stats except hp - expect(player.getStat(Stat.HP, false)).not.toBe(enemy.getStat(Stat.HP)); - for (const s of EFFECTIVE_STATS) { - expect(player.getStat(s, false)).toBe(enemy.getStat(s, false)); - } - - expect(player.getStatStages()).toEqual(enemy.getStatStages()); - - // move IDs are equal - expect(player.getMoveset().map(m => m.moveId)).toEqual(enemy.getMoveset().map(m => m.moveId)); - - expect(player.getTypes()).toEqual(enemy.getTypes()); - }); - - it("should copy in-battle overridden stats", async () => { - game.override.enemyMoveset([MoveId.POWER_SPLIT]); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - const avgAtk = Math.floor((player.getStat(Stat.ATK, false) + enemy.getStat(Stat.ATK, false)) / 2); - const avgSpAtk = Math.floor((player.getStat(Stat.SPATK, false) + enemy.getStat(Stat.SPATK, false)) / 2); - - game.move.select(MoveId.TRANSFORM); - await game.phaseInterceptor.to(TurnEndPhase); - - expect(player.getStat(Stat.ATK, false)).toBe(avgAtk); - expect(enemy.getStat(Stat.ATK, false)).toBe(avgAtk); - - expect(player.getStat(Stat.SPATK, false)).toBe(avgSpAtk); - expect(enemy.getStat(Stat.SPATK, false)).toBe(avgSpAtk); - }); - - it("should set each move's pp to a maximum of 5", async () => { - game.override.enemyMoveset([MoveId.SWORDS_DANCE, MoveId.GROWL, MoveId.SKETCH, MoveId.RECOVER]); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - const player = game.scene.getPlayerPokemon()!; - - game.move.select(MoveId.TRANSFORM); - await game.phaseInterceptor.to(TurnEndPhase); - - player.getMoveset().forEach(move => { - // Should set correct maximum PP without touching `ppUp` - if (move) { - if (move.moveId === MoveId.SKETCH) { - expect(move.getMovePp()).toBe(1); - } else { - expect(move.getMovePp()).toBe(5); - } - expect(move.ppUp).toBe(0); - } - }); - }); - - it("should activate its ability if it copies one that activates on summon", async () => { - game.override.enemyAbility(AbilityId.INTIMIDATE).ability(AbilityId.BALL_FETCH); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - game.move.select(MoveId.TRANSFORM); - - await game.phaseInterceptor.to("BerryPhase"); - - expect(game.scene.getEnemyPokemon()?.getStatStage(Stat.ATK)).toBe(-1); - }); - - it("should persist transformed attributes across reloads", async () => { - game.override.enemyMoveset([]).moveset([]); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - game.move.changeMoveset(player, MoveId.TRANSFORM); - game.move.changeMoveset(enemy, MoveId.MEMENTO); - - game.move.select(MoveId.TRANSFORM); - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); - await game.toNextWave(); - - expect(game.scene.phaseManager.getCurrentPhase()?.constructor.name).toBe("CommandPhase"); - expect(game.scene.currentBattle.waveIndex).toBe(2); - - await game.reload.reloadSession(); - - const playerReloaded = game.scene.getPlayerPokemon()!; - const playerMoveset = player.getMoveset(); - - expect(playerReloaded.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); - expect(playerReloaded.getAbility()).toBe(enemy.getAbility()); - expect(playerReloaded.getGender()).toBe(enemy.getGender()); - - expect(playerReloaded.getStat(Stat.HP, false)).not.toBe(enemy.getStat(Stat.HP)); - for (const s of EFFECTIVE_STATS) { - expect(playerReloaded.getStat(s, false)).toBe(enemy.getStat(s, false)); - } - - expect(playerMoveset.length).toEqual(1); - expect(playerMoveset[0]?.moveId).toEqual(MoveId.MEMENTO); - }); - - it("should stay transformed with the correct form after reload", async () => { - game.override.enemyMoveset([]).moveset([]).enemySpecies(SpeciesId.DARMANITAN); - - await game.classicMode.startBattle([SpeciesId.DITTO]); - - const player = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - - // change form - enemy.species.forms[1]; - enemy.species.formIndex = 1; - - game.move.changeMoveset(player, MoveId.TRANSFORM); - game.move.changeMoveset(enemy, MoveId.MEMENTO); - - game.move.select(MoveId.TRANSFORM); - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); - await game.toNextWave(); - - expect(game.scene.phaseManager.getCurrentPhase()?.constructor.name).toBe("CommandPhase"); - expect(game.scene.currentBattle.waveIndex).toBe(2); - - await game.reload.reloadSession(); - - const playerReloaded = game.scene.getPlayerPokemon()!; - - expect(playerReloaded.getSpeciesForm().speciesId).toBe(enemy.getSpeciesForm().speciesId); - expect(playerReloaded.getSpeciesForm().formIndex).toBe(enemy.getSpeciesForm().formIndex); - }); -}); diff --git a/test/moves/trick_or_treat.test.ts b/test/moves/trick_or_treat.test.ts index 861115e2503..4e563c97ddc 100644 --- a/test/moves/trick_or_treat.test.ts +++ b/test/moves/trick_or_treat.test.ts @@ -1,8 +1,8 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import { SpeciesId } from "#enums/species-id"; import { PokemonType } from "#enums/pokemon-type"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/triple_arrows.test.ts b/test/moves/triple_arrows.test.ts index 89ccb4e5b04..a60c7106a21 100644 --- a/test/moves/triple_arrows.test.ts +++ b/test/moves/triple_arrows.test.ts @@ -1,10 +1,9 @@ -import type { FlinchAttr, StatStageChangeAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/data-lists"; +import { allMoves } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import type Move from "#app/data/moves/move"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { FlinchAttr, Move, StatStageChangeAttr } from "#moves/move"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/u_turn.test.ts b/test/moves/u_turn.test.ts index a2e29899ad8..cf8b91511ca 100644 --- a/test/moves/u_turn.test.ts +++ b/test/moves/u_turn.test.ts @@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/moves/upper_hand.test.ts b/test/moves/upper_hand.test.ts index fe38e75cf9a..f03a84397f2 100644 --- a/test/moves/upper_hand.test.ts +++ b/test/moves/upper_hand.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; -import { MoveResult } from "#enums/move-result"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/moves/whirlwind.test.ts b/test/moves/whirlwind.test.ts index 00d7c16561c..9def19c4668 100644 --- a/test/moves/whirlwind.test.ts +++ b/test/moves/whirlwind.test.ts @@ -1,19 +1,19 @@ +import { globalScene } from "#app/global-scene"; +import { Status } from "#data/status-effect"; +import { AbilityId } from "#enums/ability-id"; +import { BattleType } from "#enums/battle-type"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Challenges } from "#enums/challenges"; -import { PokemonType } from "#enums/pokemon-type"; -import { MoveResult } from "#enums/move-result"; -import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { MoveResult } from "#enums/move-result"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { TrainerType } from "#enums/trainer-type"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { Status } from "#app/data/status-effect"; -import { StatusEffect } from "#enums/status-effect"; -import { globalScene } from "#app/global-scene"; -import { BattlerIndex } from "#enums/battler-index"; -import { BattleType } from "#enums/battle-type"; -import { TrainerType } from "#enums/trainer-type"; describe("Moves - Whirlwind", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/wide_guard.test.ts b/test/moves/wide_guard.test.ts index 07c02158e94..8f17938b02a 100644 --- a/test/moves/wide_guard.test.ts +++ b/test/moves/wide_guard.test.ts @@ -1,12 +1,12 @@ -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { SpeciesId } from "#enums/species-id"; import { Stat } from "#enums/stat"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; +import { BerryPhase } from "#phases/berry-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Moves - Wide Guard", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/will_o_wisp.test.ts b/test/moves/will_o_wisp.test.ts index 336e84129c5..6f878e1198c 100644 --- a/test/moves/will_o_wisp.test.ts +++ b/test/moves/will_o_wisp.test.ts @@ -1,9 +1,9 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/mystery-encounter/encounter-test-utils.ts b/test/mystery-encounter/encounter-test-utils.ts index 6293a49cf63..6b6a570d318 100644 --- a/test/mystery-encounter/encounter-test-utils.ts +++ b/test/mystery-encounter/encounter-test-utils.ts @@ -1,24 +1,24 @@ +import { Status } from "#data/status-effect"; +import { Button } from "#enums/buttons"; +import { StatusEffect } from "#enums/status-effect"; +import { UiMode } from "#enums/ui-mode"; // biome-ignore lint/performance/noNamespaceImport: Necessary for mocks -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { Status } from "#app/data/status-effect"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MessagePhase } from "#app/phases/message-phase"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { CommandPhase } from "#phases/command-phase"; +import { MessagePhase } from "#phases/message-phase"; import { MysteryEncounterBattlePhase, MysteryEncounterOptionSelectedPhase, MysteryEncounterPhase, MysteryEncounterRewardsPhase, -} from "#app/phases/mystery-encounter-phases"; -import { VictoryPhase } from "#app/phases/victory-phase"; -import type MessageUiHandler from "#app/ui/message-ui-handler"; -import type MysteryEncounterUiHandler from "#app/ui/mystery-encounter-ui-handler"; -import type PartyUiHandler from "#app/ui/party-ui-handler"; -import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { isNullOrUndefined } from "#app/utils/common"; -import { Button } from "#enums/buttons"; -import { StatusEffect } from "#enums/status-effect"; -import type GameManager from "#test/testUtils/gameManager"; +} from "#phases/mystery-encounter-phases"; +import { VictoryPhase } from "#phases/victory-phase"; +import type { GameManager } from "#test/testUtils/gameManager"; +import type { MessageUiHandler } from "#ui/message-ui-handler"; +import type { MysteryEncounterUiHandler } from "#ui/mystery-encounter-ui-handler"; +import type { OptionSelectUiHandler } from "#ui/option-select-ui-handler"; +import type { PartyUiHandler } from "#ui/party-ui-handler"; +import { isNullOrUndefined } from "#utils/common"; import { expect, vi } from "vitest"; /** diff --git a/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts b/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts index 82cac197fe9..a2832052611 100644 --- a/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts +++ b/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts @@ -1,25 +1,25 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { EggTier } from "#enums/egg-type"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { ATrainersTestEncounter } from "#mystery-encounters/a-trainers-test-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { PartyHealPhase } from "#phases/party-heal-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { ATrainersTestEncounter } from "#app/data/mystery-encounters/encounters/a-trainers-test-encounter"; -import { EggTier } from "#enums/egg-type"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { PartyHealPhase } from "#app/phases/party-heal-phase"; import i18next from "i18next"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/aTrainersTest"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/absolute-avarice-encounter.test.ts b/test/mystery-encounter/encounters/absolute-avarice-encounter.test.ts index b6c4e4d85fb..969ac812907 100644 --- a/test/mystery-encounter/encounters/absolute-avarice-encounter.test.ts +++ b/test/mystery-encounter/encounters/absolute-avarice-encounter.test.ts @@ -1,25 +1,25 @@ +import type { BattleScene } from "#app/battle-scene"; +import { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { BerryModifier, PokemonHeldItemModifier } from "#modifiers/modifier"; +import { AbsoluteAvariceEncounter } from "#mystery-encounters/absolute-avarice-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { MovePhase } from "#phases/move-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { BerryModifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { BerryType } from "#enums/berry-type"; -import { AbsoluteAvariceEncounter } from "#app/data/mystery-encounters/encounters/absolute-avarice-encounter"; -import { MoveId } from "#enums/move-id"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import i18next from "i18next"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/absoluteAvarice"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts b/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts index 4f986f58b88..97326e89a83 100644 --- a/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts +++ b/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts @@ -1,24 +1,24 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { AbilityId } from "#enums/ability-id"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { AnOfferYouCantRefuseEncounter } from "#app/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter"; +import { MoveId } from "#enums/move-id"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { ShinyRateBoosterModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import { AnOfferYouCantRefuseEncounter } from "#mystery-encounters/an-offer-you-cant-refuse-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { MoveId } from "#enums/move-id"; -import { ShinyRateBoosterModifier } from "#app/modifier/modifier"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { AbilityId } from "#enums/ability-id"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/anOfferYouCantRefuse"; /** Gyarados for Indimidate */ diff --git a/test/mystery-encounter/encounters/berries-abound-encounter.test.ts b/test/mystery-encounter/encounters/berries-abound-encounter.test.ts index 8c2c6c608cd..5af89ebc02c 100644 --- a/test/mystery-encounter/encounters/berries-abound-encounter.test.ts +++ b/test/mystery-encounter/encounters/berries-abound-encounter.test.ts @@ -1,26 +1,26 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { AbilityId } from "#enums/ability-id"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { UiMode } from "#enums/ui-mode"; +import { BerryModifier } from "#modifiers/modifier"; +import { BerriesAboundEncounter } from "#mystery-encounters/berries-abound-encounter"; +import * as EncounterDialogueUtils from "#mystery-encounters/encounter-dialogue-utils"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { BerryModifier } from "#app/modifier/modifier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { BerriesAboundEncounter } from "#app/data/mystery-encounters/encounters/berries-abound-encounter"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import * as EncounterDialogueUtils from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { AbilityId } from "#enums/ability-id"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/berriesAbound"; const defaultParty = [SpeciesId.PYUKUMUKU, SpeciesId.MAGIKARP, SpeciesId.PIKACHU]; diff --git a/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts b/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts index 4da8ff7f643..80f4c00c2a6 100644 --- a/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts +++ b/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts @@ -1,29 +1,29 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { TrainerType } from "#enums/trainer-type"; +import { UiMode } from "#enums/ui-mode"; +import { ContactHeldItemTransferChanceModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import { BugTypeSuperfanEncounter } from "#mystery-encounters/bug-type-superfan-encounter"; +import * as encounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { MysteryEncounterPhase, MysteryEncounterRewardsPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import { MoveId } from "#enums/move-id"; -import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { UiMode } from "#enums/ui-mode"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { TrainerType } from "#enums/trainer-type"; -import { MysteryEncounterPhase, MysteryEncounterRewardsPhase } from "#app/phases/mystery-encounter-phases"; -import { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier"; -import { CommandPhase } from "#app/phases/command-phase"; -import { BugTypeSuperfanEncounter } from "#app/data/mystery-encounters/encounters/bug-type-superfan-encounter"; -import * as encounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/bugTypeSuperfan"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.WEEDLE]; diff --git a/test/mystery-encounter/encounters/clowning-around-encounter.test.ts b/test/mystery-encounter/encounters/clowning-around-encounter.test.ts index 85193d1ec72..af99834d082 100644 --- a/test/mystery-encounter/encounters/clowning-around-encounter.test.ts +++ b/test/mystery-encounter/encounters/clowning-around-encounter.test.ts @@ -1,42 +1,42 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import * as BattleAnims from "#data/battle-anims"; +import { modifierTypes } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; +import { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { Button } from "#enums/buttons"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import * as BattleAnims from "#app/data/battle-anims"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { TrainerType } from "#enums/trainer-type"; +import { UiMode } from "#enums/ui-mode"; +import type { Pokemon } from "#field/pokemon"; +import type { PokemonHeldItemModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { ClowningAroundEncounter } from "#mystery-encounters/clowning-around-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { generateModifierType } from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { MovePhase } from "#phases/move-phase"; +import { PostMysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { NewBattlePhase } from "#phases/new-battle-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import { MoveId } from "#enums/move-id"; -import type BattleScene from "#app/battle-scene"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { UiMode } from "#enums/ui-mode"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { ModifierTier } from "#enums/modifier-tier"; -import { ClowningAroundEncounter } from "#app/data/mystery-encounters/encounters/clowning-around-encounter"; -import { TrainerType } from "#enums/trainer-type"; -import { AbilityId } from "#enums/ability-id"; -import { PostMysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { Button } from "#enums/buttons"; -import type PartyUiHandler from "#app/ui/party-ui-handler"; -import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { BerryType } from "#enums/berry-type"; -import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { PokemonType } from "#enums/pokemon-type"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { NewBattlePhase } from "#app/phases/new-battle-phase"; +import type { OptionSelectUiHandler } from "#ui/option-select-ui-handler"; +import type { PartyUiHandler } from "#ui/party-ui-handler"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/clowningAround"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts b/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts index e47c7cc1a42..8ef499fe7f4 100644 --- a/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts +++ b/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts @@ -1,28 +1,28 @@ +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { UiMode } from "#enums/ui-mode"; +import { PokemonMove } from "#moves/pokemon-move"; +import { DancingLessonsEncounter } from "#mystery-encounters/dancing-lessons-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { LearnMovePhase } from "#phases/learn-move-phase"; +import { MovePhase } from "#phases/move-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { MoveId } from "#enums/move-id"; -import { DancingLessonsEncounter } from "#app/data/mystery-encounters/encounters/dancing-lessons-encounter"; -import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { LearnMovePhase } from "#app/phases/learn-move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/dancingLessons"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/delibirdy-encounter.test.ts b/test/mystery-encounter/encounters/delibirdy-encounter.test.ts index 3ef8431cc2c..0fb6d2d09b8 100644 --- a/test/mystery-encounter/encounters/delibirdy-encounter.test.ts +++ b/test/mystery-encounter/encounters/delibirdy-encounter.test.ts @@ -1,19 +1,11 @@ +import type { BattleScene } from "#app/battle-scene"; +import { modifierTypes } from "#data/data-lists"; +import { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { - runMysteryEncounterToEnd, - runSelectMysteryEncounterOption, -} from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { DelibirdyEncounter } from "#app/data/mystery-encounters/encounters/delibirdy-encounter"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import type { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; import { BerryModifier, HealingBoosterModifier, @@ -23,11 +15,19 @@ import { PokemonInstantReviveModifier, PokemonNatureWeightModifier, PreserveBerryModifier, -} from "#app/modifier/modifier"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { modifierTypes } from "#app/data/data-lists"; -import { BerryType } from "#enums/berry-type"; +} from "#modifiers/modifier"; +import { DelibirdyEncounter } from "#mystery-encounters/delibirdy-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { generateModifierType } from "#mystery-encounters/encounter-phase-utils"; +import type { MoneyRequirement } from "#mystery-encounters/mystery-encounter-requirements"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { + runMysteryEncounterToEnd, + runSelectMysteryEncounterOption, +} from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/delibirdy"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts b/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts index a82734d0c03..807526d2683 100644 --- a/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts +++ b/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts @@ -1,19 +1,19 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { DepartmentStoreSaleEncounter } from "#app/data/mystery-encounters/encounters/department-store-sale-encounter"; -import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { DepartmentStoreSaleEncounter } from "#mystery-encounters/department-store-sale-encounter"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CIVILIZATION_ENCOUNTER_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/departmentStoreSale"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/field-trip-encounter.test.ts b/test/mystery-encounter/encounters/field-trip-encounter.test.ts index f4b3c52eb65..4390c80d255 100644 --- a/test/mystery-encounter/encounters/field-trip-encounter.test.ts +++ b/test/mystery-encounter/encounters/field-trip-encounter.test.ts @@ -1,20 +1,20 @@ +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; +import { MoveId } from "#enums/move-id"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { FieldTripEncounter } from "#app/data/mystery-encounters/encounters/field-trip-encounter"; -import { MoveId } from "#enums/move-id"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { FieldTripEncounter } from "#mystery-encounters/field-trip-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import i18next from "i18next"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/fieldTrip"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts b/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts index 16adc47ff11..1fb1cbfdbc8 100644 --- a/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts +++ b/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts @@ -1,35 +1,35 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import * as BattleAnims from "#data/battle-anims"; +import { Gender } from "#data/gender"; +import { Status } from "#data/status-effect"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { BiomeId } from "#enums/biome-id"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { FieryFalloutEncounter } from "#app/data/mystery-encounters/encounters/fiery-fallout-encounter"; -import { Gender } from "#app/data/gender"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import * as BattleAnims from "#app/data/battle-anims"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { StatusEffect } from "#enums/status-effect"; +import { AttackTypeBoosterModifier, PokemonHeldItemModifier } from "#modifiers/modifier"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { FieryFalloutEncounter } from "#mystery-encounters/fiery-fallout-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { MovePhase } from "#phases/move-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import { MoveId } from "#enums/move-id"; -import type BattleScene from "#app/battle-scene"; -import { AttackTypeBoosterModifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; -import { PokemonType } from "#enums/pokemon-type"; -import { Status } from "#app/data/status-effect"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { AbilityId } from "#enums/ability-id"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; -import { StatusEffect } from "#enums/status-effect"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/fieryFallout"; /** Arcanine and Ninetails for 2 Fire types. Lapras, Gengar, Abra for burnable mon. */ diff --git a/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts b/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts index 28db869004c..588c126852f 100644 --- a/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts +++ b/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts @@ -1,27 +1,27 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { UiMode } from "#enums/ui-mode"; +import { PokemonMove } from "#moves/pokemon-move"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { FightOrFlightEncounter } from "#mystery-encounters/fight-or-flight-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import { MoveId } from "#enums/move-id"; -import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { FightOrFlightEncounter } from "#app/data/mystery-encounters/encounters/fight-or-flight-encounter"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/fightOrFlight"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/fun-and-games-encounter.test.ts b/test/mystery-encounter/encounters/fun-and-games-encounter.test.ts index ae7e269ea00..6a3aa71ad22 100644 --- a/test/mystery-encounter/encounters/fun-and-games-encounter.test.ts +++ b/test/mystery-encounter/encounters/fun-and-games-encounter.test.ts @@ -1,30 +1,30 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { Command } from "#enums/command"; +import { MoveId } from "#enums/move-id"; +import { MoveUseMode } from "#enums/move-use-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { UiMode } from "#enums/ui-mode"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { FunAndGamesEncounter } from "#mystery-encounters/fun-and-games-encounter"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { UiMode } from "#enums/ui-mode"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { Nature } from "#enums/nature"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { FunAndGamesEncounter } from "#app/data/mystery-encounters/encounters/fun-and-games-encounter"; -import { MoveId } from "#enums/move-id"; -import { Command } from "#enums/command"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { MoveUseMode } from "#enums/move-use-mode"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/funAndGames"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/global-trade-system-encounter.test.ts b/test/mystery-encounter/encounters/global-trade-system-encounter.test.ts index bb598f4ae6e..2a959df76f2 100644 --- a/test/mystery-encounter/encounters/global-trade-system-encounter.test.ts +++ b/test/mystery-encounter/encounters/global-trade-system-encounter.test.ts @@ -1,24 +1,24 @@ +import type { BattleScene } from "#app/battle-scene"; +import { modifierTypes } from "#data/data-lists"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; +import { ModifierTier } from "#enums/modifier-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { PokemonNatureWeightModifier } from "#app/modifier/modifier"; -import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { modifierTypes } from "#app/data/data-lists"; -import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encounters/global-trade-system-encounter"; -import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { ModifierTier } from "#enums/modifier-tier"; -import * as Utils from "#app/utils/common"; +import { PokemonNatureWeightModifier } from "#modifiers/modifier"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { generateModifierType } from "#mystery-encounters/encounter-phase-utils"; +import { GlobalTradeSystemEncounter } from "#mystery-encounters/global-trade-system-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CIVILIZATION_ENCOUNTER_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import * as Utils from "#utils/common"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/globalTradeSystem"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts b/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts index a55806e5f48..2186fe43e23 100644 --- a/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts +++ b/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts @@ -1,20 +1,23 @@ -import { LostAtSeaEncounter } from "#app/data/mystery-encounters/encounters/lost-at-sea-encounter"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption } from "../encounter-test-utils"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { LostAtSeaEncounter } from "#mystery-encounters/lost-at-sea-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { PartyExpPhase } from "#phases/party-exp-phase"; +import { + runMysteryEncounterToEnd, + runSelectMysteryEncounterOption, +} from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import type BattleScene from "#app/battle-scene"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { PartyExpPhase } from "#app/phases/party-exp-phase"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import i18next from "i18next"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/lostAtSea"; /** Blastoise for surf. Pidgeot for fly. Abra for none. */ diff --git a/test/mystery-encounter/encounters/mysterious-challengers-encounter.test.ts b/test/mystery-encounter/encounters/mysterious-challengers-encounter.test.ts index 478648d88a7..ee952f3809e 100644 --- a/test/mystery-encounter/encounters/mysterious-challengers-encounter.test.ts +++ b/test/mystery-encounter/encounters/mysterious-challengers-encounter.test.ts @@ -1,30 +1,29 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { PartyMemberStrength } from "#enums/party-member-strength"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { UiMode } from "#enums/ui-mode"; +import { MysteriousChallengersEncounter } from "#mystery-encounters/mysterious-challengers-encounter"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { CommandPhase } from "#phases/command-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { UiMode } from "#enums/ui-mode"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { ModifierTier } from "#enums/modifier-tier"; -import { MysteriousChallengersEncounter } from "#app/data/mystery-encounters/encounters/mysterious-challengers-encounter"; -import { TrainerConfig } from "#app/data/trainers/trainer-config"; -import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; -import { PartyMemberStrength } from "#enums/party-member-strength"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; +import { TrainerConfig } from "#trainers/trainer-config"; +import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/trainer-party-template"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/mysteriousChallengers"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/part-timer-encounter.test.ts b/test/mystery-encounter/encounters/part-timer-encounter.test.ts index d36b387cae1..1bbda8b77e0 100644 --- a/test/mystery-encounter/encounters/part-timer-encounter.test.ts +++ b/test/mystery-encounter/encounters/part-timer-encounter.test.ts @@ -1,22 +1,22 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { PokemonMove } from "#moves/pokemon-move"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { CIVILIZATION_ENCOUNTER_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { PartTimerEncounter } from "#mystery-encounters/part-timer-encounter"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { PartTimerEncounter } from "#app/data/mystery-encounters/encounters/part-timer-encounter"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { MoveId } from "#enums/move-id"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; +import { GameManager } from "#test/testUtils/gameManager"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/partTimer"; // Pyukumuku for lowest speed, Regieleki for highest speed, Feebas for lowest "bulk", Melmetal for highest "bulk" diff --git a/test/mystery-encounter/encounters/safari-zone.test.ts b/test/mystery-encounter/encounters/safari-zone.test.ts index 7ac26f48e59..252198139df 100644 --- a/test/mystery-encounter/encounters/safari-zone.test.ts +++ b/test/mystery-encounter/encounters/safari-zone.test.ts @@ -1,25 +1,22 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { NON_LEGEND_PARADOX_POKEMON } from "#balance/special-species-groups"; import { BiomeId } from "#enums/biome-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { getSafariSpeciesSpawn, SafariZoneEncounter } from "#mystery-encounters/safari-zone-encounter"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { - getSafariSpeciesSpawn, - SafariZoneEncounter, -} from "#app/data/mystery-encounters/encounters/safari-zone-encounter"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-groups"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/safariZone"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts b/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts index 2138298ee2b..6ecf3162607 100644 --- a/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts +++ b/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts @@ -1,24 +1,24 @@ -import type BattleScene from "#app/battle-scene"; -import { TeleportingHijinksEncounter } from "#app/data/mystery-encounters/encounters/teleporting-hijinks-encounter"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { AbilityId } from "#enums/ability-id"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import GameManager from "#test/testUtils/gameManager"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { TeleportingHijinksEncounter } from "#mystery-encounters/teleporting-hijinks-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import i18next from "i18next"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/mystery-encounter/encounters/the-expert-breeder-encounter.test.ts b/test/mystery-encounter/encounters/the-expert-breeder-encounter.test.ts index c9d6f540191..471a26aa532 100644 --- a/test/mystery-encounter/encounters/the-expert-breeder-encounter.test.ts +++ b/test/mystery-encounter/encounters/the-expert-breeder-encounter.test.ts @@ -1,27 +1,27 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#balance/starters"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { EggTier } from "#enums/egg-type"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { TrainerType } from "#enums/trainer-type"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { TheExpertPokemonBreederEncounter } from "#mystery-encounters/the-expert-pokemon-breeder-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { PostMysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { TheExpertPokemonBreederEncounter } from "#app/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter"; -import { TrainerType } from "#enums/trainer-type"; -import { EggTier } from "#enums/egg-type"; -import { PostMysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/theExpertPokemonBreeder"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/the-pokemon-salesman-encounter.test.ts b/test/mystery-encounter/encounters/the-pokemon-salesman-encounter.test.ts index 990e39014e2..81329c5552f 100644 --- a/test/mystery-encounter/encounters/the-pokemon-salesman-encounter.test.ts +++ b/test/mystery-encounter/encounters/the-pokemon-salesman-encounter.test.ts @@ -1,25 +1,25 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { NON_LEGEND_PARADOX_POKEMON } from "#balance/special-species-groups"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { + getSalesmanSpeciesOffer, + ThePokemonSalesmanEncounter, +} from "#mystery-encounters/the-pokemon-salesman-encounter"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; -import { - getSalesmanSpeciesOffer, - ThePokemonSalesmanEncounter, -} from "#app/data/mystery-encounters/encounters/the-pokemon-salesman-encounter"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-groups"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/thePokemonSalesman"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts b/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts index 96060e4114c..9a78cd99f93 100644 --- a/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts +++ b/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts @@ -1,34 +1,34 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import * as BattleAnims from "#data/battle-anims"; +import { CustomPokemonData } from "#data/pokemon-data"; +import { AbilityId } from "#enums/ability-id"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import * as BattleAnims from "#app/data/battle-anims"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { UiMode } from "#enums/ui-mode"; +import { BerryModifier, PokemonBaseStatTotalModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { TheStrongStuffEncounter } from "#mystery-encounters/the-strong-stuff-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { MovePhase } from "#phases/move-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import { MoveId } from "#enums/move-id"; -import type BattleScene from "#app/battle-scene"; -import { TheStrongStuffEncounter } from "#app/data/mystery-encounters/encounters/the-strong-stuff-encounter"; -import { Nature } from "#enums/nature"; -import { BerryType } from "#enums/berry-type"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { BerryModifier, PokemonBaseStatTotalModifier } from "#app/modifier/modifier"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { CustomPokemonData } from "#app/data/custom-pokemon-data"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { AbilityId } from "#enums/ability-id"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/theStrongStuff"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/the-winstrate-challenge-encounter.test.ts b/test/mystery-encounter/encounters/the-winstrate-challenge-encounter.test.ts index 012b88bcd73..078b278dd19 100644 --- a/test/mystery-encounter/encounters/the-winstrate-challenge-encounter.test.ts +++ b/test/mystery-encounter/encounters/the-winstrate-challenge-encounter.test.ts @@ -1,31 +1,31 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { Status } from "#data/status-effect"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { UiMode } from "#enums/ui-mode"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; -import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; -import { TrainerType } from "#enums/trainer-type"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { Nature } from "#enums/nature"; -import { MoveId } from "#enums/move-id"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { TheWinstrateChallengeEncounter } from "#app/data/mystery-encounters/encounters/the-winstrate-challenge-encounter"; -import { Status } from "#app/data/status-effect"; -import { MysteryEncounterRewardsPhase } from "#app/phases/mystery-encounter-phases"; -import { CommandPhase } from "#app/phases/command-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { PartyHealPhase } from "#app/phases/party-heal-phase"; -import { VictoryPhase } from "#app/phases/victory-phase"; +import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; +import { TrainerType } from "#enums/trainer-type"; +import { UiMode } from "#enums/ui-mode"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { HUMAN_TRANSITABLE_BIOMES } from "#mystery-encounters/mystery-encounters"; +import { TheWinstrateChallengeEncounter } from "#mystery-encounters/the-winstrate-challenge-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { MysteryEncounterRewardsPhase } from "#phases/mystery-encounter-phases"; +import { PartyHealPhase } from "#phases/party-heal-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { VictoryPhase } from "#phases/victory-phase"; +import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; +import { GameManager } from "#test/testUtils/gameManager"; +import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/theWinstrateChallenge"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts b/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts index 9ab5f16d1b9..48b6ce79488 100644 --- a/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts +++ b/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts @@ -1,37 +1,37 @@ -import type BattleScene from "#app/battle-scene"; -import * as BattleAnims from "#app/data/battle-anims"; -import { TrashToTreasureEncounter } from "#app/data/mystery-encounters/encounters/trash-to-treasure-encounter"; -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import type { BattleScene } from "#app/battle-scene"; +import * as BattleAnims from "#data/battle-anims"; +import { modifierTypes } from "#data/data-lists"; +import { BiomeId } from "#enums/biome-id"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#modifiers/modifier"; +import type { PokemonHeldItemModifierType } from "#modifiers/modifier-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; import { type EnemyPartyConfig, type EnemyPokemonConfig, generateModifierType, -} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; -import { SpeciesId } from "#enums/species-id"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#app/modifier/modifier"; -import { ModifierTier } from "#enums/modifier-tier"; -import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { CommandPhase } from "#app/phases/command-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import * as Utils from "#app/utils/common"; -import { MoveId } from "#enums/move-id"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +} from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { TrashToTreasureEncounter } from "#mystery-encounters/trash-to-treasure-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { MovePhase } from "#phases/move-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import * as Utils from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/trashToTreasure"; diff --git a/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts b/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts index ec64a17d291..a9ebfda496a 100644 --- a/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts +++ b/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts @@ -1,33 +1,33 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; +import { speciesEggMoves } from "#balance/egg-moves"; +import { modifierTypes } from "#data/data-lists"; +import { AbilityId } from "#enums/ability-id"; +import { BerryType } from "#enums/berry-type"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { MoveId } from "#enums/move-id"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { Stat } from "#enums/stat"; +import type { BerryModifier } from "#modifiers/modifier"; +import { PokemonMove } from "#moves/pokemon-move"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import { generateModifierType } from "#mystery-encounters/encounter-phase-utils"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { UncommonBreedEncounter } from "#mystery-encounters/uncommon-breed-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { MovePhase } from "#phases/move-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { StatStageChangePhase } from "#phases/stat-stage-change-phase"; import { runMysteryEncounterToEnd, runSelectMysteryEncounterOption, } from "#test/mystery-encounter/encounter-test-utils"; -import { MoveId } from "#enums/move-id"; -import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { CommandPhase } from "#app/phases/command-phase"; -import { UncommonBreedEncounter } from "#app/data/mystery-encounters/encounters/uncommon-breed-encounter"; -import { MovePhase } from "#app/phases/move-phase"; -import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { BerryType } from "#enums/berry-type"; -import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; -import { Stat } from "#enums/stat"; -import type { BerryModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/data/data-lists"; -import { AbilityId } from "#enums/ability-id"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/uncommonBreed"; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/encounters/weird-dream-encounter.test.ts b/test/mystery-encounter/encounters/weird-dream-encounter.test.ts index 475d5cc3c6e..f68818bbfe4 100644 --- a/test/mystery-encounter/encounters/weird-dream-encounter.test.ts +++ b/test/mystery-encounter/encounters/weird-dream-encounter.test.ts @@ -1,25 +1,25 @@ -import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; +import type { BattleScene } from "#app/battle-scene"; import { BiomeId } from "#enums/biome-id"; -import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; +import { ModifierTier } from "#enums/modifier-tier"; +import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; +import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; +import { UiMode } from "#enums/ui-mode"; +import * as EncounterPhaseUtils from "#mystery-encounters/encounter-phase-utils"; +import * as EncounterTransformationSequence from "#mystery-encounters/encounter-transformation-sequence"; +import * as MysteryEncounters from "#mystery-encounters/mystery-encounters"; +import { WeirdDreamEncounter } from "#mystery-encounters/weird-dream-encounter"; +import { CommandPhase } from "#phases/command-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { runMysteryEncounterToEnd, skipBattleRunMysteryEncounterRewardsPhase, } from "#test/mystery-encounter/encounter-test-utils"; -import type BattleScene from "#app/battle-scene"; -import { UiMode } from "#enums/ui-mode"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; -import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; -import { WeirdDreamEncounter } from "#app/data/mystery-encounters/encounters/weird-dream-encounter"; -import * as EncounterTransformationSequence from "#app/data/mystery-encounters/utils/encounter-transformation-sequence"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { ModifierTier } from "#enums/modifier-tier"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const namespace = "mysteryEncounters/weirdDream"; const defaultParty = [SpeciesId.MAGBY, SpeciesId.HAUNTER, SpeciesId.ABRA]; diff --git a/test/mystery-encounter/mystery-encounter-utils.test.ts b/test/mystery-encounter/mystery-encounter-utils.test.ts index b775ce8df60..745b11b7e73 100644 --- a/test/mystery-encounter/mystery-encounter-utils.test.ts +++ b/test/mystery-encounter/mystery-encounter-utils.test.ts @@ -1,26 +1,26 @@ -import type BattleScene from "#app/battle-scene"; -import { speciesStarterCosts } from "#app/data/balance/starters"; -import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; +import type { BattleScene } from "#app/battle-scene"; +import { speciesStarterCosts } from "#balance/starters"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { StatusEffect } from "#enums/status-effect"; import { getEncounterText, queueEncounterMessage, showEncounterDialogue, showEncounterText, -} from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; +} from "#mystery-encounters/encounter-dialogue-utils"; import { getHighestLevelPlayerPokemon, getLowestLevelPlayerPokemon, getRandomPlayerPokemon, getRandomSpeciesByStarterCost, koPlayerPokemon, -} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { PokemonType } from "#enums/pokemon-type"; -import { MessagePhase } from "#app/phases/message-phase"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; -import { StatusEffect } from "#enums/status-effect"; +} from "#mystery-encounters/encounter-pokemon-utils"; +import { MysteryEncounter } from "#mystery-encounters/mystery-encounter"; +import { MessagePhase } from "#phases/message-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/mystery-encounter/mystery-encounter.test.ts b/test/mystery-encounter/mystery-encounter.test.ts index be1f153f8b1..c8ac7078788 100644 --- a/test/mystery-encounter/mystery-encounter.test.ts +++ b/test/mystery-encounter/mystery-encounter.test.ts @@ -1,10 +1,10 @@ -import { afterEach, beforeAll, beforeEach, expect, describe, it } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { SpeciesId } from "#enums/species-id"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; +import type { BattleScene } from "#app/battle-scene"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import type BattleScene from "#app/battle-scene"; +import { SpeciesId } from "#enums/species-id"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Mystery Encounters", () => { let phaserGame: Phaser.Game; diff --git a/test/phases/form-change-phase.test.ts b/test/phases/form-change-phase.test.ts index b025f72f5e4..4d3af280043 100644 --- a/test/phases/form-change-phase.test.ts +++ b/test/phases/form-change-phase.test.ts @@ -1,12 +1,12 @@ +import { modifierTypes } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { generateModifierType } from "#mystery-encounters/encounter-phase-utils"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { PokemonType } from "#enums/pokemon-type"; -import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import { modifierTypes } from "#app/data/data-lists"; describe("Form Change Phase", () => { let phaserGame: Phaser.Game; diff --git a/test/phases/frenzy-move-reset.test.ts b/test/phases/frenzy-move-reset.test.ts index 9c59e1da968..c922a121526 100644 --- a/test/phases/frenzy-move-reset.test.ts +++ b/test/phases/frenzy-move-reset.test.ts @@ -1,12 +1,12 @@ -import { BattlerIndex } from "#enums/battler-index"; import { AbilityId } from "#enums/ability-id"; +import { BattlerIndex } from "#enums/battler-index"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { StatusEffect } from "#enums/status-effect"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { StatusEffect } from "#enums/status-effect"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Frenzy Move Reset", () => { let phaserGame: Phaser.Game; diff --git a/test/phases/game-over-phase.test.ts b/test/phases/game-over-phase.test.ts index 008f9fb68e8..d679b812fc0 100644 --- a/test/phases/game-over-phase.test.ts +++ b/test/phases/game-over-phase.test.ts @@ -1,12 +1,12 @@ -import { BiomeId } from "#enums/biome-id"; import { AbilityId } from "#enums/ability-id"; +import { BiomeId } from "#enums/biome-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { Unlockables } from "#enums/unlockables"; +import { achvs } from "#system/achv"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { achvs } from "#app/system/achv"; -import { Unlockables } from "#enums/unlockables"; describe("Game Over Phase", () => { let phaserGame: Phaser.Game; diff --git a/test/phases/learn-move-phase.test.ts b/test/phases/learn-move-phase.test.ts index 88b8187069b..b7e7175a46c 100644 --- a/test/phases/learn-move-phase.test.ts +++ b/test/phases/learn-move-phase.test.ts @@ -1,11 +1,11 @@ -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import Phaser from "phaser"; -import GameManager from "#test/testUtils/gameManager"; -import { SpeciesId } from "#enums/species-id"; +import { Button } from "#enums/buttons"; import { MoveId } from "#enums/move-id"; -import { LearnMovePhase } from "#app/phases/learn-move-phase"; +import { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; -import { Button } from "#app/enums/buttons"; +import { LearnMovePhase } from "#phases/learn-move-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Learn Move Phase", () => { let phaserGame: Phaser.Game; diff --git a/test/phases/mystery-encounter-phase.test.ts b/test/phases/mystery-encounter-phase.test.ts index b17682d6c74..3c41028e4b7 100644 --- a/test/phases/mystery-encounter-phase.test.ts +++ b/test/phases/mystery-encounter-phase.test.ts @@ -1,15 +1,15 @@ -import { afterEach, beforeAll, beforeEach, expect, describe, it, vi } from "vitest"; -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { SpeciesId } from "#enums/species-id"; -import { MysteryEncounterOptionSelectedPhase, MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { UiMode } from "#enums/ui-mode"; import { Button } from "#enums/buttons"; -import type MysteryEncounterUiHandler from "#app/ui/mystery-encounter-ui-handler"; -import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -import type MessageUiHandler from "#app/ui/message-ui-handler"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; +import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { MysteryEncounterOptionSelectedPhase, MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { MessageUiHandler } from "#ui/message-ui-handler"; +import type { MysteryEncounterUiHandler } from "#ui/mystery-encounter-ui-handler"; import i18next from "i18next"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Mystery Encounter Phases", () => { let phaserGame: Phaser.Game; diff --git a/test/phases/phases.test.ts b/test/phases/phases.test.ts index 9d1c1804615..daa63fe2adc 100644 --- a/test/phases/phases.test.ts +++ b/test/phases/phases.test.ts @@ -1,9 +1,9 @@ -import type BattleScene from "#app/battle-scene"; -import { LoginPhase } from "#app/phases/login-phase"; -import { TitlePhase } from "#app/phases/title-phase"; -import { UnavailablePhase } from "#app/phases/unavailable-phase"; +import type { BattleScene } from "#app/battle-scene"; import { UiMode } from "#enums/ui-mode"; -import GameManager from "#test/testUtils/gameManager"; +import { LoginPhase } from "#phases/login-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { UnavailablePhase } from "#phases/unavailable-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/phases/select-modifier-phase.test.ts b/test/phases/select-modifier-phase.test.ts index b6c3089e236..565fbe8e439 100644 --- a/test/phases/select-modifier-phase.test.ts +++ b/test/phases/select-modifier-phase.test.ts @@ -1,20 +1,20 @@ -import type BattleScene from "#app/battle-scene"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { PlayerPokemon } from "#app/field/pokemon"; -import { ModifierTier } from "#enums/modifier-tier"; -import type { CustomModifierSettings } from "#app/modifier/modifier-type"; -import { ModifierTypeOption } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; -import { shiftCharCodes } from "#app/utils/common"; +import type { BattleScene } from "#app/battle-scene"; +import { modifierTypes } from "#data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { Button } from "#enums/buttons"; +import { ModifierTier } from "#enums/modifier-tier"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { UiMode } from "#enums/ui-mode"; +import { PlayerPokemon } from "#field/pokemon"; +import type { CustomModifierSettings } from "#modifiers/modifier-type"; +import { ModifierTypeOption } from "#modifiers/modifier-type"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { shiftCharCodes } from "#utils/common"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/plugins/api/pokerogue-account-api.test.ts b/test/plugins/api/pokerogue-account-api.test.ts index 3c37451960a..578b6ba041a 100644 --- a/test/plugins/api/pokerogue-account-api.test.ts +++ b/test/plugins/api/pokerogue-account-api.test.ts @@ -1,13 +1,13 @@ -import type { AccountInfoResponse } from "#app/@types/PokerogueAccountApi"; +import { PokerogueAccountApi } from "#api/pokerogue-account-api"; import { SESSION_ID_COOKIE_NAME } from "#app/constants"; -import { PokerogueAccountApi } from "#app/plugins/api/pokerogue-account-api"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import * as CookieUtils from "#app/utils/cookies"; -import * as cookies from "#app/utils/cookies"; -import { http, HttpResponse } from "msw"; -import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; +import type { AccountInfoResponse } from "#types/PokerogueAccountApi"; +import * as CookieUtils from "#utils/cookies"; +import * as cookies from "#utils/cookies"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); const accountApi = new PokerogueAccountApi(apiBase); diff --git a/test/plugins/api/pokerogue-admin-api.test.ts b/test/plugins/api/pokerogue-admin-api.test.ts index 08c4cf0dc45..e36f45801b6 100644 --- a/test/plugins/api/pokerogue-admin-api.test.ts +++ b/test/plugins/api/pokerogue-admin-api.test.ts @@ -1,3 +1,6 @@ +import { PokerogueAdminApi } from "#api/pokerogue-admin-api"; +import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; import type { LinkAccountToDiscordIdRequest, LinkAccountToGoogledIdRequest, @@ -5,13 +8,10 @@ import type { SearchAccountResponse, UnlinkAccountFromDiscordIdRequest, UnlinkAccountFromGoogledIdRequest, -} from "#app/@types/PokerogueAdminApi"; -import { PokerogueAdminApi } from "#app/plugins/api/pokerogue-admin-api"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import { http, HttpResponse } from "msw"; -import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +} from "#types/PokerogueAdminApi"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); const adminApi = new PokerogueAdminApi(apiBase); diff --git a/test/plugins/api/pokerogue-api.test.ts b/test/plugins/api/pokerogue-api.test.ts index c53a38e23ab..b9ebbe0f685 100644 --- a/test/plugins/api/pokerogue-api.test.ts +++ b/test/plugins/api/pokerogue-api.test.ts @@ -1,10 +1,10 @@ -import type { TitleStatsResponse } from "#app/@types/PokerogueApi"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import { http, HttpResponse } from "msw"; -import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { pokerogueApi } from "#api/pokerogue-api"; import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; +import type { TitleStatsResponse } from "#types/PokerogueApi"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); let server: SetupServerApi; diff --git a/test/plugins/api/pokerogue-daily-api.test.ts b/test/plugins/api/pokerogue-daily-api.test.ts index 563e6d09009..6399c80781e 100644 --- a/test/plugins/api/pokerogue-daily-api.test.ts +++ b/test/plugins/api/pokerogue-daily-api.test.ts @@ -1,11 +1,11 @@ -import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#app/@types/PokerogueDailyApi"; -import { PokerogueDailyApi } from "#app/plugins/api/pokerogue-daily-api"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import { ScoreboardCategory, type RankingEntry } from "#app/ui/daily-run-scoreboard"; -import { http, HttpResponse } from "msw"; -import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { PokerogueDailyApi } from "#api/pokerogue-daily-api"; import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; +import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#types/PokerogueDailyApi"; +import { type RankingEntry, ScoreboardCategory } from "#ui/daily-run-scoreboard"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); const dailyApi = new PokerogueDailyApi(apiBase); diff --git a/test/plugins/api/pokerogue-savedata-api.test.ts b/test/plugins/api/pokerogue-savedata-api.test.ts index 481ba62c19d..d465759bdfc 100644 --- a/test/plugins/api/pokerogue-savedata-api.test.ts +++ b/test/plugins/api/pokerogue-savedata-api.test.ts @@ -1,10 +1,10 @@ -import type { UpdateAllSavedataRequest } from "#app/@types/PokerogueSavedataApi"; -import { PokerogueSavedataApi } from "#app/plugins/api/pokerogue-savedata-api"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import { http, HttpResponse } from "msw"; -import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { PokerogueSavedataApi } from "#api/pokerogue-savedata-api"; import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; +import type { UpdateAllSavedataRequest } from "#types/PokerogueSavedataApi"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); const savedataApi = new PokerogueSavedataApi(apiBase); diff --git a/test/plugins/api/pokerogue-session-savedata-api.test.ts b/test/plugins/api/pokerogue-session-savedata-api.test.ts index 4d4774f2283..e95697ab72e 100644 --- a/test/plugins/api/pokerogue-session-savedata-api.test.ts +++ b/test/plugins/api/pokerogue-session-savedata-api.test.ts @@ -1,3 +1,7 @@ +import { PokerogueSessionSavedataApi } from "#api/pokerogue-session-savedata-api"; +import type { SessionSaveData } from "#system/game-data"; +import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; import type { ClearSessionSavedataRequest, ClearSessionSavedataResponse, @@ -5,14 +9,10 @@ import type { GetSessionSavedataRequest, NewClearSessionSavedataRequest, UpdateSessionSavedataRequest, -} from "#app/@types/PokerogueSessionSavedataApi"; -import { PokerogueSessionSavedataApi } from "#app/plugins/api/pokerogue-session-savedata-api"; -import type { SessionSaveData } from "#app/system/game-data"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import { http, HttpResponse } from "msw"; -import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +} from "#types/PokerogueSessionSavedataApi"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); const sessionSavedataApi = new PokerogueSessionSavedataApi(apiBase); diff --git a/test/plugins/api/pokerogue-system-savedata-api.test.ts b/test/plugins/api/pokerogue-system-savedata-api.test.ts index 0c69ab8f922..0bec6dae16b 100644 --- a/test/plugins/api/pokerogue-system-savedata-api.test.ts +++ b/test/plugins/api/pokerogue-system-savedata-api.test.ts @@ -1,16 +1,16 @@ +import { PokerogueSystemSavedataApi } from "#api/pokerogue-system-savedata-api"; +import type { SystemSaveData } from "#system/game-data"; +import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; +import { getApiBaseUrl } from "#test/testUtils/testUtils"; import type { GetSystemSavedataRequest, UpdateSystemSavedataRequest, VerifySystemSavedataRequest, VerifySystemSavedataResponse, -} from "#app/@types/PokerogueSystemSavedataApi"; -import { PokerogueSystemSavedataApi } from "#app/plugins/api/pokerogue-system-savedata-api"; -import type { SystemSaveData } from "#app/system/game-data"; -import { initServerForApiTests } from "#test/testUtils/testFileInitialization"; -import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import { http, HttpResponse } from "msw"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +} from "#types/PokerogueSystemSavedataApi"; +import { HttpResponse, http } from "msw"; import type { SetupServerApi } from "msw/node"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; const apiBase = getApiBaseUrl(); const systemSavedataApi = new PokerogueSystemSavedataApi(getApiBaseUrl()); diff --git a/test/reload.test.ts b/test/reload.test.ts index 8e39df23f47..a1cdfcb392a 100644 --- a/test/reload.test.ts +++ b/test/reload.test.ts @@ -1,13 +1,13 @@ -import { GameModes } from "#enums/game-modes"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; +import { pokerogueApi } from "#api/pokerogue-api"; import { BiomeId } from "#enums/biome-id"; import { Button } from "#enums/buttons"; +import { GameModes } from "#enums/game-modes"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { UiMode } from "#enums/ui-mode"; +import { GameManager } from "#test/testUtils/gameManager"; import type { MockClock } from "#test/testUtils/mocks/mockClock"; +import type { OptionSelectUiHandler } from "#ui/option-select-ui-handler"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Reload", () => { diff --git a/test/settingMenu/helpers/inGameManip.ts b/test/settingMenu/helpers/inGameManip.ts index ca1fac3bc65..c19c6745300 100644 --- a/test/settingMenu/helpers/inGameManip.ts +++ b/test/settingMenu/helpers/inGameManip.ts @@ -1,5 +1,5 @@ -import { getIconForLatestInput, getSettingNameWithKeycode } from "#app/configs/inputs/configHandler"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; +import { getIconForLatestInput, getSettingNameWithKeycode } from "#inputs/configHandler"; +import { SettingKeyboard } from "#system/settings-keyboard"; import { expect } from "vitest"; export class InGameManip { diff --git a/test/settingMenu/helpers/menuManip.ts b/test/settingMenu/helpers/menuManip.ts index 1ddd842c864..37c0f823559 100644 --- a/test/settingMenu/helpers/menuManip.ts +++ b/test/settingMenu/helpers/menuManip.ts @@ -9,8 +9,8 @@ import { getKeyWithKeycode, getKeyWithSettingName, getSettingNameWithKeycode, -} from "#app/configs/inputs/configHandler"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; +} from "#inputs/configHandler"; +import { SettingKeyboard } from "#system/settings-keyboard"; import { expect } from "vitest"; export class MenuManip { diff --git a/test/settingMenu/rebinding_setting.test.ts b/test/settingMenu/rebinding_setting.test.ts index 20a1fe51484..b738861c1ee 100644 --- a/test/settingMenu/rebinding_setting.test.ts +++ b/test/settingMenu/rebinding_setting.test.ts @@ -1,12 +1,12 @@ -import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty"; -import { getKeyWithKeycode, getKeyWithSettingName } from "#app/configs/inputs/configHandler"; import type { InterfaceConfig } from "#app/inputs-controller"; -import { SettingKeyboard } from "#app/system/settings/settings-keyboard"; -import { deepCopy } from "#app/utils/data"; import { Button } from "#enums/buttons"; import { Device } from "#enums/devices"; +import cfg_keyboard_qwerty from "#inputs/cfg_keyboard_qwerty"; +import { getKeyWithKeycode, getKeyWithSettingName } from "#inputs/configHandler"; +import { SettingKeyboard } from "#system/settings-keyboard"; import { InGameManip } from "#test/settingMenu/helpers/inGameManip"; import { MenuManip } from "#test/settingMenu/helpers/menuManip"; +import { deepCopy } from "#utils/data"; import { beforeEach, describe, expect, it } from "vitest"; describe("Test Rebinding", () => { diff --git a/test/sprites/pokemonSprite.test.ts b/test/sprites/pokemonSprite.test.ts index be188503b1e..019dc51a8e2 100644 --- a/test/sprites/pokemonSprite.test.ts +++ b/test/sprites/pokemonSprite.test.ts @@ -2,8 +2,8 @@ import { getAppRootDir } from "#test/sprites/spritesUtils"; import fs from "fs"; import path from "path"; import { beforeAll, describe, expect, it } from "vitest"; -import _masterlist from "../../public/images/pokemon/variant/_masterlist.json"; import _exp_masterlist from "../../public/images/pokemon/variant/_exp_masterlist.json"; +import _masterlist from "../../public/images/pokemon/variant/_masterlist.json"; type PokemonVariantMasterlist = typeof _masterlist; type PokemonExpVariantMasterlist = typeof _exp_masterlist; diff --git a/test/system/game_data.test.ts b/test/system/game_data.test.ts index b9011cd934f..5daed0b2f1b 100644 --- a/test/system/game_data.test.ts +++ b/test/system/game_data.test.ts @@ -1,12 +1,12 @@ +import { pokerogueApi } from "#api/pokerogue-api"; +import * as account from "#app/account"; import * as bypassLoginModule from "#app/global-vars/bypass-login"; -import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; -import type { SessionSaveData } from "#app/system/game-data"; import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import type { SessionSaveData } from "#system/game-data"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import * as account from "#app/account"; describe("System - Game Data", () => { let phaserGame: Phaser.Game; diff --git a/test/testUtils/TextInterceptor.ts b/test/testUtils/TextInterceptor.ts index 4aaed458e44..36a5db4c78d 100644 --- a/test/testUtils/TextInterceptor.ts +++ b/test/testUtils/TextInterceptor.ts @@ -1,7 +1,7 @@ /** * Class will intercept any text or dialogue message calls and log them for test purposes */ -export default class TextInterceptor { +export class TextInterceptor { private scene; public logs: string[] = []; constructor(scene) { diff --git a/test/testUtils/errorInterceptor.ts b/test/testUtils/errorInterceptor.ts index a8fb3284b78..c253561a71c 100644 --- a/test/testUtils/errorInterceptor.ts +++ b/test/testUtils/errorInterceptor.ts @@ -1,4 +1,4 @@ -export default class ErrorInterceptor { +export class ErrorInterceptor { private static instance: ErrorInterceptor; public running; diff --git a/test/testUtils/gameManager.ts b/test/testUtils/gameManager.ts index 334266d3bfa..c7b2649872d 100644 --- a/test/testUtils/gameManager.ts +++ b/test/testUtils/gameManager.ts @@ -1,46 +1,38 @@ import { updateUserInfo } from "#app/account"; -import { BattlerIndex } from "#enums/battler-index"; -import BattleScene from "#app/battle-scene"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import Trainer from "#app/field/trainer"; +import { BattleScene } from "#app/battle-scene"; import { getGameMode } from "#app/game-mode"; -import { GameModes } from "#enums/game-modes"; import { globalScene } from "#app/global-scene"; -import { ModifierTypeOption } from "#app/modifier/modifier-type"; -import { modifierTypes } from "#app/data/data-lists"; import overrides from "#app/overrides"; -import { CheckSwitchPhase } from "#app/phases/check-switch-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { FaintPhase } from "#app/phases/faint-phase"; -import { LoginPhase } from "#app/phases/login-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; -import { NewBattlePhase } from "#app/phases/new-battle-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import type { SelectTargetPhase } from "#app/phases/select-target-phase"; -import { TitlePhase } from "#app/phases/title-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; -import type BallUiHandler from "#app/ui/ball-ui-handler"; -import type BattleMessageUiHandler from "#app/ui/battle-message-ui-handler"; -import type CommandUiHandler from "#app/ui/command-ui-handler"; -import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import type PartyUiHandler from "#app/ui/party-ui-handler"; -import type StarterSelectUiHandler from "#app/ui/starter-select-ui-handler"; -import type TargetSelectUiHandler from "#app/ui/target-select-ui-handler"; -import { isNullOrUndefined } from "#app/utils/common"; +import { modifierTypes } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; import { Button } from "#enums/buttons"; import { ExpGainsSpeed } from "#enums/exp-gains-speed"; import { ExpNotification } from "#enums/exp-notification"; +import { GameModes } from "#enums/game-modes"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { PlayerGender } from "#enums/player-gender"; +import type { PokeballType } from "#enums/pokeball"; import type { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; -import ErrorInterceptor from "#test/testUtils/errorInterceptor"; +import type { EnemyPokemon, PlayerPokemon } from "#field/pokemon"; +import { Trainer } from "#field/trainer"; +import { ModifierTypeOption } from "#modifiers/modifier-type"; +import { CheckSwitchPhase } from "#phases/check-switch-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { LoginPhase } from "#phases/login-phase"; +import { MovePhase } from "#phases/move-phase"; +import { MysteryEncounterPhase } from "#phases/mystery-encounter-phases"; +import { NewBattlePhase } from "#phases/new-battle-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import type { SelectTargetPhase } from "#phases/select-target-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { ErrorInterceptor } from "#test/testUtils/errorInterceptor"; import { generateStarter, waitUntil } from "#test/testUtils/gameManagerUtils"; -import GameWrapper from "#test/testUtils/gameWrapper"; +import { GameWrapper } from "#test/testUtils/gameWrapper"; import { ChallengeModeHelper } from "#test/testUtils/helpers/challengeModeHelper"; import { ClassicModeHelper } from "#test/testUtils/helpers/classicModeHelper"; import { DailyModeHelper } from "#test/testUtils/helpers/dailyModeHelper"; @@ -50,18 +42,26 @@ import { MoveHelper } from "#test/testUtils/helpers/moveHelper"; import { OverridesHelper } from "#test/testUtils/helpers/overridesHelper"; import { ReloadHelper } from "#test/testUtils/helpers/reloadHelper"; import { SettingsHelper } from "#test/testUtils/helpers/settingsHelper"; -import type InputsHandler from "#test/testUtils/inputsHandler"; +import type { InputsHandler } from "#test/testUtils/inputsHandler"; import { MockFetch } from "#test/testUtils/mocks/mockFetch"; -import PhaseInterceptor from "#test/testUtils/phaseInterceptor"; -import TextInterceptor from "#test/testUtils/TextInterceptor"; -import { AES, enc } from "crypto-js"; +import { PhaseInterceptor } from "#test/testUtils/phaseInterceptor"; +import { TextInterceptor } from "#test/testUtils/TextInterceptor"; +import type { BallUiHandler } from "#ui/ball-ui-handler"; +import type { BattleMessageUiHandler } from "#ui/battle-message-ui-handler"; +import type { CommandUiHandler } from "#ui/command-ui-handler"; +import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import type { PartyUiHandler } from "#ui/party-ui-handler"; +import type { StarterSelectUiHandler } from "#ui/starter-select-ui-handler"; +import type { TargetSelectUiHandler } from "#ui/target-select-ui-handler"; +import { isNullOrUndefined } from "#utils/common"; import fs from "node:fs"; +import { AES, enc } from "crypto-js"; import { expect, vi } from "vitest"; /** * Class to manage the game state and transitions between phases. */ -export default class GameManager { +export class GameManager { public gameWrapper: GameWrapper; public scene: BattleScene; public phaseInterceptor: PhaseInterceptor; @@ -201,9 +201,8 @@ export default class GameManager { /** * Helper function to run to the final boss encounter as it's a bit tricky due to extra dialogue * Also handles Major/Minor bosses from endless modes - * @param game - The game manager - * @param species - * @param mode + * @param species - Array of {@linkcode SpeciesId}s to start the final battle with. + * @param mode - The {@linkcode GameModes} to spawn the final boss encounter in. */ async runToFinalBossEncounter(species: SpeciesId[], mode: GameModes) { console.log("===to final boss encounter==="); @@ -230,9 +229,9 @@ export default class GameManager { /** * Runs the game to a mystery encounter phase. - * @param encounterType if specified, will expect encounter to have been spawned - * @param species Optional array of species for party. - * @returns A promise that resolves when the EncounterPhase ends. + * @param encounterType - If specified, will expect encounter to be the given type. + * @param species - Optional array of species for party to start with. + * @returns A Promise that resolves when the EncounterPhase ends. */ async runToMysteryEncounter(encounterType?: MysteryEncounterType, species?: SpeciesId[]) { if (!isNullOrUndefined(encounterType)) { @@ -277,6 +276,7 @@ export default class GameManager { * Will trigger during the next {@linkcode SelectTargetPhase} * @param targetIndex - The {@linkcode BattlerIndex} of the attack target, or `undefined` for multi-target attacks * @param movePosition - The 0-indexed position of the move in the pokemon's moveset array + * @throws Immediately fails tests */ selectTarget(movePosition: number, targetIndex?: BattlerIndex) { this.onNextPrompt( @@ -292,7 +292,7 @@ export default class GameManager { handler.setCursor(targetIndex !== undefined ? targetIndex : BattlerIndex.ENEMY); } if (move.isMultiTarget() && targetIndex !== undefined) { - throw new Error(`targetIndex was passed to selectMove() but move ("${move.name}") is not targetted`); + expect.fail(`targetIndex was passed to selectMove() but move ("${move.name}") is not targetted`); } handler.processInput(Button.ACTION); }, @@ -455,17 +455,14 @@ export default class GameManager { } /** - * Faints a player or enemy pokemon instantly by setting their HP to 0. + * Faint a player or enemy pokemon instantly by setting their HP to 0. * @param pokemon - The player/enemy pokemon being fainted - * @returns A promise that resolves once the fainted pokemon's FaintPhase finishes running. + * @returns A Promise that resolves once the fainted pokemon's FaintPhase finishes running. */ async killPokemon(pokemon: PlayerPokemon | EnemyPokemon) { - return new Promise(async (resolve, reject) => { - pokemon.hp = 0; - this.scene.phaseManager.pushPhase(new FaintPhase(pokemon.getBattlerIndex(), true)); - await this.phaseInterceptor.to(FaintPhase).catch(e => reject(e)); - resolve(); - }); + pokemon.hp = 0; + this.scene.phaseManager.pushNew("FaintPhase", pokemon.getBattlerIndex(), true); + await this.phaseInterceptor.to("FaintPhase"); } /** @@ -514,9 +511,9 @@ export default class GameManager { /** * Select the BALL option from the command menu, then press Action; in the BALL * menu, select a pokéball type and press Action again to throw it. - * @param ballIndex - The index of the pokeball to throw + * @param ballIndex - The {@linkcode PokeballType} to throw */ - public doThrowPokeball(ballIndex: number) { + public doThrowPokeball(ballIndex: PokeballType) { this.onNextPrompt("CommandPhase", UiMode.COMMAND, () => { (this.scene.ui.getHandler() as CommandUiHandler).setCursor(1); (this.scene.ui.getHandler() as CommandUiHandler).processInput(Button.ACTION); diff --git a/test/testUtils/gameManagerUtils.ts b/test/testUtils/gameManagerUtils.ts index 57fd9b91d26..db758cfe64d 100644 --- a/test/testUtils/gameManagerUtils.ts +++ b/test/testUtils/gameManagerUtils.ts @@ -1,17 +1,17 @@ -import Battle from "#app/battle"; -import { BattleType } from "#enums/battle-type"; -import type BattleScene from "#app/battle-scene"; -import { getDailyRunStarters } from "#app/data/daily-run"; -import { Gender } from "#app/data/gender"; -import { getPokemonSpeciesForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { PlayerPokemon } from "#app/field/pokemon"; +import { Battle } from "#app/battle"; +import type { BattleScene } from "#app/battle-scene"; import { getGameMode } from "#app/game-mode"; +import { getDailyRunStarters } from "#data/daily-run"; +import { Gender } from "#data/gender"; +import { getPokemonSpeciesForm } from "#data/pokemon-species"; +import { BattleType } from "#enums/battle-type"; import { GameModes } from "#enums/game-modes"; -import type { StarterMoveset } from "#app/system/game-data"; -import type { Starter } from "#app/ui/starter-select-ui-handler"; -import { MoveId } from "#enums/move-id"; +import type { MoveId } from "#enums/move-id"; import type { SpeciesId } from "#enums/species-id"; +import { PlayerPokemon } from "#field/pokemon"; +import type { StarterMoveset } from "#system/game-data"; +import type { Starter } from "#ui/starter-select-ui-handler"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; /** Function to convert Blob to string */ export function blobToString(blob) { @@ -98,15 +98,6 @@ export function waitUntil(truth): Promise { }); } -/** Get the index of `move` from the moveset of the pokemon on the player's field at location `pokemonIndex`. */ -export function getMovePosition(scene: BattleScene, pokemonIndex: 0 | 1, move: MoveId): number { - const playerPokemon = scene.getPlayerField()[pokemonIndex]; - const moveSet = playerPokemon.getMoveset(); - const index = moveSet.findIndex(m => m.moveId === move && m.ppUsed < m.getMovePp()); - console.log(`Move position for ${MoveId[move]} (=${move}):`, index); - return index; -} - /** * Useful for populating party, wave index, etc. without having to spin up and run through an entire EncounterPhase */ diff --git a/test/testUtils/gameWrapper.ts b/test/testUtils/gameWrapper.ts index 7b5d564de2e..b9665ffe071 100644 --- a/test/testUtils/gameWrapper.ts +++ b/test/testUtils/gameWrapper.ts @@ -1,30 +1,32 @@ // @ts-nocheck - TODO: remove this -import BattleScene from "#app/battle-scene"; -import { MoveAnim } from "#app/data/battle-anims"; -import Pokemon from "#app/field/pokemon"; -import { sessionIdKey } from "#app/utils/common"; -import { setCookie } from "#app/utils/cookies"; + +import { BattleScene } from "#app/battle-scene"; +// biome-ignore lint/performance/noNamespaceImport: Necessary in order to mock the var +import * as bypassLoginModule from "#app/global-vars/bypass-login"; +import { MoveAnim } from "#data/battle-anims"; +import { Pokemon } from "#field/pokemon"; +import { version } from "#package.json"; import { blobToString } from "#test/testUtils/gameManagerUtils"; import { MockClock } from "#test/testUtils/mocks/mockClock"; import { MockFetch } from "#test/testUtils/mocks/mockFetch"; -import MockLoader from "#test/testUtils/mocks/mockLoader"; -import MockTextureManager from "#test/testUtils/mocks/mockTextureManager"; +import { MockGameObjectCreator } from "#test/testUtils/mocks/mockGameObjectCreator"; +import { MockLoader } from "#test/testUtils/mocks/mockLoader"; +import { MockContainer } from "#test/testUtils/mocks/mocksContainer/mockContainer"; +import { MockTextureManager } from "#test/testUtils/mocks/mockTextureManager"; +import { MockTimedEventManager } from "#test/testUtils/mocks/mockTimedEventManager"; +import { PokedexMonContainer } from "#ui/pokedex-mon-container"; +import { sessionIdKey } from "#utils/common"; +import { setCookie } from "#utils/cookies"; import fs from "node:fs"; import Phaser from "phaser"; import { vi } from "vitest"; -import { version } from "../../package.json"; -import { MockGameObjectCreator } from "./mocks/mockGameObjectCreator"; -import { MockTimedEventManager } from "./mocks/mockTimedEventManager"; -import { PokedexMonContainer } from "#app/ui/pokedex-mon-container"; -import MockContainer from "./mocks/mocksContainer/mockContainer"; -import InputManager = Phaser.Input.InputManager; -import KeyboardManager = Phaser.Input.Keyboard.KeyboardManager; -import KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin; -import GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin; -import EventEmitter = Phaser.Events.EventEmitter; -import UpdateList = Phaser.GameObjects.UpdateList; -// biome-ignore lint/performance/noNamespaceImport: Necessary in order to mock the var -import * as bypassLoginModule from "#app/global-vars/bypass-login"; + +const InputManager = Phaser.Input.InputManager; +const KeyboardManager = Phaser.Input.Keyboard.KeyboardManager; +const KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin; +const GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin; +const EventEmitter = Phaser.Events.EventEmitter; +const UpdateList = Phaser.GameObjects.UpdateList; window.URL.createObjectURL = (blob: Blob) => { blobToString(blob).then((data: string) => { @@ -40,7 +42,7 @@ window.matchMedia = () => ({ matches: false, }); -export default class GameWrapper { +export class GameWrapper { public game: Phaser.Game; public scene: BattleScene; diff --git a/test/testUtils/helpers/challengeModeHelper.ts b/test/testUtils/helpers/challengeModeHelper.ts index f0b4b151d22..31b7c062d99 100644 --- a/test/testUtils/helpers/challengeModeHelper.ts +++ b/test/testUtils/helpers/challengeModeHelper.ts @@ -1,15 +1,15 @@ -import { BattleStyle } from "#app/enums/battle-style"; -import type { SpeciesId } from "#enums/species-id"; import overrides from "#app/overrides"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import { UiMode } from "#enums/ui-mode"; -import { generateStarter } from "../gameManagerUtils"; -import { GameManagerHelper } from "./gameManagerHelper"; -import type { Challenge } from "#app/data/challenge"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import type { Challenge } from "#data/challenge"; +import { BattleStyle } from "#enums/battle-style"; import type { Challenges } from "#enums/challenges"; +import type { SpeciesId } from "#enums/species-id"; +import { UiMode } from "#enums/ui-mode"; +import { CommandPhase } from "#phases/command-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { generateStarter } from "#test/testUtils/gameManagerUtils"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; import { copyChallenge } from "data/challenge"; /** diff --git a/test/testUtils/helpers/classicModeHelper.ts b/test/testUtils/helpers/classicModeHelper.ts index eff97483777..55b25623b5a 100644 --- a/test/testUtils/helpers/classicModeHelper.ts +++ b/test/testUtils/helpers/classicModeHelper.ts @@ -1,15 +1,16 @@ -import { BattleStyle } from "#app/enums/battle-style"; -import type { SpeciesId } from "#enums/species-id"; import { getGameMode } from "#app/game-mode"; -import { GameModes } from "#enums/game-modes"; import overrides from "#app/overrides"; -import { CommandPhase } from "#app/phases/command-phase"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { BattleStyle } from "#enums/battle-style"; +import { GameModes } from "#enums/game-modes"; +import { Nature } from "#enums/nature"; +import type { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; -import { generateStarter } from "../gameManagerUtils"; -import { GameManagerHelper } from "./gameManagerHelper"; +import { CommandPhase } from "#phases/command-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { generateStarter } from "#test/testUtils/gameManagerUtils"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; /** * Helper to handle classic-mode specific operations. @@ -36,6 +37,12 @@ export class ClassicModeHelper extends GameManagerHelper { if (this.game.override.disableShinies) { this.game.override.shiny(false).enemyShiny(false); } + if (this.game.override.normalizeIVs) { + this.game.override.playerIVs(31).enemyIVs(31); + } + if (this.game.override.normalizeNatures) { + this.game.override.nature(Nature.HARDY).enemyNature(Nature.HARDY); + } this.game.onNextPrompt("TitlePhase", UiMode.TITLE, () => { this.game.scene.gameMode = getGameMode(GameModes.CLASSIC); diff --git a/test/testUtils/helpers/dailyModeHelper.ts b/test/testUtils/helpers/dailyModeHelper.ts index 4672d4dc787..214b6e4c5a4 100644 --- a/test/testUtils/helpers/dailyModeHelper.ts +++ b/test/testUtils/helpers/dailyModeHelper.ts @@ -1,13 +1,13 @@ -import { BattleStyle } from "#app/enums/battle-style"; -import { Button } from "#app/enums/buttons"; import overrides from "#app/overrides"; -import { CommandPhase } from "#app/phases/command-phase"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { TitlePhase } from "#app/phases/title-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import type SaveSlotSelectUiHandler from "#app/ui/save-slot-select-ui-handler"; +import { BattleStyle } from "#enums/battle-style"; +import { Button } from "#enums/buttons"; import { UiMode } from "#enums/ui-mode"; -import { GameManagerHelper } from "./gameManagerHelper"; +import { CommandPhase } from "#phases/command-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; +import type { SaveSlotSelectUiHandler } from "#ui/save-slot-select-ui-handler"; /** * Helper to handle daily mode specifics diff --git a/test/testUtils/helpers/field-helper.ts b/test/testUtils/helpers/field-helper.ts index 2866c01209f..ca106804b85 100644 --- a/test/testUtils/helpers/field-helper.ts +++ b/test/testUtils/helpers/field-helper.ts @@ -1,16 +1,14 @@ -// -- start tsdoc imports -- -// biome-ignore lint/correctness/noUnusedImports: TSDoc import +/* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */ import type { globalScene } from "#app/global-scene"; -// -- end tsdoc imports -- +/* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */ -import type { BattlerIndex } from "#enums/battler-index"; -import type { Ability } from "#app/data/abilities/ability"; -import { allAbilities } from "#app/data/data-lists"; -import type Pokemon from "#app/field/pokemon"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; +import type { Ability } from "#abilities/ability"; +import { allAbilities } from "#data/data-lists"; import type { AbilityId } from "#enums/ability-id"; +import type { BattlerIndex } from "#enums/battler-index"; import type { PokemonType } from "#enums/pokemon-type"; import { Stat } from "#enums/stat"; +import type { EnemyPokemon, PlayerPokemon, Pokemon } from "#field/pokemon"; import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; import { expect, type MockInstance, vi } from "vitest"; @@ -70,7 +68,7 @@ export class FieldHelper extends GameManagerHelper { * @see {@linkcode vi.spyOn} * @see https://vitest.dev/api/mock#mockreturnvalue */ - public mockAbility(pokemon: Pokemon, ability: AbilityId): MockInstance<(baseOnly?: boolean) => Ability> { + public mockAbility(pokemon: Pokemon, ability: AbilityId): MockInstance<(ignoreOverride?: boolean) => Ability> { return vi.spyOn(pokemon, "getAbility").mockReturnValue(allAbilities[ability]); } diff --git a/test/testUtils/helpers/gameManagerHelper.ts b/test/testUtils/helpers/gameManagerHelper.ts index 85d7bc0df97..6db3819a5cb 100644 --- a/test/testUtils/helpers/gameManagerHelper.ts +++ b/test/testUtils/helpers/gameManagerHelper.ts @@ -1,4 +1,4 @@ -import type GameManager from "../gameManager"; +import type { GameManager } from "#test/testUtils/gameManager"; /** * Base class for defining all game helpers. diff --git a/test/testUtils/helpers/modifiersHelper.ts b/test/testUtils/helpers/modifiersHelper.ts index 22500c87906..ff6e78c8a2f 100644 --- a/test/testUtils/helpers/modifiersHelper.ts +++ b/test/testUtils/helpers/modifiersHelper.ts @@ -1,7 +1,7 @@ +import type { ModifierTypeKeys } from "#modifiers/modifier-type"; +import { itemPoolChecks } from "#modifiers/modifier-type"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; import { expect } from "vitest"; -import { GameManagerHelper } from "./gameManagerHelper"; -import type { ModifierTypeKeys } from "#app/modifier/modifier-type"; -import { itemPoolChecks } from "#app/modifier/modifier-type"; export class ModifierHelper extends GameManagerHelper { /** diff --git a/test/testUtils/helpers/moveHelper.ts b/test/testUtils/helpers/moveHelper.ts index ed1441a6a2f..98a1c1664b4 100644 --- a/test/testUtils/helpers/moveHelper.ts +++ b/test/testUtils/helpers/moveHelper.ts @@ -1,22 +1,23 @@ -import type { BattlerIndex } from "#enums/battler-index"; -import { getMoveTargets } from "#app/data/moves/move-utils"; -import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; import Overrides from "#app/overrides"; -import type { CommandPhase } from "#app/phases/command-phase"; -import type { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { allMoves } from "#data/data-lists"; +import { BattlerIndex } from "#enums/battler-index"; import { Command } from "#enums/command"; import { MoveId } from "#enums/move-id"; -import { UiMode } from "#enums/ui-mode"; -import { getMovePosition } from "#test/testUtils/gameManagerUtils"; -import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; -import { vi } from "vitest"; -import { coerceArray } from "#app/utils/common"; import { MoveUseMode } from "#enums/move-use-mode"; +import { UiMode } from "#enums/ui-mode"; +import type { Pokemon } from "#field/pokemon"; +import { getMoveTargets } from "#moves/move-utils"; +import { PokemonMove } from "#moves/pokemon-move"; +import type { CommandPhase } from "#phases/command-phase"; +import type { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; +import { coerceArray, toReadableString } from "#utils/common"; +import type { MockInstance } from "vitest"; +import { expect, vi } from "vitest"; /** - * Helper to handle a Pokemon's move + * Helper to handle using a Pokemon's moves. */ export class MoveHelper extends GameManagerHelper { /** @@ -49,13 +50,31 @@ export class MoveHelper extends GameManagerHelper { } /** - * Select the move to be used by the given Pokemon(-index). Triggers during the next {@linkcode CommandPhase} - * @param move - the move to use - * @param pkmIndex - the pokemon index. Relevant for double-battles only (defaults to 0) - * @param targetIndex - The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves, or `null` if a manual call to `selectTarget()` is required + * Select a move _already in the player's moveset_ to be used during the next {@linkcode CommandPhase}. + * @param move - The {@linkcode MoveId} to use. + * @param pkmIndex - The {@linkcode BattlerIndex} of the player Pokemon using the move. Relevant for double battles only and defaults to {@linkcode BattlerIndex.PLAYER} if not specified. + * @param targetIndex - The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves; should be omitted for multi-target moves. + * If set to `null`, will forgo normal target selection entirely (useful for UI tests). + * @remarks + * Will fail the current test if the move being selected is not in the user's moveset. */ - public select(move: MoveId, pkmIndex: 0 | 1 = 0, targetIndex?: BattlerIndex | null) { - const movePosition = getMovePosition(this.game.scene, pkmIndex, move); + public select( + move: MoveId, + pkmIndex: BattlerIndex.PLAYER | BattlerIndex.PLAYER_2 = BattlerIndex.PLAYER, + targetIndex?: BattlerIndex | null, + ) { + const movePosition = this.getMovePosition(pkmIndex, move); + if (movePosition === -1) { + expect.fail( + `MoveHelper.select called with move '${toReadableString(MoveId[move])}' not in moveset!` + + `\nBattler Index: ${toReadableString(BattlerIndex[pkmIndex])}` + + `\nMoveset: [${this.game.scene + .getPlayerParty() + [pkmIndex].getMoveset() + .map(pm => toReadableString(MoveId[pm.moveId])) + .join(", ")}]`, + ); + } this.game.onNextPrompt("CommandPhase", UiMode.COMMAND, () => { this.game.scene.ui.setMode( @@ -77,14 +96,30 @@ export class MoveHelper extends GameManagerHelper { } /** - * Select the move to be used by the given Pokemon(-index), **which will also terastallize on this turn**. - * Triggers during the next {@linkcode CommandPhase} - * @param move - the move to use - * @param pkmIndex - the pokemon index. Relevant for double-battles only (defaults to 0) - * @param targetIndex - The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves, or `null` if a manual call to `selectTarget()` is required + * Select a move _already in the player's moveset_ to be used during the next {@linkcode CommandPhase}, **which will also terastallize on this turn**. + * @param move - The {@linkcode MoveId} to use. + * @param pkmIndex - The {@linkcode BattlerIndex} of the player Pokemon using the move. Relevant for double battles only and defaults to {@linkcode BattlerIndex.PLAYER} if not specified. + * @param targetIndex - The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves; should be omitted for multi-target moves. + * If set to `null`, will forgo normal target selection entirely (useful for UI tests) */ - public selectWithTera(move: MoveId, pkmIndex: 0 | 1 = 0, targetIndex?: BattlerIndex | null) { - const movePosition = getMovePosition(this.game.scene, pkmIndex, move); + public selectWithTera( + move: MoveId, + pkmIndex: BattlerIndex.PLAYER | BattlerIndex.PLAYER_2 = BattlerIndex.PLAYER, + targetIndex?: BattlerIndex | null, + ) { + const movePosition = this.getMovePosition(pkmIndex, move); + if (movePosition === -1) { + expect.fail( + `MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset!` + + `\nBattler Index: ${toReadableString(BattlerIndex[pkmIndex])}` + + `\nMoveset: [${this.game.scene + .getPlayerParty() + [pkmIndex].getMoveset() + .map(pm => toReadableString(MoveId[pm.moveId])) + .join(", ")}]`, + ); + } + this.game.scene.getPlayerParty()[pkmIndex].isTerastallized = false; this.game.onNextPrompt("CommandPhase", UiMode.COMMAND, () => { @@ -107,6 +142,15 @@ export class MoveHelper extends GameManagerHelper { } } + /** Helper function to get the index of the selected move in the selected part member's moveset. */ + private getMovePosition(pokemonIndex: BattlerIndex.PLAYER | BattlerIndex.PLAYER_2, move: MoveId): number { + const playerPokemon = this.game.scene.getPlayerField()[pokemonIndex]; + const moveset = playerPokemon.getMoveset(); + const index = moveset.findIndex(m => m.moveId === move && m.ppUsed < m.getMovePp()); + console.log(`Move position for ${MoveId[move]} (=${move}):`, index); + return index; + } + /** * Modifies a player pokemon's moveset to contain only the selected move and then * selects it to be used during the next {@linkcode CommandPhase}. @@ -116,14 +160,19 @@ export class MoveHelper extends GameManagerHelper { * Note: If you need to check for changes in the player's moveset as part of the test, it may be * best to use {@linkcode changeMoveset} and {@linkcode select} instead. * @param moveId - the move to use - * @param pkmIndex - the pokemon index. Relevant for double-battles only (defaults to 0) - * @param targetIndex - (optional) The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves, or `null` if a manual call to `selectTarget()` is required - * @param useTera - If `true`, the Pokemon also chooses to Terastallize. This does not require a Tera Orb. Default: `false`. + * @param pkmIndex - The {@linkcode BattlerIndex} of the player Pokemon using the move. Relevant for double battles only and defaults to {@linkcode BattlerIndex.PLAYER} if not specified. + * @param targetIndex - The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves; should be omitted for multi-target moves. + * @param useTera - If `true`, the Pokemon will attempt to Terastallize even without a Tera Orb; default `false`. */ - public use(moveId: MoveId, pkmIndex: 0 | 1 = 0, targetIndex?: BattlerIndex | null, useTera = false): void { + public use( + moveId: MoveId, + pkmIndex: BattlerIndex.PLAYER | BattlerIndex.PLAYER_2 = BattlerIndex.PLAYER, + targetIndex?: BattlerIndex, + useTera = false, + ): void { if ([Overrides.MOVESET_OVERRIDE].flat().length > 0) { vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([]); - console.warn("Warning: `use` overwrites the Pokemon's moveset and disables the player moveset override!"); + console.warn("Warning: `MoveHelper.use` overwriting player pokemon moveset and disabling moveset override!"); } const pokemon = this.game.scene.getPlayerField()[pkmIndex]; @@ -258,4 +307,20 @@ export class MoveHelper extends GameManagerHelper { */ await this.game.phaseInterceptor.to("EnemyCommandPhase"); } + + /** + * Force the move used by Metronome to be a specific move. + * @param move - The move to force metronome to use + * @param once - If `true`, uses {@linkcode MockInstance#mockReturnValueOnce} when mocking, else uses {@linkcode MockInstance#mockReturnValue}. + * @returns The spy that for Metronome that was mocked (Usually unneeded). + */ + public forceMetronomeMove(move: MoveId, once = false): MockInstance { + const spy = vi.spyOn(allMoves[MoveId.METRONOME].getAttrs("RandomMoveAttr")[0], "getMoveOverride"); + if (once) { + spy.mockReturnValueOnce(move); + } else { + spy.mockReturnValue(move); + } + return spy; + } } diff --git a/test/testUtils/helpers/overridesHelper.ts b/test/testUtils/helpers/overridesHelper.ts index 3bf0fbbda47..412e60942db 100644 --- a/test/testUtils/helpers/overridesHelper.ts +++ b/test/testUtils/helpers/overridesHelper.ts @@ -1,35 +1,54 @@ -import type { Variant } from "#app/sprites/variant"; -import { Weather } from "#app/data/weather"; -import { AbilityId } from "#enums/ability-id"; -import type { ModifierOverride } from "#app/modifier/modifier-type"; -import type { BattleStyle } from "#app/overrides"; +/** biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */ +import type { NewArenaEvent } from "#events/battle-scene"; +/** biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */ + +import type { BattleStyle, RandomTrainerOverride } from "#app/overrides"; import Overrides, { defaultOverrides } from "#app/overrides"; -import type { Unlockables } from "#enums/unlockables"; +import { AbilityId } from "#enums/ability-id"; +import type { BattleType } from "#enums/battle-type"; import { BiomeId } from "#enums/biome-id"; import { MoveId } from "#enums/move-id"; import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { Nature } from "#enums/nature"; import { SpeciesId } from "#enums/species-id"; import { StatusEffect } from "#enums/status-effect"; -import type { WeatherType } from "#enums/weather-type"; +import type { Unlockables } from "#enums/unlockables"; +import { WeatherType } from "#enums/weather-type"; +import type { ModifierOverride } from "#modifiers/modifier-type"; +import type { Variant } from "#sprites/variant"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; +import { coerceArray, shiftCharCodes } from "#utils/common"; import { expect, vi } from "vitest"; -import { GameManagerHelper } from "./gameManagerHelper"; -import { coerceArray, shiftCharCodes } from "#app/utils/common"; -import type { RandomTrainerOverride } from "#app/overrides"; -import type { BattleType } from "#enums/battle-type"; /** * Helper to handle overrides in tests */ export class OverridesHelper extends GameManagerHelper { - /** If `true`, removes the starting items from enemies at the start of each test; default `true` */ + /** + * If `true`, removes the starting items from enemies at the start of each test. + * @defaultValue `true` + */ public removeEnemyStartingItems = true; - /** If `true`, sets the shiny overrides to disable shinies at the start of each test; default `true` */ + /** + * If `true`, sets the shiny overrides to disable shinies at the start of each test. + * @defaultValue `true` + */ public disableShinies = true; + /** + * If `true`, will set the IV overrides for player and enemy pokemon to `31` at the start of each test. + * @defaultValue `true` + */ + public normalizeIVs = true; + /** + * If `true`, will set the Nature overrides for player and enemy pokemon to a neutral nature at the start of each test. + * @defaultValue `true` + */ + public normalizeNatures = true; /** * Override the starting biome - * @warning Any event listeners that are attached to [NewArenaEvent](events\battle-scene.ts) may need to be handled down the line + * @warning Any event listeners that are attached to {@linkcode NewArenaEvent} may need to be handled down the line * @param biome - The biome to set */ public startingBiome(biome: BiomeId): this { @@ -219,6 +238,80 @@ export class OverridesHelper extends GameManagerHelper { return this; } + /** + * Overrides the IVs of the player pokemon + * @param ivs - If set to a number, all IVs are set to the same value. Must be between `0` and `31`! + * + * If set to an array, that array is applied to the pokemon's IV field as-is. + * All values must be between `0` and `31`, and the array must be of exactly length `6`! + * + * If set to `null`, the override is disabled. + * @returns `this` + */ + public playerIVs(ivs: number | number[] | null): this { + this.normalizeIVs = false; + vi.spyOn(Overrides, "IVS_OVERRIDE", "get").mockReturnValue(ivs); + if (ivs === null) { + this.log("Player IVs override disabled!"); + } else { + this.log(`Player IVs set to ${ivs}!`); + } + return this; + } + + /** + * Overrides the nature of the player's pokemon + * @param nature - The nature to set, or `null` to disable the override. + * @returns `this` + */ + public nature(nature: Nature | null): this { + this.normalizeNatures = false; + vi.spyOn(Overrides, "NATURE_OVERRIDE", "get").mockReturnValue(nature); + if (nature === null) { + this.log("Player Nature override disabled!"); + } else { + this.log(`Player Nature set to ${Nature[nature]} (=${nature})!`); + } + return this; + } + + /** + * Overrides the IVs of the enemy pokemon + * @param ivs - If set to a number, all IVs are set to the same value. Must be between `0` and `31`! + * + * If set to an array, that array is applied to the pokemon's IV field as-is. + * All values must be between `0` and `31`, and the array must be of exactly length `6`! + * + * If set to `null`, the override is disabled. + * @returns `this` + */ + public enemyIVs(ivs: number | number[] | null): this { + this.normalizeIVs = false; + vi.spyOn(Overrides, "ENEMY_IVS_OVERRIDE", "get").mockReturnValue(ivs); + if (ivs === null) { + this.log("Enemy IVs override disabled!"); + } else { + this.log(`Enemy IVs set to ${ivs}!`); + } + return this; + } + + /** + * Overrides the nature of the enemy's pokemon + * @param nature - The nature to set, or `null` to disable the override. + * @returns `this` + */ + public enemyNature(nature: Nature | null): this { + this.normalizeNatures = false; + vi.spyOn(Overrides, "ENEMY_NATURE_OVERRIDE", "get").mockReturnValue(nature); + if (nature === null) { + this.log("Enemy Nature override disabled!"); + } else { + this.log(`Enemy Nature set to ${Nature[nature]} (=${nature})!`); + } + return this; + } + /** * Override each wave to not have standard trainer battles * @returns `this` @@ -262,7 +355,7 @@ export class OverridesHelper extends GameManagerHelper { */ public weather(type: WeatherType): this { vi.spyOn(Overrides, "WEATHER_OVERRIDE", "get").mockReturnValue(type); - this.log(`Weather set to ${Weather[type]} (=${type})!`); + this.log(`Weather set to ${WeatherType[type]} (=${type})!`); return this; } diff --git a/test/testUtils/helpers/reloadHelper.ts b/test/testUtils/helpers/reloadHelper.ts index 4f9d6c810f8..bc8adae6f28 100644 --- a/test/testUtils/helpers/reloadHelper.ts +++ b/test/testUtils/helpers/reloadHelper.ts @@ -1,12 +1,12 @@ -import { GameManagerHelper } from "./gameManagerHelper"; -import { TitlePhase } from "#app/phases/title-phase"; +import { BattleStyle } from "#enums/battle-style"; import { UiMode } from "#enums/ui-mode"; +import { CommandPhase } from "#phases/command-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import type { SessionSaveData } from "#system/game-data"; +import type { GameManager } from "#test/testUtils/gameManager"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; import { vi } from "vitest"; -import { BattleStyle } from "#app/enums/battle-style"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import type { SessionSaveData } from "#app/system/game-data"; -import type GameManager from "../gameManager"; /** * Helper to allow reloading sessions in unit tests. diff --git a/test/testUtils/helpers/settingsHelper.ts b/test/testUtils/helpers/settingsHelper.ts index d5a60e6496a..76db93c7de5 100644 --- a/test/testUtils/helpers/settingsHelper.ts +++ b/test/testUtils/helpers/settingsHelper.ts @@ -1,7 +1,7 @@ -import { PlayerGender } from "#app/enums/player-gender"; -import { BattleStyle } from "#app/enums/battle-style"; -import { GameManagerHelper } from "./gameManagerHelper"; -import { ExpGainsSpeed } from "#app/enums/exp-gains-speed"; +import { BattleStyle } from "#enums/battle-style"; +import { ExpGainsSpeed } from "#enums/exp-gains-speed"; +import { PlayerGender } from "#enums/player-gender"; +import { GameManagerHelper } from "#test/testUtils/helpers/gameManagerHelper"; /** * Helper to handle settings for tests diff --git a/test/testUtils/inputsHandler.ts b/test/testUtils/inputsHandler.ts index 0d8c43e7616..6a0db37c9b6 100644 --- a/test/testUtils/inputsHandler.ts +++ b/test/testUtils/inputsHandler.ts @@ -1,7 +1,7 @@ -import type BattleScene from "#app/battle-scene"; -import pad_xbox360 from "#app/configs/inputs/pad_xbox360"; +import type { BattleScene } from "#app/battle-scene"; import type { InputsController } from "#app/inputs-controller"; -import TouchControl from "#app/touch-controls"; +import { TouchControl } from "#app/touch-controls"; +import pad_xbox360 from "#inputs/pad_xbox360"; import { holdOn } from "#test/testUtils/gameManagerUtils"; import fs from "node:fs"; import { JSDOM } from "jsdom"; @@ -12,7 +12,7 @@ interface LogEntry { button: any; } -export default class InputsHandler { +export class InputsHandler { private scene: BattleScene; private events: Phaser.Events.EventEmitter; private inputController: InputsController; diff --git a/test/testUtils/mocks/mockClock.ts b/test/testUtils/mocks/mockClock.ts index 67f399ae41d..0d94a62824c 100644 --- a/test/testUtils/mocks/mockClock.ts +++ b/test/testUtils/mocks/mockClock.ts @@ -1,4 +1,6 @@ -import Clock = Phaser.Time.Clock; +import Phaser from "phaser"; + +const Clock = Phaser.Time.Clock; export class MockClock extends Clock { public overrideDelay: number | null = 1; diff --git a/test/testUtils/mocks/mockGameObjectCreator.ts b/test/testUtils/mocks/mockGameObjectCreator.ts index caf98b79a9f..cfb1051ec2f 100644 --- a/test/testUtils/mocks/mockGameObjectCreator.ts +++ b/test/testUtils/mocks/mockGameObjectCreator.ts @@ -1,5 +1,5 @@ -import MockGraphics from "./mocksContainer/mockGraphics"; -import type MockTextureManager from "./mockTextureManager"; +import { MockGraphics } from "#test/testUtils/mocks/mocksContainer/mockGraphics"; +import type { MockTextureManager } from "#test/testUtils/mocks/mockTextureManager"; export class MockGameObjectCreator { private readonly textureManager: MockTextureManager; diff --git a/test/testUtils/mocks/mockLoader.ts b/test/testUtils/mocks/mockLoader.ts index 7452f85a317..7bb3ffe7147 100644 --- a/test/testUtils/mocks/mockLoader.ts +++ b/test/testUtils/mocks/mockLoader.ts @@ -1,6 +1,8 @@ -import CacheManager = Phaser.Cache.CacheManager; +import Phaser from "phaser"; -export default class MockLoader { +const CacheManager = Phaser.Cache.CacheManager; + +export class MockLoader { public cacheManager; constructor(scene) { this.cacheManager = new CacheManager(scene); diff --git a/test/testUtils/mocks/mockTextureManager.ts b/test/testUtils/mocks/mockTextureManager.ts index 585ee0a674a..b61a804bf55 100644 --- a/test/testUtils/mocks/mockTextureManager.ts +++ b/test/testUtils/mocks/mockTextureManager.ts @@ -1,18 +1,20 @@ -import MockContainer from "#test/testUtils/mocks/mocksContainer/mockContainer"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; +import { MockBBCodeText } from "#test/testUtils/mocks/mocksContainer/mock-bbcode-text"; +import { MockInputText } from "#test/testUtils/mocks/mocksContainer/mock-input-text"; +import { MockContainer } from "#test/testUtils/mocks/mocksContainer/mockContainer"; import { MockImage } from "#test/testUtils/mocks/mocksContainer/mockImage"; -import MockNineslice from "#test/testUtils/mocks/mocksContainer/mockNineslice"; -import MockPolygon from "#test/testUtils/mocks/mocksContainer/mockPolygon"; -import MockRectangle from "#test/testUtils/mocks/mocksContainer/mockRectangle"; -import MockSprite from "#test/testUtils/mocks/mocksContainer/mockSprite"; -import MockText from "#test/testUtils/mocks/mocksContainer/mockText"; -import MockTexture from "#test/testUtils/mocks/mocksContainer/mockTexture"; -import type { MockGameObject } from "./mockGameObject"; -import { MockVideoGameObject } from "./mockVideoGameObject"; +import { MockNineslice } from "#test/testUtils/mocks/mocksContainer/mockNineslice"; +import { MockPolygon } from "#test/testUtils/mocks/mocksContainer/mockPolygon"; +import { MockRectangle } from "#test/testUtils/mocks/mocksContainer/mockRectangle"; +import { MockSprite } from "#test/testUtils/mocks/mocksContainer/mockSprite"; +import { MockText } from "#test/testUtils/mocks/mocksContainer/mockText"; +import { MockTexture } from "#test/testUtils/mocks/mocksContainer/mockTexture"; +import { MockVideoGameObject } from "#test/testUtils/mocks/mockVideoGameObject"; /** * Stub class for Phaser.Textures.TextureManager */ -export default class MockTextureManager { +export class MockTextureManager { private textures: Map; private scene; public add; @@ -33,6 +35,8 @@ export default class MockTextureManager { image: this.image.bind(this), polygon: this.polygon.bind(this), text: this.text.bind(this), + rexBBCodeText: this.rexBBCodeText.bind(this), + rexInputText: this.rexInputText.bind(this), bitmapText: this.text.bind(this), displayList: this.displayList, video: () => new MockVideoGameObject(), @@ -103,9 +107,25 @@ export default class MockTextureManager { return text; } + rexBBCodeText(x, y, content, styleOptions) { + const text = new MockBBCodeText(this, x, y, content, styleOptions); + this.list.push(text); + return text; + } + + rexInputText(x, y, w, h, content, styleOptions) { + const text = new MockInputText(this, x, y, w, h, content, styleOptions); + this.list.push(text); + return text; + } + polygon(x, y, content, fillColor, fillAlpha) { const polygon = new MockPolygon(this, x, y, content, fillColor, fillAlpha); this.list.push(polygon); return polygon; } + + exists(key: string): boolean { + return this.textures.has(key); + } } diff --git a/test/testUtils/mocks/mockTimedEventManager.ts b/test/testUtils/mocks/mockTimedEventManager.ts index 10f32fd4c8b..b6c84876783 100644 --- a/test/testUtils/mocks/mockTimedEventManager.ts +++ b/test/testUtils/mocks/mockTimedEventManager.ts @@ -1,5 +1,5 @@ -import { CLASSIC_CANDY_FRIENDSHIP_MULTIPLIER } from "#app/data/balance/starters"; import { TimedEventManager } from "#app/timed-event-manager"; +import { CLASSIC_CANDY_FRIENDSHIP_MULTIPLIER } from "#balance/starters"; /** Mock TimedEventManager so that ongoing events don't impact tests */ export class MockTimedEventManager extends TimedEventManager { diff --git a/test/testUtils/mocks/mockVideoGameObject.ts b/test/testUtils/mocks/mockVideoGameObject.ts index 9b25877c80c..40413f6f622 100644 --- a/test/testUtils/mocks/mockVideoGameObject.ts +++ b/test/testUtils/mocks/mockVideoGameObject.ts @@ -1,4 +1,4 @@ -import type { MockGameObject } from "./mockGameObject"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; /** Mocks video-related stuff */ export class MockVideoGameObject implements MockGameObject { diff --git a/test/testUtils/mocks/mocksContainer/mock-bbcode-text.ts b/test/testUtils/mocks/mocksContainer/mock-bbcode-text.ts new file mode 100644 index 00000000000..8df0e01a43e --- /dev/null +++ b/test/testUtils/mocks/mocksContainer/mock-bbcode-text.ts @@ -0,0 +1,6 @@ +import { MockText } from "#test/testUtils/mocks/mocksContainer/mockText"; + +export class MockBBCodeText extends MockText { + setMaxLines(_lines: number) {} + setWrapMode(_mode: 0 | 1 | 2 | 3 | "none" | "word" | "char" | "character" | "mix") {} +} diff --git a/test/testUtils/mocks/mocksContainer/mock-input-text.ts b/test/testUtils/mocks/mocksContainer/mock-input-text.ts new file mode 100644 index 00000000000..6826278aa1e --- /dev/null +++ b/test/testUtils/mocks/mocksContainer/mock-input-text.ts @@ -0,0 +1,24 @@ +import { MockText } from "#test/testUtils/mocks/mocksContainer/mockText"; + +export class MockInputText extends MockText { + public inputType: string; + public selectionStart: number; + public selectionEnd: number; + public selectedText: string; + + constructor(textureManager, x, y, _w, _h, content, styleOptions) { + super(textureManager, x, y, content, styleOptions); + } + + selectText(_selectionStart?: number, _selectionEnd?: number) {} + + selectAll() {} + + setCursorPosition(_value: number) {} + + scrollToBottom() {} + + resize(_width: number, _height: number) {} + + setElement(_element, _style, _innerText) {} +} diff --git a/test/testUtils/mocks/mocksContainer/mockContainer.ts b/test/testUtils/mocks/mocksContainer/mockContainer.ts index d31165bb847..df9aaab5888 100644 --- a/test/testUtils/mocks/mocksContainer/mockContainer.ts +++ b/test/testUtils/mocks/mocksContainer/mockContainer.ts @@ -1,8 +1,8 @@ -import { coerceArray } from "#app/utils/common"; -import type MockTextureManager from "#test/testUtils/mocks/mockTextureManager"; -import type { MockGameObject } from "../mockGameObject"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; +import type { MockTextureManager } from "#test/testUtils/mocks/mockTextureManager"; +import { coerceArray } from "#utils/common"; -export default class MockContainer implements MockGameObject { +export class MockContainer implements MockGameObject { protected x: number; protected y: number; protected scene; diff --git a/test/testUtils/mocks/mocksContainer/mockGraphics.ts b/test/testUtils/mocks/mocksContainer/mockGraphics.ts index cd43bb3a877..6558cdf9fb1 100644 --- a/test/testUtils/mocks/mocksContainer/mockGraphics.ts +++ b/test/testUtils/mocks/mocksContainer/mockGraphics.ts @@ -1,6 +1,6 @@ -import type { MockGameObject } from "../mockGameObject"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; -export default class MockGraphics implements MockGameObject { +export class MockGraphics implements MockGameObject { private scene; public list: MockGameObject[] = []; public name: string; diff --git a/test/testUtils/mocks/mocksContainer/mockImage.ts b/test/testUtils/mocks/mocksContainer/mockImage.ts index f8990985e54..830a22a369c 100644 --- a/test/testUtils/mocks/mocksContainer/mockImage.ts +++ b/test/testUtils/mocks/mocksContainer/mockImage.ts @@ -1,4 +1,4 @@ -import MockContainer from "#test/testUtils/mocks/mocksContainer/mockContainer"; +import { MockContainer } from "#test/testUtils/mocks/mocksContainer/mockContainer"; export class MockImage extends MockContainer { // biome-ignore lint/correctness/noUnusedPrivateClassMembers: this is intentional (?) diff --git a/test/testUtils/mocks/mocksContainer/mockNineslice.ts b/test/testUtils/mocks/mocksContainer/mockNineslice.ts index 90c0e13e725..11983075cf7 100644 --- a/test/testUtils/mocks/mocksContainer/mockNineslice.ts +++ b/test/testUtils/mocks/mocksContainer/mockNineslice.ts @@ -1,6 +1,6 @@ -import MockContainer from "#test/testUtils/mocks/mocksContainer/mockContainer"; +import { MockContainer } from "#test/testUtils/mocks/mocksContainer/mockContainer"; -export default class MockNineslice extends MockContainer { +export class MockNineslice extends MockContainer { private texture; private leftWidth; private rightWidth; diff --git a/test/testUtils/mocks/mocksContainer/mockPolygon.ts b/test/testUtils/mocks/mocksContainer/mockPolygon.ts index 4a7f3baec78..2426231193a 100644 --- a/test/testUtils/mocks/mocksContainer/mockPolygon.ts +++ b/test/testUtils/mocks/mocksContainer/mockPolygon.ts @@ -1,6 +1,6 @@ -import MockContainer from "#test/testUtils/mocks/mocksContainer/mockContainer"; +import { MockContainer } from "#test/testUtils/mocks/mocksContainer/mockContainer"; -export default class MockPolygon extends MockContainer { +export class MockPolygon extends MockContainer { constructor(textureManager, x, y, _content, _fillColor, _fillAlpha) { super(textureManager, x, y); } diff --git a/test/testUtils/mocks/mocksContainer/mockRectangle.ts b/test/testUtils/mocks/mocksContainer/mockRectangle.ts index a8eeb370115..1e38cd3af44 100644 --- a/test/testUtils/mocks/mocksContainer/mockRectangle.ts +++ b/test/testUtils/mocks/mocksContainer/mockRectangle.ts @@ -1,7 +1,7 @@ -import { coerceArray } from "#app/utils/common"; -import type { MockGameObject } from "../mockGameObject"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; +import { coerceArray } from "#utils/common"; -export default class MockRectangle implements MockGameObject { +export class MockRectangle implements MockGameObject { private fillColor; private scene; public list: MockGameObject[] = []; diff --git a/test/testUtils/mocks/mocksContainer/mockSprite.ts b/test/testUtils/mocks/mocksContainer/mockSprite.ts index bbcd421e1a7..bea1db21629 100644 --- a/test/testUtils/mocks/mocksContainer/mockSprite.ts +++ b/test/testUtils/mocks/mocksContainer/mockSprite.ts @@ -1,10 +1,10 @@ -import { coerceArray } from "#app/utils/common"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; +import { coerceArray } from "#utils/common"; import Phaser from "phaser"; -import type { MockGameObject } from "../mockGameObject"; type Frame = Phaser.Textures.Frame; -export default class MockSprite implements MockGameObject { +export class MockSprite implements MockGameObject { private phaserSprite; public pipelineData; public texture; diff --git a/test/testUtils/mocks/mocksContainer/mockText.ts b/test/testUtils/mocks/mocksContainer/mockText.ts index 2345ff70c0d..58ae3650411 100644 --- a/test/testUtils/mocks/mocksContainer/mockText.ts +++ b/test/testUtils/mocks/mocksContainer/mockText.ts @@ -1,7 +1,7 @@ -import UI from "#app/ui/ui"; -import type { MockGameObject } from "../mockGameObject"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; +import { UI } from "#ui/ui"; -export default class MockText implements MockGameObject { +export class MockText implements MockGameObject { private phaserText; private wordWrapWidth; private splitRegExp; diff --git a/test/testUtils/mocks/mocksContainer/mockTexture.ts b/test/testUtils/mocks/mocksContainer/mockTexture.ts index 3b01f9ab4ea..af25941094b 100644 --- a/test/testUtils/mocks/mocksContainer/mockTexture.ts +++ b/test/testUtils/mocks/mocksContainer/mockTexture.ts @@ -1,11 +1,11 @@ -import type MockTextureManager from "#test/testUtils/mocks/mockTextureManager"; -import type { MockGameObject } from "../mockGameObject"; +import type { MockGameObject } from "#test/testUtils/mocks/mockGameObject"; +import type { MockTextureManager } from "#test/testUtils/mocks/mockTextureManager"; /** * Stub for Phaser.Textures.Texture object * Just mocks the function calls and data required for use in tests */ -export default class MockTexture implements MockGameObject { +export class MockTexture implements MockGameObject { public manager: MockTextureManager; public key: string; public source; diff --git a/test/testUtils/phaseInterceptor.ts b/test/testUtils/phaseInterceptor.ts index e1033f87b15..c521a6c1e5f 100644 --- a/test/testUtils/phaseInterceptor.ts +++ b/test/testUtils/phaseInterceptor.ts @@ -1,70 +1,70 @@ import { Phase } from "#app/phase"; -import ErrorInterceptor from "#test/testUtils/errorInterceptor"; -import { AttemptRunPhase } from "#app/phases/attempt-run-phase"; -import { BattleEndPhase } from "#app/phases/battle-end-phase"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CheckSwitchPhase } from "#app/phases/check-switch-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; -import { EggLapsePhase } from "#app/phases/egg-lapse-phase"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { EndEvolutionPhase } from "#app/phases/end-evolution-phase"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { EvolutionPhase } from "#app/phases/evolution-phase"; -import { FaintPhase } from "#app/phases/faint-phase"; -import { FormChangePhase } from "#app/phases/form-change-phase"; -import { LearnMovePhase } from "#app/phases/learn-move-phase"; -import { LevelCapPhase } from "#app/phases/level-cap-phase"; -import { LoginPhase } from "#app/phases/login-phase"; -import { MessagePhase } from "#app/phases/message-phase"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { MovePhase } from "#app/phases/move-phase"; -import { NewBattlePhase } from "#app/phases/new-battle-phase"; -import { NewBiomeEncounterPhase } from "#app/phases/new-biome-encounter-phase"; -import { NextEncounterPhase } from "#app/phases/next-encounter-phase"; -import { PostSummonPhase } from "#app/phases/post-summon-phase"; -import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; -import { SelectGenderPhase } from "#app/phases/select-gender-phase"; -import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import { SelectTargetPhase } from "#app/phases/select-target-phase"; -import { ShinySparklePhase } from "#app/phases/shiny-sparkle-phase"; -import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; -import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; -import { SummonPhase } from "#app/phases/summon-phase"; -import { SwitchPhase } from "#app/phases/switch-phase"; -import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; -import { TitlePhase } from "#app/phases/title-phase"; -import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; -import { TurnStartPhase } from "#app/phases/turn-start-phase"; -import { UnavailablePhase } from "#app/phases/unavailable-phase"; -import { VictoryPhase } from "#app/phases/victory-phase"; -import { PartyHealPhase } from "#app/phases/party-heal-phase"; -import UI from "#app/ui/ui"; import { UiMode } from "#enums/ui-mode"; -import { SelectBiomePhase } from "#app/phases/select-biome-phase"; +import { AttemptRunPhase } from "#phases/attempt-run-phase"; +import { BattleEndPhase } from "#phases/battle-end-phase"; +import { BerryPhase } from "#phases/berry-phase"; +import { CheckSwitchPhase } from "#phases/check-switch-phase"; +import { CommandPhase } from "#phases/command-phase"; +import { DamageAnimPhase } from "#phases/damage-anim-phase"; +import { EggLapsePhase } from "#phases/egg-lapse-phase"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { EndEvolutionPhase } from "#phases/end-evolution-phase"; +import { EnemyCommandPhase } from "#phases/enemy-command-phase"; +import { EvolutionPhase } from "#phases/evolution-phase"; +import { ExpPhase } from "#phases/exp-phase"; +import { FaintPhase } from "#phases/faint-phase"; +import { FormChangePhase } from "#phases/form-change-phase"; +import { GameOverModifierRewardPhase } from "#phases/game-over-modifier-reward-phase"; +import { GameOverPhase } from "#phases/game-over-phase"; +import { LearnMovePhase } from "#phases/learn-move-phase"; +import { LevelCapPhase } from "#phases/level-cap-phase"; +import { LoginPhase } from "#phases/login-phase"; +import { MessagePhase } from "#phases/message-phase"; +import { ModifierRewardPhase } from "#phases/modifier-reward-phase"; +import { MoveEffectPhase } from "#phases/move-effect-phase"; +import { MoveEndPhase } from "#phases/move-end-phase"; +import { MovePhase } from "#phases/move-phase"; import { MysteryEncounterBattlePhase, MysteryEncounterOptionSelectedPhase, MysteryEncounterPhase, MysteryEncounterRewardsPhase, PostMysteryEncounterPhase, -} from "#app/phases/mystery-encounter-phases"; -import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase"; -import { PartyExpPhase } from "#app/phases/party-exp-phase"; -import { ExpPhase } from "#app/phases/exp-phase"; -import { GameOverPhase } from "#app/phases/game-over-phase"; -import { RibbonModifierRewardPhase } from "#app/phases/ribbon-modifier-reward-phase"; -import { GameOverModifierRewardPhase } from "#app/phases/game-over-modifier-reward-phase"; -import { UnlockPhase } from "#app/phases/unlock-phase"; -import { PostGameOverPhase } from "#app/phases/post-game-over-phase"; -import { RevivalBlessingPhase } from "#app/phases/revival-blessing-phase"; - -import type { PhaseClass, PhaseString } from "#app/@types/phase-types"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; +} from "#phases/mystery-encounter-phases"; +import { NewBattlePhase } from "#phases/new-battle-phase"; +import { NewBiomeEncounterPhase } from "#phases/new-biome-encounter-phase"; +import { NextEncounterPhase } from "#phases/next-encounter-phase"; +import { PartyExpPhase } from "#phases/party-exp-phase"; +import { PartyHealPhase } from "#phases/party-heal-phase"; +import { PokemonHealPhase } from "#phases/pokemon-heal-phase"; +import { PokemonTransformPhase } from "#phases/pokemon-transform-phase"; +import { PostGameOverPhase } from "#phases/post-game-over-phase"; +import { PostSummonPhase } from "#phases/post-summon-phase"; +import { QuietFormChangePhase } from "#phases/quiet-form-change-phase"; +import { RevivalBlessingPhase } from "#phases/revival-blessing-phase"; +import { RibbonModifierRewardPhase } from "#phases/ribbon-modifier-reward-phase"; +import { SelectBiomePhase } from "#phases/select-biome-phase"; +import { SelectGenderPhase } from "#phases/select-gender-phase"; +import { SelectModifierPhase } from "#phases/select-modifier-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import { SelectTargetPhase } from "#phases/select-target-phase"; +import { ShinySparklePhase } from "#phases/shiny-sparkle-phase"; +import { ShowAbilityPhase } from "#phases/show-ability-phase"; +import { StatStageChangePhase } from "#phases/stat-stage-change-phase"; +import { SummonPhase } from "#phases/summon-phase"; +import { SwitchPhase } from "#phases/switch-phase"; +import { SwitchSummonPhase } from "#phases/switch-summon-phase"; +import { TitlePhase } from "#phases/title-phase"; +import { ToggleDoublePositionPhase } from "#phases/toggle-double-position-phase"; +import { TurnEndPhase } from "#phases/turn-end-phase"; +import { TurnInitPhase } from "#phases/turn-init-phase"; +import { TurnStartPhase } from "#phases/turn-start-phase"; +import { UnavailablePhase } from "#phases/unavailable-phase"; +import { UnlockPhase } from "#phases/unlock-phase"; +import { VictoryPhase } from "#phases/victory-phase"; +import { ErrorInterceptor } from "#test/testUtils/errorInterceptor"; +import type { PhaseClass, PhaseString } from "#types/phase-types"; +import { UI } from "#ui/ui"; export interface PromptHandler { phaseTarget?: string; @@ -76,7 +76,7 @@ export interface PromptHandler { type PhaseInterceptorPhase = PhaseClass | PhaseString; -export default class PhaseInterceptor { +export class PhaseInterceptor { public scene; public phases = {}; public log: string[]; @@ -143,6 +143,7 @@ export default class PhaseInterceptor { [LevelCapPhase, this.startPhase], [AttemptRunPhase, this.startPhase], [SelectBiomePhase, this.startPhase], + [PokemonTransformPhase, this.startPhase], [MysteryEncounterPhase, this.startPhase], [PokemonHealPhase, this.startPhase], [MysteryEncounterOptionSelectedPhase, this.startPhase], diff --git a/test/testUtils/testFileInitialization.ts b/test/testUtils/testFileInitialization.ts index 578747b0529..98b49159d98 100644 --- a/test/testUtils/testFileInitialization.ts +++ b/test/testUtils/testFileInitialization.ts @@ -1,29 +1,29 @@ -import { SESSION_ID_COOKIE_NAME } from "#app/constants"; +import { initAbilities } from "#abilities/ability"; import { initLoggedInUser } from "#app/account"; -import { initAbilities } from "#app/data/abilities/ability"; -import { initBiomes } from "#app/data/balance/biomes"; -import { initEggMoves } from "#app/data/balance/egg-moves"; -import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions"; -import { initMoves } from "#app/data/moves/move"; -import { initModifierPools } from "#app/modifier/init-modifier-pools"; -import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters"; -import { initPokemonForms } from "#app/data/pokemon-forms"; -import { initSpecies } from "#app/data/pokemon-species"; -import { initAchievements } from "#app/system/achv"; -import { initVouchers } from "#app/system/voucher"; -import { initStatsKeys } from "#app/ui/game-stats-ui-handler"; -import { setCookie } from "#app/utils/cookies"; +import { SESSION_ID_COOKIE_NAME } from "#app/constants"; +import { initBiomes } from "#balance/biomes"; +import { initEggMoves } from "#balance/egg-moves"; +import { initPokemonPrevolutions, initPokemonStarters } from "#balance/pokemon-evolutions"; +import { initPokemonForms } from "#data/pokemon-forms"; +import { initSpecies } from "#data/pokemon-species"; +import { initModifierPools } from "#modifiers/init-modifier-pools"; +import { initModifierTypes } from "#modifiers/modifier-type"; +import { initMoves } from "#moves/move"; +import { initMysteryEncounters } from "#mystery-encounters/mystery-encounters"; +import { initI18n } from "#plugins/i18n"; +import { initAchievements } from "#system/achv"; +import { initVouchers } from "#system/voucher"; import { blobToString } from "#test/testUtils/gameManagerUtils"; +import { manageListeners } from "#test/testUtils/listenersManager"; import { MockConsoleLog } from "#test/testUtils/mocks/mockConsoleLog"; import { mockContext } from "#test/testUtils/mocks/mockContextCanvas"; import { mockLocalStorage } from "#test/testUtils/mocks/mockLocalStorage"; import { MockImage } from "#test/testUtils/mocks/mocksContainer/mockImage"; +import { initStatsKeys } from "#ui/game-stats-ui-handler"; +import { setCookie } from "#utils/cookies"; import Phaser from "phaser"; -import InputText from "phaser3-rex-plugins/plugins/inputtext"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import { manageListeners } from "./listenersManager"; -import { initI18n } from "#app/plugins/i18n"; -import { initModifierTypes } from "#app/modifier/modifier-type"; +import InputText from "phaser3-rex-plugins/plugins/inputtext"; let wasInitialized = false; /** diff --git a/test/types/enum-types.test-d.ts b/test/types/enum-types.test-d.ts new file mode 100644 index 00000000000..396c479e85a --- /dev/null +++ b/test/types/enum-types.test-d.ts @@ -0,0 +1,104 @@ +import type { EnumOrObject, EnumValues, NormalEnum, TSNumericEnum } from "#app/@types/enum-types"; +import type { enumValueToKey, getEnumKeys, getEnumValues } from "#app/utils/enums"; +import { describe, expectTypeOf, it } from "vitest"; + +enum testEnumNum { + testN1 = 1, + testN2 = 2, +} + +enum testEnumString { + testS1 = "apple", + testS2 = "banana", +} + +const testObjNum = { testON1: 1, testON2: 2 } as const; + +const testObjString = { testOS1: "apple", testOS2: "banana" } as const; + +describe("Enum Type Helpers", () => { + describe("EnumValues", () => { + it("should go from enum object type to value type", () => { + expectTypeOf>().toEqualTypeOf(); + expectTypeOf>().branded.toEqualTypeOf<1 | 2>(); + + expectTypeOf>().toEqualTypeOf(); + expectTypeOf>().toEqualTypeOf(); + expectTypeOf>().toMatchTypeOf<"apple" | "banana">(); + }); + + it("should produce union of const object values as type", () => { + expectTypeOf>().toEqualTypeOf<1 | 2>(); + + expectTypeOf>().toEqualTypeOf<"apple" | "banana">(); + }); + }); + + describe("TSNumericEnum", () => { + it("should match numeric enums", () => { + expectTypeOf>().toEqualTypeOf(); + }); + + it("should not match string enums or const objects", () => { + expectTypeOf>().toBeNever(); + expectTypeOf>().toBeNever(); + expectTypeOf>().toBeNever(); + }); + }); + + describe("NormalEnum", () => { + it("should match string enums or const objects", () => { + expectTypeOf>().toEqualTypeOf(); + expectTypeOf>().toEqualTypeOf(); + expectTypeOf>().toEqualTypeOf(); + }); + it("should not match numeric enums", () => { + expectTypeOf>().toBeNever(); + }); + }); + + describe("EnumOrObject", () => { + it("should match any enum or const object", () => { + expectTypeOf().toMatchTypeOf(); + expectTypeOf().toMatchTypeOf(); + expectTypeOf().toMatchTypeOf(); + expectTypeOf().toMatchTypeOf(); + }); + + it("should not match an enum value union w/o typeof", () => { + expectTypeOf().not.toMatchTypeOf(); + expectTypeOf().not.toMatchTypeOf(); + }); + + it("should be equivalent to `TSNumericEnum | NormalEnum`", () => { + expectTypeOf().branded.toEqualTypeOf | NormalEnum>(); + }); + }); +}); + +describe("Enum Functions", () => { + describe("getEnumKeys", () => { + it("should retrieve keys of numeric enum", () => { + expectTypeOf>().returns.toEqualTypeOf<("testN1" | "testN2")[]>(); + }); + }); + + describe("getEnumValues", () => { + it("should retrieve values of numeric enum", () => { + expectTypeOf>().returns.branded.toEqualTypeOf<(1 | 2)[]>(); + }); + }); + + describe("enumValueToKey", () => { + it("should retrieve values for a given key", () => { + expectTypeOf< + typeof enumValueToKey + >().returns.toEqualTypeOf<"testS1">(); + expectTypeOf>().returns.toEqualTypeOf< + "testS1" | "testS2" + >(); + expectTypeOf>().returns.toEqualTypeOf<"testON1">(); + expectTypeOf>().returns.toEqualTypeOf<"testON1" | "testON2">(); + }); + }); +}); diff --git a/test/ui/battle_info.test.ts b/test/ui/battle_info.test.ts index 3049424e3d2..afc456c6430 100644 --- a/test/ui/battle_info.test.ts +++ b/test/ui/battle_info.test.ts @@ -1,9 +1,9 @@ -import { ExpGainsSpeed } from "#app/enums/exp-gains-speed"; -import { SpeciesId } from "#enums/species-id"; -import { ExpPhase } from "#app/phases/exp-phase"; import { AbilityId } from "#enums/ability-id"; +import { ExpGainsSpeed } from "#enums/exp-gains-speed"; import { MoveId } from "#enums/move-id"; -import GameManager from "#test/testUtils/gameManager"; +import { SpeciesId } from "#enums/species-id"; +import { ExpPhase } from "#phases/exp-phase"; +import { GameManager } from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/ui/pokedex.test.ts b/test/ui/pokedex.test.ts index 13f595e0c60..1d81f19052c 100644 --- a/test/ui/pokedex.test.ts +++ b/test/ui/pokedex.test.ts @@ -1,21 +1,19 @@ -import GameManager from "#test/testUtils/gameManager"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import PokedexUiHandler from "#app/ui/pokedex-ui-handler"; -import { FilterTextRow } from "#app/ui/filter-text"; -import { allAbilities } from "#app/data/data-lists"; +import { allAbilities, allSpecies } from "#data/data-lists"; +import type { PokemonForm, PokemonSpecies } from "#data/pokemon-species"; import { AbilityId } from "#enums/ability-id"; -import { SpeciesId } from "#enums/species-id"; -import type { PokemonForm } from "#app/data/pokemon-species"; -import { getPokemonSpecies } from "#app/utils/pokemon-utils"; -import { allSpecies } from "#app/data/data-lists"; import { Button } from "#enums/buttons"; import { DropDownColumn } from "#enums/drop-down-column"; -import type PokemonSpecies from "#app/data/pokemon-species"; import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; import { UiMode } from "#enums/ui-mode"; -import PokedexPageUiHandler from "#app/ui/pokedex-page-ui-handler"; -import type { StarterAttributes } from "#app/system/game-data"; +import type { StarterAttributes } from "#system/game-data"; +import { GameManager } from "#test/testUtils/gameManager"; +import { FilterTextRow } from "#ui/filter-text"; +import { PokedexPageUiHandler } from "#ui/pokedex-page-ui-handler"; +import { PokedexUiHandler } from "#ui/pokedex-ui-handler"; +import { getPokemonSpecies } from "#utils/pokemon-utils"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; /* Information for the `data_pokedex_tests.psrv`: diff --git a/test/ui/starter-select.test.ts b/test/ui/starter-select.test.ts index 8167ab17957..63abc99174e 100644 --- a/test/ui/starter-select.test.ts +++ b/test/ui/starter-select.test.ts @@ -1,19 +1,19 @@ -import { Gender } from "#app/data/gender"; -import { Nature } from "#enums/nature"; -import { allSpecies } from "#app/data/data-lists"; -import { GameModes } from "#enums/game-modes"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; -import type { TitlePhase } from "#app/phases/title-phase"; -import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; -import type SaveSlotSelectUiHandler from "#app/ui/save-slot-select-ui-handler"; -import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; -import type StarterSelectUiHandler from "#app/ui/starter-select-ui-handler"; -import { UiMode } from "#enums/ui-mode"; +import { allSpecies } from "#data/data-lists"; +import { Gender } from "#data/gender"; import { AbilityId } from "#enums/ability-id"; import { Button } from "#enums/buttons"; +import { GameModes } from "#enums/game-modes"; +import { Nature } from "#enums/nature"; import { SpeciesId } from "#enums/species-id"; -import GameManager from "#test/testUtils/gameManager"; +import { UiMode } from "#enums/ui-mode"; +import { EncounterPhase } from "#phases/encounter-phase"; +import { SelectStarterPhase } from "#phases/select-starter-phase"; +import type { TitlePhase } from "#phases/title-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler"; +import type { OptionSelectUiHandler } from "#ui/option-select-ui-handler"; +import type { SaveSlotSelectUiHandler } from "#ui/save-slot-select-ui-handler"; +import type { StarterSelectUiHandler } from "#ui/starter-select-ui-handler"; import i18next from "i18next"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/ui/transfer-item.test.ts b/test/ui/transfer-item.test.ts index 572d56c5903..f2b0a4f7d35 100644 --- a/test/ui/transfer-item.test.ts +++ b/test/ui/transfer-item.test.ts @@ -1,11 +1,11 @@ -import { BerryType } from "#app/enums/berry-type"; -import { Button } from "#app/enums/buttons"; +import { BerryType } from "#enums/berry-type"; +import { Button } from "#enums/buttons"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler"; import { UiMode } from "#enums/ui-mode"; -import GameManager from "#test/testUtils/gameManager"; +import { GameManager } from "#test/testUtils/gameManager"; +import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; +import { PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler"; import Phaser from "phaser"; import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/test/ui/type-hints.test.ts b/test/ui/type-hints.test.ts index 6b0bc6e5ea5..8359c50c35d 100644 --- a/test/ui/type-hints.test.ts +++ b/test/ui/type-hints.test.ts @@ -1,14 +1,14 @@ -import { Button } from "#app/enums/buttons"; +import { Button } from "#enums/buttons"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; -import { CommandPhase } from "#app/phases/command-phase"; -import FightUiHandler from "#app/ui/fight-ui-handler"; import { UiMode } from "#enums/ui-mode"; -import GameManager from "#test/testUtils/gameManager"; +import { CommandPhase } from "#phases/command-phase"; +import { GameManager } from "#test/testUtils/gameManager"; +import type { MockText } from "#test/testUtils/mocks/mocksContainer/mockText"; +import { FightUiHandler } from "#ui/fight-ui-handler"; +import i18next from "i18next"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import type MockText from "#test/testUtils/mocks/mocksContainer/mockText"; -import i18next from "i18next"; describe("UI - Type Hints", () => { let phaserGame: Phaser.Game; diff --git a/test/utils.test.ts b/test/utils.test.ts index fe93bdd6970..aacd590a023 100644 --- a/test/utils.test.ts +++ b/test/utils.test.ts @@ -1,8 +1,7 @@ -import { expect, describe, it, beforeAll } from "vitest"; -import { randomString, padInt } from "#app/utils/common"; -import { deepMergeSpriteData } from "#app/utils/data"; - +import { padInt, randomString } from "#utils/common"; +import { deepMergeSpriteData } from "#utils/data"; import Phaser from "phaser"; +import { beforeAll, describe, expect, it } from "vitest"; describe("utils", () => { beforeAll(() => { diff --git a/test/vitest.setup.ts b/test/vitest.setup.ts index 93b439e540f..6cf20219408 100644 --- a/test/vitest.setup.ts +++ b/test/vitest.setup.ts @@ -1,8 +1,7 @@ import "vitest-canvas-mock"; +import { initTestFile } from "#test/testUtils/testFileInitialization"; import { afterAll, beforeAll, vi } from "vitest"; -import { initTestFile } from "./testUtils/testFileInitialization"; - /** Set the timezone to UTC for tests. */ /** Mock the override import to always return default values, ignoring any custom overrides. */ diff --git a/tsconfig.json b/tsconfig.json index 6af3e9ce650..39b99cf9ca9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,18 +11,41 @@ "rootDir": ".", "baseUrl": "./src", "paths": { + "#abilities/*": ["./data/abilities/*.ts"], + "#api/*": ["./plugins/api/*.ts"], + "#balance/*": ["./data/balance/*.ts"], "#enums/*": ["./enums/*.ts"], - "#app/*": ["*.ts"], - "#test/*": ["../test/*.ts"] + "#events/*": ["./events/*.ts"], + "#field/*": ["./field/*.ts"], + "#inputs/*": ["./configs/inputs/*.ts"], + "#modifiers/*": ["./modifier/*.ts"], + "#moves/*": ["./data/moves/*.ts"], + "#mystery-encounters/*": [ + "./data/mystery-encounters/utils/*.ts", + "./data/mystery-encounters/encounters/*.ts", + "./data/mystery-encounters/requirements/*.ts", + "./data/mystery-encounters/*.ts" + ], + "#package.json": ["../package.json"], + "#phases/*": ["./phases/*.ts"], + "#plugins/*": ["./plugins/vite/*.ts", "./plugins/*.ts"], + "#sprites/*": ["./sprites/*.ts"], + "#system/*": [ + "./system/settings/*.ts", + "./system/version_migration/versions/*.ts", + "./system/version_migration/*.ts", + "./system/*.ts" + ], + "#trainers/*": ["./data/trainers/*.ts"], + "#types/*": ["./@types/*.ts", "./typings/phaser/*.ts"], + "#ui/*": ["./ui/battle-info/*.ts", "./ui/settings/*.ts", "./ui/*.ts"], + "#utils/*": ["./utils/*.ts"], + "#data/*": ["./data/pokemon-forms/*.ts", "./data/pokemon/*.ts", "./data/*.ts"], + "#test/*": ["../test/*.ts"], + "#app/*": ["*.ts"] }, "outDir": "./build", "noEmit": true }, - "typedocOptions": { - "entryPoints": ["./src"], - "entryPointStrategy": "expand", - "exclude": "**/*+.test.ts", - "out": "typedoc" - }, "exclude": ["node_modules", "dist", "vite.config.ts", "vitest.config.ts", "vitest.workspace.ts"] } diff --git a/tsdoc.json b/tsdoc.json new file mode 100644 index 00000000000..b4cbc9a62a5 --- /dev/null +++ b/tsdoc.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://developer.microsoft.com/en-us/json-schemas/tsdoc/v0/tsdoc.schema.json", + "noStandardTags": false, + "tagDefinitions": [ + { + "tagName": "@todo", + "syntaxKind": "block" + }, + { + "tagName": "@linkcode", + "syntaxKind": "inline" + } + ] +} diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000000..c34e6190c1a --- /dev/null +++ b/typedoc.json @@ -0,0 +1,7 @@ +{ + "entryPoints": ["./src"], + "entryPointStrategy": "expand", + "exclude": ["**/*+.test.ts"], + "out": "typedoc", + "highlightLanguages": ["javascript", "json", "jsonc", "json5", "tsx", "typescript", "markdown"] +} diff --git a/vitest.config.ts b/vitest.config.ts index c781bde97ed..3900bc7b047 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,16 +1,6 @@ import { defineProject } from "vitest/config"; -import { defaultConfig } from "./vite.config"; import { BaseSequencer, type TestSpecification } from "vitest/node"; - -function getTestOrder(testName: string): number { - if (testName.includes("battle-scene.test.ts")) { - return 1; - } - if (testName.includes("inputs.test.ts")) { - return 2; - } - return 3; -} +import { defaultConfig } from "./vite.config"; export default defineProject(({ mode }) => ({ ...defaultConfig, @@ -18,15 +8,7 @@ export default defineProject(({ mode }) => ({ testTimeout: 20000, setupFiles: ["./test/fontFace.setup.ts", "./test/vitest.setup.ts"], sequence: { - sequencer: class CustomSequencer extends BaseSequencer { - async sort(files: TestSpecification[]) { - // use default sorting at first. - files = await super.sort(files); - // Except, forcibly reorder - - return files.sort((a, b) => getTestOrder(a.moduleId) - getTestOrder(b.moduleId)); - } - }, + sequencer: MySequencer, }, environment: "jsdom" as const, environmentOptions: { @@ -34,6 +16,10 @@ export default defineProject(({ mode }) => ({ resources: "usable", }, }, + typecheck: { + tsconfig: "tsconfig.json", + include: ["./test/types/**/*.{test,spec}{-|.}d.ts"], + }, threads: false, trace: true, restoreMocks: true, @@ -51,3 +37,38 @@ export default defineProject(({ mode }) => ({ keepNames: true, }, })); + +//#region Helpers + +/** + * Class for sorting test files in the desired order. + */ +class MySequencer extends BaseSequencer { + async sort(files: TestSpecification[]) { + files = await super.sort(files); + + return files.sort((a, b) => { + const aTestOrder = getTestOrder(a.moduleId); + const bTestOrder = getTestOrder(b.moduleId); + return aTestOrder - bTestOrder; + }); + } +} + +/** + * A helper function for sorting test files in a desired order. + * + * A lower number means that a test file must be run earlier, + * or else it breaks due to running tests with `--no-isolate.` + */ +function getTestOrder(testName: string): number { + if (testName.includes("battle-scene.test.ts")) { + return 1; + } + if (testName.includes("inputs.test.ts")) { + return 2; + } + return 3; +} + +//#endregion diff --git a/vitest.workspace.ts b/vitest.workspace.ts deleted file mode 100644 index 2f5d1f1e2c8..00000000000 --- a/vitest.workspace.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineWorkspace } from "vitest/config"; -import { defaultConfig } from "./vite.config"; - -export default defineWorkspace([ - { - ...defaultConfig, - test: { - name: "pre", - include: ["./test/pre.test.ts"], - environment: "jsdom", - }, - }, - "./vitest.config.ts", -]);