From 9e018f4fe404f8807921e0c9fc89c376c76fec47 Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 11:02:50 -0400 Subject: [PATCH 01/16] [Move] Implement Rage --- src/data/battler-tags.ts | 20 ++++++ src/data/move.ts | 2 +- src/enums/battler-tag-type.ts | 3 +- src/locales/en/battler-tags.ts | 1 + src/phases/move-effect-phase.ts | 3 + src/test/moves/rage.test.ts | 110 ++++++++++++++++++++++++++++++++ 6 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 src/test/moves/rage.test.ts diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index ede8d029327..934e5218de6 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -205,6 +205,24 @@ export class ShellTrapTag extends BattlerTag { } } +export class RageTag extends BattlerTag { + constructor() { + super(BattlerTagType.RAGE,[BattlerTagLapseType.MOVE_EFFECT],1,Moves.RAGE); + } + + lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { + if (lapseType === BattlerTagLapseType.MOVE_EFFECT) { + return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE; + } else if (lapseType === BattlerTagLapseType.CUSTOM) { + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene,pokemon.getBattlerIndex(),true,[BattleStat.ATK],1,false)); + pokemon.scene.queueMessage(i18next.t("battlerTags:rageOnHit", { + pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)})); + return true; + } + return false; + } +} + export class TrappedTag extends BattlerTag { constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, turnCount: number, sourceMove: Moves, sourceId: number) { super(tagType, lapseType, turnCount, sourceMove, sourceId); @@ -1962,6 +1980,8 @@ 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.RAGE: + return new RageTag(); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/move.ts b/src/data/move.ts index acb61042e70..f6de9e2ec09 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6450,7 +6450,7 @@ export function initMoves() { .attr(StatChangeAttr, BattleStat.SPD, 2, true), new AttackMove(Moves.QUICK_ATTACK, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 1), new AttackMove(Moves.RAGE, Type.NORMAL, MoveCategory.PHYSICAL, 20, 100, 20, -1, 0, 1) - .partial(), + .attr(AddBattlerTagAttr,BattlerTagType.RAGE,true,false,0,0,false,true), new SelfStatusMove(Moves.TELEPORT, Type.PSYCHIC, -1, 20, -1, -6, 1) .attr(ForceSwitchOutAttr, true) .hidesUser(), diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index b133b442801..f1d1f1c887a 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -69,5 +69,6 @@ export enum BattlerTagType { GULP_MISSILE_ARROKUDA = "GULP_MISSILE_ARROKUDA", GULP_MISSILE_PIKACHU = "GULP_MISSILE_PIKACHU", BEAK_BLAST_CHARGING = "BEAK_BLAST_CHARGING", - SHELL_TRAP = "SHELL_TRAP" + SHELL_TRAP = "SHELL_TRAP", + RAGE = "RAGE" } diff --git a/src/locales/en/battler-tags.ts b/src/locales/en/battler-tags.ts index d0775efda08..002f26ea939 100644 --- a/src/locales/en/battler-tags.ts +++ b/src/locales/en/battler-tags.ts @@ -70,4 +70,5 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building" } as const; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index a5ac913cc5d..0cfe256f82a 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -262,6 +262,9 @@ export class MoveEffectPhase extends PokemonPhase { if (move.category === MoveCategory.PHYSICAL && user.isPlayer() !== target.isPlayer()) { target.lapseTag(BattlerTagType.SHELL_TRAP); } + if (hitResult < HitResult.NO_EFFECT && move.category !== MoveCategory.STATUS) { + target.lapseTag(BattlerTagType.RAGE); + } if (!user.isPlayer() && this.move.getMove() instanceof AttackMove) { user.scene.applyShuffledModifiers(this.scene, EnemyAttackStatusEffectChanceModifier, false, target); } diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts new file mode 100644 index 00000000000..8d57006415d --- /dev/null +++ b/src/test/moves/rage.test.ts @@ -0,0 +1,110 @@ +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import GameManager from "#test/utils/gameManager"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import {BattleStat} from "#app/data/battle-stat"; + +const TIMEOUT = 20 * 1000; + +describe("Moves - Rage", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .ability(Abilities.UNNERVE) + .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE]) + .enemyAbility(Abilities.INSOMNIA) + .startingLevel(100) + .enemyLevel(100); + }); + + it( + "should raise attack if hit after use", + async () => { + game.override + .enemySpecies(Species.SHUCKLE) + .enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); + await game.startBattle([Species.NINJASK]); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Ninjask uses rage, then gets hit, gets atk boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + + }, TIMEOUT + ); + + it( + "should raise ATK if hit before using non-rage option", + async () => { + game.override + .enemySpecies(Species.NINJASK) + .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); + await game.startBattle([Species.SHUCKLE]); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Ninjask moves first, THEN shuckle uses rage, no ATK boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + + // Shuckle Raged last turn, so when Ninjask hits it, ATK boost despite not using rage this turn + game.doAttack(1); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + }, TIMEOUT + ); + + it( + "should not raise ATK if hit by status move", + async () => { + game.override + .enemySpecies(Species.NINJASK) + .enemyMoveset([Moves.RAGE, Moves.RAGE, Moves.RAGE, Moves.RAGE]); + await game.startBattle([Species.NINJASK]); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Ninjask Rages, then slept. No boost. + game.doAttack(2); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + }, TIMEOUT + ); + + it( + "should not raise ATK if rage has no effect", + async () => { + game.override + .enemySpecies(Species.GASTLY) + .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]) + .moveset([Moves.RAGE]); + await game.startBattle([Species.NINJASK]); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Ninjask uses rage, but it has no effect, no ATK boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + }, TIMEOUT + ); +}); From 3407d1100eda3adddbdba71c500fef85ef1daf0f Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 12:28:49 -0400 Subject: [PATCH 02/16] RageTag now displays message onAdd --- src/data/battler-tags.ts | 6 ++++++ src/locales/en/battler-tags.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 934e5218de6..28ec02e52ef 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -209,6 +209,12 @@ export class RageTag extends BattlerTag { constructor() { super(BattlerTagType.RAGE,[BattlerTagLapseType.MOVE_EFFECT],1,Moves.RAGE); } + onAdd(pokemon: Pokemon) { + super.onAdd(pokemon); + /* This message might not exist on cartridge */ + pokemon.scene.queueMessage(i18next.t("battlerTags:rageOnAdd", { + pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)})); + } lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { if (lapseType === BattlerTagLapseType.MOVE_EFFECT) { diff --git a/src/locales/en/battler-tags.ts b/src/locales/en/battler-tags.ts index 002f26ea939..133ddaa6fb9 100644 --- a/src/locales/en/battler-tags.ts +++ b/src/locales/en/battler-tags.ts @@ -70,5 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building" } as const; From 249f2ca628df145ccebc9c84783558a55e7f0fac Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 13:41:17 -0400 Subject: [PATCH 03/16] Added placeholder text for other locales --- src/locales/de/battler-tags.ts | 2 ++ src/locales/en/battler-tags.ts | 4 ++-- src/locales/fr/battler-tags.ts | 2 ++ src/locales/it/battler-tags.ts | 2 ++ src/locales/ja/battler-tags.ts | 2 ++ src/locales/ko/battler-tags.ts | 2 ++ src/locales/pt_BR/battler-tags.ts | 2 ++ src/locales/zh_CN/battler-tags.ts | 2 ++ src/locales/zh_TW/battler-tags.ts | 2 ++ 9 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/locales/de/battler-tags.ts b/src/locales/de/battler-tags.ts index 27d5f14c597..44aaa283a97 100644 --- a/src/locales/de/battler-tags.ts +++ b/src/locales/de/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} nimmt einen Teil seiner KP und legt einen Fluch auf {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/en/battler-tags.ts b/src/locales/en/battler-tags.ts index 133ddaa6fb9..7a2f56548d3 100644 --- a/src/locales/en/battler-tags.ts +++ b/src/locales/en/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building" + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/fr/battler-tags.ts b/src/locales/fr/battler-tags.ts index 7598dcaff74..99d311535d4 100644 --- a/src/locales/fr/battler-tags.ts +++ b/src/locales/fr/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} sacrifie des PV\net lance une malédiction sur {{pokemonName}} !", "cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !", "stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/it/battler-tags.ts b/src/locales/it/battler-tags.ts index 7dd3ebc6fb1..52b075e4c20 100644 --- a/src/locales/it/battler-tags.ts +++ b/src/locales/it/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} ha sacrificato metà dei suoi PS per\nlanciare una maledizione su {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/ja/battler-tags.ts b/src/locales/ja/battler-tags.ts index 38a37f0f715..e822f83b60e 100644 --- a/src/locales/ja/battler-tags.ts +++ b/src/locales/ja/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}は 自分の 体力を 削って\n{{pokemonName}}に のろいを かけた!", "cursedLapse": "{{pokemonNameWithAffix}}は のろわれている!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}は {{stockpiledCount}}つ たくわえた!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/ko/battler-tags.ts b/src/locales/ko/battler-tags.ts index 39647466ada..44d9f8bfceb 100644 --- a/src/locales/ko/battler-tags.ts +++ b/src/locales/ko/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}[[는]] 자신의 체력을 깎아서\n{{pokemonName}}에게 저주를 걸었다!", "cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/pt_BR/battler-tags.ts b/src/locales/pt_BR/battler-tags.ts index 1758fed38d6..e9873426135 100644 --- a/src/locales/pt_BR/battler-tags.ts +++ b/src/locales/pt_BR/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cortou seus PS pela metade e amaldiçoou {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/zh_CN/battler-tags.ts b/src/locales/zh_CN/battler-tags.ts index 7af764cf117..5e0d1e3c614 100644 --- a/src/locales/zh_CN/battler-tags.ts +++ b/src/locales/zh_CN/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}削减了自己的体力,\n并诅咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/zh_TW/battler-tags.ts b/src/locales/zh_TW/battler-tags.ts index 9e933336387..fbc4c86b712 100644 --- a/src/locales/zh_TW/battler-tags.ts +++ b/src/locales/zh_TW/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", + "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; From d63126a831c141e904cec4e678a4a1c3411e1ddd Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 18:56:18 -0400 Subject: [PATCH 04/16] Updated unit tests --- src/test/moves/rage.test.ts | 235 ++++++++++++++++++++++++++++++------ 1 file changed, 197 insertions(+), 38 deletions(-) diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index 8d57006415d..b4cdf4be408 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -5,9 +5,22 @@ import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import {BattleStat} from "#app/data/battle-stat"; +import {StatusEffect} from "#enums/status-effect"; +import {RageTag} from "#app/data/battler-tags"; +import {PlayerPokemon} from "#app/field/pokemon"; +import {Nature} from "#enums/nature"; +import {getMovePosition} from "#test/utils/gameManagerUtils"; +import {CommandPhase} from "#app/phases/command-phase"; +import {SelectTargetPhase} from "#app/phases/select-target-phase"; +import {BattlerIndex} from "#app/battle"; +import {TurnEndPhase} from "#app/phases/turn-end-phase"; + const TIMEOUT = 20 * 1000; +function fullOf(move: Moves) : Moves[] { + return [move,move,move,move]; +} describe("Moves - Rage", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -27,84 +40,230 @@ describe("Moves - Rage", () => { game.override .battleType("single") .ability(Abilities.UNNERVE) - .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE]) - .enemyAbility(Abilities.INSOMNIA) + .starterSpecies(Species.BOLTUND) + .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE,Moves.VITAL_THROW]) + .enemyAbility(Abilities.NO_GUARD) .startingLevel(100) - .enemyLevel(100); + .enemyLevel(100) + .disableCrits(); }); + /** + * Ally Attack-Boost Test. + * + * Checks that Rage provides an attack boost if the user it hit after use. + * + * Checks that Rage provides an attack boost if the user is hit before moving + * on the following turn, regardless of what move they selected. + * + * Checks that a pokemon stops raging if they use a different move. + */ it( "should raise attack if hit after use", async () => { game.override .enemySpecies(Species.SHUCKLE) - .enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); - await game.startBattle([Species.NINJASK]); + .enemyMoveset(fullOf(Moves.TACKLE)); + await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; - // Ninjask uses rage, then gets hit, gets atk boost + // Player Boltund uses Rage. Opponent Shuckle uses Tackle. + // Boltund's attack is raised. game.doAttack(0); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). + // Boltund's attack is raised. + game.doAttack(3); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + + // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). + // Boltund's attack not raised. + game.doAttack(3); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + }, TIMEOUT ); - it( - "should raise ATK if hit before using non-rage option", - async () => { - game.override - .enemySpecies(Species.NINJASK) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); - await game.startBattle([Species.SHUCKLE]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - - // Ninjask moves first, THEN shuckle uses rage, no ATK boost - game.doAttack(0); - await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); - - // Shuckle Raged last turn, so when Ninjask hits it, ATK boost despite not using rage this turn - game.doAttack(1); - await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); - }, TIMEOUT - ); - + /** + * Checks that Opponent Pokemon correctly receive the Attack boost from Rage + * Checks that using a Status Move on a Pokemon that used Rage does NOT provide an Attack Boost + * Checks that Pokemon do not lose the {@linkcode RageTag} BattlerTag when sleeping. + */ it( "should not raise ATK if hit by status move", async () => { game.override - .enemySpecies(Species.NINJASK) - .enemyMoveset([Moves.RAGE, Moves.RAGE, Moves.RAGE, Moves.RAGE]); - await game.startBattle([Species.NINJASK]); + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.RAGE)); + await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; + const oppPokemon = game.scene.getEnemyPokemon()!; - // Ninjask Rages, then slept. No boost. + // Opponent Shuckle uses Rage. Ally Boltund uses Vital Throw. + // Shuckle gets an Attack boost + game.doAttack(3); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + + // Ally Boltund uses Spore. Shuckle is asleep. + // Shuckle does not get an attack boost. Shuckle still has the RageTag tag. game.doAttack(2); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(oppPokemon.getTag(RageTag)).toBeTruthy; + }, TIMEOUT + ); + + /** + * Checks that the {@linkcode RageTag} tag is not given if the target is immune + */ + it( + "should not raise ATK if target is immune", + async () => { + game.override + .enemySpecies(Species.GASTLY) + .enemyMoveset(fullOf(Moves.TACKLE)); // Has semi-invulnerable turn + await game.startBattle(); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Boltund uses rage, but it has no effect, Gastly uses Tackle + // Boltund does not have RageTag or Attack boost. + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeNull; + }, TIMEOUT + ); + + /** + * Checks that the {@linkcode RageTag} tag is not given if the target is semi-invulnerable + * Checks that Pokémon does not get Attack boost if it uses Rage after getting hit on a turn + */ + it( + "should not raise ATK if target is semi-invulnerable", + async () => { + game.override + .enemySpecies(Species.REGIELEKI) + .enemyMoveset(fullOf(Moves.DIVE)); // Has semi-invulnerable turn + await game.startBattle(); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Regieliki uses Dive. Boltund uses Rage, but Regieleki is underwater + // Boltund does not gain RageTag or Attack boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeNull; + + // Regieleki finishes Dive, Boltund uses Rage + // Boltund gains RageTag, but no boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; }, TIMEOUT ); it( - "should not raise ATK if rage has no effect", + "should not stop raging if rage fails", async () => { game.override - .enemySpecies(Species.GASTLY) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]) - .moveset([Moves.RAGE]); - await game.startBattle([Species.NINJASK]); + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.FLY)); // Has semi-invulnerable turn + await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; - // Ninjask uses rage, but it has no effect, no ATK boost + // Boltund uses Rage, Shuckle uses Dive + // Boltund gains RageTag game.doAttack(0); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + + // Boltund uses Rage, Shuckle is underwater, Shuckle finishes Dive + // Boltund gains gains boost, does not lose RageTag + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + },90000 + ); + + /** + * Basic doubles test + * Checks that if a raging Pokemon is hit multiple times in one turn, they get multiple boosts + * Should also cover multi-hit moves + */ + it( + "should provide boost per hit in doubles", + async () => { + game.override + .moveset([Moves.RAGE,Moves.MEMENTO,Moves.SPORE,Moves.VITAL_THROW]) + .battleType("double") + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.TACKLE)); + await game.startBattle([Species.BOLTUND,Species.BOLTUND]); + + const leadPokemon = game.scene.getParty()[0]; + + game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.ENEMY); + await game.phaseInterceptor.to(CommandPhase); + + game.doAttack(getMovePosition(game.scene, 1, Moves.MEMENTO)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.ENEMY_2); + + await game.phaseInterceptor.to(TurnEndPhase, false); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + }, TIMEOUT + ); + + /** + * Checks that a pokemon does not lose the RageTag if it is unable to act + * regardless of what it was otherwise going to do + */ + it( + "should stay raging if unable to act", + async () => { + game.override + .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE,Moves.VITAL_THROW]) + .battleType("double") + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.SPLASH)); // Has semi-invulnerable turn + await game.startBattle(); + + const leadPokemon: PlayerPokemon = game.scene.getParty()[0]; + // Ensure that second pokemon is faster. + leadPokemon.natureOverride = Nature.SASSY; + game.scene.getParty()[1].natureOverride = Nature.JOLLY; + + game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.ENEMY); + await game.phaseInterceptor.to(CommandPhase); + + game.doAttack(getMovePosition(game.scene, 1, Moves.SPORE)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.PLAYER); + + await game.phaseInterceptor.to(TurnEndPhase, false); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + expect(leadPokemon.status?.effect).toBe(StatusEffect.SLEEP); }, TIMEOUT ); }); From 3d8762c88acaa20409e328c9a0cad4f4e5eb5f95 Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 18:56:18 -0400 Subject: [PATCH 05/16] Updated unit tests --- src/test/moves/rage.test.ts | 235 ++++++++++++++++++++++++++++++------ 1 file changed, 197 insertions(+), 38 deletions(-) diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index 8d57006415d..f21414d10d5 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -5,9 +5,22 @@ import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import {BattleStat} from "#app/data/battle-stat"; +import {StatusEffect} from "#enums/status-effect"; +import {RageTag} from "#app/data/battler-tags"; +import {PlayerPokemon} from "#app/field/pokemon"; +import {Nature} from "#enums/nature"; +import {getMovePosition} from "#test/utils/gameManagerUtils"; +import {CommandPhase} from "#app/phases/command-phase"; +import {SelectTargetPhase} from "#app/phases/select-target-phase"; +import {BattlerIndex} from "#app/battle"; +import {TurnEndPhase} from "#app/phases/turn-end-phase"; + const TIMEOUT = 20 * 1000; +function fullOf(move: Moves) : Moves[] { + return [move,move,move,move]; +} describe("Moves - Rage", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -27,84 +40,230 @@ describe("Moves - Rage", () => { game.override .battleType("single") .ability(Abilities.UNNERVE) - .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE]) - .enemyAbility(Abilities.INSOMNIA) + .starterSpecies(Species.BOLTUND) + .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE,Moves.VITAL_THROW]) + .enemyAbility(Abilities.NO_GUARD) .startingLevel(100) - .enemyLevel(100); + .enemyLevel(100) + .disableCrits(); }); + /** + * Ally Attack-Boost Test. + * + * Checks that Rage provides an attack boost if the user it hit after use. + * + * Checks that Rage provides an attack boost if the user is hit before moving + * on the following turn, regardless of what move they selected. + * + * Checks that a pokemon stops raging if they use a different move. + */ it( "should raise attack if hit after use", async () => { game.override .enemySpecies(Species.SHUCKLE) - .enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]); - await game.startBattle([Species.NINJASK]); + .enemyMoveset(fullOf(Moves.TACKLE)); + await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; - // Ninjask uses rage, then gets hit, gets atk boost + // Player Boltund uses Rage. Opponent Shuckle uses Tackle. + // Boltund's attack is raised. game.doAttack(0); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). + // Boltund's attack is raised. + game.doAttack(3); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + + // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). + // Boltund's attack not raised. + game.doAttack(3); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + }, TIMEOUT ); - it( - "should raise ATK if hit before using non-rage option", - async () => { - game.override - .enemySpecies(Species.NINJASK) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); - await game.startBattle([Species.SHUCKLE]); - - const leadPokemon = game.scene.getPlayerPokemon()!; - - // Ninjask moves first, THEN shuckle uses rage, no ATK boost - game.doAttack(0); - await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); - - // Shuckle Raged last turn, so when Ninjask hits it, ATK boost despite not using rage this turn - game.doAttack(1); - await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); - }, TIMEOUT - ); - + /** + * Checks that Opponent Pokemon correctly receive the Attack boost from Rage + * Checks that using a Status Move on a Pokemon that used Rage does NOT provide an Attack Boost + * Checks that Pokemon do not lose the {@linkcode RageTag} BattlerTag when sleeping. + */ it( "should not raise ATK if hit by status move", async () => { game.override - .enemySpecies(Species.NINJASK) - .enemyMoveset([Moves.RAGE, Moves.RAGE, Moves.RAGE, Moves.RAGE]); - await game.startBattle([Species.NINJASK]); + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.RAGE)); + await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; + const oppPokemon = game.scene.getEnemyPokemon()!; - // Ninjask Rages, then slept. No boost. + // Opponent Shuckle uses Rage. Ally Boltund uses Vital Throw. + // Shuckle gets an Attack boost + game.doAttack(3); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + + // Ally Boltund uses Spore. Shuckle is asleep. + // Shuckle does not get an attack boost. Shuckle still has the RageTag tag. game.doAttack(2); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(oppPokemon.getTag(RageTag)).toBeTruthy; + }, TIMEOUT + ); + + /** + * Checks that the {@linkcode RageTag} tag is not given if the target is immune + */ + it( + "should not raise ATK if target is immune", + async () => { + game.override + .enemySpecies(Species.GASTLY) + .enemyMoveset(fullOf(Moves.TACKLE)); // Has semi-invulnerable turn + await game.startBattle(); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Boltund uses rage, but it has no effect, Gastly uses Tackle + // Boltund does not have RageTag or Attack boost. + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeNull; + }, TIMEOUT + ); + + /** + * Checks that the {@linkcode RageTag} tag is not given if the target is semi-invulnerable + * Checks that Pokémon does not get Attack boost if it uses Rage after getting hit on a turn + */ + it( + "should not raise ATK if target is semi-invulnerable", + async () => { + game.override + .enemySpecies(Species.REGIELEKI) + .enemyMoveset(fullOf(Moves.DIVE)); // Has semi-invulnerable turn + await game.startBattle(); + + const leadPokemon = game.scene.getPlayerPokemon()!; + + // Regieliki uses Dive. Boltund uses Rage, but Regieleki is underwater + // Boltund does not gain RageTag or Attack boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeNull; + + // Regieleki finishes Dive, Boltund uses Rage + // Boltund gains RageTag, but no boost + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; }, TIMEOUT ); it( - "should not raise ATK if rage has no effect", + "should not stop raging if rage fails", async () => { game.override - .enemySpecies(Species.GASTLY) - .enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]) - .moveset([Moves.RAGE]); - await game.startBattle([Species.NINJASK]); + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.FLY)); // Has semi-invulnerable turn + await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; - // Ninjask uses rage, but it has no effect, no ATK boost + // Boltund uses Rage, Shuckle uses Dive + // Boltund gains RageTag game.doAttack(0); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + + // Boltund uses Rage, Shuckle is underwater, Shuckle finishes Dive + // Boltund gains gains boost, does not lose RageTag + game.doAttack(0); + await game.toNextTurn(); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + },TIMEOUT + ); + + /** + * Basic doubles test + * Checks that if a raging Pokemon is hit multiple times in one turn, they get multiple boosts + * Should also cover multi-hit moves + */ + it( + "should provide boost per hit in doubles", + async () => { + game.override + .moveset([Moves.RAGE,Moves.MEMENTO,Moves.SPORE,Moves.VITAL_THROW]) + .battleType("double") + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.TACKLE)); + await game.startBattle([Species.BOLTUND,Species.BOLTUND]); + + const leadPokemon = game.scene.getParty()[0]; + + game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.ENEMY); + await game.phaseInterceptor.to(CommandPhase); + + game.doAttack(getMovePosition(game.scene, 1, Moves.MEMENTO)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.ENEMY_2); + + await game.phaseInterceptor.to(TurnEndPhase, false); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + }, TIMEOUT + ); + + /** + * Checks that a pokemon does not lose the RageTag if it is unable to act + * regardless of what it was otherwise going to do + */ + it( + "should stay raging if unable to act", + async () => { + game.override + .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE,Moves.VITAL_THROW]) + .battleType("double") + .enemySpecies(Species.SHUCKLE) + .enemyMoveset(fullOf(Moves.SPLASH)); // Has semi-invulnerable turn + await game.startBattle(); + + const leadPokemon: PlayerPokemon = game.scene.getParty()[0]; + // Ensure that second pokemon is faster. + leadPokemon.natureOverride = Nature.SASSY; + game.scene.getParty()[1].natureOverride = Nature.JOLLY; + + game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.ENEMY); + await game.phaseInterceptor.to(CommandPhase); + + game.doAttack(getMovePosition(game.scene, 1, Moves.SPORE)); + await game.phaseInterceptor.to(SelectTargetPhase, false); + game.doSelectTarget(BattlerIndex.PLAYER); + + await game.phaseInterceptor.to(TurnEndPhase, false); + expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getTag(RageTag)).toBeTruthy; + expect(leadPokemon.status?.effect).toBe(StatusEffect.SLEEP); }, TIMEOUT ); }); From 8a537844539a764ee483204ebb654a4b57418f1a Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 18:59:28 -0400 Subject: [PATCH 06/16] Updated unit tests --- src/test/moves/rage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index b4cdf4be408..f21414d10d5 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -197,7 +197,7 @@ describe("Moves - Rage", () => { await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); expect(leadPokemon.getTag(RageTag)).toBeTruthy; - },90000 + },TIMEOUT ); /** From 256ebc4c621ccd7604f94f0690178ea55dafabb1 Mon Sep 17 00:00:00 2001 From: Mason S <132116525+ElizaAlex@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:00:34 -0400 Subject: [PATCH 07/16] Apply suggestions from code review Added spacing inside of function calls Co-authored-by: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> --- src/data/battler-tags.ts | 2 +- src/data/move.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 28ec02e52ef..b558ed49f3a 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -220,7 +220,7 @@ export class RageTag extends BattlerTag { if (lapseType === BattlerTagLapseType.MOVE_EFFECT) { return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE; } else if (lapseType === BattlerTagLapseType.CUSTOM) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene,pokemon.getBattlerIndex(),true,[BattleStat.ATK],1,false)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK], 1, false)); pokemon.scene.queueMessage(i18next.t("battlerTags:rageOnHit", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)})); return true; diff --git a/src/data/move.ts b/src/data/move.ts index f6de9e2ec09..32923042d07 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6450,7 +6450,7 @@ export function initMoves() { .attr(StatChangeAttr, BattleStat.SPD, 2, true), new AttackMove(Moves.QUICK_ATTACK, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 1), new AttackMove(Moves.RAGE, Type.NORMAL, MoveCategory.PHYSICAL, 20, 100, 20, -1, 0, 1) - .attr(AddBattlerTagAttr,BattlerTagType.RAGE,true,false,0,0,false,true), + .attr(AddBattlerTagAttr, BattlerTagType.RAGE, true, false, 0, 0, false, true), new SelfStatusMove(Moves.TELEPORT, Type.PSYCHIC, -1, 20, -1, -6, 1) .attr(ForceSwitchOutAttr, true) .hidesUser(), From ea234f9ce142712a6651fb18d2b3dbe92db6c0ff Mon Sep 17 00:00:00 2001 From: Mason S <132116525+ElizaAlex@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:03:27 -0400 Subject: [PATCH 08/16] Add translations from localization team MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added pt_BR, it, and fr translations. Co-authored-by: Lugiad' Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira --- src/locales/fr/battler-tags.ts | 4 ++-- src/locales/it/battler-tags.ts | 4 ++-- src/locales/pt_BR/battler-tags.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/locales/fr/battler-tags.ts b/src/locales/fr/battler-tags.ts index 99d311535d4..1952154824b 100644 --- a/src/locales/fr/battler-tags.ts +++ b/src/locales/fr/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} sacrifie des PV\net lance une malédiction sur {{pokemonName}} !", "cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !", "stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." + "rageOnAdd": "La Frénésie s’empare\nde {{pokemonNameWithAffix}} !", + "rageOnHit": "La Frénésie de {{pokemonNameWithAffix}}\naugmente !" } as const; diff --git a/src/locales/it/battler-tags.ts b/src/locales/it/battler-tags.ts index 52b075e4c20..84f47531ae2 100644 --- a/src/locales/it/battler-tags.ts +++ b/src/locales/it/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} ha sacrificato metà dei suoi PS per\nlanciare una maledizione su {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." + "rageOnAdd":"{{pokemonNameWithAffix}} comincia ad accumulare ira!", + "rageOnHit": "L’ira di {{pokemonNameWithAffix}} aumenta!" } as const; diff --git a/src/locales/pt_BR/battler-tags.ts b/src/locales/pt_BR/battler-tags.ts index e9873426135..58d70b5e323 100644 --- a/src/locales/pt_BR/battler-tags.ts +++ b/src/locales/pt_BR/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cortou seus PS pela metade e amaldiçoou {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." + "rageOnAdd":"A raiva de {{pokemonNameWithAffix}} está começando a aumentar.", + "rageOnHit": "A raiva de {{pokemonNameWithAffix}} está aumentando." } as const; From ab6af5f224e9a3879dfef6c83ce19d3e1bb57fff Mon Sep 17 00:00:00 2001 From: Mason Date: Tue, 20 Aug 2024 19:14:36 -0400 Subject: [PATCH 09/16] Style changes --- src/locales/de/battler-tags.ts | 2 +- src/locales/en/battler-tags.ts | 2 +- src/locales/es/battler-tags.ts | 2 ++ src/locales/it/battler-tags.ts | 2 +- src/locales/ja/battler-tags.ts | 2 +- src/locales/ko/battler-tags.ts | 2 +- src/locales/pt_BR/battler-tags.ts | 2 +- src/locales/zh_CN/battler-tags.ts | 2 +- src/locales/zh_TW/battler-tags.ts | 2 +- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/locales/de/battler-tags.ts b/src/locales/de/battler-tags.ts index 44aaa283a97..ebaae1f7907 100644 --- a/src/locales/de/battler-tags.ts +++ b/src/locales/de/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} nimmt einen Teil seiner KP und legt einen Fluch auf {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/en/battler-tags.ts b/src/locales/en/battler-tags.ts index 7a2f56548d3..09cbbf7bb69 100644 --- a/src/locales/en/battler-tags.ts +++ b/src/locales/en/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/es/battler-tags.ts b/src/locales/es/battler-tags.ts index d0775efda08..ecc471909d9 100644 --- a/src/locales/es/battler-tags.ts +++ b/src/locales/es/battler-tags.ts @@ -70,4 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building.", } as const; diff --git a/src/locales/it/battler-tags.ts b/src/locales/it/battler-tags.ts index 84f47531ae2..108dcfa094d 100644 --- a/src/locales/it/battler-tags.ts +++ b/src/locales/it/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} ha sacrificato metà dei suoi PS per\nlanciare una maledizione su {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!", - "rageOnAdd":"{{pokemonNameWithAffix}} comincia ad accumulare ira!", + "rageOnAdd": "{{pokemonNameWithAffix}} comincia ad accumulare ira!", "rageOnHit": "L’ira di {{pokemonNameWithAffix}} aumenta!" } as const; diff --git a/src/locales/ja/battler-tags.ts b/src/locales/ja/battler-tags.ts index e822f83b60e..05c7c8d0592 100644 --- a/src/locales/ja/battler-tags.ts +++ b/src/locales/ja/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}は 自分の 体力を 削って\n{{pokemonName}}に のろいを かけた!", "cursedLapse": "{{pokemonNameWithAffix}}は のろわれている!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}は {{stockpiledCount}}つ たくわえた!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/ko/battler-tags.ts b/src/locales/ko/battler-tags.ts index 44d9f8bfceb..5f14738ae7a 100644 --- a/src/locales/ko/battler-tags.ts +++ b/src/locales/ko/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}[[는]] 자신의 체력을 깎아서\n{{pokemonName}}에게 저주를 걸었다!", "cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/pt_BR/battler-tags.ts b/src/locales/pt_BR/battler-tags.ts index 58d70b5e323..bf551281f1e 100644 --- a/src/locales/pt_BR/battler-tags.ts +++ b/src/locales/pt_BR/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cortou seus PS pela metade e amaldiçoou {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!", - "rageOnAdd":"A raiva de {{pokemonNameWithAffix}} está começando a aumentar.", + "rageOnAdd": "A raiva de {{pokemonNameWithAffix}} está começando a aumentar.", "rageOnHit": "A raiva de {{pokemonNameWithAffix}} está aumentando." } as const; diff --git a/src/locales/zh_CN/battler-tags.ts b/src/locales/zh_CN/battler-tags.ts index 5e0d1e3c614..7e7599240cc 100644 --- a/src/locales/zh_CN/battler-tags.ts +++ b/src/locales/zh_CN/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}削减了自己的体力,\n并诅咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; diff --git a/src/locales/zh_TW/battler-tags.ts b/src/locales/zh_TW/battler-tags.ts index fbc4c86b712..4c231f1c104 100644 --- a/src/locales/zh_TW/battler-tags.ts +++ b/src/locales/zh_TW/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd":"{{pokemonNameWithAffix}}'s rage is starting to build.", + "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." } as const; From 1a07c7b2f999e7c5112abdc7eed041b0606ab892 Mon Sep 17 00:00:00 2001 From: Mason S <132116525+ElizaAlex@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:32:09 -0400 Subject: [PATCH 10/16] Update src/locales/zh_CN/battler-tags.ts Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> --- src/locales/zh_CN/battler-tags.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/zh_CN/battler-tags.ts b/src/locales/zh_CN/battler-tags.ts index 7e7599240cc..1971a6a78e7 100644 --- a/src/locales/zh_CN/battler-tags.ts +++ b/src/locales/zh_CN/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}削减了自己的体力,\n并诅咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!", - "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." + "rageOnAdd": "{{pokemonNameWithAffix}}的\n怒气开始上升了。", + "rageOnHit": "{{pokemonNameWithAffix}}的\n怒气正在上升!." } as const; From 164598219086981c8038916b801d594777413502 Mon Sep 17 00:00:00 2001 From: Mason S <132116525+ElizaAlex@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:33:49 -0400 Subject: [PATCH 11/16] Update src/test/moves/rage.test.ts Co-authored-by: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> --- src/test/moves/rage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index f21414d10d5..2e56919b003 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -213,7 +213,7 @@ describe("Moves - Rage", () => { .battleType("double") .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.TACKLE)); - await game.startBattle([Species.BOLTUND,Species.BOLTUND]); + await game.startBattle([Species.BOLTUND, Species.BOLTUND]); const leadPokemon = game.scene.getParty()[0]; From 447b75cd90e393b95d84ab6ec5ba9fbfb8a02c04 Mon Sep 17 00:00:00 2001 From: Mason S <132116525+ElizaAlex@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:35:42 -0400 Subject: [PATCH 12/16] Update rage.test.ts --- src/test/moves/rage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index 2e56919b003..ddb26983a0b 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -41,7 +41,7 @@ describe("Moves - Rage", () => { .battleType("single") .ability(Abilities.UNNERVE) .starterSpecies(Species.BOLTUND) - .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE,Moves.VITAL_THROW]) + .moveset([Moves.RAGE, Moves.SPLASH, Moves.SPORE, Moves.VITAL_THROW]) .enemyAbility(Abilities.NO_GUARD) .startingLevel(100) .enemyLevel(100) From 9de4d47784130934911dce5c8b6fe187f5760cb6 Mon Sep 17 00:00:00 2001 From: Mason S <132116525+ElizaAlex@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:36:24 -0400 Subject: [PATCH 13/16] Apply suggestions from code review Co-authored-by: Asdar Co-authored-by: Enoch Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> Co-authored-by: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> --- src/locales/es/battler-tags.ts | 4 ++-- src/locales/ko/battler-tags.ts | 4 ++-- src/locales/zh_TW/battler-tags.ts | 4 ++-- src/test/moves/rage.test.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/locales/es/battler-tags.ts b/src/locales/es/battler-tags.ts index ecc471909d9..012fa3a6397 100644 --- a/src/locales/es/battler-tags.ts +++ b/src/locales/es/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building.", + "rageOnAdd": "¡La furia de {{pokemonNameWithAffix}} comienza a crecer!", + "rageOnHit": "¡La furia de {{pokemonNameWithAffix}} está aumentando!", } as const; diff --git a/src/locales/ko/battler-tags.ts b/src/locales/ko/battler-tags.ts index 5f14738ae7a..fb2275db0c7 100644 --- a/src/locales/ko/battler-tags.ts +++ b/src/locales/ko/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}[[는]] 자신의 체력을 깎아서\n{{pokemonName}}에게 저주를 걸었다!", "cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!", "stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!", - "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." + "rageOnAdd": "{{pokemonNameWithAffix}}[[는]]\n분노 볼티지를 쌓기 시작했다.", + "rageOnHit": "{{pokemonNameWithAffix}}의\n분노 볼티지가 올라가고 있다!", } as const; diff --git a/src/locales/zh_TW/battler-tags.ts b/src/locales/zh_TW/battler-tags.ts index 4c231f1c104..25a766f23d4 100644 --- a/src/locales/zh_TW/battler-tags.ts +++ b/src/locales/zh_TW/battler-tags.ts @@ -70,6 +70,6 @@ export const battlerTags: SimpleTranslationEntries = { "cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}!", "cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!", "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", - "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building." + "rageOnAdd": "{{pokemonNameWithAffix}}的\n怒氣開始上升了。", + "rageOnHit": "{{pokemonNameWithAffix}}的\n怒氣正在上升!" } as const; diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index ddb26983a0b..fc9523953b7 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -209,7 +209,7 @@ describe("Moves - Rage", () => { "should provide boost per hit in doubles", async () => { game.override - .moveset([Moves.RAGE,Moves.MEMENTO,Moves.SPORE,Moves.VITAL_THROW]) + .moveset([Moves.RAGE, Moves.MEMENTO, Moves.SPORE, Moves.VITAL_THROW]) .battleType("double") .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.TACKLE)); From fdca4359a04a28007c71c11fc7dfe3643f34f53e Mon Sep 17 00:00:00 2001 From: Mason Date: Thu, 22 Aug 2024 15:51:12 -0400 Subject: [PATCH 14/16] Added documentation to RageTag, fixed open quote, and updates test --- src/data/battler-tags.ts | 19 +++++++++++++ src/locales/de/battler-tags.ts | 2 +- src/test/moves/rage.test.ts | 50 ++++++++++++++-------------------- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 2bfcd16a86f..020f39c0e6d 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -205,10 +205,22 @@ export class ShellTrapTag extends BattlerTag { } } +/** + * BattlerTag implementing Rage + * Pokémon with this tag will recieve an attack boost when successfully damaged by an attacking move + * This tag will be lost if a target reaches the MOVE_EFFECT lapse condition with a move other than Rage + * @see {@link https://bulbapedia.bulbagarden.net/wiki/Rage_(move) | Rage} + */ export class RageTag extends BattlerTag { constructor() { super(BattlerTagType.RAGE,[BattlerTagLapseType.MOVE_EFFECT],1,Moves.RAGE); } + + /** + * Displays a message to show that the user has started Raging. + * This is message isn't displayed on cartridge, and was included for clarity during gameplay and while testing. + * @param pokemon {@linkcode Pokemon} the Pokémon this tag is being added to. + */ onAdd(pokemon: Pokemon) { super.onAdd(pokemon); /* This message might not exist on cartridge */ @@ -216,6 +228,13 @@ export class RageTag extends BattlerTag { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)})); } + /** + * Checks to maintain a Pokémon should maintain their rage, and provides an attack boost when hit. + * @param pokemon {@linkcode Pokemon} The owner of this tag + * @param lapseType {@linkcode BattlerTagLapseType} the type of functionality invoked in battle + * @returns `true` if invoked with the MOVE_EFFECT lapse type and {@linkcode pokemon} most recently used Rage, + * or if invoked with the CUSTOM lapse type. false otherwise. + */ lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { if (lapseType === BattlerTagLapseType.MOVE_EFFECT) { return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE; diff --git a/src/locales/de/battler-tags.ts b/src/locales/de/battler-tags.ts index 2be32f75ae2..543462399b4 100644 --- a/src/locales/de/battler-tags.ts +++ b/src/locales/de/battler-tags.ts @@ -68,7 +68,7 @@ export const battlerTags: SimpleTranslationEntries = { "saltCuredOnAdd": "{{pokemonNameWithAffix}} wurde eingepökelt!", "saltCuredLapse": "{{pokemonNameWithAffix}} wurde durch {{moveName}} verletzt!", "cursedOnAdd": "{{pokemonNameWithAffix}} nimmt einen Teil seiner KP und legt einen Fluch auf {{pokemonName}}!", - "stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!"", + "stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!", "rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.", "rageOnHit": "{{pokemonNameWithAffix}}'s rage is building.", } as const; diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index fc9523953b7..236e940ff2c 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -9,9 +9,7 @@ import {StatusEffect} from "#enums/status-effect"; import {RageTag} from "#app/data/battler-tags"; import {PlayerPokemon} from "#app/field/pokemon"; import {Nature} from "#enums/nature"; -import {getMovePosition} from "#test/utils/gameManagerUtils"; import {CommandPhase} from "#app/phases/command-phase"; -import {SelectTargetPhase} from "#app/phases/select-target-phase"; import {BattlerIndex} from "#app/battle"; import {TurnEndPhase} from "#app/phases/turn-end-phase"; @@ -42,7 +40,6 @@ describe("Moves - Rage", () => { .ability(Abilities.UNNERVE) .starterSpecies(Species.BOLTUND) .moveset([Moves.RAGE, Moves.SPLASH, Moves.SPORE, Moves.VITAL_THROW]) - .enemyAbility(Abilities.NO_GUARD) .startingLevel(100) .enemyLevel(100) .disableCrits(); @@ -70,19 +67,19 @@ describe("Moves - Rage", () => { // Player Boltund uses Rage. Opponent Shuckle uses Tackle. // Boltund's attack is raised. - game.doAttack(0); + game.move.select(Moves.RAGE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). // Boltund's attack is raised. - game.doAttack(3); + game.move.select(Moves.VITAL_THROW); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). // Boltund's attack not raised. - game.doAttack(3); + game.move.select(Moves.VITAL_THROW); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); @@ -107,14 +104,14 @@ describe("Moves - Rage", () => { // Opponent Shuckle uses Rage. Ally Boltund uses Vital Throw. // Shuckle gets an Attack boost - game.doAttack(3); + game.move.select(Moves.VITAL_THROW); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); // Ally Boltund uses Spore. Shuckle is asleep. // Shuckle does not get an attack boost. Shuckle still has the RageTag tag. - game.doAttack(2); + game.move.select(Moves.SPORE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); @@ -137,7 +134,7 @@ describe("Moves - Rage", () => { // Boltund uses rage, but it has no effect, Gastly uses Tackle // Boltund does not have RageTag or Attack boost. - game.doAttack(0); + game.move.select(Moves.RAGE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeNull; @@ -153,21 +150,21 @@ describe("Moves - Rage", () => { async () => { game.override .enemySpecies(Species.REGIELEKI) - .enemyMoveset(fullOf(Moves.DIVE)); // Has semi-invulnerable turn + .enemyMoveset(fullOf(Moves.PHANTOM_FORCE)); // Has semi-invulnerable turn await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; - // Regieliki uses Dive. Boltund uses Rage, but Regieleki is underwater + // Regieliki uses Fly. Boltund uses Rage, but Regieleki is invulnerable // Boltund does not gain RageTag or Attack boost - game.doAttack(0); + game.move.select(Moves.RAGE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeNull; - // Regieleki finishes Dive, Boltund uses Rage + // Regieleki finishes Fly, Boltund uses Rage // Boltund gains RageTag, but no boost - game.doAttack(0); + game.move.select(Moves.RAGE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeTruthy; @@ -179,21 +176,21 @@ describe("Moves - Rage", () => { async () => { game.override .enemySpecies(Species.SHUCKLE) - .enemyMoveset(fullOf(Moves.FLY)); // Has semi-invulnerable turn + .enemyMoveset(fullOf(Moves.PHANTOM_FORCE)); // Has semi-invulnerable turn await game.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; - // Boltund uses Rage, Shuckle uses Dive + // Boltund uses Rage, Shuckle uses Fly // Boltund gains RageTag - game.doAttack(0); + game.move.select(Moves.RAGE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeTruthy; // Boltund uses Rage, Shuckle is underwater, Shuckle finishes Dive // Boltund gains gains boost, does not lose RageTag - game.doAttack(0); + game.move.select(Moves.RAGE); await game.toNextTurn(); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); expect(leadPokemon.getTag(RageTag)).toBeTruthy; @@ -217,14 +214,11 @@ describe("Moves - Rage", () => { const leadPokemon = game.scene.getParty()[0]; - game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE)); - await game.phaseInterceptor.to(SelectTargetPhase, false); - game.doSelectTarget(BattlerIndex.ENEMY); + game.move.select(Moves.RAGE,1,BattlerIndex.ENEMY); await game.phaseInterceptor.to(CommandPhase); - game.doAttack(getMovePosition(game.scene, 1, Moves.MEMENTO)); - await game.phaseInterceptor.to(SelectTargetPhase, false); - game.doSelectTarget(BattlerIndex.ENEMY_2); + game.move.select(Moves.MEMENTO,1,BattlerIndex.ENEMY_2); + await game.phaseInterceptor.to(TurnEndPhase, false); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); @@ -251,14 +245,10 @@ describe("Moves - Rage", () => { leadPokemon.natureOverride = Nature.SASSY; game.scene.getParty()[1].natureOverride = Nature.JOLLY; - game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE)); - await game.phaseInterceptor.to(SelectTargetPhase, false); - game.doSelectTarget(BattlerIndex.ENEMY); + game.move.select(Moves.RAGE,1,BattlerIndex.ENEMY); await game.phaseInterceptor.to(CommandPhase); - game.doAttack(getMovePosition(game.scene, 1, Moves.SPORE)); - await game.phaseInterceptor.to(SelectTargetPhase, false); - game.doSelectTarget(BattlerIndex.PLAYER); + game.move.select(Moves.SPORE,1,BattlerIndex.PLAYER); await game.phaseInterceptor.to(TurnEndPhase, false); expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); From 24117d1136077d9e3a799236022e5c0c9371a26b Mon Sep 17 00:00:00 2001 From: Mason Date: Fri, 6 Sep 2024 13:56:57 -0400 Subject: [PATCH 15/16] Updated tests and localization to new framework/syntax --- src/data/battler-tags.ts | 4 +- src/enums/battler-tag-type.ts | 2 +- src/locales/es/battler-tags.json | 2 +- src/locales/es/battler-tags.ts | 75 -------------------------------- src/test/moves/rage.test.ts | 58 ++++++++++++------------ 5 files changed, 33 insertions(+), 108 deletions(-) delete mode 100644 src/locales/es/battler-tags.ts diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 74aef364a72..957370f357b 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -335,7 +335,7 @@ export class ShellTrapTag extends BattlerTag { */ export class RageTag extends BattlerTag { constructor() { - super(BattlerTagType.RAGE,[BattlerTagLapseType.MOVE_EFFECT],1,Moves.RAGE); + super(BattlerTagType.RAGE, [BattlerTagLapseType.MOVE_EFFECT], 1, Moves.RAGE); } /** @@ -361,7 +361,7 @@ export class RageTag extends BattlerTag { if (lapseType === BattlerTagLapseType.MOVE_EFFECT) { return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE; } else if (lapseType === BattlerTagLapseType.CUSTOM) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK], 1, false)); + pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK], 1, false)); pokemon.scene.queueMessage(i18next.t("battlerTags:rageOnHit", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)})); return true; diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index af10f7a8458..6bda0971bfb 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -73,5 +73,5 @@ export enum BattlerTagType { SHELL_TRAP = "SHELL_TRAP", RAGE = "RAGE", DRAGON_CHEER = "DRAGON_CHEER", - NO_RETREAT = "NO_RETREAT", + NO_RETREAT = "NO_RETREAT" } diff --git a/src/locales/es/battler-tags.json b/src/locales/es/battler-tags.json index 0805134239c..4171c961600 100644 --- a/src/locales/es/battler-tags.json +++ b/src/locales/es/battler-tags.json @@ -69,6 +69,6 @@ "cursedLapse": "¡{{pokemonNameWithAffix}} es víctima de una maldición!", "stockpilingOnAdd": "¡{{pokemonNameWithAffix}} ha reservado energía por {{stockpiledCount}}ª vez!", "rageOnAdd": "¡La furia de {{pokemonNameWithAffix}} comienza a crecer!", - "rageOnHit": "¡La furia de {{pokemonNameWithAffix}} está aumentando!", + "rageOnHit": "¡La furia de {{pokemonNameWithAffix}} está aumentando!" } diff --git a/src/locales/es/battler-tags.ts b/src/locales/es/battler-tags.ts deleted file mode 100644 index 012fa3a6397..00000000000 --- a/src/locales/es/battler-tags.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { SimpleTranslationEntries } from "#app/interfaces/locales"; - -export const battlerTags: SimpleTranslationEntries = { - "trappedDesc": "trapping", - "flinchedDesc": "flinching", - "confusedDesc": "confusion", - "infatuatedDesc": "infatuation", - "seedDesc": "seeding", - "nightmareDesc": "nightmares", - "ingrainDesc": "roots", - "drowsyDesc": "drowsiness", - "rechargingLapse": "{{pokemonNameWithAffix}} must\nrecharge!", - "trappedOnAdd": "{{pokemonNameWithAffix}} can no\nlonger escape!", - "trappedOnRemove": "{{pokemonNameWithAffix}} was freed\nfrom {{moveName}}!", - "flinchedLapse": "{{pokemonNameWithAffix}} flinched!", - "confusedOnAdd": "{{pokemonNameWithAffix}} became\nconfused!", - "confusedOnRemove": "{{pokemonNameWithAffix}} snapped\nout of confusion!", - "confusedOnOverlap": "{{pokemonNameWithAffix}} is\nalready confused!", - "confusedLapse": "{{pokemonNameWithAffix}} is\nconfused!", - "confusedLapseHurtItself": "It hurt itself in its\nconfusion!", - "destinyBondLapseIsBoss": "{{pokemonNameWithAffix}} is unaffected\nby the effects of Destiny Bond.", - "destinyBondLapse": "{{pokemonNameWithAffix}} took\n{{pokemonNameWithAffix2}} down with it!", - "infatuatedOnAdd": "{{pokemonNameWithAffix}} fell in love\nwith {{sourcePokemonName}}!", - "infatuatedOnOverlap": "{{pokemonNameWithAffix}} is\nalready in love!", - "infatuatedLapse": "{{pokemonNameWithAffix}} is in love\nwith {{sourcePokemonName}}!", - "infatuatedLapseImmobilize": "{{pokemonNameWithAffix}} is\nimmobilized by love!", - "infatuatedOnRemove": "{{pokemonNameWithAffix}} got over\nits infatuation.", - "seededOnAdd": "{{pokemonNameWithAffix}} was seeded!", - "seededLapse": "{{pokemonNameWithAffix}}'s health is\nsapped by Leech Seed!", - "seededLapseShed": "{{pokemonNameWithAffix}}'s Leech Seed\nsucked up the liquid ooze!", - "nightmareOnAdd": "{{pokemonNameWithAffix}} began\nhaving a Nightmare!", - "nightmareOnOverlap": "{{pokemonNameWithAffix}} is\nalready locked in a Nightmare!", - "nightmareLapse": "{{pokemonNameWithAffix}} is locked\nin a Nightmare!", - "encoreOnAdd": "{{pokemonNameWithAffix}} got\nan Encore!", - "encoreOnRemove": "{{pokemonNameWithAffix}}'s Encore\nended!", - "helpingHandOnAdd": "{{pokemonNameWithAffix}} is ready to\nhelp {{pokemonName}}!", - "ingrainLapse": "{{pokemonNameWithAffix}} absorbed\nnutrients with its roots!", - "ingrainOnTrap": "{{pokemonNameWithAffix}} planted its roots!", - "aquaRingOnAdd": "{{pokemonNameWithAffix}} surrounded\nitself with a veil of water!", - "aquaRingLapse": "{{moveName}} restored\n{{pokemonName}}'s HP!", - "drowsyOnAdd": "{{pokemonNameWithAffix}} grew drowsy!", - "damagingTrapLapse": "{{pokemonNameWithAffix}} is hurt\nby {{moveName}}!", - "bindOnTrap": "{{pokemonNameWithAffix}} was squeezed by\n{{sourcePokemonName}}'s {{moveName}}!", - "wrapOnTrap": "{{pokemonNameWithAffix}} was Wrapped\nby {{sourcePokemonName}}!", - "vortexOnTrap": "{{pokemonNameWithAffix}} was trapped\nin the vortex!", - "clampOnTrap": "{{sourcePokemonNameWithAffix}} Clamped\n{{pokemonName}}!", - "sandTombOnTrap": "{{pokemonNameWithAffix}} became trapped\nby {{moveName}}!", - "magmaStormOnTrap": "{{pokemonNameWithAffix}} became trapped\nby swirling magma!", - "snapTrapOnTrap": "{{pokemonNameWithAffix}} got trapped\nby a snap trap!", - "thunderCageOnTrap": "{{sourcePokemonNameWithAffix}} trapped\n{{pokemonNameWithAffix}}!", - "infestationOnTrap": "{{pokemonNameWithAffix}} has been afflicted \nwith an infestation by {{sourcePokemonNameWithAffix}}!", - "protectedOnAdd": "{{pokemonNameWithAffix}}\nprotected itself!", - "protectedLapse": "{{pokemonNameWithAffix}}\nprotected itself!", - "enduringOnAdd": "{{pokemonNameWithAffix}} braced\nitself!", - "enduringLapse": "{{pokemonNameWithAffix}} endured\nthe hit!", - "sturdyLapse": "{{pokemonNameWithAffix}} endured\nthe hit!", - "perishSongLapse": "{{pokemonNameWithAffix}}'s perish count fell to {{turnCount}}.", - "centerOfAttentionOnAdd": "{{pokemonNameWithAffix}} became the center\nof attention!", - "truantLapse": "{{pokemonNameWithAffix}} is\nloafing around!", - "slowStartOnAdd": "{{pokemonNameWithAffix}} can't\nget it going!", - "slowStartOnRemove": "{{pokemonNameWithAffix}} finally\ngot its act together!", - "highestStatBoostOnAdd": "{{pokemonNameWithAffix}}'s {{statName}}\nwas heightened!", - "highestStatBoostOnRemove": "The effects of {{pokemonNameWithAffix}}'s\n{{abilityName}} wore off!", - "magnetRisenOnAdd": "{{pokemonNameWithAffix}} levitated with electromagnetism!", - "magnetRisenOnRemove": "{{pokemonNameWithAffix}}'s electromagnetism wore off!", - "critBoostOnAdd": "{{pokemonNameWithAffix}} is getting\npumped!", - "critBoostOnRemove": "{{pokemonNameWithAffix}} relaxed.", - "saltCuredOnAdd": "{{pokemonNameWithAffix}} is being salt cured!", - "saltCuredLapse": "{{pokemonNameWithAffix}} is hurt by {{moveName}}!", - "cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!", - "cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!", - "stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!", - "rageOnAdd": "¡La furia de {{pokemonNameWithAffix}} comienza a crecer!", - "rageOnHit": "¡La furia de {{pokemonNameWithAffix}} está aumentando!", -} as const; diff --git a/src/test/moves/rage.test.ts b/src/test/moves/rage.test.ts index 236e940ff2c..d01618405b5 100644 --- a/src/test/moves/rage.test.ts +++ b/src/test/moves/rage.test.ts @@ -4,7 +4,6 @@ import GameManager from "#test/utils/gameManager"; import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; -import {BattleStat} from "#app/data/battle-stat"; import {StatusEffect} from "#enums/status-effect"; import {RageTag} from "#app/data/battler-tags"; import {PlayerPokemon} from "#app/field/pokemon"; @@ -12,12 +11,13 @@ import {Nature} from "#enums/nature"; import {CommandPhase} from "#app/phases/command-phase"; import {BattlerIndex} from "#app/battle"; import {TurnEndPhase} from "#app/phases/turn-end-phase"; +import {Stat} from "#enums/stat"; const TIMEOUT = 20 * 1000; function fullOf(move: Moves) : Moves[] { - return [move,move,move,move]; + return [move, move, move, move]; } describe("Moves - Rage", () => { let phaserGame: Phaser.Game; @@ -61,7 +61,7 @@ describe("Moves - Rage", () => { game.override .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.TACKLE)); - await game.startBattle(); + await game.classicMode.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -69,19 +69,19 @@ describe("Moves - Rage", () => { // Boltund's attack is raised. game.move.select(Moves.RAGE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(1); // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). // Boltund's attack is raised. game.move.select(Moves.VITAL_THROW); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(2); // Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority). // Boltund's attack not raised. game.move.select(Moves.VITAL_THROW); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(2); }, TIMEOUT ); @@ -97,7 +97,7 @@ describe("Moves - Rage", () => { game.override .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.RAGE)); - await game.startBattle(); + await game.classicMode.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; const oppPokemon = game.scene.getEnemyPokemon()!; @@ -106,15 +106,15 @@ describe("Moves - Rage", () => { // Shuckle gets an Attack boost game.move.select(Moves.VITAL_THROW); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(oppPokemon.getStatStage(Stat.ATK)).toBe(1); // Ally Boltund uses Spore. Shuckle is asleep. // Shuckle does not get an attack boost. Shuckle still has the RageTag tag. game.move.select(Moves.SPORE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); - expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); + expect(oppPokemon.getStatStage(Stat.ATK)).toBe(1); expect(oppPokemon.getTag(RageTag)).toBeTruthy; }, TIMEOUT ); @@ -128,7 +128,7 @@ describe("Moves - Rage", () => { game.override .enemySpecies(Species.GASTLY) .enemyMoveset(fullOf(Moves.TACKLE)); // Has semi-invulnerable turn - await game.startBattle(); + await game.classicMode.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -136,7 +136,7 @@ describe("Moves - Rage", () => { // Boltund does not have RageTag or Attack boost. game.move.select(Moves.RAGE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeNull; }, TIMEOUT ); @@ -151,7 +151,7 @@ describe("Moves - Rage", () => { game.override .enemySpecies(Species.REGIELEKI) .enemyMoveset(fullOf(Moves.PHANTOM_FORCE)); // Has semi-invulnerable turn - await game.startBattle(); + await game.classicMode.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -159,14 +159,14 @@ describe("Moves - Rage", () => { // Boltund does not gain RageTag or Attack boost game.move.select(Moves.RAGE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeNull; // Regieleki finishes Fly, Boltund uses Rage // Boltund gains RageTag, but no boost game.move.select(Moves.RAGE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeTruthy; }, TIMEOUT ); @@ -177,7 +177,7 @@ describe("Moves - Rage", () => { game.override .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.PHANTOM_FORCE)); // Has semi-invulnerable turn - await game.startBattle(); + await game.classicMode.startBattle(); const leadPokemon = game.scene.getPlayerPokemon()!; @@ -185,16 +185,16 @@ describe("Moves - Rage", () => { // Boltund gains RageTag game.move.select(Moves.RAGE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeTruthy; // Boltund uses Rage, Shuckle is underwater, Shuckle finishes Dive // Boltund gains gains boost, does not lose RageTag game.move.select(Moves.RAGE); await game.toNextTurn(); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(1); expect(leadPokemon.getTag(RageTag)).toBeTruthy; - },TIMEOUT + }, TIMEOUT ); /** @@ -210,18 +210,18 @@ describe("Moves - Rage", () => { .battleType("double") .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.TACKLE)); - await game.startBattle([Species.BOLTUND, Species.BOLTUND]); + await game.classicMode.startBattle([Species.BOLTUND, Species.BOLTUND]); const leadPokemon = game.scene.getParty()[0]; - game.move.select(Moves.RAGE,1,BattlerIndex.ENEMY); + game.move.select(Moves.RAGE, 1, BattlerIndex.ENEMY); await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.MEMENTO,1,BattlerIndex.ENEMY_2); + game.move.select(Moves.MEMENTO, 1, BattlerIndex.ENEMY_2); await game.phaseInterceptor.to(TurnEndPhase, false); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(2); expect(leadPokemon.getTag(RageTag)).toBeTruthy; }, TIMEOUT ); @@ -234,24 +234,24 @@ describe("Moves - Rage", () => { "should stay raging if unable to act", async () => { game.override - .moveset([Moves.RAGE,Moves.SPLASH,Moves.SPORE,Moves.VITAL_THROW]) + .moveset([Moves.RAGE, Moves.SPLASH, Moves.SPORE, Moves.VITAL_THROW]) .battleType("double") .enemySpecies(Species.SHUCKLE) .enemyMoveset(fullOf(Moves.SPLASH)); // Has semi-invulnerable turn - await game.startBattle(); + await game.classicMode.startBattle(); const leadPokemon: PlayerPokemon = game.scene.getParty()[0]; // Ensure that second pokemon is faster. leadPokemon.natureOverride = Nature.SASSY; game.scene.getParty()[1].natureOverride = Nature.JOLLY; - game.move.select(Moves.RAGE,1,BattlerIndex.ENEMY); + game.move.select(Moves.RAGE, 1, BattlerIndex.ENEMY); await game.phaseInterceptor.to(CommandPhase); - game.move.select(Moves.SPORE,1,BattlerIndex.PLAYER); + game.move.select(Moves.SPORE, 1, BattlerIndex.PLAYER); await game.phaseInterceptor.to(TurnEndPhase, false); - expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0); + expect(leadPokemon.getStatStage(Stat.ATK)).toBe(0); expect(leadPokemon.getTag(RageTag)).toBeTruthy; expect(leadPokemon.status?.effect).toBe(StatusEffect.SLEEP); }, TIMEOUT From 48b37307549d12c75704f5757f1b00b9d9a54d94 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:34:40 -0700 Subject: [PATCH 16/16] Fix merge issue --- src/locales/de/battler-tags.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/de/battler-tags.json b/src/locales/de/battler-tags.json index 5d1be475b66..5509cc11b0a 100644 --- a/src/locales/de/battler-tags.json +++ b/src/locales/de/battler-tags.json @@ -66,6 +66,6 @@ "saltCuredOnAdd": "{{pokemonNameWithAffix}} wurde eingepökelt!", "saltCuredLapse": "{{pokemonNameWithAffix}} wurde durch {{moveName}} verletzt!", "cursedOnAdd": "{{pokemonNameWithAffix}} nimmt einen Teil seiner KP und legt einen Fluch auf {{pokemonName}}!", - "stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!", - "cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!" -} + "cursedLapse": "{{pokemonNameWithAffix}} wurde durch den Fluch verletzt!", + "stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!" +} \ No newline at end of file