botw: water level toggle (#5710)

amazingly the code already handles the flag being cleared to raise the water level,
so only need to setup hooks for ocarina spot to toggle

In MQ it's a diamond switch, so only need to turn it into a toggleable diamond switch
This commit is contained in:
Philip Dubé
2025-10-13 22:10:24 +00:00
committed by GitHub
parent 94b07aaa73
commit e254c1f908
3 changed files with 59 additions and 6 deletions

View File

@@ -79,7 +79,8 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) {
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 当り?\t\t ☆☆☆☆☆ %d\n" VT_RST, this->unk_158);
osSyncPrintf("\n\n");
if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) {
if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETED,
(this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag)), this)) {
Actor_Kill(&this->actor);
} else {
switch (this->type) {
@@ -113,7 +114,8 @@ void func_80ABEF2C(EnOkarinaTag* this, PlayState* play) {
player = GET_PLAYER(play);
this->unk_15A++;
if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) {
if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETED,
(this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag)), this)) {
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
} else {
if ((this->ocarinaSong != 6) || (gSaveContext.scarecrowSpawnSongSet)) {
@@ -148,7 +150,7 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) {
this->actionFunc = func_80ABEF2C;
} else {
if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) {
if (this->switchFlag >= 0) {
if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETE, this->switchFlag >= 0, this)) {
Flags_SetSwitch(play, this->switchFlag);
}
if (play->sceneNum == SCENE_WATER_TEMPLE) {
@@ -167,7 +169,7 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) {
(play->msgCtx.ocarinaMode == OCARINA_MODE_07) || (play->msgCtx.ocarinaMode == OCARINA_MODE_08) ||
(play->msgCtx.ocarinaMode == OCARINA_MODE_09) || (play->msgCtx.ocarinaMode == OCARINA_MODE_0A) ||
(play->msgCtx.ocarinaMode == OCARINA_MODE_0D)) {
if (this->switchFlag >= 0) {
if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETE, this->switchFlag >= 0, this)) {
Flags_SetSwitch(play, this->switchFlag);
}
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
@@ -190,7 +192,8 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) {
this->unk_15A++;
if ((this->ocarinaSong != 6) || (gSaveContext.scarecrowSpawnSongSet)) {
if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) {
if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETED,
(this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag)), this)) {
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
} else if (((this->type != 4) ||
GameInteractor_Should(VB_BE_ELIGIBLE_TO_OPEN_DOT,
@@ -237,7 +240,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) {
this->actionFunc = func_80ABF28C;
} else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
if (this->switchFlag >= 0) {
if (GameInteractor_Should(VB_OKARINA_TAG_COMPLETE, this->switchFlag >= 0, this)) {
Flags_SetSwitch(play, this->switchFlag);
}
switch (this->type) {