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,17 +628,20 @@ export class MoveEffectPhase extends PokemonPhase {
* @returns a `Promise` intended to be passed into a `then()` call.
*/
protected applyOnGetHitAbEffects(user: Pokemon, target: Pokemon, hitResult: HitResult) {
const hitsSubstitute = this.move.getMove().hitsSubstitute(user, target);
if (!target.isFainted() || target.canApplyAbility()) {
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) {
globalScene.applyShuffledModifiers(EnemyAttackStatusEffectChanceModifier, false, target);
}
}
}
if (!hitsSubstitute) {
target.lapseTags(BattlerTagLapseType.AFTER_HIT);
}
}
/**
* Applies all effects and attributes that require a move to connect with a target,