mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-10 19:13:42 +00:00
Environment documentation pass (#1115)
* some docs, start introducing time macro * most usages of CLOCK_TIME * finish up clock time defines, format * saving incase i need to revert * more docs * more docs progress * some more docs * format with 11 * change sos to storm * update functions.h * some depth stuff * review 1 and 2 * whoops * update zbuf stuff * most of review 3 * enum name * storm state enum * review 4 * fix enum * add comment to skyboxischanging * review * things dont match, committing so i can change branches * revert struct changes * define for override_full_control * new clock_time macro * fill alpha -> glare strength * update comment * remove indoor/outdoor, new name for underwater light variable * remove copy pasted comment * fix comments * remove whitespave * review
This commit is contained in:
parent
d7bbe43ba7
commit
4f0018bf36
50 changed files with 1339 additions and 1087 deletions
|
@ -855,7 +855,7 @@ void func_8006EE50(Font* font, u16 arg1, u16 arg2);
|
|||
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
|
||||
void Font_LoadMessageBoxIcon(Font* font, u16 icon);
|
||||
void Font_LoadOrderedFont(Font* font);
|
||||
s32 func_8006F0A0(s32 arg0);
|
||||
s32 Environment_ZBufValToFixedPoint(s32 zBufferVal);
|
||||
u16 Environment_GetPixelDepth(s32 x, s32 y);
|
||||
void Environment_GraphCallback(GraphicsContext* gfxCtx, void* param);
|
||||
void Environment_Init(GlobalContext* globalCtx, EnvironmentContext* envCtx, s32 unused);
|
||||
|
@ -874,9 +874,9 @@ void Environment_DrawSunLensFlare(GlobalContext* globalCtx, EnvironmentContext*
|
|||
GraphicsContext* gfxCtx, Vec3f pos, s32 unused);
|
||||
void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* envCtx, View* view,
|
||||
GraphicsContext* gfxCtx, Vec3f pos, s32 unused, s16 scale, f32 colorIntensity,
|
||||
s16 screenFillAlpha, u8 arg9);
|
||||
s16 glareStrength, u8 isSun);
|
||||
void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* gfxCtx);
|
||||
void func_80074CE8(GlobalContext* globalCtx, u32 arg1);
|
||||
void Environment_ChangeLightSetting(GlobalContext* globalCtx, u32 lightSetting);
|
||||
void Environment_DrawSkyboxFilters(GlobalContext* globalCtx);
|
||||
void Environment_UpdateLightningStrike(GlobalContext* globalCtx);
|
||||
void Environment_AddLightningBolts(GlobalContext* globalCtx, u8 num);
|
||||
|
@ -1491,7 +1491,7 @@ void Play_Main(GameState* thisx);
|
|||
s32 Play_InCsMode(GlobalContext* globalCtx);
|
||||
f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec);
|
||||
void* Play_LoadFile(GlobalContext* globalCtx, RomFile* file);
|
||||
void func_800C016C(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest);
|
||||
void Play_GetScreenPos(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest);
|
||||
s16 Play_CreateSubCamera(GlobalContext* globalCtx);
|
||||
s16 Play_GetActiveCamId(GlobalContext* globalCtx);
|
||||
s16 Play_ChangeCameraStatus(GlobalContext* globalCtx, s16 camId, s16 status);
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#define YEARS_ADULT 17
|
||||
#define LINK_AGE_IN_YEARS (!LINK_IS_ADULT ? YEARS_CHILD : YEARS_ADULT)
|
||||
|
||||
#define CLOCK_TIME(hr, min) ((s32)(((hr) * 60 + (min)) * (f32)0x10000 / (24 * 60) + 0.5f))
|
||||
|
||||
#define IS_DAY (gSaveContext.nightFlag == 0)
|
||||
#define IS_NIGHT (gSaveContext.nightFlag == 1)
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#define R_ENV_FOG_COLOR(i) REG(10 + i)
|
||||
#define R_ENV_FOG_FAR REG(13)
|
||||
#define R_ENV_FOG_NEAR REG(14)
|
||||
#define R_ENV_TIME_INCREMENT REG(15)
|
||||
#define R_ENV_TIME_SPEED_OLD REG(15) // Most likely used during development. Unused in the final game.
|
||||
#define R_RUN_SPEED_LIMIT REG(45)
|
||||
#define R_ENABLE_ARENA_DBG SREG(0)
|
||||
#define R_UPDATE_RATE SREG(30)
|
||||
|
|
|
@ -61,12 +61,12 @@ extern s32 gMaxActorId; // original name: "MaxProfile"
|
|||
extern s32 gDbgCamEnabled;
|
||||
extern GameStateOverlay gGameStateOverlayTable[6];
|
||||
extern u8 gWeatherMode;
|
||||
extern u8 D_8011FB34;
|
||||
extern u8 D_8011FB38;
|
||||
extern u8 gSkyboxBlendingEnabled;
|
||||
extern u16 gTimeIncrement;
|
||||
extern struct_8011FC1C D_8011FC1C[][9];
|
||||
extern SkyboxFile gSkyboxFiles[];
|
||||
extern u8 gLightConfigAfterUnderwater;
|
||||
extern u8 gInterruptSongOfStorms;
|
||||
extern u8 gSkyboxIsChanging;
|
||||
extern u16 gTimeSpeed;
|
||||
extern TimeBasedSkyboxEntry gTimeBasedSkyboxConfigs[][9];
|
||||
extern SkyboxFile gNormalSkyFiles[];
|
||||
extern s32 gZeldaArenaLogSeverity;
|
||||
extern MapData gMapDataTable;
|
||||
extern s16 gSpoilingItems[3];
|
||||
|
@ -176,7 +176,7 @@ extern u8 gCustomLensFlareOn;
|
|||
extern Vec3f gCustomLensFlarePos;
|
||||
extern s16 gLensFlareScale;
|
||||
extern f32 gLensFlareColorIntensity;
|
||||
extern s16 gLensFlareScreenFillAlpha;
|
||||
extern s16 gLensFlareGlareStrength;
|
||||
extern LightningStrike gLightningStrike;
|
||||
extern MapData* gMapData;
|
||||
extern f32 gBossMarkScale;
|
||||
|
|
|
@ -8,11 +8,49 @@
|
|||
#define FILL_SCREEN_OPA (1 << 0)
|
||||
#define FILL_SCREEN_XLU (1 << 1)
|
||||
|
||||
#define NEXT_TIME_NONE 0xFFFF
|
||||
#define NEXT_TIME_DAY (CLOCK_TIME(12, 0) + 1)
|
||||
#define NEXT_TIME_NIGHT CLOCK_TIME(0, 0)
|
||||
#define NEXT_TIME_DAY_SET 0xFFFE
|
||||
#define NEXT_TIME_NIGHT_SET 0xFFFD
|
||||
|
||||
#define LIGHT_SETTING_MAX 31
|
||||
#define LIGHT_SETTING_OVERRIDE_NONE 0xFF
|
||||
|
||||
// This mode disables the updating of lights in both light modes.
|
||||
// With this mode enabled, the only way lights can change is via the adjustment arrays.
|
||||
// This mode is not used in the original game.
|
||||
#define LIGHT_SETTING_OVERRIDE_FULL_CONTROL 0xFE
|
||||
|
||||
#define LIGHT_BLENDRATE_OVERRIDE_NONE 0xFFFF
|
||||
#define LIGHT_BLEND_OVERRIDE_NONE 0
|
||||
#define LIGHT_BLEND_OVERRIDE_ON 1
|
||||
|
||||
// This mode disables the light system's automatic blending between
|
||||
// light settings for `LIGHT_MODE_SETTINGS` (or using a light setting override).
|
||||
// This is a bit of a hack used only by bosses in the original game.
|
||||
#define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day
|
||||
/* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting`
|
||||
} LightMode;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHTNING_MODE_OFF, // no lightning
|
||||
/* 1 */ LIGHTNING_MODE_ON, // request ligtning strikes at random intervals
|
||||
/* 2 */ LIGHTNING_MODE_LAST // request one lightning strike before turning off
|
||||
} LightningMode;
|
||||
/* 0 */ SKYBOX_DMA_INACTIVE,
|
||||
/* 1 */ SKYBOX_DMA_TEXTURE1_START,
|
||||
/* 2 */ SKYBOX_DMA_TEXTURE1_DONE,
|
||||
/* 3 */ SKYBOX_DMA_TLUT1_START,
|
||||
/* 11 */ SKYBOX_DMA_TEXTURE2_START = 11,
|
||||
/* 12 */ SKYBOX_DMA_TEXTURE2_DONE,
|
||||
/* 13 */ SKYBOX_DMA_TLUT2_START
|
||||
} SkyboxDmaState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHTNING_OFF, // no lightning
|
||||
/* 1 */ LIGHTNING_ON, // request ligtning strikes at random intervals
|
||||
/* 2 */ LIGHTNING_LAST // request one lightning strike before turning off
|
||||
} LightningState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHTNING_STRIKE_WAIT, // wait between lightning strikes. request bolts when timer hits 0
|
||||
|
@ -21,14 +59,53 @@ typedef enum {
|
|||
} LightningStrikeState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SKYBOX_DMA_INACTIVE,
|
||||
/* 1 */ SKYBOX_DMA_FILE1_START,
|
||||
/* 2 */ SKYBOX_DMA_FILE1_DONE,
|
||||
/* 3 */ SKYBOX_DMA_PAL1_START,
|
||||
/* 11 */ SKYBOX_DMA_FILE2_START = 11,
|
||||
/* 12 */ SKYBOX_DMA_FILE2_DONE,
|
||||
/* 13 */ SKYBOX_DMA_PAL2_START
|
||||
} SkyboxDmaState;
|
||||
/* 0 */ WEATHER_MODE_CLEAR,
|
||||
/* 1 */ WEATHER_MODE_CLOUDY_CONFIG3, // scene must define settings for light config 3
|
||||
/* 2 */ WEATHER_MODE_CLOUDY_CONFIG2, // scene must define settings for light config 2
|
||||
/* 3 */ WEATHER_MODE_SNOW, // scene must define settings for light config 2
|
||||
/* 4 */ WEATHER_MODE_RAIN, // scene must define settings for light config 2
|
||||
/* 5 */ WEATHER_MODE_HEAVY_RAIN // scene must define settings for light config 4
|
||||
} WeatherMode;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ CHANGE_SKYBOX_INACTIVE,
|
||||
/* 1 */ CHANGE_SKYBOX_REQUESTED,
|
||||
/* 2 */ CHANGE_SKYBOX_WAIT,
|
||||
/* 3 */ CHANGE_SKYBOX_ACTIVE
|
||||
} ChangeSkyboxState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger
|
||||
/* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen
|
||||
/* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen
|
||||
/* 3 */ PRECIP_SNOW_MAX, // max number of snowflakes that can draw
|
||||
/* 4 */ PRECIP_SOS_MAX, // max number of rain drops requested from song of storms specifically
|
||||
/* 5 */ PRECIP_MAX
|
||||
} PrecipitationData;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ STORM_REQUEST_NONE,
|
||||
/* 1 */ STORM_REQUEST_START,
|
||||
/* 2 */ STORM_REQUEST_STOP
|
||||
} StormRequest;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ STORM_STATE_OFF,
|
||||
/* 1 */ STORM_STATE_ON
|
||||
} StormState;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ TIMESEQ_DAY_BGM,
|
||||
/* 0x01 */ TIMESEQ_FADE_DAY_BGM,
|
||||
/* 0x02 */ TIMESEQ_NIGHT_BEGIN_SFX,
|
||||
/* 0x03 */ TIMESEQ_EARLY_NIGHT_CRITTERS,
|
||||
/* 0x04 */ TIMESEQ_NIGHT_DELAY,
|
||||
/* 0x05 */ TIMESEQ_NIGHT_CRITTERS,
|
||||
/* 0x06 */ TIMESEQ_DAY_BEGIN_SFX,
|
||||
/* 0x07 */ TIMESEQ_MORNING_CRITTERS,
|
||||
/* 0x08 */ TIMESEQ_DAY_DELAY,
|
||||
/* 0xFF */ TIMESEQ_DISABLED = 0xFF
|
||||
} TimeBasedSeqState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SANDSTORM_OFF,
|
||||
|
@ -47,14 +124,13 @@ typedef struct {
|
|||
/* 0x08 */ f32 delayTimer;
|
||||
} LightningStrike; // size = 0xC
|
||||
|
||||
// describes what skybox files and blending modes to use depending on time of day
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 startTime;
|
||||
/* 0x02 */ u16 endTime;
|
||||
/* 0x04 */ u8 blend; // if true, blend between.. skyboxes? palettes?
|
||||
/* 0x05 */ u8 skybox1Index; // whats the difference between _pal and non _pal files?
|
||||
/* 0x04 */ u8 changeSkybox;
|
||||
/* 0x05 */ u8 skybox1Index;
|
||||
/* 0x06 */ u8 skybox2Index;
|
||||
} struct_8011FC1C; // size = 0x8
|
||||
} TimeBasedSkyboxEntry; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 ambientColor[3];
|
||||
|
@ -67,11 +143,9 @@ typedef struct {
|
|||
/* 0x14 */ s16 fogFar;
|
||||
} EnvLightSettings; // size = 0x16
|
||||
|
||||
// 1.0: 801D8EC4
|
||||
// dbg: 80222A44
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x02];
|
||||
/* 0x02 */ u16 timeIncrement; // how many units of time that pass every update
|
||||
/* 0x02 */ u16 sceneTimeSpeed; // time speed value from the scene file
|
||||
/* 0x04 */ Vec3f sunPos; // moon position can be found by negating the sun position
|
||||
/* 0x10 */ u8 skybox1Index;
|
||||
/* 0x11 */ u8 skybox2Index;
|
||||
|
@ -80,26 +154,26 @@ typedef struct {
|
|||
/* 0x14 */ char unk_14[0x01];
|
||||
/* 0x15 */ u8 skyboxDisabled;
|
||||
/* 0x16 */ u8 sunMoonDisabled;
|
||||
/* 0x17 */ u8 unk_17; // currentWeatherMode for skybox? (prev called gloomySky)
|
||||
/* 0x18 */ u8 unk_18; // nextWeatherMode for skybox?
|
||||
/* 0x19 */ u8 unk_19;
|
||||
/* 0x1A */ u16 unk_1A;
|
||||
/* 0x17 */ u8 skyboxConfig; // only used for `LIGHT_MODE_TIME`
|
||||
/* 0x18 */ u8 changeSkyboxNextConfig;
|
||||
/* 0x19 */ u8 changeSkyboxState;
|
||||
/* 0x1A */ u16 changeSkyboxTimer;
|
||||
/* 0x1C */ char unk_1C[0x02];
|
||||
/* 0x1E */ u8 indoors; // when set, day time has no effect on lighting
|
||||
/* 0x1F */ u8 unk_1F; // outdoor light index
|
||||
/* 0x20 */ u8 unk_20; // prev outdoor light index?
|
||||
/* 0x21 */ u8 unk_21;
|
||||
/* 0x22 */ u16 unk_22;
|
||||
/* 0x24 */ u16 unk_24;
|
||||
/* 0x1E */ u8 lightMode;
|
||||
/* 0x1F */ u8 lightConfig; // only used for `LIGHT_MODE_TIME`
|
||||
/* 0x20 */ u8 changeLightNextConfig;
|
||||
/* 0x21 */ u8 changeLightEnabled;
|
||||
/* 0x22 */ u16 changeLightTimer;
|
||||
/* 0x24 */ u16 changeDuration; // total time to change skybox and light configs
|
||||
/* 0x26 */ char unk_26[0x02];
|
||||
/* 0x28 */ LightInfo dirLight1; // used for sunlight outdoors
|
||||
/* 0x36 */ LightInfo dirLight2; // used for moonlight outdoors
|
||||
/* 0x28 */ LightInfo dirLight1; // used as sunlight for `LIGHT_MODE_TIME`
|
||||
/* 0x36 */ LightInfo dirLight2; // used as moonlight for `LIGHT_MODE_TIME`
|
||||
/* 0x44 */ s8 skyboxDmaState;
|
||||
/* 0x48 */ DmaRequest dmaRequest;
|
||||
/* 0x68 */ OSMesgQueue loadQueue;
|
||||
/* 0x80 */ OSMesg loadMsg;
|
||||
/* 0x84 */ f32 unk_84;
|
||||
/* 0x88 */ f32 unk_88;
|
||||
/* 0x84 */ f32 glareAlpha;
|
||||
/* 0x88 */ f32 lensFlareAlphaScale;
|
||||
/* 0x8C */ s16 adjAmbientColor[3];
|
||||
/* 0x92 */ s16 adjLight1Color[3];
|
||||
/* 0x98 */ s16 adjFogColor[3];
|
||||
|
@ -110,18 +184,18 @@ typedef struct {
|
|||
/* 0xB0 */ f32 windSpeed;
|
||||
/* 0xB4 */ u8 numLightSettings;
|
||||
/* 0xB8 */ EnvLightSettings* lightSettingsList; // list of light settings from the scene file
|
||||
/* 0xBC */ u8 blendIndoorLights; // when true, blend between indoor light settings when switching
|
||||
/* 0xBD */ u8 unk_BD; // indoor light index
|
||||
/* 0xBE */ u8 unk_BE; // prev indoor light index?
|
||||
/* 0xBF */ u8 unk_BF;
|
||||
/* 0xC0 */ EnvLightSettings lightSettings;
|
||||
/* 0xD6 */ u16 unk_D6;
|
||||
/* 0xD8 */ f32 unk_D8; // indoor light blend weight?
|
||||
/* 0xDC */ u8 unk_DC;
|
||||
/* 0xDD */ u8 gloomySkyMode;
|
||||
/* 0xDE */ u8 unk_DE; // gloomy sky state
|
||||
/* 0xDF */ u8 lightningMode;
|
||||
/* 0xE0 */ u8 unk_E0; // env sounds state
|
||||
/* 0xBC */ u8 lightBlendEnabled; // only used with `LIGHT_MODE_SETTINGS` or on override
|
||||
/* 0xBD */ u8 lightSetting; // only used with `LIGHT_MODE_SETTINGS` or on override
|
||||
/* 0xBE */ u8 prevLightSetting;
|
||||
/* 0xBF */ u8 lightSettingOverride;
|
||||
/* 0xC0 */ EnvLightSettings lightSettings; // settings for the currently "live" lights
|
||||
/* 0xD6 */ u16 lightBlendRateOverride;
|
||||
/* 0xD8 */ f32 lightBlend; // only used with `LIGHT_MODE_SETTINGS` or on setting override
|
||||
/* 0xDC */ u8 lightBlendOverride;
|
||||
/* 0xDD */ u8 stormRequest; // "rain_evt_trg"
|
||||
/* 0xDE */ u8 stormState;
|
||||
/* 0xDF */ u8 lightningState;
|
||||
/* 0xE0 */ u8 timeSeqState;
|
||||
/* 0xE1 */ u8 fillScreen;
|
||||
/* 0xE2 */ u8 screenFillColor[4];
|
||||
/* 0xE6 */ u8 sandstormState;
|
||||
|
@ -129,9 +203,8 @@ typedef struct {
|
|||
/* 0xE8 */ u8 sandstormEnvA;
|
||||
/* 0xE9 */ u8 customSkyboxFilter;
|
||||
/* 0xEA */ u8 skyboxFilterColor[4];
|
||||
/* 0xEE */ u8 unk_EE[4];
|
||||
/* 0xF2 */ u8 unk_F2[4];
|
||||
/* 0xF6 */ char unk_F6[0x06];
|
||||
/* 0xEE */ u8 precipitation[PRECIP_MAX];
|
||||
/* 0xF3 */ char unk_F3[0x09];
|
||||
} EnvironmentContext; // size = 0xFC
|
||||
|
||||
#endif
|
||||
|
|
|
@ -134,7 +134,7 @@ typedef struct {
|
|||
/* 0x13BC */ f32 entranceSpeed;
|
||||
/* 0x13C0 */ u16 entranceSound;
|
||||
/* 0x13C2 */ char unk_13C2[0x0001];
|
||||
/* 0x13C3 */ u8 unk_13C3;
|
||||
/* 0x13C3 */ u8 retainWeatherMode;
|
||||
/* 0x13C4 */ s16 dogParams;
|
||||
/* 0x13C6 */ u8 textTriggerFlags;
|
||||
/* 0x13C7 */ u8 showTitleCard;
|
||||
|
|
|
@ -4519,7 +4519,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) {
|
|||
retTextId = 0x7002;
|
||||
} else if (Flags_GetInfTable(INFTABLE_6A)) {
|
||||
retTextId = 0x7004;
|
||||
} else if ((gSaveContext.dayTime >= 0x4000) && (gSaveContext.dayTime < 0xC556)) {
|
||||
} else if ((gSaveContext.dayTime >= CLOCK_TIME(6, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 30))) {
|
||||
retTextId = 0x7002;
|
||||
} else {
|
||||
retTextId = 0x7003;
|
||||
|
|
|
@ -15,7 +15,7 @@ void SaveContext_Init(void) {
|
|||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_NONE;
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.dogIsLost = true;
|
||||
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
|
||||
|
|
|
@ -229,7 +229,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
if (sp3F != 0) {
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_4, 0x3F);
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 1);
|
||||
globalCtx->envCtx.unk_EE[0] = 20;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 20;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
@ -254,14 +254,14 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
break;
|
||||
case 7:
|
||||
if (sp3F != 0) {
|
||||
globalCtx->envCtx.unk_19 = 1;
|
||||
globalCtx->envCtx.unk_17 = 1;
|
||||
globalCtx->envCtx.unk_18 = 0;
|
||||
globalCtx->envCtx.unk_1A = 0x3C;
|
||||
globalCtx->envCtx.unk_21 = 1;
|
||||
globalCtx->envCtx.unk_1F = 0;
|
||||
globalCtx->envCtx.unk_20 = 1;
|
||||
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24 = 0x3C;
|
||||
globalCtx->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED;
|
||||
globalCtx->envCtx.skyboxConfig = 1;
|
||||
globalCtx->envCtx.changeSkyboxNextConfig = 0;
|
||||
globalCtx->envCtx.changeSkyboxTimer = 60;
|
||||
globalCtx->envCtx.changeLightEnabled = true;
|
||||
globalCtx->envCtx.lightConfig = 0;
|
||||
globalCtx->envCtx.changeLightNextConfig = 1;
|
||||
globalCtx->envCtx.changeLightTimer = globalCtx->envCtx.changeDuration = 60;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
|
@ -270,7 +270,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
}
|
||||
break;
|
||||
case 9:
|
||||
globalCtx->envCtx.unk_EE[3] = 16;
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX] = 16;
|
||||
break;
|
||||
case 10:
|
||||
Flags_SetEnv(globalCtx, 1);
|
||||
|
@ -325,13 +325,13 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
}
|
||||
break;
|
||||
case 18:
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
if (gSaveContext.dayTime < 0x4AAB) {
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_STOP;
|
||||
if (gSaveContext.dayTime < CLOCK_TIME(7, 0)) {
|
||||
gSaveContext.dayTime += 30;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_EE[1] == 0) {
|
||||
gWeatherMode = 0;
|
||||
if (globalCtx->envCtx.precipitation[PRECIP_RAIN_CUR] == 0) {
|
||||
gWeatherMode = WEATHER_MODE_CLEAR;
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 0);
|
||||
}
|
||||
break;
|
||||
|
@ -361,18 +361,19 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
break;
|
||||
case 25:
|
||||
gSaveContext.dayTime += 30;
|
||||
if ((gSaveContext.dayTime) > 0xCAAA) {
|
||||
gSaveContext.dayTime = 0xCAAA;
|
||||
if ((gSaveContext.dayTime) >= CLOCK_TIME(19, 0)) {
|
||||
gSaveContext.dayTime = CLOCK_TIME(19, 0) - 1;
|
||||
}
|
||||
break;
|
||||
case 26:
|
||||
if ((gSaveContext.dayTime < 0x3000) || (gSaveContext.dayTime >= 0x4555)) {
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xAAAB)) {
|
||||
globalCtx->envCtx.unk_BF = 1;
|
||||
} else if ((gSaveContext.dayTime >= 0xAAAB) && (gSaveContext.dayTime < 0xC556)) {
|
||||
globalCtx->envCtx.unk_BF = 2;
|
||||
if ((gSaveContext.dayTime < CLOCK_TIME(4, 30)) || (gSaveContext.dayTime >= CLOCK_TIME(6, 30))) {
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(6, 30)) && (gSaveContext.dayTime < CLOCK_TIME(16, 0))) {
|
||||
globalCtx->envCtx.lightSettingOverride = 1;
|
||||
} else if ((gSaveContext.dayTime >= CLOCK_TIME(16, 0)) &&
|
||||
(gSaveContext.dayTime <= CLOCK_TIME(18, 30))) {
|
||||
globalCtx->envCtx.lightSettingOverride = 2;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_BF = 3;
|
||||
globalCtx->envCtx.lightSettingOverride = 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -414,9 +415,9 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
break;
|
||||
case 34:
|
||||
if (IS_DAY) {
|
||||
gSaveContext.dayTime -= gTimeIncrement;
|
||||
gSaveContext.dayTime -= gTimeSpeed;
|
||||
} else {
|
||||
gSaveContext.dayTime -= gTimeIncrement * 2;
|
||||
gSaveContext.dayTime -= gTimeSpeed * 2;
|
||||
}
|
||||
break;
|
||||
case 35:
|
||||
|
@ -429,8 +430,8 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
|||
// Command 4: Set Environment Lighting
|
||||
void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) {
|
||||
if (csCtx->frames == cmd->startFrame) {
|
||||
globalCtx->envCtx.unk_BF = cmd->setting - 1;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightSettingOverride = cmd->setting - 1;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1222,8 +1223,8 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
|
|||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
||||
break;
|
||||
case 119:
|
||||
gSaveContext.dayTime = 0x8000;
|
||||
gSaveContext.skyboxTime = 0x8000;
|
||||
gSaveContext.dayTime = CLOCK_TIME(12, 0);
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(12, 0);
|
||||
globalCtx->nextEntranceIndex = ENTR_NAKANIWA_1;
|
||||
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
|
||||
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||
|
|
1198
src/code/z_kankyo.c
1198
src/code/z_kankyo.c
File diff suppressed because it is too large
Load diff
|
@ -347,7 +347,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
|
|||
if (1) {}
|
||||
if (1) {}
|
||||
|
||||
if (wZ < (func_8006F0A0(zBuf) >> 3)) {
|
||||
if (wZ < (Environment_ZBufValToFixedPoint(zBuf) >> 3)) {
|
||||
params->drawGlow = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3829,7 +3829,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
|
||||
void Interface_Update(GlobalContext* globalCtx) {
|
||||
static u8 D_80125B60 = false;
|
||||
static s16 sPrevTimeIncrement = 0;
|
||||
static s16 sPrevTimeSpeed = 0;
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
@ -4152,35 +4152,35 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
// handle suns song in areas where time moves
|
||||
if (globalCtx->envCtx.timeIncrement != 0) {
|
||||
if (globalCtx->envCtx.sceneTimeSpeed != 0) {
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_SPEED_TIME) {
|
||||
D_80125B60 = false;
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(6, 30)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 0) + 1)) {
|
||||
D_80125B60 = true;
|
||||
}
|
||||
|
||||
gSaveContext.sunsSongState = SUNSSONG_SPEED_TIME;
|
||||
sPrevTimeIncrement = gTimeIncrement;
|
||||
gTimeIncrement = 400;
|
||||
sPrevTimeSpeed = gTimeSpeed;
|
||||
gTimeSpeed = 400;
|
||||
} else if (!D_80125B60) {
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(6, 30)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 0) + 1)) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gTimeIncrement = sPrevTimeIncrement;
|
||||
gTimeSpeed = sPrevTimeSpeed;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
} else if (gSaveContext.dayTime > 0xC001) {
|
||||
} else if (gSaveContext.dayTime > CLOCK_TIME(18, 0) + 1) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gTimeIncrement = sPrevTimeIncrement;
|
||||
gTimeSpeed = sPrevTimeSpeed;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
} else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) {
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) {
|
||||
gSaveContext.nextDayTime = 0;
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(6, 30)) && (gSaveContext.dayTime < CLOCK_TIME(18, 0) + 1)) {
|
||||
gSaveContext.nextDayTime = NEXT_TIME_NIGHT;
|
||||
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
||||
globalCtx->unk_11DE9 = true;
|
||||
} else {
|
||||
gSaveContext.nextDayTime = 0x8001;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_DAY;
|
||||
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
||||
globalCtx->unk_11DE9 = true;
|
||||
|
|
|
@ -256,12 +256,12 @@ void Play_Init(GameState* thisx) {
|
|||
gSaveContext.cutsceneIndex = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.nextDayTime != 0xFFFF) {
|
||||
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
|
||||
gSaveContext.dayTime = gSaveContext.nextDayTime;
|
||||
gSaveContext.skyboxTime = gSaveContext.nextDayTime;
|
||||
}
|
||||
|
||||
if (gSaveContext.dayTime > 0xC000 || gSaveContext.dayTime < 0x4555) {
|
||||
if (gSaveContext.dayTime > CLOCK_TIME(18, 0) || gSaveContext.dayTime < CLOCK_TIME(6, 30)) {
|
||||
gSaveContext.nightFlag = 1;
|
||||
} else {
|
||||
gSaveContext.nightFlag = 0;
|
||||
|
@ -315,8 +315,8 @@ void Play_Init(GameState* thisx) {
|
|||
KaleidoScopeCall_Init(this);
|
||||
func_801109B0(this);
|
||||
|
||||
if (gSaveContext.nextDayTime != 0xFFFF) {
|
||||
if (gSaveContext.nextDayTime == 0x8001) {
|
||||
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
|
||||
if (gSaveContext.nextDayTime == NEXT_TIME_DAY) {
|
||||
gSaveContext.totalDays++;
|
||||
gSaveContext.bgsDayCount++;
|
||||
gSaveContext.dogIsLost = true;
|
||||
|
@ -324,9 +324,9 @@ void Play_Init(GameState* thisx) {
|
|||
Inventory_ReplaceItem(this, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) {
|
||||
Message_StartTextbox(this, 0x3066, NULL);
|
||||
}
|
||||
gSaveContext.nextDayTime = 0xFFFE;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_DAY_SET;
|
||||
} else {
|
||||
gSaveContext.nextDayTime = 0xFFFD;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_NIGHT_SET;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1256,7 +1256,7 @@ void Play_Draw(GlobalContext* this) {
|
|||
}
|
||||
}
|
||||
|
||||
if (this->envCtx.unk_EE[1] != 0) {
|
||||
if (this->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
|
||||
Environment_DrawRain(this, &this->view, gfxCtx);
|
||||
}
|
||||
|
||||
|
@ -1515,17 +1515,17 @@ void Play_SpawnScene(GlobalContext* this, s32 sceneNum, s32 spawn) {
|
|||
osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(this, &this->roomCtx) / 1024.0f);
|
||||
}
|
||||
|
||||
void func_800C016C(GlobalContext* this, Vec3f* src, Vec3f* dest) {
|
||||
f32 temp;
|
||||
void Play_GetScreenPos(GlobalContext* this, Vec3f* src, Vec3f* dest) {
|
||||
f32 w;
|
||||
|
||||
Matrix_Mult(&this->viewProjectionMtxF, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(src, dest);
|
||||
|
||||
temp = this->viewProjectionMtxF.ww + (this->viewProjectionMtxF.wx * src->x + this->viewProjectionMtxF.wy * src->y +
|
||||
this->viewProjectionMtxF.wz * src->z);
|
||||
w = this->viewProjectionMtxF.ww + (this->viewProjectionMtxF.wx * src->x + this->viewProjectionMtxF.wy * src->y +
|
||||
this->viewProjectionMtxF.wz * src->z);
|
||||
|
||||
dest->x = 160.0f + ((dest->x / temp) * 160.0f);
|
||||
dest->y = 120.0f - ((dest->y / temp) * 120.0f);
|
||||
dest->x = (SCREEN_WIDTH / 2) + ((dest->x / w) * (SCREEN_WIDTH / 2));
|
||||
dest->y = (SCREEN_HEIGHT / 2) - ((dest->y / w) * (SCREEN_HEIGHT / 2));
|
||||
}
|
||||
|
||||
s16 Play_CreateSubCamera(GlobalContext* this) {
|
||||
|
|
|
@ -344,8 +344,8 @@ void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) {
|
|||
// Scene Command 0x11: Skybox Settings
|
||||
void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId;
|
||||
globalCtx->envCtx.unk_17 = globalCtx->envCtx.unk_18 = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->envCtx.indoors = cmd->skyboxSettings.unk_06;
|
||||
globalCtx->envCtx.skyboxConfig = globalCtx->envCtx.changeSkyboxNextConfig = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->envCtx.lightMode = cmd->skyboxSettings.unk_06;
|
||||
}
|
||||
|
||||
// Scene Command 0x12: Skybox Disables
|
||||
|
@ -362,30 +362,31 @@ void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) {
|
|||
}
|
||||
|
||||
if (cmd->timeSettings.unk_06 != 0xFF) {
|
||||
globalCtx->envCtx.timeIncrement = cmd->timeSettings.unk_06;
|
||||
globalCtx->envCtx.sceneTimeSpeed = cmd->timeSettings.unk_06;
|
||||
} else {
|
||||
globalCtx->envCtx.timeIncrement = 0;
|
||||
globalCtx->envCtx.sceneTimeSpeed = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.sunsSongState == SUNSSONG_INACTIVE) {
|
||||
gTimeIncrement = globalCtx->envCtx.timeIncrement;
|
||||
gTimeSpeed = globalCtx->envCtx.sceneTimeSpeed;
|
||||
}
|
||||
|
||||
globalCtx->envCtx.sunPos.x = -(Math_SinS(((void)0, gSaveContext.dayTime) - 0x8000) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.dayTime) - 0x8000) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.dayTime) - 0x8000) * 20.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.x = -(Math_SinS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.dayTime) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f;
|
||||
|
||||
if (((globalCtx->envCtx.timeIncrement == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
if (((globalCtx->envCtx.sceneTimeSpeed == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
(gSaveContext.entranceIndex == ENTR_SPOT06_8)) {
|
||||
gSaveContext.skyboxTime = ((void)0, gSaveContext.dayTime);
|
||||
if ((gSaveContext.skyboxTime >= 0x2AAC) && (gSaveContext.skyboxTime < 0x4555)) {
|
||||
gSaveContext.skyboxTime = 0x3556;
|
||||
} else if ((gSaveContext.skyboxTime >= 0x4555) && (gSaveContext.skyboxTime < 0x5556)) {
|
||||
gSaveContext.skyboxTime = 0x5556;
|
||||
} else if ((gSaveContext.skyboxTime >= 0xAAAB) && (gSaveContext.skyboxTime < 0xB556)) {
|
||||
gSaveContext.skyboxTime = 0xB556;
|
||||
} else if ((gSaveContext.skyboxTime >= 0xC001) && (gSaveContext.skyboxTime < 0xCAAC)) {
|
||||
gSaveContext.skyboxTime = 0xCAAC;
|
||||
if ((gSaveContext.skyboxTime > CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) {
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(5, 0) + 1;
|
||||
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(6, 30)) && (gSaveContext.skyboxTime <= CLOCK_TIME(8, 0))) {
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(8, 0) + 1;
|
||||
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(16, 0)) && (gSaveContext.skyboxTime <= CLOCK_TIME(17, 0))) {
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(17, 0) + 1;
|
||||
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(18, 0) + 1) &&
|
||||
(gSaveContext.skyboxTime <= CLOCK_TIME(19, 0))) {
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(19, 0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ void func_80099BD8(GlobalContext* globalCtx) {
|
|||
gCustomLensFlarePos.z = -684.0f;
|
||||
gLensFlareScale = 10;
|
||||
gLensFlareColorIntensity = 8.0f;
|
||||
gLensFlareScreenFillAlpha = 200;
|
||||
gLensFlareGlareStrength = 200;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -999,14 +999,14 @@ void func_8009DA30(GlobalContext* globalCtx) {
|
|||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0A, displayListHead);
|
||||
|
||||
if ((gSaveContext.dayTime >= 0x4AAC) && (gSaveContext.dayTime <= 0xC555)) {
|
||||
if ((gSaveContext.dayTime > CLOCK_TIME(7, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 30))) {
|
||||
gSPEndDisplayList(displayListHead);
|
||||
} else {
|
||||
if (gSaveContext.dayTime > 0xC555) {
|
||||
if (gSaveContext.dayTime > CLOCK_TIME(18, 30)) {
|
||||
if (globalCtx->roomCtx.unk_74[0] != 255) {
|
||||
Math_StepToS(&globalCtx->roomCtx.unk_74[0], 255, 5);
|
||||
}
|
||||
} else if (gSaveContext.dayTime >= 0x4000) {
|
||||
} else if (gSaveContext.dayTime >= CLOCK_TIME(6, 0)) {
|
||||
if (globalCtx->roomCtx.unk_74[0] != 0) {
|
||||
Math_StepToS(&globalCtx->roomCtx.unk_74[0], 0, 10);
|
||||
}
|
||||
|
@ -1354,14 +1354,14 @@ void func_8009F5D4(GlobalContext* globalCtx) {
|
|||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, displayListHead);
|
||||
|
||||
if ((gSaveContext.dayTime >= 0x4AAC) && (gSaveContext.dayTime <= 0xC000)) {
|
||||
if ((gSaveContext.dayTime > CLOCK_TIME(7, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 0))) {
|
||||
gSPEndDisplayList(displayListHead);
|
||||
} else {
|
||||
if (gSaveContext.dayTime > 0xC000) {
|
||||
if (gSaveContext.dayTime > CLOCK_TIME(18, 0)) {
|
||||
if (globalCtx->roomCtx.unk_74[0] != 255) {
|
||||
Math_StepToS(&globalCtx->roomCtx.unk_74[0], 255, 5);
|
||||
}
|
||||
} else if (gSaveContext.dayTime >= 0x4000) {
|
||||
} else if (gSaveContext.dayTime >= CLOCK_TIME(6, 0)) {
|
||||
if (globalCtx->roomCtx.unk_74[0] != 0) {
|
||||
Math_StepToS(&globalCtx->roomCtx.unk_74[0], 0, 10);
|
||||
}
|
||||
|
|
|
@ -707,7 +707,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx, SramContext* sramCtx) {
|
|||
|
||||
gSaveContext.entranceIndex = ENTR_LINK_HOME_0;
|
||||
gSaveContext.linkAge = LINK_AGE_CHILD;
|
||||
gSaveContext.dayTime = 0x6AAB;
|
||||
gSaveContext.dayTime = CLOCK_TIME(10, 0);
|
||||
gSaveContext.cutsceneIndex = 0xFFF1;
|
||||
|
||||
if (fileChooseCtx->buttonIndex == 0) {
|
||||
|
|
|
@ -376,25 +376,28 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
|||
u8 skybox1Index;
|
||||
u8 skybox2Index;
|
||||
u32 start;
|
||||
s32 phi_v1;
|
||||
s32 skyboxConfig;
|
||||
|
||||
switch (skyboxId) {
|
||||
case SKYBOX_NORMAL_SKY:
|
||||
phi_v1 = 0;
|
||||
if (gSaveContext.unk_13C3 != 0 && gSaveContext.sceneSetupIndex < 4 && gWeatherMode > 0 &&
|
||||
gWeatherMode < 6) {
|
||||
phi_v1 = 1;
|
||||
skyboxConfig = 0;
|
||||
if (gSaveContext.retainWeatherMode && gSaveContext.sceneSetupIndex < 4 &&
|
||||
gWeatherMode > WEATHER_MODE_CLEAR && gWeatherMode <= WEATHER_MODE_HEAVY_RAIN) {
|
||||
skyboxConfig = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; i++) {
|
||||
if (gSaveContext.skyboxTime >= D_8011FC1C[phi_v1][i].startTime &&
|
||||
(gSaveContext.skyboxTime < D_8011FC1C[phi_v1][i].endTime ||
|
||||
D_8011FC1C[phi_v1][i].endTime == 0xFFFF)) {
|
||||
globalCtx->envCtx.skybox1Index = skybox1Index = D_8011FC1C[phi_v1][i].skybox1Index;
|
||||
globalCtx->envCtx.skybox2Index = skybox2Index = D_8011FC1C[phi_v1][i].skybox2Index;
|
||||
if (D_8011FC1C[phi_v1][i].blend != 0) {
|
||||
for (i = 0; i < ARRAY_COUNT(gTimeBasedSkyboxConfigs[skyboxConfig]); i++) {
|
||||
if (gSaveContext.skyboxTime >= gTimeBasedSkyboxConfigs[skyboxConfig][i].startTime &&
|
||||
(gSaveContext.skyboxTime < gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime ||
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime == 0xFFFF)) {
|
||||
globalCtx->envCtx.skybox1Index = skybox1Index =
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox1Index;
|
||||
globalCtx->envCtx.skybox2Index = skybox2Index =
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].skybox2Index;
|
||||
if (gTimeBasedSkyboxConfigs[skyboxConfig][i].changeSkybox) {
|
||||
globalCtx->envCtx.skyboxBlend =
|
||||
Environment_LerpWeight(D_8011FC1C[phi_v1][i].endTime, D_8011FC1C[phi_v1][i].startTime,
|
||||
Environment_LerpWeight(gTimeBasedSkyboxConfigs[skyboxConfig][i].endTime,
|
||||
gTimeBasedSkyboxConfigs[skyboxConfig][i].startTime,
|
||||
((void)0, gSaveContext.skyboxTime)) *
|
||||
255.0f;
|
||||
} else {
|
||||
|
@ -404,44 +407,44 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
|||
}
|
||||
}
|
||||
|
||||
size = gSkyboxFiles[skybox1Index].file.vromEnd - gSkyboxFiles[skybox1Index].file.vromStart;
|
||||
size = gNormalSkyFiles[skybox1Index].file.vromEnd - gNormalSkyFiles[skybox1Index].file.vromStart;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1054);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1055);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gSkyboxFiles[skybox1Index].file.vromStart, size,
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gNormalSkyFiles[skybox1Index].file.vromStart, size,
|
||||
"../z_vr_box.c", 1058);
|
||||
|
||||
size = gSkyboxFiles[skybox2Index].file.vromEnd - gSkyboxFiles[skybox2Index].file.vromStart;
|
||||
size = gNormalSkyFiles[skybox2Index].file.vromEnd - gNormalSkyFiles[skybox2Index].file.vromStart;
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1060);
|
||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||
1061);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gSkyboxFiles[skybox2Index].file.vromStart, size,
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size,
|
||||
"../z_vr_box.c", 1064);
|
||||
|
||||
if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
|
||||
size = gSkyboxFiles[skybox1Index].palette.vromEnd - gSkyboxFiles[skybox1Index].palette.vromStart;
|
||||
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1072);
|
||||
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[skybox1Index].palette.vromStart, size,
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, gNormalSkyFiles[skybox1Index].palette.vromStart, size,
|
||||
"../z_vr_box.c", 1075);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[skybox2Index].palette.vromStart, size,
|
||||
"../z_vr_box.c", 1077);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gNormalSkyFiles[skybox2Index].palette.vromStart,
|
||||
size, "../z_vr_box.c", 1077);
|
||||
} else {
|
||||
size = gSkyboxFiles[skybox1Index].palette.vromEnd - gSkyboxFiles[skybox1Index].palette.vromStart;
|
||||
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1085);
|
||||
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, gSkyboxFiles[skybox2Index].palette.vromStart, size,
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, gNormalSkyFiles[skybox2Index].palette.vromStart, size,
|
||||
"../z_vr_box.c", 1088);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gSkyboxFiles[skybox1Index].palette.vromStart, size,
|
||||
"../z_vr_box.c", 1090);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->palettes + size, gNormalSkyFiles[skybox1Index].palette.vromStart,
|
||||
size, "../z_vr_box.c", 1090);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_BF = 2;
|
||||
globalCtx->envCtx.lightSettingOverride = 2;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
|
||||
OnePointCutscene_Init(globalCtx, 8603, -99, NULL, CAM_ID_MAIN);
|
||||
|
@ -549,7 +549,7 @@ void BgDyYoseizo_Vanish(BgDyYoseizo* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->vanishTimer == 0) {
|
||||
func_8002DF54(globalCtx, &this->actor, 7);
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
findOcarinaSpot = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head;
|
||||
|
||||
while (findOcarinaSpot != NULL) {
|
||||
|
|
|
@ -232,7 +232,7 @@ void BgMoriBigst_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->waitTimer--;
|
||||
}
|
||||
if (func_80043590(&this->dyna)) {
|
||||
func_80074CE8(globalCtx, 6);
|
||||
Environment_ChangeLightSetting(globalCtx, 6);
|
||||
}
|
||||
if (this->actionFunc != NULL) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
|
|
|
@ -102,7 +102,7 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, 119.0f, 225.0f, -1566.0f, 0, 0, 0,
|
||||
thisx->params);
|
||||
globalCtx->envCtx.unk_BF = 0x4;
|
||||
globalCtx->envCtx.lightSettingOverride = 4;
|
||||
|
||||
} else if (!Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_PURPLE) && !Flags_GetSwitch(globalCtx, 0x1B)) {
|
||||
|
||||
|
@ -111,8 +111,8 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
(this->flameColor << 8) + thisx->params + 0x1000);
|
||||
|
||||
} else if (!Flags_GetSwitch(globalCtx, thisx->params)) {
|
||||
if (globalCtx->envCtx.unk_BF == 0xFF) {
|
||||
globalCtx->envCtx.unk_BF = 4;
|
||||
if (globalCtx->envCtx.lightSettingOverride == LIGHT_SETTING_OVERRIDE_NONE) {
|
||||
globalCtx->envCtx.lightSettingOverride = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,8 +125,8 @@ void BgPoSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
|
||||
if (globalCtx->envCtx.unk_BF != 0xFF) {
|
||||
globalCtx->envCtx.unk_BF = 0xFF;
|
||||
if (globalCtx->envCtx.lightSettingOverride != LIGHT_SETTING_OVERRIDE_NONE) {
|
||||
globalCtx->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
|
||||
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
||||
} else if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 3000.0f, 0x7530)) {
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_START;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -235,20 +235,20 @@ void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
u16 dayTime;
|
||||
s32 tmp;
|
||||
|
||||
if (gTimeIncrement == 50) {
|
||||
tmp = 0xD556;
|
||||
if (gTimeSpeed == 50) {
|
||||
tmp = CLOCK_TIME(20, 0) + 1;
|
||||
|
||||
if (gSaveContext.dayTime >= 0xD557) {
|
||||
tmp = 0x1D556;
|
||||
if (gSaveContext.dayTime > CLOCK_TIME(20, 0) + 1) {
|
||||
tmp = CLOCK_TIME(20, 0) + 1 + 0x10000;
|
||||
}
|
||||
|
||||
gTimeIncrement = (tmp - gSaveContext.dayTime) * (1.0f / 350.0f);
|
||||
gTimeSpeed = (tmp - gSaveContext.dayTime) * (1.0f / 350.0f);
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.dayTime;
|
||||
|
||||
if ((dayTime >= 0x2AAC) && (dayTime < 0x3000) && (gSaveContext.sceneSetupIndex == 5)) {
|
||||
gTimeIncrement = 0;
|
||||
if ((dayTime > CLOCK_TIME(4, 0)) && (dayTime < CLOCK_TIME(4, 30)) && (gSaveContext.sceneSetupIndex == 5)) {
|
||||
gTimeSpeed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -769,7 +769,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
s16 sp150;
|
||||
|
||||
if (this->fogMode == 0) {
|
||||
globalCtx->envCtx.unk_D8 = 0;
|
||||
globalCtx->envCtx.lightBlend = 0;
|
||||
}
|
||||
this->fogMode = 0xA;
|
||||
|
||||
|
@ -1081,36 +1081,36 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
if (1) {} // Needed for match
|
||||
|
||||
if (this->fogMode == 0) {
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_D8 = 0.5f + 0.5f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x500);
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlend = 0.5f + 0.5f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x500);
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
} else if (this->fogMode == 3) {
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.unk_BD = 2;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 2;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
} else if (this->fogMode == 2) {
|
||||
this->fogMode--;
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 0.55f + 0.05f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x3E00), 1.0f,
|
||||
0.15f);
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.55f + 0.05f * Math_SinS(this->work[BFD_VAR_TIMER] * 0x3E00),
|
||||
1.0f, 0.15f);
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
} else if (this->fogMode == 10) {
|
||||
this->fogMode = 1;
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 0.21f + 0.07f * Math_SinS(this->work[BFD_VAR_TIMER] * 0xC00), 1.0f,
|
||||
0.05f);
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.21f + 0.07f * Math_SinS(this->work[BFD_VAR_TIMER] * 0xC00),
|
||||
1.0f, 0.05f);
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
} else if (this->fogMode == 1) {
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 0.0f, 1.0f, 0.03f);
|
||||
if (globalCtx->envCtx.unk_D8 <= 0.01f) {
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.0f, 1.0f, 0.03f);
|
||||
if (globalCtx->envCtx.lightBlend <= 0.01f) {
|
||||
this->fogMode = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1164,7 +1164,7 @@ void BossFd_Effects(BossFd* this, GlobalContext* globalCtx) {
|
|||
if ((this->actor.colChkInfo.health == 0) ||
|
||||
((this->introState == BFD_CS_EMERGE) && (this->actor.world.rot.x > 0x3000))) {
|
||||
if ((u8)this->fogMode == 0) {
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
this->fogMode = 2;
|
||||
}
|
||||
|
|
|
@ -411,7 +411,7 @@ void BossFd2_BreatheFire(BossFd2* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if ((25.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame < 70.0f)) {
|
||||
if (this->skelAnime.curFrame == 25.0f) {
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_VALVAISA_FIRE - SFX_FLAG);
|
||||
if (this->skelAnime.curFrame > 50) {
|
||||
|
|
|
@ -624,7 +624,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
// fallthrough
|
||||
case 3:
|
||||
this->envLightMode = 0;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
this->csCamAt.y = (sinf(this->unk_704) * 300.0f) + this->csCamEye.y;
|
||||
this->csCamAt.z = (cosf(this->unk_704) * -300.0f) + this->csCamEye.z;
|
||||
Math_ApproachF(&this->unk_704, 0.25f, 0.05f, this->csCamAtMaxStep.y);
|
||||
|
@ -662,7 +662,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
this->envLightMode = 5;
|
||||
|
||||
if (this->csTimer < 50) {
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
|
||||
if (this->csTimer == 10) {
|
||||
|
@ -693,7 +693,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
this->fwork[GDF_TRIFORCE_PRIM_B] = 255.0f;
|
||||
this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f;
|
||||
func_80078884(NA_SE_EV_TRIFORCE_MARK);
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
// fallthrough
|
||||
case 7:
|
||||
this->envLightMode = 6;
|
||||
|
@ -708,7 +708,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->csTimer == 30) {
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
|
||||
BossGanon_SetIntroCsCamera(this, 4);
|
||||
|
@ -740,7 +740,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
this->fwork[GDF_TRIFORCE_PRIM_B] = 255.0f;
|
||||
this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f;
|
||||
func_80078884(NA_SE_EV_TRIFORCE_MARK);
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
// fallthrough
|
||||
case 9:
|
||||
this->envLightMode = 7;
|
||||
|
@ -760,7 +760,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->csTimer == 32) {
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
|
||||
if (this->csTimer == 50) {
|
||||
|
@ -832,7 +832,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
|
||||
case 15: // side view of all 3 of them
|
||||
this->envLightMode = 0;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
BossGanon_SetIntroCsCamera(this, 10);
|
||||
|
||||
if (this->csTimer == 30) {
|
||||
|
@ -925,7 +925,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
this->fwork[GDF_TRIFORCE_PRIM_A] = 0.0f;
|
||||
this->fwork[GDF_TRIFORCE_PRIM_B] = 255.0f;
|
||||
this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
// fallthrough
|
||||
case 19: // show triforce
|
||||
this->envLightMode = 8;
|
||||
|
@ -934,7 +934,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) {
|
|||
this->envLightMode = 9;
|
||||
|
||||
if (this->csTimer == 60) {
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1260,7 +1260,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx)
|
|||
this->envLightMode = 13;
|
||||
|
||||
if (this->csTimer < 30) {
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
|
||||
if (this->csTimer >= 2) {
|
||||
|
@ -1408,13 +1408,13 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx)
|
|||
this->envLightMode = 15;
|
||||
this->unk_508 = 0.0f;
|
||||
this->fwork[GDF_FWORK_1] = 1000.0f;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
if (this->csTimer < 10) {
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
|
||||
if (this->csTimer == 30) {
|
||||
|
@ -1543,7 +1543,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx)
|
|||
sCape->tearTimer = 20;
|
||||
|
||||
this->whiteFillAlpha = 255.0f;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
// fallthrough
|
||||
case 101:
|
||||
player->actor.world.pos.y = 4102.0f;
|
||||
|
@ -1641,7 +1641,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx)
|
|||
this->csCamAt.z = sZelda->actor.world.pos.z;
|
||||
|
||||
if (this->csTimer >= 10) {
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
}
|
||||
|
||||
if (this->csTimer == 10) {
|
||||
|
@ -3016,106 +3016,107 @@ void BossGanon_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
|
||||
switch (this->envLightMode) {
|
||||
case -1:
|
||||
break;
|
||||
case 0:
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 0.0f, 1.0f, 0.02f);
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.0f, 1.0f, 0.02f);
|
||||
break;
|
||||
case 1:
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.1f);
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.1f);
|
||||
break;
|
||||
case 2:
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.02f);
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.02f);
|
||||
break;
|
||||
case 3:
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
break;
|
||||
case 35:
|
||||
globalCtx->envCtx.unk_BD = 0;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightSetting = 0;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
break;
|
||||
case 4:
|
||||
globalCtx->envCtx.unk_BD = 4;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightSetting = 4;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
break;
|
||||
case 5:
|
||||
globalCtx->envCtx.unk_BE = 5;
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.075f);
|
||||
globalCtx->envCtx.prevLightSetting = 5;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.075f);
|
||||
break;
|
||||
case 6:
|
||||
globalCtx->envCtx.unk_BE = 5;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 5;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
break;
|
||||
case 65:
|
||||
globalCtx->envCtx.unk_BE = 3;
|
||||
globalCtx->envCtx.unk_BD = 6;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 3;
|
||||
globalCtx->envCtx.lightSetting = 6;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
break;
|
||||
case 7:
|
||||
globalCtx->envCtx.unk_BE = 7;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 7;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
break;
|
||||
case 75:
|
||||
globalCtx->envCtx.unk_BE = 4;
|
||||
globalCtx->envCtx.unk_BD = 8;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 4;
|
||||
globalCtx->envCtx.lightSetting = 8;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
break;
|
||||
case 8:
|
||||
globalCtx->envCtx.unk_BE = 3;
|
||||
globalCtx->envCtx.unk_BD = 9;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 3;
|
||||
globalCtx->envCtx.lightSetting = 9;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
break;
|
||||
case 9:
|
||||
globalCtx->envCtx.unk_BE = 3;
|
||||
globalCtx->envCtx.unk_BD = 0xA;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 3;
|
||||
globalCtx->envCtx.lightSetting = 10;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
break;
|
||||
case 10:
|
||||
globalCtx->envCtx.unk_BE = 3;
|
||||
globalCtx->envCtx.unk_BD = 0xB;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 3;
|
||||
globalCtx->envCtx.lightSetting = 11;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
this->unk_1A4 = 0;
|
||||
break;
|
||||
case 11:
|
||||
globalCtx->envCtx.unk_BE = 0xC;
|
||||
globalCtx->envCtx.unk_BD = 0xB;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, (Math_CosS(this->unk_1A4 * 0x1800) * 0.5f) + 0.5f, 1.0f, 1.0f);
|
||||
globalCtx->envCtx.prevLightSetting = 12;
|
||||
globalCtx->envCtx.lightSetting = 11;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, (Math_CosS(this->unk_1A4 * 0x1800) * 0.5f) + 0.5f, 1.0f,
|
||||
1.0f);
|
||||
break;
|
||||
case 12:
|
||||
globalCtx->envCtx.unk_BE = 0xC;
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 12;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
break;
|
||||
case 13:
|
||||
globalCtx->envCtx.unk_BD = 0xD;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.025f);
|
||||
globalCtx->envCtx.lightSetting = 13;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.025f);
|
||||
break;
|
||||
case 14:
|
||||
globalCtx->envCtx.unk_BD = 0xE;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightSetting = 14;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
break;
|
||||
case 15:
|
||||
globalCtx->envCtx.unk_BE = 0xE;
|
||||
globalCtx->envCtx.unk_BD = 0xF;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.01f);
|
||||
globalCtx->envCtx.prevLightSetting = 14;
|
||||
globalCtx->envCtx.lightSetting = 15;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.01f);
|
||||
break;
|
||||
case 16:
|
||||
globalCtx->envCtx.unk_BE = 0x10;
|
||||
globalCtx->envCtx.unk_BD = 0xF;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 16;
|
||||
globalCtx->envCtx.lightSetting = 15;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
break;
|
||||
case 20:
|
||||
globalCtx->envCtx.unk_BE = 2;
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
globalCtx->envCtx.prevLightSetting = 2;
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -3169,7 +3170,7 @@ void BossGanon_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
gLensFlareScale = this->lensFlareScale;
|
||||
gLensFlareColorIntensity = 10.0f;
|
||||
gLensFlareScreenFillAlpha = 0;
|
||||
gLensFlareGlareStrength = 0;
|
||||
} else {
|
||||
gCustomLensFlareOn = false;
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
player->actor.world.pos.z = -186.0f;
|
||||
player->actor.shape.rot.y = -0x5000;
|
||||
Animation_MorphToLoop(&this->skelAnime, &object_ganon_anime3_Anim_002168, 0.0f);
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
// fake, tricks the compiler into allocating more stack
|
||||
if (zero) {
|
||||
this->subCamEye.x *= 2.0;
|
||||
|
@ -229,7 +229,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
case 1:
|
||||
if (this->unk_398 < 70) {
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
this->unk_339 = 3;
|
||||
Math_ApproachF(&this->subCamEye.x, 1500.0f, 0.1f, this->unk_410.x * 1500.0f);
|
||||
|
@ -245,7 +245,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->unk_39C = 2;
|
||||
this->unk_398 = 0;
|
||||
this->unk_410.x = 0.0f;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->unk_339 = 5;
|
||||
if (this->unk_398 == 20) {
|
||||
this->unk_33C = 0.0f;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
} else {
|
||||
this->unk_339 = 4;
|
||||
|
@ -414,8 +414,8 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->subCamEye.z = -200.0f;
|
||||
this->subCamAt.x = this->subCamAt.z = -200.0f;
|
||||
this->subCamAt.y = this->actor.world.pos.y + 70.0f;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.unk_BE = globalCtx->envCtx.unk_BD = 0;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
globalCtx->envCtx.prevLightSetting = globalCtx->envCtx.lightSetting = 0;
|
||||
this->unk_339 = 0;
|
||||
} else {
|
||||
break;
|
||||
|
@ -506,7 +506,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
Animation_MorphToPlayOnce(&this->skelAnime, &object_ganon_anime3_Anim_003754, 0.0f);
|
||||
this->unk_194 = Animation_GetLastFrame(&object_ganon_anime3_Anim_003754);
|
||||
this->unk_339 = 55;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_CASBREAK);
|
||||
} else {
|
||||
break;
|
||||
|
@ -728,8 +728,8 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
sp68 = player->actor.world.pos;
|
||||
sp68.y += 60.0f;
|
||||
func_808FD210(globalCtx, &sp68);
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
this->unk_339 = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1296,7 +1296,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->subCamAt = mainCam1->at;
|
||||
this->unk_1A2[0] = 300;
|
||||
this->unk_1A2[1] = 100;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
case 1:
|
||||
if (this->unk_1A2[1] == 50) {
|
||||
func_80078884(NA_SE_EN_MGANON_WALK);
|
||||
|
@ -1326,7 +1326,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->subCamAt.y = sZelda->actor.world.pos.y + 30.0f;
|
||||
this->subCamAt.z = sZelda->actor.world.pos.z - 10.0f;
|
||||
Math_ApproachZeroF(&this->unk_324, 1.0f, 5.0f);
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 1.0f / 51);
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 1.0f / 51);
|
||||
if (this->unk_1A2[1] == 80) {
|
||||
Message_StartTextbox(globalCtx, 0x70D7, NULL);
|
||||
}
|
||||
|
@ -1406,7 +1406,7 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case 2:
|
||||
Math_ApproachF(&this->unk_324, 255.0f, 1.0f, 10.0f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 2.0f / 51.0f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 2.0f / 51.0f);
|
||||
if (Animation_OnFrame(&this->skelAnime, this->unk_194)) {
|
||||
func_808FFDB0(this, globalCtx);
|
||||
if (this->unk_334 == 0) {
|
||||
|
@ -1485,14 +1485,14 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->unk_324 = 0.0f;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->unk_31A = this->unk_31C;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
case 1:
|
||||
if (this->unk_398 < 90) {
|
||||
this->unk_339 = 20;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.1f);
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.1f);
|
||||
} else if (this->unk_398 >= 90) {
|
||||
this->unk_339 = 21;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.08f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.08f);
|
||||
}
|
||||
if (this->unk_398 == 50) {
|
||||
func_80078884(NA_SE_EN_MGANON_WALK);
|
||||
|
@ -1534,7 +1534,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case 2:
|
||||
this->unk_339 = 22;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.1f);
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.1f);
|
||||
func_80078884(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG);
|
||||
this->subCamEye.x = 250;
|
||||
this->subCamEye.y = 1150.0f;
|
||||
|
@ -1571,7 +1571,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
sZelda->unk_3C8 = 10;
|
||||
}
|
||||
this->unk_339 = 23;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
} else {
|
||||
this->unk_339 = 22;
|
||||
}
|
||||
|
@ -1640,7 +1640,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
case 7:
|
||||
this->unk_339 = 23;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.2f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.2f);
|
||||
player->actor.world.pos.x = 250.0f;
|
||||
player->actor.shape.rot.y = -0x4000;
|
||||
player->actor.world.pos.z = 30.0f;
|
||||
|
@ -1651,7 +1651,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
if ((this->unk_398 == 22) || (this->unk_398 == 35) || (this->unk_398 == 72) || (this->unk_398 == 45)) {
|
||||
func_80078884(NA_SE_EN_MGANON_DAMAGE);
|
||||
func_80078884(NA_SE_IT_SHIELD_BOUND);
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
if ((this->unk_398 == 22) || (this->unk_398 == 35) || (this->unk_398 == 72) || (this->unk_398 == 45)) {
|
||||
func_8090109C(this, globalCtx);
|
||||
|
@ -1712,15 +1712,15 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
if (this->unk_398 >= 1000) {
|
||||
if (this->unk_398 < 1040) {
|
||||
this->unk_339 = 23;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.2f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.2f);
|
||||
}
|
||||
}
|
||||
if (this->unk_398 == 1040) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DEAD2);
|
||||
this->unk_336 = 2;
|
||||
this->unk_339 = 0;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
if (Animation_OnFrame(&this->skelAnime, this->unk_194)) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_ganon2_Anim_008EB8, 0.0f);
|
||||
|
@ -1742,7 +1742,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
sZelda->unk_3C8 = 11;
|
||||
Message_StartTextbox(globalCtx, 0x70D9, NULL);
|
||||
this->unk_336 = 0;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
|
@ -1765,7 +1765,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->subCamEye.y, 1130.0f, 0.05f, this->unk_410.x * 0.25f);
|
||||
Math_ApproachF(&this->subCamEye.z, -260.0f, 0.05f, this->unk_410.x * 1.25f);
|
||||
if ((this->unk_398 >= 40) && (this->unk_398 <= 110)) {
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.02f);
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.02f);
|
||||
Math_ApproachF(&this->unk_384, 10.0f, 0.1f, 0.2f);
|
||||
Audio_PlayActorSound2(&sZelda->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG);
|
||||
} else {
|
||||
|
@ -2068,9 +2068,9 @@ void BossGanon2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->unk_332 = (s16)Rand_ZeroFloat(60.0f) + 0xA;
|
||||
}
|
||||
this->unk_339 = 0;
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_BD = (s8)Rand_ZeroFloat(1.9f) + 1;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightSetting = (s8)Rand_ZeroFloat(1.9f) + 1;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
D_8090EB20.y = 0.0f;
|
||||
D_8090EB20.x = D_8090EB20.y;
|
||||
D_8090EB20.z = D_8090EB20.x;
|
||||
|
@ -2085,75 +2085,75 @@ void BossGanon2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
} else if (this->unk_332 != 0) {
|
||||
this->unk_332--;
|
||||
}
|
||||
if ((globalCtx->envCtx.unk_D8 > 0.0f) && (this->unk_336 != 0)) {
|
||||
if ((globalCtx->envCtx.lightBlend > 0.0f) && (this->unk_336 != 0)) {
|
||||
globalCtx->envCtx.customSkyboxFilter = 1;
|
||||
globalCtx->envCtx.skyboxFilterColor[0] = 255;
|
||||
globalCtx->envCtx.skyboxFilterColor[1] = 255;
|
||||
globalCtx->envCtx.skyboxFilterColor[2] = 255;
|
||||
globalCtx->envCtx.skyboxFilterColor[3] = (s16)(globalCtx->envCtx.unk_D8 * 200.0f);
|
||||
globalCtx->envCtx.skyboxFilterColor[3] = (s16)(globalCtx->envCtx.lightBlend * 200.0f);
|
||||
} else {
|
||||
globalCtx->envCtx.customSkyboxFilter = 0;
|
||||
}
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
|
||||
switch (this->unk_339) {
|
||||
case 0:
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.1f);
|
||||
break;
|
||||
case 3:
|
||||
globalCtx->envCtx.unk_BE = 3;
|
||||
globalCtx->envCtx.unk_BD = 4;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.0125f);
|
||||
globalCtx->envCtx.prevLightSetting = 3;
|
||||
globalCtx->envCtx.lightSetting = 4;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.0125f);
|
||||
break;
|
||||
case 4:
|
||||
globalCtx->envCtx.unk_BE = 5;
|
||||
globalCtx->envCtx.unk_BD = 6;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.0125f);
|
||||
globalCtx->envCtx.prevLightSetting = 5;
|
||||
globalCtx->envCtx.lightSetting = 6;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.0125f);
|
||||
break;
|
||||
case 5:
|
||||
globalCtx->envCtx.unk_BE = 6;
|
||||
globalCtx->envCtx.unk_BD = 7;
|
||||
globalCtx->envCtx.prevLightSetting = 6;
|
||||
globalCtx->envCtx.lightSetting = 7;
|
||||
Math_ApproachF(&this->unk_33C, 0.69f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.unk_D8 =
|
||||
globalCtx->envCtx.lightBlend =
|
||||
(Math_SinS(globalCtx->gameplayFrames * 0x5000) * 0.15f) + (0.15f + this->unk_33C);
|
||||
break;
|
||||
case 55:
|
||||
globalCtx->envCtx.unk_BE = 2;
|
||||
globalCtx->envCtx.unk_BD = 0;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.prevLightSetting = 2;
|
||||
globalCtx->envCtx.lightSetting = 0;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.05f);
|
||||
break;
|
||||
case 6:
|
||||
globalCtx->envCtx.unk_BE = 2;
|
||||
globalCtx->envCtx.unk_BD = 8;
|
||||
globalCtx->envCtx.prevLightSetting = 2;
|
||||
globalCtx->envCtx.lightSetting = 8;
|
||||
Math_ApproachF(&this->unk_33C, 0.69f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.unk_D8 =
|
||||
globalCtx->envCtx.lightBlend =
|
||||
(Math_SinS(globalCtx->gameplayFrames * 0x7000) * 0.15f) + (0.15f + this->unk_33C);
|
||||
break;
|
||||
case 7:
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_BD = 8;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.02f);
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightSetting = 8;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.02f);
|
||||
break;
|
||||
case 20:
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_BD = 9;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightSetting = 9;
|
||||
break;
|
||||
case 21:
|
||||
globalCtx->envCtx.unk_BE = 0xA;
|
||||
globalCtx->envCtx.unk_BD = 9;
|
||||
globalCtx->envCtx.prevLightSetting = 10;
|
||||
globalCtx->envCtx.lightSetting = 9;
|
||||
break;
|
||||
case 22:
|
||||
globalCtx->envCtx.unk_BE = 0xA;
|
||||
globalCtx->envCtx.unk_BD = 0xB;
|
||||
globalCtx->envCtx.prevLightSetting = 10;
|
||||
globalCtx->envCtx.lightSetting = 11;
|
||||
break;
|
||||
case 23:
|
||||
globalCtx->envCtx.unk_BE = 9;
|
||||
globalCtx->envCtx.unk_BD = 0xB;
|
||||
globalCtx->envCtx.prevLightSetting = 9;
|
||||
globalCtx->envCtx.lightSetting = 11;
|
||||
break;
|
||||
case 24:
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_BD = 0xC;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightSetting = 12;
|
||||
break;
|
||||
case -1:
|
||||
break;
|
||||
|
@ -2911,8 +2911,8 @@ void BossGanon2_DrawEffects(GlobalContext* globalCtx) {
|
|||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TexScroll(globalCtx->state.gfxCtx, 0, 0 - (globalCtx->gameplayFrames & 0x7F), 32, 32));
|
||||
gSPDisplayList(POLY_OPA_DISP++, ovl_Boss_Ganon2_DL_0103A8);
|
||||
if ((globalCtx->envCtx.unk_BD == 1) || (globalCtx->envCtx.unk_BD == 2)) {
|
||||
alpha = (s16)(globalCtx->envCtx.unk_D8 * 150.0f) + 50;
|
||||
if ((globalCtx->envCtx.lightSetting == 1) || (globalCtx->envCtx.lightSetting == 2)) {
|
||||
alpha = (s16)(globalCtx->envCtx.lightBlend * 150.0f) + 50;
|
||||
angle = M_PI / 5.0f;
|
||||
} else {
|
||||
alpha = 100;
|
||||
|
@ -3052,8 +3052,8 @@ void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, GlobalC
|
|||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
|
||||
if ((globalCtx->envCtx.unk_BD == 1) || (globalCtx->envCtx.unk_BD == 2)) {
|
||||
alpha = (s16)(globalCtx->envCtx.unk_D8 * 180.0f) + 30;
|
||||
if ((globalCtx->envCtx.lightSetting == 1) || (globalCtx->envCtx.lightSetting == 2)) {
|
||||
alpha = (s16)(globalCtx->envCtx.lightBlend * 180.0f) + 30;
|
||||
} else {
|
||||
alpha = 120;
|
||||
}
|
||||
|
|
|
@ -1139,14 +1139,14 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) {
|
|||
vel.z = this->actor.world.pos.z - this->actor.prevPos.z;
|
||||
if (bodyDecayLevel < 10) {
|
||||
if (this->work[GND_DEATH_ENV_TIMER] == 0) {
|
||||
if (globalCtx->envCtx.unk_BF == 0) {
|
||||
globalCtx->envCtx.unk_BF = 3;
|
||||
if (globalCtx->envCtx.lightSettingOverride == 0) {
|
||||
globalCtx->envCtx.lightSettingOverride = 3;
|
||||
this->work[GND_DEATH_ENV_TIMER] = (s16)Rand_ZeroFloat(5.0f) + 4.0f;
|
||||
globalCtx->envCtx.unk_D6 = 0x28;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 40;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
this->work[GND_DEATH_ENV_TIMER] = (s16)Rand_ZeroFloat(2.0f) + 2.0f;
|
||||
globalCtx->envCtx.unk_D6 = 0x14;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 20;
|
||||
}
|
||||
} else {
|
||||
this->work[GND_DEATH_ENV_TIMER]--;
|
||||
|
@ -1178,8 +1178,8 @@ void BossGanondrof_Death(BossGanondrof* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_D6 = 0x14;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 20;
|
||||
}
|
||||
|
||||
this->work[GND_BODY_DECAY_FLAG] = true;
|
||||
|
|
|
@ -419,8 +419,8 @@ void BossGoma_SetupEncounter(BossGoma* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = BossGoma_Encounter;
|
||||
this->actionState = 0;
|
||||
this->disableGameplayLogic = true;
|
||||
globalCtx->envCtx.unk_BF = 4;
|
||||
globalCtx->envCtx.unk_D6 = 0xFF;
|
||||
globalCtx->envCtx.lightSettingOverride = 4;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 255;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -750,8 +750,8 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->frameCount == 176) {
|
||||
globalCtx->envCtx.unk_BF = 3;
|
||||
globalCtx->envCtx.unk_D6 = 0xFFFF;
|
||||
globalCtx->envCtx.lightSettingOverride = 3;
|
||||
globalCtx->envCtx.lightBlendRateOverride = LIGHT_BLENDRATE_OVERRIDE_NONE;
|
||||
}
|
||||
|
||||
if (this->frameCount == 190) {
|
||||
|
@ -805,7 +805,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.2f, 100.0f);
|
||||
|
||||
if (this->framesUntilNextAction == 30) {
|
||||
globalCtx->envCtx.unk_BF = 4;
|
||||
globalCtx->envCtx.lightSettingOverride = 4;
|
||||
}
|
||||
|
||||
if (this->framesUntilNextAction < 20) {
|
||||
|
|
|
@ -491,10 +491,10 @@ void BossTw_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
if (!sTwInitalized) {
|
||||
sTwInitalized = true;
|
||||
globalCtx->envCtx.unk_BF = 1;
|
||||
globalCtx->envCtx.unk_BE = 1;
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightSettingOverride = 1;
|
||||
globalCtx->envCtx.prevLightSetting = 1;
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
|
||||
D_8094C874 = D_8094C876 = D_8094C878 = D_8094C87A = D_8094C87C = D_8094C87E = D_8094C870 = D_8094C86F =
|
||||
D_8094C872 = sBeamDivertTimer = sEnvType = sGroundBlastType = sFreezeState = sTwinrovaBlastType =
|
||||
|
@ -880,7 +880,7 @@ s32 BossTw_CheckBeamReflection(BossTw* this, GlobalContext* globalCtx) {
|
|||
// beam hit the shield, normal shield equipped,
|
||||
// divert the beam backwards from link's Y rotation
|
||||
BossTw_AddShieldDeflectEffect(globalCtx, 10.0f, this->actor.params);
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
this->timers[0] = 10;
|
||||
func_80078884(NA_SE_IT_SHIELD_REFLECT_MG2);
|
||||
}
|
||||
|
@ -1001,8 +1001,8 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
if (this->timers[1] < 50) {
|
||||
if (this->timers[1] < 10) {
|
||||
if (this->timers[1] == 9) {
|
||||
globalCtx->envCtx.unk_D8 = 0.5f;
|
||||
globalCtx->envCtx.unk_BD = 3 - this->actor.params;
|
||||
globalCtx->envCtx.lightBlend = 0.5f;
|
||||
globalCtx->envCtx.lightSetting = 3 - this->actor.params;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_TWINROBA_MASIC_SET);
|
||||
}
|
||||
|
||||
|
@ -1118,7 +1118,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
this->groundBlastPos.x = 0.0f;
|
||||
this->groundBlastPos.y = 0.0f;
|
||||
this->groundBlastPos.z = 0.0f;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
func_800AA000(0.0f, 0x64, 5, 4);
|
||||
} else if (beamReflection == 0) {
|
||||
BossTw_BeamHitPlayerCheck(this, globalCtx);
|
||||
|
@ -1278,7 +1278,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
this->beamReflectionDist = sp130.z;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 0.8f, 1.0f, 0.2f);
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.8f, 1.0f, 0.2f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1320,7 +1320,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
BossTw_SetupHitByBeam(otherTw, globalCtx);
|
||||
Audio_PlayActorSound2(&otherTw->actor, NA_SE_EN_TWINROBA_DAMAGE_VOICE);
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
otherTw->actor.colChkInfo.health++;
|
||||
}
|
||||
}
|
||||
|
@ -1664,8 +1664,8 @@ void BossTw_TwinrovaMergeCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
sEnvType = -1;
|
||||
globalCtx->envCtx.unk_BD = 4;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1, 1, 0.1f);
|
||||
globalCtx->envCtx.lightSetting = 4;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1, 1, 0.1f);
|
||||
// fallthrough
|
||||
case 2:
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
@ -1711,7 +1711,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (this->timers[2] == 4) {
|
||||
sEnvType = 0;
|
||||
globalCtx->envCtx.unk_BE = 5;
|
||||
globalCtx->envCtx.prevLightSetting = 5;
|
||||
}
|
||||
|
||||
if (this->timers[2] == 1) {
|
||||
|
@ -1846,8 +1846,8 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->subCamUpdateRate, 0.01f, 1.0f, 0.0001f);
|
||||
|
||||
if (this->work[CS_TIMER_1] > 100) {
|
||||
globalCtx->envCtx.unk_BD = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.03f);
|
||||
globalCtx->envCtx.lightSetting = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.03f);
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_1] == 180) {
|
||||
|
@ -1957,11 +1957,11 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->work[CS_TIMER_1] >= 30) {
|
||||
if (this->work[CS_TIMER_1] < 45) {
|
||||
globalCtx->envCtx.unk_BE = 0;
|
||||
globalCtx->envCtx.unk_BD = 2;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 0;
|
||||
globalCtx->envCtx.lightSetting = 2;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
} else {
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.1f);
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_1] == 30) {
|
||||
|
@ -1980,7 +1980,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Audio_PlayActorSound2(&sKoumePtr->actor, NA_SE_EN_TWINROBA_TRANSFORM);
|
||||
globalCtx->envCtx.unk_D8 = 0;
|
||||
globalCtx->envCtx.lightBlend = 0;
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_1] >= 35) {
|
||||
|
@ -2121,10 +2121,10 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->work[CS_TIMER_1] >= 30) {
|
||||
if (this->work[CS_TIMER_1] < 45) {
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
} else {
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.1f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.1f);
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_1] == 30) {
|
||||
|
@ -2142,7 +2142,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Audio_PlayActorSound2(&sKotakePtr->actor, NA_SE_EN_TWINROBA_TRANSFORM);
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_1] >= 35) {
|
||||
|
@ -2212,8 +2212,8 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
case 20:
|
||||
if (this->work[CS_TIMER_1] > 20 && this->work[CS_TIMER_1] < 120) {
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.015f);
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.015f);
|
||||
}
|
||||
|
||||
if (this->work[CS_TIMER_1] == 90) {
|
||||
|
@ -2222,9 +2222,9 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->work[CS_TIMER_1] == 120) {
|
||||
sEnvType = 0;
|
||||
globalCtx->envCtx.unk_BE = 1;
|
||||
globalCtx->envCtx.unk_BD = 1;
|
||||
globalCtx->envCtx.unk_D8 = 0.0f;
|
||||
globalCtx->envCtx.prevLightSetting = 1;
|
||||
globalCtx->envCtx.lightSetting = 1;
|
||||
globalCtx->envCtx.lightBlend = 0.0f;
|
||||
TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx,
|
||||
SEGMENTED_TO_VIRTUAL(object_tw_Blob_02E170), 0xA0, 0xB4, 0x80, 0x28);
|
||||
SET_EVENTCHKINF(EVENTCHKINF_75);
|
||||
|
@ -2642,13 +2642,13 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->work[CS_TIMER_1] >= 55) {
|
||||
if (this->work[CS_TIMER_1] == 55) {
|
||||
globalCtx->envCtx.unk_D8 = 0;
|
||||
globalCtx->envCtx.lightBlend = 0;
|
||||
}
|
||||
|
||||
sEnvType = -1;
|
||||
globalCtx->envCtx.unk_BE = 5;
|
||||
globalCtx->envCtx.unk_BD = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.015f);
|
||||
globalCtx->envCtx.prevLightSetting = 5;
|
||||
globalCtx->envCtx.lightSetting = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.015f);
|
||||
Math_ApproachF(&this->actor.scale.x, 0.00024999998f, 0.1f, 0.00005f);
|
||||
this->actor.shape.rot.y += (s16)this->actor.speedXZ;
|
||||
this->workf[UNK_F13] += this->actor.speedXZ;
|
||||
|
@ -2785,13 +2785,13 @@ void BossTw_TwinrovaDeathCS(BossTw* this, GlobalContext* globalCtx) {
|
|||
case 3:
|
||||
BossTw_DeathCSMsgSfx(this, globalCtx);
|
||||
if (this->work[CS_TIMER_2] < 150) {
|
||||
globalCtx->envCtx.unk_BE = 1;
|
||||
globalCtx->envCtx.unk_BD = 0;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.1f);
|
||||
globalCtx->envCtx.prevLightSetting = 1;
|
||||
globalCtx->envCtx.lightSetting = 0;
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.1f);
|
||||
} else {
|
||||
globalCtx->envCtx.unk_BE = 1;
|
||||
globalCtx->envCtx.unk_BD = 6;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, (Math_SinS(this->work[CS_TIMER_2] * 4096) / 4.0f) + 0.75f,
|
||||
globalCtx->envCtx.prevLightSetting = 1;
|
||||
globalCtx->envCtx.lightSetting = 6;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, (Math_SinS(this->work[CS_TIMER_2] * 4096) / 4.0f) + 0.75f,
|
||||
1.0f, 0.1f);
|
||||
}
|
||||
|
||||
|
@ -3138,33 +3138,33 @@ void BossTw_TwinrovaUpdate(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
osSyncPrintf("OooooooooooooooooooooooooooooooooCC\n");
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
globalCtx->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
|
||||
|
||||
switch (sEnvType) {
|
||||
case 0:
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.02f);
|
||||
Math_ApproachZeroF(&globalCtx->envCtx.lightBlend, 1.0f, 0.02f);
|
||||
break;
|
||||
case 1:
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 0.5f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 0.5f, 1.0f, 0.05f);
|
||||
break;
|
||||
case 2:
|
||||
globalCtx->envCtx.unk_BD = 2;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, (Math_SinS(this->work[CS_TIMER_1] * 0x3000) * 0.03f) + 0.5f, 1.0f,
|
||||
0.05f);
|
||||
globalCtx->envCtx.lightSetting = 2;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, (Math_SinS(this->work[CS_TIMER_1] * 0x3000) * 0.03f) + 0.5f,
|
||||
1.0f, 0.05f);
|
||||
break;
|
||||
case 3:
|
||||
globalCtx->envCtx.unk_BD = 3;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.1f);
|
||||
globalCtx->envCtx.lightSetting = 3;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.1f);
|
||||
break;
|
||||
case 4:
|
||||
globalCtx->envCtx.unk_BD = 2;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, (Math_SinS(this->work[CS_TIMER_1] * 0x3E00) * 0.05f) + 0.95f,
|
||||
globalCtx->envCtx.lightSetting = 2;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, (Math_SinS(this->work[CS_TIMER_1] * 0x3E00) * 0.05f) + 0.95f,
|
||||
1.0f, 0.1f);
|
||||
break;
|
||||
case 5:
|
||||
globalCtx->envCtx.unk_BD = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.05f);
|
||||
globalCtx->envCtx.lightSetting = 0;
|
||||
Math_ApproachF(&globalCtx->envCtx.lightBlend, 1.0f, 1.0f, 0.05f);
|
||||
break;
|
||||
case -1:
|
||||
break;
|
||||
|
@ -3969,7 +3969,7 @@ void BossTw_BlastFire(BossTw* this, GlobalContext* globalCtx) {
|
|||
if (this->timers[0] == 50) {
|
||||
D_8094C86F = 10;
|
||||
D_8094C872 = 7;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
|
||||
if (this->timers[0] <= 50) {
|
||||
|
@ -4019,7 +4019,7 @@ void BossTw_BlastFire(BossTw* this, GlobalContext* globalCtx) {
|
|||
Rand_ZeroFloat(10.0f) + 25.0f, this->blastType);
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_D8 = 0.5f;
|
||||
globalCtx->envCtx.lightBlend = 0.5f;
|
||||
}
|
||||
|
||||
this->csState1 = 2;
|
||||
|
@ -4159,7 +4159,7 @@ void BossTw_BlastIce(BossTw* this, GlobalContext* globalCtx) {
|
|||
if (this->timers[0] == 50) {
|
||||
D_8094C86F = 10;
|
||||
D_8094C872 = 7;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
}
|
||||
|
||||
if (this->timers[0] <= 50) {
|
||||
|
@ -4209,7 +4209,7 @@ void BossTw_BlastIce(BossTw* this, GlobalContext* globalCtx) {
|
|||
Rand_ZeroFloat(10.0f) + 25.0f, this->blastType);
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_D8 = 0.5f;
|
||||
globalCtx->envCtx.lightBlend = 0.5f;
|
||||
}
|
||||
|
||||
this->csState1 = 2;
|
||||
|
@ -4345,7 +4345,7 @@ s32 BossTw_BlastShieldCheck(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (info->toucher.dmgFlags & DMG_SHIELD) {
|
||||
this->work[INVINC_TIMER] = 7;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
func_800AA000(0.0f, 100, 5, 4);
|
||||
|
||||
if (Player_HasMirrorShieldEquipped(globalCtx)) {
|
||||
|
@ -4683,7 +4683,7 @@ void BossTw_UpdateEffects(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
sTwinrovaPtr->twinrovaStun = 1;
|
||||
globalCtx->envCtx.unk_D8 = 1.0f;
|
||||
globalCtx->envCtx.lightBlend = 1.0f;
|
||||
eff->type = TWEFF_NONE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -957,7 +957,7 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) {
|
|||
sSubCamEyeMaxVelFrac.z = sSubCamEyeMaxVelFrac.x;
|
||||
sSubCamAtMaxVelFrac = sSubCamEyeMaxVelFrac;
|
||||
if (this->timer >= 45000) {
|
||||
globalCtx->envCtx.unk_BF = 1;
|
||||
globalCtx->envCtx.lightSettingOverride = 1;
|
||||
func_8002DF54(globalCtx, &this->actor, 8);
|
||||
} else if (this->timer >= 35000) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS);
|
||||
|
|
|
@ -2082,7 +2082,8 @@ void DemoEffect_DrawTimeWarp(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 25);
|
||||
Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY);
|
||||
SkelCurve_Draw(&this->actor, globalCtx, &this->skelCurve, DemoEffect_OverrideLimbDrawTimeWarp, NULL, 1, &this->actor);
|
||||
SkelCurve_Draw(&this->actor, globalCtx, &this->skelCurve, DemoEffect_OverrideLimbDrawTimeWarp, NULL, 1,
|
||||
&this->actor);
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_demo_effect.c", 3216);
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ void DemoKekkai_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (DemoKekkai_CheckEventFlag(thisx->params)) {
|
||||
if (thisx->params == KEKKAI_TOWER) {
|
||||
globalCtx->envCtx.unk_BF = 1;
|
||||
globalCtx->envCtx.lightSettingOverride = 1;
|
||||
}
|
||||
Actor_Kill(thisx);
|
||||
}
|
||||
|
|
|
@ -150,8 +150,9 @@ void EnDoor_SetupType(EnDoor* this, GlobalContext* globalCtx) {
|
|||
this->actor.objBankIndex = this->requiredObjBankIndex;
|
||||
this->actionFunc = EnDoor_Idle;
|
||||
if (doorType == DOOR_EVENING) {
|
||||
doorType =
|
||||
(gSaveContext.dayTime > 0xC000 && gSaveContext.dayTime < 0xE000) ? DOOR_SCENEEXIT : DOOR_CHECKABLE;
|
||||
doorType = (gSaveContext.dayTime > CLOCK_TIME(18, 0) && gSaveContext.dayTime < CLOCK_TIME(21, 0))
|
||||
? DOOR_SCENEEXIT
|
||||
: DOOR_CHECKABLE;
|
||||
}
|
||||
this->actor.world.rot.y = 0x0000;
|
||||
if (doorType == DOOR_LOCKED) {
|
||||
|
|
|
@ -314,12 +314,12 @@ void EnFhgFire_LightningBurst(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
this->actor.shape.rot.y += 0x1000;
|
||||
|
||||
if (this->work[FHGFIRE_FX_TIMER] == 49) {
|
||||
globalCtx->envCtx.unk_BF = 1;
|
||||
globalCtx->envCtx.unk_D6 = 0xFF;
|
||||
globalCtx->envCtx.lightSettingOverride = 1;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 255;
|
||||
}
|
||||
if (this->work[FHGFIRE_FX_TIMER] == 31) {
|
||||
globalCtx->envCtx.unk_BF = 0x00;
|
||||
globalCtx->envCtx.unk_D6 = 0x14;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 20;
|
||||
}
|
||||
if (this->work[FHGFIRE_FX_TIMER] >= 48) {
|
||||
globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] =
|
||||
|
@ -369,7 +369,7 @@ void EnFhgFire_LightningBurst(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
gCustomLensFlarePos = this->actor.world.pos;
|
||||
gLensFlareScale = this->lensFlareScale;
|
||||
gLensFlareColorIntensity = 10.0f;
|
||||
gLensFlareScreenFillAlpha = 0;
|
||||
gLensFlareGlareStrength = 0;
|
||||
}
|
||||
|
||||
void EnFhgFire_SpearLight(EnFhgFire* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -100,7 +100,7 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
// "(head) maximum turning angle speed"
|
||||
osSyncPrintf(VT_FGCOL(MAGENTA) " (頭)反転アングルスピード最大☆ %f\n" VT_RST, this->headTurnSpeedMax);
|
||||
osSyncPrintf(VT_FGCOL(GREEN) " 今時間 %d\n" VT_RST, ((void)0, gSaveContext.dayTime)); // "current time"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " チェック時間 %d\n" VT_RST, 0xBAAA); // "check time"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) " チェック時間 %d\n" VT_RST, CLOCK_TIME(17, 30) - 1); // "check time"
|
||||
osSyncPrintf("\n\n");
|
||||
|
||||
if (this->path == 3) {
|
||||
|
@ -112,13 +112,13 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->type != 5) {
|
||||
if (((gSaveContext.dayTime < 0xB888) || IS_DAY) && !GET_EVENTCHKINF(EVENTCHKINF_80)) {
|
||||
if (((gSaveContext.dayTime < CLOCK_TIME(17, 18) - 1) || IS_DAY) && !GET_EVENTCHKINF(EVENTCHKINF_80)) {
|
||||
this->actionFunc = EnHeishi1_SetupWalk;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
} else {
|
||||
if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || GET_EVENTCHKINF(EVENTCHKINF_80)) {
|
||||
if ((gSaveContext.dayTime > CLOCK_TIME(17, 18) - 1) || !IS_DAY || GET_EVENTCHKINF(EVENTCHKINF_80)) {
|
||||
this->actionFunc = EnHeishi1_SetupWaitNight;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
|
|
|
@ -298,7 +298,8 @@ void func_80A89A6C(EnJsjutan* this, GlobalContext* globalCtx) {
|
|||
this->dyna.actor.world.pos.y = this->unk_168;
|
||||
|
||||
dayTime = gSaveContext.dayTime;
|
||||
if (dayTime >= 0x8000) {
|
||||
|
||||
if (dayTime >= CLOCK_TIME(12, 0)) {
|
||||
dayTime = 0xFFFF - dayTime;
|
||||
}
|
||||
|
||||
|
|
|
@ -865,7 +865,7 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
u16 dayTime = gSaveContext.dayTime;
|
||||
f32 shadowAlpha;
|
||||
|
||||
if (dayTime >= 0x8000) {
|
||||
if (dayTime >= CLOCK_TIME(12, 0)) {
|
||||
dayTime = 0xFFFF - dayTime;
|
||||
}
|
||||
shadowAlpha = (dayTime * 0.00275f) + 10.0f;
|
||||
|
|
|
@ -202,7 +202,7 @@ void EnMm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
s32 func_80AADA70(void) {
|
||||
s32 isDay = false;
|
||||
|
||||
if ((gSaveContext.dayTime > 0x3555) && (gSaveContext.dayTime <= 0xD556)) {
|
||||
if ((gSaveContext.dayTime > CLOCK_TIME(5, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(20, 0) + 1)) {
|
||||
isDay = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,12 +35,13 @@ void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, EnOkarinaEffectActionFun
|
|||
void EnOkarinaEffect_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnOkarinaEffect* this = (EnOkarinaEffect*)thisx;
|
||||
|
||||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
if ((gWeatherMode != 4) && (gWeatherMode != 5) && (globalCtx->envCtx.gloomySkyMode == 1)) {
|
||||
globalCtx->envCtx.gloomySkyMode = 2; // end gloomy sky
|
||||
globalCtx->envCtx.precipitation[PRECIP_SOS_MAX] = 0;
|
||||
if ((gWeatherMode != WEATHER_MODE_RAIN) && (gWeatherMode != WEATHER_MODE_HEAVY_RAIN) &&
|
||||
(globalCtx->envCtx.stormRequest == STORM_REQUEST_START)) {
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_STOP;
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
}
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_LAST;
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
@ -50,20 +51,20 @@ void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
// "Ocarina Storm Effect"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n" VT_RST);
|
||||
osSyncPrintf("\n\n");
|
||||
if (globalCtx->envCtx.unk_EE[1] != 0) {
|
||||
if (globalCtx->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
EnOkarinaEffect_SetupAction(this, EnOkarinaEffect_TriggerStorm);
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) {
|
||||
this->timer = 400; // 20 seconds
|
||||
globalCtx->envCtx.unk_F2[0] = 20; // rain intensity target
|
||||
globalCtx->envCtx.gloomySkyMode = 1; // start gloomy sky
|
||||
if ((gWeatherMode != 0) || globalCtx->envCtx.unk_17 != 0) {
|
||||
globalCtx->envCtx.unk_DE = 1;
|
||||
this->timer = 400; // 20 seconds
|
||||
globalCtx->envCtx.precipitation[PRECIP_SOS_MAX] = 20;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_START;
|
||||
if ((gWeatherMode != WEATHER_MODE_CLEAR) || globalCtx->envCtx.skyboxConfig != 0) {
|
||||
globalCtx->envCtx.stormState = STORM_STATE_ON;
|
||||
}
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_ON;
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
EnOkarinaEffect_SetupAction(this, EnOkarinaEffect_ManageStorm);
|
||||
}
|
||||
|
@ -74,7 +75,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
|||
(globalCtx->msgCtx.msgLength == 0) && (!FrameAdvance_IsEnabled(globalCtx)) &&
|
||||
((globalCtx->transitionMode == TRANS_MODE_OFF) || (gSaveContext.gameMode != 0))) ||
|
||||
(this->timer >= 250)) {
|
||||
if (globalCtx->envCtx.indoors || globalCtx->envCtx.unk_1F != 1) {
|
||||
if ((globalCtx->envCtx.lightMode != LIGHT_MODE_TIME) || globalCtx->envCtx.lightConfig != 1) {
|
||||
this->timer--;
|
||||
}
|
||||
osSyncPrintf("\nthis->timer=[%d]", this->timer);
|
||||
|
@ -84,12 +85,12 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
|||
}
|
||||
}
|
||||
|
||||
if (D_8011FB38 != 0) {
|
||||
if (gInterruptSongOfStorms) {
|
||||
this->timer = 0;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
globalCtx->envCtx.precipitation[PRECIP_SOS_MAX] = 0;
|
||||
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
} else if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_NATURE_AMBIENCE) {
|
||||
|
@ -97,14 +98,14 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
|||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 0);
|
||||
}
|
||||
osSyncPrintf("\n\n\nE_wether_flg=[%d]", gWeatherMode);
|
||||
osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->envCtx.gloomySkyMode);
|
||||
if (gWeatherMode == 0 && (globalCtx->envCtx.gloomySkyMode == 1)) {
|
||||
globalCtx->envCtx.gloomySkyMode = 2; // end gloomy sky
|
||||
osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->envCtx.stormRequest);
|
||||
if (gWeatherMode == WEATHER_MODE_CLEAR && (globalCtx->envCtx.stormRequest == STORM_REQUEST_START)) {
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_STOP;
|
||||
} else {
|
||||
globalCtx->envCtx.gloomySkyMode = 0;
|
||||
globalCtx->envCtx.unk_DE = 0;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_NONE;
|
||||
globalCtx->envCtx.stormState = STORM_STATE_OFF;
|
||||
}
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_LAST;
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -957,7 +957,7 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = EnOwl_WaitDefault;
|
||||
this->unk_40A = 0;
|
||||
this->actionFlags |= 0x80;
|
||||
gTimeIncrement = 0;
|
||||
gTimeSpeed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -815,7 +815,7 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) {
|
|||
if (this->unk_194 == 0) {
|
||||
Flags_UnsetSwitch(globalCtx, 0x1B);
|
||||
}
|
||||
globalCtx->envCtx.unk_BF = 0xFF;
|
||||
globalCtx->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (this->unk_19A < 32) {
|
||||
|
@ -1093,7 +1093,7 @@ void func_80ADBF58(EnPoSisters* this, GlobalContext* globalCtx) {
|
|||
this->unk_19A--;
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x500);
|
||||
if (this->unk_19A == 0 && this->unk_194 == 0) {
|
||||
globalCtx->envCtx.unk_BF = 4;
|
||||
globalCtx->envCtx.lightSettingOverride = 4;
|
||||
}
|
||||
if (this->unk_19A < 0) {
|
||||
Math_StepToF(&this->actor.speedXZ, 5.0f, 0.2f);
|
||||
|
|
|
@ -491,7 +491,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
|
||||
|
||||
if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !!LINK_IS_ADULT ||
|
||||
if (gSaveContext.dayTime <= CLOCK_TIME(18, 0) || gSaveContext.dayTime >= CLOCK_TIME(21, 0) || !!LINK_IS_ADULT ||
|
||||
globalCtx->sceneNum != SCENE_SPOT02) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
|
|
|
@ -127,39 +127,42 @@ void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 arg4, u8 arg5,
|
||||
u16 arg6, u8 weatherMode) {
|
||||
u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, GlobalContext* globalCtx, u8 skyboxConfig,
|
||||
u8 changeSkyboxNextConfig, u8 lightConfig, u8 changeLightNextConfig,
|
||||
u16 changeDuration, u8 weatherMode) {
|
||||
s32 pad;
|
||||
u8 ret = false;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this->actor.params)) {
|
||||
if ((globalCtx->envCtx.indoors != 0) || !gSkyboxBlendingEnabled ||
|
||||
(globalCtx->skyboxId != SKYBOX_NORMAL_SKY && globalCtx->envCtx.unk_1F == globalCtx->envCtx.unk_20)) {
|
||||
D_8011FB38 = 1;
|
||||
if (globalCtx->envCtx.gloomySkyMode == 0 &&
|
||||
(globalCtx->envCtx.indoors != 0 || (globalCtx->envCtx.unk_1F != 1 && globalCtx->envCtx.unk_21 == 0))) {
|
||||
D_8011FB38 = 0;
|
||||
if ((globalCtx->envCtx.lightMode != LIGHT_MODE_TIME) || !gSkyboxIsChanging ||
|
||||
(globalCtx->skyboxId != SKYBOX_NORMAL_SKY &&
|
||||
globalCtx->envCtx.lightConfig == globalCtx->envCtx.changeLightNextConfig)) {
|
||||
gInterruptSongOfStorms = true;
|
||||
if (globalCtx->envCtx.stormRequest == STORM_REQUEST_NONE &&
|
||||
((globalCtx->envCtx.lightMode != LIGHT_MODE_TIME) ||
|
||||
(globalCtx->envCtx.lightConfig != 1 && !globalCtx->envCtx.changeLightEnabled))) {
|
||||
gInterruptSongOfStorms = false;
|
||||
if (gWeatherMode != weatherMode) {
|
||||
gWeatherMode = weatherMode;
|
||||
if (globalCtx->envCtx.gloomySkyMode == 0) {
|
||||
globalCtx->envCtx.unk_19 = 1;
|
||||
globalCtx->envCtx.unk_17 = arg2;
|
||||
globalCtx->envCtx.unk_18 = arg3;
|
||||
globalCtx->envCtx.unk_1A = arg6;
|
||||
globalCtx->envCtx.unk_21 = 1;
|
||||
globalCtx->envCtx.unk_1F = arg4;
|
||||
globalCtx->envCtx.unk_20 = arg5;
|
||||
D_8011FB34 = arg5;
|
||||
globalCtx->envCtx.unk_24 = arg6;
|
||||
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
|
||||
if (globalCtx->envCtx.stormRequest == STORM_REQUEST_NONE) {
|
||||
globalCtx->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED;
|
||||
globalCtx->envCtx.skyboxConfig = skyboxConfig;
|
||||
globalCtx->envCtx.changeSkyboxNextConfig = changeSkyboxNextConfig;
|
||||
globalCtx->envCtx.changeSkyboxTimer = changeDuration;
|
||||
globalCtx->envCtx.changeLightEnabled = true;
|
||||
globalCtx->envCtx.lightConfig = lightConfig;
|
||||
globalCtx->envCtx.changeLightNextConfig = changeLightNextConfig;
|
||||
gLightConfigAfterUnderwater = changeLightNextConfig;
|
||||
globalCtx->envCtx.changeDuration = changeDuration;
|
||||
globalCtx->envCtx.changeLightTimer = globalCtx->envCtx.changeDuration;
|
||||
}
|
||||
}
|
||||
ret = true;
|
||||
}
|
||||
} else {
|
||||
if (gTimeIncrement != 0) {
|
||||
gSaveContext.dayTime += 0x14;
|
||||
if (gTimeSpeed != 0) {
|
||||
gSaveContext.dayTime += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,42 +170,45 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, GlobalContext* global
|
|||
return ret;
|
||||
}
|
||||
|
||||
u8 WeatherTag_CheckRestoreWeather(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 arg4, u8 arg5,
|
||||
u16 arg6) {
|
||||
u8 WeatherTag_CheckRestoreWeather(EnWeatherTag* this, GlobalContext* globalCtx, u8 skyboxConfig,
|
||||
u8 changeSkyboxNextConfig, u8 lightConfig, u8 changeLightNextConfig,
|
||||
u16 changeDuration) {
|
||||
s32 pad;
|
||||
u8 ret = false;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((WEATHER_TAG_RANGE100(this->actor.params) + 100.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
|
||||
if (globalCtx->envCtx.indoors != 0 || !gSkyboxBlendingEnabled ||
|
||||
(globalCtx->skyboxId != SKYBOX_NORMAL_SKY && globalCtx->envCtx.unk_1F == globalCtx->envCtx.unk_20)) {
|
||||
D_8011FB38 = 1;
|
||||
if ((globalCtx->envCtx.gloomySkyMode == 0) &&
|
||||
(globalCtx->envCtx.indoors != 0 || (globalCtx->envCtx.unk_1F != 1 && globalCtx->envCtx.unk_21 == 0))) {
|
||||
D_8011FB38 = 0;
|
||||
gWeatherMode = 0;
|
||||
globalCtx->envCtx.unk_19 = 1;
|
||||
globalCtx->envCtx.unk_17 = arg2;
|
||||
globalCtx->envCtx.unk_18 = arg3;
|
||||
globalCtx->envCtx.unk_1A = arg6;
|
||||
globalCtx->envCtx.unk_21 = 1;
|
||||
globalCtx->envCtx.unk_1F = arg4;
|
||||
globalCtx->envCtx.unk_20 = arg5;
|
||||
D_8011FB34 = arg5;
|
||||
globalCtx->envCtx.unk_24 = arg6;
|
||||
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
|
||||
if ((globalCtx->envCtx.lightMode != LIGHT_MODE_TIME) || !gSkyboxIsChanging ||
|
||||
(globalCtx->skyboxId != SKYBOX_NORMAL_SKY &&
|
||||
globalCtx->envCtx.lightConfig == globalCtx->envCtx.changeLightNextConfig)) {
|
||||
gInterruptSongOfStorms = true;
|
||||
if ((globalCtx->envCtx.stormRequest == STORM_REQUEST_NONE) &&
|
||||
((globalCtx->envCtx.lightMode != LIGHT_MODE_TIME) ||
|
||||
(globalCtx->envCtx.lightConfig != 1 && !globalCtx->envCtx.changeLightEnabled))) {
|
||||
gInterruptSongOfStorms = false;
|
||||
gWeatherMode = WEATHER_MODE_CLEAR;
|
||||
globalCtx->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED;
|
||||
globalCtx->envCtx.skyboxConfig = skyboxConfig;
|
||||
globalCtx->envCtx.changeSkyboxNextConfig = changeSkyboxNextConfig;
|
||||
globalCtx->envCtx.changeSkyboxTimer = changeDuration;
|
||||
globalCtx->envCtx.changeLightEnabled = true;
|
||||
globalCtx->envCtx.lightConfig = lightConfig;
|
||||
globalCtx->envCtx.changeLightNextConfig = changeLightNextConfig;
|
||||
gLightConfigAfterUnderwater = changeLightNextConfig;
|
||||
globalCtx->envCtx.changeDuration = changeDuration;
|
||||
globalCtx->envCtx.changeLightTimer = globalCtx->envCtx.changeDuration;
|
||||
|
||||
ret = true;
|
||||
}
|
||||
} else if (gTimeIncrement != 0) {
|
||||
gSaveContext.dayTime += 0x14;
|
||||
} else if (gTimeSpeed != 0) {
|
||||
gSaveContext.dayTime += 20;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void EnWeatherTag_DisabledCloudyHyruleMarket(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 3, 60, 1)) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 3, 60, WEATHER_MODE_CLOUDY_CONFIG3)) {
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudyHyruleMarket);
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +220,7 @@ void EnWeatherTag_EnabledCloudyHyruleMarket(EnWeatherTag* this, GlobalContext* g
|
|||
}
|
||||
|
||||
void EnWeatherTag_DisabledCloudyLonLonRanch(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 100, 2)) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 100, WEATHER_MODE_CLOUDY_CONFIG2)) {
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudyLonLonRanch);
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +232,7 @@ void EnWeatherTag_EnabledCloudyLonLonRanch(EnWeatherTag* this, GlobalContext* gl
|
|||
}
|
||||
|
||||
void EnWeatherTag_DisabledCloudyDeathMountain(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 60, 2)) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 60, WEATHER_MODE_CLOUDY_CONFIG2)) {
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudyDeathMountain);
|
||||
}
|
||||
}
|
||||
|
@ -238,23 +244,23 @@ void EnWeatherTag_EnabledCloudyDeathMountain(EnWeatherTag* this, GlobalContext*
|
|||
}
|
||||
|
||||
void EnWeatherTag_DisabledCloudySnow(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 60, 3)) {
|
||||
globalCtx->envCtx.unk_EE[3] = 64;
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 60, WEATHER_MODE_SNOW)) {
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX] = 64;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudySnow);
|
||||
}
|
||||
}
|
||||
|
||||
void EnWeatherTag_EnabledCloudySnow(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckRestoreWeather(this, globalCtx, 1, 0, 2, 0, 60)) {
|
||||
globalCtx->envCtx.unk_EE[3] = 0;
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX] = 0;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudySnow);
|
||||
}
|
||||
}
|
||||
|
||||
void EnWeatherTag_DisabledRainLakeHylia(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 100, 4)) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 100, WEATHER_MODE_RAIN)) {
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.unk_EE[0] = 25;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 25;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledRainLakeHylia);
|
||||
}
|
||||
}
|
||||
|
@ -262,16 +268,16 @@ void EnWeatherTag_DisabledRainLakeHylia(EnWeatherTag* this, GlobalContext* globa
|
|||
void EnWeatherTag_EnabledRainLakeHylia(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckRestoreWeather(this, globalCtx, 1, 0, 2, 0, 100)) {
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledRainLakeHylia);
|
||||
}
|
||||
}
|
||||
|
||||
void EnWeatherTag_DisabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 4, 100, 5)) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 4, 100, WEATHER_MODE_HEAVY_RAIN)) {
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.unk_EE[0] = 30;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_ON;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 30;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudyRainThunderKakariko);
|
||||
}
|
||||
}
|
||||
|
@ -279,8 +285,8 @@ void EnWeatherTag_DisabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalCo
|
|||
void EnWeatherTag_EnabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckRestoreWeather(this, globalCtx, 1, 0, 4, 0, 100)) {
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_LAST;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyRainThunderKakariko);
|
||||
}
|
||||
}
|
||||
|
@ -302,8 +308,8 @@ void EnWeatherTag_DisabledRainThunder(EnWeatherTag* this, GlobalContext* globalC
|
|||
|
||||
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this->actor.params)) {
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.unk_EE[0] = 25;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_ON;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 25;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledRainThunder);
|
||||
}
|
||||
}
|
||||
|
@ -313,9 +319,9 @@ void EnWeatherTag_EnabledRainThunder(EnWeatherTag* this, GlobalContext* globalCt
|
|||
|
||||
if ((WEATHER_TAG_RANGE100(this->actor.params) + 10.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.unk_EE[1] = 10;
|
||||
globalCtx->envCtx.lightningState = LIGHTNING_LAST;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
|
||||
globalCtx->envCtx.precipitation[PRECIP_RAIN_CUR] = 10;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledRainThunder);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,8 +272,8 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) {
|
|||
-10.0f);
|
||||
}
|
||||
if (this->timers[0] == 90) {
|
||||
globalCtx->envCtx.unk_BF = 2;
|
||||
globalCtx->envCtx.unk_D6 = 0x14;
|
||||
globalCtx->envCtx.lightSettingOverride = 2;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 20;
|
||||
}
|
||||
if (this->timers[0] == 100) {
|
||||
this->bossGndSignal = FHG_LIGHTNING;
|
||||
|
@ -374,8 +374,8 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.2f, 50.0f);
|
||||
osSyncPrintf("TIME %d-------------------------------------------------\n", this->timers[0]);
|
||||
if (fabsf(this->actor.world.pos.z - (GND_BOSSROOM_CENTER_Z + 400.0f - 0.5f)) < 1.0f) {
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_D6 = 0x14;
|
||||
globalCtx->envCtx.lightSettingOverride = 0;
|
||||
globalCtx->envCtx.lightBlendRateOverride = 20;
|
||||
this->cutsceneState = INTRO_FINISH;
|
||||
Animation_MorphToLoop(&this->skin.skelAnime, &gPhantomHorseRunningAnim, -3.0f);
|
||||
this->bossGndSignal = FHG_START_FIGHT;
|
||||
|
|
|
@ -863,7 +863,7 @@ void Fishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
D_80B7A684 = 20;
|
||||
globalCtx->specialEffects = sEffects;
|
||||
gTimeIncrement = 1;
|
||||
gTimeSpeed = 1;
|
||||
D_80B7E0AC = 0;
|
||||
D_80B7E0A6 = 10;
|
||||
|
||||
|
@ -3097,11 +3097,12 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
|
||||
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE) {
|
||||
if ((gSaveContext.dayTime >= 0xC000) && (gSaveContext.dayTime <= 0xC01B)) {
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(18, 0)) && (gSaveContext.dayTime <= CLOCK_TIME(18, 0) + 27)) {
|
||||
this->unk_158 = 7;
|
||||
this->unk_17A[3] = (s16)Rand_ZeroFloat(150.0f) + 200;
|
||||
}
|
||||
if ((gSaveContext.dayTime >= 0x3AAA) && (gSaveContext.dayTime <= 0x3AC5)) {
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(5, 30) - 1) &&
|
||||
(gSaveContext.dayTime < CLOCK_TIME(5, 30) + 27)) {
|
||||
this->unk_158 = 7;
|
||||
this->unk_17A[3] = (s16)Rand_ZeroFloat(150.0f) + 200;
|
||||
}
|
||||
|
@ -3352,9 +3353,9 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
multiplier = 1.0f;
|
||||
}
|
||||
|
||||
if ((gSaveContext.dayTime >= 0xB555) && (gSaveContext.dayTime <= 0xCAAA)) {
|
||||
if ((gSaveContext.dayTime >= CLOCK_TIME(17, 0)) && (gSaveContext.dayTime < CLOCK_TIME(19, 0))) {
|
||||
multiplier *= 1.75f;
|
||||
} else if ((gSaveContext.dayTime >= 0x3555) && (gSaveContext.dayTime <= 0x4AAA)) {
|
||||
} else if ((gSaveContext.dayTime >= CLOCK_TIME(5, 0)) && (gSaveContext.dayTime < CLOCK_TIME(7, 0))) {
|
||||
multiplier *= 1.5f;
|
||||
} else if (D_80B7E076 != 0) {
|
||||
multiplier *= 1.5f;
|
||||
|
@ -5574,9 +5575,9 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
if (sREG(15) != 0) {
|
||||
if (D_80B7A654 != (sREG(15) - 1)) {
|
||||
if (D_80B7A654 == 0) {
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_START;
|
||||
} else {
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5584,10 +5585,10 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
|
||||
if (sREG(14) == 1) {
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_START;
|
||||
}
|
||||
if (sREG(14) == -1) {
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_STOP;
|
||||
}
|
||||
|
||||
sREG(14) = 0;
|
||||
|
@ -5606,10 +5607,10 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
D_80B7A654 = (u8)Rand_ZeroFloat(10.0f) + 5;
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_START;
|
||||
} else {
|
||||
D_80B7A654 = 0;
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
globalCtx->envCtx.stormRequest = STORM_REQUEST_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,12 +222,13 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_EE[3] < 64 && (gSaveContext.entranceIndex != ENTR_SPOT04_0 ||
|
||||
gSaveContext.sceneSetupIndex != 4 || globalCtx->envCtx.unk_EE[3])) {
|
||||
globalCtx->envCtx.unk_EE[3] += 16;
|
||||
if (globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX] < 64 &&
|
||||
(gSaveContext.entranceIndex != ENTR_SPOT04_0 || gSaveContext.sceneSetupIndex != 4 ||
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX])) {
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX] += 16;
|
||||
}
|
||||
|
||||
for (i = 0; i < globalCtx->envCtx.unk_EE[3]; i++) {
|
||||
for (i = 0; i < globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX]; i++) {
|
||||
// spawn in front of the camera
|
||||
dx = globalCtx->view.at.x - globalCtx->view.eye.x;
|
||||
dy = globalCtx->view.at.y - globalCtx->view.eye.y;
|
||||
|
@ -495,7 +496,7 @@ void ObjectKankyo_DrawFairies(ObjectKankyo* this2, GlobalContext* globalCtx2) {
|
|||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gSun1Tex));
|
||||
gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteMaterialDL);
|
||||
|
||||
for (i = 0; i < globalCtx->envCtx.unk_EE[3]; i++) {
|
||||
for (i = 0; i < globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX]; i++) {
|
||||
Matrix_Translate(this->effects[i].base.x + this->effects[i].pos.x,
|
||||
this->effects[i].base.y + this->effects[i].pos.y,
|
||||
this->effects[i].base.z + this->effects[i].pos.z, MTXMODE_NEW);
|
||||
|
@ -586,17 +587,18 @@ void ObjectKankyo_DrawSnow(ObjectKankyo* this2, GlobalContext* globalCtx2) {
|
|||
|
||||
if (!(globalCtx->cameraPtrs[CAM_ID_MAIN]->unk_14C & 0x100)) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 958);
|
||||
if (globalCtx->envCtx.unk_EE[2] < globalCtx->envCtx.unk_EE[3]) {
|
||||
if (globalCtx->envCtx.precipitation[PRECIP_SNOW_CUR] < globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX]) {
|
||||
if (globalCtx->state.frames % 16 == 0) {
|
||||
globalCtx->envCtx.unk_EE[2] += 2;
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_CUR] += 2;
|
||||
}
|
||||
} else if (globalCtx->envCtx.unk_EE[2] > globalCtx->envCtx.unk_EE[3]) {
|
||||
} else if (globalCtx->envCtx.precipitation[PRECIP_SNOW_CUR] >
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_MAX]) {
|
||||
if (globalCtx->state.frames % 16 == 0) {
|
||||
globalCtx->envCtx.unk_EE[2] -= 2;
|
||||
globalCtx->envCtx.precipitation[PRECIP_SNOW_CUR] -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < globalCtx->envCtx.unk_EE[2]; i++) {
|
||||
for (i = 0; i < globalCtx->envCtx.precipitation[PRECIP_SNOW_CUR]; i++) {
|
||||
switch (this->effects[i].state) {
|
||||
case 0:
|
||||
// spawn in front of the camera
|
||||
|
|
|
@ -80,7 +80,7 @@ void OceffSpot_End(OceffSpot* this, GlobalContext* globalCtx) {
|
|||
this->unk_174 -= 0.05f;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
if (gTimeIncrement != 400 && globalCtx->msgCtx.unk_E40E == 0 &&
|
||||
if (gTimeSpeed != 400 && globalCtx->msgCtx.unk_E40E == 0 &&
|
||||
GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_1) {
|
||||
if (globalCtx->msgCtx.ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE ||
|
||||
globalCtx->msgCtx.ocarinaMode != OCARINA_MODE_08) {
|
||||
|
|
|
@ -179,7 +179,8 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) {
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.dayTime >= CLOCK_TIME(6, 30) &&
|
||||
gSaveContext.dayTime < CLOCK_TIME(7, 30)) {
|
||||
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + globalCtx->envCtx.sunPos.x * (1.0f / 6.0f);
|
||||
cylinderPos.y =
|
||||
player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f + globalCtx->envCtx.sunPos.y * (1.0f / 6.0f);
|
||||
|
|
|
@ -4162,6 +4162,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
|
|||
Scene_SetTransitionForNextEntrance(globalCtx);
|
||||
} else {
|
||||
globalCtx->nextEntranceIndex = globalCtx->setupExitList[exitIndex - 1];
|
||||
|
||||
if (globalCtx->nextEntranceIndex == ENTR_RETURN_GROTTO) {
|
||||
gSaveContext.respawnFlag = 2;
|
||||
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex;
|
||||
|
@ -4179,9 +4180,11 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
|
|||
Play_TriggerVoidOut(globalCtx);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
}
|
||||
gSaveContext.unk_13C3 = 1;
|
||||
|
||||
gSaveContext.retainWeatherMode = true;
|
||||
Scene_SetTransitionForNextEntrance(globalCtx);
|
||||
}
|
||||
|
||||
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
|
||||
}
|
||||
|
||||
|
@ -9700,8 +9703,8 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) {
|
|||
Audio_SetCodeReverb(SurfaceType_GetEcho(&globalCtx->colCtx, floorPoly, this->actor.floorBgId));
|
||||
|
||||
if (this->actor.floorBgId == BGCHECK_SCENE) {
|
||||
func_80074CE8(globalCtx,
|
||||
SurfaceType_GetLightSettingIndex(&globalCtx->colCtx, floorPoly, this->actor.floorBgId));
|
||||
Environment_ChangeLightSetting(
|
||||
globalCtx, SurfaceType_GetLightSettingIndex(&globalCtx->colCtx, floorPoly, this->actor.floorBgId));
|
||||
} else {
|
||||
func_80043508(&globalCtx->colCtx, this->actor.floorBgId);
|
||||
}
|
||||
|
|
|
@ -1476,13 +1476,13 @@ void FileChoose_LoadGame(GameState* thisx) {
|
|||
gSaveContext.unk_13F0 = 0;
|
||||
gSaveContext.unk_13F2 = 0;
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(0, 0);
|
||||
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.unk_13C3 = 0;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_NONE;
|
||||
gSaveContext.retainWeatherMode = false;
|
||||
|
||||
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
|
||||
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||
|
@ -1826,28 +1826,28 @@ void FileChoose_InitContext(GameState* thisx) {
|
|||
|
||||
ShrinkWindow_SetVal(0);
|
||||
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.dayTime = 0;
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(0, 0);
|
||||
gSaveContext.dayTime = CLOCK_TIME(0, 0);
|
||||
|
||||
Skybox_Init(&this->state, &this->skyboxCtx, SKYBOX_NORMAL_SKY);
|
||||
|
||||
gTimeIncrement = 10;
|
||||
gTimeSpeed = 10;
|
||||
|
||||
envCtx->unk_19 = 0;
|
||||
envCtx->unk_1A = 0;
|
||||
envCtx->unk_21 = 0;
|
||||
envCtx->unk_22 = 0;
|
||||
envCtx->changeSkyboxState = CHANGE_SKYBOX_INACTIVE;
|
||||
envCtx->changeSkyboxTimer = 0;
|
||||
envCtx->changeLightEnabled = false;
|
||||
envCtx->changeLightTimer = 0;
|
||||
envCtx->skyboxDmaState = SKYBOX_DMA_INACTIVE;
|
||||
envCtx->skybox1Index = 99;
|
||||
envCtx->skybox2Index = 99;
|
||||
envCtx->unk_1F = 0;
|
||||
envCtx->unk_20 = 0;
|
||||
envCtx->unk_BD = 0;
|
||||
envCtx->unk_17 = 2;
|
||||
envCtx->lightConfig = 0;
|
||||
envCtx->changeLightNextConfig = 0;
|
||||
envCtx->lightSetting = 0;
|
||||
envCtx->skyboxConfig = 2;
|
||||
envCtx->skyboxDisabled = 0;
|
||||
envCtx->skyboxBlend = 0;
|
||||
envCtx->unk_84 = 0.0f;
|
||||
envCtx->unk_88 = 0.0f;
|
||||
envCtx->glareAlpha = 0.0f;
|
||||
envCtx->lensFlareAlphaScale = 0.0f;
|
||||
|
||||
Environment_UpdateSkybox(SKYBOX_NORMAL_SKY, &this->envCtx, &this->skyboxCtx);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
|
|||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.showTitleCard = true;
|
||||
gWeatherMode = 0;
|
||||
gWeatherMode = WEATHER_MODE_CLEAR;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
|
||||
}
|
||||
|
@ -593,16 +593,16 @@ void Select_PrintCutsceneSetting(SelectContext* this, GfxPrint* printer, u16 csI
|
|||
switch (csIndex) {
|
||||
case 0:
|
||||
label = GFXP_HIRAGANA " ヨル " GFXP_KATAKANA "ゴロン";
|
||||
gSaveContext.dayTime = 0;
|
||||
gSaveContext.dayTime = CLOCK_TIME(0, 0);
|
||||
break;
|
||||
case 0x8000:
|
||||
// clang-format off
|
||||
gSaveContext.dayTime = 0x8000; label = GFXP_HIRAGANA "オヒル " GFXP_KATAKANA "ジャラ";
|
||||
gSaveContext.dayTime = CLOCK_TIME(12, 0); label = GFXP_HIRAGANA "オヒル " GFXP_KATAKANA "ジャラ";
|
||||
// clang-format on
|
||||
break;
|
||||
case 0xFFF0:
|
||||
// clang-format off
|
||||
gSaveContext.dayTime = 0x8000; label = "デモ00";
|
||||
gSaveContext.dayTime = CLOCK_TIME(12, 0); label = "デモ00";
|
||||
// clang-format on
|
||||
break;
|
||||
case 0xFFF1:
|
||||
|
|
Loading…
Add table
Reference in a new issue