mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-15 20:35:13 +00:00
Nature Ambience Documentation (#1063)
* Document nature ambience io data * Document nature ambience functions * Function headers * Doc storing main bgm for nature/miniboss bgm * Give temporary names to functions * small cleanup * add docs to clarify * Break up nature ambience channel io data for easier reading * Add info to where each nature ambience Id is used * Name environmental sequence functions * Use channel macros globally * Add nature enum, revert env name * Revert tough-to-name functions, use nature channel enum instead * Fill in remaining enums from sequence 1 * PR Suggestions * Improve macros * remove clang-format off * MINI_GAME_2 -> TIMED_MINI_GAME * Revert to generic name * Fix Spacing
This commit is contained in:
parent
a862411f00
commit
b8b983dd7f
18 changed files with 850 additions and 166 deletions
|
@ -414,7 +414,7 @@ void func_809EE800(EnDivingGame* this, GlobalContext* globalCtx) {
|
|||
} else {
|
||||
func_80088B34(BREG(2) + 50);
|
||||
}
|
||||
func_800F5ACC(NA_BGM_MINI_GAME_2);
|
||||
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
|
||||
func_8002DF54(globalCtx, NULL, 7);
|
||||
this->actor.textId = 0x405B;
|
||||
this->unk_292 = TEXT_STATE_EVENT;
|
||||
|
|
|
@ -38,7 +38,7 @@ void EnOkarinaEffect_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
if ((gWeatherMode != 4) && (gWeatherMode != 5) && (globalCtx->envCtx.gloomySkyMode == 1)) {
|
||||
globalCtx->envCtx.gloomySkyMode = 2; // end gloomy sky
|
||||
func_80077684(globalCtx);
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
}
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCt
|
|||
globalCtx->envCtx.unk_DE = 1;
|
||||
}
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
func_80077624(globalCtx);
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
EnOkarinaEffect_SetupAction(this, EnOkarinaEffect_ManageStorm);
|
||||
}
|
||||
|
||||
|
@ -91,10 +91,10 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
|||
if (this->timer == 0) {
|
||||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
|
||||
func_80077684(globalCtx);
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
} else if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_NATURE_AMBIENCE) {
|
||||
func_800F6D58(0xF, 1, 0);
|
||||
func_800F6D58(0xE, 1, 0);
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_1, 0);
|
||||
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);
|
||||
|
|
|
@ -36,7 +36,7 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
func_800F4870(this->actor.params - RS_MAX);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (this->actor.params == RS_UNK_F7) {
|
||||
func_800F6FB4(4);
|
||||
Audio_PlayNatureAmbienceSequence(NATURE_ID_KOKIRI_REGION);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (this->actor.params == RS_SARIAS_SONG) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) {
|
||||
|
|
|
@ -1372,7 +1372,7 @@ void EnSkj_SetupWaitForOcarina(EnSkj* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (player->stateFlags2 & 0x1000000) {
|
||||
player->stateFlags2 |= 0x2000000;
|
||||
func_800F5BF0(4);
|
||||
func_800F5BF0(NATURE_ID_KOKIRI_REGION);
|
||||
EnSkj_TurnPlayer(this, player);
|
||||
player->unk_6A8 = &this->actor;
|
||||
Message_StartTextbox(globalCtx, 0x10BE, &this->actor);
|
||||
|
@ -1388,7 +1388,7 @@ void EnSkj_WaitForOcarina(EnSkj* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (player->stateFlags2 & 0x1000000) {
|
||||
player->stateFlags2 |= 0x2000000;
|
||||
func_800F5BF0(4);
|
||||
func_800F5BF0(NATURE_ID_KOKIRI_REGION);
|
||||
EnSkj_TurnPlayer(this, player);
|
||||
player->unk_6A8 = &this->actor;
|
||||
Message_StartTextbox(globalCtx, 0x10BE, &this->actor);
|
||||
|
|
|
@ -807,7 +807,7 @@ void func_80B15AD4(EnTa* this, GlobalContext* globalCtx) {
|
|||
Animation_GetLastFrame(&gTalonSitHandsUpAnim), ANIMMODE_ONCE, 0.0f);
|
||||
this->unk_2CC = 50;
|
||||
func_80088B34(0x1E);
|
||||
func_800F5ACC(NA_BGM_MINI_GAME_2);
|
||||
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
|
||||
this->unk_2E0 |= 0x200;
|
||||
Message_CloseTextbox(globalCtx);
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
|
|
|
@ -253,7 +253,7 @@ void EnWeatherTag_EnabledCloudySnow(EnWeatherTag* this, GlobalContext* globalCtx
|
|||
|
||||
void EnWeatherTag_DisabledRainLakeHylia(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 2, 100, 4)) {
|
||||
func_80077624(globalCtx);
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.unk_EE[0] = 25;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledRainLakeHylia);
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ void EnWeatherTag_DisabledRainLakeHylia(EnWeatherTag* this, GlobalContext* globa
|
|||
|
||||
void EnWeatherTag_EnabledRainLakeHylia(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckRestoreWeather(this, globalCtx, 1, 0, 2, 0, 100)) {
|
||||
func_80077684(globalCtx);
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledRainLakeHylia);
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ void EnWeatherTag_EnabledRainLakeHylia(EnWeatherTag* this, GlobalContext* global
|
|||
|
||||
void EnWeatherTag_DisabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 4, 100, 5)) {
|
||||
func_80077624(globalCtx);
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.unk_EE[0] = 30;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudyRainThunderKakariko);
|
||||
|
@ -278,7 +278,7 @@ void EnWeatherTag_DisabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalCo
|
|||
|
||||
void EnWeatherTag_EnabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckRestoreWeather(this, globalCtx, 1, 0, 4, 0, 100)) {
|
||||
func_80077684(globalCtx);
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyRainThunderKakariko);
|
||||
|
@ -301,7 +301,7 @@ void EnWeatherTag_DisabledRainThunder(EnWeatherTag* this, GlobalContext* globalC
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this->actor.params)) {
|
||||
func_80077624(globalCtx);
|
||||
Environment_PlayStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.unk_EE[0] = 25;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledRainThunder);
|
||||
|
@ -312,7 +312,7 @@ void EnWeatherTag_EnabledRainThunder(EnWeatherTag* this, GlobalContext* globalCt
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((WEATHER_TAG_RANGE100(this->actor.params) + 10.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
|
||||
func_80077684(globalCtx);
|
||||
Environment_StopStormNatureAmbience(globalCtx);
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.unk_EE[1] = 10;
|
||||
|
|
|
@ -385,7 +385,7 @@ void EnWf_WaitToAppear(EnWf* this, GlobalContext* globalCtx) {
|
|||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
|
||||
if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF)) {
|
||||
func_800F5ACC(0x38); // Mini-Boss Battle Theme
|
||||
func_800F5ACC(NA_BGM_MINI_BOSS);
|
||||
}
|
||||
}
|
||||
} else if (this->actionTimer != 0) {
|
||||
|
|
|
@ -641,7 +641,7 @@ void EnZf_DropIn(EnZf* this, GlobalContext* globalCtx) {
|
|||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
|
||||
if (this->actor.params == ENZF_TYPE_LIZALFOS_MINIBOSS_A) {
|
||||
func_800F5ACC(0x38); // Miniboss theme
|
||||
func_800F5ACC(NA_BGM_MINI_BOSS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2823,7 +2823,7 @@ void func_80836448(GlobalContext* globalCtx, Player* this, LinkAnimationHeader*
|
|||
func_800F6AB0(0);
|
||||
Audio_PlayFanfare(NA_BGM_GAME_OVER);
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.natureAmbienceId = NATURE_ID_DISABLED;
|
||||
}
|
||||
|
||||
OnePointCutscene_Init(globalCtx, 9806, cond ? 120 : 60, &this->actor, MAIN_CAM);
|
||||
|
@ -3985,7 +3985,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
|
|||
func_800788CC(NA_SE_OC_SECRET_HOLE_OUT);
|
||||
func_800F6964(5);
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.natureAmbienceId = NATURE_ID_DISABLED;
|
||||
} else {
|
||||
linearVel = this->linearVelocity;
|
||||
|
||||
|
@ -11923,7 +11923,7 @@ void func_8084E3C4(Player* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.natureAmbienceId = NATURE_ID_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue