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,26 +167,23 @@ 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, new PokemonMove(this.move.id, 0, 0, true),
new PokemonMove(this.move.id, 0, 0, true), 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);