diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 9068f1ae9a2..2850418bc59 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -11,6 +11,8 @@ on: branches: - main # Trigger on pull request events targeting the main branch - beta # Trigger on pull request events targeting the beta branch + merge_group: + types: [checks_requested] jobs: run-linters: # Define a job named "run-linters" diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 3b7617c45f4..a092ccb425a 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -8,6 +8,8 @@ on: branches: - main - beta + merge_group: + types: [checks_requested] jobs: pages: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9ce1d1c5038..adac45519ab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,8 @@ on: branches: - main # Trigger on pull request events targeting the main branch - beta # Trigger on pull request events targeting the beta branch + merge_group: + types: [checks_requested] jobs: run-tests: # Define a job named "run-tests" diff --git a/docs/enemy-ai.md b/docs/enemy-ai.md index f53a8511893..46482f56a90 100644 --- a/docs/enemy-ai.md +++ b/docs/enemy-ai.md @@ -191,15 +191,15 @@ Now that the enemy Pokémon with the best matchup score is on the field (assumin We then need to apply a 2x multiplier for the move's type effectiveness and a 1.5x multiplier since STAB applies. After applying these multipliers, the final score for this move is **75**. -- **Swords Dance**: As a non-attacking move, this move's benefit score is derived entirely from the sum of its attributes' benefit scores. Swords Dance's `StatChangeAttr` has a user benefit score of 0 and a target benefit score that, in this case, simplifies to +- **Swords Dance**: As a non-attacking move, this move's benefit score is derived entirely from the sum of its attributes' benefit scores. Swords Dance's `StatStageChangeAttr` has a user benefit score of 0 and a target benefit score that, in this case, simplifies to $\text{TBS}=4\times \text{levels} + (-2\times \text{sign(levels)})$ where `levels` is the number of stat stages added by the attribute (in this case, +2). The final score for this move is **6** (Note: because this move is self-targeted, we don't flip the sign of TBS when computing the target score). -- **Crush Claw**: This move is a 75-power Normal-type physical attack with a 50 percent chance to lower the target's Defense by one stage. The additional effect is implemented by the same `StatChangeAttr` as Swords Dance, so we can use the same formulas from before to compute the total TBS and base target score. +- **Crush Claw**: This move is a 75-power Normal-type physical attack with a 50 percent chance to lower the target's Defense by one stage. The additional effect is implemented by the same `StatStageChangeAttr` as Swords Dance, so we can use the same formulas from before to compute the total TBS and base target score. - $\text{TBS}=\text{getTargetBenefitScore(StatChangeAttr)}-\text{attackScore}$ + $\text{TBS}=\text{getTargetBenefitScore(StatStageChangeAttr)}-\text{attackScore}$ $\text{TBS}=(-4 + 2)-(-2\times 2 + \lfloor \frac{75}{5} \rfloor)=-2-11=-13$ @@ -221,4 +221,4 @@ When implementing a new move attribute, it's important to override `MoveAttr`'s - A move's **user benefit score (UBS)** incentivizes (or discourages) the move's usage in general. A positive UBS gives the move more incentive to be used, while a negative UBS gives the move less incentive. - A move's **target benefit score (TBS)** incentivizes (or discourages) the move's usage on a specific target. A positive TBS indicates the move is better used on the user or its allies, while a negative TBS indicates the move is better used on enemies. - **The total benefit score (UBS + TBS) of a move should never be 0.** The move selection algorithm assumes the move's benefit score is unimplemented if the total score is 0 and penalizes the move's usage as a result. With status moves especially, it's important to have some form of implementation among the move's attributes to avoid this scenario. -- **Score functions that use formulas should include comments.** If your attribute requires complex logic or formulas to calculate benefit scores, please add comments to explain how the logic works and its intended effect on the enemy's decision making. \ No newline at end of file +- **Score functions that use formulas should include comments.** If your attribute requires complex logic or formulas to calculate benefit scores, please add comments to explain how the logic works and its intended effect on the enemy's decision making. diff --git a/index.css b/index.css index abf4f9f708c..1274f2fcead 100644 --- a/index.css +++ b/index.css @@ -23,15 +23,6 @@ body { } } -#links { - width: 90%; - text-align: center; - position: fixed; - bottom: 0; - display: flex; - justify-content: space-around; -} - #app { display: flex; justify-content: center; @@ -93,7 +84,7 @@ input:-internal-autofill-selected { @media (orientation: landscape) { #touchControls { - --controls-size: 20vh; + --controls-size: 20vh; --text-shadow-size: 1.3vh; --small-button-offset: 4vh; } diff --git a/index.html b/index.html index 29b4c0d1a6e..390a29fb365 100644 --- a/index.html +++ b/index.html @@ -39,7 +39,6 @@ - diff --git a/lefthook.yml b/lefthook.yml index 01ffebc69c7..662d3b5617b 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -2,6 +2,15 @@ pre-commit: parallel: true commands: eslint: - glob: '*.{js,jsx,ts,tsx}' + glob: "*.{js,jsx,ts,tsx}" run: npx eslint --fix {staged_files} - stage_fixed: true \ No newline at end of file + stage_fixed: true + skip: + - merge + - rebase + +pre-push: + commands: + eslint: + glob: "*.{js,ts,jsx,tsx}" + run: npx eslint --fix {push_files} \ No newline at end of file diff --git a/public/images/events/september-update-pt_BR.png b/public/images/events/september-update-pt-BR.png similarity index 100% rename from public/images/events/september-update-pt_BR.png rename to public/images/events/september-update-pt-BR.png diff --git a/public/images/events/september-update-zh_CN.png b/public/images/events/september-update-zh-CN.png similarity index 100% rename from public/images/events/september-update-zh_CN.png rename to public/images/events/september-update-zh-CN.png diff --git a/public/images/inputs/keyboard.json b/public/images/inputs/keyboard.json index b1902df10d6..c9b3c79fbfb 100644 --- a/public/images/inputs/keyboard.json +++ b/public/images/inputs/keyboard.json @@ -1,596 +1,529 @@ -{"frames": [ - -{ - "filename": "0.png", - "frame": {"x":0,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "1.png", - "frame": {"x":12,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "2.png", - "frame": {"x":24,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "3.png", - "frame": {"x":36,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "4.png", - "frame": {"x":48,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "5.png", - "frame": {"x":60,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "6.png", - "frame": {"x":72,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "7.png", - "frame": {"x":84,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "8.png", - "frame": {"x":96,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "9.png", - "frame": {"x":108,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "A.png", - "frame": {"x":120,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "ALT.png", - "frame": {"x":132,"y":0,"w":16,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":16,"h":12}, - "sourceSize": {"w":16,"h":12} -}, -{ - "filename": "B.png", - "frame": {"x":148,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "BACK.png", - "frame": {"x":160,"y":0,"w":24,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":24,"h":12}, - "sourceSize": {"w":24,"h":12} -}, -{ - "filename": "C.png", - "frame": {"x":184,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "CTRL.png", - "frame": {"x":196,"y":0,"w":22,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":22,"h":12}, - "sourceSize": {"w":22,"h":12} -}, -{ - "filename": "D.png", - "frame": {"x":218,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "DEL.png", - "frame": {"x":230,"y":0,"w":17,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":17,"h":12}, - "sourceSize": {"w":17,"h":12} -}, -{ - "filename": "E.png", - "frame": {"x":247,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "END.png", - "frame": {"x":259,"y":0,"w":18,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":18,"h":12}, - "sourceSize": {"w":18,"h":12} -}, -{ - "filename": "ENTER.png", - "frame": {"x":277,"y":0,"w":27,"h":11}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":27,"h":11}, - "sourceSize": {"w":27,"h":11} -}, -{ - "filename": "ESC.png", - "frame": {"x":304,"y":0,"w":17,"h":11}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":17,"h":11}, - "sourceSize": {"w":17,"h":11} -}, -{ - "filename": "F.png", - "frame": {"x":321,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "F1.png", - "frame": {"x":333,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F2.png", - "frame": {"x":346,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F3.png", - "frame": {"x":359,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F4.png", - "frame": {"x":372,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F5.png", - "frame": {"x":385,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F6.png", - "frame": {"x":398,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F7.png", - "frame": {"x":411,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F8.png", - "frame": {"x":424,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F9.png", - "frame": {"x":437,"y":0,"w":13,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":13,"h":12}, - "sourceSize": {"w":13,"h":12} -}, -{ - "filename": "F10.png", - "frame": {"x":450,"y":0,"w":16,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":16,"h":12}, - "sourceSize": {"w":16,"h":12} -}, -{ - "filename": "F11.png", - "frame": {"x":466,"y":0,"w":15,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":15,"h":12}, - "sourceSize": {"w":15,"h":12} -}, -{ - "filename": "F12.png", - "frame": {"x":481,"y":0,"w":16,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":16,"h":12}, - "sourceSize": {"w":16,"h":12} -}, -{ - "filename": "G.png", - "frame": {"x":497,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "H.png", - "frame": {"x":509,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "HOME.png", - "frame": {"x":521,"y":0,"w":23,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":23,"h":12}, - "sourceSize": {"w":23,"h":12} -}, -{ - "filename": "I.png", - "frame": {"x":544,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "INS.png", - "frame": {"x":556,"y":0,"w":16,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":16,"h":12}, - "sourceSize": {"w":16,"h":12} -}, -{ - "filename": "J.png", - "frame": {"x":572,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "K.png", - "frame": {"x":584,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "KEY_ARROW_DOWN.png", - "frame": {"x":596,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "KEY_ARROW_LEFT.png", - "frame": {"x":608,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "KEY_ARROW_RIGHT.png", - "frame": {"x":620,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "KEY_ARROW_UP.png", - "frame": {"x":632,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "L.png", - "frame": {"x":644,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "LEFT_BRACKET.png", - "frame": {"x":656,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "M.png", - "frame": {"x":668,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "MINUS.png", - "frame": {"x":680,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "N.png", - "frame": {"x":692,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "O.png", - "frame": {"x":704,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "P.png", - "frame": {"x":716,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "PAGE_DOWN.png", - "frame": {"x":728,"y":0,"w":20,"h":11}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":20,"h":11}, - "sourceSize": {"w":20,"h":11} -}, -{ - "filename": "PAGE_UP.png", - "frame": {"x":748,"y":0,"w":20,"h":11}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":20,"h":11}, - "sourceSize": {"w":20,"h":11} -}, -{ - "filename": "PLUS.png", - "frame": {"x":768,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "Q.png", - "frame": {"x":780,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "QUOTE.png", - "frame": {"x":792,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "R.png", - "frame": {"x":804,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "RIGHT_BRACKET.png", - "frame": {"x":816,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "S.png", - "frame": {"x":828,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "SEMICOLON.png", - "frame": {"x":840,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "SHIFT.png", - "frame": {"x":852,"y":0,"w":23,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":23,"h":12}, - "sourceSize": {"w":23,"h":12} -}, -{ - "filename": "SPACE.png", - "frame": {"x":875,"y":0,"w":25,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":25,"h":12}, - "sourceSize": {"w":25,"h":12} -}, -{ - "filename": "T.png", - "frame": {"x":900,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "TAB.png", - "frame": {"x":912,"y":0,"w":19,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":19,"h":12}, - "sourceSize": {"w":19,"h":12} -}, -{ - "filename": "TILDE.png", - "frame": {"x":931,"y":0,"w":15,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":15,"h":12}, - "sourceSize": {"w":15,"h":12} -}, -{ - "filename": "U.png", - "frame": {"x":946,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "V.png", - "frame": {"x":958,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "W.png", - "frame": {"x":970,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "X.png", - "frame": {"x":982,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "Y.png", - "frame": {"x":994,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}, -{ - "filename": "Z.png", - "frame": {"x":1006,"y":0,"w":12,"h":12}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12}, - "sourceSize": {"w":12,"h":12} -}], -"meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "1.0", - "image": "keyboard.png", - "format": "RGBA8888", - "size": {"w":1018,"h":12}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:085d4353a5c4d18c90f82f8926710d72:45908b22b446cf7f4904d4e0b658b16a:bad03abb89ad027d879c383c13fd51bc$" -} -} +{ "frames": { + "0.png": { + "frame": { "x": 12, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "1.png": { + "frame": { "x": 36, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "2.png": { + "frame": { "x": 0, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "3.png": { + "frame": { "x": 12, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "4.png": { + "frame": { "x": 24, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "5.png": { + "frame": { "x": 84, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "6.png": { + "frame": { "x": 96, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "7.png": { + "frame": { "x": 120, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "8.png": { + "frame": { "x": 132, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "9.png": { + "frame": { "x": 52, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "A.png": { + "frame": { "x": 64, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "ALT.png": { + "frame": { "x": 0, "y": 22, "w": 16, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 16, "h": 11 }, + "sourceSize": { "w": 16, "h": 11 } + }, + "B.png": { + "frame": { "x": 76, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "BACK.png": { + "frame": { "x": 80, "y": 0, "w": 24, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 24, "h": 11 }, + "sourceSize": { "w": 24, "h": 11 } + }, + "C.png": { + "frame": { "x": 88, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "CTRL.png": { + "frame": { "x": 0, "y": 11, "w": 22, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 22, "h": 11 }, + "sourceSize": { "w": 22, "h": 11 } + }, + "D.png": { + "frame": { "x": 100, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "DEL.png": { + "frame": { "x": 116, "y": 11, "w": 17, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 11 }, + "sourceSize": { "w": 17, "h": 11 } + }, + "E.png": { + "frame": { "x": 112, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "END.png": { + "frame": { "x": 81, "y": 11, "w": 18, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 18, "h": 11 }, + "sourceSize": { "w": 18, "h": 11 } + }, + "ENTER.png": { + "frame": { "x": 28, "y": 0, "w": 27, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 27, "h": 11 }, + "sourceSize": { "w": 27, "h": 11 } + }, + "ESC.png": { + "frame": { "x": 99, "y": 11, "w": 17, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 11 }, + "sourceSize": { "w": 17, "h": 11 } + }, + "F.png": { + "frame": { "x": 124, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "F1.png": { + "frame": { "x": 78, "y": 22, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F2.png": { + "frame": { "x": 91, "y": 22, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F3.png": { + "frame": { "x": 104, "y": 22, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F4.png": { + "frame": { "x": 117, "y": 22, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F5.png": { + "frame": { "x": 130, "y": 22, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F6.png": { + "frame": { "x": 0, "y": 33, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F7.png": { + "frame": { "x": 13, "y": 33, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F8.png": { + "frame": { "x": 26, "y": 33, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F9.png": { + "frame": { "x": 39, "y": 33, "w": 13, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 13, "h": 11 }, + "sourceSize": { "w": 13, "h": 11 } + }, + "F10.png": { + "frame": { "x": 16, "y": 22, "w": 16, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 16, "h": 11 }, + "sourceSize": { "w": 16, "h": 11 } + }, + "F11.png": { + "frame": { "x": 48, "y": 22, "w": 15, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 15, "h": 11 }, + "sourceSize": { "w": 15, "h": 11 } + }, + "F12.png": { + "frame": { "x": 133, "y": 11, "w": 16, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 16, "h": 11 }, + "sourceSize": { "w": 16, "h": 11 } + }, + "G.png": { + "frame": { "x": 136, "y": 33, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "H.png": { + "frame": { "x": 0, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "HOME.png": { + "frame": { "x": 104, "y": 0, "w": 23, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 23, "h": 11 }, + "sourceSize": { "w": 23, "h": 11 } + }, + "I.png": { + "frame": { "x": 24, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "INS.png": { + "frame": { "x": 32, "y": 22, "w": 16, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 16, "h": 11 }, + "sourceSize": { "w": 16, "h": 11 } + }, + "J.png": { + "frame": { "x": 48, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "K.png": { + "frame": { "x": 60, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "KEY_ARROW_DOWN.png": { + "frame": { "x": 72, "y": 66, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } + }, + "KEY_ARROW_LEFT.png": { + "frame": { "x": 72, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "KEY_ARROW_RIGHT.png": { + "frame": { "x": 84, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "KEY_ARROW_UP.png": { + "frame": { "x": 94, "y": 66, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } + }, + "L.png": { + "frame": { "x": 96, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "LEFT_BRACKET.png": { + "frame": { "x": 127, "y": 66, "w": 10, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 10, "h": 11 }, + "sourceSize": { "w": 10, "h": 11 } + }, + "M.png": { + "frame": { "x": 108, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "MINUS.png": { + "frame": { "x": 105, "y": 66, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } + }, + "N.png": { + "frame": { "x": 120, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "O.png": { + "frame": { "x": 12, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "P.png": { + "frame": { "x": 132, "y": 44, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "PAGE_DOWN.png": { + "frame": { "x": 22, "y": 11, "w": 20, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 20, "h": 11 }, + "sourceSize": { "w": 20, "h": 11 } + }, + "PAGE_UP.png": { + "frame": { "x": 42, "y": 11, "w": 20, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 20, "h": 11 }, + "sourceSize": { "w": 20, "h": 11 } + }, + "PLUS.png": { + "frame": { "x": 116, "y": 66, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } + }, + "Q.png": { + "frame": { "x": 36, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "QUOTE.png": { + "frame": { "x": 83, "y": 66, "w": 11, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 11 }, + "sourceSize": { "w": 11, "h": 11 } + }, + "R.png": { + "frame": { "x": 48, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "RIGHT_BRACKET.png": { + "frame": { "x": 137, "y": 66, "w": 10, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 10, "h": 11 }, + "sourceSize": { "w": 10, "h": 11 } + }, + "S.png": { + "frame": { "x": 60, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "SEMICOLON.png": { + "frame": { "x": 72, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "SHIFT.png": { + "frame": { "x": 127, "y": 0, "w": 23, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 23, "h": 11 }, + "sourceSize": { "w": 23, "h": 11 } + }, + "SPACE.png": { + "frame": { "x": 55, "y": 0, "w": 25, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 25, "h": 11 }, + "sourceSize": { "w": 25, "h": 11 } + }, + "T.png": { + "frame": { "x": 108, "y": 55, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "TAB.png": { + "frame": { "x": 62, "y": 11, "w": 19, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 11 }, + "sourceSize": { "w": 19, "h": 11 } + }, + "TILDE.png": { + "frame": { "x": 63, "y": 22, "w": 15, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 15, "h": 11 }, + "sourceSize": { "w": 15, "h": 11 } + }, + "U.png": { + "frame": { "x": 0, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "V.png": { + "frame": { "x": 12, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "W.png": { + "frame": { "x": 24, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "X.png": { + "frame": { "x": 36, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "Y.png": { + "frame": { "x": 48, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "Z.png": { + "frame": { "x": 60, "y": 66, "w": 12, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 12, "h": 11 }, + "sourceSize": { "w": 12, "h": 11 } + }, + "ACTION.png": { + "frame": { "x": 0, "y": 0, "w": 28, "h": 11 }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { "x": 0, "y": 0, "w": 28, "h": 11 }, + "sourceSize": { "w": 28, "h": 11 } + } + }, + "meta": { + "app": "https://www.aseprite.org/", + "version": "1.3.7-dev", + "image": "keyboard.png", + "format": "RGBA8888", + "size": { "w": 150, "h": 77 }, + "scale": "1" + } +} diff --git a/public/images/inputs/keyboard.png b/public/images/inputs/keyboard.png index 67b26af12de..e4d849be0fb 100644 Binary files a/public/images/inputs/keyboard.png and b/public/images/inputs/keyboard.png differ diff --git a/public/images/pokemon/variant/465.json b/public/images/pokemon/variant/465.json new file mode 100644 index 00000000000..a7ff2338057 --- /dev/null +++ b/public/images/pokemon/variant/465.json @@ -0,0 +1,22 @@ +{ + "1": { + "529cc5": "8153c7", + "d65a94": "5ad662", + "3a73ad": "6b3aad", + "bd216b": "21bd69", + "5a193a": "195a2a", + "193a63": "391963", + "295a84": "472984" + }, + "2": { + "529cc5": "ffedb6", + "d65a94": "e67d2f", + "3a73ad": "ebc582", + "bd216b": "b35131", + "31313a": "3d1519", + "5a193a": "752e2e", + "193a63": "705040", + "295a84": "ad875a", + "4a4a52": "57211a" + } +} \ No newline at end of file diff --git a/public/images/pokemon/variant/465_2.json b/public/images/pokemon/variant/465_2.json deleted file mode 100644 index 7c6d5ea081a..00000000000 --- a/public/images/pokemon/variant/465_2.json +++ /dev/null @@ -1,4094 +0,0 @@ -{ - "textures": [ - { - "image": "465_2.png", - "format": "RGBA8888", - "size": { - "w": 407, - "h": 407 - }, - "scale": 1, - "frames": [ - { - "filename": "0009.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0010.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0041.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0042.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0073.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0074.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0139.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0140.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0171.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0172.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0007.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0008.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0039.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0040.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0071.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0072.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0137.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0138.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0169.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0170.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0023.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0024.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0055.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0056.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0087.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0088.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0153.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0154.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0185.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0186.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0025.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0026.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0057.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0058.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0089.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0090.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0155.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0156.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0187.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0188.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0001.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0002.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0017.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0018.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0033.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0034.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0049.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0050.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0065.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0066.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0081.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0082.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0097.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0098.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0129.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0130.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0131.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0132.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0147.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0148.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0163.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0164.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0179.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0180.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0011.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0012.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0043.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0044.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0075.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0076.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0141.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0142.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0173.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0174.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0105.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0106.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0121.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0122.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0003.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0004.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0035.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0036.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0067.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0068.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0133.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0134.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0165.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0166.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0027.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0028.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0059.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0060.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0091.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0092.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0157.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0158.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0189.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0190.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0005.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0006.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0037.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0038.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0069.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0070.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0135.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0136.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0167.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0168.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0015.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0016.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0047.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0048.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0079.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0080.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0145.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0146.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0177.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0178.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0031.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0032.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0063.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0064.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0095.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0096.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0161.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0162.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0193.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0194.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0019.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0020.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0051.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0052.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0083.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0084.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0149.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0150.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0181.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0182.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0013.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0014.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0045.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0046.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0077.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0078.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0143.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0144.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0175.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0176.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0021.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0022.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0053.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0054.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0085.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0086.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0151.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0152.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0183.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0184.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0099.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 196, - "w": 86, - "h": 66 - } - }, - { - "filename": "0100.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 196, - "w": 86, - "h": 66 - } - }, - { - "filename": "0101.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0102.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0125.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0126.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0103.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 176, - "y": 198, - "w": 94, - "h": 66 - } - }, - { - "filename": "0104.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 176, - "y": 198, - "w": 94, - "h": 66 - } - }, - { - "filename": "0107.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 270, - "y": 198, - "w": 97, - "h": 66 - } - }, - { - "filename": "0108.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 270, - "y": 198, - "w": 97, - "h": 66 - } - }, - { - "filename": "0127.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 86, - "h": 66 - } - }, - { - "filename": "0128.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 86, - "h": 66 - } - }, - { - "filename": "0029.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0030.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0061.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0062.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0093.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0094.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0159.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0160.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0191.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0192.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0109.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0110.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0117.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0118.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0111.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 254, - "y": 264, - "w": 97, - "h": 66 - } - }, - { - "filename": "0112.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 254, - "y": 264, - "w": 97, - "h": 66 - } - }, - { - "filename": "0113.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 330, - "w": 98, - "h": 66 - } - }, - { - "filename": "0114.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 330, - "w": 98, - "h": 66 - } - }, - { - "filename": "0115.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 98, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0116.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 98, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0119.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 195, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0120.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 195, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0123.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 3, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 292, - "y": 330, - "w": 94, - "h": 66 - } - }, - { - "filename": "0124.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 3, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 292, - "y": 330, - "w": 94, - "h": 66 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:9fb6238f8e585be9be5e520abb59e23d:2204e0edc6a9e184240a16c4ee5faa7c:06d67de9e8d7f60fc986e0c00145d6b1$" - } -} \ No newline at end of file diff --git a/public/images/pokemon/variant/465_2.png b/public/images/pokemon/variant/465_2.png deleted file mode 100644 index db25e88ad98..00000000000 Binary files a/public/images/pokemon/variant/465_2.png and /dev/null differ diff --git a/public/images/pokemon/variant/465_3.json b/public/images/pokemon/variant/465_3.json deleted file mode 100644 index c092ec585e7..00000000000 --- a/public/images/pokemon/variant/465_3.json +++ /dev/null @@ -1,4094 +0,0 @@ -{ - "textures": [ - { - "image": "465_3.png", - "format": "RGBA8888", - "size": { - "w": 407, - "h": 407 - }, - "scale": 1, - "frames": [ - { - "filename": "0009.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0010.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0041.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0042.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0073.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0074.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0139.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0140.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0171.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0172.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0007.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0008.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0039.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0040.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0071.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0072.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0137.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0138.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0169.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0170.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 74, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0023.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0024.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0055.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0056.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0087.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0088.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0153.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0154.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0185.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0186.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0025.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0026.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0057.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0058.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0089.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0090.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0155.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0156.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0187.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0188.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0001.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0002.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0017.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0018.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0033.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0034.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0049.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0050.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0065.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0066.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0081.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0082.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0097.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0098.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0129.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0130.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0131.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0132.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0147.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0148.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0163.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0164.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0179.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0180.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 314, - "y": 0, - "w": 83, - "h": 66 - } - }, - { - "filename": "0011.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0012.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0043.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0044.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0075.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0076.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0141.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0142.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0173.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0174.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 0, - "y": 64, - "w": 64, - "h": 66 - } - }, - { - "filename": "0105.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0106.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0121.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0122.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 64, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0003.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0004.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0035.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0036.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0067.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0068.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0133.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0134.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0165.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0166.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 162, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0027.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0028.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0059.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0060.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0091.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0092.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0157.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0158.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0189.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0190.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 64, - "h": 66 - }, - "frame": { - "x": 250, - "y": 65, - "w": 64, - "h": 66 - } - }, - { - "filename": "0005.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0006.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0037.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0038.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0069.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0070.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0135.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0136.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0167.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0168.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 314, - "y": 66, - "w": 93, - "h": 66 - } - }, - { - "filename": "0015.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0016.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0047.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0048.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0079.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0080.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0145.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0146.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0177.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0178.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0031.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0032.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0063.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0064.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0095.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0096.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0161.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0162.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0193.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0194.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 76, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0019.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0020.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0051.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0052.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0083.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0084.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0149.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0150.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0181.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0182.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 152, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0013.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0014.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0045.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0046.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0077.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0078.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0143.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0144.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0175.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0176.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 240, - "y": 131, - "w": 70, - "h": 67 - } - }, - { - "filename": "0021.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0022.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0053.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0054.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0085.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0086.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0151.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0152.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0183.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0184.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 310, - "y": 132, - "w": 93, - "h": 66 - } - }, - { - "filename": "0099.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 196, - "w": 86, - "h": 66 - } - }, - { - "filename": "0100.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 196, - "w": 86, - "h": 66 - } - }, - { - "filename": "0101.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0102.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0125.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0126.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 197, - "w": 90, - "h": 66 - } - }, - { - "filename": "0103.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 176, - "y": 198, - "w": 94, - "h": 66 - } - }, - { - "filename": "0104.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 176, - "y": 198, - "w": 94, - "h": 66 - } - }, - { - "filename": "0107.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 270, - "y": 198, - "w": 97, - "h": 66 - } - }, - { - "filename": "0108.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 270, - "y": 198, - "w": 97, - "h": 66 - } - }, - { - "filename": "0127.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 86, - "h": 66 - } - }, - { - "filename": "0128.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 86, - "h": 66 - } - }, - { - "filename": "0029.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0030.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0061.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0062.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0093.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0094.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0159.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0160.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0191.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0192.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 86, - "y": 263, - "w": 70, - "h": 67 - } - }, - { - "filename": "0109.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0110.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0117.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0118.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 156, - "y": 264, - "w": 98, - "h": 66 - } - }, - { - "filename": "0111.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 254, - "y": 264, - "w": 97, - "h": 66 - } - }, - { - "filename": "0112.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 254, - "y": 264, - "w": 97, - "h": 66 - } - }, - { - "filename": "0113.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 330, - "w": 98, - "h": 66 - } - }, - { - "filename": "0114.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 330, - "w": 98, - "h": 66 - } - }, - { - "filename": "0115.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 98, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0116.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 98, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0119.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 195, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0120.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 195, - "y": 330, - "w": 97, - "h": 66 - } - }, - { - "filename": "0123.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 3, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 292, - "y": 330, - "w": 94, - "h": 66 - } - }, - { - "filename": "0124.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 3, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 292, - "y": 330, - "w": 94, - "h": 66 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:9fb6238f8e585be9be5e520abb59e23d:2204e0edc6a9e184240a16c4ee5faa7c:06d67de9e8d7f60fc986e0c00145d6b1$" - } -} \ No newline at end of file diff --git a/public/images/pokemon/variant/465_3.png b/public/images/pokemon/variant/465_3.png deleted file mode 100644 index fe8e764028b..00000000000 Binary files a/public/images/pokemon/variant/465_3.png and /dev/null differ diff --git a/public/images/pokemon/variant/_masterlist.json b/public/images/pokemon/variant/_masterlist.json index 9efbf5bc150..938c92f5056 100644 --- a/public/images/pokemon/variant/_masterlist.json +++ b/public/images/pokemon/variant/_masterlist.json @@ -1691,8 +1691,8 @@ ], "465": [ 0, - 2, - 2 + 1, + 1 ], "466": [ 1, @@ -3980,6 +3980,11 @@ 1, 1 ], + "465": [ + 0, + 1, + 1 + ], "592": [ 1, 1, @@ -5690,7 +5695,7 @@ "465": [ 0, 1, - 2 + 1 ], "466": [ 2, @@ -8008,6 +8013,11 @@ 1, 1 ], + "465": [ + 0, + 1, + 1 + ], "592": [ 1, 1, diff --git a/public/images/pokemon/variant/back/465.json b/public/images/pokemon/variant/back/465.json index c8dad539b75..cc868023c2b 100644 --- a/public/images/pokemon/variant/back/465.json +++ b/public/images/pokemon/variant/back/465.json @@ -8,5 +8,14 @@ "bd216b": "21bd69", "31313a": "31313a", "d65a94": "5ad662" + }, + "2": { + "5a193a": "752e2e", + "31313a": "3d1519", + "d65a94": "e67d2f", + "3a73ad": "ebc582", + "295a84": "ad875a", + "bd216b": "b35131", + "193a63": "705040" } -} \ No newline at end of file +} diff --git a/public/images/pokemon/variant/back/465_3.json b/public/images/pokemon/variant/back/465_3.json deleted file mode 100644 index 3141b3c6cee..00000000000 --- a/public/images/pokemon/variant/back/465_3.json +++ /dev/null @@ -1,4094 +0,0 @@ -{ - "textures": [ - { - "image": "465_3.png", - "format": "RGBA8888", - "size": { - "w": 407, - "h": 407 - }, - "scale": 1, - "frames": [ - { - "filename": "0023.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0024.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0055.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0056.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0087.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0088.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0153.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0154.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0185.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0186.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 2, - "w": 83, - "h": 64 - }, - "frame": { - "x": 0, - "y": 0, - "w": 83, - "h": 64 - } - }, - { - "filename": "0025.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0026.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0057.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0058.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0089.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0090.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0155.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0156.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0187.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0188.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 3, - "w": 74, - "h": 64 - }, - "frame": { - "x": 83, - "y": 0, - "w": 74, - "h": 64 - } - }, - { - "filename": "0007.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0008.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0039.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0040.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0071.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0072.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0137.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0138.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0169.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0170.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 1, - "w": 83, - "h": 65 - }, - "frame": { - "x": 157, - "y": 0, - "w": 83, - "h": 65 - } - }, - { - "filename": "0009.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0010.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0041.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0042.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0073.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0074.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0139.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0140.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0171.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0172.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 12, - "y": 2, - "w": 74, - "h": 65 - }, - "frame": { - "x": 240, - "y": 0, - "w": 74, - "h": 65 - } - }, - { - "filename": "0021.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0022.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0053.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0054.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0085.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0086.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0151.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0152.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0183.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0184.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 1, - "w": 93, - "h": 65 - }, - "frame": { - "x": 314, - "y": 0, - "w": 93, - "h": 65 - } - }, - { - "filename": "0027.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0028.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0059.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0060.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0091.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0092.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0157.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0158.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0189.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0190.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 2, - "w": 65, - "h": 65 - }, - "frame": { - "x": 0, - "y": 64, - "w": 65, - "h": 65 - } - }, - { - "filename": "0001.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0002.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0017.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0018.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0033.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0034.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0049.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0050.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0065.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0066.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0081.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0082.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0097.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0098.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0129.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0130.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0131.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0132.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0147.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0148.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0163.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0164.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0179.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0180.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 83, - "h": 66 - }, - "frame": { - "x": 65, - "y": 64, - "w": 83, - "h": 66 - } - }, - { - "filename": "0105.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 148, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0106.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 148, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0121.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 148, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0122.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 1, - "w": 98, - "h": 65 - }, - "frame": { - "x": 148, - "y": 65, - "w": 98, - "h": 65 - } - }, - { - "filename": "0003.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0004.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0035.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0036.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0067.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0068.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0133.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0134.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0165.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0166.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 246, - "y": 65, - "w": 88, - "h": 66 - } - }, - { - "filename": "0011.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0012.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0043.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0044.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0075.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0076.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0141.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0142.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0173.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0174.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 17, - "y": 1, - "w": 65, - "h": 66 - }, - "frame": { - "x": 334, - "y": 65, - "w": 65, - "h": 66 - } - }, - { - "filename": "0005.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0006.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0037.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0038.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0069.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0070.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0135.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0136.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0167.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0168.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 2, - "y": 0, - "w": 93, - "h": 66 - }, - "frame": { - "x": 0, - "y": 130, - "w": 93, - "h": 66 - } - }, - { - "filename": "0015.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0016.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0047.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0048.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0079.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0080.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0145.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0146.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0177.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0178.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 93, - "y": 130, - "w": 76, - "h": 66 - } - }, - { - "filename": "0029.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0030.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0061.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0062.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0093.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0094.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0159.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0160.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0191.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0192.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 1, - "w": 70, - "h": 66 - }, - "frame": { - "x": 169, - "y": 130, - "w": 70, - "h": 66 - } - }, - { - "filename": "0019.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0020.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0051.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0052.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0083.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0084.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0149.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0150.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0181.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0182.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 88, - "h": 66 - }, - "frame": { - "x": 239, - "y": 131, - "w": 88, - "h": 66 - } - }, - { - "filename": "0031.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0032.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0063.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0064.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0095.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0096.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0161.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0162.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0193.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0194.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 11, - "y": 0, - "w": 76, - "h": 66 - }, - "frame": { - "x": 327, - "y": 131, - "w": 76, - "h": 66 - } - }, - { - "filename": "0099.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 196, - "w": 86, - "h": 66 - } - }, - { - "filename": "0100.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 7, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 0, - "y": 196, - "w": 86, - "h": 66 - } - }, - { - "filename": "0101.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 196, - "w": 90, - "h": 66 - } - }, - { - "filename": "0102.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 196, - "w": 90, - "h": 66 - } - }, - { - "filename": "0125.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 196, - "w": 90, - "h": 66 - } - }, - { - "filename": "0126.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 4, - "y": 0, - "w": 90, - "h": 66 - }, - "frame": { - "x": 86, - "y": 196, - "w": 90, - "h": 66 - } - }, - { - "filename": "0103.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 176, - "y": 197, - "w": 94, - "h": 66 - } - }, - { - "filename": "0104.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 176, - "y": 197, - "w": 94, - "h": 66 - } - }, - { - "filename": "0107.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 270, - "y": 197, - "w": 97, - "h": 66 - } - }, - { - "filename": "0108.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 270, - "y": 197, - "w": 97, - "h": 66 - } - }, - { - "filename": "0109.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 98, - "h": 66 - } - }, - { - "filename": "0110.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 98, - "h": 66 - } - }, - { - "filename": "0117.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 98, - "h": 66 - } - }, - { - "filename": "0118.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 0, - "y": 262, - "w": 98, - "h": 66 - } - }, - { - "filename": "0013.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0014.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0045.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0046.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0077.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0078.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0143.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0144.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0175.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0176.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 14, - "y": 0, - "w": 70, - "h": 67 - }, - "frame": { - "x": 98, - "y": 262, - "w": 70, - "h": 67 - } - }, - { - "filename": "0111.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 168, - "y": 263, - "w": 97, - "h": 66 - } - }, - { - "filename": "0112.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 168, - "y": 263, - "w": 97, - "h": 66 - } - }, - { - "filename": "0113.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 265, - "y": 263, - "w": 98, - "h": 66 - } - }, - { - "filename": "0114.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 98, - "h": 66 - }, - "frame": { - "x": 265, - "y": 263, - "w": 98, - "h": 66 - } - }, - { - "filename": "0115.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 0, - "y": 328, - "w": 97, - "h": 66 - } - }, - { - "filename": "0116.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 1, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 0, - "y": 328, - "w": 97, - "h": 66 - } - }, - { - "filename": "0119.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 97, - "y": 329, - "w": 97, - "h": 66 - } - }, - { - "filename": "0120.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 0, - "y": 0, - "w": 97, - "h": 66 - }, - "frame": { - "x": 97, - "y": 329, - "w": 97, - "h": 66 - } - }, - { - "filename": "0123.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 3, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 194, - "y": 329, - "w": 94, - "h": 66 - } - }, - { - "filename": "0124.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 3, - "y": 0, - "w": 94, - "h": 66 - }, - "frame": { - "x": 194, - "y": 329, - "w": 94, - "h": 66 - } - }, - { - "filename": "0127.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 288, - "y": 329, - "w": 86, - "h": 66 - } - }, - { - "filename": "0128.png", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 98, - "h": 67 - }, - "spriteSourceSize": { - "x": 5, - "y": 0, - "w": 86, - "h": 66 - }, - "frame": { - "x": 288, - "y": 329, - "w": 86, - "h": 66 - } - } - ] - } - ], - "meta": { - "app": "https://www.codeandweb.com/texturepacker", - "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:cd959f202c47f9ac8c3bb6f34f5e04e0:4fa06c9f7e584689369e76122c6343e8:06d67de9e8d7f60fc986e0c00145d6b1$" - } -} \ No newline at end of file diff --git a/public/images/pokemon/variant/back/465_3.png b/public/images/pokemon/variant/back/465_3.png deleted file mode 100644 index 876725447af..00000000000 Binary files a/public/images/pokemon/variant/back/465_3.png and /dev/null differ diff --git a/public/images/pokemon/variant/back/female/465.json b/public/images/pokemon/variant/back/female/465.json new file mode 100644 index 00000000000..ed257655add --- /dev/null +++ b/public/images/pokemon/variant/back/female/465.json @@ -0,0 +1,21 @@ +{ + "1": { + "193a63": "391963", + "295a84": "472984", + "3a73ad": "6b3aad", + "000000": "000000", + "5a193a": "195a2a", + "bd216b": "21bd69", + "31313a": "31313a", + "d65a94": "5ad662" + }, + "2": { + "5a193a": "752e2e", + "31313a": "3d1519", + "d65a94": "e67d2f", + "3a73ad": "ebc582", + "295a84": "ad875a", + "bd216b": "b35131", + "193a63": "705040" + } +} \ No newline at end of file diff --git a/public/images/pokemon/variant/female/465.json b/public/images/pokemon/variant/female/465.json new file mode 100644 index 00000000000..a7ff2338057 --- /dev/null +++ b/public/images/pokemon/variant/female/465.json @@ -0,0 +1,22 @@ +{ + "1": { + "529cc5": "8153c7", + "d65a94": "5ad662", + "3a73ad": "6b3aad", + "bd216b": "21bd69", + "5a193a": "195a2a", + "193a63": "391963", + "295a84": "472984" + }, + "2": { + "529cc5": "ffedb6", + "d65a94": "e67d2f", + "3a73ad": "ebc582", + "bd216b": "b35131", + "31313a": "3d1519", + "5a193a": "752e2e", + "193a63": "705040", + "295a84": "ad875a", + "4a4a52": "57211a" + } +} \ No newline at end of file diff --git a/public/images/ui/egg_summary_bg.png b/public/images/ui/egg_summary_bg.png new file mode 100644 index 00000000000..658f5df0e96 Binary files /dev/null and b/public/images/ui/egg_summary_bg.png differ diff --git a/public/images/ui/egg_summary_bg_blank.png b/public/images/ui/egg_summary_bg_blank.png new file mode 100644 index 00000000000..09bcb63cfa3 Binary files /dev/null and b/public/images/ui/egg_summary_bg_blank.png differ diff --git a/public/images/ui/icon_egg_move.png b/public/images/ui/icon_egg_move.png new file mode 100644 index 00000000000..a5b0bff4ace Binary files /dev/null and b/public/images/ui/icon_egg_move.png differ diff --git a/public/images/ui/icon_lock.png b/public/images/ui/icon_lock.png new file mode 100644 index 00000000000..6a12efa15e8 Binary files /dev/null and b/public/images/ui/icon_lock.png differ diff --git a/public/images/ui/icon_stop.png b/public/images/ui/icon_stop.png new file mode 100644 index 00000000000..6d9c201695a Binary files /dev/null and b/public/images/ui/icon_stop.png differ diff --git a/public/images/ui/legacy/egg_summary_bg.png b/public/images/ui/legacy/egg_summary_bg.png new file mode 100644 index 00000000000..658f5df0e96 Binary files /dev/null and b/public/images/ui/legacy/egg_summary_bg.png differ diff --git a/public/images/ui/legacy/icon_egg_move.png b/public/images/ui/legacy/icon_egg_move.png new file mode 100644 index 00000000000..a5b0bff4ace Binary files /dev/null and b/public/images/ui/legacy/icon_egg_move.png differ diff --git a/public/images/ui/legacy/icon_lock.png b/public/images/ui/legacy/icon_lock.png new file mode 100644 index 00000000000..6a12efa15e8 Binary files /dev/null and b/public/images/ui/legacy/icon_lock.png differ diff --git a/public/images/ui/legacy/icon_stop.png b/public/images/ui/legacy/icon_stop.png new file mode 100644 index 00000000000..6d9c201695a Binary files /dev/null and b/public/images/ui/legacy/icon_stop.png differ diff --git a/public/images/ui/legacy/settings_icon.png b/public/images/ui/legacy/settings_icon.png new file mode 100644 index 00000000000..21680cce7fc Binary files /dev/null and b/public/images/ui/legacy/settings_icon.png differ diff --git a/public/images/ui/settings_icon.png b/public/images/ui/settings_icon.png new file mode 100644 index 00000000000..21680cce7fc Binary files /dev/null and b/public/images/ui/settings_icon.png differ diff --git a/src/battle-scene.ts b/src/battle-scene.ts index e761d8fca39..9123a213f4c 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -130,7 +130,7 @@ export default class BattleScene extends SceneBase { public gameSpeed: integer = 1; public damageNumbersMode: integer = 0; public reroll: boolean = false; - public shopCursorTarget: number = ShopCursorTarget.CHECK_TEAM; + public shopCursorTarget: number = ShopCursorTarget.REWARDS; public showMovesetFlyout: boolean = true; public showArenaFlyout: boolean = true; public showTimeOfDayWidget: boolean = true; @@ -841,12 +841,13 @@ export default class BattleScene extends SceneBase { } addEnemyPokemon(species: PokemonSpecies, level: integer, trainerSlot: TrainerSlot, boss: boolean = false, dataSource?: PokemonData, postProcess?: (enemyPokemon: EnemyPokemon) => void): EnemyPokemon { + if (Overrides.OPP_LEVEL_OVERRIDE > 0) { + level = Overrides.OPP_LEVEL_OVERRIDE; + } if (Overrides.OPP_SPECIES_OVERRIDE) { species = getPokemonSpecies(Overrides.OPP_SPECIES_OVERRIDE); - } - - if (Overrides.OPP_LEVEL_OVERRIDE !== 0) { - level = Overrides.OPP_LEVEL_OVERRIDE; + // The fact that a Pokemon is a boss or not can change based on its Species and level + boss = this.getEncounterBossSegments(this.currentBattle.waveIndex, level, species) > 1; } const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource); @@ -854,7 +855,7 @@ export default class BattleScene extends SceneBase { overrideModifiers(this, false); overrideHeldItems(this, pokemon, false); if (boss && !dataSource) { - const secondaryIvs = Utils.getIvsFromId(Utils.randSeedInt(4294967295)); + const secondaryIvs = Utils.getIvsFromId(Utils.randSeedInt(4294967296)); for (let s = 0; s < pokemon.ivs.length; s++) { pokemon.ivs[s] = Math.round(Phaser.Math.Linear(Math.min(pokemon.ivs[s], secondaryIvs[s]), Math.max(pokemon.ivs[s], secondaryIvs[s]), 0.75)); @@ -960,6 +961,16 @@ export default class BattleScene extends SceneBase { this.offsetGym = this.gameMode.isClassic && this.getGeneratedOffsetGym(); } + /** + * Generates a random number using the current battle's seed + * + * This calls {@linkcode Battle.randSeedInt}(`scene`, {@linkcode range}, {@linkcode min}) in `src/battle.ts` + * which calls {@linkcode Utils.randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts` + * + * @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min} + * @param min The minimum integer to pick, default `0` + * @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1) + */ randBattleSeedInt(range: integer, min: integer = 0): integer { return this.currentBattle?.randSeedInt(this, range, min); } @@ -973,6 +984,7 @@ export default class BattleScene extends SceneBase { this.setSeed(Overrides.SEED_OVERRIDE || Utils.randomString(24)); console.log("Seed:", this.seed); + this.resetSeed(); // Properly resets RNG after saving and quitting a session this.disableMenu = false; @@ -1110,7 +1122,8 @@ export default class BattleScene extends SceneBase { doubleTrainer = false; } } - newTrainer = trainerData !== undefined ? trainerData.toTrainer(this) : new Trainer(this, trainerType, doubleTrainer ? TrainerVariant.DOUBLE : Utils.randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT); + const variant = doubleTrainer ? TrainerVariant.DOUBLE : (Utils.randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT); + newTrainer = trainerData !== undefined ? trainerData.toTrainer(this) : new Trainer(this, trainerType, variant); this.field.add(newTrainer); } } @@ -1327,6 +1340,13 @@ export default class BattleScene extends SceneBase { } getEncounterBossSegments(waveIndex: integer, level: integer, species?: PokemonSpecies, forceBoss: boolean = false): integer { + if (Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE > 1) { + return Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE; + } else if (Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE === 1) { + // The rest of the code expects to be returned 0 and not 1 if the enemy is not a boss + return 0; + } + if (this.gameMode.isDaily && this.gameMode.isWaveFinal(waveIndex)) { return 5; } @@ -2611,7 +2631,7 @@ export default class BattleScene extends SceneBase { if (mods.length < 1) { return mods; } - const rand = Math.floor(Utils.randSeedInt(mods.length)); + const rand = Utils.randSeedInt(mods.length); return [mods[rand], ...shuffleModifiers(mods.filter((_, i) => i !== rand))]; }; modifiers = shuffleModifiers(modifiers); @@ -2733,6 +2753,35 @@ export default class BattleScene extends SceneBase { (window as any).gameInfo = gameInfo; } + /** + * This function retrieves the sprite and audio keys for active Pokemon. + * Active Pokemon include both enemy and player Pokemon of the current wave. + * Note: Questions on garbage collection go to @frutescens + * @returns a string array of active sprite and audio keys that should not be deleted + */ + getActiveKeys(): string[] { + const keys: string[] = []; + const playerParty = this.getParty(); + playerParty.forEach(p => { + keys.push("pkmn__" + p.species.getSpriteId(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant)); + keys.push("pkmn__" + p.species.getSpriteId(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant, true)); + keys.push("cry/" + p.species.getCryKey(p.species.formIndex)); + if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) { + keys.push("cry/"+p.getFusionSpeciesForm().getCryKey(p.fusionSpecies.formIndex)); + } + }); + // enemyParty has to be operated on separately from playerParty because playerPokemon =/= enemyPokemon + const enemyParty = this.getEnemyParty(); + enemyParty.forEach(p => { + keys.push(p.species.getSpriteKey(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant)); + keys.push("cry/" + p.species.getCryKey(p.species.formIndex)); + if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) { + keys.push("cry/"+p.getFusionSpeciesForm().getCryKey(p.fusionSpecies.formIndex)); + } + }); + return keys; + } + /** * Initialized the 2nd phase of the final boss (e.g. form-change for Eternatus) * @param pokemon The (enemy) pokemon diff --git a/src/battle.ts b/src/battle.ts index f9afbf09604..b80caa9e679 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -6,7 +6,7 @@ import Trainer, { TrainerVariant } from "./field/trainer"; import { GameMode } from "./game-mode"; import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier"; import { PokeballType } from "./data/pokeball"; -import {trainerConfigs} from "#app/data/trainer-config"; +import { trainerConfigs } from "#app/data/trainer-config"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; import { Moves } from "#enums/moves"; @@ -31,7 +31,7 @@ export enum BattlerIndex { export interface TurnCommand { command: Command; - cursor?: integer; + cursor?: number; move?: QueuedMove; targets?: BattlerIndex[]; skip?: boolean; @@ -39,38 +39,40 @@ export interface TurnCommand { } interface TurnCommands { - [key: integer]: TurnCommand | null + [key: number]: TurnCommand | null } export default class Battle { protected gameMode: GameMode; - public waveIndex: integer; + public waveIndex: number; public battleType: BattleType; public battleSpec: BattleSpec; public trainer: Trainer | null; - public enemyLevels: integer[] | undefined; - public enemyParty: EnemyPokemon[]; - public seenEnemyPartyMemberIds: Set; + public enemyLevels: number[] | undefined; + public enemyParty: EnemyPokemon[] = []; + public seenEnemyPartyMemberIds: Set = new Set(); public double: boolean; - public started: boolean; - public enemySwitchCounter: integer; - public turn: integer; + public started: boolean = false; + public enemySwitchCounter: number = 0; + public turn: number = 0; public turnCommands: TurnCommands; - public playerParticipantIds: Set; - public battleScore: integer; - public postBattleLoot: PokemonHeldItemModifier[]; - public escapeAttempts: integer; + public playerParticipantIds: Set = new Set(); + public battleScore: number = 0; + public postBattleLoot: PokemonHeldItemModifier[] = []; + public escapeAttempts: number = 0; public lastMove: Moves; - public battleSeed: string; - private battleSeedState: string | null; - public moneyScattered: number; - public lastUsedPokeball: PokeballType | null; - public playerFaints: number; // The amount of times pokemon on the players side have fainted - public enemyFaints: number; // The amount of times pokemon on the enemies side have fainted + public battleSeed: string = Utils.randomString(16, true); + private battleSeedState: string | null = null; + public moneyScattered: number = 0; + public lastUsedPokeball: PokeballType | null = null; + /** The number of times a Pokemon on the player's side has fainted this battle */ + public playerFaints: number = 0; + /** The number of times a Pokemon on the enemy's side has fainted this battle */ + public enemyFaints: number = 0; - private rngCounter: integer = 0; + private rngCounter: number = 0; - constructor(gameMode: GameMode, waveIndex: integer, battleType: BattleType, trainer?: Trainer, double?: boolean) { + constructor(gameMode: GameMode, waveIndex: number, battleType: BattleType, trainer?: Trainer, double?: boolean) { this.gameMode = gameMode; this.waveIndex = waveIndex; this.battleType = battleType; @@ -79,22 +81,7 @@ export default class Battle { this.enemyLevels = battleType !== BattleType.TRAINER ? new Array(double ? 2 : 1).fill(null).map(() => this.getLevelForWave()) : trainer?.getPartyLevels(this.waveIndex); - this.enemyParty = []; - this.seenEnemyPartyMemberIds = new Set(); - this.double = !!double; - this.enemySwitchCounter = 0; - this.turn = 0; - this.playerParticipantIds = new Set(); - this.battleScore = 0; - this.postBattleLoot = []; - this.escapeAttempts = 0; - this.started = false; - this.battleSeed = Utils.randomString(16, true); - this.battleSeedState = null; - this.moneyScattered = 0; - this.lastUsedPokeball = null; - this.playerFaints = 0; - this.enemyFaints = 0; + this.double = double ?? false; } private initBattleSpec(): void { @@ -105,7 +92,7 @@ export default class Battle { this.battleSpec = spec; } - private getLevelForWave(): integer { + private getLevelForWave(): number { const levelWaveIndex = this.gameMode.getWaveForDifficulty(this.waveIndex); const baseLevel = 1 + levelWaveIndex / 2 + Math.pow(levelWaveIndex / 25, 2); const bossMultiplier = 1.2; @@ -138,7 +125,7 @@ export default class Battle { return rand / value; } - getBattlerCount(): integer { + getBattlerCount(): number { return this.double ? 2 : 1; } @@ -367,7 +354,13 @@ export default class Battle { return null; } - randSeedInt(scene: BattleScene, range: integer, min: integer = 0): integer { + /** + * Generates a random number using the current battle's seed. Calls {@linkcode Utils.randSeedInt} + * @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min} + * @param min The minimum integer to pick, default `0` + * @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1) + */ + randSeedInt(scene: BattleScene, range: number, min: number = 0): number { if (range <= 1) { return min; } @@ -392,7 +385,7 @@ export default class Battle { } export class FixedBattle extends Battle { - constructor(scene: BattleScene, waveIndex: integer, config: FixedBattleConfig) { + constructor(scene: BattleScene, waveIndex: number, config: FixedBattleConfig) { super(scene.gameMode, waveIndex, config.battleType, config.battleType === BattleType.TRAINER ? config.getTrainer(scene) : undefined, config.double); if (config.getEnemyParty) { this.enemyParty = config.getEnemyParty(scene); @@ -408,7 +401,7 @@ export class FixedBattleConfig { public double: boolean; public getTrainer: GetTrainerFunc; public getEnemyParty: GetEnemyPartyFunc; - public seedOffsetWaveIndex: integer; + public seedOffsetWaveIndex: number; setBattleType(battleType: BattleType): FixedBattleConfig { this.battleType = battleType; @@ -430,7 +423,7 @@ export class FixedBattleConfig { return this; } - setSeedOffsetWave(seedOffsetWaveIndex: integer): FixedBattleConfig { + setSeedOffsetWave(seedOffsetWaveIndex: number): FixedBattleConfig { this.seedOffsetWaveIndex = seedOffsetWaveIndex; return this; } @@ -476,7 +469,7 @@ function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[], rand } export interface FixedBattleConfigs { - [key: integer]: FixedBattleConfig + [key: number]: FixedBattleConfig } /** * Youngster/Lass on 5 diff --git a/src/data/ability.ts b/src/data/ability.ts old mode 100644 new mode 100755 index 40312eaa8be..2407460b87d --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2,7 +2,6 @@ import Pokemon, { HitResult, PlayerPokemon, PokemonMove } from "../field/pokemon import { Type } from "./type"; import { Constructor } from "#app/utils"; import * as Utils from "../utils"; -import { BattleStat, getBattleStatName } from "./battle-stat"; import { getPokemonNameWithAffix } from "../messages"; import { Weather, WeatherType } from "./weather"; import { BattlerTag, GroundedTag, GulpMissileTag, SemiInvulnerableTag } from "./battler-tags"; @@ -10,12 +9,11 @@ import { StatusEffect, getNonVolatileStatusEffects, getStatusEffectDescriptor, g import { Gender } from "./gender"; import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, MoveAttr, MultiHitAttr, ChargeAttr, SacrificialAttr, SacrificialAttrOnHit, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./move"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; -import { Stat, getStatName } from "./pokemon-stat"; import { BerryModifier, PokemonHeldItemModifier } from "../modifier/modifier"; import { TerrainType } from "./terrain"; import { SpeciesFormChangeManualTrigger, SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "./pokemon-forms"; import i18next from "i18next"; -import { Localizable } from "#app/interfaces/locales.js"; +import { Localizable } from "#app/interfaces/locales"; import { Command } from "../ui/command-ui-handler"; import { BerryModifierType } from "#app/modifier/modifier-type"; import { getPokeballName } from "./pokeball"; @@ -25,10 +23,11 @@ import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { Stat, type BattleStat, type EffectiveStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat"; import { MovePhase } from "#app/phases/move-phase"; import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; -import { StatChangePhase } from "#app/phases/stat-change-phase"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import BattleScene from "#app/battle-scene"; export class Ability implements Localizable { @@ -126,7 +125,7 @@ type AbAttrCondition = (pokemon: Pokemon) => boolean; type PokemonAttackCondition = (user: Pokemon | null, target: Pokemon | null, move: Move) => boolean; type PokemonDefendCondition = (target: Pokemon, user: Pokemon, move: Move) => boolean; -type PokemonStatChangeCondition = (target: Pokemon, statsChanged: BattleStat[], levels: integer) => boolean; +type PokemonStatStageChangeCondition = (target: Pokemon, statsChanged: BattleStat[], stages: number) => boolean; export abstract class AbAttr { public showAbility: boolean; @@ -203,38 +202,36 @@ export class PostBattleInitFormChangeAbAttr extends PostBattleInitAbAttr { } } -export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr { +export class PostBattleInitStatStageChangeAbAttr extends PostBattleInitAbAttr { private stats: BattleStat[]; - private levels: integer; + private stages: number; private selfTarget: boolean; - constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean) { + constructor(stats: BattleStat[], stages: number, selfTarget?: boolean) { super(); - this.stats = typeof(stats) === "number" - ? [ stats as BattleStat ] - : stats as BattleStat[]; - this.levels = levels; + this.stats = stats; + this.stages = stages; this.selfTarget = !!selfTarget; } applyPostBattleInit(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { - const statChangePhases: StatChangePhase[] = []; + const statStageChangePhases: StatStageChangePhase[] = []; if (!simulated) { if (this.selfTarget) { - statChangePhases.push(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels)); + statStageChangePhases.push(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); } else { for (const opponent of pokemon.getOpponents()) { - statChangePhases.push(new StatChangePhase(pokemon.scene, opponent.getBattlerIndex(), false, this.stats, this.levels)); + statStageChangePhases.push(new StatStageChangePhase(pokemon.scene, opponent.getBattlerIndex(), false, this.stats, this.stages)); } } - for (const statChangePhase of statChangePhases) { - if (!this.selfTarget && !statChangePhase.getPokemon()?.summonData) { - pokemon.scene.pushPhase(statChangePhase); + for (const statStageChangePhase of statStageChangePhases) { + if (!this.selfTarget && !statStageChangePhase.getPokemon()?.summonData) { + pokemon.scene.pushPhase(statStageChangePhase); } else { // TODO: This causes the ability bar to be shown at the wrong time - pokemon.scene.unshiftPhase(statChangePhase); + pokemon.scene.unshiftPhase(statStageChangePhase); } } } @@ -313,7 +310,7 @@ export class ReceivedMoveDamageMultiplierAbAttr extends PreDefendAbAttr { export class ReceivedTypeDamageMultiplierAbAttr extends ReceivedMoveDamageMultiplierAbAttr { constructor(moveType: Type, damageMultiplier: number) { - super((user, target, move) => move.type === moveType, damageMultiplier); + super((target, user, move) => user.getMoveType(move) === moveType, damageMultiplier); } } @@ -402,15 +399,15 @@ export class TypeImmunityHealAbAttr extends TypeImmunityAbAttr { } } -class TypeImmunityStatChangeAbAttr extends TypeImmunityAbAttr { +class TypeImmunityStatStageChangeAbAttr extends TypeImmunityAbAttr { private stat: BattleStat; - private levels: integer; + private stages: number; - constructor(immuneType: Type, stat: BattleStat, levels: integer, condition?: AbAttrCondition) { + constructor(immuneType: Type, stat: BattleStat, stages: number, condition?: AbAttrCondition) { super(immuneType, condition); this.stat = stat; - this.levels = levels; + this.stages = stages; } applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, cancelled: Utils.BooleanHolder, args: any[]): boolean { @@ -419,7 +416,7 @@ class TypeImmunityStatChangeAbAttr extends TypeImmunityAbAttr { if (ret) { cancelled.value = true; // Suppresses "No Effect" message if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.stages)); } } @@ -458,7 +455,7 @@ export class NonSuperEffectiveImmunityAbAttr extends TypeImmunityAbAttr { } applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (move instanceof AttackMove && pokemon.getAttackTypeEffectiveness(pokemon.getMoveType(move), attacker) < 2) { + if (move instanceof AttackMove && pokemon.getAttackTypeEffectiveness(attacker.getMoveType(move), attacker) < 2) { cancelled.value = true; // Suppresses "No Effect" message (args[0] as Utils.NumberHolder).value = 0; return true; @@ -559,7 +556,7 @@ export class PostDefendGulpMissileAbAttr extends PostDefendAbAttr { } if (battlerTag.tagType === BattlerTagType.GULP_MISSILE_ARROKUDA) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, attacker.getBattlerIndex(), false, [ BattleStat.DEF ], -1)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, attacker.getBattlerIndex(), false, [ Stat.DEF ], -1)); } else { attacker.trySetStatus(StatusEffect.PARALYSIS, true, pokemon); } @@ -588,8 +585,8 @@ export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr { } } -export class PostStatChangeAbAttr extends AbAttr { - applyPostStatChange(pokemon: Pokemon, simulated: boolean, statsChanged: BattleStat[], levelChanged: integer, selfTarget: boolean, args: any[]): boolean | Promise { +export class PostStatStageChangeAbAttr extends AbAttr { + applyPostStatStageChange(pokemon: Pokemon, simulated: boolean, statsChanged: BattleStat[], stagesChanged: integer, selfTarget: boolean, args: any[]): boolean | Promise { return false; } } @@ -635,20 +632,20 @@ export class WonderSkinAbAttr extends PreDefendAbAttr { } } -export class MoveImmunityStatChangeAbAttr extends MoveImmunityAbAttr { +export class MoveImmunityStatStageChangeAbAttr extends MoveImmunityAbAttr { private stat: BattleStat; - private levels: integer; + private stages: number; - constructor(immuneCondition: PreDefendAbAttrCondition, stat: BattleStat, levels: integer) { + constructor(immuneCondition: PreDefendAbAttrCondition, stat: BattleStat, stages: number) { super(immuneCondition); this.stat = stat; - this.levels = levels; + this.stages = stages; } applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, cancelled: Utils.BooleanHolder, args: any[]): boolean { const ret = super.applyPreDefend(pokemon, passive, simulated, attacker, move, cancelled, args); if (ret && !simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.stages)); } return ret; @@ -683,19 +680,19 @@ export class ReverseDrainAbAttr extends PostDefendAbAttr { } } -export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { +export class PostDefendStatStageChangeAbAttr extends PostDefendAbAttr { private condition: PokemonDefendCondition; private stat: BattleStat; - private levels: integer; + private stages: number; private selfTarget: boolean; private allOthers: boolean; - constructor(condition: PokemonDefendCondition, stat: BattleStat, levels: integer, selfTarget: boolean = true, allOthers: boolean = false) { + constructor(condition: PokemonDefendCondition, stat: BattleStat, stages: number, selfTarget: boolean = true, allOthers: boolean = false) { super(true); this.condition = condition; this.stat = stat; - this.levels = levels; + this.stages = stages; this.selfTarget = selfTarget; this.allOthers = allOthers; } @@ -709,11 +706,11 @@ export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { if (this.allOthers) { const otherPokemon = pokemon.getAlly() ? pokemon.getOpponents().concat([ pokemon.getAlly() ]) : pokemon.getOpponents(); for (const other of otherPokemon) { - other.scene.unshiftPhase(new StatChangePhase(other.scene, (other).getBattlerIndex(), false, [ this.stat ], this.levels)); + other.scene.unshiftPhase(new StatStageChangePhase(other.scene, (other).getBattlerIndex(), false, [ this.stat ], this.stages)); } return true; } - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), this.selfTarget, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), this.selfTarget, [ this.stat ], this.stages)); return true; } @@ -721,20 +718,20 @@ export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { } } -export class PostDefendHpGatedStatChangeAbAttr extends PostDefendAbAttr { +export class PostDefendHpGatedStatStageChangeAbAttr extends PostDefendAbAttr { private condition: PokemonDefendCondition; private hpGate: number; private stats: BattleStat[]; - private levels: integer; + private stages: number; private selfTarget: boolean; - constructor(condition: PokemonDefendCondition, hpGate: number, stats: BattleStat[], levels: integer, selfTarget: boolean = true) { + constructor(condition: PokemonDefendCondition, hpGate: number, stats: BattleStat[], stages: number, selfTarget: boolean = true) { super(true); this.condition = condition; this.hpGate = hpGate; this.stats = stats; - this.levels = levels; + this.stages = stages; this.selfTarget = selfTarget; } @@ -744,8 +741,8 @@ export class PostDefendHpGatedStatChangeAbAttr extends PostDefendAbAttr { const damageReceived = lastAttackReceived?.damage || 0; if (this.condition(pokemon, attacker, move) && (pokemon.hp <= hpGateFlat && (pokemon.hp + damageReceived) > hpGateFlat)) { - if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), true, this.stats, this.levels)); + if (!simulated ) { + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), true, this.stats, this.stages)); } return true; } @@ -913,20 +910,20 @@ export class PostDefendContactApplyTagChanceAbAttr extends PostDefendAbAttr { } } -export class PostDefendCritStatChangeAbAttr extends PostDefendAbAttr { +export class PostDefendCritStatStageChangeAbAttr extends PostDefendAbAttr { private stat: BattleStat; - private levels: integer; + private stages: number; - constructor(stat: BattleStat, levels: integer) { + constructor(stat: BattleStat, stages: number) { super(); this.stat = stat; - this.levels = levels; + this.stages = stages; } applyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean { if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.stages)); } return true; @@ -1088,7 +1085,7 @@ export class PostDefendMoveDisableAbAttr extends PostDefendAbAttr { } applyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean { - if (!attacker.summonData.disabledMove) { + if (attacker.getTag(BattlerTagType.DISABLED) === null) { if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance) && !attacker.isMax()) { if (simulated) { return true; @@ -1096,40 +1093,31 @@ export class PostDefendMoveDisableAbAttr extends PostDefendAbAttr { this.attacker = attacker; this.move = move; - - attacker.summonData.disabledMove = move.id; - attacker.summonData.disabledTurns = 4; + this.attacker.addTag(BattlerTagType.DISABLED, 4, 0, pokemon.id); return true; } } return false; } - - getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { - return i18next.t("abilityTriggers:postDefendMoveDisable", { - pokemonNameWithAffix: getPokemonNameWithAffix(this.attacker), - moveName: this.move.name, - }); - } } -export class PostStatChangeStatChangeAbAttr extends PostStatChangeAbAttr { - private condition: PokemonStatChangeCondition; +export class PostStatStageChangeStatStageChangeAbAttr extends PostStatStageChangeAbAttr { + private condition: PokemonStatStageChangeCondition; private statsToChange: BattleStat[]; - private levels: integer; + private stages: number; - constructor(condition: PokemonStatChangeCondition, statsToChange: BattleStat[], levels: integer) { + constructor(condition: PokemonStatStageChangeCondition, statsToChange: BattleStat[], stages: number) { super(true); this.condition = condition; this.statsToChange = statsToChange; - this.levels = levels; + this.stages = stages; } - applyPostStatChange(pokemon: Pokemon, simulated: boolean, statsChanged: BattleStat[], levelsChanged: integer, selfTarget: boolean, args: any[]): boolean { - if (this.condition(pokemon, statsChanged, levelsChanged) && !selfTarget) { + applyPostStatStageChange(pokemon: Pokemon, simulated: boolean, statStagesChanged: BattleStat[], stagesChanged: number, selfTarget: boolean, args: any[]): boolean { + if (this.condition(pokemon, statStagesChanged, stagesChanged) && !selfTarget) { if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (pokemon).getBattlerIndex(), true, this.statsToChange, this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, (pokemon).getBattlerIndex(), true, this.statsToChange, this.stages)); } return true; } @@ -1210,13 +1198,13 @@ export class FieldPreventExplosiveMovesAbAttr extends AbAttr { } /** - * Multiplies a BattleStat if the checked Pokemon lacks this ability. + * Multiplies a Stat if the checked Pokemon lacks this ability. * If this ability cannot stack, a BooleanHolder can be used to prevent this from stacking. - * @see {@link applyFieldBattleStatMultiplierAbAttrs} - * @see {@link applyFieldBattleStat} + * @see {@link applyFieldStatMultiplierAbAttrs} + * @see {@link applyFieldStat} * @see {@link Utils.BooleanHolder} */ -export class FieldMultiplyBattleStatAbAttr extends AbAttr { +export class FieldMultiplyStatAbAttr extends AbAttr { private stat: Stat; private multiplier: number; private canStack: boolean; @@ -1230,7 +1218,7 @@ export class FieldMultiplyBattleStatAbAttr extends AbAttr { } /** - * applyFieldBattleStat: Tries to multiply a Pokemon's BattleStat + * applyFieldStat: Tries to multiply a Pokemon's Stat * @param pokemon {@linkcode Pokemon} the Pokemon using this ability * @param passive {@linkcode boolean} unused * @param stat {@linkcode Stat} the type of the checked stat @@ -1240,12 +1228,12 @@ export class FieldMultiplyBattleStatAbAttr extends AbAttr { * @param args {any[]} unused * @returns true if this changed the checked stat, false otherwise. */ - applyFieldBattleStat(pokemon: Pokemon, passive: boolean, simulated: boolean, stat: Stat, statValue: Utils.NumberHolder, checkedPokemon: Pokemon, hasApplied: Utils.BooleanHolder, args: any[]): boolean { + applyFieldStat(pokemon: Pokemon, passive: boolean, simulated: boolean, stat: Stat, statValue: Utils.NumberHolder, checkedPokemon: Pokemon, hasApplied: Utils.BooleanHolder, args: any[]): boolean { if (!this.canStack && hasApplied.value) { return false; } - if (this.stat === stat && checkedPokemon.getAbilityAttrs(FieldMultiplyBattleStatAbAttr).every(attr => (attr as FieldMultiplyBattleStatAbAttr).stat !== stat)) { + if (this.stat === stat && checkedPokemon.getAbilityAttrs(FieldMultiplyStatAbAttr).every(attr => (attr as FieldMultiplyStatAbAttr).stat !== stat)) { statValue.value *= this.multiplier; hasApplied.value = true; return true; @@ -1465,7 +1453,7 @@ export class MovePowerBoostAbAttr extends VariableMovePowerAbAttr { export class MoveTypePowerBoostAbAttr extends MovePowerBoostAbAttr { constructor(boostedType: Type, powerMultiplier?: number) { - super((pokemon, defender, move) => move.type === boostedType, powerMultiplier || 1.5); + super((pokemon, defender, move) => pokemon?.getMoveType(move) === boostedType, powerMultiplier || 1.5); } } @@ -1549,7 +1537,7 @@ export class PreAttackFieldMoveTypePowerBoostAbAttr extends FieldMovePowerBoostA * @param powerMultiplier - The multiplier to apply to the move's power, defaults to 1.5 if not provided. */ constructor(boostedType: Type, powerMultiplier?: number) { - super((pokemon, defender, move) => move.type === boostedType, powerMultiplier || 1.5); + super((pokemon, defender, move) => pokemon?.getMoveType(move) === boostedType, powerMultiplier || 1.5); } } @@ -1579,22 +1567,22 @@ export class AllyMoveCategoryPowerBoostAbAttr extends FieldMovePowerBoostAbAttr } } -export class BattleStatMultiplierAbAttr extends AbAttr { - private battleStat: BattleStat; +export class StatMultiplierAbAttr extends AbAttr { + private stat: BattleStat; private multiplier: number; private condition: PokemonAttackCondition | null; - constructor(battleStat: BattleStat, multiplier: number, condition?: PokemonAttackCondition) { + constructor(stat: BattleStat, multiplier: number, condition?: PokemonAttackCondition) { super(false); - this.battleStat = battleStat; + this.stat = stat; this.multiplier = multiplier; this.condition = condition ?? null; } - applyBattleStat(pokemon: Pokemon, passive: boolean, simulated: boolean, battleStat: BattleStat, statValue: Utils.NumberHolder, args: any[]): boolean | Promise { + applyStatStage(pokemon: Pokemon, _passive: boolean, simulated: boolean, stat: BattleStat, statValue: Utils.NumberHolder, args: any[]): boolean | Promise { const move = (args[0] as Move); - if (battleStat === this.battleStat && (!this.condition || this.condition(pokemon, null, move))) { + if (stat === this.stat && (!this.condition || this.condition(pokemon, null, move))) { statValue.value *= this.multiplier; return true; } @@ -1765,15 +1753,15 @@ export class PostVictoryAbAttr extends AbAttr { } } -class PostVictoryStatChangeAbAttr extends PostVictoryAbAttr { +class PostVictoryStatStageChangeAbAttr extends PostVictoryAbAttr { private stat: BattleStat | ((p: Pokemon) => BattleStat); - private levels: integer; + private stages: number; - constructor(stat: BattleStat | ((p: Pokemon) => BattleStat), levels: integer) { + constructor(stat: BattleStat | ((p: Pokemon) => BattleStat), stages: number) { super(); this.stat = stat; - this.levels = levels; + this.stages = stages; } applyPostVictory(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean | Promise { @@ -1781,7 +1769,7 @@ class PostVictoryStatChangeAbAttr extends PostVictoryAbAttr { ? this.stat(pokemon) : this.stat; if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.stages)); } return true; } @@ -1815,15 +1803,15 @@ export class PostKnockOutAbAttr extends AbAttr { } } -export class PostKnockOutStatChangeAbAttr extends PostKnockOutAbAttr { +export class PostKnockOutStatStageChangeAbAttr extends PostKnockOutAbAttr { private stat: BattleStat | ((p: Pokemon) => BattleStat); - private levels: integer; + private stages: number; - constructor(stat: BattleStat | ((p: Pokemon) => BattleStat), levels: integer) { + constructor(stat: BattleStat | ((p: Pokemon) => BattleStat), stages: number) { super(); this.stat = stat; - this.levels = levels; + this.stages = stages; } applyPostKnockOut(pokemon: Pokemon, passive: boolean, simulated: boolean, knockedOut: Pokemon, args: any[]): boolean | Promise { @@ -1831,7 +1819,7 @@ export class PostKnockOutStatChangeAbAttr extends PostKnockOutAbAttr { ? this.stat(pokemon) : this.stat; if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.stages)); } return true; } @@ -1855,37 +1843,21 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr { } } -export class IgnoreOpponentStatChangesAbAttr extends AbAttr { - constructor() { +export class IgnoreOpponentStatStagesAbAttr extends AbAttr { + private stats: readonly BattleStat[]; + + constructor(stats?: BattleStat[]) { super(false); + + this.stats = stats ?? BATTLE_STATS; } - apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]) { - (args[0] as Utils.IntegerHolder).value = 0; - - return true; - } -} -/** - * Ignores opponent's evasion stat changes when determining if a move hits or not - * @extends AbAttr - * @see {@linkcode apply} - */ -export class IgnoreOpponentEvasionAbAttr extends AbAttr { - constructor() { - super(false); - } - /** - * Checks if enemy Pokemon is trapped by an Arena Trap-esque ability - * @param pokemon N/A - * @param passive N/A - * @param cancelled N/A - * @param args [0] {@linkcode Utils.IntegerHolder} of BattleStat.EVA - * @returns if evasion level was successfully considered as 0 - */ - apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]) { - (args[0] as Utils.IntegerHolder).value = 0; - return true; + apply(_pokemon: Pokemon, _passive: boolean, simulated: boolean, _cancelled: Utils.BooleanHolder, args: any[]) { + if (this.stats.includes(args[0])) { + (args[1] as Utils.BooleanHolder).value = true; + return true; + } + return false; } } @@ -1907,21 +1879,21 @@ export class IntimidateImmunityAbAttr extends AbAttr { } } -export class PostIntimidateStatChangeAbAttr extends AbAttr { +export class PostIntimidateStatStageChangeAbAttr extends AbAttr { private stats: BattleStat[]; - private levels: integer; + private stages: number; private overwrites: boolean; - constructor(stats: BattleStat[], levels: integer, overwrites?: boolean) { + constructor(stats: BattleStat[], stages: number, overwrites?: boolean) { super(true); this.stats = stats; - this.levels = levels; + this.stages = stages; this.overwrites = !!overwrites; } - apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { + apply(pokemon: Pokemon, passive: boolean, simulated:boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (!simulated) { - pokemon.scene.pushPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, this.levels)); + pokemon.scene.pushPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, this.stages)); } cancelled.value = this.overwrites; return true; @@ -2026,19 +1998,17 @@ export class PostSummonAddBattlerTagAbAttr extends PostSummonAbAttr { } } -export class PostSummonStatChangeAbAttr extends PostSummonAbAttr { +export class PostSummonStatStageChangeAbAttr extends PostSummonAbAttr { private stats: BattleStat[]; - private levels: integer; + private stages: number; private selfTarget: boolean; private intimidate: boolean; - constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean, intimidate?: boolean) { + constructor(stats: BattleStat[], stages: number, selfTarget?: boolean, intimidate?: boolean) { super(false); - this.stats = typeof(stats) === "number" - ? [ stats as BattleStat ] - : stats as BattleStat[]; - this.levels = levels; + this.stats = stats; + this.stages = stages; this.selfTarget = !!selfTarget; this.intimidate = !!intimidate; } @@ -2050,20 +2020,19 @@ export class PostSummonStatChangeAbAttr extends PostSummonAbAttr { queueShowAbility(pokemon, passive); // TODO: Better solution than manually showing the ability here if (this.selfTarget) { - // we unshift the StatChangePhase to put it right after the showAbility and not at the end of the + // we unshift the StatStageChangePhase to put it right after the showAbility and not at the end of the // phase list (which could be after CommandPhase for example) - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); return true; } for (const opponent of pokemon.getOpponents()) { const cancelled = new Utils.BooleanHolder(false); if (this.intimidate) { applyAbAttrs(IntimidateImmunityAbAttr, opponent, cancelled, simulated); - applyAbAttrs(PostIntimidateStatChangeAbAttr, opponent, cancelled, simulated); + applyAbAttrs(PostIntimidateStatStageChangeAbAttr, opponent, cancelled, simulated); } if (!cancelled.value) { - const statChangePhase = new StatChangePhase(pokemon.scene, opponent.getBattlerIndex(), false, this.stats, this.levels); - pokemon.scene.unshiftPhase(statChangePhase); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, opponent.getBattlerIndex(), false, this.stats, this.stages)); } } return true; @@ -2104,7 +2073,7 @@ export class PostSummonAllyHealAbAttr extends PostSummonAbAttr { * @param args N/A * @returns if the move was successful */ -export class PostSummonClearAllyStatsAbAttr extends PostSummonAbAttr { +export class PostSummonClearAllyStatStagesAbAttr extends PostSummonAbAttr { constructor() { super(); } @@ -2113,8 +2082,8 @@ export class PostSummonClearAllyStatsAbAttr extends PostSummonAbAttr { const target = pokemon.getAlly(); if (target?.isActive(true)) { if (!simulated) { - for (let s = 0; s < target.summonData.battleStats.length; s++) { - target.summonData.battleStats[s] = 0; + for (const s of BATTLE_STATS) { + target.setStatStage(s, 0); } target.scene.queueMessage(i18next.t("abilityTriggers:postSummonClearAllyStats", { pokemonNameWithAffix: getPokemonNameWithAffix(target) })); @@ -2143,7 +2112,7 @@ export class DownloadAbAttr extends PostSummonAbAttr { // TODO: Implement the Substitute feature(s) once move is implemented. /** * Checks to see if it is the opening turn (starting a new game), if so, Download won't work. This is because Download takes into account - * vitamins and items, so it needs to use the BattleStat and the stat alone. + * vitamins and items, so it needs to use the Stat and the stat alone. * @param {Pokemon} pokemon Pokemon that is using the move, as well as seeing the opposing pokemon. * @param {boolean} passive N/A * @param {any[]} args N/A @@ -2156,21 +2125,21 @@ export class DownloadAbAttr extends PostSummonAbAttr { for (const opponent of pokemon.getOpponents()) { this.enemyCountTally++; - this.enemyDef += opponent.getBattleStat(Stat.DEF); - this.enemySpDef += opponent.getBattleStat(Stat.SPDEF); + this.enemyDef += opponent.getEffectiveStat(Stat.DEF); + this.enemySpDef += opponent.getEffectiveStat(Stat.SPDEF); } this.enemyDef = Math.round(this.enemyDef / this.enemyCountTally); this.enemySpDef = Math.round(this.enemySpDef / this.enemyCountTally); if (this.enemyDef < this.enemySpDef) { - this.stats = [BattleStat.ATK]; + this.stats = [ Stat.ATK ]; } else { - this.stats = [BattleStat.SPATK]; + this.stats = [ Stat.SPATK ]; } if (this.enemyDef > 0 && this.enemySpDef > 0) { // only activate if there's actually an enemy to download from if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1)); } return true; } @@ -2339,12 +2308,14 @@ export class PostSummonCopyAllyStatsAbAttr extends PostSummonAbAttr { } const ally = pokemon.getAlly(); - if (!ally || ally.summonData.battleStats.every((change) => change === 0)) { + if (!ally || ally.getStatStages().every(s => s === 0)) { return false; } if (!simulated) { - pokemon.summonData.battleStats = ally.summonData.battleStats; + for (const s of BATTLE_STATS) { + pokemon.setStatStage(s, ally.getStatStage(s)); + } pokemon.updateInfo(); } @@ -2383,14 +2354,27 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr { pokemon.summonData.ability = target.getAbility().id; pokemon.summonData.gender = target.getGender(); pokemon.summonData.fusionGender = target.getFusionGender(); - pokemon.summonData.stats = [ pokemon.stats[Stat.HP] ].concat(target.stats.slice(1)); - pokemon.summonData.battleStats = target.summonData.battleStats.slice(0); + + // Copy all stats (except HP) + for (const s of EFFECTIVE_STATS) { + pokemon.setStat(s, target.getStat(s, false), false); + } + + // Copy all stat stages + for (const s of BATTLE_STATS) { + pokemon.setStatStage(s, target.getStatStage(s)); + } + pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m!.moveId, m!.ppUsed, m!.ppUp)); // TODO: are those bangs correct? pokemon.summonData.types = target.getTypes(); + pokemon.scene.playSound("battle_anims/PRSFX- Transform"); - pokemon.loadAssets(false).then(() => pokemon.playAnim()); + pokemon.loadAssets(false).then(() => { + pokemon.playAnim(); + pokemon.updateInfo(); + }); pokemon.scene.queueMessage(i18next.t("abilityTriggers:postSummonTransform", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), targetName: target.name, })); @@ -2594,13 +2578,13 @@ export class PreSwitchOutFormChangeAbAttr extends PreSwitchOutAbAttr { } -export class PreStatChangeAbAttr extends AbAttr { - applyPreStatChange(pokemon: Pokemon | null, passive: boolean, simulated: boolean, stat: BattleStat, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise { +export class PreStatStageChangeAbAttr extends AbAttr { + applyPreStatStageChange(pokemon: Pokemon | null, passive: boolean, simulated: boolean, stat: BattleStat, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise { return false; } } -export class ProtectStatAbAttr extends PreStatChangeAbAttr { +export class ProtectStatAbAttr extends PreStatStageChangeAbAttr { private protectedStat?: BattleStat; constructor(protectedStat?: BattleStat) { @@ -2609,7 +2593,7 @@ export class ProtectStatAbAttr extends PreStatChangeAbAttr { this.protectedStat = protectedStat; } - applyPreStatChange(pokemon: Pokemon, passive: boolean, simulated: boolean, stat: BattleStat, cancelled: Utils.BooleanHolder, args: any[]): boolean { + applyPreStatStageChange(_pokemon: Pokemon, _passive: boolean, simulated: boolean, stat: BattleStat, cancelled: Utils.BooleanHolder, _args: any[]): boolean { if (Utils.isNullOrUndefined(this.protectedStat) || stat === this.protectedStat) { cancelled.value = true; return true; @@ -2618,11 +2602,11 @@ export class ProtectStatAbAttr extends PreStatChangeAbAttr { return false; } - getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { + getTriggerMessage(pokemon: Pokemon, abilityName: string, ..._args: any[]): string { return i18next.t("abilityTriggers:protectStat", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), abilityName, - statName: this.protectedStat ? getBattleStatName(this.protectedStat) : i18next.t("battle:stats") + statName: this.protectedStat ? i18next.t(getStatKey(this.protectedStat)) : i18next.t("battle:stats") }); } } @@ -2658,7 +2642,7 @@ export class ConfusionOnStatusEffectAbAttr extends PostAttackAbAttr { if (simulated) { return defender.canAddTag(BattlerTagType.CONFUSED); } else { - return defender.addTag(BattlerTagType.CONFUSED, pokemon.randSeedInt(3, 2), move.id, defender.id); + return defender.addTag(BattlerTagType.CONFUSED, pokemon.randSeedIntRange(2, 5), move.id, defender.id); } } return false; @@ -3465,51 +3449,53 @@ export class MoodyAbAttr extends PostTurnAbAttr { super(true); } /** - * Randomly increases one BattleStat by 2 stages and decreases a different BattleStat by 1 stage + * Randomly increases one stat stage by 2 and decreases a different stat stage by 1 * @param {Pokemon} pokemon Pokemon that has this ability * @param passive N/A * @param simulated true if applying in a simulated call. * @param args N/A * @returns true * - * Any BattleStats at +6 or -6 are excluded from being increased or decreased, respectively - * If the pokemon already has all BattleStats raised to stage 6, it will only decrease one BattleStat by 1 stage - * If the pokemon already has all BattleStats lowered to stage -6, it will only increase one BattleStat by 2 stages + * Any stat stages at +6 or -6 are excluded from being increased or decreased, respectively + * If the pokemon already has all stat stages raised to 6, it will only decrease one stat stage by 1 + * If the pokemon already has all stat stages lowered to -6, it will only increase one stat stage by 2 */ applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { - const selectableStats = [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD]; - const increaseStatArray = selectableStats.filter(s => pokemon.summonData.battleStats[s] < 6); - let decreaseStatArray = selectableStats.filter(s => pokemon.summonData.battleStats[s] > -6); + const canRaise = EFFECTIVE_STATS.filter(s => pokemon.getStatStage(s) < 6); + let canLower = EFFECTIVE_STATS.filter(s => pokemon.getStatStage(s) > -6); - if (!simulated && increaseStatArray.length > 0) { - const increaseStat = increaseStatArray[Utils.randInt(increaseStatArray.length)]; - decreaseStatArray = decreaseStatArray.filter(s => s !== increaseStat); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [increaseStat], 2)); - } - if (!simulated && decreaseStatArray.length > 0) { - const decreaseStat = decreaseStatArray[Utils.randInt(decreaseStatArray.length)]; - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [decreaseStat], -1)); + if (!simulated) { + if (canRaise.length > 0) { + const raisedStat = canRaise[pokemon.randSeedInt(canRaise.length)]; + canLower = canRaise.filter(s => s !== raisedStat); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ raisedStat ], 2)); + } + if (canLower.length > 0) { + const loweredStat = canLower[pokemon.randSeedInt(canLower.length)]; + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ loweredStat ], -1)); + } } + return true; } } -export class PostTurnStatChangeAbAttr extends PostTurnAbAttr { +export class PostTurnStatStageChangeAbAttr extends PostTurnAbAttr { private stats: BattleStat[]; - private levels: integer; + private stages: number; - constructor(stats: BattleStat | BattleStat[], levels: integer) { + constructor(stats: BattleStat[], stages: number) { super(true); this.stats = Array.isArray(stats) ? stats : [ stats ]; - this.levels = levels; + this.stages = stages; } applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); } return true; } @@ -3721,7 +3707,7 @@ export class PostDancingMoveAbAttr extends PostMoveUsedAbAttr { } } -export class StatChangeMultiplierAbAttr extends AbAttr { +export class StatStageChangeMultiplierAbAttr extends AbAttr { private multiplier: integer; constructor(multiplier: integer) { @@ -3737,10 +3723,10 @@ export class StatChangeMultiplierAbAttr extends AbAttr { } } -export class StatChangeCopyAbAttr extends AbAttr { +export class StatStageChangeCopyAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise { if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as integer), true, false, false)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as number), true, false, false)); } return true; } @@ -4140,22 +4126,22 @@ export class FlinchEffectAbAttr extends AbAttr { } } -export class FlinchStatChangeAbAttr extends FlinchEffectAbAttr { +export class FlinchStatStageChangeAbAttr extends FlinchEffectAbAttr { private stats: BattleStat[]; - private levels: integer; + private stages: number; - constructor(stats: BattleStat | BattleStat[], levels: integer) { + constructor(stats: BattleStat[], stages: number) { super(); this.stats = Array.isArray(stats) ? stats : [ stats ]; - this.levels = levels; + this.stages = stages; } apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (!simulated) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages)); } return true; } @@ -4355,9 +4341,9 @@ export class MoneyAbAttr extends PostBattleAbAttr { * Applies a stat change after a Pokémon is summoned, * conditioned on the presence of a specific arena tag. * - * @extends {PostSummonStatChangeAbAttr} + * @extends {PostSummonStatStageChangeAbAttr} */ -export class PostSummonStatChangeOnArenaAbAttr extends PostSummonStatChangeAbAttr { +export class PostSummonStatStageChangeOnArenaAbAttr extends PostSummonStatStageChangeAbAttr { /** * The type of arena tag that conditions the stat change. * @private @@ -4366,13 +4352,13 @@ export class PostSummonStatChangeOnArenaAbAttr extends PostSummonStatChangeAbAtt private tagType: ArenaTagType; /** - * Creates an instance of PostSummonStatChangeOnArenaAbAttr. + * Creates an instance of PostSummonStatStageChangeOnArenaAbAttr. * Initializes the stat change to increase Attack by 1 stage if the specified arena tag is present. * * @param {ArenaTagType} tagType - The type of arena tag to check for. */ constructor(tagType: ArenaTagType) { - super([BattleStat.ATK], 1, true, false); + super([ Stat.ATK ], 1, true, false); this.tagType = tagType; } @@ -4619,14 +4605,14 @@ export function applyPostMoveUsedAbAttrs(attrType: Constructor(attrType, pokemon, (attr, passive) => attr.applyPostMoveUsed(pokemon, move, source, targets, simulated, args), args, false, simulated); } -export function applyBattleStatMultiplierAbAttrs(attrType: Constructor, - pokemon: Pokemon, battleStat: BattleStat, statValue: Utils.NumberHolder, simulated: boolean = false, ...args: any[]): Promise { - return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyBattleStat(pokemon, passive, simulated, battleStat, statValue, args), args, false, simulated); +export function applyStatMultiplierAbAttrs(attrType: Constructor, + pokemon: Pokemon, stat: BattleStat, statValue: Utils.NumberHolder, simulated: boolean = false, ...args: any[]): Promise { + return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyStatStage(pokemon, passive, simulated, stat, statValue, args), args); } /** - * Applies a field Battle Stat multiplier attribute - * @param attrType {@linkcode FieldMultiplyBattleStatAbAttr} should always be FieldMultiplyBattleStatAbAttr for the time being + * Applies a field Stat multiplier attribute + * @param attrType {@linkcode FieldMultiplyStatAbAttr} should always be FieldMultiplyBattleStatAbAttr for the time being * @param pokemon {@linkcode Pokemon} the Pokemon applying this ability * @param stat {@linkcode Stat} the type of the checked stat * @param statValue {@linkcode Utils.NumberHolder} the value of the checked stat @@ -4634,9 +4620,9 @@ export function applyBattleStatMultiplierAbAttrs(attrType: Constructor, +export function applyFieldStatMultiplierAbAttrs(attrType: Constructor, pokemon: Pokemon, stat: Stat, statValue: Utils.NumberHolder, checkedPokemon: Pokemon, hasApplied: Utils.BooleanHolder, simulated: boolean = false, ...args: any[]): Promise { - return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyFieldBattleStat(pokemon, passive, simulated, stat, statValue, checkedPokemon, hasApplied, args), args, false, simulated); + return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyFieldStat(pokemon, passive, simulated, stat, statValue, checkedPokemon, hasApplied, args), args); } export function applyPreAttackAbAttrs(attrType: Constructor, @@ -4669,14 +4655,14 @@ export function applyPreSwitchOutAbAttrs(attrType: Constructor(attrType, pokemon, (attr, passive) => attr.applyPreSwitchOut(pokemon, passive, simulated, args), args, true, simulated); } -export function applyPreStatChangeAbAttrs(attrType: Constructor, +export function applyPreStatStageChangeAbAttrs(attrType: Constructor, pokemon: Pokemon | null, stat: BattleStat, cancelled: Utils.BooleanHolder, simulated: boolean = false, ...args: any[]): Promise { - return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyPreStatChange(pokemon, passive, simulated, stat, cancelled, args), args, false, simulated); + return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyPreStatStageChange(pokemon, passive, simulated, stat, cancelled, args), args, false, simulated); } -export function applyPostStatChangeAbAttrs(attrType: Constructor, - pokemon: Pokemon, stats: BattleStat[], levels: integer, selfTarget: boolean, simulated: boolean = false, ...args: any[]): Promise { - return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyPostStatChange(pokemon, simulated, stats, levels, selfTarget, args), args, false, simulated); +export function applyPostStatStageChangeAbAttrs(attrType: Constructor, + pokemon: Pokemon, stats: BattleStat[], stages: integer, selfTarget: boolean, simulated: boolean = false, ...args: any[]): Promise { + return applyAbAttrsInternal(attrType, pokemon, (attr, _passive) => attr.applyPostStatStageChange(pokemon, simulated, stats, stages, selfTarget, args), args, false, simulated); } export function applyPreSetStatusAbAttrs(attrType: Constructor, @@ -4766,7 +4752,7 @@ export function initAbilities() { .attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN), new Ability(Abilities.SPEED_BOOST, 3) - .attr(PostTurnStatChangeAbAttr, BattleStat.SPD, 1), + .attr(PostTurnStatStageChangeAbAttr, [ Stat.SPD ], 1), new Ability(Abilities.BATTLE_ARMOR, 3) .attr(BlockCritAbAttr) .ignorable(), @@ -4781,7 +4767,7 @@ export function initAbilities() { .attr(StatusEffectImmunityAbAttr, StatusEffect.PARALYSIS) .ignorable(), new Ability(Abilities.SAND_VEIL, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.EVA, 1.2) + .attr(StatMultiplierAbAttr, Stat.EVA, 1.2) .attr(BlockWeatherDamageAttr, WeatherType.SANDSTORM) .condition(getWeatherCondition(WeatherType.SANDSTORM)) .ignorable(), @@ -4807,7 +4793,7 @@ export function initAbilities() { .attr(PostFaintUnsuppressedWeatherFormChangeAbAttr) .bypassFaint(), new Ability(Abilities.COMPOUND_EYES, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 1.3), + .attr(StatMultiplierAbAttr, Stat.ACC, 1.3), new Ability(Abilities.INSOMNIA, 3) .attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP) .attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) @@ -4832,7 +4818,7 @@ export function initAbilities() { .attr(ForceSwitchOutImmunityAbAttr) .ignorable(), new Ability(Abilities.INTIMIDATE, 3) - .attr(PostSummonStatChangeAbAttr, BattleStat.ATK, -1, false, true), + .attr(PostSummonStatStageChangeAbAttr, [ Stat.ATK ], -1, false, true), new Ability(Abilities.SHADOW_TAG, 3) .attr(ArenaTrapAbAttr, (user, target) => { if (target.hasAbility(Abilities.SHADOW_TAG)) { @@ -4863,26 +4849,26 @@ export function initAbilities() { .attr(PreSwitchOutResetStatusAbAttr), new Ability(Abilities.LIGHTNING_ROD, 3) .attr(RedirectTypeMoveAbAttr, Type.ELECTRIC) - .attr(TypeImmunityStatChangeAbAttr, Type.ELECTRIC, BattleStat.SPATK, 1) + .attr(TypeImmunityStatStageChangeAbAttr, Type.ELECTRIC, Stat.SPATK, 1) .ignorable(), new Ability(Abilities.SERENE_GRACE, 3) .attr(MoveEffectChanceMultiplierAbAttr, 2) .partial(), new Ability(Abilities.SWIFT_SWIM, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.SPD, 2) + .attr(StatMultiplierAbAttr, Stat.SPD, 2) .condition(getWeatherCondition(WeatherType.RAIN, WeatherType.HEAVY_RAIN)), new Ability(Abilities.CHLOROPHYLL, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.SPD, 2) + .attr(StatMultiplierAbAttr, Stat.SPD, 2) .condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)), new Ability(Abilities.ILLUMINATE, 3) - .attr(ProtectStatAbAttr, BattleStat.ACC) + .attr(ProtectStatAbAttr, Stat.ACC) .attr(DoubleBattleChanceAbAttr) .ignorable(), new Ability(Abilities.TRACE, 3) .attr(PostSummonCopyAbilityAbAttr) .attr(UncopiableAbilityAbAttr), new Ability(Abilities.HUGE_POWER, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.ATK, 2), + .attr(StatMultiplierAbAttr, Stat.ATK, 2), new Ability(Abilities.POISON_POINT, 3) .attr(PostDefendContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON) .bypassFaint(), @@ -4927,25 +4913,25 @@ export function initAbilities() { new Ability(Abilities.RUN_AWAY, 3) .attr(RunSuccessAbAttr), new Ability(Abilities.KEEN_EYE, 3) - .attr(ProtectStatAbAttr, BattleStat.ACC) + .attr(ProtectStatAbAttr, Stat.ACC) .ignorable(), new Ability(Abilities.HYPER_CUTTER, 3) - .attr(ProtectStatAbAttr, BattleStat.ATK) + .attr(ProtectStatAbAttr, Stat.ATK) .ignorable(), new Ability(Abilities.PICKUP, 3) .attr(PostBattleLootAbAttr), new Ability(Abilities.TRUANT, 3) .attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.TRUANT, 1, false), new Ability(Abilities.HUSTLE, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.ATK, 1.5) - .attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 0.8, (user, target, move) => move.category === MoveCategory.PHYSICAL), + .attr(StatMultiplierAbAttr, Stat.ATK, 1.5) + .attr(StatMultiplierAbAttr, Stat.ACC, 0.8, (_user, _target, move) => move.category === MoveCategory.PHYSICAL), new Ability(Abilities.CUTE_CHARM, 3) .attr(PostDefendContactApplyTagChanceAbAttr, 30, BattlerTagType.INFATUATED), new Ability(Abilities.PLUS, 3) - .conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), BattleStatMultiplierAbAttr, BattleStat.SPATK, 1.5) + .conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), StatMultiplierAbAttr, Stat.SPATK, 1.5) .ignorable(), new Ability(Abilities.MINUS, 3) - .conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), BattleStatMultiplierAbAttr, BattleStat.SPATK, 1.5) + .conditionalAttr(p => p.scene.currentBattle.double && [Abilities.PLUS, Abilities.MINUS].some(a => p.getAlly().hasAbility(a)), StatMultiplierAbAttr, Stat.SPATK, 1.5) .ignorable(), new Ability(Abilities.FORECAST, 3) .attr(UncopiableAbilityAbAttr) @@ -4960,9 +4946,9 @@ export function initAbilities() { .conditionalAttr(pokemon => !Utils.randSeedInt(3), PostTurnResetStatusAbAttr), new Ability(Abilities.GUTS, 3) .attr(BypassBurnDamageReductionAbAttr) - .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), BattleStatMultiplierAbAttr, BattleStat.ATK, 1.5), + .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatMultiplierAbAttr, Stat.ATK, 1.5), new Ability(Abilities.MARVEL_SCALE, 3) - .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), BattleStatMultiplierAbAttr, BattleStat.DEF, 1.5) + .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatMultiplierAbAttr, Stat.DEF, 1.5) .ignorable(), new Ability(Abilities.LIQUID_OOZE, 3) .attr(ReverseDrainAbAttr), @@ -4995,7 +4981,7 @@ export function initAbilities() { .attr(ProtectStatAbAttr) .ignorable(), new Ability(Abilities.PURE_POWER, 3) - .attr(BattleStatMultiplierAbAttr, BattleStat.ATK, 2), + .attr(StatMultiplierAbAttr, Stat.ATK, 2), new Ability(Abilities.SHELL_ARMOR, 3) .attr(BlockCritAbAttr) .ignorable(), @@ -5006,25 +4992,25 @@ export function initAbilities() { .attr(PostFaintUnsuppressedWeatherFormChangeAbAttr) .bypassFaint(), new Ability(Abilities.TANGLED_FEET, 4) - .conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), BattleStatMultiplierAbAttr, BattleStat.EVA, 2) + .conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), StatMultiplierAbAttr, Stat.EVA, 2) .ignorable(), new Ability(Abilities.MOTOR_DRIVE, 4) - .attr(TypeImmunityStatChangeAbAttr, Type.ELECTRIC, BattleStat.SPD, 1) + .attr(TypeImmunityStatStageChangeAbAttr, Type.ELECTRIC, Stat.SPD, 1) .ignorable(), new Ability(Abilities.RIVALRY, 4) .attr(MovePowerBoostAbAttr, (user, target, move) => user?.gender !== Gender.GENDERLESS && target?.gender !== Gender.GENDERLESS && user?.gender === target?.gender, 1.25, true) .attr(MovePowerBoostAbAttr, (user, target, move) => user?.gender !== Gender.GENDERLESS && target?.gender !== Gender.GENDERLESS && user?.gender !== target?.gender, 0.75), new Ability(Abilities.STEADFAST, 4) - .attr(FlinchStatChangeAbAttr, BattleStat.SPD, 1), + .attr(FlinchStatStageChangeAbAttr, [ Stat.SPD ], 1), new Ability(Abilities.SNOW_CLOAK, 4) - .attr(BattleStatMultiplierAbAttr, BattleStat.EVA, 1.2) + .attr(StatMultiplierAbAttr, Stat.EVA, 1.2) .attr(BlockWeatherDamageAttr, WeatherType.HAIL) .condition(getWeatherCondition(WeatherType.HAIL, WeatherType.SNOW)) .ignorable(), new Ability(Abilities.GLUTTONY, 4) .attr(ReduceBerryUseThresholdAbAttr), new Ability(Abilities.ANGER_POINT, 4) - .attr(PostDefendCritStatChangeAbAttr, BattleStat.ATK, 6), + .attr(PostDefendCritStatStageChangeAbAttr, Stat.ATK, 6), new Ability(Abilities.UNBURDEN, 4) .unimplemented(), new Ability(Abilities.HEATPROOF, 4) @@ -5032,7 +5018,7 @@ export function initAbilities() { .attr(ReduceBurnDamageAbAttr, 0.5) .ignorable(), new Ability(Abilities.SIMPLE, 4) - .attr(StatChangeMultiplierAbAttr, 2) + .attr(StatStageChangeMultiplierAbAttr, 2) .ignorable(), new Ability(Abilities.DRY_SKIN, 4) .attr(PostWeatherLapseDamageAbAttr, 2, WeatherType.SUNNY, WeatherType.HARSH_SUN) @@ -5057,11 +5043,11 @@ export function initAbilities() { .condition(getWeatherCondition(WeatherType.RAIN, WeatherType.HEAVY_RAIN)), new Ability(Abilities.SOLAR_POWER, 4) .attr(PostWeatherLapseDamageAbAttr, 2, WeatherType.SUNNY, WeatherType.HARSH_SUN) - .attr(BattleStatMultiplierAbAttr, BattleStat.SPATK, 1.5) + .attr(StatMultiplierAbAttr, Stat.SPATK, 1.5) .condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)), new Ability(Abilities.QUICK_FEET, 4) - .conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, BattleStatMultiplierAbAttr, BattleStat.SPD, 2) - .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5), + .conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, StatMultiplierAbAttr, Stat.SPD, 2) + .conditionalAttr(pokemon => !!pokemon.status || pokemon.hasAbility(Abilities.COMATOSE), StatMultiplierAbAttr, Stat.SPD, 1.5), new Ability(Abilities.NORMALIZE, 4) .attr(MoveTypeChangeAbAttr, Type.NORMAL, 1.2, (user, target, move) => { return ![Moves.HIDDEN_POWER, Moves.WEATHER_BALL, Moves.NATURAL_GIFT, Moves.JUDGMENT, Moves.TECHNO_BLAST].includes(move.id); @@ -5101,13 +5087,13 @@ export function initAbilities() { new Ability(Abilities.FOREWARN, 4) .attr(ForewarnAbAttr), new Ability(Abilities.UNAWARE, 4) - .attr(IgnoreOpponentStatChangesAbAttr) + .attr(IgnoreOpponentStatStagesAbAttr) .ignorable(), new Ability(Abilities.TINTED_LENS, 4) //@ts-ignore - .attr(DamageBoostAbAttr, 2, (user, target, move) => target.getAttackTypeEffectiveness(move.type, user) <= 0.5), // TODO: fix TS issues + .attr(DamageBoostAbAttr, 2, (user, target, move) => target?.getMoveEffectiveness(user, move) <= 0.5), // TODO: fix TS issues new Ability(Abilities.FILTER, 4) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getMoveEffectiveness(user, move) >= 2, 0.75) .ignorable(), new Ability(Abilities.SLOW_START, 4) .attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.SLOW_START, 5), @@ -5116,14 +5102,14 @@ export function initAbilities() { .attr(IntimidateImmunityAbAttr), new Ability(Abilities.STORM_DRAIN, 4) .attr(RedirectTypeMoveAbAttr, Type.WATER) - .attr(TypeImmunityStatChangeAbAttr, Type.WATER, BattleStat.SPATK, 1) + .attr(TypeImmunityStatStageChangeAbAttr, Type.WATER, Stat.SPATK, 1) .ignorable(), new Ability(Abilities.ICE_BODY, 4) .attr(BlockWeatherDamageAttr, WeatherType.HAIL) .attr(PostWeatherLapseHealAbAttr, 1, WeatherType.HAIL, WeatherType.SNOW) .partial(), // Healing not blocked by Heal Block new Ability(Abilities.SOLID_ROCK, 4) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getMoveEffectiveness(user, move) >= 2, 0.75) .ignorable(), new Ability(Abilities.SNOW_WARNING, 4) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW) @@ -5140,8 +5126,8 @@ export function initAbilities() { .attr(UnsuppressableAbilityAbAttr) .attr(NoFusionAbilityAbAttr), new Ability(Abilities.FLOWER_GIFT, 4) - .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), BattleStatMultiplierAbAttr, BattleStat.ATK, 1.5) - .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), BattleStatMultiplierAbAttr, BattleStat.SPDEF, 1.5) + .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), StatMultiplierAbAttr, Stat.ATK, 1.5) + .conditionalAttr(getWeatherCondition(WeatherType.SUNNY || WeatherType.HARSH_SUN), StatMultiplierAbAttr, Stat.SPDEF, 1.5) .attr(UncopiableAbilityAbAttr) .attr(NoFusionAbilityAbAttr) .attr(PostSummonFormChangeByWeatherAbAttr, Abilities.FLOWER_GIFT) @@ -5158,15 +5144,15 @@ export function initAbilities() { .attr(MoveEffectChanceMultiplierAbAttr, 0) .partial(), new Ability(Abilities.CONTRARY, 5) - .attr(StatChangeMultiplierAbAttr, -1) + .attr(StatStageChangeMultiplierAbAttr, -1) .ignorable(), new Ability(Abilities.UNNERVE, 5) .attr(PreventBerryUseAbAttr), new Ability(Abilities.DEFIANT, 5) - .attr(PostStatChangeStatChangeAbAttr, (target, statsChanged, levels) => levels < 0, [BattleStat.ATK], 2), + .attr(PostStatStageChangeStatStageChangeAbAttr, (target, statsChanged, stages) => stages < 0, [Stat.ATK], 2), new Ability(Abilities.DEFEATIST, 5) - .attr(BattleStatMultiplierAbAttr, BattleStat.ATK, 0.5) - .attr(BattleStatMultiplierAbAttr, BattleStat.SPATK, 0.5) + .attr(StatMultiplierAbAttr, Stat.ATK, 0.5) + .attr(StatMultiplierAbAttr, Stat.SPATK, 0.5) .condition((pokemon) => pokemon.getHpRatio() <= 0.5), new Ability(Abilities.CURSED_BODY, 5) .attr(PostDefendMoveDisableAbAttr, 30) @@ -5177,8 +5163,8 @@ export function initAbilities() { .ignorable() .unimplemented(), new Ability(Abilities.WEAK_ARMOR, 5) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, BattleStat.DEF, -1) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, BattleStat.SPD, 2), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, Stat.DEF, -1) + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, Stat.SPD, 2), new Ability(Abilities.HEAVY_METAL, 5) .attr(WeightMultiplierAbAttr, 2) .ignorable(), @@ -5214,10 +5200,10 @@ export function initAbilities() { new Ability(Abilities.REGENERATOR, 5) .attr(PreSwitchOutHealAbAttr), new Ability(Abilities.BIG_PECKS, 5) - .attr(ProtectStatAbAttr, BattleStat.DEF) + .attr(ProtectStatAbAttr, Stat.DEF) .ignorable(), new Ability(Abilities.SAND_RUSH, 5) - .attr(BattleStatMultiplierAbAttr, BattleStat.SPD, 2) + .attr(StatMultiplierAbAttr, Stat.SPD, 2) .attr(BlockWeatherDamageAttr, WeatherType.SANDSTORM) .condition(getWeatherCondition(WeatherType.SANDSTORM)), new Ability(Abilities.WONDER_SKIN, 5) @@ -5239,18 +5225,21 @@ export function initAbilities() { .attr(PostDefendAbilityGiveAbAttr, Abilities.MUMMY) .bypassFaint(), new Ability(Abilities.MOXIE, 5) - .attr(PostVictoryStatChangeAbAttr, BattleStat.ATK, 1), + .attr(PostVictoryStatStageChangeAbAttr, Stat.ATK, 1), new Ability(Abilities.JUSTIFIED, 5) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.type === Type.DARK && move.category !== MoveCategory.STATUS, BattleStat.ATK, 1), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => user.getMoveType(move) === Type.DARK && move.category !== MoveCategory.STATUS, Stat.ATK, 1), new Ability(Abilities.RATTLED, 5) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS && (move.type === Type.DARK || move.type === Type.BUG || - move.type === Type.GHOST), BattleStat.SPD, 1) - .attr(PostIntimidateStatChangeAbAttr, [BattleStat.SPD], 1), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => { + const moveType = user.getMoveType(move); + return move.category !== MoveCategory.STATUS + && (moveType === Type.DARK || moveType === Type.BUG || moveType === Type.GHOST); + }, Stat.SPD, 1) + .attr(PostIntimidateStatStageChangeAbAttr, [Stat.SPD], 1), new Ability(Abilities.MAGIC_BOUNCE, 5) .ignorable() .unimplemented(), new Ability(Abilities.SAP_SIPPER, 5) - .attr(TypeImmunityStatChangeAbAttr, Type.GRASS, BattleStat.ATK, 1) + .attr(TypeImmunityStatStageChangeAbAttr, Type.GRASS, Stat.ATK, 1) .ignorable(), new Ability(Abilities.PRANKSTER, 5) .attr(ChangeMovePriorityAbAttr, (pokemon, move: Move) => move.category === MoveCategory.STATUS, 1), @@ -5273,7 +5262,7 @@ export function initAbilities() { .attr(NoFusionAbilityAbAttr) .bypassFaint(), new Ability(Abilities.VICTORY_STAR, 5) - .attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 1.1) + .attr(StatMultiplierAbAttr, Stat.ACC, 1.1) .partial(), new Ability(Abilities.TURBOBLAZE, 5) .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => i18next.t("abilityTriggers:postSummonTurboblaze", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })) @@ -5302,7 +5291,7 @@ export function initAbilities() { .attr(MoveImmunityAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.hasFlag(MoveFlags.BALLBOMB_MOVE)) .ignorable(), new Ability(Abilities.COMPETITIVE, 6) - .attr(PostStatChangeStatChangeAbAttr, (target, statsChanged, levels) => levels < 0, [BattleStat.SPATK], 2), + .attr(PostStatStageChangeStatStageChangeAbAttr, (target, statsChanged, stages) => stages < 0, [Stat.SPATK], 2), new Ability(Abilities.STRONG_JAW, 6) .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.BITING_MOVE), 1.5), new Ability(Abilities.REFRIGERATE, 6) @@ -5318,11 +5307,11 @@ export function initAbilities() { .attr(UnsuppressableAbilityAbAttr) .attr(NoFusionAbilityAbAttr), new Ability(Abilities.GALE_WINGS, 6) - .attr(ChangeMovePriorityAbAttr, (pokemon, move) => pokemon.isFullHp() && move.type === Type.FLYING, 1), + .attr(ChangeMovePriorityAbAttr, (pokemon, move) => pokemon.isFullHp() && pokemon.getMoveType(move) === Type.FLYING, 1), new Ability(Abilities.MEGA_LAUNCHER, 6) .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.PULSE_MOVE), 1.5), new Ability(Abilities.GRASS_PELT, 6) - .conditionalAttr(getTerrainCondition(TerrainType.GRASSY), BattleStatMultiplierAbAttr, BattleStat.DEF, 1.5) + .conditionalAttr(getTerrainCondition(TerrainType.GRASSY), StatMultiplierAbAttr, Stat.DEF, 1.5) .ignorable(), new Ability(Abilities.SYMBIOSIS, 6) .unimplemented(), @@ -5331,7 +5320,7 @@ export function initAbilities() { new Ability(Abilities.PIXILATE, 6) .attr(MoveTypeChangeAbAttr, Type.FAIRY, 1.2, (user, target, move) => move.type === Type.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), new Ability(Abilities.GOOEY, 6) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), BattleStat.SPD, -1, false), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), Stat.SPD, -1, false), new Ability(Abilities.AERILATE, 6) .attr(MoveTypeChangeAbAttr, Type.FLYING, 1.2, (user, target, move) => move.type === Type.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), new Ability(Abilities.PARENTAL_BOND, 6) @@ -5365,7 +5354,7 @@ export function initAbilities() { .attr(PostFaintClearWeatherAbAttr) .bypassFaint(), new Ability(Abilities.STAMINA, 7) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, BattleStat.DEF, 1), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.DEF, 1), new Ability(Abilities.WIMP_OUT, 7) .condition(getSheerForceHitDisableAbCondition()) .unimplemented(), @@ -5373,7 +5362,7 @@ export function initAbilities() { .condition(getSheerForceHitDisableAbCondition()) .unimplemented(), new Ability(Abilities.WATER_COMPACTION, 7) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.type === Type.WATER && move.category !== MoveCategory.STATUS, BattleStat.DEF, 2), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => user.getMoveType(move) === Type.WATER && move.category !== MoveCategory.STATUS, Stat.DEF, 2), new Ability(Abilities.MERCILESS, 7) .attr(ConditionalCritAbAttr, (user, target, move) => target?.status?.effect === StatusEffect.TOXIC || target?.status?.effect === StatusEffect.POISON), new Ability(Abilities.SHIELDS_DOWN, 7) @@ -5397,10 +5386,10 @@ export function initAbilities() { new Ability(Abilities.STEELWORKER, 7) .attr(MoveTypePowerBoostAbAttr, Type.STEEL), new Ability(Abilities.BERSERK, 7) - .attr(PostDefendHpGatedStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [BattleStat.SPATK], 1) + .attr(PostDefendHpGatedStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [Stat.SPATK], 1) .condition(getSheerForceHitDisableAbCondition()), new Ability(Abilities.SLUSH_RUSH, 7) - .attr(BattleStatMultiplierAbAttr, BattleStat.SPD, 2) + .attr(StatMultiplierAbAttr, Stat.SPD, 2) .condition(getWeatherCondition(WeatherType.HAIL, WeatherType.SNOW)), new Ability(Abilities.LONG_REACH, 7) .attr(IgnoreContactAbAttr), @@ -5411,7 +5400,7 @@ export function initAbilities() { new Ability(Abilities.GALVANIZE, 7) .attr(MoveTypeChangeAbAttr, Type.ELECTRIC, 1.2, (user, target, move) => move.type === Type.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), new Ability(Abilities.SURGE_SURFER, 7) - .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), BattleStatMultiplierAbAttr, BattleStat.SPD, 2), + .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatMultiplierAbAttr, Stat.SPD, 2), new Ability(Abilities.SCHOOLING, 7) .attr(PostBattleInitFormChangeAbAttr, () => 0) .attr(PostSummonFormChangeAbAttr, p => p.level < 20 || p.getHpRatio() <= 0.25 ? 0 : 1) @@ -5429,7 +5418,7 @@ export function initAbilities() { .attr(NoFusionAbilityAbAttr) // Add BattlerTagType.DISGUISE if the pokemon is in its disguised form .conditionalAttr(pokemon => pokemon.formIndex === 0, PostSummonAddBattlerTagAbAttr, BattlerTagType.DISGUISE, 0, false) - .attr(FormBlockDamageAbAttr, (target, user, move) => !!target.getTag(BattlerTagType.DISGUISE) && target.getAttackTypeEffectiveness(move.type, user) > 0, 0, BattlerTagType.DISGUISE, + .attr(FormBlockDamageAbAttr, (target, user, move) => !!target.getTag(BattlerTagType.DISGUISE) && target.getMoveEffectiveness(user, move) > 0, 0, BattlerTagType.DISGUISE, (pokemon, abilityName) => i18next.t("abilityTriggers:disguiseAvoidedDamage", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), abilityName: abilityName }), (pokemon) => Utils.toDmgValue(pokemon.getMaxHp() / 8)) .attr(PostBattleInitFormChangeAbAttr, () => 0) @@ -5474,15 +5463,15 @@ export function initAbilities() { .attr(AllyMoveCategoryPowerBoostAbAttr, [MoveCategory.SPECIAL], 1.3), new Ability(Abilities.FLUFFY, 7) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), 0.5) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.type === Type.FIRE, 2) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => user.getMoveType(move) === Type.FIRE, 2) .ignorable(), new Ability(Abilities.DAZZLING, 7) .attr(FieldPriorityMoveImmunityAbAttr) .ignorable(), new Ability(Abilities.SOUL_HEART, 7) - .attr(PostKnockOutStatChangeAbAttr, BattleStat.SPATK, 1), + .attr(PostKnockOutStatStageChangeAbAttr, Stat.SPATK, 1), new Ability(Abilities.TANGLING_HAIR, 7) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), BattleStat.SPD, -1, false), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), Stat.SPD, -1, false), new Ability(Abilities.RECEIVER, 7) .attr(CopyFaintedAllyAbilityAbAttr) .attr(UncopiableAbilityAbAttr), @@ -5490,18 +5479,17 @@ export function initAbilities() { .attr(CopyFaintedAllyAbilityAbAttr) .attr(UncopiableAbilityAbAttr), new Ability(Abilities.BEAST_BOOST, 7) - .attr(PostVictoryStatChangeAbAttr, p => { - const battleStats = Utils.getEnumValues(BattleStat).slice(0, -3).map(s => s as BattleStat); - let highestBattleStat = 0; - let highestBattleStatIndex = 0; - battleStats.map((bs: BattleStat, i: integer) => { - const stat = p.getStat(bs + 1); - if (stat > highestBattleStat) { - highestBattleStatIndex = i; - highestBattleStat = stat; + .attr(PostVictoryStatStageChangeAbAttr, p => { + let highestStat: EffectiveStat; + let highestValue = 0; + for (const s of EFFECTIVE_STATS) { + const value = p.getStat(s, false); + if (value > highestValue) { + highestStat = s; + highestValue = value; } - }); - return highestBattleStatIndex; + } + return highestStat!; }, 1), new Ability(Abilities.RKS_SYSTEM, 7) .attr(UncopiableAbilityAbAttr) @@ -5525,15 +5513,15 @@ export function initAbilities() { new Ability(Abilities.SHADOW_SHIELD, 7) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.isFullHp(), 0.5), new Ability(Abilities.PRISM_ARMOR, 7) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75), + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getMoveEffectiveness(user, move) >= 2, 0.75), new Ability(Abilities.NEUROFORCE, 7) //@ts-ignore - .attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 1.25), // TODO: fix TS issues + .attr(MovePowerBoostAbAttr, (user, target, move) => target?.getMoveEffectiveness(user, move) >= 2, 1.25), // TODO: fix TS issues new Ability(Abilities.INTREPID_SWORD, 8) - .attr(PostSummonStatChangeAbAttr, BattleStat.ATK, 1, true) + .attr(PostSummonStatStageChangeAbAttr, [ Stat.ATK ], 1, true) .condition(getOncePerBattleCondition(Abilities.INTREPID_SWORD)), new Ability(Abilities.DAUNTLESS_SHIELD, 8) - .attr(PostSummonStatChangeAbAttr, BattleStat.DEF, 1, true) + .attr(PostSummonStatStageChangeAbAttr, [ Stat.DEF ], 1, true) .condition(getOncePerBattleCondition(Abilities.DAUNTLESS_SHIELD)), new Ability(Abilities.LIBERO, 8) .attr(PokemonTypeChangeAbAttr), @@ -5542,7 +5530,7 @@ export function initAbilities() { .attr(FetchBallAbAttr) .condition(getOncePerBattleCondition(Abilities.BALL_FETCH)), new Ability(Abilities.COTTON_DOWN, 8) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, BattleStat.SPD, -1, false, true) + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.SPD, -1, false, true) .bypassFaint(), new Ability(Abilities.PROPELLER_TAIL, 8) .attr(BlockRedirectAbAttr), @@ -5559,7 +5547,11 @@ export function initAbilities() { new Ability(Abilities.STALWART, 8) .attr(BlockRedirectAbAttr), new Ability(Abilities.STEAM_ENGINE, 8) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => (move.type === Type.FIRE || move.type === Type.WATER) && move.category !== MoveCategory.STATUS, BattleStat.SPD, 6), + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => { + const moveType = user.getMoveType(move); + return move.category !== MoveCategory.STATUS + && (moveType === Type.FIRE || moveType === Type.WATER); + }, Stat.SPD, 6), new Ability(Abilities.PUNK_ROCK, 8) .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.SOUND_BASED), 1.3) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.hasFlag(MoveFlags.SOUND_BASED), 0.5) @@ -5630,26 +5622,26 @@ export function initAbilities() { new Ability(Abilities.UNSEEN_FIST, 8) .attr(IgnoreProtectOnContactAbAttr), new Ability(Abilities.CURIOUS_MEDICINE, 8) - .attr(PostSummonClearAllyStatsAbAttr), + .attr(PostSummonClearAllyStatStagesAbAttr), new Ability(Abilities.TRANSISTOR, 8) .attr(MoveTypePowerBoostAbAttr, Type.ELECTRIC), new Ability(Abilities.DRAGONS_MAW, 8) .attr(MoveTypePowerBoostAbAttr, Type.DRAGON), new Ability(Abilities.CHILLING_NEIGH, 8) - .attr(PostVictoryStatChangeAbAttr, BattleStat.ATK, 1), + .attr(PostVictoryStatStageChangeAbAttr, Stat.ATK, 1), new Ability(Abilities.GRIM_NEIGH, 8) - .attr(PostVictoryStatChangeAbAttr, BattleStat.SPATK, 1), + .attr(PostVictoryStatStageChangeAbAttr, Stat.SPATK, 1), new Ability(Abilities.AS_ONE_GLASTRIER, 8) .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => i18next.t("abilityTriggers:postSummonAsOneGlastrier", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })) .attr(PreventBerryUseAbAttr) - .attr(PostVictoryStatChangeAbAttr, BattleStat.ATK, 1) + .attr(PostVictoryStatStageChangeAbAttr, Stat.ATK, 1) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr), new Ability(Abilities.AS_ONE_SPECTRIER, 8) .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => i18next.t("abilityTriggers:postSummonAsOneSpectrier", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })) .attr(PreventBerryUseAbAttr) - .attr(PostVictoryStatChangeAbAttr, BattleStat.SPATK, 1) + .attr(PostVictoryStatStageChangeAbAttr, Stat.SPATK, 1) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr), @@ -5659,26 +5651,26 @@ export function initAbilities() { new Ability(Abilities.SEED_SOWER, 9) .attr(PostDefendTerrainChangeAbAttr, TerrainType.GRASSY), new Ability(Abilities.THERMAL_EXCHANGE, 9) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.type === Type.FIRE && move.category !== MoveCategory.STATUS, BattleStat.ATK, 1) + .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => user.getMoveType(move) === Type.FIRE && move.category !== MoveCategory.STATUS, Stat.ATK, 1) .attr(StatusEffectImmunityAbAttr, StatusEffect.BURN) .ignorable(), new Ability(Abilities.ANGER_SHELL, 9) - .attr(PostDefendHpGatedStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [ BattleStat.ATK, BattleStat.SPATK, BattleStat.SPD ], 1) - .attr(PostDefendHpGatedStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [ BattleStat.DEF, BattleStat.SPDEF ], -1) + .attr(PostDefendHpGatedStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [ Stat.ATK, Stat.SPATK, Stat.SPD ], 1) + .attr(PostDefendHpGatedStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, 0.5, [ Stat.DEF, Stat.SPDEF ], -1) .condition(getSheerForceHitDisableAbCondition()), new Ability(Abilities.PURIFYING_SALT, 9) .attr(StatusEffectImmunityAbAttr) .attr(ReceivedTypeDamageMultiplierAbAttr, Type.GHOST, 0.5) .ignorable(), new Ability(Abilities.WELL_BAKED_BODY, 9) - .attr(TypeImmunityStatChangeAbAttr, Type.FIRE, BattleStat.DEF, 2) + .attr(TypeImmunityStatStageChangeAbAttr, Type.FIRE, Stat.DEF, 2) .ignorable(), new Ability(Abilities.WIND_RIDER, 9) - .attr(MoveImmunityStatChangeAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.hasFlag(MoveFlags.WIND_MOVE) && move.category !== MoveCategory.STATUS, BattleStat.ATK, 1) - .attr(PostSummonStatChangeOnArenaAbAttr, ArenaTagType.TAILWIND) + .attr(MoveImmunityStatStageChangeAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.hasFlag(MoveFlags.WIND_MOVE) && move.category !== MoveCategory.STATUS, Stat.ATK, 1) + .attr(PostSummonStatStageChangeOnArenaAbAttr, ArenaTagType.TAILWIND) .ignorable(), new Ability(Abilities.GUARD_DOG, 9) - .attr(PostIntimidateStatChangeAbAttr, [BattleStat.ATK], 1, true) + .attr(PostIntimidateStatStageChangeAbAttr, [Stat.ATK], 1, true) .attr(ForceSwitchOutImmunityAbAttr) .ignorable(), new Ability(Abilities.ROCKY_PAYLOAD, 9) @@ -5719,31 +5711,31 @@ export function initAbilities() { .ignorable() .partial(), new Ability(Abilities.VESSEL_OF_RUIN, 9) - .attr(FieldMultiplyBattleStatAbAttr, Stat.SPATK, 0.75) - .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonVesselOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: getStatName(Stat.SPATK) })) + .attr(FieldMultiplyStatAbAttr, Stat.SPATK, 0.75) + .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonVesselOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: i18next.t(getStatKey(Stat.SPATK)) })) .ignorable(), new Ability(Abilities.SWORD_OF_RUIN, 9) - .attr(FieldMultiplyBattleStatAbAttr, Stat.DEF, 0.75) - .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonSwordOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: getStatName(Stat.DEF) })) + .attr(FieldMultiplyStatAbAttr, Stat.DEF, 0.75) + .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonSwordOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: i18next.t(getStatKey(Stat.DEF)) })) .ignorable(), new Ability(Abilities.TABLETS_OF_RUIN, 9) - .attr(FieldMultiplyBattleStatAbAttr, Stat.ATK, 0.75) - .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonTabletsOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: getStatName(Stat.ATK) })) + .attr(FieldMultiplyStatAbAttr, Stat.ATK, 0.75) + .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonTabletsOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: i18next.t(getStatKey(Stat.ATK)) })) .ignorable(), new Ability(Abilities.BEADS_OF_RUIN, 9) - .attr(FieldMultiplyBattleStatAbAttr, Stat.SPDEF, 0.75) - .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonBeadsOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: getStatName(Stat.SPDEF) })) + .attr(FieldMultiplyStatAbAttr, Stat.SPDEF, 0.75) + .attr(PostSummonMessageAbAttr, (user) => i18next.t("abilityTriggers:postSummonBeadsOfRuin", { pokemonNameWithAffix: getPokemonNameWithAffix(user), statName: i18next.t(getStatKey(Stat.SPDEF)) })) .ignorable(), new Ability(Abilities.ORICHALCUM_PULSE, 9) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY) - .conditionalAttr(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN), BattleStatMultiplierAbAttr, BattleStat.ATK, 4 / 3), + .conditionalAttr(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN), StatMultiplierAbAttr, Stat.ATK, 4 / 3), new Ability(Abilities.HADRON_ENGINE, 9) .attr(PostSummonTerrainChangeAbAttr, TerrainType.ELECTRIC) .attr(PostBiomeChangeTerrainChangeAbAttr, TerrainType.ELECTRIC) - .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), BattleStatMultiplierAbAttr, BattleStat.SPATK, 4 / 3), + .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatMultiplierAbAttr, Stat.SPATK, 4 / 3), new Ability(Abilities.OPPORTUNIST, 9) - .attr(StatChangeCopyAbAttr), + .attr(StatStageChangeCopyAbAttr), new Ability(Abilities.CUD_CHEW, 9) .unimplemented(), new Ability(Abilities.SHARPNESS, 9) @@ -5769,11 +5761,11 @@ export function initAbilities() { .attr(MoveAbilityBypassAbAttr, (pokemon, move: Move) => move.category === MoveCategory.STATUS), new Ability(Abilities.MINDS_EYE, 9) .attr(IgnoreTypeImmunityAbAttr, Type.GHOST, [Type.NORMAL, Type.FIGHTING]) - .attr(ProtectStatAbAttr, BattleStat.ACC) - .attr(IgnoreOpponentEvasionAbAttr) + .attr(ProtectStatAbAttr, Stat.ACC) + .attr(IgnoreOpponentStatStagesAbAttr, [ Stat.EVA ]) .ignorable(), new Ability(Abilities.SUPERSWEET_SYRUP, 9) - .attr(PostSummonStatChangeAbAttr, BattleStat.EVA, -1) + .attr(PostSummonStatStageChangeAbAttr, [ Stat.EVA ], -1) .condition(getOncePerBattleCondition(Abilities.SUPERSWEET_SYRUP)), new Ability(Abilities.HOSPITALITY, 9) .attr(PostSummonAllyHealAbAttr, 4, true) @@ -5781,25 +5773,25 @@ export function initAbilities() { new Ability(Abilities.TOXIC_CHAIN, 9) .attr(PostAttackApplyStatusEffectAbAttr, false, 30, StatusEffect.TOXIC), new Ability(Abilities.EMBODY_ASPECT_TEAL, 9) - .attr(PostBattleInitStatChangeAbAttr, BattleStat.SPD, 1, true) + .attr(PostBattleInitStatStageChangeAbAttr, [ Stat.SPD ], 1, true) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(NoTransformAbilityAbAttr) .partial(), new Ability(Abilities.EMBODY_ASPECT_WELLSPRING, 9) - .attr(PostBattleInitStatChangeAbAttr, BattleStat.SPDEF, 1, true) + .attr(PostBattleInitStatStageChangeAbAttr, [ Stat.SPDEF ], 1, true) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(NoTransformAbilityAbAttr) .partial(), new Ability(Abilities.EMBODY_ASPECT_HEARTHFLAME, 9) - .attr(PostBattleInitStatChangeAbAttr, BattleStat.ATK, 1, true) + .attr(PostBattleInitStatStageChangeAbAttr, [ Stat.ATK ], 1, true) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(NoTransformAbilityAbAttr) .partial(), new Ability(Abilities.EMBODY_ASPECT_CORNERSTONE, 9) - .attr(PostBattleInitStatChangeAbAttr, BattleStat.DEF, 1, true) + .attr(PostBattleInitStatStageChangeAbAttr, [ Stat.DEF ], 1, true) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(NoTransformAbilityAbAttr) diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 09cc7a5b97c..fdc32b75c19 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -7,17 +7,17 @@ import Pokemon, { HitResult, PokemonMove } from "../field/pokemon"; import { StatusEffect } from "./status-effect"; import { BattlerIndex } from "../battle"; import { BlockNonDirectDamageAbAttr, ChangeMovePriorityAbAttr, ProtectStatAbAttr, applyAbAttrs } from "./ability"; -import { BattleStat } from "./battle-stat"; +import { Stat } from "#enums/stat"; import { CommonAnim, CommonBattleAnim } from "./battle-anims"; import i18next from "i18next"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase.js"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase.js"; -import { ShowAbilityPhase } from "#app/phases/show-ability-phase.js"; -import { StatChangePhase } from "#app/phases/stat-change-phase.js"; +import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; +import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; export enum ArenaTagSide { BOTH, @@ -786,8 +786,8 @@ class StickyWebTag extends ArenaTrapTag { applyAbAttrs(ProtectStatAbAttr, pokemon, cancelled); if (!cancelled.value) { pokemon.scene.queueMessage(i18next.t("arenaTag:stickyWebActivateTrap", { pokemonName: pokemon.getNameToRender() })); - const statLevels = new Utils.NumberHolder(-1); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, [BattleStat.SPD], statLevels.value)); + const stages = new Utils.NumberHolder(-1); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, [ Stat.SPD ], stages.value)); } } @@ -875,7 +875,7 @@ class TailwindTag extends ArenaTag { // Raise attack by one stage if party member has WIND_RIDER ability if (pokemon.hasAbility(Abilities.WIND_RIDER)) { pokemon.scene.unshiftPhase(new ShowAbilityPhase(pokemon.scene, pokemon.getBattlerIndex())); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK], 1, true)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.ATK ], 1, true)); } } } diff --git a/src/data/battle-stat.ts b/src/data/battle-stat.ts deleted file mode 100644 index a0cb7ca88e1..00000000000 --- a/src/data/battle-stat.ts +++ /dev/null @@ -1,71 +0,0 @@ -import i18next, { ParseKeys } from "i18next"; - -export enum BattleStat { - ATK, - DEF, - SPATK, - SPDEF, - SPD, - ACC, - EVA, - RAND, - HP -} - -export function getBattleStatName(stat: BattleStat) { - switch (stat) { - case BattleStat.ATK: - return i18next.t("pokemonInfo:Stat.ATK"); - case BattleStat.DEF: - return i18next.t("pokemonInfo:Stat.DEF"); - case BattleStat.SPATK: - return i18next.t("pokemonInfo:Stat.SPATK"); - case BattleStat.SPDEF: - return i18next.t("pokemonInfo:Stat.SPDEF"); - case BattleStat.SPD: - return i18next.t("pokemonInfo:Stat.SPD"); - case BattleStat.ACC: - return i18next.t("pokemonInfo:Stat.ACC"); - case BattleStat.EVA: - return i18next.t("pokemonInfo:Stat.EVA"); - case BattleStat.HP: - return i18next.t("pokemonInfo:Stat.HPStat"); - default: - return "???"; - } -} - -export function getBattleStatLevelChangeDescription(pokemonNameWithAffix: string, stats: string, levels: integer, up: boolean, count: number = 1) { - const stringKey = (() => { - if (up) { - switch (levels) { - case 1: - return "battle:statRose"; - case 2: - return "battle:statSharplyRose"; - case 3: - case 4: - case 5: - case 6: - return "battle:statRoseDrastically"; - default: - return "battle:statWontGoAnyHigher"; - } - } else { - switch (levels) { - case 1: - return "battle:statFell"; - case 2: - return "battle:statHarshlyFell"; - case 3: - case 4: - case 5: - case 6: - return "battle:statSeverelyFell"; - default: - return "battle:statWontGoAnyLower"; - } - } - })(); - return i18next.t(stringKey as ParseKeys, { pokemonNameWithAffix, stats, count }); -} diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 92df6fc294f..ddb85600c18 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1,7 +1,6 @@ import { ChargeAnim, CommonAnim, CommonBattleAnim, MoveChargeAnim } from "./battle-anims"; import { getPokemonNameWithAffix } from "../messages"; import Pokemon, { MoveResult, HitResult } from "../field/pokemon"; -import { Stat, getStatName } from "./pokemon-stat"; import { StatusEffect } from "./status-effect"; import * as Utils from "../utils"; import { ChargeAttr, MoveFlags, allMoves } from "./move"; @@ -9,20 +8,20 @@ import { Type } from "./type"; import { BlockNonDirectDamageAbAttr, FlinchEffectAbAttr, ReverseDrainAbAttr, applyAbAttrs } from "./ability"; import { TerrainType } from "./terrain"; import { WeatherType } from "./weather"; -import { BattleStat } from "./battle-stat"; import { allAbilities } from "./ability"; import { SpeciesFormChangeManualTrigger } from "./pokemon-forms"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import i18next from "#app/plugins/i18n.js"; -import { CommonAnimPhase } from "#app/phases/common-anim-phase.js"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase.js"; -import { MovePhase } from "#app/phases/move-phase.js"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase.js"; -import { ShowAbilityPhase } from "#app/phases/show-ability-phase.js"; -import { StatChangePhase, StatChangeCallback } from "#app/phases/stat-change-phase.js"; +import i18next from "#app/plugins/i18n"; +import { Stat, type BattleStat, type EffectiveStat, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat"; +import { CommonAnimPhase } from "#app/phases/common-anim-phase"; +import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { MovePhase } from "#app/phases/move-phase"; +import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; +import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; +import { StatStageChangePhase, StatStageChangeCallback } from "#app/phases/stat-stage-change-phase"; export enum BattlerTagLapseType { FAINT, @@ -40,13 +39,15 @@ export class BattlerTag { public turnCount: number; public sourceMove: Moves; public sourceId?: number; + public isBatonPassable: boolean; - constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType | BattlerTagLapseType[], turnCount: number, sourceMove?: Moves, sourceId?: number) { + constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType | BattlerTagLapseType[], turnCount: number, sourceMove?: Moves, sourceId?: number, isBatonPassable: boolean = false) { this.tagType = tagType; this.lapseTypes = Array.isArray(lapseType) ? lapseType : [ lapseType ]; this.turnCount = turnCount; this.sourceMove = sourceMove!; // TODO: is this bang correct? this.sourceId = sourceId; + this.isBatonPassable = isBatonPassable; } canAdd(pokemon: Pokemon): boolean { @@ -97,6 +98,127 @@ export interface TerrainBattlerTag { terrainTypes: TerrainType[]; } +/** + * Base class for tags that restrict the usage of moves. This effect is generally referred to as "disabling" a move + * in-game. This is not to be confused with {@linkcode Moves.DISABLE}. + * + * Descendants can override {@linkcode isMoveRestricted} to restrict moves that + * match a condition. A restricted move gets cancelled before it is used. Players and enemies should not be allowed + * to select restricted moves. + */ +export abstract class MoveRestrictionBattlerTag extends BattlerTag { + constructor(tagType: BattlerTagType, turnCount: integer, sourceMove?: Moves, sourceId?: integer) { + super(tagType, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], turnCount, sourceMove, sourceId); + } + + /** @override */ + override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { + if (lapseType === BattlerTagLapseType.PRE_MOVE) { + // Cancel the affected pokemon's selected move + const phase = pokemon.scene.getCurrentPhase() as MovePhase; + const move = phase.move; + + if (this.isMoveRestricted(move.moveId)) { + pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId)); + phase.cancel(); + } + + return true; + } + + return super.lapse(pokemon, lapseType); + } + + /** + * Gets whether this tag is restricting a move. + * + * @param {Moves} move {@linkcode Moves} ID to check restriction for. + * @returns {boolean} `true` if the move is restricted by this tag, otherwise `false`. + */ + abstract isMoveRestricted(move: Moves): boolean; + + /** + * Gets the text to display when the player attempts to select a move that is restricted by this tag. + * + * @param {Pokemon} pokemon {@linkcode Pokemon} for which the player is attempting to select the restricted move + * @param {Moves} move {@linkcode Moves} ID of the move that is having its selection denied + * @returns {string} text to display when the player attempts to select the restricted move + */ + abstract selectionDeniedText(pokemon: Pokemon, move: Moves): string; + + /** + * Gets the text to display when a move's execution is prevented as a result of the restriction. + * Because restriction effects also prevent selection of the move, this situation can only arise if a + * pokemon first selects a move, then gets outsped by a pokemon using a move that restricts the selected move. + * + * @param {Pokemon} pokemon {@linkcode Pokemon} attempting to use the restricted move + * @param {Moves} move {@linkcode Moves} ID of the move being interrupted + * @returns {string} text to display when the move is interrupted + */ + abstract interruptedText(pokemon: Pokemon, move: Moves): string; +} + +/** + * Tag representing the "disabling" effect performed by {@linkcode Moves.DISABLE} and {@linkcode Abilities.CURSED_BODY}. + * When the tag is added, the last-used move of the tag holder is set as the disabled move. + */ +export class DisabledTag extends MoveRestrictionBattlerTag { + /** The move being disabled. Gets set when {@linkcode onAdd} is called for this tag. */ + private moveId: Moves = Moves.NONE; + + constructor(sourceId: number) { + super(BattlerTagType.DISABLED, 4, Moves.DISABLE, sourceId); + } + + /** @override */ + override isMoveRestricted(move: Moves): boolean { + return move === this.moveId; + } + + /** + * @override + * + * Ensures that move history exists on `pokemon` and has a valid move. If so, sets the {@link moveId} and shows a message. + * Otherwise the move ID will not get assigned and this tag will get removed next turn. + */ + override onAdd(pokemon: Pokemon): void { + super.onAdd(pokemon); + + const move = pokemon.getLastXMoves() + .find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual); + if (move === undefined) { + return; + } + + this.moveId = move.move; + + pokemon.scene.queueMessage(i18next.t("battlerTags:disabledOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[this.moveId].name })); + } + + /** @override */ + override onRemove(pokemon: Pokemon): void { + super.onRemove(pokemon); + + pokemon.scene.queueMessage(i18next.t("battlerTags:disabledLapse", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[this.moveId].name })); + } + + /** @override */ + override selectionDeniedText(pokemon: Pokemon, move: Moves): string { + return i18next.t("battle:moveDisabled", { moveName: allMoves[move].name }); + } + + /** @override */ + override interruptedText(pokemon: Pokemon, move: Moves): string { + return i18next.t("battle:disableInterruptedMove", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[move].name }); + } + + /** @override */ + override loadTag(source: BattlerTag | any): void { + super.loadTag(source); + this.moveId = source.moveId; + } +} + /** * BattlerTag that represents the "recharge" effects of moves like Hyper Beam. */ @@ -207,7 +329,7 @@ export class ShellTrapTag extends BattlerTag { export class TrappedTag extends BattlerTag { constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, turnCount: number, sourceMove: Moves, sourceId: number) { - super(tagType, lapseType, turnCount, sourceMove, sourceId); + super(tagType, lapseType, turnCount, sourceMove, sourceId, true); } canAdd(pokemon: Pokemon): boolean { @@ -327,7 +449,7 @@ export class InterruptedTag extends BattlerTag { */ export class ConfusedTag extends BattlerTag { constructor(turnCount: number, sourceMove: Moves) { - super(BattlerTagType.CONFUSED, BattlerTagLapseType.MOVE, turnCount, sourceMove); + super(BattlerTagType.CONFUSED, BattlerTagLapseType.MOVE, turnCount, sourceMove, undefined, true); } canAdd(pokemon: Pokemon): boolean { @@ -362,9 +484,9 @@ export class ConfusedTag extends BattlerTag { // 1/3 chance of hitting self with a 40 base power move if (pokemon.randSeedInt(3) === 0) { - const atk = pokemon.getBattleStat(Stat.ATK); - const def = pokemon.getBattleStat(Stat.DEF); - const damage = Utils.toDmgValue(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * (pokemon.randSeedInt(15, 85) / 100)); + const atk = pokemon.getEffectiveStat(Stat.ATK); + const def = pokemon.getEffectiveStat(Stat.DEF); + const damage = Utils.toDmgValue(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * (pokemon.randSeedIntRange(85, 100) / 100)); pokemon.scene.queueMessage(i18next.t("battlerTags:confusedLapseHurtItself")); pokemon.damageAndUpdate(damage); pokemon.battleData.hitCount++; @@ -387,7 +509,7 @@ export class ConfusedTag extends BattlerTag { */ export class DestinyBondTag extends BattlerTag { constructor(sourceMove: Moves, sourceId: number) { - super(BattlerTagType.DESTINY_BOND, BattlerTagLapseType.PRE_MOVE, 1, sourceMove, sourceId); + super(BattlerTagType.DESTINY_BOND, BattlerTagLapseType.PRE_MOVE, 1, sourceMove, sourceId, true); } /** @@ -506,7 +628,7 @@ export class SeedTag extends BattlerTag { private sourceIndex: number; constructor(sourceId: number) { - super(BattlerTagType.SEEDED, BattlerTagLapseType.TURN_END, 1, Moves.LEECH_SEED, sourceId); + super(BattlerTagType.SEEDED, BattlerTagLapseType.TURN_END, 1, Moves.LEECH_SEED, sourceId, true); } /** @@ -767,7 +889,7 @@ export class OctolockTag extends TrappedTag { const shouldLapse = lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType); if (shouldLapse) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, [BattleStat.DEF, BattleStat.SPDEF], -1)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, [ Stat.DEF, Stat.SPDEF ], -1)); return true; } @@ -777,7 +899,7 @@ export class OctolockTag extends TrappedTag { export class AquaRingTag extends BattlerTag { constructor() { - super(BattlerTagType.AQUA_RING, BattlerTagLapseType.TURN_END, 1, Moves.AQUA_RING, undefined); + super(BattlerTagType.AQUA_RING, BattlerTagLapseType.TURN_END, 1, Moves.AQUA_RING, undefined, true); } onAdd(pokemon: Pokemon): void { @@ -809,7 +931,7 @@ export class AquaRingTag extends BattlerTag { /** Tag used to allow moves that interact with {@link Moves.MINIMIZE} to function */ export class MinimizeTag extends BattlerTag { constructor() { - super(BattlerTagType.MINIMIZED, BattlerTagLapseType.TURN_END, 1, Moves.MINIMIZE, undefined); + super(BattlerTagType.MINIMIZED, BattlerTagLapseType.TURN_END, 1, Moves.MINIMIZE); } canAdd(pokemon: Pokemon): boolean { @@ -1093,7 +1215,7 @@ export class ContactDamageProtectedTag extends ProtectedTag { } } -export class ContactStatChangeProtectedTag extends ProtectedTag { +export class ContactStatStageChangeProtectedTag extends ProtectedTag { private stat: BattleStat; private levels: number; @@ -1110,7 +1232,7 @@ export class ContactStatChangeProtectedTag extends ProtectedTag { */ loadTag(source: BattlerTag | any): void { super.loadTag(source); - this.stat = source.stat as BattleStat; + this.stat = source.stat; this.levels = source.levels; } @@ -1121,7 +1243,7 @@ export class ContactStatChangeProtectedTag extends ProtectedTag { const effectPhase = pokemon.scene.getCurrentPhase(); if (effectPhase instanceof MoveEffectPhase && effectPhase.move.getMove().hasFlag(MoveFlags.MAKES_CONTACT)) { const attacker = effectPhase.getPokemon(); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, attacker.getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, attacker.getBattlerIndex(), true, [ this.stat ], this.levels)); } } @@ -1207,7 +1329,7 @@ export class SturdyTag extends BattlerTag { export class PerishSongTag extends BattlerTag { constructor(turnCount: number) { - super(BattlerTagType.PERISH_SONG, BattlerTagLapseType.TURN_END, turnCount, Moves.PERISH_SONG); + super(BattlerTagType.PERISH_SONG, BattlerTagLapseType.TURN_END, turnCount, Moves.PERISH_SONG, undefined, true); } canAdd(pokemon: Pokemon): boolean { @@ -1263,7 +1385,7 @@ export class AbilityBattlerTag extends BattlerTag { public ability: Abilities; constructor(tagType: BattlerTagType, ability: Abilities, lapseType: BattlerTagLapseType, turnCount: number) { - super(tagType, lapseType, turnCount, undefined); + super(tagType, lapseType, turnCount); this.ability = ability; } @@ -1348,11 +1470,10 @@ export class HighestStatBoostTag extends AbilityBattlerTag { onAdd(pokemon: Pokemon): void { super.onAdd(pokemon); - const stats = [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ]; - let highestStat: Stat; - stats.map(s => pokemon.getBattleStat(s)).reduce((highestValue: number, value: number, i: number) => { + let highestStat: EffectiveStat; + EFFECTIVE_STATS.map(s => pokemon.getEffectiveStat(s)).reduce((highestValue: number, value: number, i: number) => { if (value > highestValue) { - highestStat = stats[i]; + highestStat = EFFECTIVE_STATS[i]; return value; } return highestValue; @@ -1370,7 +1491,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag { break; } - pokemon.scene.queueMessage(i18next.t("battlerTags:highestStatBoostOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), statName: getStatName(highestStat) }), null, false, null, true); + pokemon.scene.queueMessage(i18next.t("battlerTags:highestStatBoostOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), statName: i18next.t(getStatKey(highestStat)) }), null, false, null, true); } onRemove(pokemon: Pokemon): void { @@ -1440,7 +1561,7 @@ export class TypeImmuneTag extends BattlerTag { public immuneType: Type; constructor(tagType: BattlerTagType, sourceMove: Moves, immuneType: Type, length: number = 1) { - super(tagType, BattlerTagLapseType.TURN_END, length, sourceMove); + super(tagType, BattlerTagLapseType.TURN_END, length, sourceMove, undefined, true); this.immuneType = immuneType; } @@ -1504,7 +1625,7 @@ export class TypeBoostTag extends BattlerTag { export class CritBoostTag extends BattlerTag { constructor(tagType: BattlerTagType, sourceMove: Moves) { - super(tagType, BattlerTagLapseType.TURN_END, 1, sourceMove); + super(tagType, BattlerTagLapseType.TURN_END, 1, sourceMove, undefined, true); } onAdd(pokemon: Pokemon): void { @@ -1596,7 +1717,7 @@ export class CursedTag extends BattlerTag { private sourceIndex: number; constructor(sourceId: number) { - super(BattlerTagType.CURSED, BattlerTagLapseType.TURN_END, 1, Moves.CURSE, sourceId); + super(BattlerTagType.CURSED, BattlerTagLapseType.TURN_END, 1, Moves.CURSE, sourceId, true); } /** @@ -1714,25 +1835,25 @@ export class IceFaceBlockDamageTag extends FormBlockDamageTag { */ export class StockpilingTag extends BattlerTag { public stockpiledCount: number = 0; - public statChangeCounts: { [BattleStat.DEF]: number; [BattleStat.SPDEF]: number } = { - [BattleStat.DEF]: 0, - [BattleStat.SPDEF]: 0 + public statChangeCounts: { [Stat.DEF]: number; [Stat.SPDEF]: number } = { + [Stat.DEF]: 0, + [Stat.SPDEF]: 0 }; constructor(sourceMove: Moves = Moves.NONE) { super(BattlerTagType.STOCKPILING, BattlerTagLapseType.CUSTOM, 1, sourceMove); } - private onStatsChanged: StatChangeCallback = (_, statsChanged, statChanges) => { - const defChange = statChanges[statsChanged.indexOf(BattleStat.DEF)] ?? 0; - const spDefChange = statChanges[statsChanged.indexOf(BattleStat.SPDEF)] ?? 0; + private onStatStagesChanged: StatStageChangeCallback = (_, statsChanged, statChanges) => { + const defChange = statChanges[statsChanged.indexOf(Stat.DEF)] ?? 0; + const spDefChange = statChanges[statsChanged.indexOf(Stat.SPDEF)] ?? 0; if (defChange) { - this.statChangeCounts[BattleStat.DEF]++; + this.statChangeCounts[Stat.DEF]++; } if (spDefChange) { - this.statChangeCounts[BattleStat.SPDEF]++; + this.statChangeCounts[Stat.SPDEF]++; } }; @@ -1740,8 +1861,8 @@ export class StockpilingTag extends BattlerTag { super.loadTag(source); this.stockpiledCount = source.stockpiledCount || 0; this.statChangeCounts = { - [ BattleStat.DEF ]: source.statChangeCounts?.[ BattleStat.DEF ] ?? 0, - [ BattleStat.SPDEF ]: source.statChangeCounts?.[ BattleStat.SPDEF ] ?? 0, + [ Stat.DEF ]: source.statChangeCounts?.[ Stat.DEF ] ?? 0, + [ Stat.SPDEF ]: source.statChangeCounts?.[ Stat.SPDEF ] ?? 0, }; } @@ -1761,9 +1882,9 @@ export class StockpilingTag extends BattlerTag { })); // Attempt to increase DEF and SPDEF by one stage, keeping track of successful changes. - pokemon.scene.unshiftPhase(new StatChangePhase( + pokemon.scene.unshiftPhase(new StatStageChangePhase( pokemon.scene, pokemon.getBattlerIndex(), true, - [BattleStat.SPDEF, BattleStat.DEF], 1, true, false, true, this.onStatsChanged + [Stat.SPDEF, Stat.DEF], 1, true, false, true, this.onStatStagesChanged )); } } @@ -1777,15 +1898,15 @@ export class StockpilingTag extends BattlerTag { * one stage for each stack which had successfully changed that particular stat during onAdd. */ onRemove(pokemon: Pokemon): void { - const defChange = this.statChangeCounts[BattleStat.DEF]; - const spDefChange = this.statChangeCounts[BattleStat.SPDEF]; + const defChange = this.statChangeCounts[Stat.DEF]; + const spDefChange = this.statChangeCounts[Stat.SPDEF]; if (defChange) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.DEF], -defChange, true, false, true)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.DEF ], -defChange, true, false, true)); } if (spDefChange) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.SPDEF], -spDefChange, true, false, true)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.SPDEF ], -spDefChange, true, false, true)); } } } @@ -1927,11 +2048,11 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source case BattlerTagType.SPIKY_SHIELD: return new ContactDamageProtectedTag(sourceMove, 8); case BattlerTagType.KINGS_SHIELD: - return new ContactStatChangeProtectedTag(sourceMove, tagType, BattleStat.ATK, -1); + return new ContactStatStageChangeProtectedTag(sourceMove, tagType, Stat.ATK, -1); case BattlerTagType.OBSTRUCT: - return new ContactStatChangeProtectedTag(sourceMove, tagType, BattleStat.DEF, -2); + return new ContactStatStageChangeProtectedTag(sourceMove, tagType, Stat.DEF, -2); case BattlerTagType.SILK_TRAP: - return new ContactStatChangeProtectedTag(sourceMove, tagType, BattleStat.SPD, -1); + return new ContactStatStageChangeProtectedTag(sourceMove, tagType, Stat.SPD, -1); case BattlerTagType.BANEFUL_BUNKER: return new ContactPoisonProtectedTag(sourceMove); case BattlerTagType.BURNING_BULWARK: @@ -1995,6 +2116,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source return new StockpilingTag(sourceMove); case BattlerTagType.OCTOLOCK: return new OctolockTag(sourceId); + case BattlerTagType.DISABLED: + return new DisabledTag(sourceId); case BattlerTagType.IGNORE_GHOST: return new ExposedTag(tagType, sourceMove, Type.GHOST, [Type.NORMAL, Type.FIGHTING]); case BattlerTagType.IGNORE_DARK: diff --git a/src/data/berry.ts b/src/data/berry.ts index d0c9c311e16..01325ee39dd 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -1,14 +1,14 @@ import { getPokemonNameWithAffix } from "../messages"; import Pokemon, { HitResult } from "../field/pokemon"; -import { BattleStat } from "./battle-stat"; import { getStatusEffectHealText } from "./status-effect"; import * as Utils from "../utils"; import { DoubleBerryEffectAbAttr, ReduceBerryUseThresholdAbAttr, applyAbAttrs } from "./ability"; import i18next from "i18next"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; -import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase.js"; -import { StatChangePhase } from "#app/phases/stat-change-phase.js"; +import { Stat, type BattleStat } from "#app/enums/stat"; +import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; export function getBerryName(berryType: BerryType): string { return i18next.t(`berry:${BerryType[berryType]}.name`); @@ -35,9 +35,10 @@ export function getBerryPredicate(berryType: BerryType): BerryPredicate { case BerryType.SALAC: return (pokemon: Pokemon) => { const threshold = new Utils.NumberHolder(0.25); - const battleStat = (berryType - BerryType.LIECHI) as BattleStat; + // Offset BerryType such that LIECHI -> Stat.ATK = 1, GANLON -> Stat.DEF = 2, so on and so forth + const stat: BattleStat = berryType - BerryType.ENIGMA; applyAbAttrs(ReduceBerryUseThresholdAbAttr, pokemon, null, false, threshold); - return pokemon.getHpRatio() < threshold.value && pokemon.summonData.battleStats[battleStat] < 6; + return pokemon.getHpRatio() < threshold.value && pokemon.getStatStage(stat) < 6; }; case BerryType.LANSAT: return (pokemon: Pokemon) => { @@ -95,10 +96,11 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc { if (pokemon.battleData) { pokemon.battleData.berriesEaten.push(berryType); } - const battleStat = (berryType - BerryType.LIECHI) as BattleStat; - const statLevels = new Utils.NumberHolder(1); - applyAbAttrs(DoubleBerryEffectAbAttr, pokemon, null, false, statLevels); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ battleStat ], statLevels.value)); + // Offset BerryType such that LIECHI -> Stat.ATK = 1, GANLON -> Stat.DEF = 2, so on and so forth + const stat: BattleStat = berryType - BerryType.ENIGMA; + const statStages = new Utils.NumberHolder(1); + applyAbAttrs(DoubleBerryEffectAbAttr, pokemon, null, false, statStages); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], statStages.value)); }; case BerryType.LANSAT: return (pokemon: Pokemon) => { @@ -112,9 +114,10 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc { if (pokemon.battleData) { pokemon.battleData.berriesEaten.push(berryType); } - const statLevels = new Utils.NumberHolder(2); - applyAbAttrs(DoubleBerryEffectAbAttr, pokemon, null, false, statLevels); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ BattleStat.RAND ], statLevels.value)); + const randStat = Utils.randSeedInt(Stat.SPD, Stat.ATK); + const stages = new Utils.NumberHolder(2); + applyAbAttrs(DoubleBerryEffectAbAttr, pokemon, null, false, stages); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ randStat ], stages.value)); }; case BerryType.LEPPA: return (pokemon: Pokemon) => { diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 721231f9cb0..0e37cc94ff5 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1,6 +1,6 @@ import { Type } from "./type"; import * as Utils from "../utils"; -import {pokemonEvolutions, SpeciesFormEvolution} from "./pokemon-evolutions"; +import { pokemonEvolutions, SpeciesFormEvolution } from "./pokemon-evolutions"; import i18next from "i18next"; import { Biome } from "#enums/biome"; import { Species } from "#enums/species"; @@ -46,7 +46,7 @@ export const biomeLinks: BiomeLinks = { [Biome.SEABED]: [ Biome.CAVE, [ Biome.VOLCANO, 3 ] ], [Biome.MOUNTAIN]: [ Biome.VOLCANO, [ Biome.WASTELAND, 2 ], [ Biome.SPACE, 3 ] ], [Biome.BADLANDS]: [ Biome.DESERT, Biome.MOUNTAIN ], - [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE [ Biome.LABORATORY, 2 ] ], + [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE, [ Biome.LABORATORY, 2 ] ], [Biome.DESERT]: [ Biome.RUINS, [ Biome.CONSTRUCTION_SITE, 2 ] ], [Biome.ICE_CAVE]: Biome.SNOWY_FOREST, [Biome.MEADOW]: [ Biome.PLAINS, Biome.FAIRY_CAVE ], diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 36f696e63c1..62751b92f9c 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -13,7 +13,6 @@ import { TrainerType } from "#enums/trainer-type"; import { Nature } from "./nature"; import { Moves } from "#app/enums/moves.js"; import { TypeColor, TypeShadow } from "#app/enums/color.js"; -import { Gender } from "./gender"; import { pokemonEvolutions } from "./pokemon-evolutions"; import { pokemonFormChanges } from "./pokemon-forms"; @@ -659,7 +658,6 @@ export class FreshStartChallenge extends Challenge { pokemon.luck = 0; // No luck pokemon.shiny = false; // Not shiny pokemon.variant = 0; // Not shiny - pokemon.gender = Gender.MALE; // Starters default to male pokemon.formIndex = 0; // Froakie should be base form pokemon.ivs = [10, 10, 10, 10, 10, 10]; // Default IVs of 10 for all stats return true; diff --git a/src/data/egg-hatch-data.ts b/src/data/egg-hatch-data.ts new file mode 100644 index 00000000000..e754a9205c4 --- /dev/null +++ b/src/data/egg-hatch-data.ts @@ -0,0 +1,98 @@ +import BattleScene from "#app/battle-scene"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { DexEntry, StarterDataEntry } from "#app/system/game-data"; + +/** + * Stores data associated with a specific egg and the hatched pokemon + * Allows hatch info to be stored at hatch then retrieved for display during egg summary + */ +export class EggHatchData { + /** the pokemon that hatched from the file (including shiny, IVs, ability) */ + public pokemon: PlayerPokemon; + /** index of the egg move from the hatched pokemon (not stored in PlayerPokemon) */ + public eggMoveIndex: number; + /** boolean indicating if the egg move for the hatch is new */ + public eggMoveUnlocked: boolean; + /** stored copy of the hatched pokemon's dex entry before it was updated due to hatch */ + public dexEntryBeforeUpdate: DexEntry; + /** stored copy of the hatched pokemon's starter entry before it was updated due to hatch */ + public starterDataEntryBeforeUpdate: StarterDataEntry; + /** reference to the battle scene to get gamedata and update dex */ + private scene: BattleScene; + + constructor(scene: BattleScene, pokemon: PlayerPokemon, eggMoveIndex: number) { + this.scene = scene; + this.pokemon = pokemon; + this.eggMoveIndex = eggMoveIndex; + } + + /** + * Sets the boolean for if the egg move for the hatch is a new unlock + * @param unlocked True if the EM is new + */ + setEggMoveUnlocked(unlocked: boolean) { + this.eggMoveUnlocked = unlocked; + } + + /** + * Stores a copy of the current DexEntry of the pokemon and StarterDataEntry of its starter + * Used before updating the dex, so comparing the pokemon to these entries will show the new attributes + */ + setDex() { + const currDexEntry = this.scene.gameData.dexData[this.pokemon.species.speciesId]; + const currStarterDataEntry = this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()]; + this.dexEntryBeforeUpdate = { + seenAttr: currDexEntry.seenAttr, + caughtAttr: currDexEntry.caughtAttr, + natureAttr: currDexEntry.natureAttr, + seenCount: currDexEntry.seenCount, + caughtCount: currDexEntry.caughtCount, + hatchedCount: currDexEntry.hatchedCount, + ivs: [...currDexEntry.ivs] + }; + this.starterDataEntryBeforeUpdate = { + moveset: currStarterDataEntry.moveset, + eggMoves: currStarterDataEntry.eggMoves, + candyCount: currStarterDataEntry.candyCount, + friendship: currStarterDataEntry.friendship, + abilityAttr: currStarterDataEntry.abilityAttr, + passiveAttr: currStarterDataEntry.passiveAttr, + valueReduction: currStarterDataEntry.valueReduction, + classicWinCount: currStarterDataEntry.classicWinCount + }; + } + + /** + * Gets the dex entry before update + * @returns Dex Entry corresponding to this pokemon before the pokemon was added / updated to dex + */ + getDex(): DexEntry { + return this.dexEntryBeforeUpdate; + } + + /** + * Gets the starter dex entry before update + * @returns Starter Dex Entry corresponding to this pokemon before the pokemon was added / updated to dex + */ + getStarterEntry(): StarterDataEntry { + return this.starterDataEntryBeforeUpdate; + } + + /** + * Update the pokedex data corresponding with the new hatch's pokemon data + * Also sets whether the egg move is a new unlock or not + * @param showMessage boolean to show messages for the new catches and egg moves (false by default) + * @returns + */ + updatePokemon(showMessage : boolean = false) { + return new Promise(resolve => { + this.scene.gameData.setPokemonCaught(this.pokemon, true, true, showMessage).then(() => { + this.scene.gameData.updateSpeciesDexIvs(this.pokemon.species.speciesId, this.pokemon.ivs); + this.scene.gameData.setEggMoveUnlocked(this.pokemon.species, this.eggMoveIndex, showMessage).then((value) => { + this.setEggMoveUnlocked(value); + resolve(); + }); + }); + }); + } +} diff --git a/src/data/egg.ts b/src/data/egg.ts index 3e872d364f3..508263c9c8e 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -15,7 +15,7 @@ export const EGG_SEED = 1073741824; // Rates for specific random properties in 1/x const DEFAULT_SHINY_RATE = 128; const GACHA_SHINY_UP_SHINY_RATE = 64; -const SAME_SPECIES_EGG_SHINY_RATE = 24; +const SAME_SPECIES_EGG_SHINY_RATE = 12; const SAME_SPECIES_EGG_HA_RATE = 8; const MANAPHY_EGG_MANAPHY_RATE = 8; const GACHA_EGG_HA_RATE = 192; @@ -139,46 +139,57 @@ export class Egg { //// constructor(eggOptions?: IEggOptions) { - //if (eggOptions.tier && eggOptions.species) throw Error("Error egg can't have species and tier as option. only choose one of them.") + const generateEggProperties = (eggOptions?: IEggOptions) => { + //if (eggOptions.tier && eggOptions.species) throw Error("Error egg can't have species and tier as option. only choose one of them.") - this._sourceType = eggOptions?.sourceType!; // TODO: is this bang correct? - // Ensure _sourceType is defined before invoking rollEggTier(), as it is referenced - this._tier = eggOptions?.tier ?? (Overrides.EGG_TIER_OVERRIDE ?? this.rollEggTier()); - // If egg was pulled, check if egg pity needs to override the egg tier - if (eggOptions?.pulled) { - // Needs this._tier and this._sourceType to work - this.checkForPityTierOverrides(eggOptions.scene!); // TODO: is this bang correct? - } + this._sourceType = eggOptions?.sourceType!; // TODO: is this bang correct? + // Ensure _sourceType is defined before invoking rollEggTier(), as it is referenced + this._tier = eggOptions?.tier ?? (Overrides.EGG_TIER_OVERRIDE ?? this.rollEggTier()); + // If egg was pulled, check if egg pity needs to override the egg tier + if (eggOptions?.pulled) { + // Needs this._tier and this._sourceType to work + this.checkForPityTierOverrides(eggOptions.scene!); // TODO: is this bang correct? + } - this._id = eggOptions?.id ?? Utils.randInt(EGG_SEED, EGG_SEED * this._tier); + this._id = eggOptions?.id ?? Utils.randInt(EGG_SEED, EGG_SEED * this._tier); - this._sourceType = eggOptions?.sourceType ?? undefined; - this._hatchWaves = eggOptions?.hatchWaves ?? this.getEggTierDefaultHatchWaves(); - this._timestamp = eggOptions?.timestamp ?? new Date().getTime(); + this._sourceType = eggOptions?.sourceType ?? undefined; + this._hatchWaves = eggOptions?.hatchWaves ?? this.getEggTierDefaultHatchWaves(); + this._timestamp = eggOptions?.timestamp ?? new Date().getTime(); - // First roll shiny and variant so we can filter if species with an variant exist - this._isShiny = eggOptions?.isShiny ?? (Overrides.EGG_SHINY_OVERRIDE || this.rollShiny()); - this._variantTier = eggOptions?.variantTier ?? (Overrides.EGG_VARIANT_OVERRIDE ?? this.rollVariant()); - this._species = eggOptions?.species ?? this.rollSpecies(eggOptions!.scene!)!; // TODO: Are those bangs correct? + // First roll shiny and variant so we can filter if species with an variant exist + this._isShiny = eggOptions?.isShiny ?? (Overrides.EGG_SHINY_OVERRIDE || this.rollShiny()); + this._variantTier = eggOptions?.variantTier ?? (Overrides.EGG_VARIANT_OVERRIDE ?? this.rollVariant()); + this._species = eggOptions?.species ?? this.rollSpecies(eggOptions!.scene!)!; // TODO: Are those bangs correct? - this._overrideHiddenAbility = eggOptions?.overrideHiddenAbility ?? false; + this._overrideHiddenAbility = eggOptions?.overrideHiddenAbility ?? false; - // Override egg tier and hatchwaves if species was given - if (eggOptions?.species) { - this._tier = this.getEggTierFromSpeciesStarterValue(); - this._hatchWaves = eggOptions.hatchWaves ?? this.getEggTierDefaultHatchWaves(); - } - // If species has no variant, set variantTier to common. This needs to - // be done because species with no variants get filtered at rollSpecies but if the - // species is set via options or the legendary gacha pokemon gets choosen the check never happens - if (this._species && !getPokemonSpecies(this._species).hasVariants()) { - this._variantTier = VariantTier.COMMON; - } - // Needs this._tier so it needs to be generated afer the tier override if bought from same species - this._eggMoveIndex = eggOptions?.eggMoveIndex ?? this.rollEggMoveIndex(); - if (eggOptions?.pulled) { - this.increasePullStatistic(eggOptions.scene!); // TODO: is this bang correct? - this.addEggToGameData(eggOptions.scene!); // TODO: is this bang correct? + // Override egg tier and hatchwaves if species was given + if (eggOptions?.species) { + this._tier = this.getEggTierFromSpeciesStarterValue(); + this._hatchWaves = eggOptions.hatchWaves ?? this.getEggTierDefaultHatchWaves(); + } + // If species has no variant, set variantTier to common. This needs to + // be done because species with no variants get filtered at rollSpecies but if the + // species is set via options or the legendary gacha pokemon gets choosen the check never happens + if (this._species && !getPokemonSpecies(this._species).hasVariants()) { + this._variantTier = VariantTier.COMMON; + } + // Needs this._tier so it needs to be generated afer the tier override if bought from same species + this._eggMoveIndex = eggOptions?.eggMoveIndex ?? this.rollEggMoveIndex(); + if (eggOptions?.pulled) { + this.increasePullStatistic(eggOptions.scene!); // TODO: is this bang correct? + this.addEggToGameData(eggOptions.scene!); // TODO: is this bang correct? + } + }; + + if (eggOptions?.scene) { + const seedOverride = Utils.randomString(24); + eggOptions?.scene.executeWithSeedOffset(() => { + generateEggProperties(eggOptions); + }, 0, seedOverride); + } else { // For legacy eggs without scene + generateEggProperties(eggOptions); } } @@ -200,37 +211,46 @@ export class Egg { // Generates a PlayerPokemon from an egg public generatePlayerPokemon(scene: BattleScene): PlayerPokemon { - // Legacy egg wants to hatch. Generate missing properties - if (!this._species) { - this._isShiny = this.rollShiny(); - this._species = this.rollSpecies(scene!)!; // TODO: are these bangs correct? - } + let ret: PlayerPokemon; - let pokemonSpecies = getPokemonSpecies(this._species); - // Special condition to have Phione eggs also have a chance of generating Manaphy - if (this._species === Species.PHIONE) { - pokemonSpecies = getPokemonSpecies(Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE) ? Species.PHIONE : Species.MANAPHY); - } + const generatePlayerPokemonHelper = (scene: BattleScene) => { + // Legacy egg wants to hatch. Generate missing properties + if (!this._species) { + this._isShiny = this.rollShiny(); + this._species = this.rollSpecies(scene!)!; // TODO: are these bangs correct? + } - // Sets the hidden ability if a hidden ability exists and - // the override is set or the egg hits the chance - let abilityIndex: number | undefined = undefined; - const sameSpeciesEggHACheck = (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE)); - const gachaEggHACheck = (!(this._sourceType === EggSourceType.SAME_SPECIES_EGG) && !Utils.randSeedInt(GACHA_EGG_HA_RATE)); - if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility || sameSpeciesEggHACheck || gachaEggHACheck)) { - abilityIndex = 2; - } + let pokemonSpecies = getPokemonSpecies(this._species); + // Special condition to have Phione eggs also have a chance of generating Manaphy + if (this._species === Species.PHIONE) { + pokemonSpecies = getPokemonSpecies(Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE) ? Species.PHIONE : Species.MANAPHY); + } - // This function has way to many optional parameters - const ret: PlayerPokemon = scene.addPlayerPokemon(pokemonSpecies, 1, abilityIndex, undefined, undefined, false); - ret.shiny = this._isShiny; - ret.variant = this._variantTier; + // Sets the hidden ability if a hidden ability exists and + // the override is set or the egg hits the chance + let abilityIndex: number | undefined = undefined; + const sameSpeciesEggHACheck = (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE)); + const gachaEggHACheck = (!(this._sourceType === EggSourceType.SAME_SPECIES_EGG) && !Utils.randSeedInt(GACHA_EGG_HA_RATE)); + if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility || sameSpeciesEggHACheck || gachaEggHACheck)) { + abilityIndex = 2; + } - const secondaryIvs = Utils.getIvsFromId(Utils.randSeedInt(4294967295)); + // This function has way to many optional parameters + ret = scene.addPlayerPokemon(pokemonSpecies, 1, abilityIndex, undefined, undefined, false); + ret.shiny = this._isShiny; + ret.variant = this._variantTier; - for (let s = 0; s < ret.ivs.length; s++) { - ret.ivs[s] = Math.max(ret.ivs[s], secondaryIvs[s]); - } + const secondaryIvs = Utils.getIvsFromId(Utils.randSeedInt(4294967295)); + + for (let s = 0; s < ret.ivs.length; s++) { + ret.ivs[s] = Math.max(ret.ivs[s], secondaryIvs[s]); + } + }; + + ret = ret!; // Tell TS compiler it's defined now + scene.executeWithSeedOffset(() => { + generatePlayerPokemonHelper(scene); + }, this._id, EGG_SEED.toString()); return ret; } diff --git a/src/data/move.ts b/src/data/move.ts index 1dc715f264a..96b780a8330 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1,5 +1,4 @@ import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims"; -import { BattleStat, getBattleStatName } from "./battle-stat"; import { EncoreTag, GulpMissileTag, HelpingHandTag, SemiInvulnerableTag, ShellTrapTag, StockpilingTag, TrappedTag, TypeBoostTag } from "./battler-tags"; import { getPokemonNameWithAffix } from "../messages"; import Pokemon, { AttackMoveResult, EnemyPokemon, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../field/pokemon"; @@ -13,7 +12,6 @@ import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilit import { allAbilities } from "./ability"; import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier, PokemonMoveAccuracyBoosterModifier, AttackTypeBoosterModifier, PokemonMultiHitModifier } from "../modifier/modifier"; import { BattlerIndex, BattleType } from "../battle"; -import { Stat } from "./pokemon-stat"; import { TerrainType } from "./terrain"; import { ModifierPoolType } from "#app/modifier/modifier-type"; import { Command } from "../ui/command-ui-handler"; @@ -27,13 +25,14 @@ import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { MoveUsedEvent } from "#app/events/battle-scene"; +import { Stat, type BattleStat, type EffectiveStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat"; import { PartyStatusCurePhase } from "#app/phases/party-status-cure-phase"; import { BattleEndPhase } from "#app/phases/battle-end-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 { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; -import { StatChangePhase } from "#app/phases/stat-change-phase"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { SwitchPhase } from "#app/phases/switch-phase"; import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; import { SpeciesFormChangeRevertWeatherFormTrigger } from "./pokemon-forms"; @@ -762,8 +761,7 @@ export default class Move implements Localizable { .flat(), ); for (const aura of fieldAuras) { - // The only relevant values are `move` and the `power` holder - aura.applyPreAttack(null, null, simulated, null, this, [power]); + aura.applyPreAttack(source, null, simulated, target, this, [power]); } const alliedField: Pokemon[] = source instanceof PlayerPokemon ? source.scene.getPlayerField() : source.scene.getEnemyField(); @@ -819,10 +817,10 @@ export class AttackMove extends Move { attackScore = Math.pow(effectiveness - 1, 2) * effectiveness < 1 ? -2 : 2; if (attackScore) { if (this.category === MoveCategory.PHYSICAL) { - const atk = new Utils.IntegerHolder(user.getBattleStat(Stat.ATK, target)); + const atk = new Utils.IntegerHolder(user.getEffectiveStat(Stat.ATK, target)); applyMoveAttrs(VariableAtkAttr, user, target, move, atk); - if (atk.value > user.getBattleStat(Stat.SPATK, target)) { - const statRatio = user.getBattleStat(Stat.SPATK, target) / atk.value; + if (atk.value > user.getEffectiveStat(Stat.SPATK, target)) { + const statRatio = user.getEffectiveStat(Stat.SPATK, target) / atk.value; if (statRatio <= 0.75) { attackScore *= 2; } else if (statRatio <= 0.875) { @@ -830,10 +828,10 @@ export class AttackMove extends Move { } } } else { - const spAtk = new Utils.IntegerHolder(user.getBattleStat(Stat.SPATK, target)); + const spAtk = new Utils.IntegerHolder(user.getEffectiveStat(Stat.SPATK, target)); applyMoveAttrs(VariableAtkAttr, user, target, move, spAtk); - if (spAtk.value > user.getBattleStat(Stat.ATK, target)) { - const statRatio = user.getBattleStat(Stat.ATK, target) / spAtk.value; + if (spAtk.value > user.getEffectiveStat(Stat.ATK, target)) { + const statRatio = user.getEffectiveStat(Stat.ATK, target) / spAtk.value; if (statRatio <= 0.75) { attackScore *= 2; } else if (statRatio <= 0.875) { @@ -1100,9 +1098,9 @@ export class PreMoveMessageAttr extends MoveAttr { */ export class RespectAttackTypeImmunityAttr extends MoveAttr { } -export class IgnoreOpponentStatChangesAttr extends MoveAttr { +export class IgnoreOpponentStatStagesAttr extends MoveAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - (args[0] as Utils.IntegerHolder).value = 0; + (args[0] as Utils.BooleanHolder).value = true; return true; } @@ -1730,10 +1728,9 @@ export class HealOnAllyAttr extends HealAttr { */ export class HitHealAttr extends MoveEffectAttr { private healRatio: number; - private message: string; - private healStat: Stat | null; + private healStat: EffectiveStat | null; - constructor(healRatio?: number | null, healStat?: Stat) { + constructor(healRatio?: number | null, healStat?: EffectiveStat) { super(true, MoveEffectTrigger.HIT); this.healRatio = healRatio ?? 0.5; @@ -1755,7 +1752,7 @@ export class HitHealAttr extends MoveEffectAttr { const reverseDrain = target.hasAbilityWithAttr(ReverseDrainAbAttr, false); if (this.healStat !== null) { // Strength Sap formula - healAmount = target.getBattleStat(this.healStat); + healAmount = target.getEffectiveStat(this.healStat); message = i18next.t("battle:drainMessage", {pokemonName: getPokemonNameWithAffix(target)}); } else { // Default healing formula used by draining moves like Absorb, Draining Kiss, Bitter Blade, etc. @@ -1785,7 +1782,7 @@ export class HitHealAttr extends MoveEffectAttr { */ getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { if (this.healStat) { - const healAmount = target.getBattleStat(this.healStat); + const healAmount = target.getEffectiveStat(this.healStat); return Math.floor(Math.max(0, (Math.min(1, (healAmount+user.hp)/user.getMaxHp() - 0.33))) / user.getHpRatio()); } return Math.floor(Math.max((1 - user.getHpRatio()) - 0.33, 0) * (move.power / 4)); @@ -2516,14 +2513,14 @@ export class ElectroShotChargeAttr extends ChargeAttr { const weatherType = user.scene.arena.weather?.weatherType; if (!user.scene.arena.weather?.isEffectSuppressed(user.scene) && (weatherType === WeatherType.RAIN || weatherType === WeatherType.HEAVY_RAIN)) { // Apply the SPATK increase every call when used in the rain - const statChangeAttr = new StatChangeAttr(BattleStat.SPATK, 1, true); + const statChangeAttr = new StatStageChangeAttr([ Stat.SPATK ], 1, true); statChangeAttr.apply(user, target, move, args); // After the SPATK is raised, execute the move resolution e.g. deal damage resolve(false); } else { if (!this.statIncreaseApplied) { // Apply the SPATK increase only if it hasn't been applied before e.g. on the first turn charge up animation - const statChangeAttr = new StatChangeAttr(BattleStat.SPATK, 1, true); + const statChangeAttr = new StatStageChangeAttr([ Stat.SPATK ], 1, true); statChangeAttr.apply(user, target, move, args); // Set the flag to true so that on the following turn it doesn't raise SPATK a second time this.statIncreaseApplied = true; @@ -2571,18 +2568,16 @@ export class DelayedAttackAttr extends OverrideMoveEffectAttr { } } -export class StatChangeAttr extends MoveEffectAttr { +export class StatStageChangeAttr extends MoveEffectAttr { public stats: BattleStat[]; - public levels: integer; + public stages: integer; private condition: MoveConditionFunc | null; private showMessage: boolean; - constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean, condition?: MoveConditionFunc | null, showMessage: boolean = true, firstHitOnly: boolean = false, moveEffectTrigger: MoveEffectTrigger = MoveEffectTrigger.HIT, firstTargetOnly: boolean = false) { + constructor(stats: BattleStat[], stages: integer, selfTarget?: boolean, condition?: MoveConditionFunc | null, showMessage: boolean = true, firstHitOnly: boolean = false, moveEffectTrigger: MoveEffectTrigger = MoveEffectTrigger.HIT, firstTargetOnly: boolean = false) { super(selfTarget, moveEffectTrigger, firstHitOnly, false, firstTargetOnly); - this.stats = typeof(stats) === "number" - ? [ stats as BattleStat ] - : stats as BattleStat[]; - this.levels = levels; + this.stats = stats; + this.stages = stages; this.condition = condition!; // TODO: is this bang correct? this.showMessage = showMessage; } @@ -2594,8 +2589,8 @@ export class StatChangeAttr extends MoveEffectAttr { const moveChance = this.getMoveChance(user, target, move, this.selfTarget, true); if (moveChance < 0 || moveChance === 100 || user.randSeedInt(100) < moveChance) { - const levels = this.getLevels(user); - user.scene.unshiftPhase(new StatChangePhase(user.scene, (this.selfTarget ? user : target).getBattlerIndex(), this.selfTarget, this.stats, levels, this.showMessage)); + const stages = this.getLevels(user); + user.scene.unshiftPhase(new StatStageChangePhase(user.scene, (this.selfTarget ? user : target).getBattlerIndex(), this.selfTarget, this.stats, stages, this.showMessage)); return true; } @@ -2603,7 +2598,7 @@ export class StatChangeAttr extends MoveEffectAttr { } getLevels(_user: Pokemon): integer { - return this.levels; + return this.stages; } getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { @@ -2611,29 +2606,30 @@ export class StatChangeAttr extends MoveEffectAttr { const moveLevels = this.getLevels(user); for (const stat of this.stats) { let levels = moveLevels; + const statStage = target.getStatStage(stat); if (levels > 0) { - levels = Math.min(target.summonData.battleStats[stat] + levels, 6) - target.summonData.battleStats[stat]; + levels = Math.min(statStage + levels, 6) - statStage; } else { - levels = Math.max(target.summonData.battleStats[stat] + levels, -6) - target.summonData.battleStats[stat]; + levels = Math.max(statStage + levels, -6) - statStage; } let noEffect = false; switch (stat) { - case BattleStat.ATK: + case Stat.ATK: if (this.selfTarget) { noEffect = !user.getMoveset().find(m => m instanceof AttackMove && m.category === MoveCategory.PHYSICAL); } break; - case BattleStat.DEF: + case Stat.DEF: if (!this.selfTarget) { noEffect = !user.getMoveset().find(m => m instanceof AttackMove && m.category === MoveCategory.PHYSICAL); } break; - case BattleStat.SPATK: + case Stat.SPATK: if (this.selfTarget) { noEffect = !user.getMoveset().find(m => m instanceof AttackMove && m.category === MoveCategory.SPECIAL); } break; - case BattleStat.SPDEF: + case Stat.SPDEF: if (!this.selfTarget) { noEffect = !user.getMoveset().find(m => m instanceof AttackMove && m.category === MoveCategory.SPECIAL); } @@ -2648,18 +2644,16 @@ export class StatChangeAttr extends MoveEffectAttr { } } -export class PostVictoryStatChangeAttr extends MoveAttr { +export class PostVictoryStatStageChangeAttr extends MoveAttr { private stats: BattleStat[]; - private levels: integer; + private stages: number; private condition: MoveConditionFunc | null; private showMessage: boolean; - constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean, condition?: MoveConditionFunc, showMessage: boolean = true, firstHitOnly: boolean = false) { + constructor(stats: BattleStat[], stages: number, selfTarget?: boolean, condition?: MoveConditionFunc, showMessage: boolean = true, firstHitOnly: boolean = false) { super(); - this.stats = typeof(stats) === "number" - ? [ stats as BattleStat ] - : stats as BattleStat[]; - this.levels = levels; + this.stats = stats; + this.stages = stages; this.condition = condition!; // TODO: is this bang correct? this.showMessage = showMessage; } @@ -2667,49 +2661,48 @@ export class PostVictoryStatChangeAttr extends MoveAttr { if (this.condition && !this.condition(user, target, move)) { return; } - const statChangeAttr = new StatChangeAttr(this.stats, this.levels, this.showMessage); + const statChangeAttr = new StatStageChangeAttr(this.stats, this.stages, this.showMessage); statChangeAttr.apply(user, target, move); } } -export class AcupressureStatChangeAttr extends MoveEffectAttr { +export class AcupressureStatStageChangeAttr extends MoveEffectAttr { constructor() { super(); } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean | Promise { - let randStats = [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD, BattleStat.ACC, BattleStat.EVA ]; - randStats = randStats.filter(s => target.summonData.battleStats[s] < 6); + const randStats = BATTLE_STATS.filter(s => target.getStatStage(s) < 6); if (randStats.length > 0) { - const boostStat = [randStats[Utils.randInt(randStats.length)]]; - user.scene.unshiftPhase(new StatChangePhase(user.scene, target.getBattlerIndex(), this.selfTarget, boostStat, 2)); + const boostStat = [randStats[user.randSeedInt(randStats.length)]]; + user.scene.unshiftPhase(new StatStageChangePhase(user.scene, target.getBattlerIndex(), this.selfTarget, boostStat, 2)); return true; } return false; } } -export class GrowthStatChangeAttr extends StatChangeAttr { +export class GrowthStatStageChangeAttr extends StatStageChangeAttr { constructor() { - super([ BattleStat.ATK, BattleStat.SPATK ], 1, true); + super([ Stat.ATK, Stat.SPATK ], 1, true); } getLevels(user: Pokemon): number { if (!user.scene.arena.weather?.isEffectSuppressed(user.scene)) { const weatherType = user.scene.arena.weather?.weatherType; if (weatherType === WeatherType.SUNNY || weatherType === WeatherType.HARSH_SUN) { - return this.levels + 1; + return this.stages + 1; } } - return this.levels; + return this.stages; } } -export class CutHpStatBoostAttr extends StatChangeAttr { +export class CutHpStatStageBoostAttr extends StatStageChangeAttr { private cutRatio: integer; private messageCallback: ((user: Pokemon) => void) | undefined; - constructor(stat: BattleStat | BattleStat[], levels: integer, cutRatio: integer, messageCallback?: ((user: Pokemon) => void) | undefined) { + constructor(stat: BattleStat[], levels: integer, cutRatio: integer, messageCallback?: ((user: Pokemon) => void) | undefined) { super(stat, levels, true, null, true); this.cutRatio = cutRatio; @@ -2730,7 +2723,7 @@ export class CutHpStatBoostAttr extends StatChangeAttr { } getCondition(): MoveConditionFunc { - return (user, target, move) => user.getHpRatio() > 1 / this.cutRatio && this.stats.some(s => user.summonData.battleStats[s] < 6); + return (user, _target, _move) => user.getHpRatio() > 1 / this.cutRatio && this.stats.some(s => user.getStatStage(s) < 6); } } @@ -2740,9 +2733,11 @@ export class CopyStatsAttr extends MoveEffectAttr { return false; } - for (let s = 0; s < target.summonData.battleStats.length; s++) { - user.summonData.battleStats[s] = target.summonData.battleStats[s]; + // Copy all stat stages + for (const s of BATTLE_STATS) { + user.setStatStage(s, target.getStatStage(s)); } + if (target.getTag(BattlerTagType.CRIT_BOOST)) { user.addTag(BattlerTagType.CRIT_BOOST, 0, move.id); } else { @@ -2762,9 +2757,10 @@ export class InvertStatsAttr extends MoveEffectAttr { return false; } - for (let s = 0; s < target.summonData.battleStats.length; s++) { - target.summonData.battleStats[s] *= -1; + for (const s of BATTLE_STATS) { + target.setStatStage(s, -target.getStatStage(s)); } + target.updateInfo(); user.updateInfo(); @@ -2798,39 +2794,61 @@ export class ResetStatsAttr extends MoveEffectAttr { } resetStats(pokemon: Pokemon) { - for (let s = 0; s < pokemon.summonData.battleStats.length; s++) { - pokemon.summonData.battleStats[s] = 0; + for (const s of BATTLE_STATS) { + pokemon.setStatStage(s, 0); } pokemon.updateInfo(); } } /** - * Attribute used for moves which swap the user and the target's stat changes. + * Attribute used for status moves, specifically Heart, Guard, and Power Swap, + * that swaps the user's and target's corresponding stat stages. + * @extends MoveEffectAttr + * @see {@linkcode apply} */ -export class SwapStatsAttr extends MoveEffectAttr { +export class SwapStatStagesAttr extends MoveEffectAttr { + /** The stat stages to be swapped between the user and the target */ + private stats: readonly BattleStat[]; + + constructor(stats: readonly BattleStat[]) { + super(); + + this.stats = stats; + } + /** - * Swaps the user and the target's stat changes. - * @param user Pokemon that used the move - * @param target The target of the move - * @param move Move with this attribute + * For all {@linkcode stats}, swaps the user's and target's corresponding stat + * stage. + * @param user the {@linkcode Pokemon} that used the move + * @param target the {@linkcode Pokemon} that the move was used on + * @param move N/A * @param args N/A - * @returns true if the function succeeds + * @returns true if attribute application succeeds */ apply(user: Pokemon, target: Pokemon, move: Move, args: any []): boolean { - if (!super.apply(user, target, move, args)) { - return false; - } //Exits if the move can't apply - let priorBoost : integer; //For storing a stat boost - for (let s = 0; s < target.summonData.battleStats.length; s++) { - priorBoost = user.summonData.battleStats[s]; //Store user stat boost - user.summonData.battleStats[s] = target.summonData.battleStats[s]; //Applies target boost to self - target.summonData.battleStats[s] = priorBoost; //Applies stored boost to target + if (super.apply(user, target, move, args)) { + for (const s of BATTLE_STATS) { + const temp = user.getStatStage(s); + user.setStatStage(s, target.getStatStage(s)); + target.setStatStage(s, temp); + } + + target.updateInfo(); + user.updateInfo(); + + if (this.stats.length === 7) { + user.scene.queueMessage(i18next.t("moveTriggers:switchedStatChanges", { pokemonName: getPokemonNameWithAffix(user) })); + } else if (this.stats.length === 2) { + user.scene.queueMessage(i18next.t("moveTriggers:switchedTwoStatChanges", { + pokemonName: getPokemonNameWithAffix(user), + firstStat: i18next.t(getStatKey(this.stats[0])), + secondStat: i18next.t(getStatKey(this.stats[1])) + })); + } + return true; } - target.updateInfo(); - user.updateInfo(); - target.scene.queueMessage(i18next.t("moveTriggers:switchedStatChanges", {pokemonName: getPokemonNameWithAffix(user)})); - return true; + return false; } } @@ -3075,7 +3093,7 @@ export class WeightPowerAttr extends VariablePowerAttr { **/ export class ElectroBallPowerAttr extends VariablePowerAttr { /** - * Move that deals more damage the faster {@linkcode BattleStat.SPD} + * Move that deals more damage the faster {@linkcode Stat.SPD} * the user is compared to the target. * @param user Pokemon that used the move * @param target The target of the move @@ -3086,7 +3104,7 @@ export class ElectroBallPowerAttr extends VariablePowerAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const power = args[0] as Utils.NumberHolder; - const statRatio = target.getBattleStat(Stat.SPD) / user.getBattleStat(Stat.SPD); + const statRatio = target.getEffectiveStat(Stat.SPD) / user.getEffectiveStat(Stat.SPD); const statThresholds = [ 0.25, 1 / 3, 0.5, 1, -1 ]; const statThresholdPowers = [ 150, 120, 80, 60, 40 ]; @@ -3110,7 +3128,7 @@ export class ElectroBallPowerAttr extends VariablePowerAttr { **/ export class GyroBallPowerAttr extends VariablePowerAttr { /** - * Move that deals more damage the slower {@linkcode BattleStat.SPD} + * Move that deals more damage the slower {@linkcode Stat.SPD} * the user is compared to the target. * @param user Pokemon that used the move * @param target The target of the move @@ -3120,14 +3138,14 @@ export class GyroBallPowerAttr extends VariablePowerAttr { */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const power = args[0] as Utils.NumberHolder; - const userSpeed = user.getBattleStat(Stat.SPD); + const userSpeed = user.getEffectiveStat(Stat.SPD); if (userSpeed < 1) { // Gen 6+ always have 1 base power power.value = 1; return true; } - power.value = Math.floor(Math.min(150, 25 * target.getBattleStat(Stat.SPD) / userSpeed + 1)); + power.value = Math.floor(Math.min(150, 25 * target.getEffectiveStat(Stat.SPD) / userSpeed + 1)); return true; } } @@ -3347,18 +3365,18 @@ export class HitCountPowerAttr extends VariablePowerAttr { } /** - * Turning a once was (StatChangeCountPowerAttr) statement and making it available to call for any attribute. - * @param {Pokemon} pokemon The pokemon that is being used to calculate the count of positive stats - * @returns {number} Returns the amount of positive stats + * Tallies the number of positive stages for a given {@linkcode Pokemon}. + * @param pokemon The {@linkcode Pokemon} that is being used to calculate the count of positive stats + * @returns the amount of positive stats */ -const countPositiveStats = (pokemon: Pokemon): number => { - return pokemon.summonData.battleStats.reduce((total, stat) => (stat && stat > 0) ? total + stat : total, 0); +const countPositiveStatStages = (pokemon: Pokemon): number => { + return pokemon.getStatStages().reduce((total, stat) => (stat && stat > 0) ? total + stat : total, 0); }; /** - * Attribute that increases power based on the amount of positive stat increases. + * Attribute that increases power based on the amount of positive stat stage increases. */ -export class StatChangeCountPowerAttr extends VariablePowerAttr { +export class PositiveStatStagePowerAttr extends VariablePowerAttr { /** * @param {Pokemon} user The pokemon that is being used to calculate the amount of positive stats @@ -3368,9 +3386,9 @@ export class StatChangeCountPowerAttr extends VariablePowerAttr { * @returns {boolean} Returns true if attribute is applied */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - const positiveStats: number = countPositiveStats(user); + const positiveStatStages: number = countPositiveStatStages(user); - (args[0] as Utils.NumberHolder).value += positiveStats * 20; + (args[0] as Utils.NumberHolder).value += positiveStatStages * 20; return true; } } @@ -3392,10 +3410,10 @@ export class PunishmentPowerAttr extends VariablePowerAttr { * @returns Returns true if attribute is applied */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - const positiveStats: number = countPositiveStats(target); + const positiveStatStages: number = countPositiveStatStages(target); (args[0] as Utils.NumberHolder).value = Math.min( this.PUNISHMENT_MAX_BASE_POWER, - this.PUNISHMENT_MIN_BASE_POWER + positiveStats * 20 + this.PUNISHMENT_MIN_BASE_POWER + positiveStatStages * 20 ); return true; } @@ -3615,7 +3633,7 @@ export class TargetAtkUserAtkAttr extends VariableAtkAttr { super(); } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - (args[0] as Utils.IntegerHolder).value = target.getBattleStat(Stat.ATK, target); + (args[0] as Utils.IntegerHolder).value = target.getEffectiveStat(Stat.ATK, target); return true; } } @@ -3626,7 +3644,7 @@ export class DefAtkAttr extends VariableAtkAttr { } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - (args[0] as Utils.IntegerHolder).value = user.getBattleStat(Stat.DEF, target); + (args[0] as Utils.IntegerHolder).value = user.getEffectiveStat(Stat.DEF, target); return true; } } @@ -3648,7 +3666,7 @@ export class DefDefAttr extends VariableDefAttr { } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - (args[0] as Utils.IntegerHolder).value = target.getBattleStat(Stat.DEF, user); + (args[0] as Utils.IntegerHolder).value = target.getEffectiveStat(Stat.DEF, user); return true; } } @@ -3770,7 +3788,7 @@ export class PhotonGeyserCategoryAttr extends VariableMoveCategoryAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const category = (args[0] as Utils.NumberHolder); - if (user.getBattleStat(Stat.ATK, target, move) > user.getBattleStat(Stat.SPATK, target, move)) { + if (user.getEffectiveStat(Stat.ATK, target, move) > user.getEffectiveStat(Stat.SPATK, target, move)) { category.value = MoveCategory.PHYSICAL; return true; } @@ -3783,7 +3801,7 @@ export class TeraBlastCategoryAttr extends VariableMoveCategoryAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const category = (args[0] as Utils.NumberHolder); - if (user.isTerastallized() && user.getBattleStat(Stat.ATK, target, move) > user.getBattleStat(Stat.SPATK, target, move)) { + if (user.isTerastallized() && user.getEffectiveStat(Stat.ATK, target, move) > user.getEffectiveStat(Stat.SPATK, target, move)) { category.value = MoveCategory.PHYSICAL; return true; } @@ -3847,8 +3865,8 @@ export class StatusCategoryOnAllyAttr extends VariableMoveCategoryAttr { export class ShellSideArmCategoryAttr extends VariableMoveCategoryAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const category = (args[0] as Utils.IntegerHolder); - const atkRatio = user.getBattleStat(Stat.ATK, target, move) / target.getBattleStat(Stat.DEF, user, move); - const specialRatio = user.getBattleStat(Stat.SPATK, target, move) / target.getBattleStat(Stat.SPDEF, user, move); + const atkRatio = user.getEffectiveStat(Stat.ATK, target, move) / target.getEffectiveStat(Stat.DEF, user, move); + const specialRatio = user.getEffectiveStat(Stat.SPATK, target, move) / target.getEffectiveStat(Stat.SPDEF, user, move); // Shell Side Arm is much more complicated than it looks, this is a partial implementation to try to achieve something similar to the games if (atkRatio > specialRatio) { @@ -4314,72 +4332,6 @@ export class TypelessAttr extends MoveAttr { } */ export class BypassRedirectAttr extends MoveAttr { } -export class DisableMoveAttr extends MoveEffectAttr { - constructor() { - super(false); - } - - apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if (!super.apply(user, target, move, args)) { - return false; - } - - const moveQueue = target.getLastXMoves(); - let turnMove: TurnMove | undefined; - while (moveQueue.length) { - turnMove = moveQueue.shift(); - if (turnMove?.virtual) { - continue; - } - - const moveIndex = target.getMoveset().findIndex(m => m?.moveId === turnMove?.move); - if (moveIndex === -1) { - return false; - } - - const disabledMove = target.getMoveset()[moveIndex]; - target.summonData.disabledMove = disabledMove?.moveId!; // TODO: is this bang correct? - target.summonData.disabledTurns = 4; - - user.scene.queueMessage(i18next.t("abilityTriggers:postDefendMoveDisable", { pokemonNameWithAffix: getPokemonNameWithAffix(target), moveName: disabledMove?.getName()})); - - return true; - } - - return false; - } - - getCondition(): MoveConditionFunc { - return (user, target, move): boolean => { // TODO: Not sure what to do here - if (target.summonData.disabledMove || target.isMax()) { - return false; - } - - const moveQueue = target.getLastXMoves(); - let turnMove: TurnMove | undefined; - while (moveQueue.length) { - turnMove = moveQueue.shift(); - if (turnMove?.virtual) { - continue; - } - - const move = target.getMoveset().find(m => m?.moveId === turnMove?.move); - if (!move) { - continue; - } - - return true; - } - - return false; - }; - } - - getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { - return -5; - } -} - export class FrenzyAttr extends MoveEffectAttr { constructor() { super(true, MoveEffectTrigger.HIT, false, true); @@ -4448,7 +4400,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr { const moveChance = this.getMoveChance(user, target, move, this.selfTarget, true); if (moveChance < 0 || moveChance === 100 || user.randSeedInt(100) < moveChance) { - return (this.selfTarget ? user : target).addTag(this.tagType, user.randSeedInt(this.turnCountMax - this.turnCountMin, this.turnCountMin), move.id, user.id); + return (this.selfTarget ? user : target).addTag(this.tagType, user.randSeedIntRange(this.turnCountMin, this.turnCountMax), move.id, user.id); } return false; @@ -4470,6 +4422,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr { case BattlerTagType.INFATUATED: case BattlerTagType.NIGHTMARE: case BattlerTagType.DROWSY: + case BattlerTagType.DISABLED: return -5; case BattlerTagType.SEEDED: case BattlerTagType.SALT_CURED: @@ -4605,8 +4558,8 @@ export class CurseAttr extends MoveEffectAttr { target.addTag(BattlerTagType.CURSED, 0, move.id, user.id); return true; } else { - user.scene.unshiftPhase(new StatChangePhase(user.scene, user.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF], 1)); - user.scene.unshiftPhase(new StatChangePhase(user.scene, user.getBattlerIndex(), true, [BattleStat.SPD], -1)); + user.scene.unshiftPhase(new StatStageChangePhase(user.scene, user.getBattlerIndex(), true, [ Stat.ATK, Stat.DEF], 1)); + user.scene.unshiftPhase(new StatStageChangePhase(user.scene, user.getBattlerIndex(), true, [ Stat.SPD ], -1)); return true; } } @@ -5163,8 +5116,8 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { } let ret = this.user ? Math.floor((1 - user.getHpRatio()) * 20) : super.getUserBenefitScore(user, target, move); if (this.user && this.batonPass) { - const battleStatTotal = user.summonData.battleStats.reduce((bs: integer, total: integer) => total += bs, 0); - ret = ret / 2 + (Phaser.Tweens.Builders.GetEaseFunction("Sine.easeOut")(Math.min(Math.abs(battleStatTotal), 10) / 10) * (battleStatTotal >= 0 ? 10 : -10)); + const statStageTotal = user.getStatStages().reduce((s: integer, total: integer) => total += s, 0); + ret = ret / 2 + (Phaser.Tweens.Builders.GetEaseFunction("Sine.easeOut")(Math.min(Math.abs(statStageTotal), 10) / 10) * (statStageTotal >= 0 ? 10 : -10)); } return ret; } @@ -5989,8 +5942,17 @@ export class TransformAttr extends MoveEffectAttr { user.summonData.ability = target.getAbility().id; user.summonData.gender = target.getGender(); user.summonData.fusionGender = target.getFusionGender(); - user.summonData.stats = [ user.stats[Stat.HP] ].concat(target.stats.slice(1)); - user.summonData.battleStats = target.summonData.battleStats.slice(0); + + // Copy all stats (except HP) + for (const s of EFFECTIVE_STATS) { + user.setStat(s, target.getStat(s, false), false); + } + + // Copy all stat stages + for (const s of BATTLE_STATS) { + user.setStatStage(s, target.getStatStage(s)); + } + user.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m?.moveId!, m?.ppUsed, m?.ppUp)); // TODO: is this bang correct? user.summonData.types = target.getTypes(); @@ -5998,12 +5960,102 @@ export class TransformAttr extends MoveEffectAttr { user.loadAssets(false).then(() => { user.playAnim(); + user.updateInfo(); resolve(true); }); }); } } +/** + * Attribute used for status moves, namely Speed Swap, + * that swaps the user's and target's corresponding stats. + * @extends MoveEffectAttr + * @see {@linkcode apply} + */ +export class SwapStatAttr extends MoveEffectAttr { + /** The stat to be swapped between the user and the target */ + private stat: EffectiveStat; + + constructor(stat: EffectiveStat) { + super(); + + this.stat = stat; + } + + /** + * Takes the average of the user's and target's corresponding current + * {@linkcode stat} values and sets that stat to the average for both + * temporarily. + * @param user the {@linkcode Pokemon} that used the move + * @param target the {@linkcode Pokemon} that the move was used on + * @param move N/A + * @param args N/A + * @returns true if attribute application succeeds + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (super.apply(user, target, move, args)) { + const temp = user.getStat(this.stat, false); + user.setStat(this.stat, target.getStat(this.stat, false), false); + target.setStat(this.stat, temp, false); + + user.scene.queueMessage(i18next.t("moveTriggers:switchedStat", { + pokemonName: getPokemonNameWithAffix(user), + stat: i18next.t(getStatKey(this.stat)), + })); + + return true; + } + return false; + } +} + +/** + * Attribute used for status moves, namely Power Split and Guard Split, + * that take the average of a user's and target's corresponding + * stats and assign that average back to each corresponding stat. + * @extends MoveEffectAttr + * @see {@linkcode apply} + */ +export class AverageStatsAttr extends MoveEffectAttr { + /** The stats to be averaged individually between the user and the target */ + private stats: readonly EffectiveStat[]; + private msgKey: string; + + constructor(stats: readonly EffectiveStat[], msgKey: string) { + super(); + + this.stats = stats; + this.msgKey = msgKey; + } + + /** + * Takes the average of the user's and target's corresponding {@linkcode stat} + * values and sets those stats to the corresponding average for both + * temporarily. + * @param user the {@linkcode Pokemon} that used the move + * @param target the {@linkcode Pokemon} that the move was used on + * @param move N/A + * @param args N/A + * @returns true if attribute application succeeds + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (super.apply(user, target, move, args)) { + for (const s of this.stats) { + const avg = Math.floor((user.getStat(s, false) + target.getStat(s, false)) / 2); + + user.setStat(s, avg, false); + target.setStat(s, avg, false); + } + + user.scene.queueMessage(i18next.t(this.msgKey, { pokemonName: getPokemonNameWithAffix(user) })); + + return true; + } + return false; + } +} + export class DiscourageFrequentUseAttr extends MoveAttr { getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { const lastMoves = user.getLastXMoves(4); @@ -6072,7 +6124,7 @@ export class AddBattlerTagIfBoostedAttr extends AddBattlerTagAttr { * @returns true */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if (target.turnData.battleStatsIncreased) { + if (target.turnData.statStagesIncreased) { super.apply(user, target, move, args); } return true; @@ -6099,7 +6151,7 @@ export class StatusIfBoostedAttr extends MoveEffectAttr { * @returns true */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if (target.turnData.battleStatsIncreased) { + if (target.turnData.statStagesIncreased) { target.trySetStatus(this.effect, true, user); } return true; @@ -6182,6 +6234,8 @@ const userSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: const targetSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.status?.effect === StatusEffect.SLEEP || target.hasAbility(Abilities.COMATOSE); +const failIfLastCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => user.scene.phaseQueue.find(phase => phase instanceof MovePhase) !== undefined; + export type MoveAttrFilter = (attr: MoveAttr) => boolean; function applyMoveAttrsInternal(attrFilter: MoveAttrFilter, user: Pokemon | null, target: Pokemon | null, move: Move, args: any[]): Promise { @@ -6457,7 +6511,7 @@ export function initMoves() { .ignoresVirtual() .target(MoveTarget.ALL_NEAR_ENEMIES), new SelfStatusMove(Moves.SWORDS_DANCE, Type.NORMAL, -1, 20, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ATK, 2, true) + .attr(StatStageChangeAttr, [ Stat.ATK ], 2, true) .danceMove(), new AttackMove(Moves.CUT, Type.NORMAL, MoveCategory.PHYSICAL, 50, 95, 30, -1, 0, 1) .slicingMove(), @@ -6493,7 +6547,7 @@ export function initMoves() { new AttackMove(Moves.ROLLING_KICK, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 85, 15, 30, 0, 1) .attr(FlinchAttr), new StatusMove(Moves.SAND_ATTACK, Type.GROUND, 100, 15, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new AttackMove(Moves.HEADBUTT, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 15, 30, 0, 1) .attr(FlinchAttr), new AttackMove(Moves.HORN_ATTACK, Type.NORMAL, MoveCategory.PHYSICAL, 65, 100, 25, -1, 0, 1), @@ -6521,7 +6575,7 @@ export function initMoves() { .attr(RecoilAttr, false, 0.33) .recklessMove(), new StatusMove(Moves.TAIL_WHIP, Type.NORMAL, 100, 30, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.POISON_STING, Type.POISON, MoveCategory.PHYSICAL, 15, 100, 35, 30, 0, 1) .attr(StatusEffectAttr, StatusEffect.POISON) @@ -6534,13 +6588,13 @@ export function initMoves() { .attr(MultiHitAttr) .makesContact(false), new StatusMove(Moves.LEER, Type.NORMAL, 100, 30, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.BITE, Type.DARK, MoveCategory.PHYSICAL, 60, 100, 25, 30, 0, 1) .attr(FlinchAttr) .bitingMove(), new StatusMove(Moves.GROWL, Type.NORMAL, 100, 40, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ATK, -1) + .attr(StatStageChangeAttr, [ Stat.ATK ], -1) .soundBased() .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.ROAR, Type.NORMAL, -1, 20, -1, -6, 1) @@ -6556,10 +6610,11 @@ export function initMoves() { new AttackMove(Moves.SONIC_BOOM, Type.NORMAL, MoveCategory.SPECIAL, -1, 90, 20, -1, 0, 1) .attr(FixedDamageAttr, 20), new StatusMove(Moves.DISABLE, Type.NORMAL, 100, 20, -1, 0, 1) - .attr(DisableMoveAttr) + .attr(AddBattlerTagAttr, BattlerTagType.DISABLED, false, true) + .condition((user, target, move) => target.getMoveHistory().reverse().find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual) !== undefined) .condition(failOnMaxCondition), new AttackMove(Moves.ACID, Type.POISON, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1) - .attr(StatChangeAttr, BattleStat.SPDEF, -1) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.EMBER, Type.FIRE, MoveCategory.SPECIAL, 40, 100, 25, 10, 0, 1) .attr(StatusEffectAttr, StatusEffect.BURN), @@ -6584,9 +6639,9 @@ export function initMoves() { new AttackMove(Moves.PSYBEAM, Type.PSYCHIC, MoveCategory.SPECIAL, 65, 100, 20, 10, 0, 1) .attr(ConfuseAttr), new AttackMove(Moves.BUBBLE_BEAM, Type.WATER, MoveCategory.SPECIAL, 65, 100, 20, 10, 0, 1) - .attr(StatChangeAttr, BattleStat.SPD, -1), + .attr(StatStageChangeAttr, [ Stat.SPD ], -1), new AttackMove(Moves.AURORA_BEAM, Type.ICE, MoveCategory.SPECIAL, 65, 100, 20, 10, 0, 1) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new AttackMove(Moves.HYPER_BEAM, Type.NORMAL, MoveCategory.SPECIAL, 150, 90, 5, -1, 0, 1) .attr(RechargeAttr), new AttackMove(Moves.PECK, Type.FLYING, MoveCategory.PHYSICAL, 35, 100, 35, -1, 0, 1), @@ -6613,7 +6668,7 @@ export function initMoves() { .attr(AddBattlerTagAttr, BattlerTagType.SEEDED) .condition((user, target, move) => !target.getTag(BattlerTagType.SEEDED) && !target.isOfType(Type.GRASS)), new SelfStatusMove(Moves.GROWTH, Type.NORMAL, -1, 20, -1, 0, 1) - .attr(GrowthStatChangeAttr), + .attr(GrowthStatStageChangeAttr), new AttackMove(Moves.RAZOR_LEAF, Type.GRASS, MoveCategory.PHYSICAL, 55, 95, 25, -1, 0, 1) .attr(HighCritAttr) .makesContact(false) @@ -6640,7 +6695,7 @@ export function initMoves() { .danceMove() .target(MoveTarget.RANDOM_NEAR_ENEMY), new StatusMove(Moves.STRING_SHOT, Type.BUG, 95, 40, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.SPD, -2) + .attr(StatStageChangeAttr, [ Stat.SPD ], -2) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.DRAGON_RAGE, Type.DRAGON, MoveCategory.SPECIAL, -1, 100, 10, -1, 0, 1) .attr(FixedDamageAttr, 40), @@ -6677,13 +6732,13 @@ export function initMoves() { new AttackMove(Moves.CONFUSION, Type.PSYCHIC, MoveCategory.SPECIAL, 50, 100, 25, 10, 0, 1) .attr(ConfuseAttr), new AttackMove(Moves.PSYCHIC, Type.PSYCHIC, MoveCategory.SPECIAL, 90, 100, 10, 10, 0, 1) - .attr(StatChangeAttr, BattleStat.SPDEF, -1), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1), new StatusMove(Moves.HYPNOSIS, Type.PSYCHIC, 60, 20, -1, 0, 1) .attr(StatusEffectAttr, StatusEffect.SLEEP), new SelfStatusMove(Moves.MEDITATE, Type.PSYCHIC, -1, 40, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ATK, 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK ], 1, true), new SelfStatusMove(Moves.AGILITY, Type.PSYCHIC, -1, 30, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.SPD, 2, true), + .attr(StatStageChangeAttr, [ Stat.SPD ], 2, true), new AttackMove(Moves.QUICK_ATTACK, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 1), new AttackMove(Moves.RAGE, Type.NORMAL, MoveCategory.PHYSICAL, 20, 100, 20, -1, 0, 1) .partial(), @@ -6696,28 +6751,28 @@ export function initMoves() { .attr(MovesetCopyMoveAttr) .ignoresVirtual(), new StatusMove(Moves.SCREECH, Type.NORMAL, 85, 40, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, -2) + .attr(StatStageChangeAttr, [ Stat.DEF ], -2) .soundBased(), new SelfStatusMove(Moves.DOUBLE_TEAM, Type.NORMAL, -1, 15, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.EVA, 1, true), + .attr(StatStageChangeAttr, [ Stat.EVA ], 1, true), new SelfStatusMove(Moves.RECOVER, Type.NORMAL, -1, 5, -1, 0, 1) .attr(HealAttr, 0.5) .triageMove(), new SelfStatusMove(Moves.HARDEN, Type.NORMAL, -1, 30, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, true), new SelfStatusMove(Moves.MINIMIZE, Type.NORMAL, -1, 10, -1, 0, 1) .attr(AddBattlerTagAttr, BattlerTagType.MINIMIZED, true, false) - .attr(StatChangeAttr, BattleStat.EVA, 2, true), + .attr(StatStageChangeAttr, [ Stat.EVA ], 2, true), new StatusMove(Moves.SMOKESCREEN, Type.NORMAL, 100, 20, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new StatusMove(Moves.CONFUSE_RAY, Type.GHOST, 100, 10, -1, 0, 1) .attr(ConfuseAttr), new SelfStatusMove(Moves.WITHDRAW, Type.WATER, -1, 40, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, true), new SelfStatusMove(Moves.DEFENSE_CURL, Type.NORMAL, -1, 40, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, true), new SelfStatusMove(Moves.BARRIER, Type.PSYCHIC, -1, 20, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, 2, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true), new StatusMove(Moves.LIGHT_SCREEN, Type.PSYCHIC, -1, 30, -1, 0, 1) .attr(AddArenaTagAttr, ArenaTagType.LIGHT_SCREEN, 5, true) .target(MoveTarget.USER_SIDE), @@ -6765,17 +6820,17 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.SKULL_BASH, Type.NORMAL, MoveCategory.PHYSICAL, 130, 100, 10, -1, 0, 1) .attr(ChargeAttr, ChargeAnim.SKULL_BASH_CHARGING, i18next.t("moveTriggers:loweredItsHead", {pokemonName: "{USER}"}), null, true) - .attr(StatChangeAttr, BattleStat.DEF, 1, true) + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, true) .ignoresVirtual(), new AttackMove(Moves.SPIKE_CANNON, Type.NORMAL, MoveCategory.PHYSICAL, 20, 100, 15, -1, 0, 1) .attr(MultiHitAttr) .makesContact(false), new AttackMove(Moves.CONSTRICT, Type.NORMAL, MoveCategory.PHYSICAL, 10, 100, 35, 10, 0, 1) - .attr(StatChangeAttr, BattleStat.SPD, -1), + .attr(StatStageChangeAttr, [ Stat.SPD ], -1), new SelfStatusMove(Moves.AMNESIA, Type.PSYCHIC, -1, 20, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.SPDEF, 2, true), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], 2, true), new StatusMove(Moves.KINESIS, Type.PSYCHIC, 80, 15, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new SelfStatusMove(Moves.SOFT_BOILED, Type.NORMAL, -1, 5, -1, 0, 1) .attr(HealAttr, 0.5) .triageMove(), @@ -6812,7 +6867,7 @@ export function initMoves() { .attr(TransformAttr) .ignoresProtect(), new AttackMove(Moves.BUBBLE, Type.WATER, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.DIZZY_PUNCH, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 10, 20, 0, 1) .attr(ConfuseAttr) @@ -6821,13 +6876,13 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.SLEEP) .powderMove(), new StatusMove(Moves.FLASH, Type.NORMAL, 100, 20, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new AttackMove(Moves.PSYWAVE, Type.PSYCHIC, MoveCategory.SPECIAL, -1, 100, 15, -1, 0, 1) .attr(RandomLevelDamageAttr), new SelfStatusMove(Moves.SPLASH, Type.NORMAL, -1, 40, -1, 0, 1) .condition(failOnGravityCondition), new SelfStatusMove(Moves.ACID_ARMOR, Type.POISON, -1, 20, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.DEF, 2, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true), new AttackMove(Moves.CRABHAMMER, Type.WATER, MoveCategory.PHYSICAL, 100, 90, 10, -1, 0, 1) .attr(HighCritAttr), new AttackMove(Moves.EXPLOSION, Type.NORMAL, MoveCategory.PHYSICAL, 250, 100, 5, -1, 0, 1) @@ -6853,7 +6908,7 @@ export function initMoves() { .attr(FlinchAttr) .bitingMove(), new SelfStatusMove(Moves.SHARPEN, Type.NORMAL, -1, 30, -1, 0, 1) - .attr(StatChangeAttr, BattleStat.ATK, 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK ], 1, true), new SelfStatusMove(Moves.CONVERSION, Type.NORMAL, -1, 30, -1, 0, 1) .attr(FirstMoveTypeAttr), new AttackMove(Moves.TRI_ATTACK, Type.NORMAL, MoveCategory.SPECIAL, 80, 100, 10, 20, 0, 1) @@ -6908,7 +6963,7 @@ export function initMoves() { .windMove() .attr(HighCritAttr), new StatusMove(Moves.COTTON_SPORE, Type.GRASS, 100, 40, -1, 0, 2) - .attr(StatChangeAttr, BattleStat.SPD, -2) + .attr(StatStageChangeAttr, [ Stat.SPD ], -2) .powderMove() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.REVERSAL, Type.FIGHTING, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2) @@ -6919,25 +6974,26 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.FREEZE) .target(MoveTarget.ALL_NEAR_ENEMIES), new SelfStatusMove(Moves.PROTECT, Type.NORMAL, -1, 10, -1, 4, 2) - .attr(ProtectAttr), + .attr(ProtectAttr) + .condition(failIfLastCondition), new AttackMove(Moves.MACH_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 2) .punchingMove(), new StatusMove(Moves.SCARY_FACE, Type.NORMAL, 100, 10, -1, 0, 2) - .attr(StatChangeAttr, BattleStat.SPD, -2), + .attr(StatStageChangeAttr, [ Stat.SPD ], -2), new AttackMove(Moves.FEINT_ATTACK, Type.DARK, MoveCategory.PHYSICAL, 60, -1, 20, -1, 0, 2), new StatusMove(Moves.SWEET_KISS, Type.FAIRY, 75, 10, -1, 0, 2) .attr(ConfuseAttr), new SelfStatusMove(Moves.BELLY_DRUM, Type.NORMAL, -1, 10, -1, 0, 2) - .attr(CutHpStatBoostAttr, [BattleStat.ATK], 12, 2, (user) => { - user.scene.queueMessage(i18next.t("moveTriggers:cutOwnHpAndMaximizedStat", {pokemonName: getPokemonNameWithAffix(user), statName: getBattleStatName(BattleStat.ATK)})); + .attr(CutHpStatStageBoostAttr, [ Stat.ATK ], 12, 2, (user) => { + user.scene.queueMessage(i18next.t("moveTriggers:cutOwnHpAndMaximizedStat", { pokemonName: getPokemonNameWithAffix(user), statName: i18next.t(getStatKey(Stat.ATK)) })); }), new AttackMove(Moves.SLUDGE_BOMB, Type.POISON, MoveCategory.SPECIAL, 90, 100, 10, 30, 0, 2) .attr(StatusEffectAttr, StatusEffect.POISON) .ballBombMove(), new AttackMove(Moves.MUD_SLAP, Type.GROUND, MoveCategory.SPECIAL, 20, 100, 10, 100, 0, 2) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new AttackMove(Moves.OCTAZOOKA, Type.WATER, MoveCategory.SPECIAL, 65, 85, 10, 50, 0, 2) - .attr(StatChangeAttr, BattleStat.ACC, -1) + .attr(StatStageChangeAttr, [ Stat.ACC ], -1) .ballBombMove(), new StatusMove(Moves.SPIKES, Type.GROUND, -1, 20, -1, 0, 2) .attr(AddArenaTrapTagAttr, ArenaTagType.SPIKES) @@ -6966,11 +7022,12 @@ export function initMoves() { .condition(failOnBossCondition) .target(MoveTarget.ALL), new AttackMove(Moves.ICY_WIND, Type.ICE, MoveCategory.SPECIAL, 55, 95, 15, 100, 0, 2) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .windMove() .target(MoveTarget.ALL_NEAR_ENEMIES), new SelfStatusMove(Moves.DETECT, Type.FIGHTING, -1, 5, -1, 4, 2) - .attr(ProtectAttr), + .attr(ProtectAttr) + .condition(failIfLastCondition), new AttackMove(Moves.BONE_RUSH, Type.GROUND, MoveCategory.PHYSICAL, 25, 90, 10, -1, 0, 2) .attr(MultiHitAttr) .makesContact(false), @@ -6988,15 +7045,16 @@ export function initMoves() { .attr(HitHealAttr) .triageMove(), new SelfStatusMove(Moves.ENDURE, Type.NORMAL, -1, 10, -1, 4, 2) - .attr(ProtectAttr, BattlerTagType.ENDURING), + .attr(ProtectAttr, BattlerTagType.ENDURING) + .condition(failIfLastCondition), new StatusMove(Moves.CHARM, Type.FAIRY, 100, 20, -1, 0, 2) - .attr(StatChangeAttr, BattleStat.ATK, -2), + .attr(StatStageChangeAttr, [ Stat.ATK ], -2), new AttackMove(Moves.ROLLOUT, Type.ROCK, MoveCategory.PHYSICAL, 30, 90, 20, -1, 0, 2) .attr(ConsecutiveUseDoublePowerAttr, 5, true, true, Moves.DEFENSE_CURL), new AttackMove(Moves.FALSE_SWIPE, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 40, -1, 0, 2) .attr(SurviveDamageAttr), new StatusMove(Moves.SWAGGER, Type.NORMAL, 85, 15, -1, 0, 2) - .attr(StatChangeAttr, BattleStat.ATK, 2) + .attr(StatStageChangeAttr, [ Stat.ATK ], 2) .attr(ConfuseAttr), new SelfStatusMove(Moves.MILK_DRINK, Type.NORMAL, -1, 5, -1, 0, 2) .attr(HealAttr, 0.5) @@ -7007,7 +7065,7 @@ export function initMoves() { .attr(ConsecutiveUseDoublePowerAttr, 3, true) .slicingMove(), new AttackMove(Moves.STEEL_WING, Type.STEEL, MoveCategory.PHYSICAL, 70, 90, 25, 10, 0, 2) - .attr(StatChangeAttr, BattleStat.DEF, 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, true), new StatusMove(Moves.MEAN_LOOK, Type.NORMAL, -1, 5, -1, 0, 2) .attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, true, 1), new StatusMove(Moves.ATTRACT, Type.NORMAL, 100, 15, -1, 0, 2) @@ -7061,7 +7119,7 @@ export function initMoves() { new AttackMove(Moves.PURSUIT, Type.DARK, MoveCategory.PHYSICAL, 40, 100, 20, -1, 0, 2) .partial(), new AttackMove(Moves.RAPID_SPIN, Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, 100, 0, 2) - .attr(StatChangeAttr, BattleStat.SPD, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true) .attr(RemoveBattlerTagAttr, [ BattlerTagType.BIND, BattlerTagType.WRAP, @@ -7077,12 +7135,12 @@ export function initMoves() { ], true) .attr(RemoveArenaTrapAttr), new StatusMove(Moves.SWEET_SCENT, Type.NORMAL, 100, 20, -1, 0, 2) - .attr(StatChangeAttr, BattleStat.EVA, -2) + .attr(StatStageChangeAttr, [ Stat.EVA ], -2) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.IRON_TAIL, Type.STEEL, MoveCategory.PHYSICAL, 100, 75, 15, 30, 0, 2) - .attr(StatChangeAttr, BattleStat.DEF, -1), + .attr(StatStageChangeAttr, [ Stat.DEF ], -1), new AttackMove(Moves.METAL_CLAW, Type.STEEL, MoveCategory.PHYSICAL, 50, 95, 35, 10, 0, 2) - .attr(StatChangeAttr, BattleStat.ATK, 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK ], 1, true), new AttackMove(Moves.VITAL_THROW, Type.FIGHTING, MoveCategory.PHYSICAL, 70, -1, 10, -1, -1, 2), new SelfStatusMove(Moves.MORNING_SUN, Type.NORMAL, -1, 5, -1, 0, 2) .attr(PlantHealAttr) @@ -7109,7 +7167,7 @@ export function initMoves() { .attr(WeatherChangeAttr, WeatherType.SUNNY) .target(MoveTarget.BOTH_SIDES), new AttackMove(Moves.CRUNCH, Type.DARK, MoveCategory.PHYSICAL, 80, 100, 15, 20, 0, 2) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .bitingMove(), new AttackMove(Moves.MIRROR_COAT, Type.PSYCHIC, MoveCategory.SPECIAL, -1, 100, 20, -1, -5, 2) .attr(CounterDamageAttr, (move: Move) => move.category === MoveCategory.SPECIAL, 2) @@ -7118,15 +7176,15 @@ export function initMoves() { .attr(CopyStatsAttr), new AttackMove(Moves.EXTREME_SPEED, Type.NORMAL, MoveCategory.PHYSICAL, 80, 100, 5, -1, 2, 2), new AttackMove(Moves.ANCIENT_POWER, Type.ROCK, MoveCategory.SPECIAL, 60, 100, 5, 10, 0, 2) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, true), new AttackMove(Moves.SHADOW_BALL, Type.GHOST, MoveCategory.SPECIAL, 80, 100, 15, 20, 0, 2) - .attr(StatChangeAttr, BattleStat.SPDEF, -1) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1) .ballBombMove(), new AttackMove(Moves.FUTURE_SIGHT, Type.PSYCHIC, MoveCategory.SPECIAL, 120, 100, 10, -1, 0, 2) .partial() .attr(DelayedAttackAttr, ArenaTagType.FUTURE_SIGHT, ChargeAnim.FUTURE_SIGHT_CHARGING, i18next.t("moveTriggers:foresawAnAttack", {pokemonName: "{USER}"})), new AttackMove(Moves.ROCK_SMASH, Type.FIGHTING, MoveCategory.PHYSICAL, 40, 100, 15, 50, 0, 2) - .attr(StatChangeAttr, BattleStat.DEF, -1), + .attr(StatStageChangeAttr, [ Stat.DEF ], -1), new AttackMove(Moves.WHIRLPOOL, Type.WATER, MoveCategory.SPECIAL, 35, 85, 15, -1, 0, 2) .attr(TrapAttr, BattlerTagType.WHIRLPOOL) .attr(HitsTagAttr, BattlerTagType.UNDERWATER, true), @@ -7165,13 +7223,13 @@ export function initMoves() { new StatusMove(Moves.TORMENT, Type.DARK, 100, 15, -1, 0, 3) .unimplemented(), new StatusMove(Moves.FLATTER, Type.DARK, 100, 15, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPATK, 1) + .attr(StatStageChangeAttr, [ Stat.SPATK ], 1) .attr(ConfuseAttr), new StatusMove(Moves.WILL_O_WISP, Type.FIRE, 85, 15, -1, 0, 3) .attr(StatusEffectAttr, StatusEffect.BURN), new StatusMove(Moves.MEMENTO, Type.DARK, 100, 10, -1, 0, 3) .attr(SacrificialAttrOnHit) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -2), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], -2), new AttackMove(Moves.FACADE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 3) .attr(MovePowerMultiplierAttr, (user, target, move) => user.status && (user.status.effect === StatusEffect.BURN || user.status.effect === StatusEffect.POISON || user.status.effect === StatusEffect.TOXIC || user.status.effect === StatusEffect.PARALYSIS) ? 2 : 1) @@ -7190,7 +7248,7 @@ export function initMoves() { .attr(NaturePowerAttr) .ignoresVirtual(), new SelfStatusMove(Moves.CHARGE, Type.ELECTRIC, -1, 20, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPDEF, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], 1, true) .attr(AddBattlerTagAttr, BattlerTagType.CHARGED, true, false), new StatusMove(Moves.TAUNT, Type.DARK, 100, 20, -1, 0, 3) .unimplemented(), @@ -7210,7 +7268,7 @@ export function initMoves() { new SelfStatusMove(Moves.INGRAIN, Type.GRASS, -1, 20, -1, 0, 3) .attr(AddBattlerTagAttr, BattlerTagType.INGRAIN, true, true), new AttackMove(Moves.SUPERPOWER, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 3) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], -1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF ], -1, true), new SelfStatusMove(Moves.MAGIC_COAT, Type.PSYCHIC, -1, 15, -1, 4, 3) .unimplemented(), new SelfStatusMove(Moves.RECYCLE, Type.NORMAL, -1, 10, -1, 0, 3) @@ -7254,14 +7312,14 @@ export function initMoves() { new SelfStatusMove(Moves.CAMOUFLAGE, Type.NORMAL, -1, 20, -1, 0, 3) .attr(CopyBiomeTypeAttr), new SelfStatusMove(Moves.TAIL_GLOW, Type.BUG, -1, 20, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPATK, 3, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], 3, true), new AttackMove(Moves.LUSTER_PURGE, Type.PSYCHIC, MoveCategory.SPECIAL, 95, 100, 5, 50, 0, 3) - .attr(StatChangeAttr, BattleStat.SPDEF, -1), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1), new AttackMove(Moves.MIST_BALL, Type.PSYCHIC, MoveCategory.SPECIAL, 95, 100, 5, 50, 0, 3) - .attr(StatChangeAttr, BattleStat.SPATK, -1) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1) .ballBombMove(), new StatusMove(Moves.FEATHER_DANCE, Type.FLYING, 100, 15, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.ATK, -2) + .attr(StatStageChangeAttr, [ Stat.ATK ], -2) .danceMove(), new StatusMove(Moves.TEETER_DANCE, Type.NORMAL, 100, 20, -1, 0, 3) .attr(ConfuseAttr) @@ -7288,13 +7346,13 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.TOXIC) .bitingMove(), new AttackMove(Moves.CRUSH_CLAW, Type.NORMAL, MoveCategory.PHYSICAL, 75, 95, 10, 50, 0, 3) - .attr(StatChangeAttr, BattleStat.DEF, -1), + .attr(StatStageChangeAttr, [ Stat.DEF ], -1), new AttackMove(Moves.BLAST_BURN, Type.FIRE, MoveCategory.SPECIAL, 150, 90, 5, -1, 0, 3) .attr(RechargeAttr), new AttackMove(Moves.HYDRO_CANNON, Type.WATER, MoveCategory.SPECIAL, 150, 90, 5, -1, 0, 3) .attr(RechargeAttr), new AttackMove(Moves.METEOR_MASH, Type.STEEL, MoveCategory.PHYSICAL, 90, 90, 10, 20, 0, 3) - .attr(StatChangeAttr, BattleStat.ATK, 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK ], 1, true) .punchingMove(), new AttackMove(Moves.ASTONISH, Type.GHOST, MoveCategory.PHYSICAL, 30, 100, 15, 30, 0, 3) .attr(FlinchAttr), @@ -7306,33 +7364,33 @@ export function initMoves() { .attr(PartyStatusCureAttr, i18next.t("moveTriggers:soothingAromaWaftedThroughArea"), Abilities.SAP_SIPPER) .target(MoveTarget.PARTY), new StatusMove(Moves.FAKE_TEARS, Type.DARK, 100, 20, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPDEF, -2), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2), new AttackMove(Moves.AIR_CUTTER, Type.FLYING, MoveCategory.SPECIAL, 60, 95, 25, -1, 0, 3) .attr(HighCritAttr) .slicingMove() .windMove() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.OVERHEAT, Type.FIRE, MoveCategory.SPECIAL, 130, 90, 5, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPATK, -2, true) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2, true) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE), new StatusMove(Moves.ODOR_SLEUTH, Type.NORMAL, -1, 40, -1, 0, 3) .attr(ExposedMoveAttr, BattlerTagType.IGNORE_GHOST), new AttackMove(Moves.ROCK_TOMB, Type.ROCK, MoveCategory.PHYSICAL, 60, 95, 15, 100, 0, 3) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .makesContact(false), new AttackMove(Moves.SILVER_WIND, Type.BUG, MoveCategory.SPECIAL, 60, 100, 5, 10, 0, 3) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, true) .windMove(), new StatusMove(Moves.METAL_SOUND, Type.STEEL, 85, 40, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPDEF, -2) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2) .soundBased(), new StatusMove(Moves.GRASS_WHISTLE, Type.GRASS, 55, 15, -1, 0, 3) .attr(StatusEffectAttr, StatusEffect.SLEEP) .soundBased(), new StatusMove(Moves.TICKLE, Type.NORMAL, 100, 20, -1, 0, 3) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], -1), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF ], -1), new SelfStatusMove(Moves.COSMIC_POWER, Type.PSYCHIC, -1, 20, -1, 0, 3) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], 1, true), new AttackMove(Moves.WATER_SPOUT, Type.WATER, MoveCategory.SPECIAL, 150, 100, 5, -1, 0, 3) .attr(HpPowerAttr) .target(MoveTarget.ALL_NEAR_ENEMIES), @@ -7353,7 +7411,7 @@ export function initMoves() { .attr(OneHitKOAttr) .attr(SheerColdAccuracyAttr), new AttackMove(Moves.MUDDY_WATER, Type.WATER, MoveCategory.SPECIAL, 90, 85, 10, 30, 0, 3) - .attr(StatChangeAttr, BattleStat.ACC, -1) + .attr(StatStageChangeAttr, [ Stat.ACC ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.BULLET_SEED, Type.GRASS, MoveCategory.PHYSICAL, 25, 100, 30, -1, 0, 3) .attr(MultiHitAttr) @@ -7365,25 +7423,25 @@ export function initMoves() { .attr(MultiHitAttr) .makesContact(false), new SelfStatusMove(Moves.IRON_DEFENSE, Type.STEEL, -1, 15, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.DEF, 2, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true), new StatusMove(Moves.BLOCK, Type.NORMAL, -1, 5, -1, 0, 3) .attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, true, 1), new StatusMove(Moves.HOWL, Type.NORMAL, -1, 40, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.ATK, 1) + .attr(StatStageChangeAttr, [ Stat.ATK ], 1) .soundBased() .target(MoveTarget.USER_AND_ALLIES), new AttackMove(Moves.DRAGON_CLAW, Type.DRAGON, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 3), new AttackMove(Moves.FRENZY_PLANT, Type.GRASS, MoveCategory.SPECIAL, 150, 90, 5, -1, 0, 3) .attr(RechargeAttr), new SelfStatusMove(Moves.BULK_UP, Type.FIGHTING, -1, 20, -1, 0, 3) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF ], 1, true), new AttackMove(Moves.BOUNCE, Type.FLYING, MoveCategory.PHYSICAL, 85, 85, 5, 30, 0, 3) .attr(ChargeAttr, ChargeAnim.BOUNCE_CHARGING, i18next.t("moveTriggers:sprangUp", {pokemonName: "{USER}"}), BattlerTagType.FLYING) .attr(StatusEffectAttr, StatusEffect.PARALYSIS) .condition(failOnGravityCondition) .ignoresVirtual(), new AttackMove(Moves.MUD_SHOT, Type.GROUND, MoveCategory.SPECIAL, 55, 95, 15, 100, 0, 3) - .attr(StatChangeAttr, BattleStat.SPD, -1), + .attr(StatStageChangeAttr, [ Stat.SPD ], -1), new AttackMove(Moves.POISON_TAIL, Type.POISON, MoveCategory.PHYSICAL, 50, 100, 25, 10, 0, 3) .attr(HighCritAttr) .attr(StatusEffectAttr, StatusEffect.POISON), @@ -7398,12 +7456,12 @@ export function initMoves() { .attr(AddArenaTagAttr, ArenaTagType.WATER_SPORT, 5) .target(MoveTarget.BOTH_SIDES), new SelfStatusMove(Moves.CALM_MIND, Type.PSYCHIC, -1, 20, -1, 0, 3) - .attr(StatChangeAttr, [ BattleStat.SPATK, BattleStat.SPDEF ], 1, true), + .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF ], 1, true), new AttackMove(Moves.LEAF_BLADE, Type.GRASS, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 3) .attr(HighCritAttr) .slicingMove(), new SelfStatusMove(Moves.DRAGON_DANCE, Type.DRAGON, -1, 20, -1, 0, 3) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPD ], 1, true) .danceMove(), new AttackMove(Moves.ROCK_BLAST, Type.ROCK, MoveCategory.PHYSICAL, 25, 90, 10, -1, 0, 3) .attr(MultiHitAttr) @@ -7417,7 +7475,7 @@ export function initMoves() { .partial() .attr(DelayedAttackAttr, ArenaTagType.DOOM_DESIRE, ChargeAnim.DOOM_DESIRE_CHARGING, i18next.t("moveTriggers:choseDoomDesireAsDestiny", {pokemonName: "{USER}"})), new AttackMove(Moves.PSYCHO_BOOST, Type.PSYCHIC, MoveCategory.SPECIAL, 140, 90, 5, -1, 0, 3) - .attr(StatChangeAttr, BattleStat.SPATK, -2, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2, true), new SelfStatusMove(Moves.ROOST, Type.FLYING, -1, 5, -1, 0, 4) .attr(HealAttr, 0.5) .attr(AddBattlerTagAttr, BattlerTagType.ROOSTED, true, false) @@ -7431,7 +7489,7 @@ export function initMoves() { .attr(MovePowerMultiplierAttr, (user, target, move) => targetSleptOrComatoseCondition(user, target, move) ? 2 : 1) .attr(HealStatusEffectAttr, false, StatusEffect.SLEEP), new AttackMove(Moves.HAMMER_ARM, Type.FIGHTING, MoveCategory.PHYSICAL, 100, 90, 10, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.SPD, -1, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1, true) .punchingMove(), new AttackMove(Moves.GYRO_BALL, Type.STEEL, MoveCategory.PHYSICAL, -1, 100, 5, -1, 0, 4) .attr(GyroBallPowerAttr) @@ -7456,7 +7514,7 @@ export function initMoves() { .attr(AddArenaTagAttr, ArenaTagType.TAILWIND, 4, true) .target(MoveTarget.USER_SIDE), new StatusMove(Moves.ACUPRESSURE, Type.NORMAL, -1, 30, -1, 0, 4) - .attr(AcupressureStatChangeAttr) + .attr(AcupressureStatStageChangeAttr) .target(MoveTarget.USER_OR_NEAR_ALLY), new AttackMove(Moves.METAL_BURST, Type.STEEL, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 4) .attr(CounterDamageAttr, (move: Move) => (move.category === MoveCategory.PHYSICAL || move.category === MoveCategory.SPECIAL), 1.5) @@ -7466,7 +7524,7 @@ export function initMoves() { new AttackMove(Moves.U_TURN, Type.BUG, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 4) .attr(ForceSwitchOutAttr, true, false), new AttackMove(Moves.CLOSE_COMBAT, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 4) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true), + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true), new AttackMove(Moves.PAYBACK, Type.DARK, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 4) .attr(MovePowerMultiplierAttr, (user, target, move) => target.getLastXMoves(1).find(m => m.turn === target.scene.currentBattle.turn) || user.scene.currentBattle.turnCommands[target.getBattlerIndex()]?.command === Command.BALL ? 2 : 1), new AttackMove(Moves.ASSURANCE, Type.DARK, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 4) @@ -7510,9 +7568,9 @@ export function initMoves() { .attr(CopyMoveAttr) .ignoresVirtual(), new StatusMove(Moves.POWER_SWAP, Type.PSYCHIC, -1, 10, 100, 0, 4) - .unimplemented(), + .attr(SwapStatStagesAttr, [ Stat.ATK, Stat.SPATK ]), new StatusMove(Moves.GUARD_SWAP, Type.PSYCHIC, -1, 10, 100, 0, 4) - .unimplemented(), + .attr(SwapStatStagesAttr, [ Stat.DEF, Stat.SPDEF ]), new AttackMove(Moves.PUNISHMENT, Type.DARK, MoveCategory.PHYSICAL, -1, 100, 5, -1, 0, 4) .makesContact(true) .attr(PunishmentPowerAttr), @@ -7526,7 +7584,7 @@ export function initMoves() { .attr(AddArenaTrapTagAttr, ArenaTagType.TOXIC_SPIKES) .target(MoveTarget.ENEMY_SIDE), new StatusMove(Moves.HEART_SWAP, Type.PSYCHIC, -1, 10, -1, 0, 4) - .attr(SwapStatsAttr), + .attr(SwapStatStagesAttr, BATTLE_STATS), new SelfStatusMove(Moves.AQUA_RING, Type.WATER, -1, 20, -1, 0, 4) .attr(AddBattlerTagAttr, BattlerTagType.AQUA_RING, true, true), new SelfStatusMove(Moves.MAGNET_RISE, Type.ELECTRIC, -1, 10, -1, 0, 4) @@ -7543,7 +7601,7 @@ export function initMoves() { .pulseMove() .ballBombMove(), new SelfStatusMove(Moves.ROCK_POLISH, Type.ROCK, -1, 20, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.SPD, 2, true), + .attr(StatStageChangeAttr, [ Stat.SPD ], 2, true), new AttackMove(Moves.POISON_JAB, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 20, 30, 0, 4) .attr(StatusEffectAttr, StatusEffect.POISON), new AttackMove(Moves.DARK_PULSE, Type.DARK, MoveCategory.SPECIAL, 80, 100, 15, 20, 0, 4) @@ -7562,7 +7620,7 @@ export function initMoves() { new AttackMove(Moves.X_SCISSOR, Type.BUG, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 4) .slicingMove(), new AttackMove(Moves.BUG_BUZZ, Type.BUG, MoveCategory.SPECIAL, 90, 100, 10, 10, 0, 4) - .attr(StatChangeAttr, BattleStat.SPDEF, -1) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1) .soundBased(), new AttackMove(Moves.DRAGON_PULSE, Type.DRAGON, MoveCategory.SPECIAL, 85, 100, 10, -1, 0, 4) .pulseMove(), @@ -7577,22 +7635,22 @@ export function initMoves() { .triageMove(), new AttackMove(Moves.VACUUM_WAVE, Type.FIGHTING, MoveCategory.SPECIAL, 40, 100, 30, -1, 1, 4), new AttackMove(Moves.FOCUS_BLAST, Type.FIGHTING, MoveCategory.SPECIAL, 120, 70, 5, 10, 0, 4) - .attr(StatChangeAttr, BattleStat.SPDEF, -1) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1) .ballBombMove(), new AttackMove(Moves.ENERGY_BALL, Type.GRASS, MoveCategory.SPECIAL, 90, 100, 10, 10, 0, 4) - .attr(StatChangeAttr, BattleStat.SPDEF, -1) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1) .ballBombMove(), new AttackMove(Moves.BRAVE_BIRD, Type.FLYING, MoveCategory.PHYSICAL, 120, 100, 15, -1, 0, 4) .attr(RecoilAttr, false, 0.33) .recklessMove(), new AttackMove(Moves.EARTH_POWER, Type.GROUND, MoveCategory.SPECIAL, 90, 100, 10, 10, 0, 4) - .attr(StatChangeAttr, BattleStat.SPDEF, -1), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1), new StatusMove(Moves.SWITCHEROO, Type.DARK, 100, 10, -1, 0, 4) .unimplemented(), new AttackMove(Moves.GIGA_IMPACT, Type.NORMAL, MoveCategory.PHYSICAL, 150, 90, 5, -1, 0, 4) .attr(RechargeAttr), new SelfStatusMove(Moves.NASTY_PLOT, Type.DARK, -1, 20, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.SPATK, 2, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], 2, true), new AttackMove(Moves.BULLET_PUNCH, Type.STEEL, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 4) .punchingMove(), new AttackMove(Moves.AVALANCHE, Type.ICE, MoveCategory.PHYSICAL, 60, 100, 10, -1, -4, 4) @@ -7615,7 +7673,7 @@ export function initMoves() { .bitingMove(), new AttackMove(Moves.SHADOW_SNEAK, Type.GHOST, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 4), new AttackMove(Moves.MUD_BOMB, Type.GROUND, MoveCategory.SPECIAL, 65, 85, 10, 30, 0, 4) - .attr(StatChangeAttr, BattleStat.ACC, -1) + .attr(StatStageChangeAttr, [ Stat.ACC ], -1) .ballBombMove(), new AttackMove(Moves.PSYCHO_CUT, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 4) .attr(HighCritAttr) @@ -7624,13 +7682,13 @@ export function initMoves() { new AttackMove(Moves.ZEN_HEADBUTT, Type.PSYCHIC, MoveCategory.PHYSICAL, 80, 90, 15, 20, 0, 4) .attr(FlinchAttr), new AttackMove(Moves.MIRROR_SHOT, Type.STEEL, MoveCategory.SPECIAL, 65, 85, 10, 30, 0, 4) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new AttackMove(Moves.FLASH_CANNON, Type.STEEL, MoveCategory.SPECIAL, 80, 100, 10, 10, 0, 4) - .attr(StatChangeAttr, BattleStat.SPDEF, -1), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1), new AttackMove(Moves.ROCK_CLIMB, Type.NORMAL, MoveCategory.PHYSICAL, 90, 85, 20, 20, 0, 4) .attr(ConfuseAttr), new StatusMove(Moves.DEFOG, Type.FLYING, -1, 15, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.EVA, -1) + .attr(StatStageChangeAttr, [ Stat.EVA ], -1) .attr(ClearWeatherAttr, WeatherType.FOG) .attr(ClearTerrainAttr) .attr(RemoveScreensAttr, false) @@ -7640,7 +7698,7 @@ export function initMoves() { .ignoresProtect() .target(MoveTarget.BOTH_SIDES), new AttackMove(Moves.DRACO_METEOR, Type.DRAGON, MoveCategory.SPECIAL, 130, 90, 5, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.SPATK, -2, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2, true), new AttackMove(Moves.DISCHARGE, Type.ELECTRIC, MoveCategory.SPECIAL, 80, 100, 15, 30, 0, 4) .attr(StatusEffectAttr, StatusEffect.PARALYSIS) .target(MoveTarget.ALL_NEAR_OTHERS), @@ -7648,7 +7706,7 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.BURN) .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.LEAF_STORM, Type.GRASS, MoveCategory.SPECIAL, 130, 90, 5, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.SPATK, -2, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2, true), new AttackMove(Moves.POWER_WHIP, Type.GRASS, MoveCategory.PHYSICAL, 120, 85, 10, -1, 0, 4), new AttackMove(Moves.ROCK_WRECKER, Type.ROCK, MoveCategory.PHYSICAL, 150, 90, 5, -1, 0, 4) .attr(RechargeAttr) @@ -7670,7 +7728,7 @@ export function initMoves() { .attr(HighCritAttr) .makesContact(false), new StatusMove(Moves.CAPTIVATE, Type.NORMAL, 100, 20, -1, 0, 4) - .attr(StatChangeAttr, BattleStat.SPATK, -2) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2) .condition((user, target, move) => target.isOppositeGender(user)) .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.STEALTH_ROCK, Type.ROCK, -1, 20, -1, 0, 4) @@ -7688,7 +7746,7 @@ export function initMoves() { new AttackMove(Moves.BUG_BITE, Type.BUG, MoveCategory.PHYSICAL, 60, 100, 20, -1, 0, 4) .attr(StealEatBerryAttr), new AttackMove(Moves.CHARGE_BEAM, Type.ELECTRIC, MoveCategory.SPECIAL, 50, 90, 10, 70, 0, 4) - .attr(StatChangeAttr, BattleStat.SPATK, 1, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], 1, true), new AttackMove(Moves.WOOD_HAMMER, Type.GRASS, MoveCategory.PHYSICAL, 120, 100, 15, -1, 0, 4) .attr(RecoilAttr, false, 0.33) .recklessMove(), @@ -7697,7 +7755,7 @@ export function initMoves() { .attr(HighCritAttr) .makesContact(false), new SelfStatusMove(Moves.DEFEND_ORDER, Type.BUG, -1, 10, -1, 0, 4) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], 1, true), new SelfStatusMove(Moves.HEAL_ORDER, Type.BUG, -1, 10, -1, 0, 4) .attr(HealAttr, 0.5) .triageMove(), @@ -7723,23 +7781,24 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.SLEEP) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.SEED_FLARE, Type.GRASS, MoveCategory.SPECIAL, 120, 85, 5, 40, 0, 4) - .attr(StatChangeAttr, BattleStat.SPDEF, -2), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2), new AttackMove(Moves.OMINOUS_WIND, Type.GHOST, MoveCategory.SPECIAL, 60, 100, 5, 10, 0, 4) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, true) .windMove(), new AttackMove(Moves.SHADOW_FORCE, Type.GHOST, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 4) .attr(ChargeAttr, ChargeAnim.SHADOW_FORCE_CHARGING, i18next.t("moveTriggers:vanishedInstantly", {pokemonName: "{USER}"}), BattlerTagType.HIDDEN) .ignoresProtect() .ignoresVirtual(), new SelfStatusMove(Moves.HONE_CLAWS, Type.DARK, -1, 15, -1, 0, 5) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.ACC ], 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.ACC ], 1, true), new StatusMove(Moves.WIDE_GUARD, Type.ROCK, -1, 10, -1, 3, 5) .target(MoveTarget.USER_SIDE) - .attr(AddArenaTagAttr, ArenaTagType.WIDE_GUARD, 1, true, true), + .attr(AddArenaTagAttr, ArenaTagType.WIDE_GUARD, 1, true, true) + .condition(failIfLastCondition), new StatusMove(Moves.GUARD_SPLIT, Type.PSYCHIC, -1, 10, -1, 0, 5) - .unimplemented(), + .attr(AverageStatsAttr, [ Stat.DEF, Stat.SPDEF ], "moveTriggers:sharedGuard"), new StatusMove(Moves.POWER_SPLIT, Type.PSYCHIC, -1, 10, -1, 0, 5) - .unimplemented(), + .attr(AverageStatsAttr, [ Stat.ATK, Stat.SPATK ], "moveTriggers:sharedPower"), new StatusMove(Moves.WONDER_ROOM, Type.PSYCHIC, -1, 10, -1, 0, 5) .ignoresProtect() .target(MoveTarget.BOTH_SIDES) @@ -7749,7 +7808,7 @@ export function initMoves() { new AttackMove(Moves.VENOSHOCK, Type.POISON, MoveCategory.SPECIAL, 65, 100, 10, -1, 0, 5) .attr(MovePowerMultiplierAttr, (user, target, move) => target.status && (target.status.effect === StatusEffect.POISON || target.status.effect === StatusEffect.TOXIC) ? 2 : 1), new SelfStatusMove(Moves.AUTOTOMIZE, Type.STEEL, -1, 15, -1, 0, 5) - .attr(StatChangeAttr, BattleStat.SPD, 2, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], 2, true) .partial(), new SelfStatusMove(Moves.RAGE_POWDER, Type.BUG, -1, 20, -1, 2, 5) .powderMove() @@ -7775,7 +7834,7 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.POISON) .target(MoveTarget.ALL_NEAR_OTHERS), new SelfStatusMove(Moves.QUIVER_DANCE, Type.BUG, -1, 20, -1, 0, 5) - .attr(StatChangeAttr, [ BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, true) .danceMove(), new AttackMove(Moves.HEAVY_SLAM, Type.STEEL, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 5) .attr(MinimizeAccuracyAttr) @@ -7792,13 +7851,13 @@ export function initMoves() { new StatusMove(Moves.SOAK, Type.WATER, 100, 20, -1, 0, 5) .attr(ChangeTypeAttr, Type.WATER), new AttackMove(Moves.FLAME_CHARGE, Type.FIRE, MoveCategory.PHYSICAL, 50, 100, 20, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPD, 1, true), + .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true), new SelfStatusMove(Moves.COIL, Type.POISON, -1, 20, -1, 0, 5) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.ACC ], 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.ACC ], 1, true), new AttackMove(Moves.LOW_SWEEP, Type.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 20, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPD, -1), + .attr(StatStageChangeAttr, [ Stat.SPD ], -1), new AttackMove(Moves.ACID_SPRAY, Type.POISON, MoveCategory.SPECIAL, 40, 100, 20, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPDEF, -2) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2) .ballBombMove(), new AttackMove(Moves.FOUL_PLAY, Type.DARK, MoveCategory.PHYSICAL, 95, 100, 15, -1, 0, 5) .attr(TargetAtkUserAtkAttr), @@ -7816,14 +7875,15 @@ export function initMoves() { .attr(ConsecutiveUseMultiBasePowerAttr, 5, false) .soundBased(), new AttackMove(Moves.CHIP_AWAY, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 5) - .attr(IgnoreOpponentStatChangesAttr), + .attr(IgnoreOpponentStatStagesAttr), new AttackMove(Moves.CLEAR_SMOG, Type.POISON, MoveCategory.SPECIAL, 50, -1, 15, -1, 0, 5) .attr(ResetStatsAttr, false), new AttackMove(Moves.STORED_POWER, Type.PSYCHIC, MoveCategory.SPECIAL, 20, 100, 10, -1, 0, 5) - .attr(StatChangeCountPowerAttr), + .attr(PositiveStatStagePowerAttr), new StatusMove(Moves.QUICK_GUARD, Type.FIGHTING, -1, 15, -1, 3, 5) .target(MoveTarget.USER_SIDE) - .attr(AddArenaTagAttr, ArenaTagType.QUICK_GUARD, 1, true, true), + .attr(AddArenaTagAttr, ArenaTagType.QUICK_GUARD, 1, true, true) + .condition(failIfLastCondition), new SelfStatusMove(Moves.ALLY_SWITCH, Type.PSYCHIC, -1, 15, -1, 2, 5) .ignoresProtect() .unimplemented(), @@ -7832,8 +7892,8 @@ export function initMoves() { .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.BURN), new SelfStatusMove(Moves.SHELL_SMASH, Type.NORMAL, -1, 15, -1, 0, 5) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK, BattleStat.SPD ], 2, true) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK, Stat.SPD ], 2, true) + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true), new StatusMove(Moves.HEAL_PULSE, Type.PSYCHIC, -1, 10, -1, 0, 5) .attr(HealAttr, 0.5, false, false) .pulseMove() @@ -7847,8 +7907,8 @@ export function initMoves() { .condition(failOnGravityCondition) .ignoresVirtual(), new SelfStatusMove(Moves.SHIFT_GEAR, Type.STEEL, -1, 10, -1, 0, 5) - .attr(StatChangeAttr, BattleStat.ATK, 1, true) - .attr(StatChangeAttr, BattleStat.SPD, 2, true), + .attr(StatStageChangeAttr, [ Stat.ATK ], 1, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], 2, true), new AttackMove(Moves.CIRCLE_THROW, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 90, 10, -1, -6, 5) .attr(ForceSwitchOutAttr), new AttackMove(Moves.INCINERATE, Type.FIRE, MoveCategory.SPECIAL, 60, 100, 15, -1, 0, 5) @@ -7879,10 +7939,10 @@ export function initMoves() { new AttackMove(Moves.VOLT_SWITCH, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 5) .attr(ForceSwitchOutAttr, true, false), new AttackMove(Moves.STRUGGLE_BUG, Type.BUG, MoveCategory.SPECIAL, 50, 100, 20, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPATK, -1) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.BULLDOZE, Type.GROUND, MoveCategory.PHYSICAL, 60, 100, 20, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .makesContact(false) .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.FROST_BREATH, Type.ICE, MoveCategory.SPECIAL, 60, 90, 10, 100, 0, 5) @@ -7891,9 +7951,9 @@ export function initMoves() { .attr(ForceSwitchOutAttr) .hidesTarget(), new SelfStatusMove(Moves.WORK_UP, Type.NORMAL, -1, 30, -1, 0, 5) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], 1, true), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], 1, true), new AttackMove(Moves.ELECTROWEB, Type.ELECTRIC, MoveCategory.SPECIAL, 55, 95, 15, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.WILD_CHARGE, Type.ELECTRIC, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 5) .attr(RecoilAttr) @@ -7908,10 +7968,10 @@ export function initMoves() { .attr(HitHealAttr) .triageMove(), new AttackMove(Moves.SACRED_SWORD, Type.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 5) - .attr(IgnoreOpponentStatChangesAttr) + .attr(IgnoreOpponentStatStagesAttr) .slicingMove(), new AttackMove(Moves.RAZOR_SHELL, Type.WATER, MoveCategory.PHYSICAL, 75, 95, 10, 50, 0, 5) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .slicingMove(), new AttackMove(Moves.HEAT_CRASH, Type.FIRE, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 5) .attr(MinimizeAccuracyAttr) @@ -7919,13 +7979,13 @@ export function initMoves() { .attr(HitsTagAttr, BattlerTagType.MINIMIZED, true) .condition(failOnMaxCondition), new AttackMove(Moves.LEAF_TORNADO, Type.GRASS, MoveCategory.SPECIAL, 65, 90, 10, 50, 0, 5) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new AttackMove(Moves.STEAMROLLER, Type.BUG, MoveCategory.PHYSICAL, 65, 100, 20, 30, 0, 5) .attr(FlinchAttr), new SelfStatusMove(Moves.COTTON_GUARD, Type.GRASS, -1, 10, -1, 0, 5) - .attr(StatChangeAttr, BattleStat.DEF, 3, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 3, true), new AttackMove(Moves.NIGHT_DAZE, Type.DARK, MoveCategory.SPECIAL, 85, 95, 10, 40, 0, 5) - .attr(StatChangeAttr, BattleStat.ACC, -1), + .attr(StatStageChangeAttr, [ Stat.ACC ], -1), new AttackMove(Moves.PSYSTRIKE, Type.PSYCHIC, MoveCategory.SPECIAL, 100, 100, 10, -1, 0, 5) .attr(DefDefAttr), new AttackMove(Moves.TAIL_SLAP, Type.NORMAL, MoveCategory.PHYSICAL, 25, 85, 10, -1, 0, 5) @@ -7954,14 +8014,14 @@ export function initMoves() { .attr(DefDefAttr) .slicingMove(), new AttackMove(Moves.GLACIATE, Type.ICE, MoveCategory.SPECIAL, 65, 95, 10, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.BOLT_STRIKE, Type.ELECTRIC, MoveCategory.PHYSICAL, 130, 85, 5, 20, 0, 5) .attr(StatusEffectAttr, StatusEffect.PARALYSIS), new AttackMove(Moves.BLUE_FLARE, Type.FIRE, MoveCategory.SPECIAL, 130, 85, 5, 20, 0, 5) .attr(StatusEffectAttr, StatusEffect.BURN), new AttackMove(Moves.FIERY_DANCE, Type.FIRE, MoveCategory.SPECIAL, 80, 100, 10, 50, 0, 5) - .attr(StatChangeAttr, BattleStat.SPATK, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPATK ], 1, true) .danceMove(), new AttackMove(Moves.FREEZE_SHOCK, Type.ICE, MoveCategory.PHYSICAL, 140, 90, 5, 30, 0, 5) .attr(ChargeAttr, ChargeAnim.FREEZE_SHOCK_CHARGING, i18next.t("moveTriggers:becameCloakedInFreezingLight", {pokemonName: "{USER}"})) @@ -7972,14 +8032,14 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.BURN) .ignoresVirtual(), new AttackMove(Moves.SNARL, Type.DARK, MoveCategory.SPECIAL, 55, 95, 15, 100, 0, 5) - .attr(StatChangeAttr, BattleStat.SPATK, -1) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1) .soundBased() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.ICICLE_CRASH, Type.ICE, MoveCategory.PHYSICAL, 85, 90, 10, 30, 0, 5) .attr(FlinchAttr) .makesContact(false), new AttackMove(Moves.V_CREATE, Type.FIRE, MoveCategory.PHYSICAL, 180, 95, 5, -1, 0, 5) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF, BattleStat.SPD ], -1, true), + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF, Stat.SPD ], -1, true), new AttackMove(Moves.FUSION_FLARE, Type.FIRE, MoveCategory.SPECIAL, 100, 100, 5, -1, 0, 5) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) .attr(LastMoveDoublePowerAttr, Moves.FUSION_BOLT), @@ -7994,7 +8054,8 @@ export function initMoves() { new StatusMove(Moves.MAT_BLOCK, Type.FIGHTING, -1, 10, -1, 0, 6) .target(MoveTarget.USER_SIDE) .attr(AddArenaTagAttr, ArenaTagType.MAT_BLOCK, 1, true, true) - .condition(new FirstMoveCondition()), + .condition(new FirstMoveCondition()) + .condition(failIfLastCondition), new AttackMove(Moves.BELCH, Type.POISON, MoveCategory.SPECIAL, 120, 90, 10, -1, 0, 6) .condition((user, target, move) => user.battleData.berriesEaten.length > 0), new StatusMove(Moves.ROTOTILLER, Type.GROUND, -1, 10, -1, 0, 6) @@ -8003,12 +8064,12 @@ export function initMoves() { // If any fielded pokémon is grass-type and grounded. return [...user.scene.getEnemyParty(), ...user.scene.getParty()].some((poke) => poke.isOfType(Type.GRASS) && poke.isGrounded()); }) - .attr(StatChangeAttr, [BattleStat.ATK, BattleStat.SPATK], 1, false, (user, target, move) => target.isOfType(Type.GRASS) && target.isGrounded()), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], 1, false, (user, target, move) => target.isOfType(Type.GRASS) && target.isGrounded()), new StatusMove(Moves.STICKY_WEB, Type.BUG, -1, 20, -1, 0, 6) .attr(AddArenaTrapTagAttr, ArenaTagType.STICKY_WEB) .target(MoveTarget.ENEMY_SIDE), new AttackMove(Moves.FELL_STINGER, Type.BUG, MoveCategory.PHYSICAL, 50, 100, 25, -1, 0, 6) - .attr(PostVictoryStatChangeAttr, BattleStat.ATK, 3, true ), + .attr(PostVictoryStatStageChangeAttr, [ Stat.ATK ], 3, true ), new AttackMove(Moves.PHANTOM_FORCE, Type.GHOST, MoveCategory.PHYSICAL, 90, 100, 10, -1, 0, 6) .attr(ChargeAttr, ChargeAnim.PHANTOM_FORCE_CHARGING, i18next.t("moveTriggers:vanishedInstantly", {pokemonName: "{USER}"}), BattlerTagType.HIDDEN) .ignoresProtect() @@ -8017,7 +8078,7 @@ export function initMoves() { .attr(AddTypeAttr, Type.GHOST) .partial(), new StatusMove(Moves.NOBLE_ROAR, Type.NORMAL, 100, 30, -1, 0, 6) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], -1) .soundBased(), new StatusMove(Moves.ION_DELUGE, Type.ELECTRIC, -1, 25, -1, 1, 6) .target(MoveTarget.BOTH_SIDES) @@ -8041,7 +8102,7 @@ export function initMoves() { .soundBased() .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.PARTING_SHOT, Type.DARK, 100, 20, -1, 0, 6) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1, false, null, true, true, MoveEffectTrigger.PRE_APPLY) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], -1, false, null, true, true, MoveEffectTrigger.PRE_APPLY) .attr(ForceSwitchOutAttr, true, false) .soundBased(), new StatusMove(Moves.TOPSY_TURVY, Type.DARK, -1, 20, -1, 0, 6) @@ -8052,10 +8113,11 @@ export function initMoves() { .triageMove(), new StatusMove(Moves.CRAFTY_SHIELD, Type.FAIRY, -1, 10, -1, 3, 6) .target(MoveTarget.USER_SIDE) - .attr(AddArenaTagAttr, ArenaTagType.CRAFTY_SHIELD, 1, true, true), + .attr(AddArenaTagAttr, ArenaTagType.CRAFTY_SHIELD, 1, true, true) + .condition(failIfLastCondition), new StatusMove(Moves.FLOWER_SHIELD, Type.FAIRY, -1, 10, -1, 0, 6) .target(MoveTarget.ALL) - .attr(StatChangeAttr, BattleStat.DEF, 1, false, (user, target, move) => target.getTypes().includes(Type.GRASS) && !target.getTag(SemiInvulnerableTag)), + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, false, (user, target, move) => target.getTypes().includes(Type.GRASS) && !target.getTag(SemiInvulnerableTag)), new StatusMove(Moves.GRASSY_TERRAIN, Type.GRASS, -1, 10, -1, 0, 6) .attr(TerrainChangeAttr, TerrainType.GRASSY) .target(MoveTarget.BOTH_SIDES), @@ -8065,11 +8127,11 @@ export function initMoves() { new StatusMove(Moves.ELECTRIFY, Type.ELECTRIC, -1, 20, -1, 0, 6) .unimplemented(), new AttackMove(Moves.PLAY_ROUGH, Type.FAIRY, MoveCategory.PHYSICAL, 90, 90, 10, 10, 0, 6) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new AttackMove(Moves.FAIRY_WIND, Type.FAIRY, MoveCategory.SPECIAL, 40, 100, 30, -1, 0, 6) .windMove(), new AttackMove(Moves.MOONBLAST, Type.FAIRY, MoveCategory.SPECIAL, 95, 100, 15, 30, 0, 6) - .attr(StatChangeAttr, BattleStat.SPATK, -1), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1), new AttackMove(Moves.BOOMBURST, Type.NORMAL, MoveCategory.SPECIAL, 140, 100, 10, -1, 0, 6) .soundBased() .target(MoveTarget.ALL_NEAR_OTHERS), @@ -8077,14 +8139,15 @@ export function initMoves() { .target(MoveTarget.BOTH_SIDES) .unimplemented(), new SelfStatusMove(Moves.KINGS_SHIELD, Type.STEEL, -1, 10, -1, 4, 6) - .attr(ProtectAttr, BattlerTagType.KINGS_SHIELD), + .attr(ProtectAttr, BattlerTagType.KINGS_SHIELD) + .condition(failIfLastCondition), new StatusMove(Moves.PLAY_NICE, Type.NORMAL, -1, 20, -1, 0, 6) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new StatusMove(Moves.CONFIDE, Type.NORMAL, -1, 20, -1, 0, 6) - .attr(StatChangeAttr, BattleStat.SPATK, -1) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1) .soundBased(), new AttackMove(Moves.DIAMOND_STORM, Type.ROCK, MoveCategory.PHYSICAL, 100, 95, 5, 50, 0, 6) - .attr(StatChangeAttr, BattleStat.DEF, 2, true) + .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true) .makesContact(false) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.STEAM_ERUPTION, Type.WATER, MoveCategory.SPECIAL, 110, 95, 5, 30, 0, 6) @@ -8098,26 +8161,27 @@ export function initMoves() { .attr(WaterShurikenPowerAttr) .attr(WaterShurikenMultiHitTypeAttr), new AttackMove(Moves.MYSTICAL_FIRE, Type.FIRE, MoveCategory.SPECIAL, 75, 100, 10, 100, 0, 6) - .attr(StatChangeAttr, BattleStat.SPATK, -1), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1), new SelfStatusMove(Moves.SPIKY_SHIELD, Type.GRASS, -1, 10, -1, 4, 6) - .attr(ProtectAttr, BattlerTagType.SPIKY_SHIELD), + .attr(ProtectAttr, BattlerTagType.SPIKY_SHIELD) + .condition(failIfLastCondition), new StatusMove(Moves.AROMATIC_MIST, Type.FAIRY, -1, 20, -1, 0, 6) - .attr(StatChangeAttr, BattleStat.SPDEF, 1) + .attr(StatStageChangeAttr, [ Stat.SPDEF ], 1) .target(MoveTarget.NEAR_ALLY), new StatusMove(Moves.EERIE_IMPULSE, Type.ELECTRIC, 100, 15, -1, 0, 6) - .attr(StatChangeAttr, BattleStat.SPATK, -2), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2), new StatusMove(Moves.VENOM_DRENCH, Type.POISON, 100, 20, -1, 0, 6) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK, BattleStat.SPD ], -1, false, (user, target, move) => target.status?.effect === StatusEffect.POISON || target.status?.effect === StatusEffect.TOXIC) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK, Stat.SPD ], -1, false, (user, target, move) => target.status?.effect === StatusEffect.POISON || target.status?.effect === StatusEffect.TOXIC) .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.POWDER, Type.BUG, 100, 20, -1, 1, 6) .powderMove() .unimplemented(), new SelfStatusMove(Moves.GEOMANCY, Type.FAIRY, -1, 10, -1, 0, 6) .attr(ChargeAttr, ChargeAnim.GEOMANCY_CHARGING, i18next.t("moveTriggers:isChargingPower", {pokemonName: "{USER}"})) - .attr(StatChangeAttr, [ BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 2, true) + .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF, Stat.SPD ], 2, true) .ignoresVirtual(), new StatusMove(Moves.MAGNETIC_FLUX, Type.ELECTRIC, -1, 20, -1, 0, 6) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], 1, false, (user, target, move) => !![ Abilities.PLUS, Abilities.MINUS].find(a => target.hasAbility(a, false))) + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], 1, false, (user, target, move) => !![ Abilities.PLUS, Abilities.MINUS].find(a => target.hasAbility(a, false))) .target(MoveTarget.USER_AND_ALLIES) .condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ Abilities.PLUS, Abilities.MINUS].find(a => p.hasAbility(a, false)))), new StatusMove(Moves.HAPPY_HOUR, Type.NORMAL, -1, 30, -1, 0, 6) // No animation @@ -8132,7 +8196,7 @@ export function initMoves() { new StatusMove(Moves.HOLD_HANDS, Type.NORMAL, -1, 40, -1, 0, 6) .target(MoveTarget.NEAR_ALLY), new StatusMove(Moves.BABY_DOLL_EYES, Type.FAIRY, 100, 30, -1, 1, 6) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new AttackMove(Moves.NUZZLE, Type.ELECTRIC, MoveCategory.PHYSICAL, 20, 100, 20, 100, 0, 6) .attr(StatusEffectAttr, StatusEffect.PARALYSIS), new AttackMove(Moves.HOLD_BACK, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 40, -1, 0, 6) @@ -8141,7 +8205,7 @@ export function initMoves() { .makesContact() .attr(TrapAttr, BattlerTagType.INFESTATION), new AttackMove(Moves.POWER_UP_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 40, 100, 20, 100, 0, 6) - .attr(StatChangeAttr, BattleStat.ATK, 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK ], 1, true) .punchingMove(), new AttackMove(Moves.OBLIVION_WING, Type.FLYING, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 6) .attr(HitHealAttr, 0.75) @@ -8172,9 +8236,9 @@ export function initMoves() { .makesContact(false) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.DRAGON_ASCENT, Type.FLYING, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 6) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true), + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true), new AttackMove(Moves.HYPERSPACE_FURY, Type.DARK, MoveCategory.PHYSICAL, 100, -1, 5, -1, 0, 6) - .attr(StatChangeAttr, BattleStat.DEF, -1, true) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1, true) .makesContact(false) .ignoresProtect(), /* Unused */ @@ -8296,18 +8360,19 @@ export function initMoves() { new AttackMove(Moves.FIRST_IMPRESSION, Type.BUG, MoveCategory.PHYSICAL, 90, 100, 10, -1, 2, 7) .condition(new FirstMoveCondition()), new SelfStatusMove(Moves.BANEFUL_BUNKER, Type.POISON, -1, 10, -1, 4, 7) - .attr(ProtectAttr, BattlerTagType.BANEFUL_BUNKER), + .attr(ProtectAttr, BattlerTagType.BANEFUL_BUNKER) + .condition(failIfLastCondition), new AttackMove(Moves.SPIRIT_SHACKLE, Type.GHOST, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 7) .attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, false, 1, 1, true) .makesContact(false), new AttackMove(Moves.DARKEST_LARIAT, Type.DARK, MoveCategory.PHYSICAL, 85, 100, 10, -1, 0, 7) - .attr(IgnoreOpponentStatChangesAttr), + .attr(IgnoreOpponentStatStagesAttr), new AttackMove(Moves.SPARKLING_ARIA, Type.WATER, MoveCategory.SPECIAL, 90, 100, 10, 100, 0, 7) .attr(HealStatusEffectAttr, false, StatusEffect.BURN) .soundBased() .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.ICE_HAMMER, Type.ICE, MoveCategory.PHYSICAL, 100, 90, 10, -1, 0, 7) - .attr(StatChangeAttr, BattleStat.SPD, -1, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1, true) .punchingMove(), new StatusMove(Moves.FLORAL_HEALING, Type.FAIRY, -1, 10, -1, 0, 7) .attr(BoostHealAttr, 0.5, 2/3, true, false, (user, target, move) => user.scene.arena.terrain?.terrainType === TerrainType.GRASSY) @@ -8315,8 +8380,8 @@ export function initMoves() { new AttackMove(Moves.HIGH_HORSEPOWER, Type.GROUND, MoveCategory.PHYSICAL, 95, 95, 10, -1, 0, 7), new StatusMove(Moves.STRENGTH_SAP, Type.GRASS, 100, 10, -1, 0, 7) .attr(HitHealAttr, null, Stat.ATK) - .attr(StatChangeAttr, BattleStat.ATK, -1) - .condition((user, target, move) => target.summonData.battleStats[BattleStat.ATK] > -6) + .attr(StatStageChangeAttr, [ Stat.ATK ], -1) + .condition((user, target, move) => target.getStatStage(Stat.ATK) > -6) .triageMove(), new AttackMove(Moves.SOLAR_BLADE, Type.GRASS, MoveCategory.PHYSICAL, 125, 100, 10, -1, 0, 7) .attr(SunlightChargeAttr, ChargeAnim.SOLAR_BLADE_CHARGING, i18next.t("moveTriggers:isGlowing", {pokemonName: "{USER}"})) @@ -8328,11 +8393,11 @@ export function initMoves() { .attr(AddBattlerTagAttr, BattlerTagType.CENTER_OF_ATTENTION, false), new StatusMove(Moves.TOXIC_THREAD, Type.POISON, 100, 20, -1, 0, 7) .attr(StatusEffectAttr, StatusEffect.POISON) - .attr(StatChangeAttr, BattleStat.SPD, -1), + .attr(StatStageChangeAttr, [ Stat.SPD ], -1), new SelfStatusMove(Moves.LASER_FOCUS, Type.NORMAL, -1, 30, -1, 0, 7) .attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_CRIT, true, false), new StatusMove(Moves.GEAR_UP, Type.STEEL, -1, 20, -1, 0, 7) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], 1, false, (user, target, move) => !![ Abilities.PLUS, Abilities.MINUS].find(a => target.hasAbility(a, false))) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], 1, false, (user, target, move) => !![ Abilities.PLUS, Abilities.MINUS].find(a => target.hasAbility(a, false))) .target(MoveTarget.USER_AND_ALLIES) .condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ Abilities.PLUS, Abilities.MINUS].find(a => p.hasAbility(a, false)))), new AttackMove(Moves.THROAT_CHOP, Type.DARK, MoveCategory.PHYSICAL, 80, 100, 15, 100, 0, 7) @@ -8347,11 +8412,11 @@ export function initMoves() { .attr(TerrainChangeAttr, TerrainType.PSYCHIC) .target(MoveTarget.BOTH_SIDES), new AttackMove(Moves.LUNGE, Type.BUG, MoveCategory.PHYSICAL, 80, 100, 15, 100, 0, 7) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new AttackMove(Moves.FIRE_LASH, Type.FIRE, MoveCategory.PHYSICAL, 80, 100, 15, 100, 0, 7) - .attr(StatChangeAttr, BattleStat.DEF, -1), + .attr(StatStageChangeAttr, [ Stat.DEF ], -1), new AttackMove(Moves.POWER_TRIP, Type.DARK, MoveCategory.PHYSICAL, 20, 100, 10, -1, 0, 7) - .attr(StatChangeCountPowerAttr), + .attr(PositiveStatStagePowerAttr), new AttackMove(Moves.BURN_UP, Type.FIRE, MoveCategory.SPECIAL, 130, 100, 5, -1, 0, 7) .condition((user) => { const userTypes = user.getTypes(true); @@ -8362,7 +8427,7 @@ export function initMoves() { user.scene.queueMessage(i18next.t("moveTriggers:burnedItselfOut", {pokemonName: getPokemonNameWithAffix(user)})); }), new StatusMove(Moves.SPEED_SWAP, Type.PSYCHIC, -1, 10, -1, 0, 7) - .unimplemented(), + .attr(SwapStatAttr, Stat.SPD), new AttackMove(Moves.SMART_STRIKE, Type.STEEL, MoveCategory.PHYSICAL, 70, -1, 10, -1, 0, 7), new StatusMove(Moves.PURIFY, Type.POISON, -1, 20, -1, 0, 7) .condition( @@ -8377,7 +8442,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES) .attr(SuppressAbilitiesIfActedAttr), new AttackMove(Moves.TROP_KICK, Type.GRASS, MoveCategory.PHYSICAL, 70, 100, 15, 100, 0, 7) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new StatusMove(Moves.INSTRUCT, Type.PSYCHIC, -1, 15, -1, 0, 7) .unimplemented(), new AttackMove(Moves.BEAK_BLAST, Type.FLYING, MoveCategory.PHYSICAL, 100, 100, 15, -1, -3, 7) @@ -8385,7 +8450,7 @@ export function initMoves() { .ballBombMove() .makesContact(false), new AttackMove(Moves.CLANGING_SCALES, Type.DRAGON, MoveCategory.SPECIAL, 110, 100, 5, -1, 0, 7) - .attr(StatChangeAttr, BattleStat.DEF, -1, true, null, true, false, MoveEffectTrigger.HIT, true) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1, true, null, true, false, MoveEffectTrigger.HIT, true) .soundBased() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.DRAGON_HAMMER, Type.DRAGON, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 7), @@ -8419,7 +8484,7 @@ export function initMoves() { .partial() .ignoresVirtual(), new SelfStatusMove(Moves.EXTREME_EVOBOOST, Type.NORMAL, -1, 1, -1, 0, 7) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 2, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 2, true) .ignoresVirtual(), new AttackMove(Moves.GENESIS_SUPERNOVA, Type.PSYCHIC, MoveCategory.SPECIAL, 185, -1, 1, 100, 0, 7) .attr(TerrainChangeAttr, TerrainType.PSYCHIC) @@ -8431,18 +8496,18 @@ export function initMoves() { // Fails if the user was not hit by a physical attack during the turn .condition((user, target, move) => user.getTag(ShellTrapTag)?.activated === true), new AttackMove(Moves.FLEUR_CANNON, Type.FAIRY, MoveCategory.SPECIAL, 130, 90, 5, -1, 0, 7) - .attr(StatChangeAttr, BattleStat.SPATK, -2, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -2, true), new AttackMove(Moves.PSYCHIC_FANGS, Type.PSYCHIC, MoveCategory.PHYSICAL, 85, 100, 10, -1, 0, 7) .bitingMove() .attr(RemoveScreensAttr), new AttackMove(Moves.STOMPING_TANTRUM, Type.GROUND, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 7) .attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result === MoveResult.MISS || user.getLastXMoves(2)[1]?.result === MoveResult.FAIL ? 2 : 1), new AttackMove(Moves.SHADOW_BONE, Type.GHOST, MoveCategory.PHYSICAL, 85, 100, 10, 20, 0, 7) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .makesContact(false), new AttackMove(Moves.ACCELEROCK, Type.ROCK, MoveCategory.PHYSICAL, 40, 100, 20, -1, 1, 7), new AttackMove(Moves.LIQUIDATION, Type.WATER, MoveCategory.PHYSICAL, 85, 100, 10, 20, 0, 7) - .attr(StatChangeAttr, BattleStat.DEF, -1), + .attr(StatStageChangeAttr, [ Stat.DEF ], -1), new AttackMove(Moves.PRISMATIC_LASER, Type.PSYCHIC, MoveCategory.SPECIAL, 160, 100, 10, -1, 0, 7) .attr(RechargeAttr), new AttackMove(Moves.SPECTRAL_THIEF, Type.GHOST, MoveCategory.PHYSICAL, 90, 100, 10, -1, 0, 7) @@ -8454,7 +8519,7 @@ export function initMoves() { .ignoresAbilities() .partial(), new StatusMove(Moves.TEARFUL_LOOK, Type.NORMAL, -1, 20, -1, 0, 7) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], -1), new AttackMove(Moves.ZING_ZAP, Type.ELECTRIC, MoveCategory.PHYSICAL, 80, 100, 10, 30, 0, 7) .attr(FlinchAttr), new AttackMove(Moves.NATURES_MADNESS, Type.FAIRY, MoveCategory.SPECIAL, -1, 90, 10, -1, 0, 7) @@ -8496,7 +8561,7 @@ export function initMoves() { .makesContact(false) .ignoresVirtual(), new AttackMove(Moves.CLANGOROUS_SOULBLAZE, Type.DRAGON, MoveCategory.SPECIAL, 185, -1, 1, 100, 0, 7) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, true) .soundBased() .target(MoveTarget.ALL_NEAR_ENEMIES) .partial() @@ -8539,6 +8604,7 @@ export function initMoves() { /* Unused */ new SelfStatusMove(Moves.MAX_GUARD, Type.NORMAL, -1, 10, -1, 4, 8) .attr(ProtectAttr) + .condition(failIfLastCondition) .ignoresVirtual(), /* End Unused */ new AttackMove(Moves.DYNAMAX_CANNON, Type.DRAGON, MoveCategory.SPECIAL, 100, 100, 5, -1, 0, 8) @@ -8563,18 +8629,18 @@ export function initMoves() { .bitingMove(), new SelfStatusMove(Moves.STUFF_CHEEKS, Type.NORMAL, -1, 10, -1, 0, 8) // TODO: Stuff Cheeks should not be selectable when the user does not have a berry, see wiki .attr(EatBerryAttr) - .attr(StatChangeAttr, BattleStat.DEF, 2, true) + .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true) .condition((user) => { const userBerries = user.scene.findModifiers(m => m instanceof BerryModifier, user.isPlayer()); return userBerries.length > 0; }) .partial(), new SelfStatusMove(Moves.NO_RETREAT, Type.FIGHTING, -1, 5, -1, 0, 8) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, true) .attr(AddBattlerTagAttr, BattlerTagType.NO_RETREAT, true, false) .condition((user, target, move) => user.getTag(TrappedTag)?.sourceMove !== Moves.NO_RETREAT), // fails if the user is currently trapped by No Retreat new StatusMove(Moves.TAR_SHOT, Type.ROCK, 100, 15, -1, 0, 8) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .partial(), new StatusMove(Moves.MAGIC_POWDER, Type.PSYCHIC, 100, 20, -1, 0, 8) .attr(ChangeTypeAttr, Type.PSYCHIC) @@ -8669,16 +8735,16 @@ export function initMoves() { .ignoresVirtual(), /* End Unused */ new SelfStatusMove(Moves.CLANGOROUS_SOUL, Type.DRAGON, 100, 5, -1, 0, 8) - .attr(CutHpStatBoostAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, 3) + .attr(CutHpStatStageBoostAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ], 1, 3) .soundBased() .danceMove(), new AttackMove(Moves.BODY_PRESS, Type.FIGHTING, MoveCategory.PHYSICAL, 80, 100, 10, -1, 0, 8) .attr(DefAtkAttr), new StatusMove(Moves.DECORATE, Type.FAIRY, -1, 15, -1, 0, 8) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], 2) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], 2) .ignoresProtect(), new AttackMove(Moves.DRUM_BEATING, Type.GRASS, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .makesContact(false), new AttackMove(Moves.SNAP_TRAP, Type.GRASS, MoveCategory.PHYSICAL, 35, 100, 15, -1, 0, 8) .attr(TrapAttr, BattlerTagType.SNAP_TRAP), @@ -8691,25 +8757,25 @@ export function initMoves() { .slicingMove(), new AttackMove(Moves.BEHEMOTH_BASH, Type.STEEL, MoveCategory.PHYSICAL, 100, 100, 5, -1, 0, 8), new AttackMove(Moves.AURA_WHEEL, Type.ELECTRIC, MoveCategory.PHYSICAL, 110, 100, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.SPD, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true) .makesContact(false) .attr(AuraWheelTypeAttr) .condition((user, target, move) => [user.species.speciesId, user.fusionSpecies?.speciesId].includes(Species.MORPEKO)), // Missing custom fail message new AttackMove(Moves.BREAKING_SWIPE, Type.DRAGON, MoveCategory.PHYSICAL, 60, 100, 15, 100, 0, 8) .target(MoveTarget.ALL_NEAR_ENEMIES) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new AttackMove(Moves.BRANCH_POKE, Type.GRASS, MoveCategory.PHYSICAL, 40, 100, 40, -1, 0, 8), new AttackMove(Moves.OVERDRIVE, Type.ELECTRIC, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 8) .soundBased() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.APPLE_ACID, Type.GRASS, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.SPDEF, -1), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -1), new AttackMove(Moves.GRAV_APPLE, Type.GRASS, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTag(ArenaTagType.GRAVITY) ? 1.5 : 1) .makesContact(false), new AttackMove(Moves.SPIRIT_BREAK, Type.FAIRY, MoveCategory.PHYSICAL, 75, 100, 15, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.SPATK, -1), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1), new AttackMove(Moves.STRANGE_STEAM, Type.FAIRY, MoveCategory.SPECIAL, 90, 95, 10, 20, 0, 8) .attr(ConfuseAttr), new StatusMove(Moves.LIFE_DEW, Type.WATER, -1, 10, -1, 0, 8) @@ -8717,7 +8783,8 @@ export function initMoves() { .target(MoveTarget.USER_AND_ALLIES) .ignoresProtect(), new SelfStatusMove(Moves.OBSTRUCT, Type.DARK, 100, 10, -1, 4, 8) - .attr(ProtectAttr, BattlerTagType.OBSTRUCT), + .attr(ProtectAttr, BattlerTagType.OBSTRUCT) + .condition(failIfLastCondition), new AttackMove(Moves.FALSE_SURRENDER, Type.DARK, MoveCategory.PHYSICAL, 80, -1, 10, -1, 0, 8), new AttackMove(Moves.METEOR_ASSAULT, Type.FIGHTING, MoveCategory.PHYSICAL, 150, 100, 5, -1, 0, 8) .attr(RechargeAttr) @@ -8733,14 +8800,14 @@ export function initMoves() { .attr(ClearTerrainAttr) .condition((user, target, move) => !!user.scene.arena.terrain), new AttackMove(Moves.SCALE_SHOT, Type.DRAGON, MoveCategory.PHYSICAL, 25, 90, 20, -1, 0, 8) - //.attr(StatChangeAttr, BattleStat.SPD, 1, true) // TODO: Have boosts only apply at end of move, not after every hit - //.attr(StatChangeAttr, BattleStat.DEF, -1, true) + //.attr(StatStageChangeAttr, Stat.SPD, 1, true) // TODO: Have boosts only apply at end of move, not after every hit + //.attr(StatStageChangeAttr, Stat.DEF, -1, true) .attr(MultiHitAttr) .makesContact(false) .partial(), new AttackMove(Moves.METEOR_BEAM, Type.ROCK, MoveCategory.SPECIAL, 120, 90, 10, 100, 0, 8) .attr(ChargeAttr, ChargeAnim.METEOR_BEAM_CHARGING, i18next.t("moveTriggers:isOverflowingWithSpacePower", {pokemonName: "{USER}"}), null, true) - .attr(StatChangeAttr, BattleStat.SPATK, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPATK ], 1, true) .ignoresVirtual(), new AttackMove(Moves.SHELL_SIDE_ARM, Type.POISON, MoveCategory.SPECIAL, 90, 100, 10, 20, 0, 8) .attr(ShellSideArmCategoryAttr) @@ -8761,12 +8828,12 @@ export function initMoves() { .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() !== TerrainType.NONE && user.isGrounded() ? 2 : 1) .pulseMove(), new AttackMove(Moves.SKITTER_SMACK, Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.SPATK, -1), + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1), new AttackMove(Moves.BURNING_JEALOUSY, Type.FIRE, MoveCategory.SPECIAL, 70, 100, 5, 100, 0, 8) .attr(StatusIfBoostedAttr, StatusEffect.BURN) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.LASH_OUT, Type.DARK, MoveCategory.PHYSICAL, 75, 100, 5, -1, 0, 8) - .attr(MovePowerMultiplierAttr, (user, target, move) => user.turnData.battleStatsDecreased ? 2 : 1), + .attr(MovePowerMultiplierAttr, (user, _target, _move) => user.turnData.statStagesDecreased ? 2 : 1), new AttackMove(Moves.POLTERGEIST, Type.GHOST, MoveCategory.PHYSICAL, 110, 90, 5, -1, 0, 8) .attr(AttackedByItemAttr) .makesContact(false), @@ -8774,7 +8841,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_OTHERS) .unimplemented(), new StatusMove(Moves.COACHING, Type.FIGHTING, -1, 10, -1, 0, 8) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], 1) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF ], 1) .target(MoveTarget.NEAR_ALLY), new AttackMove(Moves.FLIP_TURN, Type.WATER, MoveCategory.PHYSICAL, 60, 100, 20, -1, 0, 8) .attr(ForceSwitchOutAttr, true, false), @@ -8810,7 +8877,7 @@ export function initMoves() { .attr(FlinchAttr) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.THUNDEROUS_KICK, Type.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.DEF, -1), + .attr(StatStageChangeAttr, [ Stat.DEF ], -1), new AttackMove(Moves.GLACIAL_LANCE, Type.ICE, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 8) .target(MoveTarget.ALL_NEAR_ENEMIES) .makesContact(false), @@ -8822,18 +8889,18 @@ export function initMoves() { new AttackMove(Moves.DIRE_CLAW, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 15, 50, 0, 8) .attr(MultiStatusEffectAttr, [StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP]), new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.DEF, 1, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 1, true), new SelfStatusMove(Moves.POWER_SHIFT, Type.NORMAL, -1, 10, -1, 0, 8) .unimplemented(), new AttackMove(Moves.STONE_AXE, Type.ROCK, MoveCategory.PHYSICAL, 65, 90, 15, 100, 0, 8) .attr(AddArenaTrapTagHitAttr, ArenaTagType.STEALTH_ROCK) .slicingMove(), new AttackMove(Moves.SPRINGTIDE_STORM, Type.FAIRY, MoveCategory.SPECIAL, 100, 80, 5, 30, 0, 8) - .attr(StatChangeAttr, BattleStat.ATK, -1) + .attr(StatStageChangeAttr, [ Stat.ATK ], -1) .windMove() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.MYSTICAL_POWER, Type.PSYCHIC, MoveCategory.SPECIAL, 70, 90, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.SPATK, 1, true), + .attr(StatStageChangeAttr, [ Stat.SPATK ], 1, true), new AttackMove(Moves.RAGING_FURY, Type.FIRE, MoveCategory.PHYSICAL, 120, 100, 10, -1, 0, 8) .makesContact(false) .attr(FrenzyAttr) @@ -8849,10 +8916,10 @@ export function initMoves() { .makesContact(false) .attr(FlinchAttr), new SelfStatusMove(Moves.VICTORY_DANCE, Type.FIGHTING, -1, 10, -1, 0, 8) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPD ], 1, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.DEF, Stat.SPD ], 1, true) .danceMove(), new AttackMove(Moves.HEADLONG_RUSH, Type.GROUND, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 8) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true) + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true) .punchingMove(), new AttackMove(Moves.BARB_BARRAGE, Type.POISON, MoveCategory.PHYSICAL, 60, 100, 10, 50, 0, 8) .makesContact(false) @@ -8860,15 +8927,15 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.POISON), new AttackMove(Moves.ESPER_WING, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 8) .attr(HighCritAttr) - .attr(StatChangeAttr, BattleStat.SPD, 1, true), + .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true), new AttackMove(Moves.BITTER_MALICE, Type.GHOST, MoveCategory.SPECIAL, 75, 100, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new SelfStatusMove(Moves.SHELTER, Type.STEEL, -1, 10, 100, 0, 8) - .attr(StatChangeAttr, BattleStat.DEF, 2, true), + .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true), new AttackMove(Moves.TRIPLE_ARROWS, Type.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 10, 30, 0, 8) .makesContact(false) .attr(HighCritAttr) - .attr(StatChangeAttr, BattleStat.DEF, -1) + .attr(StatStageChangeAttr, [ Stat.DEF ], -1) .attr(FlinchAttr) .partial(), new AttackMove(Moves.INFERNAL_PARADE, Type.GHOST, MoveCategory.SPECIAL, 60, 100, 15, 30, 0, 8) @@ -8879,7 +8946,7 @@ export function initMoves() { .slicingMove(), new AttackMove(Moves.BLEAKWIND_STORM, Type.FLYING, MoveCategory.SPECIAL, 100, 80, 10, 30, 0, 8) .attr(StormAccuracyAttr) - .attr(StatChangeAttr, BattleStat.SPD, -1) + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) .windMove() .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.WILDBOLT_STORM, Type.ELECTRIC, MoveCategory.SPECIAL, 100, 80, 10, 20, 0, 8) @@ -8898,7 +8965,7 @@ export function initMoves() { .target(MoveTarget.USER_AND_ALLIES) .triageMove(), new SelfStatusMove(Moves.TAKE_HEART, Type.PSYCHIC, -1, 10, -1, 0, 8) - .attr(StatChangeAttr, [ BattleStat.SPATK, BattleStat.SPDEF ], 1, true) + .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF ], 1, true) .attr(HealStatusEffectAttr, true, StatusEffect.PARALYSIS, StatusEffect.POISON, StatusEffect.TOXIC, StatusEffect.BURN, StatusEffect.SLEEP), /* Unused new AttackMove(Moves.G_MAX_WILDFIRE, Type.FIRE, MoveCategory.PHYSICAL, 10, -1, 10, -1, 0, 8) @@ -9005,10 +9072,10 @@ export function initMoves() { .attr(TeraBlastCategoryAttr) .attr(TeraBlastTypeAttr) .attr(TeraBlastPowerAttr) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1, true, (user, target, move) => user.isTerastallized() && user.isOfType(Type.STELLAR)) - .partial(), + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], -1, true, (user, target, move) => user.isTerastallized() && user.isOfType(Type.STELLAR)), new SelfStatusMove(Moves.SILK_TRAP, Type.BUG, -1, 10, -1, 4, 9) - .attr(ProtectAttr, BattlerTagType.SILK_TRAP), + .attr(ProtectAttr, BattlerTagType.SILK_TRAP) + .condition(failIfLastCondition), new AttackMove(Moves.AXE_KICK, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 90, 10, 30, 0, 9) .attr(MissEffectAttr, crashDamageFunc) .attr(NoEffectAttr, crashDamageFunc) @@ -9018,17 +9085,17 @@ export function initMoves() { .attr(MovePowerMultiplierAttr, (user, target, move) => 1 + Math.min(user.isPlayer() ? user.scene.currentBattle.playerFaints : user.scene.currentBattle.enemyFaints, 100)) .makesContact(false), new AttackMove(Moves.LUMINA_CRASH, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 9) - .attr(StatChangeAttr, BattleStat.SPDEF, -2), + .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2), new AttackMove(Moves.ORDER_UP, Type.DRAGON, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 9) .makesContact(false) .partial(), new AttackMove(Moves.JET_PUNCH, Type.WATER, MoveCategory.PHYSICAL, 60, 100, 15, -1, 1, 9) .punchingMove(), new StatusMove(Moves.SPICY_EXTRACT, Type.GRASS, -1, 15, -1, 0, 9) - .attr(StatChangeAttr, BattleStat.ATK, 2) - .attr(StatChangeAttr, BattleStat.DEF, -2), + .attr(StatStageChangeAttr, [ Stat.ATK ], 2) + .attr(StatStageChangeAttr, [ Stat.DEF ], -2), new AttackMove(Moves.SPIN_OUT, Type.STEEL, MoveCategory.PHYSICAL, 100, 100, 5, -1, 0, 9) - .attr(StatChangeAttr, BattleStat.SPD, -2, true), + .attr(StatStageChangeAttr, [ Stat.SPD ], -2, true), new AttackMove(Moves.POPULATION_BOMB, Type.NORMAL, MoveCategory.PHYSICAL, 20, 90, 10, -1, 0, 9) .attr(MultiHitAttr, MultiHitType._10) .slicingMove() @@ -9070,24 +9137,24 @@ export function initMoves() { new StatusMove(Moves.DOODLE, Type.NORMAL, 100, 10, -1, 0, 9) .attr(AbilityCopyAttr, true), new SelfStatusMove(Moves.FILLET_AWAY, Type.NORMAL, -1, 10, -1, 0, 9) - .attr(CutHpStatBoostAttr, [ BattleStat.ATK, BattleStat.SPATK, BattleStat.SPD ], 2, 2), + .attr(CutHpStatStageBoostAttr, [ Stat.ATK, Stat.SPATK, Stat.SPD ], 2, 2), new AttackMove(Moves.KOWTOW_CLEAVE, Type.DARK, MoveCategory.PHYSICAL, 85, -1, 10, -1, 0, 9) .slicingMove(), new AttackMove(Moves.FLOWER_TRICK, Type.GRASS, MoveCategory.PHYSICAL, 70, -1, 10, 100, 0, 9) .attr(CritOnlyAttr) .makesContact(false), new AttackMove(Moves.TORCH_SONG, Type.FIRE, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 9) - .attr(StatChangeAttr, BattleStat.SPATK, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPATK ], 1, true) .soundBased(), new AttackMove(Moves.AQUA_STEP, Type.WATER, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 9) - .attr(StatChangeAttr, BattleStat.SPD, 1, true) + .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true) .danceMove(), new AttackMove(Moves.RAGING_BULL, Type.NORMAL, MoveCategory.PHYSICAL, 90, 100, 10, -1, 0, 9) .attr(RagingBullTypeAttr) .attr(RemoveScreensAttr), new AttackMove(Moves.MAKE_IT_RAIN, Type.STEEL, MoveCategory.SPECIAL, 120, 100, 5, -1, 0, 9) .attr(MoneyAttr) - .attr(StatChangeAttr, BattleStat.SPATK, -1, true, null, true, false, MoveEffectTrigger.HIT, true) + .attr(StatStageChangeAttr, [ Stat.SPATK ], -1, true, null, true, false, MoveEffectTrigger.HIT, true) .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.PSYBLADE, Type.PSYCHIC, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 9) .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.ELECTRIC && user.isGrounded() ? 1.5 : 1) @@ -9109,17 +9176,17 @@ export function initMoves() { .attr(ForceSwitchOutAttr, true, false) .target(MoveTarget.BOTH_SIDES), new SelfStatusMove(Moves.TIDY_UP, Type.NORMAL, -1, 10, -1, 0, 9) - .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPD ], 1, true, null, true, true) + .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPD ], 1, true, null, true, true) .attr(RemoveArenaTrapAttr, true), new StatusMove(Moves.SNOWSCAPE, Type.ICE, -1, 10, -1, 0, 9) .attr(WeatherChangeAttr, WeatherType.SNOW) .target(MoveTarget.BOTH_SIDES), new AttackMove(Moves.POUNCE, Type.BUG, MoveCategory.PHYSICAL, 50, 100, 20, 100, 0, 9) - .attr(StatChangeAttr, BattleStat.SPD, -1), + .attr(StatStageChangeAttr, [ Stat.SPD ], -1), new AttackMove(Moves.TRAILBLAZE, Type.GRASS, MoveCategory.PHYSICAL, 50, 100, 20, 100, 0, 9) - .attr(StatChangeAttr, BattleStat.SPD, 1, true), + .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true), new AttackMove(Moves.CHILLING_WATER, Type.WATER, MoveCategory.SPECIAL, 50, 100, 20, 100, 0, 9) - .attr(StatChangeAttr, BattleStat.ATK, -1), + .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new AttackMove(Moves.HYPER_DRILL, Type.NORMAL, MoveCategory.PHYSICAL, 100, 100, 5, -1, 0, 9) .ignoresProtect(), new AttackMove(Moves.TWIN_BEAM, Type.PSYCHIC, MoveCategory.SPECIAL, 40, 100, 10, -1, 0, 9) @@ -9128,7 +9195,7 @@ export function initMoves() { .attr(HitCountPowerAttr) .punchingMove(), new AttackMove(Moves.ARMOR_CANNON, Type.FIRE, MoveCategory.SPECIAL, 120, 100, 5, -1, 0, 9) - .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true), + .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], -1, true), new AttackMove(Moves.BITTER_BLADE, Type.FIRE, MoveCategory.PHYSICAL, 90, 100, 10, -1, 0, 9) .attr(HitHealAttr) .slicingMove() @@ -9183,7 +9250,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES) .triageMove(), new AttackMove(Moves.SYRUP_BOMB, Type.GRASS, MoveCategory.SPECIAL, 60, 85, 10, -1, 0, 9) - .attr(StatChangeAttr, BattleStat.SPD, -1) //Temporary + .attr(StatStageChangeAttr, [ Stat.SPD ], -1) //Temporary .ballBombMove() .partial(), new AttackMove(Moves.IVY_CUDGEL, Type.GRASS, MoveCategory.PHYSICAL, 100, 100, 10, -1, 0, 9) @@ -9200,7 +9267,8 @@ export function initMoves() { .attr(PreMoveMessageAttr, doublePowerChanceMessageFunc) .attr(DoublePowerChanceAttr), new SelfStatusMove(Moves.BURNING_BULWARK, Type.FIRE, -1, 10, -1, 4, 9) - .attr(ProtectAttr, BattlerTagType.BURNING_BULWARK), + .attr(ProtectAttr, BattlerTagType.BURNING_BULWARK) + .condition(failIfLastCondition), new AttackMove(Moves.THUNDERCLAP, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 5, -1, 1, 9) .condition((user, target, move) => user.scene.currentBattle.turnCommands[target.getBattlerIndex()]?.command === Command.FIGHT && !target.turnData.acted && allMoves[user.scene.currentBattle.turnCommands[target.getBattlerIndex()]?.move?.move!].category !== MoveCategory.STATUS), // TODO: is this bang correct? new AttackMove(Moves.MIGHTY_CLEAVE, Type.ROCK, MoveCategory.PHYSICAL, 95, 100, 5, -1, 0, 9) @@ -9235,7 +9303,7 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.TOXIC) ); allMoves.map(m => { - if (m.getAttrs(StatChangeAttr).some(a => a.selfTarget && a.levels < 0)) { + if (m.getAttrs(StatStageChangeAttr).some(a => a.selfTarget && a.stages < 0)) { selfStatLowerMoves.push(m.id); } }); diff --git a/src/data/nature.ts b/src/data/nature.ts index 72e5bb7863c..c614be465c3 100644 --- a/src/data/nature.ts +++ b/src/data/nature.ts @@ -1,9 +1,9 @@ -import { Stat, getStatName } from "./pokemon-stat"; import * as Utils from "../utils"; import { TextStyle, getBBCodeFrag } from "../ui/text"; import { Nature } from "#enums/nature"; import { UiTheme } from "#enums/ui-theme"; import i18next from "i18next"; +import { Stat, EFFECTIVE_STATS, getShortenedStatKey } from "#app/enums/stat"; export { Nature }; @@ -14,10 +14,9 @@ export function getNatureName(nature: Nature, includeStatEffects: boolean = fals ret = i18next.t("nature:" + ret as any); } if (includeStatEffects) { - const stats = Utils.getEnumValues(Stat).slice(1); let increasedStat: Stat | null = null; let decreasedStat: Stat | null = null; - for (const stat of stats) { + for (const stat of EFFECTIVE_STATS) { const multiplier = getNatureStatMultiplier(nature, stat); if (multiplier > 1) { increasedStat = stat; @@ -28,7 +27,7 @@ export function getNatureName(nature: Nature, includeStatEffects: boolean = fals const textStyle = forStarterSelect ? TextStyle.SUMMARY_ALT : TextStyle.WINDOW; const getTextFrag = !ignoreBBCode ? (text: string, style: TextStyle) => getBBCodeFrag(text, style, uiTheme) : (text: string, style: TextStyle) => text; if (increasedStat && decreasedStat) { - ret = `${getTextFrag(`${ret}${!forStarterSelect ? "\n" : " "}(`, textStyle)}${getTextFrag(`+${getStatName(increasedStat, true)}`, TextStyle.SUMMARY_PINK)}${getTextFrag("/", textStyle)}${getTextFrag(`-${getStatName(decreasedStat, true)}`, TextStyle.SUMMARY_BLUE)}${getTextFrag(")", textStyle)}`; + ret = `${getTextFrag(`${ret}${!forStarterSelect ? "\n" : " "}(`, textStyle)}${getTextFrag(`+${i18next.t(getShortenedStatKey(increasedStat))}`, TextStyle.SUMMARY_PINK)}${getTextFrag("/", textStyle)}${getTextFrag(`-${i18next.t(getShortenedStatKey(decreasedStat))}`, TextStyle.SUMMARY_BLUE)}${getTextFrag(")", textStyle)}`; } else { ret = getTextFrag(`${ret}${!forStarterSelect ? "\n" : " "}(-)`, textStyle); } diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 315e75e53e1..6479d620182 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -1,7 +1,7 @@ import { Gender } from "./gender"; import { PokeballType } from "./pokeball"; import Pokemon from "../field/pokemon"; -import { Stat } from "./pokemon-stat"; +import { Stat } from "#enums/stat"; import { Type } from "./type"; import * as Utils from "../utils"; import { SpeciesFormKey } from "./pokemon-species"; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 17f2de794ae..09448b332e4 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -14,7 +14,7 @@ import { GrowthRate } from "./exp"; import { EvolutionLevel, SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; import { Type } from "./type"; import { LevelMoves, pokemonFormLevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from "./pokemon-level-moves"; -import { Stat } from "./pokemon-stat"; +import { Stat } from "#enums/stat"; import { Variant, VariantSet, variantColorCache, variantData } from "./variant"; export enum Region { @@ -944,7 +944,7 @@ export function initSpecies() { new PokemonSpecies(Species.METAPOD, 1, false, false, false, "Cocoon Pokémon", Type.BUG, null, 0.7, 9.9, Abilities.SHED_SKIN, Abilities.NONE, Abilities.SHED_SKIN, 205, 50, 20, 55, 25, 25, 30, 120, 50, 72, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.BUTTERFREE, 1, false, false, false, "Butterfly Pokémon", Type.BUG, Type.FLYING, 1.1, 32, Abilities.COMPOUND_EYES, Abilities.NONE, Abilities.TINTED_LENS, 395, 60, 45, 50, 90, 80, 70, 45, 50, 198, GrowthRate.MEDIUM_FAST, 50, true, true, new PokemonForm("Normal", "", Type.BUG, Type.FLYING, 1.1, 32, Abilities.COMPOUND_EYES, Abilities.NONE, Abilities.TINTED_LENS, 395, 60, 45, 50, 90, 80, 70, 45, 50, 198, true, null, true), - new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.BUG, Type.FLYING, 17, 32, Abilities.TINTED_LENS, Abilities.TINTED_LENS, Abilities.TINTED_LENS, 495, 85, 35, 80, 120, 90, 85, 45, 50, 198, true), + new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.BUG, Type.FLYING, 17, 32, Abilities.COMPOUND_EYES, Abilities.COMPOUND_EYES, Abilities.COMPOUND_EYES, 495, 85, 35, 80, 120, 90, 85, 45, 50, 198, true), ), new PokemonSpecies(Species.WEEDLE, 1, false, false, false, "Hairy Bug Pokémon", Type.BUG, Type.POISON, 0.3, 3.2, Abilities.SHIELD_DUST, Abilities.NONE, Abilities.RUN_AWAY, 195, 40, 35, 30, 20, 20, 50, 255, 70, 39, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.KAKUNA, 1, false, false, false, "Cocoon Pokémon", Type.BUG, Type.POISON, 0.6, 10, Abilities.SHED_SKIN, Abilities.NONE, Abilities.SHED_SKIN, 205, 45, 25, 50, 25, 25, 35, 120, 70, 72, GrowthRate.MEDIUM_FAST, 50, false), diff --git a/src/data/pokemon-stat.ts b/src/data/pokemon-stat.ts deleted file mode 100644 index 16570785a62..00000000000 --- a/src/data/pokemon-stat.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Stat } from "#enums/stat"; -import i18next from "i18next"; - -export { Stat }; - -export function getStatName(stat: Stat, shorten: boolean = false) { - let ret: string = ""; - switch (stat) { - case Stat.HP: - ret = !shorten ? i18next.t("pokemonInfo:Stat.HP") : i18next.t("pokemonInfo:Stat.HPshortened"); - break; - case Stat.ATK: - ret = !shorten ? i18next.t("pokemonInfo:Stat.ATK") : i18next.t("pokemonInfo:Stat.ATKshortened"); - break; - case Stat.DEF: - ret = !shorten ? i18next.t("pokemonInfo:Stat.DEF") : i18next.t("pokemonInfo:Stat.DEFshortened"); - break; - case Stat.SPATK: - ret = !shorten ? i18next.t("pokemonInfo:Stat.SPATK") : i18next.t("pokemonInfo:Stat.SPATKshortened"); - break; - case Stat.SPDEF: - ret = !shorten ? i18next.t("pokemonInfo:Stat.SPDEF") : i18next.t("pokemonInfo:Stat.SPDEFshortened"); - break; - case Stat.SPD: - ret = !shorten ? i18next.t("pokemonInfo:Stat.SPD") : i18next.t("pokemonInfo:Stat.SPDshortened"); - break; - } - return ret; -} diff --git a/src/data/temp-battle-stat.ts b/src/data/temp-battle-stat.ts deleted file mode 100644 index 2d461a1d647..00000000000 --- a/src/data/temp-battle-stat.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { BattleStat, getBattleStatName } from "./battle-stat"; -import i18next from "i18next"; - -export enum TempBattleStat { - ATK, - DEF, - SPATK, - SPDEF, - SPD, - ACC, - CRIT -} - -export function getTempBattleStatName(tempBattleStat: TempBattleStat) { - if (tempBattleStat === TempBattleStat.CRIT) { - return i18next.t("modifierType:TempBattleStatBoosterStatName.CRIT"); - } - return getBattleStatName(tempBattleStat as integer as BattleStat); -} - -export function getTempBattleStatBoosterItemName(tempBattleStat: TempBattleStat) { - switch (tempBattleStat) { - case TempBattleStat.ATK: - return "X Attack"; - case TempBattleStat.DEF: - return "X Defense"; - case TempBattleStat.SPATK: - return "X Sp. Atk"; - case TempBattleStat.SPDEF: - return "X Sp. Def"; - case TempBattleStat.SPD: - return "X Speed"; - case TempBattleStat.ACC: - return "X Accuracy"; - case TempBattleStat.CRIT: - return "Dire Hit"; - } -} diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index 20ceb1b331f..a2bcf9e4c0e 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -64,6 +64,7 @@ export enum BattlerTagType { STOCKPILING = "STOCKPILING", RECEIVE_DOUBLE_DAMAGE = "RECEIVE_DOUBLE_DAMAGE", ALWAYS_GET_HIT = "ALWAYS_GET_HIT", + DISABLED = "DISABLED", IGNORE_GHOST = "IGNORE_GHOST", IGNORE_DARK = "IGNORE_DARK", GULP_MISSILE_ARROKUDA = "GULP_MISSILE_ARROKUDA", diff --git a/src/enums/shop-cursor-target.ts b/src/enums/shop-cursor-target.ts index d2f72fed0d6..11f524399b2 100644 --- a/src/enums/shop-cursor-target.ts +++ b/src/enums/shop-cursor-target.ts @@ -1,13 +1,13 @@ /** - * Determines the cursor target when entering the shop phase. + * Determines the row cursor target when entering the shop phase. */ export enum ShopCursorTarget { - /** Cursor points to Reroll */ + /** Cursor points to Reroll row */ REROLL, - /** Cursor points to Items */ - ITEMS, - /** Cursor points to Shop */ + /** Cursor points to Rewards row */ + REWARDS, + /** Cursor points to Shop row */ SHOP, - /** Cursor points to Check Team */ + /** Cursor points to Check Team row */ CHECK_TEAM } diff --git a/src/enums/stat.ts b/src/enums/stat.ts index a40319664d6..a12d53e8559 100644 --- a/src/enums/stat.ts +++ b/src/enums/stat.ts @@ -1,8 +1,75 @@ +/** Enum that comprises all possible stat-related attributes, in-battle and permanent, of a Pokemon. */ export enum Stat { + /** Hit Points */ HP = 0, + /** Attack */ ATK, + /** Defense */ DEF, + /** Special Attack */ SPATK, + /** Special Defense */ SPDEF, + /** Speed */ SPD, + /** Accuracy */ + ACC, + /** Evasiveness */ + EVA +} + +/** A constant array comprised of the {@linkcode Stat} values that make up {@linkcode PermanentStat}. */ +export const PERMANENT_STATS = [ Stat.HP, Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ] as const; +/** Type used to describe the core, permanent stats of a Pokemon. */ +export type PermanentStat = typeof PERMANENT_STATS[number]; + +/** A constant array comprised of the {@linkcode Stat} values that make up {@linkcode EFfectiveStat}. */ +export const EFFECTIVE_STATS = [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD ] as const; +/** Type used to describe the intersection of core stats and stats that have stages in battle. */ +export type EffectiveStat = typeof EFFECTIVE_STATS[number]; + +/** A constant array comprised of {@linkcode Stat} the values that make up {@linkcode BattleStat}. */ +export const BATTLE_STATS = [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD, Stat.ACC, Stat.EVA ] as const; +/** Type used to describe the stats that have stages which can be incremented and decremented in battle. */ +export type BattleStat = typeof BATTLE_STATS[number]; + +/** A constant array comprised of {@linkcode Stat} the values that make up {@linkcode TempBattleStat}. */ +export const TEMP_BATTLE_STATS = [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.SPD, Stat.ACC ] as const; +/** Type used to describe the stats that have X item (`TEMP_STAT_STAGE_BOOSTER`) equivalents. */ +export type TempBattleStat = typeof TEMP_BATTLE_STATS[number]; + +/** + * Provides the translation key corresponding to the amount of stat stages and whether those stat stages + * are positive or negative. + * @param stages the amount of stages + * @param isIncrease dictates a negative (`false`) or a positive (`true`) stat stage change + * @returns the translation key fitting the conditions described by {@linkcode stages} and {@linkcode isIncrease} + */ +export function getStatStageChangeDescriptionKey(stages: number, isIncrease: boolean) { + if (stages === 1) { + return isIncrease ? "battle:statRose" : "battle:statFell"; + } else if (stages === 2) { + return isIncrease ? "battle:statSharplyRose" : "battle:statHarshlyFell"; + } else if (stages <= 6) { + return isIncrease ? "battle:statRoseDrastically" : "battle:statSeverelyFell"; + } + return isIncrease ? "battle:statWontGoAnyHigher" : "battle:statWontGoAnyLower"; +} + +/** + * Provides the translation key corresponding to a given stat which can be translated into its full name. + * @param stat the {@linkcode Stat} to be translated + * @returns the translation key corresponding to the given {@linkcode Stat} + */ +export function getStatKey(stat: Stat) { + return `pokemonInfo:Stat.${Stat[stat]}`; +} + +/** + * Provides the translation key corresponding to a given stat which can be translated into its shortened name. + * @param stat the {@linkcode Stat} to be translated + * @returns the translation key corresponding to the given {@linkcode Stat} + */ +export function getShortenedStatKey(stat: PermanentStat) { + return `pokemonInfo:Stat.${Stat[stat]}shortened`; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 34eb6b7a512..f163755eb53 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3,26 +3,24 @@ import BattleScene, { AnySound } from "../battle-scene"; import { Variant, VariantSet, variantColorCache } from "#app/data/variant"; import { variantData } from "#app/data/variant"; import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from "../ui/battle-info"; -import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, VariableMoveTypeAttr, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr, BypassBurnDamageReductionAttr, SacrificialAttrOnHit, OneHitKOAccuracyAttr, RespectAttackTypeImmunityAttr } from "../data/move"; +import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, VariableMoveTypeAttr, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatStagesAttr, SacrificialAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatStageChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr, BypassBurnDamageReductionAttr, SacrificialAttrOnHit, OneHitKOAccuracyAttr, RespectAttackTypeImmunityAttr } from "../data/move"; import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from "../data/pokemon-species"; import { Constructor } from "#app/utils"; import * as Utils from "../utils"; import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from "../data/type"; import { getLevelTotalExp } from "../data/exp"; -import { Stat } from "../data/pokemon-stat"; -import { DamageMoneyRewardModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, EnemyEndureChanceModifier, EnemyFusionChanceModifier, HiddenAbilityRateBoosterModifier, PokemonBaseStatModifier, PokemonFriendshipBoosterModifier, PokemonHeldItemModifier, PokemonNatureWeightModifier, ShinyRateBoosterModifier, SurviveDamageModifier, TempBattleStatBoosterModifier, StatBoosterModifier, CritBoosterModifier, TerastallizeModifier } from "../modifier/modifier"; +import { Stat, type PermanentStat, type BattleStat, type EffectiveStat, PERMANENT_STATS, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; +import { DamageMoneyRewardModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, EnemyEndureChanceModifier, EnemyFusionChanceModifier, HiddenAbilityRateBoosterModifier, BaseStatModifier, PokemonFriendshipBoosterModifier, PokemonHeldItemModifier, PokemonNatureWeightModifier, ShinyRateBoosterModifier, SurviveDamageModifier, TempStatStageBoosterModifier, TempCritBoosterModifier, StatBoosterModifier, CritBoosterModifier, TerastallizeModifier } from "../modifier/modifier"; import { PokeballType } from "../data/pokeball"; import { Gender } from "../data/gender"; import { initMoveAnim, loadMoveAnimAssets } from "../data/battle-anims"; import { Status, StatusEffect, getRandomStatus } from "../data/status-effect"; import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; -import { BattleStat } from "../data/battle-stat"; -import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag } from "../data/battler-tags"; +import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag } from "../data/battler-tags"; import { WeatherType } from "../data/weather"; -import { TempBattleStat } from "../data/temp-battle-stat"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; -import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldBattleStatMultiplierAbAttrs, FieldMultiplyBattleStatAbAttr, AddSecondStrikeAbAttr, IgnoreOpponentEvasionAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr, MoveTypeChangeAbAttr, FullHpResistTypeAbAttr, applyCheckTrappedAbAttrs, CheckTrappedAbAttr } from "../data/ability"; +import { Ability, AbAttr, StatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentStatStagesAbAttr, MoveImmunityAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldStatMultiplierAbAttrs, FieldMultiplyStatAbAttr, AddSecondStrikeAbAttr, UserFieldStatusEffectImmunityAbAttr, UserFieldBattlerTagImmunityAbAttr, BattlerTagImmunityAbAttr, MoveTypeChangeAbAttr, FullHpResistTypeAbAttr, applyCheckTrappedAbAttrs, CheckTrappedAbAttr } from "../data/ability"; import PokemonData from "../system/pokemon-data"; import { BattlerIndex } from "../battle"; import { Mode } from "../ui/ui"; @@ -40,7 +38,7 @@ import Overrides from "#app/overrides"; import i18next from "i18next"; import { speciesEggMoves } from "../data/egg-moves"; import { ModifierTier } from "../modifier/modifier-tier"; -import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; +import { applyChallenges, ChallengeType } from "#app/data/challenge"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; @@ -49,17 +47,17 @@ import { BerryType } from "#enums/berry-type"; import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { DamagePhase } from "#app/phases/damage-phase"; +import { FaintPhase } from "#app/phases/faint-phase"; +import { LearnMovePhase } from "#app/phases/learn-move-phase"; +import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { ObtainStatusEffectPhase } from "#app/phases/obtain-status-effect-phase"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; +import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; +import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase"; import { Challenges } from "#enums/challenges"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { DamagePhase } from "#app/phases/damage-phase.js"; -import { FaintPhase } from "#app/phases/faint-phase.js"; -import { LearnMovePhase } from "#app/phases/learn-move-phase.js"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase.js"; -import { MoveEndPhase } from "#app/phases/move-end-phase.js"; -import { ObtainStatusEffectPhase } from "#app/phases/obtain-status-effect-phase.js"; -import { StatChangePhase } from "#app/phases/stat-change-phase.js"; -import { SwitchSummonPhase } from "#app/phases/switch-summon-phase.js"; -import { ToggleDoublePositionPhase } from "#app/phases/toggle-double-position-phase.js"; export enum FieldPosition { CENTER, @@ -119,6 +117,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { public maskEnabled: boolean; public maskSprite: Phaser.GameObjects.Sprite | null; + public usedTMs: Moves[]; + private shinySparkle: Phaser.GameObjects.Sprite; constructor(scene: BattleScene, x: number, y: number, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) { @@ -195,6 +195,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.fusionVariant = dataSource.fusionVariant || 0; this.fusionGender = dataSource.fusionGender; this.fusionLuck = dataSource.fusionLuck; + this.usedTMs = dataSource.usedTMs ?? []; } else { this.id = Utils.randSeedInt(4294967296); this.ivs = ivs || Utils.getIvsFromId(this.id); @@ -673,49 +674,139 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { }); } - getStat(stat: Stat): integer { + /** + * Retrieves the entire set of stats of the {@linkcode Pokemon}. + * @param bypassSummonData prefer actual stats (`true` by default) or in-battle overriden stats (`false`) + * @returns the numeric values of the {@linkcode Pokemon}'s stats + */ + getStats(bypassSummonData: boolean = true): number[] { + if (!bypassSummonData && this.summonData?.stats) { + return this.summonData.stats; + } + 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} + */ + getStat(stat: PermanentStat, bypassSummonData: boolean = true): number { + if (!bypassSummonData && this.summonData && (this.summonData.stats[stat] !== 0)) { + return this.summonData.stats[stat]; + } return this.stats[stat]; } - getBattleStat(stat: Stat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): integer { - if (stat === Stat.HP) { - return this.getStat(Stat.HP); - } - const battleStat = (stat - 1) as BattleStat; - const statLevel = new Utils.IntegerHolder(this.summonData.battleStats[battleStat]); - if (opponent) { - if (isCritical) { - switch (stat) { - case Stat.ATK: - case Stat.SPATK: - statLevel.value = Math.max(statLevel.value, 0); - break; - case Stat.DEF: - case Stat.SPDEF: - statLevel.value = Math.min(statLevel.value, 0); - break; - } - } - applyAbAttrs(IgnoreOpponentStatChangesAbAttr, opponent, null, false, statLevel); - if (move) { - applyMoveAttrs(IgnoreOpponentStatChangesAttr, this, opponent, move, statLevel); + /** + * 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`) + */ + setStat(stat: PermanentStat, value: number, bypassSummonData: boolean = true): void { + if (value >= 0) { + if (!bypassSummonData && this.summonData) { + this.summonData.stats[stat] = value; + } else { + this.stats[stat] = value; } } - if (this.isPlayer()) { - this.scene.applyModifiers(TempBattleStatBoosterModifier, this.isPlayer(), battleStat as integer as TempBattleStat, statLevel); + } + + /** + * Retrieves the entire set of in-battle stat stages of the {@linkcode Pokemon}. + * @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 ]; + } + + /** + * 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 + */ + getStatStage(stat: BattleStat): number { + return this.summonData ? this.summonData.statStages[stat - 1] : 0; + } + + /** + * 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 + */ + setStatStage(stat: BattleStat, value: number): void { + if (this.summonData) { + if (value >= -6) { + this.summonData.statStages[stat - 1] = Math.min(value, 6); + } else { + this.summonData.statStages[stat - 1] = Math.max(value, -6); + } } - const statValue = new Utils.NumberHolder(this.getStat(stat)); + } + + /** + * Retrieves the critical-hit stage considering the move used and the Pokemon + * who used it. + * @param source the {@linkcode Pokemon} who using the move + * @param move the {@linkcode Move} being used + * @returns the final critical-hit stage value + */ + getCritStage(source: Pokemon, move: Move): number { + const critStage = new Utils.IntegerHolder(0); + applyMoveAttrs(HighCritAttr, source, this, move, critStage); + this.scene.applyModifiers(CritBoosterModifier, source.isPlayer(), source, critStage); + this.scene.applyModifiers(TempCritBoosterModifier, source.isPlayer(), critStage); + const bonusCrit = new Utils.BooleanHolder(false); + //@ts-ignore + if (applyAbAttrs(BonusCritAbAttr, source, null, false, bonusCrit)) { // TODO: resolve ts-ignore. This is a promise. Checking a promise is bogus. + if (bonusCrit.value) { + critStage.value += 1; + } + } + const critBoostTag = source.getTag(CritBoostTag); + if (critBoostTag) { + if (critBoostTag instanceof DragonCheerTag) { + critStage.value += critBoostTag.typesOnAdd.includes(Type.DRAGON) ? 2 : 1; + } else { + critStage.value += 2; + } + } + + console.log(`crit stage: +${critStage.value}`); + return critStage.value; + } + + /** + * Calculates and retrieves the final value of a stat considering any held + * items, move effects, opponent abilities, and whether there was a critical + * hit. + * @param stat the desired {@linkcode EffectiveStat} + * @param opponent the target {@linkcode Pokemon} + * @param move the {@linkcode Move} being used + * @param isCritical determines whether a critical hit has occurred or not (`false` by default) + * @returns the final in-battle value of a stat + */ + getEffectiveStat(stat: EffectiveStat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): integer { + const statValue = new Utils.NumberHolder(this.getStat(stat, false)); this.scene.applyModifiers(StatBoosterModifier, this.isPlayer(), this, stat, statValue); const fieldApplied = new Utils.BooleanHolder(false); for (const pokemon of this.scene.getField(true)) { - applyFieldBattleStatMultiplierAbAttrs(FieldMultiplyBattleStatAbAttr, pokemon, stat, statValue, this, fieldApplied); + applyFieldStatMultiplierAbAttrs(FieldMultiplyStatAbAttr, pokemon, stat, statValue, this, fieldApplied); if (fieldApplied.value) { break; } } - applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, this, battleStat, statValue); - let ret = statValue.value * (Math.max(2, 2 + statLevel.value) / Math.max(2, 2 - statLevel.value)); + applyStatMultiplierAbAttrs(StatMultiplierAbAttr, this, stat, statValue); + let ret = statValue.value * this.getStatStageMultiplier(stat, opponent, move, isCritical); + switch (stat) { case Stat.ATK: if (this.getTag(BattlerTagType.SLOW_START)) { @@ -762,24 +853,25 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!this.stats) { this.stats = [ 0, 0, 0, 0, 0, 0 ]; } - const baseStats = this.getSpeciesForm().baseStats.slice(0); - if (this.fusionSpecies) { - const fusionBaseStats = this.getFusionSpeciesForm().baseStats; - for (let s = 0; s < this.stats.length; s++) { + + // Get and manipulate base stats + const baseStats = this.getSpeciesForm(true).baseStats.slice(); + if (this.isFusion()) { + const fusionBaseStats = this.getFusionSpeciesForm(true).baseStats; + for (const s of PERMANENT_STATS) { baseStats[s] = Math.ceil((baseStats[s] + fusionBaseStats[s]) / 2); } } else if (this.scene.gameMode.isSplicedOnly) { - for (let s = 0; s < this.stats.length; s++) { + for (const s of PERMANENT_STATS) { baseStats[s] = Math.ceil(baseStats[s] / 2); } } - this.scene.applyModifiers(PokemonBaseStatModifier, this.isPlayer(), this, baseStats); - const stats = Utils.getEnumValues(Stat); - for (const s of stats) { - const isHp = s === Stat.HP; - const baseStat = baseStats[s]; - let value = Math.floor(((2 * baseStat + this.ivs[s]) * this.level) * 0.01); - if (isHp) { + this.scene.applyModifiers(BaseStatModifier, this.isPlayer(), this, baseStats); + + // Using base stats, calculate and store stats one by one + for (const s of PERMANENT_STATS) { + let value = Math.floor(((2 * baseStats[s] + this.ivs[s]) * this.level) * 0.01); + if (s === Stat.HP) { value = value + this.level + 10; if (this.hasAbility(Abilities.WONDER_GUARD, false, true)) { value = 1; @@ -800,7 +892,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { value = Math.max(Math[natureStatMultiplier.value > 1 ? "ceil" : "floor"](value * natureStatMultiplier.value), 1); } } - this.stats[s] = value; + + this.setStat(s, value); } } @@ -935,7 +1028,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (this.metBiome === -1 && !this.scene.gameMode.isFreshStartChallenge() && !this.scene.gameMode.isDaily) { levelMoves = this.getUnlockedEggMoves().concat(levelMoves); } - return levelMoves.filter(lm => !this.moveset.some(m => m?.moveId === lm)); + if (Array.isArray(this.usedTMs) && this.usedTMs.length > 0) { + levelMoves = this.usedTMs.filter(m => !levelMoves.includes(m)).concat(levelMoves); + } + levelMoves = levelMoves.filter(lm => !this.moveset.some(m => m?.moveId === lm)); + return levelMoves; } /** @@ -1371,7 +1468,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const types = this.getTypes(true); const enemyTypes = opponent.getTypes(true, true); /** Is this Pokemon faster than the opponent? */ - const outspeed = (this.isActive(true) ? this.getBattleStat(Stat.SPD, opponent) : this.getStat(Stat.SPD)) >= opponent.getBattleStat(Stat.SPD, this); + 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. @@ -1623,7 +1720,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { }; this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true); - this.fusionAbilityIndex = (this.fusionSpecies.abilityHidden && hasHiddenAbility ? this.fusionSpecies.ability2 ? 2 : 1 : this.fusionSpecies.ability2 ? randAbilityIndex : 0); + this.fusionAbilityIndex = (this.fusionSpecies.abilityHidden && hasHiddenAbility ? 2 : this.fusionSpecies.ability2 !== this.fusionSpecies.ability1 ? randAbilityIndex : 0); this.fusionShiny = this.shiny; this.fusionVariant = this.variant; @@ -1750,7 +1847,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { movePool = movePool.map(m => [m[0], m[1] * (!!allMoves[m[0]].hasAttr(SacrificialAttr) ? 0.5 : 1)]); movePool = movePool.map(m => [m[0], m[1] * (!!allMoves[m[0]].hasAttr(SacrificialAttrOnHit) ? 0.5 : 1)]); // Trainers get a weight bump to stat buffing moves - movePool = movePool.map(m => [m[0], m[1] * (allMoves[m[0]].getAttrs(StatChangeAttr).some(a => a.levels > 1 && a.selfTarget) ? 1.25 : 1)]); + movePool = movePool.map(m => [m[0], m[1] * (allMoves[m[0]].getAttrs(StatStageChangeAttr).some(a => a.stages > 1 && a.selfTarget) ? 1.25 : 1)]); // Trainers get a weight decrease to multiturn moves movePool = movePool.map(m => [m[0], m[1] * (!!allMoves[m[0]].hasAttr(ChargeAttr) || !!allMoves[m[0]].hasAttr(RechargeAttr) ? 0.7 : 1)]); } @@ -1762,8 +1859,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { movePool = movePool.map(m => [m[0], m[1] * (allMoves[m[0]].category === MoveCategory.STATUS ? 1 : Math.max(Math.min(allMoves[m[0]].power/maxPower, 1), 0.5))]); // Weight damaging moves against the lower stat - const worseCategory: MoveCategory = this.stats[Stat.ATK] > this.stats[Stat.SPATK] ? MoveCategory.SPECIAL : MoveCategory.PHYSICAL; - const statRatio = worseCategory === MoveCategory.PHYSICAL ? this.stats[Stat.ATK]/this.stats[Stat.SPATK] : this.stats[Stat.SPATK]/this.stats[Stat.ATK]; + const atk = this.getStat(Stat.ATK); + const spAtk = this.getStat(Stat.SPATK); + const worseCategory: MoveCategory = atk > spAtk ? MoveCategory.SPECIAL : MoveCategory.PHYSICAL; + const statRatio = worseCategory === MoveCategory.PHYSICAL ? atk / spAtk : spAtk / atk; movePool = movePool.map(m => [m[0], m[1] * (allMoves[m[0]].category === worseCategory ? statRatio : 1)]); let weightMultiplier = 0.9; // The higher this is the more the game weights towards higher level moves. At 0 all moves are equal weight. @@ -1949,6 +2048,48 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this instanceof PlayerPokemon ? this.scene.getPlayerField() : this.scene.getEnemyField(); } + /** + * Calculates the stat stage multiplier of the user against an opponent. + * + * Note that this does not apply to evasion or accuracy + * @see {@linkcode getAccuracyMultiplier} + * @param stat the desired {@linkcode EffectiveStat} + * @param opponent the target {@linkcode Pokemon} + * @param move the {@linkcode Move} being used + * @param isCritical determines whether a critical hit has occurred or not (`false` by default) + * @return the stat stage multiplier to be used for effective stat calculation + */ + getStatStageMultiplier(stat: EffectiveStat, opponent?: Pokemon, move?: Move, isCritical: boolean = false): number { + const statStage = new Utils.IntegerHolder(this.getStatStage(stat)); + const ignoreStatStage = new Utils.BooleanHolder(false); + + if (opponent) { + if (isCritical) { + switch (stat) { + case Stat.ATK: + case Stat.SPATK: + statStage.value = Math.max(statStage.value, 0); + break; + case Stat.DEF: + case Stat.SPDEF: + statStage.value = Math.min(statStage.value, 0); + break; + } + } + applyAbAttrs(IgnoreOpponentStatStagesAbAttr, opponent, null, false, stat, ignoreStatStage); + if (move) { + applyMoveAttrs(IgnoreOpponentStatStagesAttr, this, opponent, move, ignoreStatStage); + } + } + + if (!ignoreStatStage.value) { + const statStageMultiplier = new Utils.NumberHolder(Math.max(2, 2 + statStage.value) / Math.max(2, 2 - statStage.value)); + this.scene.applyModifiers(TempStatStageBoosterModifier, this.isPlayer(), stat, statStageMultiplier); + return Math.min(statStageMultiplier.value, 4); + } + return 1; + } + /** * Calculates the accuracy multiplier of the user against a target. * @@ -1965,34 +2106,38 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return 1; } - const userAccuracyLevel = new Utils.IntegerHolder(this.summonData.battleStats[BattleStat.ACC]); - const targetEvasionLevel = new Utils.IntegerHolder(target.summonData.battleStats[BattleStat.EVA]); + const userAccStage = new Utils.IntegerHolder(this.getStatStage(Stat.ACC)); + const targetEvaStage = new Utils.IntegerHolder(target.getStatStage(Stat.EVA)); - applyAbAttrs(IgnoreOpponentStatChangesAbAttr, target, null, false, userAccuracyLevel); - applyAbAttrs(IgnoreOpponentStatChangesAbAttr, this, null, false, targetEvasionLevel); - applyAbAttrs(IgnoreOpponentEvasionAbAttr, this, null, false, targetEvasionLevel); - applyMoveAttrs(IgnoreOpponentStatChangesAttr, this, target, sourceMove, targetEvasionLevel); - this.scene.applyModifiers(TempBattleStatBoosterModifier, this.isPlayer(), TempBattleStat.ACC, userAccuracyLevel); + const ignoreAccStatStage = new Utils.BooleanHolder(false); + const ignoreEvaStatStage = new Utils.BooleanHolder(false); + + applyAbAttrs(IgnoreOpponentStatStagesAbAttr, target, null, false, Stat.ACC, ignoreAccStatStage); + applyAbAttrs(IgnoreOpponentStatStagesAbAttr, this, null, false, Stat.EVA, ignoreEvaStatStage); + applyMoveAttrs(IgnoreOpponentStatStagesAttr, this, target, sourceMove, ignoreEvaStatStage); + + this.scene.applyModifiers(TempStatStageBoosterModifier, this.isPlayer(), Stat.ACC, userAccStage); + + userAccStage.value = ignoreAccStatStage.value ? 0 : Math.min(userAccStage.value, 6); + targetEvaStage.value = ignoreEvaStatStage.value ? 0 : targetEvaStage.value; if (target.findTag(t => t instanceof ExposedTag)) { - targetEvasionLevel.value = Math.min(0, targetEvasionLevel.value); + targetEvaStage.value = Math.min(0, targetEvaStage.value); } const accuracyMultiplier = new Utils.NumberHolder(1); - if (userAccuracyLevel.value !== targetEvasionLevel.value) { - accuracyMultiplier.value = userAccuracyLevel.value > targetEvasionLevel.value - ? (3 + Math.min(userAccuracyLevel.value - targetEvasionLevel.value, 6)) / 3 - : 3 / (3 + Math.min(targetEvasionLevel.value - userAccuracyLevel.value, 6)); + if (userAccStage.value !== targetEvaStage.value) { + accuracyMultiplier.value = userAccStage.value > targetEvaStage.value + ? (3 + Math.min(userAccStage.value - targetEvaStage.value, 6)) / 3 + : 3 / (3 + Math.min(targetEvaStage.value - userAccStage.value, 6)); } - applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, this, BattleStat.ACC, accuracyMultiplier, false, sourceMove); + applyStatMultiplierAbAttrs(StatMultiplierAbAttr, this, Stat.ACC, accuracyMultiplier, false, sourceMove); const evasionMultiplier = new Utils.NumberHolder(1); - applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, target, BattleStat.EVA, evasionMultiplier); + applyStatMultiplierAbAttrs(StatMultiplierAbAttr, target, Stat.EVA, evasionMultiplier); - accuracyMultiplier.value /= evasionMultiplier.value; - - return accuracyMultiplier.value; + return accuracyMultiplier.value / evasionMultiplier.value; } /** @@ -2079,29 +2224,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (critOnly.value || critAlways) { isCritical = true; } else { - const critLevel = new Utils.IntegerHolder(0); - applyMoveAttrs(HighCritAttr, source, this, move, critLevel); - this.scene.applyModifiers(CritBoosterModifier, source.isPlayer(), source, critLevel); - this.scene.applyModifiers(TempBattleStatBoosterModifier, source.isPlayer(), TempBattleStat.CRIT, critLevel); - const bonusCrit = new Utils.BooleanHolder(false); - //@ts-ignore - if (applyAbAttrs(BonusCritAbAttr, source, null, false, bonusCrit)) { // TODO: resolve ts-ignore. This is a promise. Checking a promise is bogus. - if (bonusCrit.value) { - critLevel.value += 1; - } - } - - const critBoostTag = source.getTag(CritBoostTag); - if (critBoostTag) { - if (critBoostTag instanceof DragonCheerTag) { - critLevel.value += critBoostTag.typesOnAdd.includes(Type.DRAGON) ? 2 : 1; - } else { - critLevel.value += 2; - } - } - - console.log(`crit stage: +${critLevel.value}`); - const critChance = [24, 8, 2, 1][Math.max(0, Math.min(critLevel.value, 3))]; + const critChance = [24, 8, 2, 1][Math.max(0, Math.min(this.getCritStage(source, move), 3))]; isCritical = critChance === 1 || !this.scene.randBattleSeedInt(critChance); if (Overrides.NEVER_CRIT_OVERRIDE) { isCritical = false; @@ -2115,8 +2238,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { isCritical = false; } } - const sourceAtk = new Utils.IntegerHolder(source.getBattleStat(isPhysical ? Stat.ATK : Stat.SPATK, this, undefined, isCritical)); - const targetDef = new Utils.IntegerHolder(this.getBattleStat(isPhysical ? Stat.DEF : Stat.SPDEF, source, move, isCritical)); + const sourceAtk = new Utils.IntegerHolder(source.getEffectiveStat(isPhysical ? Stat.ATK : Stat.SPATK, this, undefined, isCritical)); + const targetDef = new Utils.IntegerHolder(this.getEffectiveStat(isPhysical ? Stat.DEF : Stat.SPDEF, source, move, isCritical)); const criticalMultiplier = new Utils.NumberHolder(isCritical ? 1.5 : 1); applyAbAttrs(MultCritAbAttr, source, null, false, criticalMultiplier); const screenMultiplier = new Utils.NumberHolder(1); @@ -2155,7 +2278,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!isTypeImmune) { const levelMultiplier = (2 * source.level / 5 + 2); - const randomMultiplier = ((this.scene.randBattleSeedInt(16) + 85) / 100); + const randomMultiplier = (this.randSeedIntRange(85, 100) / 100); damage.value = Utils.toDmgValue((((levelMultiplier * power * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier @@ -2527,27 +2650,53 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * @param source {@linkcode Pokemon} the pokemon whose stats/Tags are to be passed on from, ie: the Pokemon using Baton Pass */ transferSummon(source: Pokemon): void { - const battleStats = Utils.getEnumValues(BattleStat); - for (const stat of battleStats) { - this.summonData.battleStats[stat] = source.summonData.battleStats[stat]; + // Copy all stat stages + for (const s of BATTLE_STATS) { + const sourceStage = source.getStatStage(s); + if ((this instanceof PlayerPokemon) && (sourceStage === 6)) { + this.scene.validateAchv(achvs.TRANSFER_MAX_STAT_STAGE); + } + this.setStatStage(s, sourceStage); } + for (const tag of source.summonData.tags) { - - // bypass those can not be passed via Baton Pass - const excludeTagTypes = new Set([BattlerTagType.DROWSY, BattlerTagType.INFATUATED, BattlerTagType.FIRE_BOOST]); - - if (excludeTagTypes.has(tag.tagType)) { + if (!tag.isBatonPassable) { continue; } this.summonData.tags.push(tag); } - if (this instanceof PlayerPokemon && source.summonData.battleStats.find(bs => bs === 6)) { - this.scene.validateAchv(achvs.TRANSFER_MAX_BATTLE_STAT); - } + this.updateInfo(); } + /** + * Gets whether the given move is currently disabled for this Pokemon. + * + * @param {Moves} moveId {@linkcode Moves} ID of the move to check + * @returns {boolean} `true` if the move is disabled for this Pokemon, otherwise `false` + * + * @see {@linkcode MoveRestrictionBattlerTag} + */ + isMoveRestricted(moveId: Moves): boolean { + return this.getRestrictingTag(moveId) !== null; + } + + /** + * Gets the {@link MoveRestrictionBattlerTag} that is restricting a move, if it exists. + * + * @param {Moves} moveId {@linkcode Moves} ID of the move to check + * @returns {MoveRestrictionBattlerTag | null} the first tag on this Pokemon that restricts the move, or `null` if the move is not restricted. + */ + getRestrictingTag(moveId: Moves): MoveRestrictionBattlerTag | null { + for (const tag of this.findTags(t => t instanceof MoveRestrictionBattlerTag)) { + if ((tag as MoveRestrictionBattlerTag).isMoveRestricted(moveId)) { + return tag as MoveRestrictionBattlerTag; + } + } + return null; + } + getMoveHistory(): TurnMove[] { return this.battleSummonData.moveHistory; } @@ -3299,12 +3448,30 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { fusionCanvas.remove(); } + /** + * Generates a random number using the current battle's seed, or the global seed if `this.scene.currentBattle` is falsy + * + * This calls either {@linkcode BattleScene.randBattleSeedInt}({@linkcode range}, {@linkcode min}) in `src/battle-scene.ts` + * which calls {@linkcode Battle.randSeedInt}(`scene`, {@linkcode range}, {@linkcode min}) in `src/battle.ts` + * which calls {@linkcode Utils.randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts`, + * or it directly calls {@linkcode Utils.randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts` if there is no current battle + * + * @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min} + * @param min The minimum integer to pick, default `0` + * @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1) + */ randSeedInt(range: integer, min: integer = 0): integer { return this.scene.currentBattle ? this.scene.randBattleSeedInt(range, min) : Utils.randSeedInt(range, min); } + /** + * Generates a random number using the current battle's seed, or the global seed if `this.scene.currentBattle` is falsy + * @param min The minimum integer to generate + * @param max The maximum integer to generate + * @returns a random integer between {@linkcode min} and {@linkcode max} inclusive + */ randSeedIntRange(min: integer, max: integer): integer { return this.randSeedInt((max - min) + 1, min); } @@ -3357,6 +3524,7 @@ export default interface Pokemon { export class PlayerPokemon extends Pokemon { public compatibleTms: Moves[]; + public usedTms: Moves[]; constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) { super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); @@ -3380,6 +3548,7 @@ export class PlayerPokemon extends Pokemon { } } this.generateCompatibleTms(); + this.usedTms = []; } initBattleInfo(): void { @@ -3638,6 +3807,9 @@ export class PlayerPokemon extends Pokemon { newPokemon.moveset = this.moveset.slice(); newPokemon.moveset = this.copyMoveset(); newPokemon.luck = this.luck; + newPokemon.metLevel = this.metLevel; + newPokemon.metBiome = this.metBiome; + newPokemon.metSpecies = this.metSpecies; newPokemon.fusionSpecies = this.fusionSpecies; newPokemon.fusionFormIndex = this.fusionFormIndex; newPokemon.fusionAbilityIndex = this.fusionAbilityIndex; @@ -3717,16 +3889,17 @@ export class PlayerPokemon extends Pokemon { this.scene.gameData.gameStats.pokemonFused++; // Store the average HP% that each Pokemon has - const newHpPercent = ((pokemon.hp / pokemon.stats[Stat.HP]) + (this.hp / this.stats[Stat.HP])) / 2; + const maxHp = this.getMaxHp(); + const newHpPercent = ((pokemon.hp / pokemon.getMaxHp()) + (this.hp / maxHp)) / 2; this.generateName(); this.calculateStats(); // Set this Pokemon's HP to the average % of both fusion components - this.hp = Math.round(this.stats[Stat.HP] * newHpPercent); + this.hp = Math.round(maxHp * newHpPercent); if (!this.isFainted()) { // If this Pokemon hasn't fainted, make sure the HP wasn't set over the new maximum - this.hp = Math.min(this.hp, this.stats[Stat.HP]); + this.hp = Math.min(this.hp, maxHp); this.status = getRandomStatus(this.status, pokemon.status); // Get a random valid status between the two } else if (!pokemon.isFainted()) { // If this Pokemon fainted but the other hasn't, make sure the HP wasn't set to zero @@ -4176,7 +4349,7 @@ export class EnemyPokemon extends Pokemon { //console.log('damage', damage, 'segment', segmentsBypassed + 1, 'segment size', segmentSize, 'damage needed', Math.round(segmentSize * Math.pow(2, segmentsBypassed + 1))); } - damage = hpRemainder + Math.round(segmentSize * segmentsBypassed); + damage = Utils.toDmgValue(this.hp - hpThreshold + segmentSize * segmentsBypassed); clearedBossSegmentIndex = s - segmentsBypassed; } break; @@ -4219,43 +4392,40 @@ export class EnemyPokemon extends Pokemon { handleBossSegmentCleared(segmentIndex: integer): void { while (segmentIndex - 1 < this.bossSegmentIndex) { - let boostedStat = BattleStat.RAND; + // Filter out already maxed out stat stages and weigh the rest based on existing stats + const leftoverStats = EFFECTIVE_STATS.filter((s: EffectiveStat) => this.getStatStage(s) < 6); + const statWeights = leftoverStats.map((s: EffectiveStat) => this.getStat(s, false)); - const battleStats = Utils.getEnumValues(BattleStat).slice(0, -3); - const statWeights = new Array().fill(battleStats.length).filter((bs: BattleStat) => this.summonData.battleStats[bs] < 6).map((bs: BattleStat) => this.getStat(bs + 1)); - const statThresholds: integer[] = []; + let boostedStat: EffectiveStat; + const statThresholds: number[] = []; let totalWeight = 0; - for (const bs of battleStats) { - totalWeight += statWeights[bs]; + + for (const i in statWeights) { + totalWeight += statWeights[i]; statThresholds.push(totalWeight); } + // Pick a random stat from the leftover stats to increase its stages const randInt = Utils.randSeedInt(totalWeight); - - for (const bs of battleStats) { - if (randInt < statThresholds[bs]) { - boostedStat = bs; + for (const i in statThresholds) { + if (randInt < statThresholds[i]) { + boostedStat = leftoverStats[i]; break; } } - let statLevels = 1; + let stages = 1; - switch (segmentIndex) { - case 1: - if (this.bossSegments >= 3) { - statLevels++; - } - break; - case 2: - if (this.bossSegments >= 5) { - statLevels++; - } - break; + // increase the boost if the boss has at least 3 segments and we passed last shield + if (this.bossSegments >= 3 && this.bossSegmentIndex === 1) { + stages++; + } + // increase the boost if the boss has at least 5 segments and we passed the second to last shield + if (this.bossSegments >= 5 && this.bossSegmentIndex === 2) { + stages++; } - this.scene.unshiftPhase(new StatChangePhase(this.scene, this.getBattlerIndex(), true, [ boostedStat ], statLevels, true, true)); - + this.scene.unshiftPhase(new StatStageChangePhase(this.scene, this.getBattlerIndex(), true, [ boostedStat! ], stages, true, true)); this.bossSegmentIndex--; } } @@ -4331,10 +4501,8 @@ export interface AttackMoveResult { } export class PokemonSummonData { - public battleStats: number[] = [ 0, 0, 0, 0, 0, 0, 0 ]; + public statStages: number[] = [ 0, 0, 0, 0, 0, 0, 0 ]; public moveQueue: QueuedMove[] = []; - public disabledMove: Moves = Moves.NONE; - public disabledTurns: number = 0; public tags: BattlerTag[] = []; public abilitySuppressed: boolean = false; public abilitiesApplied: Abilities[] = []; @@ -4344,7 +4512,7 @@ export class PokemonSummonData { public ability: Abilities = Abilities.NONE; public gender: Gender; public fusionGender: Gender; - public stats: number[]; + 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: Type[] = []; @@ -4375,8 +4543,8 @@ export class PokemonTurnData { public damageTaken: number = 0; public attacksReceived: AttackMoveResult[] = []; public order: number; - public battleStatsIncreased: boolean = false; - public battleStatsDecreased: boolean = false; + public statStagesIncreased: boolean = false; + public statStagesDecreased: boolean = false; } export enum AiType { @@ -4415,7 +4583,7 @@ export type DamageResult = HitResult.EFFECTIVE | HitResult.SUPER_EFFECTIVE | Hit * It links to {@linkcode Move} class via the move ID. * Compared to {@linkcode Move}, this class also tracks if a move has received. * PP Ups, amount of PP used, and things like that. - * @see {@linkcode isUsable} - checks if move is disabled, out of PP, or not implemented. + * @see {@linkcode isUsable} - checks if move is restricted, out of PP, or not implemented. * @see {@linkcode getMove} - returns {@linkcode Move} object by looking it up via ID. * @see {@linkcode usePp} - removes a point of PP from the move. * @see {@linkcode getMovePp} - returns amount of PP a move currently has. @@ -4435,11 +4603,25 @@ export class PokemonMove { this.virtual = !!virtual; } - isUsable(pokemon: Pokemon, ignorePp?: boolean): boolean { - if (this.moveId && pokemon.summonData?.disabledMove === this.moveId) { + /** + * Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets. + * The move is unusable if it is out of PP, restricted by an effect, or unimplemented. + * + * @param {Pokemon} pokemon {@linkcode Pokemon} that would be using this move + * @param {boolean} ignorePp If `true`, skips the PP check + * @param {boolean} ignoreRestrictionTags If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag}) + * @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`. + */ + isUsable(pokemon: Pokemon, ignorePp?: boolean, ignoreRestrictionTags?: boolean): boolean { + if (this.moveId && !ignoreRestrictionTags && pokemon.isMoveRestricted(this.moveId)) { return false; } - return (ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1) && !this.getMove().name.endsWith(" (N)"); + + if (this.getMove().name.endsWith(" (N)")) { + return false; + } + + return (ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1); } getMove(): Move { diff --git a/src/interfaces/locales.ts b/src/interfaces/locales.ts index 5f7c52100c1..4405095e0fe 100644 --- a/src/interfaces/locales.ts +++ b/src/interfaces/locales.ts @@ -37,8 +37,7 @@ export interface ModifierTypeTranslationEntries { ModifierType: { [key: string]: ModifierTypeTranslationEntry }, SpeciesBoosterItem: { [key: string]: ModifierTypeTranslationEntry }, AttackTypeBoosterItem: SimpleTranslationEntries, - TempBattleStatBoosterItem: SimpleTranslationEntries, - TempBattleStatBoosterStatName: SimpleTranslationEntries, + TempStatStageBoosterItem: SimpleTranslationEntries, BaseStatBoosterItem: SimpleTranslationEntries, EvolutionItem: SimpleTranslationEntries, FormChangeItem: SimpleTranslationEntries, diff --git a/src/loading-scene.ts b/src/loading-scene.ts index e4a73414cd1..0fe756ec9a0 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -78,6 +78,7 @@ export class LoadingScene extends SceneBase { this.loadAtlas("overlay_hp_boss", "ui"); this.loadImage("overlay_exp", "ui"); this.loadImage("icon_owned", "ui"); + this.loadImage("icon_egg_move", "ui"); this.loadImage("ability_bar_left", "ui"); this.loadImage("bgm_bar", "ui"); this.loadImage("party_exp_bar", "ui"); @@ -98,6 +99,8 @@ export class LoadingScene extends SceneBase { this.loadImage("ha_capsule", "ui", "ha_capsule.png"); this.loadImage("champion_ribbon", "ui", "champion_ribbon.png"); this.loadImage("icon_spliced", "ui"); + this.loadImage("icon_lock", "ui", "icon_lock.png"); + this.loadImage("icon_stop", "ui", "icon_stop.png"); this.loadImage("icon_tera", "ui"); this.loadImage("type_tera", "ui"); this.loadAtlas("type_bgs", "ui"); @@ -162,6 +165,7 @@ export class LoadingScene extends SceneBase { this.loadImage("saving_icon", "ui"); this.loadImage("discord", "ui"); this.loadImage("google", "ui"); + this.loadImage("settings_icon", "ui"); this.loadImage("default_bg", "arenas"); // Load arena images @@ -244,7 +248,7 @@ export class LoadingScene extends SceneBase { } else { this.loadAtlas("types", ""); } - const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"]; + const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"]; if (lang && availableLangs.includes(lang)) { this.loadImage("september-update-"+lang, "events"); } else { @@ -270,6 +274,7 @@ export class LoadingScene extends SceneBase { this.loadImage("gacha_knob", "egg"); this.loadImage("egg_list_bg", "ui"); + this.loadImage("egg_summary_bg", "ui"); this.loadImage("end_m", "cg"); this.loadImage("end_f", "cg"); diff --git a/src/locales/de/achv.json b/src/locales/de/achv.json index d2e56089720..21a1d89f9d6 100644 --- a/src/locales/de/achv.json +++ b/src/locales/de/achv.json @@ -89,7 +89,7 @@ "name": "Bänder-Meister", "name_female": "Bänder-Meisterin" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "Teamwork", "description": "Nutze Staffette, während der Anwender mindestens eines Statuswertes maximiert hat." }, @@ -274,4 +274,4 @@ "name": "Spieglein, Spieglein an der Wand", "description": "Schließe die 'Umkehrkampf' Herausforderung ab" } -} \ No newline at end of file +} diff --git a/src/locales/de/arena-flyout.json b/src/locales/de/arena-flyout.json index 30d3e7febb3..a1f2254c642 100644 --- a/src/locales/de/arena-flyout.json +++ b/src/locales/de/arena-flyout.json @@ -36,5 +36,6 @@ "matBlock": "Tatami-Schild", "craftyShield": "Trickschutz", "tailwind": "Rückenwind", - "happyHour": "Goldene Zeiten" -} \ No newline at end of file + "happyHour": "Goldene Zeiten", + "safeguard": "Bodyguard" +} diff --git a/src/locales/de/battle.json b/src/locales/de/battle.json index 762b5848439..05205b001b6 100644 --- a/src/locales/de/battle.json +++ b/src/locales/de/battle.json @@ -94,5 +94,6 @@ "retryBattle": "Möchtest du vom Beginn des Kampfes neustarten?", "unlockedSomething": "{{unlockedThing}} wurde freigeschaltet.", "congratulations": "Glückwunsch!", - "beatModeFirstTime": "{{speciesName}} hat den {{gameMode}} Modus zum ersten Mal beendet! Du erhältst {{newModifier}}!" + "beatModeFirstTime": "{{speciesName}} hat den {{gameMode}} Modus zum ersten Mal beendet! Du erhältst {{newModifier}}!", + "eggSkipPrompt": "Zur Ei-Zusammenfassung springen?" } \ No newline at end of file diff --git a/src/locales/de/challenges.json b/src/locales/de/challenges.json index 17c33353bc6..c8836c50549 100644 --- a/src/locales/de/challenges.json +++ b/src/locales/de/challenges.json @@ -1,10 +1,11 @@ { + "noneSelected": "Keine ausgewählt", "title": "Herausforderungsmodifikatoren", "illegalEvolution": "{{pokemon}} hat sich in ein Pokémon verwandelt, dass für diese Herausforderung nicht zulässig ist!", "singleGeneration": { "name": "Mono-Generation", "desc": "Du kannst nur Pokémon aus der {{gen}} Generation verwenden.", - "desc_default": "Du kannst nur Pokémon gewählten Generation verwenden.", + "desc_default": "Du kannst nur Pokémon aus der gewählten Generation verwenden.", "gen_1": "ersten", "gen_2": "zweiten", "gen_3": "dritten", diff --git a/src/locales/de/dialogue-misc.json b/src/locales/de/dialogue-misc.json index 1529831d7c5..69c704c66c6 100644 --- a/src/locales/de/dialogue-misc.json +++ b/src/locales/de/dialogue-misc.json @@ -1,6 +1,6 @@ { - "ending": "@c{smile}Oh? Du hast gewonnen?@d{96} @c{smile_eclosed}Ich schätze, das hätte ich wissen sollen.\n$Aber, du bist jetzt zurück.\n$@c{smile}Es ist vorbei.@d{64} Du hast die Schleife beendet.\n$@c{serious_smile_fists}Du hast auch deinen Traum erfüllt, nicht wahr?\nDu hast nicht einmal verloren.\n$@c{neutral}Ich bin der Einzige, der sich daran erinnern wird, was du getan hast.@d{96}\n$Ich schätze, das ist in Ordnung, oder?\n$@c{serious_smile_fists}Deine Legende wird immer in unseren Herzen weiterleben.\n$@c{smile_eclosed}Wie auch immer, ich habe genug von diesem Ort, oder nicht? Lass uns nach Hause gehen.\n$@c{serious_smile_fists}Vielleicht können wir, wenn wir zurück sind, noch einen Kampf haben?\n$Wenn du dazu bereit bist.", - "ending_female": "@c{shock}Du bist zurück?@d{32} Bedeutet das…@d{96} du hast gewonnen?!\n$@c{smile_ehalf}Ich hätte wissen sollen, dass du es in dir hast.\n$@c{smile_eclosed}Natürlich… ich hatte immer dieses Gefühl.\n$@c{smile}Es ist jetzt vorbei, richtig? Du hast die Schleife beendet.\n$@c{smile_ehalf}Du hast auch deinen Traum erfüllt, nicht wahr?\n$Du hast nicht einmal verloren.\n$Ich werde die Einzige sein, die sich daran erinnert, was du getan hast.\n$@c{angry_mopen}Ich werde versuchen, es nicht zu vergessen!\n$@c{smile_wave_wink}Nur ein Scherz!@d{64} @c{smile}Ich würde es nie vergessen.@d{32}\n$Deine Legende wird in unseren Herzen weiterleben.\n$@c{smile_wave}Wie auch immer,@d{64} es wird spät…@d{96} denke ich?\nEs ist schwer zu sagen an diesem Ort.\n$Lass uns nach Hause gehen. \n$@c{smile_wave_wink}Vielleicht können wir morgen noch einen Kampf haben, der alten Zeiten willen?", + "ending": "@c{shock}Du bist zurück?@d{32} Bedeutet das…@d{96} du hast gewonnen?!\n$@c{smile_ehalf}Ich hätte wissen sollen, dass du es in dir hast.\n$@c{smile_eclosed}Natürlich… ich hatte immer dieses Gefühl.\n$@c{smile}Es ist jetzt vorbei, richtig? Du hast die Schleife beendet.\n$@c{smile_ehalf}Du hast auch deinen Traum erfüllt, nicht wahr?\n$Du hast nicht einmal verloren.\n$Ich werde die Einzige sein, die sich daran erinnert, was du getan hast.\n$@c{angry_mopen}Ich werde versuchen, es nicht zu vergessen!\n$@c{smile_wave_wink}Nur ein Scherz!@d{64} @c{smile}Ich würde es nie vergessen.@d{32}\n$Deine Legende wird in unseren Herzen weiterleben.\n$@c{smile_wave}Wie auch immer,@d{64} es wird spät…@d{96} denke ich?\nEs ist schwer zu sagen an diesem Ort.\n$Lass uns nach Hause gehen. \n$@c{smile_wave_wink}Vielleicht können wir morgen noch einen Kampf haben, der alten Zeiten willen?", + "ending_female": "@c{smile}Oh? Du hast gewonnen?@d{96} @c{smile_eclosed}Ich schätze, das hätte ich wissen sollen.\n$Aber, du bist jetzt zurück.\n$@c{smile}Es ist vorbei.@d{64} Du hast die Schleife beendet.\n$@c{serious_smile_fists}Du hast auch deinen Traum erfüllt, nicht wahr?\nDu hast nicht einmal verloren.\n$@c{neutral}Ich bin der Einzige, der sich daran erinnern wird, was du getan hast.@d{96}\n$Ich schätze, das ist in Ordnung, oder?\n$@c{serious_smile_fists}Deine Legende wird immer in unseren Herzen weiterleben.\n$@c{smile_eclosed}Wie auch immer, ich habe genug von diesem Ort, oder nicht? Lass uns nach Hause gehen.\n$@c{serious_smile_fists}Vielleicht können wir, wenn wir zurück sind, noch einen Kampf haben?\n$Wenn du dazu bereit bist.", "ending_endless": "Glückwunsch! Du hast das aktuelle Ende erreicht!\nWir arbeiten an mehr Spielinhalten.", "ending_name": "Entwickler" } diff --git a/src/locales/de/menu-ui-handler.json b/src/locales/de/menu-ui-handler.json index 56c03102b9c..93c3f4c38e8 100644 --- a/src/locales/de/menu-ui-handler.json +++ b/src/locales/de/menu-ui-handler.json @@ -25,5 +25,6 @@ "unlinkGoogle": "Google trennen", "cancel": "Abbrechen", "losingProgressionWarning": "Du wirst jeglichen Fortschritt seit Anfang dieses Kampfes verlieren. Fortfahren?", - "noEggs": "Du brütest aktuell keine Eier aus!" + "noEggs": "Du brütest aktuell keine Eier aus!", + "donate": "Spenden" } \ No newline at end of file diff --git a/src/locales/de/modifier-type.json b/src/locales/de/modifier-type.json index 9298a78614a..8e2372cb447 100644 --- a/src/locales/de/modifier-type.json +++ b/src/locales/de/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "Verdoppelt die Wahrscheinlichkeit, dass die nächsten {{battleCount}} Begegnungen mit wilden Pokémon ein Doppelkampf sind." }, - "TempBattleStatBoosterModifierType": { - "description": "Erhöht die {{tempBattleStatName}} aller Teammitglieder für 5 Kämpfe um eine Stufe." + "TempStatStageBoosterModifierType": { + "description": "Erhöht die {{stat}} aller Teammitglieder für 5 Kämpfe um eine Stufe." }, "AttackTypeBoosterModifierType": { "description": "Erhöht die Stärke aller {{moveType}}-Attacken eines Pokémon um 20%." @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "Erhöht das Level aller Teammitglieder um {{levels}}." }, - "PokemonBaseStatBoosterModifierType": { - "description": "Erhöht den {{statName}} Basiswert des Trägers um 10%. Das Stapellimit erhöht sich, je höher dein IS-Wert ist." + "BaseStatBoosterModifierType": { + "description": "Erhöht den {{stat}} Basiswert des Trägers um 10%. Das Stapellimit erhöht sich, je höher dein IS-Wert ist." }, "AllPokemonFullHpRestoreModifierType": { "description": "Stellt 100% der KP aller Pokémon her." @@ -248,6 +248,12 @@ "name": "Scope-Linse", "description": "Ein Item zum Tragen. Es erhöht die Volltrefferquote." }, + "DIRE_HIT": { + "name": "X-Volltreffer", + "extra": { + "raises": "Volltrefferquote" + } + }, "LEEK": { "name": "Lauchstange", "description": "Ein Item, das von Porenta getragen werden kann. Diese lange Lauchstange erhöht die Volltrefferquote stark." @@ -411,25 +417,13 @@ "description": "Ein Item, das Ditto zum Tragen gegeben werden kann. Fein und doch hart, erhöht dieses sonderbare Pulver die Initiative." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "X-Angriff", "x_defense": "X-Verteidigung", "x_sp_atk": "X-Sp.-Ang.", "x_sp_def": "X-Sp.-Vert.", "x_speed": "X-Tempo", - "x_accuracy": "X-Treffer", - "dire_hit": "X-Volltreffer" - }, - "TempBattleStatBoosterStatName": { - "ATK": "Angriff", - "DEF": "Verteidigung", - "SPATK": "Sp. Ang", - "SPDEF": "Sp. Vert", - "SPD": "Initiative", - "ACC": "Genauigkeit", - "CRIT": "Volltrefferquote", - "EVA": "Fluchtwert", - "DEFAULT": "???" + "x_accuracy": "X-Treffer" }, "AttackTypeBoosterItem": { "silk_scarf": "Seidenschal", @@ -606,4 +600,4 @@ "FAIRY_MEMORY": "Feen-Disc", "NORMAL_MEMORY": "Normal-Disc" } -} \ No newline at end of file +} diff --git a/src/locales/de/modifier.json b/src/locales/de/modifier.json index 22053b1da63..37227973410 100644 --- a/src/locales/de/modifier.json +++ b/src/locales/de/modifier.json @@ -3,7 +3,7 @@ "turnHealApply": "{{typeName}} von {{pokemonNameWithAffix}} füllt einige KP auf!", "hitHealApply": "{{typeName}} von {{pokemonNameWithAffix}} füllt einige KP auf!", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}} wurde durch {{typeName}} wiederbelebt!", - "pokemonResetNegativeStatStageApply": "Die negative Statuswertveränderung von {{pokemonNameWithAffix}} wurde durch {{typeName}} aufgehoben!", + "resetNegativeStatStageApply": "Die negative Statuswertveränderung von {{pokemonNameWithAffix}} wurde durch {{typeName}} aufgehoben!", "moneyInterestApply": "Du erhählst {{moneyAmount}} ₽ durch das Item {{typeName}}!", "turnHeldItemTransferApply": "{{itemName}} von {{pokemonNameWithAffix}} wurde durch {{typeName}} von {{pokemonName}} absorbiert!", "contactHeldItemTransferApply": "{{itemName}} von {{pokemonNameWithAffix}} wurde durch {{typeName}} von {{pokemonName}} geklaut!", diff --git a/src/locales/de/move-trigger.json b/src/locales/de/move-trigger.json index 163e8014d8b..61283c9e62e 100644 --- a/src/locales/de/move-trigger.json +++ b/src/locales/de/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}} nutzt seine KP um seine Attacke zu verstärken!", "absorbedElectricity": "{{pokemonName}} absorbiert elektrische Energie!", "switchedStatChanges": "{{pokemonName}} tauschte die Statuswerteveränderungen mit dem Ziel!", + "switchedTwoStatChanges": "{{pokemonName}} tauscht Veränderungen an {{firstStat}} und {{secondStat}} mit dem Ziel!", + "switchedStat": "{{pokemonName}} tauscht seinen {{stat}}-Wert mit dem des Zieles!", + "sharedGuard": "{{pokemonName}} addiert seine Schutzkräfte mit jenen des Zieles und teilt sie gerecht auf!", + "sharedPower": "{{pokemonName}} addiert seine Kräfte mit jenen des Zieles und teilt sie gerecht auf!", "goingAllOutForAttack": "{{pokemonName}} legt sich ins Zeug!", "regainedHealth": "{{pokemonName}} erholt sich!", "keptGoingAndCrashed": "{{pokemonName}} springt daneben und verletzt sich!", @@ -63,4 +67,4 @@ "swapArenaTags": "{{pokemonName}} hat die Effekte, die auf den beiden Seiten des Kampffeldes wirken, miteinander getauscht!", "exposedMove": "{{pokemonName}} erkennt {{targetPokemonName}}!", "safeguard": "{{targetName}} wird durch Bodyguard geschützt!" -} \ No newline at end of file +} diff --git a/src/locales/de/pokemon-form-battle.json b/src/locales/de/pokemon-form-battle.json index 8651b3d1318..35060c33d0b 100644 --- a/src/locales/de/pokemon-form-battle.json +++ b/src/locales/de/pokemon-form-battle.json @@ -10,5 +10,5 @@ "eternamaxChange": "{{preName}} hat sich zu {{pokemonName}} unendynamaximiert!", "revertChange": "{{pokemonName}} hat seine ursprüngliche Form zurückerlangt!", "formChange": "{{preName}} hat seine Form geändert!", - "disguiseChange": "Its disguise served it as a decoy!" + "disguiseChange": "Sein Kostüm hat die Attacke absorbiert!" } \ No newline at end of file diff --git a/src/locales/de/pokemon-info.json b/src/locales/de/pokemon-info.json index a559001f663..2d625d52ba7 100644 --- a/src/locales/de/pokemon-info.json +++ b/src/locales/de/pokemon-info.json @@ -1,7 +1,6 @@ { "Stat": { "HP": "KP", - "HPStat": "KP", "HPshortened": "KP", "ATK": "Angriff", "ATKshortened": "Ang", diff --git a/src/locales/de/settings.json b/src/locales/de/settings.json index d72a026cf5a..31406f28d17 100644 --- a/src/locales/de/settings.json +++ b/src/locales/de/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "Bewegung Touch Steuerung", "shopOverlayOpacity": "Shop Overlay Deckkraft", "shopCursorTarget": "Shop-Cursor Ziel", - "items": "Items", + "rewards": "Items", "reroll": "Neu rollen", "shop": "Shop", "checkTeam": "Team überprüfen" diff --git a/src/locales/en/achv-female.json b/src/locales/en/achv-female.json deleted file mode 100644 index edcd8c53fb7..00000000000 --- a/src/locales/en/achv-female.json +++ /dev/null @@ -1,268 +0,0 @@ -{ - "Achievements": { - "name": "Achievements" - }, - "Locked": { - "name": "Locked" - }, - "MoneyAchv": { - "description": "Accumulate a total of ₽{{moneyAmount}}" - }, - "10K_MONEY": { - "name": "Money Haver" - }, - "100K_MONEY": { - "name": "Rich" - }, - "1M_MONEY": { - "name": "Millionaire" - }, - "10M_MONEY": { - "name": "One Percenter" - }, - "DamageAchv": { - "description": "Inflict {{damageAmount}} damage in one hit" - }, - "250_DMG": { - "name": "Hard Hitter" - }, - "1000_DMG": { - "name": "Harder Hitter" - }, - "2500_DMG": { - "name": "That's a Lotta Damage!" - }, - "10000_DMG": { - "name": "One Punch Man" - }, - "HealAchv": { - "description": "Heal {{healAmount}} {{HP}} at once with a move, ability, or held item" - }, - "250_HEAL": { - "name": "Novice Healer" - }, - "1000_HEAL": { - "name": "Big Healer" - }, - "2500_HEAL": { - "name": "Cleric" - }, - "10000_HEAL": { - "name": "Recovery Master" - }, - "LevelAchv": { - "description": "Level up a Pokémon to Lv{{level}}" - }, - "LV_100": { - "name": "But Wait, There's More!" - }, - "LV_250": { - "name": "Elite" - }, - "LV_1000": { - "name": "To Go Even Further Beyond" - }, - "RibbonAchv": { - "description": "Accumulate a total of {{ribbonAmount}} Ribbons" - }, - "10_RIBBONS": { - "name": "Pokémon League Champion" - }, - "25_RIBBONS": { - "name": "Great League Champion" - }, - "50_RIBBONS": { - "name": "Ultra League Champion" - }, - "75_RIBBONS": { - "name": "Rogue League Champion" - }, - "100_RIBBONS": { - "name": "Master League Champion" - }, - "TRANSFER_MAX_BATTLE_STAT": { - "name": "Teamwork", - "description": "Baton pass to another party member with at least one stat maxed out" - }, - "MAX_FRIENDSHIP": { - "name": "Friendmaxxing", - "description": "Reach max friendship on a Pokémon" - }, - "MEGA_EVOLVE": { - "name": "Megamorph", - "description": "Mega evolve a Pokémon" - }, - "GIGANTAMAX": { - "name": "Absolute Unit", - "description": "Gigantamax a Pokémon" - }, - "TERASTALLIZE": { - "name": "STAB Enthusiast", - "description": "Terastallize a Pokémon" - }, - "STELLAR_TERASTALLIZE": { - "name": "The Hidden Type", - "description": "Stellar Terastallize a Pokémon" - }, - "SPLICE": { - "name": "Infinite Fusion", - "description": "Splice two Pokémon together with DNA Splicers" - }, - "MINI_BLACK_HOLE": { - "name": "A Hole Lot of Items", - "description": "Acquire a Mini Black Hole" - }, - "CATCH_MYTHICAL": { - "name": "Mythical", - "description": "Catch a mythical Pokémon" - }, - "CATCH_SUB_LEGENDARY": { - "name": "(Sub-)Legendary", - "description": "Catch a sub-legendary Pokémon" - }, - "CATCH_LEGENDARY": { - "name": "Legendary", - "description": "Catch a legendary Pokémon" - }, - "SEE_SHINY": { - "name": "Shiny", - "description": "Find a shiny Pokémon in the wild" - }, - "SHINY_PARTY": { - "name": "That's Dedication", - "description": "Have a full party of shiny Pokémon" - }, - "HATCH_MYTHICAL": { - "name": "Mythical Egg", - "description": "Hatch a mythical Pokémon from an egg" - }, - "HATCH_SUB_LEGENDARY": { - "name": "Sub-Legendary Egg", - "description": "Hatch a sub-legendary Pokémon from an egg" - }, - "HATCH_LEGENDARY": { - "name": "Legendary Egg", - "description": "Hatch a legendary Pokémon from an egg" - }, - "HATCH_SHINY": { - "name": "Shiny Egg", - "description": "Hatch a shiny Pokémon from an egg" - }, - "HIDDEN_ABILITY": { - "name": "Hidden Potential", - "description": "Catch a Pokémon with a hidden ability" - }, - "PERFECT_IVS": { - "name": "Certificate of Authenticity", - "description": "Get perfect IVs on a Pokémon" - }, - "CLASSIC_VICTORY": { - "name": "Undefeated", - "description": "Beat the game in classic mode" - }, - "UNEVOLVED_CLASSIC_VICTORY": { - "name": "Bring Your Child To Work Day", - "description": "Beat the game in Classic Mode with at least one unevolved party member." - }, - "MONO_GEN_ONE": { - "name": "The Original Rival", - "description": "Complete the generation one only challenge." - }, - "MONO_GEN_TWO": { - "name": "Generation 1.5", - "description": "Complete the generation two only challenge." - }, - "MONO_GEN_THREE": { - "name": "Too much water?", - "description": "Complete the generation three only challenge." - }, - "MONO_GEN_FOUR": { - "name": "Is she really the hardest?", - "description": "Complete the generation four only challenge." - }, - "MONO_GEN_FIVE": { - "name": "All Original", - "description": "Complete the generation five only challenge." - }, - "MONO_GEN_SIX": { - "name": "Almost Royalty", - "description": "Complete the generation six only challenge." - }, - "MONO_GEN_SEVEN": { - "name": "Only Technically", - "description": "Complete the generation seven only challenge." - }, - "MONO_GEN_EIGHT": { - "name": "A Champion Time!", - "description": "Complete the generation eight only challenge." - }, - "MONO_GEN_NINE": { - "name": "She was going easy on you", - "description": "Complete the generation nine only challenge." - }, - "MonoType": { - "description": "Complete the {{type}} monotype challenge." - }, - "MONO_NORMAL": { - "name": "Extra Ordinary" - }, - "MONO_FIGHTING": { - "name": "I Know Kung Fu" - }, - "MONO_FLYING": { - "name": "Angry Birds" - }, - "MONO_POISON": { - "name": "Kanto's Favourite" - }, - "MONO_GROUND": { - "name": "Forecast: Earthquakes" - }, - "MONO_ROCK": { - "name": "Brock Hard" - }, - "MONO_BUG": { - "name": "You Like Jazz?" - }, - "MONO_GHOST": { - "name": "Who You Gonna Call?" - }, - "MONO_STEEL": { - "name": "Iron Giant" - }, - "MONO_FIRE": { - "name": "I Cast Fireball!" - }, - "MONO_WATER": { - "name": "When It Rains, It Pours" - }, - "MONO_GRASS": { - "name": "Can't Touch This" - }, - "MONO_ELECTRIC": { - "name": "Aim For The Horn!" - }, - "MONO_PSYCHIC": { - "name": "Big Brain Energy" - }, - "MONO_ICE": { - "name": "Walking On Thin Ice" - }, - "MONO_DRAGON": { - "name": "Pseudo-Legend Club" - }, - "MONO_DARK": { - "name": "It's Just A Phase" - }, - "MONO_FAIRY": { - "name": "Hey! Listen!" - }, - "FRESH_START": { - "name": "First Try!", - "description": "Complete the Fresh Start challenge." - }, - "INVERSE_BATTLE": { - "name": "Mirror rorriM", - "description": "Complete the Inverse Battle challenge.\n.egnellahc elttaB esrevnI eht etelpmoC" - } -} \ No newline at end of file diff --git a/src/locales/en/achv.json b/src/locales/en/achv.json index fae786e034a..32d519fbf78 100644 --- a/src/locales/en/achv.json +++ b/src/locales/en/achv.json @@ -97,9 +97,9 @@ "name": "Master League Champion", "name_female": "Master League Champion" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "Teamwork", - "description": "Baton pass to another party member with at least one stat maxed out" + "description": "Baton pass to another party member with at least one stat stage maxed out" }, "MAX_FRIENDSHIP": { "name": "Friendmaxxing", @@ -284,4 +284,4 @@ "name": "Mirror rorriM", "description": "Complete the Inverse Battle challenge.\n.egnellahc elttaB esrevnI eht etelpmoC" } -} \ No newline at end of file +} diff --git a/src/locales/en/arena-flyout.json b/src/locales/en/arena-flyout.json index 141ed4f743d..043d4127eb8 100644 --- a/src/locales/en/arena-flyout.json +++ b/src/locales/en/arena-flyout.json @@ -39,5 +39,6 @@ "matBlock": "Mat Block", "craftyShield": "Crafty Shield", "tailwind": "Tailwind", - "happyHour": "Happy Hour" -} + "happyHour": "Happy Hour", + "safeguard": "Safeguard" +} \ No newline at end of file diff --git a/src/locales/en/arena-tag.json b/src/locales/en/arena-tag.json index ef0b55b691b..d8fed386b24 100644 --- a/src/locales/en/arena-tag.json +++ b/src/locales/en/arena-tag.json @@ -47,5 +47,11 @@ "tailwindOnRemovePlayer": "Your team's Tailwind petered out!", "tailwindOnRemoveEnemy": "The opposing team's Tailwind petered out!", "happyHourOnAdd": "Everyone is caught up in the happy atmosphere!", - "happyHourOnRemove": "The atmosphere returned to normal." + "happyHourOnRemove": "The atmosphere returned to normal.", + "safeguardOnAdd": "The whole field is cloaked in a mystical veil!", + "safeguardOnAddPlayer": "Your team cloaked itself in a mystical veil!", + "safeguardOnAddEnemy": "The opposing team cloaked itself in a mystical veil!", + "safeguardOnRemove": "The field is no longer protected by Safeguard!", + "safeguardOnRemovePlayer": "Your team is no longer protected by Safeguard!", + "safeguardOnRemoveEnemy": "The opposing team is no longer protected by Safeguard!" } \ No newline at end of file diff --git a/src/locales/en/battle.json b/src/locales/en/battle.json index 662678e7673..120ac749acb 100644 --- a/src/locales/en/battle.json +++ b/src/locales/en/battle.json @@ -44,6 +44,7 @@ "moveNotImplemented": "{{moveName}} is not yet implemented and cannot be selected.", "moveNoPP": "There's no PP left for\nthis move!", "moveDisabled": "{{moveName}} is disabled!", + "disableInterruptedMove": "{{pokemonNameWithAffix}}'s {{moveName}}\nis disabled!", "noPokeballForce": "An unseen force\nprevents using Poké Balls.", "noPokeballTrainer": "You can't catch\nanother trainer's Pokémon!", "noPokeballMulti": "You can only throw a Poké Ball\nwhen there is one Pokémon remaining!", @@ -61,6 +62,7 @@ "skipItemQuestion": "Are you sure you want to skip taking an item?", "itemStackFull": "The stack for {{fullItemName}} is full.\nYou will receive {{itemName}} instead.", "eggHatching": "Oh?", + "eggSkipPrompt": "Skip to egg summary?", "ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?", "wildPokemonWithAffix": "Wild {{pokemonName}}", "foePokemonWithAffix": "Foe {{pokemonName}}", diff --git a/src/locales/en/battler-tags.json b/src/locales/en/battler-tags.json index 94ea3b14958..222aee4087c 100644 --- a/src/locales/en/battler-tags.json +++ b/src/locales/en/battler-tags.json @@ -67,5 +67,7 @@ "saltCuredLapse": "{{pokemonNameWithAffix}} is hurt by {{moveName}}!", "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", - "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!" -} \ No newline at end of file + "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", + "disabledOnAdd": "{{pokemonNameWithAffix}}'s {{moveName}}\nwas disabled!", + "disabledLapse": "{{pokemonNameWithAffix}}'s {{moveName}}\nis no longer disabled." +} diff --git a/src/locales/en/dialogue-misc.json b/src/locales/en/dialogue-misc.json index f5c63a85410..2f333b5f383 100644 --- a/src/locales/en/dialogue-misc.json +++ b/src/locales/en/dialogue-misc.json @@ -1,6 +1,6 @@ { - "ending": "@c{smile}Oh? You won?@d{96} @c{smile_eclosed}I guess I should've known.\nBut, you're back now.\n$@c{smile}It's over.@d{64} You ended the loop.\n$@c{serious_smile_fists}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$@c{neutral}I'm the only one who'll remember what you did.@d{96}\nI guess that's okay, isn't it?\n$@c{serious_smile_fists}Your legend will always live on in our hearts.\n$@c{smile_eclosed}Anyway, I've had about enough of this place, haven't you? Let's head home.\n$@c{serious_smile_fists}Maybe when we get back, we can have another battle?\nIf you're up to it.", - "ending_female": "@c{shock}You're back?@d{32} Does that mean…@d{96} you won?!\n@c{smile_ehalf}I should have known you had it in you.\n$@c{smile_eclosed}Of course… I always had that feeling.\n@c{smile}It's over now, right? You ended the loop.\n$@c{smile_ehalf}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$I'll be the only one to remember what you did.\n@c{angry_mopen}I'll try not to forget!\n$@c{smile_wave_wink}Just kidding!@d{64} @c{smile}I'd never forget.@d{32}\nYour legend will live on in our hearts.\n$@c{smile_wave}Anyway,@d{64} it's getting late…@d{96} I think?\nIt's hard to tell in this place.\n$Let's go home. @c{smile_wave_wink}Maybe tomorrow, we can have another battle, for old time's sake?", + "ending": "@c{shock}You're back?@d{32} Does that mean…@d{96} you won?!\n@c{smile_ehalf}I should have known you had it in you.\n$@c{smile_eclosed}Of course… I always had that feeling.\n@c{smile}It's over now, right? You ended the loop.\n$@c{smile_ehalf}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$I'll be the only one to remember what you did.\n@c{angry_mopen}I'll try not to forget!\n$@c{smile_wave_wink}Just kidding!@d{64} @c{smile}I'd never forget.@d{32}\nYour legend will live on in our hearts.\n$@c{smile_wave}Anyway,@d{64} it's getting late…@d{96} I think?\nIt's hard to tell in this place.\n$Let's go home. @c{smile_wave_wink}Maybe tomorrow, we can have another battle, for old time's sake?", + "ending_female": "@c{smile}Oh? You won?@d{96} @c{smile_eclosed}I guess I should've known.\nBut, you're back now.\n$@c{smile}It's over.@d{64} You ended the loop.\n$@c{serious_smile_fists}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$@c{neutral}I'm the only one who'll remember what you did.@d{96}\nI guess that's okay, isn't it?\n$@c{serious_smile_fists}Your legend will always live on in our hearts.\n$@c{smile_eclosed}Anyway, I've had about enough of this place, haven't you? Let's head home.\n$@c{serious_smile_fists}Maybe when we get back, we can have another battle?\nIf you're up to it.", "ending_endless": "Congratulations on reaching the current end!\nMore content is coming soon.", "ending_name": "Devs" -} \ No newline at end of file +} diff --git a/src/locales/en/dialogue.json b/src/locales/en/dialogue.json index 90b03a176d1..5565d2258c2 100644 --- a/src/locales/en/dialogue.json +++ b/src/locales/en/dialogue.json @@ -413,7 +413,7 @@ }, "ariana": { "encounter": { - "1": "Hold it right there! We can't someone on the loose.\n$It's harmful to Team Rocket's pride, you see.", + "1": "Hold it right there!\nWe can't have someone on the loose.\n$It's harmful to Team Rocket's pride, you see.", "2": "I don't know or care if what I'm doing is right or wrong...\n$I just put my faith in Giovanni and do as I am told", "3": "Your trip ends here. I'm going to take you down!" }, @@ -699,6 +699,7 @@ "encounter": { "1": "I'll fight you with all I have to wipe you out!", "2": "I don't care if you're a kid or what. I'll send you flying if you threaten us!", + "2_female": "I don't care if you're a kid or what. I'll send you flying if you threaten us!", "3": "I was told to turn away Trainers, whomever they might be!", "4": "I'll show you the power of Aether Paradise!", "5": "Now that you've learned of the darkness at the heart of Aether Paradise, we'll need you to conveniently disappear!" @@ -715,11 +716,13 @@ "encounter": { "1": "I, Branch Chief Faba, shall show you the harshness of the real world!", "2": "The man who is called Aether Paradise's last line of defense is to battle a mere child?", + "2_female": "The man who is called Aether Paradise's last line of defense is to battle a mere child?", "3": "I, Faba, am the Aether Branch Chief. The only one in the world, I'm irreplaceable." }, "victory": { "1": "Aiyee!", "2": "H-h-how can this be?! How could this child...", + "2_female": "H-h-how can this be?! How could this child...", "3": "This is why... This is why I can't bring myself to like children." } }, @@ -727,9 +730,12 @@ "encounter": { "1": "We're not bad-we're just hard!", "2": "You want some? That's how we say hello! Nice knowing you, punks!", + "2_female": "You want some? That's how we say hello! Nice knowing you, punks!", "3": "We're just a bunch of guys and gals with a great interest in other people's Pokémon!", "4": "Why you trying to act hard when we're already hard as bones out here, homie?", - "5": "Team Skull represent! We can't pay the rent! Had a lot of fun, but our youth was misspent!" + "4_female": "Why you trying to act hard when we're already hard as bones out here, homie?", + "5": "Team Skull represent! We can't pay the rent! Had a lot of fun, but our youth was misspent!", + "5_female": "Team Skull represent! We can't pay the rent! Had a lot of fun, but our youth was misspent!" }, "victory": { "1": "Huh? Is it over already?", @@ -742,11 +748,13 @@ "plumeria": { "encounter": { "1": " ...Hmph. You don't look like anything special to me.", + "1_female": " ...Hmph. You don't look like anything special to me.", "2": "It takes these dumb Grunts way too long to deal with you kids...", "3": "Mess with anyone in Team Skull, and I'll show you how serious I can get." }, "victory": { "1": "Hmmph! You're pretty strong. I'll give you that.", + "1_female": "Hmmph! You're pretty strong. I'll give you that.", "2": "Hmmph. Guess you are pretty tough. Now I understand why my Grunts waste so much time battling kids.", "3": "Hmmph! I guess I just have to hold that loss." } @@ -755,6 +763,7 @@ "encounter": { "1": "It looks like this is the end of the line for you!", "2": "You are a trainer aren't you? I'm afraid that doesn't give you the right to interfere in our work.", + "2_female": "You are a trainer aren't you? I'm afraid that doesn't give you the right to interfere in our work.", "3": "I'm from Macro Cosmos Insurance! Do you have a life insurance policy?" }, "victory": { @@ -772,6 +781,7 @@ "victory": { "1": "*sigh* I wasn't able to win... Oleana...you really are a hopeless woman.", "2": "Arghhh! This is inexcusable... What was I thinking... Any trainer who's made it this far would be no pushover..", + "2_female": "Arghhh! This is inexcusable... What was I thinking... Any trainer who's made it this far would be no pushover..", "3": "*sigh* I am one tired Oleana..." } }, diff --git a/src/locales/en/menu-ui-handler.json b/src/locales/en/menu-ui-handler.json index fccf9cd3002..0536fa12c2e 100644 --- a/src/locales/en/menu-ui-handler.json +++ b/src/locales/en/menu-ui-handler.json @@ -24,6 +24,7 @@ "linkGoogle": "Link Google", "unlinkGoogle": "Unlink Google", "cancel": "Cancel", + "donate": "Donate", "losingProgressionWarning": "You will lose any progress since the beginning of the battle. Proceed?", "noEggs": "You are not hatching\nany eggs at the moment!" } \ No newline at end of file diff --git a/src/locales/en/menu.json b/src/locales/en/menu.json index 97cfc0b019d..91888e9db31 100644 --- a/src/locales/en/menu.json +++ b/src/locales/en/menu.json @@ -51,5 +51,7 @@ "renamePokemon": "Rename Pokémon", "rename": "Rename", "nickname": "Nickname", - "errorServerDown": "Oops! There was an issue contacting the server.\n\nYou may leave this window open,\nthe game will automatically reconnect." + "errorServerDown": "Oops! There was an issue contacting the server.\n\nYou may leave this window open,\nthe game will automatically reconnect.", + "noSaves": "You don't have any save files on record!", + "tooManySaves": "You have too many save files on record!" } \ No newline at end of file diff --git a/src/locales/en/modifier-type.json b/src/locales/en/modifier-type.json index 15b9fb8f46d..f73a3dcccae 100644 --- a/src/locales/en/modifier-type.json +++ b/src/locales/en/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "Doubles the chance of an encounter being a double battle for {{battleCount}} battles." }, - "TempBattleStatBoosterModifierType": { - "description": "Increases the {{tempBattleStatName}} of all party members by 1 stage for 5 battles." + "TempStatStageBoosterModifierType": { + "description": "Increases the {{stat}} of all party members by 1 stage for 5 battles." }, "AttackTypeBoosterModifierType": { "description": "Increases the power of a Pokémon's {{moveType}}-type moves by 20%." @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "Increases all party members' level by {{levels}}." }, - "PokemonBaseStatBoosterModifierType": { - "description": "Increases the holder's base {{statName}} by 10%. The higher your IVs, the higher the stack limit." + "BaseStatBoosterModifierType": { + "description": "Increases the holder's base {{stat}} by 10%. The higher your IVs, the higher the stack limit." }, "AllPokemonFullHpRestoreModifierType": { "description": "Restores 100% HP for all Pokémon." @@ -183,6 +183,7 @@ "SOOTHE_BELL": { "name": "Soothe Bell" }, "SCOPE_LENS": { "name": "Scope Lens", "description": "It's a lens for scoping out weak points. It boosts the holder's critical-hit ratio."}, + "DIRE_HIT": { "name": "Dire Hit", "extra": { "raises": "Critical Hit Ratio" } }, "LEEK": { "name": "Leek", "description": "This very long and stiff stalk of leek boosts the critical-hit ratio of Farfetch'd's moves."}, "EVIOLITE": { "name": "Eviolite", "description": "This mysterious evolutionary lump boosts the Defense and Sp. Def stats when held by a Pokémon that can still evolve." }, @@ -250,28 +251,14 @@ "METAL_POWDER": { "name": "Metal Powder", "description": "Extremely fine yet hard, this odd powder boosts Ditto's Defense stat." }, "QUICK_POWDER": { "name": "Quick Powder", "description": "Extremely fine yet hard, this odd powder boosts Ditto's Speed stat." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "X Attack", "x_defense": "X Defense", "x_sp_atk": "X Sp. Atk", "x_sp_def": "X Sp. Def", "x_speed": "X Speed", - "x_accuracy": "X Accuracy", - "dire_hit": "Dire Hit" + "x_accuracy": "X Accuracy" }, - - "TempBattleStatBoosterStatName": { - "ATK": "Attack", - "DEF": "Defense", - "SPATK": "Sp. Atk", - "SPDEF": "Sp. Def", - "SPD": "Speed", - "ACC": "Accuracy", - "CRIT": "Critical Hit Ratio", - "EVA": "Evasiveness", - "DEFAULT": "???" - }, - "AttackTypeBoosterItem": { "silk_scarf": "Silk Scarf", "black_belt": "Black Belt", diff --git a/src/locales/en/modifier.json b/src/locales/en/modifier.json index 473be0e8bfa..47944c8adb7 100644 --- a/src/locales/en/modifier.json +++ b/src/locales/en/modifier.json @@ -3,7 +3,7 @@ "turnHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!", "hitHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}} was revived\nby its {{typeName}}!", - "pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!", + "resetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!", "moneyInterestApply": "You received interest of ₽{{moneyAmount}}\nfrom the {{typeName}}!", "turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was absorbed\nby {{pokemonName}}'s {{typeName}}!", "contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was snatched\nby {{pokemonName}}'s {{typeName}}!", diff --git a/src/locales/en/move-trigger.json b/src/locales/en/move-trigger.json index baddbaa34bf..e70fb9dcfb7 100644 --- a/src/locales/en/move-trigger.json +++ b/src/locales/en/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}} cut its own HP to power up its move!", "absorbedElectricity": "{{pokemonName}} absorbed electricity!", "switchedStatChanges": "{{pokemonName}} switched stat changes with the target!", + "switchedTwoStatChanges": "{{pokemonName}} switched all changes to its {{firstStat}}\nand {{secondStat}} with its target!", + "switchedStat": "{{pokemonName}} switched {{stat}} with its target!", + "sharedGuard": "{{pokemonName}} shared its guard with the target!", + "sharedPower": "{{pokemonName}} shared its power with the target!", "goingAllOutForAttack": "{{pokemonName}} is going all out for this attack!", "regainedHealth": "{{pokemonName}} regained\nhealth!", "keptGoingAndCrashed": "{{pokemonName}} kept going\nand crashed!", @@ -61,5 +65,6 @@ "suppressAbilities": "{{pokemonName}}'s ability\nwas suppressed!", "revivalBlessing": "{{pokemonName}} was revived!", "swapArenaTags": "{{pokemonName}} swapped the battle effects affecting each side of the field!", - "exposedMove": "{{pokemonName}} identified\n{{targetPokemonName}}!" -} + "exposedMove": "{{pokemonName}} identified\n{{targetPokemonName}}!", + "safeguard": "{{targetName}} is protected by Safeguard!" +} \ No newline at end of file diff --git a/src/locales/en/pokemon-info.json b/src/locales/en/pokemon-info.json index 87d2f7ad17b..b79daaed621 100644 --- a/src/locales/en/pokemon-info.json +++ b/src/locales/en/pokemon-info.json @@ -1,7 +1,7 @@ { "Stat": { "HP": "Max. HP", - "HPshortened": "MaxHP", + "HPshortened": "HP", "ATK": "Attack", "ATKshortened": "Atk", "DEF": "Defense", @@ -13,8 +13,7 @@ "SPD": "Speed", "SPDshortened": "Spd", "ACC": "Accuracy", - "EVA": "Evasiveness", - "HPStat": "HP" + "EVA": "Evasiveness" }, "Type": { "UNKNOWN": "Unknown", @@ -38,4 +37,4 @@ "FAIRY": "Fairy", "STELLAR": "Stellar" } -} \ No newline at end of file +} diff --git a/src/locales/en/settings.json b/src/locales/en/settings.json index 6528f0368fe..301ebea9b2b 100644 --- a/src/locales/en/settings.json +++ b/src/locales/en/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "Move Touch Controls", "shopOverlayOpacity": "Shop Overlay Opacity", "shopCursorTarget": "Shop Cursor Target", - "items": "Items", + "rewards": "Rewards", "reroll": "Reroll", "shop": "Shop", "checkTeam": "Check Team" diff --git a/src/locales/es/achv.json b/src/locales/es/achv.json index c94b8858233..14501dbdb6b 100644 --- a/src/locales/es/achv.json +++ b/src/locales/es/achv.json @@ -91,7 +91,7 @@ "name": "Campeón Liga Master", "name_female": "Campeona Liga Master" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "Trabajo en Equipo", "description": "Haz relevo a otro miembro del equipo con al menos una estadística al máximo." }, @@ -175,4 +175,4 @@ "name": "Espejo ojepsE", "description": "Completa el reto de Combate Inverso.\n.osrevnI etabmoC ed oter le atelpmoC" } -} \ No newline at end of file +} diff --git a/src/locales/es/arena-flyout.json b/src/locales/es/arena-flyout.json index b2881b5de76..64c9a489d73 100644 --- a/src/locales/es/arena-flyout.json +++ b/src/locales/es/arena-flyout.json @@ -1,21 +1,21 @@ { - "activeBattleEffects": "Efectos de Terreno Activos", + "activeBattleEffects": "Efectos de terreno activos", "player": "Jugador", "neutral": "Neutral", "enemy": "Enemigo", "sunny": "Sol", "rain": "Lluvia", - "sandstorm": "Tormenta de Arena", + "sandstorm": "Tormenta de arena", "hail": "Granizo", "snow": "Nieve", "fog": "Niebla", "heavyRain": "Diluvio", - "harshSun": "Sol Abrasador", + "harshSun": "Sol abrasador", "strongWinds": "Turbulencias", - "misty": "Campo de Niebla", - "electric": "Campo Eléctrico", - "grassy": "Campo de Hierba", - "psychic": "Campo Psíquico", + "misty": "Campo de niebla", + "electric": "Campo eléctrico", + "grassy": "Campo de hierba", + "psychic": "Campo psíquico", "mudSport": "Chapoteo Lodo", "waterSport": "Hidrochorro", "spikes": "Púas", @@ -36,5 +36,6 @@ "matBlock": "Escudo Tatami", "craftyShield": "Truco Defensa", "tailwind": "Viento Afín", - "happyHour": "Paga Extra" -} \ No newline at end of file + "happyHour": "Paga Extra", + "safeguard": "Velo Sagrado" +} diff --git a/src/locales/es/arena-tag.json b/src/locales/es/arena-tag.json index 913876ddf87..0f63b62e784 100644 --- a/src/locales/es/arena-tag.json +++ b/src/locales/es/arena-tag.json @@ -1,4 +1,53 @@ { + "yourTeam": "tu equipo", + "opposingTeam": "el equipo rival", + "arenaOnRemove": "Los efectos de {{moveName}} desaparecieron.", + "arenaOnRemovePlayer": "Los efectos de {{moveName}}\ndesaparecieron en tu bando.", + "arenaOnRemoveEnemy": "Los efectos de {{moveName}}\ndesaparecieron en el bando rival.", + "mistOnAdd": "¡Neblina de {{pokemonNameWithAffix}}\nha cubierto a su equipo!", + "mistApply": "¡La neblina evita los cambios de estadísticas!", + "reflectOnAdd": "¡Reflejo redujo el daño físico!", + "reflectOnAddPlayer": "¡Reflejo redujo el daño físico en tu bando!", + "reflectOnAddEnemy": "Reflejo redujo el daño físico en el bando rival.", + "lightScreenOnAdd": "¡Pantalla de Luz redujo el daño físico!", + "lightScreenOnAddPlayer": "¡Pantalla de Luz redujo el daño físico en tu bando!", + "lightScreenOnAddEnemy": "¡Pantalla de Luz redujo el daño físico en el bando enemigo!", + "auroraVeilOnAdd": "¡Velo Aurora redujo el daño físico!", + "auroraVeilOnAddPlayer": "¡Velo Aurora redujo el daño físico en tu bando!", + "auroraVeilOnAddEnemy": "¡Velo Aurora redujo el daño físico en el bando rival!", + "conditionalProtectOnAdd": "¡{{moveName}} protege a su bando!", + "conditionalProtectOnAddPlayer": "¡{{moveName}} protege a tu bando!", + "conditionalProtectOnAddEnemy": "¡{{moveName}} protege al bando rival!", + "conditionalProtectApply": "¡{{pokemonNameWithAffix}} ha sido protegido por {{moveName}}!", + "matBlockOnAdd": "¡{{pokemonNameWithAffix}} va a usar un tatami para bloquear ataques!", + "noCritOnAddPlayer": "¡{{moveName}} protege a tu bando de golpes críticos!", + "noCritOnAddEnemy": "¡{{moveName}} protege al bando rival de golpes críticos!", + "noCritOnRemove": "¡Los efectos de {{moveName}} de {{pokemonNameWithAffix}} se han disipado!", + "wishTagOnAdd": "¡El deseo de {{pokemonNameWithAffix}} se ha hecho realidad!", + "mudSportOnAdd": "¡Se han debilitado los ataques de tipo Eléctrico!", + "mudSportOnRemove": "Chapoteo Lodo ha dejado de surtir efecto.", + "waterSportOnAdd": "¡Se han debilitado los ataques\nde tipo Fuego!", + "waterSportOnRemove": "Hidrochorro ha dejado de surtir efecto.", + "spikesOnAdd": "¡El equipo de {{opponentDesc}} ha sido rodeado por {{moveName}}!", + "spikesActivateTrap": "¡Las púas han herido a {{pokemonNameWithAffix}}!", + "toxicSpikesOnAdd": "¡El equipo de {{opponentDesc}} ha sido rodeado por {{moveName}}!", + "toxicSpikesActivateTrapPoison": "¡{{pokemonNameWithAffix}} ha sido herido por {{moveName}}!", + "stealthRockOnAdd": "¡El equipo de {{opponentDesc}} ha sido rodeado por piedras puntiagudas!", + "stealthRockActivateTrap": "¡Unas piedras puntiagudas han dañado a {{pokemonNameWithAffix}}!", + "stickyWebOnAdd": "¡Una {{moveName}} se extiende a los pies del bando rival!", + "stickyWebActivateTrap": "¡{{pokemonName}} ha caído en una red viscosa!", + "trickRoomOnAdd": "¡{{pokemonNameWithAffix}} ha alterado las dimensiones!", + "trickRoomOnRemove": "Se han restaurado las dimensiones alteradas.", + "gravityOnAdd": "¡La gravedad se ha incrementado!", + "gravityOnRemove": "La gravedad ha vuelto a su estado normal.", + "tailwindOnAdd": "¡Sopla un viento afín!", + "tailwindOnAddPlayer": "¡El viento sopla a favor de tu bando!", + "tailwindOnAddEnemy": "¡El viento sopla a favor del bando rival!", + "tailwindOnRemove": "Ha dejado de soplar el viento afín.", + "tailwindOnRemovePlayer": "Ha dejado de soplar el viento que favorecía a tu equipo.", + "tailwindOnRemoveEnemy": "Ha dejado de soplar el viento que favorecía al bando rival.", + "happyHourOnAdd": "¡La felicidad se respira en el aire!", + "happyHourOnRemove": "La felicidad ya no se respira en el aire.", "safeguardOnAdd": "¡Todos los Pokémon están protegidos por Velo Sagrado!", "safeguardOnAddPlayer": "¡Tu equipo se ha protegido con Velo Sagrado!", "safeguardOnAddEnemy": "¡El equipo enemigo se ha protegido con Velo Sagrado!", diff --git a/src/locales/es/battler-tags.json b/src/locales/es/battler-tags.json index 9e26dfeeb6e..d917b6c74b5 100644 --- a/src/locales/es/battler-tags.json +++ b/src/locales/es/battler-tags.json @@ -1 +1,71 @@ -{} \ No newline at end of file +{ + "trappedDesc": "trampa", + "flinchedDesc": "retroceso", + "confusedDesc": "confusión", + "infatuatedDesc": "enamoramiento", + "seedDesc": "drenado", + "nightmareDesc": "pesadillas", + "ingrainDesc": "raíces", + "drowsyDesc": "sueño", + "rechargingLapse": "¡{{pokemonNameWithAffix}} necesita\nrecuperarse de su ataque!", + "trappedOnAdd": "¡{{pokemonNameWithAffix}} no puede escapar!", + "trappedOnRemove": "¡{{pokemonNameWithAffix}} se ha\nliberado de {{moveName}}!", + "flinchedLapse": "¡{{pokemonNameWithAffix}} se amedrentó!", + "confusedOnAdd": "¡{{pokemonNameWithAffix}} se encuentra confuso!", + "confusedOnRemove": "¡{{pokemonNameWithAffix}} ya no está confuso!", + "confusedOnOverlap": "¡{{pokemonNameWithAffix}} ya está confuso!", + "confusedLapse": "¡{{pokemonNameWithAffix}} está confuso!", + "confusedLapseHurtItself": "¡Está tan confuso que se ha herido a sí mismo!", + "destinyBondLapseIsBoss": "Mismo Destino no afecta a {{pokemonNameWithAffix}}.", + "destinyBondLapse": "¡{{pokemonNameWithAffix2}} ha sufrido\nel mismo destino que {{pokemonNameWithAffix}}!", + "infatuatedOnAdd": "¡{{pokemonNameWithAffix}} se ha enamorado\nde {{sourcePokemonName}}!", + "infatuatedOnOverlap": "¡{{pokemonNameWithAffix}} ya está enamorado!", + "infatuatedLapse": "¡{{pokemonNameWithAffix}} se ha enamorado\ndebido a {{sourcePokemonName}}!", + "infatuatedLapseImmobilize": "¡El enamoramiento impide que\n{{pokemonNameWithAffix}} reaccione!", + "infatuatedOnRemove": "{{pokemonNameWithAffix}} ya no está enamorado.", + "seededOnAdd": "¡{{pokemonNameWithAffix}} ha sido infectado!", + "seededLapse": "¡Las drenadoras han restado salud a {{pokemonNameWithAffix}}!", + "seededLapseShed": "¡{{pokemonNameWithAffix}} ha absorbido el lodo líquido!", + "nightmareOnAdd": "¡{{pokemonNameWithAffix}} se ha sumido en una pesadilla!", + "nightmareOnOverlap": "¡{{pokemonNameWithAffix}} ya está teniendo pesadillas!", + "nightmareLapse": "¡{{pokemonNameWithAffix}} sufre pesadillas!", + "encoreOnAdd": "¡{{pokemonNameWithAffix}} sufre los efectos de Otra Vez!", + "encoreOnRemove": "¡{{pokemonNameWithAffix}} ya no sufre los efectos de Otra Vez!", + "helpingHandOnAdd": "¡{{pokemonNameWithAffix}} se prepara\npara ayudar a {{pokemonName}}!", + "ingrainLapse": "¡{{pokemonNameWithAffix}} ha absorbido\nnutrientes a través de sus raíces!", + "ingrainOnTrap": "¡{{pokemonNameWithAffix}} ha echado raíces!", + "aquaRingOnAdd": "¡{{pokemonNameWithAffix}} se ha rodeado de un manto de agua!", + "aquaRingLapse": "¡{{pokemonName}} restauró sus PS con {{moveName}}!", + "drowsyOnAdd": "¡{{pokemonNameWithAffix}} empieza a tener sueño!", + "damagingTrapLapse": "¡{{moveName}} hiere a {{pokemonNameWithAffix}}!", + "bindOnTrap": "¡{{moveName}} de {{sourcePokemonName}} oprime a {{pokemonNameWithAffix}}!", + "wrapOnTrap": "¡{{sourcePokemonName}} ha atrapado a {{pokemonNameWithAffix}} con una constricción!", + "vortexOnTrap": "¡{{pokemonNameWithAffix}} no puede salir del torbellino!", + "clampOnTrap": "¡{{sourcePokemonNameWithAffix}} ha atenazado a \n{{pokemonName}}!", + "sandTombOnTrap": "¡{{pokemonNameWithAffix}} ha sido atrapado por {{moveName}}!", + "magmaStormOnTrap": "¡La lluvia ígnea cae sobre {{pokemonNameWithAffix}}!", + "snapTrapOnTrap": "¡{{pokemonNameWithAffix}} cayó en un cepo!", + "thunderCageOnTrap": "¡{{sourcePokemonNameWithAffix}} ha enjaulado a {{pokemonNameWithAffix}}!", + "infestationOnTrap": "¡{{pokemonNameWithAffix}} es presa del acoso de {{sourcePokemonNameWithAffix}}!", + "protectedOnAdd": "{{pokemonNameWithAffix}}\nse está protegiendo.", + "protectedLapse": "¡{{pokemonNameWithAffix}}\nse ha protegido!", + "enduringOnAdd": "{{pokemonNameWithAffix}} se prepara para resistir los ataques...", + "enduringLapse": "¡{{pokemonNameWithAffix}} ha encajado el golpe!", + "sturdyLapse": "¡{{pokemonNameWithAffix}} ha encajado el golpe!", + "perishSongLapse": "La cuenta atrás de Canto Mortal de\n{{pokemonNameWithAffix}} ha bajado a {{turnCount}}.", + "centerOfAttentionOnAdd": "¡{{pokemonNameWithAffix}} es el centro de atención!", + "truantLapse": "{{pokemonNameWithAffix}} está holgazaneando...", + "slowStartOnAdd": "¡{{pokemonNameWithAffix}} no está dando todo de sí!", + "slowStartOnRemove": "¡{{pokemonNameWithAffix}} ya puede darlo todo!", + "highestStatBoostOnAdd": "¡{{pokemonNameWithAffix}} ha reforzado su {{statName}}!", + "highestStatBoostOnRemove": "¡Los efectos de {{abilityName}}\nde {{pokemonNameWithAffix}} han desaparecido!", + "magnetRisenOnAdd": "¡{{pokemonNameWithAffix}} levita gracias a un campo electromagnético!", + "magnetRisenOnRemove": "¡El campo electromagnético de {{pokemonNameWithAffix}} se ha disipado!", + "critBoostOnAdd": "¡{{pokemonNameWithAffix}} se está preparando para luchar!", + "critBoostOnRemove": "{{pokemonNameWithAffix}} se ha relajado.", + "saltCuredOnAdd": "¡{{pokemonNameWithAffix}} está en salazón!", + "saltCuredLapse": "¡{{moveName}} ha herido a {{pokemonNameWithAffix}}!", + "cursedOnAdd": "¡{{pokemonNameWithAffix}} sacrifica algunos PS y maldice a {{pokemonName}}!", + "cursedLapse": "¡{{pokemonNameWithAffix}} es víctima de una maldición!", + "stockpilingOnAdd": "¡{{pokemonNameWithAffix}} ha reservado energía por {{stockpiledCount}}ª vez!" +} diff --git a/src/locales/es/game-mode.json b/src/locales/es/game-mode.json index e7925900253..0dbccb45e1f 100644 --- a/src/locales/es/game-mode.json +++ b/src/locales/es/game-mode.json @@ -1,8 +1,8 @@ { - "classic": "Clásica", - "endless": "Infinita", - "endlessSpliced": "Infinita (Fusión)", - "dailyRun": "Diaria", - "unknown": "Desconicido", + "classic": "Clásico", + "endless": "Infinito", + "endlessSpliced": "Infinito (Fusión)", + "dailyRun": "Diario", + "unknown": "Desconocido", "challenge": "Desafío" -} \ No newline at end of file +} diff --git a/src/locales/es/menu.json b/src/locales/es/menu.json index bd2479a02df..3f2caafac21 100644 --- a/src/locales/es/menu.json +++ b/src/locales/es/menu.json @@ -14,14 +14,14 @@ "register": "Registrarse", "emptyUsername": "El usuario no puede estar vacío", "invalidLoginUsername": "El usuario no es válido", - "invalidRegisterUsername": "El usuario solo puede contener letras, números y guiones bajos", + "invalidRegisterUsername": "El usuario solo puede contener letras, números y guiones bajos.", "invalidLoginPassword": "La contraseña no es válida", "invalidRegisterPassword": "La contraseña debe tener 6 o más caracteres.", "usernameAlreadyUsed": "El usuario ya está en uso", "accountNonExistent": "El usuario no existe", "unmatchingPassword": "La contraseña no coincide", "passwordNotMatchingConfirmPassword": "Las contraseñas deben coincidir", - "confirmPassword": "Confirmar Contra.", + "confirmPassword": "Confirmar contraseña", "registrationAgeWarning": "Al registrarte, confirmas tener 13 o más años de edad.", "backToLogin": "Volver al Login", "failedToLoadSaveData": "No se han podido cargar los datos guardados. Por favor, recarga la página.\nSi el fallo continúa, por favor comprueba #announcements en nuestro Discord.", diff --git a/src/locales/es/modifier-type.json b/src/locales/es/modifier-type.json index 9c36b8da767..e18cb19244d 100644 --- a/src/locales/es/modifier-type.json +++ b/src/locales/es/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "Duplica la posibilidad de que un encuentro sea una combate doble durante {{battleCount}} combates." }, - "TempBattleStatBoosterModifierType": { - "description": "Aumenta la est. {{tempBattleStatName}} de todos los miembros del equipo en 1 nivel durante 5 combates." + "TempStatStageBoosterModifierType": { + "description": "Aumenta la est. {{stat}} de todos los miembros del equipo en 1 nivel durante 5 combates." }, "AttackTypeBoosterModifierType": { "description": "Aumenta la potencia de los movimientos de tipo {{moveType}} de un Pokémon en un 20%." @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "Aumenta el nivel de todos los miembros del equipo en {{levels}}." }, - "PokemonBaseStatBoosterModifierType": { - "description": "Aumenta la est. {{statName}} base del portador en un 10%.\nCuanto mayores sean tus IVs, mayor será el límite de acumulación." + "BaseStatBoosterModifierType": { + "description": "Aumenta la est. {{stat}} base del portador en un 10%.\nCuanto mayores sean tus IVs, mayor será el límite de acumulación." }, "AllPokemonFullHpRestoreModifierType": { "description": "Restaura el 100% de los PS de todos los Pokémon." @@ -248,6 +248,12 @@ "name": "Periscopio", "description": "Aumenta la probabilidad de asestar un golpe crítico." }, + "DIRE_HIT": { + "name": "Crítico X", + "extra": { + "raises": "Critical Hit Ratio" + } + }, "LEEK": { "name": "Puerro", "description": "Puerro muy largo y duro que aumenta la probabilidad de asestar un golpe crítico. Debe llevarlo Farfetch'd." @@ -411,25 +417,13 @@ "description": "Polvo muy fino, pero a la vez poderoso, que aumenta la Velocidad. Debe llevarlo Ditto." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "Ataque X", "x_defense": "Defensa X", "x_sp_atk": "Ataq. Esp. X", "x_sp_def": "Def. Esp. X", "x_speed": "Velocidad X", - "x_accuracy": "Precisión X", - "dire_hit": "Crítico X" - }, - "TempBattleStatBoosterStatName": { - "ATK": "Ataque", - "DEF": "Defensa", - "SPATK": "Ataq. Esp.", - "SPDEF": "Def. Esp.", - "SPD": "Velocidad", - "ACC": "Precisión", - "CRIT": "Tasa de crítico", - "EVA": "Evasión", - "DEFAULT": "???" + "x_accuracy": "Precisión X" }, "AttackTypeBoosterItem": { "silk_scarf": "Pañuelo seda", diff --git a/src/locales/es/move-trigger.json b/src/locales/es/move-trigger.json index 52a6f86d930..f92b7950a07 100644 --- a/src/locales/es/move-trigger.json +++ b/src/locales/es/move-trigger.json @@ -1,4 +1,8 @@ { + "switchedTwoStatChanges": "{{pokemonName}} ha intercambiado los cambios en {{firstStat}} y {{secondStat}} con los del objetivo!", + "switchedStat": "{{pokemonName}} cambia su {{stat}} por la de su objetivo!", + "sharedGuard": "{{pokemonName}} suma su capacidad defensiva a la del objetivo y la reparte equitativamente!", + "sharedPower": "{{pokemonName}} suma su capacidad ofensiva a la del objetivo y la reparte equitativamente!", "isChargingPower": "¡{{pokemonName}} está acumulando energía!", "burnedItselfOut": "¡El fuego interior de {{pokemonName}} se ha extinguido!", "startedHeatingUpBeak": "¡{{pokemonName}} empieza\na calentar su pico!", @@ -9,4 +13,4 @@ "statEliminated": "¡Los cambios en estadísticas fueron eliminados!", "revivalBlessing": "¡{{pokemonName}} ha revivido!", "safeguard": "¡{{targetName}} está protegido por Velo Sagrado!" -} \ No newline at end of file +} diff --git a/src/locales/es/party-ui-handler.json b/src/locales/es/party-ui-handler.json index 65552a1e1d5..0e59aee6fd1 100644 --- a/src/locales/es/party-ui-handler.json +++ b/src/locales/es/party-ui-handler.json @@ -1,4 +1,9 @@ { + "SEND_OUT": "Enviar", + "SUMMARY": "Resumen", + "CANCEL": "Cancelar", + "RELEASE": "Liberar", + "APPLY": "Aplicar", "TEACH": "Enseñar", "SPLICE": "Fusionar", "UNSPLICE": "Separar", @@ -7,23 +12,23 @@ "TRANSFER": "Transferir", "ALL": "Todo", "PASS_BATON": "Relevo", - "UNPAUSE_EVOLUTION": "Reanudar Evolución", + "UNPAUSE_EVOLUTION": "Reanudar evolución", "REVIVE": "Revivir", "RENAME": "Rename", "choosePokemon": "Elige a un Pokémon.", "doWhatWithThisPokemon": "¿Que quieres hacer con este Pokémon?", - "noEnergy": "¡A {{pokemonName}} no le quedan\nfuerzas para luchar!", - "hasEnergy": "¡A {{pokemonName}} le quedan\nfuerzas para luchar!", - "cantBeUsed": "¡{{pokemonName}} no puede usarse\nen este desafío!", - "tooManyItems": "¡{{pokemonName}} tiene demasiados\nde este objeto!", + "noEnergy": "¡A {{pokemonName}} no le\nquedan fuerzas para luchar!", + "hasEnergy": "¡A {{pokemonName}} le\nquedan fuerzas para luchar!", + "cantBeUsed": "¡{{pokemonName}} no puede usarse en este desafío!", + "tooManyItems": "¡{{pokemonName}} tiene\ndemasiado de este objeto!", "anyEffect": "No tendría ningún efecto.", - "unpausedEvolutions": "Se reanudó las evoluciones de {{pokemonName}}.", + "unpausedEvolutions": "Se reanudaron las evoluciones de {{pokemonName}}.", "unspliceConfirmation": "¿Seguro que quiere separar a {{fusionName}}\nde {{pokemonName}}? {{fusionName}} se perderá.", "wasReverted": "{{fusionName}} se revirtió a {{pokemonName}}.", "releaseConfirmation": "¿Quieres liberar a {{pokemonName}}?", "releaseInBattle": "¡No puedes liberar un Pokémon que está en batalla!", "selectAMove": "Selecciona un movimiento.", - "changeQuantity": "Selecciona un objeto equipado para transferir.\nUsa < y > para cambiar la cantidad.", + "changeQuantity": "Selecciona un ítem para transferir.\nUsa < y > para calibrar.", "selectAnotherPokemonToSplice": "Selecciona otro Pokémon para fusionar.", "cancel": "Salir", "able": "Apto", @@ -36,7 +41,7 @@ "thisIsWhereWePart": "¡Aquí es donde nos despedimos, {{pokemonName}}!", "illMissYou": "¡Te echaré de menos, {{pokemonName}}!", "illNeverForgetYou": "¡Nunca te olvidaré, {{pokemonName}}!", - "untilWeMeetAgain": "¡Hasta que nos volvamos a encontrar, {{pokemonName}}!", + "untilWeMeetAgain": "¡Hasta que nos volvamos a\nencontrar, {{pokemonName}}!", "sayonara": "¡Sayonara, {{pokemonName}}!", "smellYaLater": "¡Nos vemos luego, {{pokemonName}}!" -} \ No newline at end of file +} diff --git a/src/locales/es/pokemon-form-battle.json b/src/locales/es/pokemon-form-battle.json index 5266baa7049..d6eed9e93cc 100644 --- a/src/locales/es/pokemon-form-battle.json +++ b/src/locales/es/pokemon-form-battle.json @@ -10,5 +10,5 @@ "eternamaxChange": "¡{{preName}} ha eternamaxizado a {{pokemonName}}!", "revertChange": "¡{{pokemonName}} ha revertido a su forma original!", "formChange": "¡{{preName}} ha cambiado de forma!", - "disguiseChange": "¡El disfraz ha actuado como señuelo!\t" + "disguiseChange": "¡El disfraz ha actuado como señuelo!" } diff --git a/src/locales/es/settings.json b/src/locales/es/settings.json index 9c16fbb0fd6..dc441d48eb8 100644 --- a/src/locales/es/settings.json +++ b/src/locales/es/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "Controles táctiles", "shopOverlayOpacity": "Opacidad de la fase de compra", "shopCursorTarget": "Cursor de la tienda", - "items": "Objetos", + "rewards": "Objetos", "reroll": "Actualizar", "shop": "Tienda", "checkTeam": "Ver equipo" diff --git a/src/locales/fr/achv.json b/src/locales/fr/achv.json index 60655ae22cf..3e95f9326ca 100644 --- a/src/locales/fr/achv.json +++ b/src/locales/fr/achv.json @@ -92,7 +92,7 @@ "name": "Master Maitre de la Ligue", "name_female": "Master Maitresse de la Ligue" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "Travail d’équipe", "description": "Utiliser Relais avec au moins une statistique montée à fond." }, diff --git a/src/locales/fr/arena-flyout.json b/src/locales/fr/arena-flyout.json index ce78643862e..e90de13b20a 100644 --- a/src/locales/fr/arena-flyout.json +++ b/src/locales/fr/arena-flyout.json @@ -36,5 +36,6 @@ "matBlock": "Tatamigaeshi", "craftyShield": "Vigilance", "tailwind": "Vent Arrière", - "happyHour": "Étrennes" -} \ No newline at end of file + "happyHour": "Étrennes", + "safeguard": "Rune Protect" +} diff --git a/src/locales/fr/battle.json b/src/locales/fr/battle.json index 1c108c89ded..b8da3a953ae 100644 --- a/src/locales/fr/battle.json +++ b/src/locales/fr/battle.json @@ -94,5 +94,6 @@ "retryBattle": "Voulez-vous réessayer depuis le début du combat ?", "unlockedSomething": "{{unlockedThing}}\na été débloqué.", "congratulations": "Félicitations !", - "beatModeFirstTime": "{{speciesName}} a battu le mode {{gameMode}} pour la première fois !\nVous avez reçu {{newModifier}} !" -} \ No newline at end of file + "beatModeFirstTime": "{{speciesName}} a battu le mode {{gameMode}} pour la première fois !\nVous avez reçu {{newModifier}} !", + "eggSkipPrompt": "Aller directement au résumé des Œufs éclos ?" +} diff --git a/src/locales/fr/dialogue-misc.json b/src/locales/fr/dialogue-misc.json index 359c2dfb46b..c8c781002b9 100644 --- a/src/locales/fr/dialogue-misc.json +++ b/src/locales/fr/dialogue-misc.json @@ -1,6 +1,6 @@ { - "ending": "@c{smile}Oh ? T’as gagné ?@d{96} @c{smile_eclosed}J’aurais dû le savoir.\nMais de voilà de retour.\n$@c{smile}C’est terminé.@d{64} T’as brisé ce cycle infernal.\n$@c{serious_smile_fists}T’as aussi accompli ton rêve non ?\nTu n’as pas connu la moindre défaite.\n$@c{neutral}Je suis le seul à me souvenir de ce que t’as fait.@d{96}\nJe pense que ça ira, non ?\n$@c{serious_smile_fists}Ta légende vivra à jamais dans nos cœurs.\n$@c{smile_eclosed}Bref, j’en ai un peu marre de ce endroit, pas toi ? Rentrons à la maison.\n$@c{serious_smile_fists}On se fera un p’tit combat une fois rentrés ?\nSi t’es d’accord.", - "ending_female": "@c{shock}T’es revenu ?@d{32} Ça veut dire…@d{96} que t’as gagné ?!\n@c{smile_ehalf}J’aurais dû le savoir.\n$@c{smile_eclosed}Bien sûr… J’ai toujours eu ce sentiment.\n@c{smile}C’est fini maitenant hein ? T’as brisé ce cycle.\n$@c{smile_ehalf}T’as aussi accompli ton rêve non ?\nTu n’as pas connu la moindre défaite.\n$Je serai la seule à me souvenir de ce que t’as fait.\n@c{angry_mopen}Je tâcherai de ne pas oublier !\n$@c{smile_wave_wink}J’déconne !@d{64} @c{smile}Jamais j’oublierai.@d{32}\nTa légende vivra à jamais dans nos cœurs.\n$@c{smile_wave}Bon,@d{64} il se fait tard…@d{96} je crois ?\nDifficile à dire ici.\n$Rentrons, @c{smile_wave_wink}et demain on se fera un p’tit combat, comme au bon vieux temps ?", + "ending": "@c{shock}T’es revenu ?@d{32} Ça veut dire…@d{96} que t’as gagné ?!\n@c{smile_ehalf}J’aurais dû m’en douter.\n$@c{smile_eclosed}Bien sûr… J’ai toujours eu ce sentiment.\n@c{smile}C’est fini maintenant hein ? T’as brisé ce cycle.\n$@c{smile_ehalf}T’as aussi accompli ton rêve non ?\nTu n’as pas connu la moindre défaite.\n$Je serai la seule à me souvenir de ce que t’as fait.\n@c{angry_mopen}Je tâcherai de ne pas oublier !\n$@c{smile_wave_wink}J’déconne !@d{64} @c{smile}Jamais j’oublierai.@d{32}\nTa légende vivra à jamais dans nos cœurs.\n$@c{smile_wave}Bon,@d{64} il se fait tard…@d{96} je crois ?\nDifficile à dire ici.\n$Rentrons, @c{smile_wave_wink}et demain on se fera un p’tit combat, comme au bon vieux temps ?", + "ending_female": "@c{smile}Oh ? T’as gagné ?@d{96} @c{smile_eclosed}J’aurais dû m’en douter.\nMais te voilà enfin de retour.\n$@c{smile}C’est terminé.@d{64} T’as brisé ce cycle infernal.\n$@c{serious_smile_fists}T’as aussi accompli ton rêve non ?\nTu n’as pas connu la moindre défaite.\n$@c{neutral}Je suis le seul à me souvenir de ce que t’as fait.@d{96}\nJe pense que ça ira, non ?\n$@c{serious_smile_fists}Ta légende vivra à jamais dans nos cœurs.\n$@c{smile_eclosed}Bref, j’en ai un peu marre de ce endroit, pas toi ? Rentrons à la maison.\n$@c{serious_smile_fists}On se fera un p’tit combat une fois rentrés ?\nSi t’es d’accord.", "ending_endless": "Félicitations ! Vous avez atteint la fin actuelle.\nPlus de contenu à venir bientôt !", "ending_name": "Les devs" } diff --git a/src/locales/fr/dialogue.json b/src/locales/fr/dialogue.json index c9bb3c417c7..d9d13a8f1e8 100644 --- a/src/locales/fr/dialogue.json +++ b/src/locales/fr/dialogue.json @@ -9,7 +9,7 @@ "6": "Allez, c’est parti !", "7": "Attention, me voilà !\nTu vas voir comment j’suis fort !", "8": "Coucou… Tu veux voir mes bô Pokémon ?", - "9": "Trève de mondanités. Ramène-toi quand tu le sens !", + "9": "Trêve de mondanités. Ramène-toi quand tu le sens !", "10": "Baisse pas ta garde si tu veux pas pleurer d’avoir perdu face à un gamin.", "11": "J’ai tout donné pour élever mes Pokémon. Attention à toi si tu leur fait du mal !", "12": "Incroyable que t’y sois parvenu ! Mais la suite va pas être une partie de plaisir.", @@ -68,7 +68,7 @@ "3": "Hum, t’es pas trop laxiste avec tes Pokémon ?\nTrop les chouchouter n’est pas bon." }, "victory": { - "1": "Il est primordial de nourir et développer toutes les caractéristiques de chaque Pokémon.", + "1": "Il est primordial de nourrir et développer toutes les caractéristiques de chaque Pokémon.", "2": "Contrairement à moi, ces Pokémon ont un bon fond.", "3": "Trop d’éloges peut ruiner les Pokémon et les gens." }, @@ -229,7 +229,7 @@ "encounter": { "1": "Ne te mets pas en travers de la Team Galaxie !", "2": "Sois témoin de la puissance de notre technologie et du futur qui se profile !", - "3": "Au nom de la Team Galaxie, j’éliminerai quiconque se mettera sur notre route !", + "3": "Au nom de la Team Galaxie, j’éliminerai quiconque se mettra sur notre route !", "4": "Prépare ta défaite !", "5": "J’espère que t’es prêt à te prendre une raclée de l’espace !", "5_female": "J’espère que t’es prête à te prendre une raclée de l’espace !" @@ -244,7 +244,7 @@ }, "plasma_grunt": { "encounter": { - "1": "Pas de quatiers à ceux qui ne suivent pas notre idéal !", + "1": "Pas de quartiers à quiconque ne suit pas notre idéal !", "2": "Si je gagne, tu relâches tous tes Pokémon !", "3": "Si tu te mets en travers de la Team Plasma, je m’occuperai de toi personnellement !", "4": "La Team Plasma va libérer les Pokémon de tous les humains égoïstes dans ton genre !", @@ -275,6 +275,96 @@ "5": "J’appelle pas ça perdre, j’appelle ça échouer avec panache !" } }, + "aether_grunt": { + "encounter": { + "1": "Je vais te mettre ta raclée !", + "2": "J’en ai rien à faire que tu sois une gosse. Tu vas tutoyer les étoiles si tu nous menaces !", + "2_female": "J’en ai rien à faire que tu sois une gosse. Tu vas tutoyer les étoiles si tu nous menaces !", + "3": "J’ai pour ordre de ne laisser passer aucun Dresseur, peu importe qui c’est !", + "4": "Je vais te montrer le pouvoir du Paradis Æther !", + "5": "Maintenant que t’es au courant de ce qu’il se passe au cœur du Paradis Æther, fais-moi une faveur et disparait !" + }, + "victory": { + "1": "C’est plutôt toi qui devrait m’apprendre à en mettre…", + "2": "Pardon ? J’ai pas compris…", + "3": "Peu importe les ordres, jamais j’aurais pu te retenir en fait…", + "4": "Mhh… Il semblerait que j’ai perdu.", + "5": "C’est plutôt moi qui va disparaitre je crois." + } + }, + "faba": { + "encounter": { + "1": "Moi, Directeur Saubohne, je vais te montrer de quel bois je me chauffe !", + "2": "Donc là, l’homme supposé être la dernière ligne défense du Paradis Æther doit affronter un mioche ?", + "2_female": "Donc là, l’homme supposé être la dernière ligne défense du Paradis Æther doit affronter un mioche ?", + "3": "S’il n’y a qu’un seul nom à retenir au sein de la Fondation Æther, c’est le mien : Saubohne !" + }, + "victory": { + "1": "Gloups !", + "2": "Malheur ! J’ai perdu face à un simple enfant ?!", + "2_female": "Malheur ! J’ai perdu face à une simple enfant ?!", + "3": "J’ai HORREUR des enfants !" + } + }, + "skull_grunt": { + "encounter": { + "1": "Oush oush ! On est pas méchants, sauf si tu viens nous allumer la mèche-han !", + "2": "Ce manque de respect, j’hallucine ! T’es allé trop loin, le mioche !", + "2_female": "Ce manque de respect, j’hallucine ! T’es allée trop loin, la mioche !", + "3": "On est juste des gars et des meufs normaux, on voit un Pokémon on le prend !", + "4": "Pourquoi tu te la joue comme ça ? C'est avec tes dents que t’vas jouer frérot.", + "4_female": "Pourquoi tu te la joue comme ça ? C'est avec tes dents que t’vas jouer ma reus.", + "5": "Cousin, écoute-nous bien ! ♪\nSe taper dessus, ça sert à rien ! ♪\n$Tu t’incrustes chez nous, ça s’fait pas ! ♪\n$Mais on est sympa, on a un plan pour toi ! ♪", + "5_female": "Cousine, écoute-nous bien ! ♪\nSe taper dessus, ça sert à rien ! ♪\n$Tu t’incrustes chez nous, ça s’fait pas ! ♪\n$Mais on est sympa, on a un plan pour toi ! ♪" + }, + "victory": { + "1": "Hein ? C’est déjà terminé ?", + "2": "… Ça craint grave ! On s’tire !", + "3": "Ouais de toute on en avait pas b’soin de ton Pokémon… Ah ah…", + "4": "Ouh là, c’est bon, j’en demandais pas tant…", + "5": "On pèse plus que des Pokémon, t’entends ?\nAlors tu vas nous respecter, oush !" + } + }, + "plumeria": { + "encounter": { + "1": "Tsk. T’es un gamin tout ce qu’il y a de plus banal, en fait.", + "1_female": "Tsk. T’es une gamine tout ce qu’il y a de plus banal, en fait.", + "2": "Abrutis de sbires. Trop incompétents pour arriver à se débarasser de gamins…", + "3": "Si tu touches encore à un cheveu de mes lascars, tu vas pas comprendre c’qui t’arrive !" + }, + "victory": { + "1": "Tsk. T’es pas mauvais. J’te l’accorde.", + "1_female": "Tsk. T’es pas mauvaise. J’te l’accorde.", + "2": "Tsk. J’dois reconnaitre que t’en as dans le ventre.\n$Maintenant, j’comprends pourquoi mes gars n’arrêtent pas de se faire battre par toi.", + "3": "Tsk. J’crois que j'ai plus qu’à assumer ma défaite." + } + }, + "macro_grunt": { + "encounter": { + "1": "Hop hop hop ! Terminus !", + "2": "T’es un Dresseur n’est-ce pas ?\n$J’ai bien peur ce que ne soit pas une excuse suffisante pour nous interrompre dans notre travail.", + "2_female": "T’es une Dresseuse n’est-ce pas ?\n$J’ai bien peur ce que ne soit pas une excuse suffisante pour nous interrompre dans notre travail.", + "3": "Je travaille à Macro Cosmos Assurances !\nBesoin d’une assurance-vie ?" + }, + "victory": { + "1": "Je n’ai d’autre choix que respectueusement me retirer.", + "2": "Mon argent de poche…\nPlus qu’à manger des pâtes pour la fin du mois…", + "3": "Chez Macro Cosmos, rien n’est comparable à notre dévotion au travail !" + } + }, + "oleana": { + "encounter": { + "1": "Je ne laisserai personne interférer avec les projets du président Shehroz.", + "2": "Je vois que vous avez su vous défaire de mes subalternes.\n$Mais assez joué. Il est temps de rentrer chez vous, maintenant.", + "3": "Je gagnerai en votre nom, monsieur le président." + }, + "victory": { + "1": "*soupir* Comment ai-je fait pour perdre ainsi… ?\nJe ne suis vraiment pas à la hauteur…", + "2": "Ah ! Quelle erreur… Je n’aurais pas dû sous-estimer un Dresseur de ton calibre…", + "2_female": "Ah ! Quelle erreur… Je n’aurais pas dû sous-estimer une Dresseuse de ton calibre…", + "3": "*soupir* Je suis fatiguée parton…" + } + }, "rocket_boss_giovanni_1": { "encounter": { "1": "Bien. Je dois admettre que je suis impressionné de te voir ici !" @@ -468,7 +558,7 @@ "4": "Voir un tel jardin rempli de fleurs est si apaisant…" }, "victory": { - "1": "Bien joué, c’est mértié.", + "1": "Bien joué, c’est mérité.", "2": "Dommage, on s’amusait si bien…", "3": "Oh non, le combat est terminé…", "4": "Aaah, ça fait du bien !\nMerci, j’en avais besoin." @@ -505,15 +595,15 @@ }, "rival": { "encounter": { - "1": "@c{smile}Ah, je te cherchais ! Je savais que t’étais pressé de partir, mais je m’attendais quand même à un au revoir…\n$@c{smile_eclosed}T’as finalement décidé de réaliser ton rêve ?\nJ’ai peine à y croire.\n$@c{serious_smile_fists}Vu que t’es là, ça te dis un petit combat ?\nJe voudrais quand même m’assurer que t’es prêt.\n$@c{serious_mopen_fists}Surtout ne te retiens pas et donne-moi tout ce que t’as !" + "1": "@c{smile}Ah, je te cherchais ! Je savais que t’étais pressée de partir, mais je m’attendais quand même à un au revoir…\n$@c{smile_eclosed}T’as finalement décidé de réaliser ton rêve ?\nJ’ai peine à y croire.\n$@c{serious_smile_fists}Vu que t’es là, ça te dis un petit combat ?\nJe voudrais quand même m’assurer que t’es prête.\n$@c{serious_mopen_fists}Surtout ne te retiens pas et donne-moi tout ce que t’as !" }, "victory": { - "1": "@c{shock}Wah… Tu m’as vraiment lavé.\nT’es vraiment un débutant ?\n$@c{smile}T’as peut-être eu de la chance, mais…\nPeut-être que t’arriveras jusqu’au bout du chemin.\n$D’ailleurs, le prof m’a demandé de te filer ces objets.\nIls ont l’air sympas.\n$@c{serious_smile_fists}Bonne chance à toi !" + "1": "@c{shock}Wah… Tu m’as vraiment lavé.\nT’es vraiment une débutante ?\n$@c{smile}T’as peut-être eu de la chance, mais…\nPeut-être que t’arriveras jusqu’au bout du chemin.\n$D’ailleurs, le prof m’a demandé de te filer ces objets.\nIls ont l’air sympas.\n$@c{serious_smile_fists}Bonne chance à toi !" } }, "rival_female": { "encounter": { - "1": "@c{smile_wave}Ah, te voilà ! Je t’ai cherché partout !\n@c{angry_mopen}On oublie de dire au revoir à sa meilleure amie ?\n$@c{smile_ehalf}T’as décidé de réaliser ton rêve, hein ?\nCe jour est donc vraiment arrivé…\n$@c{smile}Je veux bien te pardonner de m’avoir oubliée,\nà une conditon. @c{smile_wave_wink}Que tu m’affronte !\n$@c{angry_mopen}Donne tout ! Ce serait dommage que ton aventure finisse avant d’avoir commencé, hein ?" + "1": "@c{smile_wave}Ah, te voilà ! Je t’ai cherché partout !\n@c{angry_mopen}On oublie de dire au revoir à sa meilleure amie ?\n$@c{smile_ehalf}T’as décidé de réaliser ton rêve, hein ?\nCe jour est donc vraiment arrivé…\n$@c{smile}Je veux bien te pardonner de m’avoir oubliée,\nà une condition. @c{smile_wave_wink}Que tu m’affronte !\n$@c{angry_mopen}Donne tout ! Ce serait dommage que ton aventure finisse avant d’avoir commencé, hein ?" }, "victory": { "1": "@c{shock}Tu viens de commencer et t’es déjà si fort ?!@d{96}\n@c{angry}T’as triché non ? Avoue !\n$@c{smile_wave_wink}J’déconne !@d{64} @c{smile_eclosed}J’ai perdu dans les règles…\nJ’ai le sentiment que tu vas très bien t’en sortir.\n$@c{smile}D’ailleurs, le prof veut que je te donne ces quelques objets. Ils te seront utiles, pour sûr !\n$@c{smile_wave}Fais de ton mieux, comme toujours !\nJe crois fort en toi !" @@ -521,10 +611,10 @@ }, "rival_2": { "encounter": { - "1": "@c{smile}Hé, toi aussi t’es là ?\n@c{smile_eclosed}Toujours invaincu, hein… ?\n$@c{serious_mopen_fists}Je sais que j’ai l’air de t’avoir suivi ici, mais c’est pas complètement vrai.\n$@c{serious_smile_fists}Pour être honnête, ça me démangeait d’avoir une revanche depuis que tu m’as battu.\n$Je me suis beaucoup entrainé, alors sois sure que je vais pas retenir mes coups cette fois.\n$@c{serious_mopen_fists}Et comme la dernière fois, ne te retiens pas !\nC’est parti !" + "1": "@c{smile}Hé, toi aussi t’es là ?\n@c{smile_eclosed}Toujours invaincue, hein… ?\n$@c{serious_mopen_fists}Je sais que j’ai l’air de t’avoir suivie ici, mais c’est pas complètement vrai.\n$@c{serious_smile_fists}Pour être honnête, ça me démangeait d’avoir une revanche depuis que tu m’as battu.\n$Je me suis beaucoup entrainé, alors sois sure que je vais pas retenir mes coups cette fois.\n$@c{serious_mopen_fists}Et comme la dernière fois, ne te retiens pas !\nC’est parti !" }, "victory": { - "1": "@c{neutral_eclosed}Oh. Je crois que j’ai trop pris la confiance.\n$@c{smile}Pas grave, c’est OK. Je me doutais que ça arriverait.\n@c{serious_mopen_fists}Je vais juste devoir encore plus m’entrainer !\n\n$@c{smile}Ah, et pas que t’aies réellement besoin d’aide, mais j’ai ça en trop sur moi qui pourrait t’intéresser.\n\n$@c{serious_smile_fists}Mais n’espère plus en avoir d’autres !\nJe peux pas passer mon temps à aider mon adversaire.\n$@c{smile}Bref, prends soin de toi et profite bien de l’évènement !" + "1": "@c{neutral_eclosed}Oh. Je crois que j’ai trop pris la confiance.\n$@c{smile}Pas grave, c’est OK. Je me doutais que ça arriverait.\n@c{serious_mopen_fists}Je vais juste devoir encore plus m’entrainer !\n\n$@c{smile}Ah, et pas que t’aies réellement besoin d’aide, mais j’ai ça en trop sur moi qui pourrait t’intéresser.\n\n$@c{serious_smile_fists}Mais n’espère plus en avoir d’autres !\nJe peux pas passer mon temps à aider mon adversaire.\n$@c{smile}Bref, prends soin de toi !" } }, "rival_2_female": { @@ -532,7 +622,7 @@ "1": "@c{smile_wave}Hé, sympa de te croiser ici. T’as toujours l’air invaincu. @c{angry_mopen}Eh… Pas mal !\n$@c{angry_mopen}Je sais à quoi tu penses et non, je t’espionne pas.\n@c{smile_eclosed}C’est juste que j’étais aussi dans le coin.\n$@c{smile_ehalf}Heureuse pour toi, mais je veux juste te rappeler que c’est pas grave de perdre parfois.\n$@c{smile}On apprend de nos erreurs, souvent plus que si on ne connaissait que le succès.\n$@c{angry_mopen}Dans tous les cas je me suis bien entrainée pour cette revanche, t’as intérêt à tout donner !" }, "victory": { - "1": "@c{neutral}Je… J’étais pas encore supposée perdre…\n$@c{smile}Bon. Ça veut juste dire que je vais devoir encore plus m’entrainer !\n$@c{smile_wave}J’ai aussi ça en rab pour toi !\n@c{smile_wave_wink}Inutile de me remercier ~.\n$@c{angry_mopen}C’étaient les derniers, terminé les cadeaux après ceux-là !\n$@c{smile_wave}Allez, tiens le coup et profite bien de l’évènement !" + "1": "@c{neutral}Je… J’étais pas encore supposée perdre…\n$@c{smile}Bon. Ça veut juste dire que je vais devoir encore plus m’entrainer !\n$@c{smile_wave}J’ai aussi ça en rab pour toi !\n@c{smile_wave_wink}Inutile de me remercier ~.\n$@c{angry_mopen}C’étaient les derniers, terminé les cadeaux après ceux-là !\n$@c{smile_wave}Allez, tiens le coup !" }, "defeat": { "1": "Je suppose que c’est parfois normal de perdre…" @@ -540,7 +630,7 @@ }, "rival_3": { "encounter": { - "1": "@c{smile}Hé, mais qui voilà ! Ça fait un bail.\n@c{neutral}T’es… toujours invaincu ? Incroyable.\n$@c{neutral_eclosed}Tout est devenu un peu… étrange.\nC’est plus pareil sans toi au village.\n$@c{serious}Je sais que c’est égoïste, mais j’ai besoin d’expier ça.\n@c{neutral_eclosed}Je crois que tout ça te dépasse.\n$@c{serious}Ne jamais perdre, c’est juste irréaliste.\nGrandir, c’est parfois aussi savoir perdre.\n$@c{neutral_eclosed}T’as un beau parcours, mais il y a encore tellement à venir et ça va pas s’arranger. @c{neutral}T’es prêt pour ça ?\n$@c{serious_mopen_fists}Si tu l’es, alors prouve-le." + "1": "@c{smile}Hé, mais qui voilà ! Ça fait un bail.\n@c{neutral}T’es… toujours invaincue ? Incroyable.\n$@c{neutral_eclosed}Tout est devenu un peu… étrange.\nC’est plus pareil sans toi au village.\n$@c{serious}Je sais que c’est égoïste, mais j’ai besoin d’expier ça.\n@c{neutral_eclosed}Je crois que tout ça te dépasse.\n$@c{serious}Ne jamais perdre, c’est juste irréaliste.\nGrandir, c’est parfois aussi savoir perdre.\n$@c{neutral_eclosed}T’as un beau parcours, mais il y a encore tellement à venir et ça va pas s’arranger. @c{neutral}T’es prête pour ça ?\n$@c{serious_mopen_fists}Si tu l’es, alors prouve-le." }, "victory": { "1": "@c{angry_mhalf}C’est lunaire… J’ai presque fait que m’entrainer…\nAlors pourquoi il y a encore un tel écart entre nous ?" @@ -559,7 +649,7 @@ }, "rival_4": { "encounter": { - "1": "@c{neutral}Hé.\n$Je vais pas y aller par quatre chemins avec toi.\n@c{neutral_eclosed}Je suis là pour gagner. Simple, basique.\n$@c{serious_mhalf_fists}J’ai appris à maximiser tout mon potentiel en m’entrainant d’arrachepied.\n$@c{smile}C’est fou tout le temps que tu peux te dégager si tu dors pas en sacrifiant ta vie sociale.\n$@c{serious_mopen_fists}Plus rien n’a d’importance désormais, pas tant que j’aurai pas gagné.\n$@c{neutral_eclosed}J’ai atteint un stade où je ne peux plus perdre.\n@c{smile_eclosed}Je présume que ta philosophie était pas si fausse finalement.\n$@c{angry_mhalf}La défaite, c’est pour les faibles, et je ne suis plus un faible.\n$@c{serious_mopen_fists}Tiens-toi prêt." + "1": "@c{neutral}Hé.\n$Je vais pas y aller par quatre chemins avec toi.\n@c{neutral_eclosed}Je suis là pour gagner. Simple, basique.\n$@c{serious_mhalf_fists}J’ai appris à maximiser tout mon potentiel en m’entrainant d’arrachepied.\n$@c{smile}C’est fou tout le temps que tu peux te dégager si tu dors pas en sacrifiant ta vie sociale.\n$@c{serious_mopen_fists}Plus rien n’a d’importance désormais, pas tant que j’aurai pas gagné.\n$@c{neutral_eclosed}J’ai atteint un stade où je ne peux plus perdre.\n@c{smile_eclosed}Je présume que ta philosophie était pas si fausse finalement.\n$@c{angry_mhalf}La défaite, c’est pour les faibles, et je ne suis plus un faible.\n$@c{serious_mopen_fists}Tiens-toi prête." }, "victory": { "1": "@c{neutral}Que…@d{64} Qui es-tu ?" @@ -597,7 +687,7 @@ }, "rival_6": { "encounter": { - "1": "@c{smile_eclosed}Nous y revoilà.\n$@c{neutral}J’ai eu du temps pour réfléchir à tout ça.\nIl y a une raison à pourquoi tout semble étrange.\n$@c{neutral_eclosed}Ton rêve, ma volonté de te battre…\nFont partie de quelque chose de plus grand.\n$@c{serious}C’est même pas à propos de moi, ni de toi… Mais du monde, @c{serious_mhalf_fists}et te repousser dans tes limites est ma mission.\n$@c{neutral_eclosed}J’ignore si je serai capable de l’accomplir, mais je ferai tout ce qui est en mon pouvoir.\n$@c{neutral}Cet endroit est terrifiant… Et pourtant il m’a l’air familier, comme si j’y avais déjà mis les pieds.\n$@c{serious_mhalf_fists}Tu ressens la même chose, pas vrai ?\n$@c{serious}… et c’est comme si quelque chose ici me parlait.\n$Comme si c’était tout ce que ce monde avait toujours connu.\n$Ces précieux moments ensemble semblent si proches ne sont rien de plus qu’un lointain souvenir.\n$@c{neutral_eclosed}D’ailleurs, qui peut dire aujourd’hui qu’ils ont pu être réels ?\n$@c{serious_mopen_fists}Il faut que tu persévères. Si tu t’arrêtes, ça n’aura jamais de fin et t’es le seul à en être capable.\n$@c{serious_smile_fists}Difficile de comprendre le sens de tout ça, je sais juste que c’est la réalité.\n$@c{serious_mopen_fists}Si tu ne parviens pas à me battre ici et maintenant, tu n’as aucune chance." + "1": "@c{smile_eclosed}Nous y revoilà.\n$@c{neutral}J’ai eu du temps pour réfléchir à tout ça.\nIl y a une raison à pourquoi tout semble étrange.\n$@c{neutral_eclosed}Ton rêve, ma volonté de te battre…\nFont partie de quelque chose de plus grand.\n$@c{serious}C’est même pas à propos de moi, ni de toi… Mais du monde, @c{serious_mhalf_fists}et te repousser dans tes limites est ma mission.\n$@c{neutral_eclosed}J’ignore si je serai capable de l’accomplir, mais je ferai tout ce qui est en mon pouvoir.\n$@c{neutral}Cet endroit est terrifiant… Et pourtant il m’a l’air familier, comme si j’y avais déjà mis les pieds.\n$@c{serious_mhalf_fists}Tu ressens la même chose, pas vrai ?\n$@c{serious}… et c’est comme si quelque chose ici me parlait.\n$Comme si c’était tout ce que ce monde avait toujours connu.\n$Ces précieux moments ensemble semblent si proches ne sont rien de plus qu’un lointain souvenir.\n$@c{neutral_eclosed}D’ailleurs, qui peut dire aujourd’hui qu’ils ont pu être réels ?\n$@c{serious_mopen_fists}Il faut que tu persévères. Si tu t’arrêtes, ça n’aura jamais de fin et t’es la seule à en être capable.\n$@c{serious_smile_fists}Difficile de comprendre le sens de tout ça, je sais juste que c’est la réalité.\n$@c{serious_mopen_fists}Si tu ne parviens pas à me battre ici et maintenant, tu n’as aucune chance." }, "victory": { "1": "@c{smile_eclosed}J’ai fait ce que j’avais à faire.\n$Promets-moi juste une chose.\n@c{smile}Après avoir réparé ce monde… Rentre à la maison." diff --git a/src/locales/fr/menu-ui-handler.json b/src/locales/fr/menu-ui-handler.json index 807b34f1315..b8627bf91b5 100644 --- a/src/locales/fr/menu-ui-handler.json +++ b/src/locales/fr/menu-ui-handler.json @@ -25,5 +25,6 @@ "unlinkGoogle": "Délier Google", "cancel": "Retour", "losingProgressionWarning": "Vous allez perdre votre progression depuis le début du combat. Continuer ?", - "noEggs": "Vous ne faites actuellement\néclore aucun Œuf !" -} \ No newline at end of file + "noEggs": "Vous ne faites actuellement\néclore aucun Œuf !", + "donate": "Faire un don" +} diff --git a/src/locales/fr/modifier-type.json b/src/locales/fr/modifier-type.json index 935deeb5f62..509a8b11112 100644 --- a/src/locales/fr/modifier-type.json +++ b/src/locales/fr/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "Double les chances de tomber sur un combat double pendant {{battleCount}} combats." }, - "TempBattleStatBoosterModifierType": { - "description": "Augmente d’un cran {{tempBattleStatName}} pour toute l’équipe pendant 5 combats." + "TempStatStageBoosterModifierType": { + "description": "Augmente d’un cran {{stat}} pour toute l’équipe pendant 5 combats." }, "AttackTypeBoosterModifierType": { "description": "Augmente de 20% la puissance des capacités de type {{moveType}} d’un Pokémon." @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "Fait monter toute l’équipe de {{levels}} niveau·x." }, - "PokemonBaseStatBoosterModifierType": { - "description": "Augmente de 10% {{statName}} de base de son porteur. Plus les IV sont hauts, plus il peut en porter." + "BaseStatBoosterModifierType": { + "description": "Augmente de 10% {{stat}} de base de son porteur. Plus les IV sont hauts, plus il peut en porter." }, "AllPokemonFullHpRestoreModifierType": { "description": "Restaure tous les PV de toute l’équipe." @@ -183,6 +183,7 @@ "SOOTHE_BELL": { "name": "Grelot Zen" }, "SCOPE_LENS": { "name": "Lentilscope", "description": "Une lentille qui augmente d’un cran le taux de critiques du porteur." }, + "DIRE_HIT": { "name": "Muscle +", "extra": { "raises": "Taux de critique" } }, "LEEK": { "name": "Poireau", "description": "À faire tenir à Canarticho ou Palarticho. Un poireau très long et solide qui augmente de 2 crans le taux de critiques." }, "EVIOLITE": { "name": "Évoluroc", "description": "Augmente de 50% la Défense et Déf. Spé. si le porteur peut évoluer, 25% aux fusions dont une moitié le peut encore." }, @@ -250,28 +251,14 @@ "METAL_POWDER": { "name": "Poudre Métal", "description": "À faire tenir à Métamorph. Cette poudre étrange, très fine mais résistante, double sa Défense." }, "QUICK_POWDER": { "name": "Poudre Vite", "description": "À faire tenir à Métamorph. Cette poudre étrange, très fine mais résistante, double sa Vitesse." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "Attaque +", "x_defense": "Défense +", "x_sp_atk": "Atq. Spé. +", "x_sp_def": "Déf. Spé. +", "x_speed": "Vitesse +", - "x_accuracy": "Précision +", - "dire_hit": "Muscle +" + "x_accuracy": "Précision +" }, - - "TempBattleStatBoosterStatName": { - "ATK": "l’Attaque", - "DEF": "la Défense", - "SPATK": "l’Atq. Spé.", - "SPDEF": "la Déf. Spé.", - "SPD": "la Vitesse", - "ACC": "la précision", - "CRIT": "le taux de critique", - "EVA": "l’esquive", - "DEFAULT": "???" - }, - "AttackTypeBoosterItem": { "silk_scarf": "Mouchoir Soie", "black_belt": "Ceinture Noire", diff --git a/src/locales/fr/modifier.json b/src/locales/fr/modifier.json index 8a15c9e5ddf..0ec228a22c2 100644 --- a/src/locales/fr/modifier.json +++ b/src/locales/fr/modifier.json @@ -3,7 +3,7 @@ "turnHealApply": "Les PV de {{pokemonNameWithAffix}}\nsont un peu restaurés par les {{typeName}} !", "hitHealApply": "Les PV de {{pokemonNameWithAffix}}\nsont un peu restaurés par le {{typeName}} !", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}} a repris connaissance\navec sa {{typeName}} et est prêt à se battre de nouveau !", - "pokemonResetNegativeStatStageApply": "Les stats baissées de {{pokemonNameWithAffix}}\nsont restaurées par l’{{typeName}} !", + "resetNegativeStatStageApply": "Les stats baissées de {{pokemonNameWithAffix}}\nsont restaurées par l’{{typeName}} !", "moneyInterestApply": "La {{typeName}} vous rapporte\n{{moneyAmount}} ₽ d’intérêts !", "turnHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} est absorbé·e\npar le {{typeName}} de {{pokemonName}} !", "contactHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} est volé·e\npar l’{{typeName}} de {{pokemonName}} !", diff --git a/src/locales/fr/move-trigger.json b/src/locales/fr/move-trigger.json index 5c814745a8e..b9bc929c619 100644 --- a/src/locales/fr/move-trigger.json +++ b/src/locales/fr/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}} sacrifie des PV\net augmente la puissance ses capacités !", "absorbedElectricity": "{{pokemonName}} absorbe de l’électricité !", "switchedStatChanges": "{{pokemonName}} permute\nles changements de stats avec ceux de sa cible !", + "switchedTwoStatChanges": "{{pokemonName}} permute les changements de {{firstStat} et de {{secondStat}} avec ceux de sa cible !", + "switchedStat": "{{pokemonName}} et sa cible échangent leur {{stat}} !", + "sharedGuard": "{{pokemonName}} additionne sa garde à celle de sa cible et redistribue le tout équitablement !", + "sharedPower": "{{pokemonName}} additionne sa force à celle de sa cible et redistribue le tout équitablement !", "goingAllOutForAttack": "{{pokemonName}} a pris\ncette capacité au sérieux !", "regainedHealth": "{{pokemonName}}\nrécupère des PV !", "keptGoingAndCrashed": "{{pokemonName}}\ns’écrase au sol !", diff --git a/src/locales/fr/settings.json b/src/locales/fr/settings.json index 181a593cc99..c752b336b6e 100644 --- a/src/locales/fr/settings.json +++ b/src/locales/fr/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "Déplacer les contrôles tactiles", "shopOverlayOpacity": "Opacité boutique", "shopCursorTarget": "Choix après relance", - "items": "Obj. gratuits", + "rewards": "Obj. gratuits", "reroll": "Relance", "shop": "Boutique", "checkTeam": "Équipe" diff --git a/src/locales/it/achv.json b/src/locales/it/achv.json index 98e41005c46..d1607f6c548 100644 --- a/src/locales/it/achv.json +++ b/src/locales/it/achv.json @@ -80,7 +80,7 @@ "100_RIBBONS": { "name": "Campione Lega Assoluta" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "Lavoro di Squadra", "description": "Trasferisci almeno sei bonus statistiche tramite staffetta" }, @@ -261,4 +261,4 @@ "name": "Buona la prima!", "description": "Completa la modalità sfida 'Un nuovo inizio'." } -} \ No newline at end of file +} diff --git a/src/locales/it/arena-flyout.json b/src/locales/it/arena-flyout.json index ac6dd4225cc..31c2a4c0015 100644 --- a/src/locales/it/arena-flyout.json +++ b/src/locales/it/arena-flyout.json @@ -36,5 +36,6 @@ "matBlock": "Ribaltappeto", "craftyShield": "Truccodifesa", "tailwind": "Ventoincoda", - "happyHour": "Cuccagna" -} \ No newline at end of file + "happyHour": "Cuccagna", + "safeguard": "Salvaguardia" +} diff --git a/src/locales/it/modifier-type.json b/src/locales/it/modifier-type.json index b466e5bb9a3..99c06bb2038 100644 --- a/src/locales/it/modifier-type.json +++ b/src/locales/it/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "Raddoppia la possibilità di imbattersi in doppie battaglie per {{battleCount}} battaglie." }, - "TempBattleStatBoosterModifierType": { - "description": "Aumenta {{tempBattleStatName}} di un livello a tutti i Pokémon nel gruppo per 5 battaglie." + "TempStatStageBoosterModifierType": { + "description": "Aumenta la statistica {{stat}} di un livello\na tutti i Pokémon nel gruppo per 5 battaglie." }, "AttackTypeBoosterModifierType": { "description": "Aumenta la potenza delle mosse di tipo {{moveType}} del 20% per un Pokémon." @@ -59,10 +59,10 @@ "description": "Aumenta il livello di un Pokémon di {{levels}}." }, "AllPokemonLevelIncrementModifierType": { - "description": "Aumenta i livell di tutti i Pokémon della squadra di {{levels}}." + "description": "Aumenta il livello di tutti i Pokémon della squadra di {{levels}}." }, - "PokemonBaseStatBoosterModifierType": { - "description": "Aumenta {{statName}} di base del possessore del 10%." + "BaseStatBoosterModifierType": { + "description": "Aumenta l'/la {{stat}} di base del possessore del 10%." }, "AllPokemonFullHpRestoreModifierType": { "description": "Restituisce il 100% dei PS a tutti i Pokémon." @@ -248,6 +248,12 @@ "name": "Mirino", "description": "Lente che aumenta la probabilità di sferrare brutti colpi." }, + "DIRE_HIT": { + "name": "Supercolpo", + "extra": { + "raises": "Tasso di brutti colpi" + } + }, "LEEK": { "name": "Porro", "description": "Strumento da dare a Farfetch'd. Lungo gambo di porro che aumenta la probabilità di sferrare brutti colpi." @@ -411,25 +417,13 @@ "description": "Strumento da dare a Ditto. Questa strana polvere, fine e al contempo dura, aumenta la Velocità." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "Attacco X", "x_defense": "Difesa X", "x_sp_atk": "Att. Speciale X", "x_sp_def": "Dif. Speciale X", "x_speed": "Velocità X", - "x_accuracy": "Precisione X", - "dire_hit": "Supercolpo" - }, - "TempBattleStatBoosterStatName": { - "ATK": "Attacco", - "DEF": "Difesa", - "SPATK": "Att. Speciale", - "SPDEF": "Dif. Speciale", - "SPD": "Velocità", - "ACC": "Precisione", - "CRIT": "Tasso di brutti colpi", - "EVA": "Elusione", - "DEFAULT": "???" + "x_accuracy": "Precisione X" }, "AttackTypeBoosterItem": { "silk_scarf": "Sciarpa seta", @@ -606,4 +600,4 @@ "FAIRY_MEMORY": "ROM Folletto", "NORMAL_MEMORY": "ROM Normale" } -} \ No newline at end of file +} diff --git a/src/locales/it/modifier.json b/src/locales/it/modifier.json index 397a1f21f9a..c42bf04bc8a 100644 --- a/src/locales/it/modifier.json +++ b/src/locales/it/modifier.json @@ -3,7 +3,7 @@ "turnHealApply": "{{pokemonNameWithAffix}} recupera alcuni PS con\nil/la suo/a {{typeName}}!", "hitHealApply": "{{pokemonNameWithAffix}} recupera alcuni PS con\nil/la suo/a {{typeName}}!", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}} torna in forze\ngrazie al/alla suo/a {{typeName}}!", - "pokemonResetNegativeStatStageApply": "La riduzione alle statistiche di {{pokemonNameWithAffix}}\nviene annullata grazie al/alla suo/a {{typeName}}!", + "resetNegativeStatStageApply": "La riduzione alle statistiche di {{pokemonNameWithAffix}}\nviene annullata grazie al/alla suo/a {{typeName}}!", "moneyInterestApply": "Ricevi un interesse pari a {{moneyAmount}}₽\ngrazie al/allo/a {{typeName}}!", "turnHeldItemTransferApply": "Il/l'/lo/la {{itemName}} di {{pokemonNameWithAffix}} è stato assorbito\ndal {{typeName}} di {{pokemonName}}!", "contactHeldItemTransferApply": "Il/l'/lo/la {{itemName}} di {{pokemonNameWithAffix}} è stato rubato\nda {{pokemonName}} con {{typeName}}!", diff --git a/src/locales/it/move-trigger.json b/src/locales/it/move-trigger.json index 58b7b1a4c5b..785972b90f9 100644 --- a/src/locales/it/move-trigger.json +++ b/src/locales/it/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}} riduce i suoi PS per potenziare la sua mossa!", "absorbedElectricity": "{{pokemonName}} assorbe elettricità!", "switchedStatChanges": "{{pokemonName}} scambia con il bersaglio le modifiche alle statistiche!", + "switchedTwoStatChanges": "{{pokemonName}} scambia con il bersaglio le modifiche a {{firstStat}} e {{secondStat}}!", + "switchedStat": "{{pokemonName}} scambia la sua {{stat}} con quella del bersaglio!", + "sharedGuard": "{{pokemonName}} somma le sue capacità difensive con quelle del bersaglio e le ripartisce equamente!", + "sharedPower": "{{pokemonName}} somma le sue capacità offensive con quelle del bersaglio e le ripartisce equamente!", "goingAllOutForAttack": "{{pokemonName}} fa sul serio!", "regainedHealth": "{{pokemonName}} s'è\nripreso!", "keptGoingAndCrashed": "{{pokemonName}} si sbilancia e\nsi schianta!", diff --git a/src/locales/it/settings.json b/src/locales/it/settings.json index 381503f21bd..c09f5e22d4d 100644 --- a/src/locales/it/settings.json +++ b/src/locales/it/settings.json @@ -8,7 +8,7 @@ "moveTouchControls": "Move Touch Controls", "shopOverlayOpacity": "Opacità Finestra Negozio", "shopCursorTarget": "Target Cursore Negozio", - "items": "Oggetti", + "rewards": "Oggetti", "reroll": "Rerolla", "shop": "Negozio", "checkTeam": "Squadra" diff --git a/src/locales/ja/achv.json b/src/locales/ja/achv.json index 809375e5c7e..fd5e4b9e6c4 100644 --- a/src/locales/ja/achv.json +++ b/src/locales/ja/achv.json @@ -37,7 +37,7 @@ "name_female": "ワンパンウーマン" }, "HealAchv": { - "description": "一つの 技や 特性や 持っているアイテムで\n{{healAmount}}{{HP}}を 一気に 回復する" + "description": "一つの 技や 特性や 持たせたアイテムで\n{{HP}}{{healAmount}}を 一気に 回復する" }, "250_HEAL": { "name": "回復発見者" @@ -52,7 +52,7 @@ "name": "ジョーイさん" }, "LevelAchv": { - "description": "一つの ポケモンを Lv{{level}}まで レベルアップする" + "description": "一つの ポケモンを Lv.{{level}}まで 上げる" }, "LV_100": { "name": "まだまだだよ" @@ -81,8 +81,8 @@ "100_RIBBONS": { "name": "マスターリーグチャンピオン" }, - "TRANSFER_MAX_BATTLE_STAT": { - "name": "同力", + "TRANSFER_MAX_STAT_STAGE": { + "name": "連係プレー", "description": "少なくとも 一つの 能力を 最大まで あげて\n他の 手持ちポケモンに バトンタッチする" }, "MAX_FRIENDSHIP": { @@ -94,7 +94,7 @@ "description": "一つの 手持ちポケモンを メガシンカさせる" }, "GIGANTAMAX": { - "name": "太―くて 堪らない", + "name": "太ーくて堪らない", "description": "一つの 手持ちポケモンを キョダイマックスさせる" }, "TERASTALLIZE": { @@ -106,7 +106,7 @@ "description": "一つの 手持ちポケモンを ステラ・テラスタルさせる" }, "SPLICE": { - "name": "インフィニット・フュジョン", + "name": "インフィニット・フュージョン", "description": "遺伝子のくさびで 二つの ポケモンを 吸収合体させる" }, "MINI_BLACK_HOLE": { @@ -205,7 +205,7 @@ "description": "{{type}}タイプの 単一タイプチャレンジを クリアする" }, "MONO_NORMAL": { - "name": "凡人" + "name": "超凡人" }, "MONO_FIGHTING": { "name": "八千以上だ!!" @@ -223,7 +223,7 @@ "name": "タケシの挑戦状" }, "MONO_BUG": { - "name": "チョウチョウせん者" + "name": "チョウチョウ戦者" }, "MONO_GHOST": { "name": "貞子ちゃん" diff --git a/src/locales/ja/arena-flyout.json b/src/locales/ja/arena-flyout.json index 9e26dfeeb6e..fa29b4567c5 100644 --- a/src/locales/ja/arena-flyout.json +++ b/src/locales/ja/arena-flyout.json @@ -1 +1,43 @@ -{} \ No newline at end of file +{ + "activeBattleEffects": "場の効果", + "player": "味方", + "neutral": "場の全員", + "enemy": "相手", + + "sunny": "晴れ", + "rain": "雨", + "sandstorm": "砂あらし", + "hail": "あられ", + "snow": "雪", + "fog": "きり", + "heavyRain": "強い雨", + "harshSun": "大日照り", + "strongWinds": "乱気流", + + "misty": "ミストフィールド", + "electric": "エレキフィールド", + "grassy": "グラスフィールド", + "psychic": "サイコフィールド", + + "mudSport": "どろあそび", + "waterSport": "みずあそび", + "spikes": "まきびし", + "toxicSpikes": "どくびし", + "mist": "しろいきり", + "futureSight": "みらいよち", + "doomDesire": "はめつのねがい", + "wish": "ねがいごと", + "stealthRock": "ステルスロック", + "stickyWeb": "ねばねばネット", + "trickRoom": "トリックルーム", + "gravity": "じゅうりょく", + "reflect": "リフレクター", + "lightScreen": "ひかりのかべ", + "auroraVeil": "オーロラベール", + "quickGuard": "ファストガード", + "wideGuard": "ワイドガード", + "matBlock": "たたみがえし", + "craftyShield": "トリックガード", + "tailwind": "おいかぜ", + "happyHour": "ハッピータイム" +} diff --git a/src/locales/ja/bgm-name.json b/src/locales/ja/bgm-name.json index 9e26dfeeb6e..8838942c8a6 100644 --- a/src/locales/ja/bgm-name.json +++ b/src/locales/ja/bgm-name.json @@ -1 +1,150 @@ -{} \ No newline at end of file +{ + "music": "Music: ", + "missing_entries": "{{name}}", + "battle_kanto_champion": "B2W2 Kanto Champion Battle", + "battle_johto_champion": "B2W2 Johto Champion Battle", + "battle_hoenn_champion_g5": "B2W2 Hoenn Champion Battle", + "battle_hoenn_champion_g6": "ORAS Hoenn Champion Battle", + "battle_sinnoh_champion": "B2W2 Sinnoh Champion Battle", + "battle_champion_alder": "BW Unova Champion Battle", + "battle_champion_iris": "B2W2 Unova Champion Battle", + "battle_kalos_champion": "XY Kalos Champion Battle", + "battle_alola_champion": "USUM Alola Champion Battle", + "battle_galar_champion": "SWSH Galar Champion Battle", + "battle_champion_geeta": "SV Champion Geeta Battle", + "battle_champion_nemona": "SV Champion Nemona Battle", + "battle_champion_kieran": "SV Champion Kieran Battle", + "battle_hoenn_elite": "ORAS Elite Four Battle", + "battle_unova_elite": "BW Elite Four Battle", + "battle_kalos_elite": "XY Elite Four Battle", + "battle_alola_elite": "SM Elite Four Battle", + "battle_galar_elite": "SWSH League Tournament Battle", + "battle_paldea_elite": "SV Elite Four Battle", + "battle_bb_elite": "SV BB League Elite Four Battle", + "battle_final_encounter": "PMD RTDX Rayquaza's Domain", + "battle_final": "BW Ghetsis Battle", + "battle_kanto_gym": "B2W2 Kanto Gym Battle", + "battle_johto_gym": "B2W2 Johto Gym Battle", + "battle_hoenn_gym": "B2W2 Hoenn Gym Battle", + "battle_sinnoh_gym": "B2W2 Sinnoh Gym Battle", + "battle_unova_gym": "BW Unova Gym Battle", + "battle_kalos_gym": "XY Kalos Gym Battle", + "battle_galar_gym": "SWSH Galar Gym Battle", + "battle_paldea_gym": "SV Paldea Gym Battle", + "battle_legendary_kanto": "XY Kanto Legendary Battle", + "battle_legendary_raikou": "HGSS Raikou Battle", + "battle_legendary_entei": "HGSS Entei Battle", + "battle_legendary_suicune": "HGSS Suicune Battle", + "battle_legendary_lugia": "HGSS Lugia Battle", + "battle_legendary_ho_oh": "HGSS Ho-oh Battle", + "battle_legendary_regis_g5": "B2W2 Legendary Titan Battle", + "battle_legendary_regis_g6": "ORAS Legendary Titan Battle", + "battle_legendary_gro_kyo": "ORAS Groudon & Kyogre Battle", + "battle_legendary_rayquaza": "ORAS Rayquaza Battle", + "battle_legendary_deoxys": "ORAS Deoxys Battle", + "battle_legendary_lake_trio": "ORAS Lake Guardians Battle", + "battle_legendary_sinnoh": "ORAS Sinnoh Legendary Battle", + "battle_legendary_dia_pal": "ORAS Dialga & Palkia Battle", + "battle_legendary_origin_forme": "LA Origin Dialga & Palkia Battle", + "battle_legendary_giratina": "ORAS Giratina Battle", + "battle_legendary_arceus": "HGSS Arceus Battle", + "battle_legendary_unova": "BW Unova Legendary Battle", + "battle_legendary_kyurem": "BW Kyurem Battle", + "battle_legendary_res_zek": "BW Reshiram & Zekrom Battle", + "battle_legendary_xern_yvel": "XY Xerneas & Yveltal Battle", + "battle_legendary_tapu": "SM Tapu Battle", + "battle_legendary_sol_lun": "SM Solgaleo & Lunala Battle", + "battle_legendary_ub": "SM Ultra Beast Battle", + "battle_legendary_dusk_dawn": "USUM Dusk Mane & Dawn Wings Necrozma Battle", + "battle_legendary_ultra_nec": "USUM Ultra Necrozma Battle", + "battle_legendary_zac_zam": "SWSH Zacian & Zamazenta Battle", + "battle_legendary_glas_spec": "SWSH Glastrier & Spectrier Battle", + "battle_legendary_calyrex": "SWSH Calyrex Battle", + "battle_legendary_riders": "SWSH Ice & Shadow Rider Calyrex Battle", + "battle_legendary_birds_galar": "SWSH Galarian Legendary Birds Battle", + "battle_legendary_ruinous": "SV Treasures of Ruin Battle", + "battle_legendary_kor_mir": "SV Depths of Area Zero Battle", + "battle_legendary_loyal_three": "SV Loyal Three Battle", + "battle_legendary_ogerpon": "SV Ogerpon Battle", + "battle_legendary_terapagos": "SV Terapagos Battle", + "battle_legendary_pecharunt": "SV Pecharunt Battle", + "battle_rival": "BW Rival Battle", + "battle_rival_2": "BW N Battle", + "battle_rival_3": "BW Final N Battle", + "battle_trainer": "BW Trainer Battle", + "battle_wild": "BW Wild Battle", + "battle_wild_strong": "BW Strong Wild Battle", + "end_summit": "PMD RTDX Sky Tower Summit", + "battle_rocket_grunt": "HGSS Team Rocket Battle", + "battle_aqua_magma_grunt": "ORAS Team Aqua & Magma Battle", + "battle_galactic_grunt": "BDSP Team Galactic Battle", + "battle_plasma_grunt": "BW Team Plasma Battle", + "battle_flare_grunt": "XY Team Flare Battle", + "battle_aether_grunt": "SM Aether Foundation Battle", + "battle_skull_grunt": "SM Team Skull Battle", + "battle_macro_grunt": "SWSH Trainer Battle", + "battle_galactic_admin": "BDSP Team Galactic Admin Battle", + "battle_skull_admin": "SM Team Skull Admin Battle", + "battle_oleana": "SWSH Oleana Battle", + "battle_rocket_boss": "USUM Giovanni Battle", + "battle_aqua_magma_boss": "ORAS Archie & Maxie Battle", + "battle_galactic_boss": "BDSP Cyrus Battle", + "battle_plasma_boss": "B2W2 Ghetsis Battle", + "battle_flare_boss": "XY Lysandre Battle", + "battle_aether_boss": "SM Lusamine Battle", + "battle_skull_boss": "SM Guzma Battle", + "battle_macro_boss": "SWSH Rose Battle", + + "abyss": "PMD EoS Dark Crater", + "badlands": "PMD EoS Barren Valley", + "beach": "PMD EoS Drenched Bluff", + "cave": "PMD EoS Sky Peak Cave", + "construction_site": "PMD EoS Boulder Quarry", + "desert": "PMD EoS Northern Desert", + "dojo": "PMD EoS Marowak Dojo", + "end": "PMD RTDX Sky Tower", + "factory": "PMD EoS Concealed Ruins", + "fairy_cave": "PMD EoS Star Cave", + "forest": "PMD EoS Dusk Forest", + "grass": "PMD EoS Apple Woods", + "graveyard": "PMD EoS Mystifying Forest", + "ice_cave": "PMD EoS Vast Ice Mountain", + "island": "PMD EoS Craggy Coast", + "jungle": "Lmz - Jungle", + "laboratory": "Firel - Laboratory", + "lake": "PMD EoS Crystal Cave", + "meadow": "PMD EoS Sky Peak Forest", + "metropolis": "Firel - Metropolis", + "mountain": "PMD EoS Mt. Horn", + "plains": "PMD EoS Sky Peak Prairie", + "power_plant": "PMD EoS Far Amp Plains", + "ruins": "PMD EoS Deep Sealed Ruin", + "sea": "Andr06 - Marine Mystique", + "seabed": "Firel - Seabed", + "slum": "Andr06 - Sneaky Snom", + "snowy_forest": "PMD EoS Sky Peak Snowfield", + "space": "Firel - Aether", + "swamp": "PMD EoS Surrounded Sea", + "tall_grass": "PMD EoS Foggy Forest", + "temple": "PMD EoS Aegis Cave", + "town": "PMD EoS Random Dungeon Theme 3", + "volcano": "PMD EoS Steam Cave", + "wasteland": "PMD EoS Hidden Highland", + "encounter_ace_trainer": "BW Trainers' Eyes Meet (Ace Trainer)", + "encounter_backpacker": "BW Trainers' Eyes Meet (Backpacker)", + "encounter_clerk": "BW Trainers' Eyes Meet (Clerk)", + "encounter_cyclist": "BW Trainers' Eyes Meet (Cyclist)", + "encounter_lass": "BW Trainers' Eyes Meet (Lass)", + "encounter_parasol_lady": "BW Trainers' Eyes Meet (Parasol Lady)", + "encounter_pokefan": "BW Trainers' Eyes Meet (Poke Fan)", + "encounter_psychic": "BW Trainers' Eyes Meet (Psychic)", + "encounter_rich": "BW Trainers' Eyes Meet (Gentleman)", + "encounter_rival": "BW Cheren", + "encounter_roughneck": "BW Trainers' Eyes Meet (Roughneck)", + "encounter_scientist": "BW Trainers' Eyes Meet (Scientist)", + "encounter_twins": "BW Trainers' Eyes Meet (Twins)", + "encounter_youngster": "BW Trainers' Eyes Meet (Youngster)", + "heal": "BW Pokémon Heal", + "menu": "PMD EoS Welcome to the World of Pokémon!", + "title": "PMD EoS Top Menu Theme" +} diff --git a/src/locales/ja/challenges.json b/src/locales/ja/challenges.json index 99c6e978d49..d137df14086 100644 --- a/src/locales/ja/challenges.json +++ b/src/locales/ja/challenges.json @@ -1,5 +1,5 @@ { - "title": "チャレンジを 設定", + "title": "チャレンジの設定", "illegalEvolution": "{{pokemon}}は このチャレンジで\n対象外の ポケモンに なってしまった!", "singleGeneration": { "name": "単一世代", diff --git a/src/locales/ja/common.json b/src/locales/ja/common.json index 9e26dfeeb6e..d10e3e42c70 100644 --- a/src/locales/ja/common.json +++ b/src/locales/ja/common.json @@ -1 +1,8 @@ -{} \ No newline at end of file +{ + "start": "スタート", + "luckIndicator": "運:", + "shinyOnHover": "色違い", + "commonShiny": "ふつう", + "rareShiny": "レア", + "epicShiny": "超レア" +} diff --git a/src/locales/ja/dialogue-double-battle.json b/src/locales/ja/dialogue-double-battle.json index 9e26dfeeb6e..b2632f3b990 100644 --- a/src/locales/ja/dialogue-double-battle.json +++ b/src/locales/ja/dialogue-double-battle.json @@ -1 +1,84 @@ -{} \ No newline at end of file +{ + "blue_red_double": { + "encounter": { + "1": "Blue: Hey Red, let's show them what we're made of!\n$Red: ...\n$Blue: This is Pallet Town Power!" + }, + "victory": { + "1": "Blue: That was a great battle!\n$Red: ..." + } + }, + "red_blue_double": { + "encounter": { + "1": "Red: ...!\n$Blue: He never talks much.\n$Blue: But dont let that fool you! He is a champ after all!" + }, + "victory": { + "1": "Red: ...!\n$Blue: Next time we will beat you!" + } + }, + "tate_liza_double": { + "encounter": { + "1": "Tate: Are you surprised?\n$Liza: We are two gym leaders at once!\n$Tate: We are twins!\n$Liza: We dont need to talk to understand each other!\n$Tate: Twice the power...\n$Liza: Can you handle it?" + }, + "victory": { + "1": "Tate: What? Our combination was perfect!\n$Liza: Looks like we need to train more..." + } + }, + "liza_tate_double": { + "encounter": { + "1": "Liza: Hihihi... Are you surprised?\n$Tate: Yes, we are really two gym leaders at once!\n$Liza: This is my twin brother Tate!\n$Tate: And this is my twin sister Liza!\n$Liza: Don't you think we are a perfect combination?" + }, + "victory": { + "1": "Liza: Are we...\n$Tate: ...not as strong as we thought?" + } + }, + "wallace_steven_double": { + "encounter": { + "1": "Steven: Wallace, let's show them the power of the champions!\n$Wallace: We will show you the power of Hoenn!\n$Steven: Let's go!" + }, + "victory": { + "1": "Steven: That was a great battle!\n$Wallace: We will win next time!" + } + }, + "steven_wallace_double": { + "encounter": { + "1": "Steven: Do you have any rare Pokémon?\n$Wallace: Steven... We are here for a battle, not to show off our Pokémon.\n$Steven: Oh... I see... Let's go then!" + }, + "victory": { + "1": "Steven: Now that we are done with the battle, let's show off our Pokémon!\n$Wallace: Steven..." + } + }, + "alder_iris_double": { + "encounter": { + "1": "Alder: We are the strongest trainers in Unova!\n$Iris: Fights against strong trainers are the best!" + }, + "victory": { + "1": "Alder: Wow! You are super strong!\n$Iris: We will win next time!" + } + }, + "iris_alder_double": { + "encounter": { + "1": "Iris: Welcome Challenger! I am THE Unova Champion!\n$Alder: Iris, aren't you a bit too excited?", + "1_female": "Iris: Welcome Challenger! I am THE Unova Champion!\n$Alder: Iris, aren't you a bit too excited?" + }, + "victory": { + "1": "Iris: A loss like this is not easy to take...\n$Alder: But we will only get stronger with every loss!" + } + }, + "piers_marnie_double": { + "encounter": { + "1": "Marnie: Brother, let's show them the power of Spikemuth!\n$Piers: We bring darkness!" + }, + "victory": { + "1": "Marnie: You brought light to our darkness!\n$Piers: Its too bright..." + } + }, + "marnie_piers_double": { + "encounter": { + "1": "Piers: Ready for a concert?\n$Marnie: Brother... They are here to fight, not to sing...", + "1_female": "Piers: Ready for a concert?\n$Marnie: Brother... They are here to fight, not to sing..." + }, + "victory": { + "1": "Piers: Now that was a great concert!\n$Marnie: Brother..." + } + } +} diff --git a/src/locales/ja/dialogue-final-boss.json b/src/locales/ja/dialogue-final-boss.json index 9e26dfeeb6e..f20d0f013d1 100644 --- a/src/locales/ja/dialogue-final-boss.json +++ b/src/locales/ja/dialogue-final-boss.json @@ -1 +1,10 @@ -{} \ No newline at end of file +{ + "encounter": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.", + "encounter_female": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.", + "firstStageWin": "I see. The presence I felt was indeed real.\nIt appears I no longer need to hold back.\n$Do not disappoint me.", + "secondStageWin": "…Magnificent.", + "key_ordinal_one": "st", + "key_ordinal_two": "nd", + "key_ordinal_few": "rd", + "key_ordinal_other": "th" +} diff --git a/src/locales/ja/dialogue-misc.json b/src/locales/ja/dialogue-misc.json index 9e26dfeeb6e..2f333b5f383 100644 --- a/src/locales/ja/dialogue-misc.json +++ b/src/locales/ja/dialogue-misc.json @@ -1 +1,6 @@ -{} \ No newline at end of file +{ + "ending": "@c{shock}You're back?@d{32} Does that mean…@d{96} you won?!\n@c{smile_ehalf}I should have known you had it in you.\n$@c{smile_eclosed}Of course… I always had that feeling.\n@c{smile}It's over now, right? You ended the loop.\n$@c{smile_ehalf}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$I'll be the only one to remember what you did.\n@c{angry_mopen}I'll try not to forget!\n$@c{smile_wave_wink}Just kidding!@d{64} @c{smile}I'd never forget.@d{32}\nYour legend will live on in our hearts.\n$@c{smile_wave}Anyway,@d{64} it's getting late…@d{96} I think?\nIt's hard to tell in this place.\n$Let's go home. @c{smile_wave_wink}Maybe tomorrow, we can have another battle, for old time's sake?", + "ending_female": "@c{smile}Oh? You won?@d{96} @c{smile_eclosed}I guess I should've known.\nBut, you're back now.\n$@c{smile}It's over.@d{64} You ended the loop.\n$@c{serious_smile_fists}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$@c{neutral}I'm the only one who'll remember what you did.@d{96}\nI guess that's okay, isn't it?\n$@c{serious_smile_fists}Your legend will always live on in our hearts.\n$@c{smile_eclosed}Anyway, I've had about enough of this place, haven't you? Let's head home.\n$@c{serious_smile_fists}Maybe when we get back, we can have another battle?\nIf you're up to it.", + "ending_endless": "Congratulations on reaching the current end!\nMore content is coming soon.", + "ending_name": "Devs" +} diff --git a/src/locales/ja/dialogue.json b/src/locales/ja/dialogue.json index 9e26dfeeb6e..6130ade1cb4 100644 --- a/src/locales/ja/dialogue.json +++ b/src/locales/ja/dialogue.json @@ -1 +1,2827 @@ -{} \ No newline at end of file +{ + "youngster": { + "encounter": { + "1": "よっ 勝負する?", + "2": "あっ 君も 駆け出し トレーナーだね?", + "2_female": "あっ きみも 駆け出し トレーナーだね?", + "3": "あっ 初めてみる 人! 勝負だ!", + "4": "さっき 負けて 悔しいから ポケモン 探してるんだよ。\nでも 君 弱そうだな…… よしっ! 勝負 しようぜ!", + "4_female": "さっき 負けて 悔しいから ポケモン 探してるんだよ。\nでも 君 弱そうだな…… よしっ! 勝負 しようぜ!", + "5": "お久しぶりかな? 初めましてかな?\n覚えてないけど ヨロシクね!", + "6": "よーし 行くぞー!", + "7": "よっしゃ 行っくぜー!\n僕の パワー 見せてやる!", + "8": "へへへ…… 見せて あげるね!\n僕の ポケモンの すごさを!", + "9": "挨拶 なんて よかよか! いつでも かかってきんしゃい!", + "9_female": "挨拶 なんて よかよか! いつでも かかってきんしゃい!", + "10": "小僧  だからって 油断してると\n君 泣いちゃう かもしれないよー.", + "11": "大事に 育てた ポケモンだぞー!\n絶対 倒しちゃ ダメなんだぞ!", + "12": "よく来たな!\nこっから 先は 一筋縄じゃ いかないぞ!", + "12_female": "よく来たな!\nこっから 先は 一筋縄じゃ いかないぞ!", + "13": "勝負は 続くよ! いつまでも!\n終わりなき 世界へ ようこそ!", + "13_female": "勝負は 続くよ!\nいつまでも! 終わりなき 世界へ ようこそ!" + }, + "victory": { + "1": "スゴッ! 君 強いんだ!", + "1_femal1e": "スゴッ! 君 強いんだ!", + "2": "敵わなかったね?", + "3": "僕 大きくなったら 絶対 君を 倒すよ!", + "4": "ゲッ 戦えるポケモン もう いない…", + "5": "トホ…… トホホーイ……\nまた 負けちゃったよ……", + "5_female": "トホ…… トホホーイ……\nまた 負けちゃったよ……", + "6": "うわー! 負けたー!!", + "7": "すごいな 君の パワーは!\nビックリで ドッキリだよ!", + "8": "そんな…… どうして……\n僕の ポケモンは サイキョー なのに……", + "9": "また バトルして くれよな!\n次は 負けないからな!", + "10": "も~! 僕は 小僧だけ だよ!\nそんな全力で 戦っちゃ ひどいぞ!", + "11": "君の ポケモンの 方が すごい!\n僕のと 交換しておくれよ!", + "12": "さっきは 勢いで 言ったけど\n一筋縄って どんな縄?", + "13": "あはは さすが! さすがだね!\nもう 君も この世界の 住人だ!" + } + }, + "lass": { + "encounter": { + "1": "Let's have a battle, shall we?", + "2": "You look like a new trainer. Let's have a battle!", + "2_female": "You look like a new trainer. Let's have a battle!", + "3": "I don't recognize you. How about a battle?", + "4": "Let's have a fun Pokémon battle!", + "5": "I'll show you the ropes of how to really use Pokémon!", + "6": "A serious battle starts from a serious beginning! Are you sure you're ready?", + "6_female": "A serious battle starts from a serious beginning! Are you sure you're ready?", + "7": "You're only young once. And you only get one shot at a given battle. Soon, you'll be nothing but a memory.", + "8": "You'd better go easy on me, OK? Though I'll be seriously fighting!", + "9": "School is boring. I've got nothing to do. Yawn. I'm only battling to kill the time." + }, + "victory": { + "1": "That was impressive! I've got a lot to learn.", + "2": "I didn't think you'd beat me that bad…", + "2_female": "I didn't think you'd beat me that bad…", + "3": "I hope we get to have a rematch some day.", + "4": "That was pretty amazingly fun! You've totally exhausted me…", + "5": "You actually taught me a lesson! You're pretty amazing!", + "6": "Seriously, I lost. That is, like, seriously depressing, but you were seriously cool.", + "6_female": "Seriously, I lost. That is, like, seriously depressing, but you were seriously cool.", + "7": "I don't need memories like this. Deleting memory…", + "8": "Hey! I told you to go easy on me! Still, you're pretty cool when you're serious.", + "8_female": "Hey! I told you to go easy on me! Still, you're pretty cool when you're serious.", + "9": "I'm actually getting tired of battling… There's gotta be something new to do…" + } + }, + "breeder": { + "encounter": { + "1": "Obedient Pokémon, selfish Pokémon… Pokémon have unique characteristics.", + "2": "Even though my upbringing and behavior are poor, I've raised my Pokémon well.", + "3": "Hmm, do you discipline your Pokémon? Pampering them too much is no good." + }, + "victory": { + "1": "It is important to nurture and train each Pokémon's characteristics.", + "2": "Unlike my diabolical self, these are some good Pokémon.", + "3": "Too much praise can spoil both Pokémon and people." + }, + "defeat": { + "1": "You should not get angry at your Pokémon, even if you lose a battle.", + "2": "Right? Pretty good Pokémon, huh? I'm suited to raising things.", + "3": "No matter how much you love your Pokémon, you still have to discipline them when they misbehave." + } + }, + "breeder_female": { + "encounter": { + "1": "Pokémon never betray you. They return all the love you give them.", + "2": "Shall I give you a tip for training good Pokémon?", + "3": "I have raised these very special Pokémon using a special method." + }, + "victory": { + "1": "Ugh… It wasn't supposed to be like this. Did I administer the wrong blend?", + "2": "How could that happen to my Pokémon… What are you feeding your Pokémon?", + "3": "If I lose, that tells you I was just killing time. It doesn't damage my ego at all." + }, + "defeat": { + "1": "This proves my Pokémon have accepted my love.", + "2": "The real trick behind training good Pokémon is catching good Pokémon.", + "3": "Pokémon will be strong or weak depending on how you raise them." + } + }, + "fisherman": { + "encounter": { + "1": "Aack! You made me lose a bite!\nWhat are you going to do about it?", + "2": "Go away! You're scaring the Pokémon!", + "3": "Let's see if you can reel in a victory!" + }, + "victory": { + "1": "Just forget about it.", + "2": "Next time, I'll be reelin' in the triumph!", + "3": "Guess I underestimated the currents this time." + } + }, + "fisherman_female": { + "encounter": { + "1": "Woah! I've hooked a big one!", + "2": "Line's in, ready to reel in success!", + "3": "Ready to make waves!" + }, + "victory": { + "1": "I'll be back with a stronger hook.", + "2": "I'll reel in victory next time.", + "3": "I'm just sharpening my hooks for the comeback!" + } + }, + "swimmer": { + "encounter": { + "1": "Time to dive in!", + "2": "Let's ride the waves of victory!", + "3": "Ready to make a splash!" + }, + "victory": { + "1": "Drenched in defeat!", + "2": "A wave of defeat!", + "3": "Back to shore, I guess." + } + }, + "backpacker": { + "encounter": { + "1": "Pack up, game on!", + "2": "Let's see if you can keep pace!", + "3": "Gear up, challenger!", + "4": "I've spent 20 years trying to find myself… But where am I?" + }, + "victory": { + "1": "Tripped up this time!", + "2": "Oh, I think I'm lost.", + "3": "Dead end!", + "4": "Wait up a second! Hey! Don't you know who I am?" + } + }, + "ace_trainer": { + "encounter": { + "1": "You seem quite confident.", + "1_female": "You seem quite confident.", + "2": "Your Pokémon… Show them to me…", + "3": "Because I'm an Ace Trainer, people think I'm strong.", + "4": "Are you aware of what it takes to be an Ace Trainer?" + }, + "victory": { + "1": "Yes… You have good Pokémon…", + "2": "What?! But I'm a battling genius!", + "3": "Of course, you are the main character!", + "3_female": "Of course, you are the main character!", + "4": "OK! OK! You could be an Ace Trainer!", + "4_female": "OK! OK! You could be an Ace Trainer!" + }, + "defeat": { + "1": "I am devoting my body and soul to Pokémon battles!", + "2": "All within my expectations… Nothing to be surprised about…", + "3": "I thought I'd grow up to be a frail person who looked like they would break if you squeezed them too hard.", + "4": "Of course I'm strong and don't lose. It's important that I win gracefully." + } + }, + "parasol_lady": { + "encounter": { + "1": "Time to grace the battlefield with elegance and poise!" + }, + "victory": { + "1": "My elegance remains unbroken!" + } + }, + "twins": { + "encounter": { + "1": "Get ready, because when we team up, it's double the trouble!", + "2": "Two hearts, one strategy – let's see if you can keep up with our twin power!", + "3": "Hope you're ready for double trouble, because we're about to bring the heat!", + "3_female": "Hope you're ready for double trouble, because we're about to bring the heat!" + }, + "victory": { + "1": "We may have lost this round, but our bond remains unbreakable!", + "2": "Our twin spirit won't be dimmed for long.", + "3": "We'll come back stronger as a dynamic duo!" + }, + "defeat": { + "1": "Twin power reigns supreme!", + "2": "Two hearts, one triumph!", + "3": "Double the smiles, double the victory dance!" + } + }, + "cyclist": { + "encounter": { + "1": "Get ready to eat my dust!", + "2": "Gear up, challenger! I'm about to leave you in the dust!", + "3": "Pedal to the metal, let's see if you can keep pace!" + }, + "victory": { + "1": "Spokes may be still, but determination pedals on.", + "2": "Outpaced!", + "3": "The road to victory has many twists and turns yet to explore." + } + }, + "black_belt": { + "encounter": { + "1": "I praise your courage in challenging me! For I am the one with the strongest kick!", + "2": "Oh, I see. Would you like to be cut to pieces? Or do you prefer the role of punching bag?", + "2_female": "Oh, I see. Would you like to be cut to pieces? Or do you prefer the role of punching bag?" + }, + "victory": { + "1": "Oh. The Pokémon did the fighting. My strong kick didn't help a bit.", + "2": "Hmmm… If I was going to lose anyway, I was hoping to get totally messed up in the process." + } + }, + "battle_girl": { + "encounter": { + "1": "You don't have to try to impress me. You can lose against me." + }, + "victory": { + "1": "It's hard to say good-bye, but we are running out of time…" + } + }, + "hiker": { + "encounter": { + "1": "My middle-age spread has given me as much gravitas as the mountains I hike!", + "2": "I inherited this big-boned body from my parents… I'm like a living mountain range…" + }, + "victory": { + "1": "At least I cannot lose when it comes to BMI!", + "2": "It's not enough… It's never enough. My bad cholesterol isn't high enough…" + } + }, + "ranger": { + "encounter": { + "1": "When I am surrounded by nature, most other things cease to matter.", + "2": "When I'm living without nature in my life, sometimes I'll suddenly feel an anxiety attack coming on." + }, + "victory": { + "1": "It doesn't matter to the vastness of nature whether I win or lose…", + "2": "Something like this is pretty trivial compared to the stifling feelings of city life." + }, + "defeat": { + "1": "I won the battle. But victory is nothing compared to the vastness of nature…", + "2": "I'm sure how you feel is not so bad if you compare it to my anxiety attacks…" + } + }, + "scientist": { + "encounter": { + "1": "My research will lead this world to peace and joy." + }, + "victory": { + "1": "I am a genius… I am not supposed to lose against someone like you…" + } + }, + "school_kid": { + "encounter": { + "1": "…Heehee. I'm confident in my calculations and analysis.", + "2": "I'm gaining as much experience as I can because I want to be a Gym Leader someday." + }, + "victory": { + "1": "Ohhhh… Calculation and analysis are perhaps no match for chance…", + "2": "Even difficult, trying experiences have their purpose, I suppose." + } + }, + "artist": { + "encounter": { + "1": "I used to be popular, but now I am all washed up." + }, + "victory": { + "1": "As times change, values also change. I realized that too late." + } + }, + "guitarist": { + "encounter": { + "1": "Get ready to feel the rhythm of defeat as I strum my way to victory!" + }, + "victory": { + "1": "Silenced for now, but my melody of resilience will play on." + } + }, + "worker": { + "encounter": { + "1": "It bothers me that people always misunderstand me. I'm a lot more pure than everyone thinks." + }, + "victory": { + "1": "I really don't want my skin to burn, so I want to stay in the shade while I work." + } + }, + "worker_female": { + "encounter": { + "1": "It bothers me that people always misunderstand me.\n$I'm a lot more pure than everyone thinks." + }, + "victory": { + "1": "I really don't want my skin to burn, so I want to stay in the shade while I work." + }, + "defeat": { + "1": "My body and mind aren't necessarily always in sync." + } + }, + "worker_double": { + "encounter": { + "1": "I'll show you we can break you. We've been training in the field!" + }, + "victory": { + "1": "How strange… How could this be… I shouldn't have been outmuscled." + } + }, + "hex_maniac": { + "encounter": { + "1": "I normally only ever listen to classical music, but if I lose, I think I shall try a bit of new age!", + "2": "I grow stronger with each tear I cry." + }, + "victory": { + "1": "Is this the dawning of the age of Aquarius?", + "2": "Now I can get even stronger. I grow with every grudge." + }, + "defeat": { + "1": "New age simply refers to twentieth century classical composers, right?", + "2": "Don't get hung up on sadness or frustration. You can use your grudges to motivate yourself.", + "2_female": "Don't get hung up on sadness or frustration. You can use your grudges to motivate yourself." + } + }, + "psychic": { + "encounter": { + "1": "Hi! Focus!" + }, + "victory": { + "1": "Eeeeek!" + } + }, + "officer": { + "encounter": { + "1": "Brace yourself, because justice is about to be served!", + "2": "Ready to uphold the law and serve justice on the battlefield!" + }, + "victory": { + "1": "The weight of justice feels heavier than ever…", + "2": "The shadows of defeat linger in the precinct." + } + }, + "beauty": { + "encounter": { + "1": "My last ever battle… That's the way I'd like us to view this match…" + }, + "victory": { + "1": "It's been fun… Let's have another last battle again someday…" + } + }, + "baker": { + "encounter": { + "1": "Hope you're ready to taste defeat!", + "1_female": "Hope you're ready to taste defeat!" + }, + "victory": { + "1": "I'll bake a comeback." + } + }, + "biker": { + "encounter": { + "1": "Time to rev up and leave you in the dust!" + }, + "victory": { + "1": "I'll tune up for the next race." + } + }, + "firebreather": { + "encounter": { + "1": "My flames shall devour you!", + "2": "My soul is on fire. I'll show you how hot it burns!", + "3": "Step right up and take a look!" + }, + "victory": { + "1": "I burned down to ashes...", + "2": "Yow! That's hot!", + "3": "Ow! I scorched the tip of my nose!" + } + }, + "sailor": { + "encounter": { + "1": "Matey, you're walking the plank if you lose!", + "2": "Come on then! My sailor's pride is at stake!", + "3": "Ahoy there! Are you seasick?", + "3_female": "Ahoy there! Are you seasick?" + }, + "victory": { + "1": "Argh! Beaten by a kid!", + "2": "Your spirit sank me!", + "3": "I think it's me that's seasick..." + } + }, + "archer": { + "encounter": { + "1": "Before you go any further, let's see how you fare against us, Team Rocket!", + "2": "I have received reports that your skills are not insignificant. Let's see if they are true.", + "3": "I am Archer, an Admin of Team Rocket. And I do not go easy on enemies of our organization." + }, + "victory": { + "1": "What a blunder!", + "2": "With my current skills, I was not up to the task after all.", + "3": "F-forgive me, Giovanni... For me to be defeated by a mere trainer..." + } + }, + "ariana": { + "encounter": { + "1": "Hold it right there! We can't someone on the loose.\n$It's harmful to Team Rocket's pride, you see.", + "2": "I don't know or care if what I'm doing is right or wrong...\n$I just put my faith in Giovanni and do as I am told", + "3": "Your trip ends here. I'm going to take you down!" + }, + "victory": { + "1": "Tch, you really are strong. It's too bad.\n$If you were to join Team Rocket, you could become an Executive.", + "1_female": "Tch, you really are strong. It's too bad.\n$If you were to join Team Rocket, you could become an Executive.", + "2": "I... I'm shattered...", + "3": "Aaaieeeee! This can't be happening! I fought hard, but I still lost…" + } + }, + "proton": { + "encounter": { + "1": "What do you want? If you interrupt our work, don't expect any mercy!", + "2": "What do we have here? I am often labeled as the scariest and cruelest guy in Team Rocket…\n$I strongly urge you not to interfere with our business!", + "3": "I am Proton, an Admin of Team Rocket. I am here to put an end to your meddling!" + }, + "victory": { + "1": "The fortress came down!", + "2": "You may have won this time… But all you did was make Team Rocket's wrath grow…", + "3": "I am defeated… But I will not forget this!" + } + }, + "petrel": { + "encounter": { + "1": "Muhahaha, we've been waiting for you. Me? You don't know who I am? It is me, Giovanni.\n$The majestic Giovanni himself! Wahahaha! …Huh? I don't sound anything like Giovanni?\n$I don't even look like Giovanni? How come? I've worked so hard to mimic him!", + "2": "I am Petrel, an Admin of Team Rocket. I will not allow you to interfere with our plans!", + "3": "Rocket Executive Petrel will deal with this intruder!" + }, + "victory": { + "1": "OK, OK. I'll tell you where he is.", + "2": "I… I couldn't do a thing… Giovanni, please forgive me…", + "3": "No, I can't let this affect me. I have to inform the others…" + } + }, + "tabitha": { + "encounter": { + "1": "Hehehe! So you've come all the way here! But you're too late!", + "2": "Hehehe... Got here already, did you? We underestimated you! But this is it! \n$I'm a cut above the Grunts you've seen so far. I'm not stalling for time.\n$I'm going to pulverize you!", + "3": "I'm going to give you a little taste of pain! Resign yourself to it!" + }, + "victory": { + "1": "Hehehe! You might have beaten me, but you don't stand a chance against the boss!\n$If you get lost now, you won't have to face a sound whipping!", + "2": "Hehehe... So, I lost, too...", + "3": "Ahya! How could this be? For an Admin like me to lose to some random trainer...", + "3_female": "Ahya! How could this be? For an Admin like me to lose to some random trainer..." + } + }, + "courtney": { + "encounter": { + "1": "Don't. Get. In. My. Way.", + "2": "You... ...I want to...analyze. Ahahaha", + "3": "... Well then...Deleting..." + }, + "victory": { + "1": "Hah hah... Uhn...hah hah...", + "2": "As anticipated. Unanticipated. You. Target lock...completed.\n$Commencing...experiment. You. Forever. Aha... ♪", + "3": "That's unanticipated. ...I knew it. You...are interesting! ...Haha. ♪" + } + }, + "shelly": { + "encounter": { + "1": "Ahahahaha! You're going to meddle in Team Aqua's affairs?\n$You're either absolutely fearless, simply ignorant, or both!\n$You're so cute, you're disgusting! I'll put you down", + "2": "What's this? Who's this spoiled brat?", + "3": "Cool your jets. Be patient. I'll crush you shortly.", + "3_female": "Cool your jets. Be patient. I'll crush you shortly." + }, + "victory": { + "1": "Ahahahaha! We got meddled with unexpectedly! We're out of options.\n$We'll have to pull out. But this isn't the last you'll see of Team Aqua!\n$We have other plans! Don't you forget it!", + "2": "Ahhh?! Did I go too easy on you?!", + "3": "Uh. Are you telling me you've upped your game even more during the fight?\n$You're a brat with a bright future… My Pokémon and I don't have any strength left to fight…\n$Go on… Go and be destroyed by Archie.", + "3_female": "Uh. Are you telling me you've upped your game even more during the fight?\n$You're a brat with a bright future… My Pokémon and I don't have any strength left to fight…\n$Go on… Go and be destroyed by Archie." + } + }, + "matt": { + "encounter": { + "1": "All right then, until the boss has time for you, I'll be your opponent!", + "2": "Hooah! Full on! I'm burning up! Well! Welll! Wellllll! Let's battle it out until we've got nothing left!", + "3": "Hoo hah! I'm gonna smash you up!" + }, + "victory": { + "1": "Muwuhahaha! That battle was fun even though I lost!", + "2": "I can feel it! I can feel it, all right! The strength coming offa you!\n$More! I still want more! But looks like we're outta time...", + "3": "Oho! That's a loss I can be proud of!", + "3_female": "Oho! That's a loss I can be proud of!" + } + }, + "mars": { + "encounter": { + "1": "I'm Mars, one of Team Galactic's top Commanders.", + "2": "Team Galactic's vision for the future is unwavering. Opposition will be crushed without mercy!", + "3": "Feeling nervous? You should be!", + "3_female": "Feeling nervous? You should be!" + }, + "victory": { + "1": "This can't be happening! How did I lose?!", + "2": "You have some skill, I'll give you that.", + "3": "Defeated... This was a costly mistake." + } + }, + "jupiter": { + "encounter": { + "1": "Jupiter, Commander of Team Galactic, at your service.", + "2": "Resistance is futile. Team Galactic will prevail!", + "3": "You're trembling... scared already?" + }, + "victory": { + "1": "No way... I lost?!", + "2": "Impressive, you've got guts!", + "3": "Losing like this... How embarrassing." + } + }, + "saturn": { + "encounter": { + "1": "I am Saturn, Commander of Team Galactic.", + "2": "Our mission is absolute. Any hindrance will be obliterated!", + "3": "Is that fear I see in your eyes?" + }, + "victory": { + "1": "Impossible... Defeated by you?!", + "2": "You have proven yourself a worthy adversary.", + "3": "Bestowed in defeat... This is unacceptable." + } + }, + "zinzolin": { + "encounter": { + "1": "You could become a threat to Team Plasma, so we will eliminate you here and now!", + "1_female": "You could become a threat to Team Plasma, so we will eliminate you here and now!", + "2": "You don't have the sense to know when to quit, it seems. It's an act of mercy on my part to bring an end to this now!", + "3": "You're an impressive Trainer to have made it this far. But it ends here.", + "3_female": "You're an impressive Trainer to have made it this far. But it ends here." + }, + "victory": { + "1": "Ghetsis... I have failed you...", + "2": "It's bitter cold. I'm shivering. I'm suffering. Yet, we will stand victorious.", + "3": "Hmph. You're a smarter Trainer than I expected, but not smart enough.", + "3_female": "Hmph. You're a smarter Trainer than I expected, but not smart enough." + } + }, + "rood": { + "encounter": { + "1": "You are a threat to Team Plasma. We cannot let you walk away from here and now!", + "1_female": "You are a threat to Team Plasma. We cannot let you walk away from here and now!", + "2": "It seems you don't know when to give up. I'll make sure no one interferes with our plans!", + "3": "You are a remarkable Trainer to have made it this far. But this is where it ends.", + "3_female": "You are a remarkable Trainer to have made it this far. But this is where it ends." + }, + "victory": { + "1": "Ghetsis... I have failed my mission...", + "2": "The cold is piercing. I'm shivering. I'm suffering. Yet, we will stand triumphant.", + "3": "Hm. You are a talented Trainer, but unfortunately not talented enough." + } + }, + "xerosic": { + "encounter": { + "1": "Ah ha ha! It would be my pleasure. Come on, little Trainer! Let's see what you've got!", + "1_female": "Ah ha ha! It would be my pleasure. Come on, little Trainer! Let's see what you've got!", + "2": "Hmm... You're more powerful than you look. I wonder how much energy there is inside you.", + "2_female": "Hmm... You're more powerful than you look. I wonder how much energy there is inside you.", + "3": "I've been waiting for you! I need to do a little research on you! Come, let us begin!" + }, + "victory": { + "1": "Ah, you're quite strong. Oh yes—very strong, indeed.", + "2": "Ding-ding-ding! You did it! To the victor go the spoils!", + "2_female": "Ding-ding-ding! You did it! To the victor go the spoils!", + "3": "Wonderful! Amazing! You have tremendous skill and bravery!" + } + }, + "bryony": { + "encounter": { + "1": "I am Bryony, and it would be my pleasure to battle you. Show me what you've got.", + "2": "Impressive... You're more powerful than you appear. Let's see the true extent of your energy.", + "2_female": "Impressive... You're more powerful than you appear. Let's see the true extent of your energy.", + "3": "I've anticipated your arrival. It's time for a little test. Shall we begin?" + }, + "victory": { + "1": "You're quite strong. Oh yes—very strong, indeed.", + "2": "Ding-ding-ding! You've done well. Victory is yours.", + "3": "Wonderful! Remarkable! Your skill and bravery are commendable." + } + }, + "rocket_grunt": { + "encounter": { + "1": "Prepare for trouble!", + "2": "We're pulling a big job here! Get lost, kid!", + "2_female": "We're pulling a big job here! Get lost, kid!", + "3": "Hand over your Pokémon, or face the wrath of Team Rocket!", + "4": "You're about to experience the true terror of Team Rocket!", + "5": "Hey, kid! Me am a Team Rocket member kind of guy!", + "5_female": "Hey, kid! Me am a Team Rocket member kind of guy!" + }, + "victory": { + "1": "Team Rocket blasting off again!", + "2": "Oh no! I dropped the Lift Key!", + "3": "I blew it!", + "4": "My associates won't stand for this!", + "5": "You say what? Team Rocket bye-bye a go-go? Broken it is says you?" + } + }, + "magma_grunt": { + "encounter": { + "1": "If you get in the way of Team Magma, don’t expect any mercy!", + "2": "You'd better not interfere with our plans! We're making the world a better place!", + "3": "You're in the way! Team Magma has no time for kids like you!", + "4": "I hope you brought marshmallows because things are about to heat up!", + "5": "We're going to use the power of a volcano! It's gonna be... explosive! Get it? Heh heh!" + }, + "victory": { + "1": "Huh? I lost?!", + "2": "I can't believe I lost! I even skipped lunch for this", + "3": "No way! You're just a kid!", + "3_female": "No way! You're just a kid!", + "4": "Urrrgh... I should've ducked into our hideout right away...", + "5": "You beat me... Do you think the boss will dock my pay for this?" + } + }, + "aqua_grunt": { + "encounter": { + "1": "No one who crosses Team Aqua gets any mercy, not even kids!", + "2": "Grrr... You've got some nerve meddling with Team Aqua!", + "3": "You're about to get soaked! And not just from my water Pokémon!", + "4": "We, Team Aqua, exist for the good of all!", + "5": "Prepare to be washed away by the tides of my... uh, Pokémon! Yeah, my Pokémon!" + }, + "victory": { + "1": "You're kidding me!", + "2": "Arrgh, I didn't count on being meddled with by some meddling kid!", + "3": "I lost?! Guess I'll have to swim back to the hideout now...", + "4": "Oh, man, what a disaster... The boss is going to be furious...", + "5": "You beat me... Do you think the boss will make me walk the plank for this?" + } + }, + "galactic_grunt": { + "encounter": { + "1": "Don't mess with Team Galactic!", + "2": "Witness the power of our technology and the future we envision!", + "3": "In the name of Team Galactic, I'll eliminate anyone who stands in our way!", + "4": "Get ready to lose!", + "5": "Hope you're ready for a cosmic beatdown!", + "5_female": "Hope you're ready for a cosmic beatdown!" + }, + "victory": { + "1": "Shut down...", + "2": "This setback means nothing in the grand scheme.", + "3": "Our plans are bigger than this defeat.", + "4": "How?!", + "5": "Note to self: practice Pokémon battling, ASAP." + } + }, + "plasma_grunt": { + "encounter": { + "1": "We won't tolerate people who have different ideas!", + "2": "If I win against you, release your Pokémon!", + "3": "If you get in the way of Team Plasma, I'll take care of you!", + "4": "Team Plasma will liberate Pokémon from selfish humans like you!", + "5": "Our hairstyles are out of this world... but our battling skills? You'll find out soon enough." + }, + "victory": { + "1": "Plasmaaaaaaaaa!", + "2": "How could I lose...", + "3": "...What a weak Pokémon, I'll just have to go steal some better ones!", + "4": "Great plans are always interrupted.", + "5": "This is bad... Badbadbadbadbadbadbad! Bad for Team Plasma! Or Plasbad, for short!" + } + }, + "flare_grunt": { + "encounter": { + "1": "Your Pokémon are no match for the elegance of Team Flare.", + "2": "Hope you brought your sunglasses, because things are about to get bright!", + "2_female": "Hope you brought your sunglasses, because things are about to get bright!", + "3": "Team Flare will cleanse the world of imperfection!", + "4": "Prepare to face the brilliance of Team Flare!", + "5": "Fashion is most important to us!" + }, + "victory": { + "1": "The future doesn't look bright for me.", + "2": "Perhaps there's more to battling than I thought. Back to the drawing board.", + "3": "Gahh?! I lost?!", + "4": "Even in defeat, Team Flare's elegance shines through.", + "5": "You may have beaten me, but when I lose, I go out in style!" + } + }, + "aether_grunt": { + "encounter": { + "1": "I'll fight you with all I have to wipe you out!", + "2": "I don't care if you're a kid or what. I'll send you flying if you threaten us!", + "2_female": "I don't care if you're a kid or what. I'll send you flying if you threaten us!", + "3": "I was told to turn away Trainers, whomever they might be!", + "4": "I'll show you the power of Aether Paradise!", + "5": "Now that you've learned of the darkness at the heart of Aether Paradise, we'll need you to conveniently disappear!" + }, + "victory": { + "1": "Hmph! You seem to have a lot of skill.", + "2": "What does this mean? What does this mean!", + "3": "Hey! You're so strong that there's no way I can turn you away!", + "4": "Hmm... It seems as though I may have lost.", + "5": "Here's an impression for you: Aiyee!" + } + }, + "faba": { + "encounter": { + "1": "I, Branch Chief Faba, shall show you the harshness of the real world!", + "2": "The man who is called Aether Paradise's last line of defense is to battle a mere child?", + "2_female": "The man who is called Aether Paradise's last line of defense is to battle a mere child?", + "3": "I, Faba, am the Aether Branch Chief. The only one in the world, I'm irreplaceable." + }, + "victory": { + "1": "Aiyee!", + "2": "H-h-how can this be?! How could this child...", + "2_female": "H-h-how can this be?! How could this child...", + "3": "This is why... This is why I can't bring myself to like children." + } + }, + "skull_grunt": { + "encounter": { + "1": "We're not bad-we're just hard!", + "2": "You want some? That's how we say hello! Nice knowing you, punks!", + "2_female": "You want some? That's how we say hello! Nice knowing you, punks!", + "3": "We're just a bunch of guys and gals with a great interest in other people's Pokémon!", + "4": "Why you trying to act hard when we're already hard as bones out here, homie?", + "4_female": "Why you trying to act hard when we're already hard as bones out here, homie?", + "5": "Team Skull represent! We can't pay the rent! Had a lot of fun, but our youth was misspent!", + "5_female": "Team Skull represent! We can't pay the rent! Had a lot of fun, but our youth was misspent!" + }, + "victory": { + "1": "Huh? Is it over already?", + "2": "Time for us to break out, yo! Gotta tell y'all peace out, yo!", + "3": "We don't need your wack Pokémon anyway!", + "4": "Wha-?! This kid's way too strong-no bones about it!", + "5": "So, what? I'm lower than a Pokémon?! I already got self-esteem issues, man." + } + }, + "plumeria": { + "encounter": { + "1": " ...Hmph. You don't look like anything special to me.", + "1_female": " ...Hmph. You don't look like anything special to me.", + "2": "It takes these dumb Grunts way too long to deal with you kids...", + "3": "Mess with anyone in Team Skull, and I'll show you how serious I can get." + }, + "victory": { + "1": "Hmmph! You're pretty strong. I'll give you that.", + "1_female": "Hmmph! You're pretty strong. I'll give you that.", + "2": "Hmmph. Guess you are pretty tough. Now I understand why my Grunts waste so much time battling kids.", + "3": "Hmmph! I guess I just have to hold that loss." + } + }, + "macro_grunt": { + "encounter": { + "1": "It looks like this is the end of the line for you!", + "2": "You are a trainer aren't you? I'm afraid that doesn't give you the right to interfere in our work.", + "2_female": "You are a trainer aren't you? I'm afraid that doesn't give you the right to interfere in our work.", + "3": "I'm from Macro Cosmos Insurance! Do you have a life insurance policy?" + }, + "victory": { + "1": "I have little choice but to respectfully retreat.", + "2": "Having to give up my pocket money... Losing means I'm back in the red...", + "3": "Nobody can beat Macro Cosmos when it comes to our dedication to our work!" + } + }, + "oleana": { + "encounter": { + "1": "I won't let anyone interfere with Mr. Rose's plan!", + "2": "So, you got through all of the special staff that I had ordered to stop you. I would expect nothing less.", + "3": "For the chairman! I won't lose!" + }, + "victory": { + "1": "*sigh* I wasn't able to win... Oleana...you really are a hopeless woman.", + "2": "Arghhh! This is inexcusable... What was I thinking... Any trainer who's made it this far would be no pushover..", + "2_female": "Arghhh! This is inexcusable... What was I thinking... Any trainer who's made it this far would be no pushover..", + "3": "*sigh* I am one tired Oleana..." + } + }, + "rocket_boss_giovanni_1": { + "encounter": { + "1": "So! I must say, I am impressed you got here!" + }, + "victory": { + "1": "WHAT! This cannot be!" + }, + "defeat": { + "1": "Mark my words. Not being able to measure your own strength shows that you are still a child.", + "1_female": "Mark my words. Not being able to measure your own strength shows that you are still a child." + } + }, + "rocket_boss_giovanni_2": { + "encounter": { + "1": "My old associates need me... Are you going to get in my way?" + }, + "victory": { + "1": "How is this possible...? The precious dream of Team Rocket has become little more than an illusion..." + }, + "defeat": { + "1": "Team Rocket will be reborn again, and I will rule the world!" + } + }, + "magma_boss_maxie_1": { + "encounter": { + "1": "I will bury you by my own hand. I hope you appreciate this honor!" + }, + "victory": { + "1": "Ugh! You are... quite capable...\nI fell behind, but only by an inch..." + }, + "defeat": { + "1": "Team Magma will prevail!" + } + }, + "magma_boss_maxie_2": { + "encounter": { + "1": "You are the final obstacle remaining between me and my goals.\n$Brace yourself for my ultimate attack! Fuhahaha!" + }, + "victory": { + "1": "This... This is not.. Ngh..." + }, + "defeat": { + "1": "And now... I will transform this planet to a land ideal for humanity." + } + }, + "aqua_boss_archie_1": { + "encounter": { + "1": "I'm the leader of Team Aqua, so I'm afraid it's the rope's end for you." + }, + "victory": { + "1": "Let's meet again somewhere. I'll be sure to remember that face." + }, + "defeat": { + "1": "Brilliant! My team won't hold back now!" + } + }, + "aqua_boss_archie_2": { + "encounter": { + "1": "I've been waiting so long for this day to come.\nThis is the true power of my team!" + }, + "victory": { + "1": "Like I figured..." + }, + "defeat": { + "1": "I'll return everything in this world to its original, pure state!!" + } + }, + "galactic_boss_cyrus_1": { + "encounter": { + "1": "You were compelled to come here by such vacuous sentimentality.\n$I will make you regret paying heed to your heart!", + "1_female": "You were compelled to come here by such vacuous sentimentality.\n$I will make you regret paying heed to your heart!" + }, + "victory": { + "1": "Interesting. And quite curious." + }, + "defeat": { + "1": "I will create my new world..." + } + }, + "galactic_boss_cyrus_2": { + "encounter": { + "1": "So we meet again. It seems our fates have become intertwined.\n$But here and now, I will finally break that bond!" + }, + "victory": { + "1": "How? How? HOW?!" + }, + "defeat": { + "1": "Farewell." + } + }, + "plasma_boss_ghetsis_1": { + "encounter": { + "1": "I won't allow anyone to stop me! No matter who does what!" + }, + "victory": { + "1": "How can this be? I'm the creator of Team Plasma! I'm perfect!" + }, + "defeat": { + "1": "I am the perfect ruler of a perfect new world! Mwa ha ha!" + } + }, + "plasma_boss_ghetsis_2": { + "encounter": { + "1": "Come now! I want to see your face at the moment you lose all hope!" + }, + "victory": { + "1": "My calculations... No! My careful schemes! The world should be mine!" + }, + "defeat": { + "1": "Kyurem! Use Absofusion!" + } + }, + "flare_boss_lysandre_1": { + "encounter": { + "1": "Do you want to stop me? Show me in battle." + }, + "victory": { + "1": "You are here to stop me. But I ask you to wait. " + }, + "defeat": { + "1": "Pokemon...Shall no longer exist." + } + }, + "flare_boss_lysandre_2": { + "encounter": { + "1": "The future you want, or the future I want... Let us see which one is more deserving, shall we?" + }, + "victory": { + "1": "Whaugh!" + }, + "defeat": { + "1": "Fools with no vision will continue to befoul this beautiful world." + } + }, + "aether_boss_lusamine_1": { + "encounter": { + "1": "You're going to startle my sweet beast! It looks like I'll need to silence you first." + }, + "victory": { + "1": "How... how can you be so awful!" + }, + "defeat": { + "1": "Hmph..." + } + }, + "aether_boss_lusamine_2": { + "encounter": { + "1": "Why must you continue to pester me?! I am sick of you. Sick through and through!\n$Enough with this useless talk.. with Nihilego's power I will show you how wrong you were to come here!" + }, + "victory": { + "1": "Aaauuuggghhhhhhhhh!!!" + }, + "defeat": { + "1": "All that I want is my precious beast! I don't care about any of the rest of you!" + } + }, + "skull_boss_guzma_1": { + "encounter": { + "1": "The hated boss who beats you down and beats you down and never lets up...\n$Yeah. Big bad Guzma is here!" + }, + "victory": { + "1": "Tch. I'm gonna beat you down one of these days!" + }, + "defeat": { + "1": "And you came all the way out here just for that, huh?" + } + }, + "skull_boss_guzma_2": { + "encounter": { + "1": "Doesn't matter who I'm up against, I'm gonna beat them down!\n$That's what big bad Guzma is all about!" + }, + "victory": { + "1": "Guzma!!! What is wrong with you?!" + }, + "defeat": { + "1": "Y'all are stupid!" + } + }, + "macro_boss_rose_1": { + "encounter": { + "1": "I must provide limitless energy to ensure everlasting prosperity for everyone...\n$It is my purpose, my duty, my destiny!" + }, + "victory": { + "1": "You still don't understand, trainer...\n$We... No, I am going to change the course of history!" + }, + "defeat": { + "1": "You still don't understand a thing!" + } + }, + "macro_boss_rose_2": { + "encounter": { + "1": "I'm committed to solving the energy problem in the Galar region—and, of course, around the world.\n$My experience and accomplishments that made Macro Cosmos a success are proof my methods work.\n$I don't intend to change my mind, even if I lose." + }, + "victory": { + "1": "I'd forgotten how great Pokémon battles are! It's been so long since I battled...\n$That sure was satisfying, I accept defeat for this battle." + }, + "defeat": { + "1": "I suppose it must seem that I am doing something terrible. I don't expect you to understand.\n$But I must provide the Galar region with limitless energy to ensure everlasting prosperity." + } + }, + "brock": { + "encounter": { + "1": "My expertise on Rock-type Pokémon will take you down! Come on!", + "2": "My rock-hard willpower will overwhelm you!", + "3": "Allow me to show you the true strength of my Pokémon!" + }, + "victory": { + "1": "Your Pokémon's strength have overcome my rock-hard defenses!", + "2": "The world is huge! I'm glad to have had a chance to battle you.", + "3": "Perhaps I should go back to pursuing my dream as a Pokémon Breeder…" + }, + "defeat": { + "1": "The best offense is a good defense!\nThat's my way of doing things!", + "2": "Come study rocks with me next time to better learn how to fight them!", + "3": "Hah, all my traveling around the regions is paying off!" + } + }, + "misty": { + "encounter": { + "1": "My policy is an all out offensive with Water-type Pokémon!", + "1_female": "My policy is an all out offensive with Water-type Pokémon!", + "2": "Hiya, I'll show you the strength of my aquatic Pokémon!", + "3": "My dream was to go on a journey and battle powerful trainers…\nWill you be a sufficient challenge?" + }, + "victory": { + "1": "You really are strong… I'll admit that you are skilled…", + "2": "Grrr… You know you just got lucky, right?!", + "3": "Wow, you're too much! I can't believe you beat me!" + }, + "defeat": { + "1": "Was the mighty Misty too much for you?", + "2": "I hope you saw my Pokémon's elegant swimming techniques!", + "3": "Your Pokémon were no match for my pride and joys!" + } + }, + "lt_surge": { + "encounter": { + "1": "My Electric Pokémon saved me during the war! I'll show you how!", + "1_female": "My Electric Pokémon saved me during the war! I'll show you how!", + "2": "Ten-hut! I'll shock you into surrender!", + "3": "I'll zap you just like I do to all my enemies in battle!" + }, + "victory": { + "1": "Whoa! Your team's the real deal, kid!", + "2": "Aaargh, you're strong! Even my electric tricks lost against you.", + "2_female": "Aaargh, you're strong! Even my electric tricks lost against you.", + "3": "That was an absolutely shocking loss!" + }, + "defeat": { + "1": "Oh yeah! When it comes to Electric-type Pokémon, I'm number one in the world!", + "2": "Hahaha! That was an electrifying battle, kid!", + "3": "A Pokémon battle is war, and I have showed you first-hand combat!" + } + }, + "erika": { + "encounter": { + "1": "Ah, the weather is lovely here…\nOh, a battle? Very well then.", + "2": "My Pokémon battling skills rival that of my flower arranging skills.", + "3": "Oh, I hope the pleasant aroma of my Pokémon doesn't put me to sleep again…", + "4": "Seeing flowers in a garden is so soothing." + }, + "victory": { + "1": "Oh! I concede defeat.", + "2": "That match was most delightful.", + "3": "Ah, it appears it is my loss…", + "4": "Oh, my goodness." + }, + "defeat": { + "1": "I was afraid I would doze off…", + "2": "Oh my, it seems my Grass Pokémon overwhelmed you.", + "2_female": "Oh my, it seems my Grass Pokémon overwhelmed you.", + "3": "That battle was such a soothing experience.", + "4": "Oh… Is that all?" + } + }, + "janine": { + "encounter": { + "1": "I am mastering the art of poisonous attacks.\nI shall spar with you today!", + "2": "Father trusts that I can hold my own.\nI will prove him right!", + "3": "My ninja techniques are only second to my Father's!\nCan you keep up?" + }, + "victory": { + "1": "Even now, I still need training… I understand.", + "2": "Your battle technique has outmatched mine.", + "3": "I'm going to really apply myself and improve my skills." + }, + "defeat": { + "1": "Fufufu… the poison has sapped all your strength to battle.", + "2": "Ha! You didn't stand a chance against my superior ninja skills!", + "3": "Father's faith in me has proven to not be misplaced." + } + }, + "sabrina": { + "encounter": { + "1": "Through my psychic ability, I had a vision of your arrival!", + "2": "I dislike fighting, but if you wish, I will show you my powers!", + "3": "I can sense great ambition in you. I shall see if it not unfounded." + }, + "victory": { + "1": "Your power… It far exceeds what I foresaw…", + "2": "I failed to accurately predict your power.", + "3": "Even with my immense psychic powers, I cannot sense another as strong as you." + }, + "defeat": { + "1": "This victory… It is exactly as I foresaw in my visions!", + "2": "Perhaps it was another I sensed a great desire in…", + "3": "Hone your abilities before recklessly charging into battle.\nYou never know what the future may hold if you do…" + } + }, + "blaine": { + "encounter": { + "1": "Hah! Hope you brought a Burn Heal!", + "2": "My fiery Pokémon will incinerate all challengers!", + "3": "Get ready to play with fire!" + }, + "victory": { + "1": "I have burned down to nothing! Not even ashes remain!", + "2": "Didn't I stoke the flames high enough?", + "3": "I'm all burned out… But this makes my motivation to improve burn even hotter!" + }, + "defeat": { + "1": "My raging inferno cannot be quelled!", + "2": "My Pokémon have been powered up with the heat from this victory!", + "3": "Hah! My passion burns brighter than yours!" + } + }, + "giovanni": { + "encounter": { + "1": "I, the leader of Team Rocket, will make you feel a world of pain!", + "2": "My training here will be vital before I am to face my old associates again.", + "3": "I do not think you are prepared for the level of failure you are about to experience!", + "3_female": "I do not think you are prepared for the level of failure you are about to experience!" + }, + "victory": { + "1": "WHAT! Me, lose?! There is nothing I wish to say to you!", + "2": "Hmph… You could never understand what I hope to achieve.", + "3": "This defeat is merely delaying the inevitable.\nI will rise Team Rocket from the ashes in due time." + }, + "defeat": { + "1": "Not being able to measure your own strength shows that you are still but a child.", + "2": "Do not try to interfere with me again.", + "3": "I hope you understand how foolish challenging me was." + } + }, + "roxanne": { + "encounter": { + "1": "Would you kindly demonstrate how you battle?", + "2": "You can learn many things by battling many trainers.", + "3": "Oh, you caught me strategizing.\nWould you like to battle?" + }, + "victory": { + "1": "Oh, I appear to have lost.\nI understand.", + "2": "It seems that I still have so much more to learn when it comes to battle.", + "3": "I'll take what I learned here today to heart." + }, + "defeat": { + "1": "I have learned many things from our battle.\nI hope you have too.", + "2": "I look forward to battling you again.\nI hope you'll use what you've learned here.", + "3": "I won due to everything I have learned." + } + }, + "brawly": { + "encounter": { + "1": "Oh man, a challenger!\nLet's see what you can do!", + "1_female": "Oh man, a challenger!\nLet's see what you can do!", + "2": "You seem like a big splash.\nLet's battle!", + "3": "Time to create a storm!\nLet's go!" + }, + "victory": { + "1": "Oh woah, you've washed me out!", + "2": "You surfed my wave and crashed me down!", + "3": "I feel like I'm lost in Granite Cave!" + }, + "defeat": { + "1": "Haha, I surfed the big wave!\nChallenge me again sometime.", + "2": "Surf with me again some time!", + "3": "Just like the tides come in and out, I hope you return to challenge me again." + } + }, + "wattson": { + "encounter": { + "1": "Time to get shocked!\nWahahahaha!", + "2": "I'll make sparks fly!\nWahahahaha!", + "3": "I hope you brought Paralyz Heal!\nWahahahaha!" + }, + "victory": { + "1": "Seems like I'm out of charge!\nWahahahaha!", + "2": "You've completely grounded me!\nWahahahaha!", + "3": "Thanks for the thrill!\nWahahahaha!" + }, + "defeat": { + "1": "Recharge your batteries and challenge me again sometime!\nWahahahaha!", + "1_female": "Recharge your batteries and challenge me again sometime!\nWahahahaha!", + "2": "I hope you found our battle electrifying!\nWahahahaha!", + "3": "Aren't you shocked I won?\nWahahahaha!" + } + }, + "flannery": { + "encounter": { + "1": "Nice to meet you! Wait, no…\nI will crush you!", + "2": "I've only been a leader for a little while, but I'll smoke you!", + "3": "It's time to demonstrate the moves my grandfather has taught me! Let's battle!" + }, + "victory": { + "1": "You remind me of my grandfather…\nNo wonder I lost.", + "2": "Am I trying too hard?\nI should relax, can't get too heated.", + "3": "Losing isn't going to smother me out.\nTime to reignite training!" + }, + "defeat": { + "1": "I hope I've made my grandfather proud…\nLet's battle again some time.", + "2": "I…I can't believe I won!\nDoing things my way worked!", + "3": "Let's exchange burning hot moves again soon!" + } + }, + "norman": { + "encounter": { + "1": "I'm surprised you managed to get here.\nLet's battle.", + "2": "I'll do everything in my power as a Gym Leader to win.\nLet's go!", + "3": "You better give this your all.\nIt's time to battle!" + }, + "victory": { + "1": "I lost to you…?\nRules are rules, though.", + "2": "Was moving from Olivine a mistake…?", + "3": "I can't believe it.\nThat was a great match." + }, + "defeat": { + "1": "We both tried our best.\nI hope we can battle again soon.", + "2": "You should try challenging my kid instead.\nYou might learn something!", + "3": "Thank you for the excellent battle.\nBetter luck next time." + } + }, + "winona": { + "encounter": { + "1": "I've been soaring the skies looking for prey…\nAnd you're my target!", + "2": "No matter how our battle is, my Flying Pokémon and I will triumph with grace. Let's battle!", + "3": "I hope you aren't scared of heights.\nLet's ascend!" + }, + "victory": { + "1": "You're the first Trainer I've seen with more grace than I.\nExcellently played.", + "1_female": "You're the first Trainer I've seen with more grace than I.\nExcellently played.", + "2": "Oh, my Flying Pokémon have plummeted!\nVery well.", + "3": "Though I may have fallen, my Pokémon will continue to fly!" + }, + "defeat": { + "1": "My Flying Pokémon and I will forever dance elegantly!", + "2": "I hope you enjoyed our show.\nOur graceful dance is finished.", + "3": "Won't you come see our elegant choreography again?" + } + }, + "tate": { + "encounter": { + "1": "Hehehe…\nWere you surprised to see me without my sister?", + "1_female": "Hehehe…\nWere you surprised to see me without my sister?", + "2": "I can see what you're thinking…\nYou want to battle!", + "3": "How can you defeat someone…\nWho knows your every move?" + }, + "victory": { + "1": "It can't be helped…\nI miss Liza…", + "2": "Your bond with your Pokémon was stronger than mine.", + "3": "If I were with Liza, we would have won.\nWe can finish each other's thoughts!" + }, + "defeat": { + "1": "My Pokémon and I are superior!", + "2": "If you can't even defeat me, you'll never be able to defeat Liza either.", + "3": "It's all thanks to my strict training with Liza.\nI can make myself one with Pokémon." + } + }, + "liza": { + "encounter": { + "1": "Fufufu…\nWere you surprised to see me without my brother?", + "1_female": "Fufufu…\nWere you surprised to see me without my brother?", + "2": "I can determine what you desire…\nYou want to battle, don't you?", + "3": "How can you defeat someone…\nWho's one with their Pokémon?" + }, + "victory": { + "1": "It can't be helped…\nI miss Tate…", + "2": "Your bond with your Pokémon…\nIt's stronger than mine.", + "3": "If I were with Tate, we would have won.\nWe can finish each other's sentences!" + }, + "defeat": { + "1": "My Pokémon and I are victorious.", + "2": "If you can't even defeat me, you'll never be able to defeat Tate either.", + "3": "It's all thanks to my strict training with Tate.\nI can synchronize myself with my Pokémon." + } + }, + "juan": { + "encounter": { + "1": "Now's not the time to act coy.\nLet's battle!", + "2": "Ahahaha, You'll be witness to my artistry with Water Pokémon!", + "3": "A typhoon approaches!\nWill you be able to test me?", + "4": "Please, you shall bear witness to our artistry.\nA grand illusion of water sculpted by my Pokémon and myself!" + }, + "victory": { + "1": "You may be a genius who can take on Wallace!", + "2": "I focused on elegance while you trained.\nIt's only natural that you defeated me.", + "3": "Ahahaha!\nVery well, You have won this time.", + "4": "From you, I sense the brilliant shine of skill that will overcome all." + }, + "defeat": { + "1": "My Pokémon and I have sculpted an illusion of Water and come out victorious.", + "2": "Ahahaha, I have won, and you have lost.", + "3": "Shall I loan you my outfit? It may help you battle!\nAhahaha, I jest!", + "4": "I'm the winner! Which is to say, you lost." + } + }, + "crasher_wake": { + "encounter": { + "1": "Crash! Crash! Watch out!\nCrasher Wake…is…heeere!", + "2": "Crash! Crash! Crasher Wake!", + "3": "I'm the tidal wave of power to wash you away!" + }, + "victory": { + "1": "That puts a grin on my face!\nGuhahaha! That was a blast!", + "2": "Hunwah! It's gone and ended!\nHow will I say this…\nI want more! I wanted to battle a lot more!", + "3": "WHAAAAT!?" + }, + "defeat": { + "1": "Yeeeeah! That's right!", + "2": "I won, but I want more! I wanted to battle a lot more!", + "3": "So long!" + } + }, + "falkner": { + "encounter": { + "1": "I'll show you the real power of the magnificent bird Pokémon!", + "2": "Winds, stay with me!", + "3": "Dad! I hope you're watching me battle from above!" + }, + "victory": { + "1": "I understand… I'll bow out gracefully.", + "2": "A defeat is a defeat. You are strong indeed.", + "3": "…Shoot! Yeah, I lost." + }, + "defeat": { + "1": "Dad! I won with your cherished bird Pokémon…", + "2": "Bird Pokémon are the best after all!", + "3": "Feels like I'm catching up to my dad!" + } + }, + "nessa": { + "encounter": { + "1": "No matter what kind of plan your refined mind may be plotting, my partner and I will be sure to sink it.", + "1_female": "No matter what kind of plan your refined mind may be plotting, my partner and I will be sure to sink it.", + "2": "I'm not here to chat. I'm here to win!", + "3": "This is a little gift from my Pokémon… I hope you can take it!", + "3_female": "This is a little gift from my Pokémon… I hope you can take it!" + }, + "victory": { + "1": "You and your Pokémon are just too much…", + "2": "How…? How can this be?!", + "3": "I was totally washed away!" + }, + "defeat": { + "1": "The raging wave crashes again!", + "2": "Time to ride the wave of victory!", + "3": "Ehehe!" + } + }, + "melony": { + "encounter": { + "1": "I'm not going to hold back!", + "2": "All righty, I suppose we should get started.", + "3": "I'll freeze you solid!" + }, + "victory": { + "1": "You… You're pretty good, huh?", + "1_female": "You… You're pretty good, huh?", + "2": "If you find Gordie around, be sure to give him a right trashing, would you?", + "3": "I think you took breaking the ice a little too literally…" + }, + "defeat": { + "1": "Now do you see how severe battles can be?", + "2": "Hee! Looks like I went and won again!", + "3": "Are you holding back?" + } + }, + "marlon": { + "encounter": { + "1": "You look strong! Shoots! Let's start!", + "2": "I'm strong like the ocean's wide. You're gonna get swept away, fo' sho'.", + "2_female": "I'm strong like the ocean's wide. You're gonna get swept away, fo' sho'.", + "3": "Oh ho, so I'm facing you! That's off the wall." + }, + "victory": { + "1": "You totally rocked that! You're raising some wicked Pokémon. You got this Trainer thing down!", + "1_female": "You totally rocked that! You're raising some wicked Pokémon. You got this Trainer thing down!", + "2": "You don't just look strong, you're strong fo' reals! Eh, I was swept away, too!", + "3": "You're strong as a gnarly wave!" + }, + "defeat": { + "1": "You're tough, but it's not enough to sway the sea, 'K!", + "2": "Hee! Looks like I went and won again!", + "3": "Sweet, sweet victory!" + } + }, + "shauntal": { + "encounter": { + "1": "Excuse me. You're a challenger, right?\nI'm the Elite Four's Ghost-type Pokémon user, Shauntal, and I shall be your opponent.", + "1_female": "Excuse me. You're a challenger, right?\nI'm the Elite Four's Ghost-type Pokémon user, Shauntal, and I shall be your opponent.", + "2": "I absolutely love writing about Trainers who come here and the Pokémon they train.\nCould I use you and your Pokémon as a subject?", + "3": "Every person who works with Pokémon has a story to tell.\nWhat story is about to be told?" + }, + "victory": { + "1": "Wow. I'm dumbstruck!", + "2": "S-sorry! First, I must apologize to my Pokémon…\n\nI'm really sorry you had a bad experience because of me!", + "3": "Even in light of that, I'm still one of the Elite Four!" + }, + "defeat": { + "1": "Eheh.", + "2": "That gave me excellent material for my next novel!", + "3": "And so, another tale ends…" + } + }, + "marshal": { + "encounter": { + "1": "My mentor, Alder, sees your potential as a Trainer and is taking an interest in you.\nIt is my intention to test you--to take you to the limits of your strength. Kiai!", + "1_female": "My mentor, Alder, sees your potential as a Trainer and is taking an interest in you.\nIt is my intention to test you--to take you to the limits of your strength. Kiai!", + "2": "Victory, decisive victory, is my intention! Challenger, here I come!", + "3": "In myself, I seek to develop the strength of a fighter and shatter any weakness in myself!\nPrevailing with the force of my convictions!" + }, + "victory": { + "1": "Whew! Well done!", + "2": "As your battles continue, aim for even greater heights!", + "3": "The strength shown by you and your Pokémon has deeply impressed me…" + }, + "defeat": { + "1": "Hmm.", + "2": "That was good battle.", + "3": "Haaah! Haaah! Haiyaaaah!" + } + }, + "cheren": { + "encounter": { + "1": "You remind me of an old friend. That makes me excited about this Pokémon battle!", + "2": "Pokémon battles have no meaning if you don't think why you battle.\n$Or better said, it makes battling together with Pokémon meaningless.", + "3": "My name's Cheren! I'm a Gym Leader and a teacher! Pleasure to meet you.", + "3_female": "My name's Cheren! I'm a Gym Leader and a teacher! Pleasure to meet you." + }, + "victory": { + "1": "Thank you! I saw what was missing in me.", + "2": "Thank you! I feel like I saw a little of the way toward my ideals.", + "3": "Hmm… This is problematic." + }, + "defeat": { + "1": "As a Gym Leader, I aim to be a wall for you to overcome.", + "2": "All right!", + "3": "I made it where I am because Pokémon were by my side.\nPerhaps we need to think about why Pokémon help us not in terms of Pokémon and Trainers but as a relationship between living beings." + } + }, + "chili": { + "encounter": { + "1": "Yeeeeooow! Time to play with FIRE!! I'm the strongest of us brothers!", + "1_female": "Yeeeeooow! Time to play with FIRE!! I'm the strongest of us brothers!", + "2": "Ta-da! The Fire-type scorcher Chili--that's me--will be your opponent!", + "2_female": "Ta-da! The Fire-type scorcher Chili--that's me--will be your opponent!", + "3": "I'm going to show you what me and my blazing Fire types can do!", + "3_female": "I'm going to show you what me and my blazing Fire types can do!" + }, + "victory": { + "1": "You got me. I am… burned… out…", + "1_female": "You got me. I am… burned… out…", + "2": "Whoa ho! You're on fire!", + "2_female": "Whoa ho! You're on fire!", + "3": "Augh! You got me!" + }, + "defeat": { + "1": "I'm on fire! Play with me, and you'll get burned!", + "1_female": "I'm on fire! Play with me, and you'll get burned!", + "2": "When you play with fire, you get burned!", + "3": "I mean, c'mon, your opponent was me! You didn't have a chance!", + "3_female": "I mean, c'mon, your opponent was me! You didn't have a chance!" + } + }, + "cilan": { + "encounter": { + "1": "Nothing personal... No hard feelings... Me and my Grass-type Pokémon will...\n$Um... We're gonna battle come what may.", + "1_female": "Nothing personal... No hard feelings... Me and my Grass-type Pokémon will...\n$Um... We're gonna battle come what may.", + "2": "So, um, if you're OK with me, I'll, um, put everything I've got into being, er, you know, your opponent.", + "2_female": "So, um, if you're OK with me, I'll, um, put everything I've got into being, er, you know, your opponent.", + "3": "OK… So, um, I'm Cilan, I like Grass-type Pokémon.", + "3_female": "OK… So, um, I'm Cilan, I like Grass-type Pokémon." + }, + "victory": { + "1": "Er… Is it over now?", + "1_female": "Er… Is it over now?", + "2": "…What a surprise. You are very strong, aren't you? \n$I guess my brothers wouldn't have been able to defeat you either…", + "2_female": "…What a surprise. You are very strong, aren't you? \n$I guess my brothers wouldn't have been able to defeat you either…", + "3": "…Huh. Looks like my timing was, um, off?" + }, + "defeat": { + "1": "Huh? Did I win?", + "1_female": "Huh? Did I win?", + "2": "I guess… \n$I suppose I won, because I've been competing with my brothers Chili and Cress, and we all were able to get tougher.", + "2_female": "I guess… \n$I suppose I won, because I've been competing with my brothers Chili and Cress, and we all were able to get tougher.", + "3": "It…it was quite a thrilling experience…", + "3_female": "It…it was quite a thrilling experience…" + } + }, + "roark": { + "encounter": { + "1": "I need to see your potential as a Trainer. And, I'll need to see the toughness of the Pokémon that battle with you!", + "1_female": "I need to see your potential as a Trainer. And, I'll need to see the toughness of the Pokémon that battle with you!", + "2": "Here goes! These are my rocking Pokémon, my pride and joy!", + "3": "Rock-type Pokémon are simply the best!", + "4": "Every day, I toughened up my Pokémon by digging up Fossils nonstop.\n$Could I show you how tough I made them in a battle?", + "4_female": "Every day, I toughened up my Pokémon by digging up Fossils nonstop.\n$Could I show you how tough I made them in a battle?" + }, + "victory": { + "1": "W-what? That can't be! My buffed-up Pokémon!", + "2": "…We lost control there. Next time I'd like to challenge you to a Fossil-digging race underground.", + "2_female": "…We lost control there. Next time I'd like to challenge you to a Fossil-digging race underground.", + "3": "With skill like yours, it's natural for you to win.", + "4": "Wh-what?! It can't be! Even that wasn't enough?" + }, + "defeat": { + "1": "See? I'm proud of my rocking battle style!", + "2": "Thanks! The battle gave me confidence that I may be able to beat my dad!", + "3": "See? These are my rocking Pokémon, my pride and joy!", + "4": "I knew I would win!" + } + }, + "morty": { + "encounter": { + "1": "With a little more, I could see a future in which I meet the legendary Pokémon.\n$You're going to help me reach that level!", + "2": "It's said that a rainbow-hued Pokémon will come down to appear before a truly powerful Trainer. \n$I believed that tale, so I have secretly trained here all my life. As a result, I can now see what others cannot. \n$I see a shadow of the person who will make the Pokémon appear. \n$I believe that person is me! You're going to help me reach that level!", + "3": "Whether you choose to believe or not, mystic power does exist.", + "4": "You can bear witness to the fruits of my training.", + "5": "You must make your soul one with that of Pokémon. Can you do this?", + "6": "Say, do you want to be part of my training?" + }, + "victory": { + "1": "I'm not good enough yet…", + "2": "I see… Your journey has taken you to far-away places and you have witnessed much more than I.\n$I envy you for that…", + "2_female": "I see… Your journey has taken you to far-away places and you have witnessed much more than I.\n$I envy you for that…", + "3": "How is this possible…", + "4": "I don't think our potentials are so different.\n$But you seem to have something more than that… So be it.", + "5": "Guess I need more training.", + "6": "That's a shame." + }, + "defeat": { + "1": "I moved… one step ahead again.", + "2": "Fufufu…", + "3": "Wh-what?! It can't be! Even that wasn't enough?", + "4": "I feel like I just smashed through a really stubborn boulder!", + "5": "Ahahahah!", + "6": "I knew I would win!" + } + }, + "crispin": { + "encounter": { + "1": "I wanna win, so that's exactly what I'll do!", + "2": "I battle because I wanna battle! And you know what? That's how it should be!" + }, + "victory": { + "1": "I wanted to win…but I lost!", + "2": "I lost…'cause I couldn't win!" + }, + "defeat": { + "1": "Hey, wait a sec. Did I just win? I think I just won! Talk about satisfying!", + "2": "Wooo! That was amazing!" + } + }, + "amarys": { + "encounter": { + "1": "I want to be the one to help a certain person. That being the case, I cannot afford to lose.\n$… Our battle starts now." + }, + "victory": { + "1": "I am… not enough, I see." + }, + "defeat": { + "1": "Victory belongs to me. Well fought." + } + }, + "lacey": { + "encounter": { + "1": "I'll be facing you with my usual party as a member of the Elite Four." + }, + "victory": { + "1": "That was a great battle!" + }, + "defeat": { + "1": "Let's give your Pokémon a nice round of applause for their efforts!" + } + }, + "drayton": { + "encounter": { + "1": "Man, I love chairs. Don't you love chairs? What lifesavers. \n$I don't get why everyone doesn't just sit all the time. Standing up's tiring work!" + }, + "victory": { + "1": "Guess I should've expected that!" + }, + "defeat": { + "1": "Heh heh! Don't mind me, just scooping up a W over here. I get it if you're upset, but don't go full Kieran on me, OK?", + "1_female": "Heh heh! Don't mind me, just scooping up a W over here. I get it if you're upset, but don't go full Kieran on me, OK?" + } + }, + "ramos": { + "encounter": { + "1": "Did yeh enjoy the garden playground I made with all these sturdy plants o' mine?\n$Their strength is a sign o' my strength as a gardener and a Gym Leader! Yeh sure yer up to facing all that?", + "1_female": "Did yeh enjoy the garden playground I made with all these sturdy plants o' mine?\n$Their strength is a sign o' my strength as a gardener and a Gym Leader! Yeh sure yer up to facing all that?" + }, + "victory": { + "1": "Yeh believe in yer Pokémon… And they believe in yeh, too… It was a fine battle, sprout." + }, + "defeat": { + "1": "Hohoho… Indeed. Frail little blades o' grass'll break through even concrete." + } + }, + "viola": { + "encounter": { + "1": "Whether it's the tears of frustration that follow a loss or the blossoming of joy that comes with victory…\n$They're both great subjects for my camera! Fantastic! This'll be just fantastic! \n$Now come at me!", + "2": "My lens is always focused on victory--I won't let anything ruin this shot!" + }, + "victory": { + "1": "You and your Pokémon have shown me a whole new depth of field! Fantastic! Just fantastic!", + "2": "The world you see through a lens, and the world you see with a Pokémon by your side…\n$The same world can look entirely different depending on your view." + }, + "defeat": { + "1": "The photo from the moment of my victory will be a real winner, all right!", + "2": "Yes! I took some great photos!" + } + }, + "candice": { + "encounter": { + "1": "You want to challenge Candice? Sure thing! I was waiting for someone tough! \n$But I should tell you, I'm tough because I know how to focus.", + "2": "Pokémon, fashion, romance… It's all about focus! \n$I'll show you just what I mean. Get ready to lose!" + }, + "victory": { + "1": "I must say, I'm warmed up to you! I might even admire you a little.", + "2": "Wow! You're great! You've earned my respect! \n$I think your focus and will bowled us over totally. ", + "2_female": "Wow! You're great! You've earned my respect! \n$I think your focus and will bowled us over totally. " + }, + "defeat": { + "1": "I sensed your will to win, but I don't lose!", + "2": "See? Candice's focus! My Pokémon's focus is great, too!" + } + }, + "gardenia": { + "encounter": { + "1": "You have a winning aura about you. So, anyway, this will be fun. Let's have our battle!" + }, + "victory": { + "1": "Amazing! You're very good, aren't you?", + "1_female": "Amazing! You're very good, aren't you?" + }, + "defeat": { + "1": "Yes! My Pokémon and I are perfectly good!" + } + }, + "aaron": { + "encounter": { + "1": "Ok! Let me take you on!" + }, + "victory": { + "1": "Battling is a deep and complex affair…" + }, + "defeat": { + "1": "Victory over an Elite Four member doesn't come easily." + } + }, + "cress": { + "encounter": { + "1": "That is correct! It shall be I and my esteemed Water types that you must face in battle!" + }, + "victory": { + "1": "Lose? Me? I don't believe this." + }, + "defeat": { + "1": "This is the appropriate result when I'm your opponent." + } + }, + "allister": { + "encounter": { + "1": "'M Allister.\nH-here… I go…" + }, + "victory": { + "1": "I nearly lost my mask from the shock… That was…\n$Wow. I can see your skill for what it is." + }, + "defeat": { + "1": "Th-that was ace!" + } + }, + "clay": { + "encounter": { + "1": "Harrumph! Kept me waitin', didn't ya, kid? All right, time to see what ya can do!", + "1_female": "Harrumph! Kept me waitin', didn't ya, kid? All right, time to see what ya can do!" + }, + "victory": { + "1": "Man oh man… It feels good to go all out and still be defeated!" + }, + "defeat": { + "1": "What's important is how ya react to losin'. \n$That's why folks who use losin' as fuel to get better are tough." + } + }, + "kofu": { + "encounter": { + "1": "I'mma serve you a full course o' Water-type Pokémon! Don't try to eat 'em, though!" + }, + "victory": { + "1": "Vaultin' Veluza! Yer a lively one, aren't ya! A little TOO lively, if I do say so myself!", + "1_female": "Vaultin' Veluza! Yer a lively one, aren't ya! A little TOO lively, if I do say so myself!" + }, + "defeat": { + "1": "You come back to see me again now, ya hear?" + } + }, + "tulip": { + "encounter": { + "1": "Allow me to put my skills to use to make your cute little Pokémon even more beautiful!" + }, + "victory": { + "1": "Your strength has a magic to it that cannot be washed away." + }, + "defeat": { + "1": "You know, in my line of work, people who lack talent in one area or the other often fade away quickly—never to be heard of again." + } + }, + "sidney": { + "encounter": { + "1": "I like that look you're giving me. I guess you'll give me a good match.\n$That's good! Looking real good! All right!\n$You and me, let's enjoy a battle that can only be staged here!" + }, + "victory": { + "1": "Well, how do you like that? I lost! Eh, it was fun, so it doesn't matter." + }, + "defeat": { + "1": "No hard feelings, alright?" + } + }, + "phoebe": { + "encounter": { + "1": "While I trained, I gained the ability to commune with Ghost-type Pokémon. \n$Yes, the bond I developed with Pokémon is extremely tight. \n$So, come on, just try and see if you can even inflict damage on my Pokémon!" + }, + "victory": { + "1": "Oh, darn. I've gone and lost." + }, + "defeat": { + "1": "I look forward to battling you again sometime!" + } + }, + "glacia": { + "encounter": { + "1": "All I have seen are challenges by weak Trainers and their Pokémon. \n$What about you? It would please me to no end if I could go all out against you!" + }, + "victory": { + "1": "You and your Pokémon… How hot your spirits burn!\n$The all-consuming heat overwhelms. \n$It's no surprise that my icy skills failed to harm you." + }, + "defeat": { + "1": "A fiercely passionate battle, indeed." + } + }, + "drake": { + "encounter": { + "1": "For us to battle with Pokémon as partners, do you know what it takes? Do you know what is needed? \n$If you don't, then you will never prevail over me!" + }, + "victory": { + "1": "Superb, it should be said." + }, + "defeat": { + "1": "I gave my all for that battle!" + } + }, + "wallace": { + "encounter": { + "1": "There's something about you… A difference in your demeanor. \n$I think I sense that in you. Now, show me. Show me the power you wield with your Pokémon. \n$And I, in turn, shall present you with a performance of illusions in water by me and my Pokémon!" + }, + "victory": { + "1": "Bravo. I realize now your authenticity and magnificence as a Pokémon Trainer. \n$I find much joy in having met you and your Pokémon. You have proven yourself worthy.", + "1_female": "Bravo. I realize now your authenticity and magnificence as a Pokémon Trainer. \n$I find much joy in having met you and your Pokémon. You have proven yourself worthy." + }, + "defeat": { + "1": "A grand illusion!" + } + }, + "lorelei": { + "encounter": { + "1": "No one can best me when it comes to icy Pokémon! Freezing moves are powerful!\n$Your Pokémon will be at my mercy when they are frozen solid! Hahaha! Are you ready?", + "1_female": "No one can best me when it comes to icy Pokémon! Freezing moves are powerful!\n$Your Pokémon will be at my mercy when they are frozen solid! Hahaha! Are you ready?" + }, + "victory": { + "1": "How dare you!" + }, + "defeat": { + "1": "There's nothing you can do once you're frozen.", + "1_female": "There's nothing you can do once you're frozen." + } + }, + "will": { + "encounter": { + "1": "I have trained all around the world, making my psychic Pokémon powerful.\n$I can only keep getting better! Losing is not an option!" + }, + "victory": { + "1": "I… I can't… believe it…" + }, + "defeat": { + "1": "That was close. I wonder what it is that you lack." + } + }, + "malva": { + "encounter": { + "1": "I feel like my heart might just burst into flames. \n$I'm burning up with my hatred for you, runt!", + "1_female": "I feel like my heart might just burst into flames. \n$I'm burning up with my hatred for you, runt!" + }, + "victory": { + "1": "What news… So a new challenger has defeated Malva!", + "1_female": "What news… So a new challenger has defeated Malva!" + }, + "defeat": { + "1": "I am delighted! Yes, delighted that I could squash you beneath my heel." + } + }, + "hala": { + "encounter": { + "1": "Old Hala is here to make you holler!" + }, + "victory": { + "1": "I could feel the power you gained on your journey." + }, + "defeat": { + "1": "Haha! What a delightful battle!" + } + }, + "molayne": { + "encounter": { + "1": "I gave the captain position to my cousin Sophocles, but I'm confident in my ability. \n$My strength is like that of a supernova!" + }, + "victory": { + "1": "I certainly found an interesting Trainer to face!", + "1_female": "I certainly found an interesting Trainer to face!" + }, + "defeat": { + "1": "Ahaha. What an interesting battle." + } + }, + "rika": { + "encounter": { + "1": "I'd say I'll go easy on you, but… I'd be lying! Think fast!" + }, + "victory": { + "1": "Not bad, kiddo.", + "1_female": "Not bad, kiddo." + }, + "defeat": { + "1": "Nahahaha! You really are something else, kiddo!", + "1_female": "Nahahaha! You really are something else, kiddo!" + } + }, + "bruno": { + "encounter": { + "1": "We will grind you down with our superior power! Hoo hah!" + }, + "victory": { + "1": "Why? How could I lose?" + }, + "defeat": { + "1": "You can challenge me all you like, but the results will never change!" + } + }, + "bugsy": { + "encounter": { + "1": "I'm Bugsy! I never lose when it comes to bug Pokémon!" + }, + "victory": { + "1": "Whoa, amazing! You're an expert on Pokémon!\nMy research isn't complete yet. OK, you win.", + "1_female": "Whoa, amazing! You're an expert on Pokémon!\nMy research isn't complete yet. OK, you win." + }, + "defeat": { + "1": "Thanks! Thanks to our battle, I was also able to make progress in my research!" + } + }, + "koga": { + "encounter": { + "1": "Fwahahahaha! Pokémon are not merely about brute force--you shall see soon enough!" + }, + "victory": { + "1": "Ah! You've proven your worth!" + }, + "defeat": { + "1": "Have you learned to fear the techniques of the ninja?" + } + }, + "bertha": { + "encounter": { + "1": "Well, would you show this old lady how much you've learned?" + }, + "victory": { + "1": "Well! Dear child, I must say, that was most impressive. \n$Your Pokémon believed in you and did their best to earn you the win. \n$Even though I've lost, I find myself with this silly grin!" + }, + "defeat": { + "1": "Hahahahah! Looks like this old lady won!" + } + }, + "lenora": { + "encounter": { + "1": "Well then, challenger, I'm going to research how you battle with the Pokémon you've so lovingly raised!", + "1_female": "Well then, challenger, I'm going to research how you battle with the Pokémon you've so lovingly raised!" + }, + "victory": { + "1": "My theory about you was correct. You're more than just talented… You're motivated! I salute you!", + "1_female": "My theory about you was correct. You're more than just talented… You're motivated! I salute you!" + }, + "defeat": { + "1": "Ah ha ha! If you lose, make sure to analyze why, and use that knowledge in your next battle!" + } + }, + "siebold": { + "encounter": { + "1": "As long as I am alive, I shall strive onward to seek the ultimate cuisine... and the strongest opponents in battle!" + }, + "victory": { + "1": "I shall store my memory of you and your Pokémon forever away within my heart." + }, + "defeat": { + "1": "Our Pokémon battle was like food for my soul. It shall keep me going. \n$That is how I will pay my respects to you for giving your all in battle!" + } + }, + "roxie": { + "encounter": { + "1": "Get ready! I'm gonna knock some sense outta ya!" + }, + "victory": { + "1": "Wild! Your reason's already more toxic than mine!" + }, + "defeat": { + "1": "Hey, c'mon! Get serious! You gotta put more out there!", + "1_female": "Hey, c'mon! Get serious! You gotta put more out there!" + } + }, + "olivia": { + "encounter": { + "1": "No introduction needed here. Time to battle me, Olivia!" + }, + "victory": { + "1": "Really lovely… Both you and your Pokémon…" + }, + "defeat": { + "1": "Mmm-hmm." + } + }, + "poppy": { + "encounter": { + "1": "Oooh! Do you wanna have a Pokémon battle with me?" + }, + "victory": { + "1": "Uagh?! Mmmuuuggghhh…" + }, + "defeat": { + "1": "Yaaay! I did it! I de-feet-ed you! You can come for… For… An avenge match? \n$Come for an avenge match anytime you want!" + } + }, + "agatha": { + "encounter": { + "1": "Pokémon are for battling! I'll show you how a real Trainer battles!" + }, + "victory": { + "1": "Oh my! You're something special, child!" + }, + "defeat": { + "1": "Bahaha. That's how a proper battle's done!" + } + }, + "flint": { + "encounter": { + "1": "Hope you're warmed up, cause here comes the Big Bang!", + "1_female": "Hope you're warmed up, cause here comes the Big Bang!" + }, + "victory": { + "1": "Incredible! Your moves are so hot, they make mine look lukewarm!" + }, + "defeat": { + "1": "Huh? Is that it? I think you need a bit more passion." + } + }, + "grimsley": { + "encounter": { + "1": "The winner takes everything, and there's nothing left for the loser." + }, + "victory": { + "1": "When one loses, they lose everything… The next thing I'll look for will be victory, too!" + }, + "defeat": { + "1": "If somebody wins, the person who fought against that person will lose." + } + }, + "caitlin": { + "encounter": { + "1": "It's me who appeared when the flower opened up. You who have been waiting…\n$You look like a Pokémon Trainer with refined strength and deepened kindness. \n$What I look for in my opponent is superb strength… \n$Please unleash your power to the fullest!", + "1_female": "It's me who appeared when the flower opened up. You who have been waiting…\n$You look like a Pokémon Trainer with refined strength and deepened kindness. \n$What I look for in my opponent is superb strength… \n$Please unleash your power to the fullest!" + }, + "victory": { + "1": "My Pokémon and I learned so much! I offer you my thanks." + }, + "defeat": { + "1": "I aspire to claim victory with elegance and grace." + } + }, + "diantha": { + "encounter": { + "1": "Battling against you and your Pokémon, all of you brimming with hope for the future… \n$Honestly, it just fills me up with energy I need to keep facing each new day! It does!" + }, + "victory": { + "1": "Witnessing the noble spirits of you and your Pokémon in battle has really touched my heart…" + }, + "defeat": { + "1": "Oh, fantastic! What did you think? My team was pretty cool, right?" + } + }, + "wikstrom": { + "encounter": { + "1": "Well met, young challenger! Verily am I the famed blade of hardened steel, Duke Wikstrom! \n$Let the battle begin! En garde!", + "1_female": "Well met, young challenger! Verily am I the famed blade of hardened steel, Duke Wikstrom! \n$Let the battle begin! En garde!" + }, + "victory": { + "1": "Glorious! The trust that you share with your honorable Pokémon surpasses even mine!", + "1_female": "Glorious! The trust that you share with your honorable Pokémon surpasses even mine!" + }, + "defeat": { + "1": "What manner of magic is this? My heart, it doth hammer ceaselessly in my breast! \n$Winning against such a worthy opponent doth give my soul wings--thus do I soar!", + "1_female": "What manner of magic is this? My heart, it doth hammer ceaselessly in my breast! \n$Winning against such a worthy opponent doth give my soul wings--thus do I soar!" + } + }, + "acerola": { + "encounter": { + "1": "Battling is just plain fun! Come on, I can take you!" + }, + "victory": { + "1": "I'm… I'm speechless! How did you do it?!" + }, + "defeat": { + "1": "Ehaha! What an amazing victory!" + } + }, + "larry_elite": { + "encounter": { + "1": "Hello there… It's me, Larry.\n$I serve as a member of the Elite Four too, yes… Unfortunately for me." + }, + "victory": { + "1": "Well, that took the wind from under our wings…" + }, + "defeat": { + "1": "It's time for a meeting with the boss." + } + }, + "lance": { + "encounter": { + "1": "I've been waiting for you. Allow me to test your skill.", + "2": "I thought that you would be able to get this far. Let's get this started." + }, + "victory": { + "1": "You got me. You are magnificent!", + "1_female": "You got me. You are magnificent!", + "2": "I never expected another trainer to beat me… I'm surprised.", + "2_female": "I never expected another trainer to beat me… I'm surprised." + }, + "defeat": { + "1": "That was close. Want to try again?", + "2": "It's not that you are weak. Don't let it bother you.", + "2_female": "It's not that you are weak. Don't let it bother you." + } + }, + "karen": { + "encounter": { + "1": "I am Karen. Would you care for a showdown with my Dark-type Pokémon?", + "2": "I am unlike those you've already met.", + "3": "You've assembled a charming team. Our battle should be a good one." + }, + "victory": { + "1": "No! I can't win. How did you become so strong?", + "2": "I will not stray from my chosen path.", + "3": "The Champion is looking forward to meeting you." + }, + "defeat": { + "1": "That's about what I expected.", + "2": "Well, that was relatively entertaining.", + "3": "Come visit me anytime." + } + }, + "milo": { + "encounter": { + "1": "Sure seems like you understand Pokémon real well. \n$This is gonna be a doozy of a battle! \n$I'll have to Dynamax my Pokémon if I want to win!" + }, + "victory": { + "1": "The power of Grass has wilted… What an incredible Challenger!", + "1_female": "The power of Grass has wilted… What an incredible Challenger!" + }, + "defeat": { + "1": "This'll really leave you in shock and awe." + } + }, + "lucian": { + "encounter": { + "1": "Just a moment, please. The book I'm reading has nearly reached its thrilling climax… \n$The hero has obtained a mystic sword and is about to face their final trial… Ah, never mind. \n$Since you've made it this far, I'll put that aside and battle you. \n$Let me see if you'll achieve as much glory as the hero of my book!" + }, + "victory": { + "1": "I see… It appears you've put me in checkmate." + }, + "defeat": { + "1": "I have a reputation to uphold." + } + }, + "drasna": { + "encounter": { + "1": "You must be a strong Trainer. Yes, quite strong indeed…\n$That's just wonderful news! Facing opponents like you and your team will make my Pokémon grow like weeds!", + "1_female": "You must be a strong Trainer. Yes, quite strong indeed…\n$That's just wonderful news! Facing opponents like you and your team will make my Pokémon grow like weeds!" + }, + "victory": { + "1": "Oh, dear me. That sure was a quick battle… I do hope you'll come back again sometime!" + }, + "defeat": { + "1": "How can this be?" + } + }, + "kahili": { + "encounter": { + "1": "So, here you are… Why don't we see who the winds favor today, you… Or me?" + }, + "victory": { + "1": "It's frustrating to me as a member of the Elite Four, but it seems your strength is the real deal." + }, + "defeat": { + "1": "That was an ace!" + } + }, + "hassel": { + "encounter": { + "1": "Prepare to learn firsthand how the fiery breath of ferocious battle feels!" + }, + "victory": { + "1": "Fortune smiled on me this time, but… \n$Judging from how the match went, who knows if I will be so lucky next time." + }, + "defeat": { + "1": "That was an ace!" + } + }, + "blue": { + "encounter": { + "1": "You must be pretty good to get this far.", + "1_female": "You must be pretty good to get this far." + }, + "victory": { + "1": "I've only lost to him and now to you… Him? Hee, hee…" + }, + "defeat": { + "1": "See? My power is what got me here." + } + }, + "piers": { + "encounter": { + "1": "Get ready for a mosh pit with me and my party! Spikemuth, it's time to rock!" + }, + "victory": { + "1": "Me an' my team gave it our best. Let's meet up again for a battle some time…" + }, + "defeat": { + "1": "My throat's ragged from shoutin'… But 'at was an excitin' battle!" + } + }, + "red": { + "encounter": { + "1": "…!" + }, + "victory": { + "1": "…?" + }, + "defeat": { + "1": "…!" + } + }, + "jasmine": { + "encounter": { + "1": "Oh… Your Pokémon are impressive. I think I will enjoy this." + }, + "victory": { + "1": "You are truly strong. I'll have to try much harder, too." + }, + "defeat": { + "1": "I never expected to win." + } + }, + "lance_champion": { + "encounter": { + "1": "I am still the Champion. I won't hold anything back." + }, + "victory": { + "1": "This is the emergence of a new Champion.", + "1_female": "This is the emergence of a new Champion." + }, + "defeat": { + "1": "I successfully defended my Championship." + } + }, + "steven": { + "encounter": { + "1": "Tell me… What have you seen on your journey with your Pokémon? \n$What have you felt, meeting so many other Trainers out there? \n$Traveling this rich land… Has it awoken something inside you? \n$I want you to come at me with all that you've learned. \n$My Pokémon and I will respond in turn with all that we know!" + }, + "victory": { + "1": "So I, the Champion, fall in defeat…" + }, + "defeat": { + "1": "That was time well spent! Thank you!" + } + }, + "cynthia": { + "encounter": { + "1": "I, Cynthia, accept your challenge! There won't be any letup from me!" + }, + "victory": { + "1": "No matter how fun the battle is, it will always end sometime…" + }, + "defeat": { + "1": "Even if you lose, never lose your love of Pokémon." + } + }, + "iris": { + "encounter": { + "1": "Know what? I really look forward to having serious battles with strong Trainers! \n$I mean, come on! The Trainers who make it here are Trainers who desire victory with every fiber of their being! \n$And they are battling alongside Pokémon that have been through countless difficult battles! \n$If I battle with people like that, not only will I get stronger, my Pokémon will, too! \n$And we'll get to know each other even better! OK! Brace yourself! \n$I'm Iris, the Pokémon League Champion, and I'm going to defeat you!" + }, + "victory": { + "1": "Aghhhh… I did my best, but we lost…" + }, + "defeat": { + "1": "Yay! We won!" + } + }, + "hau": { + "encounter": { + "1": "I wonder if a Trainer battles differently depending on whether they're from a warm region or a cold region.\n$Let's test it out!" + }, + "victory": { + "1": "That was awesome! I think I kinda understand your vibe a little better now!" + }, + "defeat": { + "1": "Ma-an, that was some kinda battle!" + } + }, + "geeta": { + "encounter": { + "1": "I decided to throw my hat in the ring once more. \n$Come now… Show me the fruits of your training." + }, + "victory": { + "1": "I eagerly await news of all your achievements!" + }, + "defeat": { + "1": "What's the matter? This isn't all, is it?" + } + }, + "nemona": { + "encounter": { + "1": "Yesss! I'm so psyched! Time for us to let loose!" + }, + "victory": { + "1": "Well, that stinks, but I still had fun! I'll getcha next time!" + }, + "defeat": { + "1": "Well, that was a great battle! Fruitful for sure." + } + }, + "leon": { + "encounter": { + "1": "We're gonna have an absolutely champion time!" + }, + "victory": { + "1": "My time as Champion is over… \n$But what a champion time it's been! \n$Thank you for the greatest battle I've ever had!" + }, + "defeat": { + "1": "An absolute champion time, that was!" + } + }, + "whitney": { + "encounter": { + "1": "Hey! Don't you think Pokémon are, like, super cute?" + }, + "victory": { + "1": "Waaah! Waaah! You're so mean!", + "1_female": "Waaah! Waaah! You're so mean!" + }, + "defeat": { + "1": "And that's that!" + } + }, + "chuck": { + "encounter": { + "1": "Hah! You want to challenge me? Are you brave or just ignorant?", + "1_female": "Hah! You want to challenge me? Are you brave or just ignorant?" + }, + "victory": { + "1": "You're strong! Would you please make me your apprentice?" + }, + "defeat": { + "1": "There. Do you realize how much more powerful I am than you?" + } + }, + "katy": { + "encounter": { + "1": "Don't let your guard down unless you would like to find yourself knocked off your feet!", + "1_female": "Don't let your guard down unless you would like to find yourself knocked off your feet!" + }, + "victory": { + "1": "All of my sweet little Pokémon dropped like flies!" + }, + "defeat": { + "1": "Eat up, my cute little Vivillon!" + } + }, + "pryce": { + "encounter": { + "1": "Youth alone does not ensure victory! Experience is what counts." + }, + "victory": { + "1": "Outstanding! That was perfect. Try not to forget what you feel now." + }, + "defeat": { + "1": "Just as I envisioned." + } + }, + "clair": { + "encounter": { + "1": "Do you know who I am? And you still dare to challenge me?" + }, + "victory": { + "1": "I wonder how far you can get with your skill level. This should be fascinating." + }, + "defeat": { + "1": "That's that." + } + }, + "maylene": { + "encounter": { + "1": "I've come to challenge you now, and I won't hold anything back. \n$Please prepare yourself for battle!", + "1_female": "I've come to challenge you now, and I won't hold anything back. \n$Please prepare yourself for battle!" + }, + "victory": { + "1": "I admit defeat…" + }, + "defeat": { + "1": "That was awesome." + } + }, + "fantina": { + "encounter": { + "1": "You shall challenge me, yes? But I shall win. \n$That is what the Gym Leader of Hearthome does, non?" + }, + "victory": { + "1": "You are so fantastically strong. I know why I have lost." + }, + "defeat": { + "1": "I am so, so, very happy!" + } + }, + "byron": { + "encounter": { + "1": "Trainer! You're young, just like my son, Roark. \n$With more young Trainers taking charge, the future of Pokémon is bright! \n$So, as a wall for young people, I'll take your challenge!", + "1_female": "Trainer! You're young, just like my son, Roark. \n$With more young Trainers taking charge, the future of Pokémon is bright! \n$So, as a wall for young people, I'll take your challenge!" + }, + "victory": { + "1": "Hmm! My sturdy Pokémon--defeated!" + }, + "defeat": { + "1": "Gwahahaha! How were my sturdy Pokémon?!" + } + }, + "olympia": { + "encounter": { + "1": "An ancient custom deciding one's destiny. The battle begins!" + }, + "victory": { + "1": "Create your own path. Let nothing get in your way. Your fate, your future." + }, + "defeat": { + "1": "Our path is clear now." + } + }, + "volkner": { + "encounter": { + "1": "Since you've come this far, you must be quite strong…\n$I hope you're the Trainer who'll make me remember how fun it is to battle!", + "1_female": "Since you've come this far, you must be quite strong…\n$I hope you're the Trainer who'll make me remember how fun it is to battle!" + }, + "victory": { + "1": "You've got me beat…\n$Your desire and the noble way your Pokémon battled for you… \n$I even felt thrilled during our match. That was a very good battle." + }, + "defeat": { + "1": "It was not shocking at all… \n$That is not what I wanted!" + } + }, + "burgh": { + "encounter": { + "1": "M'hm… If I win this battle, I feel like I can draw a picture unlike any before it. \n$OK! I can hear my battle muse loud and clear. Let's get straight to it!", + "2": "Of course, I'm really proud of all of my Pokémon! \n$Well now… Let's get right to it!" + }, + "victory": { + "1": "Is it over? Has my muse abandoned me?", + "2": "Hmm… It's over! You're incredible!" + }, + "defeat": { + "1": "Wow… It's beautiful somehow, isn't it…", + "2": "Sometimes I hear people say something was an ugly win. \n$I think if you're trying your best, any win is beautiful." + } + }, + "elesa": { + "encounter": { + "1": "C'est fini! When I'm certain of that, I feel an electric jolt run through my body! \n$I want to feel the sensation, so now my beloved Pokémon are going to make your head spin!" + }, + "victory": { + "1": "I meant to make your head spin, but you shocked me instead." + }, + "defeat": { + "1": "That was unsatisfying somehow… Will you give it your all next time?" + } + }, + "skyla": { + "encounter": { + "1": "It's finally time for a showdown! That means the Pokémon battle that decides who's at the top, right? \n$I love being on the summit! 'Cause you can see forever and ever from high places! \n$So, how about you and I have some fun?" + }, + "victory": { + "1": "Being your opponent in battle is a new source of strength to me. Thank you!" + }, + "defeat": { + "1": "Win or lose, you always gain something from a battle, right?" + } + }, + "brycen": { + "encounter": { + "1": "There is also strength in being with other people and Pokémon. \n$Receiving their support makes you stronger. I'll show you this power!" + }, + "victory": { + "1": "The wonderful combination of you and your Pokémon! What a beautiful friendship!" + }, + "defeat": { + "1": "Extreme conditions really test you and train you!" + } + }, + "drayden": { + "encounter": { + "1": "What I want to find is a young Trainer who can show me a bright future. \n$Let's battle with everything we have: your skill, my experience, and the love we've raised our Pokémon with!" + }, + "victory": { + "1": "This intense feeling that floods me after a defeat… I don't know how to describe it." + }, + "defeat": { + "1": "Harrumph! I know your ability is greater than that!" + } + }, + "grant": { + "encounter": { + "1": "There is only one thing I wish for. \n$That by surpassing one another, we find a way to even greater heights." + }, + "victory": { + "1": "You are a wall that I am unable to surmount!" + }, + "defeat": { + "1": "Do not give up. \n$That is all there really is to it. \n$The most important lessons in life are simple." + } + }, + "korrina": { + "encounter": { + "1": "Time for Lady Korrina's big appearance!" + }, + "victory": { + "1": "It's your very being that allows your Pokémon to evolve!" + }, + "defeat": { + "1": "What an explosive battle!" + } + }, + "clemont": { + "encounter": { + "1": "Oh! I'm glad that we got to meet!" + }, + "victory": { + "1": "Your passion for battle inspires me!" + }, + "defeat": { + "1": "Looks like my Trainer-Grow-Stronger Machine, Mach 2 is really working!" + } + }, + "valerie": { + "encounter": { + "1": "Oh, if it isn't a young Trainer… It is lovely to get to meet you like this. \n$Then I suppose you have earned yourself the right to a battle, as a reward for your efforts. \n$The elusive Fairy may appear frail as the breeze and delicate as a bloom, but it is strong.", + "1_female": "Oh, if it isn't a young Trainer… It is lovely to get to meet you like this. \n$Then I suppose you have earned yourself the right to a battle, as a reward for your efforts. \n$The elusive Fairy may appear frail as the breeze and delicate as a bloom, but it is strong." + }, + "victory": { + "1": "I hope that you will find things worth smiling about tomorrow…" + }, + "defeat": { + "1": "Oh goodness, what a pity…" + } + }, + "wulfric": { + "encounter": { + "1": "You know what? We all talk big about what you learn from battling and bonds and all that…\n$But really, I just do it 'cause it's fun. \n$Who cares about the grandstanding? Let's get to battling!" + }, + "victory": { + "1": "Outstanding! I'm tough as an iceberg, but you smashed me through and through!" + }, + "defeat": { + "1": "Tussle with me and this is what happens!" + } + }, + "kabu": { + "encounter": { + "1": "Every Trainer and Pokémon trains hard in pursuit of victory. \n$But that means your opponent is also working hard to win. \n$In the end, the match is decided by which side is able to unleash their true potential." + }, + "victory": { + "1": "I'm glad I could battle you today!" + }, + "defeat": { + "1": "That's a great way for me to feel my own growth!" + } + }, + "bea": { + "encounter": { + "1": "Do you have an unshakable spirit that won't be moved, no matter how you are attacked? \n$I think I'll just test that out, shall I?" + }, + "victory": { + "1": "I felt the fighting spirit of your Pokémon as you led them in battle." + }, + "defeat": { + "1": "That was the best sort of match anyone could ever hope for." + } + }, + "opal": { + "encounter": { + "1": "Let me have a look at how you and your partner Pokémon behave!" + }, + "victory": { + "1": "Your pink is still lacking, but you're an excellent Trainer with excellent Pokémon.", + "1_female": "Your pink is still lacking, but you're an excellent Trainer with excellent Pokémon." + }, + "defeat": { + "1": "Too bad for you, I guess." + } + }, + "bede": { + "encounter": { + "1": "I suppose I should prove beyond doubt just how pathetic you are and how strong I am.", + "1_female": "I suppose I should prove beyond doubt just how pathetic you are and how strong I am." + }, + "victory": { + "1": "I see… Well, that's fine. I wasn't really trying all that hard anyway." + }, + "defeat": { + "1": "Not a bad job, I suppose." + } + }, + "gordie": { + "encounter": { + "1": "So, let's get this over with." + }, + "victory": { + "1": "I just want to climb into a hole… Well, I guess it'd be more like falling from here." + }, + "defeat": { + "1": "Battle like you always do, victory will follow!" + } + }, + "marnie": { + "encounter": { + "1": "The truth is, when all's said and done… I really just wanna become Champion for myself! \n$So don't take it personal when I kick your butt!" + }, + "victory": { + "1": "OK, so I lost… But I got to see a lot of the good points of you and your Pokémon!" + }, + "defeat": { + "1": "Hope you enjoyed our battle tactics." + } + }, + "raihan": { + "encounter": { + "1": "I'm going to defeat the Champion, win the whole tournament, and prove to the world just how strong the great Raihan really is!" + }, + "victory": { + "1": "I look this good even when I lose. \n$It's a real curse. \n$Guess it's time for another selfie!" + }, + "defeat": { + "1": "Let's take a selfie to remember this." + } + }, + "brassius": { + "encounter": { + "1": "I assume you are ready? Let our collaborative work of art begin!", + "1_female": "I assume you are ready? Let our collaborative work of art begin!" + }, + "victory": { + "1": "Ahhh…vant-garde!" + }, + "defeat": { + "1": "I will begin on a new piece at once!" + } + }, + "iono": { + "encounter": { + "1": "How're ya feelin' about this battle?\n$...\n$Let's get this show on the road! How strong is our challenger? \n$I 'unno! Let's find out together!", + "1_female": "How're ya feelin' about this battle?\n$...\n$Let's get this show on the road! How strong is our challenger? \n$I 'unno! Let's find out together!" + }, + "victory": { + "1": "You're as flashy and bright as a 10,000,000-volt Thunderbolt, friendo!", + "1_female": "You're as flashy and bright as a 10,000,000-volt Thunderbolt, friendo!" + }, + "defeat": { + "1": "Your eyeballs are MINE!" + } + }, + "larry": { + "encounter": { + "1": "When all's said and done, simplicity is strongest." + }, + "victory": { + "1": "A serving of defeat, huh?" + }, + "defeat": { + "1": "I'll call it a day." + } + }, + "ryme": { + "encounter": { + "1": "Come on, baby! Rattle me down to the bone!" + }, + "victory": { + "1": "You're cool, my friend—you move my SOUL!", + "1_female": "You're cool, my friend—you move my SOUL!" + }, + "defeat": { + "1": "Later, baby!" + } + }, + "grusha": { + "encounter": { + "1": "All I need to do is make sure the power of my Pokémon chills you to the bone!" + }, + "victory": { + "1": "Your burning passion… I kinda like it, to be honest." + }, + "defeat": { + "1": "Things didn't heat up for you." + } + }, + "marnie_elite": { + "encounter": { + "1": "You've made it this far, huh? Let's see if you can handle my Pokémon!", + "2": "I'll give it my best shot, but don't think I'll go easy on you!" + }, + "victory": { + "1": "I can't believe I lost... But you deserved that win. Well done!", + "2": "Looks like I've still got a lot to learn. Great battle, though!" + }, + "defeat": { + "1": "You put up a good fight, but I've got the edge! Better luck next time!", + "2": "Seems like my training's paid off. Thanks for the battle!" + } + }, + "nessa_elite": { + "encounter": { + "1": "The tides are turning in my favor. Ready to get swept away?", + "1_female": "The tides are turning in my favor. Ready to get swept away?", + "2": "Let's make some waves with this battle! I hope you're prepared!", + "2_female": "Let's make some waves with this battle! I hope you're prepared!" + }, + "victory": { + "1": "You navigated those waters perfectly... Well done!", + "2": "Looks like my currents were no match for you. Great job!" + }, + "defeat": { + "1": "Water always finds a way. That was a refreshing battle!", + "2": "You fought well, but the ocean's power is unstoppable!" + } + }, + "bea_elite": { + "encounter": { + "1": "Prepare yourself! My fighting spirit burns bright!", + "2": "Let's see if you can keep up with my relentless pace!" + }, + "victory": { + "1": "Your strength... It's impressive. You truly deserve this win.", + "2": "I've never felt this intensity before. Amazing job!" + }, + "defeat": { + "1": "Another victory for my intense training regimen! Well done!", + "2": "You've got strength, but I trained harder. Great battle!" + } + }, + "allister_elite": { + "encounter": { + "1": "Shadows fall... Are you ready to face your fears?", + "1_female": "Shadows fall... Are you ready to face your fears?", + "2": "Let's see if you can handle the darkness that I command." + }, + "victory": { + "1": "You've dispelled the shadows... For now. Well done.", + "2": "Your light pierced through my darkness. Great job." + }, + "defeat": { + "1": "The shadows have spoken... Your strength isn't enough.", + "2": "Darkness triumphs... Maybe next time you'll see the light." + } + }, + "raihan_elite": { + "encounter": { + "1": "Storm's brewing! Let's see if you can weather this fight!", + "2": "Get ready to face the eye of the storm!" + }, + "victory": { + "1": "You've bested the storm... Incredible job!", + "2": "You rode the winds perfectly... Great battle!" + }, + "defeat": { + "1": "Another storm weathered, another victory claimed! Well fought!", + "2": "You got caught in my storm! Better luck next time!", + "2_female": "You got caught in my storm! Better luck next time!" + } + }, + "alder": { + "encounter": { + "1": "Prepare yourself for a match against the strongest Trainer in Unova!" + }, + "victory": { + "1": "Well done! You certainly are an unmatched talent." + }, + "defeat": { + "1": "A fresh wind blows through my heart...\n$What an extraordinary effort!" + } + }, + "kieran": { + "encounter": { + "1": "Through hard work, I become stronger and stronger!\n$I don't lose." + }, + "victory": { + "1": "I don't believe it...\n$What a fun and heart-pounding battle!" + }, + "defeat": { + "1": "Wowzers, what a battle!\n$Time for you to train even harder." + } + }, + "rival": { + "encounter": { + "1": "@c{smile}あっ、ここに いたんだ! 旅に 出る前に 「じゃ またね!」って くらい 聞きたかったよ……$@c{smile_eclosed}やっぱり 夢を 追ってこうと しているんだ? 信じられない ほどね……$@c{serious_smile_fists}じゃあ、 ここまで 来たから バトルしよっか? 覚悟してるかを 確かめたい から!$@c{serious_mopen_fists}遠慮せずに 全力で かかってこいぜ!" + }, + "victory": { + "1": "@c{shock}ウワッ、カンゼンに ぶっ壊したぜ。\n初心者だとは 思えないほど……$@c{smile}たぶん 運が良っかった だけが……\n最後まで 行ける素質が あるかもな!$こっちの アイテムを あげよう、 博士に そう言いつけたから。 結構 スゴそうな もんだ!$@c{serious_smile_fists}ここからも ガンバレ!" + } + }, + "rival_female": { + "encounter": { + "1": "@c{smile_wave}あ、ついに 見つけた! あちこち 探したのよ! \n@c{angry_mopen}だーい親友に お別れを 言うまでも 忘れちゃった?$@c{smile_ehalf}大切な 夢を 追っていくのね?\n やっぱり、この日が 来たのね……$@c{smile}とにかく! アタシを 忘れちゃったのを 許せる 条件は 一つ: \n@c{smile_wave_wink}アタシと バトルだ!$@c{angry_mopen}全力で かかってきなさい!\n冒険が 第一歩で 終わっちゃうと もったいない でしょう?" + }, + "victory": { + "1": "@c{shock}始まった バッカリなのに そんなに強い?!@d{96}\n@c{angry}完全に チートだろう?\n$@c{smile_wave_wink}なんちゃって!@d{64} @c{smile_eclosed}正々堂々と 負けたよ。 冒険 上手く行ける 気がするね!\n$@c{smile}ところで、こっち! 博士からの アイテムを あげるわ。きっと 便利だと 思うよ!\n$@c{smile_wave}いつも通り 頑張ってね! 信じてるから!" + } + }, + "rival_2": { + "encounter": { + "1": "@c{smile}おや、なんと グウゼン。\n@c{smile_eclosed}今までも パーフェクトに 勝った ようだな……\n$@c{serious_mopen_fists}なんか 忍び寄った みたいだとは 分かるけど、 そんなことない… ほとんどはな。\n$@c{serious_smile_fists}ぶっちゃけ言うと、 オレが 負けた時から 再戦したくて ウズウズしてたぜ。\n$張り切って 特訓したから 今は ちゃんと 勢い 見せるんだ。\n$@c{serious_mopen_fists}今回も 遠慮しな!\n行こうぜ!" + }, + "victory": { + "1": "@c{neutral_eclosed}あ。 自信過剰かも。\n$@c{smile}いいけどさ、 こうなるのを 見込んだから。\n@c{serious_mopen_fists}次回まで もっと頑張らなくちゃ ってことだよな!\n\n$@c{smile}きっと 助け 要らないんだが、 もう一つの アイテムが 欲しいかと 思ったから あげるぜ。\n\n$@c{serious_smile_fists}でも これで ラストだ!\n相手に 利点を あげ続けると 行けないんだろう!" + } + }, + "rival_2_female": { + "encounter": { + "1": "@c{smile_wave}あっ、 こんなとこで 偶然だね! まだ 倒れないようだ。@c{angry_mopen}フム、えらいえらい!\n$@c{angry_mopen}考えてるのは 分かる、 つきまとってるワケ じゃないから!@c{smile_eclosed}この辺に いただけよ。\n$@c{smile_ehalf}ここまで 頑張っていて 良かったけど、 時々 負けることも 大丈夫だと 知ってるよね?\n$@c{smile}みんなは 失敗から 学ぶ… いつまでも 成功し続ける よりもね。\n$@c{angry_mopen}とにかく! 再戦の ために 大変 トレーニングしてたから 全・勢・力で 戦おう!" + }, + "victory": { + "1": "@c{neutral}…今回は 負ける はずじゃなかった…\n$@c{smile}しょうがないね。 次回まで もっともっと トレーニングしなくちゃ ってこと!\n$@c{smile_wave}そして! もう二つの アイテム、 どうぞ!\n@c{smile_wave_wink}「ありがと」なんて 必要ない!\n$@c{angry_mopen}でもね、 これで 最後! 今から サービス 一つも あげないよ~" + }, + "defeat": { + "1": "時々 負けることも いいんだよ…" + } + }, + "rival_3": { + "encounter": { + "1": "@c{smile}Hey, look who it is! It's been a while.\n@c{neutral}You're… still undefeated? Huh.\n$@c{neutral_eclosed}Things have been kind of… strange.\nIt's not the same back home without you.\n$@c{serious}I know it's selfish, but I need to get this off my chest.\n@c{neutral_eclosed}I think you're in over your head here.\n$@c{serious}Never losing once is just unrealistic.\nWe need to lose sometimes in order to grow.\n$@c{neutral_eclosed}You've had a great run but there's still so much ahead, and it only gets harder. @c{neutral}Are you prepared for that?\n$@c{serious_mopen_fists}If so, prove it to me." + }, + "victory": { + "1": "@c{angry_mhalf}This is ridiculous… I've hardly stopped training…\nHow are we still so far apart?" + } + }, + "rival_3_female": { + "encounter": { + "1": "@c{smile_wave}ヒサブリ~! まだ 負けてないね。\n@c{angry}だんだん イラッと来る。@c{smile_wave_wink}なんちゃって!\n$@c{smile_ehalf}でもよ、 本当に ふるさとが 恋しくないの? それとも… アタシ…?\nずっと会いたいよ… あの、みんなはね!\n$@c{smile_eclosed}夢を 叶ってるのを 応援してるけど、 実際は やがて 負ける。\n$@c{smile}その時が 来たら アタシは いつも通り そばにいるよ。\n@c{angry_mopen}さあ、 ここまで 頑張ってきた アタシの 力を 見せさせて!" + }, + "victory": { + "1": "@c{shock}もう… 足りなかった…?\nこのままで 決して 帰らない だろう……" + }, + "defeat": { + "1": "ベストを 尽くした。 じゃ、 帰りましょう。" + } + }, + "rival_4": { + "encounter": { + "1": "@c{neutral}Hey.\n$I won't mince words or pleasantries with you.\n@c{neutral_eclosed}I'm here to win, plain and simple.\n$@c{serious_mhalf_fists}I've learned to maximize my potential by putting all my time into training.\n$@c{smile}You get a lot of extra time when you cut out the unnecessary sleep and social interaction.\n$@c{serious_mopen_fists}None of that matters anymore, not until I win.\n$@c{neutral_eclosed}I've even reached the point where I don't lose anymore.\n@c{smile_eclosed}I suppose your philosophy wasn't so wrong after all.\n$@c{angry_mhalf}Losing is for the weak, and I'm not weak anymore.\n$@c{serious_mopen_fists}Prepare yourself." + }, + "victory": { + "1": "@c{neutral}What…@d{64} What are you?" + } + }, + "rival_4_female": { + "encounter": { + "1": "@c{neutral}アタシよ! また 忘れちゃった… のね?\n$@c{smile}こんな 遠くまで 来たのは 鼻が高いことだよ! おめでと~\nしかし、 ここは 終着点だね。\n$@c{smile_eclosed}アタシの 中にある 全然 知らなかった 部分を 目覚めたよ。\n今は、 トレーニングしか してないみたい。\n$@c{smile_ehalf}食べたり 寝たりも しなくて 朝から晩まで ポケモンを 育って、 毎日 昨日より 強くなってる。\n$@c{neutral}実は… もう 自分 認識できない。\n$結局、 峠を越して まるで カミに なった。\n今は 誰にも アタシを 倒せないと 思う。\n$ねえ、分かる? 全ては アンタの お陰で。\n@c{smile_ehalf}お礼を言うか アンタのこと嫌いか どうしたらいいの 分からない。\n$@c{angry_mopen}覚悟しなさい。" + }, + "victory": { + "1": "@c{neutral}一体…@d{64} 何モノか…?" + }, + "defeat": { + "1": "$@c{smile}ここまで 頑張ってたのを 誇りに思ってね。" + } + }, + "rival_5": { + "encounter": { + "1": "@c{neutral}…" + }, + "victory": { + "1": "@c{neutral}…" + } + }, + "rival_5_female": { + "encounter": { + "1": "@c{neutral}…" + }, + "victory": { + "1": "@c{neutral}…" + }, + "defeat": { + "1": "$@c{smile_ehalf}…" + } + }, + "rival_6": { + "encounter": { + "1": "@c{smile_eclosed}We meet again.\n$@c{neutral}I've had some time to reflect on all this.\nThere's a reason this all seems so strange.\n$@c{neutral_eclosed}Your dream, my drive to beat you…\nIt's all a part of something greater.\n$@c{serious}This isn't about me, or about you… This is about the world, @c{serious_mhalf_fists}and it's my purpose to push you to your limits.\n$@c{neutral_eclosed}Whether I've fulfilled that purpose I can't say, but I've done everything in my power.\n$@c{neutral}This place we ended up in is terrifying… Yet somehow I feel unphased, like I've been here before.\n$@c{serious_mhalf_fists}You feel the same, don't you?\n$@c{serious}…and it's like something here is speaking to me.\nThis is all the world's known for a long time now.\n$Those times we cherished together that seem so recent are nothing but a distant memory.\n$@c{neutral_eclosed}Who can say whether they were ever even real in the first place.\n$@c{serious_mopen_fists}You need to keep pushing, because if you don't, it will never end. You're the only one who can do this.\n$@c{serious_smile_fists}I hardly know what any of this means, I just know that it's true.\n$@c{serious_mopen_fists}If you can't defeat me here and now, you won't stand a chance." + }, + "victory": { + "1": "@c{smile_eclosed}It looks like my work is done here.\n$I want you to promise me one thing.\n@c{smile}After you heal the world, please come home." + } + }, + "rival_6_female": { + "encounter": { + "1": "@c{smile_ehalf}また アタシたちだけに なった。\n$@c{smile_eclosed}ねえ、 頭の中に グルグル 巡ることが あってよ。\n$@c{smile_ehalf}アタシとアナタの 間に 起こしたことも, この変な感情も……\n$@c{smile}アナタの夢、 アタシの野心…\n$アタシたちが し続けることも 全ては… より高い 目的が あると思うよ。\n$@c{smile_eclosed}最果ての 限界まで 押すこと… それは アタシの 役割だと思う。\n$@c{smile_ehalf}今まで 役割を 上手く果たせたかは 分からないけど…… 一生懸命 頑張った。\n$こんな奇妙な 恐ろしい場所で なんか… 全てが 明らかに 見られるみたい。\n$昔から… これだけしかは この世界こそ そのもの。\n$@c{smile_eclosed}アタシたちが 大切にした 心にギュッと 抱いた思い出… もう 思い出せない。\n$@c{smile_ehalf}本当は 全部 ウソだったの? 今は 遠い彼方に あるみたい。\n$@c{angry_mopen}アナタは 最後まで 戦い続けなければ 決して 終わらない。 アナタしか できないのよ。\n$@c{smile_ehalf}この全ての 意味、 全然 分からないけど… 真実だと 感じてる。\n$@c{neutral}今ここで アタシを 倒せないと 最後に 勝ち目は ナイ。" + }, + "victory": { + "1": "@c{smile_ehalf}役割… 果たせたと思う。\n$@c{smile_eclosed}ね、 約束して。 この世界を 癒やしたら… お願い 無事に 帰って。\n$@c{smile_ehalf}……ありがとう。" + } + } +} diff --git a/src/locales/ja/fight-ui-handler.json b/src/locales/ja/fight-ui-handler.json index 2318cebd2d3..41ec140c2ca 100644 --- a/src/locales/ja/fight-ui-handler.json +++ b/src/locales/ja/fight-ui-handler.json @@ -1,7 +1,7 @@ { "pp": "PP", - "power": "いりょく", - "accuracy": "めいちゅう", - "abilityFlyInText": " {{pokemonName}}の {{passive}}{{abilityName}}", - "passive": "Passive " -} \ No newline at end of file + "power": "威力", + "accuracy": "命中", + "abilityFlyInText": " {{pokemonName}}の\n{{passive}}:{{abilityName}}", + "passive": "パッシブ " +} diff --git a/src/locales/ja/filter-bar.json b/src/locales/ja/filter-bar.json index c09705d9b50..891b7d87674 100644 --- a/src/locales/ja/filter-bar.json +++ b/src/locales/ja/filter-bar.json @@ -32,7 +32,7 @@ "noPokerus": "ポケルス - なし", "sortByNumber": "No.", "sortByCost": "ポイント", - "sortByCandies": "飴の数", + "sortByCandies": "アメの数", "sortByIVs": "個体値", "sortByName": "名前" -} \ No newline at end of file +} diff --git a/src/locales/ja/game-stats-ui-handler.json b/src/locales/ja/game-stats-ui-handler.json index 2fff802734a..25301aa4297 100644 --- a/src/locales/ja/game-stats-ui-handler.json +++ b/src/locales/ja/game-stats-ui-handler.json @@ -12,26 +12,26 @@ "dailyRunAttempts": "デイリーラン", "dailyRunWins": "デイリーラン勝利", "endlessRuns": "エンドレスラン", - "highestWaveEndless": "エンドレス最高波", + "highestWaveEndless": "エンドレス最高ラウンド", "highestMoney": "最大貯金", "highestDamage": "最大ダメージ", "highestHPHealed": "最大HP回復", "pokemonEncountered": "遭遇したポケモン", "pokemonDefeated": "倒したポケモン", "pokemonCaught": "捕まえたポケモン", - "eggsHatched": "孵化したタマゴ", + "eggsHatched": "ふかしたタマゴ", "subLegendsSeen": "見つけた順伝説ポケモン", "subLegendsCaught": "捕まえた準伝説ポケモン", - "subLegendsHatched": "孵化した準伝説ポケモン", + "subLegendsHatched": "ふかした準伝説ポケモン", "legendsSeen": "見つけた伝説ポケモン", "legendsCaught": "捕まえた伝説ポケモン", - "legendsHatched": "孵化した伝説ポケモン", + "legendsHatched": "ふかした伝説ポケモン", "mythicalsSeen": "見つけた幻ポケモン", "mythicalsCaught": "捕まえた幻ポケモン", - "mythicalsHatched": "孵化した幻ポケモン", + "mythicalsHatched": "ふかした幻ポケモン", "shiniesSeen": "見つけた色違いポケモン", "shiniesCaught": "捕まえた色違いポケモン", - "shiniesHatched": "孵化した色違いポケモン", + "shiniesHatched": "ふかした色違いポケモン", "pokemonFused": "吸収合体したポケモン", "trainersDefeated": "倒したトレーナー", "eggsPulled": "引いたタマゴ", diff --git a/src/locales/ja/growth.json b/src/locales/ja/growth.json index 3d23fa1f46d..e5c1317632f 100644 --- a/src/locales/ja/growth.json +++ b/src/locales/ja/growth.json @@ -1,8 +1,8 @@ { - "Erratic": "60まんタイプ", - "Fast": "80まんタイプ", - "Medium_Fast": "100まんタイプ", - "Medium_Slow": "105まんタイプ", - "Slow": "125まんタイプ", - "Fluctuating": "164まんタイプ" -} \ No newline at end of file + "Erratic": "60万タイプ", + "Fast": "80万タイプ", + "Medium_Fast": "100万タイプ", + "Medium_Slow": "105万タイプ", + "Slow": "125万タイプ", + "Fluctuating": "164万タイプ" +} diff --git a/src/locales/ja/menu-ui-handler.json b/src/locales/ja/menu-ui-handler.json index 1930c3999c6..851c8478e9d 100644 --- a/src/locales/ja/menu-ui-handler.json +++ b/src/locales/ja/menu-ui-handler.json @@ -24,6 +24,6 @@ "linkGoogle": "Google連携", "unlinkGoogle": "Google連携解除", "cancel": "キャンセル", - "losingProgressionWarning": "戦闘開始からの データが 保存されません。\nよろしいですか?", - "noEggs": "現在は タマゴを 孵化していません!" + "losingProgressionWarning": "戦闘開始からの データが セーブされません。\nよろしいですか?", + "noEggs": "現在は タマゴを ふかしていません!" } diff --git a/src/locales/ja/modifier-type.json b/src/locales/ja/modifier-type.json index 6effb1d9d82..e249e3c430f 100644 --- a/src/locales/ja/modifier-type.json +++ b/src/locales/ja/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "バトル{{battleCount}}かいのあいだ ダブルバトルになるかくりつを2ばいにする" }, - "TempBattleStatBoosterModifierType": { - "description": "すべてのパーティメンバーの {{tempBattleStatName}}を5かいのバトルのあいだ 1だんかいあげる" + "TempStatStageBoosterModifierType": { + "description": "すべてのパーティメンバーの {{stat}}を5かいのバトルのあいだ 1だんかいあげる" }, "AttackTypeBoosterModifierType": { "description": "ポケモンの {{moveType}}タイプのわざのいりょくを20パーセントあげる" @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "すべてのパーティメンバーのレベルを1あげる" }, - "PokemonBaseStatBoosterModifierType": { - "description": "ポケモンの{{statName}}のきほんステータスを10パーセントあげる。こたいちがたかいほどスタックのげんかいもたかくなる。" + "BaseStatBoosterModifierType": { + "description": "ポケモンの{{stat}}のきほんステータスを10パーセントあげる。こたいちがたかいほどスタックのげんかいもたかくなる。" }, "AllPokemonFullHpRestoreModifierType": { "description": "すべてのポケモンのHPを100パーセントかいふくする" @@ -248,6 +248,12 @@ "name": "ピントレンズ", "description": "弱点が 見える レンズ。持たせた ポケモンの技が 急所に 当たりやすくなる。" }, + "DIRE_HIT": { + "name": "クリティカット", + "extra": { + "raises": "きゅうしょりつ" + } + }, "LEEK": { "name": "ながねぎ", "description": "とても長くて 硬いクキ。カモネギに 持たせると 技が 急所に 当たりやすくなる。" @@ -347,7 +353,7 @@ "description": "やせいのポケモンがかくれとくせいをもつかくりつをおおきくふやす" }, "IV_SCANNER": { - "name": "こたいち たんちき", + "name": "こたいちスキャナー", "description": "やせいのポケモンのこたいちをスキャンできる。スタックごとに2つのこたいちがあきらかになる。もっともたかいこたいちがさいしょにひょうじされる" }, "DNA_SPLICERS": { @@ -411,25 +417,13 @@ "description": "メタモンに 持たせると 素早さが あがる 不思議 粉。とても こまかくて 硬い。" } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "プラスパワー", "x_defense": "ディフェンダー", "x_sp_atk": "スペシャルアップ", "x_sp_def": "スペシャルガード", "x_speed": "スピーダー", - "x_accuracy": "ヨクアタール", - "dire_hit": "クリティカット" - }, - "TempBattleStatBoosterStatName": { - "ATK": "こうげき", - "DEF": "ぼうぎょ", - "SPATK": "とくこう", - "SPDEF": "とくぼう", - "SPD": "すばやさ", - "ACC": "めいちゅう", - "CRIT": "きゅうしょりつ", - "EVA": "かいひ", - "DEFAULT": "???" + "x_accuracy": "ヨクアタール" }, "AttackTypeBoosterItem": { "silk_scarf": "シルクのスカーフ", @@ -569,4 +563,4 @@ "DOUSE_DRIVE": "アクアカセット", "ULTRANECROZIUM_Z": "ウルトラネクロZ" } -} \ No newline at end of file +} diff --git a/src/locales/ja/modifier.json b/src/locales/ja/modifier.json index 30d5270d94f..c33bb9be151 100644 --- a/src/locales/ja/modifier.json +++ b/src/locales/ja/modifier.json @@ -1,12 +1,12 @@ { "surviveDamageApply": "{{pokemonNameWithAffix}}は\n{{typeName}}で もちこたえた!", - "turnHealApply": "{{pokemonNameWithAffix}}は\n{{typeName}}で 少し 回復!", - "hitHealApply": "{{pokemonNameWithAffix}}は\n{{typeName}}で 少し 回復!", + "turnHealApply": "{{pokemonNameWithAffix}}は\n{{typeName}}で 少し 体力を 回復した!", + "hitHealApply": "{{pokemonNameWithAffix}}は\n{{typeName}}で 少し 体力を 回復した!", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}}は\n{{typeName}}で 復活した!", - "pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}は {{typeName}}で\n下がった能力が 元に戻った!", + "resetNegativeStatStageApply": "{{pokemonNameWithAffix}}は {{typeName}}で\n下がった能力が 元に戻った!", "moneyInterestApply": "{{typeName}}から {{moneyAmount}}円 取得した!", - "turnHeldItemTransferApply": "{{pokemonName}}の {{typeName}}が\n{{pokemonNameWithAffix}}の {{itemName}}を 吸い取った!", - "contactHeldItemTransferApply": "{{pokemonName}}の {{typeName}}が\n{{pokemonNameWithAffix}}の {{itemName}}を うばい取った!", + "turnHeldItemTransferApply": "{{pokemonName}}の {{typeName}}が\n{{pokemonNameWithAffix}}の {{itemName}}を 吸い取った!", + "contactHeldItemTransferApply": "{{pokemonName}}の {{typeName}}が\n{{pokemonNameWithAffix}}の {{itemName}}を 奪い取った!", "enemyTurnHealApply": "{{pokemonNameWithAffix}}は\n体力を 回復!", "bypassSpeedChanceApply": "{{pokemonName}}は {{itemName}}で\n行動が はやくなった!" -} \ No newline at end of file +} diff --git a/src/locales/ja/move-trigger.json b/src/locales/ja/move-trigger.json index 0c404feeed6..7449d8c6e4b 100644 --- a/src/locales/ja/move-trigger.json +++ b/src/locales/ja/move-trigger.json @@ -1,62 +1,69 @@ { - "hitWithRecoil": "{{pokemonName}}は\nはんどうによる ダメージを うけた!", - "cutHpPowerUpMove": "{{pokemonName}}は\nたいりょくを けずって パワーぜんかい!", - "absorbedElectricity": "{{pokemonName}}は\n でんきを きゅうしゅうした!", - "switchedStatChanges": "{{pokemonName}}は あいてと じぶんのn\nのうりょくへんかを いれかえた!", - "goingAllOutForAttack": "{{pokemonName}}は\nほんきを だした!", - "regainedHealth": "{{pokemonName}}は\nたいりょくを かいふくした!", - "keptGoingAndCrashed": "いきおいあまって {{pokemonName}}は\nじめんに ぶつかった!", - "fled": "{{pokemonName}}は にげだした!", - "cannotBeSwitchedOut": "{{pokemonName}}を\nもどすことが できない!", - "swappedAbilitiesWithTarget": "{{pokemonName}}は\nおたがいの とくせいを いれかえた!", - "coinsScatteredEverywhere": "こばんが あたりに ちらばった!", + "hitWithRecoil": "{{pokemonName}}は\n反動による ダメージを 受けた!", + "cutHpPowerUpMove": "{{pokemonName}}は\n体力を 削って 技の 威力を 上がった!", + "absorbedElectricity": "{{pokemonName}}は\n 電気を 吸収した!", + "switchedStatChanges": "{{pokemonName}}は 相手と 自分の\n能力変化を 入れ替えた!", + "switchedTwoStatChanges": "{{pokemonName}}は 相手と 自分の {{firstStat}}と\n{{secondStat}}の 能力変化を 入れ替えた!", + "switchedStat": "{{pokemonName}}は 相手と {{stat}}を 入れ替えた!", + "sharedGuard": "{{pokemonName}}は\nお互いのガードを シェアした!", + "sharedPower": "{{pokemonName}}は\nお互いのパワーを シェアした!", + "goingAllOutForAttack": "{{pokemonName}}は\n本気を 出した!", + "regainedHealth": "{{pokemonName}}は\n体力を 回復した!", + "keptGoingAndCrashed": "勢い余って {{pokemonName}}は\n地面に ぶつかった!", + "fled": "{{pokemonName}}は 逃げ出した!", + "cannotBeSwitchedOut": "{{pokemonName}}を\n戻すことが できない!", + "swappedAbilitiesWithTarget": "{{pokemonName}}は\nお互いの 特性を 入れ替えた!", + "coinsScatteredEverywhere": "小判が 辺りに 散らばった!", "attackedByItem": "{{pokemonName}}に\n{{itemName}}が おそいかかる!", - "whippedUpAWhirlwind": "{{pokemonName}}の まわりで\nくうきが うずをまく!", - "flewUpHigh": "{{pokemonName}}は\nそらたかく とびあがった!", - "tookInSunlight": "{{pokemonName}}は\nひかりを きゅうしゅうした!", - "dugAHole": "{{pokemonName}}は\nじめんに もぐった!", - "loweredItsHead": "{{pokemonName}}は\nくびを ひっこめた!", - "isGlowing": "{{pokemonName}}を\nはげしいひかりが つつむ!", - "bellChimed": "すずのおとが ひびきわたった!", - "foresawAnAttack": "{{pokemonName}}は\nみらいに こうげきを よちした!", - "hidUnderwater": "{{pokemonName}}は\nすいちゅうに みをひそめた!", - "soothingAromaWaftedThroughArea": "ここちよい かおりが ひろがった!", - "sprangUp": "{{pokemonName}}は\nたかく とびはねた!", - "choseDoomDesireAsDestiny": "{{pokemonName}}は\nはめつのねがいを みらいに たくした!", - "vanishedInstantly": "{{pokemonName}}の すがたが\nいっしゅんにして きえた!", - "tookTargetIntoSky": "{{pokemonName}}は {{targetName}}を\nじょうくうに つれさった!", - "becameCloakedInFreezingLight": "{{pokemonName}}は\nつめたいひかりに つつまれた!", - "becameCloakedInFreezingAir": "{{pokemonName}}は\nこごえるくうきに つつまれた!", - "isChargingPower": "{{pokemonName}}は\nパワーを ためこんでいる!", - "burnedItselfOut": "{{pokemonName}}の ほのうは\nもえつきた!", - "startedHeatingUpBeak": "{{pokemonName}}は\nクチバシを かねつしはじめた!", + "whippedUpAWhirlwind": "{{pokemonName}}の 周りで\n空気が 渦を巻く!", + "flewUpHigh": "{{pokemonName}}は\n空高く 飛び上がった!", + "tookInSunlight": "{{pokemonName}}は\n光を 吸収した!", + "dugAHole": "{{pokemonName}}は\n地面に 潜った!", + "loweredItsHead": "{{pokemonName}}は\n首を 引っ込めた!", + "isGlowing": "{{pokemonName}}を\n激しい光が 包む!", + "bellChimed": "鈴の音が 響き渡った!", + "foresawAnAttack": "{{pokemonName}}は\n未来に 攻撃を 予知した!", + "isTighteningFocus": "{{pokemonName}}は\n集中力を 高めている!", + "hidUnderwater": "{{pokemonName}}は\n水中に 身を潜めた!", + "soothingAromaWaftedThroughArea": "心地よい 香りが 広がった!", + "sprangUp": "{{pokemonName}}は\n高く 飛び跳ねた!", + "choseDoomDesireAsDestiny": "{{pokemonName}}は\nはめつのねがいを 未来に 託した!", + "vanishedInstantly": "{{pokemonName}}の 姿が\n一瞬にして 消えた!", + "tookTargetIntoSky": "{{pokemonName}}は {{targetName}}を\n上空に 連れ去った!", + "becameCloakedInFreezingLight": "{{pokemonName}}は\n冷たい光に 包まれた!", + "becameCloakedInFreezingAir": "{{pokemonName}}は\n凍える空気に 包まれた!", + "isChargingPower": "{{pokemonName}}は\nパワーを 溜め込んでいる!", + "burnedItselfOut": "{{pokemonName}}の 炎は 燃え尽きた!", + "startedHeatingUpBeak": "{{pokemonName}}は\nクチバシを 加熱し始めた!", "setUpShellTrap": "{{pokemonName}}は\nトラップシェルを 仕掛けた!", - "isOverflowingWithSpacePower": "{{pokemonName}}に\nうちゅうの ちからが あふれだす!", - "usedUpAllElectricity": "{{pokemonName}}は\nでんきを つかいきった!", - "stoleItem": "{{pokemonName}}は\n{{targetName}}の {{itemName}}を ぬすんだ!", - "incineratedItem": "{{pokemonName}}は\n{{targetName}}の {{itemName}}を もやした!", - "knockedOffItem": "{{pokemonName}}は\n{{targetName}}の {{itemName}}を はたきおとした!", - "tookMoveAttack": "{{pokemonName}}は\n{{moveName}}の こうげきを うけた!", - "cutOwnHpAndMaximizedStat": "{{pokemonName}}は\nたいりょくを けずって {{statName}}ぜんかい!", - "copiedStatChanges": "{{pokemonName}}は {{targetName}}の\nのうりょくへんかを コピーした!", + "isOverflowingWithSpacePower": "{{pokemonName}}に\n宇宙の 力が 溢れ出す!", + "usedUpAllElectricity": "{{pokemonName}}は\n電気を 使い切った!", + "stoleItem": "{{pokemonName}}は\n{{targetName}}の {{itemName}}を 盗んだ!", + "incineratedItem": "{{pokemonName}}は\n{{targetName}}の {{itemName}}を 燃やした!", + "knockedOffItem": "{{pokemonName}}は\n{{targetName}}の {{itemName}}を はたき落とした!", + "tookMoveAttack": "{{pokemonName}}は\n{{moveName}}の 攻撃を 受けた!", + "cutOwnHpAndMaximizedStat": "{{pokemonName}}は\n体力を 削って {{statName}}全開!", + "copiedStatChanges": "{{pokemonName}}は {{targetName}}の\n能力変化を コピーした!", "magnitudeMessage": "マグニチュード{{magnitude}}!", - "tookAimAtTarget": "{{pokemonName}}は {{targetName}}に\nねらいを さだめた!", + "tookAimAtTarget": "{{pokemonName}}は {{targetName}}に\n狙いを 定めた!", "transformedIntoType": "{{pokemonName}}は\n{{typeName}}タイプに なった!", "copiedMove": "{{pokemonName}}は\n{{moveName}}を コピーした!", "sketchedMove": "{{pokemonName}}は\n{{moveName}}を スケッチした!", - "acquiredAbility": "{{pokemonName}}の とくせいが\n{{abilityName}}に なった!", + "acquiredAbility": "{{pokemonName}}の 特性が\n{{abilityName}}に なった!", "copiedTargetAbility": "{{pokemonName}}は\n{{targetName}}の {{abilityName}}を コピーした!", - "transformedIntoTarget": "{{pokemonName}}は\n{{targetName}}に へんしんした!", - "tryingToTakeFoeDown": "{{pokemonName}}は あいてを\nみちづれに しようとしている!", - "addType": "{{pokemonName}}に\n{{typeName}}タイプが ついかされた!", - "cannotUseMove": "{{pokemonName}}は\n{{moveName}}を つかえなかった!", - "healHp": "{{pokemonName}}の\nたいりょくが かいふくした!", - "sacrificialFullRestore": "{{pokemonName}}の\nねがいごとが かなった!", - "invertStats": "{{pokemonName}}の\nのうりょくへんかが ぎゃくてんした!", - "resetStats": "{{pokemonName}}の\nのうりょくへんかが もとにもどった!", - "faintCountdown": "{{pokemonName}}は\n{{turnCount}}ターンごに ほろびてしまう!", + "transformedIntoTarget": "{{pokemonName}}は\n{{targetName}}に 変身した!", + "tryingToTakeFoeDown": "{{pokemonName}}は 相手を\nみちづれに しようとしている!", + "addType": "{{pokemonName}}に\n{{typeName}}タイプが 追加された!", + "cannotUseMove": "{{pokemonName}}は\n{{moveName}}を 使えなかった!", + "healHp": "{{pokemonName}}の\n体力が 回復した!", + "sacrificialFullRestore": "{{pokemonName}}の\nいやしのねがいが 叶った!", + "invertStats": "{{pokemonName}}は\n能力変化が ひっくり返った!", + "resetStats": "{{pokemonName}}の\n能力変化が 元に戻った!", + "statEliminated": "全ての 能力変化が 元に戻った!", + "faintCountdown": "{{pokemonName}}は\n{{turnCount}}ターン後に 滅びてしまう!", "copyType": "{{pokemonName}}は {{targetPokemonName}}と\n同じタイプに なった!", - "suppressAbilities": "{{pokemonName}}の とくせいが きかなくなった!", + "suppressAbilities": "{{pokemonName}}の 特性が 効かなくなった!", "revivalBlessing": "{{pokemonName}}は\n復活して 戦えるようになった!", - "swapArenaTags": "{{pokemonName}}は\nおたがいの ばのこうかを いれかえた!" -} \ No newline at end of file + "swapArenaTags": "{{pokemonName}}は\nお互いの 場の 効果を 入れ替えた!", + "exposedMove": "{{pokemonName}}は {{targetPokemonName}}の\n正体を 見破った!" +} diff --git a/src/locales/ja/party-ui-handler.json b/src/locales/ja/party-ui-handler.json index a3a88b2dd6e..b112653c544 100644 --- a/src/locales/ja/party-ui-handler.json +++ b/src/locales/ja/party-ui-handler.json @@ -1,8 +1,8 @@ { - "SEND_OUT": "いれかえる", - "SUMMARY": "つよさをみる", + "SEND_OUT": "入れ替える", + "SUMMARY": "強さを見る", "CANCEL": "やめる", - "RELEASE": "にがす", - "APPLY": "つかう", - "TEACH": "おしえる" -} \ No newline at end of file + "RELEASE": "逃がす", + "APPLY": "使う", + "TEACH": "教える" +} diff --git a/src/locales/ja/pokemon-info-container.json b/src/locales/ja/pokemon-info-container.json index 796ac706731..287eed23c74 100644 --- a/src/locales/ja/pokemon-info-container.json +++ b/src/locales/ja/pokemon-info-container.json @@ -1,7 +1,7 @@ { - "moveset": "わざ", - "gender": "せいべつ:", - "ability": "とくせい:", - "nature": "せいかく:", - "form": "すがた:" -} \ No newline at end of file + "moveset": "技", + "gender": "性別:", + "ability": "特性:", + "nature": "性格:", + "form": "姿:" +} diff --git a/src/locales/ja/pokemon-summary.json b/src/locales/ja/pokemon-summary.json index 9e26dfeeb6e..cf35befe6fd 100644 --- a/src/locales/ja/pokemon-summary.json +++ b/src/locales/ja/pokemon-summary.json @@ -1 +1,44 @@ -{} \ No newline at end of file +{ + "pokemonInfo": "ポケモン情報", + "status": "ステータス", + "powerAccuracyCategory": "威力\n命中\n分類", + "type": "タイプ", + "unknownTrainer": "???", + "ot": "親", + "nature": "性格", + "expPoints": "経験値", + "nextLv": "次のレベルまで", + "cancel": "キャンセル", + "memoString": "{{natureFragment}}な性格。\n{{metFragment}}", + "metFragment": { + "normal": "{{biome}}で\nLv.{{level}}の時に出会った。", + "apparently": "{{biome}}で\nLv.{{level}}の時に出会ったようだ。" + }, + "natureFragment": { + "Hardy": "{{nature}}", + "Lonely": "{{nature}}", + "Brave": "{{nature}}", + "Adamant": "{{nature}}", + "Naughty": "{{nature}}", + "Bold": "{{nature}}", + "Docile": "{{nature}}", + "Relaxed": "{{nature}}", + "Impish": "{{nature}}", + "Lax": "{{nature}}", + "Timid": "{{nature}}", + "Hasty": "{{nature}}", + "Serious": "{{nature}}", + "Jolly": "{{nature}}", + "Naive": "{{nature}}", + "Modest": "{{nature}}", + "Mild": "{{nature}}", + "Quiet": "{{nature}}", + "Bashful": "{{nature}}", + "Rash": "{{nature}}", + "Calm": "{{nature}}", + "Gentle": "{{nature}}", + "Sassy": "{{nature}}", + "Careful": "{{nature}}", + "Quirky": "{{nature}}" + } +} diff --git a/src/locales/ja/run-history.json b/src/locales/ja/run-history.json index 222f7de728d..3bf9de32c68 100644 --- a/src/locales/ja/run-history.json +++ b/src/locales/ja/run-history.json @@ -28,10 +28,10 @@ "SPDshortened": "速さ", "runInfo": "ラン情報", "money": "お金", - "runLength": "ラン最高ウェーブ", - "viewHeldItems": "手持ちアイテム", - "hallofFameText": "殿堂へようこそ!", - "hallofFameText_female": "殿堂へようこそ!", + "runLength": "時間", + "viewHeldItems": "持たせたアイテム", + "hallofFameText": "殿堂入り おめでとう!", + "hallofFameText_female": "殿堂入り おめでとう!", "viewHallOfFame": "殿堂登録を見る!", "viewEndingSplash": "クリア後のアートを見る!" -} \ No newline at end of file +} diff --git a/src/locales/ja/save-slot-select-ui-handler.json b/src/locales/ja/save-slot-select-ui-handler.json index a84e3aca23d..73250a08f4b 100644 --- a/src/locales/ja/save-slot-select-ui-handler.json +++ b/src/locales/ja/save-slot-select-ui-handler.json @@ -1,7 +1,7 @@ { "overwriteData": "選択した スロットに データを 上書きします?", "loading": "読込中…", - "wave": "波", + "wave": "ラウンド", "lv": "Lv", "empty": "なし" -} \ No newline at end of file +} diff --git a/src/locales/ja/settings.json b/src/locales/ja/settings.json index 4cb10c670de..55d39ee70a4 100644 --- a/src/locales/ja/settings.json +++ b/src/locales/ja/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "タッチ移動操作", "shopOverlayOpacity": "ショップオーバレイ不透明度", "shopCursorTarget": "ショップカーソル初位置", - "items": "アイテム", + "rewards": "ご褒美", "reroll": "選択肢変更", "shop": "ショップ", "checkTeam": "手持ちを確認" diff --git a/src/locales/ja/splash-messages.json b/src/locales/ja/splash-messages.json index 9e26dfeeb6e..b7378e7a916 100644 --- a/src/locales/ja/splash-messages.json +++ b/src/locales/ja/splash-messages.json @@ -1 +1,36 @@ -{} \ No newline at end of file +{ + "battlesWon": "Battles Won!", + "joinTheDiscord": "Join the Discord!", + "infiniteLevels": "Infinite Levels!", + "everythingStacks": "Everything Stacks!", + "optionalSaveScumming": "Optional Save Scumming!", + "biomes": "35 Biomes!", + "openSource": "Open Source!", + "playWithSpeed": "Play with 5x Speed!", + "liveBugTesting": "Live Bug Testing!", + "heavyInfluence": "Heavy RoR2 Influence!", + "pokemonRiskAndPokemonRain": "Pokémon Risk and Pokémon Rain!", + "nowWithMoreSalt": "Now with 33% More Salt!", + "infiniteFusionAtHome": "Infinite Fusion at Home!", + "brokenEggMoves": "Broken Egg Moves!", + "magnificent": "Magnificent!", + "mubstitute": "Mubstitute!", + "thatsCrazy": "That's Crazy!", + "oranceJuice": "Orance Juice!", + "questionableBalancing": "Questionable Balancing!", + "coolShaders": "Cool Shaders!", + "aiFree": "AI-Free!", + "suddenDifficultySpikes": "Sudden Difficulty Spikes!", + "basedOnAnUnfinishedFlashGame": "Based on an Unfinished Flash Game!", + "moreAddictiveThanIntended": "More Addictive than Intended!", + "mostlyConsistentSeeds": "Mostly Consistent Seeds!", + "achievementPointsDontDoAnything": "Achievement Points Don't Do Anything!", + "youDoNotStartAtLevel": "You Do Not Start at Level 2000!", + "dontTalkAboutTheManaphyEggIncident": "Don't Talk About the Manaphy Egg Incident!", + "alsoTryPokengine": "Also Try Pokéngine!", + "alsoTryEmeraldRogue": "Also Try Emerald Rogue!", + "alsoTryRadicalRed": "Also Try Radical Red!", + "eeveeExpo": "Eevee Expo!", + "ynoproject": "YNOproject!", + "breedersInSpace": "Breeders in space!" +} diff --git a/src/locales/ja/trainer-classes.json b/src/locales/ja/trainer-classes.json index 9e26dfeeb6e..aba294fbbbd 100644 --- a/src/locales/ja/trainer-classes.json +++ b/src/locales/ja/trainer-classes.json @@ -1 +1,130 @@ -{} \ No newline at end of file +{ + "ace_trainer": "エリートトレーナー", + "ace_trainer_female": "エリートトレーナー", + "ace_duo": "エリートコンビ", + "artist": "芸術家", + "artist_female": "芸術家", + "backers": "ファンクラブ", + "backpacker": "バックパッカー", + "backpacker_female": "バックパッカー", + "backpackers": "バックパッカーズ", + "baker": "ベーカリー", + "battle_girl": "バトルガール", + "beauty": "大人のおねえさん", + "beginners": "初心者", + "biker": "暴走族", + "black_belt": "カラテ王", + "breeder": "ポケモンブリーダー", + "breeder_female": "ポケモンブリーダー", + "breeders": "ブリーダーコンビ", + "clerk": "ビジネスマン", + "clerk_female": "OL", + "colleagues": "ビジネスパートナー", + "crush_kin": "格闘兄妹", + "cyclist": "サイクリング", + "cyclist_female": "サイクリング", + "cyclists": "サイクリングチーム", + "dancer": "ダンサー", + "dancer_female": "ダンサー", + "depot_agent": "鉄道員", + "doctor": "ドクター", + "doctor_female": "ドクター", + "firebreather": "火吹きやろう", + "fisherman": "釣り人", + "fisherman_female": "釣り人", + "gentleman": "ジェントルマン", + "guitarist": "ギタリスト", + "guitarist_female": "ギタリスト", + "harlequin": "クラウン", + "hiker": "山男", + "hooligans": "バッドチーム", + "hoopster": "バスケ選手", + "infielder": "野球選手", + "janitor": "清掃員", + "lady": "お嬢さま", + "lass": "ミニスカート", + "linebacker": "フットボーラー", + "maid": "メイド", + "madame": "マダム", + "medical_team": "医療チーム", + "musician": "ミュージシャン", + "hex_maniac": "オカルトマニア", + "nurse": "ナース", + "nursery_aide": "保育士", + "officer": "お巡りさん", + "parasol_lady": "パラソルおねえさん", + "pilot": "パイロット", + "pokéfan": "大好きクラブ", + "pokéfan_female": "大好きクラブ", + "pokéfan_family": "大好き夫婦", + "preschooler": "園児", + "preschooler_female": "園児", + "preschoolers": "園児たち", + "psychic": "サイキッカー", + "psychic_female": "サイキッカー", + "psychics": "サイキッ家", + "pokémon_ranger": "ポケモンレンジャー", + "pokémon_ranger_female": "ポケモンレンジャー", + "pokémon_rangers": "レンジャーズ", + "ranger": "レンジャー", + "restaurant_staff": "レストランスタッフ", + "rich": "お金持ち", + "rich_female": "お金持ち", + "rich_boy": "お坊っちゃま", + "rich_couple": "お二人さま", + "rich_kid": "ブルジョワ男子", + "rich_kid_female": "ブルジョワ女子", + "rich_kids": "ブルジョワ子達", + "roughneck": "スキンヘッズ", + "sailor": "船乗り", + "scientist": "研究員", + "scientist_female": "研究員", + "scientists": "研究チーム", + "smasher": "テニスプレイヤー", + "snow_worker": "冷凍作業員", + "snow_worker_female": "冷凍作業員", + "striker": "サッカー選手", + "school_kid": "塾帰り", + "school_kid_female": "塾帰り", + "school_kids": "塾生たち", + "swimmer": "海パンやろう", + "swimmer_female": "ビキニのおねえさん", + "swimmers": "水着カップル", + "twins": "双子ちゃん", + "veteran": "ベテラントレーナー", + "veteran_female": "ベテラントレーナー", + "veteran_duo": "ベテランコンビ", + "waiter": "ウエーター", + "waitress": "ウエートレス", + "worker": "作業員", + "worker_female": "作業員", + "workers": "作業班", + "youngster": "短パン小僧", + "rocket_grunt": "ロケット団の下っ端", + "rocket_grunts": " ロケット団の下っ端", + "rocket_grunt_female": "ロケット団の下っ端", + "magma_grunt": "マグマ団の下っ端", + "magma_grunt_female": "マグマ団の下っ端", + "magma_grunts": "マグマ団の下っ端", + "aqua_grunt": "アクア団の下っ端", + "aqua_grunt_female": "アクア団の下っ端", + "aqua_grunts": "アクア団の下っ端", + "galactic_grunt": "ギンガ団の下っ端", + "galactic_grunt_female": "ギンガ団の下っ端", + "galactic_grunts": "ギンガ団の下っ端", + "plasma_grunt": "プラスマ団の下っ端", + "plasma_grunt_female": "プラズマ団の下っ端", + "plasma_grunts": "プラズマ団の下っ端", + "flare_grunt": "フレア団の下っ端", + "flare_grunt_female": "フレア団の下っ端", + "flare_grunts": "フレア団の下っ端", + "aether_grunt": "エーテル財団の職員", + "aether_grunt_female": "エーテル財団の職員", + "aether_grunts": "エーテル財団の職員", + "skull_grunt": "スカル団の下っ端", + "skull_grunt_female": "スカル団の下っ端", + "skull_grunts": "スカル団の下っ端", + "macro_grunt": "マクロコスモスのトレーナ", + "macro_grunt_female": "マクロコスモスのトレーナ", + "macro_grunts": "マクロコスモスのトレーナ" +} diff --git a/src/locales/ja/trainer-names.json b/src/locales/ja/trainer-names.json index 9e26dfeeb6e..70841734b5b 100644 --- a/src/locales/ja/trainer-names.json +++ b/src/locales/ja/trainer-names.json @@ -1 +1,164 @@ -{} \ No newline at end of file +{ + "brock": "タケシ", + "misty": "カスミ", + "lt_surge": "マチス", + "erika": "エリカ", + "janine": "アンズ", + "sabrina": "ナツメ", + "blaine": "カツラ", + "giovanni": "サカキ", + "falkner": "ハヤト", + "bugsy": "ツクシ", + "whitney": "アカネ", + "morty": "マツバ", + "chuck": "シジマ", + "jasmine": "ミカン", + "pryce": "ヤナギ", + "clair": "イブキ", + "roxanne": "ツツジ", + "brawly": "トウキ", + "wattson": "テッセン", + "flannery": "アスナ", + "norman": "センリ", + "winona": "ナギ", + "tate": "フウ", + "liza": "ラン", + "juan": "アダン", + "roark": "ヒョウタ", + "gardenia": "ナタネ", + "maylene": "スモモ", + "crasher_wake": "マキシ", + "fantina": "メリッサ", + "byron": "トウガン", + "candice": "スズナ", + "volkner": "デンジ", + "cilan": "デント", + "chili": "ポッド", + "cress": "コーン", + "cheren": "チェレン", + "lenora": "アロエ", + "roxie": "ホミカ", + "burgh": "アーティ", + "elesa": "カミツレ", + "clay": "ヤーコン", + "skyla": "フウロ", + "brycen": "ハチク", + "drayden": "シャガ", + "marlon": "シズイ", + "viola": "ビオラ", + "grant": "ザクロ", + "korrina": "コルニ", + "ramos": "フクジ", + "clemont": "シトロン", + "valerie": "マーシュ", + "olympia": "ゴジカ", + "wulfric": "ウルップ", + "milo": "ヤロー", + "nessa": "ルリナ", + "kabu": "カブ", + "bea": "サイトウ", + "allister": "オニオン", + "opal": "ポプラ", + "bede": "ビート", + "gordie": "マクワ", + "melony": "メロン", + "piers": "ネズ", + "marnie": "マリィ", + "raihan": "キバナ", + "katy": "カエデ", + "brassius": "コルサ", + "iono": " ナンジャモ", + "kofu": "ハイダイ", + "larry": "アオキ", + "ryme": "ライム", + "tulip": "リップ", + "grusha": "グルーシャ", + "lorelei": "カンナ", + "bruno": "シバ", + "agatha": "キクコ", + "lance": "ワタル", + "will": "イツキ", + "koga": "キョウ", + "karen": "カリン", + "sidney": "カゲツ", + "phoebe": "フヨウ", + "glacia": "プリム", + "drake": "ゲンジ", + "aaron": "リョウ", + "bertha": "キクノ", + "flint": "オーバ", + "lucian": "ゴヨウ", + "shauntal": "シキミ", + "marshal": "レンブ", + "grimsley": "ギーマ", + "caitlin": "カトレア", + "malva": "パキラ", + "siebold": "ズミ", + "wikstrom": "ガンピ", + "drasna": "ドラセナ", + "hala": "ハラ", + "molayne": "マーレイン", + "olivia": "ライチ", + "acerola": "アセロラ", + "kahili": "カヒリ", + "rika": "チリ", + "poppy": "ポピー", + "hassel": "ハッサク", + "crispin": "アカマツ", + "amarys": "ネリネ", + "lacey": "タロ", + "drayton": "カキツバタ", + "blue": "グリーン", + "red": "レッド", + "steven": "ダイゴ", + "wallace": "ミクリ", + "cynthia": "シロナ", + "alder": "アデク", + "iris": "アイリス", + "diantha": "カルネ", + "hau": "ハウ", + "geeta": "オモダカ", + "nemona": "ネモ", + "kieran": "スグリ", + "leon": "ダンデ", + "rival": "フィン", + "rival_female": "アイヴィー", + "archer": "アポロ", + "ariana": "アテナ", + "proton": "ランス", + "petrel": "ラムダ", + "tabitha": "ホムラ", + "courtney": "カガリ", + "shelly": "イズミ", + "matt": "ウシオ", + "mars": "マーズ", + "jupiter": "ジュピター", + "saturn": "サターン", + "zinzolin": "ヴィオ", + "rood": "ロット", + "xerosic": "クセロシキ", + "bryony": "バラ", + "faba": "ザオボー", + "plumeria": "プルメリ", + "oleana": "オリーヴ", + + "maxie": "マツブサ", + "archie": "アオギリ", + "cyrus": "アカギ", + "ghetsis": "ゲーチス", + "lysandre": "フラダリ", + "lusamine": "ルザミーネ", + "guzma": "グズマ", + "rose": "ローズ", + + "blue_red_double": "グリーンとレッド", + "red_blue_double": "レッドとグリーン", + "tate_liza_double": "フウとラン", + "liza_tate_double": "ランとフウ", + "steven_wallace_double": "ダイゴとミクリ", + "wallace_steven_double": "ミクリとダイゴ", + "alder_iris_double": "アデクとアイリス", + "iris_alder_double": "アイリスとアデク", + "marnie_piers_double": "マリィとネズ", + "piers_marnie_double": "ネズとマリィ" +} diff --git a/src/locales/ja/trainer-titles.json b/src/locales/ja/trainer-titles.json index 9e26dfeeb6e..b3829c701e5 100644 --- a/src/locales/ja/trainer-titles.json +++ b/src/locales/ja/trainer-titles.json @@ -1 +1,38 @@ -{} \ No newline at end of file +{ + "elite_four": "四天王", + "elite_four_female": "四天王", + "gym_leader": "ジムリーダー", + "gym_leader_female": "ジムリーダー", + "gym_leader_double": "ジムリーダーコンビ", + "champion": "チャンピオン", + "champion_female": "チャンピオン", + "champion_double": "チャンピオンコンビ", + "rival": "ライバル", + "professor": "ポケモン博士", + "frontier_brain": "フロンティアブレーン", + "rocket_boss": "ロケット団ボス", + "magma_boss": "マグマ団リーダー", + "aqua_boss": "アクア団リーダー", + "galactic_boss": "ギンガ団ボス", + "plasma_boss": "プラズマ団ボス", + "flare_boss": "フレア団ボス", + "aether_boss": "エーテル代表", + "skull_boss": "スカル団ボス", + "macro_boss": "マクロコスモス社長", + + "rocket_admin": "ロケット団幹部", + "rocket_admin_female": "ロケット団幹部", + "magma_admin": "マグマ団幹部", + "magma_admin_female": "マグマロケット団幹部", + "aqua_admin": "アクア団幹部", + "aqua_admin_female": "アクア団幹部", + "galactic_commander": "ギンガ団幹部", + "galactic_commander_female": "ギンガ団幹部", + "plasma_sage": "プラズマ団賢人", + "plasma_admin": "プラズマ団賢人", + "flare_admin": "フレア団幹部", + "flare_admin_female": "フレア団幹部", + "aether_admin": "エーテル支部長", + "skull_admin": "スカル団幹部", + "macro_admin": "マクロコスモス" +} diff --git a/src/locales/ja/weather.json b/src/locales/ja/weather.json index 92728b81461..e2d3c6c4e32 100644 --- a/src/locales/ja/weather.json +++ b/src/locales/ja/weather.json @@ -16,17 +16,17 @@ "snowStartMessage": "雪が 降り始めた!", "snowLapseMessage": "雪が 降っている!", "snowClearMessage": "雪が 止んだ!", - "fogStartMessage": "足下に 霧(きり)が立ち込めた!", - "fogLapseMessage": "足下に 霧(きり)が 立ち込めている!", - "fogClearMessage": "足下の 霧(きり)が消え去った!", + "fogStartMessage": "足下に 霧が 立ち込めた!", + "fogLapseMessage": "足下に 霧が 立ち込めている!", + "fogClearMessage": "足下の 霧が 消え去った!", "heavyRainStartMessage": "強い雨が 降り始めた!", "heavyRainLapseMessage": "強い雨が 降っている!", "heavyRainClearMessage": "強い雨が あがった!", "harshSunStartMessage": "日差しが とても強くなった!", "harshSunLapseMessage": "日差しが とても強い!", "harshSunClearMessage": "日差しが 元に戻った!", - "strongWindsStartMessage": "謎(なぞ)の 乱気流(らんきりゅう)が\nひこうポケモンを 護(まも)る!", - "strongWindsLapseMessage": "謎(なぞ)の 乱気流(らんきりゅう)の 勢(いきお)いは 止まらない!", - "strongWindsEffectMessage": "謎(なぞ)の 乱気流(らんきりゅう)が 攻撃(こうげき)を 弱(よわ)めた!", - "strongWindsClearMessage": "謎(なぞ)の 乱気流(らんきりゅう)が おさまった!" -} \ No newline at end of file + "strongWindsStartMessage": "謎の 乱気流が\nひこうポケモンを 護る!", + "strongWindsLapseMessage": "謎の 乱気流の 勢いは 止まらない!", + "strongWindsEffectMessage": "謎の 乱気流が 攻撃を 弱めた!", + "strongWindsClearMessage": "謎の 乱気流が おさまった!" +} diff --git a/src/locales/ko/achv.json b/src/locales/ko/achv.json index b9fd327ef3b..9364c1c55b6 100644 --- a/src/locales/ko/achv.json +++ b/src/locales/ko/achv.json @@ -80,7 +80,7 @@ "100_RIBBONS": { "name": "마스터 리그 챔피언" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "팀워크", "description": "한 개 이상의 능력치가 최대 랭크일 때 배턴터치 사용" }, diff --git a/src/locales/ko/arena-flyout.json b/src/locales/ko/arena-flyout.json index bfd24776cdc..e4b271691a5 100644 --- a/src/locales/ko/arena-flyout.json +++ b/src/locales/ko/arena-flyout.json @@ -36,5 +36,6 @@ "matBlock": "마룻바닥세워막기", "craftyShield": "트릭가드", "tailwind": "순풍", - "happyHour": "해피타임" -} \ No newline at end of file + "happyHour": "해피타임", + "safeguard": "신비의부적" +} diff --git a/src/locales/ko/dialogue-misc.json b/src/locales/ko/dialogue-misc.json index 8445c5c4810..f24fc79ea99 100644 --- a/src/locales/ko/dialogue-misc.json +++ b/src/locales/ko/dialogue-misc.json @@ -1,6 +1,6 @@ { - "ending": "@c{smile}오? 이긴거야?@d{96} @c{smile_eclosed}진즉 알았어야 했는데.\n아무튼, 돌아왔구나.\n$@c{smile}다 끝난거야.@d{64} 네가 굴레를 끝장냈어.\n$@c{serious_smile_fists}네 꿈도 이뤄졌고말야.\n진짜로 한 번도 안 졌잖아.\n$@c{neutral}기억하는 건 우리들 뿐일 모양이지만.@d{96}\n그래도, 괜찮지?\n$@c{serious_smile_fists}오늘의 일은\n너와 나의 마음 속에 항상 함께할 거야.\n$@c{smile_eclosed}여기 구경도 충분히 했으니\n이제 집에 가자.\n$@c{serious_smile_fists}되돌아가서, 다시 배틀을 할 수도 있지 않을까?\n네가 원한다면 말야.", - "ending_female": "@c{shock}돌아왔구나?@d{32} 그 말은…@d{96} 이겼어?!\n@c{smile_ehalf}그럴 줄 알았다니까.\n$@c{smile_eclosed}물론… 언제나 느껴왔지.\n@c{smile}끝난 거, 맞지? 이 굴레를 말이야.\n$@c{smile_ehalf}네 꿈도 이뤘고 말이야.\n어떻게 한번도 안 졌대?\n$네가 한 일은 나만 기억하게 될 모양이지만.\n@c{angry_mopen}나, 안 까먹어볼 테니까!\n$@c{smile_wave_wink}농담이야!@d{64} @c{smile}절대 안 잊어버릴 거야.@d{32}\n마음 속엔 쭉 남아있을 수 있게.\n$@c{smile_wave}어쨌든,@d{64} 시간이 좀 늦었어…@d{96}\n이런 곳에서 할 말은 아닌가?\n$집에 가자. @c{smile_wave_wink}아마 내일은,\n추억을 되짚어보기 위한 배틀을 해볼 수 있을 거야.", + "ending": "@c{shock}돌아왔구나?@d{32} 그 말은…@d{96} 이겼어?!\n@c{smile_ehalf}그럴 줄 알았다니까.\n$@c{smile_eclosed}물론… 언제나 느껴왔지.\n@c{smile}끝난 거, 맞지? 이 굴레를 말이야.\n$@c{smile_ehalf}네 꿈도 이뤘고 말이야.\n어떻게 한번도 안 졌대?\n$네가 한 일은 나만 기억하게 될 모양이지만.\n@c{angry_mopen}나, 안 까먹어볼 테니까!\n$@c{smile_wave_wink}농담이야!@d{64} @c{smile}절대 안 잊어버릴 거야.@d{32}\n마음 속엔 쭉 남아있을 수 있게.\n$@c{smile_wave}어쨌든,@d{64} 시간이 좀 늦었어…@d{96}\n이런 곳에서 할 말은 아닌가?\n$집에 가자. @c{smile_wave_wink}아마 내일은,\n추억을 되짚어보기 위한 배틀을 해볼 수 있을 거야.", + "ending_female": "@c{smile}오? 이긴거야?@d{96} @c{smile_eclosed}진즉 알았어야 했는데.\n아무튼, 돌아왔구나.\n$@c{smile}다 끝난거야.@d{64} 네가 굴레를 끝장냈어.\n$@c{serious_smile_fists}네 꿈도 이뤄졌고말야.\n진짜로 한 번도 안 졌잖아.\n$@c{neutral}기억하는 건 우리들 뿐일 모양이지만.@d{96}\n그래도, 괜찮지?\n$@c{serious_smile_fists}오늘의 일은\n너와 나의 마음 속에 항상 함께할 거야.\n$@c{smile_eclosed}여기 구경도 충분히 했으니\n이제 집에 가자.\n$@c{serious_smile_fists}되돌아가서, 다시 배틀을 할 수도 있지 않을까?\n네가 원한다면 말야.", "ending_endless": "끝에 도달하신 것을 축하드립니다!\n더 많은 컨텐츠를 기다려주세요.", "ending_name": "Devs" -} \ No newline at end of file +} diff --git a/src/locales/ko/modifier-type.json b/src/locales/ko/modifier-type.json index a5b3405b33f..d94837bb0d2 100644 --- a/src/locales/ko/modifier-type.json +++ b/src/locales/ko/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "{{battleCount}}번의 배틀 동안 더블 배틀이 등장할 확률이 두 배가 된다." }, - "TempBattleStatBoosterModifierType": { - "description": "자신의 모든 포켓몬이 5번의 배틀 동안 {{tempBattleStatName}}[[가]] 한 단계 증가한다." + "TempStatStageBoosterModifierType": { + "description": "자신의 모든 포켓몬이 5번의 배틀 동안 {{stat}}[[가]] 한 단계 증가한다." }, "AttackTypeBoosterModifierType": { "description": "지니게 하면 {{moveType}}타입 기술의 위력이 20% 상승한다." @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "자신의 모든 포켓몬의 레벨이 {{levels}}만큼 상승한다." }, - "PokemonBaseStatBoosterModifierType": { - "description": "지니게 하면 {{statName}} 종족값을 10% 올려준다. 개체값이 높을수록 더 많이 누적시킬 수 있다." + "BaseStatBoosterModifierType": { + "description": "지니게 하면 {{stat}} 종족값을 10% 올려준다. 개체값이 높을수록 더 많이 누적시킬 수 있다." }, "AllPokemonFullHpRestoreModifierType": { "description": "자신의 포켓몬의 HP를 모두 회복한다." @@ -248,6 +248,12 @@ "name": "초점렌즈", "description": "약점이 보이는 렌즈. 지니게 한 포켓몬의 기술이 급소에 맞기 쉬워진다." }, + "DIRE_HIT": { + "name": "크리티컬커터", + "extra": { + "raises": "급소율" + } + }, "LEEK": { "name": "대파", "description": "매우 길고 단단한 줄기. 파오리에게 지니게 하면 기술이 급소에 맞기 쉬워진다." @@ -411,25 +417,13 @@ "description": "메타몽에게 지니게 하면 스피드가 올라가는 이상한 가루. 매우 잘고 단단하다." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "플러스파워", "x_defense": "디펜드업", "x_sp_atk": "스페셜업", "x_sp_def": "스페셜가드", "x_speed": "스피드업", - "x_accuracy": "잘-맞히기", - "dire_hit": "크리티컬커터" - }, - "TempBattleStatBoosterStatName": { - "ATK": "공격", - "DEF": "방어", - "SPATK": "특수공격", - "SPDEF": "특수방어", - "SPD": "스피드", - "ACC": "명중률", - "CRIT": "급소율", - "EVA": "회피율", - "DEFAULT": "???" + "x_accuracy": "잘-맞히기" }, "AttackTypeBoosterItem": { "silk_scarf": "실크스카프", @@ -606,4 +600,4 @@ "FAIRY_MEMORY": "페어리메모리", "NORMAL_MEMORY": "일반메모리" } -} \ No newline at end of file +} diff --git a/src/locales/ko/move-trigger.json b/src/locales/ko/move-trigger.json index f0e0fbd6a56..2a38bb13b0a 100644 --- a/src/locales/ko/move-trigger.json +++ b/src/locales/ko/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}}[[는]]\n체력을 깎아서 자신의 기술을 강화했다!", "absorbedElectricity": "{{pokemonName}}는(은)\n전기를 흡수했다!", "switchedStatChanges": "{{pokemonName}}[[는]] 상대와 자신의\n능력 변화를 바꿨다!", + "switchedTwoStatChanges": "{{pokemonName}} 상대와 자신의 {{firstStat}}과 {{secondStat}}의 능력 변화를 바꿨다!", + "switchedStat": "{{pokemonName}} 서로의 {{stat}}를 교체했다!", + "sharedGuard": "{{pokemonName}} 서로의 가드를 셰어했다!", + "sharedPower": "{{pokemonName}} 서로의 파워를 셰어했다!", "goingAllOutForAttack": "{{pokemonName}}[[는]]\n전력을 다하기 시작했다!", "regainedHealth": "{{pokemonName}}[[는]]\n기력을 회복했다!", "keptGoingAndCrashed": "{{pokemonName}}[[는]]\n의욕이 넘쳐서 땅에 부딪쳤다!", @@ -63,4 +67,4 @@ "swapArenaTags": "{{pokemonName}}[[는]]\n서로의 필드 효과를 교체했다!", "exposedMove": "{{pokemonName}}[[는]]\n{{targetPokemonName}}의 정체를 꿰뚫어 보았다!", "safeguard": "{{targetName}}[[는]] 신비의 베일이 지켜 주고 있다!" -} \ No newline at end of file +} diff --git a/src/locales/ko/settings.json b/src/locales/ko/settings.json index b7fc01cb148..c10046385e1 100644 --- a/src/locales/ko/settings.json +++ b/src/locales/ko/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "터치 컨트롤 이동", "shopOverlayOpacity": "상점 오버레이 투명도", "shopCursorTarget": "상점 커서 위치", - "items": "아이템", + "rewards": "아이템", "reroll": "갱신", "shop": "상점", "checkTeam": "파티 확인" diff --git a/src/locales/pt_BR/achv.json b/src/locales/pt_BR/achv.json index acdec1ae306..93e982b60ea 100644 --- a/src/locales/pt_BR/achv.json +++ b/src/locales/pt_BR/achv.json @@ -84,7 +84,7 @@ "100_RIBBONS": { "name": "Fita de Diamante" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "Trabalho em Equipe", "description": "Use Baton Pass com pelo menos um atributo aumentado ao máximo" }, @@ -269,4 +269,4 @@ "name": "A torre da derrotA", "description": "Complete o desafio da Batalha Inversa.\n.asrevnI ahlataB ad oifased o etelpmoC" } -} \ No newline at end of file +} diff --git a/src/locales/pt_BR/arena-flyout.json b/src/locales/pt_BR/arena-flyout.json index e221fa6c0a5..a4be2727b27 100644 --- a/src/locales/pt_BR/arena-flyout.json +++ b/src/locales/pt_BR/arena-flyout.json @@ -36,5 +36,6 @@ "matBlock": "Mat Block", "craftyShield": "Crafty Shield", "tailwind": "Tailwind", - "happyHour": "Happy Hour" + "happyHour": "Happy Hour", + "safeguard": "Safeguard" } diff --git a/src/locales/pt_BR/dialogue-misc.json b/src/locales/pt_BR/dialogue-misc.json index 18eb2ba8c91..10e50aaa7e1 100644 --- a/src/locales/pt_BR/dialogue-misc.json +++ b/src/locales/pt_BR/dialogue-misc.json @@ -1,6 +1,6 @@ { - "ending": "@c{smile}Oh? Você venceu?@d{96} @c{smile_eclosed}Acho que eu deveria saber.\nMas, você está de volta agora.\n$@c{smile}Acabou.@d{64} Você quebrou o ciclo.\n$@c{serious_smile_fists}Você também realizou seu sonho, não é?\nVocê não perdeu nenhuma vez.\n$@c{neutral}Eu sou o único que vai lembrar o que você fez.@d{96}\nAcho que está tudo bem, não é?\n$@c{serious_smile_fists}Sua lenda sempre viverá em nossos corações.\n$@c{smile_eclosed}Enfim, já tive o suficiente deste lugar, não é? Vamos para casa.\n$@c{serious_smile_fists}Talvez quando voltarmos, possamos ter outra batalha?\nSe você estiver disposto.", - "ending_female": "@c{shock}Você está de volta?@d{32} Isso significa que…@d{96} você venceu?!\n@c{smile_ehalf}Eu deveria saber que você conseguiria.\n$@c{smile_eclosed}Claro… Eu sempre tive essa sensação.\n@c{smile}Acabou agora, certo? Você quebrou o ciclo.\n$@c{smile_ehalf}Você também realizou seu sonho, não foi?\nVocê não perdeu nenhuma vez.\n$Eu serei a única a lembrar o que você fez.\n@c{angry_mopen}Eu tentarei não esquecer!\n$@c{smile_wave_wink}Brincadeirinha!@d{64} @c{smile}Eu nunca esqueceria.@d{32}\nSua lenda viverá em nossos corações.\n$@c{smile_wave}De qualquer forma,@d{64} está ficando tarde…@d{96} Eu acho?\nÉ difícil dizer neste lugar.\n$Vamos para casa. @c{smile_wave_wink}Talvez amanhã possamos ter outra batalha, pelos velhos tempos?", + "ending": "@c{shock}Você está de volta?@d{32} Isso significa que…@d{96} você venceu?!\n@c{smile_ehalf}Eu deveria saber que você conseguiria.\n$@c{smile_eclosed}Claro… Eu sempre tive essa sensação.\n@c{smile}Acabou agora, certo? Você quebrou o ciclo.\n$@c{smile_ehalf}Você também realizou seu sonho, não foi?\nVocê não perdeu nenhuma vez.\n$Eu serei a única a lembrar o que você fez.\n@c{angry_mopen}Eu tentarei não esquecer!\n$@c{smile_wave_wink}Brincadeirinha!@d{64} @c{smile}Eu nunca esqueceria.@d{32}\nSua lenda viverá em nossos corações.\n$@c{smile_wave}De qualquer forma,@d{64} está ficando tarde…@d{96} Eu acho?\nÉ difícil dizer neste lugar.\n$Vamos para casa. @c{smile_wave_wink}Talvez amanhã possamos ter outra batalha, pelos velhos tempos?", + "ending_female": "@c{smile}Oh? Você venceu?@d{96} @c{smile_eclosed}Acho que eu deveria saber.\nMas, você está de volta agora.\n$@c{smile}Acabou.@d{64} Você quebrou o ciclo.\n$@c{serious_smile_fists}Você também realizou seu sonho, não é?\nVocê não perdeu nenhuma vez.\n$@c{neutral}Eu sou o único que vai lembrar o que você fez.@d{96}\nAcho que está tudo bem, não é?\n$@c{serious_smile_fists}Sua lenda sempre viverá em nossos corações.\n$@c{smile_eclosed}Enfim, já tive o suficiente deste lugar, não é? Vamos para casa.\n$@c{serious_smile_fists}Talvez quando voltarmos, possamos ter outra batalha?\nSe você estiver disposto.", "ending_endless": "Parabéns por alcançar o final atual!\nMais conteúdo chegará em breve.", "ending_name": "Desenvolvedores" -} \ No newline at end of file +} diff --git a/src/locales/pt_BR/modifier-type.json b/src/locales/pt_BR/modifier-type.json index b02281a53b8..823d6b35e16 100644 --- a/src/locales/pt_BR/modifier-type.json +++ b/src/locales/pt_BR/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "Dobra as chances de encontrar uma batalha em dupla por {{battleCount}} batalhas." }, - "TempBattleStatBoosterModifierType": { - "description": "Aumenta o atributo de {{tempBattleStatName}} para todos os membros da equipe por 5 batalhas." + "TempStatStageBoosterModifierType": { + "description": "Aumenta o atributo de {{stat}} para todos os membros da equipe por 5 batalhas." }, "AttackTypeBoosterModifierType": { "description": "Aumenta o poder dos ataques do tipo {{moveType}} de um Pokémon em 20%." @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "Aumenta em {{levels}} o nível de todos os membros da equipe." }, - "PokemonBaseStatBoosterModifierType": { - "description": "Aumenta o atributo base de {{statName}} em 10%. Quanto maior os IVs, maior o limite de aumento." + "BaseStatBoosterModifierType": { + "description": "Aumenta o atributo base de {{stat}} em 10%. Quanto maior os IVs, maior o limite de aumento." }, "AllPokemonFullHpRestoreModifierType": { "description": "Restaura totalmente os PS de todos os Pokémon." @@ -248,6 +248,12 @@ "name": "Lentes de Mira", "description": "Estas lentes facilitam o foco em pontos fracos. Aumenta a chance de acerto crítico de quem a segurar." }, + "DIRE_HIT": { + "name": "Direto", + "extra": { + "raises": "Chance de Acerto Crítico" + } + }, "LEEK": { "name": "Alho-poró", "description": "Esse talo de alho-poró muito longo e rígido aumenta a taxa de acerto crítico dos movimentos do Farfetch'd." @@ -411,25 +417,13 @@ "description": "Extremamente fino, porém duro, este pó estranho aumenta o atributo de Velocidade de Ditto." } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "Ataque X", "x_defense": "Defesa X", "x_sp_atk": "Ataque Esp. X", "x_sp_def": "Defesa Esp. X", "x_speed": "Velocidade X", - "x_accuracy": "Precisão X", - "dire_hit": "Direto" - }, - "TempBattleStatBoosterStatName": { - "ATK": "Ataque", - "DEF": "Defesa", - "SPATK": "Ataque Esp.", - "SPDEF": "Defesa Esp.", - "SPD": "Velocidade", - "ACC": "Precisão", - "CRIT": "Chance de Acerto Crítico", - "EVA": "Evasão", - "DEFAULT": "???" + "x_accuracy": "Precisão X" }, "AttackTypeBoosterItem": { "silk_scarf": "Lenço de Seda", diff --git a/src/locales/pt_BR/modifier.json b/src/locales/pt_BR/modifier.json index 602a0be3a5b..38622de579e 100644 --- a/src/locales/pt_BR/modifier.json +++ b/src/locales/pt_BR/modifier.json @@ -3,7 +3,7 @@ "turnHealApply": "{{pokemonNameWithAffix}} restaurou um pouco de PS usando\nsuas {{typeName}}!", "hitHealApply": "{{pokemonNameWithAffix}} restaurou um pouco de PS usando\nsua {{typeName}}!", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}} foi reanimado\npor sua {{typeName}}!", - "pokemonResetNegativeStatStageApply": "Os atributos diminuídos de {{pokemonNameWithAffix}} foram\nrestaurados por seu(sua) {{typeName}}!", + "resetNegativeStatStageApply": "Os atributos diminuídos de {{pokemonNameWithAffix}} foram\nrestaurados por seu(sua) {{typeName}}!", "moneyInterestApply": "Você recebeu um juros de ₽{{moneyAmount}}\nde sua {{typeName}}!", "turnHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} foi absorvido(a)\npelo {{typeName}} de {{pokemonName}}!", "contactHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} foi pego(a)\npela {{typeName}} de {{pokemonName}}!", diff --git a/src/locales/pt_BR/move-trigger.json b/src/locales/pt_BR/move-trigger.json index ea320412a24..9aa13dedad5 100644 --- a/src/locales/pt_BR/move-trigger.json +++ b/src/locales/pt_BR/move-trigger.json @@ -63,4 +63,4 @@ "swapArenaTags": "{{pokemonName}} trocou os efeitos de batalha que afetam cada lado do campo!", "exposedMove": "{{pokemonName}} identificou\n{{targetPokemonName}}!", "safeguard": "{{targetName}} está protegido por Safeguard!" -} \ No newline at end of file +} diff --git a/src/locales/pt_BR/settings.json b/src/locales/pt_BR/settings.json index 58ccb45f86d..74f3918bed8 100644 --- a/src/locales/pt_BR/settings.json +++ b/src/locales/pt_BR/settings.json @@ -100,7 +100,7 @@ "moveTouchControls": "Mover Controles de Toque", "shopOverlayOpacity": "Opacidade da Loja", "shopCursorTarget": "Alvo do Cursor da Loja", - "items": "Itens", + "rewards": "Itens", "reroll": "Atualizar", "shop": "Loja", "checkTeam": "Checar Time" diff --git a/src/locales/zh_CN/achv.json b/src/locales/zh_CN/achv.json index 8de0c48a2c3..90dfda0e3c1 100644 --- a/src/locales/zh_CN/achv.json +++ b/src/locales/zh_CN/achv.json @@ -86,7 +86,7 @@ "name": "大师球联盟冠军" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "团队协作", "description": "在一项属性强化至最大时用接力棒传递给其他宝可梦" }, diff --git a/src/locales/zh_CN/arena-flyout.json b/src/locales/zh_CN/arena-flyout.json index 7ddc304f404..fbce213c4aa 100644 --- a/src/locales/zh_CN/arena-flyout.json +++ b/src/locales/zh_CN/arena-flyout.json @@ -36,5 +36,6 @@ "matBlock": "掀榻榻米", "craftyShield": "戏法防守", "tailwind": "顺风", - "happyHour": "快乐时光" -} \ No newline at end of file + "happyHour": "快乐时光", + "safeguard": "神秘守护" +} diff --git a/src/locales/zh_CN/dialogue-misc.json b/src/locales/zh_CN/dialogue-misc.json index e9ac66b7955..07aa336d4f6 100644 --- a/src/locales/zh_CN/dialogue-misc.json +++ b/src/locales/zh_CN/dialogue-misc.json @@ -1,4 +1,4 @@ { - "ending": "@c{smile}哦?你赢了?@d{96} @c{smile_eclosed}我应该早猜到了\n你回来了。\n$@c{smile}结束了。@d{64} 你终结了这个循环。\n$@c{serious_smile_fists}你也完成了自己的梦想,不是吗?\n你甚至一次都没失败。\n$@c{neutral}我是唯一能够记得你所作所为的人@d{96}\n我觉得这应该也还行吧?\n$@c{serious_smile_fists}你的传奇将永远留存于我们心中。\n$@c{smile_eclosed}不管了,我真是受够这个地方了,你也一样吗?我们回家吧。\n$@c{serious_smile_fists}可能等我们回家以后,再打一场?\n要是你想的话", - "ending_female": "@c{shock}你回来了?@d{32} 也就是说…@d{96} 你赢了呀!?\n@c{smile_ehalf}我应该早料到了。\n$@c{smile_eclosed}当然…我一直有这种感觉\n@c{smile}一切都结束了,对么? 你打破了循环。\n$@c{smile_ehalf}你也完成了自己的梦想,不是吗?\n你甚至一次都没失败。\n$我是唯一能够记得你所作所为的人\n@c{angry_mopen}我会努力不忘掉哒!\n$@c{smile_wave_wink}开玩笑啦,@d{64} @c{smile}我才不会忘呢。@d{32}\n你的传奇将永远留存于我们心中。\n$@c{smile_wave}不管了,@d{64} 时候不早了@d{96} ,应该吧?\n在这地方还真搞不清楚。\n$一起回家吧。 @c{smile_wave_wink}可能明天,我们再来打一场,为了重温回忆嘛~" -} \ No newline at end of file + "ending": "@c{shock}你回来了?@d{32} 也就是说…@d{96} 你赢了呀!?\n@c{smile_ehalf}我应该早料到了。\n$@c{smile_eclosed}当然…我一直有这种感觉\n@c{smile}一切都结束了,对么? 你打破了循环。\n$@c{smile_ehalf}你也完成了自己的梦想,不是吗?\n你甚至一次都没失败。\n$我是唯一能够记得你所作所为的人\n@c{angry_mopen}我会努力不忘掉哒!\n$@c{smile_wave_wink}开玩笑啦,@d{64} @c{smile}我才不会忘呢。@d{32}\n你的传奇将永远留存于我们心中。\n$@c{smile_wave}不管了,@d{64} 时候不早了@d{96} ,应该吧?\n在这地方还真搞不清楚。\n$一起回家吧。 @c{smile_wave_wink}可能明天,我们再来打一场,为了重温回忆嘛~", + "ending_female": "@c{smile}哦?你赢了?@d{96} @c{smile_eclosed}我应该早猜到了\n你回来了。\n$@c{smile}结束了。@d{64} 你终结了这个循环。\n$@c{serious_smile_fists}你也完成了自己的梦想,不是吗?\n你甚至一次都没失败。\n$@c{neutral}我是唯一能够记得你所作所为的人@d{96}\n我觉得这应该也还行吧?\n$@c{serious_smile_fists}你的传奇将永远留存于我们心中。\n$@c{smile_eclosed}不管了,我真是受够这个地方了,你也一样吗?我们回家吧。\n$@c{serious_smile_fists}可能等我们回家以后,再打一场?\n要是你想的话" +} diff --git a/src/locales/zh_CN/modifier-type.json b/src/locales/zh_CN/modifier-type.json index 4a982b77cea..5d6184640b1 100644 --- a/src/locales/zh_CN/modifier-type.json +++ b/src/locales/zh_CN/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "接下来的{{battleCount}}场战斗是双打的概率翻倍。" }, - "TempBattleStatBoosterModifierType": { - "description": "为所有成员宝可梦提升一级{{tempBattleStatName}},持续5场战斗。" + "TempStatStageBoosterModifierType": { + "description": "为所有成员宝可梦提升一级{{stat}},持续5场战斗。" }, "AttackTypeBoosterModifierType": { "description": "一只宝可梦的{{moveType}}系招式威力提升20%。" @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "使一只寶可夢的等級提升{{levels}}級。" }, - "PokemonBaseStatBoosterModifierType": { - "description": "增加10%持有者的{{statName}},\n个体值越高堆叠上限越高。" + "BaseStatBoosterModifierType": { + "description": "增加10%持有者的{{stat}},\n个体值越高堆叠上限越高。" }, "AllPokemonFullHpRestoreModifierType": { "description": "所有宝可梦完全回复HP。" @@ -248,6 +248,12 @@ "name": "焦点镜", "description": "能看见弱点的镜片。携带它的宝可梦的招式\n会变得容易击中要害。" }, + "DIRE_HIT": { + "name": "要害攻击", + "extra": { + "raises": "会心" + } + }, "LEEK": { "name": "大葱", "description": "非常长且坚硬的茎。让大葱鸭携带后,\n招式会变得容易击中要害。" @@ -411,25 +417,13 @@ "description": "让百变怪携带后,速度就会提高的神奇粉末。\n非常细腻坚硬。" } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "力量强化", "x_defense": "防御强化", "x_sp_atk": "特攻强化", "x_sp_def": "特防强化", "x_speed": "速度强化", - "x_accuracy": "命中强化", - "dire_hit": "要害攻击" - }, - "TempBattleStatBoosterStatName": { - "ATK": "攻击", - "DEF": "防御", - "SPATK": "特攻", - "SPDEF": "特防", - "SPD": "速度", - "ACC": "命中", - "CRIT": "会心", - "EVA": "闪避", - "DEFAULT": "???" + "x_accuracy": "命中强化" }, "AttackTypeBoosterItem": { "silk_scarf": "丝绸围巾", @@ -606,4 +600,4 @@ "FAIRY_MEMORY": "妖精存储碟", "NORMAL_MEMORY": "一般存储碟" } -} \ No newline at end of file +} diff --git a/src/locales/zh_CN/modifier.json b/src/locales/zh_CN/modifier.json index 707fab20ecc..a50cdd35bc1 100644 --- a/src/locales/zh_CN/modifier.json +++ b/src/locales/zh_CN/modifier.json @@ -3,7 +3,7 @@ "turnHealApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回复了体力!", "hitHealApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回复了体力!", "pokemonInstantReviveApply": "{{pokemonNameWithAffix}}用{{typeName}}\n恢复了活力!", - "pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}降低的能力被{{typeName}}\n复原了!", + "resetNegativeStatStageApply": "{{pokemonNameWithAffix}}降低的能力被{{typeName}}\n复原了!", "moneyInterestApply": "用{{typeName}}\n获得了 ₽{{moneyAmount}} 利息!", "turnHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}吸收了!", "contactHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}夺取了!", diff --git a/src/locales/zh_CN/move-trigger.json b/src/locales/zh_CN/move-trigger.json index 44705d54e76..1eb4c397f45 100644 --- a/src/locales/zh_CN/move-trigger.json +++ b/src/locales/zh_CN/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}}\n削减了体力并提升了招式威力!", "absorbedElectricity": "{{pokemonName}}\n吸收了电力!", "switchedStatChanges": "{{pokemonName}}和对手互换了\n自己的能力变化!", + "switchedTwoStatChanges": "{{pokemonName}} 和对手互换了自己的{{firstStat}}和{{secondStat}}的能力变化!", + "switchedStat": "{{pokemonName}} 互换了各自的{{stat}}!", + "sharedGuard": "{{pokemonName}} 平分了各自的防守!", + "sharedPower": "{{pokemonName}} 平分了各自的力量!", "goingAllOutForAttack": "{{pokemonName}}拿出全力了!", "regainedHealth": "{{pokemonName}}的\n体力回复了!", "keptGoingAndCrashed": "{{pokemonName}}因势头过猛\n而撞到了地面!", diff --git a/src/locales/zh_CN/pokemon-info.json b/src/locales/zh_CN/pokemon-info.json index 5194189c806..a21a8156e4c 100644 --- a/src/locales/zh_CN/pokemon-info.json +++ b/src/locales/zh_CN/pokemon-info.json @@ -1,7 +1,7 @@ { "Stat": { "HP": "最大HP", - "HPshortened": "最大HP", + "HPshortened": "HP", "ATK": "攻击", "ATKshortened": "攻击", "DEF": "防御", @@ -37,4 +37,4 @@ "FAIRY": "妖精", "STELLAR": "星晶" } -} \ No newline at end of file +} diff --git a/src/locales/zh_CN/settings.json b/src/locales/zh_CN/settings.json index 3ae0fa8204c..dd001213b9e 100644 --- a/src/locales/zh_CN/settings.json +++ b/src/locales/zh_CN/settings.json @@ -99,7 +99,7 @@ "moveTouchControls": "移动触摸控制", "shopOverlayOpacity": "商店显示不透明度", "shopCursorTarget": "商店指针位置", - "items": "道具", + "rewards": "道具", "reroll": "刷新", "shop": "购买", "checkTeam": "检查队伍" diff --git a/src/locales/zh_TW/achv.json b/src/locales/zh_TW/achv.json index 6587394cf41..9edce2e368d 100644 --- a/src/locales/zh_TW/achv.json +++ b/src/locales/zh_TW/achv.json @@ -80,7 +80,7 @@ "100_RIBBONS": { "name": "大師球聯盟冠軍" }, - "TRANSFER_MAX_BATTLE_STAT": { + "TRANSFER_MAX_STAT_STAGE": { "name": "團隊協作", "description": "在一項屬性強化至最大時用接力棒傳遞給其他寶可夢" }, @@ -257,4 +257,4 @@ "name": "鏡子子鏡", "description": "完成逆轉之戰挑戰\n戰挑戰之轉逆成完" } -} \ No newline at end of file +} diff --git a/src/locales/zh_TW/dialogue-misc.json b/src/locales/zh_TW/dialogue-misc.json index 24e2109e5b3..408bcac546b 100644 --- a/src/locales/zh_TW/dialogue-misc.json +++ b/src/locales/zh_TW/dialogue-misc.json @@ -1,4 +1,4 @@ { - "ending": "@c{smile}哦?你贏了?@d{96} @c{smile_eclosed}我應該早猜到了\n你回來了。\n$@c{smile}結束了。@d{64} 你終結了這個循環。\n$@c{serious_smile_fists}你也完成了自己的夢想,不是嗎?\n你甚至一次都沒失敗。\n$@c{neutral}我是唯一能夠記得你所作所為的人@d{96}\n我覺得這應該也還行吧?\n$@c{serious_smile_fists}你的傳奇將永遠留存於我們心中。\n$@c{smile_eclosed}不管了,我真是受夠這個地方了,你也一樣嗎?我們回家吧。\n$@c{serious_smile_fists}可能等我們回家以後,再打一場?\n要是你想的話", - "ending_female": "@c{shock}你回來了?@d{32} 也就是說…@d{96} 你贏了呀!?\n@c{smile_ehalf}我應該早料到了。\n$@c{smile_eclosed}當然…我一直有這種感覺\n@c{smile}一切都結束了,對麼? 你打破了循環。\n$@c{smile_ehalf}你也完成了自己的夢想,不是嗎?\n你甚至一次都沒失敗。\n$我是唯一能夠記得你所作所為的人\n@c{angry_mopen}我會努力不忘掉哒!\n$@c{smile_wave_wink}開玩笑啦,@d{64} @c{smile}我才不會忘呢。@d{32}\n你的傳奇將永遠留存於我們心中。\n$@c{smile_wave}不管了,@d{64} 時候不早了@d{96} ,應該吧?\n在這地方還真搞不清楚。\n$一起回家吧。 @c{smile_wave_wink}可能明天,我們再來打一場,為了重溫回憶嘛~" -} \ No newline at end of file + "ending": "@c{shock}你回來了?@d{32} 也就是說…@d{96} 你贏了呀!?\n@c{smile_ehalf}我應該早料到了。\n$@c{smile_eclosed}當然…我一直有這種感覺\n@c{smile}一切都結束了,對麼? 你打破了循環。\n$@c{smile_ehalf}你也完成了自己的夢想,不是嗎?\n你甚至一次都沒失敗。\n$我是唯一能夠記得你所作所為的人\n@c{angry_mopen}我會努力不忘掉哒!\n$@c{smile_wave_wink}開玩笑啦,@d{64} @c{smile}我才不會忘呢。@d{32}\n你的傳奇將永遠留存於我們心中。\n$@c{smile_wave}不管了,@d{64} 時候不早了@d{96} ,應該吧?\n在這地方還真搞不清楚。\n$一起回家吧。 @c{smile_wave_wink}可能明天,我們再來打一場,為了重溫回憶嘛~", + "ending_female": "@c{smile}哦?你贏了?@d{96} @c{smile_eclosed}我應該早猜到了\n你回來了。\n$@c{smile}結束了。@d{64} 你終結了這個循環。\n$@c{serious_smile_fists}你也完成了自己的夢想,不是嗎?\n你甚至一次都沒失敗。\n$@c{neutral}我是唯一能夠記得你所作所為的人@d{96}\n我覺得這應該也還行吧?\n$@c{serious_smile_fists}你的傳奇將永遠留存於我們心中。\n$@c{smile_eclosed}不管了,我真是受夠這個地方了,你也一樣嗎?我們回家吧。\n$@c{serious_smile_fists}可能等我們回家以後,再打一場?\n要是你想的話" +} diff --git a/src/locales/zh_TW/modifier-type.json b/src/locales/zh_TW/modifier-type.json index 847ede7001e..68881a206cb 100644 --- a/src/locales/zh_TW/modifier-type.json +++ b/src/locales/zh_TW/modifier-type.json @@ -49,8 +49,8 @@ "DoubleBattleChanceBoosterModifierType": { "description": "接下來的{{battleCount}}場戰鬥是雙打的概率翻倍。" }, - "TempBattleStatBoosterModifierType": { - "description": "爲所有成員寶可夢提升一級{{tempBattleStatName}},持續5場戰鬥。" + "TempStatStageBoosterModifierType": { + "description": "爲所有成員寶可夢提升一級{{stat}},持續5場戰鬥。" }, "AttackTypeBoosterModifierType": { "description": "一隻寶可夢的{{moveType}}系招式威力提升20%。" @@ -61,8 +61,8 @@ "AllPokemonLevelIncrementModifierType": { "description": "Increases all party members' level by {{levels}}." }, - "PokemonBaseStatBoosterModifierType": { - "description": "增加持有者的{{statName}}10%,個體值越高堆疊\n上限越高。" + "BaseStatBoosterModifierType": { + "description": "增加持有者的{{stat}}10%,個體值越高堆疊\n上限越高。" }, "AllPokemonFullHpRestoreModifierType": { "description": "所有寶可夢完全恢復HP。" @@ -244,6 +244,12 @@ "name": "焦點鏡", "description": "能看見弱點的鏡片。攜帶它的寶可夢的招式 會變得容易擊中要害。" }, + "DIRE_HIT": { + "name": "要害攻擊", + "extra": { + "raises": "會心" + } + }, "LEEK": { "name": "大蔥", "description": "非常長且堅硬的莖。讓大蔥鴨攜帶後,招式會 變得容易擊中要害。" @@ -407,25 +413,13 @@ "description": "讓百變怪攜帶後,速度就會提高的神奇粉末。非常細緻堅硬。" } }, - "TempBattleStatBoosterItem": { + "TempStatStageBoosterItem": { "x_attack": "力量強化", "x_defense": "防禦強化", "x_sp_atk": "特攻強化", "x_sp_def": "特防強化", "x_speed": "速度強化", - "x_accuracy": "命中強化", - "dire_hit": "要害攻擊" - }, - "TempBattleStatBoosterStatName": { - "ATK": "攻擊", - "DEF": "防禦", - "SPATK": "特攻", - "SPDEF": "特防", - "SPD": "速度", - "ACC": "命中", - "CRIT": "會心", - "EVA": "閃避", - "DEFAULT": "???" + "x_accuracy": "命中強化" }, "AttackTypeBoosterItem": { "silk_scarf": "絲綢圍巾", @@ -602,4 +596,4 @@ "FAIRY_MEMORY": "妖精記憶碟", "NORMAL_MEMORY": "一般記憶碟" } -} \ No newline at end of file +} diff --git a/src/locales/zh_TW/modifier.json b/src/locales/zh_TW/modifier.json index eb4b5107cff..1c0d4760e6f 100644 --- a/src/locales/zh_TW/modifier.json +++ b/src/locales/zh_TW/modifier.json @@ -8,4 +8,4 @@ "contactHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}奪取了!", "enemyTurnHealApply": "{{pokemonNameWithAffix}}\n回復了一些體力!", "bypassSpeedChanceApply": "{{pokemonName}}用了{{itemName}}後,行動變快了!" -} \ No newline at end of file +} diff --git a/src/locales/zh_TW/move-trigger.json b/src/locales/zh_TW/move-trigger.json index 60dcc1eab7a..d6d0ce659ea 100644 --- a/src/locales/zh_TW/move-trigger.json +++ b/src/locales/zh_TW/move-trigger.json @@ -3,6 +3,10 @@ "cutHpPowerUpMove": "{{pokemonName}}\n削減體力並提升了招式威力!", "absorbedElectricity": "{{pokemonName}}\n吸收了电力!", "switchedStatChanges": "{{pokemonName}}和對手互換了\n自身的能力變化!", + "switchedTwoStatChanges": "{{pokemonName}} 和對手互換了自身的{{firstStat}}和{{secondStat}}的能力變化!", + "switchedStat": "{{pokemonName}} 互換了各自的{{stat}}!", + "sharedGuard": "{{pokemonName}} 平分了各自的防守!", + "sharedPower": "{{pokemonName}} 平分了各自的力量!", "goingAllOutForAttack": "{{pokemonName}}拿出全力了!", "regainedHealth": "{{pokemonName}}的\n體力回復了!", "keptGoingAndCrashed": "{{pokemonName}}因勢頭過猛\n而撞到了地面!", diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index e693ca01052..fe586074c79 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -3,12 +3,10 @@ import { AttackMove, allMoves, selfStatLowerMoves } from "../data/move"; import { MAX_PER_TYPE_POKEBALLS, PokeballType, getPokeballCatchMultiplier, getPokeballName } from "../data/pokeball"; import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove } from "../field/pokemon"; import { EvolutionItem, pokemonEvolutions } from "../data/pokemon-evolutions"; -import { Stat, getStatName } from "../data/pokemon-stat"; import { tmPoolTiers, tmSpecies } from "../data/tms"; import { Type } from "../data/type"; import PartyUiHandler, { PokemonMoveSelectFilter, PokemonSelectFilter } from "../ui/party-ui-handler"; import * as Utils from "../utils"; -import { TempBattleStat, getTempBattleStatBoosterItemName, getTempBattleStatName } from "../data/temp-battle-stat"; import { getBerryEffectDescription, getBerryName } from "../data/berry"; import { Unlockables } from "../system/unlockables"; import { StatusEffect, getStatusEffectDescriptor } from "../data/status-effect"; @@ -28,6 +26,7 @@ import { BerryType } from "#enums/berry-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { getPokemonNameWithAffix } from "#app/messages.js"; +import { PermanentStat, TEMP_BATTLE_STATS, TempBattleStat, Stat, getStatKey } from "#app/enums/stat"; const outputModifierData = false; const useMaxWeightForOutput = false; @@ -447,26 +446,28 @@ export class DoubleBattleChanceBoosterModifierType extends ModifierType { } } -export class TempBattleStatBoosterModifierType extends ModifierType implements GeneratedPersistentModifierType { - public tempBattleStat: TempBattleStat; +export class TempStatStageBoosterModifierType extends ModifierType implements GeneratedPersistentModifierType { + private stat: TempBattleStat; + private key: string; - constructor(tempBattleStat: TempBattleStat) { - super("", getTempBattleStatBoosterItemName(tempBattleStat).replace(/\./g, "").replace(/[ ]/g, "_").toLowerCase(), - (_type, _args) => new Modifiers.TempBattleStatBoosterModifier(this, this.tempBattleStat)); + constructor(stat: TempBattleStat) { + const key = TempStatStageBoosterModifierTypeGenerator.items[stat]; + super("", key, (_type, _args) => new Modifiers.TempStatStageBoosterModifier(this, this.stat)); - this.tempBattleStat = tempBattleStat; + this.stat = stat; + this.key = key; } get name(): string { - return i18next.t(`modifierType:TempBattleStatBoosterItem.${getTempBattleStatBoosterItemName(this.tempBattleStat).replace(/\./g, "").replace(/[ ]/g, "_").toLowerCase()}`); + return i18next.t(`modifierType:TempStatStageBoosterItem.${this.key}`); } - getDescription(scene: BattleScene): string { - return i18next.t("modifierType:ModifierType.TempBattleStatBoosterModifierType.description", { tempBattleStatName: getTempBattleStatName(this.tempBattleStat) }); + getDescription(_scene: BattleScene): string { + return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { stat: i18next.t(getStatKey(this.stat)) }); } getPregenArgs(): any[] { - return [ this.tempBattleStat ]; + return [ this.stat ]; } } @@ -611,40 +612,24 @@ export class AllPokemonLevelIncrementModifierType extends ModifierType { } } -function getBaseStatBoosterItemName(stat: Stat) { - switch (stat) { - case Stat.HP: - return "HP Up"; - case Stat.ATK: - return "Protein"; - case Stat.DEF: - return "Iron"; - case Stat.SPATK: - return "Calcium"; - case Stat.SPDEF: - return "Zinc"; - case Stat.SPD: - return "Carbos"; - } -} +export class BaseStatBoosterModifierType extends PokemonHeldItemModifierType implements GeneratedPersistentModifierType { + private stat: PermanentStat; + private key: string; -export class PokemonBaseStatBoosterModifierType extends PokemonHeldItemModifierType implements GeneratedPersistentModifierType { - private localeName: string; - private stat: Stat; + constructor(stat: PermanentStat) { + const key = BaseStatBoosterModifierTypeGenerator.items[stat]; + super("", key, (_type, args) => new Modifiers.BaseStatModifier(this, (args[0] as Pokemon).id, this.stat)); - constructor(localeName: string, stat: Stat) { - super("", localeName.replace(/[ \-]/g, "_").toLowerCase(), (_type, args) => new Modifiers.PokemonBaseStatModifier(this, (args[0] as Pokemon).id, this.stat)); - - this.localeName = localeName; this.stat = stat; + this.key = key; } get name(): string { - return i18next.t(`modifierType:BaseStatBoosterItem.${this.localeName.replace(/[ \-]/g, "_").toLowerCase()}`); + return i18next.t(`modifierType:BaseStatBoosterItem.${this.key}`); } - getDescription(scene: BattleScene): string { - return i18next.t("modifierType:ModifierType.PokemonBaseStatBoosterModifierType.description", { statName: getStatName(this.stat) }); + getDescription(_scene: BattleScene): string { + return i18next.t("modifierType:ModifierType.BaseStatBoosterModifierType.description", { stat: i18next.t(getStatKey(this.stat)) }); } getPregenArgs(): any[] { @@ -922,6 +907,48 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator { } } +class BaseStatBoosterModifierTypeGenerator extends ModifierTypeGenerator { + public static readonly items: Record = { + [Stat.HP]: "hp_up", + [Stat.ATK]: "protein", + [Stat.DEF]: "iron", + [Stat.SPATK]: "calcium", + [Stat.SPDEF]: "zinc", + [Stat.SPD]: "carbos" + }; + + constructor() { + super((_party: Pokemon[], pregenArgs?: any[]) => { + if (pregenArgs) { + return new BaseStatBoosterModifierType(pregenArgs[0]); + } + const randStat: PermanentStat = Utils.randSeedInt(Stat.SPD + 1); + return new BaseStatBoosterModifierType(randStat); + }); + } +} + +class TempStatStageBoosterModifierTypeGenerator extends ModifierTypeGenerator { + public static readonly items: Record = { + [Stat.ATK]: "x_attack", + [Stat.DEF]: "x_defense", + [Stat.SPATK]: "x_sp_atk", + [Stat.SPDEF]: "x_sp_def", + [Stat.SPD]: "x_speed", + [Stat.ACC]: "x_accuracy" + }; + + constructor() { + super((_party: Pokemon[], pregenArgs?: any[]) => { + if (pregenArgs && (pregenArgs.length === 1) && TEMP_BATTLE_STATS.includes(pregenArgs[0])) { + return new TempStatStageBoosterModifierType(pregenArgs[0]); + } + const randStat: TempBattleStat = Utils.randSeedInt(Stat.ACC, Stat.ATK); + return new TempStatStageBoosterModifierType(randStat); + }); + } +} + /** * Modifier type generator for {@linkcode SpeciesStatBoosterModifierType}, which * encapsulates the logic for weighting the most useful held item from @@ -930,7 +957,7 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator { */ class SpeciesStatBoosterModifierTypeGenerator extends ModifierTypeGenerator { /** Object comprised of the currently available species-based stat boosting held items */ - public static items = { + public static readonly items = { LIGHT_BALL: { stats: [Stat.ATK, Stat.SPATK], multiplier: 2, species: [Species.PIKACHU] }, THICK_CLUB: { stats: [Stat.ATK], multiplier: 2, species: [Species.CUBONE, Species.MAROWAK, Species.ALOLA_MAROWAK] }, METAL_POWDER: { stats: [Stat.DEF], multiplier: 2, species: [Species.DITTO] }, @@ -1233,7 +1260,7 @@ export type GeneratorModifierOverride = { type?: SpeciesStatBoosterItem; } | { - name: keyof Pick; + name: keyof Pick; type?: TempBattleStat; } | { @@ -1306,7 +1333,7 @@ export const modifierTypes = { SACRED_ASH: () => new AllPokemonFullReviveModifierType("modifierType:ModifierType.SACRED_ASH", "sacred_ash"), REVIVER_SEED: () => new PokemonHeldItemModifierType("modifierType:ModifierType.REVIVER_SEED", "reviver_seed", (type, args) => new Modifiers.PokemonInstantReviveModifier(type, (args[0] as Pokemon).id)), - WHITE_HERB: () => new PokemonHeldItemModifierType("modifierType:ModifierType.WHITE_HERB", "white_herb", (type, args) => new Modifiers.PokemonResetNegativeStatStageModifier(type, (args[0] as Pokemon).id)), + WHITE_HERB: () => new PokemonHeldItemModifierType("modifierType:ModifierType.WHITE_HERB", "white_herb", (type, args) => new Modifiers.ResetNegativeStatStageModifier(type, (args[0] as Pokemon).id)), ETHER: () => new PokemonPpRestoreModifierType("modifierType:ModifierType.ETHER", "ether", 10), MAX_ETHER: () => new PokemonPpRestoreModifierType("modifierType:ModifierType.MAX_ETHER", "max_ether", -1), @@ -1327,23 +1354,15 @@ export const modifierTypes = { SPECIES_STAT_BOOSTER: () => new SpeciesStatBoosterModifierTypeGenerator(), - TEMP_STAT_BOOSTER: () => new ModifierTypeGenerator((party: Pokemon[], pregenArgs?: any[]) => { - if (pregenArgs && (pregenArgs.length === 1) && (pregenArgs[0] in TempBattleStat)) { - return new TempBattleStatBoosterModifierType(pregenArgs[0] as TempBattleStat); - } - const randTempBattleStat = Utils.randSeedInt(6) as TempBattleStat; - return new TempBattleStatBoosterModifierType(randTempBattleStat); - }), - DIRE_HIT: () => new TempBattleStatBoosterModifierType(TempBattleStat.CRIT), + TEMP_STAT_STAGE_BOOSTER: () => new TempStatStageBoosterModifierTypeGenerator(), - BASE_STAT_BOOSTER: () => new ModifierTypeGenerator((party: Pokemon[], pregenArgs?: any[]) => { - if (pregenArgs && (pregenArgs.length === 1) && (pregenArgs[0] in Stat)) { - const stat = pregenArgs[0] as Stat; - return new PokemonBaseStatBoosterModifierType(getBaseStatBoosterItemName(stat), stat); + DIRE_HIT: () => new class extends ModifierType { + getDescription(_scene: BattleScene): string { + return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { stat: i18next.t("modifierType:ModifierType.DIRE_HIT.extra.raises") }); } - const randStat = Utils.randSeedInt(6) as Stat; - return new PokemonBaseStatBoosterModifierType(getBaseStatBoosterItemName(randStat), randStat); - }), + }("modifierType:ModifierType.DIRE_HIT", "dire_hit", (type, _args) => new Modifiers.TempCritBoosterModifier(type)), + + BASE_STAT_BOOSTER: () => new BaseStatBoosterModifierTypeGenerator(), ATTACK_TYPE_BOOSTER: () => new AttackTypeBoosterModifierTypeGenerator(), @@ -1513,7 +1532,7 @@ const modifierPool: ModifierPool = { return thresholdPartyMemberCount; }, 3), new WeightedModifierType(modifierTypes.LURE, skipInLastClassicWaveOrDefault(2)), - new WeightedModifierType(modifierTypes.TEMP_STAT_BOOSTER, 4), + new WeightedModifierType(modifierTypes.TEMP_STAT_STAGE_BOOSTER, 4), new WeightedModifierType(modifierTypes.BERRY, 2), new WeightedModifierType(modifierTypes.TM_COMMON, 2), ].map(m => { @@ -1626,7 +1645,7 @@ const modifierPool: ModifierPool = { new WeightedModifierType(modifierTypes.WHITE_HERB, (party: Pokemon[]) => { const checkedAbilities = [Abilities.WEAK_ARMOR, Abilities.CONTRARY, Abilities.MOODY, Abilities.ANGER_SHELL, Abilities.COMPETITIVE, Abilities.DEFIANT]; const weightMultiplier = party.filter( - p => !p.getHeldItems().some(i => i instanceof Modifiers.PokemonResetNegativeStatStageModifier && i.stackCount >= i.getMaxHeldItemCount(p)) && + p => !p.getHeldItems().some(i => i instanceof Modifiers.ResetNegativeStatStageModifier && i.stackCount >= i.getMaxHeldItemCount(p)) && (checkedAbilities.some(a => p.hasAbility(a, false, true)) || p.getMoveset(true).some(m => m && selfStatLowerMoves.includes(m.moveId)))).length; // If a party member has one of the above moves or abilities and doesn't have max herbs, the herb will appear more frequently return 0 * (weightMultiplier ? 2 : 1) + (weightMultiplier ? weightMultiplier * 0 : 0); @@ -2225,7 +2244,7 @@ export class ModifierTypeOption { } export function getPartyLuckValue(party: Pokemon[]): integer { - const luck = Phaser.Math.Clamp(party.map(p => p.isFainted() ? 0 : p.getLuck()) + const luck = Phaser.Math.Clamp(party.map(p => p.isAllowedInBattle() ? p.getLuck() : 0) .reduce((total: integer, value: integer) => total += value, 0), 0, 14); return luck || 0; } diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index ca0b18ce18b..f3219c8bf73 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -3,14 +3,12 @@ import BattleScene from "../battle-scene"; import { getLevelTotalExp } from "../data/exp"; import { MAX_PER_TYPE_POKEBALLS, PokeballType } from "../data/pokeball"; import Pokemon, { PlayerPokemon } from "../field/pokemon"; -import { Stat } from "../data/pokemon-stat"; import { addTextObject, TextStyle } from "../ui/text"; import { Type } from "../data/type"; import { EvolutionPhase } from "../phases/evolution-phase"; import { FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; import { getPokemonNameWithAffix } from "../messages"; import * as Utils from "../utils"; -import { TempBattleStat } from "../data/temp-battle-stat"; import { getBerryEffectFunc, getBerryPredicate } from "../data/berry"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; @@ -23,6 +21,7 @@ import Overrides from "#app/overrides"; import { ModifierType, modifierTypes } from "./modifier-type"; import { Command } from "#app/ui/command-ui-handler"; import { Species } from "#enums/species"; +import { Stat, type PermanentStat, type TempBattleStat, BATTLE_STATS, TEMP_BATTLE_STATS } from "#app/enums/stat"; import i18next from "i18next"; import { allMoves } from "#app/data/move"; @@ -362,41 +361,160 @@ export class DoubleBattleChanceBoosterModifier extends LapsingPersistentModifier } } -export class TempBattleStatBoosterModifier extends LapsingPersistentModifier { - private tempBattleStat: TempBattleStat; +/** + * Modifier used for party-wide items, specifically the X items, that + * temporarily increases the stat stage multiplier of the corresponding + * {@linkcode TempBattleStat}. + * @extends LapsingPersistentModifier + * @see {@linkcode apply} + */ +export class TempStatStageBoosterModifier extends LapsingPersistentModifier { + private stat: TempBattleStat; + private multiplierBoost: number; - constructor(type: ModifierTypes.TempBattleStatBoosterModifierType, tempBattleStat: TempBattleStat, battlesLeft?: integer, stackCount?: integer) { - super(type, battlesLeft || 5, stackCount); + constructor(type: ModifierType, stat: TempBattleStat, battlesLeft?: number, stackCount?: number) { + super(type, battlesLeft ?? 5, stackCount); - this.tempBattleStat = tempBattleStat; + this.stat = stat; + // Note that, because we want X Accuracy to maintain its original behavior, + // it will increment as it did previously, directly to the stat stage. + this.multiplierBoost = stat !== Stat.ACC ? 0.3 : 1; } match(modifier: Modifier): boolean { - if (modifier instanceof TempBattleStatBoosterModifier) { - return (modifier as TempBattleStatBoosterModifier).tempBattleStat === this.tempBattleStat - && (modifier as TempBattleStatBoosterModifier).battlesLeft === this.battlesLeft; + if (modifier instanceof TempStatStageBoosterModifier) { + const modifierInstance = modifier as TempStatStageBoosterModifier; + return (modifierInstance.stat === this.stat); } return false; } - clone(): TempBattleStatBoosterModifier { - return new TempBattleStatBoosterModifier(this.type as ModifierTypes.TempBattleStatBoosterModifierType, this.tempBattleStat, this.battlesLeft, this.stackCount); + clone() { + return new TempStatStageBoosterModifier(this.type, this.stat, this.battlesLeft, this.stackCount); } getArgs(): any[] { - return [ this.tempBattleStat, this.battlesLeft ]; + return [ this.stat, this.battlesLeft ]; } - apply(args: any[]): boolean { - const tempBattleStat = args[0] as TempBattleStat; + /** + * Checks if {@linkcode args} contains the necessary elements and if the + * incoming stat is matches {@linkcode stat}. + * @param args [0] {@linkcode TempBattleStat} being checked at the time + * [1] {@linkcode Utils.NumberHolder} N/A + * @returns true if the modifier can be applied, false otherwise + */ + shouldApply(args: any[]): boolean { + return args && (args.length === 2) && TEMP_BATTLE_STATS.includes(args[0]) && (args[0] === this.stat) && (args[1] instanceof Utils.NumberHolder); + } - if (tempBattleStat === this.tempBattleStat) { - const statLevel = args[1] as Utils.IntegerHolder; - statLevel.value = Math.min(statLevel.value + 1, 6); - return true; + /** + * Increases the incoming stat stage matching {@linkcode stat} by {@linkcode multiplierBoost}. + * @param args [0] {@linkcode TempBattleStat} N/A + * [1] {@linkcode Utils.NumberHolder} that holds the resulting value of the stat stage multiplier + */ + apply(args: any[]): boolean { + (args[1] as Utils.NumberHolder).value += this.multiplierBoost; + return true; + } + + /** + * Goes through existing modifiers for any that match the selected modifier, + * which will then either add it to the existing modifiers if none were found + * or, if one was found, it will refresh {@linkcode battlesLeft}. + * @param modifiers {@linkcode PersistentModifier} array of the player's modifiers + * @param _virtual N/A + * @param _scene N/A + * @returns true if the modifier was successfully added or applied, false otherwise + */ + add(modifiers: PersistentModifier[], _virtual: boolean, _scene: BattleScene): boolean { + for (const modifier of modifiers) { + if (this.match(modifier)) { + const modifierInstance = modifier as TempStatStageBoosterModifier; + if (modifierInstance.getBattlesLeft() < 5) { + modifierInstance.battlesLeft = 5; + return true; + } + // should never get here + return false; + } } - return false; + modifiers.push(this); + return true; + } + + getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number { + return 1; + } +} + +/** + * Modifier used for party-wide items, namely Dire Hit, that + * temporarily increments the critical-hit stage + * @extends LapsingPersistentModifier + * @see {@linkcode apply} + */ +export class TempCritBoosterModifier extends LapsingPersistentModifier { + constructor(type: ModifierType, battlesLeft?: integer, stackCount?: number) { + super(type, battlesLeft || 5, stackCount); + } + + clone() { + return new TempCritBoosterModifier(this.type, this.stackCount); + } + + match(modifier: Modifier): boolean { + return (modifier instanceof TempCritBoosterModifier); + } + + /** + * Checks if {@linkcode args} contains the necessary elements. + * @param args [1] {@linkcode Utils.NumberHolder} N/A + * @returns true if the critical-hit stage boost applies successfully + */ + shouldApply(args: any[]): boolean { + return args && (args.length === 1) && (args[0] instanceof Utils.NumberHolder); + } + + /** + * Increases the current critical-hit stage value by 1. + * @param args [0] {@linkcode Utils.IntegerHolder} that holds the resulting critical-hit level + * @returns true if the critical-hit stage boost applies successfully + */ + apply(args: any[]): boolean { + (args[0] as Utils.NumberHolder).value++; + return true; + } + + /** + * Goes through existing modifiers for any that match the selected modifier, + * which will then either add it to the existing modifiers if none were found + * or, if one was found, it will refresh {@linkcode battlesLeft}. + * @param modifiers {@linkcode PersistentModifier} array of the player's modifiers + * @param _virtual N/A + * @param _scene N/A + * @returns true if the modifier was successfully added or applied, false otherwise + */ + add(modifiers: PersistentModifier[], _virtual: boolean, _scene: BattleScene): boolean { + for (const modifier of modifiers) { + if (this.match(modifier)) { + const modifierInstance = modifier as TempCritBoosterModifier; + if (modifierInstance.getBattlesLeft() < 5) { + modifierInstance.battlesLeft = 5; + return true; + } + // should never get here + return false; + } + } + + modifiers.push(this); + return true; + } + + getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number { + return 1; } } @@ -663,24 +781,30 @@ export class TerastallizeModifier extends LapsingPokemonHeldItemModifier { } } -export class PokemonBaseStatModifier extends PokemonHeldItemModifier { - protected stat: Stat; +/** + * Modifier used for held items, specifically vitamins like Carbos, Hp Up, etc., that + * increase the value of a given {@linkcode PermanentStat}. + * @extends LapsingPersistentModifier + * @see {@linkcode apply} + */ +export class BaseStatModifier extends PokemonHeldItemModifier { + protected stat: PermanentStat; readonly isTransferrable: boolean = false; - constructor(type: ModifierTypes.PokemonBaseStatBoosterModifierType, pokemonId: integer, stat: Stat, stackCount?: integer) { + constructor(type: ModifierType, pokemonId: integer, stat: PermanentStat, stackCount?: integer) { super(type, pokemonId, stackCount); this.stat = stat; } matchType(modifier: Modifier): boolean { - if (modifier instanceof PokemonBaseStatModifier) { - return (modifier as PokemonBaseStatModifier).stat === this.stat; + if (modifier instanceof BaseStatModifier) { + return (modifier as BaseStatModifier).stat === this.stat; } return false; } clone(): PersistentModifier { - return new PokemonBaseStatModifier(this.type as ModifierTypes.PokemonBaseStatBoosterModifierType, this.pokemonId, this.stat, this.stackCount); + return new BaseStatModifier(this.type, this.pokemonId, this.stat, this.stackCount); } getArgs(): any[] { @@ -688,12 +812,12 @@ export class PokemonBaseStatModifier extends PokemonHeldItemModifier { } shouldApply(args: any[]): boolean { - return super.shouldApply(args) && args.length === 2 && args[1] instanceof Array; + return super.shouldApply(args) && args.length === 2 && Array.isArray(args[1]); } apply(args: any[]): boolean { - args[1][this.stat] = Math.min(Math.floor(args[1][this.stat] * (1 + this.getStackCount() * 0.1)), 999999); - + const baseStats = args[1] as number[]; + baseStats[this.stat] = Math.floor(baseStats[this.stat] * (1 + this.getStackCount() * 0.1)); return true; } @@ -1398,42 +1522,48 @@ export class PokemonInstantReviveModifier extends PokemonHeldItemModifier { } /** - * Modifier used for White Herb, which resets negative {@linkcode Stat} changes + * Modifier used for held items, namely White Herb, that restore adverse stat + * stages in battle. * @extends PokemonHeldItemModifier * @see {@linkcode apply} */ -export class PokemonResetNegativeStatStageModifier extends PokemonHeldItemModifier { +export class ResetNegativeStatStageModifier extends PokemonHeldItemModifier { constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) { super(type, pokemonId, stackCount); } matchType(modifier: Modifier) { - return modifier instanceof PokemonResetNegativeStatStageModifier; + return modifier instanceof ResetNegativeStatStageModifier; } clone() { - return new PokemonResetNegativeStatStageModifier(this.type, this.pokemonId, this.stackCount); + return new ResetNegativeStatStageModifier(this.type, this.pokemonId, this.stackCount); } /** - * Restores any negative stat stages of the mon to 0 - * @param args args[0] is the {@linkcode Pokemon} whose stat stages are being checked - * @returns true if any stat changes were applied (item was used), false otherwise + * Goes through the holder's stat stages and, if any are negative, resets that + * stat stage back to 0. + * @param args [0] {@linkcode Pokemon} that holds the held item + * @returns true if any stat stages were reset, false otherwise */ apply(args: any[]): boolean { const pokemon = args[0] as Pokemon; - const loweredStats = pokemon.summonData.battleStats.filter(s => s < 0); - if (loweredStats.length) { - for (let s = 0; s < pokemon.summonData.battleStats.length; s++) { - pokemon.summonData.battleStats[s] = Math.max(0, pokemon.summonData.battleStats[s]); + let statRestored = false; + + for (const s of BATTLE_STATS) { + if (pokemon.getStatStage(s) < 0) { + pokemon.setStatStage(s, 0); + statRestored = true; } - pokemon.scene.queueMessage(i18next.t("modifier:pokemonResetNegativeStatStageApply", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), typeName: this.type.name })); - return true; } - return false; + + if (statRestored) { + pokemon.scene.queueMessage(i18next.t("modifier:resetNegativeStatStageApply", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), typeName: this.type.name })); + } + return statRestored; } - getMaxHeldItemCount(pokemon: Pokemon): integer { + getMaxHeldItemCount(_pokemon: Pokemon): integer { return 2; } } @@ -1625,7 +1755,7 @@ export class TmModifier extends ConsumablePokemonModifier { apply(args: any[]): boolean { const pokemon = args[0] as PlayerPokemon; - pokemon.scene.unshiftPhase(new LearnMovePhase(pokemon.scene, pokemon.scene.getParty().indexOf(pokemon), (this.type as ModifierTypes.TmModifierType).moveId)); + pokemon.scene.unshiftPhase(new LearnMovePhase(pokemon.scene, pokemon.scene.getParty().indexOf(pokemon), (this.type as ModifierTypes.TmModifierType).moveId, true)); return true; } @@ -2358,7 +2488,7 @@ export class TurnHeldItemTransferModifier extends HeldItemTransferModifier { } getTransferMessage(pokemon: Pokemon, targetPokemon: Pokemon, item: ModifierTypes.ModifierType): string { - return i18next.t("modifier:turnHeldItemTransferApply", { pokemonNameWithAffix: getPokemonNameWithAffix(targetPokemon), itemName: item.name, pokemonName: pokemon.name, typeName: this.type.name }); + return i18next.t("modifier:turnHeldItemTransferApply", { pokemonNameWithAffix: getPokemonNameWithAffix(targetPokemon), itemName: item.name, pokemonName: pokemon.getNameToRender(), typeName: this.type.name }); } getMaxHeldItemCount(pokemon: Pokemon): integer { @@ -2745,7 +2875,7 @@ export class EnemyFusionChanceModifier extends EnemyPersistentModifier { * - The player * - The enemy * @param scene current {@linkcode BattleScene} - * @param isPlayer {@linkcode boolean} for whether the the player (`true`) or enemy (`false`) is being overridden + * @param isPlayer {@linkcode boolean} for whether the player (`true`) or enemy (`false`) is being overridden */ export function overrideModifiers(scene: BattleScene, isPlayer: boolean = true): void { const modifiersOverride: ModifierTypes.ModifierOverride[] = isPlayer ? Overrides.STARTING_MODIFIER_OVERRIDE : Overrides.OPP_MODIFIER_OVERRIDE; @@ -2760,13 +2890,22 @@ export function overrideModifiers(scene: BattleScene, isPlayer: boolean = true): modifiersOverride.forEach(item => { const modifierFunc = modifierTypes[item.name]; - const modifier = modifierFunc().withIdFromFunc(modifierFunc).newModifier() as PersistentModifier; - modifier.stackCount = item.count || 1; + let modifierType: ModifierType | null = modifierFunc(); - if (isPlayer) { - scene.addModifier(modifier, true, false, false, true); - } else { - scene.addEnemyModifier(modifier, true, true); + if (modifierType instanceof ModifierTypes.ModifierTypeGenerator) { + const pregenArgs = ("type" in item) && (item.type !== null) ? [item.type] : undefined; + modifierType = modifierType.generateType([], pregenArgs); + } + + const modifier = modifierType && modifierType.withIdFromFunc(modifierFunc).newModifier() as PersistentModifier; + if (modifier) { + modifier.stackCount = item.count || 1; + + if (isPlayer) { + scene.addModifier(modifier, true, false, false, true); + } else { + scene.addEnemyModifier(modifier, true, true); + } } }); } diff --git a/src/overrides.ts b/src/overrides.ts index 32ff116f41d..48c118b55bc 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -116,6 +116,14 @@ class DefaultOverrides { readonly OPP_VARIANT_OVERRIDE: Variant = 0; readonly OPP_IVS_OVERRIDE: number | number[] = []; readonly OPP_FORM_OVERRIDES: Partial> = {}; + /** + * Override to give the enemy Pokemon a given amount of health segments + * + * 0 (default): the health segments will be handled normally based on wave, level and species + * 1: the Pokemon will have a single health segment and therefore will not be a boss + * 2+: the Pokemon will be a boss with the given number of health segments + */ + readonly OPP_HEALTH_SEGMENTS_OVERRIDE: number = 0; // ------------- // EGG OVERRIDES diff --git a/src/phases/attempt-run-phase.ts b/src/phases/attempt-run-phase.ts index 817801985d2..9cf86fed592 100644 --- a/src/phases/attempt-run-phase.ts +++ b/src/phases/attempt-run-phase.ts @@ -1,31 +1,34 @@ -import BattleScene from "#app/battle-scene.js"; -import { applyAbAttrs, RunSuccessAbAttr } from "#app/data/ability.js"; -import { Stat } from "#app/enums/stat.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import Pokemon from "#app/field/pokemon.js"; +import BattleScene from "#app/battle-scene"; +import { applyAbAttrs, RunSuccessAbAttr } from "#app/data/ability"; +import { Stat } from "#app/enums/stat"; +import { StatusEffect } from "#app/enums/status-effect"; +import Pokemon, { PlayerPokemon, EnemyPokemon } from "#app/field/pokemon"; import i18next from "i18next"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; import { BattleEndPhase } from "./battle-end-phase"; import { NewBattlePhase } from "./new-battle-phase"; import { PokemonPhase } from "./pokemon-phase"; export class AttemptRunPhase extends PokemonPhase { - constructor(scene: BattleScene, fieldIndex: integer) { + constructor(scene: BattleScene, fieldIndex: number) { super(scene, fieldIndex); } start() { super.start(); - const playerPokemon = this.getPokemon(); + const playerField = this.scene.getPlayerField(); const enemyField = this.scene.getEnemyField(); - const enemySpeed = enemyField.reduce((total: integer, enemyPokemon: Pokemon) => total + enemyPokemon.getStat(Stat.SPD), 0) / enemyField.length; + const playerPokemon = this.getPokemon(); + + const escapeChance = new Utils.NumberHolder(0); + + this.attemptRunAway(playerField, enemyField, escapeChance); - const escapeChance = new Utils.IntegerHolder((((playerPokemon.getStat(Stat.SPD) * 128) / enemySpeed) + (30 * this.scene.currentBattle.escapeAttempts++)) % 256); applyAbAttrs(RunSuccessAbAttr, playerPokemon, null, false, escapeChance); - if (playerPokemon.randSeedInt(256) < escapeChance.value) { + if (Utils.randSeedInt(100) < escapeChance.value) { this.scene.playSound("se/flee"); this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500); @@ -53,4 +56,48 @@ export class AttemptRunPhase extends PokemonPhase { this.end(); } + + attemptRunAway(playerField: PlayerPokemon[], enemyField: EnemyPokemon[], escapeChance: Utils.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); + + /* 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. + * Again, the more times you've tried to escape, the higher your odds of escaping. Bosses and non-bosses are calculated differently - bosses are harder to escape from vs non-bosses + * Finally, there's a minimum and maximum escape chance as well so that escapes aren't guaranteed, yet they are never 0 either. + * The percentage chance to escape from a pokemon for both bosses and non bosses is linear and based on the minimum and maximum chances, and the speed ratio cap. + * + * At the time of writing, these conditions should be met: + * - The minimum escape chance should be 5% for bosses and non bosses + * - Bosses should have a maximum escape chance of 25%, whereas non-bosses should be 95% + * - The bonus per previous escape attempt should be 2% for bosses and 10% for non-bosses + * - The speed ratio cap should be 6x for bosses and 4x for non-bosses + * - The "default" escape chance when your speed equals the enemy speed should be 8.33% for bosses and 27.5% for non-bosses + * + * 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 + } + + /** The ratio between the speed of your active pokemon and the speed of the enemy field */ + const speedRatio = playerSpeed / enemySpeed; + /** The max ratio before escape chance stops increasing. Increased if there is a boss on the field */ + const speedCap = isBoss ? 6 : 4; + /** Minimum percent chance to escape */ + const minChance = 5; + /** Maximum percent chance to escape. Decreased if a boss is on the field */ + const maxChance = isBoss ? 25 : 95; + /** How much each escape attempt increases the chance of the next attempt. Decreased if a boss is on the field */ + const escapeBonus = isBoss ? 2 : 10; + /** Slope of the escape chance curve */ + 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 * this.scene.currentBattle.escapeAttempts++)), minChance, maxChance); + } } diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index 9681a6eeee8..47d212aa598 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -107,8 +107,9 @@ export class CommandPhase extends FieldPhase { // Decides between a Disabled, Not Implemented, or No PP translation message const errorMessage = - playerPokemon.summonData.disabledMove === move.moveId ? "battle:moveDisabled" : - move.getName().endsWith(" (N)") ? "battle:moveNotImplemented" : "battle:moveNoPP"; + playerPokemon.isMoveRestricted(move.moveId) + ? playerPokemon.getRestrictingTag(move.moveId)!.selectionDeniedText(playerPokemon, move.moveId) + : move.getName().endsWith(" (N)") ? "battle:moveNotImplemented" : "battle:moveNoPP"; const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator this.scene.ui.showText(i18next.t(errorMessage, { moveName: moveName }), null, () => { diff --git a/src/phases/egg-hatch-phase.ts b/src/phases/egg-hatch-phase.ts index a5b0252d4de..4b03aa62f02 100644 --- a/src/phases/egg-hatch-phase.ts +++ b/src/phases/egg-hatch-phase.ts @@ -1,23 +1,29 @@ -import BattleScene, { AnySound } from "#app/battle-scene.js"; -import { Egg, EGG_SEED } from "#app/data/egg.js"; -import { EggCountChangedEvent } from "#app/events/egg.js"; -import { PlayerPokemon } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { Phase } from "#app/phase.js"; -import { achvs } from "#app/system/achv.js"; -import EggCounterContainer from "#app/ui/egg-counter-container.js"; -import EggHatchSceneHandler from "#app/ui/egg-hatch-scene-handler.js"; -import PokemonInfoContainer from "#app/ui/pokemon-info-container.js"; -import { Mode } from "#app/ui/ui.js"; +import BattleScene, { AnySound } from "#app/battle-scene"; +import { Egg } from "#app/data/egg"; +import { EggCountChangedEvent } from "#app/events/egg"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { Phase } from "#app/phase"; +import { achvs } from "#app/system/achv"; +import EggCounterContainer from "#app/ui/egg-counter-container"; +import EggHatchSceneHandler from "#app/ui/egg-hatch-scene-handler"; +import PokemonInfoContainer from "#app/ui/pokemon-info-container"; +import { Mode } from "#app/ui/ui"; import i18next from "i18next"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import * as Utils from "#app/utils.js"; +import * as Utils from "#app/utils"; +import { EggLapsePhase } from "./egg-lapse-phase"; +import { EggHatchData } from "#app/data/egg-hatch-data"; + + /** * Class that represents egg hatching */ export class EggHatchPhase extends Phase { /** The egg that is hatching */ private egg: Egg; + /** The new EggHatchData for the egg/pokemon that hatches */ + private eggHatchData: EggHatchData; /** The number of eggs that are hatching */ private eggsToHatchCount: integer; @@ -58,10 +64,11 @@ export class EggHatchPhase extends Phase { private skipped: boolean; /** The sound effect being played when the egg is hatched */ private evolutionBgm: AnySound; + private eggLapsePhase: EggLapsePhase; - constructor(scene: BattleScene, egg: Egg, eggsToHatchCount: integer) { + constructor(scene: BattleScene, hatchScene: EggLapsePhase, egg: Egg, eggsToHatchCount: integer) { super(scene); - + this.eggLapsePhase = hatchScene; this.egg = egg; this.eggsToHatchCount = eggsToHatchCount; } @@ -307,6 +314,7 @@ export class EggHatchPhase extends Phase { * Function to do the logic and animation of completing a hatch and revealing the Pokemon */ doReveal(): void { + // set the previous dex data so info container can show new unlocks in egg summary const isShiny = this.pokemon.isShiny(); if (this.pokemon.species.subLegendary) { this.scene.validateAchv(achvs.HATCH_SUB_LEGENDARY); @@ -345,13 +353,13 @@ export class EggHatchPhase extends Phase { this.scene.ui.showText(i18next.t("egg:hatchFromTheEgg", { pokemonName: getPokemonNameWithAffix(this.pokemon) }), null, () => { this.scene.gameData.updateSpeciesDexIvs(this.pokemon.species.speciesId, this.pokemon.ivs); this.scene.gameData.setPokemonCaught(this.pokemon, true, true).then(() => { - this.scene.gameData.setEggMoveUnlocked(this.pokemon.species, this.eggMoveIndex).then(() => { + this.scene.gameData.setEggMoveUnlocked(this.pokemon.species, this.eggMoveIndex).then((value) => { + this.eggHatchData.setEggMoveUnlocked(value); this.scene.ui.showText("", 0); this.end(); }); }); }, null, true, 3000); - //this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm()); }); }); this.scene.tweens.add({ @@ -435,17 +443,11 @@ export class EggHatchPhase extends Phase { /** * Generates a Pokemon to be hatched by the egg + * Also stores the generated pokemon in this.eggHatchData * @returns the hatched PlayerPokemon */ generatePokemon(): PlayerPokemon { - let ret: PlayerPokemon; - - this.scene.executeWithSeedOffset(() => { - ret = this.egg.generatePlayerPokemon(this.scene); - this.eggMoveIndex = this.egg.eggMoveIndex; - - }, this.egg.id, EGG_SEED.toString()); - - return ret!; + this.eggHatchData = this.eggLapsePhase.generatePokemon(this.egg); + return this.eggHatchData.pokemon; } } diff --git a/src/phases/egg-lapse-phase.ts b/src/phases/egg-lapse-phase.ts index 50d7106f229..1adb1568166 100644 --- a/src/phases/egg-lapse-phase.ts +++ b/src/phases/egg-lapse-phase.ts @@ -1,11 +1,23 @@ -import BattleScene from "#app/battle-scene.js"; -import { Egg } from "#app/data/egg.js"; -import { Phase } from "#app/phase.js"; +import BattleScene from "#app/battle-scene"; +import { Egg, EGG_SEED } from "#app/data/egg"; +import { Phase } from "#app/phase"; import i18next from "i18next"; import Overrides from "#app/overrides"; import { EggHatchPhase } from "./egg-hatch-phase"; +import { Mode } from "#app/ui/ui"; +import { achvs } from "#app/system/achv"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { EggSummaryPhase } from "./egg-summary-phase"; +import { EggHatchData } from "#app/data/egg-hatch-data"; +/** + * Phase that handles updating eggs, and hatching any ready eggs + * Also handles prompts for skipping animation, and calling the egg summary phase + */ export class EggLapsePhase extends Phase { + + private eggHatchData: EggHatchData[] = []; + private readonly minEggsToPromptSkip: number = 5; constructor(scene: BattleScene) { super(scene); } @@ -16,20 +28,111 @@ export class EggLapsePhase extends Phase { const eggsToHatch: Egg[] = this.scene.gameData.eggs.filter((egg: Egg) => { return Overrides.EGG_IMMEDIATE_HATCH_OVERRIDE ? true : --egg.hatchWaves < 1; }); + const eggsToHatchCount: number = eggsToHatch.length; + this.eggHatchData= []; - let eggCount: integer = eggsToHatch.length; + if (eggsToHatchCount > 0) { - if (eggCount) { - this.scene.queueMessage(i18next.t("battle:eggHatching")); - - for (const egg of eggsToHatch) { - this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg, eggCount)); - if (eggCount > 0) { - eggCount--; - } + if (eggsToHatchCount >= this.minEggsToPromptSkip) { + this.scene.ui.showText(i18next.t("battle:eggHatching"), 0, () => { + // show prompt for skip + this.scene.ui.showText(i18next.t("battle:eggSkipPrompt"), 0); + this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => { + this.hatchEggsSkipped(eggsToHatch); + this.showSummary(); + }, () => { + this.hatchEggsRegular(eggsToHatch); + this.showSummary(); + } + ); + }, 100, true); + } else { + // regular hatches, no summary + this.scene.queueMessage(i18next.t("battle:eggHatching")); + this.hatchEggsRegular(eggsToHatch); + this.end(); } - + } else { + this.end(); } + } + + /** + * Hatches eggs normally one by one, showing animations + * @param eggsToHatch list of eggs to hatch + */ + hatchEggsRegular(eggsToHatch: Egg[]) { + let eggsToHatchCount: number = eggsToHatch.length; + for (const egg of eggsToHatch) { + this.scene.unshiftPhase(new EggHatchPhase(this.scene, this, egg, eggsToHatchCount)); + eggsToHatchCount--; + } + } + + /** + * Hatches eggs with no animations + * @param eggsToHatch list of eggs to hatch + */ + hatchEggsSkipped(eggsToHatch: Egg[]) { + for (const egg of eggsToHatch) { + this.hatchEggSilently(egg); + } + } + + showSummary() { + this.scene.unshiftPhase(new EggSummaryPhase(this.scene, this.eggHatchData)); this.end(); } + + /** + * Hatches an egg and stores it in the local EggHatchData array without animations + * Also validates the achievements for the hatched pokemon and removes the egg + * @param egg egg to hatch + */ + hatchEggSilently(egg: Egg) { + const eggIndex = this.scene.gameData.eggs.findIndex(e => e.id === egg.id); + if (eggIndex === -1) { + return this.end(); + } + this.scene.gameData.eggs.splice(eggIndex, 1); + + const data = this.generatePokemon(egg); + const pokemon = data.pokemon; + if (pokemon.fusionSpecies) { + pokemon.clearFusionSpecies(); + } + + if (pokemon.species.subLegendary) { + this.scene.validateAchv(achvs.HATCH_SUB_LEGENDARY); + } + if (pokemon.species.legendary) { + this.scene.validateAchv(achvs.HATCH_LEGENDARY); + } + if (pokemon.species.mythical) { + this.scene.validateAchv(achvs.HATCH_MYTHICAL); + } + if (pokemon.isShiny()) { + this.scene.validateAchv(achvs.HATCH_SHINY); + } + + } + + /** + * Generates a Pokemon and creates a new EggHatchData instance for the given egg + * @param egg the egg to hatch + * @returns the hatched PlayerPokemon + */ + generatePokemon(egg: Egg): EggHatchData { + let ret: PlayerPokemon; + let newHatchData: EggHatchData; + this.scene.executeWithSeedOffset(() => { + ret = egg.generatePlayerPokemon(this.scene); + newHatchData = new EggHatchData(this.scene, ret, egg.eggMoveIndex); + newHatchData.setDex(); + this.eggHatchData.push(newHatchData); + + }, egg.id, EGG_SEED.toString()); + return newHatchData!; + } + } diff --git a/src/phases/egg-summary-phase.ts b/src/phases/egg-summary-phase.ts new file mode 100644 index 00000000000..190af17c724 --- /dev/null +++ b/src/phases/egg-summary-phase.ts @@ -0,0 +1,50 @@ +import BattleScene from "#app/battle-scene"; +import { Phase } from "#app/phase"; +import { Mode } from "#app/ui/ui"; +import EggHatchSceneHandler from "#app/ui/egg-hatch-scene-handler"; +import { EggHatchData } from "#app/data/egg-hatch-data"; + +/** + * Class that represents the egg summary phase + * It does some of the function for updating egg data + * Phase is handled mostly by the egg-hatch-scene-handler UI + */ +export class EggSummaryPhase extends Phase { + private eggHatchData: EggHatchData[]; + private eggHatchHandler: EggHatchSceneHandler; + + constructor(scene: BattleScene, eggHatchData: EggHatchData[]) { + super(scene); + this.eggHatchData = eggHatchData; + } + + start() { + super.start(); + + // updates next pokemon once the current update has been completed + const updateNextPokemon = (i: number) => { + if (i >= this.eggHatchData.length) { + this.scene.ui.setModeForceTransition(Mode.EGG_HATCH_SUMMARY, this.eggHatchData).then(() => { + this.scene.fadeOutBgm(undefined, false); + this.eggHatchHandler = this.scene.ui.getHandler() as EggHatchSceneHandler; + }); + + } else { + this.eggHatchData[i].setDex(); + this.eggHatchData[i].updatePokemon().then(() => { + if (i < this.eggHatchData.length) { + updateNextPokemon(i + 1); + } + }); + } + }; + updateNextPokemon(0); + + } + + end() { + this.eggHatchHandler.clear(); + this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {}); + super.end(); + } +} diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 07bfd72a8bf..3f37095569a 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -26,6 +26,7 @@ import { ScanIvsPhase } from "./scan-ivs-phase"; import { ShinySparklePhase } from "./shiny-sparkle-phase"; import { SummonPhase } from "./summon-phase"; import { ToggleDoublePositionPhase } from "./toggle-double-position-phase"; +import Overrides from "#app/overrides"; export class EncounterPhase extends BattlePhase { private loaded: boolean; @@ -112,10 +113,11 @@ export class EncounterPhase extends BattlePhase { if (battle.battleType === BattleType.TRAINER) { loadEnemyAssets.push(battle.trainer?.loadAssets().then(() => battle.trainer?.initSprite())!); // TODO: is this bang correct? } else { - // This block only applies for double battles to init the boss segments (idk why it's split up like this) - if (battle.enemyParty.filter(p => p.isBoss()).length > 1) { + const overridedBossSegments = Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE > 1; + // for double battles, reduce the health segments for boss Pokemon unless there is an override + if (!overridedBossSegments && battle.enemyParty.filter(p => p.isBoss()).length > 1) { for (const enemyPokemon of battle.enemyParty) { - // If the enemy pokemon is a boss and wasn't populated from data source, then set it up + // If the enemy pokemon is a boss and wasn't populated from data source, then update the number of segments if (enemyPokemon.isBoss() && !enemyPokemon.isPopulatedFromDataSource) { enemyPokemon.setBoss(true, Math.ceil(enemyPokemon.bossSegments * (enemyPokemon.getSpeciesForm().baseTotal / totalBst))); enemyPokemon.initBattleInfo(); @@ -159,9 +161,11 @@ export class EncounterPhase extends BattlePhase { return this.scene.reset(true); } this.doEncounter(); + this.scene.resetSeed(); }); } else { this.doEncounter(); + this.scene.resetSeed(); } }); }); diff --git a/src/phases/enemy-command-phase.ts b/src/phases/enemy-command-phase.ts index d9bb08d6fae..91ee0456cd4 100644 --- a/src/phases/enemy-command-phase.ts +++ b/src/phases/enemy-command-phase.ts @@ -77,4 +77,8 @@ export class EnemyCommandPhase extends FieldPhase { this.end(); } + + getFieldIndex(): number { + return this.fieldIndex; + } } diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 66946d268cb..d5dd9f61340 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -1,14 +1,14 @@ -import BattleScene from "#app/battle-scene.js"; -import { BattlerIndex, BattleType } from "#app/battle.js"; -import { applyPostFaintAbAttrs, PostFaintAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr } from "#app/data/ability.js"; -import { BattlerTagLapseType } from "#app/data/battler-tags.js"; -import { battleSpecDialogue } from "#app/data/dialogue.js"; -import { allMoves, PostVictoryStatChangeAttr } from "#app/data/move.js"; -import { BattleSpec } from "#app/enums/battle-spec.js"; -import { StatusEffect } from "#app/enums/status-effect.js"; -import { PokemonMove, EnemyPokemon, PlayerPokemon, HitResult } from "#app/field/pokemon.js"; -import { getPokemonNameWithAffix } from "#app/messages.js"; -import { PokemonInstantReviveModifier } from "#app/modifier/modifier.js"; +import BattleScene from "#app/battle-scene"; +import { BattlerIndex, BattleType } from "#app/battle"; +import { applyPostFaintAbAttrs, PostFaintAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr } from "#app/data/ability"; +import { BattlerTagLapseType } from "#app/data/battler-tags"; +import { battleSpecDialogue } from "#app/data/dialogue"; +import { allMoves, PostVictoryStatStageChangeAttr } from "#app/data/move"; +import { BattleSpec } from "#app/enums/battle-spec"; +import { StatusEffect } from "#app/enums/status-effect"; +import { PokemonMove, EnemyPokemon, PlayerPokemon, HitResult } from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { PokemonInstantReviveModifier } from "#app/modifier/modifier"; import i18next from "i18next"; import { DamagePhase } from "./damage-phase"; import { PokemonPhase } from "./pokemon-phase"; @@ -72,7 +72,7 @@ export class FaintPhase extends PokemonPhase { if (defeatSource?.isOnField()) { applyPostVictoryAbAttrs(PostVictoryAbAttr, defeatSource); const pvmove = allMoves[pokemon.turnData.attacksReceived[0].move]; - const pvattrs = pvmove.getAttrs(PostVictoryStatChangeAttr); + const pvattrs = pvmove.getAttrs(PostVictoryStatStageChangeAttr); if (pvattrs.length) { for (const pvattr of pvattrs) { pvattr.applyPostVictory(defeatSource, defeatSource, pvmove); diff --git a/src/phases/field-phase.ts b/src/phases/field-phase.ts index 02d1f1395d3..b65e903a32b 100644 --- a/src/phases/field-phase.ts +++ b/src/phases/field-phase.ts @@ -1,5 +1,5 @@ +import Pokemon from "#app/field/pokemon.js"; import { BattlePhase } from "./battle-phase"; -import Pokemon from "#app/field/pokemon"; type PokemonFunc = (pokemon: Pokemon) => void; diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index 5a9a16b6f5e..201019e8860 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -12,11 +12,13 @@ import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-pha export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { private moveId: Moves; + private fromTM: boolean; - constructor(scene: BattleScene, partyMemberIndex: integer, moveId: Moves) { + constructor(scene: BattleScene, partyMemberIndex: integer, moveId: Moves, fromTM?: boolean) { super(scene, partyMemberIndex); this.moveId = moveId; + this.fromTM = fromTM ?? false; } start() { @@ -41,6 +43,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { if (emptyMoveIndex > -1) { pokemon.setMove(emptyMoveIndex, this.moveId); + if (this.fromTM) { + pokemon.usedTMs.push(this.moveId); + } initMoveAnim(this.scene, this.moveId).then(() => { loadMoveAnimAssets(this.scene, [this.moveId], true) .then(() => { @@ -85,6 +90,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { this.scene.ui.showText(i18next.t("battle:countdownPoof"), null, () => { this.scene.ui.showText(i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() }), null, () => { // TODO: is the bang correct? this.scene.ui.showText(i18next.t("battle:learnMoveAnd"), null, () => { + if (this.fromTM) { + pokemon.usedTMs.push(this.moveId); + } pokemon.setMove(moveIndex, Moves.NONE); this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId)); this.end(); diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index f100a763219..9b22c520e19 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -377,16 +377,16 @@ export class MoveEffectPhase extends PokemonPhase { return false; } - const moveAccuracy = this.move.getMove().calculateBattleAccuracy(user!, target); // TODO: is the bang correct here? + const moveAccuracy = this.move.getMove().calculateBattleAccuracy(user, target); if (moveAccuracy === -1) { return true; } const accuracyMultiplier = user.getAccuracyMultiplier(target, this.move.getMove()); - const rand = user.randSeedInt(100, 1); + const rand = user.randSeedInt(100); - return rand <= moveAccuracy * (accuracyMultiplier!); // TODO: is this bang correct? + return rand < (moveAccuracy * accuracyMultiplier); } /** Returns the {@linkcode Pokemon} using this phase's invoked move */ diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index cba5d18fa2e..6206a0f870c 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -48,8 +48,8 @@ export class MovePhase extends BattlePhase { this.cancelled = false; } - canMove(): boolean { - return this.pokemon.isActive(true) && this.move.isUsable(this.pokemon, this.ignorePp) && !!this.targets.length; + canMove(ignoreDisableTags?: boolean): boolean { + return this.pokemon.isActive(true) && this.move.isUsable(this.pokemon, this.ignorePp, ignoreDisableTags) && !!this.targets.length; } /**Signifies the current move should fail but still use PP */ @@ -67,18 +67,13 @@ export class MovePhase extends BattlePhase { console.log(Moves[this.move.moveId]); - /** - * Check if move is disabled or unusable (e.g. because it's out of PP due to a mid-turn Spite). - */ - if (!this.canMove()) { - if (this.move.moveId && this.pokemon.summonData?.disabledMove === this.move.moveId) { - this.scene.queueMessage(`${this.move.getName()} is disabled!`); - - } else { + // Check if move is unusable (e.g. because it's out of PP due to a mid-turn Spite). + if (!this.canMove(true)) { + if (this.pokemon.isActive(true) && this.move.ppUsed >= this.move.getMovePp()) { + this.fail(); this.showMoveText(); this.showFailedText(); } - return this.end(); } diff --git a/src/phases/stat-change-phase.ts b/src/phases/stat-change-phase.ts deleted file mode 100644 index 3116c49e8ef..00000000000 --- a/src/phases/stat-change-phase.ts +++ /dev/null @@ -1,248 +0,0 @@ -import { BattlerIndex } from "#app/battle"; -import BattleScene from "#app/battle-scene"; -import { applyAbAttrs, applyPostStatChangeAbAttrs, applyPreStatChangeAbAttrs, PostStatChangeAbAttr, ProtectStatAbAttr, StatChangeCopyAbAttr, StatChangeMultiplierAbAttr } from "#app/data/ability"; -import { ArenaTagSide, MistTag } from "#app/data/arena-tag"; -import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "#app/data/battle-stat"; -import Pokemon from "#app/field/pokemon"; -import { getPokemonNameWithAffix } from "#app/messages"; -import { PokemonResetNegativeStatStageModifier } from "#app/modifier/modifier"; -import { handleTutorial, Tutorial } from "#app/tutorial"; -import * as Utils from "#app/utils"; -import i18next from "i18next"; -import { PokemonPhase } from "./pokemon-phase"; - -export type StatChangeCallback = (target: Pokemon | null, changed: BattleStat[], relativeChanges: number[]) => void; - -export class StatChangePhase extends PokemonPhase { - private stats: BattleStat[]; - private selfTarget: boolean; - private levels: integer; - private showMessage: boolean; - private ignoreAbilities: boolean; - private canBeCopied: boolean; - private onChange: StatChangeCallback | null; - - - constructor(scene: BattleScene, battlerIndex: BattlerIndex, selfTarget: boolean, stats: BattleStat[], levels: integer, showMessage: boolean = true, ignoreAbilities: boolean = false, canBeCopied: boolean = true, onChange: StatChangeCallback | null = null) { - super(scene, battlerIndex); - - this.selfTarget = selfTarget; - this.stats = stats; - this.levels = levels; - this.showMessage = showMessage; - this.ignoreAbilities = ignoreAbilities; - this.canBeCopied = canBeCopied; - this.onChange = onChange; - } - - start() { - const pokemon = this.getPokemon(); - - let random = false; - - if (this.stats.length === 1 && this.stats[0] === BattleStat.RAND) { - this.stats[0] = this.getRandomStat(); - random = true; - } - - this.aggregateStatChanges(random); - - if (!pokemon.isActive(true)) { - return this.end(); - } - - const filteredStats = this.stats.map(s => s !== BattleStat.RAND ? s : this.getRandomStat()).filter(stat => { - const cancelled = new Utils.BooleanHolder(false); - - if (!this.selfTarget && this.levels < 0) { - this.scene.arena.applyTagsForSide(MistTag, pokemon.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, cancelled); - } - - if (!cancelled.value && !this.selfTarget && this.levels < 0) { - applyPreStatChangeAbAttrs(ProtectStatAbAttr, this.getPokemon(), stat, cancelled); - } - - return !cancelled.value; - }); - - const levels = new Utils.IntegerHolder(this.levels); - - if (!this.ignoreAbilities) { - applyAbAttrs(StatChangeMultiplierAbAttr, pokemon, null, false, levels); - } - - const battleStats = this.getPokemon().summonData.battleStats; - const relLevels = filteredStats.map(stat => (levels.value >= 1 ? Math.min(battleStats[stat] + levels.value, 6) : Math.max(battleStats[stat] + levels.value, -6)) - battleStats[stat]); - - this.onChange && this.onChange(this.getPokemon(), filteredStats, relLevels); - - const end = () => { - if (this.showMessage) { - const messages = this.getStatChangeMessages(filteredStats, levels.value, relLevels); - for (const message of messages) { - this.scene.queueMessage(message); - } - } - - for (const stat of filteredStats) { - if (levels.value > 0 && pokemon.summonData.battleStats[stat] < 6) { - if (!pokemon.turnData) { - // Temporary fix for missing turn data struct on turn 1 - pokemon.resetTurnData(); - } - pokemon.turnData.battleStatsIncreased = true; - } else if (levels.value < 0 && pokemon.summonData.battleStats[stat] > -6) { - if (!pokemon.turnData) { - // Temporary fix for missing turn data struct on turn 1 - pokemon.resetTurnData(); - } - pokemon.turnData.battleStatsDecreased = true; - } - - pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6); - } - - if (levels.value > 0 && this.canBeCopied) { - for (const opponent of pokemon.getOpponents()) { - applyAbAttrs(StatChangeCopyAbAttr, opponent, null, false, this.stats, levels.value); - } - } - - applyPostStatChangeAbAttrs(PostStatChangeAbAttr, pokemon, filteredStats, this.levels, this.selfTarget); - - // Look for any other stat change phases; if this is the last one, do White Herb check - const existingPhase = this.scene.findPhase(p => p instanceof StatChangePhase && p.battlerIndex === this.battlerIndex); - if (!(existingPhase instanceof StatChangePhase)) { - // Apply White Herb if needed - const whiteHerb = this.scene.applyModifier(PokemonResetNegativeStatStageModifier, this.player, pokemon) as PokemonResetNegativeStatStageModifier; - // If the White Herb was applied, consume it - if (whiteHerb) { - --whiteHerb.stackCount; - if (whiteHerb.stackCount <= 0) { - this.scene.removeModifier(whiteHerb); - } - this.scene.updateModifiers(this.player); - } - } - - pokemon.updateInfo(); - - handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end()); - }; - - if (relLevels.filter(l => l).length && this.scene.moveAnimations) { - pokemon.enableMask(); - const pokemonMaskSprite = pokemon.maskSprite; - - const tileX = (this.player ? 106 : 236) * pokemon.getSpriteScale() * this.scene.field.scale; - const tileY = ((this.player ? 148 : 84) + (levels.value >= 1 ? 160 : 0)) * pokemon.getSpriteScale() * this.scene.field.scale; - const tileWidth = 156 * this.scene.field.scale * pokemon.getSpriteScale(); - const tileHeight = 316 * this.scene.field.scale * pokemon.getSpriteScale(); - - // On increase, show the red sprite located at ATK - // On decrease, show the blue sprite located at SPD - const spriteColor = levels.value >= 1 ? BattleStat[BattleStat.ATK].toLowerCase() : BattleStat[BattleStat.SPD].toLowerCase(); - const statSprite = this.scene.add.tileSprite(tileX, tileY, tileWidth, tileHeight, "battle_stats", spriteColor); - statSprite.setPipeline(this.scene.fieldSpritePipeline); - statSprite.setAlpha(0); - statSprite.setScale(6); - statSprite.setOrigin(0.5, 1); - - this.scene.playSound(`se/stat_${levels.value >= 1 ? "up" : "down"}`); - - statSprite.setMask(new Phaser.Display.Masks.BitmapMask(this.scene, pokemonMaskSprite ?? undefined)); - - this.scene.tweens.add({ - targets: statSprite, - duration: 250, - alpha: 0.8375, - onComplete: () => { - this.scene.tweens.add({ - targets: statSprite, - delay: 1000, - duration: 250, - alpha: 0 - }); - } - }); - - this.scene.tweens.add({ - targets: statSprite, - duration: 1500, - y: `${levels.value >= 1 ? "-" : "+"}=${160 * 6}` - }); - - this.scene.time.delayedCall(1750, () => { - pokemon.disableMask(); - end(); - }); - } else { - end(); - } - } - - getRandomStat(): BattleStat { - const allStats = Utils.getEnumValues(BattleStat); - return this.getPokemon() ? allStats[this.getPokemon()!.randSeedInt(BattleStat.SPD + 1)] : BattleStat.ATK; // TODO: return default ATK on random? idk... - } - - aggregateStatChanges(random: boolean = false): void { - const isAccEva = [BattleStat.ACC, BattleStat.EVA].some(s => this.stats.includes(s)); - let existingPhase: StatChangePhase; - if (this.stats.length === 1) { - while ((existingPhase = (this.scene.findPhase(p => p instanceof StatChangePhase && p.battlerIndex === this.battlerIndex && p.stats.length === 1 - && (p.stats[0] === this.stats[0] || (random && p.stats[0] === BattleStat.RAND)) - && p.selfTarget === this.selfTarget && p.showMessage === this.showMessage && p.ignoreAbilities === this.ignoreAbilities) as StatChangePhase))) { - if (existingPhase.stats[0] === BattleStat.RAND) { - existingPhase.stats[0] = this.getRandomStat(); - if (existingPhase.stats[0] !== this.stats[0]) { - continue; - } - } - this.levels += existingPhase.levels; - - if (!this.scene.tryRemovePhase(p => p === existingPhase)) { - break; - } - } - } - while ((existingPhase = (this.scene.findPhase(p => p instanceof StatChangePhase && p.battlerIndex === this.battlerIndex && p.selfTarget === this.selfTarget - && ([BattleStat.ACC, BattleStat.EVA].some(s => p.stats.includes(s)) === isAccEva) - && p.levels === this.levels && p.showMessage === this.showMessage && p.ignoreAbilities === this.ignoreAbilities) as StatChangePhase))) { - this.stats.push(...existingPhase.stats); - if (!this.scene.tryRemovePhase(p => p === existingPhase)) { - break; - } - } - } - - getStatChangeMessages(stats: BattleStat[], levels: integer, relLevels: integer[]): string[] { - const messages: string[] = []; - - const relLevelStatIndexes = {}; - for (let rl = 0; rl < relLevels.length; rl++) { - const relLevel = relLevels[rl]; - if (!relLevelStatIndexes[relLevel]) { - relLevelStatIndexes[relLevel] = []; - } - relLevelStatIndexes[relLevel].push(rl); - } - - Object.keys(relLevelStatIndexes).forEach(rl => { - const relLevelStats = stats.filter((_, i) => relLevelStatIndexes[rl].includes(i)); - let statsFragment = ""; - - if (relLevelStats.length > 1) { - statsFragment = relLevelStats.length >= 5 - ? i18next.t("battle:stats") - : `${relLevelStats.slice(0, -1).map(s => getBattleStatName(s)).join(", ")}${relLevelStats.length > 2 ? "," : ""} ${i18next.t("battle:statsAnd")} ${getBattleStatName(relLevelStats[relLevelStats.length - 1])}`; - messages.push(getBattleStatLevelChangeDescription(getPokemonNameWithAffix(this.getPokemon()), statsFragment, Math.abs(parseInt(rl)), levels >= 1, relLevelStats.length)); - } else { - statsFragment = getBattleStatName(relLevelStats[0]); - messages.push(getBattleStatLevelChangeDescription(getPokemonNameWithAffix(this.getPokemon()), statsFragment, Math.abs(parseInt(rl)), levels >= 1, relLevelStats.length)); - } - }); - - return messages; - } -} diff --git a/src/phases/stat-stage-change-phase.ts b/src/phases/stat-stage-change-phase.ts new file mode 100644 index 00000000000..55faaa29903 --- /dev/null +++ b/src/phases/stat-stage-change-phase.ts @@ -0,0 +1,244 @@ +import { BattlerIndex } from "#app/battle"; +import BattleScene from "#app/battle-scene"; +import { applyAbAttrs, applyPostStatStageChangeAbAttrs, applyPreStatStageChangeAbAttrs, PostStatStageChangeAbAttr, ProtectStatAbAttr, StatStageChangeCopyAbAttr, StatStageChangeMultiplierAbAttr } from "#app/data/ability"; +import { ArenaTagSide, MistTag } from "#app/data/arena-tag"; +import Pokemon from "#app/field/pokemon"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { ResetNegativeStatStageModifier } from "#app/modifier/modifier"; +import { handleTutorial, Tutorial } from "#app/tutorial"; +import * as Utils from "#app/utils"; +import i18next from "i18next"; +import { PokemonPhase } from "./pokemon-phase"; +import { Stat, type BattleStat, getStatKey, getStatStageChangeDescriptionKey } from "#enums/stat"; + +export type StatStageChangeCallback = (target: Pokemon | null, changed: BattleStat[], relativeChanges: number[]) => void; + +export class StatStageChangePhase extends PokemonPhase { + private stats: BattleStat[]; + private selfTarget: boolean; + private stages: integer; + private showMessage: boolean; + private ignoreAbilities: boolean; + private canBeCopied: boolean; + private onChange: StatStageChangeCallback | null; + + + constructor(scene: BattleScene, battlerIndex: BattlerIndex, selfTarget: boolean, stats: BattleStat[], stages: integer, showMessage: boolean = true, ignoreAbilities: boolean = false, canBeCopied: boolean = true, onChange: StatStageChangeCallback | null = null) { + super(scene, battlerIndex); + + this.selfTarget = selfTarget; + this.stats = stats; + this.stages = stages; + this.showMessage = showMessage; + this.ignoreAbilities = ignoreAbilities; + this.canBeCopied = canBeCopied; + this.onChange = onChange; + } + + start() { + const pokemon = this.getPokemon(); + + if (!pokemon.isActive(true)) { + return this.end(); + } + + let simulate = false; + + const filteredStats = this.stats.filter(stat => { + const cancelled = new Utils.BooleanHolder(false); + + if (!this.selfTarget && this.stages < 0) { + // TODO: Include simulate boolean when tag applications can be simulated + this.scene.arena.applyTagsForSide(MistTag, pokemon.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, cancelled); + } + + if (!cancelled.value && !this.selfTarget && this.stages < 0) { + applyPreStatStageChangeAbAttrs(ProtectStatAbAttr, pokemon, stat, cancelled, simulate); + } + + // If one stat stage decrease is cancelled, simulate the rest of the applications + if (cancelled.value) { + simulate = true; + } + + return !cancelled.value; + }); + + const stages = new Utils.IntegerHolder(this.stages); + + if (!this.ignoreAbilities) { + applyAbAttrs(StatStageChangeMultiplierAbAttr, pokemon, null, false, stages); + } + + const relLevels = filteredStats.map(s => (stages.value >= 1 ? Math.min(pokemon.getStatStage(s) + stages.value, 6) : Math.max(pokemon.getStatStage(s) + stages.value, -6)) - pokemon.getStatStage(s)); + + this.onChange && this.onChange(this.getPokemon(), filteredStats, relLevels); + + const end = () => { + if (this.showMessage) { + const messages = this.getStatStageChangeMessages(filteredStats, stages.value, relLevels); + for (const message of messages) { + this.scene.queueMessage(message); + } + } + + for (const s of filteredStats) { + if (stages.value > 0 && pokemon.getStatStage(s) < 6) { + if (!pokemon.turnData) { + // Temporary fix for missing turn data struct on turn 1 + pokemon.resetTurnData(); + } + pokemon.turnData.statStagesIncreased = true; + } else if (stages.value < 0 && pokemon.getStatStage(s) > -6) { + if (!pokemon.turnData) { + // Temporary fix for missing turn data struct on turn 1 + pokemon.resetTurnData(); + } + pokemon.turnData.statStagesDecreased = true; + } + + pokemon.setStatStage(s, pokemon.getStatStage(s) + stages.value); + } + + if (stages.value > 0 && this.canBeCopied) { + for (const opponent of pokemon.getOpponents()) { + applyAbAttrs(StatStageChangeCopyAbAttr, opponent, null, false, this.stats, stages.value); + } + } + + applyPostStatStageChangeAbAttrs(PostStatStageChangeAbAttr, pokemon, filteredStats, this.stages, this.selfTarget); + + // Look for any other stat change phases; if this is the last one, do White Herb check + const existingPhase = this.scene.findPhase(p => p instanceof StatStageChangePhase && p.battlerIndex === this.battlerIndex); + if (!(existingPhase instanceof StatStageChangePhase)) { + // Apply White Herb if needed + const whiteHerb = this.scene.applyModifier(ResetNegativeStatStageModifier, this.player, pokemon) as ResetNegativeStatStageModifier; + // If the White Herb was applied, consume it + if (whiteHerb) { + whiteHerb.stackCount--; + if (whiteHerb.stackCount <= 0) { + this.scene.removeModifier(whiteHerb); + } + this.scene.updateModifiers(this.player); + } + } + + pokemon.updateInfo(); + + handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end()); + }; + + if (relLevels.filter(l => l).length && this.scene.moveAnimations) { + pokemon.enableMask(); + const pokemonMaskSprite = pokemon.maskSprite; + + const tileX = (this.player ? 106 : 236) * pokemon.getSpriteScale() * this.scene.field.scale; + const tileY = ((this.player ? 148 : 84) + (stages.value >= 1 ? 160 : 0)) * pokemon.getSpriteScale() * this.scene.field.scale; + const tileWidth = 156 * this.scene.field.scale * pokemon.getSpriteScale(); + const tileHeight = 316 * this.scene.field.scale * pokemon.getSpriteScale(); + + // On increase, show the red sprite located at ATK + // On decrease, show the blue sprite located at SPD + const spriteColor = stages.value >= 1 ? Stat[Stat.ATK].toLowerCase() : Stat[Stat.SPD].toLowerCase(); + const statSprite = this.scene.add.tileSprite(tileX, tileY, tileWidth, tileHeight, "battle_stats", spriteColor); + statSprite.setPipeline(this.scene.fieldSpritePipeline); + statSprite.setAlpha(0); + statSprite.setScale(6); + statSprite.setOrigin(0.5, 1); + + this.scene.playSound(`se/stat_${stages.value >= 1 ? "up" : "down"}`); + + statSprite.setMask(new Phaser.Display.Masks.BitmapMask(this.scene, pokemonMaskSprite ?? undefined)); + + this.scene.tweens.add({ + targets: statSprite, + duration: 250, + alpha: 0.8375, + onComplete: () => { + this.scene.tweens.add({ + targets: statSprite, + delay: 1000, + duration: 250, + alpha: 0 + }); + } + }); + + this.scene.tweens.add({ + targets: statSprite, + duration: 1500, + y: `${stages.value >= 1 ? "-" : "+"}=${160 * 6}` + }); + + this.scene.time.delayedCall(1750, () => { + pokemon.disableMask(); + end(); + }); + } else { + end(); + } + } + + aggregateStatStageChanges(): void { + const accEva: BattleStat[] = [ Stat.ACC, Stat.EVA ]; + const isAccEva = accEva.some(s => this.stats.includes(s)); + let existingPhase: StatStageChangePhase; + if (this.stats.length === 1) { + while ((existingPhase = (this.scene.findPhase(p => p instanceof StatStageChangePhase && p.battlerIndex === this.battlerIndex && p.stats.length === 1 + && (p.stats[0] === this.stats[0]) + && p.selfTarget === this.selfTarget && p.showMessage === this.showMessage && p.ignoreAbilities === this.ignoreAbilities) as StatStageChangePhase))) { + this.stages += existingPhase.stages; + + if (!this.scene.tryRemovePhase(p => p === existingPhase)) { + break; + } + } + } + while ((existingPhase = (this.scene.findPhase(p => p instanceof StatStageChangePhase && p.battlerIndex === this.battlerIndex && p.selfTarget === this.selfTarget + && (accEva.some(s => p.stats.includes(s)) === isAccEva) + && p.stages === this.stages && p.showMessage === this.showMessage && p.ignoreAbilities === this.ignoreAbilities) as StatStageChangePhase))) { + this.stats.push(...existingPhase.stats); + if (!this.scene.tryRemovePhase(p => p === existingPhase)) { + break; + } + } + } + + getStatStageChangeMessages(stats: BattleStat[], stages: integer, relStages: integer[]): string[] { + const messages: string[] = []; + + const relStageStatIndexes = {}; + for (let rl = 0; rl < relStages.length; rl++) { + const relStage = relStages[rl]; + if (!relStageStatIndexes[relStage]) { + relStageStatIndexes[relStage] = []; + } + relStageStatIndexes[relStage].push(rl); + } + + Object.keys(relStageStatIndexes).forEach(rl => { + const relStageStats = stats.filter((_, i) => relStageStatIndexes[rl].includes(i)); + let statsFragment = ""; + + if (relStageStats.length > 1) { + statsFragment = relStageStats.length >= 5 + ? i18next.t("battle:stats") + : `${relStageStats.slice(0, -1).map(s => i18next.t(getStatKey(s))).join(", ")}${relStageStats.length > 2 ? "," : ""} ${i18next.t("battle:statsAnd")} ${i18next.t(getStatKey(relStageStats[relStageStats.length - 1]))}`; + messages.push(i18next.t(getStatStageChangeDescriptionKey(Math.abs(parseInt(rl)), stages >= 1), { + pokemonNameWithAffix: getPokemonNameWithAffix(this.getPokemon()), + stats: statsFragment, + count: relStageStats.length + })); + } else { + statsFragment = i18next.t(getStatKey(relStageStats[0])); + messages.push(i18next.t(getStatStageChangeDescriptionKey(Math.abs(parseInt(rl)), stages >= 1), { + pokemonNameWithAffix: getPokemonNameWithAffix(this.getPokemon()), + stats: statsFragment, + count: relStageStats.length + })); + } + }); + + return messages; + } +} diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index 9f4de46b0fa..c8bd3398bb5 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -1,9 +1,7 @@ import BattleScene from "#app/battle-scene.js"; import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/ability.js"; import { BattlerTagLapseType } from "#app/data/battler-tags.js"; -import { allMoves } from "#app/data/move.js"; import { TerrainType } from "#app/data/terrain.js"; -import { Moves } from "#app/enums/moves.js"; import { WeatherType } from "#app/enums/weather-type.js"; import { TurnEndEvent } from "#app/events/battle-scene.js"; import Pokemon from "#app/field/pokemon.js"; @@ -11,7 +9,6 @@ import { getPokemonNameWithAffix } from "#app/messages.js"; import { TurnHealModifier, EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier, TurnStatusEffectModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier.js"; import i18next from "i18next"; import { FieldPhase } from "./field-phase"; -import { MessagePhase } from "./message-phase"; import { PokemonHealPhase } from "./pokemon-heal-phase"; export class TurnEndPhase extends FieldPhase { @@ -28,11 +25,6 @@ export class TurnEndPhase extends FieldPhase { const handlePokemon = (pokemon: Pokemon) => { pokemon.lapseTags(BattlerTagLapseType.TURN_END); - if (pokemon.summonData.disabledMove && !--pokemon.summonData.disabledTurns) { - this.scene.pushPhase(new MessagePhase(this.scene, i18next.t("battle:notDisabled", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: allMoves[pokemon.summonData.disabledMove].name }))); - pokemon.summonData.disabledMove = Moves.NONE; - } - this.scene.applyModifiers(TurnHealModifier, pokemon.isPlayer(), pokemon); if (this.scene.arena.terrain?.terrainType === TerrainType.GRASSY && pokemon.isGrounded()) { diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index b2545e9ee30..5c1af4228c6 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -43,8 +43,8 @@ export class TurnStartPhase extends FieldPhase { }, this.scene.currentBattle.turn, this.scene.waveSeed); orderedTargets.sort((a: Pokemon, b: Pokemon) => { - const aSpeed = a?.getBattleStat(Stat.SPD) || 0; - const bSpeed = b?.getBattleStat(Stat.SPD) || 0; + const aSpeed = a?.getEffectiveStat(Stat.SPD) || 0; + const bSpeed = b?.getEffectiveStat(Stat.SPD) || 0; return bSpeed - aSpeed; }); diff --git a/src/system/achv.ts b/src/system/achv.ts index de2862c2813..89e5493eb2e 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -5,9 +5,10 @@ import { pokemonEvolutions } from "#app/data/pokemon-evolutions"; import i18next from "i18next"; import * as Utils from "../utils"; import { PlayerGender } from "#enums/player-gender"; -import { Challenge, FreshStartChallenge, InverseBattleChallenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge"; -import { Challenges } from "#app/enums/challenges"; +import { Challenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge, InverseBattleChallenge } from "#app/data/challenge"; import { ConditionFn } from "#app/@types/common"; +import { Stat, getShortenedStatKey } from "#app/enums/stat"; +import { Challenges } from "#app/enums/challenges"; export enum AchvTier { COMMON, @@ -172,13 +173,13 @@ export function getAchievementDescription(localizationKey: string): string { case "10000_DMG": return i18next.t("achv:DamageAchv.description", {context: genderStr, "damageAmount": achvs._10000_DMG.damageAmount.toLocaleString("en-US")}); case "250_HEAL": - return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._250_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._250_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t(getShortenedStatKey(Stat.HP))}); case "1000_HEAL": - return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._1000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._1000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t(getShortenedStatKey(Stat.HP))}); case "2500_HEAL": - return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._2500_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._2500_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t(getShortenedStatKey(Stat.HP))}); case "10000_HEAL": - return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._10000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t("pokemonInfo:Stat.HPshortened")}); + return i18next.t("achv:HealAchv.description", {context: genderStr, "healAmount": achvs._10000_HEAL.healAmount.toLocaleString("en-US"), "HP": i18next.t(getShortenedStatKey(Stat.HP))}); case "LV_100": return i18next.t("achv:LevelAchv.description", {context: genderStr, "level": achvs.LV_100.level}); case "LV_250": @@ -195,7 +196,7 @@ export function getAchievementDescription(localizationKey: string): string { return i18next.t("achv:RibbonAchv.description", {context: genderStr, "ribbonAmount": achvs._75_RIBBONS.ribbonAmount.toLocaleString("en-US")}); case "100_RIBBONS": return i18next.t("achv:RibbonAchv.description", {context: genderStr, "ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")}); - case "TRANSFER_MAX_BATTLE_STAT": + case "TRANSFER_MAX_STAT_STAGE": return i18next.t("achv:TRANSFER_MAX_BATTLE_STAT.description", { context: genderStr }); case "MAX_FRIENDSHIP": return i18next.t("achv:MAX_FRIENDSHIP.description", { context: genderStr }); @@ -305,7 +306,7 @@ export const achvs = { _50_RIBBONS: new RibbonAchv("50_RIBBONS", "", 50, "ultra_ribbon", 50).setSecret(true), _75_RIBBONS: new RibbonAchv("75_RIBBONS", "", 75, "rogue_ribbon", 75).setSecret(true), _100_RIBBONS: new RibbonAchv("100_RIBBONS", "", 100, "master_ribbon", 100).setSecret(true), - TRANSFER_MAX_BATTLE_STAT: new Achv("TRANSFER_MAX_BATTLE_STAT", "", "TRANSFER_MAX_BATTLE_STAT.description", "baton", 20), + TRANSFER_MAX_STAT_STAGE: new Achv("TRANSFER_MAX_STAT_STAGE", "", "TRANSFER_MAX_STAT_STAGE.description", "baton", 20), MAX_FRIENDSHIP: new Achv("MAX_FRIENDSHIP", "", "MAX_FRIENDSHIP.description", "soothe_bell", 25), MEGA_EVOLVE: new Achv("MEGA_EVOLVE", "", "MEGA_EVOLVE.description", "mega_bracelet", 50), GIGANTAMAX: new Achv("GIGANTAMAX", "", "GIGANTAMAX.description", "dynamax_band", 50), diff --git a/src/system/game-data.ts b/src/system/game-data.ts index a4c276fa770..1a47294906e 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -946,7 +946,7 @@ export class GameData { return ret; } - private getSessionSaveData(scene: BattleScene): SessionSaveData { + public getSessionSaveData(scene: BattleScene): SessionSaveData { return { seed: scene.seed, playTime: scene.sessionPlayTime, @@ -1488,7 +1488,7 @@ export class GameData { }; } - const defaultStarterAttr = DexAttr.NON_SHINY | DexAttr.MALE | DexAttr.DEFAULT_VARIANT | DexAttr.DEFAULT_FORM; + const defaultStarterAttr = DexAttr.NON_SHINY | DexAttr.MALE | DexAttr.FEMALE | DexAttr.DEFAULT_VARIANT | DexAttr.DEFAULT_FORM; const defaultStarterNatures: Nature[] = []; @@ -1553,11 +1553,11 @@ export class GameData { } } - setPokemonCaught(pokemon: Pokemon, incrementCount: boolean = true, fromEgg: boolean = false): Promise { - return this.setPokemonSpeciesCaught(pokemon, pokemon.species, incrementCount, fromEgg); + setPokemonCaught(pokemon: Pokemon, incrementCount: boolean = true, fromEgg: boolean = false, showMessage: boolean = true): Promise { + return this.setPokemonSpeciesCaught(pokemon, pokemon.species, incrementCount, fromEgg, showMessage); } - setPokemonSpeciesCaught(pokemon: Pokemon, species: PokemonSpecies, incrementCount: boolean = true, fromEgg: boolean = false): Promise { + setPokemonSpeciesCaught(pokemon: Pokemon, species: PokemonSpecies, incrementCount: boolean = true, fromEgg: boolean = false, showMessage: boolean = true): Promise { return new Promise(resolve => { const dexEntry = this.dexData[species.speciesId]; const caughtAttr = dexEntry.caughtAttr; @@ -1616,13 +1616,17 @@ export class GameData { const checkPrevolution = () => { if (hasPrevolution) { const prevolutionSpecies = pokemonPrevolutions[species.speciesId]; - return this.setPokemonSpeciesCaught(pokemon, getPokemonSpecies(prevolutionSpecies), incrementCount, fromEgg).then(() => resolve()); + this.setPokemonSpeciesCaught(pokemon, getPokemonSpecies(prevolutionSpecies), incrementCount, fromEgg, showMessage).then(() => resolve()); } else { resolve(); } }; if (newCatch && speciesStarters.hasOwnProperty(species.speciesId)) { + if (!showMessage) { + resolve(); + return; + } this.scene.playSound("level_up_fanfare"); this.scene.ui.showText(i18next.t("battle:addedAsAStarter", { pokemonName: species.name }), null, () => checkPrevolution(), null, true); } else { @@ -1668,7 +1672,7 @@ export class GameData { this.starterData[species.speciesId].candyCount += count; } - setEggMoveUnlocked(species: PokemonSpecies, eggMoveIndex: integer): Promise { + setEggMoveUnlocked(species: PokemonSpecies, eggMoveIndex: integer, showMessage: boolean = true): Promise { return new Promise(resolve => { const speciesId = species.speciesId; if (!speciesEggMoves.hasOwnProperty(speciesId) || !speciesEggMoves[speciesId][eggMoveIndex]) { @@ -1688,11 +1692,15 @@ export class GameData { } this.starterData[speciesId].eggMoves |= value; - + if (!showMessage) { + resolve(true); + return; + } this.scene.playSound("level_up_fanfare"); - const moveName = allMoves[speciesEggMoves[speciesId][eggMoveIndex]].name; - this.scene.ui.showText(eggMoveIndex === 3 ? i18next.t("egg:rareEggMoveUnlock", { moveName: moveName }) : i18next.t("egg:eggMoveUnlock", { moveName: moveName }), null, () => resolve(true), null, true); + this.scene.ui.showText(eggMoveIndex === 3 ? i18next.t("egg:rareEggMoveUnlock", { moveName: moveName }) : i18next.t("egg:eggMoveUnlock", { moveName: moveName }), null, (() => { + resolve(true); + }), null, true); }); } @@ -1919,6 +1927,7 @@ export class GameData { fixStarterData(systemData: SystemSaveData): void { for (const starterId of defaultStarterSpecies) { systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1; + systemData.dexData[starterId].caughtAttr |= DexAttr.FEMALE; } } diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index 8f094379434..1fafcbf8acc 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -42,6 +42,7 @@ export default class PokemonData { public luck: integer; public pauseEvolutions: boolean; public pokerus: boolean; + public usedTMs: Moves[]; public fusionSpecies: Species; public fusionFormIndex: integer; @@ -98,6 +99,7 @@ export default class PokemonData { this.fusionVariant = source.fusionVariant; this.fusionGender = source.fusionGender; this.fusionLuck = source.fusionLuck !== undefined ? source.fusionLuck : (source.fusionShiny ? source.fusionVariant + 1 : 0); + this.usedTMs = source.usedTMs ?? []; if (!forHistory) { this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss); @@ -122,10 +124,9 @@ export default class PokemonData { this.summonData = new PokemonSummonData(); if (!forHistory && source.summonData) { - this.summonData.battleStats = source.summonData.battleStats; + this.summonData.stats = source.summonData.stats; + this.summonData.statStages = source.summonData.statStages; this.summonData.moveQueue = source.summonData.moveQueue; - this.summonData.disabledMove = source.summonData.disabledMove; - this.summonData.disabledTurns = source.summonData.disabledTurns; this.summonData.abilitySuppressed = source.summonData.abilitySuppressed; this.summonData.abilitiesApplied = source.summonData.abilitiesApplied; diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index 7b0fea95a98..6b46b6fe96c 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -25,6 +25,7 @@ const VOLUME_OPTIONS: SettingOption[] = new Array(11).fill(null).map((_, i) => i value: "Mute", label: getTranslation("settings:mute") }); + const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).map((_, i) => { const value = ((i + 1) * 10).toString(); return { @@ -32,6 +33,7 @@ const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).ma label: value, }; }); + const OFF_ON: SettingOption[] = [ { value: "Off", @@ -53,6 +55,40 @@ const AUTO_DISABLED: SettingOption[] = [ } ]; +const SHOP_CURSOR_TARGET_OPTIONS: SettingOption[] = [ + { + value: "Rewards", + label: i18next.t("settings:rewards") + }, + { + value: "Shop", + label: i18next.t("settings:shop") + }, + { + value: "Reroll", + label: i18next.t("settings:reroll") + }, + { + value: "Check Team", + label: i18next.t("settings:checkTeam") + } +]; + +const shopCursorTargetIndexMap = SHOP_CURSOR_TARGET_OPTIONS.map(option => { + switch (option.value) { + case "Rewards": + return ShopCursorTarget.REWARDS; + case "Shop": + return ShopCursorTarget.SHOP; + case "Reroll": + return ShopCursorTarget.REROLL; + case "Check Team": + return ShopCursorTarget.CHECK_TEAM; + default: + throw new Error(`Unknown value: ${option.value}`); + } +}); + /** * Types for helping separate settings to different menus */ @@ -103,7 +139,7 @@ export const SettingKeys = { Damage_Numbers: "DAMAGE_NUMBERS", Move_Animations: "MOVE_ANIMATIONS", Show_Stats_on_Level_Up: "SHOW_LEVEL_UP_STATS", - Reroll_Target: "REROLL_TARGET", + Shop_Cursor_Target: "SHOP_CURSOR_TARGET", Candy_Upgrade_Notification: "CANDY_UPGRADE_NOTIFICATION", Candy_Upgrade_Display: "CANDY_UPGRADE_DISPLAY", Move_Info: "MOVE_INFO", @@ -596,27 +632,10 @@ export const Setting: Array = [ isHidden: () => !hasTouchscreen() }, { - key: SettingKeys.Reroll_Target, + key: SettingKeys.Shop_Cursor_Target, label: i18next.t("settings:shopCursorTarget"), - options: [ - { - value:"Reroll", - label: i18next.t("settings:reroll") - }, - { - value:"Items", - label: i18next.t("settings:items") - }, - { - value:"Shop", - label: i18next.t("settings:shop") - }, - { - value:"Check Team", - label: i18next.t("settings:checkTeam") - } - ], - default: ShopCursorTarget.CHECK_TEAM, + options: SHOP_CURSOR_TARGET_OPTIONS, + default: 0, type: SettingType.DISPLAY }, { @@ -758,8 +777,10 @@ export function setSetting(scene: BattleScene, setting: string, value: integer): case SettingKeys.Show_Stats_on_Level_Up: scene.showLevelUpStats = Setting[index].options[value].value === "On"; break; - case SettingKeys.Reroll_Target: - scene.shopCursorTarget = value; + case SettingKeys.Shop_Cursor_Target: + const selectedValue = shopCursorTargetIndexMap[value]; + scene.shopCursorTarget = selectedValue; + break; case SettingKeys.EXP_Gains_Speed: scene.expGainsSpeed = value; break; diff --git a/src/test/abilities/beast_boost.test.ts b/src/test/abilities/beast_boost.test.ts new file mode 100644 index 00000000000..05645a1231d --- /dev/null +++ b/src/test/abilities/beast_boost.test.ts @@ -0,0 +1,89 @@ +import { BattlerIndex } from "#app/battle"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Abilities - Beast Boost", () => { + 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 + .battleType("single") + .enemySpecies(Species.BULBASAUR) + .enemyAbility(Abilities.BEAST_BOOST) + .ability(Abilities.BEAST_BOOST) + .startingLevel(2000) + .moveset([ Moves.FLAMETHROWER ]) + .enemyMoveset(SPLASH_ONLY); + }); + + it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => { + await game.classicMode.startBattle([Species.SLOWBRO]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + // Set the pokemon's highest stat to DEF, so it should be picked by Beast Boost + vi.spyOn(playerPokemon, "stats", "get").mockReturnValue([ 10000, 100, 1000, 200, 100, 100 ]); + console.log(playerPokemon.stats); + + expect(playerPokemon.getStatStage(Stat.DEF)).toBe(0); + + game.move.select(Moves.FLAMETHROWER); + await game.phaseInterceptor.to("VictoryPhase"); + + expect(playerPokemon.getStatStage(Stat.DEF)).toBe(1); + }, 20000); + + it("should use in-battle overriden stats when determining the stat stage to raise by 1", async() => { + game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT)); + + await game.classicMode.startBattle([Species.SLOWBRO]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + // If the opponent uses Guard Split, the pokemon's second highest stat (SPATK) should be chosen + vi.spyOn(playerPokemon, "stats", "get").mockReturnValue([ 10000, 100, 201, 200, 100, 100 ]); + + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(0); + + game.move.select(Moves.FLAMETHROWER); + + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("VictoryPhase"); + + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(1); + }, 20000); + + it("should have order preference in case of stat ties", async() => { + // Order preference follows the order of EFFECTIVE_STAT + await game.classicMode.startBattle([Species.SLOWBRO]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + + // Set up tie between SPATK, SPDEF, and SPD, where SPATK should win + vi.spyOn(playerPokemon, "stats", "get").mockReturnValue([ 10000, 1, 1, 100, 100, 100 ]); + + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(0); + + game.move.select(Moves.FLAMETHROWER); + + await game.phaseInterceptor.to("VictoryPhase"); + + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(1); + }, 20000); +}); diff --git a/src/test/abilities/contrary.test.ts b/src/test/abilities/contrary.test.ts new file mode 100644 index 00000000000..19ecc7e0240 --- /dev/null +++ b/src/test/abilities/contrary.test.ts @@ -0,0 +1,42 @@ +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +describe("Abilities - Contrary", () => { + 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 + .battleType("single") + .enemySpecies(Species.BULBASAUR) + .enemyAbility(Abilities.CONTRARY) + .ability(Abilities.INTIMIDATE) + .enemyMoveset(SPLASH_ONLY); + }); + + it("should invert stat changes when applied", async() => { + await game.startBattle([ + Species.SLOWBRO + ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); + }, 20000); +}); diff --git a/src/test/abilities/costar.test.ts b/src/test/abilities/costar.test.ts index 9a4baeef1fb..96ec775f2a0 100644 --- a/src/test/abilities/costar.test.ts +++ b/src/test/abilities/costar.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; @@ -35,7 +35,7 @@ describe("Abilities - COSTAR", () => { test( - "ability copies positive stat changes", + "ability copies positive stat stages", async () => { game.override.enemyAbility(Abilities.BALL_FETCH); @@ -48,8 +48,8 @@ describe("Abilities - COSTAR", () => { game.move.select(Moves.SPLASH, 1); await game.toNextTurn(); - expect(leftPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(+2); - expect(rightPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(0); + expect(leftPokemon.getStatStage(Stat.SPATK)).toBe(2); + expect(rightPokemon.getStatStage(Stat.SPATK)).toBe(0); game.move.select(Moves.SPLASH); await game.phaseInterceptor.to(CommandPhase); @@ -57,14 +57,14 @@ describe("Abilities - COSTAR", () => { await game.phaseInterceptor.to(MessagePhase); [leftPokemon, rightPokemon] = game.scene.getPlayerField(); - expect(leftPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(+2); - expect(rightPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(+2); + expect(leftPokemon.getStatStage(Stat.SPATK)).toBe(2); + expect(rightPokemon.getStatStage(Stat.SPATK)).toBe(2); }, TIMEOUT, ); test( - "ability copies negative stat changes", + "ability copies negative stat stages", async () => { game.override.enemyAbility(Abilities.INTIMIDATE); @@ -72,8 +72,8 @@ describe("Abilities - COSTAR", () => { let [leftPokemon, rightPokemon] = game.scene.getPlayerField(); - expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2); - expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2); + expect(leftPokemon.getStatStage(Stat.ATK)).toBe(-2); + expect(leftPokemon.getStatStage(Stat.ATK)).toBe(-2); game.move.select(Moves.SPLASH); await game.phaseInterceptor.to(CommandPhase); @@ -81,8 +81,8 @@ describe("Abilities - COSTAR", () => { await game.phaseInterceptor.to(MessagePhase); [leftPokemon, rightPokemon] = game.scene.getPlayerField(); - expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2); - expect(rightPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2); + expect(leftPokemon.getStatStage(Stat.ATK)).toBe(-2); + expect(rightPokemon.getStatStage(Stat.ATK)).toBe(-2); }, TIMEOUT, ); diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index bbb0a20dc1a..ef145262954 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -1,8 +1,9 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { StatusEffect } from "#app/data/status-effect"; import { toDmgValue } from "#app/utils"; +import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { StatusEffect } from "#app/data/status-effect"; +import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { SPLASH_ONLY } from "../utils/testUtils"; @@ -36,7 +37,7 @@ describe("Abilities - Disguise", () => { }, TIMEOUT); it("takes no damage from attacking move and transforms to Busted form, takes 1/8 max HP damage from the disguise breaking", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const mimikyu = game.scene.getEnemyPokemon()!; const maxHp = mimikyu.getMaxHp(); @@ -53,7 +54,7 @@ describe("Abilities - Disguise", () => { }, TIMEOUT); it("doesn't break disguise when attacked with ineffective move", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const mimikyu = game.scene.getEnemyPokemon()!; @@ -67,9 +68,9 @@ describe("Abilities - Disguise", () => { }, TIMEOUT); it("takes no damage from the first hit of a multihit move and transforms to Busted form, then takes damage from the second hit", async () => { - game.override.moveset([Moves.SURGING_STRIKES]); + game.override.moveset([ Moves.SURGING_STRIKES ]); game.override.enemyLevel(5); - await game.startBattle(); + await game.classicMode.startBattle(); const mimikyu = game.scene.getEnemyPokemon()!; const maxHp = mimikyu.getMaxHp(); @@ -91,7 +92,7 @@ describe("Abilities - Disguise", () => { }, TIMEOUT); it("takes effects from status moves and damage from status effects", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const mimikyu = game.scene.getEnemyPokemon()!; expect(mimikyu.hp).toBe(mimikyu.getMaxHp()); @@ -102,7 +103,7 @@ describe("Abilities - Disguise", () => { expect(mimikyu.formIndex).toBe(disguisedForm); expect(mimikyu.status?.effect).toBe(StatusEffect.POISON); - expect(mimikyu.summonData.battleStats[BattleStat.SPD]).toBe(-1); + expect(mimikyu.getStatStage(Stat.SPD)).toBe(-1); expect(mimikyu.hp).toBeLessThan(mimikyu.getMaxHp()); }, TIMEOUT); @@ -110,7 +111,7 @@ describe("Abilities - Disguise", () => { game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); game.override.starterSpecies(0); - await game.startBattle([Species.MIMIKYU, Species.FURRET]); + await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]); const mimikyu = game.scene.getPlayerPokemon()!; const maxHp = mimikyu.getMaxHp(); @@ -136,7 +137,7 @@ describe("Abilities - Disguise", () => { game.override.starterForms({ [Species.MIMIKYU]: bustedForm }); - await game.startBattle([Species.FURRET, Species.MIMIKYU]); + await game.classicMode.startBattle([ Species.FURRET, Species.MIMIKYU ]); const mimikyu = game.scene.getParty()[1]!; expect(mimikyu.formIndex).toBe(bustedForm); @@ -155,7 +156,7 @@ describe("Abilities - Disguise", () => { [Species.MIMIKYU]: bustedForm }); - await game.startBattle(); + await game.classicMode.startBattle(); const mimikyu = game.scene.getPlayerPokemon()!; @@ -175,7 +176,7 @@ describe("Abilities - Disguise", () => { [Species.MIMIKYU]: bustedForm }); - await game.startBattle([Species.MIMIKYU, Species.FURRET]); + await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]); const mimikyu1 = game.scene.getPlayerPokemon()!; @@ -194,7 +195,7 @@ describe("Abilities - Disguise", () => { it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => { game.override.enemyMoveset(Array(4).fill(Moves.ENDURE)); - await game.startBattle(); + await game.classicMode.startBattle(); const mimikyu = game.scene.getEnemyPokemon()!; mimikyu.hp = 1; @@ -205,4 +206,22 @@ describe("Abilities - Disguise", () => { expect(game.scene.getCurrentPhase()?.constructor.name).toBe("CommandPhase"); expect(game.scene.currentBattle.waveIndex).toBe(2); }, TIMEOUT); + + it("activates when Aerilate circumvents immunity to the move's base type", async () => { + game.override.ability(Abilities.AERILATE); + game.override.moveset([Moves.TACKLE]); + + await game.classicMode.startBattle(); + + const mimikyu = game.scene.getEnemyPokemon()!; + const maxHp = mimikyu.getMaxHp(); + const disguiseDamage = toDmgValue(maxHp / 8); + + game.move.select(Moves.TACKLE); + + await game.phaseInterceptor.to("MoveEndPhase"); + + expect(mimikyu.formIndex).toBe(bustedForm); + expect(mimikyu.hp).toBe(maxHp - disguiseDamage); + }, TIMEOUT); }); diff --git a/src/test/abilities/flower_gift.test.ts b/src/test/abilities/flower_gift.test.ts index f8c1141386d..de07bd29478 100644 --- a/src/test/abilities/flower_gift.test.ts +++ b/src/test/abilities/flower_gift.test.ts @@ -49,16 +49,16 @@ describe("Abilities - Flower Gift", () => { }); // TODO: Uncomment expect statements when the ability is implemented - currently does not increase stats of allies - it("increases the Attack and Special Defense stats of the Pokémon with this Ability and its allies by 1.5× during Harsh Sunlight", async () => { + it("increases the ATK and SPDEF stat stages of the Pokémon with this Ability and its allies by 1.5× during Harsh Sunlight", async () => { game.override.battleType("double"); await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]); const [ cherrim ] = game.scene.getPlayerField(); - const cherrimAtkStat = cherrim.getBattleStat(Stat.ATK); - const cherrimSpDefStat = cherrim.getBattleStat(Stat.SPDEF); + const cherrimAtkStat = cherrim.getEffectiveStat(Stat.ATK); + const cherrimSpDefStat = cherrim.getEffectiveStat(Stat.SPDEF); - // const magikarpAtkStat = magikarp.getBattleStat(Stat.ATK);; - // const magikarpSpDefStat = magikarp.getBattleStat(Stat.SPDEF); + // const magikarpAtkStat = magikarp.getEffectiveStat(Stat.ATK);; + // const magikarpSpDefStat = magikarp.getEffectiveStat(Stat.SPDEF); game.move.select(Moves.SUNNY_DAY, 0); game.move.select(Moves.SPLASH, 1); @@ -67,10 +67,10 @@ describe("Abilities - Flower Gift", () => { await game.phaseInterceptor.to("TurnEndPhase"); expect(cherrim.formIndex).toBe(SUNSHINE_FORM); - expect(cherrim.getBattleStat(Stat.ATK)).toBe(Math.floor(cherrimAtkStat * 1.5)); - expect(cherrim.getBattleStat(Stat.SPDEF)).toBe(Math.floor(cherrimSpDefStat * 1.5)); - // expect(magikarp.getBattleStat(Stat.ATK)).toBe(Math.floor(magikarpAtkStat * 1.5)); - // expect(magikarp.getBattleStat(Stat.SPDEF)).toBe(Math.floor(magikarpSpDefStat * 1.5)); + expect(cherrim.getEffectiveStat(Stat.ATK)).toBe(Math.floor(cherrimAtkStat * 1.5)); + expect(cherrim.getEffectiveStat(Stat.SPDEF)).toBe(Math.floor(cherrimSpDefStat * 1.5)); + // expect(magikarp.getEffectiveStat(Stat.ATK)).toBe(Math.floor(magikarpAtkStat * 1.5)); + // expect(magikarp.getEffectiveStat(Stat.SPDEF)).toBe(Math.floor(magikarpSpDefStat * 1.5)); }); it("changes the Pokemon's form during Harsh Sunlight", async () => { diff --git a/src/test/abilities/gulp_missile.test.ts b/src/test/abilities/gulp_missile.test.ts index a451d290906..286c3af1c56 100644 --- a/src/test/abilities/gulp_missile.test.ts +++ b/src/test/abilities/gulp_missile.test.ts @@ -1,4 +1,3 @@ -import { BattleStat } from "#app/data/battle-stat"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { StatusEffect } from "#app/enums/status-effect"; import Pokemon from "#app/field/pokemon"; @@ -13,6 +12,7 @@ import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { SPLASH_ONLY } from "../utils/testUtils"; +import { Stat } from "#enums/stat"; describe("Abilities - Gulp Missile", () => { let phaserGame: Phaser.Game; @@ -107,7 +107,7 @@ describe("Abilities - Gulp Missile", () => { expect(cramorant.formIndex).toBe(GULPING_FORM); }); - it("deals ¼ of the attacker's maximum HP when hit by a damaging attack", async () => { + it("deals 1/4 of the attacker's maximum HP when hit by a damaging attack", async () => { game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); await game.startBattle([Species.CRAMORANT]); @@ -139,7 +139,7 @@ describe("Abilities - Gulp Missile", () => { expect(cramorant.formIndex).toBe(GULPING_FORM); }); - it("lowers the attacker's Defense by 1 stage when hit in Gulping form", async () => { + it("lowers attacker's DEF stat stage by 1 when hit in Gulping form", async () => { game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); await game.startBattle([Species.CRAMORANT]); @@ -158,7 +158,7 @@ describe("Abilities - Gulp Missile", () => { await game.phaseInterceptor.to(TurnEndPhase); expect(enemy.damageAndUpdate).toHaveReturnedWith(getEffectDamage(enemy)); - expect(enemy.summonData.battleStats[BattleStat.DEF]).toBe(-1); + expect(enemy.getStatStage(Stat.DEF)).toBe(-1); expect(cramorant.getTag(BattlerTagType.GULP_MISSILE_ARROKUDA)).toBeUndefined(); expect(cramorant.formIndex).toBe(NORMAL_FORM); }); @@ -219,7 +219,7 @@ describe("Abilities - Gulp Missile", () => { await game.phaseInterceptor.to(TurnEndPhase); expect(enemy.hp).toBe(enemyHpPreEffect); - expect(enemy.summonData.battleStats[BattleStat.DEF]).toBe(-1); + expect(enemy.getStatStage(Stat.DEF)).toBe(-1); expect(cramorant.getTag(BattlerTagType.GULP_MISSILE_ARROKUDA)).toBeUndefined(); expect(cramorant.formIndex).toBe(NORMAL_FORM); }); diff --git a/src/test/abilities/hustle.test.ts b/src/test/abilities/hustle.test.ts index 276edb691c9..ff96b98c7ac 100644 --- a/src/test/abilities/hustle.test.ts +++ b/src/test/abilities/hustle.test.ts @@ -26,7 +26,7 @@ describe("Abilities - Hustle", () => { game = new GameManager(phaserGame); game.override .ability(Abilities.HUSTLE) - .moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]) + .moveset([ Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE ]) .disableCrits() .battleType("single") .enemyMoveset(SPLASH_ONLY) @@ -39,13 +39,13 @@ describe("Abilities - Hustle", () => { const pikachu = game.scene.getPlayerPokemon()!; const atk = pikachu.stats[Stat.ATK]; - vi.spyOn(pikachu, "getBattleStat"); + vi.spyOn(pikachu, "getEffectiveStat"); game.move.select(Moves.TACKLE); await game.move.forceHit(); await game.phaseInterceptor.to("DamagePhase"); - expect(pikachu.getBattleStat).toHaveReturnedWith(Math.floor(atk * 1.5)); + expect(pikachu.getEffectiveStat).toHaveReturnedWith(Math.floor(atk * 1.5)); }); it("lowers the accuracy of the user's physical moves by 20%", async () => { @@ -65,13 +65,13 @@ describe("Abilities - Hustle", () => { const pikachu = game.scene.getPlayerPokemon()!; const spatk = pikachu.stats[Stat.SPATK]; - vi.spyOn(pikachu, "getBattleStat"); + vi.spyOn(pikachu, "getEffectiveStat"); vi.spyOn(pikachu, "getAccuracyMultiplier"); game.move.select(Moves.GIGA_DRAIN); await game.phaseInterceptor.to("DamagePhase"); - expect(pikachu.getBattleStat).toHaveReturnedWith(spatk); + expect(pikachu.getEffectiveStat).toHaveReturnedWith(spatk); expect(pikachu.getAccuracyMultiplier).toHaveReturnedWith(1); }); diff --git a/src/test/abilities/hyper_cutter.test.ts b/src/test/abilities/hyper_cutter.test.ts index 28fcc2f6085..64e04ac2fd3 100644 --- a/src/test/abilities/hyper_cutter.test.ts +++ b/src/test/abilities/hyper_cutter.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -51,7 +51,7 @@ describe("Abilities - Hyper Cutter", () => { game.move.select(Moves.STRING_SHOT); await game.toNextTurn(); - expect(enemy.summonData.battleStats[BattleStat.ATK]).toEqual(0); - [BattleStat.ACC, BattleStat.DEF, BattleStat.EVA, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD].forEach((stat: number) => expect(enemy.summonData.battleStats[stat]).toBeLessThan(0)); + expect(enemy.getStatStage(Stat.ATK)).toEqual(0); + [Stat.ACC, Stat.DEF, Stat.EVA, Stat.SPATK, Stat.SPDEF, Stat.SPD].forEach((stat: number) => expect(enemy.getStatStage(stat)).toBeLessThan(0)); }); }); diff --git a/src/test/abilities/imposter.test.ts b/src/test/abilities/imposter.test.ts new file mode 100644 index 00000000000..2857f80632a --- /dev/null +++ b/src/test/abilities/imposter.test.ts @@ -0,0 +1,101 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +// 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 + .battleType("single") + .enemySpecies(Species.MEW) + .enemyLevel(200) + .enemyAbility(Abilities.BEAST_BOOST) + .enemyPassiveAbility(Abilities.BALL_FETCH) + .enemyMoveset(SPLASH_ONLY) + .ability(Abilities.IMPOSTER) + .moveset(SPLASH_ONLY); + }); + + it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => { + await game.startBattle([ + Species.DITTO + ]); + + game.move.select(Moves.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(); + + for (let i = 0; i < playerMoveset.length && i < enemyMoveset.length; i++) { + // TODO: Checks for 5 PP should be done here when that gets addressed + expect(playerMoveset[i]?.moveId).toBe(enemyMoveset[i]?.moveId); + } + + const playerTypes = player.getTypes(); + const enemyTypes = enemy.getTypes(); + + for (let i = 0; i < playerTypes.length && i < enemyTypes.length; i++) { + expect(playerTypes[i]).toBe(enemyTypes[i]); + } + }, 20000); + + it("should copy in-battle overridden stats", async () => { + game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT)); + + await game.startBattle([ + Species.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(Moves.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); + }); +}); diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index bc5b5ab1a7d..f90ba6c0e1e 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -1,17 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { Status, StatusEffect } from "#app/data/status-effect"; -import { GameModes, getGameMode } from "#app/game-mode"; -import { EncounterPhase } from "#app/phases/encounter-phase"; -import { SelectStarterPhase } from "#app/phases/select-starter-phase"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#test/utils/gameManager"; import { Mode } from "#app/ui/ui"; +import { Stat } from "#enums/stat"; +import { getMovePosition } from "#test/utils/gameManagerUtils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; -import { generateStarter } from "#test/utils/gameManagerUtils"; import { SPLASH_ONLY } from "#test/utils/testUtils"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Abilities - Intimidate", () => { let phaserGame: Phaser.Game; @@ -29,257 +25,113 @@ describe("Abilities - Intimidate", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override - .battleType("single") - .enemySpecies(Species.MAGIKARP) + game.override.battleType("single") + .enemySpecies(Species.RATTATA) .enemyAbility(Abilities.INTIMIDATE) + .enemyPassiveAbility(Abilities.HYDRATION) .ability(Abilities.INTIMIDATE) - .moveset([Moves.SPLASH, Moves.AERIAL_ACE]) + .startingWave(3) .enemyMoveset(SPLASH_ONLY); }); - it("single - wild with switch", async () => { - await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); - - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.doSwitchPokemon(1); - await game.phaseInterceptor.to("CommandPhase"); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(0); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); - }, 20000); - - it("single - boss should only trigger once then switch", async () => { - game.override.startingWave(10); - await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); - - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.doSwitchPokemon(1); - await game.phaseInterceptor.to("CommandPhase"); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(0); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); - }, 20000); - - it("single - trainer should only trigger once with switch", async () => { - game.override.startingWave(5); - await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); - - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.doSwitchPokemon(1); - await game.phaseInterceptor.to("CommandPhase"); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(0); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); - }, 200000); - - it("double - trainer should only trigger once per pokemon", async () => { - game.override - .battleType("double") - .startingWave(5); - await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); - - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); - - const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats; - expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-2); - - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); - - const battleStatsPokemon2 = game.scene.getParty()[1].summonData.battleStats; - expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2); - }, 20000); - - it("double - wild: should only trigger once per pokemon", async () => { - game.override.battleType("double"); - await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); - - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); - - const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats; - expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-2); - - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); - - const battleStatsPokemon2 = game.scene.getParty()[1].summonData.battleStats; - expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2); - }, 20000); - - it("double - boss: should only trigger once per pokemon", async () => { - game.override - .battleType("double") - .startingWave(10); - await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); - - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); - - const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats; - expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-2); - - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); - - const battleStatsPokemon2 = game.scene.getParty()[1].summonData.battleStats; - expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2); - }, 20000); - - it("single - wild next wave opp triger once, us: none", async () => { - await game.startBattle([Species.MIGHTYENA]); - - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.move.select(Moves.AERIAL_ACE); - await game.phaseInterceptor.to("DamagePhase"); - await game.doKillOpponents(); - await game.toNextWave(); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - }, 20000); - - it("single - wild next turn - no retrigger on next turn", async () => { - await game.startBattle([Species.MIGHTYENA]); - - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.move.select(Moves.SPLASH); - await game.toNextTurn(); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - }, 20000); - - it("single - trainer should only trigger once and each time he switch", async () => { - game.override - .enemyMoveset(Array(4).fill(Moves.VOLT_SWITCH)) - .startingWave(5); - await game.startBattle([Species.MIGHTYENA]); - - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.move.select(Moves.SPLASH); - await game.toNextTurn(); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - - game.move.select(Moves.SPLASH); - await game.toNextTurn(); - - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-3); - - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - }, 200000); - - it("single - trainer should only trigger once whatever turn we are", async () => { - game.override.startingWave(5); - await game.startBattle([Species.MIGHTYENA]); - - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - - game.move.select(Moves.SPLASH); - await game.toNextTurn(); - - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - }, 20000); - - it("double - wild vs only 1 on player side", async () => { - game.override.battleType("double"); - await game.classicMode.runToSummon([Species.MIGHTYENA]); + it("should lower ATK stat stage by 1 of enemy Pokemon on entry and player switch", async () => { + await game.classicMode.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); + game.onNextPrompt( + "CheckSwitchPhase", + Mode.CONFIRM, + () => { + game.setMode(Mode.MESSAGE); + game.endPhase(); + }, + () => game.isCurrentPhase("CommandPhase") || game.isCurrentPhase("TurnInitPhase") + ); await game.phaseInterceptor.to("CommandPhase", false); - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); + let playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; - const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats; - expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-1); + expect(playerPokemon.species.speciesId).toBe(Species.MIGHTYENA); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); + game.doSwitchPokemon(1); + await game.phaseInterceptor.run("CommandPhase"); + await game.phaseInterceptor.to("CommandPhase"); + + playerPokemon = game.scene.getPlayerPokemon()!; + expect(playerPokemon.species.speciesId).toBe(Species.POOCHYENA); + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-2); }, 20000); - it("double - wild vs only 1 alive on player side", async () => { - game.override.battleType("double"); - await game.runToTitle(); - - game.onNextPrompt("TitlePhase", Mode.TITLE, () => { - game.scene.gameMode = getGameMode(GameModes.CLASSIC); - const starters = generateStarter(game.scene, [Species.MIGHTYENA, Species.POOCHYENA]); - const selectStarterPhase = new SelectStarterPhase(game.scene); - game.scene.pushPhase(new EncounterPhase(game.scene, false)); - selectStarterPhase.initBattle(starters); - game.scene.getParty()[1].hp = 0; - game.scene.getParty()[1].status = new Status(StatusEffect.FAINT); - }); - - await game.phaseInterceptor.run(EncounterPhase); - + it("should lower ATK stat stage by 1 for every enemy Pokemon in a double battle on entry", async () => { + game.override.battleType("double") + .startingWave(3); + await game.classicMode.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]); + game.onNextPrompt( + "CheckSwitchPhase", + Mode.CONFIRM, + () => { + game.setMode(Mode.MESSAGE); + game.endPhase(); + }, + () => game.isCurrentPhase("CommandPhase") || game.isCurrentPhase("TurnInitPhase") + ); await game.phaseInterceptor.to("CommandPhase", false); - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); + const playerField = game.scene.getPlayerField()!; + const enemyField = game.scene.getEnemyField()!; - const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats; - expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-1); - - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2); + 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); }, 20000); + + it("should not activate again if there is no switch or new entry", async () => { + game.override.startingWave(2); + game.override.moveset([Moves.SPLASH]); + await game.classicMode.startBattle([ Species.MIGHTYENA, Species.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(Moves.SPLASH); + await game.toNextTurn(); + + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); + }, 20000); + + it("should lower ATK stat stage by 1 for every switch", async () => { + game.override.moveset([Moves.SPLASH]) + .enemyMoveset(new Array(4).fill(Moves.VOLT_SWITCH)) + .startingWave(5); + await game.classicMode.startBattle([ Species.MIGHTYENA, Species.POOCHYENA ]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + let enemyPokemon = game.scene.getEnemyPokemon()!; + + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); + + game.move.select(getMovePosition(game.scene, 0, Moves.SPLASH)); + await game.toNextTurn(); + + enemyPokemon = game.scene.getEnemyPokemon()!; + + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-2); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + + enemyPokemon = game.scene.getEnemyPokemon()!; + + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-3); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + }, 200000); }); diff --git a/src/test/abilities/intrepid_sword.test.ts b/src/test/abilities/intrepid_sword.test.ts index 18d6c04adbc..7bf0654276c 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.test.ts @@ -1,8 +1,8 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { CommandPhase } from "#app/phases/command-phase"; import { Abilities } from "#enums/abilities"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -29,14 +29,17 @@ describe("Abilities - Intrepid Sword", () => { game.override.ability(Abilities.INTREPID_SWORD); }); - it("INTREPID SWORD on player", async() => { + it("should raise ATK stat stage by 1 on entry", async() => { await game.classicMode.runToSummon([ Species.ZACIAN, ]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + await game.phaseInterceptor.to(CommandPhase, false); - const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(1); - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(1); + + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); }, 20000); }); diff --git a/src/test/abilities/moody.test.ts b/src/test/abilities/moody.test.ts index 9e936e8100a..5c46ea68ec5 100644 --- a/src/test/abilities/moody.test.ts +++ b/src/test/abilities/moody.test.ts @@ -1,18 +1,16 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; describe("Abilities - Moody", () => { let phaserGame: Phaser.Game; let game: GameManager; - const battleStatsArray = [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD]; - beforeAll(() => { phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, @@ -30,63 +28,61 @@ describe("Abilities - Moody", () => { .battleType("single") .enemySpecies(Species.RATTATA) .enemyAbility(Abilities.BALL_FETCH) - .enemyPassiveAbility(Abilities.HYDRATION) .ability(Abilities.MOODY) .enemyMoveset(SPLASH_ONLY) .moveset(SPLASH_ONLY); }); - it( - "should increase one BattleStat by 2 stages and decrease a different BattleStat by 1 stage", + it("should increase one stat stage by 2 and decrease a different stat stage by 1", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const playerPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.SPLASH); await game.toNextTurn(); // Find the increased and decreased stats, make sure they are different. - const statChanges = playerPokemon.summonData.battleStats; - const changedStats = battleStatsArray.filter(bs => statChanges[bs] === 2 || statChanges[bs] === -1); + const changedStats = EFFECTIVE_STATS.filter(s => playerPokemon.getStatStage(s) === 2 || playerPokemon.getStatStage(s) === -1); expect(changedStats).toBeTruthy(); expect(changedStats.length).toBe(2); expect(changedStats[0] !== changedStats[1]).toBeTruthy(); }); - it( - "should only increase one BattleStat by 2 stages if all BattleStats are at -6", + it("should only increase one stat stage by 2 if all stat stages are at -6", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const playerPokemon = game.scene.getPlayerPokemon()!; - // Set all BattleStats to -6 - battleStatsArray.forEach(bs => playerPokemon.summonData.battleStats[bs] = -6); + + // Set all stat stages to -6 + vi.spyOn(playerPokemon.summonData, "statStages", "get").mockReturnValue(new Array(BATTLE_STATS.length).fill(-6)); game.move.select(Moves.SPLASH); await game.toNextTurn(); - // Should increase one BattleStat by 2 (from -6, meaning it will be -4) - const increasedStat = battleStatsArray.filter(bs => playerPokemon.summonData.battleStats[bs] === -4); + // Should increase one stat stage by 2 (from -6, meaning it will be -4) + const increasedStat = EFFECTIVE_STATS.filter(s => playerPokemon.getStatStage(s) === -4); expect(increasedStat).toBeTruthy(); expect(increasedStat.length).toBe(1); }); - it( - "should only decrease one BattleStat by 1 stage if all BattleStats are at 6", + it("should only decrease one stat stage by 1 stage if all stat stages are at 6", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const playerPokemon = game.scene.getPlayerPokemon()!; - // Set all BattleStats to 6 - battleStatsArray.forEach(bs => playerPokemon.summonData.battleStats[bs] = 6); + + // Set all stat stages to 6 + vi.spyOn(playerPokemon.summonData, "statStages", "get").mockReturnValue(new Array(BATTLE_STATS.length).fill(6)); game.move.select(Moves.SPLASH); await game.toNextTurn(); - // Should decrease one BattleStat by 1 (from 6, meaning it will be 5) - const decreasedStat = battleStatsArray.filter(bs => playerPokemon.summonData.battleStats[bs] === 5); + // Should decrease one stat stage by 1 (from 6, meaning it will be 5) + const decreasedStat = EFFECTIVE_STATS.filter(s => playerPokemon.getStatStage(s) === 5); + expect(decreasedStat).toBeTruthy(); expect(decreasedStat.length).toBe(1); }); diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index 6a1838c9a98..e713d78f39e 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -1,14 +1,15 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { Stat } from "#app/data/pokemon-stat"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { VictoryPhase } from "#app/phases/victory-phase"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; - +import { SPLASH_ONLY } from "../utils/testUtils"; +import { BattlerIndex } from "#app/battle"; +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; @@ -32,23 +33,47 @@ describe("Abilities - Moxie", () => { game.override.enemyAbility(Abilities.MOXIE); game.override.ability(Abilities.MOXIE); game.override.startingLevel(2000); - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.moveset([ moveToUse ]); + game.override.enemyMoveset(SPLASH_ONLY); }); - it("MOXIE", async () => { + it("should raise ATK stat stage by 1 when winning a battle", async() => { const moveToUse = Moves.AERIAL_ACE; await game.startBattle([ Species.MIGHTYENA, Species.MIGHTYENA, ]); - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[Stat.ATK]).toBe(0); + const playerPokemon = game.scene.getPlayerPokemon()!; + + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0); game.move.select(moveToUse); await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(VictoryPhase); - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.ATK]).toBe(1); + + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1); + }, 20000); + + // TODO: Activate this test when MOXIE is corrected to work on faint and not on battle victory + it.todo("should raise ATK stat stage by 1 when defeating an ally Pokemon", async() => { + game.override.battleType("double"); + const moveToUse = Moves.AERIAL_ACE; + await game.startBattle([ + Species.MIGHTYENA, + Species.MIGHTYENA, + ]); + + const [ firstPokemon, secondPokemon ] = game.scene.getPlayerField(); + + expect(firstPokemon.getStatStage(Stat.ATK)).toBe(0); + + secondPokemon.hp = 1; + + game.move.select(moveToUse); + game.selectTarget(BattlerIndex.PLAYER_2); + + await game.phaseInterceptor.to(TurnEndPhase); + + expect(firstPokemon.getStatStage(Stat.ATK)).toBe(1); }, 20000); }); diff --git a/src/test/abilities/mycelium_might.test.ts b/src/test/abilities/mycelium_might.test.ts index d5bea185f59..d8947935880 100644 --- a/src/test/abilities/mycelium_might.test.ts +++ b/src/test/abilities/mycelium_might.test.ts @@ -1,10 +1,10 @@ -import { BattleStat } from "#app/data/battle-stat"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnStartPhase } from "#app/phases/turn-start-phase"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; +import { Stat } from "#enums/stat"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -58,8 +58,9 @@ describe("Abilities - Mycelium Might", () => { expect(speedOrder).toEqual([playerIndex, enemyIndex]); expect(commandOrder).toEqual([enemyIndex, playerIndex]); await game.phaseInterceptor.to(TurnEndPhase); - // Despite the opponent's ability (Clear Body), its attack stat is still reduced. - expect(enemyPokemon?.summonData.battleStats[BattleStat.ATK]).toBe(-1); + + // Despite the opponent's ability (Clear Body), its ATK stat stage is still reduced. + expect(enemyPokemon?.getStatStage(Stat.ATK)).toBe(-1); }, 20000); it("will still go first if a status move that is in a higher priority bracket than the opponent's move is used", async () => { @@ -81,8 +82,8 @@ describe("Abilities - Mycelium Might", () => { expect(speedOrder).toEqual([playerIndex, enemyIndex]); expect(commandOrder).toEqual([playerIndex, enemyIndex]); await game.phaseInterceptor.to(TurnEndPhase); - // Despite the opponent's ability (Clear Body), its attack stat is still reduced. - expect(enemyPokemon?.summonData.battleStats[BattleStat.ATK]).toBe(-1); + // Despite the opponent's ability (Clear Body), its ATK stat stage is still reduced. + expect(enemyPokemon?.getStatStage(Stat.ATK)).toBe(-1); }, 20000); it("will not affect non-status moves", async () => { diff --git a/src/test/abilities/parental_bond.test.ts b/src/test/abilities/parental_bond.test.ts index 1404f597ccf..81a30524a5e 100644 --- a/src/test/abilities/parental_bond.test.ts +++ b/src/test/abilities/parental_bond.test.ts @@ -1,13 +1,7 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { StatusEffect } from "#app/data/status-effect"; import { Type } from "#app/data/type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { DamagePhase } from "#app/phases/damage-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 { toDmgValue } from "#app/utils"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; @@ -15,7 +9,7 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; const TIMEOUT = 20 * 1000; @@ -39,36 +33,31 @@ describe("Abilities - Parental Bond", () => { game.override.disableCrits(); game.override.ability(Abilities.PARENTAL_BOND); game.override.enemySpecies(Species.SNORLAX); - game.override.enemyAbility(Abilities.INSOMNIA); + game.override.enemyAbility(Abilities.FUR_COAT); game.override.enemyMoveset(SPLASH_ONLY); game.override.startingLevel(100); game.override.enemyLevel(100); }); - test( - "ability should add second strike to attack move", + it( + "should add second strike to attack move", async () => { game.override.moveset([Moves.TACKLE]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); let enemyStartingHp = enemyPokemon.hp; game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(MoveEffectPhase, false); - - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); const firstStrikeDamage = enemyStartingHp - enemyPokemon.hp; enemyStartingHp = enemyPokemon.hp; - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); const secondStrikeDamage = enemyStartingHp - enemyPokemon.hp; @@ -77,556 +66,460 @@ describe("Abilities - Parental Bond", () => { }, TIMEOUT ); - test( - "ability should apply secondary effects to both strikes", + it( + "should apply secondary effects to both strikes", async () => { game.override.moveset([Moves.POWER_UP_PUNCH]); game.override.enemySpecies(Species.AMOONGUSS); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.POWER_UP_PUNCH); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(leadPokemon.turnData.hitCount).toBe(2); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(2); }, TIMEOUT ); - test( - "ability should not apply to Status moves", + it( + "should not apply to Status moves", async () => { game.override.moveset([Moves.BABY_DOLL_EYES]); - await game.startBattle([Species.CHARIZARD]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); + await game.classicMode.startBattle([Species.MAGIKARP]); const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.BABY_DOLL_EYES); - await game.phaseInterceptor.to(BerryPhase, false); - expect(enemyPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-1); + await game.phaseInterceptor.to("BerryPhase", false); + + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); }, TIMEOUT ); - test( - "ability should not apply to multi-hit moves", + it( + "should not apply to multi-hit moves", async () => { game.override.moveset([Moves.DOUBLE_HIT]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.DOUBLE_HIT); await game.move.forceHit(); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(leadPokemon.turnData.hitCount).toBe(2); }, TIMEOUT ); - test( - "ability should not apply to self-sacrifice moves", + it( + "should not apply to self-sacrifice moves", async () => { game.override.moveset([Moves.SELF_DESTRUCT]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.SELF_DESTRUCT); - await game.phaseInterceptor.to(DamagePhase, false); + await game.phaseInterceptor.to("DamagePhase", false); expect(leadPokemon.turnData.hitCount).toBe(1); }, TIMEOUT ); - test( - "ability should not apply to Rollout", + it( + "should not apply to Rollout", async () => { game.override.moveset([Moves.ROLLOUT]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.ROLLOUT); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase, false); + await game.phaseInterceptor.to("DamagePhase", false); expect(leadPokemon.turnData.hitCount).toBe(1); }, TIMEOUT ); - test( - "ability should not apply multiplier to fixed-damage moves", + it( + "should not apply multiplier to fixed-damage moves", async () => { game.override.moveset([Moves.DRAGON_RAGE]); - await game.startBattle([Species.CHARIZARD]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); + await game.classicMode.startBattle([Species.MAGIKARP]); const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); - - const enemyStartingHp = enemyPokemon.hp; game.move.select(Moves.DRAGON_RAGE); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon.hp).toBe(enemyStartingHp - 80); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - 80); }, TIMEOUT ); - test( - "ability should not apply multiplier to counter moves", + it( + "should not apply multiplier to counter moves", async () => { game.override.moveset([Moves.COUNTER]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.SHUCKLE]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); - - const playerStartingHp = leadPokemon.hp; - const enemyStartingHp = enemyPokemon.hp; game.move.select(Moves.COUNTER); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); - const playerDamage = playerStartingHp - leadPokemon.hp; + const playerDamage = leadPokemon.getMaxHp() - leadPokemon.hp; - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon.hp).toBe(enemyStartingHp - 4 * playerDamage); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - 4 * playerDamage); }, TIMEOUT ); - test( - "ability should not apply to multi-target moves", + it( + "should not apply to multi-target moves", async () => { game.override.battleType("double"); game.override.moveset([Moves.EARTHQUAKE]); + game.override.passiveAbility(Abilities.LEVITATE); - await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]); + await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]); const playerPokemon = game.scene.getPlayerField(); - expect(playerPokemon.length).toBe(2); - playerPokemon.forEach(p => expect(p).not.toBe(undefined)); - - const enemyPokemon = game.scene.getEnemyField(); - expect(enemyPokemon.length).toBe(2); - enemyPokemon.forEach(p => expect(p).not.toBe(undefined)); game.move.select(Moves.EARTHQUAKE); - await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.EARTHQUAKE, 1); - await game.phaseInterceptor.to(BerryPhase, false); + + await game.phaseInterceptor.to("BerryPhase", false); playerPokemon.forEach(p => expect(p.turnData.hitCount).toBe(1)); }, TIMEOUT ); - test( - "ability should apply to multi-target moves when hitting only one target", + it( + "should apply to multi-target moves when hitting only one target", async () => { game.override.moveset([Moves.EARTHQUAKE]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.EARTHQUAKE); - await game.phaseInterceptor.to(DamagePhase, false); + await game.phaseInterceptor.to("DamagePhase", false); expect(leadPokemon.turnData.hitCount).toBe(2); }, TIMEOUT ); - test( - "ability should only trigger post-target move effects once", + it( + "should only trigger post-target move effects once", async () => { game.override.moveset([Moves.MIND_BLOWN]); - await game.startBattle([Species.PIDGEOT]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.MIND_BLOWN); - await game.phaseInterceptor.to(DamagePhase, false); + await game.phaseInterceptor.to("DamagePhase", false); expect(leadPokemon.turnData.hitCount).toBe(2); // This test will time out if the user faints - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(leadPokemon.hp).toBe(toDmgValue(leadPokemon.getMaxHp() / 2)); + expect(leadPokemon.hp).toBe(Math.ceil(leadPokemon.getMaxHp() / 2)); }, TIMEOUT ); - test( - "Burn Up only removes type after second strike with this ability", + it( + "Burn Up only removes type after the second strike", async () => { game.override.moveset([Moves.BURN_UP]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.CHARIZARD]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.BURN_UP); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("MoveEffectPhase"); expect(leadPokemon.turnData.hitCount).toBe(2); expect(enemyPokemon.hp).toBeGreaterThan(0); expect(leadPokemon.isOfType(Type.FIRE)).toBe(true); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(leadPokemon.isOfType(Type.FIRE)).toBe(false); }, TIMEOUT ); - test( + it( "Moves boosted by this ability and Multi-Lens should strike 4 times", async () => { game.override.moveset([Moves.TACKLE]); game.override.startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(4); }, TIMEOUT ); - test( + it( "Super Fang boosted by this ability and Multi-Lens should strike twice", async () => { game.override.moveset([Moves.SUPER_FANG]); game.override.startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); - - const enemyStartingHp = enemyPokemon.hp; game.move.select(Moves.SUPER_FANG); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(2); - await game.phaseInterceptor.to(MoveEndPhase, false); + await game.phaseInterceptor.to("MoveEndPhase", false); - expect(enemyPokemon.hp).toBe(Math.ceil(enemyStartingHp * 0.25)); + expect(enemyPokemon.hp).toBe(Math.ceil(enemyPokemon.getMaxHp() * 0.25)); }, TIMEOUT ); - test( + it( "Seismic Toss boosted by this ability and Multi-Lens should strike twice", async () => { game.override.moveset([Moves.SEISMIC_TOSS]); game.override.startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); const enemyStartingHp = enemyPokemon.hp; game.move.select(Moves.SEISMIC_TOSS); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(2); - await game.phaseInterceptor.to(MoveEndPhase, false); + await game.phaseInterceptor.to("MoveEndPhase", false); expect(enemyPokemon.hp).toBe(enemyStartingHp - 200); }, TIMEOUT ); - test( + it( "Hyper Beam boosted by this ability should strike twice, then recharge", async () => { game.override.moveset([Moves.HYPER_BEAM]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.HYPER_BEAM); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(2); expect(leadPokemon.getTag(BattlerTagType.RECHARGING)).toBeUndefined(); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(leadPokemon.getTag(BattlerTagType.RECHARGING)).toBeDefined(); }, TIMEOUT ); - /** TODO: Fix TRAPPED tag lapsing incorrectly, then run this test */ - test( + it( "Anchor Shot boosted by this ability should only trap the target after the second hit", async () => { game.override.moveset([Moves.ANCHOR_SHOT]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.ANCHOR_SHOT); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(2); - expect(enemyPokemon.getTag(BattlerTagType.TRAPPED)).toBeUndefined(); // Passes + expect(enemyPokemon.getTag(BattlerTagType.TRAPPED)).toBeUndefined(); - await game.phaseInterceptor.to(MoveEndPhase); - expect(enemyPokemon.getTag(BattlerTagType.TRAPPED)).toBeDefined(); // Passes + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemyPokemon.getTag(BattlerTagType.TRAPPED)).toBeDefined(); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); - expect(enemyPokemon.getTag(BattlerTagType.TRAPPED)).toBeDefined(); // Fails :( + expect(enemyPokemon.getTag(BattlerTagType.TRAPPED)).toBeDefined(); }, TIMEOUT ); - test( + it( "Smack Down boosted by this ability should only ground the target after the second hit", async () => { game.override.moveset([Moves.SMACK_DOWN]); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.SMACK_DOWN); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(2); expect(enemyPokemon.getTag(BattlerTagType.IGNORE_FLYING)).toBeUndefined(); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(enemyPokemon.getTag(BattlerTagType.IGNORE_FLYING)).toBeDefined(); }, TIMEOUT ); - test( + it( "U-turn boosted by this ability should strike twice before forcing a switch", async () => { game.override.moveset([Moves.U_TURN]); - await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); + await game.classicMode.startBattle([Species.MAGIKARP, Species.BLASTOISE]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.U_TURN); await game.move.forceHit(); - await game.phaseInterceptor.to(MoveEffectPhase); + await game.phaseInterceptor.to("MoveEffectPhase"); expect(leadPokemon.turnData.hitCount).toBe(2); // This will cause this test to time out if the switch was forced on the first hit. - await game.phaseInterceptor.to(MoveEffectPhase, false); + await game.phaseInterceptor.to("MoveEffectPhase", false); }, TIMEOUT ); - test( + it( "Wake-Up Slap boosted by this ability should only wake up the target after the second hit", async () => { game.override.moveset([Moves.WAKE_UP_SLAP]).enemyStatusEffect(StatusEffect.SLEEP); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.WAKE_UP_SLAP); await game.move.forceHit(); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(leadPokemon.turnData.hitCount).toBe(2); expect(enemyPokemon.status?.effect).toBe(StatusEffect.SLEEP); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(enemyPokemon.status?.effect).toBeUndefined(); }, TIMEOUT ); - test( - "ability should not cause user to hit into King's Shield more than once", + it( + "should not cause user to hit into King's Shield more than once", async () => { game.override.moveset([Moves.TACKLE]); - game.override.enemyMoveset([Moves.KINGS_SHIELD, Moves.KINGS_SHIELD, Moves.KINGS_SHIELD, Moves.KINGS_SHIELD]); + game.override.enemyMoveset(Array(4).fill(Moves.KINGS_SHIELD)); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); - - const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.TACKLE); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(-1); }, TIMEOUT ); - test( - "ability should not cause user to hit into Storm Drain more than once", + it( + "should not cause user to hit into Storm Drain more than once", async () => { game.override.moveset([Moves.WATER_GUN]); game.override.enemyAbility(Abilities.STORM_DRAIN); - await game.startBattle([Species.CHARIZARD]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - expect(leadPokemon).not.toBe(undefined); + await game.classicMode.startBattle([Species.MAGIKARP]); const enemyPokemon = game.scene.getEnemyPokemon()!; - expect(enemyPokemon).not.toBe(undefined); game.move.select(Moves.WATER_GUN); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(1); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(1); }, TIMEOUT ); - test( - "ability should not apply to multi-target moves with Multi-Lens", + it( + "should not apply to multi-target moves with Multi-Lens", async () => { game.override.battleType("double"); game.override.moveset([Moves.EARTHQUAKE, Moves.SPLASH]); + game.override.passiveAbility(Abilities.LEVITATE); game.override.startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); - await game.startBattle([Species.CHARIZARD, Species.PIDGEOT]); - - const playerPokemon = game.scene.getPlayerField(); - expect(playerPokemon.length).toBe(2); - playerPokemon.forEach(p => expect(p).not.toBe(undefined)); + await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]); const enemyPokemon = game.scene.getEnemyField(); - expect(enemyPokemon.length).toBe(2); - enemyPokemon.forEach(p => expect(p).not.toBe(undefined)); const enemyStartingHp = enemyPokemon.map(p => p.hp); game.move.select(Moves.EARTHQUAKE); - await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.SPLASH, 1); - await game.phaseInterceptor.to(MoveEffectPhase, false); - - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); const enemyFirstHitDamage = enemyStartingHp.map((hp, i) => hp - enemyPokemon[i].hp); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); enemyPokemon.forEach((p, i) => expect(enemyStartingHp[i] - p.hp).toBe(2 * enemyFirstHitDamage[i])); - }, TIMEOUT ); }); diff --git a/src/test/abilities/sand_veil.test.ts b/src/test/abilities/sand_veil.test.ts index 2336e2b50de..da9fdcc01ab 100644 --- a/src/test/abilities/sand_veil.test.ts +++ b/src/test/abilities/sand_veil.test.ts @@ -1,5 +1,5 @@ -import { BattleStatMultiplierAbAttr, allAbilities } from "#app/data/ability"; -import { BattleStat } from "#app/data/battle-stat"; +import { StatMultiplierAbAttr, allAbilities } from "#app/data/ability"; +import { Stat } from "#enums/stat"; import { WeatherType } from "#app/data/weather"; import { CommandPhase } from "#app/phases/command-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; @@ -49,10 +49,10 @@ describe("Abilities - Sand Veil", () => { vi.spyOn(leadPokemon[0], "getAbility").mockReturnValue(allAbilities[Abilities.SAND_VEIL]); - const sandVeilAttr = allAbilities[Abilities.SAND_VEIL].getAttrs(BattleStatMultiplierAbAttr)[0]; - vi.spyOn(sandVeilAttr, "applyBattleStat").mockImplementation( - (pokemon, passive, simulated, battleStat, statValue, args) => { - if (battleStat === BattleStat.EVA && game.scene.arena.weather?.weatherType === WeatherType.SANDSTORM) { + const sandVeilAttr = allAbilities[Abilities.SAND_VEIL].getAttrs(StatMultiplierAbAttr)[0]; + vi.spyOn(sandVeilAttr, "applyStatStage").mockImplementation( + (_pokemon, _passive, _simulated, stat, statValue, _args) => { + if (stat === Stat.EVA && game.scene.arena.weather?.weatherType === WeatherType.SANDSTORM) { statValue.value *= -1; // will make all attacks miss return true; } diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index f9c20e85eab..2d70ede3530 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +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"; @@ -9,6 +9,7 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { @@ -31,52 +32,55 @@ describe("Abilities - Sap Sipper", () => { game.override.disableCrits(); }); - it("raise attack 1 level and block effects when activated against a grass attack", async () => { + it("raises ATK stat stage by 1 and block effects when activated against a grass attack", async() => { const moveToUse = Moves.LEAFAGE; const enemyAbility = Abilities.SAP_SIPPER; - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); + game.override.moveset([ moveToUse ]); + game.override.enemyMoveset(SPLASH_ONLY); game.override.enemySpecies(Species.DUSKULL); game.override.enemyAbility(enemyAbility); await game.startBattle(); - const startingOppHp = game.scene.currentBattle.enemyParty[0].hp; + const enemyPokemon = game.scene.getEnemyPokemon()!; + const initialEnemyHp = enemyPokemon.hp; game.move.select(moveToUse); await game.phaseInterceptor.to(TurnEndPhase); - expect(startingOppHp - game.scene.getEnemyParty()[0].hp).toBe(0); - expect(game.scene.getEnemyParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(initialEnemyHp - enemyPokemon.hp).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); }); - it("raise attack 1 level and block effects when activated against a grass status move", async () => { + it("raises ATK stat stage by 1 and block effects when activated against a grass status move", async() => { const moveToUse = Moves.SPORE; const enemyAbility = Abilities.SAP_SIPPER; - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); + game.override.moveset([ moveToUse ]); + game.override.enemyMoveset(SPLASH_ONLY); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); await game.startBattle(); + const enemyPokemon = game.scene.getEnemyPokemon()!; + game.move.select(moveToUse); await game.phaseInterceptor.to(TurnEndPhase); - expect(game.scene.getEnemyParty()[0].status).toBeUndefined(); - expect(game.scene.getEnemyParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(enemyPokemon.status).toBeUndefined(); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); }); it("do not activate against status moves that target the field", async () => { const moveToUse = Moves.GRASSY_TERRAIN; const enemyAbility = Abilities.SAP_SIPPER; - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); + game.override.moveset([ moveToUse ]); + game.override.enemyMoveset(SPLASH_ONLY); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); @@ -88,51 +92,54 @@ describe("Abilities - Sap Sipper", () => { expect(game.scene.arena.terrain).toBeDefined(); expect(game.scene.arena.terrain!.terrainType).toBe(TerrainType.GRASSY); - expect(game.scene.getEnemyParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.ATK)).toBe(0); }); it("activate once against multi-hit grass attacks", async () => { const moveToUse = Moves.BULLET_SEED; const enemyAbility = Abilities.SAP_SIPPER; - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); + game.override.moveset([ moveToUse ]); + game.override.enemyMoveset(SPLASH_ONLY); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(enemyAbility); await game.startBattle(); - const startingOppHp = game.scene.currentBattle.enemyParty[0].hp; + const enemyPokemon = game.scene.getEnemyPokemon()!; + const initialEnemyHp = enemyPokemon.hp; game.move.select(moveToUse); await game.phaseInterceptor.to(TurnEndPhase); - expect(startingOppHp - game.scene.getEnemyParty()[0].hp).toBe(0); - expect(game.scene.getEnemyParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(initialEnemyHp - enemyPokemon.hp).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); }); it("do not activate against status moves that target the user", async () => { const moveToUse = Moves.SPIKY_SHIELD; const ability = Abilities.SAP_SIPPER; - game.override.moveset([moveToUse]); + game.override.moveset([ moveToUse ]); game.override.ability(ability); - game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); + game.override.enemyMoveset(SPLASH_ONLY); game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.NONE); await game.startBattle(); + const playerPokemon = game.scene.getPlayerPokemon()!; + game.move.select(moveToUse); await game.phaseInterceptor.to(MoveEndPhase); - expect(game.scene.getParty()[0].getTag(BattlerTagType.SPIKY_SHIELD)).toBeDefined(); + expect(playerPokemon.getTag(BattlerTagType.SPIKY_SHIELD)).toBeDefined(); await game.phaseInterceptor.to(TurnEndPhase); - expect(game.scene.getParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0); expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase"); }); @@ -149,13 +156,14 @@ describe("Abilities - Sap Sipper", () => { await game.startBattle(); - const startingOppHp = game.scene.currentBattle.enemyParty[0].hp; + const enemyPokemon = game.scene.getEnemyPokemon()!; + const initialEnemyHp = enemyPokemon.hp; game.move.select(moveToUse); await game.phaseInterceptor.to(TurnEndPhase); - expect(startingOppHp - game.scene.getEnemyParty()[0].hp).toBe(0); - expect(game.scene.getEnemyParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(initialEnemyHp - enemyPokemon.hp).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1); }); }); diff --git a/src/test/abilities/serene_grace.test.ts b/src/test/abilities/serene_grace.test.ts index 7316b2ea920..e06288b9de9 100644 --- a/src/test/abilities/serene_grace.test.ts +++ b/src/test/abilities/serene_grace.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { applyAbAttrs, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import * as Utils from "#app/utils"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/abilities/sheer_force.test.ts b/src/test/abilities/sheer_force.test.ts index f73b749dac2..69b47e1eaae 100644 --- a/src/test/abilities/sheer_force.test.ts +++ b/src/test/abilities/sheer_force.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { applyAbAttrs, applyPostDefendAbAttrs, applyPreAttackAbAttrs, MoveEffectChanceMultiplierAbAttr, MovePowerBoostAbAttr, PostDefendTypeChangeAbAttr } from "#app/data/ability"; -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import * as Utils from "#app/utils"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/abilities/shield_dust.test.ts b/src/test/abilities/shield_dust.test.ts index 14770c49427..8a0b769827d 100644 --- a/src/test/abilities/shield_dust.test.ts +++ b/src/test/abilities/shield_dust.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { applyAbAttrs, applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import * as Utils from "#app/utils"; import { Abilities } from "#enums/abilities"; diff --git a/src/test/abilities/simple.test.ts b/src/test/abilities/simple.test.ts new file mode 100644 index 00000000000..4310c5d45d1 --- /dev/null +++ b/src/test/abilities/simple.test.ts @@ -0,0 +1,42 @@ +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +describe("Abilities - Simple", () => { + 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 + .battleType("single") + .enemySpecies(Species.BULBASAUR) + .enemyAbility(Abilities.SIMPLE) + .ability(Abilities.INTIMIDATE) + .enemyMoveset(SPLASH_ONLY); + }); + + it("should double stat changes when applied", async() => { + await game.startBattle([ + Species.SLOWBRO + ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-2); + }, 20000); +}); diff --git a/src/test/abilities/steely_spirit.test.ts b/src/test/abilities/steely_spirit.test.ts index c632d0be777..7aaa0a42ae3 100644 --- a/src/test/abilities/steely_spirit.test.ts +++ b/src/test/abilities/steely_spirit.test.ts @@ -1,7 +1,6 @@ import { allAbilities } from "#app/data/ability"; import { allMoves } from "#app/data/move"; import { Abilities } from "#app/enums/abilities"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; @@ -37,7 +36,7 @@ describe("Abilities - Steely Spirit", () => { }); it("increases Steel-type moves' power used by the user and its allies by 50%", async () => { - await game.startBattle([Species.PIKACHU, Species.SHUCKLE]); + await game.classicMode.startBattle([Species.PIKACHU, Species.SHUCKLE]); const boostSource = game.scene.getPlayerField()[1]; const enemyToCheck = game.scene.getEnemyPokemon()!; @@ -47,13 +46,13 @@ describe("Abilities - Steely Spirit", () => { game.move.select(moveToCheck, 0, enemyToCheck.getBattlerIndex()); game.move.select(Moves.SPLASH, 1); - await game.phaseInterceptor.to(MoveEffectPhase); + await game.phaseInterceptor.to("MoveEffectPhase"); expect(allMoves[moveToCheck].calculateBattlePower).toHaveReturnedWith(ironHeadPower * steelySpiritMultiplier); }); it("stacks if multiple users with this ability are on the field.", async () => { - await game.startBattle([Species.PIKACHU, Species.PIKACHU]); + await game.classicMode.startBattle([Species.PIKACHU, Species.PIKACHU]); const enemyToCheck = game.scene.getEnemyPokemon()!; game.scene.getPlayerField().forEach(p => { @@ -64,13 +63,13 @@ describe("Abilities - Steely Spirit", () => { game.move.select(moveToCheck, 0, enemyToCheck.getBattlerIndex()); game.move.select(moveToCheck, 1, enemyToCheck.getBattlerIndex()); - await game.phaseInterceptor.to(MoveEffectPhase); + await game.phaseInterceptor.to("MoveEffectPhase"); expect(allMoves[moveToCheck].calculateBattlePower).toHaveReturnedWith(ironHeadPower * Math.pow(steelySpiritMultiplier, 2)); }); it("does not take effect when suppressed", async () => { - await game.startBattle([Species.PIKACHU, Species.SHUCKLE]); + await game.classicMode.startBattle([Species.PIKACHU, Species.SHUCKLE]); const boostSource = game.scene.getPlayerField()[1]; const enemyToCheck = game.scene.getEnemyPokemon()!; @@ -84,8 +83,25 @@ describe("Abilities - Steely Spirit", () => { game.move.select(moveToCheck, 0, enemyToCheck.getBattlerIndex()); game.move.select(Moves.SPLASH, 1); - await game.phaseInterceptor.to(MoveEffectPhase); + await game.phaseInterceptor.to("MoveEffectPhase"); expect(allMoves[moveToCheck].calculateBattlePower).toHaveReturnedWith(ironHeadPower); }); + + it("affects variable-type moves if their resolved type is Steel", async () => { + game.override + .ability(Abilities.STEELY_SPIRIT) + .moveset([Moves.REVELATION_DANCE]); + + const revelationDance = allMoves[Moves.REVELATION_DANCE]; + vi.spyOn(revelationDance, "calculateBattlePower"); + + await game.classicMode.startBattle([Species.KLINKLANG]); + + game.move.select(Moves.REVELATION_DANCE); + + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(revelationDance.calculateBattlePower).toHaveReturnedWith(revelationDance.power * 1.5); + }); }); diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index d9c3fe34c24..7f3e160c7d0 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; @@ -41,12 +41,14 @@ describe("Abilities - Volt Absorb", () => { await game.startBattle(); + const playerPokemon = game.scene.getPlayerPokemon()!; + game.move.select(moveToUse); await game.phaseInterceptor.to(TurnEndPhase); - expect(game.scene.getParty()[0].summonData.battleStats[BattleStat.SPDEF]).toBe(1); - expect(game.scene.getParty()[0].getTag(BattlerTagType.CHARGED)).toBeDefined(); + expect(playerPokemon.getStatStage(Stat.SPDEF)).toBe(1); + expect(playerPokemon.getTag(BattlerTagType.CHARGED)).toBeDefined(); expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase"); }); }); diff --git a/src/test/abilities/wind_rider.test.ts b/src/test/abilities/wind_rider.test.ts index e11b3b39723..7a1fee6794a 100644 --- a/src/test/abilities/wind_rider.test.ts +++ b/src/test/abilities/wind_rider.test.ts @@ -1,8 +1,8 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -31,56 +31,38 @@ describe("Abilities - Wind Rider", () => { .enemyMoveset(SPLASH_ONLY); }); - it("takes no damage from wind moves and its Attack is increased by one stage when hit by one", async () => { - await game.classicMode.startBattle([Species.MAGIKARP]); + it("takes no damage from wind moves and its ATK stat stage is raised by 1 when hit by one", async () => { + await game.classicMode.startBattle([ Species.MAGIKARP ]); const shiftry = game.scene.getEnemyPokemon()!; - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(shiftry.getStatStage(Stat.ATK)).toBe(0); game.move.select(Moves.PETAL_BLIZZARD); await game.phaseInterceptor.to("TurnEndPhase"); expect(shiftry.isFullHp()).toBe(true); - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(shiftry.getStatStage(Stat.ATK)).toBe(1); }); - it("Attack is increased by one stage when Tailwind is present on its side", async () => { - game.override.ability(Abilities.WIND_RIDER); - game.override.enemySpecies(Species.MAGIKARP); + it("ATK stat stage is raised by 1 when Tailwind is present on its side", async () => { + game.override + .enemySpecies(Species.MAGIKARP) + .ability(Abilities.WIND_RIDER); await game.classicMode.startBattle([Species.SHIFTRY]); const shiftry = game.scene.getPlayerPokemon()!; - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(shiftry.getStatStage(Stat.ATK)).toBe(0); game.move.select(Moves.TAILWIND); await game.phaseInterceptor.to("TurnEndPhase"); - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(shiftry.getStatStage(Stat.ATK)).toBe(1); }); - it("does not increase Attack when Tailwind is present on opposing side", async () => { - game.override.ability(Abilities.WIND_RIDER); - game.override.enemySpecies(Species.MAGIKARP); - - await game.classicMode.startBattle([Species.SHIFTRY]); - const magikarp = game.scene.getEnemyPokemon()!; - const shiftry = game.scene.getPlayerPokemon()!; - - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(magikarp.summonData.battleStats[BattleStat.ATK]).toBe(0); - - game.move.select(Moves.TAILWIND); - - await game.phaseInterceptor.to("TurnEndPhase"); - - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(1); - expect(magikarp.summonData.battleStats[BattleStat.ATK]).toBe(0); - }); - - it("does not increase Attack when Tailwind is present on opposing side", async () => { + it("does not raise ATK stat stage when Tailwind is present on opposing side", async () => { game.override .enemySpecies(Species.MAGIKARP) .ability(Abilities.WIND_RIDER); @@ -89,15 +71,35 @@ describe("Abilities - Wind Rider", () => { const magikarp = game.scene.getEnemyPokemon()!; const shiftry = game.scene.getPlayerPokemon()!; - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(magikarp.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(shiftry.getStatStage(Stat.ATK)).toBe(0); + expect(magikarp.getStatStage(Stat.ATK)).toBe(0); game.move.select(Moves.TAILWIND); await game.phaseInterceptor.to("TurnEndPhase"); - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(1); - expect(magikarp.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(shiftry.getStatStage(Stat.ATK)).toBe(1); + expect(magikarp.getStatStage(Stat.ATK)).toBe(0); + }); + + it("does not raise ATK stat stage when Tailwind is present on opposing side", async () => { + game.override + .enemySpecies(Species.MAGIKARP) + .ability(Abilities.WIND_RIDER); + + await game.classicMode.startBattle([Species.SHIFTRY]); + const magikarp = game.scene.getEnemyPokemon()!; + const shiftry = game.scene.getPlayerPokemon()!; + + expect(shiftry.getStatStage(Stat.ATK)).toBe(0); + expect(magikarp.getStatStage(Stat.ATK)).toBe(0); + + game.move.select(Moves.TAILWIND); + + await game.phaseInterceptor.to("TurnEndPhase"); + + expect(shiftry.getStatStage(Stat.ATK)).toBe(1); + expect(magikarp.getStatStage(Stat.ATK)).toBe(0); }); it("does not interact with Sandstorm", async () => { @@ -106,14 +108,14 @@ describe("Abilities - Wind Rider", () => { await game.classicMode.startBattle([Species.SHIFTRY]); const shiftry = game.scene.getPlayerPokemon()!; - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(shiftry.getStatStage(Stat.ATK)).toBe(0); expect(shiftry.isFullHp()).toBe(true); game.move.select(Moves.SANDSTORM); await game.phaseInterceptor.to("TurnEndPhase"); - expect(shiftry.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(shiftry.getStatStage(Stat.ATK)).toBe(0); expect(shiftry.hp).lessThan(shiftry.getMaxHp()); }); }); diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index 677d998e876..fd378647184 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -1,6 +1,5 @@ +import { Stat } from "#enums/stat"; import { BattlerIndex } from "#app/battle"; -import { Stat } from "#app/data/pokemon-stat"; -import { Status, StatusEffect } from "#app/data/status-effect"; import { DamagePhase } from "#app/phases/damage-phase"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { MessagePhase } from "#app/phases/message-phase"; @@ -18,6 +17,7 @@ import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; +import { Status, StatusEffect } from "#app/data/status-effect"; const TIMEOUT = 20 * 1000; diff --git a/src/test/achievements/achievement.test.ts b/src/test/achievements/achievement.test.ts index 36c20ae2248..24d00a3e77b 100644 --- a/src/test/achievements/achievement.test.ts +++ b/src/test/achievements/achievement.test.ts @@ -224,7 +224,7 @@ describe("achvs", () => { expect(achvs._50_RIBBONS).toBeInstanceOf(RibbonAchv); expect(achvs._75_RIBBONS).toBeInstanceOf(RibbonAchv); expect(achvs._100_RIBBONS).toBeInstanceOf(RibbonAchv); - expect(achvs.TRANSFER_MAX_BATTLE_STAT).toBeInstanceOf(Achv); + expect(achvs.TRANSFER_MAX_STAT_STAGE).toBeInstanceOf(Achv); expect(achvs.MAX_FRIENDSHIP).toBeInstanceOf(Achv); expect(achvs.MEGA_EVOLVE).toBeInstanceOf(Achv); expect(achvs.GIGANTAMAX).toBeInstanceOf(Achv); diff --git a/src/test/battle-scene.test.ts b/src/test/battle-scene.test.ts index 9e28ec99791..4da75cea197 100644 --- a/src/test/battle-scene.test.ts +++ b/src/test/battle-scene.test.ts @@ -1,5 +1,5 @@ import { LoadingScene } from "#app/loading-scene"; -import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import GameManager from "./utils/gameManager"; describe("BattleScene", () => { @@ -24,4 +24,12 @@ describe("BattleScene", () => { // `BattleScene.create()` is called during the `new GameManager()` call expect(game.scene.scene.remove).toHaveBeenCalledWith(LoadingScene.KEY); }); + + it("should also reset RNG on reset", () => { + vi.spyOn(game.scene, "resetSeed"); + + game.scene.reset(); + + expect(game.scene.resetSeed).toHaveBeenCalled(); + }); }); diff --git a/src/test/battle-stat.spec.ts b/src/test/battle-stat.spec.ts deleted file mode 100644 index 16fce962838..00000000000 --- a/src/test/battle-stat.spec.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "#app/data/battle-stat"; -import { describe, expect, it } from "vitest"; -import { arrayOfRange, mockI18next } from "./utils/testUtils"; - -const TEST_BATTLE_STAT = -99 as unknown as BattleStat; -const TEST_POKEMON = "Testmon"; -const TEST_STAT = "Teststat"; - -describe("battle-stat", () => { - describe("getBattleStatName", () => { - it("should return the correct name for each BattleStat", () => { - mockI18next(); - - expect(getBattleStatName(BattleStat.ATK)).toBe("pokemonInfo:Stat.ATK"); - expect(getBattleStatName(BattleStat.DEF)).toBe("pokemonInfo:Stat.DEF"); - expect(getBattleStatName(BattleStat.SPATK)).toBe( - "pokemonInfo:Stat.SPATK" - ); - expect(getBattleStatName(BattleStat.SPDEF)).toBe( - "pokemonInfo:Stat.SPDEF" - ); - expect(getBattleStatName(BattleStat.SPD)).toBe("pokemonInfo:Stat.SPD"); - expect(getBattleStatName(BattleStat.ACC)).toBe("pokemonInfo:Stat.ACC"); - expect(getBattleStatName(BattleStat.EVA)).toBe("pokemonInfo:Stat.EVA"); - }); - - it("should fall back to ??? for an unknown BattleStat", () => { - expect(getBattleStatName(TEST_BATTLE_STAT)).toBe("???"); - }); - }); - - describe("getBattleStatLevelChangeDescription", () => { - it("should return battle:statRose for +1", () => { - mockI18next(); - - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - 1, - true - ); - - expect(message).toBe("battle:statRose"); - }); - - it("should return battle:statSharplyRose for +2", () => { - mockI18next(); - - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - 2, - true - ); - - expect(message).toBe("battle:statSharplyRose"); - }); - - it("should return battle:statRoseDrastically for +3 to +6", () => { - mockI18next(); - - arrayOfRange(3, 6).forEach((n) => { - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - n, - true - ); - - expect(message).toBe("battle:statRoseDrastically"); - }); - }); - - it("should return battle:statWontGoAnyHigher for 7 or higher", () => { - mockI18next(); - - arrayOfRange(7, 10).forEach((n) => { - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - n, - true - ); - - expect(message).toBe("battle:statWontGoAnyHigher"); - }); - }); - - it("should return battle:statFell for -1", () => { - mockI18next(); - - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - 1, - false - ); - - expect(message).toBe("battle:statFell"); - }); - - it("should return battle:statHarshlyFell for -2", () => { - mockI18next(); - - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - 2, - false - ); - - expect(message).toBe("battle:statHarshlyFell"); - }); - - it("should return battle:statSeverelyFell for -3 to -6", () => { - mockI18next(); - - arrayOfRange(3, 6).forEach((n) => { - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - n, - false - ); - - expect(message).toBe("battle:statSeverelyFell"); - }); - }); - - it("should return battle:statWontGoAnyLower for -7 or lower", () => { - mockI18next(); - - arrayOfRange(7, 10).forEach((n) => { - const message = getBattleStatLevelChangeDescription( - TEST_POKEMON, - TEST_STAT, - n, - false - ); - - expect(message).toBe("battle:statWontGoAnyLower"); - }); - }); - }); -}); diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index be89fdeb2af..25dfbc765bd 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -1,5 +1,5 @@ import { allSpecies } from "#app/data/pokemon-species"; -import { TempBattleStat } from "#app/data/temp-battle-stat"; +import { Stat } from "#enums/stat"; import { GameModes, getGameMode } from "#app/game-mode"; import { BattleEndPhase } from "#app/phases/battle-end-phase"; import { CommandPhase } from "#app/phases/command-phase"; @@ -320,7 +320,7 @@ describe("Test Battle Phase", () => { .startingLevel(100) .moveset([moveToUse]) .enemyMoveset(SPLASH_ONLY) - .startingHeldItems([{ name: "TEMP_STAT_BOOSTER", type: TempBattleStat.ACC }]); + .startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]); await game.startBattle(); game.scene.getPlayerPokemon()!.hp = 1; diff --git a/src/test/battlerTags/octolock.test.ts b/src/test/battlerTags/octolock.test.ts index fa491589f09..7b1f9264370 100644 --- a/src/test/battlerTags/octolock.test.ts +++ b/src/test/battlerTags/octolock.test.ts @@ -1,16 +1,16 @@ import BattleScene from "#app/battle-scene"; -import { BattleStat } from "#app/data/battle-stat"; -import { BattlerTag, BattlerTagLapseType, OctolockTag, TrappedTag } from "#app/data/battler-tags"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import Pokemon from "#app/field/pokemon"; -import { StatChangePhase } from "#app/phases/stat-change-phase"; import { describe, expect, it, vi } from "vitest"; +import Pokemon from "#app/field/pokemon"; +import { BattlerTag, BattlerTagLapseType, OctolockTag, TrappedTag } from "#app/data/battler-tags"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; +import { BattlerTagType } from "#app/enums/battler-tag-type"; +import { Stat } from "#enums/stat"; vi.mock("#app/battle-scene.js"); describe("BattlerTag - OctolockTag", () => { describe("lapse behavior", () => { - it("unshifts a StatChangePhase with expected stat changes", { timeout: 10000 }, async () => { + it("unshifts a StatStageChangePhase with expected stat stage changes", { timeout: 10000 }, async () => { const mockPokemon = { scene: new BattleScene(), getBattlerIndex: () => 0, @@ -19,9 +19,9 @@ describe("BattlerTag - OctolockTag", () => { const subject = new OctolockTag(1); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementation(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(-1); - expect((phase as StatChangePhase)["stats"]).toEqual([BattleStat.DEF, BattleStat.SPDEF]); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(-1); + expect((phase as StatStageChangePhase)["stats"]).toEqual([ Stat.DEF, Stat.SPDEF ]); }); subject.lapse(mockPokemon, BattlerTagLapseType.TURN_END); diff --git a/src/test/battlerTags/stockpiling.test.ts b/src/test/battlerTags/stockpiling.test.ts index fef1e938c09..e568016dfef 100644 --- a/src/test/battlerTags/stockpiling.test.ts +++ b/src/test/battlerTags/stockpiling.test.ts @@ -1,10 +1,10 @@ import BattleScene from "#app/battle-scene"; -import { BattleStat } from "#app/data/battle-stat"; -import { StockpilingTag } from "#app/data/battler-tags"; -import Pokemon, { PokemonSummonData } from "#app/field/pokemon"; -import * as messages from "#app/messages"; -import { StatChangePhase } from "#app/phases/stat-change-phase"; import { beforeEach, describe, expect, it, vi } from "vitest"; +import Pokemon, { PokemonSummonData } from "#app/field/pokemon"; +import { StockpilingTag } from "#app/data/battler-tags"; +import { Stat } from "#enums/stat"; +import * as messages from "#app/messages"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; beforeEach(() => { vi.spyOn(messages, "getPokemonNameWithAffix").mockImplementation(() => ""); @@ -12,7 +12,7 @@ beforeEach(() => { describe("BattlerTag - StockpilingTag", () => { describe("onAdd", () => { - it("unshifts a StatChangePhase with expected stat changes on add", { timeout: 10000 }, async () => { + it("unshifts a StatStageChangePhase with expected stat stage changes on add", { timeout: 10000 }, async () => { const mockPokemon = { scene: vi.mocked(new BattleScene()) as BattleScene, getBattlerIndex: () => 0, @@ -23,11 +23,11 @@ describe("BattlerTag - StockpilingTag", () => { const subject = new StockpilingTag(1); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementation(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(1); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.DEF, BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(1); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([ Stat.DEF, Stat.SPDEF ])); - (phase as StatChangePhase)["onChange"]!(mockPokemon, [BattleStat.DEF, BattleStat.SPDEF], [1, 1]); + (phase as StatStageChangePhase)["onChange"]!(mockPokemon, [Stat.DEF, Stat.SPDEF], [1, 1]); }); subject.onAdd(mockPokemon); @@ -35,7 +35,7 @@ describe("BattlerTag - StockpilingTag", () => { expect(mockPokemon.scene.unshiftPhase).toBeCalledTimes(1); }); - it("unshifts a StatChangePhase with expected stat changes on add (one stat maxed)", { timeout: 10000 }, async () => { + it("unshifts a StatStageChangePhase with expected stat changes on add (one stat maxed)", { timeout: 10000 }, async () => { const mockPokemon = { scene: new BattleScene(), summonData: new PokemonSummonData(), @@ -44,17 +44,17 @@ describe("BattlerTag - StockpilingTag", () => { vi.spyOn(mockPokemon.scene, "queueMessage").mockImplementation(() => {}); - mockPokemon.summonData.battleStats[BattleStat.DEF] = 6; - mockPokemon.summonData.battleStats[BattleStat.SPDEF] = 5; + mockPokemon.summonData.statStages[Stat.DEF - 1] = 6; + mockPokemon.summonData.statStages[Stat.SPD - 1] = 5; const subject = new StockpilingTag(1); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementation(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(1); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.DEF, BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(1); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([Stat.DEF, Stat.SPDEF])); - (phase as StatChangePhase)["onChange"]!(mockPokemon, [BattleStat.DEF, BattleStat.SPDEF], [1, 1]); + (phase as StatStageChangePhase)["onChange"]!(mockPokemon, [ Stat.DEF, Stat.SPDEF ], [1, 1]); }); subject.onAdd(mockPokemon); @@ -64,7 +64,7 @@ describe("BattlerTag - StockpilingTag", () => { }); describe("onOverlap", () => { - it("unshifts a StatChangePhase with expected stat changes on overlap", { timeout: 10000 }, async () => { + it("unshifts a StatStageChangePhase with expected stat changes on overlap", { timeout: 10000 }, async () => { const mockPokemon = { scene: new BattleScene(), getBattlerIndex: () => 0, @@ -75,11 +75,11 @@ describe("BattlerTag - StockpilingTag", () => { const subject = new StockpilingTag(1); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementation(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(1); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.DEF, BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(1); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([ Stat.DEF, Stat.SPDEF ])); - (phase as StatChangePhase)["onChange"]!(mockPokemon, [BattleStat.DEF, BattleStat.SPDEF], [1, 1]); + (phase as StatStageChangePhase)["onChange"]!(mockPokemon, [ Stat.DEF, Stat.SPDEF ], [1, 1]); }); subject.onOverlap(mockPokemon); @@ -98,39 +98,39 @@ describe("BattlerTag - StockpilingTag", () => { vi.spyOn(mockPokemon.scene, "queueMessage").mockImplementation(() => {}); - mockPokemon.summonData.battleStats[BattleStat.DEF] = 5; - mockPokemon.summonData.battleStats[BattleStat.SPDEF] = 4; + mockPokemon.summonData.statStages[Stat.DEF - 1] = 5; + mockPokemon.summonData.statStages[Stat.SPD - 1] = 4; const subject = new StockpilingTag(1); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementationOnce(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(1); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.DEF, BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(1); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([ Stat.DEF, Stat.SPDEF ])); // def doesn't change - (phase as StatChangePhase)["onChange"]!(mockPokemon, [BattleStat.SPDEF], [1]); + (phase as StatStageChangePhase)["onChange"]!(mockPokemon, [ Stat.SPDEF ], [1]); }); subject.onAdd(mockPokemon); expect(subject.stockpiledCount).toBe(1); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementationOnce(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(1); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.DEF, BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(1); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([ Stat.DEF, Stat.SPDEF ])); // def doesn't change - (phase as StatChangePhase)["onChange"]!(mockPokemon, [BattleStat.SPDEF], [1]); + (phase as StatStageChangePhase)["onChange"]!(mockPokemon, [ Stat.SPDEF ], [1]); }); subject.onOverlap(mockPokemon); expect(subject.stockpiledCount).toBe(2); vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementationOnce(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(1); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.DEF, BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(1); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([ Stat.DEF, Stat.SPDEF ])); // neither stat changes, stack count should still increase }); @@ -138,20 +138,20 @@ describe("BattlerTag - StockpilingTag", () => { subject.onOverlap(mockPokemon); expect(subject.stockpiledCount).toBe(3); - vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementationOnce(phase => { + vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementationOnce(_phase => { throw new Error("Should not be called a fourth time"); }); // fourth stack should not be applied subject.onOverlap(mockPokemon); expect(subject.stockpiledCount).toBe(3); - expect(subject.statChangeCounts).toMatchObject({ [BattleStat.DEF]: 0, [BattleStat.SPDEF]: 2 }); + expect(subject.statChangeCounts).toMatchObject({ [ Stat.DEF ]: 0, [Stat.SPDEF]: 2 }); // removing tag should reverse stat changes vi.spyOn(mockPokemon.scene, "unshiftPhase").mockImplementationOnce(phase => { - expect(phase).toBeInstanceOf(StatChangePhase); - expect((phase as StatChangePhase)["levels"]).toEqual(-2); - expect((phase as StatChangePhase)["stats"]).toEqual(expect.arrayContaining([BattleStat.SPDEF])); + expect(phase).toBeInstanceOf(StatStageChangePhase); + expect((phase as StatStageChangePhase)["stages"]).toEqual(-2); + expect((phase as StatStageChangePhase)["stats"]).toEqual(expect.arrayContaining([Stat.SPDEF])); }); subject.onRemove(mockPokemon); diff --git a/src/test/boss-pokemon.test.ts b/src/test/boss-pokemon.test.ts new file mode 100644 index 00000000000..c6fc276551f --- /dev/null +++ b/src/test/boss-pokemon.test.ts @@ -0,0 +1,215 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import GameManager from "./utils/gameManager"; +import { Species } from "#app/enums/species"; +import { getPokemonSpecies } from "#app/data/pokemon-species"; +import { SPLASH_ONLY } from "./utils/testUtils"; +import { Abilities } from "#app/enums/abilities"; +import { Moves } from "#app/enums/moves"; +import { EFFECTIVE_STATS } from "#app/enums/stat"; +import { EnemyPokemon } from "#app/field/pokemon"; +import { toDmgValue } from "#app/utils"; + +describe("Boss Pokemon / Shields", () => { + const TIMEOUT = 20 * 1000; + + 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 + .battleType("single") + .disableTrainerWaves() + .disableCrits() + .enemySpecies(Species.RATTATA) + .enemyMoveset(SPLASH_ONLY) + .enemyHeldItems([]) + .startingLevel(1000) + .moveset([Moves.FALSE_SWIPE, Moves.SUPER_FANG, Moves.SPLASH]) + .ability(Abilities.NO_GUARD); + }); + + it("Pokemon should get shields based on their Species and level and the current wave", async () => { + let level = 50; + let wave = 5; + + // On normal waves, no shields... + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.RATTATA))).toBe(0); + // ... expect (sub)-legendary and mythical Pokemon who always get shields + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.MEW))).toBe(2); + // Pokemon with 670+ BST get an extra shield + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.MEWTWO))).toBe(3); + + // Every 10 waves will always be a boss Pokemon with shield(s) + wave = 50; + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.RATTATA))).toBe(2); + // Every extra 250 waves adds a shield + wave += 250; + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.RATTATA))).toBe(3); + wave += 750; + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.RATTATA))).toBe(6); + + // Pokemon above level 100 get an extra shield + level = 100; + expect(game.scene.getEncounterBossSegments(wave, level, getPokemonSpecies(Species.RATTATA))).toBe(7); + }, TIMEOUT); + + it("should reduce the number of shields if we are in a double battle", async () => { + game.override + .battleType("double") + .startingWave(150); // Floor 150 > 2 shields / 3 health segments + + await game.classicMode.startBattle([ Species.MEWTWO ]); + + const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]!; + const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]!; + expect(boss1.isBoss()).toBe(true); + expect(boss1.bossSegments).toBe(2); + expect(boss2.isBoss()).toBe(true); + expect(boss2.bossSegments).toBe(2); + }, TIMEOUT); + + it("shields should stop overflow damage and give stat stage boosts when broken", async () => { + game.override.startingWave(150); // Floor 150 > 2 shields / 3 health segments + + await game.classicMode.startBattle([ Species.MEWTWO ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + const segmentHp = enemyPokemon.getMaxHp() / enemyPokemon.bossSegments; + expect(enemyPokemon.isBoss()).toBe(true); + expect(enemyPokemon.bossSegments).toBe(3); + expect(getTotalStatStageBoosts(enemyPokemon)).toBe(0); + + game.move.select(Moves.SUPER_FANG); // Enough to break the first shield + await game.toNextTurn(); + + // Broke 1st of 2 shields, health at 2/3rd + expect(enemyPokemon.bossSegmentIndex).toBe(1); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - toDmgValue(segmentHp)); + // Breaking the shield gives a +1 boost to ATK, DEF, SP ATK, SP DEF or SPD + expect(getTotalStatStageBoosts(enemyPokemon)).toBe(1); + + game.move.select(Moves.FALSE_SWIPE); // Enough to break last shield but not kill + await game.toNextTurn(); + + expect(enemyPokemon.bossSegmentIndex).toBe(0); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - toDmgValue(2 * segmentHp)); + // Breaking the last shield gives a +2 boost to ATK, DEF, SP ATK, SP DEF or SPD + expect(getTotalStatStageBoosts(enemyPokemon)).toBe(3); + + }, TIMEOUT); + + it("breaking multiple shields at once requires extra damage", async () => { + game.override + .battleType("double") + .enemyHealthSegments(5); + + await game.classicMode.startBattle([ Species.MEWTWO ]); + + // In this test we want to break through 3 shields at once + const brokenShields = 3; + + const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]!; + const boss1SegmentHp = boss1.getMaxHp() / boss1.bossSegments; + const requiredDamageBoss1 = boss1SegmentHp * (1 + Math.pow(2, brokenShields)); + expect(boss1.isBoss()).toBe(true); + expect(boss1.bossSegments).toBe(5); + expect(boss1.bossSegmentIndex).toBe(4); + + // Not enough damage to break through all shields + boss1.damageAndUpdate(Math.floor(requiredDamageBoss1 - 5)); + expect(boss1.bossSegmentIndex).toBe(1); + expect(boss1.hp).toBe(boss1.getMaxHp() - toDmgValue(boss1SegmentHp * 3)); + + const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]!; + const boss2SegmentHp = boss2.getMaxHp() / boss2.bossSegments; + const requiredDamageBoss2 = boss2SegmentHp * (1 + Math.pow(2, brokenShields)); + + expect(boss2.isBoss()).toBe(true); + expect(boss2.bossSegments).toBe(5); + + // Enough damage to break through all shields + boss2.damageAndUpdate(Math.ceil(requiredDamageBoss2)); + expect(boss2.bossSegmentIndex).toBe(0); + expect(boss2.hp).toBe(boss2.getMaxHp() - toDmgValue(boss2SegmentHp * 4)); + + }, TIMEOUT); + + it("the number of stat stage boosts is consistent when several shields are broken at once", async () => { + const shieldsToBreak = 4; + + game.override + .battleType("double") + .enemyHealthSegments(shieldsToBreak + 1); + + await game.classicMode.startBattle([ Species.MEWTWO ]); + + const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]!; + const boss1SegmentHp = boss1.getMaxHp() / boss1.bossSegments; + const singleShieldDamage = Math.ceil(boss1SegmentHp); + expect(boss1.isBoss()).toBe(true); + expect(boss1.bossSegments).toBe(shieldsToBreak + 1); + expect(boss1.bossSegmentIndex).toBe(shieldsToBreak); + expect(getTotalStatStageBoosts(boss1)).toBe(0); + + + let totalStatStages = 0; + + // Break the shields one by one + for (let i = 1; i <= shieldsToBreak; i++) { + boss1.damageAndUpdate(singleShieldDamage); + expect(boss1.bossSegmentIndex).toBe(shieldsToBreak - i); + expect(boss1.hp).toBe(boss1.getMaxHp() - toDmgValue(boss1SegmentHp * i)); + // Do nothing and go to next turn so that the StatStageChangePhase gets applied + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + // All broken shields give +1 stat boost, except the last two that gives +2 + totalStatStages += i >= shieldsToBreak -1? 2 : 1; + expect(getTotalStatStageBoosts(boss1)).toBe(totalStatStages); + } + + const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]!; + const boss2SegmentHp = boss2.getMaxHp() / boss2.bossSegments; + const requiredDamage = boss2SegmentHp * (1 + Math.pow(2, shieldsToBreak - 1)); + + expect(boss2.isBoss()).toBe(true); + expect(boss2.bossSegments).toBe(shieldsToBreak + 1); + expect(boss2.bossSegmentIndex).toBe(shieldsToBreak); + expect(getTotalStatStageBoosts(boss2)).toBe(0); + + // Enough damage to break all shields at once + boss2.damageAndUpdate(Math.ceil(requiredDamage)); + expect(boss2.bossSegmentIndex).toBe(0); + expect(boss2.hp).toBe(boss2.getMaxHp() - toDmgValue(boss2SegmentHp * shieldsToBreak)); + // Do nothing and go to next turn so that the StatStageChangePhase gets applied + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + expect(getTotalStatStageBoosts(boss2)).toBe(totalStatStages); + + }, TIMEOUT); + + /** + * Gets the sum of the effective stat stage boosts for the given Pokemon + * @param enemyPokemon the pokemon to get stats from + * @returns the total stats boosts + */ + function getTotalStatStageBoosts(enemyPokemon: EnemyPokemon): number { + let boosts = 0; + for (const s of EFFECTIVE_STATS) { + boosts += enemyPokemon.getStatStage(s); + } + return boosts; + } +}); + diff --git a/src/test/eggs/egg.test.ts b/src/test/eggs/egg.test.ts index 28f1b7f0a6c..4f00e843b47 100644 --- a/src/test/eggs/egg.test.ts +++ b/src/test/eggs/egg.test.ts @@ -12,6 +12,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite describe("Egg Generation Tests", () => { let phaserGame: Phaser.Game; let game: GameManager; + const EGG_HATCH_COUNT: integer = 1000; beforeAll(() => { phaserGame = new Phaser.Game({ @@ -47,14 +48,21 @@ describe("Egg Generation Tests", () => { expect(result).toBe(expectedSpecies); }); - it("should hatch an Arceus. Set from legendary gacha", async () => { + it("should hatch an Arceus around half the time. Set from legendary gacha", async () => { const scene = game.scene; const timestamp = new Date(2024, 6, 10, 15, 0, 0, 0).getTime(); const expectedSpecies = Species.ARCEUS; + let gachaSpeciesCount = 0; - const result = new Egg({ scene, timestamp, sourceType: EggSourceType.GACHA_LEGENDARY, tier: EggTier.MASTER }).generatePlayerPokemon(scene).species.speciesId; + for (let i = 0; i < EGG_HATCH_COUNT; i++) { + const result = new Egg({ scene, timestamp, sourceType: EggSourceType.GACHA_LEGENDARY, tier: EggTier.MASTER }).generatePlayerPokemon(scene).species.speciesId; + if (result === expectedSpecies) { + gachaSpeciesCount++; + } + } - expect(result).toBe(expectedSpecies); + expect(gachaSpeciesCount).toBeGreaterThan(0.4 * EGG_HATCH_COUNT); + expect(gachaSpeciesCount).toBeLessThan(0.6 * EGG_HATCH_COUNT); }); it("should hatch an Arceus. Set from species", () => { const scene = game.scene; @@ -156,7 +164,7 @@ describe("Egg Generation Tests", () => { const scene = game.scene; const eggMoveIndex = new Egg({ scene }).eggMoveIndex; - const result = eggMoveIndex && eggMoveIndex >= 0 && eggMoveIndex <= 3; + const result = !Utils.isNullOrUndefined(eggMoveIndex) && eggMoveIndex >= 0 && eggMoveIndex <= 3; expect(result).toBe(true); }); @@ -309,4 +317,63 @@ describe("Egg Generation Tests", () => { expect(egg.variantTier).toBe(VariantTier.EPIC); }); + + it("should generate egg moves, species, shinyness, and ability unpredictably for the egg gacha", () => { + const scene = game.scene; + scene.setSeed("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + scene.resetSeed(); + + const firstEgg = new Egg({scene, sourceType: EggSourceType.GACHA_SHINY, tier: EggTier.COMMON}); + const firstHatch = firstEgg.generatePlayerPokemon(scene); + let diffEggMove = false; + let diffSpecies = false; + let diffShiny = false; + let diffAbility = false; + for (let i = 0; i < EGG_HATCH_COUNT; i++) { + scene.gameData.unlockPity[EggTier.COMMON] = 0; + scene.setSeed("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + scene.resetSeed(); // Make sure that eggs are unpredictable even if using same seed + + const newEgg = new Egg({scene, sourceType: EggSourceType.GACHA_SHINY, tier: EggTier.COMMON}); + const newHatch = newEgg.generatePlayerPokemon(scene); + diffEggMove = diffEggMove || (newEgg.eggMoveIndex !== firstEgg.eggMoveIndex); + diffSpecies = diffSpecies || (newHatch.species.speciesId !== firstHatch.species.speciesId); + diffShiny = diffShiny || (newHatch.shiny !== firstHatch.shiny); + diffAbility = diffAbility || (newHatch.abilityIndex !== firstHatch.abilityIndex); + } + + expect(diffEggMove).toBe(true); + expect(diffSpecies).toBe(true); + expect(diffShiny).toBe(true); + expect(diffAbility).toBe(true); + }); + + it("should generate egg moves, shinyness, and ability unpredictably for species eggs", () => { + const scene = game.scene; + scene.setSeed("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + scene.resetSeed(); + + const firstEgg = new Egg({scene, species: Species.BULBASAUR}); + const firstHatch = firstEgg.generatePlayerPokemon(scene); + let diffEggMove = false; + let diffSpecies = false; + let diffShiny = false; + let diffAbility = false; + for (let i = 0; i < EGG_HATCH_COUNT; i++) { + scene.setSeed("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + scene.resetSeed(); // Make sure that eggs are unpredictable even if using same seed + + const newEgg = new Egg({scene, species: Species.BULBASAUR}); + const newHatch = newEgg.generatePlayerPokemon(scene); + diffEggMove = diffEggMove || (newEgg.eggMoveIndex !== firstEgg.eggMoveIndex); + diffSpecies = diffSpecies || (newHatch.species.speciesId !== firstHatch.species.speciesId); + diffShiny = diffShiny || (newHatch.shiny !== firstHatch.shiny); + diffAbility = diffAbility || (newHatch.abilityIndex !== firstHatch.abilityIndex); + } + + expect(diffEggMove).toBe(true); + expect(diffSpecies).toBe(false); + expect(diffShiny).toBe(true); + expect(diffAbility).toBe(true); + }); }); diff --git a/src/test/escape-calculations.test.ts b/src/test/escape-calculations.test.ts new file mode 100644 index 00000000000..ecf22fc74aa --- /dev/null +++ b/src/test/escape-calculations.test.ts @@ -0,0 +1,303 @@ +import { AttemptRunPhase } from "#app/phases/attempt-run-phase"; +import { CommandPhase } from "#app/phases/command-phase"; +import { Command } from "#app/ui/command-ui-handler"; +import * as Utils from "#app/utils"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Escape chance calculations", () => { + 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 + .battleType("single") + .enemySpecies(Species.BULBASAUR) + .enemyAbility(Abilities.INSOMNIA) + .ability(Abilities.INSOMNIA); + }); + + it("single non-boss opponent", async () => { + await game.classicMode.startBattle([Species.BULBASAUR]); + + const playerPokemon = game.scene.getPlayerField(); + const enemyField = game.scene.getEnemyField(); + const enemySpeed = 100; + // set enemyPokemon's speed to 100 + vi.spyOn(enemyField[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, enemySpeed]); + + const commandPhase = game.scene.getCurrentPhase() as CommandPhase; + commandPhase.handleCommand(Command.RUN, 0); + + await game.phaseInterceptor.to(AttemptRunPhase, false); + const phase = game.scene.getCurrentPhase() as AttemptRunPhase; + const escapePercentage = new Utils.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, escapeAttempts: number, expectedEscapeChance: number }[] = [ + { pokemonSpeedRatio: 0.01, escapeAttempts: 0, expectedEscapeChance: 5 }, + { pokemonSpeedRatio: 0.1, escapeAttempts: 0, expectedEscapeChance: 7 }, + { pokemonSpeedRatio: 0.25, escapeAttempts: 0, expectedEscapeChance: 11 }, + { pokemonSpeedRatio: 0.5, escapeAttempts: 0, expectedEscapeChance: 16 }, + { pokemonSpeedRatio: 0.8, escapeAttempts: 0, expectedEscapeChance: 23 }, + { pokemonSpeedRatio: 1, escapeAttempts: 0, expectedEscapeChance: 28 }, + { pokemonSpeedRatio: 1.2, escapeAttempts: 0, expectedEscapeChance: 32 }, + { pokemonSpeedRatio: 1.5, escapeAttempts: 0, expectedEscapeChance: 39 }, + { pokemonSpeedRatio: 3, escapeAttempts: 0, expectedEscapeChance: 73 }, + { pokemonSpeedRatio: 3.8, escapeAttempts: 0, expectedEscapeChance: 91 }, + { pokemonSpeedRatio: 4, escapeAttempts: 0, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 4.2, escapeAttempts: 0, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 10, escapeAttempts: 0, expectedEscapeChance: 95 }, + + // retries section + { pokemonSpeedRatio: 0.4, escapeAttempts: 1, expectedEscapeChance: 24 }, + { pokemonSpeedRatio: 1.6, escapeAttempts: 2, expectedEscapeChance: 61 }, + { pokemonSpeedRatio: 3.7, escapeAttempts: 5, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 0.2, escapeAttempts: 2, expectedEscapeChance: 30 }, + { pokemonSpeedRatio: 1, escapeAttempts: 3, expectedEscapeChance: 58 }, + { pokemonSpeedRatio: 2.9, escapeAttempts: 0, expectedEscapeChance: 70 }, + { pokemonSpeedRatio: 0.01, escapeAttempts: 7, expectedEscapeChance: 75 }, + { pokemonSpeedRatio: 16.2, escapeAttempts: 4, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 2, escapeAttempts: 3, expectedEscapeChance: 80 }, + ]; + + for (let i = 0; i < escapeChances.length; i++) { + // sets the number of escape attempts to the required amount + game.scene.currentBattle.escapeAttempts = escapeChances[i].escapeAttempts; + // set playerPokemon's speed to a multiple of the enemySpeed + vi.spyOn(playerPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, escapeChances[i].pokemonSpeedRatio * enemySpeed]); + phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); + expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance); + } + }, 20000); + + it("double non-boss opponent", async () => { + game.override.battleType("double"); + await game.classicMode.startBattle([Species.BULBASAUR, Species.ABOMASNOW]); + + const playerPokemon = game.scene.getPlayerField(); + const enemyField = game.scene.getEnemyField(); + const enemyASpeed = 70; + const enemyBSpeed = 30; + // gets the sum of the speed of the two pokemon + const totalEnemySpeed = enemyASpeed + enemyBSpeed; + // this is used to find the ratio of the player's first pokemon + const playerASpeedPercentage = 0.4; + // set enemyAPokemon's speed to 70 + vi.spyOn(enemyField[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, enemyASpeed]); + // set enemyBPokemon's speed to 30 + vi.spyOn(enemyField[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, enemyBSpeed]); + + const commandPhase = game.scene.getCurrentPhase() as CommandPhase; + commandPhase.handleCommand(Command.RUN, 0); + + await game.phaseInterceptor.to(AttemptRunPhase, false); + const phase = game.scene.getCurrentPhase() as AttemptRunPhase; + const escapePercentage = new Utils.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, escapeAttempts: number, expectedEscapeChance: number }[] = [ + { pokemonSpeedRatio: 0.3, escapeAttempts: 0, expectedEscapeChance: 12 }, + { pokemonSpeedRatio: 0.7, escapeAttempts: 0, expectedEscapeChance: 21 }, + { pokemonSpeedRatio: 1.5, escapeAttempts: 0, expectedEscapeChance: 39 }, + { pokemonSpeedRatio: 3, escapeAttempts: 0, expectedEscapeChance: 73 }, + { pokemonSpeedRatio: 9, escapeAttempts: 0, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 0.01, escapeAttempts: 0, expectedEscapeChance: 5 }, + { pokemonSpeedRatio: 1, escapeAttempts: 0, expectedEscapeChance: 28 }, + { pokemonSpeedRatio: 4.3, escapeAttempts: 0, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 2.7, escapeAttempts: 0, expectedEscapeChance: 66 }, + { pokemonSpeedRatio: 2.1, escapeAttempts: 0, expectedEscapeChance: 52 }, + { pokemonSpeedRatio: 1.8, escapeAttempts: 0, expectedEscapeChance: 46 }, + { pokemonSpeedRatio: 6, escapeAttempts: 0, expectedEscapeChance: 95 }, + + // retries section + { pokemonSpeedRatio: 0.9, escapeAttempts: 1, expectedEscapeChance: 35 }, + { pokemonSpeedRatio: 3.6, escapeAttempts: 2, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 0.03, escapeAttempts: 7, expectedEscapeChance: 76 }, + { pokemonSpeedRatio: 0.02, escapeAttempts: 7, expectedEscapeChance: 75 }, + { pokemonSpeedRatio: 1, escapeAttempts: 5, expectedEscapeChance: 78 }, + { pokemonSpeedRatio: 0.7, escapeAttempts: 3, expectedEscapeChance: 51 }, + { pokemonSpeedRatio: 2.4, escapeAttempts: 9, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 1.8, escapeAttempts: 7, expectedEscapeChance: 95 }, + { pokemonSpeedRatio: 2, escapeAttempts: 10, expectedEscapeChance: 95 }, + + ]; + + for (let i = 0; i < escapeChances.length; i++) { + // sets the number of escape attempts to the required amount + game.scene.currentBattle.escapeAttempts = escapeChances[i].escapeAttempts; + // set the first playerPokemon's speed to a multiple of the enemySpeed + vi.spyOn(playerPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, Math.floor(escapeChances[i].pokemonSpeedRatio * totalEnemySpeed * playerASpeedPercentage)]); + // set the second playerPokemon's speed to the remaining value of speed + vi.spyOn(playerPokemon[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, escapeChances[i].pokemonSpeedRatio * totalEnemySpeed - playerPokemon[0].stats[5]]); + phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); + // checks to make sure the escape values are the same + expect(escapePercentage.value).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); + } + }, 20000); + + it("single boss opponent", async () => { + game.override.startingWave(10); + await game.classicMode.startBattle([Species.BULBASAUR]); + + const playerPokemon = game.scene.getPlayerField()!; + const enemyField = game.scene.getEnemyField()!; + const enemySpeed = 100; + // set enemyPokemon's speed to 100 + vi.spyOn(enemyField[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, enemySpeed]); + + const commandPhase = game.scene.getCurrentPhase() as CommandPhase; + commandPhase.handleCommand(Command.RUN, 0); + + await game.phaseInterceptor.to(AttemptRunPhase, false); + const phase = game.scene.getCurrentPhase() as AttemptRunPhase; + const escapePercentage = new Utils.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, escapeAttempts: number, expectedEscapeChance: number }[] = [ + { pokemonSpeedRatio: 0.01, escapeAttempts: 0, expectedEscapeChance: 5 }, + { pokemonSpeedRatio: 0.1, escapeAttempts: 0, expectedEscapeChance: 5 }, + { pokemonSpeedRatio: 0.25, escapeAttempts: 0, expectedEscapeChance: 6 }, + { pokemonSpeedRatio: 0.5, escapeAttempts: 0, expectedEscapeChance: 7 }, + { pokemonSpeedRatio: 0.8, escapeAttempts: 0, expectedEscapeChance: 8 }, + { pokemonSpeedRatio: 1, escapeAttempts: 0, expectedEscapeChance: 8 }, + { pokemonSpeedRatio: 1.2, escapeAttempts: 0, expectedEscapeChance: 9 }, + { pokemonSpeedRatio: 1.5, escapeAttempts: 0, expectedEscapeChance: 10 }, + { pokemonSpeedRatio: 3, escapeAttempts: 0, expectedEscapeChance: 15 }, + { pokemonSpeedRatio: 3.8, escapeAttempts: 0, expectedEscapeChance: 18 }, + { pokemonSpeedRatio: 4, escapeAttempts: 0, expectedEscapeChance: 18 }, + { pokemonSpeedRatio: 4.2, escapeAttempts: 0, expectedEscapeChance: 19 }, + { pokemonSpeedRatio: 4.7, escapeAttempts: 0, expectedEscapeChance: 21 }, + { pokemonSpeedRatio: 5, escapeAttempts: 0, expectedEscapeChance: 22 }, + { pokemonSpeedRatio: 5.9, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 6, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 6.7, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 10, escapeAttempts: 0, expectedEscapeChance: 25 }, + + // retries section + { pokemonSpeedRatio: 0.4, escapeAttempts: 1, expectedEscapeChance: 8 }, + { pokemonSpeedRatio: 1.6, escapeAttempts: 2, expectedEscapeChance: 14 }, + { pokemonSpeedRatio: 3.7, escapeAttempts: 5, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 0.2, escapeAttempts: 2, expectedEscapeChance: 10 }, + { pokemonSpeedRatio: 1, escapeAttempts: 3, expectedEscapeChance: 14 }, + { pokemonSpeedRatio: 2.9, escapeAttempts: 0, expectedEscapeChance: 15 }, + { pokemonSpeedRatio: 0.01, escapeAttempts: 7, expectedEscapeChance: 19 }, + { pokemonSpeedRatio: 16.2, escapeAttempts: 4, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 2, escapeAttempts: 3, expectedEscapeChance: 18 }, + { pokemonSpeedRatio: 4.5, escapeAttempts: 1, expectedEscapeChance: 22 }, + { pokemonSpeedRatio: 6.8, escapeAttempts: 6, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 5.2, escapeAttempts: 8, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 4.7, escapeAttempts: 10, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 5.1, escapeAttempts: 1, expectedEscapeChance: 24 }, + { pokemonSpeedRatio: 6, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 5.9, escapeAttempts: 2, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 6.1, escapeAttempts: 3, expectedEscapeChance: 25 }, + + ]; + + for (let i = 0; i < escapeChances.length; i++) { + // sets the number of escape attempts to the required amount + game.scene.currentBattle.escapeAttempts = escapeChances[i].escapeAttempts; + // set playerPokemon's speed to a multiple of the enemySpeed + vi.spyOn(playerPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, escapeChances[i].pokemonSpeedRatio * enemySpeed]); + phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); + expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance); + } + }, 20000); + + it("double boss opponent", async () => { + game.override.battleType("double"); + game.override.startingWave(10); + await game.classicMode.startBattle([Species.BULBASAUR, Species.ABOMASNOW]); + + const playerPokemon = game.scene.getPlayerField(); + const enemyField = game.scene.getEnemyField(); + const enemyASpeed = 70; + const enemyBSpeed = 30; + // gets the sum of the speed of the two pokemon + const totalEnemySpeed = enemyASpeed + enemyBSpeed; + // this is used to find the ratio of the player's first pokemon + const playerASpeedPercentage = 0.8; + // set enemyAPokemon's speed to 70 + vi.spyOn(enemyField[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, enemyASpeed]); + // set enemyBPokemon's speed to 30 + vi.spyOn(enemyField[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, enemyBSpeed]); + + const commandPhase = game.scene.getCurrentPhase() as CommandPhase; + commandPhase.handleCommand(Command.RUN, 0); + + await game.phaseInterceptor.to(AttemptRunPhase, false); + const phase = game.scene.getCurrentPhase() as AttemptRunPhase; + const escapePercentage = new Utils.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, escapeAttempts: number, expectedEscapeChance: number }[] = [ + { pokemonSpeedRatio: 0.3, escapeAttempts: 0, expectedEscapeChance: 6 }, + { pokemonSpeedRatio: 0.7, escapeAttempts: 0, expectedEscapeChance: 7 }, + { pokemonSpeedRatio: 1.5, escapeAttempts: 0, expectedEscapeChance: 10 }, + { pokemonSpeedRatio: 3, escapeAttempts: 0, expectedEscapeChance: 15 }, + { pokemonSpeedRatio: 9, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 0.01, escapeAttempts: 0, expectedEscapeChance: 5 }, + { pokemonSpeedRatio: 1, escapeAttempts: 0, expectedEscapeChance: 8 }, + { pokemonSpeedRatio: 4.3, escapeAttempts: 0, expectedEscapeChance: 19 }, + { pokemonSpeedRatio: 2.7, escapeAttempts: 0, expectedEscapeChance: 14 }, + { pokemonSpeedRatio: 2.1, escapeAttempts: 0, expectedEscapeChance: 12 }, + { pokemonSpeedRatio: 1.8, escapeAttempts: 0, expectedEscapeChance: 11 }, + { pokemonSpeedRatio: 6, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 4, escapeAttempts: 0, expectedEscapeChance: 18 }, + { pokemonSpeedRatio: 5.7, escapeAttempts: 0, expectedEscapeChance: 24 }, + { pokemonSpeedRatio: 5, escapeAttempts: 0, expectedEscapeChance: 22 }, + { pokemonSpeedRatio: 6.1, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 6.8, escapeAttempts: 0, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 10, escapeAttempts: 0, expectedEscapeChance: 25 }, + + // retries section + { pokemonSpeedRatio: 0.9, escapeAttempts: 1, expectedEscapeChance: 10 }, + { pokemonSpeedRatio: 3.6, escapeAttempts: 2, expectedEscapeChance: 21 }, + { pokemonSpeedRatio: 0.03, escapeAttempts: 7, expectedEscapeChance: 19 }, + { pokemonSpeedRatio: 0.02, escapeAttempts: 7, expectedEscapeChance: 19 }, + { pokemonSpeedRatio: 1, escapeAttempts: 5, expectedEscapeChance: 18 }, + { pokemonSpeedRatio: 0.7, escapeAttempts: 3, expectedEscapeChance: 13 }, + { pokemonSpeedRatio: 2.4, escapeAttempts: 9, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 1.8, escapeAttempts: 7, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 2, escapeAttempts: 10, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 3, escapeAttempts: 1, expectedEscapeChance: 17 }, + { pokemonSpeedRatio: 4.5, escapeAttempts: 3, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 3.7, escapeAttempts: 1, expectedEscapeChance: 19 }, + { pokemonSpeedRatio: 6.5, escapeAttempts: 1, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 12, escapeAttempts: 4, expectedEscapeChance: 25 }, + { pokemonSpeedRatio: 5.2, escapeAttempts: 2, expectedEscapeChance: 25 }, + + ]; + + for (let i = 0; i < escapeChances.length; i++) { + // sets the number of escape attempts to the required amount + game.scene.currentBattle.escapeAttempts = escapeChances[i].escapeAttempts; + // set the first playerPokemon's speed to a multiple of the enemySpeed + vi.spyOn(playerPokemon[0], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, Math.floor(escapeChances[i].pokemonSpeedRatio * totalEnemySpeed * playerASpeedPercentage)]); + // set the second playerPokemon's speed to the remaining value of speed + vi.spyOn(playerPokemon[1], "stats", "get").mockReturnValue([20, 20, 20, 20, 20, escapeChances[i].pokemonSpeedRatio * totalEnemySpeed - playerPokemon[0].stats[5]]); + phase.attemptRunAway(playerPokemon, enemyField, escapePercentage); + // checks to make sure the escape values are the same + expect(escapePercentage.value).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); + } + }, 20000); +}); diff --git a/src/test/evolution.test.ts b/src/test/evolution.test.ts index 5844e92ab8d..9f0806b8e24 100644 --- a/src/test/evolution.test.ts +++ b/src/test/evolution.test.ts @@ -79,12 +79,15 @@ describe("Evolution", () => { const nincada = game.scene.getPlayerPokemon()!; nincada.abilityIndex = 2; + nincada.metBiome = -1; nincada.evolve(pokemonEvolutions[Species.NINCADA][0], nincada.getSpeciesForm()); const ninjask = game.scene.getParty()[0]; const shedinja = game.scene.getParty()[1]; expect(ninjask.abilityIndex).toBe(2); expect(shedinja.abilityIndex).toBe(1); + // Regression test for https://github.com/pagefaultgames/pokerogue/issues/3842 + expect(shedinja.metBiome).toBe(-1); }, TIMEOUT); it("should set wild delay to NONE by default", () => { diff --git a/src/test/items/dire_hit.test.ts b/src/test/items/dire_hit.test.ts new file mode 100644 index 00000000000..02f7c0d06a4 --- /dev/null +++ b/src/test/items/dire_hit.test.ts @@ -0,0 +1,98 @@ +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phase from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; +import { BattleEndPhase } from "#app/phases/battle-end-phase"; +import { TempCritBoosterModifier } from "#app/modifier/modifier"; +import { Mode } from "#app/ui/ui"; +import 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"; + +describe("Items - Dire Hit", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phase.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + + game.override + .enemySpecies(Species.MAGIKARP) + .enemyMoveset(SPLASH_ONLY) + .moveset([ Moves.POUND ]) + .startingHeldItems([{ name: "DIRE_HIT" }]) + .battleType("single") + .disableCrits(); + + }, 20000); + + it("should raise CRIT stage by 1", async () => { + await game.startBattle([ + Species.GASTLY + ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + vi.spyOn(enemyPokemon, "getCritStage"); + + game.move.select(Moves.POUND); + + await game.phaseInterceptor.to(TurnEndPhase); + + expect(enemyPokemon.getCritStage).toHaveReturnedWith(1); + }, 20000); + + it("should renew how many battles are left of existing DIRE_HIT when picking up new DIRE_HIT", async() => { + game.override.itemRewards([{ name: "DIRE_HIT" }]); + + await game.startBattle([ + Species.PIKACHU + ]); + + game.move.select(Moves.SPLASH); + + await game.doKillOpponents(); + + await game.phaseInterceptor.to(BattleEndPhase); + + const modifier = game.scene.findModifier(m => m instanceof TempCritBoosterModifier) as TempCritBoosterModifier; + expect(modifier.getBattlesLeft()).toBe(4); + + // Forced DIRE_HIT to spawn in the first slot with override + game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => { + const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler; + // Traverse to first modifier slot + handler.setCursor(0); + handler.setRowCursor(ShopCursorTarget.REWARDS); + handler.processInput(Button.ACTION); + }, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(NewBattlePhase), true); + + await game.phaseInterceptor.to(TurnInitPhase); + + // Making sure only one booster is in the modifier list even after picking up another + let count = 0; + for (const m of game.scene.modifiers) { + if (m instanceof TempCritBoosterModifier) { + count++; + expect((m as TempCritBoosterModifier).getBattlesLeft()).toBe(5); + } + } + expect(count).toBe(1); + }, 20000); +}); diff --git a/src/test/items/eviolite.test.ts b/src/test/items/eviolite.test.ts index e491784acec..83b00583893 100644 --- a/src/test/items/eviolite.test.ts +++ b/src/test/items/eviolite.test.ts @@ -1,4 +1,4 @@ -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { EvolutionStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; @@ -37,29 +37,29 @@ describe("Items - Eviolite", () => { const partyMember = game.scene.getParty()[0]; - // Checking consoe log to make sure Eviolite is applied when getBattleStat (with the appropriate stat) is called - partyMember.getBattleStat(Stat.DEF); + // Checking console log to make sure Eviolite is applied when getEffectiveStat (with the appropriate stat) is called + partyMember.getEffectiveStat(Stat.DEF); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:ModifierType.EVIOLITE.name"), ""); // Printing dummy console messages along the way so subsequent checks don't pass because of the first console.log(""); - partyMember.getBattleStat(Stat.SPDEF); + partyMember.getEffectiveStat(Stat.SPDEF); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:ModifierType.EVIOLITE.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.ATK); + partyMember.getEffectiveStat(Stat.ATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:ModifierType.EVIOLITE.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPATK); + partyMember.getEffectiveStat(Stat.SPATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:ModifierType.EVIOLITE.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPD); + partyMember.getEffectiveStat(Stat.SPD); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:ModifierType.EVIOLITE.name"), ""); }); diff --git a/src/test/items/leek.test.ts b/src/test/items/leek.test.ts index 7505b6374a0..af20516ef83 100644 --- a/src/test/items/leek.test.ts +++ b/src/test/items/leek.test.ts @@ -1,7 +1,4 @@ -import { BattlerIndex } from "#app/battle"; -import { CritBoosterModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/modifier/modifier-type"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; import * as Utils from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -26,91 +23,64 @@ describe("Items - Leek", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override.enemySpecies(Species.MAGIKARP); - game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - game.override.disableCrits(); - - game.override.battleType("single"); + game.override + .enemySpecies(Species.MAGIKARP) + .enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]) + .startingHeldItems([{ name: "LEEK" }]) + .moveset([ Moves.TACKLE ]) + .disableCrits() + .battleType("single"); }); - it("LEEK activates in battle correctly", async () => { - game.override.startingHeldItems([{ name: "LEEK" }]); - game.override.moveset([Moves.POUND]); - const consoleSpy = vi.spyOn(console, "log"); + it("should raise CRIT stage by 2 when held by FARFETCHD", async () => { await game.startBattle([ Species.FARFETCHD ]); - game.move.select(Moves.POUND); + const enemyMember = game.scene.getEnemyPokemon()!; - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + vi.spyOn(enemyMember, "getCritStage"); - await game.phaseInterceptor.to(MoveEffectPhase); + game.move.select(Moves.TACKLE); - expect(consoleSpy).toHaveBeenCalledWith("Applied", "Leek", ""); + await game.phaseInterceptor.to(TurnEndPhase); + + expect(enemyMember.getCritStage).toHaveReturnedWith(2); }, 20000); - it("LEEK held by FARFETCHD", async () => { - await game.startBattle([ - Species.FARFETCHD - ]); - - const partyMember = game.scene.getPlayerPokemon()!; - - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); - - expect(critLevel.value).toBe(0); - - // Giving Leek to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.LEEK().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); - - expect(critLevel.value).toBe(2); - }, 20000); - - it("LEEK held by GALAR_FARFETCHD", async () => { + it("should raise CRIT stage by 2 when held by GALAR_FARFETCHD", async () => { await game.startBattle([ Species.GALAR_FARFETCHD ]); - const partyMember = game.scene.getPlayerPokemon()!; + const enemyMember = game.scene.getEnemyPokemon()!; - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + vi.spyOn(enemyMember, "getCritStage"); - expect(critLevel.value).toBe(0); + game.move.select(Moves.TACKLE); - // Giving Leek to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.LEEK().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + await game.phaseInterceptor.to(TurnEndPhase); - expect(critLevel.value).toBe(2); + expect(enemyMember.getCritStage).toHaveReturnedWith(2); }, 20000); - it("LEEK held by SIRFETCHD", async () => { + it("should raise CRIT stage by 2 when held by SIRFETCHD", async () => { await game.startBattle([ Species.SIRFETCHD ]); - const partyMember = game.scene.getPlayerPokemon()!; + const enemyMember = game.scene.getEnemyPokemon()!; - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + vi.spyOn(enemyMember, "getCritStage"); - expect(critLevel.value).toBe(0); + game.move.select(Moves.TACKLE); - // Giving Leek to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.LEEK().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + await game.phaseInterceptor.to(TurnEndPhase); - expect(critLevel.value).toBe(2); + expect(enemyMember.getCritStage).toHaveReturnedWith(2); }, 20000); - it("LEEK held by fused FARFETCHD line (base)", async () => { + it("should raise CRIT stage by 2 when held by FARFETCHD line fused with Pokemon", async () => { // Randomly choose from the Farfetch'd line const species = [Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD]; @@ -119,9 +89,7 @@ describe("Items - Leek", () => { Species.PIKACHU, ]); - const party = game.scene.getParty(); - const partyMember = party[0]; - const ally = party[1]; + const [ partyMember, ally ] = game.scene.getParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; @@ -132,20 +100,18 @@ describe("Items - Leek", () => { partyMember.fusionGender = ally.gender; partyMember.fusionLuck = ally.luck; - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + const enemyMember = game.scene.getEnemyPokemon()!; - expect(critLevel.value).toBe(0); + vi.spyOn(enemyMember, "getCritStage"); - // Giving Leek to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.LEEK().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + game.move.select(Moves.TACKLE); - expect(critLevel.value).toBe(2); + await game.phaseInterceptor.to(TurnEndPhase); + + expect(enemyMember.getCritStage).toHaveReturnedWith(2); }, 20000); - it("LEEK held by fused FARFETCHD line (part)", async () => { + it("should raise CRIT stage by 2 when held by Pokemon fused with FARFETCHD line", async () => { // Randomly choose from the Farfetch'd line const species = [Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD]; @@ -154,9 +120,7 @@ describe("Items - Leek", () => { species[Utils.randInt(species.length)] ]); - const party = game.scene.getParty(); - const partyMember = party[0]; - const ally = party[1]; + const [ partyMember, ally ] = game.scene.getParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; @@ -167,36 +131,31 @@ describe("Items - Leek", () => { partyMember.fusionGender = ally.gender; partyMember.fusionLuck = ally.luck; - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); - expect(critLevel.value).toBe(0); + const enemyMember = game.scene.getEnemyPokemon()!; - // Giving Leek to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.LEEK().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + vi.spyOn(enemyMember, "getCritStage"); - expect(critLevel.value).toBe(2); + game.move.select(Moves.TACKLE); + + await game.phaseInterceptor.to(TurnEndPhase); + + expect(enemyMember.getCritStage).toHaveReturnedWith(2); }, 20000); - it("LEEK not held by FARFETCHD line", async () => { + it("should not raise CRIT stage when held by a Pokemon outside of FARFETCHD line", async () => { await game.startBattle([ Species.PIKACHU ]); - const partyMember = game.scene.getPlayerPokemon()!; + const enemyMember = game.scene.getEnemyPokemon()!; - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + vi.spyOn(enemyMember, "getCritStage"); - expect(critLevel.value).toBe(0); + game.move.select(Moves.TACKLE); - // Giving Leek to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.LEEK().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); + await game.phaseInterceptor.to(TurnEndPhase); - expect(critLevel.value).toBe(0); + expect(enemyMember.getCritStage).toHaveReturnedWith(0); }, 20000); }); diff --git a/src/test/items/light_ball.test.ts b/src/test/items/light_ball.test.ts index cf4f5c9e22f..673348e7b7a 100644 --- a/src/test/items/light_ball.test.ts +++ b/src/test/items/light_ball.test.ts @@ -1,4 +1,4 @@ -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; @@ -37,29 +37,29 @@ describe("Items - Light Ball", () => { const partyMember = game.scene.getParty()[0]; - // Checking consoe log to make sure Light Ball is applied when getBattleStat (with the appropriate stat) is called - partyMember.getBattleStat(Stat.DEF); + // Checking console log to make sure Light Ball is applied when getEffectiveStat (with the appropriate stat) is called + partyMember.getEffectiveStat(Stat.DEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.LIGHT_BALL.name"), ""); // Printing dummy console messages along the way so subsequent checks don't pass because of the first console.log(""); - partyMember.getBattleStat(Stat.SPDEF); + partyMember.getEffectiveStat(Stat.SPDEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.LIGHT_BALL.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.ATK); + partyMember.getEffectiveStat(Stat.ATK); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.LIGHT_BALL.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPATK); + partyMember.getEffectiveStat(Stat.SPATK); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.LIGHT_BALL.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPD); + partyMember.getEffectiveStat(Stat.SPD); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.LIGHT_BALL.name"), ""); }); diff --git a/src/test/items/metal_powder.test.ts b/src/test/items/metal_powder.test.ts index a3a4936532f..0206fd1f471 100644 --- a/src/test/items/metal_powder.test.ts +++ b/src/test/items/metal_powder.test.ts @@ -1,4 +1,4 @@ -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; @@ -37,29 +37,29 @@ describe("Items - Metal Powder", () => { const partyMember = game.scene.getParty()[0]; - // Checking consoe log to make sure Metal Powder is applied when getBattleStat (with the appropriate stat) is called - partyMember.getBattleStat(Stat.DEF); + // Checking console log to make sure Metal Powder is applied when getEffectiveStat (with the appropriate stat) is called + partyMember.getEffectiveStat(Stat.DEF); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.METAL_POWDER.name"), ""); // Printing dummy console messages along the way so subsequent checks don't pass because of the first console.log(""); - partyMember.getBattleStat(Stat.SPDEF); + partyMember.getEffectiveStat(Stat.SPDEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.METAL_POWDER.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.ATK); + partyMember.getEffectiveStat(Stat.ATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.METAL_POWDER.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPATK); + partyMember.getEffectiveStat(Stat.SPATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.METAL_POWDER.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPD); + partyMember.getEffectiveStat(Stat.SPD); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.METAL_POWDER.name"), ""); }); diff --git a/src/test/items/quick_powder.test.ts b/src/test/items/quick_powder.test.ts index 53521ba78f1..344b772feb4 100644 --- a/src/test/items/quick_powder.test.ts +++ b/src/test/items/quick_powder.test.ts @@ -1,4 +1,4 @@ -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; @@ -37,29 +37,29 @@ describe("Items - Quick Powder", () => { const partyMember = game.scene.getParty()[0]; - // Checking consoe log to make sure Quick Powder is applied when getBattleStat (with the appropriate stat) is called - partyMember.getBattleStat(Stat.DEF); + // Checking console log to make sure Quick Powder is applied when getEffectiveStat (with the appropriate stat) is called + partyMember.getEffectiveStat(Stat.DEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), ""); // Printing dummy console messages along the way so subsequent checks don't pass because of the first console.log(""); - partyMember.getBattleStat(Stat.SPDEF); + partyMember.getEffectiveStat(Stat.SPDEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.ATK); + partyMember.getEffectiveStat(Stat.ATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPATK); + partyMember.getEffectiveStat(Stat.SPATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPD); + partyMember.getEffectiveStat(Stat.SPD); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), ""); }); diff --git a/src/test/items/scope_lens.test.ts b/src/test/items/scope_lens.test.ts index 85673218762..c8629093ab5 100644 --- a/src/test/items/scope_lens.test.ts +++ b/src/test/items/scope_lens.test.ts @@ -1,13 +1,10 @@ -import { BattlerIndex } from "#app/battle"; -import { CritBoosterModifier } from "#app/modifier/modifier"; -import { modifierTypes } from "#app/modifier/modifier-type"; -import { MoveEffectPhase } from "#app/phases/move-effect-phase"; -import * as Utils from "#app/utils"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; import Phase from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; describe("Items - Scope Lens", () => { let phaserGame: Phaser.Game; @@ -26,47 +23,29 @@ describe("Items - Scope Lens", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override.enemySpecies(Species.MAGIKARP); - game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); - game.override.disableCrits(); + game.override + .enemySpecies(Species.MAGIKARP) + .enemyMoveset(SPLASH_ONLY) + .moveset([ Moves.POUND ]) + .startingHeldItems([{ name: "SCOPE_LENS" }]) + .battleType("single") + .disableCrits(); - game.override.battleType("single"); }, 20000); - it("SCOPE_LENS activates in battle correctly", async () => { - game.override.startingHeldItems([{ name: "SCOPE_LENS" }]); - game.override.moveset([Moves.POUND]); - const consoleSpy = vi.spyOn(console, "log"); + it("should raise CRIT stage by 1", async () => { await game.startBattle([ Species.GASTLY ]); + const enemyPokemon = game.scene.getEnemyPokemon()!; + + vi.spyOn(enemyPokemon, "getCritStage"); + game.move.select(Moves.POUND); - await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to(TurnEndPhase); - await game.phaseInterceptor.to(MoveEffectPhase); - - expect(consoleSpy).toHaveBeenCalledWith("Applied", "Scope Lens", ""); - }, 20000); - - it("SCOPE_LENS held by random pokemon", async () => { - await game.startBattle([ - Species.GASTLY - ]); - - const partyMember = game.scene.getPlayerPokemon()!; - - // Making sure modifier is not applied without holding item - const critLevel = new Utils.IntegerHolder(0); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); - - expect(critLevel.value).toBe(0); - - // Giving Scope Lens to party member and testing if it applies - partyMember.scene.addModifier(modifierTypes.SCOPE_LENS().newModifier(partyMember), true); - partyMember.scene.applyModifiers(CritBoosterModifier, true, partyMember, critLevel); - - expect(critLevel.value).toBe(1); + expect(enemyPokemon.getCritStage).toHaveReturnedWith(1); }, 20000); }); diff --git a/src/test/items/temp_stat_stage_booster.test.ts b/src/test/items/temp_stat_stage_booster.test.ts new file mode 100644 index 00000000000..c81703220db --- /dev/null +++ b/src/test/items/temp_stat_stage_booster.test.ts @@ -0,0 +1,175 @@ +import { BATTLE_STATS, Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; +import { Species } from "#enums/species"; +import Phase from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { Moves } from "#app/enums/moves"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { SPLASH_ONLY } from "../utils/testUtils"; +import { Abilities } from "#app/enums/abilities"; +import { TempStatStageBoosterModifier } from "#app/modifier/modifier"; +import { Mode } from "#app/ui/ui"; +import { Button } from "#app/enums/buttons"; +import { CommandPhase } from "#app/phases/command-phase"; +import { NewBattlePhase } from "#app/phases/new-battle-phase"; +import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { BattleEndPhase } from "#app/phases/battle-end-phase"; +import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; +import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; + + +describe("Items - Temporary Stat Stage Boosters", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phase.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + + game.override + .battleType("single") + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(SPLASH_ONLY) + .enemyAbility(Abilities.BALL_FETCH) + .moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ]) + .startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]); + }); + + it("should provide a x1.3 stat stage multiplier", async() => { + await game.startBattle([ + Species.PIKACHU + ]); + + const partyMember = game.scene.getPlayerPokemon()!; + + vi.spyOn(partyMember, "getStatStageMultiplier"); + + game.move.select(Moves.TACKLE); + + await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnEndPhase); + + expect(partyMember.getStatStageMultiplier).toHaveReturnedWith(1.3); + }, 20000); + + it("should increase existing ACC stat stage by 1 for X_ACCURACY only", async() => { + game.override + .startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]) + .ability(Abilities.SIMPLE); + + await game.startBattle([ + Species.PIKACHU + ]); + + const partyMember = game.scene.getPlayerPokemon()!; + + vi.spyOn(partyMember, "getAccuracyMultiplier"); + + // Raise ACC by +2 stat stages + game.move.select(Moves.HONE_CLAWS); + + await game.phaseInterceptor.to(TurnEndPhase); + + game.move.select(Moves.TACKLE); + + await game.phaseInterceptor.to(TurnEndPhase); + + // ACC at +3 stat stages yields a x2 multiplier + expect(partyMember.getAccuracyMultiplier).toHaveReturnedWith(2); + }, 20000); + + + it("should increase existing stat stage multiplier by 3/10 for the rest of the boosters", async() => { + await game.startBattle([ + Species.PIKACHU + ]); + + const partyMember = game.scene.getPlayerPokemon()!; + + vi.spyOn(partyMember, "getStatStageMultiplier"); + + // Raise ATK by +1 stat stage + game.move.select(Moves.HONE_CLAWS); + + await game.phaseInterceptor.to(TurnEndPhase); + + game.move.select(Moves.TACKLE); + + await game.phaseInterceptor.to(TurnEndPhase); + + // ATK at +1 stat stage yields a x1.5 multiplier, add 0.3 from X_ATTACK + expect(partyMember.getStatStageMultiplier).toHaveReturnedWith(1.8); + }, 20000); + + it("should not increase past maximum stat stage multiplier", async() => { + game.override.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }, { name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]); + + await game.startBattle([ + Species.PIKACHU + ]); + + const partyMember = game.scene.getPlayerPokemon()!; + + vi.spyOn(partyMember, "getStatStageMultiplier"); + vi.spyOn(partyMember, "getAccuracyMultiplier"); + + // Set all stat stages to 6 + vi.spyOn(partyMember.summonData, "statStages", "get").mockReturnValue(new Array(BATTLE_STATS.length).fill(6)); + + game.move.select(Moves.TACKLE); + + await game.phaseInterceptor.to(TurnEndPhase); + + expect(partyMember.getAccuracyMultiplier).toHaveReturnedWith(3); + expect(partyMember.getStatStageMultiplier).toHaveReturnedWith(4); + }, 20000); + + it("should renew how many battles are left of existing booster when picking up new booster of same type", async() => { + game.override + .startingLevel(200) + .itemRewards([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]); + + await game.startBattle([ + Species.PIKACHU + ]); + + game.move.select(Moves.SPLASH); + + await game.doKillOpponents(); + + await game.phaseInterceptor.to(BattleEndPhase); + + const modifier = game.scene.findModifier(m => m instanceof TempStatStageBoosterModifier) as TempStatStageBoosterModifier; + expect(modifier.getBattlesLeft()).toBe(4); + + // Forced X_ATTACK to spawn in the first slot with override + game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => { + const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler; + // Traverse to first modifier slot + handler.setCursor(0); + handler.setRowCursor(ShopCursorTarget.REWARDS); + handler.processInput(Button.ACTION); + }, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(NewBattlePhase), true); + + await game.phaseInterceptor.to(TurnInitPhase); + + // Making sure only one booster is in the modifier list even after picking up another + let count = 0; + for (const m of game.scene.modifiers) { + if (m instanceof TempStatStageBoosterModifier) { + count++; + expect((m as TempStatStageBoosterModifier).getBattlesLeft()).toBe(5); + } + } + expect(count).toBe(1); + }, 20000); +}); diff --git a/src/test/items/thick_club.test.ts b/src/test/items/thick_club.test.ts index 347921446e6..bcb6b371264 100644 --- a/src/test/items/thick_club.test.ts +++ b/src/test/items/thick_club.test.ts @@ -1,4 +1,4 @@ -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { SpeciesStatBoosterModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import i18next from "#app/plugins/i18n"; @@ -37,29 +37,29 @@ describe("Items - Thick Club", () => { const partyMember = game.scene.getParty()[0]; - // Checking consoe log to make sure Thick Club is applied when getBattleStat (with the appropriate stat) is called - partyMember.getBattleStat(Stat.DEF); + // Checking console log to make sure Thick Club is applied when getEffectiveStat (with the appropriate stat) is called + partyMember.getEffectiveStat(Stat.DEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), ""); // Printing dummy console messages along the way so subsequent checks don't pass because of the first console.log(""); - partyMember.getBattleStat(Stat.SPDEF); + partyMember.getEffectiveStat(Stat.SPDEF); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.ATK); + partyMember.getEffectiveStat(Stat.ATK); expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPATK); + partyMember.getEffectiveStat(Stat.SPATK); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), ""); console.log(""); - partyMember.getBattleStat(Stat.SPD); + partyMember.getEffectiveStat(Stat.SPD); expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), ""); }); diff --git a/src/test/localization/battle-stat.test.ts b/src/test/localization/battle-stat.test.ts deleted file mode 100644 index b5ba698c4b6..00000000000 --- a/src/test/localization/battle-stat.test.ts +++ /dev/null @@ -1,217 +0,0 @@ -import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "#app/data/battle-stat"; -import deBattleStat from "#app/locales/de/battle.json"; -import dePokemonInfo from "#app/locales/de/pokemon-info.json"; -import enBattleStat from "#app/locales/en/battle.json"; -import enPokemonInfo from "#app/locales/en/pokemon-info.json"; -import esBattleStat from "#app/locales/es/battle.json"; -import esPokemonInfo from "#app/locales/es/pokemon-info.json"; -import frBattleStat from "#app/locales/fr/battle.json"; -import frPokemonInfo from "#app/locales/fr/pokemon-info.json"; -import itBattleStat from "#app/locales/it/battle.json"; -import itPokemonInfo from "#app/locales/it/pokemon-info.json"; -import koBattleStat from "#app/locales/ko/battle.json"; -import koPokemonInfo from "#app/locales/ko/pokemon-info.json"; -import ptBrBattleStat from "#app/locales/pt_BR/battle.json"; -import ptBrPokemonInfo from "#app/locales/pt_BR/pokemon-info.json"; -import zhCnBattleStat from "#app/locales/zh_CN/battle.json"; -import zhCnPokemonInfo from "#app/locales/zh_CN/pokemon-info.json"; -import zhTwBattleStat from "#app/locales/zh_TW/battle.json"; -import zhTwPokemonInfo from "#app/locales/zh_TW/pokemon-info.json"; -import i18next, { initI18n } from "#app/plugins/i18n"; -import { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor"; -import { beforeAll, describe, expect, it } from "vitest"; - -interface BattleStatTestUnit { - stat: BattleStat, - key: string -} - -interface BattleStatLevelTestUnit { - levels: integer, - up: boolean, - key: string - changedStats: integer -} - -function testBattleStatName(stat: BattleStat, expectMessage: string) { - if (!expectMessage) { - return; - } // not translated yet! - const message = getBattleStatName(stat); - console.log(`message ${message}, expected ${expectMessage}`); - expect(message).toBe(expectMessage); -} - -function testBattleStatLevelChangeDescription(levels: integer, up: boolean, expectMessage: string, changedStats: integer) { - if (!expectMessage) { - return; - } // not translated yet! - const message = getBattleStatLevelChangeDescription("{{pokemonNameWithAffix}}", "{{stats}}", levels, up, changedStats); - console.log(`message ${message}, expected ${expectMessage}`); - expect(message).toBe(expectMessage); -} - -describe("Test for BattleStat Localization", () => { - const battleStatUnits: BattleStatTestUnit[] = []; - const battleStatLevelUnits: BattleStatLevelTestUnit[] = []; - - beforeAll(() => { - initI18n(); - - battleStatUnits.push({stat: BattleStat.ATK, key: "Stat.ATK"}); - battleStatUnits.push({stat: BattleStat.DEF, key: "Stat.DEF"}); - battleStatUnits.push({stat: BattleStat.SPATK, key: "Stat.SPATK"}); - battleStatUnits.push({stat: BattleStat.SPDEF, key: "Stat.SPDEF"}); - battleStatUnits.push({stat: BattleStat.SPD, key: "Stat.SPD"}); - battleStatUnits.push({stat: BattleStat.ACC, key: "Stat.ACC"}); - battleStatUnits.push({stat: BattleStat.EVA, key: "Stat.EVA"}); - - battleStatLevelUnits.push({levels: 1, up: true, key: "statRose_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 2, up: true, key: "statSharplyRose_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 3, up: true, key: "statRoseDrastically_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 4, up: true, key: "statRoseDrastically_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 5, up: true, key: "statRoseDrastically_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 6, up: true, key: "statRoseDrastically_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 7, up: true, key: "statWontGoAnyHigher_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 1, up: false, key: "statFell_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 2, up: false, key: "statHarshlyFell_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 3, up: false, key: "statSeverelyFell_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 4, up: false, key: "statSeverelyFell_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 5, up: false, key: "statSeverelyFell_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 6, up: false, key: "statSeverelyFell_one", changedStats: 1}); - battleStatLevelUnits.push({levels: 7, up: false, key: "statWontGoAnyLower_one", changedStats: 1}); - }); - - it("Test getBattleStatName() in English", async () => { - i18next.changeLanguage("en"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, enPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in English", async () => { - i18next.changeLanguage("en"); - battleStatLevelUnits.forEach(unit => { - testBattleStatLevelChangeDescription(unit.levels, unit.up, enBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in Español", async () => { - i18next.changeLanguage("es"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, esPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in Español", async () => { - i18next.changeLanguage("es"); - battleStatLevelUnits.forEach(unit => { - testBattleStatLevelChangeDescription(unit.levels, unit.up, esBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in Italiano", async () => { - i18next.changeLanguage("it"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, itPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in Italiano", async () => { - i18next.changeLanguage("it"); - battleStatLevelUnits.forEach(unit => { - testBattleStatLevelChangeDescription(unit.levels, unit.up, itBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in Français", async () => { - i18next.changeLanguage("fr"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, frPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in Français", async () => { - i18next.changeLanguage("fr"); - battleStatLevelUnits.forEach(unit => { - testBattleStatLevelChangeDescription(unit.levels, unit.up, frBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in Deutsch", async () => { - i18next.changeLanguage("de"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, dePokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in Deutsch", async () => { - i18next.changeLanguage("de"); - battleStatLevelUnits.forEach(unit => { - testBattleStatLevelChangeDescription(unit.levels, unit.up, deBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in Português (BR)", async () => { - i18next.changeLanguage("pt-BR"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, ptBrPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in Português (BR)", async () => { - i18next.changeLanguage("pt-BR"); - battleStatLevelUnits.forEach(unit => { - testBattleStatLevelChangeDescription(unit.levels, unit.up, ptBrBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in 简体中文", async () => { - i18next.changeLanguage("zh-CN"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, zhCnPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in 简体中文", async () => { - i18next.changeLanguage("zh-CN"); - battleStatLevelUnits.forEach(unit => { - // In i18next, the pluralization rules are language-specific, and Chinese only supports the _other suffix. - unit.key = unit.key.replace("one", "other"); - testBattleStatLevelChangeDescription(unit.levels, unit.up, zhCnBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in 繁體中文", async () => { - i18next.changeLanguage("zh-TW"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, zhTwPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in 繁體中文", async () => { - i18next.changeLanguage("zh-TW"); - battleStatLevelUnits.forEach(unit => { - // In i18next, the pluralization rules are language-specific, and Chinese only supports the _other suffix. - unit.key = unit.key.replace("one", "other"); - testBattleStatLevelChangeDescription(unit.levels, unit.up, zhTwBattleStat[unit.key], unit.changedStats); - }); - }); - - it("Test getBattleStatName() in 한국어", async () => { - await i18next.changeLanguage("ko"); - battleStatUnits.forEach(unit => { - testBattleStatName(unit.stat, koPokemonInfo[unit.key.split(".")[0]][unit.key.split(".")[1]]); - }); - }); - - it("Test getBattleStatLevelChangeDescription() in 한국어", async () => { - i18next.changeLanguage("ko", () => { - battleStatLevelUnits.forEach(unit => { - const processor = new KoreanPostpositionProcessor(); - const message = processor.process(koBattleStat[unit.key]); - testBattleStatLevelChangeDescription(unit.levels, unit.up, message, unit.changedStats); - }); - }); - }); -}); diff --git a/src/test/moves/alluring_voice.test.ts b/src/test/moves/alluring_voice.test.ts index e6ece39524a..9807d1bce85 100644 --- a/src/test/moves/alluring_voice.test.ts +++ b/src/test/moves/alluring_voice.test.ts @@ -40,7 +40,7 @@ describe("Moves - Alluring Voice", () => { }); - it("should confuse the opponent if their stats were raised", async () => { + it("should confuse the opponent if their stat stages were raised", async () => { await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; diff --git a/src/test/moves/baton_pass.test.ts b/src/test/moves/baton_pass.test.ts index 602da9e37f8..1a4edafdd36 100644 --- a/src/test/moves/baton_pass.test.ts +++ b/src/test/moves/baton_pass.test.ts @@ -1,13 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { PostSummonPhase } from "#app/phases/post-summon-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { BattlerIndex } from "#app/battle"; import GameManager from "#app/test/utils/gameManager"; +import { Abilities } from "#enums/abilities"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { SPLASH_ONLY } from "../utils/testUtils"; - describe("Moves - Baton Pass", () => { let phaserGame: Phaser.Game; @@ -27,35 +27,35 @@ describe("Moves - Baton Pass", () => { game = new GameManager(phaserGame); game.override .battleType("single") - .enemySpecies(Species.DUGTRIO) - .startingLevel(1) - .startingWave(97) + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.BALL_FETCH) .moveset([Moves.BATON_PASS, Moves.NASTY_PLOT, Moves.SPLASH]) + .ability(Abilities.BALL_FETCH) .enemyMoveset(SPLASH_ONLY) .disableCrits(); }); - it("passes stat stage buffs when player uses it", async () => { + it("transfers all stat stages when player uses it", async() => { // arrange - await game.startBattle([ - Species.RAICHU, - Species.SHUCKLE - ]); + await game.classicMode.startBattle([Species.RAICHU, Species.SHUCKLE]); // round 1 - buff game.move.select(Moves.NASTY_PLOT); await game.toNextTurn(); - expect(game.scene.getPlayerPokemon()!.summonData.battleStats[BattleStat.SPATK]).toEqual(2); + + let playerPokemon = game.scene.getPlayerPokemon()!; + + expect(playerPokemon.getStatStage(Stat.SPATK)).toEqual(2); // round 2 - baton pass game.move.select(Moves.BATON_PASS); game.doSelectPartyPokemon(1); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); // assert - const playerPkm = game.scene.getPlayerPokemon()!; - expect(playerPkm.species.speciesId).toEqual(Species.SHUCKLE); - expect(playerPkm.summonData.battleStats[BattleStat.SPATK]).toEqual(2); + playerPokemon = game.scene.getPlayerPokemon()!; + expect(playerPokemon.species.speciesId).toEqual(Species.SHUCKLE); + expect(playerPokemon.getStatStage(Stat.SPATK)).toEqual(2); }, 20000); it("passes stat stage buffs when AI uses it", async () => { @@ -63,10 +63,7 @@ describe("Moves - Baton Pass", () => { game.override .startingWave(5) .enemyMoveset(new Array(4).fill([Moves.NASTY_PLOT])); - await game.startBattle([ - Species.RAICHU, - Species.SHUCKLE - ]); + await game.classicMode.startBattle([Species.RAICHU, Species.SHUCKLE]); // round 1 - ai buffs game.move.select(Moves.SPLASH); @@ -76,11 +73,11 @@ describe("Moves - Baton Pass", () => { game.scene.getEnemyPokemon()!.hp = 100; game.override.enemyMoveset(new Array(4).fill(Moves.BATON_PASS)); game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(PostSummonPhase, false); + await game.phaseInterceptor.to("PostSummonPhase", false); // assert // check buffs are still there - expect(game.scene.getEnemyPokemon()!.summonData.battleStats[BattleStat.SPATK]).toEqual(2); + expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.SPATK)).toEqual(2); // confirm that a switch actually happened. can't use species because I // can't find a way to override trainer parties with more than 1 pokemon species expect(game.scene.getEnemyPokemon()!.hp).not.toEqual(100); @@ -91,4 +88,20 @@ describe("Moves - Baton Pass", () => { "PostSummonPhase" ]); }, 20000); + + it("doesn't transfer effects that aren't transferrable", async() => { + game.override.enemyMoveset(Array(4).fill(Moves.SALT_CURE)); + await game.classicMode.startBattle([Species.PIKACHU, Species.FEEBAS]); + + const [player1, player2] = game.scene.getParty(); + + game.move.select(Moves.BATON_PASS); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("MoveEndPhase"); + expect(player1.findTag((t) => t.tagType === BattlerTagType.SALT_CURED)).toBeTruthy(); + game.doSelectPartyPokemon(1); + await game.toNextTurn(); + + expect(player2.findTag((t) => t.tagType === BattlerTagType.SALT_CURED)).toBeUndefined(); + }, 20000); }); diff --git a/src/test/moves/belly_drum.test.ts b/src/test/moves/belly_drum.test.ts index e4956c6e83a..7024deb3f18 100644 --- a/src/test/moves/belly_drum.test.ts +++ b/src/test/moves/belly_drum.test.ts @@ -1,8 +1,8 @@ -import { BattleStat } from "#app/data/battle-stat"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { toDmgValue } from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; @@ -43,8 +43,8 @@ describe("Moves - BELLY DRUM", () => { // Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Belly_Drum_(move) - test("Belly Drum raises the user's Attack to its max, at the cost of 1/2 of its maximum HP", - async () => { + test("raises the user's ATK stat stage to its max, at the cost of 1/2 of its maximum HP", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -54,48 +54,48 @@ describe("Moves - BELLY DRUM", () => { await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp() - hpLost); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); }, TIMEOUT ); - test("Belly Drum will still take effect if an uninvolved stat is at max", - async () => { + test("will still take effect if an uninvolved stat stage is at max", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO); - // Here - BattleStat.ATK -> -3 and BattleStat.SPATK -> 6 - leadPokemon.summonData.battleStats[BattleStat.ATK] = -3; - leadPokemon.summonData.battleStats[BattleStat.SPATK] = 6; + // Here - Stat.ATK -> -3 and Stat.SPATK -> 6 + leadPokemon.setStatStage(Stat.ATK, -3); + leadPokemon.setStatStage(Stat.SPATK, 6); game.move.select(Moves.BELLY_DRUM); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp() - hpLost); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(6); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(6); }, TIMEOUT ); - test("Belly Drum fails if the pokemon's attack stat is at its maximum", - async () => { + test("fails if the pokemon's ATK stat stage is at its maximum", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; + leadPokemon.setStatStage(Stat.ATK, 6); game.move.select(Moves.BELLY_DRUM); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); }, TIMEOUT ); - test("Belly Drum fails if the user's health is less than 1/2", - async () => { + test("fails if the user's health is less than 1/2", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -106,7 +106,7 @@ describe("Moves - BELLY DRUM", () => { await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(hpLost - PREDAMAGE); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); }, TIMEOUT ); }); diff --git a/src/test/moves/burning_jealousy.test.ts b/src/test/moves/burning_jealousy.test.ts index 2281fe74acb..2cb6a0bc52a 100644 --- a/src/test/moves/burning_jealousy.test.ts +++ b/src/test/moves/burning_jealousy.test.ts @@ -41,7 +41,7 @@ describe("Moves - Burning Jealousy", () => { }); - it("should burn the opponent if their stats were raised", async () => { + it("should burn the opponent if their stat stages were raised", async () => { await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; @@ -53,7 +53,7 @@ describe("Moves - Burning Jealousy", () => { expect(enemy.status?.effect).toBe(StatusEffect.BURN); }, TIMEOUT); - it("should still burn the opponent if their stats were both raised and lowered in the same turn", async () => { + it("should still burn the opponent if their stat stages were both raised and lowered in the same turn", async () => { game.override .starterSpecies(0) .battleType("double"); @@ -69,7 +69,7 @@ describe("Moves - Burning Jealousy", () => { expect(enemy.status?.effect).toBe(StatusEffect.BURN); }, TIMEOUT); - it("should ignore stats raised by imposter", async () => { + it("should ignore stat stages raised by IMPOSTER", async () => { game.override .enemySpecies(Species.DITTO) .enemyAbility(Abilities.IMPOSTER) @@ -88,7 +88,7 @@ describe("Moves - Burning Jealousy", () => { await game.classicMode.startBattle(); }, TIMEOUT); - it("should be boosted by Sheer Force even if opponent didn't raise stats", async () => { + it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => { game.override .ability(Abilities.SHEER_FORCE) .enemyMoveset(SPLASH_ONLY); diff --git a/src/test/moves/ceaseless_edge.test.ts b/src/test/moves/ceaseless_edge.test.ts index 34ecf8f39f6..8511b3179c6 100644 --- a/src/test/moves/ceaseless_edge.test.ts +++ b/src/test/moves/ceaseless_edge.test.ts @@ -110,7 +110,7 @@ describe("Moves - Ceaseless Edge", () => { const hpBeforeSpikes = game.scene.currentBattle.enemyParty[1].hp; // Check HP of pokemon that WILL BE switched in (index 1) - game.forceOpponentToSwitch(); + game.forceEnemyToSwitch(); game.move.select(Moves.SPLASH); await game.phaseInterceptor.to(TurnEndPhase, false); expect(game.scene.currentBattle.enemyParty[0].hp).toBeLessThan(hpBeforeSpikes); diff --git a/src/test/moves/clangorous_soul.test.ts b/src/test/moves/clangorous_soul.test.ts index 9ea6da91595..9bd3bc2379e 100644 --- a/src/test/moves/clangorous_soul.test.ts +++ b/src/test/moves/clangorous_soul.test.ts @@ -1,12 +1,11 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#test/utils/gameManager"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { toDmgValue } from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; +import { Stat } from "#enums/stat"; import { SPLASH_ONLY } from "#test/utils/testUtils"; -import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; const TIMEOUT = 20 * 1000; /** HP Cost of Move */ @@ -14,7 +13,7 @@ const RATIO = 3; /** Amount of extra HP lost */ const PREDAMAGE = 15; -describe("Moves - CLANGOROUS_SOUL", () => { +describe("Moves - Clangorous Soul", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -40,91 +39,91 @@ describe("Moves - CLANGOROUS_SOUL", () => { //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move) - test("Clangorous Soul raises the user's Attack, Defense, Special Attack, Special Defense and Speed by one stage each, at the cost of 1/3 of its maximum HP", - async () => { + it("raises the user's ATK, DEF, SPATK, SPDEF, and SPD stat stages by 1 each at the cost of 1/3 of its maximum HP", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO); + const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); game.move.select(Moves.CLANGOROUS_SOUL); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp() - hpLost); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); - expect(leadPokemon.summonData.battleStats[BattleStat.DEF]).toBe(1); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(1); - expect(leadPokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(1); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(1); + expect(leadPokemon.getStatStage(Stat.DEF)).toBe(1); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(1); + expect(leadPokemon.getStatStage(Stat.SPDEF)).toBe(1); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(1); }, TIMEOUT ); - test("Clangorous Soul will still take effect if one or more of the involved stats are not at max", - async () => { + it("will still take effect if one or more of the involved stat stages are not at max", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO); + const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); - //Here - BattleStat.SPD -> 0 and BattleStat.SPDEF -> 4 - leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.DEF] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPDEF] = 4; + //Here - Stat.SPD -> 0 and Stat.SPDEF -> 4 + leadPokemon.setStatStage(Stat.ATK, 6); + leadPokemon.setStatStage(Stat.DEF, 6); + leadPokemon.setStatStage(Stat.SPATK, 6); + leadPokemon.setStatStage(Stat.SPDEF, 4); game.move.select(Moves.CLANGOROUS_SOUL); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp() - hpLost); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.DEF]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(5); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.DEF)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPDEF)).toBe(5); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(1); }, TIMEOUT ); - test("Clangorous Soul fails if all stats involved are at max", - async () => { + it("fails if all stat stages involved are at max", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.DEF] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPDEF] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPD] = 6; + leadPokemon.setStatStage(Stat.ATK, 6); + leadPokemon.setStatStage(Stat.DEF, 6); + leadPokemon.setStatStage(Stat.SPATK, 6); + leadPokemon.setStatStage(Stat.SPDEF, 6); + leadPokemon.setStatStage(Stat.SPD, 6); game.move.select(Moves.CLANGOROUS_SOUL); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.DEF]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(6); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.DEF)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPDEF)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(6); }, TIMEOUT ); - test("Clangorous Soul fails if the user's health is less than 1/3", - async () => { + it("fails if the user's health is less than 1/3", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO); + const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO); leadPokemon.hp = hpLost - PREDAMAGE; game.move.select(Moves.CLANGOROUS_SOUL); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(hpLost - PREDAMAGE); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(leadPokemon.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(0); - expect(leadPokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(0); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(leadPokemon.getStatStage(Stat.DEF)).toBe(0); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(0); + expect(leadPokemon.getStatStage(Stat.SPDEF)).toBe(0); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(0); }, TIMEOUT ); }); diff --git a/src/test/moves/crafty_shield.test.ts b/src/test/moves/crafty_shield.test.ts index a341a50b0b9..e73a1fd256d 100644 --- a/src/test/moves/crafty_shield.test.ts +++ b/src/test/moves/crafty_shield.test.ts @@ -1,13 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { BattlerTagType } from "#app/enums/battler-tag-type"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { Abilities } from "#enums/abilities"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import GameManager from "../utils/gameManager"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +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"; const TIMEOUT = 20 * 1000; @@ -55,7 +55,7 @@ describe("Moves - Crafty Shield", () => { await game.phaseInterceptor.to(BerryPhase, false); - leadPokemon.forEach(p => expect(p.summonData.battleStats[BattleStat.ATK]).toBe(0)); + leadPokemon.forEach(p => expect(p.getStatStage(Stat.ATK)).toBe(0)); }, TIMEOUT ); @@ -117,8 +117,8 @@ describe("Moves - Crafty Shield", () => { await game.phaseInterceptor.to(BerryPhase, false); - expect(leadPokemon[0].summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(leadPokemon[1].summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon[0].getStatStage(Stat.ATK)).toBe(0); + expect(leadPokemon[1].getStatStage(Stat.ATK)).toBe(2); } ); }); diff --git a/src/test/moves/disable.test.ts b/src/test/moves/disable.test.ts new file mode 100644 index 00000000000..3d207035ce3 --- /dev/null +++ b/src/test/moves/disable.test.ts @@ -0,0 +1,129 @@ +import { BattlerIndex } from "#app/battle"; +import { MoveResult } from "#app/field/pokemon"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Moves - Disable", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(async () => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .ability(Abilities.BALL_FETCH) + .enemyAbility(Abilities.BALL_FETCH) + .moveset([Moves.DISABLE, Moves.SPLASH]) + .enemyMoveset(SPLASH_ONLY) + .starterSpecies(Species.PIKACHU) + .enemySpecies(Species.SHUCKLE); + }); + + it("restricts moves", async () => { + await game.classicMode.startBattle(); + + const enemyMon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.DISABLE); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); + + expect(enemyMon.getMoveHistory()).toHaveLength(1); + expect(enemyMon.isMoveRestricted(Moves.SPLASH)).toBe(true); + }); + + it("fails if enemy has no move history", async() => { + await game.classicMode.startBattle(); + + const playerMon = game.scene.getPlayerPokemon()!; + const enemyMon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.DISABLE); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toNextTurn(); + + expect(playerMon.getMoveHistory()[0]).toMatchObject({ move: Moves.DISABLE, result: MoveResult.FAIL }); + expect(enemyMon.isMoveRestricted(Moves.SPLASH)).toBe(false); + }, 20000); + + it("causes STRUGGLE if all usable moves are disabled", async() => { + await game.classicMode.startBattle(); + + const enemyMon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.DISABLE); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); + + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + + const enemyHistory = enemyMon.getMoveHistory(); + expect(enemyHistory).toHaveLength(2); + expect(enemyHistory[0].move).toBe(Moves.SPLASH); + expect(enemyHistory[1].move).toBe(Moves.STRUGGLE); + }, 20000); + + it("cannot disable STRUGGLE", async() => { + game.override.enemyMoveset(Array(4).fill(Moves.STRUGGLE)); + await game.classicMode.startBattle(); + + const playerMon = game.scene.getPlayerPokemon()!; + const enemyMon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.DISABLE); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); + + expect(playerMon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyMon.getLastXMoves()[0].move).toBe(Moves.STRUGGLE); + expect(enemyMon.isMoveRestricted(Moves.STRUGGLE)).toBe(false); + }, 20000); + + it("interrupts target's move when target moves after", async() => { + await game.classicMode.startBattle(); + + const enemyMon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + + // Both mons just used Splash last turn; now have player use Disable. + game.move.select(Moves.DISABLE); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.toNextTurn(); + + const enemyHistory = enemyMon.getMoveHistory(); + expect(enemyHistory).toHaveLength(2); + expect(enemyHistory[0]).toMatchObject({ move: Moves.SPLASH, result: MoveResult.SUCCESS }); + expect(enemyHistory[1].result).toBe(MoveResult.FAIL); + }, 20000); + + it("disables NATURE POWER, not the move invoked by it", async() => { + game.override.enemyMoveset(Array(4).fill(Moves.NATURE_POWER)); + await game.classicMode.startBattle(); + + const enemyMon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.DISABLE); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); + + expect(enemyMon.isMoveRestricted(Moves.NATURE_POWER)).toBe(true); + expect(enemyMon.isMoveRestricted(enemyMon.getLastXMoves(2)[1].move)).toBe(false); + }, 20000); +}); diff --git a/src/test/moves/double_team.test.ts b/src/test/moves/double_team.test.ts index c45c8bd8516..fa224c8df9e 100644 --- a/src/test/moves/double_team.test.ts +++ b/src/test/moves/double_team.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { Abilities } from "#app/enums/abilities"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; @@ -32,20 +32,20 @@ describe("Moves - Double Team", () => { game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); }); - it("increases the user's evasion by one stage.", async () => { + it("raises the user's EVA stat stage by 1", async () => { await game.startBattle([Species.MAGIKARP]); const ally = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; vi.spyOn(enemy, "getAccuracyMultiplier"); - expect(ally.summonData.battleStats[BattleStat.EVA]).toBe(0); + expect(ally.getStatStage(Stat.EVA)).toBe(0); game.move.select(Moves.DOUBLE_TEAM); await game.phaseInterceptor.to(TurnEndPhase); await game.toNextTurn(); - expect(ally.summonData.battleStats[BattleStat.EVA]).toBe(1); + expect(ally.getStatStage(Stat.EVA)).toBe(1); expect(enemy.getAccuracyMultiplier).toHaveReturnedWith(.75); }); }); diff --git a/src/test/moves/dragon_cheer.test.ts b/src/test/moves/dragon_cheer.test.ts new file mode 100644 index 00000000000..747d71bd000 --- /dev/null +++ b/src/test/moves/dragon_cheer.test.ts @@ -0,0 +1,101 @@ +import { BattlerIndex } from "#app/battle"; +import { Type } from "#app/data/type"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; +import { Abilities } from "#enums/abilities"; +import GameManager from "#test/utils/gameManager"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Moves - Dragon Cheer", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + const TIMEOUT = 20 * 1000; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("double") + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(SPLASH_ONLY) + .enemyLevel(20) + .moveset([Moves.DRAGON_CHEER, Moves.TACKLE, Moves.SPLASH]); + }); + + it("increases the user's allies' critical hit ratio by one stage", async () => { + await game.classicMode.startBattle([Species.DRAGONAIR, Species.MAGIKARP]); + + const enemy = game.scene.getEnemyField()[0]; + + vi.spyOn(enemy, "getCritStage"); + + game.move.select(Moves.DRAGON_CHEER, 0); + game.move.select(Moves.TACKLE, 1, BattlerIndex.ENEMY); + + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + // After Tackle + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getCritStage).toHaveReturnedWith(1); // getCritStage is called on defender + }, TIMEOUT); + + it("increases the user's Dragon-type allies' critical hit ratio by two stages", async () => { + await game.classicMode.startBattle([Species.MAGIKARP, Species.DRAGONAIR]); + + const enemy = game.scene.getEnemyField()[0]; + + vi.spyOn(enemy, "getCritStage"); + + game.move.select(Moves.DRAGON_CHEER, 0); + game.move.select(Moves.TACKLE, 1, BattlerIndex.ENEMY); + + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + // After Tackle + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getCritStage).toHaveReturnedWith(2); // getCritStage is called on defender + }, TIMEOUT); + + it("applies the effect based on the allies' type upon use of the move, and do not change if the allies' type changes later in battle", async () => { + await game.classicMode.startBattle([Species.DRAGONAIR, Species.MAGIKARP]); + + const magikarp = game.scene.getPlayerField()[1]; + const enemy = game.scene.getEnemyField()[0]; + + vi.spyOn(enemy, "getCritStage"); + + game.move.select(Moves.DRAGON_CHEER, 0); + game.move.select(Moves.TACKLE, 1, BattlerIndex.ENEMY); + + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + // After Tackle + await game.phaseInterceptor.to("TurnEndPhase"); + expect(enemy.getCritStage).toHaveReturnedWith(1); // getCritStage is called on defender + + await game.toNextTurn(); + + // Change Magikarp's type to Dragon + vi.spyOn(magikarp, "getTypes").mockReturnValue([Type.DRAGON]); + expect(magikarp.getTypes()).toEqual([Type.DRAGON]); + + game.move.select(Moves.SPLASH, 0); + game.move.select(Moves.TACKLE, 1, BattlerIndex.ENEMY); + + await game.setTurnOrder([BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemy.getCritStage).toHaveReturnedWith(1); // getCritStage is called on defender + }, TIMEOUT); +}); diff --git a/src/test/moves/dragon_rage.test.ts b/src/test/moves/dragon_rage.test.ts index 223635575ab..5da6e082ce5 100644 --- a/src/test/moves/dragon_rage.test.ts +++ b/src/test/moves/dragon_rage.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { Type } from "#app/data/type"; import { Species } from "#app/enums/species"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; @@ -63,9 +63,8 @@ describe("Moves - Dragon Rage", () => { game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); it("ignores resistances", async () => { @@ -74,20 +73,18 @@ describe("Moves - Dragon Rage", () => { game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); - it("ignores stat changes", async () => { + it("ignores SPATK stat stages", async () => { game.override.disableCrits(); - partyPokemon.summonData.battleStats[BattleStat.SPATK] = 2; + partyPokemon.setStatStage(Stat.SPATK, 2); game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); it("ignores stab", async () => { @@ -96,9 +93,8 @@ describe("Moves - Dragon Rage", () => { game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); it("ignores criticals", async () => { @@ -106,20 +102,18 @@ describe("Moves - Dragon Rage", () => { game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); - it("ignores damage modification from abilities such as ice scales", async () => { + it("ignores damage modification from abilities, for example ICE_SCALES", async () => { game.override.disableCrits(); game.override.enemyAbility(Abilities.ICE_SCALES); game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); it("ignores multi hit", async () => { @@ -128,8 +122,7 @@ describe("Moves - Dragon Rage", () => { game.move.select(Moves.DRAGON_RAGE); await game.phaseInterceptor.to(TurnEndPhase); - const damageDealt = enemyPokemon.getMaxHp() - enemyPokemon.hp; - expect(damageDealt).toBe(dragonRageDamage); + expect(enemyPokemon.getInverseHp()).toBe(dragonRageDamage); }); }); diff --git a/src/test/moves/fillet_away.test.ts b/src/test/moves/fillet_away.test.ts index b2ff9e25dba..a639a86c5c1 100644 --- a/src/test/moves/fillet_away.test.ts +++ b/src/test/moves/fillet_away.test.ts @@ -1,8 +1,8 @@ -import { BattleStat } from "#app/data/battle-stat"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { toDmgValue } from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; +import { Stat } from "#enums/stat"; import GameManager from "#test/utils/gameManager"; import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; @@ -40,8 +40,8 @@ describe("Moves - FILLET AWAY", () => { //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move) - test("Fillet Away raises the user's Attack, Special Attack, and Speed by two stages each, at the cost of 1/2 of its maximum HP", - async () => { + test("raises the user's ATK, SPATK, and SPD stat stages by 2 each, at the cost of 1/2 of its maximum HP", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -51,55 +51,55 @@ describe("Moves - FILLET AWAY", () => { await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp() - hpLost); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(2); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(2); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(2); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(2); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(2); }, TIMEOUT ); - test("Fillet Away will still take effect if one or more of the involved stats are not at max", - async () => { + test("still takes effect if one or more of the involved stat stages are not at max", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO); - //Here - BattleStat.SPD -> 0 and BattleStat.SPATK -> 3 - leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPATK] = 3; + //Here - Stat.SPD -> 0 and Stat.SPATK -> 3 + leadPokemon.setStatStage(Stat.ATK, 6); + leadPokemon.setStatStage(Stat.SPATK, 3); game.move.select(Moves.FILLET_AWAY); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp() - hpLost); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(5); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(2); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(5); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(2); }, TIMEOUT ); - test("Fillet Away fails if all stats involved are at max", - async () => { + test("fails if all stat stages involved are at max", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; - leadPokemon.summonData.battleStats[BattleStat.ATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPATK] = 6; - leadPokemon.summonData.battleStats[BattleStat.SPD] = 6; + leadPokemon.setStatStage(Stat.ATK, 6); + leadPokemon.setStatStage(Stat.SPATK, 6); + leadPokemon.setStatStage(Stat.SPD, 6); game.move.select(Moves.FILLET_AWAY); await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(6); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(6); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(6); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(6); }, TIMEOUT ); - test("Fillet Away fails if the user's health is less than 1/2", - async () => { + test("fails if the user's health is less than 1/2", + async() => { await game.startBattle([Species.MAGIKARP]); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -110,9 +110,9 @@ describe("Moves - FILLET AWAY", () => { await game.phaseInterceptor.to(TurnEndPhase); expect(leadPokemon.hp).toBe(hpLost - PREDAMAGE); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(leadPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(0); - expect(leadPokemon.summonData.battleStats[BattleStat.SPD]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(leadPokemon.getStatStage(Stat.SPATK)).toBe(0); + expect(leadPokemon.getStatStage(Stat.SPD)).toBe(0); }, TIMEOUT ); }); diff --git a/src/test/moves/fissure.test.ts b/src/test/moves/fissure.test.ts index 51122b269b8..34612d1fb18 100644 --- a/src/test/moves/fissure.test.ts +++ b/src/test/moves/fissure.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { Species } from "#app/enums/species"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import { DamagePhase } from "#app/phases/damage-phase"; @@ -52,7 +52,7 @@ describe("Moves - Fissure", () => { game.scene.clearEnemyHeldItemModifiers(); }); - it("ignores damage modification from abilities such as fur coat", async () => { + it("ignores damage modification from abilities, for example FUR_COAT", async () => { game.override.ability(Abilities.NO_GUARD); game.override.enemyAbility(Abilities.FUR_COAT); @@ -62,10 +62,10 @@ describe("Moves - Fissure", () => { expect(enemyPokemon.isFainted()).toBe(true); }); - it("ignores accuracy stat", async () => { + it("ignores user's ACC stat stage", async () => { vi.spyOn(partyPokemon, "getAccuracyMultiplier"); - enemyPokemon.summonData.battleStats[BattleStat.ACC] = -6; + partyPokemon.setStatStage(Stat.ACC, -6); game.move.select(Moves.FISSURE); @@ -75,10 +75,10 @@ describe("Moves - Fissure", () => { expect(partyPokemon.getAccuracyMultiplier).toHaveReturnedWith(1); }); - it("ignores evasion stat", async () => { + it("ignores target's EVA stat stage", async () => { vi.spyOn(partyPokemon, "getAccuracyMultiplier"); - enemyPokemon.summonData.battleStats[BattleStat.EVA] = 6; + enemyPokemon.setStatStage(Stat.EVA, 6); game.move.select(Moves.FISSURE); diff --git a/src/test/moves/flower_shield.test.ts b/src/test/moves/flower_shield.test.ts index b3e50219aec..ffe8ae995d3 100644 --- a/src/test/moves/flower_shield.test.ts +++ b/src/test/moves/flower_shield.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { SemiInvulnerableTag } from "#app/data/battler-tags"; import { Type } from "#app/data/type"; import { Biome } from "#app/enums/biome"; @@ -34,24 +34,24 @@ describe("Moves - Flower Shield", () => { game.override.enemyMoveset(SPLASH_ONLY); }); - it("increases defense of all Grass-type Pokemon on the field by one stage - single battle", async () => { + it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - single battle", async () => { game.override.enemySpecies(Species.CHERRIM); await game.startBattle([Species.MAGIKARP]); const cherrim = game.scene.getEnemyPokemon()!; const magikarp = game.scene.getPlayerPokemon()!; - expect(magikarp.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(cherrim.summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(magikarp.getStatStage(Stat.DEF)).toBe(0); + expect(cherrim.getStatStage(Stat.DEF)).toBe(0); game.move.select(Moves.FLOWER_SHIELD); await game.phaseInterceptor.to(TurnEndPhase); - expect(magikarp.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(cherrim.summonData.battleStats[BattleStat.DEF]).toBe(1); + expect(magikarp.getStatStage(Stat.DEF)).toBe(0); + expect(cherrim.getStatStage(Stat.DEF)).toBe(1); }); - it("increases defense of all Grass-type Pokemon on the field by one stage - double battle", async () => { + it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - double battle", async () => { game.override.enemySpecies(Species.MAGIKARP).startingBiome(Biome.GRASS).battleType("double"); await game.startBattle([Species.CHERRIM, Species.MAGIKARP]); @@ -60,21 +60,21 @@ describe("Moves - Flower Shield", () => { const grassPokemons = field.filter(p => p.getTypes().includes(Type.GRASS)); const nonGrassPokemons = field.filter(pokemon => !grassPokemons.includes(pokemon)); - grassPokemons.forEach(p => expect(p.summonData.battleStats[BattleStat.DEF]).toBe(0)); - nonGrassPokemons.forEach(p => expect(p.summonData.battleStats[BattleStat.DEF]).toBe(0)); + grassPokemons.forEach(p => expect(p.getStatStage(Stat.DEF)).toBe(0)); + nonGrassPokemons.forEach(p => expect(p.getStatStage(Stat.DEF)).toBe(0)); game.move.select(Moves.FLOWER_SHIELD); game.move.select(Moves.SPLASH, 1); await game.phaseInterceptor.to(TurnEndPhase); - grassPokemons.forEach(p => expect(p.summonData.battleStats[BattleStat.DEF]).toBe(1)); - nonGrassPokemons.forEach(p => expect(p.summonData.battleStats[BattleStat.DEF]).toBe(0)); + grassPokemons.forEach(p => expect(p.getStatStage(Stat.DEF)).toBe(1)); + nonGrassPokemons.forEach(p => expect(p.getStatStage(Stat.DEF)).toBe(0)); }); /** * See semi-vulnerable state tags. {@linkcode SemiInvulnerableTag} */ - it("does not increase defense of a pokemon in semi-vulnerable state", async () => { + it("does not raise DEF stat stage for a Pokemon in semi-vulnerable state", async () => { game.override.enemySpecies(Species.PARAS); game.override.enemyMoveset([Moves.DIG, Moves.DIG, Moves.DIG, Moves.DIG]); game.override.enemyLevel(50); @@ -83,32 +83,32 @@ describe("Moves - Flower Shield", () => { const paras = game.scene.getEnemyPokemon()!; const cherrim = game.scene.getPlayerPokemon()!; - expect(paras.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(cherrim.summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(paras.getStatStage(Stat.DEF)).toBe(0); + expect(cherrim.getStatStage(Stat.DEF)).toBe(0); expect(paras.getTag(SemiInvulnerableTag)).toBeUndefined; game.move.select(Moves.FLOWER_SHIELD); await game.phaseInterceptor.to(TurnEndPhase); expect(paras.getTag(SemiInvulnerableTag)).toBeDefined(); - expect(paras.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(cherrim.summonData.battleStats[BattleStat.DEF]).toBe(1); + expect(paras.getStatStage(Stat.DEF)).toBe(0); + expect(cherrim.getStatStage(Stat.DEF)).toBe(1); }); - it("does nothing if there are no Grass-type pokemon on the field", async () => { + it("does nothing if there are no Grass-type Pokemon on the field", async () => { game.override.enemySpecies(Species.MAGIKARP); await game.startBattle([Species.MAGIKARP]); const enemy = game.scene.getEnemyPokemon()!; const ally = game.scene.getPlayerPokemon()!; - expect(enemy.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(ally.summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(enemy.getStatStage(Stat.DEF)).toBe(0); + expect(ally.getStatStage(Stat.DEF)).toBe(0); game.move.select(Moves.FLOWER_SHIELD); await game.phaseInterceptor.to(TurnEndPhase); - expect(enemy.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(ally.summonData.battleStats[BattleStat.DEF]).toBe(0); + expect(enemy.getStatStage(Stat.DEF)).toBe(0); + expect(ally.getStatStage(Stat.DEF)).toBe(0); }); }); diff --git a/src/test/moves/focus_punch.test.ts b/src/test/moves/focus_punch.test.ts index 99399623a1c..249647f0294 100644 --- a/src/test/moves/focus_punch.test.ts +++ b/src/test/moves/focus_punch.test.ts @@ -123,7 +123,7 @@ describe("Moves - Focus Punch", () => { await game.startBattle([Species.CHARIZARD]); - game.forceOpponentToSwitch(); + game.forceEnemyToSwitch(); game.move.select(Moves.FOCUS_PUNCH); await game.phaseInterceptor.to(TurnStartPhase); diff --git a/src/test/moves/follow_me.test.ts b/src/test/moves/follow_me.test.ts index d7ef199df3e..7d0c4fdb546 100644 --- a/src/test/moves/follow_me.test.ts +++ b/src/test/moves/follow_me.test.ts @@ -1,5 +1,5 @@ +import { Stat } from "#enums/stat"; import { BattlerIndex } from "#app/battle"; -import { Stat } from "#app/data/pokemon-stat"; import { Abilities } from "#app/enums/abilities"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; @@ -28,48 +28,55 @@ describe("Moves - Follow Me", () => { game = new GameManager(phaserGame); game.override.battleType("double"); game.override.starterSpecies(Species.AMOONGUSS); + game.override.ability(Abilities.BALL_FETCH); game.override.enemySpecies(Species.SNORLAX); game.override.startingLevel(100); game.override.enemyLevel(100); game.override.moveset([Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.enemyMoveset([Moves.TACKLE, Moves.FOLLOW_ME, Moves.SPLASH]); }); test( "move should redirect enemy attacks to the user", async () => { - await game.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); const playerPokemon = game.scene.getPlayerField(); - const playerStartingHp = playerPokemon.map(p => p.hp); - game.move.select(Moves.FOLLOW_ME); game.move.select(Moves.QUICK_ATTACK, 1, BattlerIndex.ENEMY); + + // Force both enemies to target the player Pokemon that did not use Follow Me + await game.forceEnemyMove(Moves.TACKLE, BattlerIndex.PLAYER_2); + await game.forceEnemyMove(Moves.TACKLE, BattlerIndex.PLAYER_2); + await game.phaseInterceptor.to(TurnEndPhase, false); - expect(playerPokemon[0].hp).toBeLessThan(playerStartingHp[0]); - expect(playerPokemon[1].hp).toBe(playerStartingHp[1]); + expect(playerPokemon[0].hp).toBeLessThan(playerPokemon[0].getMaxHp()); + expect(playerPokemon[1].hp).toBe(playerPokemon[1].getMaxHp()); }, TIMEOUT ); test( "move should redirect enemy attacks to the first ally that uses it", async () => { - await game.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); const playerPokemon = game.scene.getPlayerField(); - const playerStartingHp = playerPokemon.map(p => p.hp); - game.move.select(Moves.FOLLOW_ME); game.move.select(Moves.FOLLOW_ME, 1); + + // Each player is targeted by an enemy + await game.forceEnemyMove(Moves.TACKLE, BattlerIndex.PLAYER); + await game.forceEnemyMove(Moves.TACKLE, BattlerIndex.PLAYER_2); + await game.phaseInterceptor.to(TurnEndPhase, false); - playerPokemon.sort((a, b) => a.getBattleStat(Stat.SPD) - b.getBattleStat(Stat.SPD)); + playerPokemon.sort((a, b) => a.getEffectiveStat(Stat.SPD) - b.getEffectiveStat(Stat.SPD)); - expect(playerPokemon[1].hp).toBeLessThan(playerStartingHp[1]); - expect(playerPokemon[0].hp).toBe(playerStartingHp[0]); + expect(playerPokemon[1].hp).toBeLessThan(playerPokemon[1].getMaxHp()); + expect(playerPokemon[0].hp).toBe(playerPokemon[0].getMaxHp()); }, TIMEOUT ); @@ -78,21 +85,23 @@ describe("Moves - Follow Me", () => { async () => { game.override.ability(Abilities.STALWART); game.override.moveset([Moves.QUICK_ATTACK]); - game.override.enemyMoveset([Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME]); - await game.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); const enemyPokemon = game.scene.getEnemyField(); - const enemyStartingHp = enemyPokemon.map(p => p.hp); - game.move.select(Moves.QUICK_ATTACK, 0, BattlerIndex.ENEMY); game.move.select(Moves.QUICK_ATTACK, 1, BattlerIndex.ENEMY_2); + + // Target doesn't need to be specified if the move is self-targeted + await game.forceEnemyMove(Moves.FOLLOW_ME); + await game.forceEnemyMove(Moves.SPLASH); + await game.phaseInterceptor.to(TurnEndPhase, false); // If redirection was bypassed, both enemies should be damaged - expect(enemyPokemon[0].hp).toBeLessThan(enemyStartingHp[0]); - expect(enemyPokemon[1].hp).toBeLessThan(enemyStartingHp[1]); + expect(enemyPokemon[0].hp).toBeLessThan(enemyPokemon[0].getMaxHp()); + expect(enemyPokemon[1].hp).toBeLessThan(enemyPokemon[1].getMaxHp()); }, TIMEOUT ); @@ -100,21 +109,22 @@ describe("Moves - Follow Me", () => { "move effect should be bypassed by Snipe Shot", async () => { game.override.moveset([Moves.SNIPE_SHOT]); - game.override.enemyMoveset([Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME]); - await game.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); const enemyPokemon = game.scene.getEnemyField(); - const enemyStartingHp = enemyPokemon.map(p => p.hp); - game.move.select(Moves.SNIPE_SHOT, 0, BattlerIndex.ENEMY); game.move.select(Moves.SNIPE_SHOT, 1, BattlerIndex.ENEMY_2); + + await game.forceEnemyMove(Moves.FOLLOW_ME); + await game.forceEnemyMove(Moves.SPLASH); + await game.phaseInterceptor.to(TurnEndPhase, false); // If redirection was bypassed, both enemies should be damaged - expect(enemyPokemon[0].hp).toBeLessThan(enemyStartingHp[0]); - expect(enemyPokemon[1].hp).toBeLessThan(enemyStartingHp[1]); + expect(enemyPokemon[0].hp).toBeLessThan(enemyPokemon[0].getMaxHp()); + expect(enemyPokemon[1].hp).toBeLessThan(enemyPokemon[1].getMaxHp()); }, TIMEOUT ); }); diff --git a/src/test/moves/freeze_dry.test.ts b/src/test/moves/freeze_dry.test.ts new file mode 100644 index 00000000000..445a432a812 --- /dev/null +++ b/src/test/moves/freeze_dry.test.ts @@ -0,0 +1,107 @@ +import { BattlerIndex } from "#app/battle"; +import { Abilities } from "#app/enums/abilities"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; +import GameManager from "#test/utils/gameManager"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Moves - Freeze-Dry", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + const TIMEOUT = 20 * 1000; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(SPLASH_ONLY) + .starterSpecies(Species.FEEBAS) + .ability(Abilities.BALL_FETCH) + .moveset([Moves.FREEZE_DRY]); + }); + + it("should deal 2x damage to pure water types", async () => { + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.FREEZE_DRY); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(2); + }, TIMEOUT); + + it("should deal 4x damage to water/flying types", async () => { + game.override.enemySpecies(Species.WINGULL); + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.FREEZE_DRY); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(4); + }, TIMEOUT); + + it("should deal 1x damage to water/fire types", async () => { + game.override.enemySpecies(Species.VOLCANION); + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.FREEZE_DRY); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(1); + }, TIMEOUT); + + // enable if this is ever fixed (lol) + it.todo("should deal 2x damage to water types under Normalize", async () => { + game.override.ability(Abilities.NORMALIZE); + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.FREEZE_DRY); + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); + await game.phaseInterceptor.to("MoveEffectPhase"); + + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(2); + }, TIMEOUT); + + // enable once Electrify is implemented (and the interaction is fixed, as above) + it.todo("should deal 2x damage to water types under Electrify", async () => { + game.override.enemyMoveset(Array(4).fill(Moves.ELECTRIFY)); + await game.classicMode.startBattle(); + + const enemy = game.scene.getEnemyPokemon()!; + vi.spyOn(enemy, "getMoveEffectiveness"); + + game.move.select(Moves.FREEZE_DRY); + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(enemy.getMoveEffectiveness).toHaveReturnedWith(2); + }, TIMEOUT); +}); diff --git a/src/test/moves/freezy_frost.test.ts b/src/test/moves/freezy_frost.test.ts index 00d7104d373..ae42d5b6dc6 100644 --- a/src/test/moves/freezy_frost.test.ts +++ b/src/test/moves/freezy_frost.test.ts @@ -1,82 +1,61 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { allMoves } from "#app/data/move"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import { allMoves } from "#app/data/move"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Freezy Frost", () => { - describe("integration tests", () => { - let phaserGame: Phaser.Game; - let game: GameManager; + let phaserGame: Phaser.Game; + let game: GameManager; - beforeAll(() => { - phaserGame = new Phaser.Game({ type: Phaser.HEADLESS }); - }); + beforeAll(() => { + phaserGame = new Phaser.Game({ type: Phaser.HEADLESS }); + }); - afterEach(() => { - game.phaseInterceptor.restoreOg(); - }); + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); - beforeEach(() => { - game = new GameManager(phaserGame); + beforeEach(() => { + game = new GameManager(phaserGame); - game.override.battleType("single"); + game.override.battleType("single"); - game.override.enemySpecies(Species.RATTATA); - game.override.enemyLevel(100); - game.override.enemyMoveset(SPLASH_ONLY); - game.override.enemyAbility(Abilities.NONE); + game.override.enemySpecies(Species.RATTATA); + game.override.enemyLevel(100); + game.override.enemyMoveset(SPLASH_ONLY); + game.override.enemyAbility(Abilities.NONE); - game.override.startingLevel(100); - game.override.moveset([Moves.FREEZY_FROST, Moves.SWORDS_DANCE, Moves.CHARM, Moves.SPLASH]); - vi.spyOn(allMoves[Moves.FREEZY_FROST], "accuracy", "get").mockReturnValue(100); - game.override.ability(Abilities.NONE); - }); + game.override.startingLevel(100); + game.override.moveset([Moves.FREEZY_FROST, Moves.SWORDS_DANCE, Moves.CHARM, Moves.SPLASH]); + vi.spyOn(allMoves[Moves.FREEZY_FROST], "accuracy", "get").mockReturnValue(100); + game.override.ability(Abilities.NONE); + }); - it("Uses Swords Dance to raise own ATK by 2, Charm to lower enemy ATK by 2, player uses Freezy Frost to clear all stat changes", { timeout: 10000 }, async () => { - await game.startBattle([Species.RATTATA]); - const user = game.scene.getPlayerPokemon()!; - const enemy = game.scene.getEnemyPokemon()!; - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(enemy.summonData.battleStats[BattleStat.ATK]).toBe(0); + it("should clear all stat stage changes", { timeout: 10000 }, async () => { + await game.startBattle([Species.RATTATA]); + const user = game.scene.getPlayerPokemon()!; + const enemy = game.scene.getEnemyPokemon()!; - game.move.select(Moves.SWORDS_DANCE); - await game.phaseInterceptor.to(TurnInitPhase); + expect(user.getStatStage(Stat.ATK)).toBe(0); + expect(enemy.getStatStage(Stat.ATK)).toBe(0); - game.move.select(Moves.CHARM); - await game.phaseInterceptor.to(TurnInitPhase); - const userAtkBefore = user.summonData.battleStats[BattleStat.ATK]; - const enemyAtkBefore = enemy.summonData.battleStats[BattleStat.ATK]; - expect(userAtkBefore).toBe(2); - expect(enemyAtkBefore).toBe(-2); + game.move.select(Moves.SWORDS_DANCE); + await game.phaseInterceptor.to(TurnInitPhase); - game.move.select(Moves.FREEZY_FROST); - await game.phaseInterceptor.to(TurnInitPhase); - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(enemy.summonData.battleStats[BattleStat.ATK]).toBe(0); - }); + game.move.select(Moves.CHARM); + await game.phaseInterceptor.to(TurnInitPhase); + expect(user.getStatStage(Stat.ATK)).toBe(2); + expect(enemy.getStatStage(Stat.ATK)).toBe(-2); - it("Uses Swords Dance to raise own ATK by 2, Charm to lower enemy ATK by 2, enemy uses Freezy Frost to clear all stat changes", { timeout: 10000 }, async () => { - game.override.enemyMoveset([Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST]); - await game.startBattle([Species.SHUCKLE]); // Shuckle for slower Swords Dance on first turn so Freezy Frost doesn't affect it. - const user = game.scene.getPlayerPokemon()!; - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - - game.move.select(Moves.SWORDS_DANCE); - await game.phaseInterceptor.to(TurnInitPhase); - - const userAtkBefore = user.summonData.battleStats[BattleStat.ATK]; - expect(userAtkBefore).toBe(2); - - game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(MoveEndPhase); - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - }); + game.move.select(Moves.FREEZY_FROST); + await game.phaseInterceptor.to(TurnInitPhase); + expect(user.getStatStage(Stat.ATK)).toBe(0); + expect(enemy.getStatStage(Stat.ATK)).toBe(0); }); }); diff --git a/src/test/moves/fusion_flare.test.ts b/src/test/moves/fusion_flare.test.ts index 471f6a2ac7b..0a8f6f9115d 100644 --- a/src/test/moves/fusion_flare.test.ts +++ b/src/test/moves/fusion_flare.test.ts @@ -27,7 +27,7 @@ describe("Moves - Fusion Flare", () => { game.override.moveset([fusionFlare]); game.override.startingLevel(1); - game.override.enemySpecies(Species.RESHIRAM); + game.override.enemySpecies(Species.RATTATA); game.override.enemyMoveset([Moves.REST, Moves.REST, Moves.REST, Moves.REST]); game.override.battleType("single"); diff --git a/src/test/moves/fusion_flare_bolt.test.ts b/src/test/moves/fusion_flare_bolt.test.ts index ebef5148778..a8372fcaaab 100644 --- a/src/test/moves/fusion_flare_bolt.test.ts +++ b/src/test/moves/fusion_flare_bolt.test.ts @@ -1,6 +1,6 @@ +import { Stat } from "#enums/stat"; import { BattlerIndex } from "#app/battle"; import { allMoves } from "#app/data/move"; -import { Stat } from "#app/data/pokemon-stat"; import { DamagePhase } from "#app/phases/damage-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase"; diff --git a/src/test/moves/glaive_rush.test.ts b/src/test/moves/glaive_rush.test.ts index 1eac3c32bb4..5867ef751b8 100644 --- a/src/test/moves/glaive_rush.test.ts +++ b/src/test/moves/glaive_rush.test.ts @@ -1,13 +1,12 @@ import { allMoves } from "#app/data/move"; import { Abilities } from "#app/enums/abilities"; -import { DamagePhase } from "#app/phases/damage-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +const TIMEOUT = 20 * 1000; describe("Moves - Glaive Rush", () => { let phaserGame: Phaser.Game; @@ -25,131 +24,142 @@ describe("Moves - Glaive Rush", () => { beforeEach(() => { game = new GameManager(phaserGame); - game.override.battleType("single"); - game.override.disableCrits(); - game.override.enemySpecies(Species.MAGIKARP); - game.override.enemyAbility(Abilities.BALL_FETCH); - game.override.enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH)); - game.override.starterSpecies(Species.KLINK); - game.override.ability(Abilities.UNNERVE); - game.override.passiveAbility(Abilities.FUR_COAT); - game.override.moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]); + game.override + .battleType("single") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH)) + .starterSpecies(Species.KLINK) + .ability(Abilities.BALL_FETCH) + .moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]); }); it("takes double damage from attacks", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); + const enemy = game.scene.getEnemyPokemon()!; enemy.hp = 1000; - vi.spyOn(game.scene, "randBattleSeedInt").mockReturnValue(0); game.move.select(Moves.SHADOW_SNEAK); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); const damageDealt = 1000 - enemy.hp; - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); game.move.select(Moves.SHADOW_SNEAK); - await game.phaseInterceptor.to(DamagePhase); + await game.phaseInterceptor.to("DamagePhase"); expect(enemy.hp).toBeLessThanOrEqual(1001 - (damageDealt * 3)); - }, 5000); // TODO: revert back to 20s + }, TIMEOUT); it("always gets hit by attacks", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); + const enemy = game.scene.getEnemyPokemon()!; enemy.hp = 1000; allMoves[Moves.AVALANCHE].accuracy = 0; game.move.select(Moves.AVALANCHE); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(enemy.hp).toBeLessThan(1000); - }, 20000); + }, TIMEOUT); it("interacts properly with multi-lens", async () => { - game.override.startingHeldItems([{ name: "MULTI_LENS", count: 2 }]); - game.override.enemyMoveset(Array(4).fill(Moves.AVALANCHE)); - await game.startBattle(); + game.override + .startingHeldItems([{ name: "MULTI_LENS", count: 2 }]) + .enemyMoveset(Array(4).fill(Moves.AVALANCHE)); + await game.classicMode.startBattle(); + const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + enemy.hp = 1000; player.hp = 1000; allMoves[Moves.AVALANCHE].accuracy = 0; game.move.select(Moves.GLAIVE_RUSH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.hp).toBeLessThan(1000); player.hp = 1000; game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.hp).toBe(1000); - }, 20000); + }, TIMEOUT); it("secondary effects only last until next move", async () => { game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); - await game.startBattle(); + await game.classicMode.startBattle(); + const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + enemy.hp = 1000; player.hp = 1000; allMoves[Moves.SHADOW_SNEAK].accuracy = 0; game.move.select(Moves.GLAIVE_RUSH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.hp).toBe(1000); game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); const damagedHp = player.hp; expect(player.hp).toBeLessThan(1000); game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.hp).toBe(damagedHp); - }, 20000); + }, TIMEOUT); it("secondary effects are removed upon switching", async () => { - game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)); - game.override.starterSpecies(0); - await game.startBattle([Species.KLINK, Species.FEEBAS]); + game.override + .enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK)) + .starterSpecies(0); + await game.classicMode.startBattle([Species.KLINK, Species.FEEBAS]); + const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + enemy.hp = 1000; allMoves[Moves.SHADOW_SNEAK].accuracy = 0; game.move.select(Moves.GLAIVE_RUSH); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.hp).toBe(player.getMaxHp()); game.doSwitchPokemon(1); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); game.doSwitchPokemon(1); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); expect(player.hp).toBe(player.getMaxHp()); - }, 20000); + }, TIMEOUT); it("secondary effects don't activate if move fails", async () => { game.override.moveset([Moves.SHADOW_SNEAK, Moves.PROTECT, Moves.SPLASH, Moves.GLAIVE_RUSH]); - await game.startBattle(); + await game.classicMode.startBattle(); + const player = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; + enemy.hp = 1000; player.hp = 1000; game.move.select(Moves.PROTECT); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); game.move.select(Moves.SHADOW_SNEAK); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); game.override.enemyMoveset(Array(4).fill(Moves.SPLASH)); const damagedHP1 = 1000 - enemy.hp; enemy.hp = 1000; game.move.select(Moves.SHADOW_SNEAK); - await game.phaseInterceptor.to(TurnEndPhase); + await game.phaseInterceptor.to("TurnEndPhase"); const damagedHP2 = 1000 - enemy.hp; expect(damagedHP2).toBeGreaterThanOrEqual((damagedHP1 * 2) - 1); - }, 20000); + }, TIMEOUT); }); diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index dfbf5406351..defe5e26f41 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -1,14 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { Stat } from "#app/data/pokemon-stat"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; - +import { SPLASH_ONLY } from "../utils/testUtils"; +import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Growth", () => { let phaserGame: Phaser.Game; @@ -26,31 +25,25 @@ describe("Moves - Growth", () => { beforeEach(() => { game = new GameManager(phaserGame); - const moveToUse = Moves.GROWTH; game.override.battleType("single"); - game.override.enemySpecies(Species.RATTATA); game.override.enemyAbility(Abilities.MOXIE); game.override.ability(Abilities.INSOMNIA); - game.override.startingLevel(2000); - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.moveset([ Moves.GROWTH ]); + game.override.enemyMoveset(SPLASH_ONLY); }); - it("GROWTH", async () => { - const moveToUse = Moves.GROWTH; + it("should raise SPATK stat stage by 1", async() => { await game.startBattle([ - Species.MIGHTYENA, - Species.MIGHTYENA, + Species.MIGHTYENA ]); - let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[Stat.SPATK]).toBe(0); - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0); + const playerPokemon = game.scene.getPlayerPokemon()!; - game.move.select(moveToUse); + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(0); + + game.move.select(Moves.GROWTH); await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase); - battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; - expect(battleStatsPokemon[BattleStat.SPATK]).toBe(1); + + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(1); }, 20000); }); diff --git a/src/test/moves/guard_split.test.ts b/src/test/moves/guard_split.test.ts new file mode 100644 index 00000000000..f95d09f726c --- /dev/null +++ b/src/test/moves/guard_split.test.ts @@ -0,0 +1,82 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +describe("Moves - Guard Split", () => { + 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 + .battleType("single") + .enemyAbility(Abilities.NONE) + .enemySpecies(Species.MEW) + .enemyLevel(200) + .moveset([ Moves.GUARD_SPLIT ]) + .ability(Abilities.NONE); + }); + + it("should average the user's DEF and SPDEF stats with those of the target", async () => { + game.override.enemyMoveset(SPLASH_ONLY); + await game.startBattle([ + Species.INDEEDEE + ]); + + const player = game.scene.getPlayerPokemon()!; + const enemy = game.scene.getEnemyPokemon()!; + + const avgDef = Math.floor((player.getStat(Stat.DEF, false) + enemy.getStat(Stat.DEF, false)) / 2); + const avgSpDef = Math.floor((player.getStat(Stat.SPDEF, false) + enemy.getStat(Stat.SPDEF, false)) / 2); + + game.move.select(Moves.GUARD_SPLIT); + await game.phaseInterceptor.to(TurnEndPhase); + + expect(player.getStat(Stat.DEF, false)).toBe(avgDef); + expect(enemy.getStat(Stat.DEF, false)).toBe(avgDef); + + expect(player.getStat(Stat.SPDEF, false)).toBe(avgSpDef); + expect(enemy.getStat(Stat.SPDEF, false)).toBe(avgSpDef); + }, 20000); + + it("should be idempotent", async () => { + game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT)); + await game.startBattle([ + Species.INDEEDEE + ]); + + const player = game.scene.getPlayerPokemon()!; + const enemy = game.scene.getEnemyPokemon()!; + + const avgDef = Math.floor((player.getStat(Stat.DEF, false) + enemy.getStat(Stat.DEF, false)) / 2); + const avgSpDef = Math.floor((player.getStat(Stat.SPDEF, false) + enemy.getStat(Stat.SPDEF, false)) / 2); + + game.move.select(Moves.GUARD_SPLIT); + await game.phaseInterceptor.to(TurnEndPhase); + + game.move.select(Moves.GUARD_SPLIT); + await game.phaseInterceptor.to(TurnEndPhase); + + expect(player.getStat(Stat.DEF, false)).toBe(avgDef); + expect(enemy.getStat(Stat.DEF, false)).toBe(avgDef); + + expect(player.getStat(Stat.SPDEF, false)).toBe(avgSpDef); + expect(enemy.getStat(Stat.SPDEF, false)).toBe(avgSpDef); + }, 20000); +}); diff --git a/src/test/moves/guard_swap.test.ts b/src/test/moves/guard_swap.test.ts new file mode 100644 index 00000000000..407d475de09 --- /dev/null +++ b/src/test/moves/guard_swap.test.ts @@ -0,0 +1,63 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { MoveEndPhase } from "#app/phases/move-end-phase"; + +describe("Moves - Guard Swap", () => { + 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 + .battleType("single") + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH)) + .enemySpecies(Species.MEW) + .enemyLevel(200) + .moveset([ Moves.GUARD_SWAP ]) + .ability(Abilities.NONE); + }); + + it("should swap the user's DEF AND SPDEF stat stages with the target's", async () => { + await game.startBattle([ + Species.INDEEDEE + ]); + + // Should start with no stat stages + const player = game.scene.getPlayerPokemon()!; + // After Shell Smash, should have +2 in ATK and SPATK, -1 in DEF and SPDEF + const enemy = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.GUARD_SWAP); + + await game.phaseInterceptor.to(MoveEndPhase); + + expect(player.getStatStage(Stat.DEF)).toBe(0); + expect(player.getStatStage(Stat.SPDEF)).toBe(0); + expect(enemy.getStatStage(Stat.DEF)).toBe(-1); + expect(enemy.getStatStage(Stat.SPDEF)).toBe(-1); + + await game.phaseInterceptor.to(TurnEndPhase); + + expect(player.getStatStage(Stat.DEF)).toBe(-1); + expect(player.getStatStage(Stat.SPDEF)).toBe(-1); + expect(enemy.getStatStage(Stat.DEF)).toBe(0); + expect(enemy.getStatStage(Stat.SPDEF)).toBe(0); + }, 20000); +}); diff --git a/src/test/moves/haze.test.ts b/src/test/moves/haze.test.ts index 8a32a40cb32..42081ce74e8 100644 --- a/src/test/moves/haze.test.ts +++ b/src/test/moves/haze.test.ts @@ -1,13 +1,12 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Haze", () => { describe("integration tests", () => { @@ -37,44 +36,28 @@ describe("Moves - Haze", () => { game.override.ability(Abilities.NONE); }); - it("Uses Swords Dance to raise own ATK by 2, Charm to lower enemy ATK by 2, player uses Haze to clear all stat changes", { timeout: 10000 }, async () => { + it("should reset all stat changes of all Pokemon on field", { timeout: 10000 }, async () => { await game.startBattle([Species.RATTATA]); const user = game.scene.getPlayerPokemon()!; const enemy = game.scene.getEnemyPokemon()!; - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(enemy.summonData.battleStats[BattleStat.ATK]).toBe(0); + + expect(user.getStatStage(Stat.ATK)).toBe(0); + expect(enemy.getStatStage(Stat.ATK)).toBe(0); game.move.select(Moves.SWORDS_DANCE); await game.phaseInterceptor.to(TurnInitPhase); game.move.select(Moves.CHARM); await game.phaseInterceptor.to(TurnInitPhase); - const userAtkBefore = user.summonData.battleStats[BattleStat.ATK]; - const enemyAtkBefore = enemy.summonData.battleStats[BattleStat.ATK]; - expect(userAtkBefore).toBe(2); - expect(enemyAtkBefore).toBe(-2); + + expect(user.getStatStage(Stat.ATK)).toBe(2); + expect(enemy.getStatStage(Stat.ATK)).toBe(-2); game.move.select(Moves.HAZE); await game.phaseInterceptor.to(TurnInitPhase); - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(enemy.summonData.battleStats[BattleStat.ATK]).toBe(0); - }); - it("Uses Swords Dance to raise own ATK by 2, Charm to lower enemy ATK by 2, enemy uses Haze to clear all stat changes", { timeout: 10000 }, async () => { - game.override.enemyMoveset([Moves.HAZE, Moves.HAZE, Moves.HAZE, Moves.HAZE]); - await game.startBattle([Species.SHUCKLE]); // Shuckle for slower Swords Dance on first turn so Haze doesn't affect it. - const user = game.scene.getPlayerPokemon()!; - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); - - game.move.select(Moves.SWORDS_DANCE); - await game.phaseInterceptor.to(TurnInitPhase); - - const userAtkBefore = user.summonData.battleStats[BattleStat.ATK]; - expect(userAtkBefore).toBe(2); - - game.move.select(Moves.SPLASH); - await game.phaseInterceptor.to(MoveEndPhase); - expect(user.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(user.getStatStage(Stat.ATK)).toBe(0); + expect(enemy.getStatStage(Stat.ATK)).toBe(0); }); }); }); diff --git a/src/test/moves/lash_out.test.ts b/src/test/moves/lash_out.test.ts index 78f4b712cf0..74d9fcd66c0 100644 --- a/src/test/moves/lash_out.test.ts +++ b/src/test/moves/lash_out.test.ts @@ -39,7 +39,7 @@ describe("Moves - Lash Out", () => { }); - it("should deal double damage if the user's stats were lowered this turn", async () => { + it("should deal double damage if the user's stat stages were lowered this turn", async () => { vi.spyOn(allMoves[Moves.LASH_OUT], "calculateBattlePower"); await game.classicMode.startBattle(); diff --git a/src/test/moves/make_it_rain.test.ts b/src/test/moves/make_it_rain.test.ts index 0af7763f175..e41472d7561 100644 --- a/src/test/moves/make_it_rain.test.ts +++ b/src/test/moves/make_it_rain.test.ts @@ -1,13 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { MoveEndPhase } from "#app/phases/move-end-phase"; -import { StatChangePhase } from "#app/phases/stat-change-phase"; +import { Stat } from "#enums/stat"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; const TIMEOUT = 20 * 1000; @@ -36,17 +36,17 @@ describe("Moves - Make It Rain", () => { game.override.enemyLevel(100); }); - it("should only reduce Sp. Atk. once in a double battle", async () => { + it("should only lower SPATK stat stage by 1 once in a double battle", async () => { await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); - const playerPokemon = game.scene.getPlayerField(); + const playerPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.MAKE_IT_RAIN); game.move.select(Moves.SPLASH, 1); await game.phaseInterceptor.to(MoveEndPhase); - expect(playerPokemon[0].summonData.battleStats[BattleStat.SPATK]).toBe(-1); + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(-1); }, TIMEOUT); it("should apply effects even if the target faints", async () => { @@ -60,10 +60,10 @@ describe("Moves - Make It Rain", () => { game.move.select(Moves.MAKE_IT_RAIN); - await game.phaseInterceptor.to(StatChangePhase); + await game.phaseInterceptor.to(StatStageChangePhase); expect(enemyPokemon.isFainted()).toBe(true); - expect(playerPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(-1); + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(-1); }, TIMEOUT); it("should reduce Sp. Atk. once after KOing two enemies", async () => { @@ -71,22 +71,22 @@ describe("Moves - Make It Rain", () => { await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); - const playerPokemon = game.scene.getPlayerField(); + const playerPokemon = game.scene.getPlayerPokemon()!; const enemyPokemon = game.scene.getEnemyField(); game.move.select(Moves.MAKE_IT_RAIN); game.move.select(Moves.SPLASH, 1); - await game.phaseInterceptor.to(StatChangePhase); + await game.phaseInterceptor.to(StatStageChangePhase); enemyPokemon.forEach(p => expect(p.isFainted()).toBe(true)); - expect(playerPokemon[0].summonData.battleStats[BattleStat.SPATK]).toBe(-1); + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(-1); }, TIMEOUT); - it("should reduce Sp. Atk if it only hits the second target", async () => { + it("should lower SPATK stat stage by 1 if it only hits the second target", async () => { await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); - const playerPokemon = game.scene.getPlayerField(); + const playerPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.MAKE_IT_RAIN); game.move.select(Moves.SPLASH, 1); @@ -96,6 +96,6 @@ describe("Moves - Make It Rain", () => { await game.phaseInterceptor.to(MoveEndPhase); - expect(playerPokemon[0].summonData.battleStats[BattleStat.SPATK]).toBe(-1); + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(-1); }, TIMEOUT); }); diff --git a/src/test/moves/mat_block.test.ts b/src/test/moves/mat_block.test.ts index 29a97806242..4a95985eb92 100644 --- a/src/test/moves/mat_block.test.ts +++ b/src/test/moves/mat_block.test.ts @@ -1,13 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; -import { Abilities } from "#enums/abilities"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import GameManager from "../utils/gameManager"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +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"; const TIMEOUT = 20 * 1000; @@ -76,7 +76,7 @@ describe("Moves - Mat Block", () => { await game.phaseInterceptor.to(BerryPhase, false); - leadPokemon.forEach(p => expect(p.summonData.battleStats[BattleStat.ATK]).toBe(-2)); + leadPokemon.forEach(p => expect(p.getStatStage(Stat.ATK)).toBe(-2)); }, TIMEOUT ); diff --git a/src/test/moves/octolock.test.ts b/src/test/moves/octolock.test.ts index 34dad13b0d9..c86906ea240 100644 --- a/src/test/moves/octolock.test.ts +++ b/src/test/moves/octolock.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { TrappedTag } from "#app/data/battler-tags"; import { CommandPhase } from "#app/phases/command-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase"; @@ -12,110 +12,106 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; describe("Moves - Octolock", () => { - describe("integration tests", () => { - let phaserGame: Phaser.Game; - let game: GameManager; + 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.battleType("single"); - - game.override.enemySpecies(Species.RATTATA); - game.override.enemyMoveset(SPLASH_ONLY); - game.override.enemyAbility(Abilities.BALL_FETCH); - - game.override.startingLevel(2000); - game.override.moveset([Moves.OCTOLOCK, Moves.SPLASH]); - game.override.ability(Abilities.BALL_FETCH); - }); - - it("Reduces DEf and SPDEF by 1 each turn", { timeout: 10000 }, async () => { - await game.startBattle([Species.GRAPPLOCT]); - - const enemyPokemon = game.scene.getEnemyField(); - - // use Octolock and advance to init phase of next turn to check for stat changes - game.move.select(Moves.OCTOLOCK); - await game.phaseInterceptor.to(TurnInitPhase); - - expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(-1); - expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(-1); - - // take a second turn to make sure stat changes occur again - await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.SPLASH); - - await game.phaseInterceptor.to(TurnInitPhase); - expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(-2); - expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(-2); - }); - - it("If target pokemon has Big Pecks, Octolock should only reduce spdef by 1", { timeout: 10000 }, async () => { - game.override.enemyAbility(Abilities.BIG_PECKS); - await game.startBattle([Species.GRAPPLOCT]); - - const enemyPokemon = game.scene.getEnemyField(); - - // use Octolock and advance to init phase of next turn to check for stat changes - game.move.select(Moves.OCTOLOCK); - await game.phaseInterceptor.to(TurnInitPhase); - - expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(-1); - }); - - it("If target pokemon has White Smoke, Octolock should not reduce any stats", { timeout: 10000 }, async () => { - game.override.enemyAbility(Abilities.WHITE_SMOKE); - await game.startBattle([Species.GRAPPLOCT]); - - const enemyPokemon = game.scene.getEnemyField(); - - // use Octolock and advance to init phase of next turn to check for stat changes - game.move.select(Moves.OCTOLOCK); - await game.phaseInterceptor.to(TurnInitPhase); - - expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(0); - }); - - it("If target pokemon has Clear Body, Octolock should not reduce any stats", { timeout: 10000 }, async () => { - game.override.enemyAbility(Abilities.CLEAR_BODY); - await game.startBattle([Species.GRAPPLOCT]); - - const enemyPokemon = game.scene.getEnemyField(); - - // use Octolock and advance to init phase of next turn to check for stat changes - game.move.select(Moves.OCTOLOCK); - await game.phaseInterceptor.to(TurnInitPhase); - - expect(enemyPokemon[0].summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(enemyPokemon[0].summonData.battleStats[BattleStat.SPDEF]).toBe(0); - }); - - it("Traps the target pokemon", { timeout: 10000 }, async () => { - await game.startBattle([Species.GRAPPLOCT]); - - const enemyPokemon = game.scene.getEnemyField(); - - // before Octolock - enemy should not be trapped - expect(enemyPokemon[0].findTag(t => t instanceof TrappedTag)).toBeUndefined(); - - game.move.select(Moves.OCTOLOCK); - - // after Octolock - enemy should be trapped - await game.phaseInterceptor.to(MoveEndPhase); - expect(enemyPokemon[0].findTag(t => t instanceof TrappedTag)).toBeDefined(); + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, }); }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + + game.override.battleType("single") + .enemySpecies(Species.RATTATA) + .enemyMoveset(SPLASH_ONLY) + .enemyAbility(Abilities.BALL_FETCH) + .startingLevel(2000) + .moveset([ Moves.OCTOLOCK, Moves.SPLASH ]) + .ability(Abilities.BALL_FETCH); + }); + + it("lowers DEF and SPDEF stat stages of the target Pokemon by 1 each turn", { timeout: 10000 }, async () => { + await game.classicMode.startBattle([ Species.GRAPPLOCT ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(-1); + expect(enemyPokemon.getStatStage(Stat.SPDEF)).toBe(-1); + + // take a second turn to make sure stat changes occur again + await game.phaseInterceptor.to(CommandPhase); + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to(TurnInitPhase); + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(-2); + expect(enemyPokemon.getStatStage(Stat.SPDEF)).toBe(-2); + }); + + it("if target pokemon has BIG_PECKS, should only lower SPDEF stat stage by 1", { timeout: 10000 }, async () => { + game.override.enemyAbility(Abilities.BIG_PECKS); + await game.classicMode.startBattle([ Species.GRAPPLOCT ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPDEF)).toBe(-1); + }); + + it("if target pokemon has WHITE_SMOKE, should not reduce any stat stages", { timeout: 10000 }, async () => { + game.override.enemyAbility(Abilities.WHITE_SMOKE); + await game.classicMode.startBattle([ Species.GRAPPLOCT ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPDEF)).toBe(0); + }); + + it("if target pokemon has CLEAR_BODY, should not reduce any stat stages", { timeout: 10000 }, async () => { + game.override.enemyAbility(Abilities.CLEAR_BODY); + await game.classicMode.startBattle([ Species.GRAPPLOCT ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + // use Octolock and advance to init phase of next turn to check for stat changes + game.move.select(Moves.OCTOLOCK); + await game.phaseInterceptor.to(TurnInitPhase); + + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPDEF)).toBe(0); + }); + + it("traps the target pokemon", { timeout: 10000 }, async () => { + await game.classicMode.startBattle([ Species.GRAPPLOCT ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + // before Octolock - enemy should not be trapped + expect(enemyPokemon.findTag(t => t instanceof TrappedTag)).toBeUndefined(); + + game.move.select(Moves.OCTOLOCK); + + // after Octolock - enemy should be trapped + await game.phaseInterceptor.to(MoveEndPhase); + expect(enemyPokemon.findTag(t => t instanceof TrappedTag)).toBeDefined(); + }); }); diff --git a/src/test/moves/parting_shot.test.ts b/src/test/moves/parting_shot.test.ts index 7c2ca3f334c..d9535ca6482 100644 --- a/src/test/moves/parting_shot.test.ts +++ b/src/test/moves/parting_shot.test.ts @@ -1,14 +1,14 @@ -import { BattleStat } from "#app/data/battle-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"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, test } from "vitest"; import GameManager from "../utils/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"; import { SPLASH_ONLY } from "../utils/testUtils"; const TIMEOUT = 20 * 1000; @@ -51,9 +51,8 @@ describe("Moves - Parting Shot", () => { game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - const battleStatsOpponent = enemyPokemon.summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(0); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MURKROW); }, TIMEOUT ); @@ -72,9 +71,8 @@ describe("Moves - Parting Shot", () => { game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - const battleStatsOpponent = enemyPokemon.summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(0); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MURKROW); }, TIMEOUT ); @@ -108,16 +106,15 @@ describe("Moves - Parting Shot", () => { const enemyPokemon = game.scene.getEnemyPokemon()!; expect(enemyPokemon).toBeDefined(); - const battleStatsOpponent = enemyPokemon.summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-6); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(-6); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-6); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(-6); // now parting shot should fail game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-6); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(-6); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-6); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(-6); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MURKROW); }, TIMEOUT ); @@ -137,9 +134,8 @@ describe("Moves - Parting Shot", () => { game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - const battleStatsOpponent = enemyPokemon.summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(0); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MURKROW); }, TIMEOUT ); @@ -158,9 +154,8 @@ describe("Moves - Parting Shot", () => { game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - const battleStatsOpponent = enemyPokemon.summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(0); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MURKROW); }, TIMEOUT ); @@ -176,9 +171,8 @@ describe("Moves - Parting Shot", () => { game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - const battleStatsOpponent = enemyPokemon.summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(-1); + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(-1); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MURKROW); }, TIMEOUT ); @@ -199,9 +193,9 @@ describe("Moves - Parting Shot", () => { game.move.select(Moves.PARTING_SHOT); await game.phaseInterceptor.to(BerryPhase, false); - const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.ATK]).toBe(0); - expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0); + const enemyPokemon = game.scene.getEnemyPokemon()!; + expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(enemyPokemon.getStatStage(Stat.SPATK)).toBe(0); expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MEOWTH); }, TIMEOUT ); diff --git a/src/test/moves/power_split.test.ts b/src/test/moves/power_split.test.ts new file mode 100644 index 00000000000..a532a90a54d --- /dev/null +++ b/src/test/moves/power_split.test.ts @@ -0,0 +1,82 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +describe("Moves - Power Split", () => { + 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 + .battleType("single") + .enemyAbility(Abilities.NONE) + .enemySpecies(Species.MEW) + .enemyLevel(200) + .moveset([ Moves.POWER_SPLIT ]) + .ability(Abilities.NONE); + }); + + it("should average the user's ATK and SPATK stats with those of the target", async () => { + game.override.enemyMoveset(SPLASH_ONLY); + await game.startBattle([ + Species.INDEEDEE + ]); + + 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(Moves.POWER_SPLIT); + 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); + }, 20000); + + it("should be idempotent", async () => { + game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT)); + await game.startBattle([ + Species.INDEEDEE + ]); + + 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(Moves.POWER_SPLIT); + await game.phaseInterceptor.to(TurnEndPhase); + + game.move.select(Moves.POWER_SPLIT); + 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); + }, 20000); +}); diff --git a/src/test/moves/power_swap.test.ts b/src/test/moves/power_swap.test.ts new file mode 100644 index 00000000000..f1efeaa3af3 --- /dev/null +++ b/src/test/moves/power_swap.test.ts @@ -0,0 +1,62 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { MoveEndPhase } from "#app/phases/move-end-phase"; + +describe("Moves - Power Swap", () => { + 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 + .battleType("single") + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH)) + .enemySpecies(Species.MEW) + .enemyLevel(200) + .moveset([ Moves.POWER_SWAP ]) + .ability(Abilities.NONE); + }); + + it("should swap the user's ATK AND SPATK stat stages with the target's", async () => { + await game.startBattle([ + Species.INDEEDEE + ]); + + // Should start with no stat stages + const player = game.scene.getPlayerPokemon()!; + // After Shell Smash, should have +2 in ATK and SPATK, -1 in DEF and SPDEF + const enemy = game.scene.getEnemyPokemon()!; + game.move.select(Moves.POWER_SWAP); + + await game.phaseInterceptor.to(MoveEndPhase); + + expect(player.getStatStage(Stat.ATK)).toBe(0); + expect(player.getStatStage(Stat.SPATK)).toBe(0); + expect(enemy.getStatStage(Stat.ATK)).toBe(2); + expect(enemy.getStatStage(Stat.SPATK)).toBe(2); + + await game.phaseInterceptor.to(TurnEndPhase); + + expect(player.getStatStage(Stat.ATK)).toBe(2); + expect(player.getStatStage(Stat.SPATK)).toBe(2); + expect(enemy.getStatStage(Stat.ATK)).toBe(0); + expect(enemy.getStatStage(Stat.SPATK)).toBe(0); + }, 20000); +}); diff --git a/src/test/moves/protect.test.ts b/src/test/moves/protect.test.ts index 3fd51f4bc93..83cd088aa47 100644 --- a/src/test/moves/protect.test.ts +++ b/src/test/moves/protect.test.ts @@ -1,13 +1,14 @@ -import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; -import { BattleStat } from "#app/data/battle-stat"; -import { allMoves } from "#app/data/move"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { Abilities } from "#enums/abilities"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; import GameManager from "../utils/gameManager"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { allMoves } from "#app/data/move"; +import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; +import { BattlerIndex } from "#app/battle"; +import { MoveResult } from "#app/field/pokemon"; const TIMEOUT = 20 * 1000; @@ -43,13 +44,13 @@ describe("Moves - Protect", () => { test( "should protect the user from attacks", async () => { - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.CHARIZARD]); const leadPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.PROTECT); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); }, TIMEOUT @@ -61,13 +62,13 @@ describe("Moves - Protect", () => { game.override.enemyMoveset(Array(4).fill(Moves.CEASELESS_EDGE)); vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.CHARIZARD]); const leadPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.PROTECT); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); expect(game.scene.arena.getTagOnSide(ArenaTrapTag, ArenaTagSide.ENEMY)).toBeUndefined(); @@ -79,15 +80,15 @@ describe("Moves - Protect", () => { async () => { game.override.enemyMoveset(Array(4).fill(Moves.CHARM)); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.CHARIZARD]); const leadPokemon = game.scene.getPlayerPokemon()!; game.move.select(Moves.PROTECT); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); }, TIMEOUT ); @@ -96,18 +97,38 @@ describe("Moves - Protect", () => { async () => { game.override.enemyMoveset(Array(4).fill(Moves.TACHYON_CUTTER)); - await game.startBattle([Species.CHARIZARD]); + await game.classicMode.startBattle([Species.CHARIZARD]); const leadPokemon = game.scene.getPlayerPokemon()!; - const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.PROTECT); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); expect(enemyPokemon.turnData.hitCount).toBe(1); }, TIMEOUT ); + + test( + "should fail if the user is the last to move in the turn", + async () => { + game.override.enemyMoveset(Array(4).fill(Moves.PROTECT)); + + await game.classicMode.startBattle([Species.CHARIZARD]); + + const leadPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.PROTECT); + + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + + await game.phaseInterceptor.to("BerryPhase", false); + + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(leadPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + }, TIMEOUT + ); }); diff --git a/src/test/moves/quick_guard.test.ts b/src/test/moves/quick_guard.test.ts index 26d9a74e9fd..5f4af40eb71 100644 --- a/src/test/moves/quick_guard.test.ts +++ b/src/test/moves/quick_guard.test.ts @@ -1,12 +1,12 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { Abilities } from "#enums/abilities"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import GameManager from "../utils/gameManager"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { BattlerIndex } from "#app/battle"; +import { MoveResult } from "#app/field/pokemon"; const TIMEOUT = 20 * 1000; @@ -42,19 +42,16 @@ describe("Moves - Quick Guard", () => { test( "should protect the user and allies from priority moves", async () => { - await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); + await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]); - const leadPokemon = game.scene.getPlayerField(); + const playerPokemon = game.scene.getPlayerField(); game.move.select(Moves.QUICK_GUARD); - - await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.SPLASH, 1); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - leadPokemon.forEach(p => expect(p.hp).toBe(p.getMaxHp())); + playerPokemon.forEach(p => expect(p.hp).toBe(p.getMaxHp())); }, TIMEOUT ); @@ -64,19 +61,16 @@ describe("Moves - Quick Guard", () => { game.override.enemyAbility(Abilities.PRANKSTER); game.override.enemyMoveset(Array(4).fill(Moves.GROWL)); - await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); + await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]); - const leadPokemon = game.scene.getPlayerField(); + const playerPokemon = game.scene.getPlayerField(); game.move.select(Moves.QUICK_GUARD); - - await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.SPLASH, 1); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - leadPokemon.forEach(p => expect(p.summonData.battleStats[BattleStat.ATK]).toBe(0)); + playerPokemon.forEach(p => expect(p.getStatStage(Stat.ATK)).toBe(0)); }, TIMEOUT ); @@ -85,21 +79,40 @@ describe("Moves - Quick Guard", () => { async () => { game.override.enemyMoveset(Array(4).fill(Moves.WATER_SHURIKEN)); - await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]); + await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]); - const leadPokemon = game.scene.getPlayerField(); + const playerPokemon = game.scene.getPlayerField(); const enemyPokemon = game.scene.getEnemyField(); game.move.select(Moves.QUICK_GUARD); - - await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.FOLLOW_ME, 1); - await game.phaseInterceptor.to(BerryPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - leadPokemon.forEach(p => expect(p.hp).toBe(p.getMaxHp())); + playerPokemon.forEach(p => expect(p.hp).toBe(p.getMaxHp())); enemyPokemon.forEach(p => expect(p.turnData.hitCount).toBe(1)); } ); + + test( + "should fail if the user is the last to move in the turn", + async () => { + game.override.battleType("single"); + game.override.enemyMoveset(Array(4).fill(Moves.QUICK_GUARD)); + + await game.classicMode.startBattle([Species.CHARIZARD]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.QUICK_GUARD); + + await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + + await game.phaseInterceptor.to("BerryPhase", false); + + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(playerPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + }, TIMEOUT + ); }); diff --git a/src/test/moves/rage_powder.test.ts b/src/test/moves/rage_powder.test.ts index 3e78c6fe0c9..86bc48ef882 100644 --- a/src/test/moves/rage_powder.test.ts +++ b/src/test/moves/rage_powder.test.ts @@ -1,5 +1,4 @@ import { BattlerIndex } from "#app/battle"; -import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -26,32 +25,31 @@ describe("Moves - Rage Powder", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override.battleType("double"); - game.override.starterSpecies(Species.AMOONGUSS); game.override.enemySpecies(Species.SNORLAX); game.override.startingLevel(100); game.override.enemyLevel(100); game.override.moveset([Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.enemyMoveset([Moves.RAGE_POWDER, Moves.TACKLE, Moves.SPLASH]); }); test( "move effect should be bypassed by Grass type", async () => { - game.override.enemyMoveset([Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER]); - - await game.startBattle([Species.AMOONGUSS, Species.VENUSAUR]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.VENUSAUR]); const enemyPokemon = game.scene.getEnemyField(); - const enemyStartingHp = enemyPokemon.map(p => p.hp); - game.move.select(Moves.QUICK_ATTACK, 0, BattlerIndex.ENEMY); game.move.select(Moves.QUICK_ATTACK, 1, BattlerIndex.ENEMY_2); - await game.phaseInterceptor.to(TurnEndPhase, false); + + await game.forceEnemyMove(Moves.RAGE_POWDER); + await game.forceEnemyMove(Moves.SPLASH); + + await game.phaseInterceptor.to("BerryPhase", false); // If redirection was bypassed, both enemies should be damaged - expect(enemyPokemon[0].hp).toBeLessThan(enemyStartingHp[0]); - expect(enemyPokemon[1].hp).toBeLessThan(enemyStartingHp[1]); + expect(enemyPokemon[0].hp).toBeLessThan(enemyPokemon[0].getMaxHp()); + expect(enemyPokemon[1].hp).toBeLessThan(enemyPokemon[0].getMaxHp()); }, TIMEOUT ); @@ -59,10 +57,9 @@ describe("Moves - Rage Powder", () => { "move effect should be bypassed by Overcoat", async () => { game.override.ability(Abilities.OVERCOAT); - game.override.enemyMoveset([Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER]); // Test with two non-Grass type player Pokemon - await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]); const enemyPokemon = game.scene.getEnemyField(); @@ -70,7 +67,11 @@ describe("Moves - Rage Powder", () => { game.move.select(Moves.QUICK_ATTACK, 0, BattlerIndex.ENEMY); game.move.select(Moves.QUICK_ATTACK, 1, BattlerIndex.ENEMY_2); - await game.phaseInterceptor.to(TurnEndPhase, false); + + await game.forceEnemyMove(Moves.RAGE_POWDER); + await game.forceEnemyMove(Moves.SPLASH); + + await game.phaseInterceptor.to("BerryPhase", false); // If redirection was bypassed, both enemies should be damaged expect(enemyPokemon[0].hp).toBeLessThan(enemyStartingHp[0]); diff --git a/src/test/moves/speed_swap.test.ts b/src/test/moves/speed_swap.test.ts new file mode 100644 index 00000000000..131d506792b --- /dev/null +++ b/src/test/moves/speed_swap.test.ts @@ -0,0 +1,54 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +describe("Moves - Speed Swap", () => { + 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 + .battleType("single") + .enemyAbility(Abilities.NONE) + .enemyMoveset(SPLASH_ONLY) + .enemySpecies(Species.MEW) + .enemyLevel(200) + .moveset([ Moves.SPEED_SWAP ]) + .ability(Abilities.NONE); + }); + + it("should swap the user's SPD and the target's SPD stats", async () => { + await game.startBattle([ + Species.INDEEDEE + ]); + + const player = game.scene.getPlayerPokemon()!; + const enemy = game.scene.getEnemyPokemon()!; + + const playerSpd = player.getStat(Stat.SPD, false); + const enemySpd = enemy.getStat(Stat.SPD, false); + + game.move.select(Moves.SPEED_SWAP); + await game.phaseInterceptor.to(TurnEndPhase); + + expect(player.getStat(Stat.SPD, false)).toBe(enemySpd); + expect(enemy.getStat(Stat.SPD, false)).toBe(playerSpd); + }, 20000); +}); diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index 05ea717ebbe..fa2e7521152 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -73,7 +73,7 @@ describe("Moves - Spikes", () => { await game.toNextTurn(); game.move.select(Moves.SPLASH); - game.forceOpponentToSwitch(); + game.forceEnemyToSwitch(); await game.toNextTurn(); const enemy = game.scene.getEnemyParty()[0]; diff --git a/src/test/moves/spit_up.test.ts b/src/test/moves/spit_up.test.ts index ab47e65d653..f88791efb74 100644 --- a/src/test/moves/spit_up.test.ts +++ b/src/test/moves/spit_up.test.ts @@ -1,22 +1,24 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; import { allMoves } from "#app/data/move"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { MoveResult, TurnMove } from "#app/field/pokemon"; -import { MovePhase } from "#app/phases/move-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; -import { SPLASH_ONLY } from "#test/utils/testUtils"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { SPLASH_ONLY } from "#test/utils/testUtils"; +import { MovePhase } from "#app/phases/move-phase"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Spit Up", () => { let phaserGame: Phaser.Game; let game: GameManager; + const spitUp = allMoves[Moves.SPIT_UP]; + beforeAll(() => { phaserGame = new Phaser.Game({ type: Phaser.HEADLESS }); }); @@ -35,8 +37,10 @@ describe("Moves - Spit Up", () => { game.override.enemyAbility(Abilities.NONE); game.override.enemyLevel(2000); - game.override.moveset([Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP, Moves.SPIT_UP]); + game.override.moveset(new Array(4).fill(spitUp.id)); game.override.ability(Abilities.NONE); + + vi.spyOn(spitUp, "calculateBattlePower"); }); describe("consumes all stockpile stacks to deal damage (scaling with stacks)", () => { @@ -53,13 +57,11 @@ describe("Moves - Spit Up", () => { expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(stacksToSetup); - vi.spyOn(allMoves[Moves.SPIT_UP], "calculateBattlePower"); - game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveBeenCalledOnce(); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveReturnedWith(expectedPower); + expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); + expect(spitUp.calculateBattlePower).toHaveReturnedWith(expectedPower); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); @@ -78,13 +80,11 @@ describe("Moves - Spit Up", () => { expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(stacksToSetup); - vi.spyOn(allMoves[Moves.SPIT_UP], "calculateBattlePower"); - game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveBeenCalledOnce(); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveReturnedWith(expectedPower); + expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); + expect(spitUp.calculateBattlePower).toHaveReturnedWith(expectedPower); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); @@ -104,13 +104,11 @@ describe("Moves - Spit Up", () => { expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(stacksToSetup); - vi.spyOn(allMoves[Moves.SPIT_UP], "calculateBattlePower"); - game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveBeenCalledOnce(); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveReturnedWith(expectedPower); + expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); + expect(spitUp.calculateBattlePower).toHaveReturnedWith(expectedPower); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); @@ -124,14 +122,12 @@ describe("Moves - Spit Up", () => { const stockpilingTag = pokemon.getTag(StockpilingTag)!; expect(stockpilingTag).toBeUndefined(); - vi.spyOn(allMoves[Moves.SPIT_UP], "calculateBattlePower"); - game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.FAIL }); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).not.toHaveBeenCalled(); + expect(spitUp.calculateBattlePower).not.toHaveBeenCalled(); }); describe("restores stat boosts granted by stacks", () => { @@ -144,22 +140,20 @@ describe("Moves - Spit Up", () => { const stockpilingTag = pokemon.getTag(StockpilingTag)!; expect(stockpilingTag).toBeDefined(); - vi.spyOn(allMoves[Moves.SPIT_UP], "calculateBattlePower"); - game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(MovePhase); - expect(pokemon.summonData.battleStats[BattleStat.DEF]).toBe(1); - expect(pokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(1); + expect(pokemon.getStatStage(Stat.DEF)).toBe(1); + expect(pokemon.getStatStage(Stat.SPDEF)).toBe(1); await game.phaseInterceptor.to(TurnInitPhase); expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS }); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveBeenCalledOnce(); + expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); - expect(pokemon.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(pokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(0); + expect(pokemon.getStatStage(Stat.DEF)).toBe(0); + expect(pokemon.getStatStage(Stat.SPDEF)).toBe(0); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); @@ -175,26 +169,19 @@ describe("Moves - Spit Up", () => { // for the sake of simplicity (and because other tests cover the setup), set boost amounts directly stockpilingTag.statChangeCounts = { - [BattleStat.DEF]: -1, - [BattleStat.SPDEF]: 2, + [Stat.DEF]: -1, + [Stat.SPDEF]: 2, }; - expect(stockpilingTag.statChangeCounts).toMatchObject({ - [BattleStat.DEF]: -1, - [BattleStat.SPDEF]: 2, - }); - - vi.spyOn(allMoves[Moves.SPIT_UP], "calculateBattlePower"); - game.move.select(Moves.SPIT_UP); await game.phaseInterceptor.to(TurnInitPhase); expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SPIT_UP, result: MoveResult.SUCCESS }); - expect(allMoves[Moves.SPIT_UP].calculateBattlePower).toHaveBeenCalledOnce(); + expect(spitUp.calculateBattlePower).toHaveBeenCalledOnce(); - expect(pokemon.summonData.battleStats[BattleStat.DEF]).toBe(1); - expect(pokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(-2); + expect(pokemon.getStatStage(Stat.DEF)).toBe(1); + expect(pokemon.getStatStage(Stat.SPDEF)).toBe(-2); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); diff --git a/src/test/moves/spotlight.test.ts b/src/test/moves/spotlight.test.ts index e5f4719d1d3..aef44369642 100644 --- a/src/test/moves/spotlight.test.ts +++ b/src/test/moves/spotlight.test.ts @@ -1,5 +1,4 @@ import { BattlerIndex } from "#app/battle"; -import { Stat } from "#app/data/pokemon-stat"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -31,52 +30,46 @@ describe("Moves - Spotlight", () => { game.override.startingLevel(100); game.override.enemyLevel(100); game.override.moveset([Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.enemyMoveset([Moves.FOLLOW_ME, Moves.SPLASH]); }); test( "move should redirect attacks to the target", async () => { - await game.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); const enemyPokemon = game.scene.getEnemyField(); - const enemyStartingHp = enemyPokemon.map(p => p.hp); - game.move.select(Moves.SPOTLIGHT, 0, BattlerIndex.ENEMY); game.move.select(Moves.QUICK_ATTACK, 1, BattlerIndex.ENEMY_2); + + await game.forceEnemyMove(Moves.SPLASH); + await game.forceEnemyMove(Moves.SPLASH); + await game.phaseInterceptor.to(TurnEndPhase, false); - expect(enemyPokemon[0].hp).toBeLessThan(enemyStartingHp[0]); - expect(enemyPokemon[1].hp).toBe(enemyStartingHp[1]); + expect(enemyPokemon[0].hp).toBeLessThan(enemyPokemon[0].getMaxHp()); + expect(enemyPokemon[1].hp).toBe(enemyPokemon[1].getMaxHp()); }, TIMEOUT ); test( "move should cause other redirection moves to fail", async () => { - game.override.enemyMoveset([Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME]); - - await game.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); + await game.classicMode.startBattle([Species.AMOONGUSS, Species.CHARIZARD]); const enemyPokemon = game.scene.getEnemyField(); - /** - * Spotlight will target the slower enemy. In this situation without Spotlight being used, - * the faster enemy would normally end up with the Center of Attention tag. - */ - enemyPokemon.sort((a, b) => b.getBattleStat(Stat.SPD) - a.getBattleStat(Stat.SPD)); - const spotTarget = enemyPokemon[1].getBattlerIndex(); - const attackTarget = enemyPokemon[0].getBattlerIndex(); + game.move.select(Moves.SPOTLIGHT, 0, BattlerIndex.ENEMY); + game.move.select(Moves.QUICK_ATTACK, 1, BattlerIndex.ENEMY_2); - const enemyStartingHp = enemyPokemon.map(p => p.hp); + await game.forceEnemyMove(Moves.SPLASH); + await game.forceEnemyMove(Moves.FOLLOW_ME); - game.move.select(Moves.SPOTLIGHT, 0, spotTarget); - game.move.select(Moves.QUICK_ATTACK, 1, attackTarget); - await game.phaseInterceptor.to(TurnEndPhase, false); + await game.phaseInterceptor.to("BerryPhase", false); - expect(enemyPokemon[1].hp).toBeLessThan(enemyStartingHp[1]); - expect(enemyPokemon[0].hp).toBe(enemyStartingHp[0]); + expect(enemyPokemon[0].hp).toBeLessThan(enemyPokemon[0].getMaxHp()); + expect(enemyPokemon[1].hp).toBe(enemyPokemon[1].getMaxHp()); }, TIMEOUT ); }); diff --git a/src/test/moves/stockpile.test.ts b/src/test/moves/stockpile.test.ts index b1941b9f9b3..d57768d0ffd 100644 --- a/src/test/moves/stockpile.test.ts +++ b/src/test/moves/stockpile.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; import { MoveResult, TurnMove } from "#app/field/pokemon"; import { CommandPhase } from "#app/phases/command-phase"; @@ -38,7 +38,7 @@ describe("Moves - Stockpile", () => { game.override.ability(Abilities.NONE); }); - it("Gains a stockpile stack and increases DEF and SPDEF by 1 on each use, fails at max stacks (3)", { timeout: 10000 }, async () => { + it("gains a stockpile stack and raises user's DEF and SPDEF stat stages by 1 on each use, fails at max stacks (3)", { timeout: 10000 }, async () => { await game.startBattle([Species.ABOMASNOW]); const user = game.scene.getPlayerPokemon()!; @@ -47,8 +47,8 @@ describe("Moves - Stockpile", () => { // we just have to know that they're implemented as a BattlerTag. expect(user.getTag(StockpilingTag)).toBeUndefined(); - expect(user.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(user.summonData.battleStats[BattleStat.SPDEF]).toBe(0); + expect(user.getStatStage(Stat.DEF)).toBe(0); + expect(user.getStatStage(Stat.SPDEF)).toBe(0); // use Stockpile four times for (let i = 0; i < 4; i++) { @@ -60,18 +60,16 @@ describe("Moves - Stockpile", () => { await game.phaseInterceptor.to(TurnInitPhase); const stockpilingTag = user.getTag(StockpilingTag)!; - const def = user.summonData.battleStats[BattleStat.DEF]; - const spdef = user.summonData.battleStats[BattleStat.SPDEF]; if (i < 3) { // first three uses should behave normally - expect(def).toBe(i + 1); - expect(spdef).toBe(i + 1); + expect(user.getStatStage(Stat.DEF)).toBe(i + 1); + expect(user.getStatStage(Stat.SPDEF)).toBe(i + 1); expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(i + 1); } else { // fourth should have failed - expect(def).toBe(3); - expect(spdef).toBe(3); + expect(user.getStatStage(Stat.DEF)).toBe(3); + expect(user.getStatStage(Stat.SPDEF)).toBe(3); expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(3); expect(user.getMoveHistory().at(-1)).toMatchObject({ result: MoveResult.FAIL, move: Moves.STOCKPILE }); @@ -79,17 +77,17 @@ describe("Moves - Stockpile", () => { } }); - it("Gains a stockpile stack even if DEF and SPDEF are at +6", { timeout: 10000 }, async () => { + it("gains a stockpile stack even if user's DEF and SPDEF stat stages are at +6", { timeout: 10000 }, async () => { await game.startBattle([Species.ABOMASNOW]); const user = game.scene.getPlayerPokemon()!; - user.summonData.battleStats[BattleStat.DEF] = 6; - user.summonData.battleStats[BattleStat.SPDEF] = 6; + user.setStatStage(Stat.DEF, 6); + user.setStatStage(Stat.SPDEF, 6); expect(user.getTag(StockpilingTag)).toBeUndefined(); - expect(user.summonData.battleStats[BattleStat.DEF]).toBe(6); - expect(user.summonData.battleStats[BattleStat.SPDEF]).toBe(6); + expect(user.getStatStage(Stat.DEF)).toBe(6); + expect(user.getStatStage(Stat.SPDEF)).toBe(6); game.move.select(Moves.STOCKPILE); await game.phaseInterceptor.to(TurnInitPhase); @@ -97,8 +95,8 @@ describe("Moves - Stockpile", () => { const stockpilingTag = user.getTag(StockpilingTag)!; expect(stockpilingTag).toBeDefined(); expect(stockpilingTag.stockpiledCount).toBe(1); - expect(user.summonData.battleStats[BattleStat.DEF]).toBe(6); - expect(user.summonData.battleStats[BattleStat.SPDEF]).toBe(6); + expect(user.getStatStage(Stat.DEF)).toBe(6); + expect(user.getStatStage(Stat.SPDEF)).toBe(6); // do it again, just for good measure await game.phaseInterceptor.to(CommandPhase); @@ -109,8 +107,8 @@ describe("Moves - Stockpile", () => { const stockpilingTagAgain = user.getTag(StockpilingTag)!; expect(stockpilingTagAgain).toBeDefined(); expect(stockpilingTagAgain.stockpiledCount).toBe(2); - expect(user.summonData.battleStats[BattleStat.DEF]).toBe(6); - expect(user.summonData.battleStats[BattleStat.SPDEF]).toBe(6); + expect(user.getStatStage(Stat.DEF)).toBe(6); + expect(user.getStatStage(Stat.SPDEF)).toBe(6); }); }); }); diff --git a/src/test/moves/swallow.test.ts b/src/test/moves/swallow.test.ts index 202f25fee74..9cea7ae8dc9 100644 --- a/src/test/moves/swallow.test.ts +++ b/src/test/moves/swallow.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { MoveResult, TurnMove } from "#app/field/pokemon"; @@ -138,7 +138,7 @@ describe("Moves - Swallow", () => { expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.FAIL }); }); - describe("restores stat boosts granted by stacks", () => { + describe("restores stat stage boosts granted by stacks", () => { it("decreases stats based on stored values (both boosts equal)", { timeout: 10000 }, async () => { await game.startBattle([Species.ABOMASNOW]); @@ -151,20 +151,20 @@ describe("Moves - Swallow", () => { game.move.select(Moves.SWALLOW); await game.phaseInterceptor.to(MovePhase); - expect(pokemon.summonData.battleStats[BattleStat.DEF]).toBe(1); - expect(pokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(1); + expect(pokemon.getStatStage(Stat.DEF)).toBe(1); + expect(pokemon.getStatStage(Stat.SPDEF)).toBe(1); await game.phaseInterceptor.to(TurnInitPhase); expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.SUCCESS }); - expect(pokemon.summonData.battleStats[BattleStat.DEF]).toBe(0); - expect(pokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(0); + expect(pokemon.getStatStage(Stat.DEF)).toBe(0); + expect(pokemon.getStatStage(Stat.SPDEF)).toBe(0); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); - it("decreases stats based on stored values (different boosts)", { timeout: 10000 }, async () => { + it("lower stat stages based on stored values (different boosts)", { timeout: 10000 }, async () => { await game.startBattle([Species.ABOMASNOW]); const pokemon = game.scene.getPlayerPokemon()!; @@ -175,22 +175,18 @@ describe("Moves - Swallow", () => { // for the sake of simplicity (and because other tests cover the setup), set boost amounts directly stockpilingTag.statChangeCounts = { - [BattleStat.DEF]: -1, - [BattleStat.SPDEF]: 2, + [Stat.DEF]: -1, + [Stat.SPDEF]: 2, }; - expect(stockpilingTag.statChangeCounts).toMatchObject({ - [BattleStat.DEF]: -1, - [BattleStat.SPDEF]: 2, - }); - game.move.select(Moves.SWALLOW); + await game.phaseInterceptor.to(TurnInitPhase); expect(pokemon.getMoveHistory().at(-1)).toMatchObject({ move: Moves.SWALLOW, result: MoveResult.SUCCESS }); - expect(pokemon.summonData.battleStats[BattleStat.DEF]).toBe(1); - expect(pokemon.summonData.battleStats[BattleStat.SPDEF]).toBe(-2); + expect(pokemon.getStatStage(Stat.DEF)).toBe(1); + expect(pokemon.getStatStage(Stat.SPDEF)).toBe(-2); expect(pokemon.getTag(StockpilingTag)).toBeUndefined(); }); diff --git a/src/test/moves/tackle.test.ts b/src/test/moves/tackle.test.ts index 5eca9e344c8..b25c7524a1a 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -1,4 +1,4 @@ -import { Stat } from "#app/data/pokemon-stat"; +import { Stat } from "#enums/stat"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 0a999fe1920..04730a04f7a 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -1,12 +1,13 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; -import { TurnInitPhase } from "#app/phases/turn-init-phase"; +import { Stat } from "#enums/stat"; +import GameManager from "#test/utils/gameManager"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "../utils/testUtils"; +import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; +import { TurnInitPhase } from "#app/phases/turn-init-phase"; describe("Moves - Tail whip", () => { @@ -31,23 +32,23 @@ describe("Moves - Tail whip", () => { game.override.enemyAbility(Abilities.INSOMNIA); game.override.ability(Abilities.INSOMNIA); game.override.startingLevel(2000); - game.override.moveset([moveToUse]); - game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + game.override.moveset([ moveToUse ]); + game.override.enemyMoveset(SPLASH_ONLY); }); - it("TAIL_WHIP", async () => { + it("should lower DEF stat stage by 1", async() => { const moveToUse = Moves.TAIL_WHIP; await game.startBattle([ Species.MIGHTYENA, Species.MIGHTYENA, ]); - let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.DEF]).toBe(0); + const enemyPokemon = game.scene.getEnemyPokemon()!; + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(0); game.move.select(moveToUse); await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase); - battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; - expect(battleStatsOpponent[BattleStat.DEF]).toBe(-1); + + expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(-1); }, 20000); }); diff --git a/src/test/moves/tailwind.test.ts b/src/test/moves/tailwind.test.ts index 6b70122d08d..d158a9cce86 100644 --- a/src/test/moves/tailwind.test.ts +++ b/src/test/moves/tailwind.test.ts @@ -1,5 +1,5 @@ +import { Stat } from "#enums/stat"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { Stat } from "#app/data/pokemon-stat"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { Moves } from "#enums/moves"; @@ -38,16 +38,16 @@ describe("Moves - Tailwind", () => { const magikarpSpd = magikarp.getStat(Stat.SPD); const meowthSpd = meowth.getStat(Stat.SPD); - expect(magikarp.getBattleStat(Stat.SPD)).equal(magikarpSpd); - expect(meowth.getBattleStat(Stat.SPD)).equal(meowthSpd); + expect(magikarp.getEffectiveStat(Stat.SPD)).equal(magikarpSpd); + expect(meowth.getEffectiveStat(Stat.SPD)).equal(meowthSpd); game.move.select(Moves.TAILWIND); game.move.select(Moves.SPLASH, 1); await game.phaseInterceptor.to(TurnEndPhase); - expect(magikarp.getBattleStat(Stat.SPD)).toBe(magikarpSpd * 2); - expect(meowth.getBattleStat(Stat.SPD)).toBe(meowthSpd * 2); + expect(magikarp.getEffectiveStat(Stat.SPD)).toBe(magikarpSpd * 2); + expect(meowth.getEffectiveStat(Stat.SPD)).toBe(meowthSpd * 2); expect(game.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.PLAYER)).toBeDefined(); }); @@ -86,8 +86,8 @@ describe("Moves - Tailwind", () => { const enemySpd = enemy.getStat(Stat.SPD); - expect(ally.getBattleStat(Stat.SPD)).equal(allySpd); - expect(enemy.getBattleStat(Stat.SPD)).equal(enemySpd); + expect(ally.getEffectiveStat(Stat.SPD)).equal(allySpd); + expect(enemy.getEffectiveStat(Stat.SPD)).equal(enemySpd); expect(game.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.PLAYER)).toBeUndefined(); expect(game.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.ENEMY)).toBeUndefined(); @@ -95,8 +95,8 @@ describe("Moves - Tailwind", () => { await game.phaseInterceptor.to(TurnEndPhase); - expect(ally.getBattleStat(Stat.SPD)).toBe(allySpd * 2); - expect(enemy.getBattleStat(Stat.SPD)).equal(enemySpd); + expect(ally.getEffectiveStat(Stat.SPD)).toBe(allySpd * 2); + expect(enemy.getEffectiveStat(Stat.SPD)).equal(enemySpd); expect(game.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.PLAYER)).toBeDefined(); expect(game.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.ENEMY)).toBeUndefined(); }); diff --git a/src/test/moves/tera_blast.test.ts b/src/test/moves/tera_blast.test.ts index bd7df8403d1..fa7a99adc14 100644 --- a/src/test/moves/tera_blast.test.ts +++ b/src/test/moves/tera_blast.test.ts @@ -1,9 +1,8 @@ import { BattlerIndex } from "#app/battle"; -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import { allMoves } from "#app/data/move"; import { Type } from "#app/data/type"; import { Abilities } from "#app/enums/abilities"; -import { Stat } from "#app/enums/stat"; import { HitResult } from "#app/field/pokemon"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; @@ -112,7 +111,7 @@ describe("Moves - Tera Blast", () => { await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.phaseInterceptor.to("MoveEndPhase"); - expect(playerPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(-1); - expect(playerPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-1); + expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(-1); + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1); }, 20000); }); diff --git a/src/test/moves/tidy_up.test.ts b/src/test/moves/tidy_up.test.ts index 1ef7933c114..5204b06106b 100644 --- a/src/test/moves/tidy_up.test.ts +++ b/src/test/moves/tidy_up.test.ts @@ -1,4 +1,4 @@ -import { BattleStat } from "#app/data/battle-stat"; +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"; @@ -60,7 +60,6 @@ describe("Moves - Tidy Up", () => { game.move.select(Moves.TIDY_UP); await game.phaseInterceptor.to(MoveEndPhase); expect(game.scene.arena.getTag(ArenaTagType.STEALTH_ROCK)).toBeUndefined(); - }, 20000); it("toxic spikes are cleared", async () => { @@ -73,7 +72,6 @@ describe("Moves - Tidy Up", () => { game.move.select(Moves.TIDY_UP); await game.phaseInterceptor.to(MoveEndPhase); expect(game.scene.arena.getTag(ArenaTagType.TOXIC_SPIKES)).toBeUndefined(); - }, 20000); it("sticky webs are cleared", async () => { @@ -87,7 +85,6 @@ describe("Moves - Tidy Up", () => { game.move.select(Moves.TIDY_UP); await game.phaseInterceptor.to(MoveEndPhase); expect(game.scene.arena.getTag(ArenaTagType.STICKY_WEB)).toBeUndefined(); - }, 20000); it.skip("substitutes are cleared", async () => { @@ -101,22 +98,20 @@ describe("Moves - Tidy Up", () => { game.move.select(Moves.TIDY_UP); await game.phaseInterceptor.to(MoveEndPhase); // TODO: check for subs here once the move is implemented - }, 20000); it("user's stats are raised with no traps set", async () => { await game.startBattle(); - const player = game.scene.getPlayerPokemon()!.summonData.battleStats; - expect(player[BattleStat.ATK]).toBe(0); - expect(player[BattleStat.SPD]).toBe(0); + const playerPokemon = game.scene.getPlayerPokemon()!; + + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0); game.move.select(Moves.TIDY_UP); await game.phaseInterceptor.to(TurnEndPhase); - expect(player[BattleStat.ATK]).toBe(+1); - expect(player[BattleStat.SPD]).toBe(+1); - + expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1); + expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1); }, 20000); - }); diff --git a/src/test/moves/transform.test.ts b/src/test/moves/transform.test.ts new file mode 100644 index 00000000000..45769447e4d --- /dev/null +++ b/src/test/moves/transform.test.ts @@ -0,0 +1,101 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#app/test/utils/gameManager"; +import { Species } from "#enums/species"; +import { TurnEndPhase } from "#app/phases/turn-end-phase"; +import { Moves } from "#enums/moves"; +import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; +import { Abilities } from "#enums/abilities"; +import { SPLASH_ONLY } from "../utils/testUtils"; + +// 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 + .battleType("single") + .enemySpecies(Species.MEW) + .enemyLevel(200) + .enemyAbility(Abilities.BEAST_BOOST) + .enemyPassiveAbility(Abilities.BALL_FETCH) + .enemyMoveset(SPLASH_ONLY) + .ability(Abilities.INTIMIDATE) + .moveset([ Moves.TRANSFORM ]); + }); + + it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => { + await game.startBattle([ + Species.DITTO + ]); + + game.move.select(Moves.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()); + + 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(); + + for (let i = 0; i < playerMoveset.length && i < enemyMoveset.length; i++) { + // TODO: Checks for 5 PP should be done here when that gets addressed + expect(playerMoveset[i]?.moveId).toBe(enemyMoveset[i]?.moveId); + } + + const playerTypes = player.getTypes(); + const enemyTypes = enemy.getTypes(); + + for (let i = 0; i < playerTypes.length && i < enemyTypes.length; i++) { + expect(playerTypes[i]).toBe(enemyTypes[i]); + } + }, 20000); + + it("should copy in-battle overridden stats", async () => { + game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT)); + + await game.startBattle([ + Species.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(Moves.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); + }); +}); diff --git a/src/test/moves/wide_guard.test.ts b/src/test/moves/wide_guard.test.ts index 616972de01b..6feeff815b5 100644 --- a/src/test/moves/wide_guard.test.ts +++ b/src/test/moves/wide_guard.test.ts @@ -1,12 +1,12 @@ -import { BattleStat } from "#app/data/battle-stat"; -import { BerryPhase } from "#app/phases/berry-phase"; -import { CommandPhase } from "#app/phases/command-phase"; -import { Abilities } from "#enums/abilities"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; import GameManager from "../utils/gameManager"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Stat } from "#enums/stat"; +import { BerryPhase } from "#app/phases/berry-phase"; +import { CommandPhase } from "#app/phases/command-phase"; const TIMEOUT = 20 * 1000; @@ -75,7 +75,7 @@ describe("Moves - Wide Guard", () => { await game.phaseInterceptor.to(BerryPhase, false); - leadPokemon.forEach(p => expect(p.summonData.battleStats[BattleStat.ATK]).toBe(0)); + leadPokemon.forEach(p => expect(p.getStatStage(Stat.ATK)).toBe(0)); }, TIMEOUT ); diff --git a/src/test/reload.test.ts b/src/test/reload.test.ts new file mode 100644 index 00000000000..0a712fcc7df --- /dev/null +++ b/src/test/reload.test.ts @@ -0,0 +1,137 @@ +import { Species } from "#app/enums/species"; +import { GameModes } from "#app/game-mode"; +import GameManager from "#test/utils/gameManager"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { SPLASH_ONLY } from "./utils/testUtils"; +import { Moves } from "#app/enums/moves"; +import { Biome } from "#app/enums/biome"; + +describe("Reload", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + }); + + it("should not have RNG inconsistencies in a Classic run", async () => { + await game.classicMode.startBattle(); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); + + it("should not have RNG inconsistencies after a biome switch", async () => { + game.override + .startingWave(10) + .startingBiome(Biome.CAVE) // Will lead to biomes with randomly generated weather + .battleType("single") + .startingLevel(100) + .enemyLevel(1000) + .disableTrainerWaves() + .moveset([Moves.KOWTOW_CLEAVE]) + .enemyMoveset(SPLASH_ONLY); + await game.dailyMode.startBattle(); + + // Transition from Daily Run Wave 10 to Wave 11 in order to trigger biome switch + game.move.select(Moves.KOWTOW_CLEAVE); + await game.phaseInterceptor.to("DamagePhase"); + await game.doKillOpponents(); + await game.toNextWave(); + expect(game.phaseInterceptor.log).toContain("NewBiomeEncounterPhase"); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); + + it("should not have RNG inconsistencies at a Daily run wild Pokemon fight", async () => { + await game.dailyMode.startBattle(); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); + + it("should not have RNG inconsistencies at a Daily run double battle", async () => { + game.override + .battleType("double"); + await game.dailyMode.startBattle(); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); + + it("should not have RNG inconsistencies at a Daily run Gym Leader fight", async () => { + game.override + .battleType("single") + .startingWave(40); + await game.dailyMode.startBattle(); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); + + it("should not have RNG inconsistencies at a Daily run regular trainer fight", async () => { + game.override + .battleType("single") + .startingWave(45); + await game.dailyMode.startBattle(); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); + + it("should not have RNG inconsistencies at a Daily run wave 50 Boss fight", async () => { + game.override + .battleType("single") + .startingWave(50); + await game.runToFinalBossEncounter([Species.BULBASAUR], GameModes.DAILY); + + const preReloadRngState = Phaser.Math.RND.state(); + + await game.reload.reloadSession(); + + const postReloadRngState = Phaser.Math.RND.state(); + + expect(preReloadRngState).toBe(postReloadRngState); + }, 20000); +}); diff --git a/src/test/ui/starter-select.test.ts b/src/test/ui/starter-select.test.ts index 8ef1ea16b4a..6d26ebfd6b3 100644 --- a/src/test/ui/starter-select.test.ts +++ b/src/test/ui/starter-select.test.ts @@ -53,9 +53,6 @@ describe("UI - Starter select", () => { const handler = game.scene.ui.getHandler() as StarterSelectUiHandler; handler.processInput(Button.RIGHT); handler.processInput(Button.LEFT); - handler.processInput(Button.CYCLE_SHINY); - handler.processInput(Button.V); - handler.processInput(Button.V); handler.processInput(Button.ACTION); game.phaseInterceptor.unlock(); }); @@ -117,9 +114,6 @@ describe("UI - Starter select", () => { handler.processInput(Button.RIGHT); handler.processInput(Button.LEFT); handler.processInput(Button.CYCLE_GENDER); - handler.processInput(Button.CYCLE_SHINY); - handler.processInput(Button.V); - handler.processInput(Button.V); handler.processInput(Button.ACTION); game.phaseInterceptor.unlock(); }); @@ -184,9 +178,6 @@ describe("UI - Starter select", () => { handler.processInput(Button.CYCLE_GENDER); handler.processInput(Button.CYCLE_NATURE); handler.processInput(Button.CYCLE_ABILITY); - handler.processInput(Button.CYCLE_SHINY); - handler.processInput(Button.V); - handler.processInput(Button.V); handler.processInput(Button.ACTION); game.phaseInterceptor.unlock(); }); @@ -227,11 +218,12 @@ describe("UI - Starter select", () => { expect(game.scene.getParty()[0].species.speciesId).toBe(Species.BULBASAUR); expect(game.scene.getParty()[0].shiny).toBe(true); expect(game.scene.getParty()[0].variant).toBe(2); + expect(game.scene.getParty()[0].gender).toBe(Gender.FEMALE); expect(game.scene.getParty()[0].nature).toBe(Nature.LONELY); expect(game.scene.getParty()[0].getAbility().id).toBe(Abilities.CHLOROPHYLL); }, 20000); - it("Bulbasaur - shiny - variant 2 female lonely chlorophyl", async() => { + it("Bulbasaur - shiny - variant 2 female", async() => { await game.importData("src/test/utils/saves/everything.prsv"); const caughtCount = Object.keys(game.scene.gameData.dexData).filter((key) => { const species = game.scene.gameData.dexData[key]; @@ -249,9 +241,6 @@ describe("UI - Starter select", () => { handler.processInput(Button.RIGHT); handler.processInput(Button.LEFT); handler.processInput(Button.CYCLE_GENDER); - handler.processInput(Button.CYCLE_SHINY); - handler.processInput(Button.V); - handler.processInput(Button.V); handler.processInput(Button.ACTION); game.phaseInterceptor.unlock(); }); @@ -313,6 +302,7 @@ describe("UI - Starter select", () => { handler.processInput(Button.RIGHT); handler.processInput(Button.LEFT); handler.processInput(Button.ACTION); + handler.processInput(Button.CYCLE_SHINY); game.phaseInterceptor.unlock(); }); await game.phaseInterceptor.run(SelectStarterPhase); @@ -371,7 +361,7 @@ describe("UI - Starter select", () => { const handler = game.scene.ui.getHandler() as StarterSelectUiHandler; handler.processInput(Button.RIGHT); handler.processInput(Button.LEFT); - handler.processInput(Button.CYCLE_SHINY); + handler.processInput(Button.V); handler.processInput(Button.V); handler.processInput(Button.ACTION); game.phaseInterceptor.unlock(); @@ -415,7 +405,7 @@ describe("UI - Starter select", () => { expect(game.scene.getParty()[0].variant).toBe(1); }, 20000); - it("Bulbasaur - shiny - variant 2", async() => { + it("Bulbasaur - shiny - variant 0", async() => { await game.importData("src/test/utils/saves/everything.prsv"); const caughtCount = Object.keys(game.scene.gameData.dexData).filter((key) => { const species = game.scene.gameData.dexData[key]; @@ -432,8 +422,6 @@ describe("UI - Starter select", () => { const handler = game.scene.ui.getHandler() as StarterSelectUiHandler; handler.processInput(Button.RIGHT); handler.processInput(Button.LEFT); - handler.processInput(Button.CYCLE_SHINY); - handler.processInput(Button.V); handler.processInput(Button.V); handler.processInput(Button.ACTION); game.phaseInterceptor.unlock(); @@ -474,7 +462,7 @@ describe("UI - Starter select", () => { expect(game.scene.getParty()[0].species.speciesId).toBe(Species.BULBASAUR); expect(game.scene.getParty()[0].shiny).toBe(true); - expect(game.scene.getParty()[0].variant).toBe(2); + expect(game.scene.getParty()[0].variant).toBe(0); }, 20000); it("Check if first pokemon in party is caterpie from gen 1 and 1rd row, 3rd column", async() => { diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 6724e05521c..ade33aa1148 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -2,6 +2,8 @@ import { updateUserInfo } from "#app/account"; import { BattlerIndex } from "#app/battle"; import BattleScene from "#app/battle-scene"; import { BattleStyle } from "#app/enums/battle-style"; +import { Moves } from "#app/enums/moves"; +import { getMoveTargets } from "#app/data/move"; import { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import Trainer from "#app/field/trainer"; import { GameModes, getGameMode } from "#app/game-mode"; @@ -9,6 +11,7 @@ import { ModifierTypeOption, modifierTypes } from "#app/modifier/modifier-type"; import overrides from "#app/overrides"; import { CommandPhase } from "#app/phases/command-phase"; import { EncounterPhase } from "#app/phases/encounter-phase"; +import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { FaintPhase } from "#app/phases/faint-phase"; import { LoginPhase } from "#app/phases/login-phase"; import { MovePhase } from "#app/phases/move-phase"; @@ -45,6 +48,8 @@ import { ChallengeModeHelper } from "./helpers/challengeModeHelper"; import { MoveHelper } from "./helpers/moveHelper"; import { OverridesHelper } from "./helpers/overridesHelper"; import { SettingsHelper } from "./helpers/settingsHelper"; +import { ReloadHelper } from "./helpers/reloadHelper"; +import { CheckSwitchPhase } from "#app/phases/check-switch-phase"; /** * Class to manage the game state and transitions between phases. @@ -61,6 +66,7 @@ export default class GameManager { public readonly dailyMode: DailyModeHelper; public readonly challengeMode: ChallengeModeHelper; public readonly settings: SettingsHelper; + public readonly reload: ReloadHelper; /** * Creates an instance of GameManager. @@ -70,7 +76,7 @@ export default class GameManager { constructor(phaserGame: Phaser.Game, bypassLogin: boolean = true) { localStorage.clear(); ErrorInterceptor.getInstance().clear(); - BattleScene.prototype.randBattleSeedInt = (arg) => arg-1; + BattleScene.prototype.randBattleSeedInt = (range, min: number = 0) => min + range - 1; // This simulates a max roll this.gameWrapper = new GameWrapper(phaserGame, bypassLogin); this.scene = new BattleScene(); this.phaseInterceptor = new PhaseInterceptor(this.scene); @@ -82,6 +88,7 @@ export default class GameManager { this.dailyMode = new DailyModeHelper(this); this.challengeMode = new ChallengeModeHelper(this); this.settings = new SettingsHelper(this); + this.reload = new ReloadHelper(this); } /** @@ -231,15 +238,42 @@ export default class GameManager { this.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => { const handler = this.scene.ui.getHandler() as ModifierSelectUiHandler; handler.processInput(Button.CANCEL); - }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(NewBattlePhase), true); + }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(NewBattlePhase) || this.isCurrentPhase(CheckSwitchPhase), true); this.onNextPrompt("SelectModifierPhase", Mode.CONFIRM, () => { const handler = this.scene.ui.getHandler() as ModifierSelectUiHandler; handler.processInput(Button.ACTION); - }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(NewBattlePhase)); + }, () => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(NewBattlePhase) || this.isCurrentPhase(CheckSwitchPhase)); } - forceOpponentToSwitch() { + /** + * Forces the next enemy selecting a move to use the given move in its moveset against the + * given target (if applicable). + * @param moveId {@linkcode Moves} the move the enemy will use + * @param target {@linkcode BattlerIndex} the target on which the enemy will use the given move + */ + async forceEnemyMove(moveId: Moves, target?: BattlerIndex) { + // Wait for the next EnemyCommandPhase to start + await this.phaseInterceptor.to(EnemyCommandPhase, false); + const enemy = this.scene.getEnemyField()[(this.scene.getCurrentPhase() as EnemyCommandPhase).getFieldIndex()]; + const legalTargets = getMoveTargets(enemy, moveId); + + vi.spyOn(enemy, "getNextMove").mockReturnValueOnce({ + move: moveId, + targets: (target && !legalTargets.multiple && legalTargets.targets.includes(target)) + ? [target] + : enemy.getNextTargets(moveId) + }); + + /** + * Run the EnemyCommandPhase to completion. + * This allows this function to be called consecutively to + * force a move for each enemy in a double battle. + */ + await this.phaseInterceptor.to(EnemyCommandPhase); + } + + forceEnemyToSwitch() { const originalMatchupScore = Trainer.prototype.getPartyMemberMatchupScores; Trainer.prototype.getPartyMemberMatchupScores = () => { Trainer.prototype.getPartyMemberMatchupScores = originalMatchupScore; diff --git a/src/test/utils/helpers/overridesHelper.ts b/src/test/utils/helpers/overridesHelper.ts index d5eaee003db..cc5f9018325 100644 --- a/src/test/utils/helpers/overridesHelper.ts +++ b/src/test/utils/helpers/overridesHelper.ts @@ -281,6 +281,31 @@ export class OverridesHelper extends GameManagerHelper { return this; } + /** + * Override the items rolled at the end of a battle + * @param items the items to be rolled + * @returns this + */ + itemRewards(items: ModifierOverride[]) { + vi.spyOn(Overrides, "ITEM_REWARD_OVERRIDE", "get").mockReturnValue(items); + this.log("Item rewards set to:", items); + return this; + } + + /** + * Override the enemy (Pokemon) to have the given amount of health segments + * @param healthSegments the number of segments to give + * default: 0, the health segments will be handled like in the game based on wave, level and species + * 1: the Pokemon will not be a boss + * 2+: the Pokemon will be a boss with the given number of health segments + * @returns this + */ + enemyHealthSegments(healthSegments: number) { + vi.spyOn(Overrides, "OPP_HEALTH_SEGMENTS_OVERRIDE", "get").mockReturnValue(healthSegments); + this.log("Enemy Pokemon health segments set to:", healthSegments); + return this; + } + private log(...params: any[]) { console.log("Overrides:", ...params); } diff --git a/src/test/utils/helpers/reloadHelper.ts b/src/test/utils/helpers/reloadHelper.ts new file mode 100644 index 00000000000..c15347b08c9 --- /dev/null +++ b/src/test/utils/helpers/reloadHelper.ts @@ -0,0 +1,53 @@ +import { GameManagerHelper } from "./gameManagerHelper"; +import { TitlePhase } from "#app/phases/title-phase"; +import { Mode } from "#app/ui/ui"; +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"; + +/** + * Helper to allow reloading sessions in unit tests. + */ +export class ReloadHelper extends GameManagerHelper { + /** + * Simulate reloading the session from the title screen, until reaching the + * beginning of the first turn (equivalent to running `startBattle()`) for + * the reloaded session. + */ + async reloadSession() : Promise { + const scene = this.game.scene; + const sessionData = scene.gameData.getSessionSaveData(scene); + const titlePhase = new TitlePhase(scene); + + scene.clearPhaseQueue(); + + // Set the last saved session to the desired session data + vi.spyOn(scene.gameData, "getSession").mockReturnValue( + new Promise((resolve, reject) => { + resolve(sessionData); + }) + ); + scene.unshiftPhase(titlePhase); + this.game.endPhase(); // End the currently ongoing battle + + titlePhase.loadSaveSlot(-1); // Load the desired session data + this.game.phaseInterceptor.shift(); // Loading the save slot also ended TitlePhase, clean it up + + // Run through prompts for switching Pokemon, copied from classicModeHelper.ts + if (this.game.scene.battleStyle === BattleStyle.SWITCH) { + this.game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.game.setMode(Mode.MESSAGE); + this.game.endPhase(); + }, () => this.game.isCurrentPhase(CommandPhase) || this.game.isCurrentPhase(TurnInitPhase)); + + this.game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { + this.game.setMode(Mode.MESSAGE); + this.game.endPhase(); + }, () => this.game.isCurrentPhase(CommandPhase) || this.game.isCurrentPhase(TurnInitPhase)); + } + + await this.game.phaseInterceptor.to(CommandPhase); + console.log("==================[New Turn]=================="); + } +} diff --git a/src/test/utils/mocks/mocksContainer/mockContainer.ts b/src/test/utils/mocks/mocksContainer/mockContainer.ts index 5babd9e71b2..d2cdd852257 100644 --- a/src/test/utils/mocks/mocksContainer/mockContainer.ts +++ b/src/test/utils/mocks/mocksContainer/mockContainer.ts @@ -208,4 +208,5 @@ export default class MockContainer implements MockGameObject { return this.list; } + disableInteractive = vi.fn(); } diff --git a/src/test/utils/phaseInterceptor.ts b/src/test/utils/phaseInterceptor.ts index de65405abff..2eb5324a2aa 100644 --- a/src/test/utils/phaseInterceptor.ts +++ b/src/test/utils/phaseInterceptor.ts @@ -1,4 +1,6 @@ import { Phase } from "#app/phase"; +import ErrorInterceptor from "#app/test/utils/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"; @@ -10,14 +12,15 @@ 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 { 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 { PartyHealPhase } from "#app/phases/party-heal-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"; @@ -26,7 +29,7 @@ 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 { StatChangePhase } from "#app/phases/stat-change-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"; @@ -37,7 +40,7 @@ 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 ErrorInterceptor from "#app/test/utils/errorInterceptor"; +import { PartyHealPhase } from "#app/phases/party-heal-phase"; import UI, { Mode } from "#app/ui/ui"; export default class PhaseInterceptor { @@ -62,6 +65,7 @@ export default class PhaseInterceptor { [TitlePhase, this.startPhase], [SelectGenderPhase, this.startPhase], [EncounterPhase, this.startPhase], + [NewBiomeEncounterPhase, this.startPhase], [SelectStarterPhase, this.startPhase], [PostSummonPhase, this.startPhase], [SummonPhase, this.startPhase], @@ -86,7 +90,7 @@ export default class PhaseInterceptor { [NewBattlePhase, this.startPhase], [VictoryPhase, this.startPhase], [MoveEndPhase, this.startPhase], - [StatChangePhase, this.startPhase], + [StatStageChangePhase, this.startPhase], [ShinySparklePhase, this.startPhase], [SelectTargetPhase, this.startPhase], [UnavailablePhase, this.startPhase], @@ -96,6 +100,8 @@ export default class PhaseInterceptor { [PartyHealPhase, this.startPhase], [EvolutionPhase, this.startPhase], [EndEvolutionPhase, this.startPhase], + [LevelCapPhase, this.startPhase], + [AttemptRunPhase, this.startPhase], ]; private endBySetMode = [ @@ -237,6 +243,22 @@ export default class PhaseInterceptor { this.scene.shiftPhase(); } + /** + * Remove the current phase from the phase interceptor. + * + * Do not call this unless absolutely necessary. This function is intended + * for cleaning up the phase interceptor when, for whatever reason, a phase + * is manually ended without using the phase interceptor. + * + * @param shouldRun Whether or not the current scene should also be run. + */ + shift(shouldRun: boolean = false) : void { + this.onHold.shift(); + if (shouldRun) { + this.scene.shiftPhase(); + } + } + /** * Method to initialize phases and their corresponding methods. */ diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index abdb2db232a..874bf6a8b46 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -33,7 +33,7 @@ const timedEvents: TimedEvent[] = [ xPosition: 19, yPosition: 115, scale: 0.30, - availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"] + availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"] } ]; diff --git a/src/ui/achvs-ui-handler.ts b/src/ui/achvs-ui-handler.ts index eb4316dc24b..605b8c538a9 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -74,7 +74,7 @@ export default class AchvsUiHandler extends MessageUiHandler { this.headerText = addTextObject(this.scene, 0, 0, "", TextStyle.SETTINGS_LABEL); this.headerText.setOrigin(0, 0); this.headerText.setPositionRelative(this.headerBg, 8, 4); - this.headerActionButton = new Phaser.GameObjects.Sprite(this.scene, 0, 0, "keyboard", "SPACE.png"); + this.headerActionButton = new Phaser.GameObjects.Sprite(this.scene, 0, 0, "keyboard", "ACTION.png"); this.headerActionButton.setOrigin(0, 0); this.headerActionButton.setPositionRelative(this.headerBg, 236, 6); this.headerActionText = addTextObject(this.scene, 0, 0, "", TextStyle.WINDOW, {fontSize:"60px"}); diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 11b807e8ab7..05c634609f8 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -7,7 +7,7 @@ import { StatusEffect } from "../data/status-effect"; import BattleScene from "../battle-scene"; import { Type, getTypeRgb } from "../data/type"; import { getVariantTint } from "#app/data/variant"; -import { BattleStat } from "#app/data/battle-stat"; +import { Stat } from "#enums/stat"; import BattleFlyout from "./battle-flyout"; import { WindowVariant, addWindow } from "./ui-theme"; import i18next from "i18next"; @@ -30,7 +30,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container { private lastLevelExp: integer; private lastLevel: integer; private lastLevelCapped: boolean; - private lastBattleStats: string; + private lastStats: string; private box: Phaser.GameObjects.Sprite; private nameText: Phaser.GameObjects.Text; @@ -68,9 +68,9 @@ export default class BattleInfo extends Phaser.GameObjects.Container { public flyoutMenu?: BattleFlyout; - private battleStatOrder: BattleStat[]; - private battleStatOrderPlayer = [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.ACC, BattleStat.EVA, BattleStat.SPD]; - private battleStatOrderEnemy = [BattleStat.HP, BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.ACC, BattleStat.EVA, BattleStat.SPD]; + private statOrder: Stat[]; + private readonly statOrderPlayer = [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.ACC, Stat.EVA, Stat.SPD ]; + private readonly statOrderEnemy = [ Stat.HP, Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.ACC, Stat.EVA, Stat.SPD ]; constructor(scene: Phaser.Scene, x: number, y: number, player: boolean) { super(scene, x, y); @@ -229,9 +229,9 @@ export default class BattleInfo extends Phaser.GameObjects.Container { const startingX = this.player ? -this.statsBox.width + 8 : -this.statsBox.width + 5; const paddingX = this.player ? 4 : 2; const statOverflow = this.player ? 1 : 0; - this.battleStatOrder = this.player ? this.battleStatOrderPlayer : this.battleStatOrderEnemy; // this tells us whether or not to use the player or enemy battle stat order + this.statOrder = this.player ? this.statOrderPlayer : this.statOrderEnemy; // this tells us whether or not to use the player or enemy battle stat order - this.battleStatOrder.map((s, i) => { + this.statOrder.map((s, i) => { // we do a check for i > statOverflow to see when the stat labels go onto the next column // For enemies, we have HP (i=0) by itself then a new column, so we check for i > 0 // For players, we don't have HP, so we start with i = 0 and i = 1 for our first column, and so need to check for i > 1 @@ -239,25 +239,25 @@ export default class BattleInfo extends Phaser.GameObjects.Container { const baseY = -this.statsBox.height / 2 + 4; // this is the baseline for the y-axis let statY: number; // this will be the y-axis placement for the labels - if (this.battleStatOrder[i] === BattleStat.SPD || this.battleStatOrder[i] === BattleStat.HP) { + if (this.statOrder[i] === Stat.SPD || this.statOrder[i] === Stat.HP) { statY = baseY + 5; } else { statY = baseY + (!!(i % 2) === this.player ? 10 : 0); // we compare i % 2 against this.player to tell us where to place the label; because this.battleStatOrder for enemies has HP, this.battleStatOrder[1]=ATK, but for players this.battleStatOrder[0]=ATK, so this comparing i % 2 to this.player fixes this issue for us } - const statLabel = this.scene.add.sprite(statX, statY, "pbinfo_stat", BattleStat[s]); + const statLabel = this.scene.add.sprite(statX, statY, "pbinfo_stat", Stat[s]); statLabel.setName("icon_stat_label_" + i.toString()); statLabel.setOrigin(0, 0); statLabels.push(statLabel); this.statValuesContainer.add(statLabel); - const statNumber = this.scene.add.sprite(statX + statLabel.width, statY, "pbinfo_stat_numbers", this.battleStatOrder[i] !== BattleStat.HP ? "3" : "empty"); + const statNumber = this.scene.add.sprite(statX + statLabel.width, statY, "pbinfo_stat_numbers", this.statOrder[i] !== Stat.HP ? "3" : "empty"); statNumber.setName("icon_stat_number_" + i.toString()); statNumber.setOrigin(0, 0); this.statNumbers.push(statNumber); this.statValuesContainer.add(statNumber); - if (this.battleStatOrder[i] === BattleStat.HP) { + if (this.statOrder[i] === Stat.HP) { statLabel.setVisible(false); statNumber.setVisible(false); } @@ -433,10 +433,10 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.statValuesContainer.setPosition(8, 7); } - const battleStats = this.battleStatOrder.map(() => 0); + const stats = this.statOrder.map(() => 0); - this.lastBattleStats = battleStats.join(""); - this.updateBattleStats(battleStats); + this.lastStats = stats.join(""); + this.updateStats(stats); } getTextureName(): string { @@ -650,14 +650,12 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.lastLevel = pokemon.level; } - const battleStats = pokemon.summonData - ? pokemon.summonData.battleStats - : this.battleStatOrder.map(() => 0); - const battleStatsStr = battleStats.join(""); + const stats = pokemon.getStatStages(); + const statsStr = stats.join(""); - if (this.lastBattleStats !== battleStatsStr) { - this.updateBattleStats(battleStats); - this.lastBattleStats = battleStatsStr; + if (this.lastStats !== statsStr) { + this.updateStats(stats); + this.lastStats = statsStr; } this.shinyIcon.setVisible(pokemon.isShiny()); @@ -769,10 +767,10 @@ export default class BattleInfo extends Phaser.GameObjects.Container { } } - updateBattleStats(battleStats: integer[]): void { - this.battleStatOrder.map((s, i) => { - if (s !== BattleStat.HP) { - this.statNumbers[i].setFrame(battleStats[s].toString()); + updateStats(stats: integer[]): void { + this.statOrder.map((s, i) => { + if (s !== Stat.HP) { + this.statNumbers[i].setFrame(stats[s - 1].toString()); } }); } diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index 86f8d9e01a8..3bea0f21433 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -1,13 +1,12 @@ import BattleScene from "../battle-scene"; import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "./text"; import { Mode } from "./ui"; -import * as Utils from "../utils"; import MessageUiHandler from "./message-ui-handler"; -import { getStatName, Stat } from "../data/pokemon-stat"; import { addWindow } from "./ui-theme"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import {Button} from "#enums/buttons"; import i18next from "i18next"; +import { Stat, PERMANENT_STATS, getStatKey } from "#app/enums/stat"; export default class BattleMessageUiHandler extends MessageUiHandler { private levelUpStatsContainer: Phaser.GameObjects.Container; @@ -100,9 +99,8 @@ export default class BattleMessageUiHandler extends MessageUiHandler { const levelUpStatsLabelsContent = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 73, -94, "", TextStyle.WINDOW, { maxLines: 6 }); let levelUpStatsLabelText = ""; - const stats = Utils.getEnumValues(Stat); - for (const s of stats) { - levelUpStatsLabelText += `${getStatName(s)}\n`; + for (const s of PERMANENT_STATS) { + levelUpStatsLabelText += `${i18next.t(getStatKey(s))}\n`; } levelUpStatsLabelsContent.text = levelUpStatsLabelText; levelUpStatsLabelsContent.x -= levelUpStatsLabelsContent.displayWidth; @@ -176,8 +174,7 @@ export default class BattleMessageUiHandler extends MessageUiHandler { } const newStats = (this.scene as BattleScene).getParty()[partyMemberIndex].stats; let levelUpStatsValuesText = ""; - const stats = Utils.getEnumValues(Stat); - for (const s of stats) { + for (const s of PERMANENT_STATS) { levelUpStatsValuesText += `${showTotals ? newStats[s] : newStats[s] - prevStats[s]}\n`; } this.levelUpStatsValuesContent.text = levelUpStatsValuesText; @@ -199,10 +196,9 @@ export default class BattleMessageUiHandler extends MessageUiHandler { return new Promise(resolve => { this.scene.executeWithSeedOffset(() => { let levelUpStatsValuesText = ""; - const stats = Utils.getEnumValues(Stat); const shownStats = this.getTopIvs(ivs, shownIvsCount); - for (const s of stats) { - levelUpStatsValuesText += `${shownStats.indexOf(s) > -1 ? this.getIvDescriptor(ivs[s], s, pokemonId) : "???"}\n`; + for (const s of PERMANENT_STATS) { + levelUpStatsValuesText += `${shownStats.includes(s) ? this.getIvDescriptor(ivs[s], s, pokemonId) : "???"}\n`; } this.levelUpStatsValuesContent.text = levelUpStatsValuesText; this.levelUpStatsIncrContent.setVisible(false); @@ -217,26 +213,16 @@ export default class BattleMessageUiHandler extends MessageUiHandler { } getTopIvs(ivs: integer[], shownIvsCount: integer): Stat[] { - const stats = Utils.getEnumValues(Stat); let shownStats: Stat[] = []; if (shownIvsCount < 6) { - const statsPool = stats.slice(0); + const statsPool = PERMANENT_STATS.slice(); + // Sort the stats from highest to lowest iv + statsPool.sort((s1, s2) => ivs[s2] - ivs[s1]); for (let i = 0; i < shownIvsCount; i++) { - let shownStat: Stat | null = null; - let highestIv = -1; - statsPool.map(s => { - if (ivs[s] > highestIv) { - shownStat = s as Stat; - highestIv = ivs[s]; - } - }); - if (shownStat !== null && shownStat !== undefined) { - shownStats.push(shownStat); - statsPool.splice(statsPool.indexOf(shownStat), 1); - } + shownStats.push(statsPool[i]); } } else { - shownStats = stats; + shownStats = PERMANENT_STATS.slice(); } return shownStats; } diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index b22ea5d20fc..27ff923e9a3 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -68,7 +68,11 @@ export default class CommandUiHandler extends UiHandler { messageHandler.movesWindowContainer.setVisible(false); messageHandler.message.setWordWrapWidth(1110); messageHandler.showText(i18next.t("commandUiHandler:actionMessage", {pokemonName: getPokemonNameWithAffix(commandPhase.getPokemon())}), 0); - this.setCursor(this.getCursor()); + if (this.getCursor() === Command.POKEMON) { + this.setCursor(Command.FIGHT); + } else { + this.setCursor(this.getCursor()); + } return true; } @@ -85,7 +89,7 @@ export default class CommandUiHandler extends UiHandler { if (button === Button.ACTION) { switch (cursor) { // Fight - case 0: + case Command.FIGHT: if ((this.scene.getCurrentPhase() as CommandPhase).checkFightOverride()) { return true; } @@ -93,17 +97,17 @@ export default class CommandUiHandler extends UiHandler { success = true; break; // Ball - case 1: + case Command.BALL: ui.setModeWithoutClear(Mode.BALL); success = true; break; // Pokemon - case 2: + case Command.POKEMON: ui.setMode(Mode.PARTY, PartyUiMode.SWITCH, (this.scene.getCurrentPhase() as CommandPhase).getPokemon().getFieldIndex(), null, PartyUiHandler.FilterNonFainted); success = true; break; // Run - case 3: + case Command.RUN: (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.RUN, 0); success = true; break; diff --git a/src/ui/egg-summary-ui-handler.ts b/src/ui/egg-summary-ui-handler.ts new file mode 100644 index 00000000000..af82ab33438 --- /dev/null +++ b/src/ui/egg-summary-ui-handler.ts @@ -0,0 +1,320 @@ +import BattleScene from "../battle-scene"; +import { Mode } from "./ui"; +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 { Gender } from "#app/data/gender"; +import { getVariantTint } from "#app/data/variant"; +import { EggTier } from "#app/enums/egg-type"; +import PokemonHatchInfoContainer from "./pokemon-hatch-info-container"; +import { EggSummaryPhase } from "#app/phases/egg-summary-phase"; +import { DexAttr } from "#app/system/game-data"; +import { EggHatchData } from "#app/data/egg-hatch-data"; + +const iconContainerX = 115; +const iconContainerY = 9; +const numCols = 11; +const iconSize = 18; + +/** + * UI Handler for the egg summary. + * 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 { + /** holds all elements in the scene */ + private eggHatchContainer: Phaser.GameObjects.Container; + /** holds the icon containers and info container */ + private summaryContainer: Phaser.GameObjects.Container; + /** container for the mini pokemon sprites */ + private pokemonIconSpritesContainer: Phaser.GameObjects.Container; + /** container for the icons displayed alongside the mini icons (e.g. shiny, HA capsule) */ + private pokemonIconsContainer: Phaser.GameObjects.Container; + /** hatch info container that displays the current pokemon / hatch (main element on left hand side) */ + private infoContainer: PokemonHatchInfoContainer; + /** handles jumping animations for the pokemon sprite icons */ + private iconAnimHandler: PokemonIconAnimHandler; + private eggHatchBg: Phaser.GameObjects.Image; + private cursorObj: Phaser.GameObjects.Image; + private eggHatchData: EggHatchData[]; + + + /** + * Allows subscribers to listen for events + * + * Current Events: + * - {@linkcode EggEventType.EGG_COUNT_CHANGED} {@linkcode EggCountChangedEvent} + */ + public readonly eventTarget: EventTarget = new EventTarget(); + + constructor(scene: BattleScene) { + super(scene, Mode.EGG_HATCH_SUMMARY); + } + + + setup() { + const ui = this.getUi(); + + this.summaryContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6); + this.summaryContainer.setVisible(false); + ui.add(this.summaryContainer); + + this.eggHatchContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6); + this.eggHatchContainer.setVisible(false); + ui.add(this.eggHatchContainer); + + this.iconAnimHandler = new PokemonIconAnimHandler(); + this.iconAnimHandler.setup(this.scene); + + this.eggHatchBg = this.scene.add.image(0, 0, "egg_summary_bg"); + this.eggHatchBg.setOrigin(0, 0); + this.eggHatchContainer.add(this.eggHatchBg); + + this.pokemonIconsContainer = this.scene.add.container(iconContainerX, iconContainerY); + this.pokemonIconSpritesContainer = this.scene.add.container(iconContainerX, iconContainerY); + this.summaryContainer.add(this.pokemonIconsContainer); + this.summaryContainer.add(this.pokemonIconSpritesContainer); + + this.cursorObj = this.scene.add.image(0, 0, "select_cursor"); + this.cursorObj.setOrigin(0, 0); + this.summaryContainer.add(this.cursorObj); + + this.infoContainer = new PokemonHatchInfoContainer(this.scene, this.summaryContainer); + this.infoContainer.setup(); + this.infoContainer.changeToEggSummaryLayout(); + this.infoContainer.setVisible(true); + this.summaryContainer.add(this.infoContainer); + + this.cursor = -1; + } + + clear() { + super.clear(); + this.cursor = -1; + this.summaryContainer.setVisible(false); + this.pokemonIconSpritesContainer.removeAll(true); + this.pokemonIconsContainer.removeAll(true); + this.eggHatchBg.setVisible(false); + this.getUi().hideTooltip(); + // Note: Questions on garbage collection go to @frutescens + const activeKeys = this.scene.getActiveKeys(); + // Removing unnecessary sprites from animation manager + const animKeys = Object.keys(this.scene.anims["anims"]["entries"]); + animKeys.forEach(key => { + if (key.startsWith("pkmn__") && !activeKeys.includes(key)) { + this.scene.anims.remove(key); + } + }); + // Removing unnecessary cries from audio cache + const audioKeys = Object.keys(this.scene.cache.audio.entries.entries); + audioKeys.forEach(key => { + if (key.startsWith("cry/") && !activeKeys.includes(key)) { + delete this.scene.cache.audio.entries.entries[key]; + } + }); + // Clears eggHatchData in EggSummaryUiHandler + this.eggHatchData.length = 0; + // Removes Pokemon icons in EggSummaryUiHandler + this.iconAnimHandler.removeAll(); + console.log("Egg Summary Handler cleared"); + } + + /** + * @param args EggHatchData[][] + * args[0]: list of EggHatchData for each egg/pokemon hatched + */ + show(args: EggHatchData[][]): boolean { + super.show(args); + if (args.length >= 1) { + // sort the egg hatch data by egg tier then by species number (then by order hatched) + this.eggHatchData = args[0].sort(function sortHatchData(a: EggHatchData, b: EggHatchData) { + const speciesA = a.pokemon.species; + const speciesB = b.pokemon.species; + if (getEggTierForSpecies(speciesA) < getEggTierForSpecies(speciesB)) { + return -1; + } else if (getEggTierForSpecies(speciesA) > getEggTierForSpecies(speciesB)) { + return 1; + } else { + if (speciesA.speciesId < speciesB.speciesId) { + return -1; + } else if (speciesA.speciesId > speciesB.speciesId) { + return 1; + } else { + return 0; + } + } + } + + ); + } + + this.getUi().bringToTop(this.summaryContainer); + this.summaryContainer.setVisible(true); + this.eggHatchContainer.setVisible(true); + this.pokemonIconsContainer.setVisible(true); + this.eggHatchBg.setVisible(true); + this.infoContainer.hideDisplayPokemon(); + + this.eggHatchData.forEach( (value: EggHatchData, i: number) => { + const x = (i % numCols) * iconSize; + const y = Math.floor(i / numCols) * iconSize; + + const displayPokemon = value.pokemon; + const offset = 2; + const rightSideX = 12; + + const bg = this.scene.add.image(x+2, y+5, "passive_bg"); + bg.setOrigin(0, 0); + bg.setScale(0.75); + bg.setVisible(true); + this.pokemonIconsContainer.add(bg); + + // set tint for passive bg + switch (getEggTierForSpecies(displayPokemon.species)) { + case EggTier.COMMON: + bg.setVisible(false); + break; + case EggTier.GREAT: + bg.setTint(0xabafff); + break; + case EggTier.ULTRA: + bg.setTint(0xffffaa); + break; + case EggTier.MASTER: + bg.setTint(0xdfffaf); + break; + } + const species = displayPokemon.species; + const female = displayPokemon.gender === Gender.FEMALE; + const formIndex = displayPokemon.formIndex; + const variant = displayPokemon.variant; + const isShiny = displayPokemon.shiny; + + // set pokemon icon (and replace with base sprite if there is a mismatch) + const icon = this.scene.add.sprite(x - offset, y + offset, species.getIconAtlasKey(formIndex, isShiny, variant)); + icon.setScale(0.5); + icon.setOrigin(0, 0); + icon.setFrame(species.getIconId(female, formIndex, isShiny, variant)); + + if (icon.frame.name !== species.getIconId(female, formIndex, isShiny, variant)) { + console.log(`${species.name}'s variant icon does not exist. Replacing with default.`); + icon.setTexture(species.getIconAtlasKey(formIndex, false, variant)); + icon.setFrame(species.getIconId(female, formIndex, false, variant)); + } + this.pokemonIconSpritesContainer.add(icon); + this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE); + + const shiny = this.scene.add.image(x + rightSideX, y + offset * 2, "shiny_star_small"); + shiny.setScale(0.5); + shiny.setVisible(displayPokemon.shiny); + shiny.setTint(getVariantTint(displayPokemon.variant)); + this.pokemonIconsContainer.add(shiny); + + const ha = this.scene.add.image(x + rightSideX, y + 7, "ha_capsule"); + ha.setScale(0.5); + ha.setVisible((displayPokemon.hasAbility(displayPokemon.species.abilityHidden))); + this.pokemonIconsContainer.add(ha); + + const pb = this.scene.add.image(x + rightSideX, y + offset * 7, "icon_owned"); + pb.setOrigin(0, 0); + pb.setScale(0.5); + + // add animation for new unlocks (new catch or new shiny or new form) + const dexEntry = value.dexEntryBeforeUpdate; + const caughtAttr = dexEntry.caughtAttr; + const newShiny = BigInt(1 << (displayPokemon.shiny ? 1 : 0)); + const newVariant = BigInt(1 << (displayPokemon.variant + 4)); + const newShinyOrVariant = ((newShiny & caughtAttr) === BigInt(0)) || ((newVariant & caughtAttr) === BigInt(0)); + const newForm = (BigInt(1 << displayPokemon.formIndex) * DexAttr.DEFAULT_FORM & caughtAttr) === BigInt(0); + + pb.setVisible(!caughtAttr || newForm); + if (!caughtAttr || newShinyOrVariant || newForm) { + this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.PASSIVE); + } + this.pokemonIconsContainer.add(pb); + + const em = this.scene.add.image(x, y + offset, "icon_egg_move"); + em.setOrigin(0, 0); + em.setScale(0.5); + em.setVisible(value.eggMoveUnlocked); + this.pokemonIconsContainer.add(em); + }); + + this.setCursor(0); + this.scene.playSoundWithoutBgm("evolution_fanfare"); + return true; + } + + processInput(button: Button): boolean { + const ui = this.getUi(); + + let success = false; + const error = false; + if (button === Button.CANCEL) { + const phase = this.scene.getCurrentPhase(); + if (phase instanceof EggSummaryPhase) { + phase.end(); + } + ui.revertMode(); + success = true; + } else { + const count = this.eggHatchData.length; + const rows = Math.ceil(count / numCols); + const row = Math.floor(this.cursor / numCols); + switch (button) { + case Button.UP: + if (row) { + success = this.setCursor(this.cursor - numCols); + } + break; + case Button.DOWN: + if (row < rows - 2 || (row < rows - 1 && this.cursor % numCols <= (count - 1) % numCols)) { + success = this.setCursor(this.cursor + numCols); + } + break; + case Button.LEFT: + if (this.cursor % numCols) { + success = this.setCursor(this.cursor - 1); + } + break; + case Button.RIGHT: + if (this.cursor % numCols < (row < rows - 1 ? 10 : (count - 1) % numCols)) { + success = this.setCursor(this.cursor + 1); + } + break; + } + } + + if (success) { + ui.playSelect(); + } else if (error) { + ui.playError(); + } + + return success || error; + } + + setCursor(cursor: number): boolean { + let changed = false; + + const lastCursor = this.cursor; + + changed = super.setCursor(cursor); + + if (changed) { + this.cursorObj.setPosition(iconContainerX - 1 + iconSize * (cursor % numCols), iconContainerY + 1 + iconSize * Math.floor(cursor / numCols)); + + if (lastCursor > -1) { + this.iconAnimHandler.addOrUpdate(this.pokemonIconSpritesContainer.getAt(lastCursor) as Phaser.GameObjects.Sprite, PokemonIconAnimMode.NONE); + } + this.iconAnimHandler.addOrUpdate(this.pokemonIconSpritesContainer.getAt(cursor) as Phaser.GameObjects.Sprite, PokemonIconAnimMode.ACTIVE); + + this.infoContainer.showHatchInfo(this.eggHatchData[cursor]); + + } + + return changed; + } + +} diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 0beaddbb517..4bbe88dabd9 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -95,9 +95,13 @@ export default class FightUiHandler extends UiHandler { messageHandler.bg.setVisible(false); messageHandler.commandWindow.setVisible(false); messageHandler.movesWindowContainer.setVisible(true); - this.setCursor(this.getCursor()); + const pokemon = (this.scene.getCurrentPhase() as CommandPhase).getPokemon(); + if (pokemon.battleSummonData.turnCount <= 1) { + this.setCursor(0); + } else { + this.setCursor(this.getCursor()); + } this.displayMoves(); - return true; } diff --git a/src/ui/login-form-ui-handler.ts b/src/ui/login-form-ui-handler.ts index 5f4cb889574..631b2e50b02 100644 --- a/src/ui/login-form-ui-handler.ts +++ b/src/ui/login-form-ui-handler.ts @@ -3,14 +3,31 @@ import { ModalConfig } from "./modal-ui-handler"; import * as Utils from "../utils"; import { Mode } from "./ui"; import i18next from "i18next"; -import BattleScene from "#app/battle-scene.js"; +import BattleScene from "#app/battle-scene"; import { addTextObject, TextStyle } from "./text"; import { addWindow } from "./ui-theme"; +import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; + +interface BuildInteractableImageOpts { + scale?: number; + x?: number; + y?: number; + origin?: { x: number; y: number }; +} export default 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"; + private readonly ERR_PASSWORD_MATCH: string = "password doesn't match"; + private readonly ERR_NO_SAVES: string = "No save files found"; + private readonly ERR_TOO_MANY_SAVES: string = "Too many save files found"; + private googleImage: Phaser.GameObjects.Image; private discordImage: Phaser.GameObjects.Image; + private usernameInfoImage: Phaser.GameObjects.Image; private externalPartyContainer: Phaser.GameObjects.Container; + private infoContainer: Phaser.GameObjects.Container; private externalPartyBg: Phaser.GameObjects.NineSlice; private externalPartyTitle: Phaser.GameObjects.Text; constructor(scene: BattleScene, mode: Mode | null = null) { @@ -18,8 +35,23 @@ export default class LoginFormUiHandler extends FormModalUiHandler { } setup(): void { - super.setup(); + this.buildExternalPartyContainer(); + + this.infoContainer = this.scene.add.container(0, 0); + + this.usernameInfoImage = this.buildInteractableImage("settings_icon", "username-info-icon", { + x: 20, + scale: 0.5 + }); + + this.infoContainer.add(this.usernameInfoImage); + this.getUi().add(this.infoContainer); + this.infoContainer.setVisible(false); + this.infoContainer.disableInteractive(); + } + + private buildExternalPartyContainer() { this.externalPartyContainer = this.scene.add.container(0, 0); this.externalPartyContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 12, this.scene.game.canvas.height / 12), Phaser.Geom.Rectangle.Contains); this.externalPartyTitle = addTextObject(this.scene, 0, 4, "", TextStyle.SETTINGS_LABEL); @@ -28,31 +60,8 @@ export default class LoginFormUiHandler extends FormModalUiHandler { this.externalPartyContainer.add(this.externalPartyBg); this.externalPartyContainer.add(this.externalPartyTitle); - const googleImage = this.scene.add.image(0, 0, "google"); - googleImage.setOrigin(0, 0); - googleImage.setScale(0.07); - googleImage.setInteractive(); - googleImage.setName("google-icon"); - googleImage.on("pointerdown", () => { - const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/google/callback`); - const googleId = import.meta.env.VITE_GOOGLE_CLIENT_ID; - const googleUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${googleId}&redirect_uri=${redirectUri}&response_type=code&scope=openid`; - window.open(googleUrl, "_self"); - }); - this.googleImage = googleImage; - - const discordImage = this.scene.add.image(20, 0, "discord"); - discordImage.setOrigin(0, 0); - discordImage.setScale(0.07); - discordImage.setInteractive(); - discordImage.setName("discord-icon"); - discordImage.on("pointerdown", () => { - const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/discord/callback`); - const discordId = import.meta.env.VITE_DISCORD_CLIENT_ID; - const discordUrl = `https://discord.com/api/oauth2/authorize?client_id=${discordId}&redirect_uri=${redirectUri}&response_type=code&scope=identify&prompt=none`; - window.open(discordUrl, "_self"); - }); - this.discordImage = discordImage; + this.googleImage = this.buildInteractableImage("google", "google-icon"); + this.discordImage = this.buildInteractableImage("discord", "discord-icon"); this.externalPartyContainer.add(this.googleImage); this.externalPartyContainer.add(this.discordImage); @@ -62,51 +71,54 @@ export default class LoginFormUiHandler extends FormModalUiHandler { this.externalPartyContainer.setVisible(false); } - getModalTitle(config?: ModalConfig): string { + override getModalTitle(_config?: ModalConfig): string { return i18next.t("menu:login"); } - getFields(config?: ModalConfig): string[] { + override getFields(_config?: ModalConfig): string[] { return [ i18next.t("menu:username"), i18next.t("menu:password") ]; } - getWidth(config?: ModalConfig): number { + override getWidth(_config?: ModalConfig): number { return 160; } - getMargin(config?: ModalConfig): [number, number, number, number] { + override getMargin(_config?: ModalConfig): [number, number, number, number] { return [ 0, 0, 48, 0 ]; } - getButtonLabels(config?: ModalConfig): string[] { + override getButtonLabels(_config?: ModalConfig): string[] { return [ i18next.t("menu:login"), i18next.t("menu:register")]; } - getReadableErrorMessage(error: string): string { + override getReadableErrorMessage(error: string): string { const colonIndex = error?.indexOf(":"); if (colonIndex > 0) { error = error.slice(0, colonIndex); } switch (error) { - case "invalid username": + case this.ERR_USERNAME: return i18next.t("menu:invalidLoginUsername"); - case "invalid password": + case this.ERR_PASSWORD: return i18next.t("menu:invalidLoginPassword"); - case "account doesn't exist": + case this.ERR_ACCOUNT_EXIST: return i18next.t("menu:accountNonExistent"); - case "password doesn't match": + case this.ERR_PASSWORD_MATCH: return i18next.t("menu:unmatchingPassword"); + case this.ERR_NO_SAVES: + return i18next.t("menu:noSaves"); + case this.ERR_TOO_MANY_SAVES: + return i18next.t("menu:tooManySaves"); } return super.getReadableErrorMessage(error); } - show(args: any[]): boolean { + override show(args: any[]): boolean { if (super.show(args)) { - this.processExternalProvider(); - const config = args[0] as ModalConfig; + this.processExternalProvider(config); const originalLoginAction = this.submitAction; this.submitAction = (_) => { // Prevent overlapping overrides on action modification @@ -143,25 +155,81 @@ export default class LoginFormUiHandler extends FormModalUiHandler { return false; } - clear() { + override clear() { super.clear(); this.externalPartyContainer.setVisible(false); + this.infoContainer.setVisible(false); + this.setMouseCursorStyle("default"); //reset cursor - this.discordImage.off("pointerdown"); - this.googleImage.off("pointerdown"); + [this.discordImage, this.googleImage, this.usernameInfoImage].forEach((img) => img.off("pointerdown")); } - processExternalProvider() : void { + private processExternalProvider(config: ModalConfig) : void { this.externalPartyTitle.setText(i18next.t("menu:orUse") ?? ""); this.externalPartyTitle.setX(20+this.externalPartyTitle.text.length); this.externalPartyTitle.setVisible(true); this.externalPartyContainer.setPositionRelative(this.modalContainer, 175, 0); this.externalPartyContainer.setVisible(true); - this.externalPartyBg.setSize(this.externalPartyTitle.text.length+50, this.modalBg.height); + this.externalPartyBg.setSize(this.externalPartyTitle.text.length + 50, this.modalBg.height); this.getUi().moveTo(this.externalPartyContainer, this.getUi().length - 1); this.googleImage.setPosition(this.externalPartyBg.width/3.1, this.externalPartyBg.height-60); this.discordImage.setPosition(this.externalPartyBg.width/3.1, this.externalPartyBg.height-40); + this.infoContainer.setPosition(5, -76); + this.infoContainer.setVisible(true); + this.getUi().moveTo(this.infoContainer, this.getUi().length - 1); + this.usernameInfoImage.setPositionRelative(this.infoContainer, 0, 0); + + this.discordImage.on("pointerdown", () => { + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/discord/callback`); + const discordId = import.meta.env.VITE_DISCORD_CLIENT_ID; + const discordUrl = `https://discord.com/api/oauth2/authorize?client_id=${discordId}&redirect_uri=${redirectUri}&response_type=code&scope=identify&prompt=none`; + window.open(discordUrl, "_self"); + }); + + this.googleImage.on("pointerdown", () => { + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/google/callback`); + const googleId = import.meta.env.VITE_GOOGLE_CLIENT_ID; + const googleUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${googleId}&redirect_uri=${redirectUri}&response_type=code&scope=openid`; + window.open(googleUrl, "_self"); + }); + + const onFail = error => { + this.scene.ui.setMode(Mode.LOADING, { buttonActions: [] }); + this.scene.ui.setModeForceTransition(Mode.LOGIN_FORM, Object.assign(config, { errorMessage: error?.trim() })); + this.scene.ui.playError(); + }; + + this.usernameInfoImage.on("pointerdown", () => { + const localStorageKeys = Object.keys(localStorage); // this gets the keys for localStorage + const keyToFind = "data_"; + const dataKeys = localStorageKeys.filter(ls => ls.indexOf(keyToFind) >= 0); + if (dataKeys.length > 0 && dataKeys.length <= 2) { + const options: OptionSelectItem[] = []; + for (let i = 0; i < dataKeys.length; i++) { + options.push({ + label: dataKeys[i].replace(keyToFind, ""), + handler: () => { + this.scene.ui.revertMode(); + this.infoContainer.disableInteractive(); + return true; + } + }); + } + this.scene.ui.setOverlayMode(Mode.OPTION_SELECT, { + options: options, + delay: 1000 + }); + this.infoContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width, this.scene.game.canvas.height), Phaser.Geom.Rectangle.Contains); + } else { + if (dataKeys.length > 2) { + return onFail(this.ERR_TOO_MANY_SAVES); + } else { + return onFail(this.ERR_NO_SAVES); + } + } + }); + this.externalPartyContainer.setAlpha(0); this.scene.tweens.add({ targets: this.externalPartyContainer, @@ -170,5 +238,31 @@ export default class LoginFormUiHandler extends FormModalUiHandler { y: "-=24", alpha: 1 }); + + this.infoContainer.setAlpha(0); + this.scene.tweens.add({ + targets: this.infoContainer, + duration: Utils.fixedInt(1000), + ease: "Sine.easeInOut", + y: "-=24", + alpha: 1 + }); + } + + private buildInteractableImage(texture: string, name: string, opts: BuildInteractableImageOpts = {}) { + const { + scale = 0.07, + x = 0, + y = 0, + origin = { x: 0, y: 0 } + } = opts; + const img = this.scene.add.image(x, y, texture); + img.setName(name); + img.setOrigin(origin.x, origin.y); + img.setScale(scale); + img.setInteractive(); + this.addInteractionHoverEffect(img); + + return img; } } diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 6349d219827..adbb3089e5c 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -31,6 +31,7 @@ let wikiUrl = "https://wiki.pokerogue.net/start"; const discordUrl = "https://discord.gg/uWpTfdKG49"; const githubUrl = "https://github.com/pagefaultgames/pokerogue"; const redditUrl = "https://www.reddit.com/r/pokerogue"; +const donateUrl = "https://github.com/sponsors/patapancakes"; export default class MenuUiHandler extends MessageUiHandler { private readonly textPadding = 8; @@ -369,7 +370,16 @@ export default class MenuUiHandler extends MessageUiHandler { return true; }, keepOpen: true - }]; + }, + { + label: i18next.t("menuUiHandler:donate"), + handler: () => { + window.open(donateUrl, "_blank")?.focus(); + return true; + }, + keepOpen: true + } + ]; if (!bypassLogin && loggedInUser?.hasAdminRole) { communityOptions.push({ label: "Admin", diff --git a/src/ui/modal-ui-handler.ts b/src/ui/modal-ui-handler.ts index cecdacc1eb9..5f586ec8db7 100644 --- a/src/ui/modal-ui-handler.ts +++ b/src/ui/modal-ui-handler.ts @@ -57,29 +57,35 @@ export abstract class ModalUiHandler extends UiHandler { const buttonLabels = this.getButtonLabels(); - const buttonTopMargin = this.getButtonTopMargin(); - for (const label of buttonLabels) { - const buttonLabel = addTextObject(this.scene, 0, 8, label, TextStyle.TOOLTIP_CONTENT); - buttonLabel.setOrigin(0.5, 0.5); - - const buttonBg = addWindow(this.scene, 0, 0, buttonLabel.getBounds().width + 8, 16, false, false, 0, 0, WindowVariant.THIN); - buttonBg.setOrigin(0.5, 0); - buttonBg.setInteractive(new Phaser.Geom.Rectangle(0, 0, buttonBg.width, buttonBg.height), Phaser.Geom.Rectangle.Contains); - - const buttonContainer = this.scene.add.container(0, buttonTopMargin); - - this.buttonBgs.push(buttonBg); - this.buttonContainers.push(buttonContainer); - - buttonContainer.add(buttonBg); - buttonContainer.add(buttonLabel); - this.modalContainer.add(buttonContainer); + this.addButton(label); } this.modalContainer.setVisible(false); } + private addButton(label: string) { + const buttonTopMargin = this.getButtonTopMargin(); + const buttonLabel = addTextObject(this.scene, 0, 8, label, TextStyle.TOOLTIP_CONTENT); + buttonLabel.setOrigin(0.5, 0.5); + + const buttonBg = addWindow(this.scene, 0, 0, buttonLabel.getBounds().width + 8, 16, false, false, 0, 0, WindowVariant.THIN); + buttonBg.setOrigin(0.5, 0); + buttonBg.setInteractive(new Phaser.Geom.Rectangle(0, 0, buttonBg.width, buttonBg.height), Phaser.Geom.Rectangle.Contains); + + const buttonContainer = this.scene.add.container(0, buttonTopMargin); + + this.buttonBgs.push(buttonBg); + this.buttonContainers.push(buttonContainer); + + buttonContainer.add(buttonBg); + buttonContainer.add(buttonLabel); + + this.addInteractionHoverEffect(buttonBg); + + this.modalContainer.add(buttonContainer); + } + show(args: any[]): boolean { if (args.length >= 1 && "buttonActions" in args[0]) { super.show(args); @@ -135,4 +141,20 @@ export abstract class ModalUiHandler extends UiHandler { this.buttonBgs.map(bg => bg.off("pointerdown")); } + + /** + * Adds a hover effect to a game object which changes the cursor to a `pointer` and tints it slighly + * @param gameObject the game object to add hover events/effects to + */ + protected addInteractionHoverEffect(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.NineSlice | Phaser.GameObjects.Sprite) { + gameObject.on("pointerover", () => { + this.setMouseCursorStyle("pointer"); + gameObject.setTint(0xbbbbbb); + }); + + gameObject.on("pointerout", () => { + this.setMouseCursorStyle("default"); + gameObject.clearTint(); + }); + } } diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 6e9a33df5d8..ca5d27f96a4 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -257,6 +257,9 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { if (this.scene.shopCursorTarget === ShopCursorTarget.CHECK_TEAM) { this.setRowCursor(0); this.setCursor(2); + } else if ((this.scene.shopCursorTarget === ShopCursorTarget.SHOP) && this.scene.gameMode.hasNoShop) { + this.setRowCursor(ShopCursorTarget.REWARDS); + this.setCursor(0); } else { this.setRowCursor(this.scene.shopCursorTarget); this.setCursor(0); diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index a61037548e6..98a19402a2b 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -311,7 +311,7 @@ export default class PartyUiHandler extends MessageUiHandler { this.partyContainer.setVisible(true); this.partyBg.setTexture(`party_bg${this.scene.currentBattle.double ? "_double" : ""}`); this.populatePartySlots(); - this.setCursor(this.cursor < 6 ? this.cursor : 0); + this.setCursor(0); return true; } @@ -1321,16 +1321,13 @@ class PartySlot extends Phaser.GameObjects.Container { this.slotHpOverlay.setVisible(false); this.slotHpText.setVisible(false); let slotTmText: string; - switch (true) { - case (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1): - slotTmText = i18next.t("partyUiHandler:notAble"); - break; - case (this.pokemon.getMoveset().filter(m => m?.moveId === tmMoveId).length > 0): + + if (this.pokemon.getMoveset().filter(m => m?.moveId === tmMoveId).length > 0) { slotTmText = i18next.t("partyUiHandler:learned"); - break; - default: + } else if (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1) { + slotTmText = i18next.t("partyUiHandler:notAble"); + } else { slotTmText = i18next.t("partyUiHandler:able"); - break; } this.slotDescriptionLabel.setText(slotTmText); diff --git a/src/ui/pokemon-hatch-info-container.ts b/src/ui/pokemon-hatch-info-container.ts new file mode 100644 index 00000000000..f8a9adced36 --- /dev/null +++ b/src/ui/pokemon-hatch-info-container.ts @@ -0,0 +1,189 @@ +import PokemonInfoContainer from "./pokemon-info-container"; +import BattleScene from "../battle-scene"; +import { Gender } from "../data/gender"; +import { Type } from "../data/type"; +import * as Utils from "../utils"; +import { TextStyle, addTextObject } from "./text"; +import { speciesEggMoves } from "#app/data/egg-moves"; +import { allMoves } from "#app/data/move"; +import { Species } from "#app/enums/species"; +import { getEggTierForSpecies } from "#app/data/egg"; +import { starterColors } from "../battle-scene"; +import { argbFromRgba } from "@material/material-color-utilities"; +import { EggHatchData } from "#app/data/egg-hatch-data"; +import { 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 { + private currentPokemonSprite: Phaser.GameObjects.Sprite; + private pokemonNumberText: Phaser.GameObjects.Text; + private pokemonNameText: Phaser.GameObjects.Text; + private pokemonEggMovesContainer: Phaser.GameObjects.Container; + private pokemonEggMoveContainers: Phaser.GameObjects.Container[]; + private pokemonEggMoveBgs: Phaser.GameObjects.NineSlice[]; + private pokemonEggMoveLabels: Phaser.GameObjects.Text[]; + private pokemonHatchedIcon : Phaser.GameObjects.Sprite; + private pokemonListContainer: Phaser.GameObjects.Container; + private pokemonCandyIcon: Phaser.GameObjects.Sprite; + private pokemonCandyOverlayIcon: Phaser.GameObjects.Sprite; + private pokemonCandyCountText: Phaser.GameObjects.Text; + + constructor(scene: BattleScene, listContainer : Phaser.GameObjects.Container, x: number = 115, y: number = 9,) { + super(scene, x, y); + this.pokemonListContainer = listContainer; + + } + setup(): void { + super.setup(); + super.changeToEggSummaryLayout(); + + this.currentPokemonSprite = this.scene.add.sprite(54, 80, "pkmn__sub"); + this.currentPokemonSprite.setScale(0.8); + this.currentPokemonSprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], ignoreTimeTint: true }); + this.pokemonListContainer.add(this.currentPokemonSprite); + + // setup name and number + this.pokemonNumberText = addTextObject(this.scene, 80, 107.5, "0000", TextStyle.SUMMARY, {fontSize: 74}); + this.pokemonNumberText.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonNumberText); + + this.pokemonNameText = addTextObject(this.scene, 7, 107.5, "", TextStyle.SUMMARY, {fontSize: 74}); + this.pokemonNameText.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonNameText); + + // setup egg icon and candy count + this.pokemonHatchedIcon = this.scene.add.sprite(-5, 90, "egg_icons"); + this.pokemonHatchedIcon.setOrigin(0, 0.2); + this.pokemonHatchedIcon.setScale(0.8); + this.pokemonListContainer.add(this.pokemonHatchedIcon); + + this.pokemonCandyIcon = this.scene.add.sprite(4.5, 40, "candy"); + this.pokemonCandyIcon.setScale(0.5); + this.pokemonCandyIcon.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonCandyIcon); + + this.pokemonCandyOverlayIcon = this.scene.add.sprite(4.5, 40, "candy_overlay"); + this.pokemonCandyOverlayIcon.setScale(0.5); + this.pokemonCandyOverlayIcon.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonCandyOverlayIcon); + + this.pokemonCandyCountText = addTextObject(this.scene, 14, 40, "x0", TextStyle.SUMMARY, { fontSize: "56px" }); + this.pokemonCandyCountText.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonCandyCountText); + + // setup egg moves + this.pokemonEggMoveContainers = []; + this.pokemonEggMoveBgs = []; + this.pokemonEggMoveLabels = []; + this.pokemonEggMovesContainer = this.scene.add.container(0, 200); + this.pokemonEggMovesContainer.setVisible(false); + this.pokemonEggMovesContainer.setScale(0.5); + + for (let m = 0; m < 4; m++) { + const eggMoveContainer = this.scene.add.container(0, 0 + 6 * m); + + const eggMoveBg = this.scene.add.nineslice(70, 0, "type_bgs", "unknown", 92, 14, 2, 2, 2, 2); + eggMoveBg.setOrigin(1, 0); + + const eggMoveLabel = addTextObject(this.scene, 70 -eggMoveBg.width / 2, 0, "???", TextStyle.PARTY); + eggMoveLabel.setOrigin(0.5, 0); + + this.pokemonEggMoveBgs.push(eggMoveBg); + this.pokemonEggMoveLabels.push(eggMoveLabel); + + eggMoveContainer.add(eggMoveBg); + eggMoveContainer.add(eggMoveLabel); + eggMoveContainer.setScale(0.44); + + this.pokemonEggMoveContainers.push(eggMoveContainer); + + this.pokemonEggMovesContainer.add(eggMoveContainer); + } + + super.add(this.pokemonEggMoveContainers); + + } + + /** + * Disable the sprite (and replace with substitute) + */ + hideDisplayPokemon() { + this.currentPokemonSprite.setVisible(false); + } + + /** + * Display a given pokemon sprite with animations + * assumes the specific pokemon sprite has already been loaded + */ + displayPokemon(pokemon: PlayerPokemon) { + const species = pokemon.species; + const female = pokemon.gender === Gender.FEMALE; + const formIndex = pokemon.formIndex; + const shiny = pokemon.shiny; + const variant = pokemon.variant; + this.currentPokemonSprite.setVisible(false); + species.loadAssets(this.scene, female, formIndex, shiny, variant, true).then(() => { + + getPokemonSpeciesForm(species.speciesId, pokemon.formIndex).cry(this.scene); + this.currentPokemonSprite.play(species.getSpriteKey(female, formIndex, shiny, variant)); + this.currentPokemonSprite.setPipelineData("shiny", shiny); + this.currentPokemonSprite.setPipelineData("variant", variant); + this.currentPokemonSprite.setPipelineData("spriteKey", species.getSpriteKey(female, formIndex, shiny, variant)); + this.currentPokemonSprite.setVisible(true); + }); + } + + /** + * Updates the info container with the appropriate dex data and starter entry from the hatchInfo + * Also updates the displayed name, number, egg moves and main animated sprite for the pokemon + * @param hatchInfo The EggHatchData of the pokemon / new hatch to show + */ + showHatchInfo(hatchInfo: EggHatchData) { + this.pokemonEggMovesContainer.setVisible(true); + + const pokemon = hatchInfo.pokemon; + const species = pokemon.species; + this.displayPokemon(pokemon); + + super.show(pokemon, false, 1, hatchInfo.getDex(), hatchInfo.getStarterEntry(), true); + const colorScheme = starterColors[species.speciesId]; + + this.pokemonCandyIcon.setTint(argbFromRgba(Utils.rgbHexToRgba(colorScheme[0]))); + this.pokemonCandyIcon.setVisible(true); + this.pokemonCandyOverlayIcon.setTint(argbFromRgba(Utils.rgbHexToRgba(colorScheme[1]))); + this.pokemonCandyOverlayIcon.setVisible(true); + this.pokemonCandyCountText.setText(`x${this.scene.gameData.starterData[species.speciesId].candyCount}`); + this.pokemonCandyCountText.setVisible(true); + + this.pokemonNumberText.setText(Utils.padInt(species.speciesId, 4)); + this.pokemonNameText.setText(species.name); + + const hasEggMoves = species && speciesEggMoves.hasOwnProperty(species.speciesId); + + for (let em = 0; em < 4; em++) { + const eggMove = hasEggMoves ? allMoves[speciesEggMoves[species.speciesId][em]] : null; + const eggMoveUnlocked = eggMove && this.scene.gameData.starterData[species.speciesId].eggMoves & Math.pow(2, em); + this.pokemonEggMoveBgs[em].setFrame(Type[eggMove ? eggMove.type : Type.UNKNOWN].toString().toLowerCase()); + + this.pokemonEggMoveLabels[em].setText(eggMove && eggMoveUnlocked ? eggMove.name : "???"); + if (!(eggMove && hatchInfo.starterDataEntryBeforeUpdate.eggMoves & Math.pow(2, em)) && eggMoveUnlocked) { + this.pokemonEggMoveLabels[em].setText("(+) " + eggMove.name); + } + } + + // will always have at least one egg move + this.pokemonEggMovesContainer.setVisible(true); + + if (species.speciesId === Species.MANAPHY || species.speciesId === Species.PHIONE) { + this.pokemonHatchedIcon.setFrame("manaphy"); + } else { + this.pokemonHatchedIcon.setFrame(getEggTierForSpecies(species)); + } + + } + +} diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index edb85ecff7a..49bfd4d7293 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -6,7 +6,7 @@ import { getNatureName } from "../data/nature"; import { Type } from "../data/type"; import Pokemon from "../field/pokemon"; import i18next from "i18next"; -import { DexAttr } from "../system/game-data"; +import { DexAttr, DexEntry, StarterDataEntry } from "../system/game-data"; import * as Utils from "../utils"; import ConfirmUiHandler from "./confirm-ui-handler"; import { StatsContainer } from "./stats-container"; @@ -24,7 +24,7 @@ const languageSettings: { [key: string]: LanguageSetting } = { infoContainerTextSize: "64px" }, "de": { - infoContainerTextSize: "64px" + infoContainerTextSize: "64px", }, "es": { infoContainerTextSize: "64px" @@ -63,6 +63,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { private pokemonMovesContainers: Phaser.GameObjects.Container[]; private pokemonMoveBgs: Phaser.GameObjects.NineSlice[]; private pokemonMoveLabels: Phaser.GameObjects.Text[]; + private infoBg; private numCharsBeforeCutoff = 16; @@ -83,9 +84,9 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { const currentLanguage = i18next.resolvedLanguage!; // TODO: is this bang correct? const langSettingKey = Object.keys(languageSettings).find(lang => currentLanguage?.includes(lang))!; // TODO: is this bang correct? const textSettings = languageSettings[langSettingKey]; - const infoBg = addWindow(this.scene, 0, 0, this.infoWindowWidth, 132); - infoBg.setOrigin(0.5, 0.5); - infoBg.setName("window-info-bg"); + this.infoBg = addWindow(this.scene, 0, 0, this.infoWindowWidth, 132); + this.infoBg.setOrigin(0.5, 0.5); + this.infoBg.setName("window-info-bg"); this.pokemonMovesContainer = this.scene.add.container(6, 14); this.pokemonMovesContainer.setName("pkmn-moves"); @@ -133,7 +134,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.statsContainer = new StatsContainer(this.scene, -48, -64, true); - this.add(infoBg); + this.add(this.infoBg); this.add(this.statsContainer); // The position should be set per language @@ -207,9 +208,16 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.setVisible(false); } - show(pokemon: Pokemon, showMoves: boolean = false, speedMultiplier: number = 1): Promise { + show(pokemon: Pokemon, showMoves: boolean = false, speedMultiplier: number = 1, dexEntry?: DexEntry, starterEntry?: StarterDataEntry, eggInfo = false): Promise { return new Promise(resolve => { - const caughtAttr = BigInt(pokemon.scene.gameData.dexData[pokemon.species.speciesId].caughtAttr); + if (!dexEntry) { + dexEntry = pokemon.scene.gameData.dexData[pokemon.species.speciesId]; + } + if (!starterEntry) { + starterEntry = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()]; + } + + const caughtAttr = BigInt(dexEntry.caughtAttr); if (pokemon.gender > Gender.GENDERLESS) { this.pokemonGenderText.setText(getGenderSymbol(pokemon.gender)); this.pokemonGenderText.setColor(getGenderColor(pokemon.gender)); @@ -268,7 +276,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { const opponentPokemonAbilityIndex = (opponentPokemonOneNormalAbility && pokemon.abilityIndex === 1) ? 2 : pokemon.abilityIndex; const opponentPokemonAbilityAttr = 1 << opponentPokemonAbilityIndex; - const rootFormHasHiddenAbility = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr & opponentPokemonAbilityAttr; + const rootFormHasHiddenAbility = starterEntry.abilityAttr & opponentPokemonAbilityAttr; if (!rootFormHasHiddenAbility) { this.pokemonAbilityLabelText.setColor(getTextColor(TextStyle.SUMMARY_BLUE, false, this.scene.uiTheme)); @@ -280,7 +288,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.pokemonNatureText.setText(getNatureName(pokemon.getNature(), true, false, false, this.scene.uiTheme)); - const dexNatures = pokemon.scene.gameData.dexData[pokemon.species.speciesId].natureAttr; + const dexNatures = dexEntry.natureAttr; const newNature = 1 << (pokemon.nature + 1); if (!(dexNatures & newNature)) { @@ -324,31 +332,31 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { } const starterSpeciesId = pokemon.species.getRootSpeciesId(); - const originalIvs: integer[] | null = this.scene.gameData.dexData[starterSpeciesId].caughtAttr - ? this.scene.gameData.dexData[starterSpeciesId].ivs - : null; + const originalIvs: integer[] | null = eggInfo ? (dexEntry.caughtAttr ? dexEntry.ivs : null) : (this.scene.gameData.dexData[starterSpeciesId].caughtAttr + ? this.scene.gameData.dexData[starterSpeciesId].ivs : null); this.statsContainer.updateIvs(pokemon.ivs, originalIvs!); // TODO: is this bang correct? - - this.scene.tweens.add({ - targets: this, - duration: Utils.fixedInt(Math.floor(750 / speedMultiplier)), - ease: "Cubic.easeInOut", - x: this.initialX - this.infoWindowWidth, - onComplete: () => { - resolve(); - } - }); - - if (showMoves) { + if (!eggInfo) { this.scene.tweens.add({ - delay: Utils.fixedInt(Math.floor(325 / speedMultiplier)), - targets: this.pokemonMovesContainer, - duration: Utils.fixedInt(Math.floor(325 / speedMultiplier)), + targets: this, + duration: Utils.fixedInt(Math.floor(750 / speedMultiplier)), ease: "Cubic.easeInOut", - x: this.movesContainerInitialX - 57, - onComplete: () => resolve() + x: this.initialX - this.infoWindowWidth, + onComplete: () => { + resolve(); + } }); + + if (showMoves) { + this.scene.tweens.add({ + delay: Utils.fixedInt(Math.floor(325 / speedMultiplier)), + targets: this.pokemonMovesContainer, + duration: Utils.fixedInt(Math.floor(325 / speedMultiplier)), + ease: "Cubic.easeInOut", + x: this.movesContainerInitialX - 57, + onComplete: () => resolve() + }); + } } for (let m = 0; m < 4; m++) { @@ -364,6 +372,36 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { }); } + changeToEggSummaryLayout() { + // The position should be set per language (and shifted for new layout) + const currentLanguage = i18next.resolvedLanguage!; // TODO: is this bang correct? + const langSettingKey = Object.keys(languageSettings).find(lang => currentLanguage?.includes(lang))!; // TODO: is this bang correct? + const textSettings = languageSettings[langSettingKey]; + + const eggLabelTextOffset = 43; + const infoContainerLabelXPos = (textSettings?.infoContainerLabelXPos || -18) + eggLabelTextOffset; + const infoContainerTextXPos = (textSettings?.infoContainerTextXPos || -14) + eggLabelTextOffset; + + this.x = this.initialX - this.infoWindowWidth; + + this.pokemonGenderText.setPosition(89, -2); + this.pokemonGenderNewText.setPosition(79, -2); + 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.statsContainer.setScale(0.7); + this.statsContainer.setPosition(30, -3); + this.infoBg.setVisible(false); + this.pokemonMovesContainer.setVisible(false); + } + makeRoomForConfirmUi(speedMultiplier: number = 1, fromCatch: boolean = false): Promise { const xPosition = fromCatch ? this.initialX - this.infoWindowWidth - 65 : this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth; return new Promise(resolve => { diff --git a/src/ui/registration-form-ui-handler.ts b/src/ui/registration-form-ui-handler.ts index 733aab79b05..0c4b54ac723 100644 --- a/src/ui/registration-form-ui-handler.ts +++ b/src/ui/registration-form-ui-handler.ts @@ -5,6 +5,20 @@ import { Mode } from "./ui"; import { TextStyle, addTextObject } from "./text"; import i18next from "i18next"; + +interface LanguageSetting { + inputFieldFontSize?: string, + warningMessageFontSize?: string, + errorMessageFontSize?: string, +} + +const languageSettings: { [key: string]: LanguageSetting } = { + "es":{ + inputFieldFontSize: "50px", + errorMessageFontSize: "40px", + } +}; + export default class RegistrationFormUiHandler extends FormModalUiHandler { getModalTitle(config?: ModalConfig): string { return i18next.t("menu:register"); @@ -50,7 +64,17 @@ export default class RegistrationFormUiHandler extends FormModalUiHandler { setup(): void { super.setup(); - const label = addTextObject(this.scene, 10, 87, i18next.t("menu:registrationAgeWarning"), TextStyle.TOOLTIP_CONTENT, { fontSize: "42px" }); + this.modalContainer.list.forEach((child: Phaser.GameObjects.GameObject) => { + if (child instanceof Phaser.GameObjects.Text && child !== this.titleText) { + const inputFieldFontSize = languageSettings[i18next.resolvedLanguage!]?.inputFieldFontSize; + if (inputFieldFontSize) { + child.setFontSize(inputFieldFontSize); + } + } + }); + + const warningMessageFontSize = languageSettings[i18next.resolvedLanguage!]?.warningMessageFontSize ?? "42px"; + const label = addTextObject(this.scene, 10, 87, i18next.t("menu:registrationAgeWarning"), TextStyle.TOOLTIP_CONTENT, { fontSize: warningMessageFontSize}); this.modalContainer.add(label); } @@ -68,6 +92,10 @@ export default class RegistrationFormUiHandler extends FormModalUiHandler { const onFail = error => { this.scene.ui.setMode(Mode.REGISTRATION_FORM, Object.assign(config, { errorMessage: error?.trim() })); this.scene.ui.playError(); + const errorMessageFontSize = languageSettings[i18next.resolvedLanguage!]?.errorMessageFontSize; + if (errorMessageFontSize) { + this.errorMessage.setFontSize(errorMessageFontSize); + } }; if (!this.inputs[0].text) { return onFail(i18next.t("menu:emptyUsername")); diff --git a/src/ui/run-info-ui-handler.ts b/src/ui/run-info-ui-handler.ts index 25210277edc..7a183a11d29 100644 --- a/src/ui/run-info-ui-handler.ts +++ b/src/ui/run-info-ui-handler.ts @@ -13,8 +13,9 @@ import { BattleType } from "../battle"; import { TrainerVariant } from "../field/trainer"; import { Challenges } from "#enums/challenges"; import { getLuckString, getLuckTextTint } from "../modifier/modifier-type"; -import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle.js"; +import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle"; import { Type, getTypeRgb } from "../data/type"; +import { TypeColor, TypeShadow } from "#app/enums/color"; import { getNatureStatMultiplier, getNatureName } from "../data/nature"; import { getVariantTint } from "#app/data/variant"; import { PokemonHeldItemModifier, TerastallizeModifier } from "../modifier/modifier"; @@ -373,15 +374,16 @@ export default class RunInfoUiHandler extends UiHandler { break; case GameModes.CHALLENGE: modeText.appendText(`${i18next.t("gameMode:challenge")}`, false); - modeText.appendText(`\t\t${i18next.t("runHistory:challengeRules")}: `); + modeText.appendText(`${i18next.t("runHistory:challengeRules")}: `); + modeText.setWrapMode(1); // wrap by word + modeText.setWrapWidth(500); const rules: string[] = this.challengeParser(); if (rules) { for (let i = 0; i < rules.length; i++) { - const newline = i > 0 && i%2 === 0; if (i > 0) { - modeText.appendText(" + ", newline); + modeText.appendText(" + ", false); } - modeText.appendText(rules[i], newline); + modeText.appendText(rules[i], false); } } break; @@ -470,14 +472,18 @@ export default class RunInfoUiHandler extends UiHandler { rules.push(i18next.t(`runHistory:challengeMonoGen${this.runInfo.challenges[i].value}`)); break; case Challenges.SINGLE_TYPE: - rules.push(i18next.t(`pokemonInfo:Type.${Type[this.runInfo.challenges[i].value-1]}` as const)); + const typeRule = Type[this.runInfo.challenges[i].value-1]; + const typeTextColor = `[color=${TypeColor[typeRule]}]`; + const typeShadowColor = `[shadow=${TypeShadow[typeRule]}]`; + const typeText = typeTextColor + typeShadowColor + i18next.t(`pokemonInfo:Type.${typeRule}`)!+"[/color]"+"[/shadow]"; + rules.push(typeText); break; case Challenges.FRESH_START: rules.push(i18next.t("challenges:freshStart.name")); break; case Challenges.INVERSE_BATTLE: // - rules.push(i18next.t("challenges:inverseBattle.shortName").split("").reverse().join("")); + rules.push(i18next.t("challenges:inverseBattle.shortName")); break; } } @@ -628,7 +634,7 @@ export default class RunInfoUiHandler extends UiHandler { // Pokemon Held Items - not displayed by default // Endless/Endless Spliced have a different scale because Pokemon tend to accumulate more items in these runs. const heldItemsScale = (this.runInfo.gameMode === GameModes.SPLICED_ENDLESS || this.runInfo.gameMode === GameModes.ENDLESS) ? 0.25 : 0.5; - const heldItemsContainer = this.scene.add.container(-82, 6); + const heldItemsContainer = this.scene.add.container(-82, 2); const heldItemsList : PokemonHeldItemModifier[] = []; if (this.runInfo.modifiers.length) { for (const m of this.runInfo.modifiers) { @@ -648,6 +654,9 @@ export default class RunInfoUiHandler extends UiHandler { break; } const itemIcon = item?.getIcon(this.scene, true); + if (item?.stackCount < item?.getMaxHeldItemCount(pokemon) && itemIcon.list[1] instanceof Phaser.GameObjects.BitmapText) { + itemIcon.list[1].clearTint(); + } itemIcon.setScale(heldItemsScale); itemIcon.setPosition((index%19) * 10, row * 10); heldItemsContainer.add(itemIcon); diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index ff76a467d25..6b75c46bd45 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -32,19 +32,19 @@ import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; import {Passive as PassiveAttr} from "#enums/passive"; import * as Challenge from "../data/challenge"; import MoveInfoOverlay from "./move-info-overlay"; -import { getEggTierForSpecies } from "#app/data/egg.js"; +import { getEggTierForSpecies } from "#app/data/egg"; import { Device } from "#enums/devices"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import {Button} from "#enums/buttons"; -import { EggSourceType } from "#app/enums/egg-source-types.js"; +import { EggSourceType } from "#app/enums/egg-source-types"; import AwaitableUiHandler from "./awaitable-ui-handler"; import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "./dropdown"; import { StarterContainer } from "./starter-container"; import { DropDownColumn, FilterBar } from "./filter-bar"; import { ScrollBar } from "./scroll-bar"; -import { SelectChallengePhase } from "#app/phases/select-challenge-phase.js"; -import { TitlePhase } from "#app/phases/title-phase.js"; +import { SelectChallengePhase } from "#app/phases/select-challenge-phase"; +import { TitlePhase } from "#app/phases/title-phase"; import { Abilities } from "#app/enums/abilities"; export type StarterSelectCallback = (starters: Starter[]) => void; @@ -263,6 +263,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private pokemonHatchedIcon : Phaser.GameObjects.Sprite; private pokemonHatchedCountText: Phaser.GameObjects.Text; private pokemonShinyIcon: Phaser.GameObjects.Sprite; + private pokemonPassiveDisabledIcon: Phaser.GameObjects.Sprite; + private pokemonPassiveLockedIcon: Phaser.GameObjects.Sprite; private instructionsContainer: Phaser.GameObjects.Container; private filterInstructionsContainer: Phaser.GameObjects.Container; @@ -574,6 +576,18 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonPassiveText.setOrigin(0, 0); this.starterSelectContainer.add(this.pokemonPassiveText); + this.pokemonPassiveDisabledIcon = this.scene.add.sprite(starterInfoXPos, 137 + starterInfoYOffset, "icon_stop"); + this.pokemonPassiveDisabledIcon.setOrigin(0, 0.5); + this.pokemonPassiveDisabledIcon.setScale(0.35); + this.pokemonPassiveDisabledIcon.setVisible(false); + this.starterSelectContainer.add(this.pokemonPassiveDisabledIcon); + + this.pokemonPassiveLockedIcon = this.scene.add.sprite(starterInfoXPos, 137 + starterInfoYOffset, "icon_lock"); + this.pokemonPassiveLockedIcon.setOrigin(0, 0.5); + this.pokemonPassiveLockedIcon.setScale(0.42, 0.38); + this.pokemonPassiveLockedIcon.setVisible(false); + this.starterSelectContainer.add(this.pokemonPassiveLockedIcon); + this.pokemonNatureLabelText = addTextObject(this.scene, 6, 145 + starterInfoYOffset, i18next.t("starterSelectUiHandler:nature"), TextStyle.SUMMARY_ALT, { fontSize: starterInfoTextSize }); this.pokemonNatureLabelText.setOrigin(0, 0); this.pokemonNatureLabelText.setVisible(false); @@ -734,7 +748,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonShinyIcon = this.scene.add.sprite(14, 76, "shiny_icons"); this.pokemonShinyIcon.setOrigin(0.15, 0.2); this.pokemonShinyIcon.setScale(1); - this.pokemonCaughtHatchedContainer.add ((this.pokemonShinyIcon)); + this.pokemonCaughtHatchedContainer.add(this.pokemonShinyIcon); this.pokemonHatchedCountText = addTextObject(this.scene, 24, 19, "0", TextStyle.SUMMARY_ALT); this.pokemonHatchedCountText.setOrigin(0, 0); @@ -1839,10 +1853,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler { switch (button) { case Button.CYCLE_SHINY: if (this.canCycleShiny) { - const newVariant = starterAttributes.variant ? starterAttributes.variant as Variant : props.variant; - starterAttributes.shiny = starterAttributes.shiny ? !starterAttributes.shiny : true; - this.setSpeciesDetails(this.lastSpecies, !props.shiny, undefined, undefined, props.shiny ? 0 : newVariant, undefined, undefined); + starterAttributes.shiny = starterAttributes.shiny !== undefined ? !starterAttributes.shiny : false; + if (starterAttributes.shiny) { + // Change to shiny, we need to get the proper default variant + const newProps = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, this.getCurrentDexProps(this.lastSpecies.speciesId)); + const newVariant = starterAttributes.variant ? starterAttributes.variant as Variant : newProps.variant; + this.setSpeciesDetails(this.lastSpecies, true, undefined, undefined, newVariant, undefined, undefined); + this.scene.playSound("se/sparkle"); // Set the variant label to the shiny tint const tint = getVariantTint(newVariant); @@ -1850,6 +1868,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonShinyIcon.setTint(tint); this.pokemonShinyIcon.setVisible(true); } else { + this.setSpeciesDetails(this.lastSpecies, false, undefined, undefined, 0, undefined, undefined); this.pokemonShinyIcon.setVisible(false); success = true; } @@ -2935,6 +2954,10 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } this.pokemonSprite.setVisible(false); + this.pokemonPassiveLabelText.setVisible(false); + this.pokemonPassiveText.setVisible(false); + this.pokemonPassiveDisabledIcon.setVisible(false); + this.pokemonPassiveLockedIcon.setVisible(false); if (this.assetLoadCancelled) { this.assetLoadCancelled.value = true; @@ -3066,9 +3089,34 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonAbilityText.setShadowColor(this.getTextColor(!isHidden ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GOLD, true)); const passiveAttr = this.scene.gameData.starterData[species.speciesId].passiveAttr; - this.pokemonPassiveText.setText(passiveAttr & PassiveAttr.UNLOCKED ? passiveAttr & PassiveAttr.ENABLED ? allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]].name : i18next.t("starterSelectUiHandler:disabled") : i18next.t("starterSelectUiHandler:locked")); - this.pokemonPassiveText.setColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY)); - this.pokemonPassiveText.setShadowColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY, true)); + const passiveAbility = allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]]; + + if (passiveAbility) { + const isUnlocked = !!(passiveAttr & PassiveAttr.UNLOCKED); + const isEnabled = !!(passiveAttr & PassiveAttr.ENABLED); + + const textStyle = isUnlocked && isEnabled ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY; + const textAlpha = isUnlocked && isEnabled ? 1 : 0.5; + + this.pokemonPassiveLabelText.setVisible(true); + this.pokemonPassiveLabelText.setColor(this.getTextColor(TextStyle.SUMMARY_ALT)); + this.pokemonPassiveLabelText.setShadowColor(this.getTextColor(TextStyle.SUMMARY_ALT, true)); + this.pokemonPassiveText.setVisible(true); + this.pokemonPassiveText.setText(passiveAbility.name); + this.pokemonPassiveText.setColor(this.getTextColor(textStyle)); + this.pokemonPassiveText.setAlpha(textAlpha); + this.pokemonPassiveText.setShadowColor(this.getTextColor(textStyle, true)); + + const iconPosition = { + x: this.pokemonPassiveText.x + this.pokemonPassiveText.displayWidth + 1, + y: this.pokemonPassiveText.y + this.pokemonPassiveText.displayHeight / 2 + }; + this.pokemonPassiveDisabledIcon.setVisible(isUnlocked && !isEnabled); + this.pokemonPassiveDisabledIcon.setPosition(iconPosition.x, iconPosition.y); + this.pokemonPassiveLockedIcon.setVisible(!isUnlocked); + this.pokemonPassiveLockedIcon.setPosition(iconPosition.x, iconPosition.y); + + } this.pokemonNatureText.setText(getNatureName(natureIndex as unknown as Nature, true, true, false, this.scene.uiTheme)); @@ -3444,23 +3492,22 @@ export default class StarterSelectUiHandler extends MessageUiHandler { props += DexAttr.MALE; } /* This part is very similar to above, but instead of for gender, it checks for shiny within starter preferences. - * If they're not there, it checks the caughtAttr for shiny only (i.e. SHINY === true && NON_SHINY === false) + * If they're not there, it enables shiny state by default if any shiny was caught */ - if (this.starterPreferences[speciesId]?.shiny || ((caughtAttr & DexAttr.SHINY) > 0n && (caughtAttr & DexAttr.NON_SHINY) === 0n)) { + if (this.starterPreferences[speciesId]?.shiny || ((caughtAttr & DexAttr.SHINY) > 0n && this.starterPreferences[speciesId]?.shiny !== false)) { props += DexAttr.SHINY; - if (this.starterPreferences[speciesId]?.variant) { + if (this.starterPreferences[speciesId]?.variant !== undefined) { props += BigInt(Math.pow(2, this.starterPreferences[speciesId]?.variant)) * DexAttr.DEFAULT_VARIANT; } else { /* This calculates the correct variant if there's no starter preferences for it. - * This gets the lowest tier variant that you've caught (in line with other mechanics) and adds it to the temp props + * This gets the highest tier variant that you've caught and adds it to the temp props */ - if ((caughtAttr & DexAttr.DEFAULT_VARIANT) > 0) { - props += DexAttr.DEFAULT_VARIANT; - } - if ((caughtAttr & DexAttr.VARIANT_2) > 0) { - props += DexAttr.VARIANT_2; - } else if ((caughtAttr & DexAttr.VARIANT_3) > 0) { + if ((caughtAttr & DexAttr.VARIANT_3) > 0) { props += DexAttr.VARIANT_3; + } else if ((caughtAttr & DexAttr.VARIANT_2) > 0) { + props += DexAttr.VARIANT_2; + } else { + props += DexAttr.DEFAULT_VARIANT; } } } else { diff --git a/src/ui/stats-container.ts b/src/ui/stats-container.ts index 2bd7099a2c5..c6e0ea3a71c 100644 --- a/src/ui/stats-container.ts +++ b/src/ui/stats-container.ts @@ -1,7 +1,8 @@ import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; import BattleScene from "../battle-scene"; -import { Stat, getStatName } from "../data/pokemon-stat"; import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text"; +import { PERMANENT_STATS, getStatKey } from "#app/enums/stat"; +import i18next from "i18next"; const ivChartSize = 24; const ivChartStatCoordMultipliers = [[0, -1], [0.825, -0.5], [0.825, 0.5], [-0.825, -0.5], [-0.825, 0.5], [0, 1]]; @@ -53,16 +54,16 @@ export class StatsContainer extends Phaser.GameObjects.Container { this.ivStatValueTexts = []; - new Array(6).fill(null).map((_, i: integer) => { - const statLabel = addTextObject(this.scene, ivChartBg.x + (ivChartSize) * ivChartStatCoordMultipliers[i][0] * 1.325, ivChartBg.y + (ivChartSize) * ivChartStatCoordMultipliers[i][1] * 1.325 - 4 + ivLabelOffset[i], getStatName(i as Stat), TextStyle.TOOLTIP_CONTENT); + for (const s of PERMANENT_STATS) { + const statLabel = addTextObject(this.scene, ivChartBg.x + (ivChartSize) * ivChartStatCoordMultipliers[s][0] * 1.325, ivChartBg.y + (ivChartSize) * ivChartStatCoordMultipliers[s][1] * 1.325 - 4 + ivLabelOffset[s], i18next.t(getStatKey(s)), TextStyle.TOOLTIP_CONTENT); statLabel.setOrigin(0.5); - this.ivStatValueTexts[i] = addBBCodeTextObject(this.scene, statLabel.x, statLabel.y + 8, "0", TextStyle.TOOLTIP_CONTENT); - this.ivStatValueTexts[i].setOrigin(0.5); + this.ivStatValueTexts[s] = addBBCodeTextObject(this.scene, statLabel.x, statLabel.y + 8, "0", TextStyle.TOOLTIP_CONTENT); + this.ivStatValueTexts[s].setOrigin(0.5); this.add(statLabel); - this.add(this.ivStatValueTexts[i]); - }); + this.add(this.ivStatValueTexts[s]); + } } updateIvs(ivs: integer[], originalIvs?: integer[]): void { diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index ea7b798f2bf..8ae72f08edd 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -11,7 +11,6 @@ import Move, { MoveCategory } from "../data/move"; import { getPokeballAtlasKey } from "../data/pokeball"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { getLevelRelExp, getLevelTotalExp } from "../data/exp"; -import { Stat, getStatName } from "../data/pokemon-stat"; import { PokemonHeldItemModifier } from "../modifier/modifier"; import { StatusEffect } from "../data/status-effect"; import { getBiomeName } from "../data/biomes"; @@ -19,10 +18,11 @@ import { Nature, getNatureName, getNatureStatMultiplier } from "../data/nature"; import { loggedInUser } from "../account"; import { Variant, getVariantTint } from "#app/data/variant"; import {Button} from "#enums/buttons"; -import { Ability } from "../data/ability.js"; +import { Ability } from "../data/ability"; import i18next from "i18next"; import {modifierSortFunc} from "../modifier/modifier"; import { PlayerGender } from "#enums/player-gender"; +import { Stat, PERMANENT_STATS, getStatKey } from "#app/enums/stat"; enum Page { PROFILE, @@ -836,10 +836,8 @@ export default class SummaryUiHandler extends UiHandler { const statsContainer = this.scene.add.container(0, -pageBg.height); pageContainer.add(statsContainer); - const stats = Utils.getEnumValues(Stat) as Stat[]; - - stats.forEach((stat, s) => { - const statName = getStatName(stat); + PERMANENT_STATS.forEach((stat, s) => { + const statName = i18next.t(getStatKey(stat)); const rowIndex = s % 3; const colIndex = Math.floor(s / 3); @@ -850,7 +848,7 @@ export default class SummaryUiHandler extends UiHandler { statsContainer.add(statLabel); const statValueText = stat !== Stat.HP - ? Utils.formatStat(this.pokemon?.stats[s]!) // TODO: is this bang correct? + ? Utils.formatStat(this.pokemon?.getStat(stat)!) // TODO: is this bang correct? : `${Utils.formatStat(this.pokemon?.hp!, true)}/${Utils.formatStat(this.pokemon?.getMaxHp()!, true)}`; // TODO: are those bangs correct? const statValue = addTextObject(this.scene, 120 + 88 * colIndex, 56 + 16 * rowIndex, statValueText, TextStyle.WINDOW_ALT); diff --git a/src/ui/ui-handler.ts b/src/ui/ui-handler.ts index 94625efaa75..d9f0a876b71 100644 --- a/src/ui/ui-handler.ts +++ b/src/ui/ui-handler.ts @@ -52,6 +52,15 @@ export default abstract class UiHandler { return changed; } + /** + * Changes the style of the mouse cursor. + * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor} + * @param cursorStyle cursor style to apply + */ + protected setMouseCursorStyle(cursorStyle: "pointer" | "default") { + this.scene.input.manager.canvas.style.cursor = cursorStyle; + } + clear() { this.active = false; } diff --git a/src/ui/ui.ts b/src/ui/ui.ts index 8ec91b59480..6c988b43043 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -49,6 +49,7 @@ 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"; @@ -66,6 +67,7 @@ export enum Mode { STARTER_SELECT, EVOLUTION_SCENE, EGG_HATCH_SCENE, + EGG_HATCH_SUMMARY, CONFIRM, OPTION_SELECT, MENU, @@ -171,6 +173,7 @@ export default class UI extends Phaser.GameObjects.Container { new StarterSelectUiHandler(scene), new EvolutionSceneHandler(scene), new EggHatchSceneHandler(scene), + new EggSummaryUiHandler(scene), new ConfirmUiHandler(scene), new OptionSelectUiHandler(scene), new MenuUiHandler(scene), diff --git a/src/utils.ts b/src/utils.ts index 173ea25b17c..fd5430d7276 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ -import i18next from "i18next"; import { MoneyFormat } from "#enums/money-format"; +import i18next from "i18next"; export const MissingTextureKey = "__MISSING"; @@ -82,6 +82,12 @@ export function randInt(range: integer, min: integer = 0): integer { return Math.floor(Math.random() * range) + min; } +/** + * Generates a random number using the global seed, or the current battle's seed if called via `Battle.randSeedInt` + * @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min} + * @param min The minimum integer to pick, default `0` + * @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1) + */ export function randSeedInt(range: integer, min: integer = 0): integer { if (range <= 1) { return min;