[Ability] Embody Aspect now triggers on switch-in while Terastallized (#6294)

* Fix Embody Aspect triggers

* Use selectWithTera

* apply suggestions

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
This commit is contained in:
Acelynn Zhang 2025-08-20 20:10:54 -05:00 committed by GitHub
parent 030b701910
commit f34be91891
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 75 additions and 1 deletions

View File

@ -7833,22 +7833,26 @@ export function initAbilities() {
new Ability(AbilityId.TOXIC_CHAIN, 9)
.attr(PostAttackApplyStatusEffectAbAttr, false, 30, StatusEffect.TOXIC),
new Ability(AbilityId.EMBODY_ASPECT_TEAL, 9)
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPD ], 1)
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPD ], 1) // Activates immediately upon Terastallizing, as well as upon switching in while Terastallized
.conditionalAttr(pokemon => pokemon.isTerastallized, PostSummonStatStageChangeAbAttr, [ Stat.SPD ], 1, true)
.uncopiable()
.unreplaceable() // TODO is this true?
.attr(NoTransformAbilityAbAttr),
new Ability(AbilityId.EMBODY_ASPECT_WELLSPRING, 9)
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPDEF ], 1)
.conditionalAttr(pokemon => pokemon.isTerastallized, PostSummonStatStageChangeAbAttr, [ Stat.SPDEF ], 1, true)
.uncopiable()
.unreplaceable()
.attr(NoTransformAbilityAbAttr),
new Ability(AbilityId.EMBODY_ASPECT_HEARTHFLAME, 9)
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.ATK ], 1)
.conditionalAttr(pokemon => pokemon.isTerastallized, PostSummonStatStageChangeAbAttr, [ Stat.ATK ], 1, true)
.uncopiable()
.unreplaceable()
.attr(NoTransformAbilityAbAttr),
new Ability(AbilityId.EMBODY_ASPECT_CORNERSTONE, 9)
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.DEF ], 1)
.conditionalAttr(pokemon => pokemon.isTerastallized, PostSummonStatStageChangeAbAttr, [ Stat.DEF ], 1, true)
.uncopiable()
.unreplaceable()
.attr(NoTransformAbilityAbAttr),

View File

@ -0,0 +1,70 @@
import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { Stat } from "#enums/stat";
import { GameManager } from "#test/test-utils/game-manager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Ability - Embody Aspect", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
const teraForm = 4;
const baseForm = 0;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.moveset([MoveId.SPLASH])
.ability(AbilityId.EMBODY_ASPECT_TEAL)
.battleStyle("single")
.criticalHits(false)
.enemySpecies(SpeciesId.MAGIKARP)
.enemyMoveset(MoveId.SPLASH);
});
it("should activate on switch-in if user is Terastallized", async () => {
await game.classicMode.startBattle([SpeciesId.OGERPON, SpeciesId.ABOMASNOW]);
const ogerpon = game.field.getPlayerPokemon();
expect(ogerpon.formIndex).toBe(baseForm);
expect(ogerpon).toHaveStatStage(Stat.SPD, 0);
//Terastallize Ogerpon
game.move.selectWithTera(MoveId.SPLASH);
await game.phaseInterceptor.to("QuietFormChangePhase");
expect(ogerpon.formIndex).toBe(teraForm);
await game.toNextTurn();
expect(ogerpon).toHaveStatStage(Stat.SPD, 1);
expect(ogerpon).toHaveAbilityApplied(AbilityId.EMBODY_ASPECT_TEAL);
// Clear out abilities applied set so we can check it again later
ogerpon.waveData.abilitiesApplied.clear();
//Switch ogerpon out
game.doSwitchPokemon(1);
await game.toNextTurn();
//Switch ogerpon back in
game.doSwitchPokemon(1);
await game.toNextTurn();
//Ability activated again
expect(ogerpon).toHaveStatStage(Stat.SPD, 1);
expect(ogerpon).toHaveAbilityApplied(AbilityId.EMBODY_ASPECT_TEAL);
});
});