pokeemerald/test/battle/ability/zen_mode.c

94 lines
3.6 KiB
C
Raw Normal View History

2023-03-24 14:04:38 +01:00
#include "global.h"
#include "test/battle.h"
2023-03-24 14:04:38 +01:00
SINGLE_BATTLE_TEST("Zen Mode switches Darmanitan's form when HP is half or less at the end of the turn")
{
u16 standardSpecies, zenSpecies;
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN; zenSpecies = SPECIES_DARMANITAN_ZEN_MODE; }
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN_GALARIAN; zenSpecies = SPECIES_DARMANITAN_ZEN_MODE_GALARIAN; }
GIVEN {
ASSUME(P_GEN_5_POKEMON == TRUE);
ASSUME(gSpeciesInfo[standardSpecies].baseHP == 105);
ASSUME(gSpeciesInfo[zenSpecies].baseHP == 105);
PLAYER(standardSpecies)
{
Ability(ABILITY_ZEN_MODE);
HP((GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP) / 2) + 1);
2023-06-23 11:38:18 +02:00
}
2023-03-24 14:04:38 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_TACKLE); }
} SCENE {
MESSAGE("Darmanitan used Celebrate!");
MESSAGE("Foe Wobbuffet used Tackle!");
HP_BAR(player);
ABILITY_POPUP(player, ABILITY_ZEN_MODE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
2023-03-24 14:04:38 +01:00
} THEN {
ASSUME(player->hp <= player->maxHP / 2);
EXPECT_EQ(player->species, zenSpecies);
}
}
SINGLE_BATTLE_TEST("Zen Mode switches Darmanitan's form when HP is half or less before the first turn")
{
u16 standardSpecies, zenSpecies;
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN; zenSpecies = SPECIES_DARMANITAN_ZEN_MODE; }
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN_GALARIAN; zenSpecies = SPECIES_DARMANITAN_ZEN_MODE_GALARIAN; }
GIVEN {
ASSUME(P_GEN_5_POKEMON == TRUE);
ASSUME(gSpeciesInfo[standardSpecies].baseHP == 105);
ASSUME(gSpeciesInfo[zenSpecies].baseHP == 105);
PLAYER(standardSpecies)
{
Ability(ABILITY_ZEN_MODE);
HP(GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP) / 2);
2023-06-23 11:38:18 +02:00
}
2023-03-24 14:04:38 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_ZEN_MODE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Darmanitan used Celebrate!");
MESSAGE("Foe Wobbuffet used Celebrate!");
} THEN {
EXPECT_LE(player->hp, player->maxHP / 2);
EXPECT_EQ(player->species, zenSpecies);
}
}
SINGLE_BATTLE_TEST("Zen Mode switches Darmanitan's form when HP is healed above half")
{
u16 standardSpecies, zenSpecies;
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN; zenSpecies = SPECIES_DARMANITAN_ZEN_MODE; }
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN_GALARIAN; zenSpecies = SPECIES_DARMANITAN_ZEN_MODE_GALARIAN; }
GIVEN {
ASSUME(P_GEN_5_POKEMON == TRUE);
ASSUME(gSpeciesInfo[standardSpecies].baseHP == 105);
ASSUME(gSpeciesInfo[zenSpecies].baseHP == 105);
PLAYER(standardSpecies)
{
Ability(ABILITY_ZEN_MODE);
HP(GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP) / 2);
2023-06-23 11:38:18 +02:00
}
2023-03-24 14:04:38 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_HEAL_PULSE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_ZEN_MODE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Darmanitan used Celebrate!");
MESSAGE("Foe Wobbuffet used Heal Pulse!");
HP_BAR(player);
ABILITY_POPUP(player, ABILITY_ZEN_MODE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
} THEN {
EXPECT_GT(player->hp, player->maxHP / 2);
EXPECT_EQ(player->species, standardSpecies);
}
}