Compare commits

..

No commits in common. "06e4994b8a6db1a864606c6d6e3bd51fefee6eb7" and "4b890cb6c452ce8acc1c2541a6df5ed76a3153ea" have entirely different histories.

231 changed files with 2199 additions and 3502 deletions

View File

@ -1,30 +0,0 @@
name: Test Template
on:
workflow_call:
inputs:
project:
required: true
type: string
shard:
required: true
type: number
totalShards:
required: true
type: number
jobs:
test:
name: Shard ${{ inputs.shard }} of ${{ inputs.totalShards }}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
run: npm ci
- name: Run tests
run: npx vitest --project ${{ inputs.project }} --shard=${{ inputs.shard }}/${{ inputs.totalShards }} ${{ !runner.debug && '--silent' || '' }}

View File

@ -15,33 +15,91 @@ on:
types: [checks_requested]
jobs:
pre-test:
name: Run Pre-test
runs-on: ubuntu-latest
run-misc-tests: # Define a job named "run-tests"
name: Run misc tests # Human-readable name for the job
runs-on: ubuntu-latest # Specify the latest Ubuntu runner for the job
steps:
- name: Check out Git repository # Step to check out the repository
uses: actions/checkout@v4 # Use the checkout action version 4
- name: Set up Node.js # Step to set up Node.js environment
uses: actions/setup-node@v4 # Use the setup-node action version 4
with:
node-version: 20 # Specify Node.js version 20
- name: Install Node.js dependencies # Step to install Node.js dependencies
run: npm ci # Use 'npm ci' to install dependencies
- name: pre-test # pre-test to check overrides
run: npx vitest run --project pre
- name: test misc
run: npx vitest --project misc
run-abilities-tests:
name: Run abilities tests
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
path: tests-action
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
working-directory: tests-action
run: npm ci
- name: Run Pre-test
working-directory: tests-action
run: npx vitest run --project pre ${{ !runner.debug && '--silent' || '' }}
- name: pre-test
run: npx vitest run --project pre
- name: test abilities
run: npx vitest --project abilities
run-tests:
name: Run Tests
needs: [pre-test]
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
uses: ./.github/workflows/test-shard-template.yml
with:
project: main
shard: ${{ matrix.shard }}
totalShards: 10
run-items-tests:
name: Run items tests
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
run: npm ci
- name: pre-test
run: npx vitest run --project pre
- name: test items
run: npx vitest --project items
run-moves-tests:
name: Run moves tests
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
run: npm ci
- name: pre-test
run: npx vitest run --project pre
- name: test moves
run: npx vitest --project moves
run-battle-tests:
name: Run battle tests
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node.js dependencies
run: npm ci
- name: pre-test
run: npx vitest run --project pre
- name: test battle
run: npx vitest --project battle

View File

@ -20,58 +20,54 @@ const type = args[0]; // "move" or "ability"
let fileName = args[1]; // The file name
if (!type || !fileName) {
console.error('Please provide a type ("move", "ability", or "item") and a file name.');
process.exit(1);
console.error('Please provide both a type ("move", "ability", or "item") and a file name.');
process.exit(1);
}
// Convert fileName from kebab-case or camelCase to snake_case
fileName = fileName
.replace(/-+/g, '_') // Convert kebab-case (dashes) to underscores
.replace(/([a-z])([A-Z])/g, '$1_$2') // Convert camelCase to snake_case
.toLowerCase(); // Ensure all lowercase
// Convert fileName from to snake_case if camelCase is given
fileName = fileName.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
// Format the description for the test case
const formattedName = fileName
.replace(/_/g, ' ')
.replace(/\b\w/g, char => char.toUpperCase());
.replace(/_/g, ' ')
.replace(/\b\w/g, char => char.toUpperCase());
// Determine the directory based on the type
let dir;
let description;
if (type === 'move') {
dir = path.join(__dirname, 'src', 'test', 'moves');
description = `Moves - ${formattedName}`;
dir = path.join(__dirname, 'src', 'test', 'moves');
description = `Moves - ${formattedName}`;
} else if (type === 'ability') {
dir = path.join(__dirname, 'src', 'test', 'abilities');
description = `Abilities - ${formattedName}`;
dir = path.join(__dirname, 'src', 'test', 'abilities');
description = `Abilities - ${formattedName}`;
} else if (type === "item") {
dir = path.join(__dirname, 'src', 'test', 'items');
description = `Items - ${formattedName}`;
dir = path.join(__dirname, 'src', 'test', 'items');
description = `Items - ${formattedName}`;
} else {
console.error('Invalid type. Please use "move", "ability", or "item".');
process.exit(1);
console.error('Invalid type. Please use "move", "ability", or "item".');
process.exit(1);
}
// Ensure the directory exists
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
fs.mkdirSync(dir, { recursive: true });
}
// Create the file with the given name
const filePath = path.join(dir, `${fileName}.test.ts`);
if (fs.existsSync(filePath)) {
console.error(`File "${fileName}.test.ts" already exists.`);
process.exit(1);
console.error(`File "${fileName}.test.ts" already exists.`);
process.exit(1);
}
// Define the content template
const content = `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, it, expect } from "vitest";
import { afterEach, beforeAll, beforeEach, describe, it } from "vitest";
describe("${description}", () => {
let phaserGame: Phaser.Game;
@ -91,15 +87,14 @@ describe("${description}", () => {
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.moveset([Moves.SPLASH])
.battleType("single")
.enemyAbility(Abilities.BALL_FETCH)
.enemyMoveset(Moves.SPLASH);
.enemyMoveset(SPLASH_ONLY);
});
it("test case", async () => {
// await game.classicMode.startBattle([Species.MAGIKARP]);
// game.move.select(Moves.SPLASH);
// await game.classicMode.startBattle();
// game.move.select();
}, TIMEOUT);
});
`;

View File

@ -1,7 +1,7 @@
import tseslint from '@typescript-eslint/eslint-plugin';
import stylisticTs from '@stylistic/eslint-plugin-ts'
import parser from '@typescript-eslint/parser';
import importX from 'eslint-plugin-import-x';
// import imports from 'eslint-plugin-import'; // Disabled due to not being compatible with eslint v9
export default [
{
@ -11,7 +11,7 @@ export default [
parser: parser
},
plugins: {
"import-x": importX,
// imports: imports.configs.recommended // Disabled due to not being compatible with eslint v9
'@stylistic/ts': stylisticTs,
'@typescript-eslint': tseslint
},
@ -39,8 +39,7 @@ export default [
}],
"space-before-blocks": ["error", "always"], // Enforces a space before blocks
"keyword-spacing": ["error", { "before": true, "after": true }], // Enforces spacing before and after keywords
"comma-spacing": ["error", { "before": false, "after": true }], // Enforces spacing after comma
"import-x/extensions": ["error", "never", { "json": "always" }], // Enforces no extension for imports unless json
"comma-spacing": ["error", { "before": false, "after": true }] // Enforces spacing after comma
}
}
]

200
package-lock.json generated
View File

@ -28,7 +28,6 @@
"@vitest/coverage-istanbul": "^2.0.4",
"dependency-cruiser": "^16.3.10",
"eslint": "^9.7.0",
"eslint-plugin-import-x": "^4.2.1",
"jsdom": "^24.0.0",
"lefthook": "^1.6.12",
"phaser3spectorjs": "^0.0.8",
@ -2506,19 +2505,6 @@
"node": ">=8"
}
},
"node_modules/doctrine": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"esutils": "^2.0.2"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@ -2701,155 +2687,6 @@
"url": "https://opencollective.com/eslint"
}
},
"node_modules/eslint-import-resolver-node": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
"integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
"dev": true,
"license": "MIT",
"dependencies": {
"debug": "^3.2.7",
"is-core-module": "^2.13.0",
"resolve": "^1.22.4"
}
},
"node_modules/eslint-import-resolver-node/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/eslint-plugin-import-x": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.2.1.tgz",
"integrity": "sha512-WWi2GedccIJa0zXxx3WDnTgouGQTtdYK1nhXMwywbqqAgB0Ov+p1pYBsWh3VaB0bvBOwLse6OfVII7jZD9xo5Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/utils": "^8.1.0",
"debug": "^4.3.4",
"doctrine": "^3.0.0",
"eslint-import-resolver-node": "^0.3.9",
"get-tsconfig": "^4.7.3",
"is-glob": "^4.0.3",
"minimatch": "^9.0.3",
"semver": "^7.6.3",
"stable-hash": "^0.0.4",
"tslib": "^2.6.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0"
}
},
"node_modules/eslint-plugin-import-x/node_modules/@typescript-eslint/scope-manager": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz",
"integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.5.0",
"@typescript-eslint/visitor-keys": "8.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/eslint-plugin-import-x/node_modules/@typescript-eslint/types": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz",
"integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/eslint-plugin-import-x/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz",
"integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"@typescript-eslint/types": "8.5.0",
"@typescript-eslint/visitor-keys": "8.5.0",
"debug": "^4.3.4",
"fast-glob": "^3.3.2",
"is-glob": "^4.0.3",
"minimatch": "^9.0.4",
"semver": "^7.6.0",
"ts-api-utils": "^1.3.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/eslint-plugin-import-x/node_modules/@typescript-eslint/utils": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.5.0.tgz",
"integrity": "sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "8.5.0",
"@typescript-eslint/types": "8.5.0",
"@typescript-eslint/typescript-estree": "8.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0"
}
},
"node_modules/eslint-plugin-import-x/node_modules/@typescript-eslint/visitor-keys": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz",
"integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.5.0",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/eslint-scope": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz",
@ -3306,19 +3143,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/get-tsconfig": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz",
"integrity": "sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==",
"dev": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
},
"funding": {
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/glob-parent": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@ -5030,16 +4854,6 @@
"node": ">=4"
}
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
"node_modules/reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@ -5255,13 +5069,6 @@
"node": ">=0.10.0"
}
},
"node_modules/stable-hash": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz",
"integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==",
"dev": true,
"license": "MIT"
},
"node_modules/stackback": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
@ -5653,13 +5460,6 @@
"node": ">=6"
}
},
"node_modules/tslib": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",
"dev": true,
"license": "0BSD"
},
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

View File

@ -32,7 +32,6 @@
"@vitest/coverage-istanbul": "^2.0.4",
"dependency-cruiser": "^16.3.10",
"eslint": "^9.7.0",
"eslint-plugin-import-x": "^4.2.1",
"jsdom": "^24.0.0",
"lefthook": "^1.6.12",
"phaser3spectorjs": "^0.0.8",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

View File

@ -2193,14 +2193,8 @@ export default class BattleScene extends SceneBase {
return true;
}
/**
* Find a specific {@linkcode Phase} in the phase queue.
*
* @param phaseFilter filter function to use to find the wanted phase
* @returns the found phase or undefined if none found
*/
findPhase<P extends Phase = Phase>(phaseFilter: (phase: P) => boolean): P | undefined {
return this.phaseQueue.find(phaseFilter) as P;
findPhase(phaseFilter: (phase: Phase) => boolean): Phase | undefined {
return this.phaseQueue.find(phaseFilter);
}
tryReplacePhase(phaseFilter: (phase: Phase) => boolean, phase: Phase): boolean {
@ -2769,20 +2763,20 @@ export default class BattleScene extends SceneBase {
const keys: string[] = [];
const playerParty = this.getParty();
playerParty.forEach(p => {
keys.push(p.getSpriteKey(true));
keys.push(p.getBattleSpriteKey(true, true));
keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies) {
keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
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.getSpriteKey(true));
keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies) {
keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
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;

View File

@ -1 +0,0 @@
export const PLAYER_PARTY_MAX_SIZE = 6;

View File

@ -1595,8 +1595,8 @@ export class PostAttackAbAttr extends AbAttr {
private attackCondition: PokemonAttackCondition;
/** The default attackCondition requires that the selected move is a damaging move */
constructor(attackCondition: PokemonAttackCondition = (user, target, move) => (move.category !== MoveCategory.STATUS), showAbility: boolean = true) {
super(showAbility);
constructor(attackCondition: PokemonAttackCondition = (user, target, move) => (move.category !== MoveCategory.STATUS)) {
super();
this.attackCondition = attackCondition;
}
@ -1624,40 +1624,6 @@ export class PostAttackAbAttr extends AbAttr {
}
}
/**
* Ability attribute for Gorilla Tactics
* @extends PostAttackAbAttr
*/
export class GorillaTacticsAbAttr extends PostAttackAbAttr {
constructor() {
super((user, target, move) => true, false);
}
/**
*
* @param {Pokemon} pokemon the {@linkcode Pokemon} with this ability
* @param passive n/a
* @param simulated whether the ability is being simulated
* @param defender n/a
* @param move n/a
* @param hitResult n/a
* @param args n/a
* @returns `true` if the ability is applied
*/
applyPostAttackAfterMoveTypeCheck(pokemon: Pokemon, passive: boolean, simulated: boolean, defender: Pokemon, move: Move, hitResult: HitResult | null, args: any[]): boolean | Promise<boolean> {
if (simulated) {
return simulated;
}
if (pokemon.getTag(BattlerTagType.GORILLA_TACTICS)) {
return false;
}
pokemon.addTag(BattlerTagType.GORILLA_TACTICS);
return true;
}
}
export class PostAttackStealHeldItemAbAttr extends PostAttackAbAttr {
private stealCondition: PokemonAttackCondition | null;
@ -3957,7 +3923,7 @@ export class PostBattleLootAbAttr extends PostBattleAbAttr {
}
export class PostFaintAbAttr extends AbAttr {
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
return false;
}
}
@ -4008,7 +3974,7 @@ export class PostFaintClearWeatherAbAttr extends PostFaintAbAttr {
* @param args N/A
* @returns {boolean} Returns true if the weather clears, otherwise false.
*/
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
const weatherType = pokemon.scene.arena.weather?.weatherType;
let turnOffWeather = false;
@ -4056,8 +4022,8 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
this.damageRatio = damageRatio;
}
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
if (move !== undefined && attacker !== undefined && move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { //If the mon didn't die to indirect damage
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) {
const cancelled = new Utils.BooleanHolder(false);
pokemon.scene.getField(true).map(p => applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled, simulated));
if (cancelled.value || attacker.hasAbilityWithAttr(BlockNonDirectDamageAbAttr)) {
@ -4086,8 +4052,8 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
super ();
}
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
if (move !== undefined && attacker !== undefined && !simulated) { //If the mon didn't die to indirect damage
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
if (!simulated) {
const damage = pokemon.turnData.attacksReceived[0].damage;
attacker.damageAndUpdate((damage), HitResult.OTHER);
attacker.turnData.damageTaken += damage;
@ -4745,7 +4711,7 @@ export function applyPostBattleAbAttrs(attrType: Constructor<PostBattleAbAttr>,
}
export function applyPostFaintAbAttrs(attrType: Constructor<PostFaintAbAttr>,
pokemon: Pokemon, attacker?: Pokemon, move?: Move, hitResult?: HitResult, simulated: boolean = false, ...args: any[]): Promise<void> {
pokemon: Pokemon, attacker: Pokemon, move: Move, hitResult: HitResult, simulated: boolean = false, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<PostFaintAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostFaint(pokemon, passive, simulated, attacker, move, hitResult, args), args, false, simulated);
}
@ -5631,7 +5597,7 @@ export function initAbilities() {
.bypassFaint()
.partial(),
new Ability(Abilities.GORILLA_TACTICS, 8)
.attr(GorillaTacticsAbAttr),
.unimplemented(),
new Ability(Abilities.NEUTRALIZING_GAS, 8)
.attr(SuppressFieldAbilitiesAbAttr)
.attr(UncopiableAbilityAbAttr)

View File

@ -107,8 +107,8 @@ export interface TerrainBattlerTag {
* to select restricted moves.
*/
export abstract class MoveRestrictionBattlerTag extends BattlerTag {
constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType | BattlerTagLapseType[], turnCount: integer, sourceMove?: Moves, sourceId?: integer) {
super(tagType, lapseType, turnCount, sourceMove, sourceId);
constructor(tagType: BattlerTagType, turnCount: integer, sourceMove?: Moves, sourceId?: integer) {
super(tagType, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], turnCount, sourceMove, sourceId);
}
/** @override */
@ -119,9 +119,7 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
const move = phase.move;
if (this.isMoveRestricted(move.moveId)) {
if (this.interruptedText(pokemon, move.moveId)) {
pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId));
}
pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId));
phase.cancel();
}
@ -157,52 +155,7 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
* @param {Moves} move {@linkcode Moves} ID of the move being interrupted
* @returns {string} text to display when the move is interrupted
*/
interruptedText(pokemon: Pokemon, move: Moves): string {
return "";
}
}
/**
* Tag representing the "Throat Chop" effect. Pokemon with this tag cannot use sound-based moves.
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Throat_Chop_(move) | Throat Chop}
* @extends MoveRestrictionBattlerTag
*/
export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
constructor() {
super(BattlerTagType.THROAT_CHOPPED, [ BattlerTagLapseType.TURN_END, BattlerTagLapseType.PRE_MOVE ], 2, Moves.THROAT_CHOP);
}
/**
* Checks if a {@linkcode Moves | move} is restricted by Throat Chop.
* @override
* @param {Moves} move the {@linkcode Moves | move} to check for sound-based restriction
* @returns true if the move is sound-based
*/
override isMoveRestricted(move: Moves): boolean {
return allMoves[move].hasFlag(MoveFlags.SOUND_BASED);
}
/**
* Shows a message when the player attempts to select a move that is restricted by Throat Chop.
* @override
* @param {Pokemon} pokemon the {@linkcode Pokemon} that is attempting to select the restricted move
* @param {Moves} move the {@linkcode Moves | move} that is being restricted
* @returns the message to display when the player attempts to select the restricted move
*/
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:moveCannotBeSelected", { moveName: allMoves[move].name });
}
/**
* Shows a message when a move is interrupted by Throat Chop.
* @override
* @param {Pokemon} pokemon the interrupted {@linkcode Pokemon}
* @param {Moves} move the {@linkcode Moves | move} that was interrupted
* @returns the message to display when the move is interrupted
*/
override interruptedText(pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:throatChopInterruptedMove", { pokemonName: getPokemonNameWithAffix(pokemon) });
}
abstract interruptedText(pokemon: Pokemon, move: Moves): string;
}
/**
@ -214,7 +167,7 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
private moveId: Moves = Moves.NONE;
constructor(sourceId: number) {
super(BattlerTagType.DISABLED, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], 4, Moves.DISABLE, sourceId);
super(BattlerTagType.DISABLED, 4, Moves.DISABLE, sourceId);
}
/** @override */
@ -225,7 +178,7 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
/**
* @override
*
* Ensures that move history exists on `pokemon` and has a valid move. If so, sets the {@linkcode moveId} and shows a message.
* 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 {
@ -254,12 +207,7 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
return i18next.t("battle:moveDisabled", { moveName: allMoves[move].name });
}
/**
* @override
* @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
*/
/** @override */
override interruptedText(pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:disableInterruptedMove", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[move].name });
}
@ -271,72 +219,6 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
}
}
/**
* Tag used by Gorilla Tactics to restrict the user to using only one move.
* @extends MoveRestrictionBattlerTag
*/
export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
private moveId = Moves.NONE;
constructor() {
super(BattlerTagType.GORILLA_TACTICS, BattlerTagLapseType.CUSTOM, 0);
}
/** @override */
override isMoveRestricted(move: Moves): boolean {
return move !== this.moveId;
}
/**
* @override
* @param {Pokemon} pokemon the {@linkcode Pokemon} to check if the tag can be added
* @returns `true` if the pokemon has a valid move and no existing {@linkcode GorillaTacticsTag}; `false` otherwise
*/
override canAdd(pokemon: Pokemon): boolean {
return (this.getLastValidMove(pokemon) !== undefined) && !pokemon.getTag(GorillaTacticsTag);
}
/**
* Ensures that move history exists on {@linkcode Pokemon} and has a valid move.
* If so, sets the {@linkcode moveId} and increases the user's Attack by 50%.
* @override
* @param {Pokemon} pokemon the {@linkcode Pokemon} to add the tag to
*/
override onAdd(pokemon: Pokemon): void {
const lastValidMove = this.getLastValidMove(pokemon);
if (!lastValidMove) {
return;
}
this.moveId = lastValidMove;
pokemon.setStat(Stat.ATK, pokemon.getStat(Stat.ATK, false) * 1.5, false);
}
/**
*
* @override
* @param {Pokemon} pokemon n/a
* @param {Moves} move {@linkcode Moves} ID of the move being denied
* @returns {string} text to display when the move is denied
*/
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:canOnlyUseMove", { moveName: allMoves[this.moveId].name, pokemonName: getPokemonNameWithAffix(pokemon) });
}
/**
* Gets the last valid move from the pokemon's move history.
* @param {Pokemon} pokemon {@linkcode Pokemon} to get the last valid move from
* @returns {Moves | undefined} the last valid move from the pokemon's move history
*/
getLastValidMove(pokemon: Pokemon): Moves | undefined {
const move = pokemon.getLastXMoves()
.find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual);
return move?.move;
}
}
/**
* BattlerTag that represents the "recharge" effects of moves like Hyper Beam.
*/
@ -2102,75 +1984,7 @@ export class ExposedTag extends BattlerTag {
}
}
/**
* Tag that doubles the type effectiveness of Fire-type moves.
* @extends BattlerTag
*/
export class TarShotTag extends BattlerTag {
constructor() {
super(BattlerTagType.TAR_SHOT, BattlerTagLapseType.CUSTOM, 0);
}
/**
* If the Pokemon is terastallized, the tag cannot be added.
* @param {Pokemon} pokemon the {@linkcode Pokemon} to which the tag is added
* @returns whether the tag is applied
*/
override canAdd(pokemon: Pokemon): boolean {
return !pokemon.isTerastallized();
}
override onAdd(pokemon: Pokemon): void {
pokemon.scene.queueMessage(i18next.t("battlerTags:tarShotOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
}
}
/**
* Tag that swaps the user's base ATK stat with its base DEF stat.
* @extends BattlerTag
*/
export class PowerTrickTag extends BattlerTag {
constructor(sourceMove: Moves, sourceId: number) {
super(BattlerTagType.POWER_TRICK, BattlerTagLapseType.CUSTOM, 0, sourceMove, sourceId, true);
}
onAdd(pokemon: Pokemon): void {
this.swapStat(pokemon);
pokemon.scene.queueMessage(i18next.t("battlerTags:powerTrickActive", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
}
onRemove(pokemon: Pokemon): void {
this.swapStat(pokemon);
pokemon.scene.queueMessage(i18next.t("battlerTags:powerTrickActive", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
}
/**
* Removes the Power Trick tag and reverts any stat changes if the tag is already applied.
* @param {Pokemon} pokemon The {@linkcode Pokemon} that already has the Power Trick tag.
*/
onOverlap(pokemon: Pokemon): void {
pokemon.removeTag(this.tagType);
}
/**
* Swaps the user's base ATK stat with its base DEF stat.
* @param {Pokemon} pokemon The {@linkcode Pokemon} whose stats will be swapped.
*/
swapStat(pokemon: Pokemon): void {
const temp = pokemon.getStat(Stat.ATK, false);
pokemon.setStat(Stat.ATK, pokemon.getStat(Stat.DEF, false), false);
pokemon.setStat(Stat.DEF, temp, false);
}
}
/**
* Retrieves a {@linkcode BattlerTag} based on the provided tag type, turn count, source move, and source ID.
*
* @param {BattlerTagType} tagType the type of the {@linkcode BattlerTagType}.
* @param turnCount the turn count.
* @param {Moves} sourceMove the source {@linkcode Moves}.
* @param sourceId the source ID.
* @returns {BattlerTag} the corresponding {@linkcode BattlerTag} object.
*/
export function getBattlerTag(tagType: BattlerTagType, turnCount: number, sourceMove: Moves, sourceId: number): BattlerTag {
switch (tagType) {
case BattlerTagType.RECHARGING:
@ -2311,14 +2125,6 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
case BattlerTagType.GULP_MISSILE_ARROKUDA:
case BattlerTagType.GULP_MISSILE_PIKACHU:
return new GulpMissileTag(tagType, sourceMove);
case BattlerTagType.TAR_SHOT:
return new TarShotTag();
case BattlerTagType.THROAT_CHOPPED:
return new ThroatChoppedTag();
case BattlerTagType.GORILLA_TACTICS:
return new GorillaTacticsTag();
case BattlerTagType.POWER_TRICK:
return new PowerTrickTag(sourceMove, sourceId);
case BattlerTagType.NONE:
default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -1569,7 +1569,8 @@ export const trainerTypeDialogue: TrainerTypeDialogue = {
"dialogue:roark.victory.1",
"dialogue:roark.victory.2",
"dialogue:roark.victory.3",
"dialogue:roark.victory.4"
"dialogue:roark.victory.4",
"dialogue:roark.victory.5"
],
defeat: [
"dialogue:roark.defeat.1",

View File

@ -222,7 +222,7 @@ export class Egg {
let pokemonSpecies = getPokemonSpecies(this._species);
// Special condition to have Phione eggs also have a chance of generating Manaphy
if (this._species === Species.PHIONE && this._sourceType === EggSourceType.SAME_SPECIES_EGG) {
if (this._species === Species.PHIONE) {
pokemonSpecies = getPokemonSpecies(Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE) ? Species.PHIONE : Species.MANAPHY);
}
@ -326,8 +326,7 @@ export class Egg {
break;
}
const tierMultiplier = this.isManaphyEgg() ? 2 : Math.pow(2, 3 - this.tier);
return Utils.randSeedInt(baseChance * tierMultiplier) ? Utils.randSeedInt(3) : 3;
return Utils.randSeedInt(baseChance * Math.pow(2, 3 - this.tier)) ? Utils.randSeedInt(3) : 3;
}
private getEggTierDefaultHatchWaves(eggTier?: EggTier): number {
@ -362,12 +361,7 @@ export class Egg {
* the species that was the legendary focus at the time
*/
if (this.isManaphyEgg()) {
/**
* Adding a technicality to make unit tests easier: By making this check pass
* when Utils.randSeedInt(8) = 1, and by making the generatePlayerPokemon() species
* check pass when Utils.randSeedInt(8) = 0, we can tell them apart during tests.
*/
const rand = (Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE) !== 1);
const rand = Utils.randSeedInt(MANAPHY_EGG_MANAPHY_RATE);
return rand ? Species.PHIONE : Species.MANAPHY;
} else if (this.tier === EggTier.MASTER
&& this._sourceType === EggSourceType.GACHA_LEGENDARY) {

View File

@ -3472,7 +3472,7 @@ export class SpitUpPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const stockpilingTag = user.getTag(StockpilingTag);
if (stockpilingTag && stockpilingTag.stockpiledCount > 0) {
if (stockpilingTag !== null && stockpilingTag.stockpiledCount > 0) {
const power = args[0] as Utils.IntegerHolder;
power.value = this.multiplier * stockpilingTag.stockpiledCount;
return true;
@ -3490,7 +3490,7 @@ export class SwallowHealAttr extends HealAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const stockpilingTag = user.getTag(StockpilingTag);
if (stockpilingTag && stockpilingTag.stockpiledCount > 0) {
if (stockpilingTag !== null && stockpilingTag?.stockpiledCount > 0) {
const stockpiled = stockpilingTag.stockpiledCount;
let healRatio: number;
@ -5987,8 +5987,9 @@ export class SwapStatAttr extends MoveEffectAttr {
}
/**
* Swaps the user's and target's corresponding current
* {@linkcode EffectiveStat | stat} values
* 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
@ -6012,59 +6013,48 @@ export class SwapStatAttr extends MoveEffectAttr {
}
}
/**
* Attribute used to switch the user's own stats.
* Used by Power Shift.
* @extends MoveEffectAttr
*/
export class ShiftStatAttr extends MoveEffectAttr {
private statToSwitch: EffectiveStat;
private statToSwitchWith: EffectiveStat;
constructor(statToSwitch: EffectiveStat, statToSwitchWith: EffectiveStat) {
/**
* Attribute used for status moves, namely Power Trick,
* that swaps user's own stat.
* @extends MoveEffectAttr
* @see {@linkcode apply}
*/
export class SelfSwapStatAttr extends MoveEffectAttr {
/** Swaps the values of two specified stats */
private firstStat: EffectiveStat;
private secondStat: EffectiveStat;
constructor(firstStat: EffectiveStat, secondStat: EffectiveStat) {
super();
this.statToSwitch = statToSwitch;
this.statToSwitchWith = statToSwitchWith;
this.firstStat = firstStat;
this.secondStat = secondStat;
}
/**
* Switches the user's stats based on the {@linkcode statToSwitch} and {@linkcode statToSwitchWith} attributes.
* @param {Pokemon} user the {@linkcode Pokemon} that used the move
* @param target n/a
* @param move n/a
* @param args n/a
* @returns whether the effect was applied
* Swap user's {@linkcode firstStat} value with {@linkcode secondStat} value.
* @param user the {@linkcode Pokemon} that used the move
* @param target N/A
* @param move N/A
* @param args N/A
* @returns true if attribute application succeeds
*/
override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.apply(user, target, move, args)) {
return false;
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (super.apply(user, target, move, args)) {
const temp = user.getStat(this.firstStat, false);
user.setStat(this.firstStat, target.getStat(this.secondStat, false), false);
user.setStat(this.secondStat, temp, false);
user.scene.queueMessage(i18next.t("moveTriggers:selfSwitchedStat", {
pokemonName: getPokemonNameWithAffix(user),
firstStat:i18next.t(getStatKey(this.firstStat)),
secondStat:i18next.t(getStatKey(this.secondStat)),
}));
return true;
}
const firstStat = user.getStat(this.statToSwitch, false);
const secondStat = user.getStat(this.statToSwitchWith, false);
user.setStat(this.statToSwitch, secondStat, false);
user.setStat(this.statToSwitchWith, firstStat, false);
user.scene.queueMessage(i18next.t("moveTriggers:shiftedStats", {
pokemonName: getPokemonNameWithAffix(user),
statToSwitch: i18next.t(getStatKey(this.statToSwitch)),
statToSwitchWith: i18next.t(getStatKey(this.statToSwitchWith))
}));
return true;
}
/**
* Encourages the user to use the move if the stat to switch with is greater than the stat to switch.
* @param {Pokemon} user the {@linkcode Pokemon} that used the move
* @param target n/a
* @param move n/a
* @returns number of points to add to the user's benefit score
*/
override getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
return user.getStat(this.statToSwitchWith, false) > user.getStat(this.statToSwitch, false) ? 10 : 0;
return false;
}
}
@ -6272,42 +6262,12 @@ export class VariableTargetAttr extends MoveAttr {
}
}
/**
* Attribute for {@linkcode Moves.AFTER_YOU}
*
* [After You - Move | Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/After_You_(move))
*/
export class AfterYouAttr extends MoveEffectAttr {
/**
* Allows the target of this move to act right after the user.
*
* @param user {@linkcode Pokemon} that is using the move.
* @param target {@linkcode Pokemon} that will move right after this move is used.
* @param move {@linkcode Move} {@linkcode Moves.AFTER_YOU}
* @param _args N/A
* @returns true
*/
override apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean {
user.scene.queueMessage(i18next.t("moveTriggers:afterYou", {targetName: getPokemonNameWithAffix(target)}));
//Will find next acting phase of the targeted pokémon, delete it and queue it next on successful delete.
const nextAttackPhase = target.scene.findPhase<MovePhase>((phase) => phase.pokemon === target);
if (nextAttackPhase && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) {
target.scene.prependToPhase(new MovePhase(target.scene, target, [...nextAttackPhase.targets], nextAttackPhase.move), MovePhase);
}
return true;
}
}
const failOnGravityCondition: MoveConditionFunc = (user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY);
const failOnBossCondition: MoveConditionFunc = (user, target, move) => !target.isBossImmune();
const failOnMaxCondition: MoveConditionFunc = (user, target, move) => !target.isMax();
const failIfSingleBattle: MoveConditionFunc = (user, target, move) => user.scene.currentBattle.double;
const failIfDampCondition: MoveConditionFunc = (user, target, move) => {
const cancelled = new Utils.BooleanHolder(false);
user.scene.getField(true).map(p=>applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled));
@ -7642,7 +7602,7 @@ export function initMoves() {
.attr(OpponentHighHpPowerAttr, 120)
.makesContact(),
new SelfStatusMove(Moves.POWER_TRICK, Type.PSYCHIC, -1, 10, -1, 0, 4)
.attr(AddBattlerTagAttr, BattlerTagType.POWER_TRICK, true),
.attr(SelfSwapStatAttr, Stat.ATK, Stat.DEF),
new StatusMove(Moves.GASTRO_ACID, Type.POISON, 100, 10, -1, 0, 4)
.attr(SuppressAbilitiesAttr),
new StatusMove(Moves.LUCKY_CHANT, Type.NORMAL, -1, 30, -1, 0, 4)
@ -7955,10 +7915,7 @@ export function initMoves() {
.attr(AbilityGiveAttr),
new StatusMove(Moves.AFTER_YOU, Type.NORMAL, -1, 15, -1, 0, 5)
.ignoresProtect()
.target(MoveTarget.NEAR_OTHER)
.condition(failIfSingleBattle)
.condition((user, target, move) => !target.turnData.acted)
.attr(AfterYouAttr),
.unimplemented(),
new AttackMove(Moves.ROUND, Type.NORMAL, MoveCategory.SPECIAL, 60, 100, 15, -1, 0, 5)
.soundBased()
.partial(),
@ -8492,7 +8449,7 @@ export function initMoves() {
.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)
.attr(AddBattlerTagAttr, BattlerTagType.THROAT_CHOPPED),
.partial(),
new AttackMove(Moves.POLLEN_PUFF, Type.BUG, MoveCategory.SPECIAL, 90, 100, 15, -1, 0, 7)
.attr(StatusCategoryOnAllyAttr)
.attr(HealOnAllyAttr, 0.5, true, false)
@ -8732,7 +8689,7 @@ export function initMoves() {
.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(StatStageChangeAttr, [ Stat.SPD ], -1)
.attr(AddBattlerTagAttr, BattlerTagType.TAR_SHOT, false),
.partial(),
new StatusMove(Moves.MAGIC_POWDER, Type.PSYCHIC, 100, 20, -1, 0, 8)
.attr(ChangeTypeAttr, Type.PSYCHIC)
.powderMove(),
@ -8982,8 +8939,7 @@ export function initMoves() {
new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8)
.attr(StatStageChangeAttr, [ Stat.DEF ], 1, true),
new SelfStatusMove(Moves.POWER_SHIFT, Type.NORMAL, -1, 10, -1, 0, 8)
.target(MoveTarget.USER)
.attr(ShiftStatAttr, Stat.ATK, Stat.DEF),
.unimplemented(),
new AttackMove(Moves.STONE_AXE, Type.ROCK, MoveCategory.PHYSICAL, 65, 90, 15, 100, 0, 8)
.attr(AddArenaTrapTagHitAttr, ArenaTagType.STEALTH_ROCK)
.slicingMove(),

View File

@ -88,14 +88,12 @@ export class Weather {
return 1;
}
isMoveWeatherCancelled(user: Pokemon, move: Move): boolean {
const moveType = user.getMoveType(move);
isMoveWeatherCancelled(move: Move): boolean {
switch (this.weatherType) {
case WeatherType.HARSH_SUN:
return move instanceof AttackMove && moveType === Type.WATER;
return move instanceof AttackMove && move.type === Type.WATER;
case WeatherType.HEAVY_RAIN:
return move instanceof AttackMove && moveType === Type.FIRE;
return move instanceof AttackMove && move.type === Type.FIRE;
}
return false;

View File

@ -73,8 +73,4 @@ export enum BattlerTagType {
SHELL_TRAP = "SHELL_TRAP",
DRAGON_CHEER = "DRAGON_CHEER",
NO_RETREAT = "NO_RETREAT",
GORILLA_TACTICS = "GORILLA_TACTICS",
THROAT_CHOPPED = "THROAT_CHOPPED",
TAR_SHOT = "TAR_SHOT",
POWER_TRICK = "POWER_TRICK",
}

View File

@ -391,8 +391,8 @@ export class Arena {
return true;
}
isMoveWeatherCancelled(user: Pokemon, move: Move) {
return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(user, move);
isMoveWeatherCancelled(move: Move) {
return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(move);
}
isMoveTerrainCancelled(user: Pokemon, targets: BattlerIndex[], move: Move) {

View File

@ -17,7 +17,7 @@ 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 { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag, TarShotTag, PowerTrickTag } 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 { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag";
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";
@ -58,7 +58,6 @@ 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 { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
export enum FieldPosition {
CENTER,
@ -984,16 +983,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
: this.moveset;
// Overrides moveset based on arrays specified in overrides.ts
let overrideArray: Moves | Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
if (!Array.isArray(overrideArray)) {
overrideArray = [overrideArray];
}
const overrideArray: Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
if (overrideArray.length > 0) {
if (!this.isPlayer()) {
this.moveset = [];
}
overrideArray.forEach((move: Moves, index: number) => {
const ppUsed = this.moveset[index]?.ppUsed ?? 0;
const ppUsed = this.moveset[index]?.ppUsed || 0;
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp));
});
}
@ -1056,9 +1049,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const teraType = this.getTeraType();
if (teraType !== Type.UNKNOWN) {
types.push(teraType);
if (forDefend) {
return types;
}
}
}
@ -1330,10 +1320,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
const trappedByAbility = new Utils.BooleanHolder(false);
const opposingField = this.isPlayer() ? this.scene.getEnemyField() : this.scene.getPlayerField();
opposingField.forEach(opponent =>
applyCheckTrappedAbAttrs(CheckTrappedAbAttr, opponent, trappedByAbility, this, trappedAbMessages, simulated)
this.scene.getEnemyField()!.forEach(enemyPokemon =>
applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trappedByAbility, this, trappedAbMessages, simulated)
);
return (trappedByAbility.value || !!this.getTag(TrappedTag));
@ -1359,7 +1348,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
/**
* Calculates the effectiveness of a move against the Pokémon.
* This includes modifiers from move and ability attributes.
*
* @param source {@linkcode Pokemon} The attacking Pokémon.
* @param move {@linkcode Move} The move being used by the attacking Pokémon.
* @param ignoreAbility Whether to ignore abilities that might affect type effectiveness or immunity (defaults to `false`).
@ -1379,14 +1368,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
: 1);
applyMoveAttrs(VariableMoveTypeMultiplierAttr, source, this, move, typeMultiplier);
if (this.getTypes(true, true).find(t => move.isTypeImmune(source, this, t))) {
if (this.getTypes().find(t => move.isTypeImmune(source, this, t))) {
typeMultiplier.value = 0;
}
if (this.getTag(TarShotTag) && (this.getMoveType(move) === Type.FIRE)) {
typeMultiplier.value *= 2;
}
const cancelledHolder = cancelled ?? new Utils.BooleanHolder(false);
if (!ignoreAbility) {
applyPreDefendAbAttrs(TypeImmunityAbAttr, this, source, move, cancelledHolder, simulated, typeMultiplier);
@ -1418,7 +1403,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
/**
* Calculates the move's type effectiveness multiplier based on the target's type/s.
* Calculates the type effectiveness multiplier for an attack type
* @param moveType {@linkcode Type} the type of the move being used
* @param source {@linkcode Pokemon} the Pokemon using the move
* @param ignoreStrongWinds whether or not this ignores strong winds (anticipation, forewarn, stealth rocks)
@ -2683,10 +2668,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
continue;
}
if (tag instanceof PowerTrickTag) {
tag.swapStat(this);
}
this.summonData.tags.push(tag);
}
@ -2794,7 +2775,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this.fusionFaintCry(callback);
}
const key = `cry/${this.species.getCryKey(this.formIndex)}`;
const key = `cry/${this.getSpeciesForm().getCryKey(this.formIndex)}`;
//eslint-disable-next-line @typescript-eslint/no-unused-vars
let i = 0;
let rate = 0.85;
@ -2852,7 +2833,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
private fusionFaintCry(callback: Function): void {
const key = `cry/${this.species.getCryKey(this.formIndex)}`;
const key = `cry/${this.getSpeciesForm().getCryKey(this.formIndex)}`;
let i = 0;
let rate = 0.85;
const cry = this.scene.playSound(key, { rate: rate }) as AnySound;
@ -2860,7 +2841,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const tintSprite = this.getTintSprite();
let duration = cry.totalDuration * 1000;
const fusionCryKey = `cry/${this.fusionSpecies?.getCryKey(this.fusionFormIndex)}`;
const fusionCryKey = `cry/${this.getFusionSpeciesForm().getCryKey(this.fusionFormIndex)}`;
let fusionCry = this.scene.playSound(fusionCryKey, { rate: rate }) as AnySound;
fusionCry.stop();
duration = Math.min(duration, fusionCry.totalDuration * 1000);
@ -3547,6 +3528,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);
@ -3570,6 +3552,7 @@ export class PlayerPokemon extends Pokemon {
}
}
this.generateCompatibleTms();
this.usedTms = [];
}
initBattleInfo(): void {
@ -4479,29 +4462,17 @@ export class EnemyPokemon extends Pokemon {
return BattlerIndex.ENEMY + this.getFieldIndex();
}
/**
* Add a new pokemon to the player's party (at `slotIndex` if set).
* @param pokeballType the type of pokeball the pokemon was caught with
* @param slotIndex an optional index to place the pokemon in the party
* @returns the pokemon that was added or null if the pokemon could not be added
*/
addToParty(pokeballType: PokeballType, slotIndex: number = -1) {
addToParty(pokeballType: PokeballType) {
const party = this.scene.getParty();
let ret: PlayerPokemon | null = null;
if (party.length < PLAYER_PARTY_MAX_SIZE) {
if (party.length < 6) {
this.pokeball = pokeballType;
this.metLevel = this.level;
this.metBiome = this.scene.arena.biomeType;
this.metSpecies = this.species.speciesId;
const newPokemon = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, this.formIndex, this.gender, this.shiny, this.variant, this.ivs, this.nature, this);
if (Utils.isBetween(slotIndex, 0, PLAYER_PARTY_MAX_SIZE - 1)) {
party.splice(slotIndex, 0, newPokemon);
} else {
party.push(newPokemon);
}
party.push(newPokemon);
ret = newPokemon;
this.scene.triggerPokemonFormChange(newPokemon, SpeciesFormChangeActiveTrigger, true);
}

View File

@ -7,15 +7,15 @@ import { WindowVariant, getWindowVariantSuffix } from "./ui/ui-theme";
import { isMobile } from "./touch-controls";
import * as Utils from "./utils";
import { initI18n } from "./plugins/i18n";
import { initPokemonPrevolutions } from "#app/data/pokemon-evolutions";
import { initBiomes } from "#app/data/biomes";
import { initEggMoves } from "#app/data/egg-moves";
import { initPokemonForms } from "#app/data/pokemon-forms";
import { initSpecies } from "#app/data/pokemon-species";
import { initMoves } from "#app/data/move";
import { initAbilities } from "#app/data/ability";
import { initAchievements } from "#app/system/achv";
import { initTrainerTypeDialogue } from "#app/data/dialogue";
import {initPokemonPrevolutions} from "#app/data/pokemon-evolutions";
import {initBiomes} from "#app/data/biomes";
import {initEggMoves} from "#app/data/egg-moves";
import {initPokemonForms} from "#app/data/pokemon-forms";
import {initSpecies} from "#app/data/pokemon-species";
import {initMoves} from "#app/data/move";
import {initAbilities} from "#app/data/ability";
import {initAchievements} from "#app/system/achv";
import {initTrainerTypeDialogue} from "#app/data/dialogue";
import { initChallenges } from "./data/challenge";
import i18next from "i18next";
import { initStatsKeys } from "./ui/game-stats-ui-handler";
@ -250,9 +250,9 @@ export class LoadingScene extends SceneBase {
}
const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"];
if (lang && availableLangs.includes(lang)) {
this.loadImage("egg-update_"+lang, "events");
this.loadImage("september-update-"+lang, "events");
} else {
this.loadImage("egg-update_en", "events");
this.loadImage("september-update-en", "events");
}
this.loadAtlas("statuses", "");

View File

@ -69,6 +69,5 @@
"cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!",
"disabledOnAdd": " {{moveName}} von {{pokemonNameWithAffix}} wurde blockiert!",
"disabledLapse": "{{moveName}} von {{pokemonNameWithAffix}} ist nicht länger blockiert!",
"powerTrickActive": "{{pokemonNameWithAffix}} tauscht den Wert seines Angriffs mit dem seiner Verteidigung!"
"disabledLapse": "{{moveName}} von {{pokemonNameWithAffix}} ist nicht länger blockiert!"
}

View File

@ -3,6 +3,5 @@
"power": "Stärke",
"accuracy": "Genauigkeit",
"abilityFlyInText": "{{passive}}{{abilityName}} von {{pokemonName}} wirkt!",
"passive": "Passive Fähigkeit ",
"teraHover": "Tera-Typ {{type}}"
"passive": "Passive Fähigkeit "
}

View File

@ -5,6 +5,7 @@
"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!",
"selfSwitchedStat": "{{pokemonName}} tauscht den Wert seines {{firstStat}} mit dem seiner {{secondStat}}!",
"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!",
@ -66,6 +67,5 @@
"revivalBlessing": "{{pokemonName}} ist wieder fit und kampfbereit!",
"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!",
"afterYou": "{{targetName}} lässt sich auf Galanterie ein!"
"safeguard": "{{targetName}} wird durch Bodyguard geschützt!"
}

View File

@ -53,6 +53,5 @@
"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!",
"powerTrickActive": "{{pokemonNameWithAffix}} switched its Attack and Defense!"
"safeguardOnRemoveEnemy": "The opposing team is no longer protected by Safeguard!"
}

View File

@ -44,10 +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!",
"canOnlyUseMove": "{{pokemonName}} can only use {{moveName}}!",
"moveCannotBeSelected": "{{moveName}} cannot be selected!",
"disableInterruptedMove": "{{pokemonNameWithAffix}}'s {{moveName}}\nis disabled!",
"throatChopInterruptedMove": "The effects of Throat Chop prevent\n{{pokemonName}} from using certain moves!",
"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!",

View File

@ -69,6 +69,5 @@
"cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!",
"disabledOnAdd": "{{pokemonNameWithAffix}}'s {{moveName}}\nwas disabled!",
"disabledLapse": "{{pokemonNameWithAffix}}'s {{moveName}}\nis no longer disabled.",
"tarShotOnAdd": "{{pokemonNameWithAffix}} became weaker to fire!"
"disabledLapse": "{{pokemonNameWithAffix}}'s {{moveName}}\nis no longer disabled."
}

View File

@ -3,6 +3,5 @@
"power": "Power",
"accuracy": "Accuracy",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ",
"teraHover": "{{type}} Terastallized"
"passive": "Passive "
}

View File

@ -5,9 +5,9 @@
"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!",
"selfSwitchedStat": "{{pokemonName}} switched its {{firstStat}} and {{secondStat}}!",
"sharedGuard": "{{pokemonName}} shared its guard with the target!",
"sharedPower": "{{pokemonName}} shared its power with the target!",
"shiftedStats": "{{pokemonName}} switched its {{statToSwitch}} and {{statToSwitchWith}}!",
"goingAllOutForAttack": "{{pokemonName}} is going all out for this attack!",
"regainedHealth": "{{pokemonName}} regained\nhealth!",
"keptGoingAndCrashed": "{{pokemonName}} kept going\nand crashed!",
@ -67,6 +67,5 @@
"revivalBlessing": "{{pokemonName}} was revived!",
"swapArenaTags": "{{pokemonName}} swapped the battle effects affecting each side of the field!",
"exposedMove": "{{pokemonName}} identified\n{{targetPokemonName}}!",
"safeguard": "{{targetName}} is protected by Safeguard!",
"afterYou": "{{pokemonName}} took the kind offer!"
}
"safeguard": "{{targetName}} is protected by Safeguard!"
}

View File

@ -53,6 +53,5 @@
"safeguardOnAddEnemy": "¡El equipo enemigo se ha protegido con Velo Sagrado!",
"safeguardOnRemove": "¡Velo Sagrado dejó de hacer efecto!",
"safeguardOnRemovePlayer": "El efecto de Velo Sagrado en tu equipo se ha disipado.",
"safeguardOnRemoveEnemy": "El efecto de Velo Sagrado en el equipo enemigo se ha disipado.",
"powerTrickActive": "¡{{pokemonNameWithAffix}} cambió su Ataque y Defensa!"
"safeguardOnRemoveEnemy": "El efecto de Velo Sagrado en el equipo enemigo se ha disipado."
}

View File

@ -1,6 +1,7 @@
{
"switchedTwoStatChanges": "{{pokemonName}} ha intercambiado los cambios en {{firstStat}} y {{secondStat}} con los del objetivo!",
"switchedStat": "{{pokemonName}} cambia su {{stat}} por la de su objetivo!",
"selfSwitchedStat": "¡{{pokemonName}} cambió {{firstStat}} a {{secondStat}}!",
"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!",

View File

@ -69,6 +69,5 @@
"cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !",
"disabledOnAdd": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} est mise sous entrave !",
"disabledLapse": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} nest plus sous entrave !",
"powerTrickActive": "{{pokemonNameWithAffix}} échange\nson Attaque et sa Défense !"
"disabledLapse": "La capacité {{moveName}}\nde {{pokemonNameWithAffix}} nest plus sous entrave !"
}

View File

@ -5,6 +5,7 @@
"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}} !",
"selfSwitchedStat": "{{pokemonName}} échange\nson {{firstStat}} et sa {{secondStat}} !",
"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 !",

View File

@ -69,6 +69,5 @@
"cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!",
"disabledOnAdd": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} è stata bloccata!",
"disabledLapse": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} non è più bloccata!",
"powerTrickActive": "{{pokemonNameWithAffix}} switched its Attack and Defense!"
"disabledLapse": "La mossa {{moveName}} di\n{{pokemonNameWithAffix}} non è più bloccata!"
}

View File

@ -2,11 +2,11 @@
"blockRecoilDamage": "{{pokemonName}}は {{abilityName}}で 反動ダメージを 受けない!",
"badDreams": "{{pokemonName}}は ナイトメアに うなされている!",
"costar": "{{pokemonName}}は {{allyName}}の\n能力変化を コピーした",
"iceFaceAvoidedDamage": "{{pokemonNameWithAffix}}は\n{{abilityName}}で ダメージを 受けない!",
"iceFaceAvoidedDamage": "{{pokemonName}}は\n{{abilityName}}で ダメージを 受けない!",
"perishBody": "{{pokemonName}}の {{abilityName}}で\nおたがいは 3ターン後に ほろびいてしまう",
"poisonHeal": "{{pokemonName}}は {{abilityName}}で 回復した!",
"trace": "{{pokemonName}}は 相手の {{targetName}}の\n{{abilityName}}を トレースした!",
"windPowerCharged": "{{pokemonNameWithAffix}}は\n{{moveName}}を 受けて じゅうでんした!",
"windPowerCharged": "{{pokemonName}}は\n{{moveName}}を 受けて じゅうでんした!",
"quickDraw": "{{pokemonName}}は クイックドロウで\n行動が はやくなった",
"disguiseAvoidedDamage": "{{pokemonNameWithAffix}}の\nばけのかわが はがれた",
"blockItemTheft": "{{pokemonNameWithAffix}}の {{abilityName}}で\n道具を うばわれない",

File diff suppressed because it is too large Load Diff

View File

@ -39,6 +39,5 @@
"matBlock": "たたみがえし",
"craftyShield": "トリックガード",
"tailwind": "おいかぜ",
"happyHour": "ハッピータイム",
"safeguard": "しんぴなまもり"
"happyHour": "ハッピータイム"
}

View File

@ -47,11 +47,5 @@
"tailwindOnRemovePlayer": "味方の 追い風が 止んだ!",
"tailwindOnRemoveEnemy": "相手の 追い風が 止んだ!",
"happyHourOnAdd": "みんなが ハッピーな気分に\n包まれた",
"happyHourOnRemove": "みんなの 気分が 元に戻った",
"safeguardOnAdd": "場の全体は 神秘のベールに 包まれた!",
"safeguardOnAddPlayer": "味方は 神秘のベールに 包まれた!",
"safeguardOnAddEnemy": "相手は 神秘のベールに 包まれた!",
"safeguardOnRemove": "場の全体を 包んでいた\n神秘のベールが なくなった",
"safeguardOnRemovePlayer": "味方を 包んでいた\n神秘のベールが なくなった",
"safeguardOnRemoveEnemy": "相手を 包んでいた\n神秘のベールが なくなった"
}
"happyHourOnRemove": "みんなの 気分が 元に戻った"
}

View File

@ -4,7 +4,7 @@
"trainerAppearedDouble": "{{trainerName}}が\n勝負を しかけてきた!",
"trainerSendOut": "{{trainerName}}は\n{{pokemonName}}を 繰り出した!",
"singleWildAppeared": "あっ! 野生の {{pokemonName}}が 飛び出してきた!",
"multiWildAppeared": "あっ! 野生の {{pokemonName1}}と\n{{pokemonName2}}が 飛び出してきた!",
"multiWildAppeared": "あっ! 野生の {{pokemonName1}}と\n{{pokemonName2}}が 飛び出してきた!",
"playerComeBack": "{{pokemonName}}! 戻れ!",
"trainerComeBack": "{{trainerName}}は\n{{pokemonName}}を 引っ込めた!",
"playerGo": "ゆけっ! {{pokemonName}}",
@ -51,7 +51,7 @@
"noPokeballStrong": "相手の ポケモンが 強すぎて 捕まえられない!\nまずは 弱めよう",
"noEscapeForce": "見えない 力の せいで\n逃げることが できない!",
"noEscapeTrainer": "ダメだ! 勝負の最中に\n相手に 背中を 見せられない",
"noEscapePokemon": "{{pokemonName}}の {{moveName}}で\n{{escapeVerb}}!",
"noEscapePokemon": "{{pokemonName}}の {{moveName}}で {{escapeVerb}}!",
"runAwaySuccess": " うまく 逃げ切れた!",
"runAwayCannotEscape": "逃げることが できない!",
"escapeVerbSwitch": "入れ替えることが できない",
@ -62,7 +62,6 @@
"skipItemQuestion": "本当に アイテムを 取らずに 進みますか?",
"itemStackFull": "{{fullItemName}}の スタックが いっぱいです。\n代わりに {{itemName}}を 取得します。",
"eggHatching": "おや?",
"eggSkipPrompt": "タマゴは ふかします!\nタマゴまとめに 飛ばしますか",
"ivScannerUseQuestion": "{{pokemonName}}を\n個体値スキャナーで 操作しますか?",
"wildPokemonWithAffix": "野生の {{pokemonName}}",
"foePokemonWithAffix": "相手の {{pokemonName}}",

View File

@ -1,46 +1,46 @@
{
"SITRUS": {
"name": "オボンのみ",
"effect": "持たせると HPが 50%以下に なるとき HPを 25% 回復する"
"effect": "持たせると HPが 50以下になるとき HPを 25 回復する"
},
"LUM": {
"name": "ラムのみ",
"effect": "持たせると 状態異常や 混乱に なるとき 回復する"
"effect": "持たせると 状態異常や 混乱になるとき 回復する\n"
},
"ENIGMA": {
"name": "ナゾのみ",
"effect": "持たせると 効果バツグンの 技を 受けたとき HPを 25%回復する"
"effect": "持たせると 効果バツグンの 技を 受けたとき HPを 回復する"
},
"LIECHI": {
"name": "チイラのみ",
"effect": "持たせると HPが 25%以下に なるとき 攻撃が あがる"
"effect": "持たせると HPが 25%以下に なるとき 攻撃が あがる"
},
"GANLON": {
"name": "リュガのみ",
"effect": "持たせると HPが 25%以下に なるとき 防御が あがる"
"effect": "持たせると HPが 25%以下に なるとき 防御が あがる\n"
},
"PETAYA": {
"name": "ヤタピのみ",
"effect": "持たせると HPが 25%以下に なるとき 特攻が あがる"
"effect": "持たせると HPが 25%以下に なるとき 特攻が あがる\n"
},
"APICOT": {
"name": "ズアのみ",
"effect": "持たせると HPが 25%以下に なるとき 特防が あがる"
"effect": "持たせると HPが 25%以下に なるとき 特防が あがる\n"
},
"SALAC": {
"name": "カムラのみ",
"effect": "持たせると HPが 25%以下に なるとき 素早さが あがる"
"effect": "持たせると HPが 25%以下に なるとき 素早さが あがる"
},
"LANSAT": {
"name": "サンのみ",
"effect": "持たせると HPが 25%以下に なるとき 攻撃が 急所に 当たりやすくなる"
"effect": "持たせると HPが 25%以下に なるとき 攻撃が 急所に 当たりやすくなる"
},
"STARF": {
"name": "スターのみ",
"effect": "持たせると HPが 25%以下に なるとき どれか 1つの 能力が ぐーんと あがる"
"effect": "持たせると HPが 25%以下に なるとき どれか 1つの 能力が ぐーんと あがる"
},
"LEPPA": {
"name": "ヒメリのみ",
"effect": "持たせると PPが0になる 技の PPを 10回復する"
"effect": "持たせると PPが 0になる 技のPPを 10回復する"
}
}

View File

@ -2,6 +2,6 @@
"pp": "PP",
"power": "威力",
"accuracy": "命中",
"abilityFlyInText": " {{pokemonName}}の\n{{passive}} {{abilityName}}",
"abilityFlyInText": " {{pokemonName}}の\n{{passive}}{{abilityName}}",
"passive": "パッシブ "
}

View File

@ -22,7 +22,7 @@
"unmatchingPassword": "入力したパスワードが 一致しません",
"passwordNotMatchingConfirmPassword": "パスワードは パスワード確認と 一致する 必要があります",
"confirmPassword": "パスワード確認",
"registrationAgeWarning": "登録では 13歳以上 であることを 確認します。",
"registrationAgeWarning": "登録では 歳以上 であることを 確認します。",
"backToLogin": "ログインへ",
"failedToLoadSaveData": "セーブデータの 読み込みは 不可能でした。ページを 再読み込み してください。\n長い間に続く 場合は 管理者に 連絡してください。",
"sessionSuccess": "セッションが 正常に 読み込まれました。",
@ -46,10 +46,10 @@
"yes": "はい",
"no": "いいえ",
"disclaimer": "免責",
"disclaimerDescription": "このゲームは 未完成作品です。\nセーブデータの 損失を含める ゲーム性に関する 問題が 起きる可能性が あります。\nなお、ゲームは 予告なく変更される 可能性もあり、\nさらに更新され、完成されるとも 限りません。",
"disclaimerDescription": "このゲームは 未完成作品です。\nセーブデータの 損失を含める ゲーム性に関する 問題が 起きる可能性が あります。\nなお、ゲームは 予告なく変更される 可能性もあり、さらに更新され、完成されるとも 限りません。",
"choosePokemon": "ポケモンを選ぶ",
"renamePokemon": "ニックネームを変える",
"rename": "名前を変える",
"rename": "変える",
"nickname": "ニックネーム",
"errorServerDown": "おや!\nサーバーとの 接続中に 問題が 発生しました。\nゲームは 自動的に 再接続されます から\nウィンドウは 開いたままに しておいても よろしいです。",
"noSaves": "何の セーブファイルも ありません!",

File diff suppressed because it is too large Load Diff

View File

@ -4,44 +4,5 @@
"CANCEL": "やめる",
"RELEASE": "逃がす",
"APPLY": "使う",
"TEACH": "教える",
"SPLICE": "吸収合体",
"UNSPLICE": "合体を分離",
"ACTIVATE": "有効にする",
"DEACTIVATE": "無効にする",
"TRANSFER": "アイテムを移動",
"ALL": "全部",
"PASS_BATON": "バトンタッチ",
"UNPAUSE_EVOLUTION": "進化を有効にする",
"REVIVE": "復活する",
"RENAME": "名前を変える",
"choosePokemon": "ポケモンを 選んで ください。",
"doWhatWithThisPokemon": "このポケモンを どうする?",
"noEnergy": "{{pokemonName}}は 戦うための\n元気が 残っていません",
"hasEnergy": "{{pokemonName}}は まだまだ 元気だ!",
"cantBeUsed": "{{pokemonName}}は このチャレンジで\n使えられません",
"tooManyItems": "{{pokemonName}}は このアイテムが\nこれ以上 持ちきれない",
"anyEffect": "使っても 効果がないよ",
"unpausedEvolutions": "{{pokemonName}}は また 進化できる。",
"unspliceConfirmation": "本当に {{pokemonName}}を {{fusionName}}から\n分離しますか {{fusionName}}は なくなる。",
"wasReverted": "{{fusionName}}は {{pokemonName}}に 回帰した。",
"releaseConfirmation": "本当に {{pokemonName}}を 逃がしますか?",
"releaseInBattle": "戦闘中の ポケモンを\n逃がすことは できません",
"selectAMove": "技を 選んでください。",
"changeQuantity": "移動する アイテムを 選んでください。\n< と > で 数量が 変えられる。",
"selectAnotherPokemonToSplice": "もう一つの ポケモンを 選んで 合体する。",
"cancel": "キャンセル",
"able": "可能",
"notAble": "不可能",
"learned": "覚えている",
"goodbye": "グッバイ {{pokemonName}}!",
"byebye": "ばいばい {{pokemonName}}!",
"farewell": "さようなら {{pokemonName}}!",
"soLong": "じゃあね {{pokemonName}}!",
"thisIsWhereWePart": "これでお別れだね {{pokemonName}}!",
"illMissYou": "恋しく思うよ {{pokemonName}}!",
"illNeverForgetYou": "一生忘れない {{pokemonName}}!",
"untilWeMeetAgain": "また出会える日まで、{{pokemonName}}!",
"sayonara": "さらば {{pokemonName}}!",
"smellYaLater": "そんじゃ あばよ {{pokemonName}}!"
"TEACH": "教える"
}

View File

@ -20,7 +20,7 @@
"normal": "普通",
"fast": "早い",
"faster": "とても早い",
"skip": "飛ばす",
"skip": "スキップ",
"levelUpNotifications": "レベルアップ時のみ",
"on": "オン",
"off": "オフ",

View File

@ -23,7 +23,7 @@
"manageNature": "性格を変える",
"addToFavorites": "お気に入りにする",
"removeFromFavorites": "お気に入りから除く",
"useCandies": "アメを使う",
"useCandies": "を使う",
"selectNature": "性格を選んでください。",
"selectMoveSwapOut": "入れ替えたい技を選んでください。",
"selectMoveSwapWith": "他の技と交換してください。",

View File

@ -1,10 +1,10 @@
{
"intro": "PokéRogueへ ようこそ! グライク要素が\n加わった バトル中心の ポケモンファンゲームです。\n$このゲームは 収益を上げず、Pokémonおよび 使用される\n著作権資産に 対する所有権を 主張しません。\n$ゲームは まだ開発中ですが、完全に プレイすることが できます。\nバグ報告は ディスコードコミュニティを ご利用ください。\n$ゲームが 遅い場合は、ブラウザ設定で「ハードウェア\nアクセラレーション」が オンになっている ことを 確認してください",
"accessMenu": "メニューを開くには 入力待ちの間に MキーEscを 押してください。\nメニューには 設定や 様々な機能が 含まれています。",
"menu": "このメニューから 設定が 開けます。\n$設定では、ゲームの速さや ウィンドウタイプなどの オプションを 変更できます。\n$ここには 様々な機能が ありますので、\nぜひ 確認してみてください!",
"starterSelect": "この画面で Zキー空白キーを押して ポケモンが 選択できます。\n選んだポケモンは 最初の手持ちに なります。\n$各ポケモンは ポイントが ある。最大6つを 選べますが\nポケモンのポイントが 合計10を超えては いけません。\n$ポケモンを 捕まえたり タマゴからふかしたり することで\n選択できる 性別、特性、フォルムなどの 幅を広げられます。\n$個体値も 徐々に 累積して 高くなるので、\n同じポケモンを たくさん 捕まえて みてください!",
"pokerus": "毎日、無作為に スターターの\n3種類には 紫色の枠が 表示されます。\n$登録された スターターの 中に いれば、\n手持ちに加えて 強さを 確認してみましょう!",
"statChange": "ポケモンを 入れ替えない限り、\n次のバトルでも 能力変化は なくなりません。\n$その代わりに、トレーナーバトルや 新しいバイオームに\n入る直前に 自動的に 能力変化は 元に戻ります。\n$CキーShiftキーを 押し続けると、\n場にいるポケモンの 能力変化を 確認できます。\n$Vキーを押すと、\n相手が出した技も 確認できます。\n$ただし、現在のバトルでの 相手ポケモンが\nすでに使った 技のみが 表示されます。",
"selectItem": "バトルが 終わるたびには、「ショップ」という\n画面で 3つのご褒美から 1つが選べます。\n$種類は 消耗品、ポケモンの持ち物や道具、\n永続的な パッシブアイテムなど 様々です。\n$ほとんどの 消耗しない 道具は\n効果が 累積されます。\n$例えば 進化アイテムなどの ご褒美は\n使用できる 場合にのみ 登場します。\n$持ち物や道具が\n手持ちポケモン間に 移動できる\n$持ち物や道具が あれば、ショップ画面の\n右下に「アイテム移行」が 表示されます。\n$ショップ画面で お金で 消耗品を 買えます。\nラウンドが 進むにつれて 買えるアイテムが 増えます。\n$ご褒美を 選択すると 次のラウンドに\n進むから、まず 消耗品を ってください。",
"eggGacha": "この画面では、「タマゴクーポン」で\nポケモンのタマゴを 取得できます。\n$タマゴは ラウンドが進めるうちに ふかします。\nタマゴのふかは レア度によって 時間が かかります。\n$ふかしたポケモンは 手持ちに 加えられず、\nスターターに 登録されます。\n$ふかしたポケモンは 一般的に\n野生ポケモンよりも 高い個体値があります。\n$あるポケモンは タマゴからしか 手に入りません。\n$各ガチャマシンは 個性的なボーナスが あるますから、\n好きな方から 引いてみてください,"
}
"intro": "PokéRogueへようこそ!ログライク要素が\n加わったバトル中心のポケモンファンゲームです。\n$このゲームは収益を上げず、Pokémonおよび使用される\n著作権資産に対する所有権を主張しません。\n$ゲームはまだ作業中ですが、完全にプレイすることができます。\nバグ報告はディスコードコミュニティをご利用ください。\n$ゲームが遅い場合は、ブラウザ設定で「ハードウェア\nアクセラレーション」がオンになっていることを確認してください",
"accessMenu": "メニューにアクセスするには、入力待ちの間にMキーまたはEscを押してください。\nメニューには設定やさまざまな機能が含まれています。",
"menu": "このメニューから設定にアクセスできます。\n$設定ではゲームスピード、ウィンドウスタイル、\nおよびその他のオプションを変更できます。\n$ここにはさまざまな他の機能もありますので、\nぜひ確認してみてください!",
"starterSelect": "この画面でZキーやSpaceを押してポケモンを選択できます。\n選んだポケモンは自分の最初のパーティーになります。\n$最大6匹のパーティーで始めることができますが\nポケモンによってポイントがあり、合計10を超えてはなりません。\n$捕まえたりふかさせたりすることで\n選択できる性別、特性、フォルムなどの幅を広げることができます。\n$個体値も徐々に累積して高くなるので、\n同じポケモンをたくさん捕まえてみてください!",
"pokerus": "毎日ランダムでスターターの\n3種類に紫色の枠が表示されます。\n$登録されたスターターの中にあれば、\nパーティに追加してつよさを確認してみましょう!",
"statChange": "ポケモンは交代しない限り、\n次のバトルでも能力変化が維持されます。\n$その代わりに、トレーナーバトルや新しいバイオームに\n入る直前に自動的にリセットされます。\n$CキーまたはShiftキーを押し続けると、\n現在のポケモンの能力変化を確認できます。\n$Vキーを押すと、\n相手が使用した技も確認できます。\n$ただし、今のバトルで相手ポケモンがすでに\n使った技のみが表示されます。",
"selectItem": "バトルが終わるたびに、\nランダムなアイテム3つの中から1つを選んで獲得します。\n$種類は消耗品、ポケモンの持ち物、\n永続的なパッシブアイテムなど様々です。\n$ほとんどの消耗しない道具は\n効果が累積されます。\n$進化用など一部のアイテムは\n使用できる場合にのみ登場します。\n$持ち物を渡す機能を使用して\nポケモン同士で道具を持たせることもできます。\n$持ち物があれば、アイテム選択画面の\n右下に渡す機能が表示されます。\n$お金で消耗品を購入することもでき、\nウェーブが進むにつれて購入可能な種類が増えます。\n$アイテムを選択すると次のウェーブに進むため、\nまず消耗品の購入を行ってください。",
"eggGacha": "この画面でポケモンのたまごクーポンを\nガチャができます。\n$卵は戦闘を繰り返すうちにふかします。\n珍しいほどもっと長くかかります。\n$ふかさせたポケモンはパーティーに追加されず、\nスターティングに登録されます。\n$卵からふかしたポケモンは一般的に\n野生で捕まえたポケモンよりも高い個体値を持ちます。\n$一部のポケモンは卵からしか手に入りません。\n$各ガチャマシンがそれぞれ異なるボーナスを持っているため、\n好きな方を使ってみてください!,"
}

View File

@ -69,6 +69,5 @@
"cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!",
"disabledOnAdd": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n사용할 수 없다!",
"disabledLapse": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n이제 사용할 수 있다.",
"powerTrickActive": "{{pokemonNameWithAffix}}[[는]]\n공격과 방어를 바꿨다!"
"disabledLapse": "{{pokemonNameWithAffix}}의 {{moveName}}[[는]]\n이제 사용할 수 있다."
}

View File

@ -5,6 +5,7 @@
"switchedStatChanges": "{{pokemonName}}[[는]] 상대와 자신의\n능력 변화를 바꿨다!",
"switchedTwoStatChanges": "{{pokemonName}} 상대와 자신의 {{firstStat}}과 {{secondStat}}의 능력 변화를 바꿨다!",
"switchedStat": "{{pokemonName}} 서로의 {{stat}}를 교체했다!",
"selfSwitchedStat": "{{pokemonName}}[[는]]\n{{firstStat}}과 {{secondStat}}를 바꿨다!",
"sharedGuard": "{{pokemonName}} 서로의 가드를 셰어했다!",
"sharedPower": "{{pokemonName}} 서로의 파워를 셰어했다!",
"goingAllOutForAttack": "{{pokemonName}}[[는]]\n전력을 다하기 시작했다!",

View File

@ -12,7 +12,6 @@
"blockItemTheft": "{{abilityName}} de {{pokemonNameWithAffix}}\nprevine o roubo de itens!",
"typeImmunityHeal": "{{abilityName}} de {{pokemonNameWithAffix}}\nrestaurou um pouco de PS!",
"nonSuperEffectiveImmunity": "{{pokemonNameWithAffix}} evitou dano\ncom {{abilityName}}!",
"fullHpResistType": "{{pokemonNameWithAffix}} fez seu casco brilhar!\nEstá distorcendo o confronte de tipos!",
"moveImmunity": "Isso não afeta {{pokemonNameWithAffix}}!",
"reverseDrain": "{{pokemonNameWithAffix}} absorveu a gosma líquida!",
"postDefendTypeChange": "{{abilityName}} de {{pokemonNameWithAffix}}\ntransformou-o no tipo {{typeName}}!",

View File

@ -44,7 +44,6 @@
"moveNotImplemented": "{{moveName}} ainda não foi implementado e não pode ser usado.",
"moveNoPP": "Não há mais PP\npara esse movimento!",
"moveDisabled": "Não se pode usar {{moveName}} porque foi desabilitado!",
"disableInterruptedMove": "{{moveName}} de {{pokemonNameWithAffix}}\nestá desabilitado!",
"noPokeballForce": "Uma força misteriosa\nte impede de usar Poké Bolas.",
"noPokeballTrainer": "Não se pode capturar\nPokémon dos outros!",
"noPokeballMulti": "Não se pode lançar Poké Bolas\nquando há mais de um Pokémon!",
@ -62,7 +61,6 @@
"skipItemQuestion": "Tem certeza de que não quer escolher um item?",
"itemStackFull": "O estoque de {{fullItemName}} está cheio.\nVocê receberá {{itemName}} no lugar.",
"eggHatching": "Opa?",
"eggSkipPrompt": "Pular para súmario de ovos?",
"ivScannerUseQuestion": "Quer usar o Scanner de IVs em {{pokemonName}}?",
"wildPokemonWithAffix": "{{pokemonName}} selvagem",
"foePokemonWithAffix": "{{pokemonName}} adversário",
@ -91,7 +89,7 @@
"statSeverelyFell_other": "{{stats}} de {{pokemonNameWithAffix}} diminuíram severamente!",
"statWontGoAnyLower_one": "{{stats}} de {{pokemonNameWithAffix}} não vai mais diminuir!",
"statWontGoAnyLower_other": "{{stats}} de {{pokemonNameWithAffix}} não vão mais diminuir!",
"transformedIntoType": "{{pokemonName}} se transformou\nno tipo {{type}}!",
"transformedIntoType": "{{pokemonName}} transformed\ninto the {{type}} type!",
"ppReduced": "O PP do movimento {{moveName}} de\n{{targetName}} foi reduzido em {{reduction}}!",
"retryBattle": "Você gostaria de tentar novamente desde o início da batalha?",
"unlockedSomething": "{{unlockedThing}}\nfoi desbloqueado.",

View File

@ -67,8 +67,5 @@
"saltCuredLapse": "{{pokemonNameWithAffix}} foi ferido pelo {{moveName}}!",
"cursedOnAdd": "{{pokemonNameWithAffix}} cortou seus PS pela metade e amaldiçoou {{pokemonName}}!",
"cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!",
"disabledOnAdd": "{{moveName}} de {{pokemonNameWithAffix}}\nfoi desabilitado!",
"disabledLapse": "{{moveName}} de {{pokemonNameWithAffix}}\nnão está mais desabilitado.",
"powerTrickActive": "{{pokemonNameWithAffix}} trocou seu atributo de Ataque pela sua Defesa!"
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!"
}

View File

@ -1,7 +1,6 @@
{
"title": "Desafios",
"illegalEvolution": "{{pokemon}} não pode ser escolhido\nnesse desafio!",
"noneSelected": "Nada Selecionado",
"singleGeneration": {
"name": "Geração Única",
"desc": "Você só pode user Pokémon da {{gen}} geração.",
@ -34,4 +33,4 @@
"value.0": "Desligado",
"value.1": "Ligado"
}
}
}

