2023-10-13 23:07:04 +02:00
|
|
|
#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;
|
2023-10-22 21:22:59 +02:00
|
|
|
u16 move;
|
|
|
|
|
|
|
|
PARAMETRIZE { move = MOVE_SWIFT; }
|
|
|
|
PARAMETRIZE { move = MOVE_TACKLE; }
|
2023-10-13 23:07:04 +02:00
|
|
|
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gBattleMoves[MOVE_SWIFT].split == SPLIT_SPECIAL);
|
2023-10-22 21:22:59 +02:00
|
|
|
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
|
2023-10-13 23:07:04 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ROWAP_BERRY); }
|
|
|
|
} WHEN {
|
2023-10-22 21:22:59 +02:00
|
|
|
TURN { MOVE(player, move); }
|
2023-10-13 23:07:04 +02:00
|
|
|
} SCENE {
|
2023-10-22 21:22:59 +02:00
|
|
|
ANIMATION(ANIM_TYPE_MOVE, move, player);
|
2023-10-13 23:07:04 +02:00
|
|
|
HP_BAR(opponent);
|
2023-10-22 21:22:59 +02:00
|
|
|
if (move == MOVE_SWIFT) {
|
|
|
|
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!");
|
|
|
|
} else {
|
|
|
|
NONE_OF {
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Rowap Berry!");
|
|
|
|
}
|
|
|
|
}
|
2023-10-13 23:07:04 +02:00
|
|
|
} THEN {
|
2023-10-22 21:22:59 +02:00
|
|
|
if (move == MOVE_SWIFT)
|
|
|
|
EXPECT_EQ(player->maxHP / 8, damage);
|
2023-10-13 23:07:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2023-10-24 09:55:32 +02:00
|
|
|
NONE_OF {
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Rowap Berry!");
|
|
|
|
}
|
2023-10-13 23:07:04 +02:00
|
|
|
}
|
|
|
|
}
|