sovereignx/test/battle/hold_effect/leftovers.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

54 lines
1.5 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItemsInfo[ITEM_LEFTOVERS].holdEffect == HOLD_EFFECT_LEFTOVERS);
}
SINGLE_BATTLE_TEST("Leftovers recovers 1/16th HP at end of turn")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(1); Item(ITEM_LEFTOVERS); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {}
} SCENE {
s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet's Leftovers restored its HP a little!");
HP_BAR(player, damage: -maxHP / 16);
}
}
SINGLE_BATTLE_TEST("Leftovers does nothing if max HP")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LEFTOVERS); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {}
} SCENE {
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet's Leftovers restored its HP a little!");
HP_BAR(player);
}
}
}
SINGLE_BATTLE_TEST("Leftovers does nothing if Heal Block applies")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(1); Item(ITEM_LEFTOVERS); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HEAL_BLOCK); }
} SCENE {
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet's Leftovers restored its HP a little!");
HP_BAR(player);
}
}
}