2023-04-21 19:57:30 +01:00
|
|
|
#include "global.h"
|
2023-08-12 20:00:15 +01:00
|
|
|
#include "test/battle.h"
|
2023-04-21 19:57:30 +01:00
|
|
|
|
2024-02-09 12:58:16 +00:00
|
|
|
ASSUMPTIONS
|
|
|
|
{
|
2024-02-09 20:02:56 +00:00
|
|
|
ASSUME(gItemsInfo[ITEM_FULL_RESTORE].battleUsage == EFFECT_ITEM_HEAL_AND_CURE_STATUS);
|
2024-02-09 12:58:16 +00:00
|
|
|
}
|
|
|
|
|
2023-04-21 19:57:30 +01:00
|
|
|
SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures any primary status")
|
|
|
|
{
|
|
|
|
u16 status;
|
2024-06-20 12:46:01 +01:00
|
|
|
PARAMETRIZE { status = STATUS1_BURN; }
|
|
|
|
PARAMETRIZE { status = STATUS1_FREEZE; }
|
|
|
|
PARAMETRIZE { status = STATUS1_PARALYSIS; }
|
|
|
|
PARAMETRIZE { status = STATUS1_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_TOXIC_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_SLEEP; }
|
|
|
|
PARAMETRIZE { status = STATUS1_NONE; }
|
2023-04-21 19:57:30 +01:00
|
|
|
GIVEN {
|
2023-06-23 10:38:18 +01:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); Status1(status); }
|
2023-04-21 19:57:30 +01:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
2024-05-19 23:25:03 +01:00
|
|
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 0); }
|
2023-04-21 19:57:30 +01:00
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet had its HP restored.");
|
2024-02-09 12:58:16 +00:00
|
|
|
if (status != STATUS1_NONE) {
|
|
|
|
MESSAGE("Wobbuffet had its status healed!"); // The message is not printed if status wasn't healed.
|
|
|
|
}
|
2023-04-25 22:06:07 +01:00
|
|
|
} THEN {
|
2023-04-21 19:57:30 +01:00
|
|
|
EXPECT_EQ(player->hp, player->maxHP);
|
|
|
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
|
|
|
}
|
2023-04-21 20:57:00 +01:00
|
|
|
}
|
|
|
|
|
2024-05-19 23:25:03 +01:00
|
|
|
SINGLE_BATTLE_TEST("Full Restore restores a party members HP and cures any primary status")
|
|
|
|
{
|
|
|
|
u16 status;
|
2024-06-20 12:46:01 +01:00
|
|
|
PARAMETRIZE { status = STATUS1_BURN; }
|
|
|
|
PARAMETRIZE { status = STATUS1_FREEZE; }
|
|
|
|
PARAMETRIZE { status = STATUS1_PARALYSIS; }
|
|
|
|
PARAMETRIZE { status = STATUS1_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_TOXIC_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_SLEEP; }
|
|
|
|
PARAMETRIZE { status = STATUS1_NONE; }
|
2024-05-19 23:25:03 +01:00
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); Status1(status); }
|
|
|
|
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(300); Status1(status); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 1); }
|
|
|
|
TURN { SWITCH(player, 1); }
|
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wynaut had its HP restored.");
|
2024-05-19 23:25:03 +01:00
|
|
|
if (status != STATUS1_NONE) {
|
|
|
|
MESSAGE("Wynaut had its status healed!"); // The message is not printed if status wasn't healed.
|
|
|
|
}
|
|
|
|
} THEN {
|
|
|
|
EXPECT_EQ(player->hp, player->maxHP);
|
|
|
|
EXPECT_EQ(player->species, SPECIES_WYNAUT);
|
|
|
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-09 12:58:16 +00:00
|
|
|
SINGLE_BATTLE_TEST("Full Restore heals a battler from any primary status")
|
|
|
|
{
|
|
|
|
u16 status;
|
2024-06-20 12:46:01 +01:00
|
|
|
PARAMETRIZE { status = STATUS1_BURN; }
|
|
|
|
PARAMETRIZE { status = STATUS1_FREEZE; }
|
|
|
|
PARAMETRIZE { status = STATUS1_PARALYSIS; }
|
|
|
|
PARAMETRIZE { status = STATUS1_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_TOXIC_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_SLEEP; }
|
2024-02-09 12:58:16 +00:00
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Status1(status); }
|
|
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
NOT MESSAGE("Wobbuffet had its HP restored."); // The message is not printed if mon has max HP.
|
2024-02-09 12:58:16 +00:00
|
|
|
MESSAGE("Wobbuffet had its status healed!");
|
|
|
|
} THEN {
|
|
|
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-19 23:25:03 +01:00
|
|
|
SINGLE_BATTLE_TEST("Full Restore heals a party member from any primary status")
|
|
|
|
{
|
|
|
|
u16 status;
|
2024-06-20 12:46:01 +01:00
|
|
|
PARAMETRIZE { status = STATUS1_BURN; }
|
|
|
|
PARAMETRIZE { status = STATUS1_FREEZE; }
|
|
|
|
PARAMETRIZE { status = STATUS1_PARALYSIS; }
|
|
|
|
PARAMETRIZE { status = STATUS1_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_TOXIC_POISON; }
|
|
|
|
PARAMETRIZE { status = STATUS1_SLEEP; }
|
2024-05-19 23:25:03 +01:00
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
PLAYER(SPECIES_WYNAUT) { Status1(status); }
|
|
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
|
|
} WHEN {
|
|
|
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 1); }
|
|
|
|
TURN { SWITCH(player, 1); }
|
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
NOT MESSAGE("Wynaut had its HP restored."); // The message is not printed if mon has max HP.
|
2024-05-19 23:25:03 +01:00
|
|
|
MESSAGE("Wynaut had its status healed!");
|
|
|
|
} THEN {
|
|
|
|
EXPECT_EQ(player->species, SPECIES_WYNAUT);
|
|
|
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-21 20:57:00 +01:00
|
|
|
SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures confusion")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2023-06-23 10:38:18 +01:00
|
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); }
|
2023-04-21 20:57:00 +01:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN{ MOVE(opponent, MOVE_CONFUSE_RAY); }
|
|
|
|
TURN{ USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 0); }
|
|
|
|
TURN{ MOVE(player, MOVE_TACKLE); }
|
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet had its HP restored.");
|
2023-04-21 20:57:00 +01:00
|
|
|
NONE_OF { MESSAGE("Wobbuffet is confused!"); }
|
2023-04-25 22:06:07 +01:00
|
|
|
} THEN {
|
2023-04-21 20:57:00 +01:00
|
|
|
EXPECT_EQ(player->hp, player->maxHP);
|
|
|
|
}
|
|
|
|
}
|
2024-02-09 12:58:16 +00:00
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Full Restore resets Toxic Counter")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_TOXIC); }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 0); }
|
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet used Toxic!");
|
|
|
|
MESSAGE("Wobbuffet had its HP restored.");
|
2024-02-09 12:58:16 +00:00
|
|
|
MESSAGE("Wobbuffet had its status healed!");
|
|
|
|
} THEN {
|
|
|
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
|
|
|
}
|
|
|
|
}
|