diff --git a/src/data/ability.ts b/src/data/ability.ts index 4194be31405..d58c6c5c9b9 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1367,7 +1367,7 @@ export class AddSecondStrikeAbAttr extends PreAttackAbAttr { const hitCount = args[0] as Utils.NumberHolder; const multiplier = args[1] as Utils.NumberHolder; - if (move.canBeMultiStrikeEnhanced(pokemon)) { + if (move.canBeMultiStrikeEnhanced(pokemon, true)) { this.showAbility = !!hitCount?.value; if (hitCount?.value) { hitCount.value += 1; diff --git a/src/data/move.ts b/src/data/move.ts index c1d33a1a4c3..040bbefdf08 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -818,8 +818,6 @@ export default class Move implements Localizable { applyMoveAttrs(VariablePowerAttr, source, target, this, power); - source.scene.applyModifiers(PokemonMultiHitModifier, source.isPlayer(), source, this.id, null, power); - if (!this.hasAttr(TypelessAttr)) { source.scene.arena.applyTags(WeakenMoveTypeTag, simulated, this.type, power); source.scene.applyModifiers(AttackTypeBoosterModifier, source.isPlayer(), source, this.type, power); @@ -846,8 +844,11 @@ export default class Move implements Localizable { * by enhancing effects. * Currently used for {@link https://bulbapedia.bulbagarden.net/wiki/Parental_Bond_(Ability) | Parental Bond} * and {@linkcode PokemonMultiHitModifier | Multi-Lens}. + * @param user The {@linkcode Pokemon} using the move + * @param restrictSpread `true` if the enhancing effect + * should not affect multi-target moves (default `false`) */ - canBeMultiStrikeEnhanced(user: Pokemon): boolean { + canBeMultiStrikeEnhanced(user: Pokemon, restrictSpread: boolean = false): boolean { // Multi-strike enhancers... // ...cannot enhance moves that hit multiple targets @@ -870,7 +871,7 @@ export default class Move implements Localizable { Moves.ENDEAVOR ]; - return !isMultiTarget + return (!restrictSpread || !isMultiTarget) && !this.isChargingMove() && !exceptAttrs.some(attr => this.hasAttr(attr)) && !exceptMoves.some(id => this.id === id) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 5e60d888072..7aa4b9308d1 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -2715,7 +2715,7 @@ export class PokemonMultiHitModifier extends PokemonHeldItemModifier { if (!isNullOrUndefined(count)) { return this.applyHitCountBoost(count); } else if (!isNullOrUndefined(damageMultiplier)) { - return this.applyPowerModifier(pokemon, damageMultiplier); + return this.applyDamageModifier(pokemon, damageMultiplier); } return false; @@ -2732,7 +2732,7 @@ export class PokemonMultiHitModifier extends PokemonHeldItemModifier { * equal to (1 - the number of stacked Multi-Lenses). * Additional strikes beyond that are given a 0.25x damage multiplier */ - private applyPowerModifier(pokemon: Pokemon, damageMultiplier: NumberHolder): boolean { + private applyDamageModifier(pokemon: Pokemon, damageMultiplier: NumberHolder): boolean { damageMultiplier.value = (pokemon.turnData.hitsLeft === pokemon.turnData.hitCount) ? (1 - (0.25 * this.getStackCount())) : 0.25; diff --git a/src/test/items/multi_lens.test.ts b/src/test/items/multi_lens.test.ts index e4e4ab9863e..d389ca70555 100644 --- a/src/test/items/multi_lens.test.ts +++ b/src/test/items/multi_lens.test.ts @@ -95,4 +95,23 @@ describe("Items - Multi Lens", () => { await game.phaseInterceptor.to("BerryPhase", false); expect(playerPokemon.turnData.hitCount).toBe(2); }); + + it("should enhance multi-target moves", async () => { + game.override + .battleType("double") + .moveset([ Moves.SWIFT, Moves.SPLASH ]); + + await game.classicMode.startBattle([ Species.MAGIKARP, Species.FEEBAS ]); + + const [ magikarp, ] = game.scene.getPlayerField(); + + game.move.select(Moves.SWIFT, 0); + game.move.select(Moves.SPLASH, 1); + + await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2 ]); + + await game.phaseInterceptor.to("MoveEndPhase"); + + expect(magikarp.turnData.hitCount).toBe(2); + }); });