Update to show ability even if opponent pokemon does not get statused
This commit is contained in:
parent
aadc86dd19
commit
ec82686305
|
@ -1678,7 +1678,8 @@ export class SynchronizeStatusAbAttr extends PostSetStatusAbAttr {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (sourcePokemon && syncStatuses.has(effect)) {
|
if (sourcePokemon && syncStatuses.has(effect)) {
|
||||||
return sourcePokemon.trySetStatus(effect, true, pokemon);
|
sourcePokemon.trySetStatus(effect, true, pokemon);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -210,6 +210,30 @@ describe("Abilities - Synchronize", () => {
|
||||||
expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase");
|
expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase");
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
|
it("shows ability even if it fails to set the status of the opponent Pokemon", async () => {
|
||||||
|
// Arrange
|
||||||
|
const moveToUse = Moves.THUNDER_WAVE;
|
||||||
|
|
||||||
|
// Starter mocks
|
||||||
|
vi.spyOn(overrides, "STARTER_SPECIES_OVERRIDE", "get").mockReturnValue(Species.PIKACHU);
|
||||||
|
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||||
|
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.STATIC);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await game.startBattle();
|
||||||
|
game.doAttack(getMovePosition(game.scene, 0, moveToUse));
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to(MoveEffectPhase, false);
|
||||||
|
vi.spyOn(game.scene.getCurrentPhase() as MoveEffectPhase, "hitCheck").mockReturnValue(true);
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(game.scene.getParty()[0].status?.effect).toBe(undefined);
|
||||||
|
expect(game.scene.getEnemyParty()[0].status?.effect).toBe(StatusEffect.PARALYSIS);
|
||||||
|
expect(game.phaseInterceptor.log).toContain("ShowAbilityPhase");
|
||||||
|
}, 20000);
|
||||||
|
|
||||||
it("should activate with Psycho Shift after the move clears the status", async () => {
|
it("should activate with Psycho Shift after the move clears the status", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const moveToUse = Moves.PSYCHO_SHIFT;
|
const moveToUse = Moves.PSYCHO_SHIFT;
|
||||||
|
|
Loading…
Reference in New Issue