More updating event macro comments
This commit is contained in:
+1
-1
@@ -686,7 +686,7 @@ u8 BattleSetup_GetTerrainId(void)
|
||||
}
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE113) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE113))
|
||||
return BATTLE_TERRAIN_SAND;
|
||||
if (GetSav1Weather() == WEATHER_SANDSTORM)
|
||||
if (GetSavedWeather() == WEATHER_SANDSTORM)
|
||||
return BATTLE_TERRAIN_SAND;
|
||||
|
||||
return BATTLE_TERRAIN_PLAIN;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "trainer_hill.h"
|
||||
#include "fldeff.h"
|
||||
|
||||
// This file's functions.
|
||||
static void Task_ExitNonAnimDoor(u8);
|
||||
static void Task_ExitNonDoor(u8);
|
||||
static void Task_DoContestHallWarp(u8);
|
||||
@@ -50,9 +49,9 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId);
|
||||
// data[0] is used universally by tasks in this file as a state for switches
|
||||
#define tState data[0]
|
||||
|
||||
// const
|
||||
static const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
|
||||
const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelPixelRadii) - 1;
|
||||
// Smaller flash level -> larger flash radius
|
||||
static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
|
||||
const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1;
|
||||
|
||||
const struct ScanlineEffectParams sFlashEffectParams =
|
||||
{
|
||||
@@ -971,14 +970,14 @@ static u8 StartUpdateOrbFlashEffect(s32 centerX, s32 centerY, s32 initialFlashRa
|
||||
#undef tFlashRadiusDelta
|
||||
#undef tClearScanlineEffect
|
||||
|
||||
// A higher flashLevel value is a smaller flash radius (more darkness). 0 is full brightness
|
||||
void AnimateFlash(u8 flashLevel)
|
||||
// A higher flash level is a smaller flash radius (more darkness). 0 is full brightness
|
||||
void AnimateFlash(u8 newFlashLevel)
|
||||
{
|
||||
u8 curFlashLevel = GetFlashLevel();
|
||||
bool8 fullBrightness = FALSE;
|
||||
if (!flashLevel)
|
||||
if (newFlashLevel == 0)
|
||||
fullBrightness = TRUE;
|
||||
StartUpdateFlashLevelEffect(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[curFlashLevel], sFlashLevelPixelRadii[flashLevel], fullBrightness, 1);
|
||||
StartUpdateFlashLevelEffect(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelToRadius[curFlashLevel], sFlashLevelToRadius[newFlashLevel], fullBrightness, 1);
|
||||
StartWaitForFlashUpdate();
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
@@ -987,7 +986,7 @@ void WriteFlashScanlineEffectBuffer(u8 flashLevel)
|
||||
{
|
||||
if (flashLevel)
|
||||
{
|
||||
SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[flashLevel]);
|
||||
SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelToRadius[flashLevel]);
|
||||
CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1570,17 +1570,13 @@ bool8 FoundBlackGlasses(void)
|
||||
void SetRoute119Weather(void)
|
||||
{
|
||||
if (IsMapTypeOutdoors(GetLastUsedWarpMapType()) != TRUE)
|
||||
{
|
||||
SetSav1Weather(WEATHER_ROUTE119_CYCLE);
|
||||
}
|
||||
SetSavedWeather(WEATHER_ROUTE119_CYCLE);
|
||||
}
|
||||
|
||||
void SetRoute123Weather(void)
|
||||
{
|
||||
if (IsMapTypeOutdoors(GetLastUsedWarpMapType()) != TRUE)
|
||||
{
|
||||
SetSav1Weather(WEATHER_ROUTE123_CYCLE);
|
||||
}
|
||||
SetSavedWeather(WEATHER_ROUTE123_CYCLE);
|
||||
}
|
||||
|
||||
u8 GetLeadMonIndex(void)
|
||||
|
||||
@@ -2487,19 +2487,19 @@ static void CreateAbnormalWeatherTask(void)
|
||||
static u8 TranslateWeatherNum(u8);
|
||||
static void UpdateRainCounter(u8, u8);
|
||||
|
||||
void SetSav1Weather(u32 weather)
|
||||
void SetSavedWeather(u32 weather)
|
||||
{
|
||||
u8 oldWeather = gSaveBlock1Ptr->weather;
|
||||
gSaveBlock1Ptr->weather = TranslateWeatherNum(weather);
|
||||
UpdateRainCounter(gSaveBlock1Ptr->weather, oldWeather);
|
||||
}
|
||||
|
||||
u8 GetSav1Weather(void)
|
||||
u8 GetSavedWeather(void)
|
||||
{
|
||||
return gSaveBlock1Ptr->weather;
|
||||
}
|
||||
|
||||
void SetSav1WeatherFromCurrMapHeader(void)
|
||||
void SetSavedWeatherFromCurrMapHeader(void)
|
||||
{
|
||||
u8 oldWeather = gSaveBlock1Ptr->weather;
|
||||
gSaveBlock1Ptr->weather = TranslateWeatherNum(gMapHeader.weather);
|
||||
@@ -2508,19 +2508,19 @@ void SetSav1WeatherFromCurrMapHeader(void)
|
||||
|
||||
void SetWeather(u32 weather)
|
||||
{
|
||||
SetSav1Weather(weather);
|
||||
SetNextWeather(GetSav1Weather());
|
||||
SetSavedWeather(weather);
|
||||
SetNextWeather(GetSavedWeather());
|
||||
}
|
||||
|
||||
void SetWeather_Unused(u32 weather)
|
||||
{
|
||||
SetSav1Weather(weather);
|
||||
SetCurrentAndNextWeather(GetSav1Weather());
|
||||
SetSavedWeather(weather);
|
||||
SetCurrentAndNextWeather(GetSavedWeather());
|
||||
}
|
||||
|
||||
void DoCurrentWeather(void)
|
||||
{
|
||||
u8 weather = GetSav1Weather();
|
||||
u8 weather = GetSavedWeather();
|
||||
|
||||
if (weather == WEATHER_ABNORMAL)
|
||||
{
|
||||
@@ -2539,7 +2539,7 @@ void DoCurrentWeather(void)
|
||||
|
||||
void ResumePausedWeather(void)
|
||||
{
|
||||
u8 weather = GetSav1Weather();
|
||||
u8 weather = GetSavedWeather();
|
||||
|
||||
if (weather == WEATHER_ABNORMAL)
|
||||
{
|
||||
|
||||
+7
-3
@@ -803,7 +803,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
RestartWildEncounterImmunitySteps();
|
||||
TryUpdateRandomTrainerRematches(mapGroup, mapNum);
|
||||
DoTimeBasedEvents();
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
Overworld_ClearSavedMusic();
|
||||
@@ -854,7 +854,7 @@ static void LoadMapFromWarp(bool32 a1)
|
||||
TryUpdateRandomTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum);
|
||||
if (a1 != TRUE)
|
||||
DoTimeBasedEvents();
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
if (isOutdoors)
|
||||
FlagClear(FLAG_SYS_USE_FLASH);
|
||||
@@ -967,6 +967,10 @@ bool32 Overworld_IsBikingAllowed(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Flash level of 0 is fully bright
|
||||
// Flash level of 1 is the largest flash radius
|
||||
// Flash level of 7 is the smallest flash radius
|
||||
// Flash level of 8 is fully black
|
||||
void SetDefaultFlashLevel(void)
|
||||
{
|
||||
if (!gMapHeader.cave)
|
||||
@@ -1099,7 +1103,7 @@ u16 GetCurrLocationDefaultMusic(void)
|
||||
// Play the desert music only when the sandstorm is active on Route 111.
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE111)
|
||||
&& gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE111)
|
||||
&& GetSav1Weather() == WEATHER_SANDSTORM)
|
||||
&& GetSavedWeather() == WEATHER_SANDSTORM)
|
||||
return MUS_ROUTE111;
|
||||
|
||||
music = GetLocationMusic(&gSaveBlock1Ptr->location);
|
||||
|
||||
+4
-4
@@ -609,7 +609,7 @@ bool8 ScrCmd_animateflash(struct ScriptContext *ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setflashradius(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_setflashlevel(struct ScriptContext *ctx)
|
||||
{
|
||||
SetFlashLevel(VarGet(ScriptReadHalfword(ctx)));
|
||||
return FALSE;
|
||||
@@ -706,13 +706,13 @@ bool8 ScrCmd_setweather(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 weather = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_resetweather(struct ScriptContext *ctx)
|
||||
{
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1982,7 +1982,7 @@ bool8 ScrCmd_dofieldeffect(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setfieldeffectarg(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_setfieldeffectargument(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 argNum = ScriptReadByte(ctx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user