From a8adfc2476c0d9907931a7b2c1a115dcf2d7cc5c Mon Sep 17 00:00:00 2001 From: "Adrian T." <68144167+torranx@users.noreply.github.com> Date: Mon, 29 Jul 2024 04:46:37 +0800 Subject: [PATCH] [Hotfix] Fix interactions of some moves not changing types (#3183) --- src/data/move.ts | 6 +++++- src/field/pokemon.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index a2b879a388b..ee7ad1abc02 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -717,9 +717,13 @@ export default class Move implements Localizable { * @returns The calculated power of the move. */ calculateBattlePower(source: Pokemon, target: Pokemon): number { - const power = new Utils.NumberHolder(this.power); + if (this.category === MoveCategory.STATUS) { + return -1; + } + const power = new Utils.NumberHolder(this.power); const typeChangeMovePowerMultiplier = new Utils.NumberHolder(1); + applyPreAttackAbAttrs(MoveTypeChangeAttr, source, target, this, typeChangeMovePowerMultiplier); const sourceTeraType = source.getTeraType(); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f630cc16a48..cd9ff748b0a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1836,7 +1836,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const types = this.getTypes(true, true); const cancelled = new Utils.BooleanHolder(false); + const power = move.calculateBattlePower(source, this); const typeless = move.hasAttr(TypelessAttr); + const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => types.includes(attr.immuneType))) ? this.getAttackTypeEffectiveness(move, source, false, false) : 1); @@ -1861,7 +1863,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { case MoveCategory.PHYSICAL: case MoveCategory.SPECIAL: const isPhysical = moveCategory === MoveCategory.PHYSICAL; - const power = move.calculateBattlePower(source, this); const sourceTeraType = source.getTeraType(); if (!typeless) {