mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
applied style comments
This commit is contained in:
parent
95bbd45cf1
commit
611a305037
@ -2624,9 +2624,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (fixedDamage.value) {
|
if (fixedDamage.value) {
|
||||||
const lensCount = source.getHeldItems().find(i => i instanceof PokemonMultiHitModifier)?.getStackCount() ?? 0;
|
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)
|
// Apply damage fixing for hp cutting moves on multi lens hits (NOT PARENTAL BOND)
|
||||||
if (move.hasAttr(TargetHalfHpDamageAttr) &&
|
if (move.hasAttr(TargetHalfHpDamageAttr)
|
||||||
(source.turnData.hitCount === source.turnData.hitsLeft ||
|
&& (source.turnData.hitCount === source.turnData.hitsLeft
|
||||||
source.turnData.hitCount - source.turnData.hitsLeft !== lensCount + 1)) {
|
|| source.turnData.hitCount - source.turnData.hitsLeft !== lensCount + 1)) {
|
||||||
// Do some unholy math to make the moves' damage values add up to 50%
|
// Do some unholy math to make the moves' damage values add up to 50%
|
||||||
// Values obtained courtesy of WolframAlpha and Desmos Graphing Calculator
|
// Values obtained courtesy of WolframAlpha and Desmos Graphing Calculator
|
||||||
// (https://www.desmos.com/calculator/wdngrksdfz)
|
// (https://www.desmos.com/calculator/wdngrksdfz)
|
||||||
|
@ -149,7 +149,7 @@ describe("Items - Multi Lens", () => {
|
|||||||
|
|
||||||
game.move.select(Moves.SUPER_FANG);
|
game.move.select(Moves.SUPER_FANG);
|
||||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
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
|
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()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
game.move.select(Moves.SUPER_FANG);
|
game.move.select(Moves.SUPER_FANG);
|
||||||
await game.forceEnemyMove(Moves.SPLASH);
|
|
||||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
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
|
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()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
game.move.select(Moves.SUPER_FANG);
|
game.move.select(Moves.SUPER_FANG);
|
||||||
await game.forceEnemyMove(Moves.SPLASH);
|
|
||||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
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);
|
expect(enemyPokemon.getHpRatio()).toBeCloseTo(0.5, 8);
|
||||||
});
|
});
|
||||||
it("should result in correct damage for hp% attacks with 3 lenses + Parental Bond", async () => {
|
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()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
game.move.select(Moves.SUPER_FANG);
|
game.move.select(Moves.SUPER_FANG);
|
||||||
await game.forceEnemyMove(Moves.SPLASH);
|
|
||||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
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);
|
expect(enemyPokemon.getHpRatio()).toBeCloseTo(0.25, 8);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user