pokeemerald/test/battle/hold_effect/rowap_berry.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

45 lines
1.4 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItems[ITEM_ROWAP_BERRY].holdEffect == HOLD_EFFECT_ROWAP_BERRY);
}
SINGLE_BATTLE_TEST("Rowap Berry causes the attacker to lose 1/8 of its max HP if a special move was used")
{
s16 damage;
GIVEN {
ASSUME(gBattleMoves[MOVE_SWIFT].split == SPLIT_SPECIAL);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ROWAP_BERRY); }
} WHEN {
TURN { MOVE(player, MOVE_SWIFT); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWIFT, player);
HP_BAR(opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
HP_BAR(player, captureDamage: &damage);
MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Rowap Berry!");
} THEN {
EXPECT_EQ(player->maxHP / 8, damage);
}
}
SINGLE_BATTLE_TEST("Rowap Berry is not triggered by a physical move")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ROWAP_BERRY); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
HP_BAR(opponent);
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
NOT MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Rowap Berry!");
}
}