#include "global.h" #include "test/battle.h" ASSUMPTIONS { ASSUME(gMovesInfo[MOVE_BELLY_DRUM].effect == EFFECT_BELLY_DRUM); } SINGLE_BATTLE_TEST("Belly Drum cuts the user's HP in half") { GIVEN { PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_BELLY_DRUM); } } SCENE { s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); HP_BAR(player, hp: maxHP / 2); } } SINGLE_BATTLE_TEST("Belly Drum maximizes the user's Attack stat", s16 damage) { bool32 raiseAttack; PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { if (raiseAttack) TURN { MOVE(player, MOVE_BELLY_DRUM); } TURN { MOVE(player, MOVE_TACKLE); } } SCENE { if (raiseAttack) { ANIMATION(ANIM_TYPE_MOVE, MOVE_BELLY_DRUM, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); MESSAGE("Wobbuffet cut its own HP and maximized ATTACK!"); } ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); HP_BAR(opponent, captureDamage: &results[i].damage); } FINALLY { EXPECT_MUL_EQ(results[0].damage, Q_4_12(4), results[1].damage); } } SINGLE_BATTLE_TEST("Belly Drum fails if user's current HP is half or less than half its maximum") { GIVEN { PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(50);} OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_BELLY_DRUM); } } SCENE { MESSAGE("But it failed!"); NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_BELLY_DRUM, player); HP_BAR(player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } } } SINGLE_BATTLE_TEST("Belly Drum fails if the user's Attack is already at +6") { GIVEN { ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_SWORDS_DANCE); } TURN { MOVE(player, MOVE_SWORDS_DANCE); } TURN { MOVE(player, MOVE_SWORDS_DANCE); } TURN { MOVE(player, MOVE_BELLY_DRUM); } } SCENE { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); MESSAGE("Wobbuffet's Attack sharply rose!"); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); MESSAGE("Wobbuffet's Attack sharply rose!"); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); MESSAGE("Wobbuffet's Attack sharply rose!"); MESSAGE("But it failed!"); NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_BELLY_DRUM, player); HP_BAR(player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); } } } SINGLE_BATTLE_TEST("Belly Drum's HP cost doesn't trigger effects that trigger on damage taken") { GIVEN { PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_AIR_BALLOON); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_BELLY_DRUM); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, MOVE_BELLY_DRUM, player); MESSAGE("Wobbuffet cut its own HP and maximized ATTACK!"); NOT MESSAGE("Wobbuffet's Air Balloon popped!"); } } TO_DO_BATTLE_TEST("Belly Drum maximizes the user's Attack stat, even when below 0"); TO_DO_BATTLE_TEST("Belly Drum minimizes the user's Attack stat if it has Contrary"); // Should still say "maximized attack" TO_DO_BATTLE_TEST("Belly Drum fails if the user's Attack is already at +6, even with Contrary"); TO_DO_BATTLE_TEST("Belly Drum deducts HP if the user has contrary and is at -6");