pokeemerald/test/battle/hold_effect/attack_up.c
Alex 1ae26b32e6
Fix Kee Berry and Custap Berry + Tests (#3409)
* Fix Kee Berry and Custap Berry + Tests

* add missing assumes

* fix wrong test files

* fix new line
2023-10-13 23:07:04 +02:00

72 lines
2.5 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItems[ITEM_LIECHI_BERRY].holdEffect == HOLD_EFFECT_ATTACK_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_DRAGON_RAGE);
}
SINGLE_BATTLE_TEST("Liechi Berry raises the holder's Attack by one stage when HP drops to 1/4 or below")
{
u32 move;
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_DRAGON_RAGE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { MaxHP(160); HP(80); Item(ITEM_LIECHI_BERRY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
if (move == MOVE_TACKLE)
{
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
NOT MESSAGE("Using Liechi Berry, the Attack of Wobbuffet rose!");
}
else
{
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Using Liechi Berry, the Attack of Wobbuffet rose!");
}
} THEN {
if (move == MOVE_DRAGON_RAGE)
EXPECT_EQ(player->statStages[STAT_ATK], 7);
}
}
SINGLE_BATTLE_TEST("Liechi Berry raises Attack by one stage when HP drops to 1/2 or below if holder has Gluttony")
{
GIVEN {
PLAYER(SPECIES_BELLSPROUT) { MaxHP(80); HP(80); Ability(ABILITY_GLUTTONY); Item(ITEM_LIECHI_BERRY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_DRAGON_RAGE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_RAGE, opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Using Liechi Berry, the Attack of Bellsprout rose!");
} THEN {
EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1);
}
}
SINGLE_BATTLE_TEST("Liechi Berry raises Attack by one stage when HP drops to 1/4 or below if holder has Ripen")
{
GIVEN {
ASSUME(P_GEN_8_POKEMON == TRUE);
PLAYER(SPECIES_APPLIN) { MaxHP(160); HP(80); Ability(ABILITY_RIPEN); Item(ITEM_LIECHI_BERRY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_DRAGON_RAGE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_RAGE, opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Using Liechi Berry, the Attack of Applin sharply rose!");
} THEN {
EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 2);
}
}