mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
71 lines
2.5 KiB
C
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);
|
|
}
|
|
}
|