mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
Multi-Lens now applies to spread moves
This commit is contained in:
parent
4802f512ff
commit
f77d2804e9
@ -1367,7 +1367,7 @@ export class AddSecondStrikeAbAttr extends PreAttackAbAttr {
|
|||||||
const hitCount = args[0] as Utils.NumberHolder;
|
const hitCount = args[0] as Utils.NumberHolder;
|
||||||
const multiplier = args[1] as Utils.NumberHolder;
|
const multiplier = args[1] as Utils.NumberHolder;
|
||||||
|
|
||||||
if (move.canBeMultiStrikeEnhanced(pokemon)) {
|
if (move.canBeMultiStrikeEnhanced(pokemon, true)) {
|
||||||
this.showAbility = !!hitCount?.value;
|
this.showAbility = !!hitCount?.value;
|
||||||
if (hitCount?.value) {
|
if (hitCount?.value) {
|
||||||
hitCount.value += 1;
|
hitCount.value += 1;
|
||||||
|
@ -846,8 +846,11 @@ export default class Move implements Localizable {
|
|||||||
* by enhancing effects.
|
* by enhancing effects.
|
||||||
* Currently used for {@link https://bulbapedia.bulbagarden.net/wiki/Parental_Bond_(Ability) | Parental Bond}
|
* Currently used for {@link https://bulbapedia.bulbagarden.net/wiki/Parental_Bond_(Ability) | Parental Bond}
|
||||||
* and {@linkcode PokemonMultiHitModifier | Multi-Lens}.
|
* 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...
|
// Multi-strike enhancers...
|
||||||
|
|
||||||
// ...cannot enhance moves that hit multiple targets
|
// ...cannot enhance moves that hit multiple targets
|
||||||
@ -870,7 +873,7 @@ export default class Move implements Localizable {
|
|||||||
Moves.ENDEAVOR
|
Moves.ENDEAVOR
|
||||||
];
|
];
|
||||||
|
|
||||||
return !isMultiTarget
|
return (!restrictSpread || !isMultiTarget)
|
||||||
&& !this.isChargingMove()
|
&& !this.isChargingMove()
|
||||||
&& !exceptAttrs.some(attr => this.hasAttr(attr))
|
&& !exceptAttrs.some(attr => this.hasAttr(attr))
|
||||||
&& !exceptMoves.some(id => this.id === id)
|
&& !exceptMoves.some(id => this.id === id)
|
||||||
|
@ -95,4 +95,23 @@ describe("Items - Multi Lens", () => {
|
|||||||
await game.phaseInterceptor.to("BerryPhase", false);
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
expect(playerPokemon.turnData.hitCount).toBe(2);
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user