diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 642ea6f7c658..7dca24c28648 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3793,9 +3793,11 @@ void SetMoveEffect(bool32 primary, bool32 certain) SetMoveEffect(primary, certain); break; case MOVE_EFFECT_PSYCHIC_NOISE: - if (GetBattlerAbility(gEffectBattler) == ABILITY_AROMA_VEIL || GetBattlerAbility(BATTLE_PARTNER(gEffectBattler)) == ABILITY_AROMA_VEIL) + battlerAbility = IsAbilityOnSide(gEffectBattler, ABILITY_AROMA_VEIL); + + if (battlerAbility) { - gBattlerAbility = gEffectBattler; + gBattlerAbility = battlerAbility - 1; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_AromaVeilProtectsRet; } diff --git a/test/battle/move_effect/psychic_noise.c b/test/battle/move_effect/psychic_noise.c index 25d7f60795ab..405bbf492c35 100644 --- a/test/battle/move_effect/psychic_noise.c +++ b/test/battle/move_effect/psychic_noise.c @@ -54,3 +54,20 @@ SINGLE_BATTLE_TEST("Psychic Noise heal block effect is blocked by Aroma Veil") ANIMATION(ANIM_TYPE_MOVE, MOVE_RECOVER, opponent); } } + +DOUBLE_BATTLE_TEST("Psychic Noise heal block effect is blocked by partners Aroma Veil in doubles") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_MILCERY) { Ability(ABILITY_AROMA_VEIL); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_PSYCHIC_NOISE, target: opponentLeft); MOVE(opponentLeft, MOVE_RECOVER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PSYCHIC_NOISE, playerLeft); + ABILITY_POPUP(opponentRight, ABILITY_AROMA_VEIL); + MESSAGE("Foe Wobbuffet is protected by an aromatic veil!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_RECOVER, opponentLeft); + } +}