pokeemerald/test/battle/hold_effect/white_herb.c
2023-10-30 10:58:30 -03:00

71 lines
2.5 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItems[ITEM_WHITE_HERB].holdEffect == HOLD_EFFECT_RESTORE_STATS);
}
SINGLE_BATTLE_TEST("White Herb restores stats when they're lowered")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_WHITE_HERB); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_LEER); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet's White Herb restored its status!");
} THEN {
EXPECT(player->item == ITEM_NONE);
EXPECT(player->statStages[STAT_DEF] = DEFAULT_STAT_STAGE);
}
}
SINGLE_BATTLE_TEST("White Herb restores stats after Attack was lowered by Intimidate in singles")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_WHITE_HERB); }
OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); }
} WHEN {
TURN { ; }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet's White Herb restored its status!");
} THEN {
EXPECT(player->item == ITEM_NONE);
EXPECT(player->statStages[STAT_DEF] = DEFAULT_STAT_STAGE);
}
}
DOUBLE_BATTLE_TEST("White Herb restores stats after Attack was lowered by Intimidate in doubles")
{
GIVEN {
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_WHITE_HERB); }
OPPONENT(SPECIES_WYNAUT) { Item(ITEM_WHITE_HERB); }
PLAYER(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); }
PLAYER(SPECIES_WOBBUFFET);
} WHEN {
TURN { ; }
} SCENE {
ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft);
MESSAGE("Foe Wobbuffet's White Herb restored its status!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight);
MESSAGE("Foe Wynaut's White Herb restored its status!");
} THEN {
EXPECT(opponentLeft->item == ITEM_NONE);
EXPECT(opponentLeft->statStages[STAT_DEF] = DEFAULT_STAT_STAGE);
EXPECT(opponentRight->item == ITEM_NONE);
EXPECT(opponentRight->statStages[STAT_DEF] = DEFAULT_STAT_STAGE);
}
}