Clean up field_poison.c

This commit is contained in:
GriffinR
2022-07-06 21:04:54 -04:00
parent 06c9e0eb99
commit 06dc93fc2f
4 changed files with 44 additions and 40 deletions

View File

@@ -1200,29 +1200,35 @@ bool8 IsLargeBreakableDecoration(u16 metatileId, bool8 checkBase)
return FALSE;
}
#define tState data[0]
#define tMosaic data[1]
static void Task_FieldPoisonEffect(u8 taskId)
{
s16 *data = gTasks[taskId].data;
switch (data[0])
switch (tState)
{
case 0:
data[1] += 2;
if (data[1] > 8)
data[0]++;
tMosaic += 2;
if (tMosaic > 8)
tState++;
break;
case 1:
data[1] -= 2;
if (data[1] == 0)
data[0]++;
tMosaic -= 2;
if (tMosaic == 0)
tState++;
break;
case 2:
DestroyTask(taskId);
return;
}
SetGpuReg(REG_OFFSET_MOSAIC, (data[1] << 4) | data[1]);
SetGpuReg(REG_OFFSET_MOSAIC, (tMosaic << 4) | tMosaic);
}
#undef tState
#undef tMosaic
void FldEffPoison_Start(void)
{
PlaySE(SE_FIELD_POISON);