sovereignx/test/battle/item_effect/revive.c
Bassoonian b9a02b205d
Rename gItems and gAbilities to gItemsInfo and gAbilitiesInfo (#4068)
* Rename gItems to gItemsInfo

* Rename gAbilities to gAbilitiesInfo

* Just fixing up my bad merge

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-26 15:25:52 -03:00

76 lines
2.4 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Revive restores a fainted battler's HP to half")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_REVIVE].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); }
TURN { USE_ITEM(player, ITEM_REVIVE, partyIndex: 0); }
TURN { SWITCH(player, 0); }
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, 100);
}
}
SINGLE_BATTLE_TEST("Max Revive restores a fainted battler's HP fully")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_MAX_REVIVE].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); }
TURN { USE_ITEM(player, ITEM_MAX_REVIVE, partyIndex: 0); }
TURN { SWITCH(player, 0); }
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, 200);
}
}
SINGLE_BATTLE_TEST("Revival Herb restores a fainted battler's HP fully")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_REVIVAL_HERB].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); }
TURN { USE_ITEM(player, ITEM_REVIVAL_HERB, partyIndex: 0); }
TURN { SWITCH(player, 0); }
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, 200);
}
}
SINGLE_BATTLE_TEST("Max Honey restores a fainted battler's HP fully")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_MAX_HONEY].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); }
TURN { USE_ITEM(player, ITEM_MAX_HONEY, partyIndex: 0); }
TURN { SWITCH(player, 0); }
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, 200);
}
}
TO_DO_BATTLE_TEST("Revive won't restore a battler's HP if it hasn't fainted")