Document some battle anim funcs and data

This commit is contained in:
Marcus Huderle
2021-02-27 11:04:45 -06:00
parent 06ae5a37e2
commit c323e7f061
18 changed files with 228 additions and 241 deletions
+14 -19
View File
@@ -6,16 +6,21 @@
#include "task.h"
#include "constants/battle_anim.h"
// this file's functions
static void sub_8158B98(u8 taskId);
static void sub_8158C04(u8 taskId);
static void SoundTask_FireBlast_Step1(u8 taskId);
static void SoundTask_FireBlast_Step2(u8 taskId);
static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId);
static void SoundTask_PlayDoubleCry_Step(u8 taskId);
static void SoundTask_PlayCryWithEcho_Step(u8 taskId);
static void SoundTask_AdjustPanningVar_Step(u8 taskId);
// task start
void sub_8158B30(u8 taskId)
// Loops the specified sound effect and pans from the
// attacker to the target. The second specified sound effect
// is played at the very end. This task is effectively
// hardcoded to the move FIRE_BLAST due to the baked-in
// durations.
// arg 0: looped sound effect
// arg 1: ending sound effect
void SoundTask_FireBlast(u8 taskId)
{
s8 pan1, pan2, panIncrement;
@@ -31,10 +36,10 @@ void sub_8158B30(u8 taskId)
gTasks[taskId].data[4] = panIncrement;
gTasks[taskId].data[10] = 10;
gTasks[taskId].func = sub_8158B98;
gTasks[taskId].func = SoundTask_FireBlast_Step1;
}
static void sub_8158B98(u8 taskId)
static void SoundTask_FireBlast_Step1(u8 taskId)
{
s16 pan = gTasks[taskId].data[2];
s8 panIncrement = gTasks[taskId].data[4];
@@ -42,7 +47,7 @@ static void sub_8158B98(u8 taskId)
{
gTasks[taskId].data[10] = 5;
gTasks[taskId].data[11] = 0;
gTasks[taskId].func = sub_8158C04;
gTasks[taskId].func = SoundTask_FireBlast_Step2;
}
else
{
@@ -56,7 +61,7 @@ static void sub_8158B98(u8 taskId)
}
}
static void sub_8158C04(u8 taskId)
static void SoundTask_FireBlast_Step2(u8 taskId)
{
if (++gTasks[taskId].data[10] == 6)
{
@@ -69,9 +74,7 @@ static void sub_8158C04(u8 taskId)
DestroyAnimSoundTask(taskId);
}
}
// task end
// task start
void SoundTask_LoopSEAdjustPanning(u8 taskId)
{
u16 songId = gBattleAnimArgs[0];
@@ -123,9 +126,7 @@ static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId)
gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11], oldPan);
}
}
// task end
// task start
void SoundTask_PlayCryHighPitch(u8 taskId)
{
u16 species = 0;
@@ -169,9 +170,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId)
DestroyAnimVisualTask(taskId);
}
// task end
// task start
void SoundTask_PlayDoubleCry(u8 taskId)
{
u16 species = 0;
@@ -258,7 +257,6 @@ static void SoundTask_PlayDoubleCry_Step(u8 taskId)
}
}
}
// task end
void SoundTask_WaitForCry(u8 taskId)
{
@@ -273,7 +271,6 @@ void SoundTask_WaitForCry(u8 taskId)
}
}
// task start
void SoundTask_PlayCryWithEcho(u8 taskId)
{
u16 species;
@@ -329,7 +326,6 @@ static void SoundTask_PlayCryWithEcho_Step(u8 taskId)
break;
}
}
// task end
void SoundTask_PlaySE1WithPanning(u8 taskId)
{
@@ -389,4 +385,3 @@ static void SoundTask_AdjustPanningVar_Step(u8 taskId)
if (gTasks[taskId].data[11] == gTasks[taskId].data[2])
DestroyAnimVisualTask(taskId);
}