mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 22:09:27 +02:00
Fix Embody Aspect triggers
This commit is contained in:
parent
3d9cb539c7
commit
76cc1344a0
@ -7824,25 +7824,33 @@ export function initAbilities() {
|
|||||||
new Ability(AbilityId.TOXIC_CHAIN, 9)
|
new Ability(AbilityId.TOXIC_CHAIN, 9)
|
||||||
.attr(PostAttackApplyStatusEffectAbAttr, false, 30, StatusEffect.TOXIC),
|
.attr(PostAttackApplyStatusEffectAbAttr, false, 30, StatusEffect.TOXIC),
|
||||||
new Ability(AbilityId.EMBODY_ASPECT_TEAL, 9)
|
new Ability(AbilityId.EMBODY_ASPECT_TEAL, 9)
|
||||||
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPD ], 1)
|
.attr(PostSummonStatStageChangeAbAttr, [ Stat.SPD ], 1, true) //Activiates on switch in when tera'd
|
||||||
|
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPD ], 1) //Activates mid round when tera'd
|
||||||
.uncopiable()
|
.uncopiable()
|
||||||
.unreplaceable() // TODO is this true?
|
.unreplaceable() // TODO is this true?
|
||||||
.attr(NoTransformAbilityAbAttr),
|
.attr(NoTransformAbilityAbAttr)
|
||||||
|
.condition(pokemon => pokemon.isTerastallized),
|
||||||
new Ability(AbilityId.EMBODY_ASPECT_WELLSPRING, 9)
|
new Ability(AbilityId.EMBODY_ASPECT_WELLSPRING, 9)
|
||||||
|
.attr(PostSummonStatStageChangeAbAttr, [ Stat.SPDEF ], 1, true)
|
||||||
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPDEF ], 1)
|
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.SPDEF ], 1)
|
||||||
.uncopiable()
|
.uncopiable()
|
||||||
.unreplaceable()
|
.unreplaceable()
|
||||||
.attr(NoTransformAbilityAbAttr),
|
.attr(NoTransformAbilityAbAttr)
|
||||||
|
.condition(pokemon => pokemon.isTerastallized),
|
||||||
new Ability(AbilityId.EMBODY_ASPECT_HEARTHFLAME, 9)
|
new Ability(AbilityId.EMBODY_ASPECT_HEARTHFLAME, 9)
|
||||||
|
.attr(PostSummonStatStageChangeAbAttr, [ Stat.ATK ], 1, true)
|
||||||
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.ATK ], 1)
|
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.ATK ], 1)
|
||||||
.uncopiable()
|
.uncopiable()
|
||||||
.unreplaceable()
|
.unreplaceable()
|
||||||
.attr(NoTransformAbilityAbAttr),
|
.attr(NoTransformAbilityAbAttr)
|
||||||
|
.condition(pokemon => pokemon.isTerastallized),
|
||||||
new Ability(AbilityId.EMBODY_ASPECT_CORNERSTONE, 9)
|
new Ability(AbilityId.EMBODY_ASPECT_CORNERSTONE, 9)
|
||||||
|
.attr(PostSummonStatStageChangeAbAttr, [ Stat.SPD ], 1, true)
|
||||||
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.DEF ], 1)
|
.attr(PostTeraFormChangeStatChangeAbAttr, [ Stat.DEF ], 1)
|
||||||
.uncopiable()
|
.uncopiable()
|
||||||
.unreplaceable()
|
.unreplaceable()
|
||||||
.attr(NoTransformAbilityAbAttr),
|
.attr(NoTransformAbilityAbAttr)
|
||||||
|
.condition(pokemon => pokemon.isTerastallized),
|
||||||
new Ability(AbilityId.TERA_SHIFT, 9, 2)
|
new Ability(AbilityId.TERA_SHIFT, 9, 2)
|
||||||
.attr(PostSummonFormChangeAbAttr, p => p.getFormKey() ? 0 : 1)
|
.attr(PostSummonFormChangeAbAttr, p => p.getFormKey() ? 0 : 1)
|
||||||
.uncopiable()
|
.uncopiable()
|
||||||
|
64
test/abilities/embody-aspect.test.ts
Normal file
64
test/abilities/embody-aspect.test.ts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import { AbilityId } from "#enums/ability-id";
|
||||||
|
import { MoveId } from "#enums/move-id";
|
||||||
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
|
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
|
||||||
|
.ability(AbilityId.EMBODY_ASPECT_TEAL)
|
||||||
|
.battleStyle("single")
|
||||||
|
.criticalHits(false)
|
||||||
|
.enemySpecies(SpeciesId.MAGIKARP)
|
||||||
|
.enemyMoveset(MoveId.SPLASH);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Embody Aspect should activate on switching in if user is terrestrialized", async () => {
|
||||||
|
await game.classicMode.startBattle([SpeciesId.OGERPON, SpeciesId.ABOMASNOW]);
|
||||||
|
|
||||||
|
const Ogerpon = game.scene.getPlayerParty()[0];
|
||||||
|
expect(Ogerpon.formIndex).toBe(baseForm);
|
||||||
|
|
||||||
|
game.field.forceTera(Ogerpon, PokemonType.GRASS);
|
||||||
|
game.move.use(MoveId.SPLASH);
|
||||||
|
|
||||||
|
// todo: add helper function to activiate tera related abilities
|
||||||
|
// await game.phaseInterceptor.to(QuietFormChangePhase);
|
||||||
|
// expect(Ogerpon.formIndex).toBe(teraForm);
|
||||||
|
// expect(Ogerpon.getStatStage(Stat.SPD)).toBe(1);
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
//Switch Ogerpon out
|
||||||
|
game.doSwitchPokemon(1);
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
//Switch Ogerpon back in
|
||||||
|
game.doSwitchPokemon(1);
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
//Ability activated
|
||||||
|
expect(Ogerpon.getStatStage(Stat.SPD)).toBe(1);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user