From 282b0c82154e11b6f8bc9e67559e4f7a2eec9b95 Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Sun, 1 Dec 2024 14:24:16 -0800 Subject: [PATCH 1/4] Added features to prevent test flakiness. (#4959) Co-authored-by: frutescens --- src/test/abilities/serene_grace.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/abilities/serene_grace.test.ts b/src/test/abilities/serene_grace.test.ts index a19b5c82546..6f9b2195a9c 100644 --- a/src/test/abilities/serene_grace.test.ts +++ b/src/test/abilities/serene_grace.test.ts @@ -25,10 +25,13 @@ describe("Abilities - Serene Grace", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override + .disableCrits() .battleType("single") .ability(Abilities.SERENE_GRACE) - .moveset([ Moves.AIR_SLASH, Moves.TACKLE ]) + .moveset([ Moves.AIR_SLASH ]) + .enemySpecies(Species.ALOLA_GEODUDE) .enemyLevel(10) + .enemyAbility(Abilities.BALL_FETCH) .enemyMoveset([ Moves.SPLASH ]); }); From 0556e1ad50e4c1b606242561e71861cdf7452748 Mon Sep 17 00:00:00 2001 From: "Amani H." <109637146+xsn34kzx@users.noreply.github.com> Date: Sun, 1 Dec 2024 17:24:47 -0500 Subject: [PATCH 2/4] [Balance] Adjust Flame/Toxic Orb Weight Functions (#4954) * [Balance] Adjust Flame/Toxic Orb Weight Functions * Adjust Booleans * Add Documentation * Implement More Granularity * Minor `if` Change --- src/field/pokemon.ts | 15 +++++++-- src/modifier/modifier-type.ts | 62 ++++++++++++++++++++++++++++------- 2 files changed, 63 insertions(+), 14 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 6aa4bd46a68..accd39e1f94 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3501,12 +3501,21 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this.gender !== Gender.GENDERLESS && pokemon.gender === (this.gender === Gender.MALE ? Gender.FEMALE : Gender.MALE); } - canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean { + /** + * Checks if a status effect can be applied to the Pokemon. + * + * @param effect The {@linkcode StatusEffect} whose applicability is being checked + * @param quiet Whether in-battle messages should trigger or not + * @param overrideStatus Whether the Pokemon's current status can be overriden + * @param sourcePokemon The Pokemon that is setting the status effect + * @param ignoreField Whether any field effects (weather, terrain, etc.) should be considered + */ + canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null, ignoreField: boolean = false): boolean { if (effect !== StatusEffect.FAINT) { if (overrideStatus ? this.status?.effect === effect : this.status) { return false; } - if (this.isGrounded() && this.scene.arena.terrain?.terrainType === TerrainType.MISTY) { + if (this.isGrounded() && (!ignoreField && this.scene.arena.terrain?.terrainType === TerrainType.MISTY)) { return false; } } @@ -3556,7 +3565,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } break; case StatusEffect.FREEZE: - if (this.isOfType(Type.ICE) || (this.scene?.arena?.weather?.weatherType && [ WeatherType.SUNNY, WeatherType.HARSH_SUN ].includes(this.scene.arena.weather.weatherType))) { + if (this.isOfType(Type.ICE) || (!ignoreField && (this.scene?.arena?.weather?.weatherType && [ WeatherType.SUNNY, WeatherType.HARSH_SUN ].includes(this.scene.arena.weather.weatherType)))) { return false; } break; diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 04776afc624..57b3ced1813 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1751,19 +1751,59 @@ const modifierPool: ModifierPool = { || (p.isFusion() && checkedSpecies.includes(p.getFusionSpeciesForm(true).speciesId)))) ? 12 : 0; }, 12), new WeightedModifierType(modifierTypes.TOXIC_ORB, (party: Pokemon[]) => { - const checkedAbilities = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.TOXIC_BOOST, Abilities.POISON_HEAL, Abilities.MAGIC_GUARD ]; - const checkedMoves = [ Moves.FACADE, Moves.TRICK, Moves.FLING, Moves.SWITCHEROO, Moves.PSYCHO_SHIFT ]; - // If a party member doesn't already have one of these two orbs and has one of the above moves or abilities, the orb can appear - return party.some(p => !p.getHeldItems().some(i => i instanceof TurnStatusEffectModifier) - && (checkedAbilities.some(a => p.hasAbility(a, false, true)) - || p.getMoveset(true).some(m => m && checkedMoves.includes(m.moveId)))) ? 10 : 0; + return party.some(p => { + const moveset = p.getMoveset(true).filter(m => !isNullOrUndefined(m)).map(m => m.moveId); + + const canSetStatus = p.canSetStatus(StatusEffect.TOXIC, true, true, null, true); + const isHoldingOrb = p.getHeldItems().some(i => i.type.id === "FLAME_ORB" || i.type.id === "TOXIC_ORB"); + + // Moves that take advantage of obtaining the actual status effect + const hasStatusMoves = [ Moves.FACADE, Moves.PSYCHO_SHIFT ] + .some(m => moveset.includes(m)); + // Moves that take advantage of being able to give the target a status orb + // TODO: Take moves from comment they are implemented + const hasItemMoves = [ /* Moves.TRICK, Moves.FLING, Moves.SWITCHEROO */ ] + .some(m => moveset.includes(m)); + // Abilities that take advantage of obtaining the actual status effect + const hasRelevantAbilities = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.TOXIC_BOOST, Abilities.POISON_HEAL, Abilities.MAGIC_GUARD ] + .some(a => p.hasAbility(a, false, true)); + + if (!isHoldingOrb) { + if (canSetStatus) { + return hasRelevantAbilities || hasStatusMoves; + } else { + return hasItemMoves; + } + } + return false; + }) ? 10 : 0; }, 10), new WeightedModifierType(modifierTypes.FLAME_ORB, (party: Pokemon[]) => { - const checkedAbilities = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.FLARE_BOOST, Abilities.MAGIC_GUARD ]; - const checkedMoves = [ Moves.FACADE, Moves.TRICK, Moves.FLING, Moves.SWITCHEROO, Moves.PSYCHO_SHIFT ]; - // If a party member doesn't already have one of these two orbs and has one of the above moves or abilities, the orb can appear - return party.some(p => !p.getHeldItems().some(i => i instanceof TurnStatusEffectModifier) - && (checkedAbilities.some(a => p.hasAbility(a, false, true)) || p.getMoveset(true).some(m => m && checkedMoves.includes(m.moveId)))) ? 10 : 0; + return party.some(p => { + const moveset = p.getMoveset(true).filter(m => !isNullOrUndefined(m)).map(m => m.moveId); + const canSetStatus = p.canSetStatus(StatusEffect.BURN, true, true, null, true); + const isHoldingOrb = p.getHeldItems().some(i => i.type.id === "FLAME_ORB" || i.type.id === "TOXIC_ORB"); + + // Moves that take advantage of obtaining the actual status effect + const hasStatusMoves = [ Moves.FACADE, Moves.PSYCHO_SHIFT ] + .some(m => moveset.includes(m)); + // Moves that take advantage of being able to give the target a status orb + // TODO: Take moves from comment they are implemented + const hasItemMoves = [ /* Moves.TRICK, Moves.FLING, Moves.SWITCHEROO */ ] + .some(m => moveset.includes(m)); + // Abilities that take advantage of obtaining the actual status effect + const hasRelevantAbilities = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.FLARE_BOOST, Abilities.MAGIC_GUARD ] + .some(a => p.hasAbility(a, false, true)); + + if (!isHoldingOrb) { + if (canSetStatus) { + return hasRelevantAbilities || hasStatusMoves; + } else { + return hasItemMoves; + } + } + return false; + }) ? 10 : 0; }, 10), new WeightedModifierType(modifierTypes.WHITE_HERB, (party: Pokemon[]) => { const checkedAbilities = [ Abilities.WEAK_ARMOR, Abilities.CONTRARY, Abilities.MOODY, Abilities.ANGER_SHELL, Abilities.COMPETITIVE, Abilities.DEFIANT ]; From 1607a694c3795148b7ad9b87765e645c584780c3 Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Sun, 1 Dec 2024 17:27:17 -0500 Subject: [PATCH 3/4] [Move] Partially Implement Instruct (#4857) Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> --- src/battle-scene.ts | 18 ++ src/data/move.ts | 123 ++++++++++- src/field/pokemon.ts | 6 + src/phases/move-effect-phase.ts | 10 +- src/test/moves/instruct.test.ts | 315 +++++++++++++++++++++++++++ src/test/utils/helpers/moveHelper.ts | 19 ++ 6 files changed, 489 insertions(+), 2 deletions(-) create mode 100644 src/test/moves/instruct.test.ts diff --git a/src/battle-scene.ts b/src/battle-scene.ts index f5e3a714df6..c430a12ae3e 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2469,6 +2469,24 @@ export default class BattleScene extends SceneBase { } } + /** + * Tries to add the input phase to index after target phase in the {@linkcode phaseQueue}, else simply calls {@linkcode unshiftPhase()} + * @param phase {@linkcode Phase} the phase to be added + * @param targetPhase {@linkcode Phase} the type of phase to search for in {@linkcode phaseQueue} + * @returns `true` if a `targetPhase` was found to append to + */ + appendToPhase(phase: Phase, targetPhase: Constructor): boolean { + const targetIndex = this.phaseQueue.findIndex(ph => ph instanceof targetPhase); + + if (targetIndex !== -1 && this.phaseQueue.length > targetIndex) { + this.phaseQueue.splice(targetIndex + 1, 0, phase); + return true; + } else { + this.unshiftPhase(phase); + return false; + } + } + /** * Adds a MessagePhase, either to PhaseQueuePrepend or nextCommandPhaseQueue * @param message string for MessagePhase diff --git a/src/data/move.ts b/src/data/move.ts index 166058178f5..b4c519c5bcf 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6728,6 +6728,126 @@ export class CopyMoveAttr extends OverrideMoveEffectAttr { } } +/** + * Attribute used for moves that causes the target to repeat their last used move. + * + * Used for [Instruct](https://bulbapedia.bulbagarden.net/wiki/Instruct_(move)). +*/ +export class RepeatMoveAttr extends MoveEffectAttr { + constructor() { + super(false, { trigger: MoveEffectTrigger.POST_APPLY }); // needed to ensure correct protect interaction + } + + /** + * Forces the target to re-use their last used move again + * + * @param user {@linkcode Pokemon} that used the attack + * @param target {@linkcode Pokemon} targeted by the attack + * @param move N/A + * @param args N/A + * @returns `true` if the move succeeds + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + // get the last move used (excluding status based failures) as well as the corresponding moveset slot + const lastMove = target.getLastXMoves(-1).find(m => m.move !== Moves.NONE)!; + const movesetMove = target.getMoveset().find(m => m?.moveId === lastMove.move)!; + const moveTargets = lastMove.targets ?? []; + + user.scene.queueMessage(i18next.t("moveTriggers:instructingMove", { + userPokemonName: getPokemonNameWithAffix(user), + targetPokemonName: getPokemonNameWithAffix(target) + })); + target.getMoveQueue().unshift({ move: lastMove.move, targets: moveTargets, ignorePP: false }); + target.turnData.extraTurns++; + target.scene.appendToPhase(new MovePhase(target.scene, target, moveTargets, movesetMove), MoveEndPhase); + return true; + } + + getCondition(): MoveConditionFunc { + return (user, target, move) => { + // TODO: Confirm behavior of instructing move known by target but called by another move + const lastMove = target.getLastXMoves(-1).find(m => m.move !== Moves.NONE); + const movesetMove = target.getMoveset().find(m => m?.moveId === lastMove?.move); + const moveTargets = lastMove?.targets ?? []; + // TODO: Add a way of adding moves to list procedurally rather than a pre-defined blacklist + const unrepeatablemoves = [ + // Locking/Continually Executed moves + Moves.OUTRAGE, + Moves.RAGING_FURY, + Moves.ROLLOUT, + Moves.PETAL_DANCE, + Moves.THRASH, + Moves.ICE_BALL, + // Multi-turn Moves + Moves.BIDE, + Moves.SHELL_TRAP, + Moves.BEAK_BLAST, + Moves.FOCUS_PUNCH, + // "First Turn Only" moves + Moves.FAKE_OUT, + Moves.FIRST_IMPRESSION, + Moves.MAT_BLOCK, + // Moves with a recharge turn + Moves.HYPER_BEAM, + Moves.ETERNABEAM, + Moves.FRENZY_PLANT, + Moves.BLAST_BURN, + Moves.HYDRO_CANNON, + Moves.GIGA_IMPACT, + Moves.PRISMATIC_LASER, + Moves.ROAR_OF_TIME, + Moves.ROCK_WRECKER, + Moves.METEOR_ASSAULT, + // Charging & 2-turn moves + Moves.DIG, + Moves.FLY, + Moves.BOUNCE, + Moves.SHADOW_FORCE, + Moves.PHANTOM_FORCE, + Moves.DIVE, + Moves.ELECTRO_SHOT, + Moves.ICE_BURN, + Moves.GEOMANCY, + Moves.FREEZE_SHOCK, + Moves.SKY_DROP, + Moves.SKY_ATTACK, + Moves.SKULL_BASH, + Moves.SOLAR_BEAM, + Moves.SOLAR_BLADE, + Moves.METEOR_BEAM, + // Other moves + Moves.INSTRUCT, + Moves.KINGS_SHIELD, + Moves.SKETCH, + Moves.TRANSFORM, + Moves.MIMIC, + Moves.STRUGGLE, + // TODO: Add Max/G-Move blockage if or when they are implemented + ]; + + if (!movesetMove // called move not in target's moveset (dancer, forgetting the move, etc.) + || movesetMove.ppUsed === movesetMove.getMovePp() // move out of pp + || allMoves[lastMove?.move ?? Moves.NONE].isChargingMove() // called move is a charging/recharging move + || !moveTargets.length // called move has no targets + || unrepeatablemoves.includes(lastMove?.move ?? Moves.NONE)) { // called move is explicitly in the banlist + return false; + } + return true; + }; + } + + getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { + // TODO: Make the AI acutally use instruct + /* Ideally, the AI would score instruct based on the scorings of the on-field pokemons' + * last used moves at the time of using Instruct (by the time the instructor gets to act) + * with respect to the user's side. + * In 99.9% of cases, this would be the pokemon's ally (unless the target had last + * used a move like Decorate on the user or its ally) + */ + return 2; + } +} + /** * Attribute used for moves that reduce PP of the target's last used move. * Used for Spite. @@ -9892,7 +10012,8 @@ export function initMoves() { .attr(StatStageChangeAttr, [ Stat.ATK ], -1), new StatusMove(Moves.INSTRUCT, Type.PSYCHIC, -1, 15, -1, 0, 7) .ignoresSubstitute() - .unimplemented(), + .attr(RepeatMoveAttr) + .edgeCase(), // incorrect interactions with Gigaton Hammer, Blood Moon & Torment new AttackMove(Moves.BEAK_BLAST, Type.FLYING, MoveCategory.PHYSICAL, 100, 100, 15, -1, -3, 7) .attr(BeakBlastHeaderAttr) .ballBombMove() diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index accd39e1f94..fcfc2ff7536 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5294,6 +5294,7 @@ export class PokemonBattleSummonData { export class PokemonTurnData { public flinched: boolean = false; public acted: boolean = false; + /** How many times the move should hit the target(s) */ public hitCount: number = 0; /** * - `-1` = Calculate how many hits are left @@ -5312,6 +5313,11 @@ export class PokemonTurnData { public switchedInThisTurn: boolean = false; public failedRunAway: boolean = false; public joinedRound: boolean = false; + /** + * Used to make sure multi-hits occur properly when the user is + * forced to act again in the same turn + */ + public extraTurns: number = 0; } export enum AiType { diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index ea45dc2b9e2..96ded602b30 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -127,6 +127,14 @@ export class MoveEffectPhase extends PokemonPhase { user.lapseTags(BattlerTagLapseType.MOVE_EFFECT); + // If the user is acting again (such as due to Instruct), reset hitsLeft/hitCount so that + // the move executes correctly (ensures all hits of a multi-hit are properly calculated) + if (user.turnData.hitsLeft === 0 && user.turnData.hitCount > 0 && user.turnData.extraTurns > 0) { + user.turnData.hitsLeft = -1; + user.turnData.hitCount = 0; + user.turnData.extraTurns--; + } + /** * If this phase is for the first hit of the invoked move, * resolve the move's total hit count. This block combines the @@ -313,7 +321,7 @@ export class MoveEffectPhase extends PokemonPhase { } /** - * Create a Promise that applys *all* effects from the invoked move's MoveEffectAttrs. + * Create a Promise that applies *all* effects from the invoked move's MoveEffectAttrs. * These are ordered by trigger type (see {@linkcode MoveEffectTrigger}), and each trigger * type requires different conditions to be met with respect to the move's hit result. */ diff --git a/src/test/moves/instruct.test.ts b/src/test/moves/instruct.test.ts new file mode 100644 index 00000000000..0e227ef6a3f --- /dev/null +++ b/src/test/moves/instruct.test.ts @@ -0,0 +1,315 @@ +import { BattlerIndex } from "#app/battle"; +import type Pokemon from "#app/field/pokemon"; +import { MoveResult } from "#app/field/pokemon"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/utils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; + +describe("Moves - Instruct", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + function instructSuccess(pokemon: Pokemon, move: Moves): void { + expect(pokemon.getLastXMoves(-1)[0].move).toBe(move); + expect(pokemon.getLastXMoves(-1)[1].move).toBe(pokemon.getLastXMoves()[0].move); + expect(pokemon.getMoveset().find(m => m?.moveId === move)?.ppUsed).toBe(2); + } + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .battleType("single") + .enemySpecies(Species.SHUCKLE) + .enemyAbility(Abilities.NO_GUARD) + .enemyLevel(100) + .startingLevel(100) + .ability(Abilities.BALL_FETCH) + .moveset([ Moves.INSTRUCT, Moves.SONIC_BOOM, Moves.SPLASH, Moves.TORMENT ]) + .disableCrits(); + }); + + it("should repeat enemy's attack move when moving last", async () => { + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + const enemy = game.scene.getEnemyPokemon()!; + game.move.changeMoveset(enemy, Moves.SONIC_BOOM); + + game.move.select(Moves.INSTRUCT, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + await game.forceEnemyMove(Moves.SONIC_BOOM, BattlerIndex.PLAYER); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(game.scene.getPlayerPokemon()?.getInverseHp()).toBe(40); + instructSuccess(enemy, Moves.SONIC_BOOM); + }); + + it("should repeat enemy's move through substitute", async () => { + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + const enemy = game.scene.getEnemyPokemon()!; + game.move.changeMoveset(enemy, [ Moves.SONIC_BOOM, Moves.SUBSTITUTE ]); + + game.move.select(Moves.SPLASH); + await game.forceEnemyMove(Moves.SUBSTITUTE); + await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); + await game.toNextTurn(); + + game.move.select(Moves.INSTRUCT); + await game.forceEnemyMove(Moves.SONIC_BOOM); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(game.scene.getPlayerPokemon()?.getInverseHp()).toBe(40); + instructSuccess(game.scene.getEnemyPokemon()!, Moves.SONIC_BOOM); + }); + + it("should repeat ally's attack on enemy", async () => { + game.override + .battleType("double") + .moveset([]); + await game.classicMode.startBattle([ Species.AMOONGUSS, Species.SHUCKLE ]); + + const [ amoonguss, shuckle ] = game.scene.getPlayerField(); + game.move.changeMoveset(amoonguss, Moves.INSTRUCT); + game.move.changeMoveset(shuckle, Moves.SONIC_BOOM); + + game.move.select(Moves.INSTRUCT, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2); + game.move.select(Moves.SONIC_BOOM, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY); + await game.forceEnemyMove(Moves.SPLASH); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2 ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(game.scene.getEnemyField()[0].getInverseHp()).toBe(40); + instructSuccess(shuckle, Moves.SONIC_BOOM); + }); + + // TODO: Enable test case once gigaton hammer (and blood moon) is fixed + it.todo("should repeat enemy's Gigaton Hammer", async () => { + game.override + .enemyLevel(5); + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + const enemy = game.scene.getEnemyPokemon()!; + game.move.changeMoveset(enemy, Moves.GIGATON_HAMMER); + + game.move.select(Moves.INSTRUCT); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + instructSuccess(enemy, Moves.GIGATON_HAMMER); + }); + + it("should respect enemy's status condition", async () => { + game.override + .moveset([ Moves.THUNDER_WAVE, Moves.INSTRUCT ]) + .enemyMoveset([ Moves.SPLASH, Moves.SONIC_BOOM ]); + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + game.move.select(Moves.THUNDER_WAVE); + await game.forceEnemyMove(Moves.SONIC_BOOM); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.toNextTurn(); + + game.move.select(Moves.INSTRUCT); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.move.forceStatusActivation(true); + await game.phaseInterceptor.to("MovePhase"); + await game.move.forceStatusActivation(false); + await game.phaseInterceptor.to("TurnEndPhase", false); + + const moveHistory = game.scene.getEnemyPokemon()!.getMoveHistory(); + expect(moveHistory.length).toBe(3); + expect(moveHistory[0].move).toBe(Moves.SONIC_BOOM); + expect(moveHistory[1].move).toBe(Moves.NONE); + expect(moveHistory[2].move).toBe(Moves.SONIC_BOOM); + }); + + it("should not repeat enemy's out of pp move", async () => { + game.override.enemySpecies(Species.UNOWN); + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + game.move.changeMoveset(enemyPokemon, Moves.HIDDEN_POWER); + const moveUsed = enemyPokemon.moveset.find(m => m?.moveId === Moves.HIDDEN_POWER)!; + moveUsed.ppUsed = moveUsed.getMovePp() - 1; + + game.move.select(Moves.INSTRUCT); + await game.forceEnemyMove(Moves.HIDDEN_POWER); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + const playerMove = game.scene.getPlayerPokemon()!.getLastXMoves()!; + expect(playerMove[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.getMoveHistory().length).toBe(1); + }); + + it("should fail if no move has yet been used by target", async () => { + game.override.enemyMoveset(Moves.SPLASH); + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + game.move.select(Moves.INSTRUCT); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + }); + + it("should attempt to call enemy's disabled move, but move use itself should fail", async () => { + game.override + .moveset([ Moves.INSTRUCT, Moves.DISABLE ]) + .battleType("double"); + await game.classicMode.startBattle([ Species.AMOONGUSS, Species.DROWZEE ]); + + const [ enemy1, enemy2 ] = game.scene.getEnemyField(); + game.move.changeMoveset(enemy1, Moves.SONIC_BOOM); + game.move.changeMoveset(enemy2, Moves.SPLASH); + + game.move.select(Moves.INSTRUCT, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.select(Moves.DISABLE, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY); + await game.forceEnemyMove(Moves.SONIC_BOOM, BattlerIndex.PLAYER); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY_2 ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(game.scene.getPlayerField()[0].getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + const enemyMove = game.scene.getEnemyPokemon()!.getLastXMoves()[0]; + expect(enemyMove.result).toBe(MoveResult.FAIL); + expect(game.scene.getEnemyPokemon()!.getMoveset().find(m => m?.moveId === Moves.SONIC_BOOM)?.ppUsed).toBe(1); + + }); + + it("should not repeat enemy's move through protect", async () => { + await game.classicMode.startBattle([ Species.AMOONGUSS ]); + + const MoveToUse = Moves.PROTECT; + const enemyPokemon = game.scene.getEnemyPokemon()!; + game.move.changeMoveset(enemyPokemon, MoveToUse); + game.move.select(Moves.INSTRUCT); + await game.forceEnemyMove(Moves.PROTECT); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(enemyPokemon.getLastXMoves(-1)[0].move).toBe(Moves.PROTECT); + expect(enemyPokemon.getLastXMoves(-1)[1]).toBeUndefined(); // undefined because protect failed + expect(enemyPokemon.getMoveset().find(m => m?.moveId === Moves.PROTECT)?.ppUsed).toBe(1); + }); + + it("should not repeat enemy's charging move", async () => { + game.override + .enemyMoveset([ Moves.SONIC_BOOM, Moves.HYPER_BEAM ]) + .enemyLevel(5); + await game.classicMode.startBattle([ Species.SHUCKLE ]); + + const player = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + enemyPokemon.battleSummonData.moveHistory = [{ move: Moves.SONIC_BOOM, targets: [ BattlerIndex.PLAYER ], result: MoveResult.SUCCESS, virtual: false }]; + + game.move.select(Moves.INSTRUCT); + await game.forceEnemyMove(Moves.HYPER_BEAM); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.toNextTurn(); + + expect(player.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + + game.move.select(Moves.INSTRUCT); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(player.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + }); + + it("should not repeat dance move not known by target", async () => { + game.override + .battleType("double") + .moveset([ Moves.INSTRUCT, Moves.FIERY_DANCE ]) + .enemyMoveset(Moves.SPLASH) + .enemyAbility(Abilities.DANCER); + await game.classicMode.startBattle([ Species.SHUCKLE, Species.SHUCKLE ]); + + game.move.select(Moves.INSTRUCT, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.select(Moves.FIERY_DANCE, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY); + await game.forceEnemyMove(Moves.SPLASH); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2 ]); + await game.phaseInterceptor.to("TurnEndPhase", false); + + expect(game.scene.getPlayerField()[0].getLastXMoves()[0].result).toBe(MoveResult.FAIL); + }); + + it("should cause multi-hit moves to hit the appropriate number of times in singles", async () => { + game.override + .enemyAbility(Abilities.SKILL_LINK) + .enemyMoveset(Moves.BULLET_SEED); + await game.classicMode.startBattle([ Species.BULBASAUR ]); + + const player = game.scene.getPlayerPokemon()!; + + game.move.select(Moves.SPLASH); + await game.toNextTurn(); + + game.move.select(Moves.INSTRUCT); + await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(player.turnData.attacksReceived.length).toBe(10); + + await game.toNextTurn(); + game.move.select(Moves.INSTRUCT); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(player.turnData.attacksReceived.length).toBe(10); + }); + + it("should cause multi-hit moves to hit the appropriate number of times in doubles", async () => { + game.override + .battleType("double") + .enemyAbility(Abilities.SKILL_LINK) + .enemyMoveset([ Moves.BULLET_SEED, Moves.SPLASH ]) + .enemyLevel(5); + await game.classicMode.startBattle([ Species.BULBASAUR, Species.IVYSAUR ]); + + const [ , ivysaur ] = game.scene.getPlayerField(); + + game.move.select(Moves.SPLASH); + game.move.select(Moves.SPLASH, 1); + await game.forceEnemyMove(Moves.BULLET_SEED, BattlerIndex.PLAYER_2); + await game.forceEnemyMove(Moves.SPLASH); + await game.toNextTurn(); + + game.move.select(Moves.INSTRUCT, 0, BattlerIndex.ENEMY); + game.move.select(Moves.INSTRUCT, 1, BattlerIndex.ENEMY); + await game.forceEnemyMove(Moves.BULLET_SEED, BattlerIndex.PLAYER_2); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2 ]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(ivysaur.turnData.attacksReceived.length).toBe(15); + + await game.toNextTurn(); + game.move.select(Moves.INSTRUCT, 0, BattlerIndex.ENEMY); + game.move.select(Moves.INSTRUCT, 1, BattlerIndex.ENEMY); + await game.forceEnemyMove(Moves.BULLET_SEED, BattlerIndex.PLAYER_2); + await game.forceEnemyMove(Moves.SPLASH); + await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]); + await game.phaseInterceptor.to("BerryPhase"); + + expect(ivysaur.turnData.attacksReceived.length).toBe(15); + }); +}); diff --git a/src/test/utils/helpers/moveHelper.ts b/src/test/utils/helpers/moveHelper.ts index 73fe63395fd..68d3b3d51d7 100644 --- a/src/test/utils/helpers/moveHelper.ts +++ b/src/test/utils/helpers/moveHelper.ts @@ -1,4 +1,6 @@ import { BattlerIndex } from "#app/battle"; +import type Pokemon from "#app/field/pokemon"; +import { PokemonMove } from "#app/field/pokemon"; import Overrides from "#app/overrides"; import { CommandPhase } from "#app/phases/command-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; @@ -71,4 +73,21 @@ export class MoveHelper extends GameManagerHelper { await this.game.phaseInterceptor.to("MovePhase"); vi.spyOn(Overrides, "STATUS_ACTIVATION_OVERRIDE", "get").mockReturnValue(null); } + + /** + * Used when the normal moveset override can't be used (such as when it's necessary to check updated properties of the moveset). + * @param pokemon - The pokemon being modified + * @param moveset - The moveset to use + */ + public changeMoveset(pokemon: Pokemon, moveset: Moves | Moves[]): void { + if (!Array.isArray(moveset)) { + moveset = [ moveset ]; + } + pokemon.moveset = []; + moveset.forEach((move) => { + pokemon.moveset.push(new PokemonMove(move)); + }); + const movesetStr = moveset.map((moveId) => Moves[moveId]).join(", "); + console.log(`Pokemon ${pokemon.species.name}'s moveset manually set to ${movesetStr} (=[${moveset.join(", ")}])!`); + } } From e930536efee5e0fbd11fbaa678545ebe8fd11c50 Mon Sep 17 00:00:00 2001 From: innerthunder <168692175+innerthunder@users.noreply.github.com> Date: Sun, 1 Dec 2024 14:27:55 -0800 Subject: [PATCH 4/4] [Move] Implement Powder (with edge case) (#3662) * Powder basic implementation * Add Powder integration tests * Fix thaw test * Use new test utils and type check function * More edge case tests * Make Powder (P) * Add locale keys * Add placeholder common anim * Use CommonAnimPhase instead of async animation * Add comments with new English text * Make Powder `edgeCase` instead * ESLint * Fix imports * Add `moveName` key arg for other languages * ESLint * Update locales * Fix pages issues * Update Powder explosion animation * Update common-powder.json * Update src/test/moves/powder.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Remove lingering TIMEOUTs * More test cleanup --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- public/battle-anims/common-powder.json | 2496 +++++++++++++++++++ public/images/battle_anims/PRAS- Powder.png | Bin 4147 -> 4092 bytes src/data/battle-anims.ts | 1 + src/data/battler-tags.ts | 53 + src/data/move.ts | 3 +- src/enums/battler-tag-type.ts | 1 + src/test/moves/powder.test.ts | 205 ++ 7 files changed, 2758 insertions(+), 1 deletion(-) create mode 100644 public/battle-anims/common-powder.json create mode 100644 src/test/moves/powder.test.ts diff --git a/public/battle-anims/common-powder.json b/public/battle-anims/common-powder.json new file mode 100644 index 00000000000..698d68e7e81 --- /dev/null +++ b/public/battle-anims/common-powder.json @@ -0,0 +1,2496 @@ +{ + "graphic":"PRAS- Powder", + "frames":[ + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 0 , + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 17, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 0 , + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 17, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 0, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 17, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 155, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 150, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 155, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 150, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + } + ] + ], + "frameTimedEvents":{ + "16":[{"frameIndex":16,"resourceName":"PRSFX- Powder common1.wav","volume":100,"pitch":100,"eventType":"AnimTimedSoundEvent"}], + "18":[{"frameIndex":18,"resourceName":"PRSFX- Powder common2.wav","volume":30,"pitch":120,"eventType":"AnimTimedSoundEvent"}] + }, + "position":3, + "hue":0 +} \ No newline at end of file diff --git a/public/images/battle_anims/PRAS- Powder.png b/public/images/battle_anims/PRAS- Powder.png index 3c4a4d2db55552ea56556cd5b61bcac66a8dfbbd..9656c31e6c9663a934d5ef4883547b88db1ebcff 100644 GIT binary patch delta 3911 zcmZ`*c{mj8*EUGDkV#&`q=ht=vdc1+WXlp|Un~1EwrPgJ4C$3@G1=0X(D2GKl6@H4 zAPMoxWF2c7VnV|h%Y6EN-|x@w{^Q)|dG2#P&vTvgT-P}t&hCR=oK^+Q@^W!-aG3F1 zmL3rx+{XAON7bMd?Pzh&`p!M0Bffq6c6@w%E(ZsRL}Ia68M+XZR*ByuE)mF)C>3F2 zY0JU>|4|07yvxBMe9H9JjeCgKYtzYLlZ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?4HCG q@wYDk000000000000000001 target.status?.effect === StatusEffect.POISON || target.status?.effect === StatusEffect.TOXIC }) .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.POWDER, Type.BUG, 100, 20, -1, 1, 6) + .attr(AddBattlerTagAttr, BattlerTagType.POWDER, false, true) .ignoresSubstitute() .powderMove() - .unimplemented(), + .edgeCase(), // does not cancel Fire-type moves generated by Dancer new ChargingSelfStatusMove(Moves.GEOMANCY, Type.FAIRY, -1, 10, -1, 0, 6) .chargeText(i18next.t("moveTriggers:isChargingPower", { pokemonName: "{USER}" })) .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF, Stat.SPD ], 2, true) diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index bb969386630..f28ac37ae27 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -93,4 +93,5 @@ export enum BattlerTagType { GRUDGE = "GRUDGE", PSYCHO_SHIFT = "PSYCHO_SHIFT", ENDURE_TOKEN = "ENDURE_TOKEN", + POWDER = "POWDER", } diff --git a/src/test/moves/powder.test.ts b/src/test/moves/powder.test.ts new file mode 100644 index 00000000000..5c0f318d620 --- /dev/null +++ b/src/test/moves/powder.test.ts @@ -0,0 +1,205 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#test/utils/gameManager"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { BerryPhase } from "#app/phases/berry-phase"; +import { MoveResult } from "#app/field/pokemon"; +import { Type } from "#enums/type"; +import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { StatusEffect } from "#enums/status-effect"; + +describe("Moves - Powder", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override.battleType("single"); + + game.override + .enemySpecies(Species.SNORLAX) + .enemyLevel(100) + .enemyMoveset(Moves.EMBER) + .enemyAbility(Abilities.INSOMNIA) + .startingLevel(100) + .moveset([ Moves.POWDER, Moves.SPLASH, Moves.FIERY_DANCE ]); + }); + + it( + "should cancel the target's Fire-type move and damage the target", + async () => { + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + + await game.toNextTurn(); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + }); + + it( + "should have no effect against Grass-type Pokemon", + async () => { + game.override.enemySpecies(Species.AMOONGUSS); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); + + it( + "should have no effect against Pokemon with Overcoat", + async () => { + game.override.enemyAbility(Abilities.OVERCOAT); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); + + it( + "should not damage the target if the target has Magic Guard", + async () => { + game.override.enemyAbility(Abilities.MAGIC_GUARD); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); + + it( + "should not prevent the target from thawing out with Flame Wheel", + async () => { + game.override + .enemyMoveset(Array(4).fill(Moves.FLAME_WHEEL)) + .enemyStatusEffect(StatusEffect.FREEZE); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.status?.effect).not.toBe(StatusEffect.FREEZE); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + } + ); + + it( + "should not allow a target with Protean to change to Fire type", + async () => { + game.override.enemyAbility(Abilities.PROTEAN); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp()); + expect(enemyPokemon.summonData?.types).not.toBe(Type.FIRE); + }); + + // TODO: Implement this interaction to pass this test + it.skip( + "should cancel Fire-type moves generated by the target's Dancer ability", + async () => { + game.override + .enemySpecies(Species.BLASTOISE) + .enemyAbility(Abilities.DANCER); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.FIERY_DANCE); + + await game.phaseInterceptor.to(MoveEffectPhase); + const enemyStartingHp = enemyPokemon.hp; + + await game.phaseInterceptor.to(BerryPhase, false); + // player should not take damage + expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp()); + // enemy should have taken damage from player's Fiery Dance + 2 Powder procs + expect(enemyPokemon.hp).toBe(enemyStartingHp - 2 * Math.floor(enemyPokemon.getMaxHp() / 4)); + }); + + it( + "should cancel Revelation Dance if it becomes a Fire-type move", + async () => { + game.override + .enemySpecies(Species.CHARIZARD) + .enemyMoveset(Array(4).fill(Moves.REVELATION_DANCE)); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + }); + + it( + "should cancel Shell Trap and damage the target, even if the move would fail", + async () => { + game.override.enemyMoveset(Array(4).fill(Moves.SHELL_TRAP)); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + }); +});