Add forgotten check for substitute

This commit is contained in:
Sirz Benjie 2025-04-08 15:19:12 -05:00
parent 3465c68071
commit 92a21c5666
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
1 changed files with 5 additions and 2 deletions

View File

@ -628,16 +628,19 @@ 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);
}
}
}
target.lapseTags(BattlerTagLapseType.AFTER_HIT);
if (!hitsSubstitute) {
target.lapseTags(BattlerTagLapseType.AFTER_HIT);
}
}
/**