mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
5fe564f014
Fix Purifying Salt to be immune to statuses from secondary effects.
76 lines
2.5 KiB
C
76 lines
2.5 KiB
C
#include "global.h"
|
|
#include "test/battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gItems[ITEM_KEE_BERRY].holdEffect == HOLD_EFFECT_KEE_BERRY);
|
|
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Kee Berry raises the holder's Defense by one stage when hit by a physical move")
|
|
{
|
|
u16 move;
|
|
|
|
PARAMETRIZE { move = MOVE_SWIFT; }
|
|
PARAMETRIZE { move = MOVE_TACKLE; }
|
|
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_SWIFT].split == SPLIT_SPECIAL);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_KEE_BERRY); }
|
|
} WHEN {
|
|
TURN { MOVE(player, move); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, move, player);
|
|
HP_BAR(opponent);
|
|
if (move == MOVE_TACKLE) {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
MESSAGE("Using Kee Berry, the Defense of Foe Wobbuffet rose!");
|
|
} else {
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
MESSAGE("Using Kee Berry, the Defense of Foe Wobbuffet rose!");
|
|
}
|
|
}
|
|
} THEN {
|
|
if (move == MOVE_TACKLE)
|
|
EXPECT_EQ(opponent->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 1);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Kee Berry raises the holder's Defense by two stages with Ripen when hit by a physical move")
|
|
{
|
|
GIVEN {
|
|
ASSUME(P_GEN_8_POKEMON == TRUE);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_APPLIN) { Item(ITEM_KEE_BERRY); Ability(ABILITY_RIPEN); }
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_TACKLE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
|
|
HP_BAR(opponent);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
MESSAGE("Using Kee Berry, the Defense of Foe Applin sharply rose!");
|
|
} THEN {
|
|
EXPECT_EQ(opponent->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 2);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Kee Berry is not triggered by a special move")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_SWIFT].split == SPLIT_SPECIAL);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_KEE_BERRY); }
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_SWIFT); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWIFT, player);
|
|
HP_BAR(opponent);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
MESSAGE("Using Kee Berry, the Defense of Foe Wobbuffet rose!");
|
|
}
|
|
}
|
|
}
|