sovereignx/test/battle/move_effect/protect.c

485 lines
18 KiB
C
Raw Normal View History

Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_PROTECT].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_DETECT].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_KINGS_SHIELD].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_SILK_TRAP].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_SPIKY_SHIELD].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_WIDE_GUARD].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_QUICK_GUARD].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_CRAFTY_SHIELD].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_BANEFUL_BUNKER].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_BURNING_BULWARK].effect == EFFECT_PROTECT);
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
ASSUME(gMovesInfo[MOVE_LEER].category == DAMAGE_CATEGORY_STATUS);
ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL);
ASSUME(!(gMovesInfo[MOVE_WATER_GUN].makesContact));
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
}
SINGLE_BATTLE_TEST("Protect, Detect, Spiky Shield, Baneful Bunker and Burning Bulwark protect from all moves")
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
{
u32 j;
static const u16 protectMoves[] = {
MOVE_PROTECT,
MOVE_DETECT,
MOVE_SPIKY_SHIELD,
MOVE_BANEFUL_BUNKER,
MOVE_BURNING_BULWARK,
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
};
u16 protectMove = MOVE_NONE;
u16 usedMove = MOVE_NONE;
for (j = 0; j < ARRAY_COUNT(protectMoves); j++)
{
PARAMETRIZE { protectMove = protectMoves[j]; usedMove = MOVE_TACKLE; }
PARAMETRIZE { protectMove = protectMoves[j]; usedMove = MOVE_LEER; }
PARAMETRIZE { protectMove = protectMoves[j]; usedMove = MOVE_WATER_GUN; }
}
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, protectMove); MOVE(player, usedMove); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, protectMove, opponent);
MESSAGE("Foe Wobbuffet protected itself!");
NOT ANIMATION(ANIM_TYPE_MOVE, usedMove, player);
MESSAGE("Foe Wobbuffet protected itself!");
if (usedMove == MOVE_LEER) {
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
} else {
NOT HP_BAR(opponent);
}
}
}
SINGLE_BATTLE_TEST("King's Shield, Silk Trap and Obstruct protect from damaging moves and lower stats on contact")
{
u32 j;
static const u16 protectMoves[][3] =
{ // Move Stat Stages
{MOVE_KINGS_SHIELD, STAT_ATK, 1},
{MOVE_SILK_TRAP, STAT_SPEED, 1},
{MOVE_OBSTRUCT, STAT_DEF, 2},
};
u16 protectMove = MOVE_NONE;
u16 usedMove = MOVE_NONE;
u16 statId = 0, lowersBy = 0;
for (j = 0; j < ARRAY_COUNT(protectMoves); j++)
{
PARAMETRIZE { usedMove = MOVE_TACKLE; protectMove = protectMoves[j][0]; statId = protectMoves[j][1]; lowersBy = protectMoves[j][2]; }
PARAMETRIZE { usedMove = MOVE_LEER; protectMove = protectMoves[j][0]; statId = 0; lowersBy = 0; }
PARAMETRIZE { usedMove = MOVE_WATER_GUN; protectMove = protectMoves[j][0]; statId = 0; lowersBy = 0; }
}
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, protectMove); MOVE(player, usedMove); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, protectMove, opponent);
MESSAGE("Foe Wobbuffet protected itself!");
if (usedMove == MOVE_LEER) {
ANIMATION(ANIM_TYPE_MOVE, usedMove, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
NOT MESSAGE("Foe Wobbuffet protected itself!");
} else {
NOT ANIMATION(ANIM_TYPE_MOVE, usedMove, player);
MESSAGE("Foe Wobbuffet protected itself!");
if (usedMove == MOVE_TACKLE) {
NOT HP_BAR(opponent);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
if (statId == STAT_ATK) {
MESSAGE("Wobbuffet's Attack fell!");
} else if (statId == STAT_SPEED) {
MESSAGE("Wobbuffet's Speed fell!");
} else if (statId == STAT_DEF) {
if (lowersBy == 2) {
MESSAGE("Wobbuffet's Defense harshly fell!");
}
}
} else {
NONE_OF {
HP_BAR(opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
}
}
} THEN {
if (usedMove == MOVE_TACKLE) {
EXPECT_EQ(player->statStages[statId], DEFAULT_STAT_STAGE - lowersBy);
}
}
}
SINGLE_BATTLE_TEST("Spiky Shield does 1/8 dmg of max hp of attackers making contact and may faint them")
{
u16 usedMove = MOVE_NONE;
u16 hp = 400, maxHp = 400;
PARAMETRIZE { usedMove = MOVE_TACKLE; hp = 1; }
PARAMETRIZE { usedMove = MOVE_TACKLE; }
PARAMETRIZE { usedMove = MOVE_LEER; }
PARAMETRIZE { usedMove = MOVE_WATER_GUN; }
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(hp); MaxHP(maxHp); }
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
if (hp == 1) {
TURN { MOVE(opponent, MOVE_SPIKY_SHIELD); MOVE(player, usedMove); SEND_OUT(player, 1); }
} else {
TURN { MOVE(opponent, MOVE_SPIKY_SHIELD); MOVE(player, usedMove); }
}
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIKY_SHIELD, opponent);
MESSAGE("Foe Wobbuffet protected itself!");
NOT ANIMATION(ANIM_TYPE_MOVE, usedMove, player);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponent);
if (usedMove == MOVE_TACKLE) {
HP_BAR(player, maxHp / 8);
if (hp == 1) {
MESSAGE("Wobbuffet fainted!");
MESSAGE("Go! Wobbuffet!");
}
}
}
}
SINGLE_BATTLE_TEST("Baneful Bunker poisons pokemon for moves making contact")
{
u16 usedMove = MOVE_NONE;
PARAMETRIZE {usedMove = MOVE_TACKLE; }
PARAMETRIZE {usedMove = MOVE_LEER; }
PARAMETRIZE {usedMove = MOVE_WATER_GUN; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BANEFUL_BUNKER); MOVE(player, usedMove); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BANEFUL_BUNKER, opponent);
MESSAGE("Foe Wobbuffet protected itself!");
NOT ANIMATION(ANIM_TYPE_MOVE, usedMove, player);
MESSAGE("Foe Wobbuffet protected itself!");
if (usedMove == MOVE_TACKLE) {
NOT HP_BAR(opponent);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
STATUS_ICON(player, STATUS1_POISON);
} else {
NONE_OF {
HP_BAR(opponent);
STATUS_ICON(player, STATUS1_POISON);
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
}
}
}
SINGLE_BATTLE_TEST("Burning Bulwark burns pokemon for moves making contact")
{
u16 usedMove = MOVE_NONE;
PARAMETRIZE {usedMove = MOVE_TACKLE; }
PARAMETRIZE {usedMove = MOVE_LEER; }
PARAMETRIZE {usedMove = MOVE_WATER_GUN; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BURNING_BULWARK); MOVE(player, usedMove); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BURNING_BULWARK, opponent);
MESSAGE("Foe Wobbuffet protected itself!");
NOT ANIMATION(ANIM_TYPE_MOVE, usedMove, player);
MESSAGE("Foe Wobbuffet protected itself!");
if (usedMove == MOVE_TACKLE) {
NOT HP_BAR(opponent);
STATUS_ICON(player, STATUS1_BURN);
} else {
NONE_OF {
HP_BAR(opponent);
STATUS_ICON(player, STATUS1_BURN);
}
}
}
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
SINGLE_BATTLE_TEST("Recoil damage is not applied if target was protected")
{
u32 j, k;
static const u16 protectMoves[] = { MOVE_PROTECT, MOVE_DETECT, MOVE_KINGS_SHIELD, MOVE_BANEFUL_BUNKER, MOVE_SILK_TRAP, MOVE_OBSTRUCT, MOVE_SPIKY_SHIELD };
static const u16 recoilMoves[] = { MOVE_VOLT_TACKLE, MOVE_HEAD_SMASH, MOVE_TAKE_DOWN, MOVE_DOUBLE_EDGE };
u16 protectMove = MOVE_NONE;
u16 recoilMove = MOVE_NONE;
for (j = 0; j < ARRAY_COUNT(protectMoves); j++)
{
for (k = 0; k < ARRAY_COUNT(recoilMoves); k++)
{
PARAMETRIZE { protectMove = protectMoves[j]; recoilMove = recoilMoves[k]; }
}
}
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_VOLT_TACKLE].recoil > 0);
ASSUME(gMovesInfo[MOVE_HEAD_SMASH].recoil > 0);
ASSUME(gMovesInfo[MOVE_TAKE_DOWN].recoil > 0);
ASSUME(gMovesInfo[MOVE_DOUBLE_EDGE].recoil > 0);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
PLAYER(SPECIES_RAPIDASH);
OPPONENT(SPECIES_BEAUTIFLY);
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_TACKLE); }
TURN { MOVE(opponent, protectMove); MOVE(player, recoilMove); }
TURN {}
} SCENE {
// 1st turn
MESSAGE("Foe Beautifly used Tackle!");
MESSAGE("Rapidash used Tackle!");
// 2nd turn
ANIMATION(ANIM_TYPE_MOVE, protectMove, opponent);
MESSAGE("Foe Beautifly protected itself!");
// MESSAGE("Rapidash used recoilMove!");
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, recoilMove, player);
MESSAGE("Rapidash is hit with recoil!");
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
}
}
SINGLE_BATTLE_TEST("Multi-hit moves don't hit a protected target and fail only once")
{
u16 move = MOVE_NONE;
PARAMETRIZE { move = MOVE_PROTECT; }
PARAMETRIZE { move = MOVE_DETECT; }
PARAMETRIZE { move = MOVE_KINGS_SHIELD; }
PARAMETRIZE { move = MOVE_BANEFUL_BUNKER; }
PARAMETRIZE { move = MOVE_SILK_TRAP; }
PARAMETRIZE { move = MOVE_OBSTRUCT; }
PARAMETRIZE { move = MOVE_SPIKY_SHIELD; }
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_ARM_THRUST].effect == EFFECT_MULTI_HIT);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
PLAYER(SPECIES_RAPIDASH);
OPPONENT(SPECIES_BEAUTIFLY);
} WHEN {
TURN { MOVE(opponent, move); MOVE(player, MOVE_ARM_THRUST); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
MESSAGE("Foe Beautifly protected itself!");
MESSAGE("Rapidash used Arm Thrust!");
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ARM_THRUST, player);
MESSAGE("Foe Beautifly protected itself!");
// Each effect happens only once.
if (move == MOVE_KINGS_SHIELD || move == MOVE_SILK_TRAP || move == MOVE_OBSTRUCT) {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
} else if (move == MOVE_SPIKY_SHIELD) {
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
HP_BAR(player);
} else if (move == MOVE_BANEFUL_BUNKER) {
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
STATUS_ICON(player, STATUS1_POISON);
}
NONE_OF {
if (move == MOVE_KINGS_SHIELD || move == MOVE_SILK_TRAP || move == MOVE_OBSTRUCT) {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
} else if (move == MOVE_SPIKY_SHIELD) {
HP_BAR(player);
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
MESSAGE("Hit 2 time(s)!");
MESSAGE("Hit 3 time(s)!");
MESSAGE("Hit 4 time(s)!");
MESSAGE("Hit 5 time(s)!");
}
}
}
DOUBLE_BATTLE_TEST("Wide Guard protects self and ally from multi-target moves")
{
u16 move = MOVE_NONE;
PARAMETRIZE { move = MOVE_TACKLE; } // Single target
PARAMETRIZE { move = MOVE_SURF; } // All targets
PARAMETRIZE { move = MOVE_HYPER_VOICE; } // 2 foes
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_TACKLE].target == MOVE_TARGET_SELECTED);
ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY);
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_WIDE_GUARD); MOVE(playerLeft, move, target: opponentLeft); }
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
TURN {}
} SCENE {
MESSAGE("Foe Wobbuffet used Wide Guard!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_WIDE_GUARD, opponentLeft);
if (move == MOVE_TACKLE) {
MESSAGE("Wobbuffet used Tackle!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft);
HP_BAR(opponentLeft);
} else if (move == MOVE_HYPER_VOICE) {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentRight);
} else { // Surf
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentLeft);
HP_BAR(playerRight);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentRight);
}
}
}
DOUBLE_BATTLE_TEST("Wide Guard can not fail on consecutive turns")
{
u8 turns;
PASSES_RANDOMLY(2, 2);
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_WIDE_GUARD); MOVE(playerLeft, MOVE_HYPER_VOICE, target: opponentLeft); }
TURN { MOVE(opponentLeft, MOVE_WIDE_GUARD); MOVE(playerLeft, MOVE_HYPER_VOICE, target: opponentLeft); }
TURN {}
} SCENE {
for (turns = 0; turns < 2; turns++) {
MESSAGE("Foe Wobbuffet used Wide Guard!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_WIDE_GUARD, opponentLeft);
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPER_VOICE, playerLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentRight);
}
}
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
DOUBLE_BATTLE_TEST("Quick Guard protects self and ally from priority moves")
{
u16 move = MOVE_NONE;
struct BattlePokemon *targetOpponent = NULL;
PARAMETRIZE { move = MOVE_TACKLE; targetOpponent = opponentLeft; }
PARAMETRIZE { move = MOVE_TACKLE; targetOpponent = opponentRight; }
PARAMETRIZE { move = MOVE_QUICK_ATTACK; targetOpponent = opponentLeft; }
PARAMETRIZE { move = MOVE_QUICK_ATTACK; targetOpponent = opponentRight; }
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_TACKLE].priority == 0);
ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_QUICK_GUARD); MOVE(playerLeft, move, target:targetOpponent); }
TURN {}
} SCENE {
MESSAGE("Foe Wobbuffet used Quick Guard!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_GUARD, opponentLeft);
if (move == MOVE_TACKLE) {
MESSAGE("Wobbuffet used Tackle!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft);
HP_BAR(targetOpponent);
} else if (move == MOVE_QUICK_ATTACK) {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_ATTACK, playerLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(targetOpponent);
}
}
}
DOUBLE_BATTLE_TEST("Quick Guard can not fail on consecutive turns")
{
u8 turns;
PASSES_RANDOMLY(2, 2);
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_QUICK_GUARD); MOVE(playerLeft, MOVE_QUICK_ATTACK, target: opponentRight); }
TURN { MOVE(opponentLeft, MOVE_QUICK_GUARD); MOVE(playerLeft, MOVE_QUICK_ATTACK, target: opponentRight); }
} SCENE {
for (turns = 0; turns < 2; turns++) {
MESSAGE("Foe Wobbuffet used Quick Guard!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_GUARD, opponentLeft);
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_QUICK_ATTACK, playerLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT HP_BAR(opponentRight);
}
}
}
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from status moves")
{
u16 move = MOVE_NONE;
struct BattlePokemon *targetOpponent = NULL;
PARAMETRIZE { move = MOVE_HYPER_VOICE; }
PARAMETRIZE { move = MOVE_LEER; }
PARAMETRIZE { move = MOVE_TACKLE; targetOpponent = opponentLeft; }
PARAMETRIZE { move = MOVE_TACKLE; targetOpponent = opponentRight; }
GIVEN {
Move data unification (#3999) * Made gBattleMoves handle the InGame name and description of battle moves No more multiple arrays in separate, individual files. Note: -Keep an eye on Task_LearnedMove. * Reintroduced move names Misc: -Fixed Trick-or-Treat and Light of Ruin's expanded names. -Introduced a new field for Z-Move names, and a constant for their name length. -Added a few TODOs to GetBattleMoveName. -Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own. * Updated GetBattleMoveName to handle Z-Move Names Misc: -Removed pointless TODO about MOVE_NAME_LENGTH. -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it. * Fixed a couple of expanded move names * Removed zMoveName variable of struct BattleMove and extended the name variable's size * Ditched no longer used MOVE_NAME_LENGTH constant * Corrected the names of the max moves I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea. * Fixed U-turn's name * Brought back MOVE_NAME_LENGTH I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves. * Introduced a union for Move/Z-Move names in the struct BattleMove * Fixed the union for gBattleMoves move names Also updated GetBattleMoveName to properly handle Max Move names. Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names. * Removed deprecated GetZMoveName and GetMaxMoveName * Reintroduced mention to gMoveNames in sGFRomHeader * Fixed move names and ported move descriptions * Fused the struct ContestMove into the struct BattleMove * Removed no longer used Z_MOVE_NAME_LENGTH constant * Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names * Reintroduced the contest parameters for Pokémon moves * Renamed gBattleMoves to gMovesInfo This is consistent with gSpeciesInfo, the array that contains most of the species data. * Renamed the BattleMove struct to MovesInfo This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array. * Removed empty lines separating battle params from contest params in gMovesInfo * Renamed MovesInfo to MoveInfo * Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro Used to handle moves with expanded names in a more comfortable manner. Also fixed Trick-or-Treat's expanded name. * Renamed GetBattleMoveName to GetMoveName * Added a comment pointing out that the shared move descriptions are shared move descriptions * Re-aligned one of the escape characters of CHECK_MOVE_FLAG * Renamed the battle_moves.h file to moves_info.h instead for consistency's sake * Applied Eduardo's adjustments * Using compound string for regular move names as well, saving 1180 bytes and making their use consistent * Move description formatting * Updated Pursuit test after merge * Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY --------- Co-authored-by: Nephrite <thechurchofcage@gmail.com> Co-authored-by: Bassoonian <iasperbassoonian@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 11:51:32 +00:00
ASSUME(gMovesInfo[MOVE_LEER].target == MOVE_TARGET_BOTH);
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH);
ASSUME(gMovesInfo[MOVE_HYPER_VOICE].category == DAMAGE_CATEGORY_SPECIAL);
Fix protect recoil issue and add tests for protect (#3321) * fix protect recoil issue and add tests for protect * test for #3312 and baneful bunker fix * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * more recoil moves for protect test * Update test/battle/move_effect/protect.c Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * rename spiky shield test --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-09-26 11:26:23 +01:00
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_CRAFTY_SHIELD); (move == MOVE_TACKLE) ? MOVE(playerLeft, move, target:targetOpponent) : MOVE(playerLeft, move); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CRAFTY_SHIELD, opponentLeft);
if (move == MOVE_LEER) {
MESSAGE("Wobbuffet used Leer!");
MESSAGE("Foe Wobbuffet protected itself!");
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft);
MESSAGE("Foe Wobbuffet protected itself!");
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
} else {
if (move == MOVE_HYPER_VOICE || targetOpponent == opponentLeft) {
NOT MESSAGE("Foe Wobbuffet protected itself!");
HP_BAR(opponentLeft);
} else if (move == MOVE_HYPER_VOICE || targetOpponent == opponentRight) {
NOT MESSAGE("Foe Wobbuffet protected itself!");
HP_BAR(opponentRight);
}
}
}
}