View File

@ -6,6 +6,7 @@
"goingAllOutForAttack": "{{pokemonName}} está arriscando tudo nesse ataque!",
"regainedHealth": "{{pokemonName}} recuperou/nsaúde!",
"keptGoingAndCrashed": "{{pokemonName}} errou o alvo/ne se arrebentou!",
"selfSwitchedStat": "{{pokemonName}} trocou seu atributo de {{firstStat}} pela sua {{secondStat}}!",
"fled": "{{pokemonName}} fugiu!",
"cannotBeSwitchedOut": "{{pokemonName}} não pode ser trocado!",
"swappedAbilitiesWithTarget": "{{pokemonName}} trocou/nde habilidades com o alvo!",

View File

@ -69,6 +69,5 @@
"cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒",
"stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!",
"disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{{moveName}}",
"disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了",
"powerTrickActive": "{{pokemonNameWithAffix}}互换了攻击和防御!"
"disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了"
}

View File

@ -5,6 +5,7 @@
"switchedStatChanges": "{{pokemonName}}和对手互换了\n自己的能力变化",
"switchedTwoStatChanges": "{{pokemonName}} 和对手互换了自己的{{firstStat}}和{{secondStat}}的能力变化!",
"switchedStat": "{{pokemonName}} 互换了各自的{{stat}}",
"selfSwitchedStat": "{{pokemonName}} 互换了{{firstStat}}和{{secondStat}}",
"sharedGuard": "{{pokemonName}} 平分了各自的防守!",
"sharedPower": "{{pokemonName}} 平分了各自的力量!",
"goingAllOutForAttack": "{{pokemonName}}拿出全力了!",

