sovereignx/test/battle/ability/zen_mode.c
kittenchilly db24128ee3
Update battle messages to Gen 5+ standards (#3240)
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
2024-10-21 14:52:45 -03:00

90 lines
3.6 KiB
C

#include "global.h"
#include "test/battle.h"
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_STANDARD; zenSpecies = SPECIES_DARMANITAN_ZEN; }
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN_GALAR_STANDARD; zenSpecies = SPECIES_DARMANITAN_GALAR_ZEN; }
GIVEN {
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);
}
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_TACKLE); }
} SCENE {
MESSAGE("Darmanitan used Celebrate!");
MESSAGE("The opposing Wobbuffet used Tackle!");
HP_BAR(player);
ABILITY_POPUP(player, ABILITY_ZEN_MODE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
} 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_STANDARD; zenSpecies = SPECIES_DARMANITAN_ZEN; }
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN_GALAR_STANDARD; zenSpecies = SPECIES_DARMANITAN_GALAR_ZEN; }
GIVEN {
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);
}
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("The opposing 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_STANDARD; zenSpecies = SPECIES_DARMANITAN_ZEN; }
PARAMETRIZE { standardSpecies = SPECIES_DARMANITAN_GALAR_STANDARD; zenSpecies = SPECIES_DARMANITAN_GALAR_ZEN; }
GIVEN {
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);
}
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("The opposing 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);
}
}