mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 22:39:31 +02:00
Added nightmare interaction to Wimp Out following bug fix
This commit is contained in:
parent
82a6385e35
commit
cce3818690
@ -3260,6 +3260,9 @@ function calculateSleepDamage(pokemon: Pokemon): number {
|
||||
damageTaken += Utils.toDmgValue(pokemon.getMaxHp() / 8);
|
||||
}
|
||||
}
|
||||
if (pokemon.getTag(BattlerTagType.NIGHTMARE)) {
|
||||
damageTaken += Utils.toDmgValue(pokemon.getMaxHp() / 4);
|
||||
}
|
||||
return damageTaken;
|
||||
}
|
||||
|
||||
|
@ -651,4 +651,28 @@ describe("Abilities - Wimp Out", () => {
|
||||
expect(game.phaseInterceptor.log).not.toContain("MovePhase");
|
||||
expect(game.phaseInterceptor.log).toContain("BattleEndPhase");
|
||||
});
|
||||
it("Wimp Out will activate due to Nightmare", async () => {
|
||||
// arrange
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.enemyMoveset([ Moves.NIGHTMARE ])
|
||||
.statusEffect(StatusEffect.SLEEP);
|
||||
await game.startBattle([
|
||||
Species.WIMPOD,
|
||||
Species.TYRUNT
|
||||
]);
|
||||
const playerHp = game.scene.getPlayerPokemon()!.hp;
|
||||
game.scene.getPlayerPokemon()!.hp = playerHp * 0.65;
|
||||
|
||||
// act
|
||||
game.move.select(Moves.NIGHTMARE);
|
||||
game.doSelectPartyPokemon(1);
|
||||
await game.toNextTurn();
|
||||
|
||||
// assert
|
||||
expect(game.scene.getParty()[1].getHpRatio()).toBeGreaterThan(0);
|
||||
expect(game.scene.getParty()[1].getHpRatio()).toBeLessThan(0.5);
|
||||
expect(game.phaseInterceptor.log).toContain("SwitchSummonPhase");
|
||||
expect(game.scene.getPlayerPokemon()!.species.speciesId).toBe(Species.TYRUNT);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user