#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!"); } }