Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various tests, add RNG_RANDOM_TARGET #5438

Merged
merged 13 commits into from
Oct 11, 2024
26 changes: 25 additions & 1 deletion test/battle/move_effect/belly_drum.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,31 @@ SINGLE_BATTLE_TEST("Belly Drum's HP cost doesn't trigger effects that trigger on
}
}

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);
}
}

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");
19 changes: 18 additions & 1 deletion test/battle/status1/burn.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "global.h"
#include "test/battle.h"

#if B_BURN_DAMAGE >= GEN_7
SINGLE_BATTLE_TEST("Burn deals 1/16th damage per turn")
{
u32 j;
GIVEN {
ASSUME(B_BURN_DAMAGE >= GEN_LATEST);
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
Expand All @@ -17,6 +17,23 @@ SINGLE_BATTLE_TEST("Burn deals 1/16th damage per turn")
HP_BAR(player, damage: maxHP / 16);
}
}
#else
SINGLE_BATTLE_TEST("Burn deals 1/8th damage per turn")
{
u32 j;
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
for (j = 0; j < 4; j++)
TURN {}
} SCENE {
s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP);
for (j = 0; j < 4; j++)
HP_BAR(player, damage: maxHP / 8);
}
}
#endif

SINGLE_BATTLE_TEST("Burn reduces Attack by 50%", s16 damage)
{
Expand Down
Loading