mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Schooling and Zen Mode tests
This commit is contained in:
parent
52011804b9
commit
498f4a2c97
111
test/ability_schooling.c
Normal file
111
test/ability_schooling.c
Normal file
@ -0,0 +1,111 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("Schooling switches Level 20+ Wishiwashi's form when HP is 25-percent or less at the end of the turn")
|
||||
{
|
||||
u16 level;
|
||||
PARAMETRIZE { level = 19; }
|
||||
PARAMETRIZE { level = 20; }
|
||||
|
||||
GIVEN {
|
||||
ASSUME(P_GEN_7_POKEMON == TRUE);
|
||||
ASSUME(gSpeciesInfo[SPECIES_WISHIWASHI].baseHP == gSpeciesInfo[SPECIES_WISHIWASHI_SCHOOL].baseHP);
|
||||
PLAYER(SPECIES_WISHIWASHI)
|
||||
{
|
||||
Level(level);
|
||||
HP(GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP) / 2);
|
||||
Ability(ABILITY_SCHOOLING);
|
||||
};
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_SUPER_FANG); }
|
||||
} SCENE {
|
||||
if (level >= 20)
|
||||
{
|
||||
ABILITY_POPUP(player, ABILITY_SCHOOLING);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
}
|
||||
MESSAGE("Wishiwashi used Celebrate!");
|
||||
MESSAGE("Foe Wobbuffet used Super Fang!");
|
||||
HP_BAR(player);
|
||||
if (level >= 20)
|
||||
{
|
||||
ABILITY_POPUP(player, ABILITY_SCHOOLING);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
}
|
||||
} THEN {
|
||||
EXPECT_EQ(player->species, SPECIES_WISHIWASHI);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Schooling switches Level 20+ Wishiwashi's form when HP is over 25-percent before the first turn")
|
||||
{
|
||||
u16 level;
|
||||
bool32 overQuarterHP;
|
||||
PARAMETRIZE { level = 19; overQuarterHP = FALSE; }
|
||||
PARAMETRIZE { level = 20; overQuarterHP = FALSE; }
|
||||
PARAMETRIZE { level = 19; overQuarterHP = TRUE; }
|
||||
PARAMETRIZE { level = 20; overQuarterHP = TRUE; }
|
||||
|
||||
GIVEN {
|
||||
ASSUME(P_GEN_7_POKEMON == TRUE);
|
||||
ASSUME(gSpeciesInfo[SPECIES_WISHIWASHI].baseHP == gSpeciesInfo[SPECIES_WISHIWASHI_SCHOOL].baseHP);
|
||||
PLAYER(SPECIES_WISHIWASHI)
|
||||
{
|
||||
Level(level);
|
||||
HP(GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP) / (overQuarterHP ? 2 : 4));
|
||||
Ability(ABILITY_SCHOOLING);
|
||||
};
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); }
|
||||
} SCENE {
|
||||
if (level >= 20 && overQuarterHP)
|
||||
{
|
||||
ABILITY_POPUP(player, ABILITY_SCHOOLING);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
}
|
||||
MESSAGE("Wishiwashi used Celebrate!");
|
||||
MESSAGE("Foe Wobbuffet used Celebrate!");
|
||||
} THEN {
|
||||
if (level >= 20 && overQuarterHP)
|
||||
EXPECT_EQ(player->species, SPECIES_WISHIWASHI_SCHOOL);
|
||||
else
|
||||
EXPECT_EQ(player->species, SPECIES_WISHIWASHI);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Schooling switches Level 20+ Wishiwashi's form when HP is healed above 25-percent")
|
||||
{
|
||||
u16 level;
|
||||
PARAMETRIZE { level = 19; }
|
||||
PARAMETRIZE { level = 20; }
|
||||
|
||||
GIVEN {
|
||||
ASSUME(P_GEN_7_POKEMON == TRUE);
|
||||
ASSUME(gSpeciesInfo[SPECIES_WISHIWASHI].baseHP == gSpeciesInfo[SPECIES_WISHIWASHI_SCHOOL].baseHP);
|
||||
PLAYER(SPECIES_WISHIWASHI)
|
||||
{
|
||||
Level(level);
|
||||
HP(GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP) / 4);
|
||||
Ability(ABILITY_SCHOOLING);
|
||||
};
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_HEAL_PULSE); }
|
||||
} SCENE {
|
||||
MESSAGE("Wishiwashi used Celebrate!");
|
||||
MESSAGE("Foe Wobbuffet used Heal Pulse!");
|
||||
HP_BAR(player);
|
||||
if (level >= 20)
|
||||
{
|
||||
ABILITY_POPUP(player, ABILITY_SCHOOLING);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
}
|
||||
} THEN {
|
||||
if (level >= 20)
|
||||
EXPECT_EQ(player->species, SPECIES_WISHIWASHI_SCHOOL);
|
||||
else
|
||||
EXPECT_EQ(player->species, SPECIES_WISHIWASHI);
|
||||
}
|
||||
}
|
93
test/ability_zen_mode.c
Normal file
93
test/ability_zen_mode.c
Normal file
@ -0,0 +1,93 @@
|
||||
#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; 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);
|
||||
};
|
||||
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);
|
||||
} 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);
|
||||
};
|
||||
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);
|
||||
};
|
||||
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);
|
||||
}
|
||||
}
|
@ -938,6 +938,7 @@ void Level_(u32 sourceLine, u32 level)
|
||||
INVALID_IF(level == 0 || level > MAX_LEVEL, "Illegal level: %d", level);
|
||||
SetMonData(DATA.currentMon, MON_DATA_LEVEL, &level);
|
||||
SetMonData(DATA.currentMon, MON_DATA_EXP, &gExperienceTables[gSpeciesInfo[species].growthRate][level]);
|
||||
CalculateMonStats(DATA.currentMon);
|
||||
}
|
||||
|
||||
void MaxHP_(u32 sourceLine, u32 maxHP)
|
||||
|
Loading…
Reference in New Issue
Block a user