Add forgotten check for substitute

This commit is contained in:
Sirz Benjie 2025-04-08 15:19:12 -05:00
parent 92c8349317
commit 46ac822524
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -628,16 +628,19 @@ export class MoveEffectPhase extends PokemonPhase {
* @returns a `Promise` intended to be passed into a `then()` call. * @returns a `Promise` intended to be passed into a `then()` call.
*/ */
protected applyOnGetHitAbEffects(user: Pokemon, target: Pokemon, hitResult: HitResult) { protected applyOnGetHitAbEffects(user: Pokemon, target: Pokemon, hitResult: HitResult) {
const hitsSubstitute = this.move.getMove().hitsSubstitute(user, target);
if (!target.isFainted() || target.canApplyAbility()) { if (!target.isFainted() || target.canApplyAbility()) {
applyPostDefendAbAttrs(PostDefendAbAttr, target, user, this.move.getMove(), hitResult); applyPostDefendAbAttrs(PostDefendAbAttr, target, user, this.move.getMove(), hitResult);
if (!this.move.getMove().hitsSubstitute(user, target)) { if (!hitsSubstitute) {
if (!user.isPlayer() && this.move.getMove() instanceof AttackMove) { if (!user.isPlayer() && this.move.getMove() instanceof AttackMove) {
globalScene.applyShuffledModifiers(EnemyAttackStatusEffectChanceModifier, false, target); globalScene.applyShuffledModifiers(EnemyAttackStatusEffectChanceModifier, false, target);
} }
} }
} }
target.lapseTags(BattlerTagLapseType.AFTER_HIT); if (!hitsSubstitute) {
target.lapseTags(BattlerTagLapseType.AFTER_HIT);
}
} }
/** /**