Fix magic coat/bounce

This commit is contained in:
Dean 2025-06-15 11:41:11 -07:00
parent 1441cf9171
commit 16d848c750

View File

@ -54,6 +54,7 @@ import { HitCheckResult } from "#enums/hit-check-result";
import type Move from "#app/data/moves/move"; import type Move from "#app/data/moves/move";
import { isFieldTargeted } from "#app/data/moves/move-utils"; import { isFieldTargeted } from "#app/data/moves/move-utils";
import { DamageAchv } from "#app/system/achv"; import { DamageAchv } from "#app/system/achv";
import { MovePhaseTimingModifier } from "#enums/move-phase-timing-modifier";
type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier]; type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier];
@ -166,18 +167,15 @@ export class MoveEffectPhase extends PokemonPhase {
: [user.getBattlerIndex()]; : [user.getBattlerIndex()];
// TODO: ability displays should be handled by the ability // TODO: ability displays should be handled by the ability
if (!target.getTag(BattlerTagType.MAGIC_COAT)) { if (!target.getTag(BattlerTagType.MAGIC_COAT)) {
this.queuedPhases.push( globalScene.phaseManager.unshiftNew(
globalScene.phaseManager.create(
"ShowAbilityPhase", "ShowAbilityPhase",
target.getBattlerIndex(), target.getBattlerIndex(),
target.getPassiveAbility().hasAttr("ReflectStatusMoveAbAttr"), target.getPassiveAbility().hasAttr("ReflectStatusMoveAbAttr"),
),
); );
this.queuedPhases.push(globalScene.phaseManager.create("HideAbilityPhase")); globalScene.phaseManager.unshiftNew("HideAbilityPhase");
} }
this.queuedPhases.push( globalScene.phaseManager.startNewDynamicPhase(
globalScene.phaseManager.create(
"MovePhase", "MovePhase",
target, target,
newTargets, newTargets,
@ -185,7 +183,7 @@ export class MoveEffectPhase extends PokemonPhase {
true, true,
true, true,
true, true,
), MovePhaseTimingModifier.FIRST,
); );
} }
@ -372,9 +370,6 @@ export class MoveEffectPhase extends PokemonPhase {
return; return;
} }
if (this.queuedPhases.length) {
globalScene.phaseManager.appendToPhase(this.queuedPhases, "MoveEndPhase");
}
const moveType = user.getMoveType(this.move, true); const moveType = user.getMoveType(this.move, true);
if (this.move.category !== MoveCategory.STATUS && !user.stellarTypesBoosted.includes(moveType)) { if (this.move.category !== MoveCategory.STATUS && !user.stellarTypesBoosted.includes(moveType)) {
user.stellarTypesBoosted.push(moveType); user.stellarTypesBoosted.push(moveType);