Add flag set/unset hooks and GI actions (#3065)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user