View File

@ -68,6 +68,5 @@
"cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}",
"cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!",
"disabledOnAdd": "封住了{{pokemonNameWithAffix}}的\n{moveName}}",
"disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了",
"powerTrickActive": "{{pokemonNameWithAffix}}互換了攻擊和防禦!"
"disabledLapse": "{{pokemonNameWithAffix}}的\n定身法解除了"
}

View File

@ -5,6 +5,7 @@
"switchedStatChanges": "{{pokemonName}}和對手互換了\n自身的能力變化",
"switchedTwoStatChanges": "{{pokemonName}} 和對手互換了自身的{{firstStat}}和{{secondStat}}的能力變化!",
"switchedStat": "{{pokemonName}} 互換了各自的{{stat}}",
"selfSwitchedStat": "{{pokemonName}} 互换{{firstStat}}击和{{secondStat}}",
"sharedGuard": "{{pokemonName}} 平分了各自的防守!",
"sharedPower": "{{pokemonName}} 平分了各自的力量!",
"goingAllOutForAttack": "{{pokemonName}}拿出全力了!",

View File

@ -1545,7 +1545,6 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.TEMP_STAT_STAGE_BOOSTER, 4),
new WeightedModifierType(modifierTypes.BERRY, 2),
new WeightedModifierType(modifierTypes.TM_COMMON, 2),
new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(1 - rerollCount, 0) : 0, 1),
].map(m => {
m.setTier(ModifierTier.COMMON); return m;
}),
@ -1616,7 +1615,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3),
new WeightedModifierType(modifierTypes.TERA_SHARD, 1),
new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode.isSplicedOnly && party.filter(p => !p.fusionSpecies).length > 1 ? 4 : 0),
new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount * 3, 0) : 0, 3),
new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(1 - rerollCount, 0) : 0, 1),
].map(m => {
m.setTier(ModifierTier.GREAT); return m;
}),
@ -1697,7 +1696,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.RARE_FORM_CHANGE_ITEM, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 6, 24),
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36),
new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36),
new WeightedModifierType(modifierTypes.VOUCHER_PLUS, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(9 - rerollCount * 3, 0) : 0, 9),
new WeightedModifierType(modifierTypes.VOUCHER_PLUS, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount * 1, 0) : 0, 3),
].map(m => {
m.setTier(ModifierTier.ROGUE); return m;
}),
@ -1706,7 +1705,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.SHINY_CHARM, 14),
new WeightedModifierType(modifierTypes.HEALING_CHARM, 18),
new WeightedModifierType(modifierTypes.MULTI_LENS, 18),
new WeightedModifierType(modifierTypes.VOUCHER_PREMIUM, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily && !party[0].scene.gameMode.isEndless && !party[0].scene.gameMode.isSplicedOnly ? Math.max(15 - rerollCount * 5, 0) : 0, 15),
new WeightedModifierType(modifierTypes.VOUCHER_PREMIUM, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily && !party[0].scene.gameMode.isEndless && !party[0].scene.gameMode.isSplicedOnly ? Math.max(5 - rerollCount * 2, 0) : 0, 5),
new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => !party[0].scene.gameMode.isSplicedOnly && party.filter(p => !p.fusionSpecies).length > 1 ? 24 : 0, 24),
new WeightedModifierType(modifierTypes.MINI_BLACK_HOLE, (party: Pokemon[]) => (!party[0].scene.gameMode.isFreshStartChallenge() && party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) ? 1 : 0, 1),
].map(m => {

View File

@ -367,10 +367,6 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
return container;
}
getIconStackText(_scene: BattleScene, _virtual?: boolean): Phaser.GameObjects.BitmapText | null {
return null;
}
getBattleCount(): number {
return this.battleCount;
}
@ -388,8 +384,7 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
}
getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number {
// Must be an abitrary number greater than 1
return 2;
return 1;
}
}
@ -792,7 +787,7 @@ export class TerastallizeModifier extends LapsingPokemonHeldItemModifier {
/**
* Modifier used for held items, specifically vitamins like Carbos, Hp Up, etc., that
* increase the value of a given {@linkcode PermanentStat}.
* @extends PokemonHeldItemModifier
* @extends LapsingPersistentModifier
* @see {@linkcode apply}
*/
export class BaseStatModifier extends PokemonHeldItemModifier {

View File

@ -98,7 +98,7 @@ class DefaultOverrides {
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
readonly GENDER_OVERRIDE: Gender | null = null;
readonly MOVESET_OVERRIDE: Moves | Array<Moves> = [];
readonly MOVESET_OVERRIDE: Array<Moves> = [];
readonly SHINY_OVERRIDE: boolean = false;
readonly VARIANT_OVERRIDE: Variant = 0;
@ -111,7 +111,7 @@ class DefaultOverrides {
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
readonly OPP_MOVESET_OVERRIDE: Moves | Array<Moves> = [];
readonly OPP_MOVESET_OVERRIDE: Array<Moves> = [];
readonly OPP_SHINY_OVERRIDE: boolean = false;
readonly OPP_VARIANT_OVERRIDE: Variant = 0;
readonly OPP_IVS_OVERRIDE: number | number[] = [];

View File

@ -221,8 +221,8 @@ export class AttemptCapturePhase extends PokemonPhase {
this.scene.clearEnemyHeldItemModifiers();
this.scene.field.remove(pokemon, true);
};
const addToParty = (slotIndex?: number) => {
const newPokemon = pokemon.addToParty(this.pokeballType, slotIndex);
const addToParty = () => {
const newPokemon = pokemon.addToParty(this.pokeballType);
const modifiers = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier, false);
if (this.scene.getParty().filter(p => p.isShiny()).length === 6) {
this.scene.validateAchv(achvs.SHINY_PARTY);
@ -253,7 +253,7 @@ export class AttemptCapturePhase extends PokemonPhase {
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => {
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
if (slotIndex < 6) {
addToParty(slotIndex);
addToParty();
} else {
promptRelease();
}

View File

@ -448,7 +448,6 @@ export class EggHatchPhase extends Phase {
*/
generatePokemon(): PlayerPokemon {
this.eggHatchData = this.eggLapsePhase.generatePokemon(this.egg);
this.eggMoveIndex = this.eggHatchData.eggMoveIndex;
return this.eggHatchData.pokemon;
}
}

View File

@ -43,9 +43,8 @@ export class EggSummaryPhase extends Phase {
}
end() {
this.scene.time.delayedCall(250, () => this.scene.setModifiersVisible(true));
this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {
super.end();
});
this.eggHatchHandler.clear();
this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {});
super.end();
}
}

View File

@ -65,8 +65,6 @@ export class FaintPhase extends PokemonPhase {
if (pokemon.turnData?.attacksReceived?.length) {
const lastAttack = pokemon.turnData.attacksReceived[0];
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); // TODO: is this bang correct?
} else { //If killed by indirect damage, apply post-faint abilities without providing a last move
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon);
}
const alivePlayField = this.scene.getField(true);

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene";
import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims";
import Move, { allMoves } from "#app/data/move";
import { allMoves } from "#app/data/move";
import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms";
import { Moves } from "#app/enums/moves";
import { getPokemonNameWithAffix } from "#app/messages";
@ -9,15 +9,14 @@ import { SummaryUiMode } from "#app/ui/summary-ui-handler";
import { Mode } from "#app/ui/ui";
import i18next from "i18next";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";
import Pokemon from "#app/field/pokemon";
export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
private moveId: Moves;
private messageMode: Mode;
private fromTM: boolean;
constructor(scene: BattleScene, partyMemberIndex: integer, moveId: Moves, fromTM?: boolean) {
super(scene, partyMemberIndex);
this.moveId = moveId;
this.fromTM = fromTM ?? false;
}
@ -27,131 +26,87 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
const pokemon = this.getPokemon();
const move = allMoves[this.moveId];
const currentMoveset = pokemon.getMoveset();
// The game first checks if the Pokemon already has the move and ends the phase if it does.
const hasMoveAlready = currentMoveset.some(m => m?.moveId === move.id) && this.moveId !== Moves.SKETCH;
if (hasMoveAlready) {
const existingMoveIndex = pokemon.getMoveset().findIndex(m => m?.moveId === move.id);
if (existingMoveIndex > -1) {
return this.end();
}
this.messageMode = this.scene.ui.getHandler() instanceof EvolutionSceneHandler ? Mode.EVOLUTION_SCENE : Mode.MESSAGE;
this.scene.ui.setMode(this.messageMode);
// If the Pokemon has less than 4 moves, the new move is added to the largest empty moveset index
// If it has 4 moves, the phase then checks if the player wants to replace the move itself.
if (currentMoveset.length < 4) {
this.learnMove(currentMoveset.length, move, pokemon);
const emptyMoveIndex = pokemon.getMoveset().length < 4
? pokemon.getMoveset().length
: pokemon.getMoveset().findIndex(m => m === null);
const messageMode = this.scene.ui.getHandler() instanceof EvolutionSceneHandler
? Mode.EVOLUTION_SCENE
: Mode.MESSAGE;
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(() => {
this.scene.ui.setMode(messageMode).then(() => {
// Sound loaded into game as is
this.scene.playSound("level_up_fanfare");
this.scene.ui.showText(i18next.t("battle:learnMove", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), null, () => {
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
this.end();
}, messageMode === Mode.EVOLUTION_SCENE ? 1000 : null, true);
});
});
});
} else {
this.replaceMoveCheck(move, pokemon);
this.scene.ui.setMode(messageMode).then(() => {
this.scene.ui.showText(i18next.t("battle:learnMovePrompt", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), null, () => {
this.scene.ui.showText(i18next.t("battle:learnMoveLimitReached", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => {
this.scene.ui.showText(i18next.t("battle:learnMoveReplaceQuestion", { moveName: move.name }), null, () => {
const noHandler = () => {
this.scene.ui.setMode(messageMode).then(() => {
this.scene.ui.showText(i18next.t("battle:learnMoveStopTeaching", { moveName: move.name }), null, () => {
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
this.scene.ui.setMode(messageMode);
this.scene.ui.showText(i18next.t("battle:learnMoveNotLearned", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), null, () => this.end(), null, true);
}, () => {
this.scene.ui.setMode(messageMode);
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId));
this.end();
});
});
});
};
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
this.scene.ui.setMode(messageMode);
this.scene.ui.showText(i18next.t("battle:learnMoveForgetQuestion"), null, () => {
this.scene.ui.setModeWithoutClear(Mode.SUMMARY, this.getPokemon(), SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => {
if (moveIndex === 4) {
noHandler();
return;
}
this.scene.ui.setMode(messageMode).then(() => {
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();
}, null, true);
}, null, true);
}, null, true);
});
});
}, null, true);
}, noHandler);
});
}, null, true);
}, null, true);
});
}
}
/**
* This displays a chain of messages (listed below) and asks if the user wishes to forget a move.
*
* > [Pokemon] wants to learn the move [MoveName]
* > However, [Pokemon] already knows four moves.
* > Should a move be forgotten and replaced with [MoveName]? --> `Mode.CONFIRM` -> Yes: Go to `this.forgetMoveProcess()`, No: Go to `this.rejectMoveAndEnd()`
* @param move The Move to be learned
* @param Pokemon The Pokemon learning the move
*/
async replaceMoveCheck(move: Move, pokemon: Pokemon) {
const learnMovePrompt = i18next.t("battle:learnMovePrompt", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name });
const moveLimitReached = i18next.t("battle:learnMoveLimitReached", { pokemonName: getPokemonNameWithAffix(pokemon) });
const shouldReplaceQ = i18next.t("battle:learnMoveReplaceQuestion", { moveName: move.name });
const preQText = [learnMovePrompt, moveLimitReached].join("$");
await this.scene.ui.showTextPromise(preQText);
await this.scene.ui.showTextPromise(shouldReplaceQ, undefined, false);
await this.scene.ui.setModeWithoutClear(Mode.CONFIRM,
() => this.forgetMoveProcess(move, pokemon), // Yes
() => { // No
this.scene.ui.setMode(this.messageMode);
this.rejectMoveAndEnd(move, pokemon);
}
);
}
/**
* This facilitates the process in which an old move is chosen to be forgotten.
*
* > Which move should be forgotten?
*
* The game then goes `Mode.SUMMARY` to select a move to be forgotten.
* If a player does not select a move or chooses the new move (`moveIndex === 4`), the game goes to `this.rejectMoveAndEnd()`.
* If an old move is selected, the function then passes the `moveIndex` to `this.learnMove()`
* @param move The Move to be learned
* @param Pokemon The Pokemon learning the move
*/
async forgetMoveProcess(move: Move, pokemon: Pokemon) {
this.scene.ui.setMode(this.messageMode);
await this.scene.ui.showTextPromise(i18next.t("battle:learnMoveForgetQuestion"), undefined, true);
await this.scene.ui.setModeWithoutClear(Mode.SUMMARY, pokemon, SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => {
if (moveIndex === 4) {
this.scene.ui.setMode(this.messageMode).then(() => this.rejectMoveAndEnd(move, pokemon));
return;
}
const forgetSuccessText = i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() });
const fullText = [i18next.t("battle:countdownPoof"), forgetSuccessText, i18next.t("battle:learnMoveAnd")].join("$");
this.scene.ui.setMode(this.messageMode).then(() => this.learnMove(moveIndex, move, pokemon, fullText));
});
}
/**
* This asks the player if they wish to end the current move learning process.
*
* > Stop trying to teach [MoveName]? --> `Mode.CONFIRM` --> Yes: > [Pokemon] did not learn the move [MoveName], No: `this.replaceMoveCheck()`
*
* If the player wishes to not teach the Pokemon the move, it displays a message and ends the phase.
* If the player reconsiders, it repeats the process for a Pokemon with a full moveset once again.
* @param move The Move to be learned
* @param Pokemon The Pokemon learning the move
*/
async rejectMoveAndEnd(move: Move, pokemon: Pokemon) {
await this.scene.ui.showTextPromise(i18next.t("battle:learnMoveStopTeaching", { moveName: move.name }), undefined, false);
this.scene.ui.setModeWithoutClear(Mode.CONFIRM,
() => {
this.scene.ui.setMode(this.messageMode);
this.scene.ui.showTextPromise(i18next.t("battle:learnMoveNotLearned", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), undefined, true).then(() => this.end());
},
() => {
this.scene.ui.setMode(this.messageMode);
this.replaceMoveCheck(move, pokemon);
}
);
}
/**
* This teaches the Pokemon the new move and ends the phase.
* When a Pokemon forgets a move and learns a new one, its 'Learn Move' message is significantly longer.
*
* Pokemon with a `moveset.length < 4`
* > [Pokemon] learned [MoveName]
*
* Pokemon with a `moveset.length > 4`
* > 1... 2... and 3... and Poof!
* > [Pokemon] forgot how to use [MoveName]
* > And...
* > [Pokemon] learned [MoveName]!
* @param move The Move to be learned
* @param Pokemon The Pokemon learning the move
*/
async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
if (this.fromTM) {
if (!pokemon.usedTMs) {
pokemon.usedTMs = [];
}
pokemon.usedTMs.push(this.moveId);
}
pokemon.setMove(index, this.moveId);
initMoveAnim(this.scene, this.moveId).then(() => {
loadMoveAnimAssets(this.scene, [this.moveId], true);
this.scene.playSound("level_up_fanfare"); // Sound loaded into game as is
});
this.scene.ui.setMode(this.messageMode);
const learnMoveText = i18next.t("battle:learnMove", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name });
textMessage = textMessage ? textMessage+"$"+learnMoveText : learnMoveText;
await this.scene.ui.showTextPromise(textMessage, this.messageMode === Mode.EVOLUTION_SCENE ? 1000 : undefined, true);
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
this.end();
}
}

