pokeemerald/test/item_effect_revive.c

75 lines
2.3 KiB
C
Raw Normal View History

2023-04-24 14:16:17 +02:00
#include "global.h"
#include "test_battle.h"
SINGLE_BATTLE_TEST("Revive restores a fainted battler's HP to half")
2023-04-24 14:16:17 +02:00
{
GIVEN {
ASSUME(gItems[ITEM_REVIVE].battleUsage == EFFECT_ITEM_REVIVE);
2023-06-22 18:24:35 +02:00
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
2023-04-24 14:16:17 +02:00
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 {
2023-04-24 22:26:56 +02:00
MESSAGE("Wynaut had its HP restored!");
2023-04-25 23:06:07 +02:00
} THEN {
2023-06-22 18:24:35 +02:00
EXPECT_EQ(player->hp, 100);
2023-04-24 14:16:17 +02:00
}
}
SINGLE_BATTLE_TEST("Max Revive restores a fainted battler's HP fully")
2023-04-24 14:16:17 +02:00
{
GIVEN {
ASSUME(gItems[ITEM_MAX_REVIVE].battleUsage == EFFECT_ITEM_REVIVE);
2023-06-22 18:24:35 +02:00
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
2023-04-24 14:16:17 +02:00
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 {
2023-04-24 22:26:56 +02:00
MESSAGE("Wynaut had its HP restored!");
2023-04-25 23:06:07 +02:00
} THEN {
2023-06-22 18:24:35 +02:00
EXPECT_EQ(player->hp, 200);
2023-04-24 14:16:17 +02:00
}
}
SINGLE_BATTLE_TEST("Revival Herb restores a fainted battler's HP fully")
2023-04-24 14:16:17 +02:00
{
GIVEN {
ASSUME(gItems[ITEM_REVIVAL_HERB].battleUsage == EFFECT_ITEM_REVIVE);
2023-06-22 18:24:35 +02:00
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
2023-04-24 14:16:17 +02:00
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 {
2023-04-24 22:26:56 +02:00
MESSAGE("Wynaut had its HP restored!");
2023-04-25 23:06:07 +02:00
} THEN {
2023-06-22 18:24:35 +02:00
EXPECT_EQ(player->hp, 200);
2023-04-24 14:16:17 +02:00
}
}
SINGLE_BATTLE_TEST("Max Honey restores a fainted battler's HP fully")
2023-04-24 14:16:17 +02:00
{
GIVEN {
ASSUME(gItems[ITEM_MAX_HONEY].battleUsage == EFFECT_ITEM_REVIVE);
2023-06-22 18:24:35 +02:00
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
2023-04-24 14:16:17 +02:00
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 {
2023-04-24 22:26:56 +02:00
MESSAGE("Wynaut had its HP restored!");
2023-04-25 23:06:07 +02:00
} THEN {
2023-06-22 18:24:35 +02:00
EXPECT_EQ(player->hp, 200);
2023-04-24 14:16:17 +02:00
}
}