2023-08-12 20:00:15 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
|
2024-10-11 22:47:46 +01:00
|
|
|
SINGLE_BATTLE_TEST("Burn deals 1/16th (Gen7+) or 1/8th damage per turn")
|
2023-08-12 20:00:15 +01:00
|
|
|
{
|
2023-10-12 11:14:07 +01:00
|
|
|
u32 j;
|
2023-08-12 20:00:15 +01:00
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
2023-10-12 11:14:07 +01:00
|
|
|
for (j = 0; j < 4; j++)
|
2023-08-12 20:00:15 +01:00
|
|
|
TURN {}
|
|
|
|
} SCENE {
|
|
|
|
s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP);
|
2023-10-12 11:14:07 +01:00
|
|
|
for (j = 0; j < 4; j++)
|
2024-10-11 22:47:46 +01:00
|
|
|
HP_BAR(player, damage: maxHP / ((B_BURN_DAMAGE >= GEN_7) ? 16 : 8));
|
2023-08-12 20:00:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Burn reduces Attack by 50%", s16 damage)
|
|
|
|
{
|
|
|
|
bool32 burned;
|
|
|
|
PARAMETRIZE { burned = FALSE; }
|
|
|
|
PARAMETRIZE { burned = TRUE; }
|
|
|
|
GIVEN {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
|
2023-08-12 20:00:15 +01:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { if (burned) Status1(STATUS1_BURN); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_TACKLE); }
|
|
|
|
} SCENE {
|
|
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
|
|
} FINALLY {
|
|
|
|
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
|
|
|
|
}
|
|
|
|
}
|
2024-07-03 09:48:31 +01:00
|
|
|
|
|
|
|
AI_SINGLE_BATTLE_TEST("AI avoids Will-o-Wisp when it can not burn target")
|
|
|
|
{
|
|
|
|
u32 species, ability;
|
|
|
|
|
|
|
|
PARAMETRIZE { species = SPECIES_BUIZEL; ability = ABILITY_WATER_VEIL; }
|
|
|
|
PARAMETRIZE { species = SPECIES_DEWPIDER; ability = ABILITY_WATER_BUBBLE; }
|
|
|
|
PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; }
|
|
|
|
PARAMETRIZE { species = SPECIES_ARCTIBAX; ability = ABILITY_THERMAL_EXCHANGE; }
|
|
|
|
PARAMETRIZE { species = SPECIES_NACLI; ability = ABILITY_PURIFYING_SALT; }
|
|
|
|
PARAMETRIZE { species = SPECIES_CHARMANDER; ability = ABILITY_BLAZE; }
|
|
|
|
|
|
|
|
GIVEN {
|
|
|
|
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_OMNISCIENT);
|
|
|
|
PLAYER(species) { Ability(ability); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_CELEBRATE, MOVE_WILL_O_WISP); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { SCORE_EQ(opponent, MOVE_CELEBRATE, MOVE_WILL_O_WISP); } // Both get -10
|
|
|
|
}
|
|
|
|
}
|