Fixes negative priority being blocked by dazzling abilities (#6433)

This commit is contained in:
Alex 2025-03-17 21:48:50 +01:00 committed by GitHub
parent 3fa57381cd
commit f237b5fa1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View File

@ -4241,7 +4241,7 @@ static void ChooseStatBoostAnimation(u32 battler)
bool32 CanAbilityBlockMove(u32 battlerAtk, u32 battlerDef, u32 move, u32 abilityDef, enum AbilityEffectOptions option)
{
const u8 *battleScriptBlocksMove = NULL;
u32 atkPriority = AI_DATA->aiCalcInProgress ? GetBattleMovePriority(battlerAtk, move) : GetChosenMovePriority(battlerAtk);
s32 atkPriority = AI_DATA->aiCalcInProgress ? GetBattleMovePriority(battlerAtk, move) : GetChosenMovePriority(battlerAtk);
u32 moveTarget = GetBattlerMoveTargetType(battlerAtk, move);
u32 battlerAbility = battlerDef;

View File

@ -50,3 +50,25 @@ DOUBLE_BATTLE_TEST("Dazzling, Queenly Majesty and Armor Tail protect users partn
MESSAGE("Wobbuffet cannot use Quick Attack!");
}
}
DOUBLE_BATTLE_TEST("Dazzling, Queenly Majesty and Armor Tail don't protect the user from negative priority")
{
u32 species, ability;
PARAMETRIZE { species = SPECIES_BRUXISH; ability = ABILITY_DAZZLING; }
PARAMETRIZE { species = SPECIES_FARIGIRAF; ability = ABILITY_ARMOR_TAIL; }
PARAMETRIZE { species = SPECIES_TSAREENA; ability = ABILITY_QUEENLY_MAJESTY; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(species) { Ability(ability); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(playerLeft, MOVE_AVALANCHE, target: opponentLeft); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_AVALANCHE, playerLeft);
NOT ABILITY_POPUP(opponentLeft, ability);
}
}