mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 08:16:04 +00:00
Merge branch 'beta' into linger-arena-trap-fix
This commit is contained in:
commit
bf4fffb5d0
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user