diff --git a/soh/include/functions.h b/soh/include/functions.h index 3e0921afb..8bce5eb69 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -553,10 +553,19 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); s32 Flags_GetEventChkInf(s32 flag); void Flags_SetEventChkInf(s32 flag); +void Flags_UnsetEventChkInf(s32 flag); +s32 Flags_GetItemGetInf(s32 flag); +void Flags_SetItemGetInf(s32 flag); +void Flags_UnsetItemGetInf(s32 flag); s32 Flags_GetInfTable(s32 flag); void Flags_SetInfTable(s32 flag); +void Flags_UnsetInfTable(s32 flag); +s32 Flags_GetEventInf(s32 flag); +void Flags_SetEventInf(s32 flag); +void Flags_UnsetEventInf(s32 flag); s32 Flags_GetRandomizerInf(RandomizerInf flag); void Flags_SetRandomizerInf(RandomizerInf flag); +void Flags_UnsetRandomizerInf(RandomizerInf flag); u16 func_80037C30(PlayState* play, s16 arg1); s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3); s32 func_80038290(PlayState* play, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4); diff --git a/soh/include/macros.h b/soh/include/macros.h index 1641dc1ad..74d74cef1 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -88,6 +88,7 @@ #define GET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF))) #define SET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) #define GET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] & (1 << ((flag) & 0xF))) #define SET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF))) diff --git a/soh/include/z64player.h b/soh/include/z64player.h index d2e69f51b..4aaf57586 100644 --- a/soh/include/z64player.h +++ b/soh/include/z64player.h @@ -406,6 +406,9 @@ typedef enum { FLAG_SCENE_CLEAR, FLAG_SCENE_COLLECTIBLE, FLAG_EVENT_CHECK_INF, + FLAG_ITEM_GET_INF, + FLAG_INF_TABLE, + FLAG_EVENT_INF, FLAG_RANDOMIZER_INF } FlagType; diff --git a/soh/include/z64save.h b/soh/include/z64save.h index c4ab0a681..4fa02f157 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -389,15 +389,15 @@ typedef enum { */ #define EVENTCHKINF_FIRST_SPOKE_TO_MIDO 0x02 -#define EVENTCHKINF_03 0x03 +#define EVENTCHKINF_COMPLAINED_ABOUT_MIDO 0x03 #define EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD 0x04 #define EVENTCHKINF_DEKU_TREE_OPENED_MOUTH 0x05 #define EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD 0x07 -#define EVENTCHKINF_09 0x09 -#define EVENTCHKINF_0A 0x0A +#define EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP 0x09 +#define EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT 0x0A #define EVENTCHKINF_0B 0x0B #define EVENTCHKINF_MET_DEKU_TREE 0x0C -#define EVENTCHKINF_0F 0x0F +#define EVENTCHKINF_SPOKE_TO_MIDO_ABOUT_SARIA 0x0F #define EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET 0x10 #define EVENTCHKINF_SPOKE_TO_INGO_AT_RANCH_BEFORE_TALON_RETURNS 0x11 #define EVENTCHKINF_OBTAINED_POCKET_EGG 0x12 @@ -406,30 +406,31 @@ typedef enum { #define EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH 0x15 #define EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON 0x16 #define EVENTCHKINF_EPONA_OBTAINED 0x18 +#define EVENTCHKINF_OBTAINED_KOKIRI_EMERALD 0x19 #define EVENTCHKINF_RENTED_HORSE_FROM_INGO 0x1B #define EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH 0x1C -#define EVENTCHKINF_1D 0x1D -#define EVENTCHKINF_1E 0x1E +#define EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB 0x1D +#define EVENTCHKINF_WON_COW_IN_MALONS_RACE 0x1E #define EVENTCHKINF_20 0x20 #define EVENTCHKINF_21 0x21 #define EVENTCHKINF_22 0x22 -#define EVENTCHKINF_23 0x23 -#define EVENTCHKINF_25 0x25 +#define EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE 0x23 +#define EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP 0x25 #define EVENTCHKINF_2A 0x2A #define EVENTCHKINF_2B 0x2B #define EVENTCHKINF_2C 0x2C #define EVENTCHKINF_2D 0x2D #define EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED 0x2F -#define EVENTCHKINF_30 0x30 -#define EVENTCHKINF_31 0x31 +#define EVENTCHKINF_SPOKE_TO_A_ZORA 0x30 +#define EVENTCHKINF_OBTAINED_RUTOS_LETTER 0x31 #define EVENTCHKINF_32 0x32 -#define EVENTCHKINF_33 0x33 -#define EVENTCHKINF_37 0x37 -#define EVENTCHKINF_38 0x38 -#define EVENTCHKINF_39 0x39 -#define EVENTCHKINF_3A 0x3A +#define EVENTCHKINF_KING_ZORA_MOVED 0x33 +#define EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP 0x37 +#define EVENTCHKINF_OBTAINED_SILVER_SCALE 0x38 +#define EVENTCHKINF_OPENED_ZORAS_DOMAIN 0x39 +#define EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU 0x3A #define EVENTCHKINF_BEGAN_NABOORU_BATTLE 0x3B -#define EVENTCHKINF_3C 0x3C +#define EVENTCHKINF_FINISHED_NABOORU_BATTLE 0x3C // 0x40 #define EVENTCHKINF_40_INDEX 4 @@ -439,28 +440,29 @@ typedef enum { #define EVENTCHKINF_41 0x41 #define EVENTCHKINF_42 0x42 -#define EVENTCHKINF_43 0x43 +#define EVENTCHKINF_OBTAINED_OCARINA_OF_TIME 0x43 #define EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL 0x45 -#define EVENTCHKINF_48 0x48 -#define EVENTCHKINF_49 0x49 -#define EVENTCHKINF_4A 0x4A +#define EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP 0x48 +#define EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP 0x49 +#define EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP 0x4A #define EVENTCHKINF_OPENED_THE_DOOR_OF_TIME 0x4B #define EVENTCHKINF_4C 0x4C -#define EVENTCHKINF_4D 0x4D -#define EVENTCHKINF_4E 0x4E +#define EVENTCHKINF_RAINBOW_BRIDGE_BUILT 0x4D +#define EVENTCHKINF_CAUGHT_BY_CASTLE_GUARDS 0x4E #define EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER 0x4F -#define EVENTCHKINF_50 0x50 -#define EVENTCHKINF_51 0x51 -#define EVENTCHKINF_52 0x52 -#define EVENTCHKINF_54 0x54 -#define EVENTCHKINF_55 0x55 +#define EVENTCHKINF_LEARNED_MINUET_OF_FOREST 0x50 +#define EVENTCHKINF_LEARNED_BOLERO_OF_FIRE 0x51 +#define EVENTCHKINF_LEARNED_SERENADE_OF_WATER 0x52 +#define EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW 0x54 +#define EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT 0x55 +#define EVENTCHKINF_LEARNED_SARIAS_SONG 0x57 #define EVENTCHKINF_LEARNED_ZELDAS_LULLABY 0x59 -#define EVENTCHKINF_5A 0x5A -#define EVENTCHKINF_5B 0x5B +#define EVENTCHKINF_LEARNED_SUNS_SONG 0x5A +#define EVENTCHKINF_LEARNED_SONG_OF_STORMS 0x5B #define EVENTCHKINF_5C 0x5C -#define EVENTCHKINF_65 0x65 -#define EVENTCHKINF_67 0x67 -#define EVENTCHKINF_68 0x68 +#define EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL 0x65 +#define EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO 0x67 +#define EVENTCHKINF_PLAYED_HORSEBACK_ARCHERY 0x68 #define EVENTCHKINF_RAISED_LAKE_HYLIA_WATER 0x69 #define EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO 0x6A @@ -471,7 +473,7 @@ typedef enum { #define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO ((EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX << 4) | EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT) #define EVENTCHKINF_6E 0x6E -#define EVENTCHKINF_6F 0x6F +#define EVENTCHKINF_SPOKE_TO_KAEPORA_BY_LOST_WOODS 0x6F #define EVENTCHKINF_BEGAN_GOHMA_BATTLE 0x70 #define EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE 0x71 #define EVENTCHKINF_BEGAN_PHANTOM_GANON_BATTLE 0x72 @@ -481,11 +483,11 @@ typedef enum { #define EVENTCHKINF_BEGAN_BARINA_BATTLE 0x76 #define EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE 0x77 #define EVENTCHKINF_BEGAN_GANONDORF_BATTLE 0x78 -#define EVENTCHKINF_80 0x80 -#define EVENTCHKINF_82 0x82 -#define EVENTCHKINF_8C 0x8C -#define EVENTCHKINF_8D 0x8D -#define EVENTCHKINF_8E 0x8E +#define EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE 0x80 +#define EVENTCHKINF_DRAWBRIDGE_OPENED_AFTER_ZELDA_FLED 0x82 +#define EVENTCHKINF_PAID_BACK_KEATON_MASK_FEE 0x8C +#define EVENTCHKINF_PAID_BACK_SKULL_MASK_FEE 0x8D +#define EVENTCHKINF_PAID_BACK_SPOOKY_MASK_FEE 0x8E #define EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE 0x8F // 0x90-0x93 @@ -503,9 +505,9 @@ typedef enum { CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX], EVENTCHKINF_CARPENTERS_FREE_MASK_ALL) #define EVENTCHKINF_SPOKE_TO_NABOORU_IN_SPIRIT_TEMPLE 0x94 -#define EVENTCHKINF_95 0x95 -#define EVENTCHKINF_96 0x96 -#define EVENTCHKINF_9C 0x9C +#define EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA 0x95 +#define EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE 0x96 +#define EVENTCHKINF_PLAYED_SONG_FOR_SCARECROW_AS_ADULT 0x9C #define EVENTCHKINF_ENTERED_HYRULE_FIELD 0xA0 #define EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_TRAIL 0xA1 #define EVENTCHKINF_ENTERED_KAKARIKO_VILLAGE 0xA3 @@ -514,10 +516,10 @@ typedef enum { #define EVENTCHKINF_ENTERED_GORON_CITY 0xA6 #define EVENTCHKINF_ENTERED_TEMPLE_OF_TIME 0xA7 #define EVENTCHKINF_ENTERED_DEKU_TREE 0xA8 -#define EVENTCHKINF_A9 0xA9 -#define EVENTCHKINF_AA 0xAA -#define EVENTCHKINF_AC 0xAC -#define EVENTCHKINF_AD 0xAD +#define EVENTCHKINF_LEARNED_SONG_OF_TIME 0xA9 +#define EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL 0xAA +#define EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT 0xAC +#define EVENTCHKINF_COMPLETED_SPIRIT_TRIAL 0xAD #define EVENTCHKINF_ENTERED_DODONGOS_CAVERN 0xB0 #define EVENTCHKINF_ENTERED_LAKE_HYLIA 0xB1 #define EVENTCHKINF_ENTERED_GERUDO_VALLEY 0xB2 @@ -529,20 +531,20 @@ typedef enum { #define EVENTCHKINF_ENTERED_DESERT_COLOSSUS 0xB8 #define EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_CRATER 0xB9 #define EVENTCHKINF_ENTERED_GANONS_CASTLE_EXTERIOR 0xBA -#define EVENTCHKINF_BB 0xBB -#define EVENTCHKINF_BC 0xBC -#define EVENTCHKINF_BD 0xBD -#define EVENTCHKINF_BE 0xBE -#define EVENTCHKINF_BF 0xBF +#define EVENTCHKINF_COMPLETED_FOREST_TRIAL 0xBB +#define EVENTCHKINF_COMPLETED_WATER_TRIAL 0xBC +#define EVENTCHKINF_COMPLETED_SHADOW_TRIAL 0xBD +#define EVENTCHKINF_COMPLETED_FIRE_TRIAL 0xBE +#define EVENTCHKINF_COMPLETED_LIGHT_TRIAL 0xBF #define EVENTCHKINF_NABOORU_ORDERED_TO_FIGHT_BY_TWINROVA 0xC0 -#define EVENTCHKINF_C1 0xC1 -#define EVENTCHKINF_C3 0xC3 +#define EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE 0xC1 +#define EVENTCHKINF_DISPELLED_GANONS_TOWER_BARRIER 0xC3 #define EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS 0xC4 #define EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL 0xC5 -#define EVENTCHKINF_C6 0xC6 +#define EVENTCHKINF_SPOKE_TO_DEKU_TREE_SPROUT 0xC6 #define EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO 0xC7 -#define EVENTCHKINF_C8 0xC8 -#define EVENTCHKINF_C9 0xC9 +#define EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION 0xC8 +#define EVENTCHKINF_TIME_TRAVELED_TO_ADULT 0xC9 // 0xD0-0xD6 #define EVENTCHKINF_SONGS_FOR_FROGS_INDEX 13 @@ -569,12 +571,12 @@ typedef enum { #define EVENTCHKINF_SONGS_FOR_FROGS_STORMS ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_STORMS_SHIFT) // 0xDA-0xDE -#define EVENTCHKINF_DA_DB_DC_DD_DE_INDEX 13 -#define EVENTCHKINF_DA_MASK (1 << 10) -#define EVENTCHKINF_DB_MASK (1 << 11) -#define EVENTCHKINF_DC_MASK (1 << 12) -#define EVENTCHKINF_DD_MASK (1 << 13) -#define EVENTCHKINF_DE_MASK (1 << 14) +#define EVENTCHKINF_SKULLTULA_REWARD_INDEX 13 +#define EVENTCHKINF_SKULLTULA_REWARD_10_MASK (1 << 10) +#define EVENTCHKINF_SKULLTULA_REWARD_20_MASK (1 << 11) +#define EVENTCHKINF_SKULLTULA_REWARD_30_MASK (1 << 12) +#define EVENTCHKINF_SKULLTULA_REWARD_40_MASK (1 << 13) +#define EVENTCHKINF_SKULLTULA_REWARD_50_MASK (1 << 14) /* @@ -618,8 +620,8 @@ typedef enum { #define ITEMGETINF_1B 0x1B #define ITEMGETINF_1C 0x1C #define ITEMGETINF_1D 0x1D -#define ITEMGETINF_1E 0x1E -#define ITEMGETINF_1F 0x1F +#define ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE 0x1E +#define ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE 0x1F #define ITEMGETINF_23 0x23 #define ITEMGETINF_24 0x24 #define ITEMGETINF_25 0x25 @@ -794,6 +796,7 @@ typedef enum { // 0x1D0-0x1DF #define INFTABLE_1DX_INDEX 29 +#define INFTABLE_SWORDLESS 0x1D0 /* @@ -856,7 +859,7 @@ typedef enum { (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_0F_MASK) | ((v) << EVENTINF_HORSES_0F_SHIFT) -#define EVENTINF_10 0x10 +#define EVENTINF_MARATHON_ACTIVE 0x10 // 0x20-0x24 #define EVENTINF_20_21_22_23_24_INDEX 2 diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index e58e51818..633777a23 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -587,7 +587,7 @@ void Entrance_OverrideWeatherState() { return; } // Lon Lon Ranch (No Epona) - if (!Flags_GetEventChkInf(0x18)){ // if you don't have Epona + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)){ // if you don't have Epona switch (gSaveContext.entranceIndex) { case 0x0157: // Lon Lon Ranch from HF case 0x01F9: // Hyrule Field from LLR @@ -596,7 +596,7 @@ void Entrance_OverrideWeatherState() { } } // Water Temple - if (!(gSaveContext.eventChkInf[4] & 0x0400)) { // have not beaten Water Temple + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) { // have not beaten Water Temple switch (gSaveContext.entranceIndex) { case 0x019D: // Zora River from behind waterfall case 0x01DD: // Zora River from LW water shortcut @@ -630,7 +630,7 @@ void Entrance_OverrideWeatherState() { } } // Death Mountain Cloudy - if (!(gSaveContext.eventChkInf[4] & 0x0200)) { // have not beaten Fire Temple + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) { // have not beaten Fire Temple if (gPlayState->nextEntranceIndex == 0x04D6) { // Lost Woods Goron City Shortcut gWeatherMode = 2; return; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 872752994..7a30a35ee 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -4692,33 +4692,89 @@ void func_80035B18(PlayState* play, Actor* actor, u16 textId) { } /** - * Tests if event_chk_inf flag is set. + * Tests if "eventChkInf" flag is set. */ s32 Flags_GetEventChkInf(s32 flag) { return gSaveContext.eventChkInf[flag >> 4] & (1 << (flag & 0xF)); } /** - * Sets event_chk_inf flag. + * Sets "eventChkInf" flag. */ void Flags_SetEventChkInf(s32 flag) { gSaveContext.eventChkInf[flag >> 4] |= (1 << (flag & 0xF)); } /** - * Tests if "inf_table flag is set. + * Unsets "eventChkInf" flag. + */ +void Flags_UnsetEventChkInf(s32 flag) { + gSaveContext.eventChkInf[flag >> 4] &= ~(1 << (flag & 0xF)); +} + +/** + * Tests if "itemGetInf" flag is set. + */ +s32 Flags_GetItemGetInf(s32 flag) { + return gSaveContext.itemGetInf[flag >> 4] & (1 << (flag & 0xF)); +} + +/** + * Sets "itemGetInf" flag. + */ +void Flags_SetItemGetInf(s32 flag) { + gSaveContext.itemGetInf[flag >> 4] |= (1 << (flag & 0xF)); +} + +/** + * Unsets "itemGetInf" flag. + */ +void Flags_UnsetItemGetInf(s32 flag) { + gSaveContext.itemGetInf[flag >> 4] &= ~(1 << (flag & 0xF)); +} + +/** + * Tests if "infTable" flag is set. */ s32 Flags_GetInfTable(s32 flag) { return gSaveContext.infTable[flag >> 4] & (1 << (flag & 0xF)); } /** - * Sets "inf_table" flag. + * Sets "infTable" flag. */ void Flags_SetInfTable(s32 flag) { gSaveContext.infTable[flag >> 4] |= (1 << (flag & 0xF)); } +/** + * Unsets "infTable" flag. + */ +void Flags_UnsetInfTable(s32 flag) { + gSaveContext.infTable[flag >> 4] &= ~(1 << (flag & 0xF)); +} + +/** + * Tests if "eventInf" flag is set. + */ +s32 Flags_GetEventInf(s32 flag) { + return gSaveContext.eventInf[flag >> 4] & (1 << (flag & 0xF)); +} + +/** + * Sets "eventInf" flag. + */ +void Flags_SetEventInf(s32 flag) { + gSaveContext.eventInf[flag >> 4] |= (1 << (flag & 0xF)); +} + +/** + * Unsets "eventInf" flag. + */ +void Flags_UnsetEventInf(s32 flag) { + gSaveContext.eventInf[flag >> 4] &= ~(1 << (flag & 0xF)); +} + /** * Tests if "randomizerInf" flag is set. */ @@ -4733,27 +4789,34 @@ void Flags_SetRandomizerInf(RandomizerInf flag) { gSaveContext.randomizerInf[flag >> 4] |= (1 << (flag & 0xF)); } +/** + * Unsets "randomizerInf" flag. + */ +void Flags_UnsetRandomizerInf(RandomizerInf flag) { + gSaveContext.randomizerInf[flag >> 4] &= ~(1 << (flag & 0xF)); +} + u32 func_80035BFC(PlayState* play, s16 arg1) { u16 retTextId = 0; switch (arg1) { case 0: - if (Flags_GetEventChkInf(0x9)) { - if (Flags_GetInfTable(0x5)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { + if (Flags_GetInfTable(INFTABLE_05)) { retTextId = 0x1048; } else { retTextId = 0x1047; } } else { - if (Flags_GetEventChkInf(0x2)) { - if (Flags_GetInfTable(0x3)) { + if (Flags_GetEventChkInf(EVENTCHKINF_FIRST_SPOKE_TO_MIDO)) { + if (Flags_GetInfTable(INFTABLE_03)) { retTextId = 0x1032; } else { retTextId = 0x1031; } } else { - if (Flags_GetInfTable(0x0)) { - if (Flags_GetInfTable(0x1)) { + if (Flags_GetInfTable(INFTABLE_GREETED_BY_SARIA)) { + if (Flags_GetInfTable(INFTABLE_01)) { retTextId = 0x1003; } else { retTextId = 0x1002; @@ -4766,21 +4829,21 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 1: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { - if (Flags_GetInfTable(0x10)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { + if (Flags_GetInfTable(INFTABLE_10)) { retTextId = 0x1046; } else { retTextId = 0x1045; } } else { - if (Flags_GetEventChkInf(0x3)) { - if (Flags_GetInfTable(0xE)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLAINED_ABOUT_MIDO)) { + if (Flags_GetInfTable(INFTABLE_0E)) { retTextId = 0x1034; } else { retTextId = 0x1033; } } else { - if (Flags_GetInfTable(0xC)) { + if (Flags_GetInfTable(INFTABLE_0C)) { retTextId = 0x1030; } else { retTextId = 0x102F; @@ -4788,21 +4851,21 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } } } else { - if (Flags_GetEventChkInf(0x5C)) { - if (Flags_GetInfTable(0x19)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { + if (Flags_GetInfTable(INFTABLE_19)) { retTextId = 0x1071; } else { retTextId = 0x1070; } } else { - if (Flags_GetEventChkInf(0xB)) { - if (Flags_GetInfTable(0x17)) { + if (Flags_GetEventChkInf(EVENTCHKINF_0B)) { + if (Flags_GetInfTable(INFTABLE_17)) { retTextId = 0x1068; } else { retTextId = 0x1067; } } else { - if (Flags_GetInfTable(0x15)) { + if (Flags_GetInfTable(INFTABLE_15)) { retTextId = 0x1061; } else { retTextId = 0x1060; @@ -4813,15 +4876,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 2: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1042; } else { retTextId = 0x1004; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1072; - } else if (Flags_GetInfTable(0x41)) { + } else if (Flags_GetInfTable(INFTABLE_41)) { retTextId = 0x1055; } else { retTextId = 0x1056; @@ -4830,17 +4893,17 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 3: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1043; } else { - if (Flags_GetInfTable(0x1E)) { + if (Flags_GetInfTable(INFTABLE_1E)) { retTextId = 0x1006; } else { retTextId = 0x1005; } } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1073; } else { retTextId = 0x105A; @@ -4849,15 +4912,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 4: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1042; } else { retTextId = 0x1007; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1072; - } else if (Flags_GetInfTable(0x47)) { + } else if (Flags_GetInfTable(INFTABLE_47)) { retTextId = 0x105E; } else { retTextId = 0x105D; @@ -4866,15 +4929,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 5: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1044; - } else if (Flags_GetInfTable(0x22)) { + } else if (Flags_GetInfTable(INFTABLE_22)) { retTextId = 0x1009; } else { retTextId = 0x1008; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1075; } else { retTextId = 0x105B; @@ -4883,15 +4946,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 6: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1042; - } else if (Flags_GetInfTable(0x24)) { + } else if (Flags_GetInfTable(INFTABLE_24)) { retTextId = 0x100B; } else { retTextId = 0x100A; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1056; } else { retTextId = 0x105F; @@ -4900,15 +4963,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 7: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1043; - } else if (Flags_GetInfTable(0x26)) { + } else if (Flags_GetInfTable(INFTABLE_26)) { retTextId = 0x100D; } else { retTextId = 0x100C; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1057; } else { retTextId = 0x1057; @@ -4917,17 +4980,17 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 8: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1043; - } else if (Flags_GetInfTable(0x28)) { + } else if (Flags_GetInfTable(INFTABLE_28)) { retTextId = 0x1019; } else { retTextId = 0x100E; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1077; - } else if (Flags_GetInfTable(0x51)) { + } else if (Flags_GetInfTable(INFTABLE_51)) { retTextId = 0x1058; } else { retTextId = 0x1059; @@ -4936,13 +4999,13 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 9: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x1049; } else { retTextId = 0x1035; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1079; } else { retTextId = 0x104E; @@ -4951,15 +5014,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 10: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x104A; } else { retTextId = 0x1038; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1079; - } else if (Flags_GetInfTable(0x59)) { + } else if (Flags_GetInfTable(INFTABLE_59)) { retTextId = 0x1050; } else { retTextId = 0x104F; @@ -4968,13 +5031,13 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 11: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x104B; } else { retTextId = 0x103C; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x107B; } else { retTextId = 0x1051; @@ -4983,13 +5046,13 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 12: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x104C; } else { retTextId = 0x103D; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x107C; } else { retTextId = 0x1052; @@ -4998,15 +5061,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 13: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x9)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { retTextId = 0x104D; } else { retTextId = 0x103E; } } else { - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x106E; - } else if (Flags_GetInfTable(0x61)) { + } else if (Flags_GetInfTable(INFTABLE_61)) { retTextId = 0x1053; } else { retTextId = 0x1054; @@ -5014,9 +5077,9 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } break; case 15: - if (Flags_GetEventChkInf(0x5C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_5C)) { retTextId = 0x1078; - } else if (Flags_GetInfTable(0x66)) { + } else if (Flags_GetInfTable(INFTABLE_66)) { retTextId = 0x1066; } else { retTextId = 0x1062; @@ -5025,7 +5088,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { case 16: if (play->sceneNum == SCENE_SPOT15) { retTextId = 0x7002; - } else if (Flags_GetInfTable(0x6A)) { + } else if (Flags_GetInfTable(INFTABLE_6A)) { retTextId = 0x7004; } else if ((gSaveContext.dayTime >= 0x4000) && (gSaveContext.dayTime < 0xC556)) { retTextId = 0x7002; @@ -5034,8 +5097,8 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } break; case 17: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { - if (Flags_GetInfTable(0x6C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { + if (Flags_GetInfTable(INFTABLE_6C)) { retTextId = 0x7008; } else { retTextId = 0x7007; @@ -5048,11 +5111,11 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { retTextId = 0x702D; break; case 18: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7006; } else { - if (Flags_GetEventChkInf(0x12)) { - if (Flags_GetInfTable(0x71)) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG)) { + if (Flags_GetInfTable(INFTABLE_71)) { retTextId = 0x7072; } else { retTextId = 0x7071; @@ -5064,50 +5127,50 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 20: case 21: - if (Flags_GetEventChkInf(0x42)) { + if (Flags_GetEventChkInf(EVENTCHKINF_42)) { retTextId = 0x2012; - } else if (Flags_GetEventChkInf(0x41)) { - if (Flags_GetInfTable(0x76)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_41)) { + if (Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) { retTextId = 0x2011; } else { retTextId = 0x2010; } - } else if (Flags_GetEventChkInf(0x40)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { retTextId = 0x200F; } else { retTextId = 0x200E; } break; case 24: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7044; } else { retTextId = 0x7015; } break; case 25: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7045; } else { - Flags_GetInfTable(0xC2); + Flags_GetInfTable(INFTABLE_C2); retTextId = 0x7016; } break; case 26: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7046; } else { - Flags_GetInfTable(0xC2); + Flags_GetInfTable(INFTABLE_C2); retTextId = 0x7018; } break; case 27: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7047; - } else if (Flags_GetEventChkInf(0x14)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { retTextId = 0x701A; - } else if (Flags_GetEventChkInf(0x11)) { - if (Flags_GetInfTable(0xC6)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_INGO_AT_RANCH_BEFORE_TALON_RETURNS)) { + if (Flags_GetInfTable(INFTABLE_C6)) { retTextId = 0x701C; } else { retTextId = 0x701B; @@ -5117,59 +5180,59 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } break; case 28: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7048; } else { - Flags_GetInfTable(0xCA); + Flags_GetInfTable(INFTABLE_CA); retTextId = 0x701D; } break; case 29: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x7049; } else { - Flags_GetInfTable(0xCC); + Flags_GetInfTable(INFTABLE_CC); retTextId = 0x701F; } break; case 30: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x704A; } else { - Flags_GetInfTable(0xCE); + Flags_GetInfTable(INFTABLE_CE); retTextId = 0x7021; } break; case 31: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x704B; } else { - Flags_GetInfTable(0xD0); + Flags_GetInfTable(INFTABLE_D0); retTextId = 0x7023; } break; case 32: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x704C; } else { - Flags_GetInfTable(0xD2); + Flags_GetInfTable(INFTABLE_D2); retTextId = 0x7025; } break; case 33: - if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x704D; } else { - Flags_GetInfTable(0xD4); + Flags_GetInfTable(INFTABLE_D4); retTextId = 0x7027; } break; case 34: - Flags_GetInfTable(0xD6); + Flags_GetInfTable(INFTABLE_D6); retTextId = 0x403C; break; case 35: - if (Flags_GetInfTable(0xD8)) { + if (Flags_GetInfTable(INFTABLE_D8)) { retTextId = 0x5029; } else { retTextId = 0x5028; @@ -5180,17 +5243,17 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 38: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3027; - } else if (Flags_GetEventChkInf(0x23)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) { retTextId = 0x3021; - } else if (Flags_GetInfTable(0xE0)) { + } else if (Flags_GetInfTable(INFTABLE_E0)) { retTextId = 0x302A; } else { retTextId = 0x3008; } } else { - if (Flags_GetEventChkInf(0x20)) { + if (Flags_GetEventChkInf(EVENTCHKINF_20)) { retTextId = 0x4043; } else { retTextId = 0x302A; @@ -5199,15 +5262,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 39: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3027; - } else if (Flags_GetEventChkInf(0x23)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) { retTextId = 0x3026; } else { retTextId = 0x3009; } } else { - if (Flags_GetEventChkInf(0x2A)) { + if (Flags_GetEventChkInf(EVENTCHKINF_2A)) { retTextId = 0x4043; } else { retTextId = 0x302A; @@ -5216,17 +5279,17 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 40: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3027; - } else if (Flags_GetEventChkInf(0x23)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) { retTextId = 0x3026; - } else if (Flags_GetInfTable(0xEB)) { + } else if (Flags_GetInfTable(INFTABLE_EB)) { retTextId = 0x302B; } else { retTextId = 0x300A; } } else { - if (Flags_GetEventChkInf(0x2B)) { + if (Flags_GetEventChkInf(EVENTCHKINF_2B)) { retTextId = 0x4043; } else { retTextId = 0x302A; @@ -5235,15 +5298,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 41: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3027; - } else if (Flags_GetInfTable(0xF0)) { + } else if (Flags_GetInfTable(INFTABLE_F0)) { retTextId = 0x3015; } else { retTextId = 0x3014; } } else { - if (Flags_GetEventChkInf(0x2C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_2C)) { retTextId = 0x4043; } else { retTextId = 0x302A; @@ -5252,15 +5315,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 42: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3027; - } else if (Flags_GetInfTable(0xF4)) { + } else if (Flags_GetInfTable(INFTABLE_F4)) { retTextId = 0x3017; } else { retTextId = 0x3016; } } else { - if (Flags_GetEventChkInf(0x2C)) { + if (Flags_GetEventChkInf(EVENTCHKINF_2C)) { retTextId = 0x4043; } else { retTextId = 0x302A; @@ -5269,15 +5332,15 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 43: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3027; - } else if (Flags_GetInfTable(0xF8)) { + } else if (Flags_GetInfTable(INFTABLE_F8)) { retTextId = 0x3019; } else { retTextId = 0x3018; } } else { - if (Flags_GetEventChkInf(0x2D)) { + if (Flags_GetEventChkInf(EVENTCHKINF_2D)) { retTextId = 0x4043; } else { retTextId = 0x302A; @@ -5285,28 +5348,28 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } break; case 48: - if (Flags_GetEventChkInf(0x25)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { retTextId = 0x3029; - } else if (Flags_GetEventChkInf(0x20) && Flags_GetEventChkInf(0x21)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_20) && Flags_GetEventChkInf(EVENTCHKINF_21)) { retTextId = 0x301B; } else { retTextId = 0x301A; } break; case 49: - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402D; - } else if (Flags_GetEventChkInf(0x30)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { retTextId = 0x4007; } else { retTextId = 0x4006; } break; case 50: - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402E; - } else if (Flags_GetEventChkInf(0x30)) { - if (Flags_GetInfTable(0x124)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { + if (Flags_GetInfTable(INFTABLE_124)) { retTextId = 0x4009; } else { retTextId = 0x4008; @@ -5316,44 +5379,44 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { } break; case 51: - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402D; - } else if (Flags_GetEventChkInf(0x31)) { - if (Flags_GetInfTable(0x12A)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER)) { + if (Flags_GetInfTable(INFTABLE_12A)) { retTextId = 0x400B; } else { retTextId = 0x402F; } - } else if (Flags_GetEventChkInf(0x30)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { retTextId = 0x400A; } else { retTextId = 0x4006; } break; case 52: - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402E; - } else if (Flags_GetEventChkInf(0x30)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { retTextId = 0x400C; } else { retTextId = 0x4006; } break; case 53: - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402D; - } else if (Flags_GetEventChkInf(0x33)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { retTextId = 0x4010; - } else if (Flags_GetEventChkInf(0x30)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { retTextId = 0x400F; } else { retTextId = 0x4006; } break; case 54: - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402E; - } else if (Flags_GetEventChkInf(0x30)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { retTextId = 0x4011; } else { retTextId = 0x4006; @@ -5361,10 +5424,10 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 55: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x37)) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { retTextId = 0x402B; - } else if (Flags_GetEventChkInf(0x31)) { - if (Flags_GetInfTable(0x138)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER)) { + if (Flags_GetInfTable(INFTABLE_138)) { retTextId = 0x401C; } else { retTextId = 0x401B; @@ -5386,7 +5449,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { retTextId = 0x5012; break; case 61: - if (Flags_GetInfTable(0x166)) { + if (Flags_GetInfTable(INFTABLE_166)) { retTextId = 0x5001; } else { retTextId = 0x5000; @@ -5396,23 +5459,23 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { retTextId = 0x5012; break; case 63: - if (Flags_GetInfTable(0x16A)) { + if (Flags_GetInfTable(INFTABLE_16A)) { retTextId = 0x5001; } else { retTextId = 0x5000; } break; case 71: - if (Flags_GetEventChkInf(0x16)) { + if (Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON)) { retTextId = 0x2049; - } else if (Flags_GetEventChkInf(0x15)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH)) { retTextId = 0x2048; - } else if (Flags_GetEventChkInf(0x14)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { retTextId = 0x2047; - } else if (Flags_GetEventChkInf(0x12) && !Flags_GetEventChkInf(0x14)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG) && !Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { retTextId = 0x2044; - } else if (Flags_GetEventChkInf(0x10)) { - if (Flags_GetEventChkInf(0x11)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET)) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_INGO_AT_RANCH_BEFORE_TALON_RETURNS)) { retTextId = 0x2043; } else { retTextId = 0x2042; @@ -5423,18 +5486,18 @@ u32 func_80035BFC(PlayState* play, s16 arg1) { break; case 72: if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x14)) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { retTextId = 0x2040; - } else if (Flags_GetInfTable(0x94)) { + } else if (Flags_GetInfTable(INFTABLE_94)) { retTextId = 0x2040; } else { retTextId = 0x203F; } } else { - if (!Flags_GetEventChkInf(0x18)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { if (!IS_DAY) { retTextId = 0x204E; - } else if (Flags_GetInfTable(0x9A)) { + } else if (Flags_GetInfTable(INFTABLE_SPOKE_TO_INGO_ONCE_AS_ADULT)) { retTextId = 0x2031; } else { retTextId = 0x2030; @@ -5458,204 +5521,204 @@ void func_80036E50(u16 textId, s16 arg1) { case 0: switch (textId) { case 0x1001: - Flags_SetInfTable(0x0); + Flags_SetInfTable(INFTABLE_GREETED_BY_SARIA); return; case 0x1002: - Flags_SetInfTable(0x1); + Flags_SetInfTable(INFTABLE_01); return; case 0x1031: - Flags_SetEventChkInf(0x3); - Flags_SetInfTable(0x3); + Flags_SetEventChkInf(EVENTCHKINF_COMPLAINED_ABOUT_MIDO); + Flags_SetInfTable(INFTABLE_03); return; case 0x1047: - Flags_SetInfTable(0x5); + Flags_SetInfTable(INFTABLE_05); return; } return; case 1: switch (textId) { case 0x102F: - Flags_SetEventChkInf(0x2); - Flags_SetInfTable(0xC); + Flags_SetEventChkInf(EVENTCHKINF_FIRST_SPOKE_TO_MIDO); + Flags_SetInfTable(INFTABLE_0C); return; case 0x1033: Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - Flags_SetEventChkInf(0x4); - Flags_SetInfTable(0xE); + Flags_SetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD); + Flags_SetInfTable(INFTABLE_0E); return; case 0x1045: - Flags_SetInfTable(0x10); + Flags_SetInfTable(INFTABLE_10); return; case 0x1060: - Flags_SetInfTable(0x15); + Flags_SetInfTable(INFTABLE_15); return; case 0x1067: - Flags_SetEventChkInf(0xA); - Flags_SetInfTable(0x17); + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT); + Flags_SetInfTable(INFTABLE_17); return; case 0x1070: - Flags_SetInfTable(0x19); + Flags_SetInfTable(INFTABLE_19); return; } return; case 2: if (textId == 0x1056) { - Flags_SetInfTable(0x41); + Flags_SetInfTable(INFTABLE_41); } return; case 3: if (textId == 0x1005) { - Flags_SetInfTable(0x1E); + Flags_SetInfTable(INFTABLE_1E); } return; case 4: if (textId == 0x105D) { - Flags_SetInfTable(0x47); + Flags_SetInfTable(INFTABLE_47); } return; case 5: if (textId == 0x1008) { - Flags_SetInfTable(0x22); + Flags_SetInfTable(INFTABLE_22); } return; case 6: if (textId == 0x100A) { - Flags_SetInfTable(0x24); + Flags_SetInfTable(INFTABLE_24); } return; case 7: if (textId == 0x100C) { - Flags_SetInfTable(0x26); + Flags_SetInfTable(INFTABLE_26); } return; case 8: if (textId == 0x100E) { - Flags_SetInfTable(0x28); + Flags_SetInfTable(INFTABLE_28); } if (textId == 0x1059) { - Flags_SetInfTable(0x51); + Flags_SetInfTable(INFTABLE_51); } return; case 10: if (textId == 0x104F) { - Flags_SetInfTable(0x59); + Flags_SetInfTable(INFTABLE_59); } return; case 13: if (textId == 0x1054) { - Flags_SetInfTable(0x61); + Flags_SetInfTable(INFTABLE_61); } return; case 15: if (textId == 0x1062) { - Flags_SetInfTable(0x66); + Flags_SetInfTable(INFTABLE_66); } return; case 16: if (textId == 0x7002) { - Flags_SetInfTable(0x6A); + Flags_SetInfTable(INFTABLE_6A); } if (textId == 0x7003) { - Flags_SetInfTable(0x6A); + Flags_SetInfTable(INFTABLE_6A); } return; case 17: if (textId == 0x7007) { - Flags_SetInfTable(0x6C); + Flags_SetInfTable(INFTABLE_6C); } return; case 18: if (textId == 0x7071) { - Flags_SetInfTable(0x71); + Flags_SetInfTable(INFTABLE_71); } return; case 20: case 21: if (textId == 0x2010) { - Flags_SetInfTable(0x76); + Flags_SetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD); } return; case 25: if (textId == 0x7016) { - Flags_SetInfTable(0xC2); + Flags_SetInfTable(INFTABLE_C2); } return; case 26: if (textId == 0x7018) { - Flags_SetInfTable(0xC4); + Flags_SetInfTable(INFTABLE_C4); } return; case 28: if (textId == 0x701D) { - Flags_SetInfTable(0xCA); + Flags_SetInfTable(INFTABLE_CA); } return; case 29: if (textId == 0x701F) { - Flags_SetInfTable(0xCC); + Flags_SetInfTable(INFTABLE_CC); } return; case 30: if (textId == 0x7021) { - Flags_SetInfTable(0xCE); + Flags_SetInfTable(INFTABLE_CE); } return; case 31: if (textId == 0x7023) { - Flags_SetInfTable(0xD0); + Flags_SetInfTable(INFTABLE_D0); } return; case 32: if (textId == 0x7025) { - Flags_SetInfTable(0xD2); + Flags_SetInfTable(INFTABLE_D2); } return; case 33: if (textId == 0x7027) { - Flags_SetInfTable(0xD4); + Flags_SetInfTable(INFTABLE_D4); } return; case 34: if (textId == 0x403C) { - Flags_SetInfTable(0xD6); + Flags_SetInfTable(INFTABLE_D6); } return; case 35: if (textId == 0x5028) { - Flags_SetInfTable(0xD8); + Flags_SetInfTable(INFTABLE_D8); } return; case 38: if (textId == 0x3008) { - Flags_SetInfTable(0xE0); + Flags_SetInfTable(INFTABLE_E0); } return; case 40: if (textId == 0x300B) { - Flags_SetInfTable(0xEB); + Flags_SetInfTable(INFTABLE_EB); } return; case 41: if (textId == 0x3014) { - Flags_SetInfTable(0xF0); + Flags_SetInfTable(INFTABLE_F0); } return; case 42: if (textId == 0x3016) { - Flags_SetInfTable(0xF4); + Flags_SetInfTable(INFTABLE_F4); } return; case 43: if (textId == 0x3018) { - Flags_SetEventChkInf(0x20); - Flags_SetInfTable(0xF8); + Flags_SetEventChkInf(EVENTCHKINF_20); + Flags_SetInfTable(INFTABLE_F8); } return; case 48: if (textId == 0x3020) { - Flags_SetEventChkInf(0x22); - Flags_SetInfTable(0x113); + Flags_SetEventChkInf(EVENTCHKINF_22); + Flags_SetInfTable(INFTABLE_113); } return; case 49: @@ -5663,56 +5726,56 @@ void func_80036E50(u16 textId, s16 arg1) { case 53: case 54: if (textId == 0x4006) { - Flags_SetEventChkInf(0x30); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA); } return; case 50: if (textId == 0x4006) { - Flags_SetEventChkInf(0x30); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA); } if (textId == 0x4008) { - Flags_SetInfTable(0x124); + Flags_SetInfTable(INFTABLE_124); } return; case 51: if (textId == 0x4006) { - Flags_SetEventChkInf(0x30); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA); } if (textId == 0x400A) { - Flags_SetEventChkInf(0x32); + Flags_SetEventChkInf(EVENTCHKINF_32); } if (textId == 0x402F) { - Flags_SetInfTable(0x12A); + Flags_SetInfTable(INFTABLE_12A); } return; case 55: if (textId == 0x401B) { - Flags_SetEventChkInf(0x33); - Flags_SetInfTable(0x138); + Flags_SetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED); + Flags_SetInfTable(INFTABLE_138); } return; case 61: if (textId == 0x5000) { - Flags_SetInfTable(0x166); + Flags_SetInfTable(INFTABLE_166); } return; case 63: if (textId == 0x5013) { - Flags_SetInfTable(0x16A); + Flags_SetInfTable(INFTABLE_16A); } return; case 71: if (textId == 0x2041) { - Flags_SetEventChkInf(0x10); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET); } if (textId == 0x2044) { - Flags_SetEventChkInf(0x12); + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); } if (textId == 0x2047) { - Flags_SetEventChkInf(0x15); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH); } if (textId == 0x2048) { - Flags_SetEventChkInf(0x16); + Flags_SetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); } return; case 72: @@ -5727,14 +5790,14 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { switch (textId) { case 0x1035: if (msgCtx->choiceIndex == 0) { - if (Flags_GetInfTable(0x2A)) { + if (Flags_GetInfTable(INFTABLE_2A)) { func_80035B18(play, actor, 0x1036); } else { func_80035B18(play, actor, 0x1041); } } if (msgCtx->choiceIndex == 1) { - if (Flags_GetInfTable(0x2B)) { + if (Flags_GetInfTable(INFTABLE_2B)) { func_80035B18(play, actor, 0x1037); } else { func_80035B18(play, actor, 0x1041); @@ -5744,21 +5807,21 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { break; case 0x1038: if (msgCtx->choiceIndex == 0) { - if (Flags_GetInfTable(0x2E)) { + if (Flags_GetInfTable(INFTABLE_2E)) { func_80035B18(play, actor, 0x1039); } else { func_80035B18(play, actor, 0x1041); } } if (msgCtx->choiceIndex == 1) { - if (Flags_GetInfTable(0x2F)) { + if (Flags_GetInfTable(INFTABLE_2F)) { func_80035B18(play, actor, 0x103A); } else { func_80035B18(play, actor, 0x1041); } } if (msgCtx->choiceIndex == 2) { - if (Flags_GetInfTable(0x30)) { + if (Flags_GetInfTable(INFTABLE_30)) { func_80035B18(play, actor, 0x103B); } else { func_80035B18(play, actor, 0x1041); @@ -5779,25 +5842,25 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { if (msgCtx->choiceTextId == 0x1035) { if (msgCtx->choiceIndex == 0) { func_80035B18(play, actor, 0x1036); - Flags_SetInfTable(0x2A); + Flags_SetInfTable(INFTABLE_2A); } if (msgCtx->choiceIndex == 1) { func_80035B18(play, actor, 0x1037); - Flags_SetInfTable(0x2B); + Flags_SetInfTable(INFTABLE_2B); } } if (msgCtx->choiceTextId == 0x1038) { if (msgCtx->choiceIndex == 0) { func_80035B18(play, actor, 0x1039); - Flags_SetInfTable(0x2E); + Flags_SetInfTable(INFTABLE_2E); } if (msgCtx->choiceIndex == 1) { func_80035B18(play, actor, 0x103A); - Flags_SetInfTable(0x2F); + Flags_SetInfTable(INFTABLE_2F); } if (msgCtx->choiceIndex == 2) { func_80035B18(play, actor, 0x103B); - Flags_SetInfTable(0x30); + Flags_SetInfTable(INFTABLE_30); } } ret = 0; @@ -5824,7 +5887,7 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { if (msgCtx->choiceIndex == 1) { func_80035B18(play, actor, 0x2032); } - Flags_SetInfTable(0x9A); + Flags_SetInfTable(INFTABLE_SPOKE_TO_INGO_ONCE_AS_ADULT); ret = 0; break; case 0x2036: @@ -5854,7 +5917,7 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { ret = 0; break; case 0x2043: - if (Flags_GetEventChkInf(0x12)) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG)) { break; } func_80035B18(play, actor, 0x2044); @@ -5864,7 +5927,7 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { break; case 0x300A: if (msgCtx->choiceIndex == 0) { - if (Flags_GetEventChkInf(0x22)) { + if (Flags_GetEventChkInf(EVENTCHKINF_22)) { func_80035B18(play, actor, 0x300B); } else { func_80035B18(play, actor, 0x300C); @@ -5880,7 +5943,7 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) { func_80035B18(play, actor, 0x301D); } if (msgCtx->choiceIndex == 1) { - if (Flags_GetInfTable(0x113)) { + if (Flags_GetInfTable(INFTABLE_113)) { func_80035B18(play, actor, 0x301F); } else { func_80035B18(play, actor, 0x301E); diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index a00d018d6..cee86e165 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -340,13 +340,13 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { } break; case 19: - gSaveContext.eventChkInf[6] |= 0x0020; + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL); break; case 20: - gSaveContext.eventChkInf[6] |= 0x0080; + Flags_SetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO); break; case 21: - gSaveContext.eventChkInf[6] |= 0x0200; + Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); break; case 22: D_801614B0.r = 255; @@ -624,8 +624,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB gSaveContext.fw.set = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; } - if (!(gSaveContext.eventChkInf[4] & 0x20)) { - gSaveContext.eventChkInf[4] |= 0x20; + if (!Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) { + Flags_SetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL); play->nextEntranceIndex = 0x00A0; play->sceneLoadFlag = 0x14; gSaveContext.cutsceneIndex = 0xFFF3; @@ -697,7 +697,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->fadeTransition = 3; break; case 18: - gSaveContext.eventChkInf[4] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER); play->nextEntranceIndex = 0x0324; play->sceneLoadFlag = 0x14; play->fadeTransition = 2; @@ -842,14 +842,14 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->fadeTransition = 17; break; case 46: - gSaveContext.eventChkInf[4] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER); play->nextEntranceIndex = 0x0324; play->sceneLoadFlag = 0x14; play->fadeTransition = 4; break; case 47: Item_Give(play, ITEM_SONG_NOCTURNE); - gSaveContext.eventChkInf[5] |= 0x10; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW); play->nextEntranceIndex = 0x00DB; play->sceneLoadFlag = 0x14; gSaveContext.cutsceneIndex = 0xFFF1; @@ -1077,8 +1077,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->fadeTransition = 3; break; case 95: - if ((gSaveContext.eventChkInf[4] & 0x100) && (gSaveContext.eventChkInf[4] & 0x200) && - (gSaveContext.eventChkInf[4] & 0x400)) { + if ((Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) && + (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP))) { play->nextEntranceIndex = 0x0053; play->sceneLoadFlag = 0x14; gSaveContext.cutsceneIndex = 0xFFF3; @@ -1111,7 +1111,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB gSaveContext.cutsceneIndex = 0xFFF1; play->fadeTransition = 5; } else { - gSaveContext.eventChkInf[12] |= 0x100; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION); play->nextEntranceIndex = 0x0610; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; @@ -1233,8 +1233,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->fadeTransition = 2; break; case 113: - if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) && - Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FOREST_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_WATER_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SHADOW_TRIAL) && + Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FIRE_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_LIGHT_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SPIRIT_TRIAL)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTowerBarrierCs); play->csCtx.frames = 0; gSaveContext.cutsceneTrigger = 1; @@ -1257,7 +1257,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB gSaveContext.nextTransitionType = 2; break; case 116: - if (gSaveContext.eventChkInf[12] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION)) { play->nextEntranceIndex = 0x0580; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; @@ -2152,39 +2152,39 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) { const bool bShouldTowerRandoSkip = (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE)); - if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) { + if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) { if (!gSaveContext.n64ddFlag) { - Flags_SetEventChkInf(0xAC); + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT); gSaveContext.entranceIndex = 0x0123; gSaveContext.cutsceneIndex = 0xFFF0; } - } else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x0100) && - (gSaveContext.eventChkInf[4] & 0x0200) && (gSaveContext.eventChkInf[4] & 0x0400) && - !Flags_GetEventChkInf(0xAA)) { + } else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && + (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) && + !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) { if (!gSaveContext.n64ddFlag) { - Flags_SetEventChkInf(0xAA); + Flags_SetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL); gSaveContext.cutsceneIndex = 0xFFF0; } - } else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(0xC1)) { + } else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE)) { if (!gSaveContext.n64ddFlag) { - Flags_SetEventChkInf(0xC1); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE); Item_Give(play, ITEM_OCARINA_FAIRY); gSaveContext.entranceIndex = 0x011E; gSaveContext.cutsceneIndex = 0xFFF0; } } else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && - LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) && + LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) { if (!gSaveContext.n64ddFlag) { - Flags_SetEventChkInf(0xC4); + Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS); gSaveContext.entranceIndex = 0x0053; gSaveContext.cutsceneIndex = 0xFFF8; } - } else if ((!Flags_GetEventChkInf(0xC7) && + } else if ((!Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO) && gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO) || (bShouldTowerRandoSkip && gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_FINAL)) { - Flags_SetEventChkInf(0xC7); + Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO); gSaveContext.entranceIndex = 0x0517; // In rando, skip the cutscene for the tower falling down after the escape. if (gSaveContext.n64ddFlag) { diff --git a/soh/src/code/z_horse.c b/soh/src/code/z_horse.c index 9b5caf8b5..2c51ff296 100644 --- a/soh/src/code/z_horse.c +++ b/soh/src/code/z_horse.c @@ -47,7 +47,7 @@ void func_8006D0EC(PlayState* play, Player* player) { { SCENE_SPOT20, 928, 0, -2280, 0, 2 }, }; - if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) { + if ((AREG(6) != 0) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0))) { player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, player->actor.world.pos.x, player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x, player->actor.shape.rot.y, player->actor.shape.rot.z, 9, true); @@ -67,16 +67,16 @@ void func_8006D0EC(PlayState* play, Player* player) { horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1, true); horseActor->room = -1; - } else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) { + } else if ((gSaveContext.entranceIndex == 1230) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) { Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1, true); ASSERT(horseActor != NULL); } else if ((play->sceneNum == gSaveContext.horseData.scene) && - (((Flags_GetEventChkInf(0x18) != 0) && (!gSaveContext.n64ddFlag || + (((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE)))) || DREG(1) != 0)) { // "Set by existence of horse %d %d %d" - osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18), + osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), DREG(1)); if (func_8006CFC0(gSaveContext.horseData.scene)) { @@ -94,11 +94,11 @@ void func_8006D0EC(PlayState* play, Player* player) { osSyncPrintf(VT_RST); func_8006D074(play); } - } else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) { + } else if ((play->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) { Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1, true); ASSERT(horseActor != NULL); - } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) { for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) { HorseSpawn* horseSpawn = &horseSpawns[i]; if (horseSpawn->scene == play->sceneNum) { @@ -113,7 +113,7 @@ void func_8006D0EC(PlayState* play, Player* player) { break; } } - } else if (!Flags_GetEventChkInf(0x18)) { + } else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { if ((DREG(1) == 0) && (play->sceneNum == SCENE_SOUKO) && !IS_DAY) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1, true); } @@ -161,7 +161,7 @@ void func_8006D684(PlayState* play, Player* player) { func_8002DE74(play, player); gSaveContext.horseData.scene = play->sceneNum; } else if ((play->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) && - (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) { + (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) == 0) && (DREG(1) == 0)) { player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5, true); ASSERT(player->rideActor != NULL); @@ -252,7 +252,7 @@ void func_8006DC68(PlayState* play, Player* player) { gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) && (gSaveContext.respawnFlag == 0)) || ((play->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) && - !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) { + !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) { func_8006D684(play, player); } else { func_8006D0EC(play, player); diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 488d5507b..70fcc3552 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -2542,19 +2542,19 @@ void Environment_WarpSongLeave(PlayState* play) { switch (play->nextEntranceIndex) { case 0x147: - Flags_SetEventChkInf(0xB9); + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DEATH_MOUNTAIN_CRATER); break; case 0x0102: - Flags_SetEventChkInf(0xB1); + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_LAKE_HYLIA); break; case 0x0123: - Flags_SetEventChkInf(0xB8); + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DESERT_COLOSSUS); break; case 0x00E4: - Flags_SetEventChkInf(0xB6); + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_GRAVEYARD); break; case 0x0053: - Flags_SetEventChkInf(0xA7); + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_TEMPLE_OF_TIME); break; case 0x00FC: break; diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 3a758d92a..7d619676b 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -398,11 +398,11 @@ void Map_InitData(PlayState* play, s16 room) { extendedMapIndex = 0x15; } } else if (play->sceneNum == SCENE_SPOT09) { - if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) { + if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { extendedMapIndex = 0x16; } } else if (play->sceneNum == SCENE_SPOT12) { - if ((!gSaveContext.n64ddFlag && ((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) || + if ((!gSaveContext.n64ddFlag && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) || (gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) { extendedMapIndex = 0x17; } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index a13c36f4c..cf8759a23 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1616,7 +1616,7 @@ void Message_OpenText(PlayState* play, u16 textId) { textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> 0x1C; } else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_SWORD, 2))) { textId = 0xB; // Traded Giant's Knife for Biggoron Sword - } else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (gSaveContext.eventChkInf[9] & 0x40))) { + } else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE)))) { textId = 0xB5; // Destroyed Gold Skulltula } // Ocarina Staff + Dialog diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 43be8b854..6ea4874f3 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1417,7 +1417,7 @@ void Inventory_SwapAgeEquipment(void) { // When becoming adult, remove swordless flag since we'll get master sword // Only in rando to keep swordless link bugs in vanilla if (gSaveContext.n64ddFlag) { - gSaveContext.infTable[29] &= ~1; + Flags_UnsetInfTable(INFTABLE_SWORDLESS); } gSaveContext.childEquips.equipment = gSaveContext.equips.equipment; @@ -1471,13 +1471,13 @@ void Inventory_SwapAgeEquipment(void) { // When becoming child, set swordless flag if player doesn't have kokiri sword // Only in rando to keep swordless link bugs in vanilla if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) { - gSaveContext.infTable[29] |= 1; + Flags_SetInfTable(INFTABLE_SWORDLESS); } // When using enhancements, set swordless flag if player doesn't have kokiri sword or hasn't equipped a sword yet. // Then set the child equips button items to item none to ensure kokiri sword is not equipped - if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && ((1 << 0 & gSaveContext.inventory.equipment) == 0 || gSaveContext.infTable[29] & 1)) { - gSaveContext.infTable[29] |= 1; + if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && ((1 << 0 & gSaveContext.inventory.equipment) == 0 || Flags_GetInfTable(INFTABLE_SWORDLESS))) { + Flags_SetInfTable(INFTABLE_SWORDLESS); gSaveContext.childEquips.buttonItems[0] = ITEM_NONE; } @@ -1512,7 +1512,7 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.equipment = gSaveContext.childEquips.equipment; gSaveContext.equips.equipment &= 0xFFF0; // Equips kokiri sword in the inventory screen only if kokiri sword exists in inventory and a sword has been equipped already - if (!((1 << 0 & gSaveContext.inventory.equipment) == 0) && !(gSaveContext.infTable[29] & 1)) { + if (!((1 << 0 & gSaveContext.inventory.equipment) == 0) && !Flags_GetInfTable(INFTABLE_SWORDLESS)) { gSaveContext.equips.equipment |= 0x0001; } } else if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE) { @@ -1543,7 +1543,7 @@ void Inventory_SwapAgeEquipment(void) { When becoming child, set swordless flag if player doesn't have kokiri sword Only in rando to keep swordless link bugs in vanilla*/ if (1 << 0 & gSaveContext.inventory.equipment == 0) { - gSaveContext.infTable[29] |= 1; + Flags_SetInfTable(INFTABLE_SWORDLESS); } //zero out items @@ -1558,7 +1558,7 @@ void Inventory_SwapAgeEquipment(void) { if ((CVarGetInteger("gSwitchAge", 0) || CVarGetInteger("gSwitchTimeline", 0)) && (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { - gSaveContext.infTable[29] |= 1; + Flags_SetInfTable(INFTABLE_SWORDLESS); if (gSaveContext.childEquips.equipment == 0) { // force equip kokiri tunic and boots in scenario gSaveContext.childEquips.equipment is uninitialized gSaveContext.equips.equipment &= 0xFFF0; @@ -2155,8 +2155,8 @@ u8 Item_Give(PlayState* play, u8 item) { AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); } - if (!(gSaveContext.itemGetInf[1] & 8)) { - gSaveContext.itemGetInf[1] |= 8; + if (!Flags_GetItemGetInf(ITEMGETINF_13)) { + Flags_SetItemGetInf(ITEMGETINF_13); return Return_Item(item, MOD_NONE, ITEM_NONE); } @@ -2168,8 +2168,8 @@ u8 Item_Give(PlayState* play, u8 item) { AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); } - if (!(gSaveContext.itemGetInf[1] & 8)) { - gSaveContext.itemGetInf[1] |= 8; + if (!Flags_GetItemGetInf(ITEMGETINF_13)) { + Flags_SetItemGetInf(ITEMGETINF_13); return Return_Item(item, MOD_NONE, ITEM_NONE); } @@ -2245,8 +2245,8 @@ u8 Item_Give(PlayState* play, u8 item) { func_80087708(play, 12, 5); } - if (!(gSaveContext.infTable[25] & 0x100)) { - gSaveContext.infTable[25] |= 0x100; + if (!Flags_GetInfTable(INFTABLE_198)) { + Flags_SetInfTable(INFTABLE_198); return Return_Item(item, MOD_NONE, ITEM_NONE); } @@ -2261,8 +2261,8 @@ u8 Item_Give(PlayState* play, u8 item) { func_80087708(play, 24, 5); } - if (!(gSaveContext.infTable[25] & 0x100)) { - gSaveContext.infTable[25] |= 0x100; + if (!Flags_GetInfTable(INFTABLE_198)) { + Flags_SetInfTable(INFTABLE_198); return Return_Item(item, MOD_NONE, ITEM_NONE); } @@ -2321,7 +2321,7 @@ u8 Item_Give(PlayState* play, u8 item) { return Return_Item(item, MOD_NONE, ITEM_NONE); } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { if ((item == ITEM_SAW) && CVarGetInteger("gDekuNutUpgradeFix", 0) == 0) { - gSaveContext.itemGetInf[1] |= 0x8000; + Flags_SetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE); } if (item >= ITEM_POCKET_EGG) { @@ -2670,7 +2670,7 @@ u8 Item_CheckObtainability(u8 item) { } else if (item == ITEM_LONGSHOT) { return ITEM_NONE; } else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) { - if (!(gSaveContext.itemGetInf[1] & 0x8)) { + if (!Flags_GetItemGetInf(ITEMGETINF_13)) { return ITEM_NONE; } else { return ITEM_SEEDS; @@ -2685,8 +2685,8 @@ u8 Item_CheckObtainability(u8 item) { return ITEM_HEART; } else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) { // "Magic Pot Get_Inf_Table( 25, 0x0100)=%d" - osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.infTable[25] & 0x100); - if (!(gSaveContext.infTable[25] & 0x100)) { + osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", Flags_GetInfTable(INFTABLE_198)); + if (!Flags_GetInfTable(INFTABLE_198)) { return ITEM_NONE; } else { return item; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 935b8b690..4cece3fa7 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -234,7 +234,7 @@ void GivePlayerRandoRewardNocturne(PlayState* play, RandomizerCheck check) { gSaveContext.entranceIndex == 0x0191 || gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL && - !Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(0xAA)) { + !Player_InBlockingCsMode(play, player) && !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_NOCTURNE_OF_SHADOW); GiveItemEntryWithoutActor(play, getItemEntry); player->pendingFlag.flagID = 0xAA; @@ -246,7 +246,7 @@ void GivePlayerRandoRewardRequiem(PlayState* play, RandomizerCheck check) { Player* player = GET_PLAYER(play); if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) { - if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL && + if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT) && player != NULL && !Player_InBlockingCsMode(play, player)) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME); GiveItemEntryWithoutActor(play, getItemEntry); @@ -433,7 +433,7 @@ void GivePlayerRandoRewardSariaGift(PlayState* play, RandomizerCheck check) { if (gSaveContext.entranceIndex == 0x05E0) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_ZELDAS_LULLABY); - if (!Flags_GetEventChkInf(0xC1) && player != NULL && !Player_InBlockingCsMode(play, player)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE) && player != NULL && !Player_InBlockingCsMode(play, player)) { GiveItemEntryWithoutActor(play, getItemEntry); player->pendingFlag.flagType = FLAG_EVENT_CHECK_INF; player->pendingFlag.flagID = 0xC1; @@ -462,7 +462,7 @@ void Play_Init(GameState* thisx) { // entranceIndex 0x7A, Castle Courtyard - Day from crawlspace // entranceIndex 0x400, Zelda's Courtyard if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) && - !(gSaveContext.eventChkInf[4] & 1) && !(gSaveContext.eventChkInf[5] & 0x200)) { + !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)) { if (gSaveContext.entranceIndex == 0x7A) { gSaveContext.entranceIndex = 0x400; } @@ -560,7 +560,7 @@ void Play_Init(GameState* thisx) { } } else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT04) && LINK_IS_ADULT && gSaveContext.sceneSetupIndex < 4) { - gSaveContext.sceneSetupIndex = (gSaveContext.eventChkInf[4] & 0x100) ? 3 : 2; + gSaveContext.sceneSetupIndex = (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) ? 3 : 2; } Play_SpawnScene( diff --git a/soh/src/code/z_scene_table.c b/soh/src/code/z_scene_table.c index 5213e3190..c123c9523 100644 --- a/soh/src/code/z_scene_table.c +++ b/soh/src/code/z_scene_table.c @@ -2030,7 +2030,7 @@ void func_8009E0B8(PlayState* play) { spA3 = 255 - (u8)play->roomCtx.unk_74[0]; } else if (gSaveContext.sceneSetupIndex == 6) { spA0 = play->roomCtx.unk_74[0] + 500; - } else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (gSaveContext.eventChkInf[0] & 0x80)) { + } else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD))) { spA0 = 2150; } @@ -2058,7 +2058,7 @@ void func_8009E54C(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !(gSaveContext.eventChkInf[6] & 0x200))) { + if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER))) { play->roomCtx.unk_74[0] = 87; } diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index ce5651539..b531bb05d 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -153,7 +153,7 @@ void Sram_OpenSave() { } // if zelda cutscene has been watched but lullaby was not obtained, restore cutscene and take away letter - if ((gSaveContext.eventChkInf[4] & 1) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) { + if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) { i = gSaveContext.eventChkInf[4] & ~1; gSaveContext.eventChkInf[4] = i; diff --git a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 959d836fb..489a50cfa 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -80,7 +80,7 @@ s32 BgBdanObjects_GetContactRu1(BgBdanObjects* this, s32 arg1) { case 0: return this->cameraSetting == CAM_SET_NORMAL0; case 4: - return gSaveContext.infTable[20] & 0x40; + return Flags_GetInfTable(INFTABLE_146); case 3: return this->cameraSetting == CAM_SET_DUNGEON1; default: @@ -98,7 +98,7 @@ void BgBdanObjects_SetContactRu1(BgBdanObjects* this, s32 arg1) { this->cameraSetting = CAM_SET_DUNGEON0; break; case 4: - gSaveContext.infTable[20] |= 0x40; + Flags_SetInfTable(INFTABLE_146); break; default: osSyncPrintf("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n"); diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 4a0a97711..925a66ba2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -298,8 +298,8 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); } - if ((wallType == BWALL_DC_ENTRANCE) && (!(Flags_GetEventChkInf(0xB0)))) { - Flags_SetEventChkInf(0xB0); + if ((wallType == BWALL_DC_ENTRANCE) && (!Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN))) { + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN); Cutscene_SetSegment(play, gDcOpeningCs); gSaveContext.cutsceneTrigger = 1; Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); diff --git a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 3722a15de..d9408a83c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -181,7 +181,7 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { sBgDodoagoFirstExplosiveFlag = true; sBgDodoagoTimer = 50; } - } else if (Flags_GetEventChkInf(0xB0)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN)) { Collider_UpdateCylinder(&this->dyna.actor, &this->colliderMain); Collider_UpdateCylinder(&this->dyna.actor, &this->colliderLeft); Collider_UpdateCylinder(&this->dyna.actor, &this->colliderRight); @@ -311,7 +311,7 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) { void BgDodoago_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - if (Flags_GetEventChkInf(0xB0)) { + if (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN)) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index b1f13dadb..aeee629fd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -237,17 +237,17 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { if (play->sceneNum != SCENE_DAIYOUSEI_IZUMI) { switch (this->fountainType) { case FAIRY_SPELL_FARORES_WIND: - if (!(gSaveContext.itemGetInf[1] & 0x100)) { + if (!Flags_GetItemGetInf(ITEMGETINF_18)) { givingReward = true; } break; case FAIRY_SPELL_DINS_FIRE: - if (!(gSaveContext.itemGetInf[1] & 0x200)) { + if (!Flags_GetItemGetInf(ITEMGETINF_19)) { givingReward = true; } break; case FAIRY_SPELL_NAYRUS_LOVE: - if (!(gSaveContext.itemGetInf[1] & 0x400)) { + if (!Flags_GetItemGetInf(ITEMGETINF_1A)) { givingReward = true; } break; diff --git a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 8e722c063..262722f67 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -44,8 +44,8 @@ void BgGateShutter_Init(Actor* thisx, PlayState* play) { this->somePos.x = thisx->world.pos.x; this->somePos.y = thisx->world.pos.y; this->somePos.z = thisx->world.pos.z; - if (((gSaveContext.infTable[7] & 0x40) || - (!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[4] & 0x20)) || + if (((Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) || + (!gSaveContext.n64ddFlag && (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL))) || (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_KAK_GATE) == RO_KAK_GATE_OPEN))) && (play->sceneNum == SCENE_SPOT01)) { thisx->world.pos.x = -89.0f; @@ -66,7 +66,7 @@ void BgGateShutter_Destroy(Actor* thisx, PlayState* play) { } void func_8087828C(BgGateShutter* this, PlayState* play) { - if (this->openingState == 1 && !(gSaveContext.infTable[7] & 0x40)) { + if (this->openingState == 1 && !Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) { this->unk_178 = 2; this->actionFunc = func_80878300; } else if (this->openingState == 2) { diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 1865b6a30..b79020309 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -51,7 +51,7 @@ void BgGjyoBridge_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE); - if (gSaveContext.eventChkInf[4] & 0x2000 || (gSaveContext.n64ddFlag && bridge == RO_BRIDGE_ALWAYS_OPEN)) { + if (Flags_GetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT) || (gSaveContext.n64ddFlag && bridge == RO_BRIDGE_ALWAYS_OPEN)) { this->actionFunc = func_808787A4; } else { this->dyna.actor.draw = NULL; @@ -150,7 +150,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, PlayState* play) { (play->csCtx.npcActions[2]->action == 2)) { this->dyna.actor.draw = BgGjyoBridge_Draw; func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId); - gSaveContext.eventChkInf[4] |= 0x2000; + Flags_SetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 7fcd3d7ac..c29c488e3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -46,7 +46,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if ((play->sceneNum != SCENE_SPOT20 || !LINK_IS_ADULT) || - (((gSaveContext.eventChkInf[1] & 0x100)) && (gSaveContext.cutsceneIndex != 0xFFF0))) { + (((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) && (gSaveContext.cutsceneIndex != 0xFFF0))) { Actor_Kill(&this->dyna.actor); return; } diff --git a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index ced3fba1b..4f9207abe 100644 --- a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -57,7 +57,7 @@ void BgRelayObjects_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 3); if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&gWindmillRotatingPlatformCol, &colHeader); - if (gSaveContext.eventChkInf[6] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL)) { thisx->world.rot.y = 0x400; } else { thisx->world.rot.y = 0x80; @@ -111,7 +111,7 @@ void BgRelayObjects_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); if ((this->dyna.actor.params == WINDMILL_ROTATING_GEAR) && (gSaveContext.cutsceneIndex < 0xFFF0)) { - gSaveContext.eventChkInf[6] &= ~0x20; + Flags_UnsetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL); } } @@ -182,9 +182,9 @@ void func_808A932C(BgRelayObjects* this, PlayState* play) { void func_808A939C(BgRelayObjects* this, PlayState* play) { if (Flags_GetEnv(play, 5)) { - gSaveContext.eventChkInf[6] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL); } - if (gSaveContext.eventChkInf[6] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL)) { Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x400, 8); } else { Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x80, 8); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index d57696955..04e42fed3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -82,7 +82,7 @@ void BgSpot00Hanebasi_Init(Actor* thisx, PlayState* play) { if (gSaveContext.sceneSetupIndex != 6) { // Don't close the bridge in rando to accomodate hyrule castle exit if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && - CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1) && !(gSaveContext.n64ddFlag)) { + CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) && !(gSaveContext.n64ddFlag)) { this->dyna.actor.shape.rot.x = -0x4000; } } @@ -143,7 +143,7 @@ void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, PlayState* play) { if ((gSaveContext.sceneSetupIndex >= 4) || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || !CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) || - (gSaveContext.eventChkInf[8] & 1)) { + (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE))) { if (this->dyna.actor.shape.rot.x != 0) { if (Flags_GetEnv(play, 0) || ((gSaveContext.sceneSetupIndex < 4) && IS_DAY)) { this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall; @@ -214,14 +214,14 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { if (this->dyna.actor.params == DT_DRAWBRIDGE) { if (play->sceneNum == SCENE_SPOT00) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && - CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1) && LINK_IS_CHILD) { + CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) && LINK_IS_CHILD) { Player* player = GET_PLAYER(play); if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) && (player->actor.world.pos.z > 1080.0f) && (player->actor.world.pos.z < 1700.0f) && (!(Play_InCsMode(play)))) { - gSaveContext.eventChkInf[8] |= 1; - Flags_SetEventChkInf(0x82); + Flags_SetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE); + Flags_SetEventChkInf(EVENTCHKINF_DRAWBRIDGE_OPENED_AFTER_ZELDA_FLED); this->actionFunc = BgSpot00Hanebasi_DoNothing; func_8002DF54(play, &player->actor, 8); play->nextEntranceIndex = 0x00CD; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index 0d75d9ab3..a697bd666 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -66,7 +66,7 @@ void func_808AAA50(BgSpot01Fusya* this, PlayState* play) { this->unk_158 = 100.0f; } - if (gSaveContext.eventChkInf[6] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL)) { this->unk_158 = 1800.0f; } thisx->shape.rot.z += this->unk_154; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 1dd024c65..e8ecc6d91 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -303,7 +303,7 @@ void BgSpot01Idohashira_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (gSaveContext.sceneSetupIndex < 4) { - if ((gSaveContext.eventChkInf[5] & 0x10) && LINK_IS_ADULT) { + if ((Flags_GetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW)) && LINK_IS_ADULT) { Actor_Kill(&this->dyna.actor); } else { this->action = 0; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index be27b893c..5f035763e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -37,7 +37,7 @@ void BgSpot01Idomizu_Init(Actor* thisx, PlayState* play) { BgSpot01Idomizu* this = (BgSpot01Idomizu*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); - if (gSaveContext.eventChkInf[6] & 0x80 || LINK_AGE_IN_YEARS == YEARS_ADULT) { + if (Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO) || LINK_AGE_IN_YEARS == YEARS_ADULT) { this->waterHeight = -550.0f; } else { this->waterHeight = 52.0f; @@ -50,7 +50,7 @@ void BgSpot01Idomizu_Destroy(Actor* thisx, PlayState* play) { } void func_808ABB84(BgSpot01Idomizu* this, PlayState* play) { - if (gSaveContext.eventChkInf[6] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO)) { this->waterHeight = -550.0f; } play->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 695c7f857..f08878ec2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -51,7 +51,7 @@ void BgSpot01Idosoko_Init(Actor* thisx, PlayState* play) { // child Link has drained the water to the well if (!LINK_IS_ADULT || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF && - Flags_GetEventChkInf(0x67))) { + Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO))) { Actor_Kill(&this->dyna.actor); } else { BgSpot01Idosoko_SetupAction(this, func_808ABF54); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index df662a063..61c9d6c7d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -88,7 +88,7 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - if (((gSaveContext.eventChkInf[1] & 0x2000) && (play->sceneNum == SCENE_SPOT02) && + if (((Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) && (play->sceneNum == SCENE_SPOT02) && (thisx->params == 2)) || (LINK_IS_ADULT && (thisx->params == 1))) { Actor_Kill(thisx); @@ -101,7 +101,7 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_808ACC34; thisx->draw = func_808ACCB8; - if (gSaveContext.eventChkInf[1] & 0x2000) { + if (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { Actor_Kill(thisx); } break; @@ -131,7 +131,7 @@ void func_808AC908(BgSpot02Objects* this, PlayState* play) { // We want to do most of the same things in rando, but we're not in a cutscene and the flag for // destroying the royal tombstone is already set. - if (gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0x2000) { + if (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION); this->timer = 25; pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x; @@ -144,7 +144,7 @@ void func_808AC908(BgSpot02Objects* this, PlayState* play) { if (play->csCtx.state != 0) { if (play->csCtx.npcActions[3] != NULL && play->csCtx.npcActions[3]->action == 2) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION); - gSaveContext.eventChkInf[1] |= 0x2000; + Flags_SetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB); this->timer = 25; pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x; pos.y = this->dyna.actor.world.pos.y + 30.0f; @@ -220,7 +220,7 @@ void func_808ACC34(BgSpot02Objects* this, PlayState* play) { // This is the actionFunc that the game settles on when you load the Graveyard // When we're in rando and the flag for the gravestone being destroyed gets set, // set the actionFunc to the function where the gravestone explodes. - if (gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0X2000) { + if (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { this->actionFunc = func_808AC908; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index e94166558..eb96e3614 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -128,7 +128,7 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->colliderItem); if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) { - if (!(gSaveContext.eventChkInf[6] & 0x200)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER)) { thisx->home.pos.y = thisx->world.pos.y = WATER_LEVEL_LOWERED; } else { thisx->home.pos.y = thisx->world.pos.y = WATER_LEVEL_RAISED; @@ -154,7 +154,7 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChainWaterPlane); thisx->flags = ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED; - if (LINK_IS_ADULT && !(Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER))) { + if (LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER)) { if (gSaveContext.sceneSetupIndex < 4) { this->lakeHyliaWaterLevel = -681.0f; play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface = @@ -623,7 +623,7 @@ void BgSpot06Objects_WaterPlaneCutsceneLower(BgSpot06Objects* this, PlayState* p this->dyna.actor.world.pos.y = (this->lakeHyliaWaterLevel + 680.0f) + WATER_LEVEL_RAISED; } - gSaveContext.eventChkInf[6] &= ~0x200; // Unset the "raised lake hylia water" flag + Flags_UnsetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); // Unset the "raised lake hylia water" flag play->roomCtx.unk_74[0] = 87; // Remove the moving under water texture from lake hylia ground if (this->lakeHyliaWaterLevel <= -681.0f) { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 943c50d7b..28f98b4f1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -64,7 +64,7 @@ s32 func_808B1AE0(BgSpot09Obj* this, PlayState* play) { return this->dyna.actor.params == 0; } - carpentersRescued = (gSaveContext.eventChkInf[9] & 0xF) == 0xF; + carpentersRescued = GET_EVENTCHKINF_CARPENTERS_FREE_ALL(); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { switch (this->dyna.actor.params) { @@ -139,7 +139,7 @@ void BgSpot09Obj_Init(Actor* thisx, PlayState* play) { BgSpot09Obj* this = (BgSpot09Obj*)thisx; osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params, - gSaveContext.eventChkInf[9] & 0xF); + GET_EVENTCHKINF_CARPENTERS_FREE_ALL()); this->dyna.actor.params &= 0xFF; if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) { osSyncPrintf("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 66b37d5c3..bbb66bd1b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -110,7 +110,7 @@ s32 func_808B3AAC(BgSpot15Rrbox* this, PlayState* play) { } if (rotY < 0x2000 && rotY > -0x6000) { - return gSaveContext.eventChkInf[1] & 0x10; + return Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE); } return true; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index d4d66d3d2..ab49767df 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -46,7 +46,7 @@ void BgSpot15Saku_Init(Actor* thisx, PlayState* play) { this->unk_170.x = this->dyna.actor.world.pos.x; this->unk_170.y = this->dyna.actor.world.pos.y; this->unk_170.z = this->dyna.actor.world.pos.z; - if (gSaveContext.infTable[7] & 2) { + if (Flags_GetInfTable(INFTABLE_71)) { this->dyna.actor.world.pos.z = 2659.0f; } this->actionFunc = func_808B4930; @@ -59,7 +59,7 @@ void BgSpot15Saku_Destroy(Actor* thisx, PlayState* play) { } void func_808B4930(BgSpot15Saku* this, PlayState* play) { - if (this->unk_168 && !(gSaveContext.infTable[7] & 2)) { + if (this->unk_168 && !Flags_GetInfTable(INFTABLE_71)) { this->timer = 2; this->actionFunc = func_808B4978; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index b6b11df76..5509765c3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -443,7 +443,7 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) { OnePointCutscene_Init(play, 4180, 50, NULL, MAIN_CAM); Flags_SetSwitch(play, this->switchFlag); - gSaveContext.eventChkInf[2] |= 8; + Flags_SetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE); func_808B5A78(this); } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index 990bdea68..8d4a9b2a5 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -71,7 +71,7 @@ void BgSpot16Doughnut_Init(Actor* thisx, PlayState* play) { break; } osSyncPrintf(VT_FGCOL(CYAN) "%f" VT_RST "\n", this->actor.scale.x); - if (!LINK_IS_ADULT || gSaveContext.eventChkInf[2] & 0x8000) { + if (!LINK_IS_ADULT || Flags_GetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED)) { this->fireFlag &= ~1; } else { this->fireFlag |= 1; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index 73c94e2fe..d2a9c9899 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -48,7 +48,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { if (param == 0) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - if (gSaveContext.infTable[16] & 0x200) { + if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { this->actionFunc = func_808B95AC; this->dyna.actor.world.pos.y += 180.0f; } else { @@ -63,7 +63,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { } } } else { - if (gSaveContext.infTable[16] & 0x200) { + if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { this->dyna.actor.world.pos.x += 125.0f * Math_CosS(this->dyna.actor.world.rot.y); this->dyna.actor.world.pos.z -= 125.0f * Math_SinS(this->dyna.actor.world.rot.y); this->actionFunc = func_808B95AC; @@ -94,7 +94,7 @@ void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { } void func_808B9618(BgSpot18Shutter* this, PlayState* play) { - if (gSaveContext.infTable[16] & 0x200) { + if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { Actor_SetFocus(&this->dyna.actor, 70.0f); if (((this->dyna.actor.params >> 8) & 1) == 0) { this->actionFunc = func_808B9698; diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index 823606f39..574685b04 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -47,7 +47,7 @@ void BgTokiHikari_Init(Actor* thisx, PlayState* play) { this->actionFunc = BgTokiHikari_DoNothing; break; case 1: - if (!(gSaveContext.eventChkInf[4] & 0x800)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) { this->actionFunc = func_808BA204; this->unk_14C = 0.0f; } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 8abc3a5ae..6c8db2fdf 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -112,14 +112,14 @@ void BgTokiSwd_Destroy(Actor* thisx, PlayState* play) { } void func_808BAF40(BgTokiSwd* this, PlayState* play) { - if (((gSaveContext.eventChkInf[4] & 0x8000) == 0) && (gSaveContext.sceneSetupIndex < 4) && + if (((Flags_GetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER)) == 0) && (gSaveContext.sceneSetupIndex < 4) && Actor_IsFacingAndNearPlayer(&this->actor, 800.0f, 0x7530) && !Play_InCsMode(play)) { - gSaveContext.eventChkInf[4] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER); play->csCtx.segment = D_808BBD90; gSaveContext.cutsceneTrigger = 1; } - if (!LINK_IS_ADULT || (gSaveContext.eventChkInf[5] & 0x20 && !gSaveContext.n64ddFlag) || gSaveContext.n64ddFlag) { + if (!LINK_IS_ADULT || (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && !gSaveContext.n64ddFlag) || gSaveContext.n64ddFlag) { if (Actor_HasParent(&this->actor, play)) { if (!LINK_IS_ADULT) { Item_Give(play, ITEM_SWORD_MASTER); diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 2f9171d4a..a7f4905e7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -143,9 +143,9 @@ void func_808BC864(BgTreemouth* this, PlayState* play) { } void func_808BC8B8(BgTreemouth* this, PlayState* play) { - if ((!(Flags_GetEventChkInf(5))) || LINK_IS_ADULT) { + if ((!Flags_GetEventChkInf(EVENTCHKINF_DEKU_TREE_OPENED_MOUTH)) || LINK_IS_ADULT) { if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0xC)) { + if (Flags_GetEventChkInf(EVENTCHKINF_MET_DEKU_TREE)) { if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x7530)) { this->dyna.actor.flags |= ACTOR_FLAG_TARGETABLE; if (this->dyna.actor.isTargeted) { @@ -156,7 +156,7 @@ void func_808BC8B8(BgTreemouth* this, PlayState* play) { } } } else if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x4E20)) { - Flags_SetEventChkInf(0xC); + Flags_SetEventChkInf(EVENTCHKINF_MET_DEKU_TREE); play->csCtx.segment = D_808BCE20; gSaveContext.cutsceneTrigger = 1; BgTreemouth_SetupAction(this, func_808BC9EC); @@ -188,7 +188,7 @@ void func_808BC9EC(BgTreemouth* this, PlayState* play) { if (play->msgCtx.choiceIndex == 0) { play->csCtx.segment = D_808BD520; - Flags_SetEventChkInf(5); + Flags_SetEventChkInf(EVENTCHKINF_DEKU_TREE_OPENED_MOUTH); BgTreemouth_SetupAction(this, func_808BCAF0); } else { play->csCtx.segment = D_808BD790; @@ -237,7 +237,7 @@ void BgTreemouth_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); if ((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) { - if (gSaveContext.eventChkInf[0] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD)) { alpha = 2150; } } else { // neeeded to match diff --git a/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index abdf98c0c..a19ef2338 100644 --- a/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -42,7 +42,7 @@ void BgUmaJump_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (this->dyna.actor.params == 1) { - if (!Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) { Actor_Kill(&this->dyna.actor); return; } diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 86820b0df..4a015a4f8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -353,7 +353,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) { this->cameraAt.z = player->actor.world.pos.z; } - if (gSaveContext.eventChkInf[7] & 2) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE)) { if (this->unk_198 == 100) { this->actor.world.pos.x = -1114.0f; this->actor.world.pos.z = -2804.0f; @@ -394,7 +394,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) { case 4: Math_SmoothStepToF(&this->unk_20C, 0.0f, 1.0f, 0.01f, 0.0f); - if (gSaveContext.eventChkInf[7] & 2) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE)) { phi_f0 = -50.0f; } else { phi_f0 = 0.0f; @@ -422,7 +422,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) { } if (this->unk_198 == 0x5A) { - if (!(gSaveContext.eventChkInf[7] & 2)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE)) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gKingDodongoTitleCardENGTex), 160, 180, 128, 40, true); } @@ -441,7 +441,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) { this->unk_1DA = 50; this->unk_1BC = 0; player->actor.shape.rot.y = -0x4002; - gSaveContext.eventChkInf[7] |= 2; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_KING_DODONGO_BATTLE); } break; } diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 91193f866..e56858317 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -350,7 +350,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->timers[0] = 0; this->camData.speedMod = 0.0f; this->camData.accel = 0.0f; - if (gSaveContext.eventChkInf[7] & 8) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) { this->introState = BFD_CS_EMERGE; this->camData.nextEye.x = player2->actor.world.pos.x + 100.0f + 300.0f - 600.0f; this->camData.nextEye.y = player2->actor.world.pos.y + 100.0f - 50.0f; @@ -471,7 +471,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { osSyncPrintf("WAY_SPD X = %f\n", this->camData.atVel.x); osSyncPrintf("WAY_SPD Y = %f\n", this->camData.atVel.y); osSyncPrintf("WAY_SPD Z = %f\n", this->camData.atVel.z); - if ((this->timers[3] > 190) && !(gSaveContext.eventChkInf[7] & 8)) { + if ((this->timers[3] > 190) && !Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) { Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -498,7 +498,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { if (this->timers[3] == 160) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS); } - if ((this->timers[3] == 130) && !(gSaveContext.eventChkInf[7] & 8)) { + if ((this->timers[3] == 130) && !Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gVolvagiaBossTitleCardENGTex), 160, 180, 128, 40, true); } @@ -549,7 +549,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { func_8002DF54(play, &this->actor, 7); this->actionFunc = BossFd_Wait; this->handoffSignal = FD2_SIGNAL_GROUND; - gSaveContext.eventChkInf[7] |= 8; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE); } break; } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index f1f7aebd6..cac446b70 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -570,7 +570,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { Play_ChangeCameraStatus(play, this->csCamIndex, CAM_STAT_ACTIVE); this->csCamFov = 60.0f; - if (gSaveContext.eventChkInf[7] & 0x100 || gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE) || gSaveContext.n64ddFlag || gSaveContext.isBossRush) { // watched cutscene already, skip most of it this->csState = 17; this->csTimer = 0; @@ -1108,12 +1108,12 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { gSegments[6] = VIRTUAL_TO_PHYSICAL( play->objectCtx.status[Object_GetIndex(&play->objectCtx, OBJECT_GANON)].segment); - if (!(gSaveContext.eventChkInf[7] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE)) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gGanondorfTitleCardENGTex), 160, 180, 128, 40, true); } - gSaveContext.eventChkInf[7] |= 0x100; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE); } if (this->csTimer >= 20) { @@ -1540,7 +1540,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { if (this->csTimer == 180) { play->sceneLoadFlag = 0x14; if ((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE) || gSaveContext.isBossRush)) { - Flags_SetEventChkInf(0xC7); + Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO); play->nextEntranceIndex = 0x517; } else { diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index d1166aade..72623af22 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -680,7 +680,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { // entrance of the boss room if (fabsf(player->actor.world.pos.x - 150.0f) < 60.0f && fabsf(player->actor.world.pos.z - 350.0f) < 60.0f) { - if (gSaveContext.eventChkInf[7] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE)) { BossGoma_SetupEncounterState4(this, play); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_SHUTTER, 164.72f, -480.0f, 397.68002f, 0, -0x705C, 0, 0x180); @@ -919,13 +919,13 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { if (Animation_OnFrame(&this->skelanime, 40.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_CRY1); - if (!(gSaveContext.eventChkInf[7] & 1)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE)) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gGohmaTitleCardENGTex), 160, 180, 128, 40, true); } Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); - gSaveContext.eventChkInf[7] |= 1; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE); } if (Animation_OnFrame(&this->skelanime, this->currentAnimFrameCount)) { diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 0c85e5f78..317eaf55d 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -377,7 +377,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) { MO_WATER_LEVEL(play) = -500; return; } - if (gSaveContext.eventChkInf[7] & 0x10) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_MORPHA_BATTLE)) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); this->tentMaxAngle = 5.0f; this->timers[0] = 50; @@ -1445,7 +1445,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { if (this->timers[2] == 130) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gMorphaTitleCardENGTex), 160, 180, 128, 40, true); - gSaveContext.eventChkInf[7] |= 0x10; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_MORPHA_BATTLE); } break; case MO_INTRO_FINISH: diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 2ea30cdee..022227f32 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -395,7 +395,7 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) { Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, sCutsceneCamera, CAM_STAT_ACTIVE); Math_Vec3f_Copy(&sCameraAt, &player->actor.world.pos); - if (gSaveContext.eventChkInf[7] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) { sCameraEye.z = ROOM_CENTER_Z - 100.0f; } @@ -431,7 +431,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { Play_ChangeCameraStatus(play, sCutsceneCamera, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE); Play_ClearCamera(play, sCutsceneCamera); - gSaveContext.eventChkInf[7] |= 0x80; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE); BossSst_HeadSetupNeutral(this); this->colliderJntSph.base.ocFlags1 |= OC1_ON; sHands[LEFT]->colliderJntSph.base.ocFlags1 |= OC1_ON; @@ -454,7 +454,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { this->ready = true; func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96); Audio_PlayActorSound2(&sFloor->dyna.actor, NA_SE_EN_SHADEST_TAIKO_HIGH); - } else if (gSaveContext.eventChkInf[7] & 0x80) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) { sHands[RIGHT]->actor.draw = BossSst_DrawHand; sHands[LEFT]->actor.draw = BossSst_DrawHand; this->actor.draw = BossSst_DrawHead; @@ -581,7 +581,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { } if (this->timer <= 198) { revealStateTimer = 198 - this->timer; - if ((gSaveContext.eventChkInf[7] & 0x80) && (revealStateTimer <= 44)) { + if ((Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) && (revealStateTimer <= 44)) { sCameraAt.x += 492.0f * 0.01f; sCameraAt.y += 200.0f * 0.01f; sCameraEye.x -= 80.0f * 0.01f; @@ -610,7 +610,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { sCameraEye.y += 125.0f * 0.01f; sCameraEye.z -= 350.0f * 0.01f; } else if (revealStateTimer == 85) { - if (!(gSaveContext.eventChkInf[7] & 0x80)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BONGO_BONGO_BATTLE)) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gBongoTitleCardENGTex), 160, 180, 128, 40, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 1fa024c28..58b16feb8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -479,7 +479,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) { this->actor.naviEnemyId = 0x33; SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_0070E0, &object_tw_Anim_006F28, NULL, NULL, 0); - if (gSaveContext.eventChkInf[7] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE)) { // began twinrova battle BossTw_SetupFlyTo(this, play); this->actor.world.pos.x = -600.0f; @@ -497,7 +497,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) { this->actor.naviEnemyId = 0x32; SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_01F888, &object_tw_Anim_006F28, NULL, NULL, 0); - if (gSaveContext.eventChkInf[7] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE)) { // began twinrova battle BossTw_SetupFlyTo(this, play); this->actor.world.pos.x = 600.0f; @@ -519,7 +519,7 @@ void BossTw_Init(Actor* thisx, PlayState* play2) { SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_032020, &object_tw_Anim_0244B4, NULL, NULL, 0); Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_0244B4, -3.0f); - if (gSaveContext.eventChkInf[7] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE)) { // began twinrova battle BossTw_SetupWait(this, play); } else { @@ -2184,7 +2184,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) { play->envCtx.unk_BD = 1; play->envCtx.unk_D8 = 0.0f; TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gTwinrovaTitleCardENGTex), 160, 180, 128, 40, true); - gSaveContext.eventChkInf[7] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_TWINROVA_BATTLE); Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); } diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 625a33eed..005759565 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -638,7 +638,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) { 0, BOSSVA_DOOR); if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { warpId = ACTOR_EN_RU1; - if (gSaveContext.eventChkInf[3] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { warpId = ACTOR_DOOR_WARP1; } Actor_Spawn(&play->actorCtx, play, warpId, this->actor.world.pos.x, this->actor.world.pos.y, @@ -651,7 +651,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) { } else { this->actor.colChkInfo.damageTable = sDamageTable; sPhase2Timer = 0xFFFF; - if (gSaveContext.eventChkInf[7] & 0x40) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BARINA_BATTLE)) { sCsState = INTRO_CALL_BARI; sDoorState = 100; func_8002DF54(play, &this->actor, 1); @@ -986,7 +986,7 @@ void BossVa_BodyIntro(BossVa* this, PlayState* play) { sCameraNextAt.y = 140.0f; sCameraNextAt.z = -200.0f; - if (!(gSaveContext.eventChkInf[7] & 0x40)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_BARINA_BATTLE)) { TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gBarinadeTitleCardENGTex), 160, 180, 128, 40, true); } @@ -1028,7 +1028,7 @@ void BossVa_BodyIntro(BossVa* this, PlayState* play) { Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE); func_8002DF54(play, &this->actor, 7); sCsState++; - gSaveContext.eventChkInf[7] |= 0x40; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_BARINA_BATTLE); player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; } break; diff --git a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 3aaa0d3b9..6e74bb338 100644 --- a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -495,7 +495,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { this->jewel.isPositionInit = 0; DemoEffect_InitJewel(play, this); Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTOR_EN_DOOR); - if ((play->sceneNum == SCENE_BDAN) && (gSaveContext.infTable[20] & 0x20)) { + if ((play->sceneNum == SCENE_BDAN) && (Flags_GetInfTable(INFTABLE_145))) { Actor_Kill(&this->actor); return; } @@ -702,7 +702,7 @@ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { Actor_SetScale(&this->actor, 84 * 0.001f); } } else if (gSaveContext.sceneSetupIndex == 5 || gSaveContext.sceneSetupIndex == 4 || - (gSaveContext.entranceIndex == 0x0324 && !((gSaveContext.eventChkInf[12] & 0x200)))) { + (gSaveContext.entranceIndex == 0x0324 && !((Flags_GetEventChkInf(EVENTCHKINF_TIME_TRAVELED_TO_ADULT))))) { SkelCurve_SetAnim(&this->skelCurve, &gTimeWarpAnim, 1.0f, 59.0f, 59.0f, 0.0f); SkelCurve_Update(play, &this->skelCurve); this->updateFunc = DemoEffect_UpdateTimeWarpReturnFromChamberOfSages; @@ -766,7 +766,7 @@ void DemoEffect_UpdateTimeWarpReturnFromChamberOfSages(DemoEffect* this, PlaySta if (this->timeWarp.shrinkTimer > 250) { if (gSaveContext.entranceIndex == 0x0324) { - gSaveContext.eventChkInf[12] |= 0x200; + Flags_SetEventChkInf(EVENTCHKINF_TIME_TRAVELED_TO_ADULT); } Actor_Kill(&this->actor); @@ -1587,8 +1587,8 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, PlayState* play) { if (play->csCtx.state && play->csCtx.npcActions[this->csActionId]) { switch (play->csCtx.npcActions[this->csActionId]->action) { case 3: - if (gSaveContext.eventChkInf[4] & 0x800) { - gSaveContext.eventChkInf[4] |= 0x800; + if (Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) { + Flags_SetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME); } DemoEffect_MoveJewelActivateDoorOfTime(this, play); if ((play->gameplayFrames & 1) == 0) { @@ -1622,7 +1622,7 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, PlayState* play) { } if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { - if (!(gSaveContext.eventChkInf[4] & 0x800)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) { hasCmdAction = play->csCtx.state && play->csCtx.npcActions[this->csActionId]; if (!hasCmdAction) { this->effectFlags |= 0x1; diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 92bfd7ddf..d55cfe45f 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -895,7 +895,7 @@ void func_80986BE4(DemoIm* this, s32 arg1) { } void func_80986BF8(DemoIm* this, PlayState* play) { - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { this->action = 24; this->drawConfig = 1; this->unk_280 = 1; @@ -912,7 +912,7 @@ void GivePlayerRandoRewardImpa(Actor* impa, PlayState* play, RandomizerCheck che } else if (!Flags_GetTreasure(play, 0x1F) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) { GiveItemEntryFromActor(impa, play, getItemEntry, 75.0f, 50.0f); } else if (!Player_InBlockingCsMode(play, GET_PLAYER(play))) { - gSaveContext.eventChkInf[5] |= 0x200; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY); play->sceneLoadFlag = 0x14; play->fadeTransition = 3; gSaveContext.nextTransitionType = 3; @@ -933,7 +933,7 @@ void func_80986C30(DemoIm* this, PlayState* play) { } else { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs); gSaveContext.cutsceneTrigger = 1; - gSaveContext.eventChkInf[5] |= 0x200; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY); Item_Give(play, ITEM_SONG_LULLABY); func_80985F54(this); } @@ -941,7 +941,7 @@ void func_80986C30(DemoIm* this, PlayState* play) { } void func_80986CC8(DemoIm* this) { - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { this->action = 26; this->drawConfig = 1; this->unk_280 = 1; @@ -951,7 +951,7 @@ void func_80986CC8(DemoIm* this) { void func_80986CFC(DemoIm* this, PlayState* play) { if (func_80986A5C(this, play)) { - gSaveContext.eventChkInf[4] |= 0x1000; + Flags_SetEventChkInf(EVENTCHKINF_4C); this->action = 19; } } @@ -960,9 +960,9 @@ void func_80986D40(DemoIm* this, PlayState* play) { if (gSaveContext.sceneSetupIndex == 6) { this->action = 19; this->drawConfig = 1; - } else if ((gSaveContext.eventChkInf[8] & 1) && !gSaveContext.n64ddFlag) { + } else if ((Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) && !gSaveContext.n64ddFlag) { Actor_Kill(&this->actor); - } else if (!(gSaveContext.eventChkInf[5] & 0x200)) { + } else if (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)) { this->action = 23; } else { this->action = 20; diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index e76b2fcc3..f4239a656 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -234,7 +234,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { case DEMOKANKYO_DOOR_OF_TIME: this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 1.0f; this->unk_150[0].unk_18 = 0.0f; - if (!(gSaveContext.eventChkInf[4] & 0x800)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_TOKI, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x0000); @@ -412,7 +412,7 @@ void DemoKankyo_UpdateDoorOfTime(DemoKankyo* this, PlayState* play) { this->unk_150[0].unk_18 += 1.0f; if (this->unk_150[0].unk_18 >= 102.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_STONEDOOR_STOP); - gSaveContext.eventChkInf[4] |= 0x800; + Flags_SetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME); Actor_Kill(this->actor.child); DemoKankyo_SetupAction(this, DemoKankyo_KillDoorOfTimeCollision); } diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index bb29705d4..9e6c3acb7 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -231,7 +231,7 @@ void DemoKekkai_TowerBarrier(DemoKekkai* this, PlayState* play) { } else { this->timer++; if (this->timer > 100) { - Flags_SetEventChkInf(0xC3); + Flags_SetEventChkInf(EVENTCHKINF_DISPELLED_GANONS_TOWER_BARRIER); Actor_Kill(&this->actor); return; } else if (this->timer > 40) { diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 6aef4910e..f7556386f 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -599,7 +599,7 @@ void func_809975C0(DoorShutter* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); if (this->dyna.actor.bgCheckFlags & 1) { DoorShutter_SetupAction(this, func_809976B8); - if (!(gSaveContext.eventChkInf[7] & 1)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GOHMA_BATTLE)) { BossGoma* parent = (BossGoma*)this->dyna.actor.parent; this->unk_164 = 10; diff --git a/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index b6a8b83e0..b18bf0358 100644 --- a/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -50,7 +50,7 @@ void DoorToki_Destroy(Actor* thisx, PlayState* play) { void DoorToki_Update(Actor* thisx, PlayState* play) { DoorToki* this = (DoorToki*)thisx; - if (gSaveContext.eventChkInf[4] & 0x800) { + if (Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) { func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId); } else { func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId); diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index e0e160518..60faf16c3 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -570,8 +570,8 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { osSyncPrintf("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", play->sceneLoadFlag, 0x14); if (play->sceneNum == SCENE_DDAN_BOSS) { - if (!Flags_GetEventChkInf(0x25)) { - Flags_SetEventChkInf(0x25); + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { + Flags_SetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN); if (gSaveContext.n64ddFlag) { play->nextEntranceIndex = 0x47A; @@ -586,9 +586,9 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } } else if (play->sceneNum == SCENE_YDAN_BOSS) { - if (!Flags_GetEventChkInf(7) || gSaveContext.n64ddFlag) { - Flags_SetEventChkInf(7); - Flags_SetEventChkInf(9); + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD) || gSaveContext.n64ddFlag) { + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD); + Flags_SetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE); if (gSaveContext.n64ddFlag) { play->nextEntranceIndex = 0x0457; @@ -704,7 +704,7 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, PlayState* play) { this->warpTimer++; if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == 0xFFEF) { - gSaveContext.eventChkInf[3] |= 0x80; + Flags_SetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY); if (gSaveContext.n64ddFlag) { @@ -829,8 +829,8 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { if (gSaveContext.isBossRush) { BossRush_HandleBlueWarp(play, this->actor.world.pos.x, this->actor.world.pos.z); } else if (play->sceneNum == SCENE_MORIBOSSROOM) { - if (!(gSaveContext.eventChkInf[4] & 0x100)) { - gSaveContext.eventChkInf[4] |= 0x100; + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) { + Flags_SetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_FOREST_TEMPLE); if (gSaveContext.n64ddFlag) { @@ -851,8 +851,8 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } } else if (play->sceneNum == SCENE_FIRE_BS) { - if (!(gSaveContext.eventChkInf[4] & 0x200)) { - gSaveContext.eventChkInf[4] |= 0x200; + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) { + Flags_SetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE); if (gSaveContext.n64ddFlag) { @@ -874,8 +874,8 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } } else if (play->sceneNum == SCENE_MIZUSIN_BS) { - if (!(gSaveContext.eventChkInf[4] & 0x400)) { - gSaveContext.eventChkInf[4] |= 0x400; + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) { + Flags_SetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE); if (gSaveContext.n64ddFlag) { diff --git a/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index 1cd642f0c..ac2fcb6f4 100644 --- a/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -81,7 +81,7 @@ void EfcErupc_UpdateAction(EfcErupc* this, PlayState* play) { case 2: if (this->unk_14E == 0) { func_800F3F3C(6); - gSaveContext.eventChkInf[2] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED); } this->unk_14E++; break; diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 00464b3dc..075286901 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -126,7 +126,7 @@ void func_809B0558(EnAni* this, PlayState* play) { } else { EnAni_SetupAction(this, func_809B0524); } - gSaveContext.itemGetInf[1] |= 0x20; + Flags_SetItemGetInf(ITEMGETINF_15); } else { if (!gSaveContext.n64ddFlag) { func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); @@ -175,7 +175,7 @@ void func_809B064C(EnAni* this, PlayState* play) { } } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && -80.0f < this->actor.yDistToPlayer) { - if (gSaveContext.itemGetInf[1] & 0x20) { + if (Flags_GetItemGetInf(ITEMGETINF_15)) { EnAni_SetText(this, play, 0x5056); } else { EnAni_SetText(this, play, 0x5055); @@ -201,16 +201,16 @@ void func_809B07F8(EnAni* this, PlayState* play) { } } else if (yawDiff > -0x36B0 && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && -80.0f < this->actor.yDistToPlayer) { - if (gSaveContext.itemGetInf[1] & 0x20) { + if (Flags_GetItemGetInf(ITEMGETINF_15)) { EnAni_SetText(this, play, 0x5056); } else { EnAni_SetText(this, play, 0x5055); } } else if (yawDiff > -0x3E8 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { - if (!(gSaveContext.eventChkInf[2] & 0x8000)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED)) { textId = 0x5052; } else { - textId = (gSaveContext.itemGetInf[1] & 0x20) ? 0x5054 : 0x5053; + textId = (Flags_GetItemGetInf(ITEMGETINF_15)) ? 0x5054 : 0x5053; } EnAni_SetText(this, play, textId); } diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index ae9a4e8b3..7ad117ccf 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -143,7 +143,7 @@ void EnBomBowMan_BlinkAwake(EnBomBowlMan* this, PlayState* play) { // Check for beaten Dodongo's Cavern if Rando is disabled if (!gSaveContext.n64ddFlag) { - if ((gSaveContext.eventChkInf[2] & 0x20) || BREG(2)) { + if ((Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) || BREG(2)) { this->actor.textId = 0xBF; } else { this->actor.textId = 0x7058; @@ -194,7 +194,7 @@ void EnBomBowMan_CheckBeatenDC(EnBomBowlMan* this, PlayState* play) { bombchuBowlingClosed = (INV_CONTENT(explosive) == ITEM_NONE); } else { // if not rando'd, check if we have beaten Dodongo's Cavern - bombchuBowlingClosed = !((gSaveContext.eventChkInf[2] & 0x20) || BREG(2)); + bombchuBowlingClosed = !((Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) || BREG(2)); } if (bombchuBowlingClosed) { this->actionFunc = EnBomBowMan_WaitNotBeatenDC; @@ -426,7 +426,7 @@ void EnBomBowMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { switch (this->prizeSelect) { case 0: prizeTemp = EXITEM_BOMB_BAG_BOWLING; - if (gSaveContext.itemGetInf[1] & 2) { + if (Flags_GetItemGetInf(ITEMGETINF_11)) { prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING; } break; @@ -435,7 +435,7 @@ void EnBomBowMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING; } else { prizeTemp = EXITEM_HEART_PIECE_BOWLING; - if (gSaveContext.itemGetInf[1] & 4) { + if (Flags_GetItemGetInf(ITEMGETINF_12)) { prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING; } } @@ -446,7 +446,7 @@ void EnBomBowMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { case 3: if (!gSaveContext.n64ddFlag) { prizeTemp = EXITEM_HEART_PIECE_BOWLING; - if (gSaveContext.itemGetInf[1] & 4) { + if (Flags_GetItemGetInf(ITEMGETINF_12)) { prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING; } } else { diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 116805c1a..b92b22d3f 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -158,10 +158,10 @@ void EnBomBowlPit_SetupGivePrize(EnBomBowlPit* this, PlayState* play) { if (this->exItemDone != 0) { switch (this->prizeIndex) { case EXITEM_BOMB_BAG_BOWLING: - gSaveContext.itemGetInf[1] |= 2; + Flags_SetItemGetInf(ITEMGETINF_11); break; case EXITEM_HEART_PIECE_BOWLING: - gSaveContext.itemGetInf[1] |= 4; + Flags_SetItemGetInf(ITEMGETINF_12); break; } diff --git a/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.c index dc5202bd2..18609091b 100644 --- a/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -100,7 +100,7 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { minigameRoomNum *= 2; // Spawn Heart Piece in chest (or Purple Rupee if won Heart Piece) if (play->roomCtx.curRoom.num >= 6) { - rewardChestParams = ((gSaveContext.itemGetInf[1] & 0x800) ? (0x4EA0) : (0x4EC0)); + rewardChestParams = ((Flags_GetItemGetInf(ITEMGETINF_1B)) ? (0x4EA0) : (0x4EC0)); rewardChestParams = sTreasureFlags[5] | rewardChestParams; this->finalChest = (EnBox*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_BOX, 20.0f, 20.0f, -2500.0f, 0, 0x7FFF, 0, rewardChestParams); @@ -110,7 +110,7 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { Actor_Kill(&this->actor); return; } else { - rewardParams = ((gSaveContext.itemGetInf[1] & 0x800) ? (ITEM_ETC_RUPEE_PURPLE_CHEST_GAME) + rewardParams = ((Flags_GetItemGetInf(ITEMGETINF_1B)) ? (ITEM_ETC_RUPEE_PURPLE_CHEST_GAME) : (ITEM_ETC_HEART_PIECE_CHEST_GAME)) & 0xFF; Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_ETCETERA, 20.0f, 20.0f, -2500.0f, 0, 0, 0, @@ -275,8 +275,8 @@ void EnChanger_OpenChests(EnChanger* this, PlayState* play) { void EnChanger_SetHeartPieceFlag(EnChanger* this, PlayState* play) { if (this->finalChest->unk_1F4 != 0) { - if (!(gSaveContext.itemGetInf[1] & 0x800)) { - gSaveContext.itemGetInf[1] |= 0x800; + if (!Flags_GetItemGetInf(ITEMGETINF_1B)) { + Flags_SetItemGetInf(ITEMGETINF_1B); } Actor_Kill(&this->actor); } diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index c97a54760..c6d84aec4 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -127,7 +127,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - if (!(gSaveContext.eventChkInf[1] & 0x4000)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE)) { Actor_Kill(&this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 1990d2b3b..6ce7b3485 100644 --- a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -189,7 +189,7 @@ s32 EnCs_GetTalkState(EnCs* this, PlayState* play) { if (this->actor.textId == 0x2026) { Player_UnsetMask(play); Item_Give(play, ITEM_SOLD_OUT); - gSaveContext.itemGetInf[3] |= 0x400; + Flags_SetItemGetInf(ITEMGETINF_3A); Rupees_ChangeBy(30); this->actor.textId = 0x2027; talkState = 2; @@ -213,7 +213,7 @@ s32 EnCs_GetTextID(EnCs* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 textId = Text_GetFaceReaction(play, 15); - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { if (textId == 0) { textId = 0x2028; } @@ -336,14 +336,14 @@ void EnCs_Walk(EnCs* this, PlayState* play) { animIndex = this->currentAnimIndex; if (this->talkState == 0) { - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { rnd = Rand_ZeroOne() * 10.0f; } else { rnd = Rand_ZeroOne() * 5.0f; } if (rnd == 0) { - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { animIndex = 2.0f * Rand_ZeroOne(); animIndex = (animIndex == 0) ? ENCS_ANIM_2 : ENCS_ANIM_1; } else { @@ -472,7 +472,7 @@ void EnCs_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnCs_OverrideLimbDraw, EnCs_PostLimbDraw, &this->actor); - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { s32 childLinkObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD); // Handle attaching the Spooky Mask to the boy's face diff --git a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 57d2ec604..35f58f63b 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -153,13 +153,13 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { s32 noKill = true; s32 isFree = false; - if ((this->actor.params & 3) == 0 && (gSaveContext.eventChkInf[9] & 1)) { + if ((this->actor.params & 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { isFree = true; - } else if ((this->actor.params & 3) == 1 && (gSaveContext.eventChkInf[9] & 2)) { + } else if ((this->actor.params & 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { isFree = true; - } else if ((this->actor.params & 3) == 2 && (gSaveContext.eventChkInf[9] & 4)) { + } else if ((this->actor.params & 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { isFree = true; - } else if ((this->actor.params & 3) == 3 && (gSaveContext.eventChkInf[9] & 8)) { + } else if ((this->actor.params & 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { isFree = true; } @@ -241,10 +241,10 @@ s32 EnDaiku_UpdateTalking(EnDaiku* this, PlayState* play) { if (Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x6061: - gSaveContext.infTable[23] |= 0x40; + Flags_SetInfTable(INFTABLE_176); break; case 0x6064: - gSaveContext.infTable[23] |= 0x100; + Flags_SetInfTable(INFTABLE_178); break; } @@ -274,7 +274,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) { freedCount = 0; for (carpenterType = 0; carpenterType < 4; carpenterType++) { - if (gSaveContext.eventChkInf[9] & (1 << carpenterType)) { + if (gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & EVENTCHKINF_CARPENTERS_FREE_MASK(carpenterType)) { freedCount++; } } @@ -310,7 +310,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6063; } else { - if (!(gSaveContext.infTable[23] & 0x40)) { + if (!Flags_GetInfTable(INFTABLE_176)) { this->actor.textId = 0x6061; } else { this->actor.textId = 0x6062; @@ -321,7 +321,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6066; } else { - if (!(gSaveContext.infTable[23] & 0x100)) { + if (!Flags_GetInfTable(INFTABLE_178)) { this->actor.textId = 0x6064; } else { this->actor.textId = 0x6065; @@ -402,7 +402,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex); this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); - gSaveContext.eventChkInf[9] |= 1 << (this->actor.params & 3); + gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= EVENTCHKINF_CARPENTERS_FREE_MASK(this->actor.params & 3); this->actor.gravity = -1.0f; this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive; @@ -494,7 +494,7 @@ void EnDaiku_EscapeSuccess(EnDaiku* this, PlayState* play) { Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE); this->subCamActive = false; - if ((gSaveContext.eventChkInf[9] & 0xF) == 0xF) { + if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { Matrix_RotateY(this->initRot.y * (M_PI / 0x8000), MTXMODE_NEW); Matrix_MultVec3f(&D_809E4148, &vec); gerudoGuard = diff --git a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 115a7e086..0f1eae0c9 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -218,10 +218,10 @@ s32 EnDaikuKakariko_GetTalkState(EnDaikuKakariko* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x6061: - gSaveContext.infTable[23] |= 0x40; + Flags_SetInfTable(INFTABLE_176); break; case 0x6064: - gSaveContext.infTable[23] |= 0x100; + Flags_SetInfTable(INFTABLE_178); break; } talkState = 0; diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index e5afb02d0..f3bed2351 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -144,14 +144,14 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) { } else { s32 rupeesNeeded = 5; - if (gSaveContext.eventChkInf[3] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { rupeesNeeded = 10; } if (this->grabbedRupeesCounter >= rupeesNeeded) { // Won. gSaveContext.timer1State = 0; this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0; - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { this->actor.textId = 0x4055; } else { this->actor.textId = 0x405D; @@ -164,7 +164,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) { func_800F5B58(); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); func_8002DF54(play, NULL, 8); - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { this->actionFunc = func_809EE96C; } else { this->actionFunc = func_809EE048; @@ -210,7 +210,7 @@ void EnDivingGame_Talk(EnDivingGame* this, PlayState* play) { switch (this->state) { case ENDIVINGGAME_STATE_NOTPLAYING: this->unk_292 = TEXT_STATE_CHOICE; - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { this->actor.textId = 0x4053; this->phase = ENDIVINGGAME_PHASE_1; } else { @@ -252,7 +252,7 @@ void EnDivingGame_HandlePlayChoice(EnDivingGame* this, PlayState* play) { this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0; break; } - if (!(gSaveContext.eventChkInf[3] & 0x100) || this->actor.textId == 0x85 || this->actor.textId == 0x2D) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE) || this->actor.textId == 0x85 || this->actor.textId == 0x2D) { Message_ContinueTextbox(play, this->actor.textId); this->unk_292 = TEXT_STATE_EVENT; this->actionFunc = func_809EE048; @@ -311,7 +311,7 @@ void EnDivingGame_SetupRupeeThrow(EnDivingGame* this, PlayState* play) { this->unk_2D0.x = -280.0f; this->unk_2D0.y = -20.0f; this->unk_2D0.z = -240.0f; - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { this->rupeesLeftToThrow = 5; } else { this->rupeesLeftToThrow = 10; @@ -355,7 +355,7 @@ void EnDivingGame_RupeeThrow(EnDivingGame* this, PlayState* play) { this->spawnRuppyTimer = 5; EnDivingGame_SpawnRuppy(this, play); this->rupeesLeftToThrow--; - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { this->unk_296 = 30; } else { this->unk_296 = 5; @@ -413,7 +413,7 @@ void func_809EE800(EnDivingGame* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { func_80088B34(BREG(2) + 50); } else { func_80088B34(BREG(2) + 50); @@ -486,7 +486,7 @@ void func_809EEAF8(EnDivingGame* this, PlayState* play) { // "Successful completion" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0; - gSaveContext.eventChkInf[3] |= 0x100; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE); this->actionFunc = func_809EDCB0; } } diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 3143eeea3..ca498ca12 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -332,7 +332,7 @@ void func_809EFA28(EnDns* this) { } void func_809EFA58(EnDns* this) { - gSaveContext.itemGetInf[0] |= 0x800; + Flags_SetItemGetInf(ITEMGETINF_0B); Rupees_ChangeBy(-this->dnsItemEntry->itemPrice); } @@ -345,12 +345,12 @@ void func_809EFACC(EnDns* this) { } void func_809EFAFC(EnDns* this) { - gSaveContext.infTable[25] |= 0x4; + Flags_SetInfTable(INFTABLE_192); Rupees_ChangeBy(-this->dnsItemEntry->itemPrice); } void func_809EFB40(EnDns* this) { - gSaveContext.infTable[25] |= 0x8; + Flags_SetInfTable(INFTABLE_193); Rupees_ChangeBy(-this->dnsItemEntry->itemPrice); } diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index a10d43d46..4f2ecf93d 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -180,14 +180,14 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { delay = 0; switch (Player_GetMask(play)) { case PLAYER_MASK_SKULL: - if (!(gSaveContext.itemGetInf[1] & 0x4000)) { + if (!Flags_GetItemGetInf(ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE)) { reaction = DNT_SIGNAL_CELEBRATE; this->prize = DNT_PRIZE_STICK; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_SARIA_THEME); break; } case PLAYER_MASK_TRUTH: - if (!(gSaveContext.itemGetInf[1] & 0x8000) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { + if (!Flags_GetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->prize = DNT_PRIZE_NUTS; diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 24d1129d1..9b44e0cfc 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -286,7 +286,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { osSyncPrintf("実 \n"); osSyncPrintf("実 \n"); osSyncPrintf("実 \n"); - gSaveContext.itemGetInf[1] |= 0x8000; + Flags_SetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE); } else { // "stick" osSyncPrintf("棒 \n"); @@ -295,7 +295,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { osSyncPrintf("棒 \n"); osSyncPrintf("棒 \n"); osSyncPrintf("棒 \n"); - gSaveContext.itemGetInf[1] |= 0x4000; + Flags_SetItemGetInf(ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE); } this->actor.textId = 0; if ((this->stage != NULL) && (this->stage->actor.update != NULL)) { diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index b7b32f6b2..ecd84158a 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -249,7 +249,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); // "Big hit" osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 大当り ☆☆☆☆☆ %d\n" VT_RST, this->hitCounter); - if (!LINK_IS_ADULT && !(gSaveContext.itemGetInf[1] & 0x2000)) { + if (!LINK_IS_ADULT && !Flags_GetItemGetInf(ITEMGETINF_1D)) { this->hitCounter++; if (this->hitCounter >= 3) { if(gSaveContext.n64ddFlag) { diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index 1f82a797a..685949b81 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -171,7 +171,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { } } else if (doorType == DOOR_CHECKABLE) { this->actor.textId = (this->actor.params & 0x3F) + 0x0200; - if (this->actor.textId == 0x0229 && !(gSaveContext.eventChkInf[1] & 0x10)) { + if (this->actor.textId == 0x0229 && !Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { // Talon's house door. If Talon has not been woken up at Hyrule Castle // this door should be openable at any time of day. Note that there is no // check for time of day as the scene setup for Lon Lon merely initializes diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index e8b1cf673..f5733a3f8 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -85,7 +85,7 @@ void EnDs_DisplayOddPotionText(EnDs* this, PlayState* play) { this->actor.textId = 0x504F; this->actionFunc = EnDs_TalkAfterGiveOddPotion; this->actor.flags &= ~ACTOR_FLAG_PLAYER_TALKED_TO; - gSaveContext.itemGetInf[3] |= 1; + Flags_SetItemGetInf(ITEMGETINF_30); } } @@ -259,7 +259,7 @@ void EnDs_Wait(EnDs* this, PlayState* play) { player->actor.textId = 0x504A; this->actionFunc = EnDs_OfferOddPotion; } else if ((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE) == RO_GENERIC_OFF) || - gSaveContext.itemGetInf[3] & 1) { + Flags_GetItemGetInf(ITEMGETINF_30)) { player->actor.textId = 0x500C; this->actionFunc = EnDs_OfferBluePotion; } else { diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index 51a40c5ec..86f9d92dc 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -112,7 +112,7 @@ u16 func_809FDC38(PlayState* play, Actor* actor) { return 0x301D; } } - if (gSaveContext.infTable[0x11] & 8) { + if (Flags_GetInfTable(INFTABLE_113)) { return 0x301B; } else { return 0x301A; @@ -127,13 +127,13 @@ s16 func_809FDCDC(PlayState* play, Actor* actor) { case TEXT_STATE_CLOSING: switch (actor->textId) { case 0x301A: - gSaveContext.infTable[0x11] |= 8; + Flags_SetInfTable(INFTABLE_113); break; case 0x301C: case 0x301F: return NPC_TALK_STATE_ACTION; case 0x3020: - gSaveContext.eventChkInf[0x2] |= 4; + Flags_SetEventChkInf(EVENTCHKINF_22); break; } return 0; @@ -157,7 +157,7 @@ s16 func_809FDCDC(PlayState* play, Actor* actor) { s32 func_809FDDB4(EnDu* this, PlayState* play) { if (play->sceneNum == SCENE_SPOT18 && LINK_IS_CHILD) { return 1; - } else if (play->sceneNum == SCENE_HIDAN && !(gSaveContext.infTable[0x11] & 0x400) && LINK_IS_ADULT) { + } else if (play->sceneNum == SCENE_HIDAN && !Flags_GetInfTable(INFTABLE_SPOKE_TO_DARUNIA_IN_FIRE_TEMPLE) && LINK_IS_ADULT) { return 1; } return 0; @@ -431,7 +431,7 @@ void func_809FE798(EnDu* this, PlayState* play) { } } else { Actor_Kill(&this->actor); - gSaveContext.infTable[0x11] |= 0x400; + Flags_SetInfTable(INFTABLE_SPOKE_TO_DARUNIA_IN_FIRE_TEMPLE); } } diff --git a/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 972b60afb..181c06f87 100644 --- a/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -48,7 +48,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) { // "☆☆☆☆☆ Death Mountain Encount2 set ☆☆☆☆☆" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ デスマウンテンエンカウント2セットされました ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - if (LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x200)) { // flag for having used fire temple blue warp + if (LINK_IS_ADULT && (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP))) { // flag for having used fire temple blue warp Actor_Kill(thisx); } } else { diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index ccf163e3a..d5941d348 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -442,7 +442,7 @@ void EnExItem_TargetPrizeFinish(EnExItem* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { // "Successful completion" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); - gSaveContext.itemGetInf[1] |= 0x2000; + Flags_SetItemGetInf(ITEMGETINF_1D); Actor_Kill(&this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index b816a1e2e..de8d6878b 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -66,7 +66,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { this->actor.gravity = 0.0f; // If you haven't won the diving game before, you will always get 5 rupees - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { this->rupeeValue = 5; this->colorIdx = 1; } else { @@ -271,7 +271,7 @@ void EnExRuppy_EnterWater(EnExRuppy* this, PlayState* play) { this->actor.world.pos.x = ((Rand_ZeroOne() - 0.5f) * 300.0f) + -260.0f; this->actor.world.pos.y = ((Rand_ZeroOne() - 0.5f) * 200.0f) + 370.0f; temp_f2 = this->unk_15A * -50.0f; - if (!(gSaveContext.eventChkInf[3] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SILVER_SCALE)) { temp_f2 += -500.0f; this->actor.world.pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + temp_f2; } else { diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index c1575c63e..1b66eb1fd 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -626,12 +626,12 @@ void EnFr_Activate(EnFr* this, PlayState* play) { void EnFr_ActivateCheckFrogSong(EnFr* this, PlayState* play) { if (sEnFrPointers.flags == 11) { // Check if all 6 child songs have been played for the frogs - if ((gSaveContext.eventChkInf[13] & 0x2) // ZL - && (gSaveContext.eventChkInf[13] & 0x4) // Epona - && (gSaveContext.eventChkInf[13] & 0x10) // Saria - && (gSaveContext.eventChkInf[13] & 0x8) // Suns - && (gSaveContext.eventChkInf[13] & 0x20) // SoT - && (gSaveContext.eventChkInf[13] & 0x40)) { // SoS + if ((Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_ZL)) // ZL + && (Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_EPONA)) // Epona + && (Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_SARIA)) // Saria + && (Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_SUNS)) // Suns + && (Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_SOT)) // SoT + && (Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_STORMS))) { // SoS this->actionFunc = EnFr_TalkBeforeFrogSong; this->songIndex = FROG_CHOIR_SONG; Message_StartTextbox(play, 0x40AB, &this->actor); @@ -795,7 +795,7 @@ void EnFr_DeactivateButterfly() { } u8 EnFr_GetNextNoteFrogSong(u8 ocarinaNoteIndex) { - if (!(gSaveContext.eventChkInf[13] & 1)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_SONGS_FOR_FROGS_CHOIR)) { return gFrogsSongPtr[ocarinaNoteIndex]; } else { return sOcarinaNotes[(s32)Rand_ZeroFloat(60.0f) % 5]; diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 4d21b1b91..58c0fc67f 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -137,7 +137,7 @@ void EnFu_WaitChild(EnFu* this, PlayState* play) { u16 textID = Text_GetFaceReaction(play, 0xB); if (textID == 0) { - textID = (gSaveContext.eventChkInf[6] & 0x80) ? 0x5033 : 0x5032; + textID = (Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO)) ? 0x5033 : 0x5032; } // if ACTOR_FLAG_PLAYER_TALKED_TO is set and textID is 0x5033, change animation @@ -168,7 +168,7 @@ void func_WaitForSongGive(EnFu* this, PlayState* play) { void func_80A1DB60(EnFu* this, PlayState* play) { if (play->csCtx.state == CS_STATE_IDLE) { this->actionFunc = EnFu_WaitAdult; - gSaveContext.eventChkInf[5] |= 0x800; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_SONG_OF_STORMS); play->msgCtx.ocarinaMode = OCARINA_MODE_04; } @@ -206,7 +206,7 @@ void func_80A1DBD4(EnFu* this, PlayState* play) { } play->msgCtx.ocarinaMode = OCARINA_MODE_00; - gSaveContext.eventChkInf[6] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL); } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_02) { player->stateFlags2 &= ~0x1000000; this->actionFunc = EnFu_WaitAdult; @@ -244,7 +244,7 @@ void EnFu_WaitAdult(EnFu* this, PlayState* play) { Player* player = GET_PLAYER(play); yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if ((gSaveContext.eventChkInf[5] & 0x800)) { + if ((Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SONG_OF_STORMS))) { func_80A1D94C(this, play, 0x508E, func_80A1DBA0); } else if (player->stateFlags2 & 0x1000000) { this->actor.textId = 0x5035; diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 9cdb9b4e2..7b1f25151 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -143,7 +143,7 @@ static Vec3f sBottlesPositions[] = { }; void func_80A2F180(EnGb* this) { - if (gSaveContext.infTable[0xB] & 0x40) { + if (Flags_GetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET)) { this->textId = 0x70F5; } else { this->textId = 0x70F4; @@ -308,8 +308,8 @@ void func_80A2F83C(EnGb* this, PlayState* play) { void func_80A2F94C(EnGb* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { - if (!(gSaveContext.infTable[0xB] & 0x40)) { - gSaveContext.infTable[0xB] |= 0x40; + if (!Flags_GetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET)) { + Flags_SetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET); } func_80A2F180(this); this->actionFunc = func_80A2F83C; @@ -318,8 +318,8 @@ void func_80A2F94C(EnGb* this, PlayState* play) { void func_80A2F9C0(EnGb* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { - if (!(gSaveContext.infTable[0xB] & 0x40)) { - gSaveContext.infTable[0xB] |= 0x40; + if (!Flags_GetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET)) { + Flags_SetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET); } func_80A2F180(this); Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); @@ -330,8 +330,8 @@ void func_80A2F9C0(EnGb* this, PlayState* play) { void func_80A2FA50(EnGb* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { - if (!(gSaveContext.infTable[0xB] & 0x40)) { - gSaveContext.infTable[0xB] |= 0x40; + if (!Flags_GetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET)) { + Flags_SetInfTable(INFTABLE_SPOKE_TO_POE_COLLECTOR_IN_RUINED_MARKET); } func_80A2F180(this); Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 67e45b197..4f791371b 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -263,7 +263,7 @@ void EnGe1_KickPlayer(EnGe1* this, PlayState* play) { if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) { play->nextEntranceIndex = 0x1A5; - } else if (gSaveContext.eventChkInf[12] & 0x80) { // Caught previously + } else if (Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO)) { // Caught previously play->nextEntranceIndex = 0x5F8; } else { play->nextEntranceIndex = 0x3B4; @@ -532,9 +532,9 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { s32 getItemId; if (Actor_HasParent(&this->actor, play)) { - if (gSaveContext.n64ddFlag && gSaveContext.minigameScore >= 1500 && !(gSaveContext.infTable[25] & 1)) { - gSaveContext.itemGetInf[0] |= 0x8000; - gSaveContext.infTable[25] |= 1; + if (gSaveContext.n64ddFlag && gSaveContext.minigameScore >= 1500 && !Flags_GetInfTable(INFTABLE_190)) { + Flags_SetItemGetInf(ITEMGETINF_0F); + Flags_SetInfTable(INFTABLE_190); this->stateFlags |= GE1_STATE_GIVE_QUIVER; this->actor.parent = NULL; return; @@ -543,9 +543,9 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { } if (this->stateFlags & GE1_STATE_GIVE_QUIVER) { - gSaveContext.itemGetInf[0] |= 0x8000; + Flags_SetItemGetInf(ITEMGETINF_0F); } else { - gSaveContext.infTable[25] |= 1; + Flags_SetInfTable(INFTABLE_190); } } else { if (this->stateFlags & GE1_STATE_GIVE_QUIVER) { @@ -659,7 +659,7 @@ void EnGe1_BeginGame_Archery(EnGe1* this, PlayState* play) { play->fadeTransition = 0x26; play->sceneLoadFlag = 0x14; gSaveContext.eventInf[0] |= 0x100; - gSaveContext.eventChkInf[6] |= 0x100; + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_HORSEBACK_ARCHERY); if (!(player->stateFlags1 & 0x800000)) { func_8002DF54(play, &this->actor, 1); @@ -712,14 +712,14 @@ void EnGe1_TalkAfterGame_Archery(EnGe1* this, PlayState* play) { if (gSaveContext.minigameScore < 1000) { this->actor.textId = 0x6045; this->actionFunc = EnGe1_TalkNoPrize_Archery; - } else if (!(gSaveContext.infTable[25] & 1)) { + } else if (!Flags_GetInfTable(INFTABLE_190)) { this->actor.textId = 0x6046; this->actionFunc = EnGe1_TalkWinPrize_Archery; this->stateFlags &= ~GE1_STATE_GIVE_QUIVER; } else if (gSaveContext.minigameScore < 1500) { this->actor.textId = 0x6047; this->actionFunc = EnGe1_TalkNoPrize_Archery; - } else if (gSaveContext.itemGetInf[0] & 0x8000) { + } else if (Flags_GetItemGetInf(ITEMGETINF_0F)) { this->actor.textId = 0x6047; this->actionFunc = EnGe1_TalkNoPrize_Archery; } else { @@ -744,8 +744,8 @@ void EnGe1_Wait_Archery(EnGe1* this, PlayState* play) { if (!(player->stateFlags1 & 0x800000)) { EnGe1_SetTalkAction(this, play, 0x603F, 100.0f, EnGe1_TalkNoHorse_Archery); } else { - if (gSaveContext.eventChkInf[6] & 0x100) { - if (gSaveContext.infTable[25] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_HORSEBACK_ARCHERY)) { + if (Flags_GetInfTable(INFTABLE_190)) { textId = 0x6042; } else { textId = 0x6043; diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 7fe28fa58..9fd064f5a 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -234,7 +234,9 @@ s32 EnGe2_CheckCarpentersFreed(void) { } } - if ((u8)(gSaveContext.eventChkInf[9] & 0xF) == 0xF) { + if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & + (EVENTCHKINF_CARPENTERS_FREE_MASK_ALL | 0xF0), + EVENTCHKINF_CARPENTERS_FREE_MASK_ALL)) { return 1; } return 0; @@ -250,7 +252,7 @@ void EnGe2_CaptureClose(EnGe2* this, PlayState* play) { if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) { play->nextEntranceIndex = 0x1A5; - } else if (gSaveContext.eventChkInf[12] & 0x80) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO)) { play->nextEntranceIndex = 0x5F8; } else { play->nextEntranceIndex = 0x3B4; @@ -280,7 +282,7 @@ void EnGe2_CaptureCharge(EnGe2* this, PlayState* play) { if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) { play->nextEntranceIndex = 0x1A5; - } else if (gSaveContext.eventChkInf[12] & 0x80) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO)) { play->nextEntranceIndex = 0x5F8; } else { play->nextEntranceIndex = 0x3B4; diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 4b4f07a1e..bfa022612 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1568,7 +1568,7 @@ void EnGeldB_Draw(Actor* thisx, PlayState* play) { if (this->timer == 0) { if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) { play->nextEntranceIndex = 0x1A5; - } else if (gSaveContext.eventChkInf[12] & 0x80) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO)) { play->nextEntranceIndex = 0x5F8; } else { play->nextEntranceIndex = 0x3B4; diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 979a3d839..01475f9ae 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -324,55 +324,55 @@ void EnGirlA_SetupAction(EnGirlA* this, EnGirlAActionFunc func) { s32 EnGirlA_TryChangeShopItem(EnGirlA* this, PlayState* play) { switch (this->actor.params) { case SI_MILK_BOTTLE: - if (gSaveContext.itemGetInf[0] & 0x4) { + if (Flags_GetItemGetInf(ITEMGETINF_TALON_BOTTLE)) { this->actor.params = SI_HEART; return true; } break; case SI_BOMBCHU_10_2: - if (gSaveContext.itemGetInf[0] & 0x40) { + if (Flags_GetItemGetInf(ITEMGETINF_06)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_10_3: - if (gSaveContext.itemGetInf[0] & 0x80) { + if (Flags_GetItemGetInf(ITEMGETINF_07)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_20_3: - if (gSaveContext.itemGetInf[0] & 0x100) { + if (Flags_GetItemGetInf(ITEMGETINF_08)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_20_4: - if (gSaveContext.itemGetInf[0] & 0x200) { + if (Flags_GetItemGetInf(ITEMGETINF_09)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_10_4: - if (gSaveContext.itemGetInf[0] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_0A)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_10_1: - if (gSaveContext.itemGetInf[0] & 0x8) { + if (Flags_GetItemGetInf(ITEMGETINF_03)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_20_1: - if (gSaveContext.itemGetInf[0] & 0x10) { + if (Flags_GetItemGetInf(ITEMGETINF_04)) { this->actor.params = SI_SOLD_OUT; return true; } break; case SI_BOMBCHU_20_2: - if (gSaveContext.itemGetInf[0] & 0x20) { + if (Flags_GetItemGetInf(ITEMGETINF_05)) { this->actor.params = SI_SOLD_OUT; return true; } @@ -995,7 +995,7 @@ void EnGirlA_BuyEvent_ShieldDiscount(PlayState* play, EnGirlA* this) { gSaveContext.pendingSale = entry.itemId; gSaveContext.pendingSaleMod = entry.modIndex; if (this->actor.params == SI_HYLIAN_SHIELD) { - if (gSaveContext.infTable[7] & 0x40) { + if (Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) { Rupees_ChangeBy(-(this->basePrice - sShieldDiscounts[(s32)Rand_ZeroFloat(7.9f)])); return; } @@ -1031,28 +1031,28 @@ void EnGirlA_BuyEvent_ObtainBombchuPack(PlayState* play, EnGirlA* this) { switch (this->actor.params) { case SI_BOMBCHU_10_2: - gSaveContext.itemGetInf[0] |= 0x40; + Flags_SetItemGetInf(ITEMGETINF_06); break; case SI_BOMBCHU_10_3: - gSaveContext.itemGetInf[0] |= 0x80; + Flags_SetItemGetInf(ITEMGETINF_07); break; case SI_BOMBCHU_20_3: - gSaveContext.itemGetInf[0] |= 0x100; + Flags_SetItemGetInf(ITEMGETINF_08); break; case SI_BOMBCHU_20_4: - gSaveContext.itemGetInf[0] |= 0x200; + Flags_SetItemGetInf(ITEMGETINF_09); break; case SI_BOMBCHU_10_4: - gSaveContext.itemGetInf[0] |= 0x400; + Flags_SetItemGetInf(ITEMGETINF_0A); break; case SI_BOMBCHU_10_1: - gSaveContext.itemGetInf[0] |= 0x8; + Flags_SetItemGetInf(ITEMGETINF_03); break; case SI_BOMBCHU_20_1: - gSaveContext.itemGetInf[0] |= 0x10; + Flags_SetItemGetInf(ITEMGETINF_04); break; case SI_BOMBCHU_20_2: - gSaveContext.itemGetInf[0] |= 0x20; + Flags_SetItemGetInf(ITEMGETINF_05); break; } } @@ -1090,27 +1090,27 @@ void EnGirlA_SetItemDescription(PlayState* play, EnGirlA* this) { isMaskFreeToBorrow = false; switch (this->actor.params) { case SI_KEATON_MASK: - if (gSaveContext.itemGetInf[3] & 0x100) { + if (Flags_GetItemGetInf(ITEMGETINF_38)) { isMaskFreeToBorrow = true; } break; case SI_SPOOKY_MASK: - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { isMaskFreeToBorrow = true; } break; case SI_SKULL_MASK: - if (gSaveContext.itemGetInf[3] & 0x200) { + if (Flags_GetItemGetInf(ITEMGETINF_39)) { isMaskFreeToBorrow = true; } break; case SI_BUNNY_HOOD: - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { isMaskFreeToBorrow = true; } break; case SI_MASK_OF_TRUTH: - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { isMaskFreeToBorrow = true; } break; @@ -1184,7 +1184,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) { this->actor.objBankIndex = this->objBankIndex; switch (this->actor.params) { case SI_KEATON_MASK: - if (gSaveContext.itemGetInf[3] & 0x100) { + if (Flags_GetItemGetInf(ITEMGETINF_38)) { this->actor.textId = 0x70B6; } else { this->actor.textId = itemEntry->itemDescTextId; @@ -1192,7 +1192,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) { this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; break; case SI_SPOOKY_MASK: - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { this->actor.textId = 0x70B5; } else { this->actor.textId = itemEntry->itemDescTextId; @@ -1200,7 +1200,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) { this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; break; case SI_SKULL_MASK: - if (gSaveContext.itemGetInf[3] & 0x200) { + if (Flags_GetItemGetInf(ITEMGETINF_39)) { this->actor.textId = 0x70B4; } else { this->actor.textId = itemEntry->itemDescTextId; @@ -1208,7 +1208,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) { this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; break; case SI_BUNNY_HOOD: - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { this->actor.textId = 0x70B7; } else { this->actor.textId = itemEntry->itemDescTextId; @@ -1216,7 +1216,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) { this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; break; case SI_MASK_OF_TRUTH: - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { this->actor.textId = 0x70BB; this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; } else { diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 4915ef9a5..ef171a89a 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -147,14 +147,14 @@ void EnGm_UpdateEye(EnGm* this) { void EnGm_SetTextID(EnGm* this) { switch (func_80A3D7C8()) { case 0: - if (gSaveContext.infTable[11] & 1) { + if (Flags_GetInfTable(INFTABLE_B0)) { this->actor.textId = 0x304B; } else { this->actor.textId = 0x304A; } break; case 1: - if (gSaveContext.infTable[11] & 2) { + if (Flags_GetInfTable(INFTABLE_B1)) { this->actor.textId = 0x304F; } else { this->actor.textId = 0x304C; @@ -208,16 +208,16 @@ void func_80A3DC44(EnGm* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, play)) { switch (func_80A3D7C8()) { case 0: - gSaveContext.infTable[11] |= 1; + Flags_SetInfTable(INFTABLE_B0); case 3: this->actionFunc = func_80A3DD7C; return; case 1: - gSaveContext.infTable[11] |= 2; + Flags_SetInfTable(INFTABLE_B1); if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { //Resets "Talked to Medigoron" flag in infTable to restore initial conversation state - gSaveContext.infTable[11] &= ~2; + Flags_UnsetInfTable(INFTABLE_B1); } case 2: this->actionFunc = EnGm_ProcessChoiceIndex; @@ -259,7 +259,7 @@ void EnGm_ProcessChoiceIndex(EnGm* this, PlayState* play) { !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { itemEntry = Randomizer_GetItemFromKnownCheck(RC_GC_MEDIGORON, GI_SWORD_KNIFE); GiveItemEntryFromActor(&this->actor, play, itemEntry, 415.0f, 10.0f); - gSaveContext.infTable[11] |= 2; + Flags_SetInfTable(INFTABLE_B1); } else { itemEntry = ItemTable_Retrieve(GI_SWORD_KNIFE); func_8002F434(&this->actor, play, GI_SWORD_KNIFE, 415.0f, 10.0f); @@ -292,7 +292,7 @@ void func_80A3DF00(EnGm* this, PlayState* play) { !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_GC_MEDIGORON, GI_SWORD_KNIFE); GiveItemEntryFromActor(&this->actor, play, itemEntry, 415.0f, 10.0f); - gSaveContext.infTable[11] |= 2; + Flags_SetInfTable(INFTABLE_B1); } else { func_8002F434(&this->actor, play, GI_SWORD_KNIFE, 415.0f, 10.0f); diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index 3e264be77..1cbb24439 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -115,20 +115,20 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x00: if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) { - if (gSaveContext.infTable[16] & 0x8000) { + if (Flags_GetInfTable(INFTABLE_10F)) { return 0x3042; } else { return 0x3041; } - } else if (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1) || (gSaveContext.infTable[16] & 0x2000)) { - if (gSaveContext.infTable[16] & 0x4000) { + } else if (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1) || (Flags_GetInfTable(INFTABLE_10D))) { + if (Flags_GetInfTable(INFTABLE_SPOKE_TO_GORON_LINK)) { return 0x3038; } else { return 0x3037; } } else { - if (gSaveContext.infTable[16] & 0x200) { - if (gSaveContext.infTable[16] & 0x400) { + if (Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { + if (Flags_GetInfTable(INFTABLE_10A)) { return 0x3033; } else { return 0x3032; @@ -146,9 +146,9 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x20: if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; - } else if (gSaveContext.eventChkInf[2] & 0x8) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) { return 0x3021; - } else if (gSaveContext.infTable[14] & 0x1) { + } else if (Flags_GetInfTable(INFTABLE_E0)) { return 0x302A; } else { return 0x3008; @@ -156,7 +156,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x30: if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; - } else if (gSaveContext.eventChkInf[2] & 0x8) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) { return 0x3026; } else { return 0x3009; @@ -164,7 +164,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x40: if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; - } else if (gSaveContext.eventChkInf[2] & 0x8) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) { return 0x3026; } else { return 0x300A; @@ -172,7 +172,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x50: if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; - } else if (gSaveContext.infTable[15] & 1) { + } else if (Flags_GetInfTable(INFTABLE_F0)) { return 0x3015; } else { return 0x3014; @@ -180,7 +180,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x60: if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; - } else if (gSaveContext.infTable[15] & 0x10) { + } else if (Flags_GetInfTable(INFTABLE_F4)) { return 0x3017; } else { return 0x3016; @@ -188,7 +188,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { case 0x70: if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; - } else if (gSaveContext.infTable[15] & 0x100) { + } else if (Flags_GetInfTable(INFTABLE_F8)) { return 0x3019; } else { return 0x3018; @@ -209,36 +209,36 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (thisx->textId) { case 0x3008: - gSaveContext.infTable[14] |= 1; + Flags_SetInfTable(INFTABLE_E0); unkState = NPC_TALK_STATE_IDLE; break; case 0x300B: - gSaveContext.infTable[14] |= 0x800; + Flags_SetInfTable(INFTABLE_EB); unkState = NPC_TALK_STATE_IDLE; break; case 0x3014: - gSaveContext.infTable[15] |= 1; + Flags_SetInfTable(INFTABLE_F0); unkState = NPC_TALK_STATE_IDLE; break; case 0x3016: - gSaveContext.infTable[15] |= 0x10; + Flags_SetInfTable(INFTABLE_F4); unkState = NPC_TALK_STATE_IDLE; break; case 0x3018: - gSaveContext.infTable[15] |= 0x100; + Flags_SetInfTable(INFTABLE_F8); unkState = NPC_TALK_STATE_IDLE; break; case 0x3036: func_8002F434(thisx, play, GI_TUNIC_GORON, xzRange, yRange); - gSaveContext.infTable[16] |= 0x2000; // EnGo exclusive flag + Flags_SetInfTable(INFTABLE_10D); // EnGo exclusive flag unkState = NPC_TALK_STATE_ACTION; break; case 0x3037: - gSaveContext.infTable[16] |= 0x4000; + Flags_SetInfTable(INFTABLE_SPOKE_TO_GORON_LINK); unkState = NPC_TALK_STATE_IDLE; break; case 0x3041: - gSaveContext.infTable[16] |= 0x8000; + Flags_SetInfTable(INFTABLE_10F); unkState = NPC_TALK_STATE_IDLE; break; case 0x3059: @@ -263,7 +263,7 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) { switch (thisx->textId) { case 0x300A: if (play->msgCtx.choiceIndex == 0) { - if (CUR_UPG_VALUE(UPG_STRENGTH) != 0 || (gSaveContext.infTable[14] & 0x800)) { + if (CUR_UPG_VALUE(UPG_STRENGTH) != 0 || (Flags_GetInfTable(INFTABLE_EB))) { thisx->textId = 0x300B; } else { thisx->textId = 0x300C; @@ -276,12 +276,12 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) { break; case 0x3034: if (play->msgCtx.choiceIndex == 0) { - if (gSaveContext.infTable[16] & 0x800) { + if (Flags_GetInfTable(INFTABLE_10B)) { thisx->textId = 0x3033; } else { thisx->textId = 0x3035; } - } else if (gSaveContext.infTable[16] & 0x800) { + } else if (Flags_GetInfTable(INFTABLE_10B)) { thisx->textId = 0x3036; } else { thisx->textId = 0x3033; @@ -298,7 +298,7 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) { Message_ContinueTextbox(play, thisx->textId); unkState = NPC_TALK_STATE_TALKING; } - gSaveContext.infTable[11] |= 0x10; + Flags_SetInfTable(INFTABLE_B4); break; } } @@ -307,7 +307,7 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) { if (Message_ShouldAdvance(play)) { switch (thisx->textId) { case 0x3035: - gSaveContext.infTable[16] |= 0x800; + Flags_SetInfTable(INFTABLE_10B); case 0x3032: case 0x3033: thisx->textId = 0x3034; @@ -598,7 +598,7 @@ void func_80A3F908(EnGo* this, PlayState* play) { if (((this->actor.params & 0xF0) == 0x90) && (isUnkCondition == true)) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_SWORD_BROKEN) { if (func_8002F368(play) == EXCH_ITEM_SWORD_BROKEN) { - if (gSaveContext.infTable[11] & 0x10) { + if (Flags_GetInfTable(INFTABLE_B4)) { this->actor.textId = 0x3055; } else { this->actor.textId = 0x3054; @@ -666,7 +666,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { EnGo_SetupAction(this, EnGo_FireGenericActionFunc); break; case 0x40: - if (gSaveContext.infTable[14] & 0x800) { + if (Flags_GetInfTable(INFTABLE_EB)) { EnGo_SetMovedPos(this, play); } Actor_SetScale(&this->actor, 0.015f); @@ -754,7 +754,7 @@ void EnGo_GoronLinkRolling(EnGo* this, PlayState* play) { (this->unk_218 == 0)) { this->actor.speedXZ = 0.0f; EnGo_SetupAction(this, func_80A4008C); - gSaveContext.infTable[16] |= 0x200; + Flags_SetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED); } this->actor.shape.rot = this->actor.world.rot; @@ -849,7 +849,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { this->skelAnime.curFrame = lastFrame; this->skelAnime.playSpeed = 0.0f; this->unk_212 = Rand_S16Offset(30, 30); - if (((this->actor.params & 0xF0) == 0x40) && ((gSaveContext.infTable[14] & 0x800) == 0)) { + if (((this->actor.params & 0xF0) == 0x40) && ((Flags_GetInfTable(INFTABLE_EB)) == 0)) { EnGo_SetupAction(this, func_80A40B1C); } else { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); @@ -936,7 +936,7 @@ void func_80A40A54(EnGo* this, PlayState* play) { } void func_80A40B1C(EnGo* this, PlayState* play) { - if (gSaveContext.infTable[14] & 0x800) { + if (Flags_GetInfTable(INFTABLE_EB)) { EnGo_ChangeAnim(this, ENGO_ANIM_3); EnGo_SetupAction(this, func_80A40A54); } else { diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 100f9721f..69180ee62 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -10,27 +10,27 @@ /* FLAGS -gSaveContext.eventChkInf[2] & 0x8 - DC entrance boulder blown up as child +Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE) - DC entrance boulder blown up as child InfTable -gSaveContext.infTable[11] & 0x10 -gSaveContext.infTable[14] & 0x1 - Talked to DMT Goron at DC entrance (Before DC is opened as child) -gSaveContext.infTable[14] & 0x8 - Talked to GC Goron in bottom level stairwell -gSaveContext.infTable[14] & 0x40 - Talked to GC Goron at LW entrance (Before LW shortcut is opened) -gSaveContext.infTable[14] & 0x800 - Talked to DMT Goron at Bomb Flower with goron bracelet -gSaveContext.infTable[15] & 0x1 - Talked to Goron at GC Entrance (Before goron ruby is obtained) -gSaveContext.infTable[15] & 0x10 - Talked to Goron at GC Island (Before goron ruby is obtained) -gSaveContext.infTable[15] & 0x100 - (not on cloud modding) Talked to GC Goron outside Darunias door (after opening door, -before getting goron bracelet) gSaveContext.infTable[16] & 0x200 - Obtained Fire Tunic from Goron Link -gSaveContext.infTable[16] & 0x400 - (not on cloud modding) -gSaveContext.infTable[16] & 0x800 - Spoke to Goron Link About Volvagia -gSaveContext.infTable[16] & 0x1000 - Stopped Goron Link's Rolling -gSaveContext.infTable[16] & 0x2000 - EnGo Exclusive -gSaveContext.infTable[16] & 0x4000 - Spoke to Goron Link -gSaveContext.infTable[16] & 0x8000 - (not on cloud modding) +Flags_GetInfTable(INFTABLE_B4) +Flags_GetInfTable(INFTABLE_E0) - Talked to DMT Goron at DC entrance (Before DC is opened as child) +Flags_GetInfTable(INFTABLE_E3) - Talked to GC Goron in bottom level stairwell +Flags_GetInfTable(INFTABLE_E6) - Talked to GC Goron at LW entrance (Before LW shortcut is opened) +Flags_GetInfTable(INFTABLE_EB) - Talked to DMT Goron at Bomb Flower with goron bracelet +Flags_GetInfTable(INFTABLE_F0) - Talked to Goron at GC Entrance (Before goron ruby is obtained) +Flags_GetInfTable(INFTABLE_F4) - Talked to Goron at GC Island (Before goron ruby is obtained) +Flags_GetInfTable(INFTABLE_F8) - (not on cloud modding) Talked to GC Goron outside Darunias door (after opening door, +before getting goron bracelet) Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED) - Obtained Fire Tunic from Goron Link +Flags_GetInfTable(INFTABLE_10A) - (not on cloud modding) +Flags_GetInfTable(INFTABLE_10B) - Spoke to Goron Link About Volvagia +Flags_GetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING) - Stopped Goron Link's Rolling +Flags_GetInfTable(INFTABLE_10D) - EnGo Exclusive +Flags_GetInfTable(INFTABLE_SPOKE_TO_GORON_LINK) - Spoke to Goron Link +Flags_GetInfTable(INFTABLE_10F) - (not on cloud modding) -gSaveContext.infTable[17] & 0x4000 - Bomb bag upgrade obtained from rolling Goron +Flags_GetInfTable(INFTABLE_11E) - Bomb bag upgrade obtained from rolling Goron EnGo pathIndex: this->actor.params & 0xF @@ -333,7 +333,7 @@ u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityRollingBig(PlayState* play, EnGo2* this) { - if (gSaveContext.infTable[17] & 0x4000) { + if (Flags_GetInfTable(INFTABLE_11E)) { return 0x3013; } else if ((CUR_CAPACITY(UPG_BOMB_BAG) >= 20 || gSaveContext.n64ddFlag) && this->waypoint > 7 && this->waypoint < 12) { return 0x3012; @@ -356,7 +356,7 @@ s16 EnGo2_UpdateTalkStateGoronCityRollingBig(PlayState* play, EnGo2* this) { EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40)); } Message_CloseTextbox(play); - gSaveContext.infTable[17] |= 0x4000; + Flags_SetInfTable(INFTABLE_11E); return NPC_TALK_STATE_ACTION; } else { return NPC_TALK_STATE_ACTION; @@ -375,8 +375,8 @@ u16 EnGo2_GetTextIdGoronDmtBombFlower(PlayState* play, EnGo2* this) { s16 EnGo2_UpdateTalkStateGoronDmtBombFlower(PlayState* play, EnGo2* this) { switch (Message_GetState(&play->msgCtx)) { case TEXT_STATE_CLOSING: - if ((this->actor.textId == 0x300B) && (gSaveContext.infTable[14] & 0x800) == 0) { - gSaveContext.infTable[14] |= 0x800; + if ((this->actor.textId == 0x300B) && (Flags_GetInfTable(INFTABLE_EB)) == 0) { + Flags_SetInfTable(INFTABLE_EB); return NPC_TALK_STATE_ACTION; } else { return NPC_TALK_STATE_IDLE; @@ -403,7 +403,7 @@ u16 EnGo2_GetTextIdGoronDmtRollingSmall(PlayState* play, EnGo2* this) { if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return 0x3027; } else { - return (gSaveContext.eventChkInf[2] & 0x8) ? 0x3026 : 0x3009; + return (Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE)) ? 0x3026 : 0x3009; } } @@ -423,14 +423,14 @@ u16 EnGo2_GetTextIdGoronDmtDcEntrance(PlayState* play, EnGo2* this) { (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { - return gSaveContext.eventChkInf[2] & 0x8 ? 0x3021 : gSaveContext.infTable[14] & 0x1 ? 0x302A : 0x3008; + return Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE) ? 0x3021 : Flags_GetInfTable(INFTABLE_E0) ? 0x302A : 0x3008; } } s16 EnGo2_UpdateTalkStateGoronDmtDcEntrance(PlayState* play, EnGo2* this) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { if (this->actor.textId == 0x3008) { - gSaveContext.infTable[14] |= 0x1; + Flags_SetInfTable(INFTABLE_E0); } return NPC_TALK_STATE_IDLE; } else { @@ -446,14 +446,14 @@ u16 EnGo2_GetTextIdGoronCityEntrance(PlayState* play, EnGo2* this) { (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { - return gSaveContext.infTable[15] & 0x1 ? 0x3015 : 0x3014; + return Flags_GetInfTable(INFTABLE_F0) ? 0x3015 : 0x3014; } } s16 EnGo2_UpdateTalkStateGoronCityEntrance(PlayState* play, EnGo2* this) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { if (this->actor.textId == 0x3014) { - gSaveContext.infTable[15] |= 0x1; + Flags_SetInfTable(INFTABLE_F0); } return NPC_TALK_STATE_IDLE; } else { @@ -469,14 +469,14 @@ u16 EnGo2_GetTextIdGoronCityIsland(PlayState* play, EnGo2* this) { (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { - return gSaveContext.infTable[15] & 0x10 ? 0x3017 : 0x3016; + return Flags_GetInfTable(INFTABLE_F4) ? 0x3017 : 0x3016; } } s16 EnGo2_UpdateTalkStateGoronCityIsland(PlayState* play, EnGo2* this) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { if (this->actor.textId == 0x3016) { - gSaveContext.infTable[15] |= 0x10; + Flags_SetInfTable(INFTABLE_F4); } return NPC_TALK_STATE_IDLE; } else { @@ -494,7 +494,7 @@ u16 EnGo2_GetTextIdGoronCityLowestFloor(PlayState* play, EnGo2* this) { } else { return CUR_UPG_VALUE(UPG_STRENGTH) != 0 ? 0x302C : !Flags_GetSwitch(play, 0x1B) ? 0x3017 - : gSaveContext.infTable[15] & 0x100 ? 0x3019 + : Flags_GetInfTable(INFTABLE_F8) ? 0x3019 : 0x3018; } } @@ -502,7 +502,7 @@ u16 EnGo2_GetTextIdGoronCityLowestFloor(PlayState* play, EnGo2* this) { s16 EnGo2_UpdateTalkStateGoronCityLowestFloor(PlayState* play, EnGo2* this) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { if (this->actor.textId == 0x3018) { - gSaveContext.infTable[15] |= 0x100; + Flags_SetInfTable(INFTABLE_F8); } return NPC_TALK_STATE_IDLE; } else { @@ -526,13 +526,13 @@ u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) { } if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) { - return gSaveContext.infTable[16] & 0x8000 ? 0x3042 : 0x3041; + return Flags_GetInfTable(INFTABLE_10F) ? 0x3042 : 0x3041; } else if (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) { - return gSaveContext.infTable[16] & 0x4000 ? 0x3038 : 0x3037; - } else if (gSaveContext.infTable[16] & 0x1000) { + return Flags_GetInfTable(INFTABLE_SPOKE_TO_GORON_LINK) ? 0x3038 : 0x3037; + } else if (Flags_GetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING)) { this->unk_20C = 0; this->dialogState = TEXT_STATE_NONE; - return gSaveContext.infTable[16] & 0x400 ? 0x3033 : 0x3032; + return Flags_GetInfTable(INFTABLE_10A) ? 0x3033 : 0x3032; } else { return 0x3030; } @@ -559,7 +559,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) { return NPC_TALK_STATE_ACTION; } case 0x3037: - gSaveContext.infTable[16] |= 0x4000; + Flags_SetInfTable(INFTABLE_SPOKE_TO_GORON_LINK); default: return NPC_TALK_STATE_IDLE; } @@ -567,12 +567,12 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) { if (Message_ShouldAdvance(play)) { if (this->actor.textId == 0x3034) { if (play->msgCtx.choiceIndex == 0) { - this->actor.textId = gSaveContext.infTable[16] & 0x800 ? 0x3033 : 0x3035; + this->actor.textId = Flags_GetInfTable(INFTABLE_10B) ? 0x3033 : 0x3035; if (this->actor.textId == 0x3035) { Audio_StopSfxById(NA_SE_EN_GOLON_CRY); } } else { - this->actor.textId = gSaveContext.infTable[16] & 0x800 ? 0x3036 : 0x3033; + this->actor.textId = Flags_GetInfTable(INFTABLE_10B) ? 0x3036 : 0x3033; if (this->actor.textId == 0x3036) { Audio_StopSfxById(NA_SE_EN_GOLON_CRY); } @@ -588,7 +588,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) { if (Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x3035: - gSaveContext.infTable[16] |= 0x800; + Flags_SetInfTable(INFTABLE_10B); case 0x3032: case 0x3033: this->actor.textId = 0x3034; @@ -719,13 +719,13 @@ s16 EnGo2_UpdateTalkStateGoronFireGeneric(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityStairwell(PlayState* play, EnGo2* this) { - return !LINK_IS_ADULT ? gSaveContext.infTable[14] & 0x8 ? 0x3022 : 0x300E : 0x3043; + return !LINK_IS_ADULT ? Flags_GetInfTable(INFTABLE_E3) ? 0x3022 : 0x300E : 0x3043; } s16 EnGo2_UpdateTalkStateGoronCityStairwell(PlayState* play, EnGo2* this) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { if (this->actor.textId == 0x300E) { - gSaveContext.infTable[14] |= 0x8; + Flags_SetInfTable(INFTABLE_E3); } return NPC_TALK_STATE_IDLE; } else { @@ -751,7 +751,7 @@ u16 EnGo2_GetTextIdGoronCityLostWoods(PlayState* play, EnGo2* this) { if (Flags_GetSwitch(play, 0x1C)) { return 0x302F; } else { - return gSaveContext.infTable[14] & 0x40 ? 0x3025 : 0x3024; + return Flags_GetInfTable(INFTABLE_E6) ? 0x3025 : 0x3024; } } else { return 0x3043; @@ -761,7 +761,7 @@ u16 EnGo2_GetTextIdGoronCityLostWoods(PlayState* play, EnGo2* this) { s16 EnGo2_UpdateTalkStateGoronCityLostWoods(PlayState* play, EnGo2* this) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { if (this->actor.textId == 0x3024) { - gSaveContext.infTable[14] |= 0x40; + Flags_SetInfTable(INFTABLE_E6); } return NPC_TALK_STATE_IDLE; } else { @@ -1114,7 +1114,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { } else if (INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_SWORD_BROKEN) { if (func_8002F368(play) == EXCH_ITEM_SWORD_BROKEN) { - if (gSaveContext.infTable[11] & 0x10) { + if (Flags_GetInfTable(INFTABLE_B4)) { textId = 0x3055; } else { textId = 0x3054; @@ -1413,7 +1413,7 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) { void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { if ((this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || (this->actor.params & 0x1F) == GORON_CITY_LINK) { this->collider.info.bumperFlags = 1; - this->actor.speedXZ = gSaveContext.infTable[17] & 0x4000 ? 6.0f : 3.6000001f; + this->actor.speedXZ = Flags_GetInfTable(INFTABLE_11E) ? 6.0f : 3.6000001f; } else { this->actor.speedXZ = 6.0f; } @@ -1637,7 +1637,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { EnGo2_GetItemAnimation(this, play); break; case GORON_CITY_LINK: - if ((gSaveContext.infTable[16] & 0x200)) { + if ((Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED))) { Path_CopyLastPoint(this->path, &this->actor.world.pos); this->actor.home.pos = this->actor.world.pos; if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || @@ -1648,7 +1648,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnGo2_CurledUp; } } else { - gSaveContext.infTable[16] &= ~0x1000; + Flags_UnsetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING); this->collider.dim.height = (D_80A4816C[this->actor.params & 0x1F].height * 0.6f); EnGo2_SetupRolling(this, play); this->isAwake = true; @@ -1679,7 +1679,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnGo2_CurledUp; break; case GORON_DMT_BOMB_FLOWER: - if (gSaveContext.infTable[14] & 0x800) { + if (Flags_GetInfTable(INFTABLE_EB)) { Path_CopyLastPoint(this->path, &this->actor.world.pos); this->actor.home.pos = this->actor.world.pos; } @@ -1902,7 +1902,7 @@ void EnGo2_SetGetItem(EnGo2* this, PlayState* play) { EnGo2_GetItemAnimation(this, play); return; case GI_TUNIC_GORON: - gSaveContext.infTable[16] |= 0x200; + Flags_SetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED); EnGo2_GetItemAnimation(this, play); return; case GI_SWORD_BGS: @@ -1996,7 +1996,7 @@ void EnGo2_GoronLinkStopRolling(EnGo2* this, PlayState* play) { if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) { player->actor.freezeTimer = 10; } else { - gSaveContext.infTable[16] |= 0x1000; + Flags_SetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING); this->trackingMode = NPC_TRACKING_NONE; this->unk_211 = false; this->isAwake = false; diff --git a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 910d30fd7..549b8d9e1 100644 --- a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -53,7 +53,7 @@ static InitChainEntry sInitChain[] = { void EnGuest_Init(Actor* thisx, PlayState* play) { EnGuest* this = (EnGuest*)thisx; - if (gSaveContext.infTable[7] & 0x40) { + if (Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) { Actor_Kill(&this->actor); } else { this->osAnimeBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_OS_ANIME); diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 65c6a8cd7..99c130e60 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -120,11 +120,11 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) { // eventChkInf[4] & 1 = Got Zelda's Letter // eventChkInf[5] & 0x200 = Got item from impa // eventChkInf[8] & 1 = Ocarina thrown in moat - bool metZelda = (gSaveContext.eventChkInf[4] & 1) && (gSaveContext.eventChkInf[5] & 0x200); + bool metZelda = (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)); if (this->type != 5) { if ((gSaveContext.dayTime < 0xB888 || IS_DAY) && - ((!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[8] & 1)) || + ((!gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) || (gSaveContext.n64ddFlag && !metZelda))) { this->actionFunc = EnHeishi1_SetupWalk; } else { @@ -132,7 +132,7 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) { } } else { if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || - (!gSaveContext.n64ddFlag && gSaveContext.eventChkInf[8] & 1) || + (!gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) || (gSaveContext.n64ddFlag && metZelda)) { this->actionFunc = EnHeishi1_SetupWaitNight; } else { @@ -365,7 +365,7 @@ void EnHeishi1_Kick(EnHeishi1* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); if (!this->loadStarted) { - gSaveContext.eventChkInf[4] |= 0x4000; + Flags_SetEventChkInf(EVENTCHKINF_CAUGHT_BY_CASTLE_GUARDS); play->nextEntranceIndex = 0x4FA; play->sceneLoadFlag = 0x14; this->loadStarted = true; diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 85e24b4ea..60f6039e1 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -191,8 +191,8 @@ void func_80A53278(EnHeishi2* this, PlayState* play) { this->unk_30B = 1; this->unk_300 = TEXT_STATE_DONE; this->actionFunc = func_80A5475C; - } else if ((gSaveContext.eventChkInf[0] & 0x200) && (gSaveContext.eventChkInf[2] & 0x20) && - (gSaveContext.eventChkInf[3] & 0x80)) { + } else if ((Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) && + (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP))) { // "Get all spiritual stones!" osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 全部の精霊石GET! ☆☆☆☆☆ \n" VT_RST); this->unk_300 = TEXT_STATE_DONE; @@ -211,7 +211,7 @@ void func_80A53278(EnHeishi2* this, PlayState* play) { this->unk_300 = TEXT_STATE_DONE; this->actor.textId = 0x7099; this->actionFunc = func_80A5475C; - } else if (gSaveContext.eventChkInf[1] & 4) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG)) { if (this->unk_30E == 0) { // "Start under the first sleeve!" osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ 1回目袖の下開始! ☆☆☆☆☆ \n" VT_RST); @@ -354,8 +354,8 @@ void func_80A5399C(EnHeishi2* this, PlayState* play) { this->unk_30B = 0; var = 0; - if (gSaveContext.infTable[7] & 0x40) { - if (!(gSaveContext.infTable[7] & 0x80)) { + if (Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) { + if (!Flags_GetInfTable(INFTABLE_GATE_GUARD_PUT_ON_KEATON_MASK)) { if (Player_GetMask(play) == PLAYER_MASK_KEATON) { if (this->unk_309 == 0) { this->actor.textId = 0x200A; @@ -526,7 +526,7 @@ void func_80A53F30(EnHeishi2* this, PlayState* play) { void func_80A54038(EnHeishi2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { - gSaveContext.infTable[7] |= 0x40; + Flags_SetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD); Message_CloseTextbox(play); func_8002DF54(play, 0, 7); this->actionFunc = func_80A53908; @@ -541,8 +541,8 @@ void func_80A540C0(EnHeishi2* this, PlayState* play) { this->actor.textId = 0x2020; Message_ContinueTextbox(play, this->actor.textId); Player_UnsetMask(play); - gSaveContext.infTable[7] |= 0x80; - gSaveContext.itemGetInf[3] |= 0x100; + Flags_SetInfTable(INFTABLE_GATE_GUARD_PUT_ON_KEATON_MASK); + Flags_SetItemGetInf(ITEMGETINF_38); Item_Give(play, ITEM_SOLD_OUT); if (this->unk_30A != 0) { this->unk_30A = 2; @@ -848,7 +848,7 @@ void EnHeishi2_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi2_OverrideLimbDraw, EnHeishi2_PostLimbDraw, this); - if ((this->type == 5) && (gSaveContext.infTable[7] & 0x80)) { + if ((this->type == 5) && (Flags_GetInfTable(INFTABLE_GATE_GUARD_PUT_ON_KEATON_MASK))) { linkObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD); if (linkObjBankIndex >= 0) { Matrix_Put(&this->mtxf_330); diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 83dae5d81..04069f762 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -205,7 +205,7 @@ void func_80A55D00(EnHeishi3* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play) && (this->respawnFlag == 0)) { - gSaveContext.eventChkInf[4] |= 0x4000; + Flags_SetEventChkInf(EVENTCHKINF_CAUGHT_BY_CASTLE_GUARDS); play->nextEntranceIndex = 0x47E; // Hyrule Castle from Guard Capture (outside) play->sceneLoadFlag = 0x14; this->respawnFlag = 1; diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 9fffe1c7a..c0986aa7f 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -134,12 +134,12 @@ void func_80A563BC(EnHeishi4* this, PlayState* play) { this->unk_2B4 = 1; this->actionFunc = func_80A56B40; } else { - if (gSaveContext.eventChkInf[8] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) { this->actor.textId = 0x5065; this->actionFunc = func_80A56B40; return; } - if (gSaveContext.eventChkInf[4] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) { this->actor.textId = 0x5068; this->actionFunc = func_80A56B40; return; @@ -215,14 +215,14 @@ void func_80A56614(EnHeishi4* this, PlayState* play) { } void func_80A5673C(EnHeishi4* this, PlayState* play) { - if (gSaveContext.eventChkInf[4] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) { osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ マスターソード祝入手! ☆☆☆☆☆ \n" VT_RST); Actor_Kill(&this->actor); return; } this->unk_284 = 0; - if (gSaveContext.eventChkInf[8] & 1) { - if (!(gSaveContext.infTable[6] & 0x1000)) { + if (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) { + if (!Flags_GetInfTable(INFTABLE_6C)) { f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardAnim_00C444); Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardAnim_00C444, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f); @@ -269,7 +269,7 @@ void func_80A56994(EnHeishi4* this, PlayState* play) { func_80038290(play, &this->actor, &this->unk_260, &this->unk_266, this->actor.focus.pos); if ((this->unk_282 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - gSaveContext.infTable[6] |= 0x1000; + Flags_SetInfTable(INFTABLE_6C); func_8002DF54(play, NULL, 8); this->actionFunc = func_80A56A50; } diff --git a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 6fa5f68b6..58efc9abb 100644 --- a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -462,7 +462,7 @@ s32 EnHorse_BgCheckBridgeJumpPoint(EnHorse* this, PlayState* play) { if (this->actor.speedXZ < 12.8f) { return false; } - if ((gSaveContext.eventChkInf[9] & 0xF) == 0xF) { + if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { return false; } @@ -681,7 +681,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) { player = GET_PLAYER(play); if (play->sceneNum != SCENE_SPOT20 || //! Same flag checked twice - (Flags_GetEventChkInf(0x18) && ((gSaveContext.eventInf[0] & 0xF) != 6 || Flags_GetEventChkInf(0x18))) || + (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && ((gSaveContext.eventInf[0] & 0xF) != 6 || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) || // always load two spawns inside lon lon ((sHorseSpawns[i].pos.x == 856 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -918) || (sHorseSpawns[i].pos.x == -1003 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -755))) { @@ -792,7 +792,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP | ENHORSE_UNRIDEABLE; } else if (this->actor.params == 6) { this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP; - if (Flags_GetEventChkInf(0x18) || DREG(1) != 0) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0) { this->stateFlags &= ~ENHORSE_CANT_JUMP; this->stateFlags |= ENHORSE_FLAG_26; } else if (gSaveContext.eventInf[0] & 0x40 && this->type == HORSE_HNI) { @@ -806,7 +806,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } if (play->sceneNum == SCENE_SPOT20 && (gSaveContext.eventInf[0] & 0xF) == 6 && - Flags_GetEventChkInf(0x18) == 0 && !DREG(1)) { + Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) == 0 && !DREG(1)) { this->stateFlags |= ENHORSE_FLAG_25; } @@ -832,7 +832,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { Actor_Kill(&this->actor); return; } - if (Flags_GetEventChkInf(0x18)) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { Actor_Kill(&this->actor); return; } @@ -840,12 +840,12 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { Actor_Kill(&this->actor); return; } - } else if (!Flags_GetEventChkInf(0x18) && !DREG(1) && !IS_DAY) { + } else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1) && !IS_DAY) { Actor_Kill(&this->actor); return; } } else if (play->sceneNum == SCENE_MALON_STABLE) { - if (IS_DAY || Flags_GetEventChkInf(0x18) || DREG(1) != 0 || !LINK_IS_ADULT) { + if (IS_DAY || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0 || !LINK_IS_ADULT) { Actor_Kill(&this->actor); return; } @@ -882,7 +882,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } else if (this->actor.params == 8) { EnHorse_InitHorsebackArchery(this); Interface_InitHorsebackArchery(play); - } else if (play->sceneNum == SCENE_SPOT20 && !Flags_GetEventChkInf(0x18) && !DREG(1)) { + } else if (play->sceneNum == SCENE_SPOT20 && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1)) { EnHorse_InitFleePlayer(this); } else { if (play->sceneNum == SCENE_SOUKO) { @@ -2517,7 +2517,7 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) { if (play->interfaceCtx.hbaAmmo != 0) { if (!(this->hbaFlags & 2)) { - if (gSaveContext.infTable[25] & 1) { + if (Flags_GetInfTable(INFTABLE_190)) { if ((s32)gSaveContext.minigameScore >= 1500) { this->hbaFlags |= 4; } @@ -3554,7 +3554,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->stateFlags &= ~ENHORSE_FLAG_24; } - if (play->sceneNum == SCENE_SPOT09 && (gSaveContext.eventChkInf[9] & 0xF) != 0xF) { + if (play->sceneNum == SCENE_SPOT09 && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { EnHorse_CheckBridgeJumps(this, play); } diff --git a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 60d6d4a60..5921a13c3 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -441,7 +441,7 @@ void EnHorseGameCheck_Init(Actor* thisx, PlayState* play) { s32 pad; EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx; - if ((play->sceneNum == SCENE_SPOT20) && (Flags_GetEventChkInf(0x18) || DREG(1))) { + if ((play->sceneNum == SCENE_SPOT20) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1))) { this->actor.params = HORSEGAME_MALON_RACE; } if (sInitFuncs[this->actor.params] != NULL) { diff --git a/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 0710bb9be..c1ffa1487 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -166,11 +166,11 @@ void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) { if (gSaveContext.sceneSetupIndex > 3) { func_80A69EC0(this); } else if (play->sceneNum == SCENE_SPOT20) { - if (!Flags_GetEventChkInf(0x14)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); return; } - this->unk_2A0 = gSaveContext.eventChkInf[1] & 0x40; + this->unk_2A0 = Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); func_80A69EC0(this); } else { func_80A69EC0(this); @@ -359,17 +359,17 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) { return; } - if (((gSaveContext.eventChkInf[1] & 0x40) && (DREG(53) != 0)) || + if (((Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON)) && (DREG(53) != 0)) || ((play->sceneNum == SCENE_SPOT20) && (gSaveContext.cutsceneIndex == 0xFFF1))) { func_80A6A4DC(this); } else { - this->unk_2A0 = gSaveContext.eventChkInf[1] & 0x40; + this->unk_2A0 = Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); } newAnimationIdx = this->animationIdx; animationEnded = SkelAnime_Update(&this->skin.skelAnime); if (animationEnded || (this->animationIdx == 1) || (this->animationIdx == 0)) { - if (gSaveContext.eventChkInf[1] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH)) { distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos); if (distLinkFromHome > 250.0f) { diff --git a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index d0de9bcb8..526a0d31c 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -208,7 +208,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { return; } if (!LINK_IS_ADULT) { - if (Flags_GetEventChkInf(0x14)) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { if (this->actor.world.rot.z != 3) { Actor_Kill(&this->actor); return; @@ -217,7 +217,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) { if (this->actor.world.rot.z != 7) { Actor_Kill(&this->actor); return; diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 81fe82aa9..e264b0f60 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -80,7 +80,7 @@ void EnHs_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコの店(大人の時) \n" VT_RST); func_80A6E3A0(this, func_80A6E9AC); bool shouldSpawn; - bool tradedMushroom = gSaveContext.itemGetInf[3] & 1; + bool tradedMushroom = Flags_GetItemGetInf(ITEMGETINF_30); if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { // To explain the logic because Fado and Grog are linked: // - If you have Cojiro, then spawn Grog and not Fado. diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index dc5055e70..5e488c85a 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -430,7 +430,7 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) { switch (this->actor.params & 0x7F) { case ENHY_TYPE_AOB: if (play->sceneNum == SCENE_KAKARIKO) { - return (this->unk_330 & 0x800) ? 0x508D : ((gSaveContext.infTable[12] & 0x800) ? 0x508C : 0x508B); + return (this->unk_330 & 0x800) ? 0x508D : ((Flags_GetInfTable(INFTABLE_CB)) ? 0x508C : 0x508B); } else if (play->sceneNum == SCENE_MARKET_DAY) { return (gSaveContext.eventInf[3] & 1) ? 0x709B : 0x709C; } else if (gSaveContext.dogIsLost) { @@ -446,77 +446,77 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) { return 0x70A0; } case ENHY_TYPE_COB: - if (gSaveContext.eventChkInf[8] & 1) { - return (gSaveContext.infTable[12] & 2) ? 0x7017 : 0x7045; + if (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) { + return (Flags_GetInfTable(INFTABLE_C1)) ? 0x7017 : 0x7045; } else { - return (gSaveContext.infTable[12] & 1) ? 0x7017 : 0x7016; + return (Flags_GetInfTable(INFTABLE_C0)) ? 0x7017 : 0x7016; } case ENHY_TYPE_AHG_2: if (play->sceneNum == SCENE_KAKARIKO) { return 0x5086; } else if (play->sceneNum == SCENE_SPOT01) { return 0x5085; - } else if (gSaveContext.eventChkInf[8] & 1) { - return (gSaveContext.infTable[12] & 8) ? 0x701A : 0x7047; - } else if (gSaveContext.eventChkInf[1] & 0x10) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) { + return (Flags_GetInfTable(INFTABLE_C3)) ? 0x701A : 0x7047; + } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { return 0x701A; - } else if (gSaveContext.eventChkInf[1] & 1) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET)) { return 0x701B; - } else if (gSaveContext.infTable[12] & 4) { + } else if (Flags_GetInfTable(INFTABLE_C2)) { return 0x701C; } else { return 0x701A; } case ENHY_TYPE_BOJ_3: - return (gSaveContext.eventChkInf[8] & 1) ? ((gSaveContext.infTable[12] & 0x10) ? 0x7001 : 0x70EB) : 0x7001; + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? ((Flags_GetInfTable(INFTABLE_C4)) ? 0x7001 : 0x70EB) : 0x7001; case ENHY_TYPE_AHG_4: - return (gSaveContext.eventChkInf[8] & 1) ? 0x704B : ((gSaveContext.infTable[12] & 0x20) ? 0x7024 : 0x7023); + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x704B : ((Flags_GetInfTable(INFTABLE_C5)) ? 0x7024 : 0x7023); case ENHY_TYPE_BOJ_5: player->exchangeItemId = EXCH_ITEM_BLUE_FIRE; return 0x700C; case ENHY_TYPE_BBA: - return (gSaveContext.eventChkInf[8] & 1) ? 0x704A : ((gSaveContext.infTable[12] & 0x40) ? 0x7022 : 0x7021); + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x704A : ((Flags_GetInfTable(INFTABLE_C6)) ? 0x7022 : 0x7021); case ENHY_TYPE_BJI_7: if (play->sceneNum == SCENE_KAKARIKO) { return 0x5088; } else if (play->sceneNum == SCENE_SPOT01) { return 0x5087; } else { - return (gSaveContext.eventChkInf[8] & 1) ? 0x704D - : ((gSaveContext.infTable[12] & 0x80) ? 0x7028 : 0x7027); + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x704D + : ((Flags_GetInfTable(INFTABLE_C7)) ? 0x7028 : 0x7027); } case ENHY_TYPE_CNE_8: - if (gSaveContext.eventChkInf[8] & 1) { - return (gSaveContext.infTable[12] & 0x200) ? 0x701E : 0x7048; + if (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) { + return (Flags_GetInfTable(INFTABLE_C9)) ? 0x701E : 0x7048; } else { - return (gSaveContext.infTable[12] & 0x100) ? 0x701E : 0x701D; + return (Flags_GetInfTable(INFTABLE_C8)) ? 0x701E : 0x701D; } case ENHY_TYPE_BOJ_9: if (play->sceneNum == SCENE_KAKARIKO) { - return (gSaveContext.eventChkInf[10] & 0x400) ? 0x5082 : 0x5081; + return (Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) ? 0x5082 : 0x5081; } else if (play->sceneNum == SCENE_SPOT01) { return CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) ? 0x5080 : 0x507F; } else { - return (gSaveContext.eventChkInf[8] & 1) ? 0x7049 - : ((gSaveContext.infTable[12] & 0x400) ? 0x7020 : 0x701F); + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x7049 + : ((Flags_GetInfTable(INFTABLE_CA)) ? 0x7020 : 0x701F); } case ENHY_TYPE_BOJ_10: if (play->sceneNum == SCENE_LABO) { - return (gSaveContext.eventChkInf[10] & 0x400) ? 0x507E : 0x507D; + return (Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) ? 0x507E : 0x507D; } else if (play->sceneNum == SCENE_SPOT01) { return CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) ? 0x507C : 0x507B; } else { - return (gSaveContext.eventChkInf[8] & 1) ? 0x7046 - : ((gSaveContext.infTable[12] & 0x2000) ? 0x7019 : 0x7018); + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x7046 + : ((Flags_GetInfTable(INFTABLE_CD)) ? 0x7019 : 0x7018); } case ENHY_TYPE_CNE_11: - return (gSaveContext.infTable[8] & 0x800) ? ((gSaveContext.infTable[12] & 0x1000) ? 0x7014 : 0x70A4) + return (Flags_GetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE)) ? ((Flags_GetInfTable(INFTABLE_CC)) ? 0x7014 : 0x70A4) : 0x7014; case ENHY_TYPE_BOJ_12: if (play->sceneNum == SCENE_SPOT01) { return !IS_DAY ? 0x5084 : 0x5083; } else { - return (gSaveContext.eventChkInf[8] & 1) ? 0x7044 : 0x7015; + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x7044 : 0x7015; } case ENHY_TYPE_AHG_13: return 0x7055; @@ -529,20 +529,20 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) { case ENHY_TYPE_AHG_17: if (!LINK_IS_ADULT) { if (IS_DAY) { - return (gSaveContext.infTable[22] & 1) ? 0x5058 : 0x5057; + return (Flags_GetInfTable(INFTABLE_160)) ? 0x5058 : 0x5057; } else { - return (gSaveContext.infTable[22] & 2) ? 0x505A : 0x5059; + return (Flags_GetInfTable(INFTABLE_161)) ? 0x505A : 0x5059; } } else if (IS_DAY) { - return (gSaveContext.infTable[22] & 4) ? 0x505C : 0x505B; + return (Flags_GetInfTable(INFTABLE_162)) ? 0x505C : 0x505B; } else { return 0x5058; } case ENHY_TYPE_BOB_18: if (!LINK_IS_ADULT) { - return (gSaveContext.eventChkInf[8] & 1) ? 0x505F : ((gSaveContext.infTable[22] & 8) ? 0x505E : 0x505D); + return (Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) ? 0x505F : ((Flags_GetInfTable(INFTABLE_163)) ? 0x505E : 0x505D); } else { - return (this->unk_330 & 0x800) ? 0x5062 : ((gSaveContext.infTable[22] & 0x10) ? 0x5061 : 0x5060); + return (this->unk_330 & 0x800) ? 0x5062 : ((Flags_GetInfTable(INFTABLE_164)) ? 0x5061 : 0x5060); } case ENHY_TYPE_BJI_19: return 0x7120; @@ -599,67 +599,67 @@ s16 func_80A70058(PlayState* play, Actor* thisx) { Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); break; case 0x7016: - gSaveContext.infTable[12] |= 1; + Flags_SetInfTable(INFTABLE_C0); break; case 0x7045: - gSaveContext.infTable[12] |= 2; + Flags_SetInfTable(INFTABLE_C1); break; case 0x701B: - gSaveContext.infTable[12] |= 4; + Flags_SetInfTable(INFTABLE_C2); break; case 0x7047: - gSaveContext.infTable[12] |= 8; + Flags_SetInfTable(INFTABLE_C3); break; case 0x70EB: - gSaveContext.infTable[12] |= 0x10; + Flags_SetInfTable(INFTABLE_C4); break; case 0x7023: - gSaveContext.infTable[12] |= 0x20; + Flags_SetInfTable(INFTABLE_C5); break; case 0x7021: - gSaveContext.infTable[12] |= 0x40; + Flags_SetInfTable(INFTABLE_C6); break; case 0x7027: - gSaveContext.infTable[12] |= 0x80; + Flags_SetInfTable(INFTABLE_C7); break; case 0x701D: - gSaveContext.infTable[12] |= 0x100; + Flags_SetInfTable(INFTABLE_C8); break; case 0x7048: - gSaveContext.infTable[12] |= 0x200; + Flags_SetInfTable(INFTABLE_C9); break; case 0x701F: - gSaveContext.infTable[12] |= 0x400; + Flags_SetInfTable(INFTABLE_CA); break; case 0x7018: - gSaveContext.infTable[12] |= 0x2000; + Flags_SetInfTable(INFTABLE_CD); break; case 0x70A4: - gSaveContext.infTable[12] |= 0x1000; + Flags_SetInfTable(INFTABLE_CC); break; case 0x5057: - gSaveContext.infTable[22] |= 1; + Flags_SetInfTable(INFTABLE_160); break; case 0x5059: - gSaveContext.infTable[22] |= 2; + Flags_SetInfTable(INFTABLE_161); break; case 0x505B: - gSaveContext.infTable[22] |= 4; + Flags_SetInfTable(INFTABLE_162); break; case 0x505D: - gSaveContext.infTable[22] |= 8; + Flags_SetInfTable(INFTABLE_163); break; case 0x5060: - gSaveContext.infTable[22] |= 0x10; + Flags_SetInfTable(INFTABLE_164); break; case 0x508B: - gSaveContext.infTable[12] |= 0x800; + Flags_SetInfTable(INFTABLE_CB); break; case 0x709E: gSaveContext.dogParams = 0; break; case 0x709F: - if (gSaveContext.infTable[25] & 2) { // Already brought the lost dog back + if (Flags_GetInfTable(INFTABLE_191)) { // Already brought the lost dog back func_80A6F7CC(this, play, GI_RUPEE_BLUE); } else { if (!gSaveContext.n64ddFlag) { @@ -869,7 +869,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } else if (IS_NIGHT) { return false; - } else if ((gSaveContext.eventChkInf[8] & 1) && !(gSaveContext.eventChkInf[4] & 0x20)) { + } else if ((Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) && !Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) { return false; } else { return true; @@ -1079,8 +1079,8 @@ void func_80A714C4(EnHy* this, PlayState* play) { void func_80A71530(EnHy* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { if (gSaveContext.n64ddFlag) { - if (!(gSaveContext.infTable[25] & 2)) { - gSaveContext.infTable[25] |= 2; + if (!Flags_GetInfTable(INFTABLE_191)) { + Flags_SetInfTable(INFTABLE_191); } gSaveContext.dogParams = 0; gSaveContext.dogIsLost = false; @@ -1089,7 +1089,7 @@ void func_80A71530(EnHy* this, PlayState* play) { case GI_HEART_PIECE: gSaveContext.dogParams = 0; gSaveContext.dogIsLost = false; - gSaveContext.infTable[25] |= 2; + Flags_SetInfTable(INFTABLE_191); break; case GI_RUPEE_BLUE: Rupees_ChangeBy(5); diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 48359632c..2801f78d0 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1414,7 +1414,7 @@ void EnIk_Draw(Actor* thisx, PlayState* play) { void func_80A780D0(EnIk* this, PlayState* play) { if (this->actor.params == 0) { - if (!(gSaveContext.eventChkInf[3] & 0x800)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_BEGAN_NABOORU_BATTLE)) { this->actor.update = EnIk_Update; this->actor.draw = EnIk_Draw; Actor_SetScale(&this->actor, 0.01f); @@ -1430,7 +1430,7 @@ void func_80A78160(EnIk* this, PlayState* play) { this->actor.update = func_80A75FA0; this->actor.draw = func_80A76798; this->actor.flags |= ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE; - gSaveContext.eventChkInf[3] |= 0x800; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_NABOORU_BATTLE); Actor_SetScale(&this->actor, 0.012f); func_80A7489C(this); } @@ -1464,7 +1464,7 @@ void func_80A781CC(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); } } - gSaveContext.eventChkInf[3] |= 0x1000; + Flags_SetEventChkInf(EVENTCHKINF_FINISHED_NABOORU_BATTLE); func_80A7735C(this, play); gSaveContext.sohStats.count[COUNT_ENEMIES_DEFEATED_IRON_KNUCKLE_NABOORU]++; } @@ -1474,7 +1474,7 @@ void EnIk_Init(Actor* thisx, PlayState* play) { EnIk* this = (EnIk*)thisx; s32 flag = this->actor.params & 0xFF00; - if (((this->actor.params & 0xFF) == 0 && (gSaveContext.eventChkInf[3] & 0x1000)) || + if (((this->actor.params & 0xFF) == 0 && (Flags_GetEventChkInf(EVENTCHKINF_FINISHED_NABOORU_BATTLE))) || (flag != 0 && Flags_GetSwitch(play, flag >> 8))) { Actor_Kill(&this->actor); } else { diff --git a/soh/src/overlays/actors/ovl_En_In/z_en_in.c b/soh/src/overlays/actors/ovl_En_In/z_en_in.c index 204c62f09..1c413936f 100644 --- a/soh/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/soh/src/overlays/actors/ovl_En_In/z_en_in.c @@ -112,14 +112,14 @@ static Gfx* sAdultEraDLs[] = { }; u16 func_80A78FB0(PlayState* play) { - if (gSaveContext.eventChkInf[1] & 0x10) { - if (gSaveContext.infTable[9] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { + if (Flags_GetInfTable(INFTABLE_97)) { return 0x2046; } else { return 0x2045; } } - if (gSaveContext.infTable[9] & 0x10) { + if (Flags_GetInfTable(INFTABLE_94)) { return 0x2040; } else { return 0x203F; @@ -133,7 +133,7 @@ u16 func_80A79010(PlayState* play) { if (temp_v0 != 0) { return temp_v0; } - if (gSaveContext.eventChkInf[1] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { if (IS_DAY) { return 0x205F; } else { @@ -147,8 +147,8 @@ u16 func_80A79010(PlayState* play) { case 1: if (!(player->stateFlags1 & 0x800000)) { return 0x2036; - } else if (gSaveContext.eventChkInf[1] & 0x800) { - if (gSaveContext.infTable[10] & 4) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO)) { + if (Flags_GetInfTable(INFTABLE_A2)) { return 0x2036; } else { return 0x2038; @@ -171,7 +171,7 @@ u16 func_80A79010(PlayState* play) { return 0x205B; case 2: default: - if (gSaveContext.infTable[0x9] & 0x400) { + if (Flags_GetInfTable(INFTABLE_SPOKE_TO_INGO_ONCE_AS_ADULT)) { return 0x2031; } else { return 0x2030; @@ -197,14 +197,14 @@ s16 func_80A791CC(PlayState* play, Actor* thisx) { switch (thisx->textId) { case 0x2045: - gSaveContext.infTable[9] |= 0x80; + Flags_SetInfTable(INFTABLE_97); break; case 0x203E: ret = NPC_TALK_STATE_ACTION; break; case 0x203F: - gSaveContext.eventChkInf[1] |= 2; - gSaveContext.infTable[9] |= 0x10; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_INGO_AT_RANCH_BEFORE_TALON_RETURNS); + Flags_SetInfTable(INFTABLE_94); break; } return ret; @@ -225,7 +225,7 @@ s16 func_80A7924C(PlayState* play, Actor* thisx) { this->actor.textId = 0x2034; } Message_ContinueTextbox(play, this->actor.textId); - gSaveContext.infTable[9] |= 0x400; + Flags_SetInfTable(INFTABLE_SPOKE_TO_INGO_ONCE_AS_ADULT); break; case 0x2034: if (play->msgCtx.choiceIndex == 1) { @@ -251,7 +251,7 @@ s16 func_80A7924C(PlayState* play, Actor* thisx) { } else { this->actor.textId = 0x2039; Message_ContinueTextbox(play, this->actor.textId); - gSaveContext.infTable[10] |= 4; + Flags_SetInfTable(INFTABLE_A2); } break; case 0x205B: @@ -366,34 +366,34 @@ s32 func_80A7975C(EnIn* this, PlayState* play) { s32 func_80A79830(EnIn* this, PlayState* play) { if (play->sceneNum == SCENE_SPOT20 && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 1 && - !(gSaveContext.eventChkInf[1] & 0x10)) { + !Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { return 1; } if (play->sceneNum == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 3 && - (gSaveContext.eventChkInf[1] & 0x10)) { + (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { return 1; } if (play->sceneNum == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_NIGHT) { - if ((this->actor.shape.rot.z == 2) && !(gSaveContext.eventChkInf[1] & 0x10)) { + if ((this->actor.shape.rot.z == 2) && !Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { return 1; } - if ((this->actor.shape.rot.z == 4) && (gSaveContext.eventChkInf[1] & 0x10)) { + if ((this->actor.shape.rot.z == 4) && (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { return 1; } } if (play->sceneNum == SCENE_SPOT20 && LINK_IS_ADULT && IS_DAY) { - if ((this->actor.shape.rot.z == 5) && !(gSaveContext.eventChkInf[1] & 0x100)) { + if ((this->actor.shape.rot.z == 5) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { return 2; } - if ((this->actor.shape.rot.z == 7) && (gSaveContext.eventChkInf[1] & 0x100)) { + if ((this->actor.shape.rot.z == 7) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) { return 4; } } if (play->sceneNum == SCENE_SOUKO && LINK_IS_ADULT && IS_NIGHT) { - if (this->actor.shape.rot.z == 6 && !(gSaveContext.eventChkInf[1] & 0x100)) { + if (this->actor.shape.rot.z == 6 && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { return 3; } - if (this->actor.shape.rot.z == 8 && (gSaveContext.eventChkInf[1] & 0x100)) { + if (this->actor.shape.rot.z == 8 && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) { return 3; } } @@ -534,7 +534,7 @@ void func_80A79FB0(EnIn* this, PlayState* play) { case 3: EnIn_ChangeAnim(this, ENIN_ANIM_7); this->actionFunc = func_80A7A4BC; - if (!(gSaveContext.eventChkInf[1] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { this->actor.params = 5; } break; @@ -644,7 +644,7 @@ void func_80A7A4C8(EnIn* this, PlayState* play) { func_80A79BAC(this, play, 1, 0x20); gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x000F) | 0x0001; gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000; - gSaveContext.infTable[10] &= ~4; + Flags_UnsetInfTable(INFTABLE_A2); Environment_ForcePlaySequence(NA_BGM_HORSE); play->msgCtx.stateTimer = 0; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -657,8 +657,8 @@ void func_80A7A568(EnIn* this, PlayState* play) { s32 phi_a2; s32 phi_a3; - if (!(gSaveContext.eventChkInf[1] & 0x800) && (player->stateFlags1 & 0x800000)) { - gSaveContext.infTable[10] |= 0x800; + if (!Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO) && (player->stateFlags1 & 0x800000)) { + Flags_SetInfTable(INFTABLE_AB); } if (gSaveContext.timer1State == 10) { Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -680,10 +680,10 @@ void func_80A7A568(EnIn* this, PlayState* play) { phi_a3 = 2; } else { Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (!(gSaveContext.eventChkInf[1] & 0x800)) { - if (gSaveContext.infTable[10] & 0x800) { - gSaveContext.eventChkInf[1] |= 0x800; - gSaveContext.infTable[10] |= 0x800; + if (!Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO)) { + if (Flags_GetInfTable(INFTABLE_AB)) { + Flags_SetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO); + Flags_SetInfTable(INFTABLE_AB); } } gSaveContext.eventInf[0] &= ~0xF; @@ -892,9 +892,9 @@ void func_80A7B024(EnIn* this, PlayState* play) { } player->actor.freezeTimer = 10; if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { - if (!(gSaveContext.eventChkInf[1] & 0x800) && (gSaveContext.infTable[10] & 0x800)) { - gSaveContext.eventChkInf[1] |= 0x800; - gSaveContext.infTable[10] |= 0x800; + if (!Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO) && (Flags_GetInfTable(INFTABLE_AB))) { + Flags_SetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO); + Flags_SetInfTable(INFTABLE_AB); } func_80A79BAC(this, play, 0, 0x26); gSaveContext.eventInf[0] = gSaveContext.eventInf[0] & ~0xF; diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c index b0b560530..2bd4db7eb 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -97,7 +97,7 @@ void EnJj_Init(Actor* thisx, PlayState* play2) { this->extraBlinkCounter = 0; this->extraBlinkTotal = 0; - if (gSaveContext.eventChkInf[3] & 0x400) { // Fish given + if (Flags_GetEventChkInf(EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU)) { // Fish given EnJj_SetupAction(this, EnJj_WaitToOpenMouth); } else { EnJj_SetupAction(this, EnJj_WaitForFish); @@ -222,7 +222,7 @@ void EnJj_BeginCutscene(EnJj* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; func_8003EBF8(play, &play->colCtx.dyna, bodyCollisionActor->bgId); func_8005B1A4(GET_ACTIVE_CAM(play)); - gSaveContext.eventChkInf[3] |= 0x400; + Flags_SetEventChkInf(EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU); func_80078884(NA_SE_SY_CORRECT_CHIME); } } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 63dcbc6c3..61fd404c6 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -139,7 +139,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { this->actionFunc = func_80A904D8; } else if ((this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y) && - (gSaveContext.eventChkInf[9] & 0x1000)) { + (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_FOR_SCARECROW_AS_ADULT))) { this->unk_194 = 0; if (play->msgCtx.ocarinaMode == OCARINA_MODE_0B) { diff --git a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 8b79f1122..dd11e900e 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -388,8 +388,8 @@ void func_80A91A90(EnKakasi3* this, PlayState* play) { if (this->dialogState == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { if (this->unk_195) { - if (!(gSaveContext.eventChkInf[9] & 0x1000)) { - gSaveContext.eventChkInf[9] |= 0x1000; + if (!Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SONG_FOR_SCARECROW_AS_ADULT)) { + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_FOR_SCARECROW_AS_ADULT); } } if (play->cameraPtrs[this->camId] == NULL) { diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index f12e16c63..2ecf1bab7 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -288,15 +288,15 @@ u16 func_80A96FD0(PlayState* play, Actor* thisx) { EnKo* this = (EnKo*)thisx; switch (ENKO_TYPE) { case ENKO_TYPE_CHILD_FADO: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x10DA; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { return 0x10D9; } - return (gSaveContext.infTable[11] & 0x80) ? 0x10D8 : 0x10D7; + return (Flags_GetInfTable(INFTABLE_B7)) ? 0x10D8 : 0x10D7; case ENKO_TYPE_CHILD_0: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x1025; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { @@ -304,62 +304,62 @@ u16 func_80A96FD0(PlayState* play, Actor* thisx) { } return 0x1004; case ENKO_TYPE_CHILD_1: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x1023; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { return 0x1043; } - if (gSaveContext.infTable[1] & 0x4000) { + if (Flags_GetInfTable(INFTABLE_1E)) { return 0x1006; } return 0x1005; case ENKO_TYPE_CHILD_2: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x1022; } return 0x1007; case ENKO_TYPE_CHILD_3: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x1021; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { return 0x1044; } - if (gSaveContext.infTable[2] & 4) { + if (Flags_GetInfTable(INFTABLE_22)) { return 0x1009; } return 0x1008; case ENKO_TYPE_CHILD_4: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x1097; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { return 0x1042; } - if (gSaveContext.infTable[2] & 0x10) { + if (Flags_GetInfTable(INFTABLE_24)) { return 0x100B; } return 0x100A; case ENKO_TYPE_CHILD_5: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x10B0; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { return 0x1043; } - if (gSaveContext.infTable[2] & 0x40) { + if (Flags_GetInfTable(INFTABLE_26)) { return 0x100D; } return 0x100C; case ENKO_TYPE_CHILD_6: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x10B5; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { return 0x1043; } - if (gSaveContext.infTable[2] & 0x100) { + if (Flags_GetInfTable(INFTABLE_28)) { return 0x1019; } return 0x100E; @@ -395,7 +395,7 @@ u16 func_80A97338(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) { return 0x1072; } - if (gSaveContext.infTable[4] & 2) { + if (Flags_GetInfTable(INFTABLE_41)) { return 0x1056; } return 0x1055; @@ -408,7 +408,7 @@ u16 func_80A97338(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) { return 0x1074; } - if (gSaveContext.infTable[4] & 0x80) { + if (Flags_GetInfTable(INFTABLE_47)) { return 0x105E; } return 0x105D; @@ -428,7 +428,7 @@ u16 func_80A97338(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) { return 0x1077; } - if (gSaveContext.infTable[5] & 2) { + if (Flags_GetInfTable(INFTABLE_51)) { return 0x1059; } return 0x1058; @@ -441,7 +441,7 @@ u16 func_80A97338(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) { return 0x107A; } - if (gSaveContext.infTable[5] & 0x200) { + if (Flags_GetInfTable(INFTABLE_59)) { return 0x1050; } return 0x104F; @@ -459,7 +459,7 @@ u16 func_80A97338(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) { return 0x107C; } - if (gSaveContext.infTable[6] & 2) { + if (Flags_GetInfTable(INFTABLE_61)) { return 0x1054; } return 0x1053; @@ -500,37 +500,37 @@ s16 func_80A97738(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (this->actor.textId) { case 0x1005: - gSaveContext.infTable[1] |= 0x4000; + Flags_SetInfTable(INFTABLE_1E); break; case 0x1008: - gSaveContext.infTable[2] |= 0x4; + Flags_SetInfTable(INFTABLE_22); break; case 0x100A: - gSaveContext.infTable[2] |= 0x10; + Flags_SetInfTable(INFTABLE_24); break; case 0x100C: - gSaveContext.infTable[2] |= 0x40; + Flags_SetInfTable(INFTABLE_26); break; case 0x100E: - gSaveContext.infTable[2] |= 0x100; + Flags_SetInfTable(INFTABLE_28); break; case 0x104F: - gSaveContext.infTable[5] |= 0x200; + Flags_SetInfTable(INFTABLE_59); break; case 0x1053: - gSaveContext.infTable[6] |= 2; + Flags_SetInfTable(INFTABLE_61); break; case 0x1055: - gSaveContext.infTable[4] |= 2; + Flags_SetInfTable(INFTABLE_41); break; case 0x1058: - gSaveContext.infTable[5] |= 2; + Flags_SetInfTable(INFTABLE_51); break; case 0x105D: - gSaveContext.infTable[4] |= 0x80; + Flags_SetInfTable(INFTABLE_47); break; case 0x10D7: - gSaveContext.infTable[11] |= 0x80; + Flags_SetInfTable(INFTABLE_B7); break; case 0x10BA: return NPC_TALK_STATE_TALKING; @@ -565,7 +565,7 @@ s16 func_80A97738(PlayState* play, Actor* thisx) { Message_ContinueTextbox(play, this->actor.textId); break; case 0x10B7: - gSaveContext.infTable[11] |= 0x1000; + Flags_SetInfTable(INFTABLE_BC); case 0x10B8: this->actor.textId = (play->msgCtx.choiceIndex == 0) ? 0x10BA : 0x10B9; @@ -587,7 +587,7 @@ s32 EnKo_GetForestQuestState(EnKo* this) { if (!LINK_IS_ADULT) { // Obtained Zelda's Letter - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return ENKO_FQS_CHILD_SARIA; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { @@ -955,7 +955,7 @@ void func_80A9877C(EnKo* this, PlayState* play) { this->actor.textId = INV_CONTENT(ITEM_TRADE_ADULT) > ITEM_ODD_POTION ? 0x10B9 : 0x10DF; if (func_8002F368(play) == ENKO_TYPE_CHILD_9) { - this->actor.textId = (gSaveContext.infTable[11] & 0x1000) ? 0x10B8 : 0x10B7; + this->actor.textId = (Flags_GetInfTable(INFTABLE_BC)) ? 0x10B8 : 0x10B7; this->unk_210 = 0; } player->actor.textId = this->actor.textId; @@ -1077,7 +1077,7 @@ s32 EnKo_GetForestQuestState2(EnKo* this) { return CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) ? ENKO_FQS_ADULT_SAVED : ENKO_FQS_ADULT_ENEMY; } if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { - return (gSaveContext.eventChkInf[4] & 1) ? ENKO_FQS_CHILD_SARIA : ENKO_FQS_CHILD_STONE; + return (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) ? ENKO_FQS_CHILD_SARIA : ENKO_FQS_CHILD_STONE; } return ENKO_FQS_CHILD_START; } @@ -1193,7 +1193,7 @@ void func_80A99048(EnKo* this, PlayState* play) { return; } } else { - if (!Flags_GetEventChkInf(7)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD)) { this->collider.dim.height += 200; this->actionFunc = func_80A995CC; return; @@ -1250,7 +1250,7 @@ void func_80A99560(EnKo* this, PlayState* play) { this->actor.textId = 0x10B9; Message_ContinueTextbox(play, this->actor.textId); this->interactInfo.talkState = NPC_TALK_STATE_TALKING; - gSaveContext.itemGetInf[3] |= 2; + Flags_SetItemGetInf(ITEMGETINF_31); this->actionFunc = func_80A99384; } } diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 853214f01..322088618 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -76,11 +76,11 @@ u16 EnKz_GetTextNoMaskChild(PlayState* play, EnKz* this) { if ((gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY)) || (!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) { // Allow turning in Ruto's letter even if you have already rescued her - if (gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[3] & 8)) { + if (gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { player->exchangeItemId = EXCH_ITEM_LETTER_RUTO; } return 0x402B; - } else if (gSaveContext.eventChkInf[3] & 8) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { return 0x401C; } else { player->exchangeItemId = EXCH_ITEM_LETTER_RUTO; @@ -93,7 +93,7 @@ u16 EnKz_GetTextNoMaskAdult(PlayState* play, EnKz* this) { // this works because both ITEM_NONE and later trade items are > ITEM_FROG if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_FROG) { - if (!(gSaveContext.infTable[19] & 0x200)) { + if (!Flags_GetInfTable(INFTABLE_139)) { if (!gSaveContext.n64ddFlag) { return CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012; } else { @@ -132,14 +132,14 @@ s16 func_80A9C6C0(PlayState* play, Actor* thisx) { ret = NPC_TALK_STATE_IDLE; switch (this->actor.textId) { case 0x4012: - gSaveContext.infTable[19] |= 0x200; + Flags_SetInfTable(INFTABLE_139); ret = NPC_TALK_STATE_ACTION; break; case 0x401B: ret = !Message_ShouldAdvance(play) ? NPC_TALK_STATE_TALKING : NPC_TALK_STATE_ACTION; break; case 0x401F: - gSaveContext.infTable[19] |= 0x200; + Flags_SetInfTable(INFTABLE_139); break; } break; @@ -243,7 +243,7 @@ void func_80A9CB18(EnKz* this, PlayState* play) { Player* player = GET_PLAYER(play); if (func_80A9C95C(play, this, &this->interactInfo.talkState, 340.0f, EnKz_GetText, func_80A9C6C0)) { - if (((gSaveContext.n64ddFlag && LINK_IS_CHILD) || this->actor.textId == 0x401A) && !(gSaveContext.eventChkInf[3] & 8)) { + if (((gSaveContext.n64ddFlag && LINK_IS_CHILD) || this->actor.textId == 0x401A) && !Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { if (func_8002F368(play) == EXCH_ITEM_LETTER_RUTO) { this->actor.textId = 0x401B; this->sfxPlayed = false; @@ -267,7 +267,7 @@ void func_80A9CB18(EnKz* this, PlayState* play) { } this->isTrading = false; - if (gSaveContext.infTable[19] & 0x200) { + if (Flags_GetInfTable(INFTABLE_139)) { this->actor.textId = CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A; player->actor.textId = this->actor.textId; } else { @@ -345,21 +345,21 @@ void EnKz_Init(Actor* thisx, PlayState* play) { Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_0); if (!gSaveContext.n64ddFlag) { - if (gSaveContext.eventChkInf[3] & 8) { + if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { EnKz_SetMovedPos(this, play); } } else { int zorasFountain = Randomizer_GetSettingValue(RSK_ZORAS_FOUNTAIN); switch (zorasFountain) { case 0: - if (gSaveContext.eventChkInf[3] & 8) { + if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { EnKz_SetMovedPos(this, play); } break; case 1: if (LINK_IS_ADULT) { EnKz_SetMovedPos(this, play); - } else if (gSaveContext.eventChkInf[3] & 8) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { EnKz_SetMovedPos(this, play); } break; @@ -370,7 +370,7 @@ void EnKz_Init(Actor* thisx, PlayState* play) { } if (LINK_IS_ADULT) { - if (!(gSaveContext.infTable[19] & 0x100)) { + if (!Flags_GetInfTable(INFTABLE_138)) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BG_ICE_SHELTER, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x04FF); @@ -434,7 +434,7 @@ void EnKz_Mweep(EnKz* this, PlayState* play) { Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_1); Inventory_ReplaceItem(play, ITEM_LETTER_RUTO, ITEM_BOTTLE); EnKz_SetMovedPos(this, play); - gSaveContext.eventChkInf[3] |= 8; + Flags_SetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED); this->actor.speedXZ = 0.0; this->actionFunc = EnKz_StopMweep; } @@ -508,8 +508,8 @@ void EnKz_Update(Actor* thisx, PlayState* play) { EnKz* this = (EnKz*)thisx; s32 pad; - if (LINK_IS_ADULT && !(gSaveContext.infTable[19] & 0x100)) { - gSaveContext.infTable[19] |= 0x100; + if (LINK_IS_ADULT && !Flags_GetInfTable(INFTABLE_138)) { + Flags_SetInfTable(INFTABLE_138); } Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index b7c90046d..f87745f9e 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -91,7 +91,7 @@ static void* sEyeTextures[] = { }; bool Randomizer_ObtainedMalonHCReward() { - return Flags_GetEventChkInf(0x12); + return Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); } u16 EnMa1_GetText(PlayState* play, Actor* thisx) { @@ -110,24 +110,24 @@ u16 EnMa1_GetText(PlayState* play, Actor* thisx) { return 0x204A; } } - if (gSaveContext.eventChkInf[1] & 0x40) { + if (Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON)) { return 0x2049; } - if (gSaveContext.eventChkInf[1] & 0x20) { - if ((gSaveContext.infTable[8] & 0x20)) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH)) { + if ((Flags_GetInfTable(INFTABLE_CHILD_MALON_SAID_EPONA_WAS_AFRAID_OF_YOU))) { return 0x2049; } else { return 0x2048; } } - if (gSaveContext.eventChkInf[1] & 0x10) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { return 0x2047; } - if (gSaveContext.eventChkInf[1] & 4) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG)) { return 0x2044; } - if (gSaveContext.infTable[8] & 0x10) { - if (gSaveContext.infTable[8] & 0x800) { + if (Flags_GetInfTable(INFTABLE_MET_CHILD_MALON_AT_CASTLE_OR_MARKET)) { + if (Flags_GetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE)) { return 0x2043; } else { return 0x2042; @@ -143,23 +143,23 @@ s16 func_80AA0778(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (thisx->textId) { case 0x2041: - gSaveContext.infTable[8] |= 0x10; - gSaveContext.eventChkInf[1] |= 1; + Flags_SetInfTable(INFTABLE_MET_CHILD_MALON_AT_CASTLE_OR_MARKET); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET); ret = NPC_TALK_STATE_IDLE; break; case 0x2043: ret = NPC_TALK_STATE_TALKING; break; case 0x2047: - gSaveContext.eventChkInf[1] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_RANCH); ret = NPC_TALK_STATE_IDLE; break; case 0x2048: - gSaveContext.infTable[8] |= 0x20; + Flags_SetInfTable(INFTABLE_CHILD_MALON_SAID_EPONA_WAS_AFRAID_OF_YOU); ret = NPC_TALK_STATE_IDLE; break; case 0x2049: - gSaveContext.eventChkInf[1] |= 0x40; + Flags_SetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); ret = NPC_TALK_STATE_IDLE; break; case 0x2061: @@ -202,22 +202,22 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) { } // Causes Malon to appear in the market if you haven't met her yet. if (((play->sceneNum == SCENE_MARKET_NIGHT) || (play->sceneNum == SCENE_MARKET_DAY)) && - !(gSaveContext.eventChkInf[1] & 0x10) && !(gSaveContext.infTable[8] & 0x800)) { + !Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) && !Flags_GetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE)) { return 1; } if ((play->sceneNum == SCENE_SPOT15) && // if we're at hyrule castle - (!(gSaveContext.eventChkInf[1] & 0x10) || // and talon hasn't left + (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || // and talon hasn't left (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward()))) { // or we're rando'd and haven't gotten malon's HC check - if (gSaveContext.infTable[8] & 0x800) { // if we've met malon + if (Flags_GetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE)) { // if we've met malon return 1; // make her appear at the castle } else { // if we haven't met malon - gSaveContext.infTable[8] |= 0x800; // set the flag for meeting malon + Flags_SetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE); // set the flag for meeting malon return 0; // don't make her appear at the castle } } // Malon asleep in her bed if Talon has left Hyrule Castle and it is nighttime. - if ((play->sceneNum == SCENE_SOUKO) && IS_NIGHT && (gSaveContext.eventChkInf[1] & 0x10)) { + if ((play->sceneNum == SCENE_SOUKO) && IS_NIGHT && (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { return 1; } // Don't spawn Malon if none of the above are true and we are not in Lon Lon Ranch. @@ -226,7 +226,7 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) { } // If we've gotten this far, we're in Lon Lon Ranch. Spawn Malon if it is daytime, Talon has left Hyrule Castle, and // either we are not randomized, or we are and we have received Malon's item at Hyrule Castle. - if ((this->actor.shape.rot.z == 3) && IS_DAY && (gSaveContext.eventChkInf[1] & 0x10) && + if ((this->actor.shape.rot.z == 3) && IS_DAY && (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) && ((gSaveContext.n64ddFlag && Randomizer_ObtainedMalonHCReward()) || !gSaveContext.n64ddFlag)) { return 1; } @@ -293,9 +293,9 @@ void EnMa1_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); if (gSaveContext.n64ddFlag) { // Skip Malon's multiple textboxes before getting an item - gSaveContext.infTable[8] |= 0x800; - gSaveContext.infTable[8] |= 0x10; - gSaveContext.eventChkInf[1] |= 1; + Flags_SetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE); + Flags_SetInfTable(INFTABLE_MET_CHILD_MALON_AT_CASTLE_OR_MARKET); + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET); } if (!func_80AA08C4(this, play)) { @@ -313,14 +313,14 @@ void EnMa1_Init(Actor* thisx, PlayState* play) { // 1. Talon has not left Hyrule Castle. // 2. We are Randomized and have not obtained Malon's Weird Egg Check. // 3. We are not Randomized and have obtained Epona's Song - if (!(gSaveContext.eventChkInf[1] & 0x10) || (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward()) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag) || + if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward()) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag) || (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F))) { this->actionFunc = func_80AA0D88; EnMa1_ChangeAnim(this, ENMA1_ANIM_2); // If none of the above conditions were true, set Malon up to teach Epona's Song. } else { if (gSaveContext.n64ddFlag) { // Skip straight to "let's sing it together" textbox in the ranch - gSaveContext.eventChkInf[1] |= 0x40; + Flags_SetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); } this->actionFunc = func_80AA0F44; @@ -349,13 +349,13 @@ void func_80AA0D88(EnMa1* this, PlayState* play) { // We want to Kill Malon's Actor outside of randomizer when Talon is freed. In Randomizer we don't kill Malon's // Actor here, otherwise if we wake up Talon first and then get her check she will spontaneously // disappear. - if ((play->sceneNum == SCENE_SPOT15) && (!gSaveContext.n64ddFlag && gSaveContext.eventChkInf[1] & 0x10)) { + if ((play->sceneNum == SCENE_SPOT15) && (!gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { Actor_Kill(&this->actor); // We want Malon to give the Weird Egg Check (see function below) in the following situations: // 1. Talon as not left Hyrule Castle (Vanilla) OR // 2. We haven't obtained Malon's Weird Egg Check (Randomizer only) OR // 3. We have Epona's Song? (Vanilla only, not sure why it's here but I didn't write that one) - } else if ((!(gSaveContext.eventChkInf[1] & 0x10) || (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward())) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) { + } else if ((!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward())) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { this->actionFunc = func_80AA0EA0; play->msgCtx.stateTimer = 4; @@ -382,7 +382,7 @@ void func_80AA0EFC(EnMa1* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ITEM_GIVEN) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->actionFunc = func_80AA0D88; - gSaveContext.eventChkInf[1] |= 4; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; } } @@ -418,7 +418,7 @@ void func_80AA0F44(EnMa1* this, PlayState* play) { } } - if (gSaveContext.eventChkInf[1] & 0x40) { + if (Flags_GetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON)) { // When the player pulls out the Ocarina while close to Malon if (player->stateFlags2 & 0x1000000) { player->stateFlags2 |= 0x2000000; diff --git a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 2a3587809..16672060c 100644 --- a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -75,13 +75,13 @@ u16 func_80AA19A0(PlayState* play, Actor* thisx) { if (faceReaction != 0) { return faceReaction; } - if (gSaveContext.eventChkInf[1] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { return 0x2056; } if (IS_NIGHT) { - if (gSaveContext.infTable[8] & 0x1000) { + if (Flags_GetInfTable(INFTABLE_8C)) { return 0x2052; - } else if (gSaveContext.infTable[8] & 0x4000) { + } else if (Flags_GetInfTable(INFTABLE_8E)) { return 0x2051; } else { return 0x2050; @@ -97,11 +97,11 @@ s16 func_80AA1A38(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (thisx->textId) { case 0x2051: - gSaveContext.infTable[8] |= 0x1000; + Flags_SetInfTable(INFTABLE_8C); ret = NPC_TALK_STATE_ACTION; break; case 0x2053: - gSaveContext.infTable[8] |= 0x2000; + Flags_SetInfTable(INFTABLE_8D); ret = NPC_TALK_STATE_IDLE; break; default: @@ -142,15 +142,15 @@ u16 func_80AA1B58(EnMa2* this, PlayState* play) { if (LINK_IS_CHILD) { return 0; } - if (!(gSaveContext.eventChkInf[1] & 0x100) && (play->sceneNum == SCENE_MALON_STABLE) && IS_DAY && + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (play->sceneNum == SCENE_MALON_STABLE) && IS_DAY && (this->actor.shape.rot.z == 5)) { return 1; } - if (!(gSaveContext.eventChkInf[1] & 0x100) && (play->sceneNum == SCENE_SPOT20) && IS_NIGHT && + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (play->sceneNum == SCENE_SPOT20) && IS_NIGHT && (this->actor.shape.rot.z == 6)) { return 2; } - if (!(gSaveContext.eventChkInf[1] & 0x100) || (play->sceneNum != SCENE_SPOT20)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (play->sceneNum != SCENE_SPOT20)) { return 0; } if ((this->actor.shape.rot.z == 7) && IS_DAY) { @@ -230,7 +230,7 @@ void EnMa2_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80AA204C; break; case 3: - if (gSaveContext.infTable[8] & 0x2000) { + if (Flags_GetInfTable(INFTABLE_8D)) { EnMa2_ChangeAnim(this, ENMA2_ANIM_0); } else { EnMa2_ChangeAnim(this, ENMA2_ANIM_3); @@ -284,7 +284,7 @@ void func_80AA20E4(EnMa2* this, PlayState* play) { } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_208 = 0x1E; - gSaveContext.infTable[8] |= 0x4000; + Flags_SetInfTable(INFTABLE_8E); this->actionFunc = func_80AA21C8; play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else { diff --git a/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index ff2e80692..95c5df3e7 100644 --- a/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -76,7 +76,7 @@ u16 func_80AA2AA0(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); s16* timer1ValuePtr; // weirdness with this necessary to match - if (!(gSaveContext.infTable[11] & 0x100)) { + if (!Flags_GetInfTable(INFTABLE_B8)) { return 0x2000; } timer1ValuePtr = &gSaveContext.timer1Value; @@ -90,7 +90,7 @@ u16 func_80AA2AA0(PlayState* play, Actor* thisx) { HIGH_SCORE(HS_HORSE_RACE) = 0xB4; gSaveContext.timer1Value = *timer1ValuePtr; } - if (!(gSaveContext.eventChkInf[1] & 0x4000) && (gSaveContext.timer1Value < 0x32)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE) && (gSaveContext.timer1Value < 0x32)) { return 0x208F; } else if (gSaveContext.timer1Value < HIGH_SCORE(HS_HORSE_RACE)) { return 0x2012; @@ -102,7 +102,7 @@ u16 func_80AA2AA0(PlayState* play, Actor* thisx) { (Actor_FindNearby(play, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) { return 0x2001; } - if (!(gSaveContext.infTable[11] & 0x200)) { + if (!Flags_GetInfTable(INFTABLE_B9)) { return 0x2002; } else { return 0x2003; @@ -125,9 +125,9 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) { break; case TEXT_STATE_CHOICE: if (Message_ShouldAdvance(play)) { - gSaveContext.infTable[11] |= 0x200; + Flags_SetInfTable(INFTABLE_B9); if (play->msgCtx.choiceIndex == 0) { - if (gSaveContext.eventChkInf[1] & 0x4000) { + if (Flags_GetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE)) { Message_ContinueTextbox(play, 0x2091); } else if (HIGH_SCORE(HS_HORSE_RACE) == 0) { Message_ContinueTextbox(play, 0x2092); @@ -140,11 +140,11 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (thisx->textId) { case 0x2000: - gSaveContext.infTable[11] |= 0x100; + Flags_SetInfTable(INFTABLE_B8); ret = NPC_TALK_STATE_IDLE; break; case 0x208F: - gSaveContext.eventChkInf[1] |= 0x4000; + Flags_SetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE); case 0x2004: case 0x2012: if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timer1Value) { @@ -157,7 +157,7 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) { gSaveContext.timer1State = 0xA; break; case 0x2002: - gSaveContext.infTable[11] |= 0x200; + Flags_SetInfTable(INFTABLE_B9); case 0x2003: if (!(gSaveContext.eventInf[0] & 0x400)) { ret = NPC_TALK_STATE_IDLE; @@ -198,7 +198,7 @@ s32 func_80AA2EC8(EnMa3* this, PlayState* play) { if (LINK_IS_CHILD) { return 2; } - if (!(gSaveContext.eventChkInf[1] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { return 2; } if (gSaveContext.eventInf[0] & 0x400) { diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index f270eca21..90da4c01b 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -380,7 +380,7 @@ u16 EnMd_GetTextKokiriForest(PlayState* play, EnMd* this) { return 0x1045; } - if (gSaveContext.eventChkInf[0] & 0x10) { + if (Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) { return 0x1034; } @@ -388,7 +388,7 @@ u16 EnMd_GetTextKokiriForest(PlayState* play, EnMd* this) { return 0x1033; } - if (gSaveContext.infTable[0] & 0x1000) { + if (Flags_GetInfTable(INFTABLE_0C)) { return 0x1030; } @@ -399,7 +399,7 @@ u16 EnMd_GetTextKokiriHome(PlayState* play, EnMd* this) { this->unk_208 = 0; this->unk_209 = TEXT_STATE_NONE; - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 0x1028; } @@ -410,18 +410,18 @@ u16 EnMd_GetTextLostWoods(PlayState* play, EnMd* this) { this->unk_208 = 0; this->unk_209 = TEXT_STATE_NONE; - if (gSaveContext.eventChkInf[4] & 0x100) { - if (gSaveContext.infTable[1] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) { + if (Flags_GetInfTable(INFTABLE_19)) { return 0x1071; } return 0x1070; } - if (gSaveContext.eventChkInf[0] & 0x400) { + if (Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT)) { return 0x1068; } - if (gSaveContext.infTable[1] & 0x20) { + if (Flags_GetInfTable(INFTABLE_15)) { return 0x1061; } @@ -458,17 +458,17 @@ s16 func_80AAAF04(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (this->actor.textId) { case 0x1028: - gSaveContext.eventChkInf[0] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_ABOUT_SARIA); break; case 0x102F: - gSaveContext.eventChkInf[0] |= 4; - gSaveContext.infTable[0] |= 0x1000; + Flags_SetEventChkInf(EVENTCHKINF_FIRST_SPOKE_TO_MIDO); + Flags_SetInfTable(INFTABLE_0C); break; case 0x1060: - gSaveContext.infTable[1] |= 0x20; + Flags_SetInfTable(INFTABLE_15); break; case 0x1070: - gSaveContext.infTable[1] |= 0x200; + Flags_SetInfTable(INFTABLE_19); break; case 0x1033: case 0x1067: @@ -505,13 +505,13 @@ u8 EnMd_ShouldSpawn(EnMd* this, PlayState* play) { } if (play->sceneNum == SCENE_SPOT04) { - if (!(gSaveContext.eventChkInf[1] & 0x1000) && !(gSaveContext.eventChkInf[4] & 1)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 1; } } if (play->sceneNum == SCENE_KOKIRI_HOME4) { - if (((gSaveContext.eventChkInf[1] & 0x1000) != 0) || ((gSaveContext.eventChkInf[4] & 1) != 0)) { + if (((Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH)) != 0) || ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) != 0)) { if (!LINK_IS_ADULT) { return 1; } @@ -638,12 +638,12 @@ void func_80AAB5A4(EnMd* this, PlayState* play) { if (play->sceneNum != SCENE_KOKIRI_HOME4) { if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { - temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) && + temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_SPOT04)) ? 100.0f : 32767.0f; } else { - temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) && + temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_SPOT04)) ? 100.0f : 400.0f; @@ -679,11 +679,11 @@ void EnMd_Init(Actor* thisx, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, FAIRY_KOKIRI); - if (((play->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) || - ((play->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) && + if (((play->sceneNum == SCENE_SPOT04) && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) || + ((play->sceneNum == SCENE_SPOT04) && (Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)))) || - ((play->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) { + ((play->sceneNum == SCENE_SPOT10) && !Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT))) { this->actor.home.pos = this->actor.world.pos; this->actionFunc = func_80AAB948; return; @@ -747,16 +747,16 @@ void func_80AAB948(EnMd* this, PlayState* play) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && - Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !(gSaveContext.eventChkInf[1] & 0x1000) && + Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_SPOT04)) { play->msgCtx.msgMode = MSGMODE_PAUSED; } if (play->sceneNum == SCENE_SPOT04) { - gSaveContext.eventChkInf[0] |= 0x10; + Flags_SetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD); } if (play->sceneNum == SCENE_SPOT10) { - gSaveContext.eventChkInf[0] |= 0x400; + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT); } func_80AAA92C(this, 3); @@ -816,10 +816,10 @@ void func_80AABD0C(EnMd* this, PlayState* play) { if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && - Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !(gSaveContext.eventChkInf[1] & 0x1000) && + Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_SPOT04)) { Message_CloseTextbox(play); - gSaveContext.eventChkInf[1] |= 0x1000; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH); Actor_Kill(&this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index b8fda33a2..e056a4b04 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -70,7 +70,7 @@ void EnMk_Init(Actor* thisx, PlayState* play) { this->swimFlag = 0; this->actor.targetMode = 6; - if (gSaveContext.itemGetInf[1] & 1) { + if (Flags_GetItemGetInf(ITEMGETINF_10)) { this->flags |= 4; } } @@ -216,7 +216,7 @@ void func_80AACFA0(EnMk* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; this->actionFunc = func_80AACA40; - gSaveContext.itemGetInf[1] |= 1; + Flags_SetItemGetInf(ITEMGETINF_10); } else { // not sure when/how/if this is getting called if (!gSaveContext.n64ddFlag) { @@ -264,7 +264,7 @@ void EnMk_Wait(EnMk* this, PlayState* play) { switch (playerExchangeItem) { case EXCH_ITEM_NONE: if (this->swimFlag >= 8) { - if (gSaveContext.itemGetInf[1] & 1) { + if (Flags_GetItemGetInf(ITEMGETINF_10)) { player->actor.textId = 0x4075; this->actionFunc = func_80AACA40; } else { diff --git a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c index c593b96f7..dbd9a2af6 100644 --- a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -231,7 +231,7 @@ s32 func_80AADAA0(EnMm* this, PlayState* play) { EnMm_ChangeAnim(this, RM_ANIM_HAPPY, &this->curAnimIndex); } else { player->actor.textId = 0x202C; - gSaveContext.infTable[23] |= 0x1000; + Flags_SetInfTable(INFTABLE_17C); } sp1C = 2; } @@ -240,7 +240,7 @@ s32 func_80AADAA0(EnMm* this, PlayState* play) { if (Message_ShouldAdvance(play)) { Player_UnsetMask(play); Item_Give(play, ITEM_SOLD_OUT); - gSaveContext.itemGetInf[3] |= 0x800; + Flags_SetItemGetInf(ITEMGETINF_3B); Rupees_ChangeBy(500); player->actor.textId = 0x202E; sp1C = 2; @@ -266,12 +266,12 @@ s32 EnMm_GetTextId(EnMm* this, PlayState* play) { textId = Text_GetFaceReaction(play, 0x1C); - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { if (textId == 0) { textId = 0x204D; } } else if (player->currentMask == PLAYER_MASK_BUNNY) { - textId = (gSaveContext.infTable[23] & 0x1000) ? 0x202B : 0x202A; + textId = (Flags_GetInfTable(INFTABLE_17C)) ? 0x202B : 0x202A; } else if (textId == 0) { textId = 0x2029; } @@ -430,7 +430,7 @@ void func_80AAE294(EnMm* this, PlayState* play) { } } - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { this->speedXZ = 10.0f; this->skelAnime.playSpeed = 2.0f; } else { @@ -457,7 +457,7 @@ void func_80AAE294(EnMm* this, PlayState* play) { } } - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { dustPos.x = this->actor.world.pos.x; dustPos.y = this->actor.world.pos.y; dustPos.z = this->actor.world.pos.z; @@ -478,7 +478,7 @@ void func_80AAE50C(EnMm* this, PlayState* play) { this->sitTimer = 0; this->actionFunc = func_80AAE294; - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { EnMm_ChangeAnim(this, RM_ANIM_SPRINT, &this->curAnimIndex); this->mouthTexIndex = RM_MOUTH_CLOSED; } else { @@ -524,7 +524,7 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnMm_OverrideLimbDraw, EnMm_PostLimbDraw, this); - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { s32 linkChildObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD); if (linkChildObjBankIndex >= 0) { diff --git a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index ad940c115..fc3164edf 100644 --- a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -101,9 +101,9 @@ void EnMm2_ChangeAnim(EnMm2* this, s32 index, s32* currentIndex) { } void func_80AAEF70(EnMm2* this, PlayState* play) { - if ((gSaveContext.eventChkInf[9] & 0xF) != 0xF) { + if (!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { this->actor.textId = 0x6086; - } else if (gSaveContext.infTable[23] & 0x8000) { + } else if (Flags_GetInfTable(INFTABLE_17F)) { if (gSaveContext.eventInf[1] & 1) { this->actor.textId = 0x6082; } else if (gSaveContext.timer2State != 0) { @@ -150,7 +150,7 @@ void EnMm2_Init(Actor* thisx, PlayState* play2) { Actor_Kill(&this->actor); } if (this->actor.params == 1) { - if (!(gSaveContext.infTable[23] & 0x8000) || !(gSaveContext.eventInf[1] & 1)) { + if (!Flags_GetInfTable(INFTABLE_17F) || !(gSaveContext.eventInf[1] & 1)) { osSyncPrintf(VT_FGCOL(CYAN) " マラソン 開始されていない \n" VT_RST "\n"); Actor_Kill(&this->actor); } @@ -251,7 +251,7 @@ void func_80AAF57C(EnMm2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); func_80AAEF70(this, play); if ((func_80AAF224(this, play, func_80AAF3C0)) && (this->actor.textId == 0x607D)) { - gSaveContext.infTable[23] |= 0x8000; + Flags_SetInfTable(INFTABLE_17F); } } diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index b92ddd8af..e5b3723cf 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -566,7 +566,7 @@ void EnNb_InitKidnap(EnNb* this, PlayState* play) { EnNb_SetCurrentAnim(this, &gNabooruTrappedInVortexPushingGroundAnim, 0, 0.0f, 0); this->action = NB_KIDNAPPED; this->actor.shape.shadowAlpha = 0; - gSaveContext.eventChkInf[9] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA); } void EnNb_PlayCrySFX(EnNb* this, PlayState* play) { @@ -1102,11 +1102,11 @@ void EnNb_LookUp(EnNb* this, PlayState* play) { } void EnNb_CrawlspaceSpawnCheck(EnNb* this, PlayState* play) { - if (!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[9] & 0x20) && LINK_IS_CHILD) { + if (!gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA) && LINK_IS_CHILD) { EnNb_UpdatePath(this, play); // looking into crawlspace - if (!(gSaveContext.eventChkInf[9] & 0x10)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_NABOORU_IN_SPIRIT_TEMPLE)) { EnNb_SetCurrentAnim(this, &gNabooruKneeingAtCrawlspaceAnim, 0, 0.0f, 0); this->action = NB_CROUCH_CRAWLSPACE; this->drawMode = NB_DRAW_DEFAULT; @@ -1203,7 +1203,7 @@ void func_80AB3838(EnNb* this, PlayState* play) { } else { this->actor.flags |= ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY; - if (!(gSaveContext.infTable[22] & 0x1000)) { + if (!Flags_GetInfTable(INFTABLE_16C)) { this->actor.textId = 0x601D; } else { this->actor.textId = 0x6024; @@ -1215,7 +1215,7 @@ void func_80AB3838(EnNb* this, PlayState* play) { void EnNb_SetupPathMovement(EnNb* this, PlayState* play) { EnNb_SetCurrentAnim(this, &gNabooruStandingToWalkingTransitionAnim, 2, -8.0f, 0); - gSaveContext.eventChkInf[9] |= 0x10; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_NABOORU_IN_SPIRIT_TEMPLE); this->action = NB_IN_PATH; this->actor.flags &= ~(ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY); } @@ -1233,7 +1233,7 @@ void EnNb_SetTextIdAsChild(EnNb* this, PlayState* play) { EnNb_SetupPathMovement(this, play); } else { if (textId == 0x6027) { - gSaveContext.infTable[22] |= 0x1000; + Flags_SetInfTable(INFTABLE_16C); } this->action = NB_IDLE_CRAWLSPACE; } diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c index d84c5423f..fff9689b0 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -190,22 +190,22 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { } break; case 1: - if (gSaveContext.eventChkInf[1] & 0x10) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); } break; case 3: - if (!(gSaveContext.eventChkInf[1] & 0x10)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); } break; case 5: - if (gSaveContext.eventChkInf[1] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { Actor_Kill(&this->actor); } break; case 7: - if (!(gSaveContext.eventChkInf[1] & 0x100)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { Actor_Kill(&this->actor); } break; @@ -228,7 +228,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { case 0xD: case 0xE: Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit2); - if (play->sceneNum == SCENE_LINK_HOME && !(gSaveContext.eventChkInf[1] & 0x4000)) { + if (play->sceneNum == SCENE_LINK_HOME && !Flags_GetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE)) { Actor_Kill(&this->actor); } break; diff --git a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index b0ba52947..aecbd0224 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -144,7 +144,7 @@ void EnNiwGirl_Talk(EnNiwGirl* this, PlayState* play) { -10.0f); this->actor.flags |= ACTOR_FLAG_TARGETABLE; this->actor.textId = 0x7000; - if ((gSaveContext.eventChkInf[8] & 1) && (this->unk_27A == 0)) { + if ((Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) && (this->unk_27A == 0)) { this->actor.textId = 0x70EA; } switch (Player_GetMask(play)) { diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 50df2657a..34b19aa60 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -172,7 +172,7 @@ void func_80AB9F24(EnNiwLady* this, PlayState* play) { this->actor.draw = EnNiwLady_Draw; switch (this->unk_278) { case 0: - if (!(gSaveContext.itemGetInf[0] & 0x1000) && !LINK_IS_ADULT) { + if (!Flags_GetItemGetInf(ITEMGETINF_0C) && !LINK_IS_ADULT) { frames = Animation_GetLastFrame(&gObjOsAnim_A630); Animation_Change(&this->skelAnime, &gObjOsAnim_A630, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, 0.0f); } else { @@ -305,7 +305,7 @@ void func_80ABA654(EnNiwLady* this, PlayState* play) { osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 爆弾 ☆☆☆☆☆ %d\n" VT_RST, this->unk_272); osSyncPrintf("\n\n"); this->unk_26E = 0xB; - if (!(gSaveContext.itemGetInf[0] & 0x1000)) { + if (!Flags_GetItemGetInf(ITEMGETINF_0C)) { this->actor.parent = NULL; if (!gSaveContext.n64ddFlag) { @@ -336,7 +336,7 @@ void func_80ABA778(EnNiwLady* this, PlayState* play) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ アダルトメッセージチェック ☆☆☆☆☆ \n" VT_RST); this->unk_262 = TEXT_STATE_DONE; this->unk_273 = 0; - if (!(gSaveContext.itemGetInf[2] & 0x1000)) { + if (!Flags_GetItemGetInf(ITEMGETINF_2C)) { if (this->unk_274 != 0) { this->unk_27A = 1; } else { @@ -346,9 +346,9 @@ void func_80ABA778(EnNiwLady* this, PlayState* play) { this->unk_262 = TEXT_STATE_CHOICE; } else { this->unk_27A = 2; - if (!(gSaveContext.itemGetInf[2] & 0x4000)) { + if (!Flags_GetItemGetInf(ITEMGETINF_2E)) { this->unk_27A = 3; - if (gSaveContext.eventChkInf[6] & 0x400) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO)) { this->unk_27A = 9; if (this->unk_277 != 0) { this->unk_27A = 10; @@ -372,7 +372,7 @@ void func_80ABA878(EnNiwLady* this, PlayState* play) { } if (Actor_ProcessTalkRequest(&this->actor, play)) { playerExchangeItemId = func_8002F368(play); - if ((playerExchangeItemId == 6) && (gSaveContext.eventChkInf[6] & 0x400)) { + if ((playerExchangeItemId == 6) && (Flags_GetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO))) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); player->actor.textId = sTradeItemTextIds[5]; this->unk_26E = this->unk_27A + 21; @@ -403,7 +403,7 @@ void func_80ABA9B8(EnNiwLady* this, PlayState* play) { } else { // TODO: get-item-rework Adult trade sequence this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); - gSaveContext.itemGetInf[2] |= 0x1000; + Flags_SetItemGetInf(ITEMGETINF_2C); } this->actionFunc = func_80ABAC00; @@ -439,7 +439,7 @@ void func_80ABAB08(EnNiwLady* this, PlayState* play) { // TODO: get-item-rework Adult trade sequence this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO); Randomizer_ConsumeAdultTradeItem(play, ITEM_POCKET_CUCCO); - gSaveContext.itemGetInf[2] |= 0x4000; + Flags_SetItemGetInf(ITEMGETINF_2E); } this->actionFunc = func_80ABAC00; break; @@ -465,7 +465,7 @@ void func_80ABAC00(EnNiwLady* this, PlayState* play) { getItemId = this->getItemId; if (LINK_IS_ADULT) { if (!gSaveContext.n64ddFlag) { - getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO; + getItemId = !Flags_GetItemGetInf(ITEMGETINF_2C) ? GI_POCKET_EGG : GI_COJIRO; } else { // TODO: get-item-rework Adult trade sequence getItemId = this->getItemEntry.getItemId; @@ -486,14 +486,14 @@ void func_80ABAC84(EnNiwLady* this, PlayState* play) { } osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); if (LINK_IS_ADULT) { - if (!(gSaveContext.itemGetInf[2] & 0x1000)) { - gSaveContext.itemGetInf[2] |= 0x1000; + if (!Flags_GetItemGetInf(ITEMGETINF_2C)) { + Flags_SetItemGetInf(ITEMGETINF_2C); } else { - gSaveContext.itemGetInf[2] |= 0x4000; + Flags_SetItemGetInf(ITEMGETINF_2E); } this->actionFunc = func_80ABA778; } else { - gSaveContext.itemGetInf[0] |= 0x1000; + Flags_SetItemGetInf(ITEMGETINF_0C); this->unk_262 = TEXT_STATE_DONE; this->actionFunc = func_80ABA244; } diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index ad5283c63..007b9d1d8 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -192,8 +192,8 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { if ((this->ocarinaSong != 6) || (gSaveContext.scarecrowSpawnSongSet)) { if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; - } else if (((this->type != 4) || !(gSaveContext.eventChkInf[4] & 0x800)) && - ((this->type != 6) || !(gSaveContext.eventChkInf[1] & 0x2000)) && + } else if (((this->type != 4) || !Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) && + ((this->type != 6) || !Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) && (this->actor.xzDistToPlayer < (90.0f + this->interactRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { if (player->stateFlags2 & 0x1000000) { @@ -243,15 +243,15 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { switch (this->type) { case 1: Flags_SetSwitch(play, this->switchFlag); - gSaveContext.eventChkInf[3] |= 0x200; + Flags_SetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN); break; case 2: if (!gSaveContext.n64ddFlag) { play->csCtx.segment = D_80ABF9D0; gSaveContext.cutsceneTrigger = 1; } else { - gSaveContext.eventChkInf[6] |= 0x80; - gSaveContext.eventChkInf[6] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO); + Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL); } func_800F574C(1.18921f, 0x5A); break; @@ -279,7 +279,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { : SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_005020); gSaveContext.cutsceneTrigger = 1; } - gSaveContext.eventChkInf[1] |= 0x2000; + Flags_SetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB); func_80078884(NA_SE_SY_CORRECT_CHIME); break; default: diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index e403871b9..75c0669fa 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -373,7 +373,7 @@ s16 ShopItemDisp_Default(s16 v) { s16 ShopItemDisp_SpookyMask(s16 v) { // Sold Skull Mask - if (gSaveContext.itemGetInf[3] & 0x200) { + if (Flags_GetItemGetInf(ITEMGETINF_39)) { return v; } return -1; @@ -381,7 +381,7 @@ s16 ShopItemDisp_SpookyMask(s16 v) { s16 ShopItemDisp_SkullMask(s16 v) { // Sold Keaton Mask - if (gSaveContext.itemGetInf[3] & 0x100) { + if (Flags_GetItemGetInf(ITEMGETINF_38)) { return v; } return -1; @@ -389,7 +389,7 @@ s16 ShopItemDisp_SkullMask(s16 v) { s16 ShopItemDisp_BunnyHood(s16 v) { // Sold Spooky Mask - if (gSaveContext.itemGetInf[3] & 0x400) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { return v; } return -1; @@ -397,7 +397,7 @@ s16 ShopItemDisp_BunnyHood(s16 v) { s16 ShopItemDisp_ZoraMask(s16 v) { // Obtained Mask of Truth - if (gSaveContext.itemGetInf[3] & 0x8000) { + if (Flags_GetItemGetInf(ITEMGETINF_3F)) { return v; } return -1; @@ -405,7 +405,7 @@ s16 ShopItemDisp_ZoraMask(s16 v) { s16 ShopItemDisp_GoronMask(s16 v) { // Obtained Mask of Truth - if (gSaveContext.itemGetInf[3] & 0x8000) { + if (Flags_GetItemGetInf(ITEMGETINF_3F)) { return v; } return -1; @@ -413,7 +413,7 @@ s16 ShopItemDisp_GoronMask(s16 v) { s16 ShopItemDisp_GerudoMask(s16 v) { // Obtained Mask of Truth - if (gSaveContext.itemGetInf[3] & 0x8000) { + if (Flags_GetItemGetInf(ITEMGETINF_3F)) { return v; } return -1; @@ -525,7 +525,7 @@ void EnOssan_TalkZoraShopkeeper(PlayState* play) { // Goron City, Goron void EnOssan_TalkGoronShopkeeper(PlayState* play) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - if (gSaveContext.eventChkInf[2] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { Message_ContinueTextbox(play, 0x3028); } else if (CUR_UPG_VALUE(UPG_STRENGTH) != 0) { Message_ContinueTextbox(play, 0x302D); @@ -542,10 +542,10 @@ void EnOssan_TalkGoronShopkeeper(PlayState* play) { // Happy Mask Shop void EnOssan_TalkHappyMaskShopkeeper(PlayState* play) { - if ((gSaveContext.itemGetInf[3] & 0x100) // Sold Keaton Mask - && (gSaveContext.itemGetInf[3] & 0x200) // Sold Skull Mask - && (gSaveContext.itemGetInf[3] & 0x400) // Sold Spooky Mask - && (gSaveContext.itemGetInf[3] & 0x800)) { // Sold Bunny Hood + if ((Flags_GetItemGetInf(ITEMGETINF_38)) // Sold Keaton Mask + && (Flags_GetItemGetInf(ITEMGETINF_39)) // Sold Skull Mask + && (Flags_GetItemGetInf(ITEMGETINF_3A)) // Sold Spooky Mask + && (Flags_GetItemGetInf(ITEMGETINF_3B))) { // Sold Bunny Hood Message_ContinueTextbox(play, 0x70AE); } else { switch (play->msgCtx.choiceIndex) { @@ -605,8 +605,8 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { // If you haven't given Zelda's Letter to the Kakariko Guard // or are rando'd and haven't gotten gotten the letter from zelda yet - if (this->actor.params == OSSAN_TYPE_MASK && (!(gSaveContext.infTable[7] & 0x40) || - (gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[4] & 1)))) { + if (this->actor.params == OSSAN_TYPE_MASK && (!Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD) || + (gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)))) { Actor_Kill(&this->actor); return; } @@ -617,8 +617,8 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { } // Don't kill bombchu shop actor in rando, making it so the shop is immediately open - // gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern - if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20) && !gSaveContext.n64ddFlag) { + // Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) - Completed Dodongo's Cavern + if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && !gSaveContext.n64ddFlag) { Actor_Kill(&this->actor); return; } @@ -724,8 +724,8 @@ void EnOssan_StartShopping(PlayState* play, EnOssan* this) { if (this->actor.params == OSSAN_TYPE_MASK) { // if all masks have been sold, give the option to ask about the mask of truth - if ((gSaveContext.itemGetInf[3] & 0x100) && (gSaveContext.itemGetInf[3] & 0x200) && - (gSaveContext.itemGetInf[3] & 0x400) && (gSaveContext.itemGetInf[3] & 0x800)) { + if ((Flags_GetItemGetInf(ITEMGETINF_38)) && (Flags_GetItemGetInf(ITEMGETINF_39)) && + (Flags_GetItemGetInf(ITEMGETINF_3A)) && (Flags_GetItemGetInf(ITEMGETINF_3B))) { Message_ContinueTextbox(play, 0x70AD); } else { Message_ContinueTextbox(play, 0x70A2); @@ -891,18 +891,18 @@ void EnOssan_TryPaybackMask(EnOssan* this, PlayState* play) { Rupees_ChangeBy(-price); if (this->happyMaskShopState == OSSAN_HAPPY_STATE_REQUEST_PAYMENT_BUNNY_HOOD) { - gSaveContext.eventChkInf[8] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE); Message_ContinueTextbox(play, 0x70A9); this->happyMaskShopState = OSSAN_HAPPY_STATE_ALL_MASKS_SOLD; return; } if (this->happyMaskShopState == OSSAN_HAPPY_STATE_REQUEST_PAYMENT_KEATON_MASK) { - gSaveContext.eventChkInf[8] |= 0x1000; + Flags_SetEventChkInf(EVENTCHKINF_PAID_BACK_KEATON_MASK_FEE); } else if (this->happyMaskShopState == OSSAN_HAPPY_STATE_REQUEST_PAYMENT_SPOOKY_MASK) { - gSaveContext.eventChkInf[8] |= 0x4000; + Flags_SetEventChkInf(EVENTCHKINF_PAID_BACK_SPOOKY_MASK_FEE); } else if (this->happyMaskShopState == OSSAN_HAPPY_STATE_REQUEST_PAYMENT_SKULL_MASK) { - gSaveContext.eventChkInf[8] |= 0x2000; + Flags_SetEventChkInf(EVENTCHKINF_PAID_BACK_SKULL_MASK_FEE); } Message_ContinueTextbox(play, 0x70A7); @@ -1421,7 +1421,7 @@ void EnOssan_HandleCanBuyItem(PlayState* play, EnOssan* this) { switch (selectedItem->canBuyFunc(play, selectedItem)) { case CANBUY_RESULT_SUCCESS_FANFARE: - if (selectedItem->actor.params == SI_HYLIAN_SHIELD && gSaveContext.infTable[7] & 0x40) { + if (selectedItem->actor.params == SI_HYLIAN_SHIELD && Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) { EnOssan_SetStateGiveDiscountDialog(play, this); } else { EnOssan_GiveItemWithFanfare(play, this); @@ -1536,9 +1536,9 @@ void EnOssan_BuyGoronCityBombs(PlayState* play, EnOssan* this) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { // Let players buy the right side of the goron shop in rando regardless of DC completion // Players will still need a bomb bag to buy bombs (handled by vanilla behaviour) - // gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern - if (!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[2] & 0x20)) { - if (gSaveContext.infTable[15] & 0x1000) { + // Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) - Completed Dodongo's Cavern + if (!gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { + if (Flags_GetInfTable(INFTABLE_FC)) { EnOssan_SetStateCantGetItem(play, this, 0x302E); } else { this->stickLeftPrompt.isEnabled = false; @@ -1633,7 +1633,7 @@ void EnOssan_State_SelectBombs(EnOssan* this, PlayState* play, Player* player) { osSyncPrintf("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", __FILE__, __LINE__); return; } - osSyncPrintf("店主の依頼 ( %d )\n", gSaveContext.infTable[15] & 0x1000); + osSyncPrintf("店主の依頼 ( %d )\n", Flags_GetInfTable(INFTABLE_FC)); if (this->actor.params != OSSAN_TYPE_GORON) { EnOssan_State_ItemSelected(this, play, player); return; @@ -1672,16 +1672,16 @@ void EnOssan_State_SelectMaskItem(EnOssan* this, PlayState* play, Player* player case 0: switch (item->actor.params) { case SI_KEATON_MASK: - gSaveContext.itemGetInf[2] |= 0x08; + Flags_SetItemGetInf(ITEMGETINF_23); break; case SI_SPOOKY_MASK: - gSaveContext.itemGetInf[2] |= 0x20; + Flags_SetItemGetInf(ITEMGETINF_25); break; case SI_SKULL_MASK: - gSaveContext.itemGetInf[2] |= 0x10; + Flags_SetItemGetInf(ITEMGETINF_24); break; case SI_BUNNY_HOOD: - gSaveContext.itemGetInf[2] |= 0x40; + Flags_SetItemGetInf(ITEMGETINF_26); break; case SI_MASK_OF_TRUTH: case SI_ZORA_MASK: @@ -1766,8 +1766,8 @@ void EnOssan_State_ItemPurchased(EnOssan* this, PlayState* play, Player* player) EnOssan_ResetItemPosition(this); item = this->shelfSlots[this->cursorIndex]; item->updateStockedItemFunc(play, item); - if (itemTemp->actor.params == SI_MASK_OF_TRUTH && !(gSaveContext.itemGetInf[3] & 0x8000)) { - gSaveContext.itemGetInf[3] |= 0x8000; + if (itemTemp->actor.params == SI_MASK_OF_TRUTH && !Flags_GetItemGetInf(ITEMGETINF_3F)) { + Flags_SetItemGetInf(ITEMGETINF_3F); Message_ContinueTextbox(play, 0x70AB); this->happyMaskShopState = OSSAN_HAPPY_STATE_BORROWED_FIRST_MASK; EnOssan_UpdateShopOfferings(this, play); @@ -1834,7 +1834,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player void EnOssan_State_WaitForDisplayOnlyBombDialog(EnOssan* this, PlayState* play, Player* player) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(play)) { - gSaveContext.infTable[15] |= 0x1000; + Flags_SetInfTable(INFTABLE_FC); EnOssan_StartShopping(play, this); } } @@ -1844,7 +1844,7 @@ void EnOssan_State_21(EnOssan* this, PlayState* play, Player* player) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE_HAS_NEXT && Message_ShouldAdvance(play)) { this->stateFlag = OSSAN_STATE_22; Message_ContinueTextbox(play, 0x3012); - gSaveContext.infTable[15] |= 0x1000; + Flags_SetInfTable(INFTABLE_FC); } } @@ -1864,7 +1864,7 @@ void EnOssan_State_GiveLonLonMilk(EnOssan* this, PlayState* play, Player* player // For giving Mask of Truth when you first sell all masks void EnOssan_State_LendMaskOfTruth(EnOssan* this, PlayState* play, Player* player) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(play)) { - gSaveContext.itemGetInf[2] |= 0x400; + Flags_SetItemGetInf(ITEMGETINF_2A); this->cursorIndex = 2; EnOssan_GiveItemWithFanfare(play, this); } @@ -2155,8 +2155,8 @@ u16 EnOssan_SetupHelloDialog(EnOssan* this) { // mask shop messages if (this->actor.params == OSSAN_TYPE_MASK) { if (INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_SOLD_OUT) { - if (gSaveContext.itemGetInf[3] & 0x800) { - if (!(gSaveContext.eventChkInf[8] & 0x8000)) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE)) { // Pay back Bunny Hood this->happyMaskShopState = OSSAN_HAPPY_STATE_REQUEST_PAYMENT_BUNNY_HOOD; return 0x70C6; @@ -2164,8 +2164,8 @@ u16 EnOssan_SetupHelloDialog(EnOssan* this) { return 0x70AC; } } - if (gSaveContext.itemGetInf[3] & 0x400) { - if (!(gSaveContext.eventChkInf[8] & 0x4000)) { + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_SPOOKY_MASK_FEE)) { // Pay back Spooky Mask this->happyMaskShopState = OSSAN_HAPPY_STATE_REQUEST_PAYMENT_SPOOKY_MASK; return 0x70C5; @@ -2173,8 +2173,8 @@ u16 EnOssan_SetupHelloDialog(EnOssan* this) { return 0x70AC; } } - if (gSaveContext.itemGetInf[3] & 0x200) { - if (!(gSaveContext.eventChkInf[8] & 0x2000)) { + if (Flags_GetItemGetInf(ITEMGETINF_39)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_SKULL_MASK_FEE)) { // Pay back Skull Mask this->happyMaskShopState = OSSAN_HAPPY_STATE_REQUEST_PAYMENT_SKULL_MASK; return 0x70C4; @@ -2182,8 +2182,8 @@ u16 EnOssan_SetupHelloDialog(EnOssan* this) { return 0x70AC; } } - if (gSaveContext.itemGetInf[3] & 0x100) { - if (!(gSaveContext.eventChkInf[8] & 0x1000)) { + if (Flags_GetItemGetInf(ITEMGETINF_38)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_KEATON_MASK_FEE)) { // Pay back Keaton Mask this->happyMaskShopState = OSSAN_HAPPY_STATE_REQUEST_PAYMENT_KEATON_MASK; return 0x70A5; @@ -2192,12 +2192,12 @@ u16 EnOssan_SetupHelloDialog(EnOssan* this) { } } } else { - if (gSaveContext.itemGetInf[3] & 0x800) { + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { return 0x70AC; - } else if (!(gSaveContext.itemGetInf[3] & 0x400) && !(gSaveContext.itemGetInf[2] & 0x10) && - !(gSaveContext.itemGetInf[3] & 0x100)) { + } else if (!Flags_GetItemGetInf(ITEMGETINF_3A) && !Flags_GetItemGetInf(ITEMGETINF_24) && + !Flags_GetItemGetInf(ITEMGETINF_38)) { // Haven't borrowed the Keaton Mask - if (!(gSaveContext.itemGetInf[2] & 0x8)) { + if (!Flags_GetItemGetInf(ITEMGETINF_23)) { return 0x70A1; } else { // Haven't sold the Keaton Mask diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index a6405304c..22d490799 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -162,7 +162,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnOwl_WaitHyruleCastle; break; case OWL_KAKARIKO: - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { // has zelda's letter osSyncPrintf("フクロウ退避\n"); // "Owl evacuation" Actor_Kill(&this->actor); @@ -172,7 +172,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnOwl_WaitKakariko; break; case OWL_HYLIA_GERUDO: - if (gSaveContext.eventChkInf[4] & 8) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_OCARINA_OF_TIME)) { // has ocarina of time osSyncPrintf("フクロウ退避\n"); // "Owl evacuation" Actor_Kill(&this->actor); @@ -184,7 +184,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnOwl_WaitLakeHylia; break; case OWL_ZORA_RIVER: - if ((gSaveContext.eventChkInf[3] & 0x200) || !(gSaveContext.eventChkInf[4] & 1)) { + if ((Flags_GetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN)) || !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { // opened zora's domain or has zelda's letter osSyncPrintf("フクロウ退避\n"); // "Owl evacuation" Actor_Kill(&this->actor); @@ -394,7 +394,7 @@ void EnOwl_WaitOutsideKokiri(EnOwl* this, PlayState* play) { this->actionFunc = EnOwl_ConfirmKokiriMessage; // spoke to owl by lost woods - gSaveContext.eventChkInf[6] |= 0x8000; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_KAEPORA_BY_LOST_WOODS); } } @@ -451,7 +451,7 @@ void func_80ACAB88(EnOwl* this, PlayState* play) { switch (index) { case OWL_REPEAT: // obtained zelda's letter - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { Message_ContinueTextbox(play, 0x206D); } else { Message_ContinueTextbox(play, 0x206C); @@ -604,12 +604,12 @@ void func_80ACB148(EnOwl* this, PlayState* play) { } void EnOwl_WaitHyliaShortcut(EnOwl* this, PlayState* play) { - u16 textId = (gSaveContext.infTable[25] & 0x20) ? 0x4004 : 0x4003; + u16 textId = (Flags_GetInfTable(INFTABLE_SPOKE_TO_KAEPORA_IN_LAKE_HYLIA)) ? 0x4004 : 0x4003; // Spoke to Owl in Lake Hylia EnOwl_LookAtLink(this, play); if (func_80ACA558(this, play, textId)) { - gSaveContext.infTable[25] |= 0x20; + Flags_SetInfTable(INFTABLE_SPOKE_TO_KAEPORA_IN_LAKE_HYLIA); Audio_PlayFanfare(NA_BGM_OWL); this->actionFunc = func_80ACB148; } diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index e977c1286..5ee3f325a 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -763,21 +763,21 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) { } // Convenience function used so that Ruto always spawns in Jabu in rando, even after she's been kidnapped -// Equivalent to !(gSaveContext.infTable[20] & 0x20) in vanilla +// Equivalent to !Flags_GetInfTable(INFTABLE_145) in vanilla bool shouldSpawnRuto() { - // gSaveContext.infTable[20] & 0x40 check is to prevent Ruto from spawning during the short period of time when + // Flags_GetInfTable(INFTABLE_146) check is to prevent Ruto from spawning during the short period of time when // she's on the Zora's Sapphire pedestal but hasn't been kidnapped yet (would result in multiple Rutos otherwise) - return !(gSaveContext.infTable[20] & 0x20) || (gSaveContext.n64ddFlag && (gSaveContext.infTable[20] & 0x40)); + return !Flags_GetInfTable(INFTABLE_145) || (gSaveContext.n64ddFlag && (Flags_GetInfTable(INFTABLE_146))); } void func_80AEC320(EnRu1* this, PlayState* play) { s8 actorRoom; - if (!(gSaveContext.infTable[20] & 2)) { + if (!Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 7; EnRu1_SetMouthIndex(this, 1); - } else if ((gSaveContext.infTable[20] & 0x80) && !(gSaveContext.infTable[20] & 1) && shouldSpawnRuto()) { + } else if ((Flags_GetInfTable(INFTABLE_147)) && !Flags_GetInfTable(INFTABLE_140) && shouldSpawnRuto()) { if (!func_80AEB020(this, play)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; @@ -930,7 +930,7 @@ void func_80AECA18(EnRu1* this) { void func_80AECA44(EnRu1* this, PlayState* play) { if (func_80AEAFA0(play, 5, 3)) { - gSaveContext.infTable[20] |= 2; + Flags_SetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO); this->action = 14; } } @@ -1181,8 +1181,8 @@ void func_80AED414(EnRu1* this, PlayState* play) { void func_80AED44C(EnRu1* this, PlayState* play) { s8 actorRoom; - if ((gSaveContext.infTable[20] & 2) && shouldSpawnRuto() && !(gSaveContext.infTable[20] & 1) && - !(gSaveContext.infTable[20] & 0x80)) { + if ((Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO)) && shouldSpawnRuto() && !Flags_GetInfTable(INFTABLE_140) && + !Flags_GetInfTable(INFTABLE_147)) { if (!func_80AEB020(this, play)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; @@ -1255,10 +1255,10 @@ void func_80AED6DC(EnRu1* this, PlayState* play) { void func_80AED6F8(PlayState* play) { s8 curRoomNum; - if ((!(gSaveContext.infTable[20] & 0x80))) { + if ((!Flags_GetInfTable(INFTABLE_147))) { curRoomNum = play->roomCtx.curRoom.num; if (curRoomNum == 2) { - gSaveContext.infTable[20] |= 0x80; + Flags_SetInfTable(INFTABLE_147); } } } @@ -1506,10 +1506,10 @@ void func_80AEE050(EnRu1* this) { s32 func_80AEE264(EnRu1* this, PlayState* play) { if (!Actor_ProcessTalkRequest(&this->actor, play)) { this->actor.flags |= ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY; - if ((gSaveContext.infTable[20] & 8)) { + if ((Flags_GetInfTable(INFTABLE_143))) { this->actor.textId = 0x404E; func_8002F2F4(&this->actor, play); - } else if (gSaveContext.infTable[20] & 4) { + } else if (Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_TALK_FIRST_TIME)) { this->actor.textId = 0x404D; func_8002F2F4(&this->actor, play); } else { @@ -1530,12 +1530,12 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { if (((dynaPolyActor->actor.params >> 8) & 0x3F) == 0x38) { - gSaveContext.infTable[20] |= 1; + Flags_SetInfTable(INFTABLE_140); return; } } } - gSaveContext.infTable[20] &= ~0x1; + Flags_UnsetInfTable(INFTABLE_140); } s32 func_80AEE394(EnRu1* this, PlayState* play) { @@ -1599,7 +1599,7 @@ void func_80AEE628(EnRu1* this, PlayState* play) { if (EnRu1_IsCsStateIdle(play)) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSittingAnim), ANIMMODE_LOOP, -8.0f); - gSaveContext.infTable[20] |= 0x10; + Flags_SetInfTable(INFTABLE_RUTO_IN_JJ_WANTS_TO_BE_TOSSED_TO_SAPPHIRE); this->action = 31; } this->roomNum3 = curRoomNum; @@ -1609,7 +1609,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { s32 pad; s8 curRoomNum = play->roomCtx.curRoom.num; - if (!(gSaveContext.infTable[20] & 0x10) && (func_80AEB124(play) != 0)) { + if (!Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_WANTS_TO_BE_TOSSED_TO_SAPPHIRE) && (func_80AEB124(play) != 0)) { if (!Player_InCsMode(play)) { Animation_Change(&this->skelAnime, &gRutoChildSeesSapphireAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f); @@ -1821,7 +1821,7 @@ void func_80AEF080(EnRu1* this) { s32 func_80AEF0BC(EnRu1* this, PlayState* play) { s32 frameCount; - if (gSaveContext.infTable[20] & 4) { + if (Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_TALK_FIRST_TIME)) { frameCount = Animation_GetLastFrame(&gRutoChildSitAnim); Animation_Change(&this->skelAnime, &gRutoChildSitAnim, 1.0f, 0, frameCount, ANIMMODE_ONCE, -8.0f); play->msgCtx.msgMode = MSGMODE_PAUSED; @@ -1841,7 +1841,7 @@ void func_80AEF170(EnRu1* this, PlayState* play, s32 cond) { void func_80AEF188(EnRu1* this, PlayState* play) { if (func_80AEB174(play) && !func_80AEF0BC(this, play)) { Message_CloseTextbox(play); - gSaveContext.infTable[20] |= 4; + Flags_SetInfTable(INFTABLE_RUTO_IN_JJ_TALK_FIRST_TIME); this->action = 24; } } @@ -1851,7 +1851,7 @@ void func_80AEF1F0(EnRu1* this, PlayState* play, UNK_TYPE arg2) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gRutoChildSittingAnim), ANIMMODE_LOOP, 0.0f); Message_CloseTextbox(play); - gSaveContext.infTable[20] |= 8; + Flags_SetInfTable(INFTABLE_143); func_80AED6DC(this, play); func_8002F580(&this->actor, play); this->action = 27; @@ -2013,7 +2013,7 @@ void func_80AEF890(EnRu1* this, PlayState* play) { if ((gSaveContext.sceneSetupIndex < 4) && (EnRu1_IsCsStateIdle(play))) { curRoomNum = play->roomCtx.curRoom.num; - gSaveContext.infTable[20] |= 0x20; + Flags_SetInfTable(INFTABLE_145); Flags_SetSwitch(play, func_80AEADE0(this)); func_80AEB0EC(this, 1); this->action = 42; @@ -2104,7 +2104,7 @@ void func_80AEFC24(EnRu1* this, PlayState* play) { } void func_80AEFC54(EnRu1* this, PlayState* play) { - if ((gSaveContext.infTable[20] & 0x20) && !(gSaveContext.infTable[20] & 0x40)) { + if ((Flags_GetInfTable(INFTABLE_145)) && !Flags_GetInfTable(INFTABLE_146)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 41; this->unk_28C = EnRu1_FindSwitch(play); @@ -2125,7 +2125,7 @@ void func_80AEFCE8(EnRu1* this, PlayState* play) { } void func_80AEFD38(EnRu1* this, PlayState* play) { - if ((gSaveContext.eventChkInf[3] & 0x80) && LINK_IS_CHILD) { + if ((Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) && LINK_IS_CHILD) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->actor.flags &= ~ACTOR_FLAG_UPDATE_WHILE_CULLED; this->action = 44; @@ -2188,7 +2188,7 @@ void func_80AEFF40(EnRu1* this, PlayState* play) { void func_80AEFF94(EnRu1* this, PlayState* play) { s8 actorRoom; - if ((gSaveContext.infTable[20] & 2) && (gSaveContext.infTable[20] & 1) && shouldSpawnRuto() && + if ((Flags_GetInfTable(INFTABLE_RUTO_IN_JJ_MEET_RUTO)) && (Flags_GetInfTable(INFTABLE_140)) && shouldSpawnRuto() && (!(func_80AEB020(this, play)))) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index c812e4c0e..a98dfeaea 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -152,25 +152,25 @@ u16 func_80AF55E0(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { this->unk_208 = 0; this->unk_209 = TEXT_STATE_NONE; - if (gSaveContext.infTable[0] & 0x20) { + if (Flags_GetInfTable(INFTABLE_05)) { return 0x1048; } else { return 0x1047; } } - if (gSaveContext.eventChkInf[0] & 4) { + if (Flags_GetEventChkInf(EVENTCHKINF_FIRST_SPOKE_TO_MIDO)) { this->unk_208 = 0; this->unk_209 = TEXT_STATE_NONE; - if (gSaveContext.infTable[0] & 8) { + if (Flags_GetInfTable(INFTABLE_03)) { return 0x1032; } else { return 0x1031; } } - if (gSaveContext.infTable[0] & 1) { + if (Flags_GetInfTable(INFTABLE_GREETED_BY_SARIA)) { this->unk_208 = 0; this->unk_209 = TEXT_STATE_NONE; - if (gSaveContext.infTable[0] & 2) { + if (Flags_GetInfTable(INFTABLE_01)) { return 0x1003; } else { return 0x1002; @@ -187,16 +187,16 @@ s16 func_80AF56F4(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: switch (this->actor.textId) { case 0x1002: - gSaveContext.infTable[0] |= 2; + Flags_SetInfTable(INFTABLE_01); ret = NPC_TALK_STATE_IDLE; break; case 0x1031: - gSaveContext.eventChkInf[0] |= 8; - gSaveContext.infTable[0] |= 8; + Flags_SetEventChkInf(EVENTCHKINF_COMPLAINED_ABOUT_MIDO); + Flags_SetInfTable(INFTABLE_03); ret = NPC_TALK_STATE_IDLE; break; case 0x1047: - gSaveContext.infTable[0] |= 0x20; + Flags_SetInfTable(INFTABLE_05); ret = NPC_TALK_STATE_IDLE; break; default: @@ -383,17 +383,17 @@ s32 func_80AF5DFC(EnSa* this, PlayState* play) { } } if (play->sceneNum == SCENE_KOKIRI_HOME5 && !LINK_IS_ADULT && - INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY && !(gSaveContext.eventChkInf[4] & 1)) { + INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY && !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { return 1; } - if (play->sceneNum == SCENE_SPOT05 && (gSaveContext.eventChkInf[4] & 1)) { + if (play->sceneNum == SCENE_SPOT05 && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER))) { if (gSaveContext.n64ddFlag) { return 5; } return CHECK_QUEST_ITEM(QUEST_SONG_SARIA) ? 2 : 5; } if (play->sceneNum == SCENE_SPOT04 && !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { - if (gSaveContext.infTable[0] & 1) { + if (Flags_GetInfTable(INFTABLE_GREETED_BY_SARIA)) { return 1; } return 4; @@ -591,7 +591,7 @@ void func_80AF6448(EnSa* this, PlayState* play) { break; } } else if (!CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && - ((gSaveContext.infTable[0] & 2) || (gSaveContext.infTable[0] & 8))) { + ((Flags_GetInfTable(INFTABLE_01)) || (Flags_GetInfTable(INFTABLE_03)))) { if (this->unk_20B != 3) { func_80AF5CD4(this, 3); } @@ -727,7 +727,7 @@ void func_80AF6B20(EnSa* this, PlayState* play) { this->actor.world.pos = this->actor.home.pos; this->actor.world.rot = this->unk_21A; this->mouthIndex = 0; - gSaveContext.infTable[0] |= 1; + Flags_SetInfTable(INFTABLE_GREETED_BY_SARIA); } this->actionFunc = func_80AF6448; diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 8c5026a87..45e3b4e91 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -78,9 +78,9 @@ void EnShopnuts_Init(Actor* thisx, PlayState* play) { } } - if (((this->actor.params == 0x0002) && (gSaveContext.itemGetInf[0] & 0x800)) || - ((this->actor.params == 0x0009) && (gSaveContext.infTable[25] & 4)) || - ((this->actor.params == 0x000A) && (gSaveContext.infTable[25] & 8))) { + if (((this->actor.params == 0x0002) && (Flags_GetItemGetInf(ITEMGETINF_0B))) || + ((this->actor.params == 0x0009) && (Flags_GetInfTable(INFTABLE_192))) || + ((this->actor.params == 0x000A) && (Flags_GetInfTable(INFTABLE_193)))) { Actor_Kill(&this->actor); } else { EnShopnuts_SetupWait(this); diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index f4c27fda3..06e402138 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -341,9 +341,9 @@ void EnSkj_CalculateCenter(EnSkj* this) { void EnSkj_SetNaviId(EnSkj* this) { switch (this->actor.params) { case 0: - if (gSaveContext.itemGetInf[3] & 0x200) { + if (Flags_GetItemGetInf(ITEMGETINF_39)) { this->actor.naviEnemyId = 0x41; // Skull kid with skull mask - } else if (gSaveContext.itemGetInf[1] & 0x40) { + } else if (Flags_GetItemGetInf(ITEMGETINF_16)) { this->actor.naviEnemyId = 0x40; // Skull kid after Saria's song but no mask } else { this->actor.naviEnemyId = 0x3F; // No Sarias song no skull mask @@ -714,7 +714,7 @@ void EnSkj_SetupResetFight(EnSkj* this) { void EnSkj_SariasSongKidIdle(EnSkj* this, PlayState* play) { if (this->actor.params == 0) { - if (!(gSaveContext.itemGetInf[1] & 0x40) && (this->actor.xzDistToPlayer < 200.0f)) { + if (!Flags_GetItemGetInf(ITEMGETINF_16) && (this->actor.xzDistToPlayer < 200.0f)) { this->backflipFlag = 1; EnSkj_Backflip(this); } else if (sSmallStumpSkullKid.unk_0 != 0) { @@ -918,7 +918,7 @@ void EnSkj_WaitInRange(EnSkj* this, PlayState* play) { player->actor.world.pos.x = sSmallStumpSkullKid.skullkid->actor.world.pos.x; player->actor.world.pos.y = sSmallStumpSkullKid.skullkid->actor.world.pos.y; player->actor.world.pos.z = sSmallStumpSkullKid.skullkid->actor.world.pos.z; - if ((Player_GetMask(play) == PLAYER_MASK_SKULL) && !(gSaveContext.itemGetInf[3] & 0x200)) { + if ((Player_GetMask(play) == PLAYER_MASK_SKULL) && !Flags_GetItemGetInf(ITEMGETINF_39)) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); EnSkj_SetupMaskTrade(this); } else { @@ -928,8 +928,8 @@ void EnSkj_WaitInRange(EnSkj* this, PlayState* play) { EnSkj_SetupResetFight(this); } else { player->stateFlags2 |= 0x800000; - if (gSaveContext.itemGetInf[1] & 0x40) { - if (gSaveContext.itemGetInf[3] & 0x200) { + if (Flags_GetItemGetInf(ITEMGETINF_16)) { + if (Flags_GetItemGetInf(ITEMGETINF_39)) { this->textId = Text_GetFaceReaction(play, 0x15); if (this->textId == 0) { this->textId = 0x1020; @@ -955,7 +955,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { Player* player = GET_PLAYER(play); // Played a song thats not Saria's song - if (!(gSaveContext.itemGetInf[1] & 0x40) && ((play->msgCtx.msgMode == MSGMODE_OCARINA_FAIL) || + if (!Flags_GetItemGetInf(ITEMGETINF_16) && ((play->msgCtx.msgMode == MSGMODE_OCARINA_FAIL) || (play->msgCtx.msgMode == MSGMODE_OCARINA_FAIL_NO_TEXT))) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; Message_CloseTextbox(play); @@ -976,7 +976,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { EnSkj_ChangeAnim(this, SKJ_ANIM_WAIT); EnSkj_SetupAction(this, SKJ_ACTION_SARIA_SONG_WAIT_IN_RANGE); } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - if (!(gSaveContext.itemGetInf[1] & 0x40)) { + if (!Flags_GetItemGetInf(ITEMGETINF_16)) { // Saria's song has been played for the first titme play->msgCtx.ocarinaMode = OCARINA_MODE_04; func_80078884(NA_SE_SY_CORRECT_CHIME); @@ -995,7 +995,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { } else { if (play->msgCtx.ocarinaMode >= OCARINA_MODE_05) { gSaveContext.sunsSongState = 0; - if (gSaveContext.itemGetInf[1] & 0x40) { + if (Flags_GetItemGetInf(ITEMGETINF_16)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; player->unk_6A8 = &this->actor; func_8002F2CC(&this->actor, play, EnSkj_GetItemXzRange(this)); @@ -1034,7 +1034,7 @@ void EnSkj_SariaSongTalk(EnSkj* this, PlayState* play) { s32 pad; if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (gSaveContext.itemGetInf[1] & 0x40) { + if (Flags_GetItemGetInf(ITEMGETINF_16)) { EnSkj_SetupWaitInRange(this); } else { func_80AFFE24(this); @@ -1072,7 +1072,7 @@ void EnSkj_SetupPostSariasSong(EnSkj* this) { void EnSkj_ChangeModeAfterSong(EnSkj* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - gSaveContext.itemGetInf[1] |= 0x40; + Flags_SetItemGetInf(ITEMGETINF_16); EnSkj_SetNaviId(this); EnSkj_SetupWaitInRange(this); } @@ -1168,7 +1168,7 @@ void EnSkj_SetupTakeMask(EnSkj* this, PlayState* play) { void EnSkj_TakeMask(EnSkj* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { Rupees_ChangeBy(10); - gSaveContext.itemGetInf[3] |= 0x200; + Flags_SetItemGetInf(ITEMGETINF_39); EnSkj_SetNaviId(this); Player_UnsetMask(play); Item_Give(play, ITEM_SOLD_OUT); @@ -1577,7 +1577,7 @@ void EnSkj_FinishOcarinaGameRound(EnSkj* this, PlayState* play) { } if (ocarinaGameRoundNum == 2 || gSaveContext.n64ddFlag) { - gSaveContext.itemGetInf[1] |= 0x80; + Flags_SetItemGetInf(ITEMGETINF_17); this->actionFunc = EnSkj_CleanupOcarinaGame; } else { EnSkj_OfferNextRound(this, play); @@ -1630,7 +1630,7 @@ s32 EnSkj_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void EnSkj_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { OPEN_DISPS(play->state.gfxCtx); - if ((limbIndex == 11) && (gSaveContext.itemGetInf[3] & 0x200)) { + if ((limbIndex == 11) && (Flags_GetItemGetInf(ITEMGETINF_39))) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Push(); Matrix_RotateZYX(-0x4000, 0, 0, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index cf6cf0187..98910ffef 100644 --- a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -667,13 +667,13 @@ void EnSsh_Idle(EnSsh* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, play)) { this->actionFunc = EnSsh_Talk; if (this->actor.params == ENSSH_FATHER) { - gSaveContext.eventChkInf[9] |= 0x40; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE); } if ((this->actor.textId == 0x26) || (this->actor.textId == 0x27)) { - gSaveContext.infTable[25] |= 0x40; + Flags_SetInfTable(INFTABLE_196); } if ((this->actor.textId == 0x24) || (this->actor.textId == 0x25)) { - gSaveContext.infTable[25] |= 0x80; + Flags_SetInfTable(INFTABLE_197); } } else { if ((this->unkTimer != 0) && (DECR(this->unkTimer) == 0)) { @@ -698,13 +698,13 @@ void EnSsh_Idle(EnSsh* this, PlayState* play) { if (gSaveContext.inventory.gsTokens >= 50) { this->actor.textId = 0x29; } else if (gSaveContext.inventory.gsTokens >= 10) { - if (gSaveContext.infTable[25] & 0x80) { + if (Flags_GetInfTable(INFTABLE_197)) { this->actor.textId = 0x24; } else { this->actor.textId = 0x25; } } else { - if (gSaveContext.infTable[25] & 0x40) { + if (Flags_GetInfTable(INFTABLE_196)) { this->actor.textId = 0x27; } else { this->actor.textId = 0x26; diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 379af78b3..6371a8983 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -80,7 +80,7 @@ static EnSthActionFunc sRewardObtainedWaitActions[6] = { }; static u16 sEventFlags[6] = { - 0x0000, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, + 0, EVENTCHKINF_SKULLTULA_REWARD_10_MASK, EVENTCHKINF_SKULLTULA_REWARD_20_MASK, EVENTCHKINF_SKULLTULA_REWARD_30_MASK, EVENTCHKINF_SKULLTULA_REWARD_40_MASK, EVENTCHKINF_SKULLTULA_REWARD_50_MASK, }; static s16 sGetItemIds[6] = { @@ -162,7 +162,7 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) { this->eventFlag = sEventFlags[this->actor.params]; params = &this->actor.params; - if (gSaveContext.eventChkInf[13] & this->eventFlag) { + if (gSaveContext.eventChkInf[EVENTCHKINF_SKULLTULA_REWARD_INDEX] & this->eventFlag) { EnSth_SetupAction(this, sRewardObtainedWaitActions[*params]); } else { EnSth_SetupAction(this, EnSth_RewardUnobtainedWait); @@ -296,7 +296,7 @@ void EnSth_GiveReward(EnSth* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; EnSth_SetupAction(this, EnSth_RewardObtainedTalk); - gSaveContext.eventChkInf[13] |= this->eventFlag; + gSaveContext.eventChkInf[EVENTCHKINF_SKULLTULA_REWARD_INDEX] |= this->eventFlag; } else { EnSth_GivePlayerItem(this, play); } diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 3cc614b79..ad13bca27 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -358,7 +358,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50); this->getItemId = this->getItemEntry.getItemId; Flags_SetTreasure(play, 0x1E); - } else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x2000)) { + } else if (!gSaveContext.n64ddFlag && !Flags_GetItemGetInf(ITEMGETINF_0D)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Pachinko ☆☆☆☆☆ %d\n" VT_RST, CUR_UPG_VALUE(UPG_BULLET_BAG)); if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) { @@ -375,7 +375,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50); this->getItemId = this->getItemEntry.getItemId; Flags_SetTreasure(play, 0x1F); - } else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x4000)) { + } else if (!gSaveContext.n64ddFlag && !Flags_GetItemGetInf(ITEMGETINF_0E)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Bow ☆☆☆☆☆ %d\n" VT_RST, CUR_UPG_VALUE(UPG_QUIVER)); switch (CUR_UPG_VALUE(UPG_QUIVER)) { @@ -445,9 +445,9 @@ void EnSyatekiMan_FinishPrize(EnSyatekiMan* this, PlayState* play) { // "Successful completion" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); if (!LINK_IS_ADULT) { - gSaveContext.itemGetInf[0] |= 0x2000; + Flags_SetItemGetInf(ITEMGETINF_0D); } else if ((this->getItemId == GI_QUIVER_40) || (this->getItemId == GI_QUIVER_50)) { - gSaveContext.itemGetInf[0] |= 0x4000; + Flags_SetItemGetInf(ITEMGETINF_0E); } this->gameResult = SYATEKI_RESULT_NONE; this->actor.parent = this->tempGallery; diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index bb3342cd8..c7432b2d0 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -74,7 +74,7 @@ void func_80B13AAC(EnTa* this, PlayState* play) { if (gSaveContext.eventInf[0] & 0x400) { if (gSaveContext.eventInf[0] & 0x100) { - if (gSaveContext.itemGetInf[0] & 4) { + if (Flags_GetItemGetInf(ITEMGETINF_TALON_BOTTLE)) { this->actor.textId = 0x2088; } else { this->actor.textId = 0x2086; @@ -84,8 +84,8 @@ void func_80B13AAC(EnTa* this, PlayState* play) { } gSaveContext.eventInf[0] &= ~0x100; } else if (faceReaction == 0) { - if (gSaveContext.infTable[7] & 0x4000) { - if (gSaveContext.itemGetInf[0] & 4) { + if (Flags_GetInfTable(INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE)) { + if (Flags_GetItemGetInf(ITEMGETINF_TALON_BOTTLE)) { this->actor.textId = 0x208B; } else { this->actor.textId = 0x207F; @@ -123,11 +123,11 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { switch (this->actor.params) { case 1: osSyncPrintf(VT_FGCOL(CYAN) " 追放タロン \n" VT_RST); - if (gSaveContext.eventChkInf[6] & 0x800) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO)) { Actor_Kill(&this->actor); } else if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); - } else if (gSaveContext.eventChkInf[6] & 0x400) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO)) { func_80B13AA0(this, func_80B14CAC, func_80B167C0); this->eyeIndex = 0; Animation_PlayOnce(&this->skelAnime, &gTalonStandAnim); @@ -142,7 +142,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { break; case 2: osSyncPrintf(VT_FGCOL(CYAN) " 出戻りタロン \n" VT_RST); - if (!(gSaveContext.eventChkInf[6] & 0x800)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO)) { Actor_Kill(&this->actor); } else if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); @@ -159,9 +159,9 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { default: osSyncPrintf(VT_FGCOL(CYAN) " その他のタロン \n" VT_RST); if (play->sceneNum == SCENE_SPOT15) { - if (gSaveContext.eventChkInf[1] & 0x10) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); - } else if (gSaveContext.eventChkInf[1] & 0x8) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_CASTLE)) { func_80B13AA0(this, func_80B14C18, func_80B167C0); this->eyeIndex = 0; Animation_PlayOnce(&this->skelAnime, &gTalonStandAnim); @@ -175,7 +175,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { } } else if (play->sceneNum == SCENE_SOUKO) { osSyncPrintf(VT_FGCOL(CYAN) " ロンロン牧場の倉庫 の タロン\n" VT_RST); - if (!(gSaveContext.eventChkInf[1] & 0x10)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); } else if (LINK_IS_ADULT) { Actor_Kill(&this->actor); @@ -277,10 +277,10 @@ void func_80B143D4(EnTa* this, PlayState* play) { void func_80B14410(EnTa* this) { if (!LINK_IS_ADULT) { func_80B13AA0(this, func_80B14C18, func_80B167C0); - gSaveContext.eventChkInf[1] |= 0x8; + Flags_SetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_CASTLE); } else { func_80B13AA0(this, func_80B14CAC, func_80B167C0); - gSaveContext.eventChkInf[6] |= 0x400; + Flags_SetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO); } } @@ -465,7 +465,7 @@ void func_80B14B6C(EnTa* this, PlayState* play) { s16 csCamIdx = OnePointCutscene_Init(play, 4175, -99, &this->actor, MAIN_CAM); func_80B13AA0(this, func_80B14AF4, func_80B167C0); this->unk_2CC = 5; - gSaveContext.eventChkInf[1] |= 0x10; + Flags_SetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE); if (gSaveContext.n64ddFlag) { OnePointCutscene_EndCutscene(play, csCamIdx); } @@ -490,10 +490,10 @@ void func_80B14C60(EnTa* this, PlayState* play) { } void func_80B14CAC(EnTa* this, PlayState* play) { - if (gSaveContext.eventChkInf[1] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { if (func_80B142F4(this, play, 0x5017)) { func_80B13AA0(this, func_80B14C60, func_80B167C0); - gSaveContext.eventChkInf[6] |= 0x800; + Flags_SetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO); } } else if (func_80B142F4(this, play, 0x5016)) { func_80B13AA0(this, func_80B14C60, func_80B167C0); @@ -872,7 +872,7 @@ void func_80B15E80(EnTa* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80B15E28; if (!(this->unk_2E0 & 0x2)) { - gSaveContext.itemGetInf[0] |= 4; + Flags_SetItemGetInf(ITEMGETINF_TALON_BOTTLE); } this->unk_2E0 &= ~0x2; } else if (this->unk_2E0 & 2) { @@ -992,8 +992,8 @@ void func_80B162E8(EnTa* this, PlayState* play) { void func_80B16364(EnTa* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { - gSaveContext.infTable[7] |= 0x4000; - if (gSaveContext.itemGetInf[0] & 4) { + Flags_SetInfTable(INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE); + if (Flags_GetItemGetInf(ITEMGETINF_TALON_BOTTLE)) { Message_ContinueTextbox(play, 0x208B); func_80B13AA0(this, func_80B15FE8, func_80B16938); } else { @@ -1032,7 +1032,7 @@ void func_80B16504(EnTa* this, PlayState* play) { if (faceReaction != 0) { func_80B14FAC(this, func_80B15E28); } else { - gSaveContext.infTable[7] |= 0x4000; + Flags_SetInfTable(INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE); switch (this->actor.textId) { case 0x207E: diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 20a8dfc61..b63371441 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -345,7 +345,7 @@ u16 func_80B1C54C(PlayState* play, Actor* thisx) { return ret; } - if (gSaveContext.infTable[13] & 0x0200) { + if (Flags_GetInfTable(INFTABLE_D9)) { /* "Do you want me to dig here? ..." */ return 0x5019; } else { @@ -364,7 +364,7 @@ s16 func_80B1C5A0(PlayState* play, Actor* thisx) { case TEXT_STATE_CLOSING: /* "I am the boss of the carpenters ..." (wtf?) */ if (thisx->textId == 0x5028) { - gSaveContext.infTable[13] |= 0x0100; + Flags_SetInfTable(INFTABLE_D8); } ret = NPC_TALK_STATE_IDLE; break; @@ -381,11 +381,11 @@ s16 func_80B1C5A0(PlayState* play, Actor* thisx) { } else { play->msgCtx.msgMode = MSGMODE_PAUSED; Rupees_ChangeBy(-10); - gSaveContext.infTable[13] |= 0x0200; + Flags_SetInfTable(INFTABLE_D9); return NPC_TALK_STATE_ACTION; } Message_ContinueTextbox(play, thisx->textId); - gSaveContext.infTable[13] |= 0x0200; + Flags_SetInfTable(INFTABLE_D9); } break; case TEXT_STATE_EVENT: @@ -632,8 +632,8 @@ void EnTk_Dig(EnTk* this, PlayState* play) { * Upgrade the purple rupee reward to the heart piece if this * is the first grand prize dig. */ - if (!(gSaveContext.itemGetInf[1] & 0x1000) && !(gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0))) { - gSaveContext.itemGetInf[1] |= 0x1000; + if (!Flags_GetItemGetInf(ITEMGETINF_1C) && !(gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0))) { + Flags_SetItemGetInf(ITEMGETINF_1C); this->currentReward = 4; } else if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { this->currentReward = 4; diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 289a4394a..1b266f9eb 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -175,7 +175,7 @@ s32 func_80B203D8(EnToryo* this, PlayState* play) { case 0x5028: ret = 1; if (Message_ShouldAdvance(play)) { - gSaveContext.infTable[23] |= 4; + Flags_SetInfTable(INFTABLE_172); ret = 0; } break; @@ -188,14 +188,14 @@ s32 func_80B203D8(EnToryo* this, PlayState* play) { case 0x606F: ret = 1; if (Message_ShouldAdvance(play)) { - gSaveContext.infTable[23] |= 2; + Flags_SetInfTable(INFTABLE_171); ret = 0; } break; case 0x606A: ret = 1; if (Message_ShouldAdvance(play)) { - gSaveContext.infTable[23] |= 1; + Flags_SetInfTable(INFTABLE_170); ret = 0; } break; @@ -244,7 +244,7 @@ u32 func_80B20634(EnToryo* this, PlayState* play) { if (this->unk_1E0 != 0) { if (this->unk_1E0 == 10) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); - if (gSaveContext.infTable[23] & 2) { + if (Flags_GetInfTable(INFTABLE_171)) { ret = 0x606E; } else { ret = 0x606D; @@ -263,15 +263,15 @@ s32 func_80B206A0(EnToryo* this, PlayState* play) { if (textId == 0) { if ((this->stateFlags & 1)) { - if ((gSaveContext.eventChkInf[9] & 0xF) == 0xF) { + if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { ret = 0x606C; - } else if ((gSaveContext.infTable[23] & 1)) { + } else if ((Flags_GetInfTable(INFTABLE_170))) { ret = 0x606B; } else { ret = 0x606A; } } else if ((this->stateFlags & 2)) { - if ((gSaveContext.infTable[23] & 4)) { + if ((Flags_GetInfTable(INFTABLE_172))) { ret = 0x5029; } else { ret = 0x5028; diff --git a/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 0048ea502..f8b1cfd10 100644 --- a/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -67,7 +67,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { osSyncPrintf("\n\n"); // "☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n" VT_RST); - if (Flags_GetEventChkInf(0x18)) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyLonLonRanch); @@ -77,7 +77,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { // "☆☆☆☆☆ Yukigafuru You won't come (._.) ☆☆☆☆☆" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ゆきがふるー あなたはこないー (._.) ☆☆☆☆☆ \n" VT_RST); - if (gSaveContext.eventChkInf[4] & 0x400) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) { Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudySnow); @@ -87,7 +87,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { // "☆☆☆☆☆ Wow wa wa na wa saa ki ha (^o^) ☆☆☆☆☆" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n" VT_RST); - if (gSaveContext.eventChkInf[4] & 0x400) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) { Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledRainLakeHylia); @@ -96,7 +96,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { osSyncPrintf("\n\n"); // "☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n" VT_RST); - if (gSaveContext.eventChkInf[4] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) { Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyDeathMountain); @@ -106,8 +106,8 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { // "☆☆☆☆☆ Cloudy Rain Thunder (;O;) Uo Melancholy ☆☆☆☆☆" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり雨雷 (;O;) うおお 憂鬱 ☆☆☆☆☆ \n" VT_RST); - if (!(gSaveContext.eventChkInf[4] & 0x100) || !(gSaveContext.eventChkInf[4] & 0x200) || - !(gSaveContext.eventChkInf[4] & 0x400) || CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP) || !Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP) || + !Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP) || CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) { Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyRainThunderKakariko); diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index f5c8c899e..1355481c1 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -106,7 +106,7 @@ void func_80B391CC(EnWonderTalk* this, PlayState* play) { // "Attention coordinates" osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 0.0f); this->unk_15C = 120.0f; - if (gSaveContext.eventChkInf[1] & 0x2000) { + if (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { Actor_Kill(&this->actor); } break; @@ -134,7 +134,7 @@ void func_80B3943C(EnWonderTalk* this, PlayState* play) { s16 yawDiffTemp; this->unk_15A++; - if (this->unk_150 == 4 && (gSaveContext.eventChkInf[1] & 0x2000)) { + if (this->unk_150 == 4 && (Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB))) { Actor_Kill(&this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 0ff5957e9..649be0a5d 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -282,7 +282,7 @@ void func_80B3C9EC(EnXc* this) { void func_80B3CA38(EnXc* this, PlayState* play) { // If Player is adult but hasn't learned Minuet of Forest - if (!(gSaveContext.eventChkInf[5] & 1) && LINK_IS_ADULT) { + if (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_MINUET_OF_FOREST) && LINK_IS_ADULT) { this->action = SHEIK_ACTION_INIT; } else { Actor_Kill(&this->actor); @@ -317,7 +317,7 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { if (!gSaveContext.n64ddFlag) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs); gSaveContext.cutsceneTrigger = 1; - gSaveContext.eventChkInf[5] |= 1; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_MINUET_OF_FOREST); Item_Give(play, ITEM_SONG_MINUET); } else { GivePlayerRandoRewardSheikSong(this, play, RC_SHEIK_IN_FOREST, 1, RG_MINUET_OF_FOREST); @@ -333,7 +333,7 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { void func_80B3CB58(EnXc* this, PlayState* play) { // If hasn't learned Bolero and Player is Adult - if (!(gSaveContext.eventChkInf[5] & 2) && LINK_IS_ADULT) { + if (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_BOLERO_OF_FIRE) && LINK_IS_ADULT) { this->action = SHEIK_ACTION_INIT; } else { Actor_Kill(&this->actor); @@ -353,7 +353,7 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { if (!gSaveContext.n64ddFlag) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gDeathMountainCraterBoleroCs); gSaveContext.cutsceneTrigger = 1; - gSaveContext.eventChkInf[5] |= 2; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_BOLERO_OF_FIRE); Item_Give(play, ITEM_SONG_BOLERO); } else { GivePlayerRandoRewardSheikSong(this, play, RC_SHEIK_IN_CRATER, 2, RG_BOLERO_OF_FIRE); @@ -373,7 +373,7 @@ void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { } // Player is adult and does not have iron boots and has not learned Serenade - if ((!CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4)) && LINK_IS_ADULT) { + if ((!CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER)) && LINK_IS_ADULT) { this->action = SHEIK_ACTION_SERENADE; osSyncPrintf("水のセレナーデ シーク誕生!!!!!!!!!!!!!!!!!!\n"); } else { @@ -389,12 +389,12 @@ s32 EnXc_SerenadeCS(EnXc* this, PlayState* play) { if (((CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !gSaveContext.n64ddFlag) || (Flags_GetTreasure(play, 2) && gSaveContext.n64ddFlag)) && - !(gSaveContext.eventChkInf[5] & 4) && !(stateFlags & 0x20000000) && + !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER) && !(stateFlags & 0x20000000) && !Play_InCsMode(play)) { if (!gSaveContext.n64ddFlag) { Cutscene_SetSegment(play, &gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; - gSaveContext.eventChkInf[5] |= 4; // Learned Serenade of Water Flag + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER); // Learned Serenade of Water Flag Item_Give(play, ITEM_SONG_SERENADE); } else { GivePlayerRandoRewardSheikSong(this, play, RC_SHEIK_IN_ICE_CAVERN, 4, RG_SERENADE_OF_WATER); @@ -2192,17 +2192,17 @@ void EnXc_DrawSquintingEyes(Actor* thisx, PlayState* play) { void EnXc_InitTempleOfTime(EnXc* this, PlayState* play) { if (LINK_IS_ADULT) { - if (!(gSaveContext.eventChkInf[12] & 0x20)) { - gSaveContext.eventChkInf[12] |= 0x20; + if (!Flags_GetEventChkInf(EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL)) { + Flags_SetEventChkInf(EVENTCHKINF_SHEIK_SPAWNED_AT_MASTER_SWORD_PEDESTAL); play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimeFirstAdultCs); gSaveContext.cutsceneTrigger = 1; func_80B3EBF0(this, play); - } else if ((!(gSaveContext.eventChkInf[5] & 0x20) && (gSaveContext.eventChkInf[4] & 0x100) && + } else if ((!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && !gSaveContext.n64ddFlag) || - (!(gSaveContext.eventChkInf[5] & 0x20) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && + (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && gSaveContext.n64ddFlag)) { if (!gSaveContext.n64ddFlag) { - gSaveContext.eventChkInf[5] |= 0x20; + Flags_SetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT); Item_Give(play, ITEM_SONG_PRELUDE); play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimePreludeCs); gSaveContext.cutsceneTrigger = 1; @@ -2210,7 +2210,7 @@ void EnXc_InitTempleOfTime(EnXc* this, PlayState* play) { } else { GivePlayerRandoRewardSheikSong(this, play, RC_SHEIK_AT_TEMPLE, 0x20, RG_PRELUDE_OF_LIGHT); } - } else if (!(gSaveContext.eventChkInf[5] & 0x20)) { + } else if (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT)) { func_80B3C9EC(this); } else { Actor_Kill(&this->actor); @@ -2349,7 +2349,7 @@ void EnXc_Update(Actor* thisx, PlayState* play) { if (this->actor.params == SHEIK_TYPE_9) { if (gSaveContext.n64ddFlag && LINK_IS_ADULT) { - if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && !(gSaveContext.eventChkInf[5] & 0x20)) { + if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT)) { GivePlayerRandoRewardSheikSong(this, play, RC_SHEIK_AT_TEMPLE, 0x20, RG_PRELUDE_OF_LIGHT); } } diff --git a/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index e5434ed58..f21c52359 100644 --- a/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -93,15 +93,15 @@ void EnZl1_Init(Actor* thisx, PlayState* play) { Animation_Change(&this->skelAnime, &gChildZelda1Anim_00438, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f); this->unk_1E6 = 0; this->actionFunc = func_80B4BC78; - } else if (Flags_GetEventChkInf(9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { Actor_Kill(&this->actor); - } else if ((Flags_GetEventChkInf(9) && Flags_GetEventChkInf(0x25)) || - (Flags_GetEventChkInf(9) && Flags_GetEventChkInf(0x37))) { + } else if ((Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) || + (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP) && Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP))) { frameCount = Animation_GetLastFrame(&gChildZelda1Anim_00438); Animation_Change(&this->skelAnime, &gChildZelda1Anim_00438, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f); this->actor.textId = 0x703D; this->actionFunc = func_80B4AF18; - } else if (Flags_GetEventChkInf(0x40)) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { frameCount = Animation_GetLastFrame(&gChildZelda1Anim_00438); Animation_Change(&this->skelAnime, &gChildZelda1Anim_00438, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f); this->actor.textId = 0x703C; @@ -532,7 +532,7 @@ void func_80B4BF2C(EnZl1* this, PlayState* play) { if ((Message_GetState(msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { this->actor.textId = 0x703C; Message_ContinueTextbox(play, this->actor.textId); - Flags_SetEventChkInf(0x40); + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER); this->unk_1E2 = 6; } break; diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index d43922a95..a58b09a4d 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -2580,7 +2580,7 @@ void func_80B59AD0(EnZl3* this, PlayState* play) { func_80088AA0(180); func_80B54EA4(this, play); func_80B53614(this, play); - gSaveContext.eventChkInf[12] &= ~0x80; + Flags_UnsetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO); func_80B56F10(this, play); gSaveContext.healthAccumulator = 320; Magic_Fill(play); diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 558069664..405d96407 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -237,7 +237,7 @@ void GivePlayerRandoRewardZeldaChild(EnZl4* zelda, PlayState* play, RandomizerCh GiveItemEntryFromActor(&zelda->actor, play, getItemEntry, 10000.0f, 100.0f); } else if (Flags_GetTreasure(play, 0x1E) && !Player_InBlockingCsMode(play, GET_PLAYER(play))) { gSaveContext.unk_13EE = 0x32; - gSaveContext.eventChkInf[4] |= 1; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER); } } @@ -398,7 +398,7 @@ void EnZl4_Init(Actor* thisx, PlayState* play) { if (gSaveContext.sceneSetupIndex >= 4) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0); this->actionFunc = EnZl4_TheEnd; - } else if (gSaveContext.eventChkInf[4] & 1) { + } else if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0); this->actionFunc = EnZl4_Idle; } else { @@ -1208,7 +1208,7 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play) { if (EnZl4_CsMakePlan(this, play)) { func_8002DF54(play, &this->actor, 7); gSaveContext.unk_13EE = 0x32; - gSaveContext.eventChkInf[4] |= 1; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER); this->actionFunc = EnZl4_Idle; } break; diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c index f5177ff6e..561ebf81b 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -371,7 +371,7 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { switch (thisx->params & 0x3F) { case 8: - if (gSaveContext.eventChkInf[3] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { return 0x402A; } break; @@ -386,7 +386,7 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { return 0x402D; } - if (gSaveContext.eventChkInf[3] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { return 0x4007; } break; @@ -396,8 +396,8 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { return 0x402E; } - if (gSaveContext.eventChkInf[3] & 1) { - return (gSaveContext.infTable[18] & 0x10) ? 0x4009 : 0x4008; + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { + return (Flags_GetInfTable(INFTABLE_124)) ? 0x4009 : 0x4008; } break; @@ -405,10 +405,10 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { return 0x402D; } - if (gSaveContext.eventChkInf[3] & 2) { - return (gSaveContext.infTable[18] & 0x200) ? 0x400B : 0x402F; + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER)) { + return (Flags_GetInfTable(INFTABLE_129)) ? 0x400B : 0x402F; } - if (gSaveContext.eventChkInf[3] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { return 0x400A; } break; @@ -417,7 +417,7 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { return 0x402E; } - if (gSaveContext.eventChkInf[3] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { return 0x400C; } break; @@ -427,10 +427,10 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { return 0x402D; } - if (gSaveContext.eventChkInf[3] & 8) { + if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { return 0x4010; } - if (gSaveContext.eventChkInf[3] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { return 0x400F; } break; @@ -439,7 +439,7 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { return 0x402E; } - if (gSaveContext.eventChkInf[3] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA)) { return 0x4011; } break; @@ -464,13 +464,13 @@ s16 func_80B61298(PlayState* play, Actor* thisx) { case 0x4021: return NPC_TALK_STATE_IDLE; case 0x4008: - gSaveContext.infTable[18] |= 0x10; + Flags_SetInfTable(INFTABLE_124); break; case 0x402F: - gSaveContext.infTable[18] |= 0x200; + Flags_SetInfTable(INFTABLE_129); break; } - gSaveContext.eventChkInf[3] |= 1; + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_A_ZORA); return NPC_TALK_STATE_IDLE; case TEXT_STATE_CHOICE: diff --git a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index dc498f627..9212362d6 100644 --- a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -130,13 +130,13 @@ void EnfHG_Intro(EnfHG* this, PlayState* play) { if ((fabsf(player->actor.world.pos.x - (GND_BOSSROOM_CENTER_X + 0.0f)) < 100.0f) && (fabsf(player->actor.world.pos.z - (GND_BOSSROOM_CENTER_Z + 315.0f)) < 100.0f)) { this->cutsceneState = INTRO_START; - if (gSaveContext.eventChkInf[7] & 4) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_PHANTOM_GANON_BATTLE)) { this->timers[0] = 57; } } break; case INTRO_START: - if (gSaveContext.eventChkInf[7] & 4) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_PHANTOM_GANON_BATTLE)) { if (this->timers[0] == 55) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_SHUTTER, GND_BOSSROOM_CENTER_X + 0.0f, GND_BOSSROOM_CENTER_Y - 97.0f, @@ -161,7 +161,7 @@ void EnfHG_Intro(EnfHG* this, PlayState* play) { this->timers[0] = 60; this->actor.world.pos.y = GND_BOSSROOM_CENTER_Y - 7.0f; Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); - gSaveContext.eventChkInf[7] |= 4; + Flags_SetEventChkInf(EVENTCHKINF_BEGAN_PHANTOM_GANON_BATTLE); Flags_SetSwitch(play, 0x23); case INTRO_FENCE: player->actor.world.pos.x = GND_BOSSROOM_CENTER_X + 0.0f; diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 78c40124b..06836b310 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -83,7 +83,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { case ITEM_ETC_LETTER: Actor_SetScale(&this->actor, 0.5f); this->futureActionFunc = func_80B858B4; - if ((gSaveContext.eventChkInf[3] & 2 && !gSaveContext.n64ddFlag) || + if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER) && !gSaveContext.n64ddFlag) || (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1E))) { Actor_Kill(&this->actor); } @@ -128,7 +128,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { } if ((this->actor.params & 0xFF) == 1) { - gSaveContext.eventChkInf[3] |= 2; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER); Flags_SetSwitch(play, 0xB); } Actor_Kill(&this->actor); @@ -145,7 +145,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { void func_80B858B4(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { if ((this->actor.params & 0xFF) == 1) { - gSaveContext.eventChkInf[3] |= 2; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER); Flags_SetSwitch(play, 0xB); if (gSaveContext.n64ddFlag) { diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index bedc62a56..3e4694423 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -58,7 +58,7 @@ void ItemOcarina_Init(Actor* thisx, PlayState* play) { break; case 3: ItemOcarina_SetupAction(this, ItemOcarina_WaitInWater); - if (!(gSaveContext.eventChkInf[8] & 1) || (gSaveContext.eventChkInf[4] & 8)) { + if (!Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) || (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_OCARINA_OF_TIME))) { Actor_Kill(thisx); return; } @@ -184,7 +184,7 @@ void ItemOcarina_StartSoTCutscene(ItemOcarina* this, PlayState* play) { void ItemOcarina_WaitInWater(ItemOcarina* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - gSaveContext.eventChkInf[4] |= 8; + Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_OCARINA_OF_TIME); Flags_SetSwitch(play, 3); this->actionFunc = ItemOcarina_StartSoTCutscene; this->actor.draw = NULL; diff --git a/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 4a87c2628..28fe96439 100644 --- a/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -87,7 +87,7 @@ void ObjHana_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); } - if (type == 2 && (gSaveContext.eventChkInf[4] & 1)) { + if (type == 2 && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER))) { Actor_Kill(&this->actor); } } diff --git a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 4ad706b79..15c3be23f 100644 --- a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -116,22 +116,22 @@ void ObjectKankyo_Init(Actor* thisx, PlayState* play) { } // Check which beams are disabled - if (Flags_GetEventChkInf(0xBB)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FOREST_TRIAL)) { this->effects[0].size = 0.0f; } - if (Flags_GetEventChkInf(0xBC)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_WATER_TRIAL)) { this->effects[1].size = 0.0f; } - if (Flags_GetEventChkInf(0xBD)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SHADOW_TRIAL)) { this->effects[2].size = 0.0f; } - if (Flags_GetEventChkInf(0xBE)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FIRE_TRIAL)) { this->effects[3].size = 0.0f; } - if (Flags_GetEventChkInf(0xBF)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_LIGHT_TRIAL)) { this->effects[4].size = 0.0f; } - if (Flags_GetEventChkInf(0xAD)) { + if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SPIRIT_TRIAL)) { this->effects[5].size = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 0ede05482..ac70e56ff 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6279,24 +6279,33 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) { // and which flag is specified in player->pendingFlag.flagID. void Player_SetPendingFlag(Player* this, PlayState* play) { switch (this->pendingFlag.flagType) { - case FLAG_SCENE_CLEAR: - Flags_SetClear(play, this->pendingFlag.flagID); - break; - case FLAG_SCENE_COLLECTIBLE: - Flags_SetCollectible(play, this->pendingFlag.flagID); - break; case FLAG_SCENE_SWITCH: Flags_SetSwitch(play, this->pendingFlag.flagID); break; case FLAG_SCENE_TREASURE: Flags_SetTreasure(play, this->pendingFlag.flagID); break; - case FLAG_RANDOMIZER_INF: - Flags_SetRandomizerInf(this->pendingFlag.flagID); + case FLAG_SCENE_CLEAR: + Flags_SetClear(play, this->pendingFlag.flagID); + break; + case FLAG_SCENE_COLLECTIBLE: + Flags_SetCollectible(play, this->pendingFlag.flagID); break; case FLAG_EVENT_CHECK_INF: Flags_SetEventChkInf(this->pendingFlag.flagID); break; + case FLAG_ITEM_GET_INF: + Flags_SetItemGetInf(this->pendingFlag.flagID); + break; + case FLAG_INF_TABLE: + Flags_SetInfTable(this->pendingFlag.flagID); + break; + case FLAG_EVENT_INF: + Flags_SetEventInf(this->pendingFlag.flagID); + break; + case FLAG_RANDOMIZER_INF: + Flags_SetRandomizerInf(this->pendingFlag.flagID); + break; case FLAG_NONE: default: break; @@ -9715,8 +9724,8 @@ void Player_Init(Actor* thisx, PlayState* play2) { if ((gSaveContext.sceneSetupIndex < 4) && (gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].field & 0x4000) && - ((play->sceneNum != SCENE_DDAN) || (gSaveContext.eventChkInf[11] & 1)) && - ((play->sceneNum != SCENE_NIGHT_SHOP) || (gSaveContext.eventChkInf[2] & 0x20))) { + ((play->sceneNum != SCENE_DDAN) || (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN))) && + ((play->sceneNum != SCENE_NIGHT_SHOP) || (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)))) { TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, this->giObjectSegment, 160, 120, 144, 24, 20); } @@ -12389,7 +12398,7 @@ void func_8084D3E4(Player* this, PlayState* play) { this->actor.parent = NULL; AREG(6) = 0; - if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) { gSaveContext.horseData.pos.x = rideActor->actor.world.pos.x; gSaveContext.horseData.pos.y = rideActor->actor.world.pos.y; gSaveContext.horseData.pos.z = rideActor->actor.world.pos.z; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 2477d7d18..b37f9ef69 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -356,14 +356,14 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) { // only allow mask select when: // the shop is open: - // * zelda's letter check: gSaveContext.eventChkInf[4] & 1 - // * kak gate check: gSaveContext.infTable[7] & 0x40 - // and the mask quest is complete: gSaveContext.eventChkInf[8] & 0x8000 + // * zelda's letter check: Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) + // * kak gate check: Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD) + // and the mask quest is complete: Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE) if (CVarGetInteger("gMaskSelect", 0) && - (gSaveContext.eventChkInf[8] & 0x8000) && + (Flags_GetEventChkInf(EVENTCHKINF_PAID_BACK_BUNNY_HOOD_FEE)) && cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A) && - (gSaveContext.eventChkInf[4] & 1) && - (gSaveContext.infTable[7] & 0x40)) { + (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && + (Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD))) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSelectingMask = !gSelectingMask; } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index e8478e00a..c1f17f177 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -3404,7 +3404,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[1] = 1; } - if (gSaveContext.eventChkInf[11] & 4) { + if (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_GERUDO_VALLEY)) { pauseCtx->worldMapPoints[2] = 1; } @@ -3428,7 +3428,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[3] = 1; } - if (gSaveContext.eventChkInf[0] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { pauseCtx->worldMapPoints[4] = 1; } @@ -3440,19 +3440,19 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[4] = 1; } - if (gSaveContext.eventChkInf[6] & 0x400) { + if (Flags_GetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO)) { pauseCtx->worldMapPoints[4] = 2; } - if (gSaveContext.eventChkInf[1] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { pauseCtx->worldMapPoints[4] = 1; } - if (gSaveContext.eventChkInf[0] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { pauseCtx->worldMapPoints[5] = 2; } - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { pauseCtx->worldMapPoints[5] = 1; } @@ -3460,7 +3460,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[5] = 2; } - if (gSaveContext.eventChkInf[4] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) { pauseCtx->worldMapPoints[5] = 1; } @@ -3468,15 +3468,15 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[5] = 2; } - if (gSaveContext.eventChkInf[0] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { pauseCtx->worldMapPoints[6] = 1; } - if (gSaveContext.eventChkInf[4] & 1) { + if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) { pauseCtx->worldMapPoints[7] = 2; } - if (gSaveContext.eventChkInf[2] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { pauseCtx->worldMapPoints[7] = 1; } @@ -3484,7 +3484,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[7] = 2; } - if (gSaveContext.eventChkInf[4] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) { pauseCtx->worldMapPoints[7] = 1; } @@ -3500,7 +3500,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[8] = 1; } - if (gSaveContext.eventChkInf[4] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) { pauseCtx->worldMapPoints[8] = 2; } @@ -3512,11 +3512,11 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[8] = 2; } - if (gSaveContext.eventChkInf[6] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO)) { pauseCtx->worldMapPoints[8] = 1; } - if (gSaveContext.eventChkInf[10] & 0x400) { + if (Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) { pauseCtx->worldMapPoints[8] = 2; } @@ -3528,7 +3528,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[9] = 1; } - if (gSaveContext.eventChkInf[0] & 0x8000) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_ABOUT_SARIA)) { pauseCtx->worldMapPoints[9] = 2; } @@ -3540,21 +3540,21 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[9] = 2; } - if (gSaveContext.eventChkInf[4] & 0x100) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) { pauseCtx->worldMapPoints[9] = 1; } pauseCtx->worldMapPoints[10] = 2; - if (gSaveContext.eventChkInf[0] & 0x200) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP)) { pauseCtx->worldMapPoints[10] = 1; } - if (gSaveContext.eventChkInf[6] & 0x4000) { + if (Flags_GetEventChkInf(EVENTCHKINF_6E)) { pauseCtx->worldMapPoints[10] = 2; } - if (gSaveContext.eventChkInf[0] & 0x8000) { + if (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_ABOUT_SARIA)) { pauseCtx->worldMapPoints[10] = 1; } @@ -3562,11 +3562,11 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->worldMapPoints[11] = 1; } - if (gSaveContext.eventChkInf[2] & 0x20) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { pauseCtx->worldMapPoints[11] = 2; } - if (gSaveContext.eventChkInf[3] & 0x80) { + if (Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP)) { pauseCtx->worldMapPoints[11] = 1; }