From 52f0f5a1495045215ff3a1bb41eed0b8d409847a Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 8 Apr 2024 16:02:12 -0400 Subject: [PATCH] Fix status move immunity not working (ie. Thunder Wave) --- src/data/splash-messages.ts | 1 - src/field/pokemon.ts | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/data/splash-messages.ts b/src/data/splash-messages.ts index 62d1cfec548..a1c0d3aada5 100644 --- a/src/data/splash-messages.ts +++ b/src/data/splash-messages.ts @@ -21,7 +21,6 @@ splashMessages.push(...[ 'Questionable Balancing!', 'Cool Shaders!', 'AI-Free!', - 'Help Wanted!', 'Sudden Difficulty Spikes!', 'Based on an Unfinished Flash Game!', 'More Addictive than Intended!', diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 72cf0c4d0ef..389e584425b 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1091,17 +1091,17 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // 2nd argument is for MoveTypeChangePowerMultiplierAbAttr applyAbAttrs(VariableMoveTypeAbAttr, source, null, variableType, typeChangeMovePowerMultiplier); const type = variableType.value as Type; + const types = this.getTypes(true, true); const cancelled = new Utils.BooleanHolder(false); const typeless = !!move.getAttrs(TypelessAttr).length; - const types = this.getTypes(true, true); - const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => (attr as StatusMoveTypeImmunityAttr).immuneType === type)) + const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => types.includes((attr as StatusMoveTypeImmunityAttr).immuneType))) ? getTypeDamageMultiplier(type, types[0]) * (types.length > 1 ? getTypeDamageMultiplier(type, types[1]) : 1) : 1); applyMoveAttrs(VariableMoveTypeMultiplierAttr, source, this, move, typeMultiplier); if (typeless) typeMultiplier.value = 1; - if (this.getTypes(true, true).find(t => move.isTypeImmune(t))) + if (types.find(t => move.isTypeImmune(t))) typeMultiplier.value = 0; switch (moveCategory) {