sovereignx/test/battle/hold_effect/leftovers.c
DizzyEggg a7b9d139da
Fix Wall Werrors on modern (#3412)
* Fix Wall Werror errors

* fix hgss pokedex modern errors

* tests build on modern

* learnset change

* Update src/battle_ai_util.c

Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>

* Update src/battle_anim_new.c

Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>

* Update src/debug.c

Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>

* Update src/debug.c

Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>

* Update src/pokedex_plus_hgss.c

Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>

* review changes

* unused cmd args

* various args back

---------

Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>
2023-10-13 18:39:35 +02:00

54 lines
1.5 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItems[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);
}
}
}