Fixes Psychic Noise, Aroma Veil interaction in doubles (#4021)

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
Alex 2024-01-20 14:10:22 +01:00 committed by GitHub
parent 58102e6fe8
commit b0c76563bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View file

@ -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;
}

View file

@ -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);
}
}