Fixes Bug Bite eaten berry not ignoring Unnerve (#6666)
This commit is contained in:
parent
007d7e712e
commit
72839fc002
@ -5106,6 +5106,9 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
gProtectStructs[i].spikyShielded = FALSE;
|
||||
gProtectStructs[i].kingsShielded = FALSE;
|
||||
gProtectStructs[i].banefulBunkered = FALSE;
|
||||
gProtectStructs[i].obstructed = FALSE;
|
||||
gProtectStructs[i].silkTrapped = FALSE;
|
||||
gProtectStructs[i].burningBulwarked = FALSE;
|
||||
gProtectStructs[i].quash = FALSE;
|
||||
gProtectStructs[i].usedCustapBerry = FALSE;
|
||||
gProtectStructs[i].quickDraw = FALSE;
|
||||
|
||||
@ -7234,6 +7234,9 @@ static u32 ItemHealHp(u32 battler, u32 itemId, enum ItemCaseId caseID, bool32 pe
|
||||
|
||||
static bool32 UnnerveOn(u32 battler, u32 itemId)
|
||||
{
|
||||
if (gBattleScripting.overrideBerryRequirements > 0) // Berries that aren't eaten naturally ignore unnerve
|
||||
return FALSE;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == POCKET_BERRIES && IsUnnerveAbilityOnOpposingSide(battler))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
|
||||
@ -133,3 +133,18 @@ SINGLE_BATTLE_TEST("Tanga Berry activates before Bug Bite")
|
||||
EXPECT_EQ(player->item, ITEM_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Bug Bite ignores Unnerve")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||
OPPONENT(SPECIES_TYRANITAR) { Ability(ABILITY_UNNERVE); Item(ITEM_ORAN_BERRY); }
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_BUG_BITE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BUG_BITE, player);
|
||||
HP_BAR(player);
|
||||
} THEN {
|
||||
EXPECT_EQ(opponent->item, ITEM_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user