mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 10:42:25 +02:00
added a feature that removes MAKES_CONTACT if necessary
This commit is contained in:
parent
c37d90b1fa
commit
f199549753
@ -4621,6 +4621,10 @@ export class ShellSideArmCategoryAttr extends VariableMoveCategoryAttr {
|
||||
move.makesContact();
|
||||
return true;
|
||||
}
|
||||
/** MoveFlags are not reset every turn so if this flag is set it needs to be reset if the move is a special attack */
|
||||
if (move.hasFlag(MoveFlags.MAKES_CONTACT)) {
|
||||
move.makesContact(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -34,22 +34,6 @@ describe("Moves - Shell Side Arm", () => {
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should not make contact if the move stays special", async () => {
|
||||
game.override.enemySpecies(Species.SLOWBRO).enemyAbility(Abilities.ROUGH_SKIN);
|
||||
|
||||
await game.classicMode.startBattle([ Species.XURKITREE ]);
|
||||
|
||||
const player = game.scene.getPlayerPokemon()!;
|
||||
|
||||
vi.spyOn(shellSideArmAttr, "apply");
|
||||
|
||||
game.move.select(Moves.SHELL_SIDE_ARM);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(shellSideArmAttr.apply).toHaveLastReturnedWith(false);
|
||||
expect(player.getMaxHp()).toBe(player.hp);
|
||||
});
|
||||
|
||||
it("becomes a physical attack if forecasted to deal more damage as physical", async () => {
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
|
||||
@ -109,4 +93,21 @@ describe("Moves - Shell Side Arm", () => {
|
||||
|
||||
expect(shellSideArmAttr.apply).toHaveLastReturnedWith(false);
|
||||
});
|
||||
|
||||
it("should not make contact if the move stays special", async () => {
|
||||
game.override.enemySpecies(Species.SLOWBRO).enemyAbility(Abilities.ROUGH_SKIN);
|
||||
|
||||
await game.classicMode.startBattle([ Species.XURKITREE ]);
|
||||
|
||||
const player = game.scene.getPlayerPokemon()!;
|
||||
|
||||
vi.spyOn(shellSideArmAttr, "apply");
|
||||
|
||||
game.move.select(Moves.SHELL_SIDE_ARM);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(shellSideArmAttr.apply).toHaveLastReturnedWith(false);
|
||||
expect(player.getMaxHp()).toBe(player.hp);
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user