2023-12-28 22:27:09 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
|
|
|
|
ASSUMPTIONS
|
|
|
|
{
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_BELLY_DRUM].effect == EFFECT_BELLY_DRUM);
|
2023-12-28 22:27:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
|
2023-12-28 22:27:09 +00:00
|
|
|
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 {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2);
|
2023-12-28 22:27:09 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-05-09 14:22:48 +01:00
|
|
|
|
|
|
|
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!");
|
|
|
|
}
|
|
|
|
}
|
2024-06-01 14:07:51 +01:00
|
|
|
|
2024-10-11 22:47:46 +01:00
|
|
|
SINGLE_BATTLE_TEST("Belly Drum minimizes the user's Attack stat with Contrary", s16 damage)
|
|
|
|
{
|
|
|
|
bool32 raiseAttack;
|
|
|
|
PARAMETRIZE { raiseAttack = FALSE; }
|
|
|
|
PARAMETRIZE { raiseAttack = TRUE; }
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_CONTRARY); }
|
|
|
|
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!"); // Message unaffected by Contrary
|
|
|
|
}
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
|
|
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
|
|
} FINALLY {
|
|
|
|
EXPECT_MUL_EQ(results[1].damage, Q_4_12(4), results[0].damage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-01 14:07:51 +01:00
|
|
|
TO_DO_BATTLE_TEST("Belly Drum maximizes the user's Attack stat, even when below 0");
|
|
|
|
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");
|