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