87e2526665
* Add switching message macros * Add test
65 lines
2.4 KiB
C
65 lines
2.4 KiB
C
#include "global.h"
|
|
#include "test/battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gItemsInfo[ITEM_EJECT_PACK].holdEffect == HOLD_EFFECT_EJECT_PACK);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Eject Pack does not cause the new Pokémon to lose HP due to it's held Life Orb")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gItemsInfo[ITEM_LIFE_ORB].holdEffect == HOLD_EFFECT_LIFE_ORB);
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
|
|
PLAYER(SPECIES_WYNAUT) { Item(ITEM_LIFE_ORB); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_OVERHEAT); SEND_OUT(player, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_OVERHEAT, player);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
|
|
SEND_IN_MESSAGE("Wynaut");
|
|
NOT MESSAGE("Wynaut was hurt by its Life Orb!");
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Eject Pack does not activate if there are no Pokémon left to battle")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(0); }
|
|
OPPONENT(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }
|
|
} WHEN {
|
|
TURN { }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
|
|
}
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Eject Pack is triggered by self-inflicting stat decreases")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gItemsInfo[ITEM_LIFE_ORB].holdEffect == HOLD_EFFECT_LIFE_ORB);
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
|
|
PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_OVERHEAT); SEND_OUT(player, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_OVERHEAT, player);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
|
|
SEND_IN_MESSAGE("Wynaut");
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent);
|
|
}
|
|
}
|