disable vertical stripe animation during tests

This commit is contained in:
cawtds
2024-06-22 12:30:19 +02:00
parent b81c3711f9
commit ca484cf4ff
4 changed files with 13 additions and 13 deletions

View File

@@ -208,7 +208,6 @@ static void Nop(void)
void LaunchBattleAnimation(u32 animType, u16 animId)
{
s32 i;
bool8 isMoveAnim = (animId == ANIM_TYPE_MOVE);
if (gTestRunnerEnabled)
{
@@ -233,7 +232,7 @@ void LaunchBattleAnimation(u32 animType, u16 animId)
gAnimBattlerSpecies[i] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[i]], MON_DATA_SPECIES);
}
if (!isMoveAnim)
if (animType != ANIM_TYPE_MOVE)
gAnimMoveIndex = 0;
else
gAnimMoveIndex = animId;
@@ -267,7 +266,7 @@ void LaunchBattleAnimation(u32 animType, u16 animId)
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
sAnimSpriteIndexArray[i] = 0xFFFF;
if (isMoveAnim)
if (animType == ANIM_TYPE_MOVE)
{
for (i = 0; gMovesWithQuietBGM[i] != 0xFFFF; i++)
{

View File

@@ -1280,10 +1280,11 @@ static void Task_GiveExpWithExpBar(u8 taskId)
{
u8 level;
u16 species;
s32 currExp, newExpPoints, expOnNextLvl;
s32 currExp, expOnNextLvl, newExpPoints;
if (gTasks[taskId].tExpTask_frames < 13)
{
++gTasks[taskId].tExpTask_frames;
gTasks[taskId].tExpTask_frames++;
}
else
{
@@ -1300,6 +1301,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
if (currExp + gainedExp >= expOnNextLvl)
{
SetMonData(&gPlayerParty[monId], MON_DATA_EXP, &expOnNextLvl);
@@ -1316,7 +1318,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
}
gainedExp -= expOnNextLvl - currExp;
BtlController_EmitTwoReturnValues(battler, 1, RET_VALUE_LEVELED_UP, gainedExp);
BtlController_EmitTwoReturnValues(battler, BUFFER_B, RET_VALUE_LEVELED_UP, gainedExp);
gTasks[taskId].func = Task_LaunchLvlUpAnim;
}
else
@@ -1336,7 +1338,7 @@ static void Task_LaunchLvlUpAnim(u8 taskId)
u8 monIndex = gTasks[taskId].tExpTask_monId;
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battler)])
battler = BATTLE_PARTNER(battler);
battler ^= BIT_FLANK;
InitAndLaunchSpecialAnimation(battler, battler, battler, B_ANIM_LVL_UP);
gTasks[taskId].func = Task_UpdateLvlInHealthbox;
@@ -1361,7 +1363,7 @@ static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId)
{
s32 battlerId = gTasks[taskId].tExpTask_battler;
if (IsBattlerSpriteVisible((u8)battlerId) == TRUE)
if (IsBattlerSpriteVisible((u8)battlerId) == TRUE && !gTestRunnerEnabled)
{
gTasks[taskId].func = Task_CreateLevelUpVerticalStripes;
gTasks[taskId].data[15] = 0;

View File

@@ -2184,9 +2184,8 @@ s32 MoveBattleBar(u8 battlerId, u8 healthboxSpriteId, u8 whichBar, u8 unused)
else // exp bar
{
u16 expFraction = GetScaledExpFraction(gBattleSpritesDataPtr->battleBars[battlerId].oldValue,
gBattleSpritesDataPtr->battleBars[battlerId].receivedValue,
gBattleSpritesDataPtr->battleBars[battlerId].maxValue,
B_EXPBAR_NUM_TILES);
gBattleSpritesDataPtr->battleBars[battlerId].receivedValue,
gBattleSpritesDataPtr->battleBars[battlerId].maxValue, B_EXPBAR_NUM_TILES);
if (expFraction == 0)
expFraction = 1;
@@ -2404,7 +2403,7 @@ static u8 GetScaledExpFraction(s32 oldValue, s32 receivedValue, s32 maxValue, u8
s32 newVal, result;
s8 oldToMax, newToMax;
scale *= 8;
scale *= (B_FAST_EXP_GROW) ? 2 : 8;
newVal = oldValue - receivedValue;
if (newVal < 0)

View File

@@ -9,7 +9,7 @@
#include "test_runner.h"
#include "test/test.h"
#define TIMEOUT_SECONDS 70
#define TIMEOUT_SECONDS 55
void CB2_TestRunner(void);