Magic bounce should not bounce anything during semi-invulnerable state

This commit is contained in:
Sirz Benjie 2025-02-04 21:30:06 -06:00
parent 4b61766430
commit dcc4ce5d18
No known key found for this signature in database
GPG Key ID: D4BFA840253CD6D7

View File

@ -264,16 +264,12 @@ export class MoveEffectPhase extends PokemonPhase {
const canMagicBounce = !isReflecting && !move.checkFlag(MoveFlags.IGNORE_ABILITIES, user, target) && target.hasAbilityWithAttr(ReflectStatusMoveAbAttr);
const semiInvulnerableTag = target.getTag(SemiInvulnerableTag);
/** Is the target in a semi-invulnerable state that isn't being bypassed by this move? */
const activeSemiInvulnerability = !!semiInvulnerableTag &&
!(this.checkBypassSemiInvuln(semiInvulnerableTag)
|| this.checkBypassAccAndInvuln(target));
/** Is the target reflecting the effect, not protected, and not in an semi-invulnerable state?*/
const willBounce = (!isProtected && !this.reflected && !isCommanding
&& move.hasFlag(MoveFlags.REFLECTABLE)
&& (isReflecting || canMagicBounce)
&& !activeSemiInvulnerability);
&& !semiInvulnerableTag);
// If the move will bounce, then queue the bounce and move on to the next target
if (!target.switchOutStatus && willBounce) {