Fix Smack Down anim + move anim tests (#4774)
* Fix Smack Down anim + move anim tests * really agbcc * fix undefined reference * hopefully everything works
This commit is contained in:
parent
f868de066d
commit
84d13d0abf
4 changed files with 34 additions and 3 deletions
|
@ -5168,7 +5168,6 @@ Move_SMACK_DOWN::
|
|||
createvisualtask AnimTask_SmokescreenImpact, 0x8, 0x400, 0x1902
|
||||
fadetobg BG_IN_AIR
|
||||
waitbgfadeout
|
||||
createvisualtask AnimTask_StartSlidingBg, 5, 0x0, 0x0, 0x0, 0xffff
|
||||
createvisualtask AnimTask_SeismicTossBgAccelerateDownAtEnd, 3
|
||||
goto SeismicTossWeak
|
||||
|
||||
|
|
|
@ -695,6 +695,7 @@ struct BattleTestData
|
|||
struct BattleTestRunnerState
|
||||
{
|
||||
u8 battlersCount;
|
||||
bool8 forceMoveAnim;
|
||||
u16 parametersCount; // Valid only in BattleTest_Setup.
|
||||
u16 parameters;
|
||||
u16 runParameter;
|
||||
|
@ -996,6 +997,8 @@ void SendOut(u32 sourceLine, struct BattlePokemon *, u32 partyIndex);
|
|||
#define NONE_OF for (OpenQueueGroup(__LINE__, QUEUE_GROUP_NONE_OF); gBattleTestRunnerState->data.queueGroupType != QUEUE_GROUP_NONE; CloseQueueGroup(__LINE__))
|
||||
#define NOT NONE_OF
|
||||
|
||||
#define FORCE_MOVE_ANIM(set) gBattleTestRunnerState->forceMoveAnim = (set)
|
||||
|
||||
#define ABILITY_POPUP(battler, ...) QueueAbility(__LINE__, battler, (struct AbilityEventContext) { __VA_ARGS__ })
|
||||
#define ANIMATION(type, id, ...) QueueAnimation(__LINE__, type, id, (struct AnimationEventContext) { __VA_ARGS__ })
|
||||
#define HP_BAR(battler, ...) QueueHP(__LINE__, battler, (struct HPEventContext) { APPEND_TRUE(__VA_ARGS__) })
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "test_runner.h"
|
||||
#include "test/battle.h"
|
||||
#include "constants/battle_anim.h"
|
||||
#include "constants/moves.h"
|
||||
|
||||
|
@ -239,6 +240,9 @@ void LaunchBattleAnimation(u32 animType, u32 animId)
|
|||
TestRunner_Battle_RecordAnimation(animType, animId);
|
||||
// Play Transform and Ally Switch even in Headless as these move animations also change mon data.
|
||||
if (gTestRunnerHeadless
|
||||
#if TESTING // Because gBattleTestRunnerState is not seen outside of test env.
|
||||
&& !gBattleTestRunnerState->forceMoveAnim
|
||||
#endif // TESTING
|
||||
&& !(animType == ANIM_TYPE_MOVE && (animId == MOVE_TRANSFORM || animId == MOVE_ALLY_SWITCH)))
|
||||
{
|
||||
gAnimScriptCallback = Nop;
|
||||
|
|
25
test/battle/move_animations/smack_down.c
Normal file
25
test/battle/move_animations/smack_down.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("Move Animation Test: Smack Down works when used 15 times in a row")
|
||||
{
|
||||
u16 j, nTurns = 15;
|
||||
FORCE_MOVE_ANIM(TRUE);
|
||||
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
for (j = 0; j < nTurns; j++)
|
||||
{
|
||||
TURN { MOVE(player, MOVE_SMACK_DOWN); MOVE(opponent, MOVE_HELPING_HAND); } // Helping Hand, so there's no anim on the opponent's side.
|
||||
}
|
||||
} SCENE {
|
||||
for (j = 0; j < nTurns; j++)
|
||||
{
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SMACK_DOWN, player);
|
||||
}
|
||||
} THEN {
|
||||
FORCE_MOVE_ANIM(FALSE);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue