mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
67 lines
2.5 KiB
C
67 lines
2.5 KiB
C
#include "global.h"
|
|
#include "test_battle.h"
|
|
|
|
SINGLE_BATTLE_TEST("Restore PP: Ether restores the PP of one of a battler's moves by 10 ")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gItems[ITEM_ETHER].battleUsage == EFFECT_ITEM_RESTORE_PP);
|
|
ASSUME(gItems[ITEM_ETHER].type == ITEM_USE_PARTY_MENU_MOVES);
|
|
PLAYER(SPECIES_WOBBUFFET) { MovesWithPP({MOVE_TACKLE, 0}, {MOVE_CONFUSION, 20}); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { USE_ITEM(player, ITEM_ETHER, partyIndex: 0, move: MOVE_TACKLE); }
|
|
} THEN {
|
|
EXPECT_EQ(player->pp[0], 10);
|
|
EXPECT_EQ(player->pp[1], 20);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Restore PP: Max Ether restores the PP of one of a battler's moves fully")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gItems[ITEM_MAX_ETHER].battleUsage == EFFECT_ITEM_RESTORE_PP);
|
|
ASSUME(gItems[ITEM_MAX_ETHER].type == ITEM_USE_PARTY_MENU_MOVES);
|
|
PLAYER(SPECIES_WOBBUFFET) { MovesWithPP({MOVE_TACKLE, 0}, {MOVE_CONFUSION, 20}); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { USE_ITEM(player, ITEM_MAX_ETHER, partyIndex: 0, move: MOVE_TACKLE); }
|
|
} THEN {
|
|
EXPECT_EQ(player->pp[0], 35);
|
|
EXPECT_EQ(player->pp[1], 20);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Restore PP: Elixir restores the PP of all of a battler's moves by 10")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gItems[ITEM_ELIXIR].battleUsage == EFFECT_ITEM_RESTORE_PP);
|
|
ASSUME(gItems[ITEM_ELIXIR].type == ITEM_USE_PARTY_MENU);
|
|
PLAYER(SPECIES_WOBBUFFET) { MovesWithPP({MOVE_TACKLE, 0}, {MOVE_CONFUSION, 0}, {MOVE_SCRATCH, 0}, {MOVE_GROWL, 0}); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { USE_ITEM(player, ITEM_ELIXIR, partyIndex: 0); }
|
|
} THEN {
|
|
EXPECT_EQ(player->pp[0], 10);
|
|
EXPECT_EQ(player->pp[1], 10);
|
|
EXPECT_EQ(player->pp[2], 10);
|
|
EXPECT_EQ(player->pp[3], 10);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Restore PP: Max Elixir restores the PP of all of a battler's moves fully")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gItems[ITEM_MAX_ELIXIR].battleUsage == EFFECT_ITEM_RESTORE_PP);
|
|
ASSUME(gItems[ITEM_MAX_ELIXIR].type == ITEM_USE_PARTY_MENU);
|
|
PLAYER(SPECIES_WOBBUFFET) { MovesWithPP({MOVE_TACKLE, 0}, {MOVE_CONFUSION, 0}, {MOVE_SCRATCH, 0}, {MOVE_GROWL, 0}); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { USE_ITEM(player, ITEM_MAX_ELIXIR, partyIndex: 0); }
|
|
} THEN {
|
|
EXPECT_EQ(player->pp[0], 35);
|
|
EXPECT_EQ(player->pp[1], 25);
|
|
EXPECT_EQ(player->pp[2], 35);
|
|
EXPECT_EQ(player->pp[3], 40);
|
|
}
|
|
}
|