[Bug] fix pre defend power multiplier (#2416)

This commit is contained in:
Adrian T 2024-06-21 23:10:49 +08:00 committed by GitHub
parent 46135b5a68
commit 28b2dd15c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -1769,8 +1769,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
aura.applyPreAttack(null, null, null, move, [power]); aura.applyPreAttack(null, null, null, move, [power]);
} }
applyPreDefendAbAttrs(ReceivedMoveDamageMultiplierAbAttr, this, source, move, cancelled, power);
power.value *= typeChangeMovePowerMultiplier.value; power.value *= typeChangeMovePowerMultiplier.value;
if (!typeless) { if (!typeless) {
@ -1796,7 +1794,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && move.type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS) { if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && move.type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS) {
power.value /= 2; power.value /= 2;
} }
applyMoveAttrs(VariablePowerAttr, source, this, move, power); applyMoveAttrs(VariablePowerAttr, source, this, move, power);
this.scene.applyModifiers(PokemonMultiHitModifier, source.isPlayer(), source, new Utils.IntegerHolder(0), power); this.scene.applyModifiers(PokemonMultiHitModifier, source.isPlayer(), source, new Utils.IntegerHolder(0), power);
if (!typeless) { if (!typeless) {
this.scene.arena.applyTags(WeakenMoveTypeTag, move.type, power); this.scene.arena.applyTags(WeakenMoveTypeTag, move.type, power);
@ -1934,6 +1934,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
applyMoveAttrs(ModifiedDamageAttr, source, this, move, damage); applyMoveAttrs(ModifiedDamageAttr, source, this, move, damage);
applyPreDefendAbAttrs(ReceivedMoveDamageMultiplierAbAttr, this, source, move, cancelled, power);
if (power.value === 0) { if (power.value === 0) {
damage.value = 0; damage.value = 0;