2023-04-14 20:25:50 +02:00
|
|
|
#include "global.h"
|
|
|
|
#include "test_battle.h"
|
|
|
|
|
2023-04-22 02:39:46 +02:00
|
|
|
#define TEST_HP 1
|
|
|
|
#define MAX_HP 400
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Potion restores a battler's HP by 20")
|
2023-04-14 20:25:50 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-14 20:25:50 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_POTION, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 20);
|
2023-04-14 20:25:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Super Potion restores a battler's HP by 60")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_SUPER_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_SUPER_POTION, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 60);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Hyper Potion restores a battler's HP by 120")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_HYPER_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_HYPER_POTION, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 120);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Max Potion restores a battler's HP fully")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_MAX_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_MAX_POTION, partyIndex: 0); }
|
2023-04-22 02:39:46 +02:00
|
|
|
} SCENE {
|
|
|
|
HP_BAR(player, hp: MAX_HP);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Fresh Water restores a battler's HP by 30")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_FRESH_WATER].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_FRESH_WATER, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 30);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Soda Pop restores a battler's HP by 50")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_SODA_POP].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_SODA_POP, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 50);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Lemonade restores a battler's HP by 70")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_LEMONADE].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_LEMONADE, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 70);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Moomoo Milk restores a battler's HP by 100")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_MOOMOO_MILK].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_MOOMOO_MILK, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 100);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Energy Powder restores a battler's HP by 60(50)")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_ENERGY_POWDER].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_ENERGY_POWDER, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
if (I_HEALTH_RECOVERY >= GEN_7)
|
|
|
|
HP_BAR(player, hp: TEST_HP + 60);
|
|
|
|
else
|
|
|
|
HP_BAR(player, hp: TEST_HP + 50);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Energy Root restores a battler's HP by 120(200)")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_ENERGY_ROOT].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_ENERGY_ROOT, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
if (I_HEALTH_RECOVERY >= GEN_7)
|
|
|
|
HP_BAR(player, hp: TEST_HP + 120);
|
|
|
|
else
|
|
|
|
HP_BAR(player, hp: TEST_HP + 200);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Sweet Heart restores a battler's HP by 20")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_SWEET_HEART].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_SWEET_HEART, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 20);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Oran Berry restores a battler's HP by 10")
|
2023-04-21 22:51:33 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_ORAN_BERRY].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-21 22:51:33 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_ORAN_BERRY, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 10);
|
2023-04-21 22:51:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-30 23:22:51 +02:00
|
|
|
SINGLE_BATTLE_TEST("Sitrus Berry restores a battler's HP by 25% of its max HP(30HP flat)")
|
2023-04-14 20:25:50 +02:00
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gItems[ITEM_SITRUS_BERRY].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
2023-04-22 02:39:46 +02:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
|
2023-04-14 20:25:50 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_SITRUS_BERRY, partyIndex: 0); }
|
|
|
|
} SCENE {
|
|
|
|
if (I_SITRUS_BERRY_HEAL >= GEN_4)
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + MAX_HP * 0.25);
|
2023-04-14 20:25:50 +02:00
|
|
|
else
|
2023-04-22 02:39:46 +02:00
|
|
|
HP_BAR(player, hp: TEST_HP + 30);
|
2023-04-14 20:25:50 +02:00
|
|
|
}
|
|
|
|
}
|
2023-04-22 02:39:46 +02:00
|
|
|
|
|
|
|
#undef TEST_HP
|
2023-04-26 12:12:41 +02:00
|
|
|
#undef MAX_HP
|