diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 80b05b89d16..9511fc87dc9 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -14,7 +14,6 @@ import { SelfStatusMove, VariablePowerAttr, applyMoveAttrs, - VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, @@ -6896,7 +6895,7 @@ export function initAbilities() { new Ability(Abilities.STRONG_JAW, 6) .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.BITING_MOVE), 1.5), new Ability(Abilities.REFRIGERATE, 6) - .attr(MoveTypeChangeAbAttr, PokemonType.ICE, 1.2, (user, target, move) => move.type === PokemonType.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), + .attr(MoveTypeChangeAbAttr, PokemonType.ICE, 1.2, (user, target, move) => move.type === PokemonType.NORMAL), new Ability(Abilities.SWEET_VEIL, 6) .attr(UserFieldStatusEffectImmunityAbAttr, StatusEffect.SLEEP) .attr(PostSummonUserFieldRemoveStatusEffectAbAttr, StatusEffect.SLEEP) @@ -6920,11 +6919,11 @@ export function initAbilities() { new Ability(Abilities.TOUGH_CLAWS, 6) .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), 1.3), new Ability(Abilities.PIXILATE, 6) - .attr(MoveTypeChangeAbAttr, PokemonType.FAIRY, 1.2, (user, target, move) => move.type === PokemonType.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), + .attr(MoveTypeChangeAbAttr, PokemonType.FAIRY, 1.2, (user, target, move) => move.type === PokemonType.NORMAL), new Ability(Abilities.GOOEY, 6) .attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT), Stat.SPD, -1, false), new Ability(Abilities.AERILATE, 6) - .attr(MoveTypeChangeAbAttr, PokemonType.FLYING, 1.2, (user, target, move) => move.type === PokemonType.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), + .attr(MoveTypeChangeAbAttr, PokemonType.FLYING, 1.2, (user, target, move) => move.type === PokemonType.NORMAL), new Ability(Abilities.PARENTAL_BOND, 6) .attr(AddSecondStrikeAbAttr, 0.25), new Ability(Abilities.DARK_AURA, 6) @@ -7001,7 +7000,7 @@ export function initAbilities() { new Ability(Abilities.TRIAGE, 7) .attr(ChangeMovePriorityAbAttr, (pokemon, move) => move.hasFlag(MoveFlags.TRIAGE_MOVE), 3), new Ability(Abilities.GALVANIZE, 7) - .attr(MoveTypeChangeAbAttr, PokemonType.ELECTRIC, 1.2, (user, target, move) => move.type === PokemonType.NORMAL && !move.hasAttr(VariableMoveTypeAttr)), + .attr(MoveTypeChangeAbAttr, PokemonType.ELECTRIC, 1.2, (user, target, move) => move.type === PokemonType.NORMAL), new Ability(Abilities.SURGE_SURFER, 7) .conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), StatMultiplierAbAttr, Stat.SPD, 2), new Ability(Abilities.SCHOOLING, 7) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index b0558d303f1..85f3007dd88 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -13,7 +13,7 @@ import { } from "../battler-tags"; import { getPokemonNameWithAffix } from "../../messages"; import type { AttackMoveResult, TurnMove } from "../../field/pokemon"; -import type Pokemon from "../../field/pokemon"; +import Pokemon from "../../field/pokemon"; import { EnemyPokemon, FieldPosition, @@ -4826,7 +4826,12 @@ export class FormChangeItemTypeAttr extends VariableMoveTypeAttr { return true; } - return false; + // Force move to have its original typing if it changed + if (moveType.value === move.type) { + return false; + } + moveType.value = move.type + return true; } } @@ -4977,7 +4982,11 @@ export class WeatherBallTypeAttr extends VariableMoveTypeAttr { moveType.value = PokemonType.ICE; break; default: - return false; + if (moveType.value === move.type) { + return false; + } + moveType.value = move.type; + break; } return true; } @@ -5025,7 +5034,12 @@ export class TerrainPulseTypeAttr extends VariableMoveTypeAttr { moveType.value = PokemonType.PSYCHIC; break; default: - return false; + if (moveType.value === move.type) { + return false; + } + // force move to have its original typing if it was changed + moveType.value = move.type; + break; } return true; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 492856b4b52..90f0c4275dd 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -9,7 +9,7 @@ import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo, } from "#app/ui/battle-info"; -import type Move from "#app/data/moves/move"; +import Move from "#app/data/moves/move"; import { HighCritAttr, HitsTagAttr, @@ -2583,8 +2583,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { */ public getMoveType(move: Move, simulated = true): PokemonType { const moveTypeHolder = new NumberHolder(move.type); + // If the user is terastallized and the move is tera blast, then the move type is the tera type - applyMoveAttrs(VariableMoveTypeAttr, this, null, move, moveTypeHolder); + // Abilities that change the move type go first applyPreAttackAbAttrs( MoveTypeChangeAbAttr, this, @@ -2593,6 +2594,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { simulated, moveTypeHolder, ); + // And then moves that change the move type go + applyMoveAttrs(VariableMoveTypeAttr, this, null, move, moveTypeHolder); + + // If the user is terastallized and the move is tera blast, or tera starstorm that is stellar type, + // then bypass the check for ion deluge + if (this.isTerastallized && (move.id === Moves.TERA_BLAST || move.id === Moves.TERA_STARSTORM && moveTypeHolder.value === PokemonType.STELLAR)) { + return moveTypeHolder.value as PokemonType; + } globalScene.arena.applyTags( ArenaTagType.ION_DELUGE,