Sync drought with pokefirered, add weather tags
This commit is contained in:
+27
-27
@@ -160,11 +160,11 @@ void StartWeather(void)
|
||||
{
|
||||
if (!FuncIsActiveTask(Task_WeatherMain))
|
||||
{
|
||||
u8 index = AllocSpritePalette(0x1200);
|
||||
u8 index = AllocSpritePalette(TAG_WEATHER_START);
|
||||
CpuCopy32(gFogPalette, &gPlttBufferUnfaded[0x100 + index * 16], 32);
|
||||
BuildGammaShiftTables();
|
||||
gWeatherPtr->altGammaSpritePalIndex = index;
|
||||
gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(0x1201);
|
||||
gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(PALTAG_WEATHER_2);
|
||||
gWeatherPtr->rainSpriteCount = 0;
|
||||
gWeatherPtr->curRainSpriteIndex = 0;
|
||||
gWeatherPtr->cloudSpritesCreated = 0;
|
||||
@@ -885,50 +885,50 @@ bool8 LoadDroughtWeatherPalettes(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80ABFE0(s8 gammaIndex)
|
||||
static void SetDroughtGamma(s8 gammaIndex)
|
||||
{
|
||||
sub_80ABC48(-gammaIndex - 1);
|
||||
}
|
||||
|
||||
void sub_80ABFF0(void)
|
||||
void DroughtStateInit(void)
|
||||
{
|
||||
gWeatherPtr->unknown_73C = 0;
|
||||
gWeatherPtr->unknown_740 = 0;
|
||||
gWeatherPtr->unknown_742 = 0;
|
||||
gWeatherPtr->unknown_73E = 0;
|
||||
gWeatherPtr->droughtBrightnessStage = 0;
|
||||
gWeatherPtr->droughtTimer = 0;
|
||||
gWeatherPtr->droughtState = 0;
|
||||
gWeatherPtr->droughtLastBrightnessStage = 0;
|
||||
}
|
||||
|
||||
void sub_80AC01C(void)
|
||||
void DroughtStateRun(void)
|
||||
{
|
||||
switch (gWeatherPtr->unknown_742)
|
||||
switch (gWeatherPtr->droughtState)
|
||||
{
|
||||
case 0:
|
||||
if (++gWeatherPtr->unknown_740 > 5)
|
||||
if (++gWeatherPtr->droughtTimer > 5)
|
||||
{
|
||||
gWeatherPtr->unknown_740 = 0;
|
||||
sub_80ABFE0(gWeatherPtr->unknown_73C++);
|
||||
if (gWeatherPtr->unknown_73C > 5)
|
||||
gWeatherPtr->droughtTimer = 0;
|
||||
SetDroughtGamma(gWeatherPtr->droughtBrightnessStage++);
|
||||
if (gWeatherPtr->droughtBrightnessStage > 5)
|
||||
{
|
||||
gWeatherPtr->unknown_73E = gWeatherPtr->unknown_73C;
|
||||
gWeatherPtr->unknown_742 = 1;
|
||||
gWeatherPtr->unknown_740 = 0x3C;
|
||||
gWeatherPtr->droughtLastBrightnessStage = gWeatherPtr->droughtBrightnessStage;
|
||||
gWeatherPtr->droughtState = 1;
|
||||
gWeatherPtr->droughtTimer = 60;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
gWeatherPtr->unknown_740 = (gWeatherPtr->unknown_740 + 3) & 0x7F;
|
||||
gWeatherPtr->unknown_73C = ((gSineTable[gWeatherPtr->unknown_740] - 1) >> 6) + 2;
|
||||
if (gWeatherPtr->unknown_73C != gWeatherPtr->unknown_73E)
|
||||
sub_80ABFE0(gWeatherPtr->unknown_73C);
|
||||
gWeatherPtr->unknown_73E = gWeatherPtr->unknown_73C;
|
||||
gWeatherPtr->droughtTimer = (gWeatherPtr->droughtTimer + 3) & 0x7F;
|
||||
gWeatherPtr->droughtBrightnessStage = ((gSineTable[gWeatherPtr->droughtTimer] - 1) >> 6) + 2;
|
||||
if (gWeatherPtr->droughtBrightnessStage != gWeatherPtr->droughtLastBrightnessStage)
|
||||
SetDroughtGamma(gWeatherPtr->droughtBrightnessStage);
|
||||
gWeatherPtr->droughtLastBrightnessStage = gWeatherPtr->droughtBrightnessStage;
|
||||
break;
|
||||
case 2:
|
||||
if (++gWeatherPtr->unknown_740 > 5)
|
||||
if (++gWeatherPtr->droughtTimer > 5)
|
||||
{
|
||||
gWeatherPtr->unknown_740 = 0;
|
||||
sub_80ABFE0(--gWeatherPtr->unknown_73C);
|
||||
if (gWeatherPtr->unknown_73C == 3)
|
||||
gWeatherPtr->unknown_742 = 0;
|
||||
gWeatherPtr->droughtTimer = 0;
|
||||
SetDroughtGamma(--gWeatherPtr->droughtBrightnessStage);
|
||||
if (gWeatherPtr->droughtBrightnessStage == 3)
|
||||
gWeatherPtr->droughtState = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user