4adc2dcb16
* Added SpeciesInfo fields # Conflicts: # include/pokemon.h * Added missing comments * Renamed gigantamax to isGigantamax * Converted species flags to agbcc bit flags * Added padding after flags * Pikachu form config * Dex text * Reordered Paradox flag * Missing Pikachu ifdef comments * Moved P_GEN_x_POKEMON settings to the species_families file * Gen 1 Dex entries * Renamed file to species_enabled.h * Prevent Pokémon from evolving if their evolution is disabled * Prevent Pokémon from being affected by Eviolite if their evolution is disabled * Prevent Pokémon offspring if they're disabled * Corrected imprementation of evolution prevention It could potentially overwrite items by accident * Cross-evo configs * Gen 2 dex entries * Changed cry table to use assignable IDs # Conflicts: # include/pokemon.h * Form table pointers * Beginning support for moving data to gSpeciesInfo * Pokédexes reads text from gSpeciesInfo * Reading species names from gSpeciesInfo * Fixed erroneous copy-paste * Moved Bulbasaur to Raichu Family data do gSpeciesinfo * Added female pic sizes * Macros for Front, Back, Palette and Learnsets * Sandshrew to Dugtrio Families * Obtains Height/Weight from gSpeciesInfo * Read category from gSpeciesInfo * Removed unused data from pokedex_entries.h * Moved Gen 1 data to gSpeciesInfo * Moved Gen 2 data to gSpeciesInfo + fixed Ursaluna Bloodmoon not producing Teddiursa eggs * Moved Gen 3 data to gSpeciesInfo * Moved Gen 4 data to gSpeciesInfo * HGSS dex properly shows form sprites * Fixed data type for GetSpeciesHeight/Weight * Reading Pokédex Size data from gSpeciesInfo * Cleaned up mon graphic decompression function * Reading Front Pics gSpeciesInfo * Reading Back Pics gSpeciesInfo * Updated uses of GetMonSpritePalStruct to allow loading the data directly instead of reading the struct * Reading palettes from gSpeciesInfo * Reading animation delay from gSpeciesInfo * Fixed Pokémon Debug Menu not reading animation delay * Reading front anim Id from gSpeciesInfo * Reading back anim Id from gSpeciesInfo * Reading Animation Frames from gSpeciesInfo * Reading Icon Sprites from gSpeciesInfo * Reading Icon Palette IDs from gSpeciesInfo * Reading Footprints from gSpeciesInfo * Reading Mon Pic sizes from gSpeciesInfo * Separate mon pic sizes for female mon * Reading Level Up Learnsets from gSpeciesInfo * Reading Teachable Learnsets from gSpeciesInfo * Reading National Dex Number from gSpeciesInfo * Reading Enemy Mon Elevation from gSpeciesInfo * Reading Evolutions from gSpeciesInfo * Reading form table from gSpeciesInfo * Fixed button label inconsistency in pokémon debug menu * Reading form change table from gSpeciesInfo * Removed need to define mon graphics in include/graphics.h * Reordered mon graphics by family * Fixed National dex number offset * gFrontierBannedSpecies now checks IsSpeciesEnabled * Added 3 more toggles for Fusions, Primal Reversions and Ultra Burst * Gen 3 & 4 family toggles for dex entries * Fixed missing Mr. Rime data * Gen 1 dex descriptions as compound strings * Gen 2 dex descriptions as compound strings * Gen 3 dex descriptions as compound strings * Gen 4 dex descriptions as compound strings * Fixed compile in agbcc * Moved Gen 5 data to gSpeciesInfo * Using PLACEHOLDER_ANIM_SINGLE_FRAME when needed (same hash) * Renamed PLACEHOLDER_TWO_FRAME_ANIMATION to PLACEHOLDER_ANIM_TWO_FRAMES * Fixed capitalization for front pic anims * Fixed `CanEvolve` * Moved Gen 6 data to gSpeciesInfo * Gen 7 without macros * Gen 8 without macros * Gen 9 without macros * Fixed Gen 9 sound data * Finished moving Gen 7 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Ultra Necrozma is now included in the fusion forms define * Cries are now properly excluded from the rom when disabling species * Removed P_GEN_x_POKEMON from form_change_tables.h * Fixed Yanmega's cry ignoring the P_GEN_4_CROSS_EVOS setting * Added P_NEW_EVOS_IN_REGIONAL_DEX setting * Automatic ASSUMPTION_FAIL when used species are disabled * Finished moving Gen 8 data in macros (by Alex) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Expanded Alcremie macro * Finished moving Gen 9 data in macros (by Alex) * Fixed missing data for Komala and Marshadow * Form species id tables use family toggles + added missing Ursaluna form species id table * Fixed Genesect palettes * Fixed Flabébé family graphics * Fixed Minior Graphics * Fixed missing Calyrex data * Family toggles in mon graphcis (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed missing Ogerpon data * Ordered Level Up Learnsets (missing toggles) Also added White Basculin learnset * Added more Minior synonyms * Fixed enamorus order * Reordered teachable learnsets * Removed sSpeciesXXX level up learnsets + reordered * Removed unneeded assumes * Removed unused extra animations * Family toggles in mon level up learnsets (By Jasper/Bassoonian) Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed Phione graphics inclusion * Family toggles for Teachable Learnsets Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Ordered Front Pic Anims * Family toggles for front pic animations Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS dex incorrectly showing the wrong mon when catching it * Family toggles for Egg Moves + reodered Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> * Fixed HGSS not checking for null footprints * Review changes * Fixed Female difference mon not using their macros * Fixed Alcremie Macro * Fixed compile error when disabling the Bulbasaur family * Fixed Turtwig and Chimchar family + Houndour and Mareep cries not being excluded properly * Re-added missing Egg graphical data * Fixed crash during the Birch Intro when Lotad is disabled * Renamed PALLETE to PALETTES * Removed extra spacing for YOffsets * Fixed compile when only disabling cross-gen evolutions * Added Tera Forms define (Ogerpon and Terapagos) * Fixed Necrozma macro * Removed .noFlip = FALSE * Fixed dex number in summary screen for forms when nat dex is disabled * Fixed Paldean form paths --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
433 lines
15 KiB
C
433 lines
15 KiB
C
#include "global.h"
|
|
#include "test/battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gItems[ITEM_RED_CARD].holdEffect == HOLD_EFFECT_RED_CARD);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card switches the attacker with a random non-fainted replacement")
|
|
{
|
|
PASSES_RANDOMLY(1, 2, RNG_FORCE_RANDOM_SWITCH);
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_BULBASAUR);
|
|
OPPONENT(SPECIES_CHARMANDER);
|
|
OPPONENT(SPECIES_SQUIRTLE) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TACKLE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
MESSAGE("Foe Bulbasaur was dragged out!");
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
DOUBLE_BATTLE_TEST("Red Card switches the target with a random non-battler, non-fainted replacement")
|
|
{
|
|
PASSES_RANDOMLY(1, 2, RNG_FORCE_RANDOM_SWITCH);
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_BULBASAUR);
|
|
OPPONENT(SPECIES_CHARMANDER);
|
|
OPPONENT(SPECIES_SQUIRTLE) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
MESSAGE("Foe Bulbasaur was dragged out!");
|
|
} THEN {
|
|
EXPECT(playerLeft->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if holder faints")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); Item(ITEM_RED_CARD); }
|
|
PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if target is behind a Substitute")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_SUBSTITUTE); MOVE(opponent, MOVE_TACKLE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_RED_CARD); // Not activated, so still has the item.
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card activates after the last hit of a multi-hit move")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_DOUBLE_KICK); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, opponent);
|
|
HP_BAR(player);
|
|
HP_BAR(player);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if no replacements")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TACKLE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_RED_CARD); // Not activated, so still has the item.
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if replacements fainted")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT) { HP(0); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TACKLE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_RED_CARD); // Not activated, so still has the item.
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if knocked off")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_KNOCK_OFF); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, opponent);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if stolen by a move")
|
|
{
|
|
u32 item;
|
|
bool32 activate;
|
|
PARAMETRIZE { item = ITEM_NONE; activate = FALSE; }
|
|
PARAMETRIZE { item = ITEM_POTION; activate = TRUE; }
|
|
ASSUME(gBattleMoves[MOVE_THIEF].effect == EFFECT_THIEF);
|
|
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(item); }
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_THIEF); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_THIEF, opponent);
|
|
if (activate) {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
} else {
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if stolen by Magician")
|
|
{
|
|
u32 item;
|
|
bool32 activate;
|
|
PARAMETRIZE { item = ITEM_NONE; activate = FALSE; }
|
|
PARAMETRIZE { item = ITEM_POTION; activate = TRUE; }
|
|
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_FENNEKIN) { Ability(ABILITY_MAGICIAN); Item(item); }
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TACKLE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
if (activate) {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Fennekin!");
|
|
} else {
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Fennekin!");
|
|
}
|
|
}
|
|
} THEN {
|
|
EXPECT(player->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
DOUBLE_BATTLE_TEST("Red Card activates for only the fastest target")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Speed(3); Item(ITEM_RED_CARD); }
|
|
PLAYER(SPECIES_WYNAUT) { Speed(2); Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET) { Speed(5); }
|
|
OPPONENT(SPECIES_WYNAUT) { Speed(4); }
|
|
OPPONENT(SPECIES_UNOWN) { Speed(1); }
|
|
} WHEN {
|
|
TURN {
|
|
MOVE(opponentLeft, MOVE_ROCK_SLIDE);
|
|
MOVE(opponentRight, MOVE_TACKLE, target: playerRight);
|
|
}
|
|
} SCENE {
|
|
// Fastest target's Red Card activates.
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, opponentLeft);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
MESSAGE("Foe Unown was dragged out!");
|
|
|
|
// Slower target's Red Card still able to activate on other battler.
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight);
|
|
MESSAGE("Wynaut held up its Red Card against Foe Wynaut!");
|
|
MESSAGE("Foe Wobbuffet was dragged out!");
|
|
} THEN {
|
|
EXPECT(playerLeft->item == ITEM_NONE);
|
|
EXPECT(playerRight->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker is rooted")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_UNOWN);
|
|
} WHEN {
|
|
TURN { MOVE(opponentLeft, MOVE_INGRAIN); }
|
|
TURN {
|
|
MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft);
|
|
MOVE(opponentRight, MOVE_TACKLE, target: playerLeft);
|
|
}
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
MESSAGE("Foe Wobbuffet anchored itself with its roots!");
|
|
|
|
// Red Card already consumed so cannot activate.
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight);
|
|
MESSAGE("Wynaut held up its Red Card against Foe Wynaut!");
|
|
}
|
|
}
|
|
}
|
|
|
|
DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker has Suction Cups")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_OCTILLERY) { Ability(ABILITY_SUCTION_CUPS); }
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_UNOWN);
|
|
} WHEN {
|
|
TURN {
|
|
MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft);
|
|
MOVE(opponentRight, MOVE_TACKLE, target: playerLeft);
|
|
}
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Octillery!");
|
|
MESSAGE("Foe Octillery anchors itself with Suction Cups!");
|
|
|
|
// Red Card already consumed so cannot activate.
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight);
|
|
MESSAGE("Wynaut held up its Red Card against Foe Wynaut!");
|
|
}
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if switched by Dragon Tail")
|
|
{
|
|
bool32 hasWynaut, activate;
|
|
PARAMETRIZE { hasWynaut = TRUE; activate = FALSE; }
|
|
PARAMETRIZE { hasWynaut = FALSE; activate = TRUE; }
|
|
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
if (hasWynaut) PLAYER(SPECIES_WYNAUT);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_DRAGON_TAIL); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, opponent);
|
|
if (activate) {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
} else {
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card activates and overrides U-turn")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_U_TURN); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, opponent);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Wobbuffet!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card does not activate if attacker's Sheer Force applied")
|
|
{
|
|
u32 move;
|
|
bool32 activate;
|
|
PARAMETRIZE { move = MOVE_TACKLE; activate = TRUE; }
|
|
PARAMETRIZE { move = MOVE_STOMP; activate = FALSE; }
|
|
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
OPPONENT(SPECIES_TAUROS) { Ability(ABILITY_SHEER_FORCE); }
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, move); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
|
|
if (activate) {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Tauros!");
|
|
} else {
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Wobbuffet held up its Red Card against Foe Tauros!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card activates before Emergency Exit")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_GOLISOPOD) { MaxHP(100); HP(51); Item(ITEM_RED_CARD); }
|
|
PLAYER(SPECIES_WIMPOD);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
MESSAGE("Golisopod held up its Red Card against Foe Wobbuffet!");
|
|
ABILITY_POPUP(player, ABILITY_EMERGENCY_EXIT);
|
|
MESSAGE("Go! Wimpod!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Red Card is consumed after dragged out replacement has its Speed lowered by Sticky Web")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
PLAYER(SPECIES_WYNAUT) { Moves(MOVE_TACKLE); }
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_STICKY_WEB); }
|
|
TURN { MOVE(player, MOVE_TACKLE); }
|
|
TURN { MOVE(player, MOVE_TACKLE); }
|
|
} SCENE {
|
|
// 1st turn Sticky Web
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_STICKY_WEB, opponent);
|
|
// 2nd turn Red Card activation
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
MESSAGE("Foe Wobbuffet held up its Red Card against Wobbuffet!");
|
|
MESSAGE("Wynaut was dragged out!");
|
|
MESSAGE("Wynaut was caught in a Sticky Web!");
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
// 3rd turn, Red Card was consumed, it can't trigger again
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
|
|
MESSAGE("Foe Wobbuffet held up its Red Card against Wynaut!");
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
}
|
|
} THEN {
|
|
EXPECT(opponent->item == ITEM_NONE);
|
|
}
|
|
}
|
|
|
|
// SINGLE_BATTLE_TEST("Red Card activates but fails if the attacker has Dynamaxed")
|