View File

@ -204,7 +204,7 @@ export class MovePhase extends BattlePhase {
let success = this.move.getMove().applyConditions(this.pokemon, targets[0], this.move.getMove());
const cancelled = new Utils.BooleanHolder(false);
let failedText = this.move.getMove().getFailedText(this.pokemon, targets[0], this.move.getMove(), cancelled);
if (success && this.scene.arena.isMoveWeatherCancelled(this.pokemon, this.move.getMove())) {
if (success && this.scene.arena.isMoveWeatherCancelled(this.move.getMove())) {
success = false;
} else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, this.move.getMove())) {
success = false;

View File

@ -65,7 +65,7 @@ export class QuietFormChangePhase extends BattlePhase {
pokemonFormTintSprite.setVisible(false);
pokemonFormTintSprite.setTintFill(0xFFFFFF);
this.scene.playSound("battle_anims/PRSFX- Transform");
this.scene.playSound("PRSFX- Transform");
this.scene.tweens.add({
targets: pokemonTintSprite,

View File

@ -30,7 +30,7 @@ export class TrainerVictoryPhase extends BattlePhase {
const trainerType = this.scene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct?
if (vouchers.hasOwnProperty(TrainerType[trainerType])) {
if (!this.scene.validateVoucher(vouchers[TrainerType[trainerType]]) && this.scene.currentBattle.trainer?.config.isBoss) {
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, [modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PREMIUM][vouchers[TrainerType[trainerType]].voucherType]));
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, [modifierTypes.VOUCHER, modifierTypes.VOUCHER, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PREMIUM][vouchers[TrainerType[trainerType]].voucherType]));
}
}

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene";
import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability";
import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability.js";
import { CommonAnim } from "#app/data/battle-anims";
import { Weather, getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather";
import { BattlerTagType } from "#app/enums/battler-tag-type";

View File

@ -7,7 +7,7 @@ import * as Utils from "../utils";
import { PlayerGender } from "#enums/player-gender";
import { Challenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge, InverseBattleChallenge } from "#app/data/challenge";
import { ConditionFn } from "#app/@types/common";
import { Stat, getShortenedStatKey } from "#app/enums/stat";
import { Stat, getShortenedStatKey } from "#app/enums/stat";
import { Challenges } from "#app/enums/challenges";
export enum AchvTier {
@ -197,7 +197,7 @@ export function getAchievementDescription(localizationKey: string): string {
case "100_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {context: genderStr, "ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "TRANSFER_MAX_STAT_STAGE":
return i18next.t("achv:TRANSFER_MAX_STAT_STAGE.description", { context: genderStr });
return i18next.t("achv:TRANSFER_MAX_BATTLE_STAT.description", { context: genderStr });
case "MAX_FRIENDSHIP":
return i18next.t("achv:MAX_FRIENDSHIP.description", { context: genderStr });
case "MEGA_EVOLVE":

View File

@ -1,4 +1,4 @@
import { allSpecies } from "#app/data/pokemon-species";
import { allSpecies } from "#app/data/pokemon-species.js";
import { AbilityAttr, defaultStarterSpecies, DexAttr, SessionSaveData, SystemSaveData } from "./game-data";
import { SettingKeys } from "./settings/settings";
@ -31,7 +31,7 @@ export function applySessionDataPatches(data: SessionSaveData) {
// From [ stat, battlesLeft ] to [ stat, maxBattles, battleCount ]
m.args = [ newStat, 5, m.args[1] ];
} else if (m.className === "DoubleBattleChanceBoosterModifier" && m.args.length === 1) {
} else if (m.className === "DoubleBattleChanceBoosterModifier") {
let maxBattles: number;
switch (m.typeId) {
case "MAX_LURE":
@ -53,8 +53,6 @@ export function applySessionDataPatches(data: SessionSaveData) {
data.enemyModifiers.forEach((m) => {
if (m.className === "PokemonBaseStatModifier") {
m.className = "BaseStatModifier";
} else if (m.className === "PokemonResetNegativeStatStageModifier") {
m.className = "ResetNegativeStatStageModifier";
}
});
}
@ -76,7 +74,7 @@ export function applySystemDataPatches(data: SystemSaveData) {
if (data.starterData) {
// Migrate ability starter data if empty for caught species
Object.keys(data.starterData).forEach(sd => {
if (data.dexData[sd]?.caughtAttr && (data.starterData[sd] && !data.starterData[sd].abilityAttr)) {
if (data.dexData[sd].caughtAttr && !data.starterData[sd].abilityAttr) {
data.starterData[sd].abilityAttr = 1;
}
});
@ -104,11 +102,9 @@ export function applySystemDataPatches(data: SystemSaveData) {
// --- PATCHES ---
// Fix Starter Data
for (const starterId of defaultStarterSpecies) {
if (data.starterData[starterId]?.abilityAttr) {
if (data.gameVersion) {
for (const starterId of defaultStarterSpecies) {
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
}
if (data.dexData[starterId]?.caughtAttr) {
data.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
}
}

View File

@ -3,6 +3,7 @@ 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";
@ -26,7 +27,7 @@ describe("Abilities - Aura Break", () => {
game = new GameManager(phaserGame);
game.override.battleType("single");
game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
game.override.enemyMoveset(Moves.SPLASH);
game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemyAbility(Abilities.AURA_BREAK);
game.override.enemySpecies(Species.SHUCKLE);
});

View File

@ -5,6 +5,7 @@ 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 { SPLASH_ONLY } from "#test/utils/testUtils";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
@ -30,7 +31,7 @@ describe("Abilities - Battery", () => {
game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH);
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
game.override.enemyMoveset(Moves.SPLASH);
game.override.enemyMoveset(SPLASH_ONLY);
});
it("raises the power of allies' special moves by 30%", async () => {

View File

@ -4,6 +4,7 @@ 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";
@ -30,7 +31,7 @@ describe("Abilities - Beast Boost", () => {
.ability(Abilities.BEAST_BOOST)
.startingLevel(2000)
.moveset([ Moves.FLAMETHROWER ])
.enemyMoveset(Moves.SPLASH);
.enemyMoveset(SPLASH_ONLY);
});
it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => {
@ -50,7 +51,7 @@ describe("Abilities - Beast Boost", () => {
}, 20000);
it("should use in-battle overriden stats when determining the stat stage to raise by 1", async() => {
game.override.enemyMoveset([Moves.GUARD_SPLIT]);
game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT));
await game.classicMode.startBattle([Species.SLOWBRO]);

View File

@ -1,10 +1,10 @@
import { Moves } from "#app/enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";
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;
@ -27,7 +27,7 @@ describe("Abilities - Contrary", () => {
.enemySpecies(Species.BULBASAUR)
.enemyAbility(Abilities.CONTRARY)
.ability(Abilities.INTIMIDATE)
.enemyMoveset(Moves.SPLASH);
.enemyMoveset(SPLASH_ONLY);
});
it("should invert stat changes when applied", async() => {

View File

@ -5,6 +5,7 @@ import { Species } from "#app/enums/species";
import { CommandPhase } from "#app/phases/command-phase";
import { MessagePhase } from "#app/phases/message-phase";
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";
@ -29,7 +30,7 @@ describe("Abilities - COSTAR", () => {
game.override.battleType("double");
game.override.ability(Abilities.COSTAR);
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
game.override.enemyMoveset(Moves.SPLASH);
game.override.enemyMoveset(SPLASH_ONLY);
});

View File

@ -30,7 +30,7 @@ describe("Abilities - Dancer", () => {
.moveset([Moves.SWORDS_DANCE, Moves.SPLASH])
.enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.DANCER)
.enemyMoveset([Moves.VICTORY_DANCE]);
.enemyMoveset(Array(4).fill(Moves.VICTORY_DANCE));
});
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability)

View File

@ -6,6 +6,7 @@ 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";
const TIMEOUT = 20 * 1000;
@ -30,7 +31,7 @@ describe("Abilities - Disguise", () => {
game.override
.battleType("single")
.enemySpecies(Species.MIMIKYU)
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.starterSpecies(Species.REGIELEKI)
.moveset([Moves.SHADOW_SNEAK, Moves.VACUUM_WAVE, Moves.TOXIC_THREAD, Moves.SPLASH]);
}, TIMEOUT);
@ -107,7 +108,7 @@ describe("Abilities - Disguise", () => {
}, TIMEOUT);
it("persists form change when switched out", async () => {
game.override.enemyMoveset([Moves.SHADOW_SNEAK]);
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
game.override.starterSpecies(0);
await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]);
@ -193,7 +194,7 @@ describe("Abilities - Disguise", () => {
}, TIMEOUT);
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([Moves.ENDURE]);
game.override.enemyMoveset(Array(4).fill(Moves.ENDURE));
await game.classicMode.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!;

View File

@ -1,7 +1,9 @@
import { Species } from "#app/enums/species";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
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";
@ -21,56 +23,63 @@ describe("Abilities - Dry Skin", () => {
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.battleType("single")
.disableCrits()
.enemyAbility(Abilities.DRY_SKIN)
.enemyMoveset(Moves.SPLASH)
.enemySpecies(Species.CHARMANDER)
.ability(Abilities.BALL_FETCH)
.moveset([Moves.SUNNY_DAY, Moves.RAIN_DANCE, Moves.SPLASH, Moves.WATER_GUN])
.starterSpecies(Species.CHANDELURE);
game.override.battleType("single");
game.override.disableCrits();
game.override.enemyAbility(Abilities.DRY_SKIN);
game.override.enemyMoveset(SPLASH_ONLY);
game.override.enemySpecies(Species.CHARMANDER);
game.override.ability(Abilities.UNNERVE);
game.override.starterSpecies(Species.CHANDELURE);
});
it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => {
await game.classicMode.startBattle();
game.override.moveset([Moves.SUNNY_DAY, Moves.SPLASH]);
await game.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
expect(enemy).not.toBe(undefined);
// first turn
let previousEnemyHp = enemy.hp;
game.move.select(Moves.SUNNY_DAY);
await game.phaseInterceptor.to("TurnEndPhase");
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.hp).toBeLessThan(previousEnemyHp);
// second turn
enemy.hp = enemy.getMaxHp();
previousEnemyHp = enemy.hp;
game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("TurnEndPhase");
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.hp).toBeLessThan(previousEnemyHp);
});
it("during rain, gain 1/8 of maximum health at the end of each turn", async () => {
await game.classicMode.startBattle();
game.override.moveset([Moves.RAIN_DANCE, Moves.SPLASH]);
await game.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
expect(enemy).not.toBe(undefined);
enemy.hp = 1;
// first turn
let previousEnemyHp = enemy.hp;
game.move.select(Moves.RAIN_DANCE);
await game.phaseInterceptor.to("TurnEndPhase");
expect(enemy.hp).toBeGreaterThan(1);
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.hp).toBeGreaterThan(previousEnemyHp);
// second turn
enemy.hp = 1;
previousEnemyHp = enemy.hp;
game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("TurnEndPhase");
expect(enemy.hp).toBeGreaterThan(1);
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.hp).toBeGreaterThan(previousEnemyHp);
});
it("opposing fire attacks do 25% more damage", async () => {
game.override.moveset([Moves.FLAMETHROWER]);
await game.classicMode.startBattle();
await game.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
const initialHP = 1000;
@ -78,65 +87,72 @@ describe("Abilities - Dry Skin", () => {
// first turn
game.move.select(Moves.FLAMETHROWER);
await game.phaseInterceptor.to("TurnEndPhase");
await game.phaseInterceptor.to(TurnEndPhase);
const fireDamageTakenWithDrySkin = initialHP - enemy.hp;
expect(enemy.hp > 0);
enemy.hp = initialHP;
game.override.enemyAbility(Abilities.NONE);
// second turn
game.move.select(Moves.FLAMETHROWER);
await game.phaseInterceptor.to("TurnEndPhase");
await game.phaseInterceptor.to(TurnEndPhase);
const fireDamageTakenWithoutDrySkin = initialHP - enemy.hp;
expect(fireDamageTakenWithDrySkin).toBeGreaterThan(fireDamageTakenWithoutDrySkin);
});
it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => {
await game.classicMode.startBattle();
game.override.moveset([Moves.WATER_GUN]);
await game.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
expect(enemy).not.toBe(undefined);
enemy.hp = 1;
game.move.select(Moves.WATER_GUN);
await game.phaseInterceptor.to("TurnEndPhase");
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.hp).toBeGreaterThan(1);
});
it("opposing water attacks do not heal if they were protected from", async () => {
game.override.enemyMoveset([Moves.PROTECT]);
game.override.moveset([Moves.WATER_GUN]);
await game.classicMode.startBattle();
await game.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
expect(enemy).not.toBe(undefined);
enemy.hp = 1;
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
game.move.select(Moves.WATER_GUN);
await game.phaseInterceptor.to("TurnEndPhase");
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.hp).toBe(1);
});
it("multi-strike water attacks only heal once", async () => {
game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
await game.classicMode.startBattle();
await game.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
expect(enemy).not.toBe(undefined);
enemy.hp = 1;
// first turn
game.move.select(Moves.WATER_SHURIKEN);
await game.phaseInterceptor.to("TurnEndPhase");
await game.phaseInterceptor.to(TurnEndPhase);
const healthGainedFromWaterShuriken = enemy.hp - 1;
enemy.hp = 1;
// second turn
game.move.select(Moves.WATER_GUN);
await game.phaseInterceptor.to("TurnEndPhase");
await game.phaseInterceptor.to(TurnEndPhase);
const healthGainedFromWaterGun = enemy.hp - 1;
expect(healthGainedFromWaterShuriken).toBe(healthGainedFromWaterGun);

View File

@ -7,6 +7,7 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
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";
@ -37,7 +38,7 @@ describe("Abilities - Flash Fire", () => {
it("immune to Fire-type moves", async () => {
game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH);
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
await game.startBattle([Species.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!;
@ -48,7 +49,7 @@ describe("Abilities - Flash Fire", () => {
}, 20000);
it("not activate if the Pokémon is protected from the Fire-type move", async () => {
game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.PROTECT]);
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.PROTECT]);
await game.startBattle([Species.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!;
@ -59,7 +60,7 @@ describe("Abilities - Flash Fire", () => {
}, 20000);
it("activated by Will-O-Wisp", async () => {
game.override.enemyMoveset([Moves.WILL_O_WISP]).moveset(Moves.SPLASH);
game.override.enemyMoveset(Array(4).fill(Moves.WILL_O_WISP)).moveset(SPLASH_ONLY);
await game.startBattle([Species.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!;
@ -74,7 +75,7 @@ describe("Abilities - Flash Fire", () => {
}, 20000);
it("activated after being frozen", async () => {
game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH);
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
game.override.statusEffect(StatusEffect.FREEZE);
await game.startBattle([Species.BLISSEY]);
@ -87,7 +88,7 @@ describe("Abilities - Flash Fire", () => {
}, 20000);
it("not passing with baton pass", async () => {
game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.BATON_PASS]);
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.BATON_PASS]);
await game.startBattle([Species.BLISSEY, Species.CHANSEY]);
// ensure use baton pass after enemy moved
@ -103,7 +104,7 @@ describe("Abilities - Flash Fire", () => {
}, 20000);
it("boosts Fire-type move when the ability is activated", async () => {
game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]);
game.override.enemyMoveset(Array(4).fill(Moves.FIRE_PLEDGE)).moveset([Moves.EMBER, Moves.SPLASH]);
game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE);
await game.startBattle([Species.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!;

View File

@ -5,6 +5,7 @@ import { WeatherType } from "#app/enums/weather-type";
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";
@ -43,7 +44,7 @@ describe("Abilities - Flower Gift", () => {
game.override
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SKILL_SWAP])
.enemySpecies(Species.MAGIKARP)
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.enemyAbility(Abilities.BALL_FETCH);
});
@ -91,7 +92,7 @@ describe("Abilities - Flower Gift", () => {
});
it("reverts to Overcast Form when the Pokémon loses Flower Gift, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
game.override.enemyMoveset([Moves.SKILL_SWAP]).weather(WeatherType.HARSH_SUN);
game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP)).weather(WeatherType.HARSH_SUN);
await game.classicMode.startBattle([Species.CHERRIM]);
@ -110,7 +111,7 @@ describe("Abilities - Flower Gift", () => {
});
it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.HARSH_SUN);
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.HARSH_SUN);
await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]);

View File

@ -10,6 +10,7 @@ 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 { SPLASH_ONLY } from "#test/utils/testUtils";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
@ -66,7 +67,7 @@ describe("Abilities - Forecast", () => {
game.override
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE])
.enemySpecies(Species.MAGIKARP)
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.enemyAbility(Abilities.BALL_FETCH);
});
@ -228,7 +229,7 @@ describe("Abilities - Forecast", () => {
});
it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => {
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.RAIN);
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.RAIN);
await game.startBattle([Species.CASTFORM, Species.PIKACHU]);
const castform = game.scene.getPlayerPokemon()!;
@ -259,7 +260,7 @@ describe("Abilities - Forecast", () => {
});
it("does not change Castform's form until after Stealth Rock deals damage", async () => {
game.override.weather(WeatherType.RAIN).enemyMoveset([Moves.STEALTH_ROCK]);
game.override.weather(WeatherType.RAIN).enemyMoveset(Array(4).fill(Moves.STEALTH_ROCK));
await game.startBattle([Species.PIKACHU, Species.CASTFORM]);
// First turn - set up stealth rock

View File

@ -6,6 +6,7 @@ import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species";
import { HitResult } from "#app/field/pokemon";
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";
@ -35,7 +36,7 @@ describe("Abilities - Galvanize", () => {
.moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES])
.enemySpecies(Species.DUSCLOPS)
.enemyAbility(Abilities.BALL_FETCH)
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.enemyLevel(100);
});

View File

@ -1,83 +0,0 @@
import { BattlerIndex } from "#app/battle";
import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species";
import { Stat } from "#app/enums/stat";
import { Abilities } from "#enums/abilities";
import GameManager from "#test/utils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Gorilla Tactics", () => {
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")
.enemyAbility(Abilities.BALL_FETCH)
.enemyMoveset([Moves.SPLASH, Moves.DISABLE])
.enemySpecies(Species.MAGIKARP)
.enemyLevel(30)
.moveset([Moves.SPLASH, Moves.TACKLE, Moves.GROWL])
.ability(Abilities.GORILLA_TACTICS);
});
it("boosts the Pokémon's Attack by 50%, but limits the Pokémon to using only one move", async () => {
await game.classicMode.startBattle([Species.GALAR_DARMANITAN]);
const darmanitan = game.scene.getPlayerPokemon()!;
const initialAtkStat = darmanitan.getStat(Stat.ATK);
game.move.select(Moves.SPLASH);
await game.forceEnemyMove(Moves.SPLASH);
await game.phaseInterceptor.to("TurnEndPhase");
expect(darmanitan.getStat(Stat.ATK, false)).toBeCloseTo(initialAtkStat * 1.5);
// Other moves should be restricted
expect(darmanitan.isMoveRestricted(Moves.TACKLE)).toBe(true);
expect(darmanitan.isMoveRestricted(Moves.SPLASH)).toBe(false);
}, TIMEOUT);
it("should struggle if the only usable move is disabled", async () => {
await game.classicMode.startBattle([Species.GALAR_DARMANITAN]);
const darmanitan = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!;
// First turn, lock move to Growl
game.move.select(Moves.GROWL);
await game.forceEnemyMove(Moves.SPLASH);
// Second turn, Growl is interrupted by Disable
await game.toNextTurn();
game.move.select(Moves.GROWL);
await game.forceEnemyMove(Moves.DISABLE);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("TurnEndPhase");
expect(enemy.getStatStage(Stat.ATK)).toBe(-1); // Only the effect of the first Growl should be applied
// Third turn, Struggle is used
await game.toNextTurn();
game.move.select(Moves.TACKLE);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("MoveEndPhase");
expect(darmanitan.hp).toBeLessThan(darmanitan.getMaxHp());
}, TIMEOUT);
});

View File

@ -11,6 +11,7 @@ import { Moves } from "#enums/moves";
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", () => {
@ -48,7 +49,7 @@ describe("Abilities - Gulp Missile", () => {
.moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH])
.enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH)
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.enemyLevel(5);
});
@ -107,7 +108,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("deals 1/4 of the attacker's maximum HP when hit by a damaging attack", async () => {
game.override.enemyMoveset([Moves.TACKLE]);
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
await game.startBattle([Species.CRAMORANT]);
const enemy = game.scene.getEnemyPokemon()!;
@ -120,7 +121,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("does not have any effect when hit by non-damaging attack", async () => {
game.override.enemyMoveset([Moves.TAIL_WHIP]);
game.override.enemyMoveset(Array(4).fill(Moves.TAIL_WHIP));
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;
@ -139,7 +140,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("lowers attacker's DEF stat stage by 1 when hit in Gulping form", async () => {
game.override.enemyMoveset([Moves.TACKLE]);
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;
@ -163,7 +164,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("paralyzes the enemy when hit in Gorging form", async () => {
game.override.enemyMoveset([Moves.TACKLE]);
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;
@ -187,7 +188,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("does not activate the ability when underwater", async () => {
game.override.enemyMoveset([Moves.SURF]);
game.override.enemyMoveset(Array(4).fill(Moves.SURF));
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;
@ -200,7 +201,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => {
game.override.enemyMoveset([Moves.TACKLE]).enemyAbility(Abilities.MAGIC_GUARD);
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)).enemyAbility(Abilities.MAGIC_GUARD);
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;
@ -224,7 +225,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("cannot be suppressed", async () => {
game.override.enemyMoveset([Moves.GASTRO_ACID]);
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID));
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;
@ -244,7 +245,7 @@ describe("Abilities - Gulp Missile", () => {
});
it("cannot be swapped with another ability", async () => {
game.override.enemyMoveset([Moves.SKILL_SWAP]);
game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP));
await game.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!;

View File

@ -5,6 +5,7 @@ import { toDmgValue } from "#app/utils";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
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";
@ -29,7 +30,7 @@ describe("Abilities - Heatproof", () => {
.disableCrits()
.enemySpecies(Species.CHARMANDER)
.enemyAbility(Abilities.HEATPROOF)
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.enemyLevel(100)
.starterSpecies(Species.CHANDELURE)
.ability(Abilities.BALL_FETCH)

View File

@ -4,6 +4,7 @@ import { Stat } from "#app/enums/stat";
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";
@ -28,7 +29,7 @@ describe("Abilities - Hustle", () => {
.moveset([ Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE ])
.disableCrits()
.battleType("single")
.enemyMoveset(Moves.SPLASH)
.enemyMoveset(SPLASH_ONLY)
.enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.BALL_FETCH);
});

Some files were not shown because too many files have changed in this diff Show More