sovereignx/test/battle/hold_effect/jaboca_berry.c
kittenchilly db24128ee3
Update battle messages to Gen 5+ standards (#3240)
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
2024-10-21 14:52:45 -03:00

60 lines
2 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItemsInfo[ITEM_JABOCA_BERRY].holdEffect == HOLD_EFFECT_JABOCA_BERRY);
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
}
SINGLE_BATTLE_TEST("Jaboca Berry causes the attacker to lose 1/8 of its max HP if a physical move was used")
{
s16 damage;
u16 move;
PARAMETRIZE { move = MOVE_SWIFT; }
PARAMETRIZE { move = MOVE_TACKLE; }
GIVEN {
ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_JABOCA_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);
HP_BAR(player, captureDamage: &damage);
MESSAGE("Wobbuffet was hurt by the opposing Wobbuffet's Jaboca Berry!");
} else {
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Wobbuffet was hurt by the opposing Wobbuffet's Jaboca Berry!");
}
}
} THEN {
if (move == MOVE_TACKLE)
EXPECT_EQ(player->maxHP / 8, damage);
}
}
SINGLE_BATTLE_TEST("Jaboca Berry tirggers before Bug Bite can steal it")
{
KNOWN_FAILING;
GIVEN {
ASSUME(gMovesInfo[MOVE_BUG_BITE].category == DAMAGE_CATEGORY_PHYSICAL);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_JABOCA_BERRY); }
} WHEN {
TURN { MOVE(player, MOVE_BUG_BITE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BUG_BITE, player);
HP_BAR(opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
HP_BAR(player);
MESSAGE("Wyanut was hurt by the opposing Wobbuffet's Jaboca Berry!");
NOT MESSAGE("Wynaut stole and ate the opposing its target's Jaboca Berry!");
}
}