From 611a3050378aa33de235d4c2763dd3690151f8da Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Mon, 18 Nov 2024 21:35:51 -0500 Subject: [PATCH] applied style comments --- src/field/pokemon.ts | 6 +++--- src/test/items/multi_lens.test.ts | 11 ++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index c5be177e849..cfe01a8b4c8 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -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) diff --git a/src/test/items/multi_lens.test.ts b/src/test/items/multi_lens.test.ts index 37685e2836c..50a858fc928 100644 --- a/src/test/items/multi_lens.test.ts +++ b/src/test/items/multi_lens.test.ts @@ -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); }); });