mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-28 12:32:44 +02:00
[Update Fur Coat ability to reduce damage from DefDefAttr moves and test added
This commit is contained in:
parent
0a661b9a6c
commit
eec986b583
@ -8737,7 +8737,7 @@ export function initAbilities() {
|
|||||||
.attr(PokemonTypeChangeAbAttr),
|
.attr(PokemonTypeChangeAbAttr),
|
||||||
//.condition((p) => !p.summonData.abilitiesApplied.includes(AbilityId.PROTEAN)), //Gen 9 Implementation
|
//.condition((p) => !p.summonData.abilitiesApplied.includes(AbilityId.PROTEAN)), //Gen 9 Implementation
|
||||||
new Ability(AbilityId.FUR_COAT, 6)
|
new Ability(AbilityId.FUR_COAT, 6)
|
||||||
.attr(ReceivedMoveDamageMultiplierAbAttr, (_target, _user, move) => move.category === MoveCategory.PHYSICAL || move.id === MoveId.PSYSHOCK || move.id === MoveId.PSYSTRIKE || move.id === MoveId.SECRET_SWORD, 0.5)
|
.attr(ReceivedMoveDamageMultiplierAbAttr, (_target, _user, move) => move.category === MoveCategory.PHYSICAL || move.hasAttr("DefDefAttr"), 0.5)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(AbilityId.MAGICIAN, 6)
|
new Ability(AbilityId.MAGICIAN, 6)
|
||||||
.attr(PostAttackStealHeldItemAbAttr),
|
.attr(PostAttackStealHeldItemAbAttr),
|
||||||
|
105
test/abilities/fur_coat.test.ts
Normal file
105
test/abilities/fur_coat.test.ts
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
import { AbilityId } from "#enums/ability-id";
|
||||||
|
import { MoveId } from "#enums/move-id";
|
||||||
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
import { allAbilities } from "#app/data/data-lists";
|
||||||
|
|
||||||
|
describe("Abilities - Fur Coat", () => {
|
||||||
|
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
|
||||||
|
.battleStyle("single")
|
||||||
|
.moveset([MoveId.TACKLE, MoveId.PSYSHOCK, MoveId.PSYSTRIKE, MoveId.SECRET_SWORD, MoveId.SCALD])
|
||||||
|
.ability(AbilityId.BALL_FETCH)
|
||||||
|
.enemySpecies(SpeciesId.MINCCINO)
|
||||||
|
.enemyAbility(AbilityId.BALL_FETCH)
|
||||||
|
.enemyMoveset([MoveId.SPLASH])
|
||||||
|
.disableCrits();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should reduce damage from a physical move after gaining Fur Coat", async () => {
|
||||||
|
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
||||||
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
// Use Tackle before Fur Coat
|
||||||
|
game.move.select(MoveId.TACKLE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const damageBefore = enemy.getMaxHp() - enemy.hp;
|
||||||
|
// Give Fur Coat
|
||||||
|
enemy.setTempAbility(allAbilities[AbilityId.FUR_COAT]);
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
// Use Tackle after Fur Coat
|
||||||
|
game.move.select(MoveId.TACKLE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const damageAfter = enemy.getMaxHp() - enemy.hp;
|
||||||
|
expect(damageAfter).toBeLessThan(damageBefore);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not reduce damage from a special move", async () => {
|
||||||
|
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
||||||
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
// Use Scald before Fur Coat
|
||||||
|
game.move.select(MoveId.SCALD);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const damageBefore = enemy.getMaxHp() - enemy.hp;
|
||||||
|
// Give Fur Coat
|
||||||
|
enemy.setTempAbility(allAbilities[AbilityId.FUR_COAT]);
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
// Use Scald after Fur Coat
|
||||||
|
game.move.select(MoveId.SCALD);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const damageAfter = enemy.getMaxHp() - enemy.hp;
|
||||||
|
expect(damageAfter).toBeCloseTo(damageBefore, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should reduce damage from Psyshock, Psystrike, and Secret Sword after gaining Fur Coat", async () => {
|
||||||
|
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
||||||
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
// Test Psyshock
|
||||||
|
game.move.select(MoveId.PSYSHOCK);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const psyshockBefore = enemy.getMaxHp() - enemy.hp;
|
||||||
|
enemy.setTempAbility(allAbilities[AbilityId.FUR_COAT]);
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
game.move.select(MoveId.PSYSHOCK);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const psyshockAfter = enemy.getMaxHp() - enemy.hp;
|
||||||
|
expect(psyshockAfter).toBeLessThan(psyshockBefore);
|
||||||
|
// Test Psystrike
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
game.move.select(MoveId.PSYSTRIKE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const psystrikeBefore = enemy.getMaxHp() - enemy.hp;
|
||||||
|
enemy.setTempAbility(allAbilities[AbilityId.FUR_COAT]);
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
game.move.select(MoveId.PSYSTRIKE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const psystrikeAfter = enemy.getMaxHp() - enemy.hp;
|
||||||
|
expect(psystrikeAfter).toBeLessThan(psystrikeBefore);
|
||||||
|
// Test Secret Sword
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
game.move.select(MoveId.SECRET_SWORD);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const secretSwordBefore = enemy.getMaxHp() - enemy.hp;
|
||||||
|
enemy.setTempAbility(allAbilities[AbilityId.FUR_COAT]);
|
||||||
|
enemy.hp = enemy.getMaxHp();
|
||||||
|
game.move.select(MoveId.SECRET_SWORD);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
const secretSwordAfter = enemy.getMaxHp() - enemy.hp;
|
||||||
|
expect(secretSwordAfter).toBeLessThan(secretSwordBefore);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user