mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
Add forgotten check for substitute
This commit is contained in:
parent
92c8349317
commit
46ac822524
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user