applied style comments

This commit is contained in:
Bertie690 2024-11-18 21:35:51 -05:00
parent 95bbd45cf1
commit 611a305037
2 changed files with 7 additions and 10 deletions

View File

@ -2624,9 +2624,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (fixedDamage.value) {
const lensCount = source.getHeldItems().find(i => i instanceof PokemonMultiHitModifier)?.getStackCount() ?? 0;
// Apply damage fixing for hp cutting moves on multi lens hits (NOT PARENTAL BOND)
if (move.hasAttr(TargetHalfHpDamageAttr) &&
(source.turnData.hitCount === source.turnData.hitsLeft ||
source.turnData.hitCount - source.turnData.hitsLeft !== lensCount + 1)) {
if (move.hasAttr(TargetHalfHpDamageAttr)
&& (source.turnData.hitCount === source.turnData.hitsLeft
|| source.turnData.hitCount - source.turnData.hitsLeft !== lensCount + 1)) {
// Do some unholy math to make the moves' damage values add up to 50%
// Values obtained courtesy of WolframAlpha and Desmos Graphing Calculator
// (https://www.desmos.com/calculator/wdngrksdfz)

View File

@ -149,7 +149,7 @@ describe("Items - Multi Lens", () => {
game.move.select(Moves.SUPER_FANG);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.phaseInterceptor.to("MoveEndPhase", true);
await game.phaseInterceptor.to("MoveEndPhase");
expect(enemyPokemon.getHpRatio()).toBeCloseTo(0.5, 10); // unrealistically high level of precision
});
@ -166,9 +166,8 @@ describe("Items - Multi Lens", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SUPER_FANG);
await game.forceEnemyMove(Moves.SPLASH);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.phaseInterceptor.to("MoveEndPhase", true);
await game.phaseInterceptor.to("MoveEndPhase");
expect(enemyPokemon.getHpRatio()).toBeCloseTo(0.5, 8); // unrealistically high level of precision
});
@ -185,9 +184,8 @@ describe("Items - Multi Lens", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SUPER_FANG);
await game.forceEnemyMove(Moves.SPLASH);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.phaseInterceptor.to("MoveEndPhase", true);
await game.phaseInterceptor.to("MoveEndPhase");
expect(enemyPokemon.getHpRatio()).toBeCloseTo(0.5, 8);
});
it("should result in correct damage for hp% attacks with 3 lenses + Parental Bond", async () => {
@ -204,9 +202,8 @@ describe("Items - Multi Lens", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SUPER_FANG);
await game.forceEnemyMove(Moves.SPLASH);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.phaseInterceptor.to("MoveEndPhase", true);
await game.phaseInterceptor.to("MoveEndPhase");
expect(enemyPokemon.getHpRatio()).toBeCloseTo(0.25, 8);
});
});