2023-10-13 23:07:04 +02:00
|
|
|
#include "global.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
|
|
|
|
ASSUMPTIONS
|
|
|
|
{
|
|
|
|
ASSUME(gItems[ITEM_JABOCA_BERRY].holdEffect == HOLD_EFFECT_JABOCA_BERRY);
|
2023-10-22 21:22:59 +02:00
|
|
|
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
|
2023-10-13 23:07:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Jaboca Berry causes the attacker to lose 1/8 of its max HP if a physical 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 {
|
2023-10-22 21:22:59 +02:00
|
|
|
ASSUME(gBattleMoves[MOVE_SWIFT].split == SPLIT_SPECIAL);
|
2023-10-13 23:07:04 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_JABOCA_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_TACKLE) {
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
HP_BAR(player, captureDamage: &damage);
|
|
|
|
MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Jaboca Berry!");
|
|
|
|
} else {
|
|
|
|
NONE_OF {
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Jaboca Berry!");
|
|
|
|
}
|
|
|
|
}
|
2023-10-13 23:07:04 +02:00
|
|
|
} THEN {
|
2023-10-22 21:22:59 +02:00
|
|
|
if (move == MOVE_TACKLE)
|
|
|
|
EXPECT_EQ(player->maxHP / 8, damage);
|
2023-10-13 23:07:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-22 21:22:59 +02:00
|
|
|
SINGLE_BATTLE_TEST("Jaboca Berry tirggers before Bug Bite can steal it")
|
2023-10-13 23:07:04 +02:00
|
|
|
{
|
2023-10-22 21:22:59 +02:00
|
|
|
KNOWN_FAILING;
|
2023-10-13 23:07:04 +02:00
|
|
|
GIVEN {
|
2023-10-22 21:22:59 +02:00
|
|
|
ASSUME(gBattleMoves[MOVE_BUG_BITE].split == SPLIT_PHYSICAL);
|
|
|
|
PLAYER(SPECIES_WYNAUT);
|
2023-10-13 23:07:04 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_JABOCA_BERRY); }
|
|
|
|
} WHEN {
|
2023-10-22 21:22:59 +02:00
|
|
|
TURN { MOVE(player, MOVE_BUG_BITE); }
|
2023-10-13 23:07:04 +02:00
|
|
|
} SCENE {
|
2023-10-22 21:22:59 +02:00
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BUG_BITE, player);
|
2023-10-13 23:07:04 +02:00
|
|
|
HP_BAR(opponent);
|
2023-10-22 21:22:59 +02:00
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
|
|
HP_BAR(player);
|
|
|
|
MESSAGE("Wyanut was hurt by Foe Wobbuffet's Jaboca Berry!");
|
|
|
|
NOT MESSAGE("Wynaut stole and ate Foe Wobbuffet's Jaboca Berry!");
|
2023-10-13 23:07:04 +02:00
|
|
|
}
|
|
|
|
}
|