diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2023-09-26 08:45:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-26 08:45:51 -0500 |
| commit | db10864e95d993a9f5389f31f61d441fb4ccba0c (patch) | |
| tree | 6c53affa2c9ecbc655c529097dbb0d13318fa9d1 /soh/src/code | |
| parent | bae6cf420374a2ab15059e359e57f5de43c9776c (diff) | |
Add flag set/unset hooks and GI actions (#3065)
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 750419966..85b9748df 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -668,6 +668,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) { } else { play->actorCtx.flags.tempSwch |= (1 << (flag - 0x20)); } + GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_SWITCH, flag); } /** @@ -680,6 +681,7 @@ void Flags_UnsetSwitch(PlayState* play, s32 flag) { } else { play->actorCtx.flags.tempSwch &= ~(1 << (flag - 0x20)); } + GameInteractor_ExecuteOnSceneFlagUnset(play->sceneNum, FLAG_SCENE_SWITCH, flag); } /** @@ -728,6 +730,7 @@ s32 Flags_GetTreasure(PlayState* play, s32 flag) { void Flags_SetTreasure(PlayState* play, s32 flag) { lusprintf(__FILE__, __LINE__, 2, "Treasure Flag Set - %#x", flag); play->actorCtx.flags.chest |= (1 << flag); + GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_TREASURE, flag); } /** @@ -742,6 +745,7 @@ s32 Flags_GetClear(PlayState* play, s32 flag) { */ void Flags_SetClear(PlayState* play, s32 flag) { play->actorCtx.flags.clear |= (1 << flag); + GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_CLEAR, flag); } /** @@ -749,6 +753,7 @@ void Flags_SetClear(PlayState* play, s32 flag) { */ void Flags_UnsetClear(PlayState* play, s32 flag) { play->actorCtx.flags.clear &= ~(1 << flag); + GameInteractor_ExecuteOnSceneFlagUnset(play->sceneNum, FLAG_SCENE_CLEAR, flag); } /** @@ -795,6 +800,7 @@ void Flags_SetCollectible(PlayState* play, s32 flag) { play->actorCtx.flags.tempCollect |= (1 << (flag - 0x20)); } } + GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_COLLECTIBLE, flag); } void func_8002CDE4(PlayState* play, TitleCardContext* titleCtx) { @@ -4718,6 +4724,7 @@ s32 Flags_GetEventChkInf(s32 flag) { */ void Flags_SetEventChkInf(s32 flag) { gSaveContext.eventChkInf[flag >> 4] |= (1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, flag); } /** @@ -4725,6 +4732,7 @@ void Flags_SetEventChkInf(s32 flag) { */ void Flags_UnsetEventChkInf(s32 flag) { gSaveContext.eventChkInf[flag >> 4] &= ~(1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagUnset(FLAG_EVENT_CHECK_INF, flag); } /** @@ -4739,6 +4747,7 @@ s32 Flags_GetItemGetInf(s32 flag) { */ void Flags_SetItemGetInf(s32 flag) { gSaveContext.itemGetInf[flag >> 4] |= (1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagSet(FLAG_ITEM_GET_INF, flag); } /** @@ -4746,6 +4755,7 @@ void Flags_SetItemGetInf(s32 flag) { */ void Flags_UnsetItemGetInf(s32 flag) { gSaveContext.itemGetInf[flag >> 4] &= ~(1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagUnset(FLAG_ITEM_GET_INF, flag); } /** @@ -4760,6 +4770,7 @@ s32 Flags_GetInfTable(s32 flag) { */ void Flags_SetInfTable(s32 flag) { gSaveContext.infTable[flag >> 4] |= (1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagSet(FLAG_INF_TABLE, flag); } /** @@ -4767,6 +4778,7 @@ void Flags_SetInfTable(s32 flag) { */ void Flags_UnsetInfTable(s32 flag) { gSaveContext.infTable[flag >> 4] &= ~(1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagUnset(FLAG_INF_TABLE, flag); } /** @@ -4781,6 +4793,7 @@ s32 Flags_GetEventInf(s32 flag) { */ void Flags_SetEventInf(s32 flag) { gSaveContext.eventInf[flag >> 4] |= (1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_INF, flag); } /** @@ -4788,6 +4801,7 @@ void Flags_SetEventInf(s32 flag) { */ void Flags_UnsetEventInf(s32 flag) { gSaveContext.eventInf[flag >> 4] &= ~(1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagUnset(FLAG_EVENT_INF, flag); } /** @@ -4802,6 +4816,7 @@ s32 Flags_GetRandomizerInf(RandomizerInf flag) { */ void Flags_SetRandomizerInf(RandomizerInf flag) { gSaveContext.randomizerInf[flag >> 4] |= (1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagSet(FLAG_RANDOMIZER_INF, flag); } /** @@ -4809,6 +4824,7 @@ void Flags_SetRandomizerInf(RandomizerInf flag) { */ void Flags_UnsetRandomizerInf(RandomizerInf flag) { gSaveContext.randomizerInf[flag >> 4] &= ~(1 << (flag & 0xF)); + GameInteractor_ExecuteOnFlagUnset(FLAG_RANDOMIZER_INF, flag); } u32 func_80035BFC(PlayState* play, s16 arg1) { |
