diff --git a/mods/randomizer/CMakeLists.txt b/mods/randomizer/CMakeLists.txt index 3496312a59..300539ce2e 100644 --- a/mods/randomizer/CMakeLists.txt +++ b/mods/randomizer/CMakeLists.txt @@ -86,6 +86,7 @@ set(RANDOMIZER_SOURCES src/paths.cpp src/session.cpp src/hooks.cpp + src/item.cpp src/ui/config_store.cpp src/ui/rando_seed_generation.cpp src/ui/rando_config.cpp diff --git a/mods/randomizer/src/hooks.cpp b/mods/randomizer/src/hooks.cpp index f5197d59bd..7b2a906ca1 100644 --- a/mods/randomizer/src/hooks.cpp +++ b/mods/randomizer/src/hooks.cpp @@ -5,6 +5,7 @@ #include "flags.h" #include "stages.h" #include "tools.h" +#include "item.hpp" #include "item_ids.h" #include @@ -50,7 +51,13 @@ DEFINE_HOOK(&CheckFieldItemCreateHeap, dItemData_CheckFieldItemCreateHeap); DEFINE_HOOK(&dEvt_control_c::talkEnd, dEvt_control_c__talkEnd); DEFINE_HOOK(&dComIfG_play_c::getLayerNo_common_common, dComIfG_play_c__getLayerNo_common_common); +DEFINE_HOOK(&dComIfGs_onStageSwitch, onStageSwitch); +extern void getItemFunc(u8); +DEFINE_HOOK(&getItemFunc, dItem_getItemFunc); + +extern int checkItemGet(u8 i_itemNo, int i_default); +DEFINE_HOOK(&checkItemGet, dItem_checkItemGet); namespace randomizer::ui { dialogSelectModeState g_dialogSelectModeState = SelectReady; @@ -482,24 +489,16 @@ HookAction hookPreSaveInfoOnSwitch(ModContext*, void* args, void*, void*) { return HOOK_CONTINUE; } -// TODO: item service -/* HookAction hookPreExecItemGet(ModContext*, void* args, void*, void*) { - if (randomizer_IsActive()) { - const u8 item = mods::arg(args, 0); - item_funcs::exec_item_get(item); - dusk::mods::item_granted(item, mods::arg(args, 1), mods::arg(args, 2)); - return HOOK_SKIP_ORIGINAL; - } - return HOOK_CONTINUE; -} */ +HookAction hookPreGetItemFunc(ModContext*, void* args, void*, void*) { + const u8 item = mods::arg(args, 0); + item::exec_item_get(item); + return HOOK_SKIP_ORIGINAL; +} -/* HookAction hookPreCheckItemGet(ModContext*, void* args, void* retval, void*) { - if (randomizer_IsActive()) { - *static_cast(retval) = item_funcs::check_item_get(mods::arg(args, 0), mods::arg(args, 1)); - return HOOK_SKIP_ORIGINAL; - } - return HOOK_CONTINUE; -} */ + HookAction hookPreCheckItemGet(ModContext*, void* args, void* retval, void*) { + *static_cast(retval) = item::check_item_get(mods::arg(args, 0), mods::arg(args, 1)); + return HOOK_SKIP_ORIGINAL; +} HookAction hookPreSetNextStage(ModContext*, void* args, void*, void*) { randomizer_checkAndOverrideEntranceData( @@ -1161,6 +1160,19 @@ HookAction hookPreGetLayerNo(ModContext*, void* args, void* retval, void*) { return HOOK_CONTINUE; } +HookAction hookPreOnStageSwitch(ModContext*, void* args, void* retval, void*) { + const int i_stageNo = mods::arg(args, 0); + const int i_no = mods::arg(args, 1); + + // Avoid trying to get the save table if stag info is NULL + if (dComIfGp_getStageStagInfo() == NULL) { + dComIfGs_onSaveSwitch(i_stageNo, i_no); + return HOOK_SKIP_ORIGINAL; + } + + return HOOK_CONTINUE; +} + } ModResult initialize() { @@ -1211,6 +1223,11 @@ ModResult initialize() { ADD_HOOK_PRE(dComIfG_play_c__getLayerNo_common_common, hookPreGetLayerNo); + ADD_HOOK_PRE(dItem_getItemFunc, hookPreGetItemFunc); + ADD_HOOK_PRE(dItem_checkItemGet, hookPreCheckItemGet); + + ADD_HOOK_PRE(onStageSwitch, hookPreOnStageSwitch); + return MOD_OK; } } \ No newline at end of file diff --git a/mods/randomizer/src/item.cpp b/mods/randomizer/src/item.cpp new file mode 100644 index 0000000000..4004b83378 --- /dev/null +++ b/mods/randomizer/src/item.cpp @@ -0,0 +1,1597 @@ +#include "item.hpp" + +#include "d/d_com_inf_game.h" +#include "d/d_item.h" +#include "d/d_item_data.h" + +#include "flags.h" +#include "item_ids.h" +#include "randomizer_context.hpp" +#include "stages.h" +#include "tools.h" +#include "verify_item_functions.h" + +static void item_func_FOOLISH_ITEM() { + // Failsafe: Make sure the count does not somehow exceed 100 + if (g_randomizerState.mFoolishItemCount < 100) + { + g_randomizerState.mFoolishItemCount += 1; + } +} + +static void item_func_ORDON_PORTAL() { + dComIfGs_onStageSwitch(0x0, 0x34); // Unlock Ordon Portal +} + +static void item_func_SOUTH_FARON_PORTAL() { + dComIfGs_onStageSwitch(0x2, 0x47); // Unlock S Faron Portal +} + +static void item_func_UPPER_ZORAS_RIVER_PORTAL() { + dComIfGs_onStageSwitch(0x4, 0x17); // Talked to Iza before portal + dComIfGs_onStageSwitch(0x4, 0x37); // Talked to Iza after portal + dComIfGs_onStageSwitch(0x4, 0x15); // Unlock UZR Portal + dComIfGs_onEventBit(0xB80); // Declined to help Iza + dComIfGs_onEventBit(0x1304); // Talked to Iza before UZR portal + dComIfGs_onEventBit(0xB02); // Iza 1 Minigame Unlocked +} + +static void item_func_CASTLE_TOWN_PORTAL() { + dComIfGs_onStageSwitch(0x6, 0x3); // Unlock Castle Town Portal +} + +static void item_func_GERUDO_DESERT_PORTAL() { + dComIfGs_onStageSwitch(0xA, 0x15); // Unlock Desert Portal +} + +static void item_func_NORTH_FARON_PORTAL() { + dComIfGs_onStageSwitch(0x2, 0x2); // Unlock N Faron Portal +} + +static void item_func_KAKARIKO_GORGE_PORTAL() { + dComIfGs_onStageSwitch(0x6, 0x15); // Unlock Gorge Portal +} + +static void item_func_KAKARIKO_VILLAGE_PORTAL() { + dComIfGs_onStageSwitch(0x3, 0x1F); // Unlock Kak Portal +} + +static void item_func_DEATH_MOUNTAIN_PORTAL() { + dComIfGs_onStageSwitch(0x3, 0x15); // Unlock DM Portal +} + +static void item_func_ZORAS_DOMAIN_PORTAL() { + dComIfGs_onStageSwitch(0x4, 0x2); // Unlock ZD Portal +} + +static void item_func_FOREST_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x10); + dComIfGs_setKeyNum(0x10, currentKeys + 1); +} + +static void item_func_MINES_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x11); + dComIfGs_setKeyNum(0x11, currentKeys + 1); +} + +static void item_func_LAKEBED_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x12); + dComIfGs_setKeyNum(0x12, currentKeys + 1); +} + +static void item_func_ARBITERS_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x13); + dComIfGs_setKeyNum(0x13, currentKeys + 1); +} + +static void item_func_SNOWPEAK_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x14); + dComIfGs_setKeyNum(0x14, currentKeys + 1); +} + +static void item_func_TEMPLE_OF_TIME_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x15); + dComIfGs_setKeyNum(0x15, currentKeys + 1); +} + +static void item_func_CITY_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x16); + dComIfGs_setKeyNum(0x16, currentKeys + 1); +} + +static void item_func_PALACE_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x17); + dComIfGs_setKeyNum(0x17, currentKeys + 1); +} + +static void item_func_HYRULE_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0x18); + dComIfGs_setKeyNum(0x18, currentKeys + 1); +} + +static void item_func_CAMP_SMALL_KEY() { + u8 currentKeys = getAreaKeyNum(0xA); + dComIfGs_setKeyNum(0xA, currentKeys + 1); +} + +static void item_func_LAKE_HYLIA_PORTAL() { + dComIfGs_onStageSwitch(0x4, 0xA); // Unlock Lake Portal +} + +static void item_func_FOREST_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x10); +} + +static void item_func_LAKEBED_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x12); +} + +static void item_func_ARBITERS_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x13); +} + +static void item_func_TEMPLE_OF_TIME_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x15); +} + +static void item_func_CITY_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x16); +} + +static void item_func_PALACE_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x17); +} + +static void item_func_HYRULE_BOSS_KEY() { + dComIfGs_onDungeonItemBossKey(0x18); +} + +static void item_func_FOREST_COMPASS() { + dComIfGs_onDungeonItemCompass(0x10); +} + +static void item_func_MINES_COMPASS() { + dComIfGs_onDungeonItemCompass(0x11); +} + +static void item_func_LAKEBED_COMPASS() { + dComIfGs_onDungeonItemCompass(0x12); +} + +static void item_func_ARBITERS_COMPASS() { + dComIfGs_onDungeonItemCompass(0x13); +} + +static void item_func_SNOWPEAK_COMPASS() { + dComIfGs_onDungeonItemCompass(0x14); +} + +static void item_func_TEMPLE_OF_TIME_COMPASS() { + dComIfGs_onDungeonItemCompass(0x15); +} + +static void item_func_CITY_COMPASS() { + dComIfGs_onDungeonItemCompass(0x16); +} + +static void item_func_PALACE_COMPASS() { + dComIfGs_onDungeonItemCompass(0x17); +} + +static void item_func_HYRULE_COMPASS() { + dComIfGs_onDungeonItemCompass(0x18); +} + +static void item_func_MIRROR_CHAMBER_PORTAL() { + dComIfGs_onStageSwitch(0xA, 0x28); // Unlock MC Portal +} + +static void item_func_SNOWPEAK_PORTAL() { + dComIfGs_onStageSwitch(0x8, 0x15); // Unlock Snowpeak Portal +} + +static void item_func_FOREST_MAP() { + dComIfGs_onDungeonItemMap(0x10); +} + +static void item_func_MINES_MAP() { + dComIfGs_onDungeonItemMap(0x11); +} + +static void item_func_LAKEBED_MAP() { + dComIfGs_onDungeonItemMap(0x12); +} + +static void item_func_ARBITERS_MAP() { + dComIfGs_onDungeonItemMap(0x13); +} + +static void item_func_SNOWPEAK_MAP() { + dComIfGs_onDungeonItemMap(0x14); +} + +static void item_func_TEMPLE_OF_TIME_MAP() { + dComIfGs_onDungeonItemMap(0x15); +} + +static void item_func_CITY_MAP() { + dComIfGs_onDungeonItemMap(0x16); +} + +static void item_func_PALACE_MAP() { + dComIfGs_onDungeonItemMap(0x17); +} + +static void item_func_HYRULE_MAP() { + dComIfGs_onDungeonItemMap(0x18); +} + +static void item_func_SACRED_GROVE_PORTAL() { + dComIfGs_onStageSwitch(0x7, 0x64); // Unlock Grove Portal +} + +static void item_func_FUSED_SHADOW_1() { + dComIfGs_onCollectCrystal(0); + /* + Adding rando code until framework is implemented + // Check if the requirement for the HC barrier is set to shadows, and if so, set the flag + rando::gRandomizer->checkSetHCBarrierFlag(rando::HC_Fused_Shadows, 1); + + // Check if the requirement for the HC BK is set to shadows, and if so, set the flag + rando::gRandomizer->checkSetHCBkFlag(rando::HC_BK_Fused_Shadows, 1); + */ +} + +static void item_func_FUSED_SHADOW_2() { + dComIfGs_onCollectCrystal(1); + /* + Adding rando code until framework is implemented + // Check if the requirement for the HC barrier is set to shadows, and if so, set the flag + rando::gRandomizer->checkSetHCBarrierFlag(rando::HC_Fused_Shadows, 2); + + // Check if the requirement for the HC BK is set to shadows, and if so, set the flag + rando::gRandomizer->checkSetHCBkFlag(rando::HC_BK_Fused_Shadows, 2); + */ +} + +static void item_func_FUSED_SHADOW_3() { + dComIfGs_onCollectCrystal(2); + /* + Adding rando code until framework is implemented + // If the player has the palace requirement set to Fused Shadows. + if (headerPtr->getPalaceRequirements() == rando::PalaceEntryRequirements::PoT_Fused_Shadows) + { + events::setSaveFileEventFlag(libtp::data::flags::FIXED_THE_MIRROR_OF_TWILIGHT); + } + + // Check if the requirement for the HC barrier is set to shadows, and if so, set the flag + rando::gRandomizer->checkSetHCBarrierFlag(rando::HC_Fused_Shadows, 3); + + // Check if the requirement for the HC BK is set to shadows, and if so, set the flag + rando::gRandomizer->checkSetHCBkFlag(rando::HC_BK_Fused_Shadows, 3); + */ +} + +static void item_func_MIRROR_PIECE_1() { + dComIfGs_onCollectMirror(0); +} + +static void item_func_ENDING_BLOW() { + dComIfGs_onEventBit(0x2904); +} + +static void item_func_SHIELD_ATTACK() { + dComIfGs_onEventBit(0x2908); +} + +static void item_func_BACK_SLICE() { + dComIfGs_onEventBit(0x2902); +} + +static void item_func_HELM_SPLITTER() { + dComIfGs_onEventBit(0x2901); +} + +static void item_func_MORTAL_DRAW() { + dComIfGs_onEventBit(0x2A80); +} + +static void item_func_JUMP_STRIKE() { + dComIfGs_onEventBit(0x2A40); +} + +static void item_func_GREAT_SPIN() { + dComIfGs_onEventBit(0x2A20); +} + +static void item_func_ELDIN_BRIDGE_PORTAL() { + dComIfGs_onStageSwitch(0x6, 0x63); // Unlock Eldin Bridge Portal +} + +static int item_getcheck_func_ORDON_PORTAL() { + return dComIfGs_isStageSwitch(0x0, 0x34); // Unlock Ordon Portal +} + +static int item_getcheck_func_SOUTH_FARON_PORTAL() { + return dComIfGs_isStageSwitch(0x2, 0x47); // Unlock S Faron Portal +} + +static int item_getcheck_func_UPPER_ZORAS_RIVER_PORTAL() { + return dComIfGs_isStageSwitch(0x4, 0x15); // Unlock UZR Portal +} + +static int item_getcheck_func_CASTLE_TOWN_PORTAL() { + return dComIfGs_isStageSwitch(0x6, 0x3); // Unlock Castle Town Portal +} + +static int item_getcheck_func_GERUDO_DESERT_PORTAL() { + return dComIfGs_isStageSwitch(0xA, 0x15); // Unlock Desert Portal +} + +static int item_getcheck_func_NORTH_FARON_PORTAL() { + return dComIfGs_isStageSwitch(0x2, 0x2); // Unlock N Faron Portal +} + +static int item_getcheck_func_KAKARIKO_GORGE_PORTAL() { + return dComIfGs_isStageSwitch(0x6, 0x15); // Unlock Gorge Portal +} + +static int item_getcheck_func_KAKARIKO_VILLAGE_PORTAL() { + return dComIfGs_isStageSwitch(0x3, 0x1F); // Unlock Kak Portal +} + +static int item_getcheck_func_DEATH_MOUNTAIN_PORTAL() { + return dComIfGs_isStageSwitch(0x3, 0x15); // Unlock DM Portal +} + +static int item_getcheck_func_ZORAS_DOMAIN_PORTAL() { + return dComIfGs_isStageSwitch(0x4, 0x2); // Unlock ZD Portal +} + +static int item_getcheck_func_CAMP_SMALL_KEY() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_CAMP_SMALL_KEY_e); +} + +static int item_getcheck_func_LAKE_HYLIA_PORTAL() { + return dComIfGs_isStageSwitch(0x4, 0xA); // Unlock Lake Portal +} + +static int item_getcheck_func_MIRROR_CHAMBER_PORTAL() { + return dComIfGs_isStageSwitch(0xA, 0x28); // Unlock MC Portal +} + +static int item_getcheck_func_SNOWPEAK_PORTAL() { + return dComIfGs_isStageSwitch(0x8, 0x15); // Unlock Snowpeak Portal +} + +static int item_getcheck_func_SACRED_GROVE_PORTAL() { + return dComIfGs_isStageSwitch(0x7, 0x64); // Unlock Grove Portal +} + +static int item_getcheck_func_FUSED_SHADOW_1() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_FUSED_SHADOW_1_e); +} + +static int item_getcheck_func_FUSED_SHADOW_2() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_FUSED_SHADOW_2_e); +} + +static int item_getcheck_func_FUSED_SHADOW_3() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_FUSED_SHADOW_3_e); +} + +static int item_getcheck_func_MIRROR_PIECE_1() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_MIRROR_PIECE_1_e); +} + +static int item_getcheck_func_ENDING_BLOW() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_ENDING_BLOW_e); +} + +static int item_getcheck_func_SHIELD_ATTACK() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_SHIELD_ATTACK_e); +} + +static int item_getcheck_func_BACK_SLICE() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_BACK_SLICE_e); +} + +static int item_getcheck_func_HELM_SPLITTER() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_HELM_SPLITTER_e); +} + +static int item_getcheck_func_MORTAL_DRAW() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_MORTAL_DRAW_e); +} + +static int item_getcheck_func_JUMP_STRIKE() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_JUMP_STRIKE_e); +} + +static int item_getcheck_func_GREAT_SPIN() { + return dComIfGs_isItemFirstBit(dItemNo_Randomizer_GREAT_SPIN_e); +} + +static int item_getcheck_func_ELDIN_BRIDGE_PORTAL() { + return dComIfGs_isStageSwitch(0x6, 0x63); // Unlock Eldin Bridge Portal +} + +static void (*item_func_ptr_randomizer[256])() = { + /* 0x00 */ item_func_HEART, + /* 0x01 */ item_func_GREEN_RUPEE, + /* 0x02 */ item_func_BLUE_RUPEE, + /* 0x03 */ item_func_YELLOW_RUPEE, + /* 0x04 */ item_func_RED_RUPEE, + /* 0x05 */ item_func_PURPLE_RUPEE, + /* 0x06 */ item_func_ORANGE_RUPEE, + /* 0x07 */ item_func_SILVER_RUPEE, + /* 0x08 */ item_func_S_MAGIC, + /* 0x09 */ item_func_L_MAGIC, + /* 0x0A */ item_func_BOMB_5, + /* 0x0B */ item_func_BOMB_10, + /* 0x0C */ item_func_BOMB_20, + /* 0x0D */ item_func_BOMB_30, + /* 0x0E */ item_func_ARROW_10, + /* 0x0F */ item_func_ARROW_20, + /* 0x10 */ item_func_ARROW_30, + /* 0x11 */ item_func_ARROW_1, + /* 0x12 */ item_func_PACHINKO_SHOT, + /* 0x13 */ item_func_FOOLISH_ITEM, + /* 0x14 */ item_func_ORDON_PORTAL, + /* 0x15 */ item_func_SOUTH_FARON_PORTAL, + /* 0x16 */ item_func_WATER_BOMB_5, + /* 0x17 */ item_func_WATER_BOMB_10, + /* 0x18 */ item_func_WATER_BOMB_20, + /* 0x19 */ item_func_WATER_BOMB_30, + /* 0x1A */ item_func_BOMB_INSECT_5, + /* 0x1B */ item_func_BOMB_INSECT_10, + /* 0x1C */ item_func_BOMB_INSECT_20, + /* 0x1D */ item_func_BOMB_INSECT_30, + /* 0x1E */ item_func_RECOVER_FAILY, + /* 0x1F */ item_func_TRIPLE_HEART, + /* 0x20 */ item_func_SMALL_KEY, + /* 0x21 */ item_func_KAKERA_HEART, + /* 0x22 */ item_func_UTUWA_HEART, + /* 0x23 */ item_func_MAP, + /* 0x24 */ item_func_COMPUS, + /* 0x25 */ item_func_DUNGEON_EXIT, + /* 0x26 */ item_func_BOSS_KEY, + /* 0x27 */ item_func_DUNGEON_BACK, + /* 0x28 */ item_func_SWORD, + /* 0x29 */ item_func_MASTER_SWORD, + /* 0x2A */ item_func_WOOD_SHIELD, + /* 0x2B */ item_func_SHIELD, + /* 0x2C */ item_func_HYLIA_SHIELD, + /* 0x2D */ item_func_TKS_LETTER, + /* 0x2E */ item_func_WEAR_CASUAL, + /* 0x2F */ item_func_WEAR_KOKIRI, + /* 0x30 */ item_func_ARMOR, + /* 0x31 */ item_func_WEAR_ZORA, + /* 0x32 */ item_func_MAGIC_LV1, + /* 0x33 */ item_func_DUNGEON_EXIT_2, + /* 0x34 */ item_func_WALLET_LV1, + /* 0x35 */ item_func_WALLET_LV2, + /* 0x36 */ item_func_WALLET_LV3, + /* 0x37 */ item_func_noentry, + /* 0x38 */ item_func_noentry, + /* 0x39 */ item_func_UPPER_ZORAS_RIVER_PORTAL, + /* 0x3A */ item_func_CASTLE_TOWN_PORTAL, + /* 0x3B */ item_func_GERUDO_DESERT_PORTAL, + /* 0x3C */ item_func_NORTH_FARON_PORTAL, + /* 0x3D */ item_func_ZORAS_JEWEL, + /* 0x3E */ item_func_HAWK_EYE, + /* 0x3F */ item_func_WOOD_STICK, + /* 0x40 */ item_func_BOOMERANG, + /* 0x41 */ item_func_SPINNER, + /* 0x42 */ item_func_IRONBALL, + /* 0x43 */ item_func_BOW, + /* 0x44 */ item_func_HOOKSHOT, + /* 0x45 */ item_func_HVY_BOOTS, + /* 0x46 */ item_func_COPY_ROD, + /* 0x47 */ item_func_W_HOOKSHOT, + /* 0x48 */ item_func_KANTERA, + /* 0x49 */ item_func_LIGHT_SWORD, + /* 0x4A */ item_func_FISHING_ROD_1, + /* 0x4B */ item_func_PACHINKO, + /* 0x4C */ item_func_COPY_ROD_2, + /* 0x4D */ item_func_KAKARIKO_GORGE_PORTAL, + /* 0x4E */ item_func_KAKARIKO_VILLAGE_PORTAL, + /* 0x4F */ item_func_BOMB_BAG_LV2, + /* 0x50 */ item_func_BOMB_BAG_LV1, + /* 0x51 */ item_func_BOMB_IN_BAG, + /* 0x52 */ item_func_DEATH_MOUNTAIN_PORTAL, + /* 0x53 */ item_func_LIGHT_ARROW, + /* 0x54 */ item_func_ARROW_LV1, + /* 0x55 */ item_func_ARROW_LV2, + /* 0x56 */ item_func_ARROW_LV3, + /* 0x57 */ item_func_ZORAS_DOMAIN_PORTAL, + /* 0x58 */ item_func_LURE_ROD, + /* 0x59 */ item_func_BOMB_ARROW, + /* 0x5A */ item_func_HAWK_ARROW, + /* 0x5B */ item_func_BEE_ROD, + /* 0x5C */ item_func_JEWEL_ROD, + /* 0x5D */ item_func_WORM_ROD, + /* 0x5E */ item_func_JEWEL_BEE_ROD, + /* 0x5F */ item_func_JEWEL_WORM_ROD, + /* 0x60 */ item_func_EMPTY_BOTTLE, + /* 0x61 */ item_func_RED_BOTTLE, + /* 0x62 */ item_func_GREEN_BOTTLE, + /* 0x63 */ item_func_BLUE_BOTTLE, + /* 0x64 */ item_func_MILK_BOTTLE, + /* 0x65 */ item_func_HALF_MILK_BOTTLE, + /* 0x66 */ item_func_OIL_BOTTLE, + /* 0x67 */ item_func_WATER_BOTTLE, + /* 0x68 */ item_func_OIL_BOTTLE2, + /* 0x69 */ item_func_RED_BOTTLE2, + /* 0x6A */ item_func_UGLY_SOUP, + /* 0x6B */ item_func_HOT_SPRING, + /* 0x6C */ item_func_FAIRY_BOTTLE, + /* 0x6D */ item_func_HOT_SPRING2, + /* 0x6E */ item_func_OIL2, + /* 0x6F */ item_func_OIL, + /* 0x70 */ item_func_NORMAL_BOMB, + /* 0x71 */ item_func_WATER_BOMB, + /* 0x72 */ item_func_POKE_BOMB, + /* 0x73 */ item_func_FAIRY_DROP, + /* 0x74 */ item_func_WORM, + /* 0x75 */ item_func_DROP_BOTTLE, + /* 0x76 */ item_func_BEE_CHILD, + /* 0x77 */ item_func_CHUCHU_RARE, + /* 0x78 */ item_func_CHUCHU_RED, + /* 0x79 */ item_func_CHUCHU_BLUE, + /* 0x7A */ item_func_CHUCHU_GREEN, + /* 0x7B */ item_func_CHUCHU_YELLOW, + /* 0x7C */ item_func_CHUCHU_PURPLE, + /* 0x7D */ item_func_LV1_SOUP, + /* 0x7E */ item_func_LV2_SOUP, + /* 0x7F */ item_func_LV3_SOUP, + /* 0x80 */ item_func_LETTER, + /* 0x81 */ item_func_BILL, + /* 0x82 */ item_func_WOOD_STATUE, + /* 0x83 */ item_func_IRIAS_PENDANT, + /* 0x84 */ item_func_HORSE_FLUTE, + /* 0x85 */ item_func_FOREST_SMALL_KEY, + /* 0x86 */ item_func_MINES_SMALL_KEY, + /* 0x87 */ item_func_LAKEBED_SMALL_KEY, + /* 0x88 */ item_func_ARBITERS_SMALL_KEY, + /* 0x89 */ item_func_SNOWPEAK_SMALL_KEY, + /* 0x8A */ item_func_TEMPLE_OF_TIME_SMALL_KEY, + /* 0x8B */ item_func_CITY_SMALL_KEY, + /* 0x8C */ item_func_PALACE_SMALL_KEY, + /* 0x8D */ item_func_HYRULE_SMALL_KEY, + /* 0x8E */ item_func_CAMP_SMALL_KEY, + /* 0x8F */ item_func_LAKE_HYLIA_PORTAL, + /* 0x90 */ item_func_RAFRELS_MEMO, + /* 0x91 */ item_func_ASHS_SCRIBBLING, + /* 0x92 */ item_func_FOREST_BOSS_KEY, + /* 0x93 */ item_func_LAKEBED_BOSS_KEY, + /* 0x94 */ item_func_ARBITERS_BOSS_KEY, + /* 0x95 */ item_func_TEMPLE_OF_TIME_BOSS_KEY, + /* 0x96 */ item_func_CITY_BOSS_KEY, + /* 0x97 */ item_func_PALACE_BOSS_KEY, + /* 0x98 */ item_func_HYRULE_BOSS_KEY, + /* 0x99 */ item_func_FOREST_COMPASS, + /* 0x9A */ item_func_MINES_COMPASS, + /* 0x9B */ item_func_LAKEBED_COMPASS, + /* 0x9C */ item_func_CHUCHU_YELLOW2, + /* 0x9D */ item_func_OIL_BOTTLE3, + /* 0x9E */ item_func_SHOP_BEE_CHILD, + /* 0x9F */ item_func_CHUCHU_BLACK, + /* 0xA0 */ item_func_LIGHT_DROP, + /* 0xA1 */ item_func_DROP_CONTAINER, + /* 0xA2 */ item_func_DROP_CONTAINER02, + /* 0xA3 */ item_func_DROP_CONTAINER03, + /* 0xA4 */ item_func_FILLED_CONTAINER, + /* 0xA5 */ item_func_MIRROR_PIECE_2, + /* 0xA6 */ item_func_MIRROR_PIECE_3, + /* 0xA7 */ item_func_MIRROR_PIECE_4, + /* 0xA8 */ item_func_ARBITERS_COMPASS, + /* 0xA9 */ item_func_SNOWPEAK_COMPASS, + /* 0xAA */ item_func_TEMPLE_OF_TIME_COMPASS, + /* 0xAB */ item_func_CITY_COMPASS, + /* 0xAC */ item_func_PALACE_COMPASS, + /* 0xAD */ item_func_HYRULE_COMPASS, + /* 0xAE */ item_func_MIRROR_CHAMBER_PORTAL, + /* 0xAF */ item_func_SNOWPEAK_PORTAL, + /* 0xB0 */ item_func_SMELL_YELIA_POUCH, + /* 0xB1 */ item_func_SMELL_PUMPKIN, + /* 0xB2 */ item_func_SMELL_POH, + /* 0xB3 */ item_func_SMELL_FISH, + /* 0xB4 */ item_func_SMELL_CHILDREN, + /* 0xB5 */ item_func_SMELL_MEDICINE, + /* 0xB6 */ item_func_FOREST_MAP, + /* 0xB7 */ item_func_MINES_MAP, + /* 0xB8 */ item_func_LAKEBED_MAP, + /* 0xB9 */ item_func_ARBITERS_MAP, + /* 0xBA */ item_func_SNOWPEAK_MAP, + /* 0xBB */ item_func_TEMPLE_OF_TIME_MAP, + /* 0xBC */ item_func_CITY_MAP, + /* 0xBD */ item_func_PALACE_MAP, + /* 0xBE */ item_func_HYRULE_MAP, + /* 0xBF */ item_func_SACRED_GROVE_PORTAL, + /* 0xC0 */ item_func_M_BEETLE, + /* 0xC1 */ item_func_F_BEETLE, + /* 0xC2 */ item_func_M_BUTTERFLY, + /* 0xC3 */ item_func_F_BUTTERFLY, + /* 0xC4 */ item_func_M_STAG_BEETLE, + /* 0xC5 */ item_func_F_STAG_BEETLE, + /* 0xC6 */ item_func_M_GRASSHOPPER, + /* 0xC7 */ item_func_F_GRASSHOPPER, + /* 0xC8 */ item_func_M_NANAFUSHI, + /* 0xC9 */ item_func_F_NANAFUSHI, + /* 0xCA */ item_func_M_DANGOMUSHI, + /* 0xCB */ item_func_F_DANGOMUSHI, + /* 0xCC */ item_func_M_MANTIS, + /* 0xCD */ item_func_F_MANTIS, + /* 0xCE */ item_func_M_LADYBUG, + /* 0xCF */ item_func_F_LADYBUG, + /* 0xD0 */ item_func_M_SNAIL, + /* 0xD1 */ item_func_F_SNAIL, + /* 0xD2 */ item_func_M_DRAGONFLY, + /* 0xD3 */ item_func_F_DRAGONFLY, + /* 0xD4 */ item_func_M_ANT, + /* 0xD5 */ item_func_F_ANT, + /* 0xD6 */ item_func_M_MAYFLY, + /* 0xD7 */ item_func_F_MAYFLY, + /* 0xD8 */ item_func_FUSED_SHADOW_1, + /* 0xD9 */ item_func_FUSED_SHADOW_2, + /* 0xDA */ item_func_FUSED_SHADOW_3, + /* 0xDB */ item_func_MIRROR_PIECE_1, + /* 0xDC */ item_func_noentry, + /* 0xDD */ item_func_noentry, + /* 0xDE */ item_func_noentry, + /* 0xDF */ item_func_noentry, + /* 0xE0 */ item_func_POU_SPIRIT, + /* 0xE1 */ item_func_ENDING_BLOW, + /* 0xE2 */ item_func_SHIELD_ATTACK, + /* 0xE3 */ item_func_BACK_SLICE, + /* 0xE4 */ item_func_HELM_SPLITTER, + /* 0xE5 */ item_func_MORTAL_DRAW, + /* 0xE6 */ item_func_JUMP_STRIKE, + /* 0xE7 */ item_func_GREAT_SPIN, + /* 0xE8 */ item_func_ELDIN_BRIDGE_PORTAL, + /* 0xE9 */ item_func_ANCIENT_DOCUMENT, + /* 0xEA */ item_func_AIR_LETTER, + /* 0xEB */ item_func_ANCIENT_DOCUMENT2, + /* 0xEC */ item_func_LV7_DUNGEON_EXIT, + /* 0xED */ item_func_LINKS_SAVINGS, + /* 0xEE */ item_func_SMALL_KEY2, + /* 0xEF */ item_func_POU_FIRE1, + /* 0xF0 */ item_func_POU_FIRE2, + /* 0xF1 */ item_func_POU_FIRE3, + /* 0xF2 */ item_func_POU_FIRE4, + /* 0xF3 */ item_func_BOSSRIDER_KEY, + /* 0xF4 */ item_func_TOMATO_PUREE, + /* 0xF5 */ item_func_TASTE, + /* 0xF6 */ item_func_LV5_BOSS_KEY, + /* 0xF7 */ item_func_SURFBOARD, + /* 0xF8 */ item_func_KANTERA2, + /* 0xF9 */ item_func_L2_KEY_PIECES1, + /* 0xFA */ item_func_L2_KEY_PIECES2, + /* 0xFB */ item_func_L2_KEY_PIECES3, + /* 0xFC */ item_func_KEY_OF_CARAVAN, + /* 0xFD */ item_func_LV2_BOSS_KEY, + /* 0xFE */ item_func_KEY_OF_FILONE, + /* 0xFF */ item_func_noentry, +}; + +static int (*item_getcheck_func_ptr_randomizer[256])() = { + /* 0x00 */ item_getcheck_func_HEART, + /* 0x01 */ item_getcheck_func_GREEN_RUPEE, + /* 0x02 */ item_getcheck_func_BLUE_RUPEE, + /* 0x03 */ item_getcheck_func_YELLOW_RUPEE, + /* 0x04 */ item_getcheck_func_RED_RUPEE, + /* 0x05 */ item_getcheck_func_PURPLE_RUPEE, + /* 0x06 */ item_getcheck_func_ORANGE_RUPEE, + /* 0x07 */ item_getcheck_func_SILVER_RUPEE, + /* 0x08 */ item_getcheck_func_S_MAGIC, + /* 0x09 */ item_getcheck_func_L_MAGIC, + /* 0x0A */ item_getcheck_func_BOMB_5, + /* 0x0B */ item_getcheck_func_BOMB_10, + /* 0x0C */ item_getcheck_func_BOMB_20, + /* 0x0D */ item_getcheck_func_BOMB_30, + /* 0x0E */ item_getcheck_func_ARROW_10, + /* 0x0F */ item_getcheck_func_ARROW_20, + /* 0x10 */ item_getcheck_func_ARROW_30, + /* 0x11 */ item_getcheck_func_ARROW_1, + /* 0x12 */ item_getcheck_func_PACHINKO_SHOT, + /* 0x13 */ item_getcheck_func_noentry, + /* 0x14 */ item_getcheck_func_ORDON_PORTAL, + /* 0x15 */ item_getcheck_func_SOUTH_FARON_PORTAL, + /* 0x16 */ item_getcheck_func_WATER_BOMB_5, + /* 0x17 */ item_getcheck_func_WATER_BOMB_10, + /* 0x18 */ item_getcheck_func_WATER_BOMB_20, + /* 0x19 */ item_getcheck_func_WATER_BOMB_30, + /* 0x1A */ item_getcheck_func_BOMB_INSECT_5, + /* 0x1B */ item_getcheck_func_BOMB_INSECT_10, + /* 0x1C */ item_getcheck_func_BOMB_INSECT_20, + /* 0x1D */ item_getcheck_func_BOMB_INSECT_30, + /* 0x1E */ item_getcheck_func_RECOVER_FAILY, + /* 0x1F */ item_getcheck_func_TRIPLE_HEART, + /* 0x20 */ item_getcheck_func_SMALL_KEY, + /* 0x21 */ item_getcheck_func_KAKERA_HEART, + /* 0x22 */ item_getcheck_func_UTUWA_HEART, + /* 0x23 */ item_getcheck_func_MAP, + /* 0x24 */ item_getcheck_func_COMPUS, + /* 0x25 */ item_getcheck_func_DUNGEON_EXIT, + /* 0x26 */ item_getcheck_func_BOSS_KEY, + /* 0x27 */ item_getcheck_func_DUNGEON_BACK, + /* 0x28 */ item_getcheck_func_SWORD, + /* 0x29 */ item_getcheck_func_MASTER_SWORD, + /* 0x2A */ item_getcheck_func_WOOD_SHIELD, + /* 0x2B */ item_getcheck_func_SHIELD, + /* 0x2C */ item_getcheck_func_HYLIA_SHIELD, + /* 0x2D */ item_getcheck_func_TKS_LETTER, + /* 0x2E */ item_getcheck_func_WEAR_CASUAL, + /* 0x2F */ item_getcheck_func_WEAR_KOKIRI, + /* 0x30 */ item_getcheck_func_ARMOR, + /* 0x31 */ item_getcheck_func_WEAR_ZORA, + /* 0x32 */ item_getcheck_func_MAGIC_LV1, + /* 0x33 */ item_getcheck_func_DUNGEON_EXIT_2, + /* 0x34 */ item_getcheck_func_WALLET_LV1, + /* 0x35 */ item_getcheck_func_WALLET_LV2, + /* 0x36 */ item_getcheck_func_WALLET_LV3, + /* 0x37 */ item_getcheck_func_noentry, + /* 0x38 */ item_getcheck_func_noentry, + /* 0x39 */ item_getcheck_func_UPPER_ZORAS_RIVER_PORTAL, + /* 0x3A */ item_getcheck_func_CASTLE_TOWN_PORTAL, + /* 0x3B */ item_getcheck_func_GERUDO_DESERT_PORTAL, + /* 0x3C */ item_getcheck_func_NORTH_FARON_PORTAL, + /* 0x3D */ item_getcheck_func_ZORAS_JEWEL, + /* 0x3E */ item_getcheck_func_HAWK_EYE, + /* 0x3F */ item_getcheck_func_WOOD_STICK, + /* 0x40 */ item_getcheck_func_BOOMERANG, + /* 0x41 */ item_getcheck_func_SPINNER, + /* 0x42 */ item_getcheck_func_IRONBALL, + /* 0x43 */ item_getcheck_func_BOW, + /* 0x44 */ item_getcheck_func_HOOKSHOT, + /* 0x45 */ item_getcheck_func_HVY_BOOTS, + /* 0x46 */ item_getcheck_func_COPY_ROD, + /* 0x47 */ item_getcheck_func_W_HOOKSHOT, + /* 0x48 */ item_getcheck_func_KANTERA, + /* 0x49 */ item_getcheck_func_LIGHT_SWORD, + /* 0x4A */ item_getcheck_func_FISHING_ROD_1, + /* 0x4B */ item_getcheck_func_PACHINKO, + /* 0x4C */ item_getcheck_func_COPY_ROD_2, + /* 0x4D */ item_getcheck_func_KAKARIKO_GORGE_PORTAL, + /* 0x4E */ item_getcheck_func_KAKARIKO_VILLAGE_PORTAL, + /* 0x4F */ item_getcheck_func_BOMB_BAG_LV2, + /* 0x50 */ item_getcheck_func_BOMB_BAG_LV1, + /* 0x51 */ item_getcheck_func_BOMB_IN_BAG, + /* 0x52 */ item_getcheck_func_DEATH_MOUNTAIN_PORTAL, + /* 0x53 */ item_getcheck_func_LIGHT_ARROW, + /* 0x54 */ item_getcheck_func_ARROW_LV1, + /* 0x55 */ item_getcheck_func_ARROW_LV2, + /* 0x56 */ item_getcheck_func_ARROW_LV3, + /* 0x57 */ item_getcheck_func_ZORAS_DOMAIN_PORTAL, + /* 0x58 */ item_getcheck_func_LURE_ROD, + /* 0x59 */ item_getcheck_func_BOMB_ARROW, + /* 0x5A */ item_getcheck_func_HAWK_ARROW, + /* 0x5B */ item_getcheck_func_BEE_ROD, + /* 0x5C */ item_getcheck_func_JEWEL_ROD, + /* 0x5D */ item_getcheck_func_WORM_ROD, + /* 0x5E */ item_getcheck_func_JEWEL_BEE_ROD, + /* 0x5F */ item_getcheck_func_JEWEL_WORM_ROD, + /* 0x60 */ item_getcheck_func_EMPTY_BOTTLE, + /* 0x61 */ item_getcheck_func_RED_BOTTLE, + /* 0x62 */ item_getcheck_func_GREEN_BOTTLE, + /* 0x63 */ item_getcheck_func_BLUE_BOTTLE, + /* 0x64 */ item_getcheck_func_MILK_BOTTLE, + /* 0x65 */ item_getcheck_func_HALF_MILK_BOTTLE, + /* 0x66 */ item_getcheck_func_OIL_BOTTLE, + /* 0x67 */ item_getcheck_func_WATER_BOTTLE, + /* 0x68 */ item_getcheck_func_OIL_BOTTLE2, + /* 0x69 */ item_getcheck_func_RED_BOTTLE2, + /* 0x6A */ item_getcheck_func_UGLY_SOUP, + /* 0x6B */ item_getcheck_func_HOT_SPRING, + /* 0x6C */ item_getcheck_func_FAIRY_BOTTLE, + /* 0x6D */ item_getcheck_func_HOT_SPRING2, + /* 0x6E */ item_getcheck_func_OIL2, + /* 0x6F */ item_getcheck_func_OIL, + /* 0x70 */ item_getcheck_func_NORMAL_BOMB, + /* 0x71 */ item_getcheck_func_WATER_BOMB, + /* 0x72 */ item_getcheck_func_POKE_BOMB, + /* 0x73 */ item_getcheck_func_FAIRY_DROP, + /* 0x74 */ item_getcheck_func_WORM, + /* 0x75 */ item_getcheck_func_DROP_BOTTLE, + /* 0x76 */ item_getcheck_func_BEE_CHILD, + /* 0x77 */ item_getcheck_func_CHUCHU_RARE, + /* 0x78 */ item_getcheck_func_CHUCHU_RED, + /* 0x79 */ item_getcheck_func_CHUCHU_BLUE, + /* 0x7A */ item_getcheck_func_CHUCHU_GREEN, + /* 0x7B */ item_getcheck_func_CHUCHU_YELLOW, + /* 0x7C */ item_getcheck_func_CHUCHU_PURPLE, + /* 0x7D */ item_getcheck_func_LV1_SOUP, + /* 0x7E */ item_getcheck_func_LV2_SOUP, + /* 0x7F */ item_getcheck_func_LV3_SOUP, + /* 0x80 */ item_getcheck_func_LETTER, + /* 0x81 */ item_getcheck_func_BILL, + /* 0x82 */ item_getcheck_func_WOOD_STATUE, + /* 0x83 */ item_getcheck_func_IRIAS_PENDANT, + /* 0x84 */ item_getcheck_func_HORSE_FLUTE, + /* 0x85 */ item_getcheck_func_noentry, + /* 0x86 */ item_getcheck_func_noentry, + /* 0x87 */ item_getcheck_func_noentry, + /* 0x88 */ item_getcheck_func_noentry, + /* 0x89 */ item_getcheck_func_noentry, + /* 0x8A */ item_getcheck_func_noentry, + /* 0x8B */ item_getcheck_func_noentry, + /* 0x8C */ item_getcheck_func_noentry, + /* 0x8D */ item_getcheck_func_noentry, + /* 0x8E */ item_getcheck_func_CAMP_SMALL_KEY, + /* 0x8F */ item_getcheck_func_LAKE_HYLIA_PORTAL, + /* 0x90 */ item_getcheck_func_RAFRELS_MEMO, + /* 0x91 */ item_getcheck_func_ASHS_SCRIBBLING, + /* 0x92 */ item_getcheck_func_noentry, + /* 0x93 */ item_getcheck_func_noentry, + /* 0x94 */ item_getcheck_func_noentry, + /* 0x95 */ item_getcheck_func_noentry, + /* 0x96 */ item_getcheck_func_noentry, + /* 0x97 */ item_getcheck_func_noentry, + /* 0x98 */ item_getcheck_func_noentry, + /* 0x99 */ item_getcheck_func_noentry, + /* 0x9A */ item_getcheck_func_noentry, + /* 0x9B */ item_getcheck_func_noentry, + /* 0x9C */ item_getcheck_func_CHUCHU_YELLOW2, + /* 0x9D */ item_getcheck_func_OIL_BOTTLE3, + /* 0x9E */ item_getcheck_func_SHOP_BEE_CHILD, + /* 0x9F */ item_getcheck_func_CHUCHU_BLACK, + /* 0xA0 */ item_getcheck_func_LIGHT_DROP, + /* 0xA1 */ item_getcheck_func_DROP_CONTAINER, + /* 0xA2 */ item_getcheck_func_DROP_CONTAINER02, + /* 0xA3 */ item_getcheck_func_DROP_CONTAINER03, + /* 0xA4 */ item_getcheck_func_FILLED_CONTAINER, + /* 0xA5 */ item_getcheck_func_MIRROR_PIECE_2, + /* 0xA6 */ item_getcheck_func_MIRROR_PIECE_3, + /* 0xA7 */ item_getcheck_func_MIRROR_PIECE_4, + /* 0xA8 */ item_getcheck_func_noentry, + /* 0xA9 */ item_getcheck_func_noentry, + /* 0xAA */ item_getcheck_func_noentry, + /* 0xAB */ item_getcheck_func_noentry, + /* 0xAC */ item_getcheck_func_noentry, + /* 0xAD */ item_getcheck_func_noentry, + /* 0xAE */ item_getcheck_func_MIRROR_CHAMBER_PORTAL, + /* 0xAF */ item_getcheck_func_SNOWPEAK_PORTAL, + /* 0xB0 */ item_getcheck_func_SMELL_YELIA_POUCH, + /* 0xB1 */ item_getcheck_func_SMELL_PUMPKIN, + /* 0xB2 */ item_getcheck_func_SMELL_POH, + /* 0xB3 */ item_getcheck_func_SMELL_FISH, + /* 0xB4 */ item_getcheck_func_SMELL_CHILDREN, + /* 0xB5 */ item_getcheck_func_SMELL_MEDICINE, + /* 0xB6 */ item_getcheck_func_noentry, + /* 0xB7 */ item_getcheck_func_noentry, + /* 0xB8 */ item_getcheck_func_noentry, + /* 0xB9 */ item_getcheck_func_noentry, + /* 0xBA */ item_getcheck_func_noentry, + /* 0xBB */ item_getcheck_func_noentry, + /* 0xBC */ item_getcheck_func_noentry, + /* 0xBD */ item_getcheck_func_noentry, + /* 0xBE */ item_getcheck_func_noentry, + /* 0xBF */ item_getcheck_func_SACRED_GROVE_PORTAL, + /* 0xC0 */ item_getcheck_func_M_BEETLE, + /* 0xC1 */ item_getcheck_func_F_BEETLE, + /* 0xC2 */ item_getcheck_func_M_BUTTERFLY, + /* 0xC3 */ item_getcheck_func_F_BUTTERFLY, + /* 0xC4 */ item_getcheck_func_M_STAG_BEETLE, + /* 0xC5 */ item_getcheck_func_F_STAG_BEETLE, + /* 0xC6 */ item_getcheck_func_M_GRASSHOPPER, + /* 0xC7 */ item_getcheck_func_F_GRASSHOPPER, + /* 0xC8 */ item_getcheck_func_M_NANAFUSHI, + /* 0xC9 */ item_getcheck_func_F_NANAFUSHI, + /* 0xCA */ item_getcheck_func_M_DANGOMUSHI, + /* 0xCB */ item_getcheck_func_F_DANGOMUSHI, + /* 0xCC */ item_getcheck_func_M_MANTIS, + /* 0xCD */ item_getcheck_func_F_MANTIS, + /* 0xCE */ item_getcheck_func_M_LADYBUG, + /* 0xCF */ item_getcheck_func_F_LADYBUG, + /* 0xD0 */ item_getcheck_func_M_SNAIL, + /* 0xD1 */ item_getcheck_func_F_SNAIL, + /* 0xD2 */ item_getcheck_func_M_DRAGONFLY, + /* 0xD3 */ item_getcheck_func_F_DRAGONFLY, + /* 0xD4 */ item_getcheck_func_M_ANT, + /* 0xD5 */ item_getcheck_func_F_ANT, + /* 0xD6 */ item_getcheck_func_M_MAYFLY, + /* 0xD7 */ item_getcheck_func_F_MAYFLY, + /* 0xD8 */ item_getcheck_func_FUSED_SHADOW_1, + /* 0xD9 */ item_getcheck_func_FUSED_SHADOW_2, + /* 0xDA */ item_getcheck_func_FUSED_SHADOW_3, + /* 0xDB */ item_getcheck_func_MIRROR_PIECE_1, + /* 0xDC */ item_getcheck_func_noentry, + /* 0xDD */ item_getcheck_func_noentry, + /* 0xDE */ item_getcheck_func_noentry, + /* 0xDF */ item_getcheck_func_noentry, + /* 0xE0 */ item_getcheck_func_POU_SPIRIT, + /* 0xE1 */ item_getcheck_func_ENDING_BLOW, + /* 0xE2 */ item_getcheck_func_SHIELD_ATTACK, + /* 0xE3 */ item_getcheck_func_BACK_SLICE, + /* 0xE4 */ item_getcheck_func_HELM_SPLITTER, + /* 0xE5 */ item_getcheck_func_MORTAL_DRAW, + /* 0xE6 */ item_getcheck_func_JUMP_STRIKE, + /* 0xE7 */ item_getcheck_func_GREAT_SPIN, + /* 0xE8 */ item_getcheck_func_ELDIN_BRIDGE_PORTAL, + /* 0xE9 */ item_getcheck_func_ANCIENT_DOCUMENT, + /* 0xEA */ item_getcheck_func_AIR_LETTER, + /* 0xEB */ item_getcheck_func_ANCIENT_DOCUMENT2, + /* 0xEC */ item_getcheck_func_LV7_DUNGEON_EXIT, + /* 0xED */ item_getcheck_func_LINKS_SAVINGS, + /* 0xEE */ item_getcheck_func_SMALL_KEY2, + /* 0xEF */ item_getcheck_func_POU_FIRE1, + /* 0xF0 */ item_getcheck_func_POU_FIRE2, + /* 0xF1 */ item_getcheck_func_POU_FIRE3, + /* 0xF2 */ item_getcheck_func_POU_FIRE4, + /* 0xF3 */ item_getcheck_func_BOSSRIDER_KEY, + /* 0xF4 */ item_getcheck_func_TOMATO_PUREE, + /* 0xF5 */ item_getcheck_func_TASTE, + /* 0xF6 */ item_getcheck_func_LV5_BOSS_KEY, + /* 0xF7 */ item_getcheck_func_SURFBOARD, + /* 0xF8 */ item_getcheck_func_KANTERA2, + /* 0xF9 */ item_getcheck_func_L2_KEY_PIECES1, + /* 0xFA */ item_getcheck_func_L2_KEY_PIECES2, + /* 0xFB */ item_getcheck_func_L2_KEY_PIECES3, + /* 0xFC */ item_getcheck_func_KEY_OF_CARAVAN, + /* 0xFD */ item_getcheck_func_LV2_BOSS_KEY, + /* 0xFE */ item_getcheck_func_KEY_OF_FILONE, + /* 0xFF */ item_getcheck_func_noentry, +}; + +namespace randomizer::item { +void exec_item_get(u8 item_no) { + item_no = verifyProgressiveItem(item_no); + g_randomizerState.mUpdateTracker = true; + dComIfGs_onItemFirstBit(item_no); + item_func_ptr_randomizer[item_no](); +} + +int check_item_get(u8 item_no, int param) { + switch (item_no) { + case dItemNo_Randomizer_HYLIA_SHIELD_e: + // Check if we are at Kakariko Malo mart and verify that we have not bought the shield. + if (playerIsInRoomStage(3, allStages[Kakariko_Village_Interiors]) && + !dComIfGs_isEventBit(BOUGHT_HYLIAN_SHIELD_AT_MALO_MART)) { + // Return false so we can buy the shield. + return 0; + } + break; + case dItemNo_Randomizer_HAWK_EYE_e: + // Check if we are at Kakariko Village and that the hawkeye is currently not for sale. + if (getStageID() == Kakariko_Village && !dComIfGs_isSwitch(0x3E, 0)) { + // Return false so we can buy the hawkeye. + return 0; + } + break; + case dItemNo_Randomizer_SHIELD_e: + case dItemNo_Randomizer_WOOD_SHIELD_e: + // Check if we are at Kakariko Malo mart and that the Wooden Shield has not been bought. + if (playerIsInRoomStage(3, allStages[Kakariko_Village_Interiors]) && + !dComIfGs_isSwitch(0x5, 3)) { + // Return false so we can buy the shield. + return 0; + } + break; + case dItemNo_Randomizer_TOMATO_PUREE_e: + case dItemNo_Randomizer_TASTE_e: + // Check to see if currently in Snowpeak Ruins + if (getStageID() == Snowpeak_Ruins) { + // Return false so that yeta will give the map item no matter what. + return 0; + } + break; + case dItemNo_Randomizer_IRONBALL_e: + // Check to see if currently in Snowpeak Ruins Darkhammer room + if (getStageID() == Darkhammer) { + return dComIfGs_isSwitch(0x5F, 51); // Picked up the Ball and Chain check. + } + } + + int result = item_getcheck_func_ptr_randomizer[item_no](); + + if (result == -1) { + result = param; + } + + return result; +} + +} // namespace randomizer::item + +namespace randomizer::item { + +dItem_itemResource item_resource_randomizer[] = { + /* 0x00 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x01 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x02 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x1, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x03 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x2, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x04 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x3, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x05 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x4, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x06 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x5, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x07 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x6, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0x08 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x09 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x0A */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000C, 0x64, 0x019F}, + /* 0x0B */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000C, 0x64, 0x019F}, + /* 0x0C */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000C, 0x64, 0x019F}, + /* 0x0D */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000C, 0x64, 0x019F}, + /* 0x0E */ {"O_gD_arow", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0053, 0x64, 0x0000}, + /* 0x0F */ {"O_gD_arow", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0053, 0x64, 0x0000}, + /* 0x10 */ {"O_gD_arow", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0053, 0x64, 0x0000}, + /* 0x11 */ {"O_gD_arow", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0053, 0x64, 0x0000}, + /* 0x12 */ {"O_gD_tane", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x005C, 0x64, 0x0000}, + /* 0x13 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x14 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x15 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x16 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000D, 0x64, 0x0000}, + /* 0x17 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000D, 0x64, 0x0000}, + /* 0x18 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000D, 0x64, 0x0000}, + /* 0x19 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000D, 0x64, 0x0000}, + /* 0x1A */ {"O_gD_BI", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000B, 0x64, 0x0000}, + /* 0x1B */ {"O_gD_BI", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000B, 0x64, 0x0000}, + /* 0x1C */ {"O_gD_BI", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000B, 0x64, 0x0000}, + /* 0x1D */ {"O_gD_BI", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000B, 0x64, 0x0000}, + /* 0x1E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x1F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x20 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x21 */ {"O_gD_hutk", 0x0008,-0x0001, 0x0005, 0x000B,-0x0001, -0x1, -0x1, 0x0050, 0x64, 0x0194}, + /* 0x22 */ {"O_gD_hutu", 0x0008,-0x0001, 0x0005, 0x000B,-0x0001, -0x1, -0x1, 0x0051, 0x64, 0x0000}, + /* 0x23 */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0x24 */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0x25 */ {"O_gD_TKS", 0x0008,-0x0001, 0x0005,-0x0001, 0x000B, -0x1, -0x1, 0x0028, 0x64, 0x0191}, + /* 0x26 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x27 */ {"O_gD_TKC", 0x0009, 0x000C, 0x0006,-0x0001, 0x000F, -0x1, -0x1, 0x0026, 0x64, 0x0191}, + /* 0x28 */ {"O_gD_SWA", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0070, 0x6E, 0x0195}, + /* 0x29 */ {"MstrSword", 0x0005,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0042, 0x6E, 0x0195}, + /* 0x2A */ {"T_gD_SHB", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0074, 0x6E, 0x01B5}, + /* 0x2B */ {"O_gD_SHC", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0040, 0x6E, 0x0196}, + /* 0x2C */ {"O_gD_SHA", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x003C, 0x64, 0x01B4}, + /* 0x2D */ {"O_gD_mem2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0022, 0x64, 0x01A8}, + /* 0x2E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x006B, 0x64, 0x0192}, + /* 0x2F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x006B, 0x64, 0x0000}, + /* 0x30 */ {"O_gD_marm", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0041, 0x64, 0x01A9}, + /* 0x31 */ {"O_gD_zora", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004D, 0x64, 0x01AA}, + /* 0x32 */ {"O_gD_Injy", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x002E, 0x64, 0x0000}, + /* 0x33 */ {"O_gD_TKS", 0x0008,-0x0001, 0x0005,-0x0001,-0x0001, -0x1, -0x1, 0x0028, 0x64, 0x0000}, + /* 0x34 */ {"O_gD_puL2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0047, 0x64, 0x0000}, + /* 0x35 */ {"O_gD_puL2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0048, 0x64, 0x0000}, + /* 0x36 */ {"O_gD_puL3", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0049, 0x64, 0x01AD}, + /* 0x37 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0050, 0x64, 0x019F}, + /* 0x38 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0050, 0x64, 0x01AF}, + /* 0x39 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0050, 0x64, 0x01B0}, + /* 0x3A */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0050, 0x64, 0x0000}, + /* 0x3B */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0072, 0x6E, 0x0000}, + /* 0x3C */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x01B3}, + /* 0x3D */ {"O_gD_sang", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x002A, 0x64, 0x0194}, + /* 0x3E */ {"O_gD_hawk", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0059, 0x64, 0x0000}, + /* 0x3F */ {"O_gD_SWB", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0024, 0x6E, 0x0000}, + /* 0x40 */ {"O_gD_boom", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0062, 0x6E, 0x01AB}, + /* 0x41 */ {"O_gD_SP", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x002B, 0x5F, 0x01A6}, + /* 0x42 */ {"O_gD_IB", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0020, 0x78, 0x0000}, + /* 0x43 */ {"O_gD_bow", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0069, 0x64, 0x01A5}, + /* 0x44 */ {"O_gD_HS", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006A, 0x78, 0x01AC}, + /* 0x45 */ {"O_gD_boot", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0025, 0x64, 0x01A7}, + /* 0x46 */ {"O_gD_CROD", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0016, 0x6E, 0x019E}, + /* 0x47 */ {"O_gD_HS", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x002C, 0x82, 0x01B5}, + /* 0x48 */ {"T_gD_kt", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006C, 0x6E, 0x0193}, + /* 0x49 */ {"MstrSword", 0x0005,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0042, 0x6E, 0x0195}, + /* 0x4A */ {"O_gD_uktr", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0018, 0x64, 0x01B7}, + /* 0x4B */ {"O_gD_pach", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x005B, 0x64, 0x01B8}, + /* 0x4C */ {"O_gD_CROD", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0016, 0x6E, 0x01B9}, + /* 0x4D */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x01BA}, + /* 0x4E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0197}, + /* 0x4F */ {"O_gD_bmL2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0056, 0x64, 0x0198}, + /* 0x50 */ {"O_gD_bomc", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, 0x0, -0x1, 0x0055, 0x64, 0x01BD}, + /* 0x51 */ {"O_gD_bomc", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0055, 0x64, 0x0000}, + /* 0x52 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0056, 0x64, 0x0000}, + /* 0x53 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x54 */ {"O_gD_quL1", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004A, 0x64, 0x01B1}, + /* 0x55 */ {"O_gD_quL2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004B, 0x64, 0x01F0}, + /* 0x56 */ {"O_gD_quL3", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004C, 0x64, 0x0000}, + /* 0x57 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x58 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x004E, 0x64, 0x0000}, + /* 0x59 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x000C, 0x64, 0x0000}, + /* 0x5A */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0059, 0x64, 0x0000}, + /* 0x5B */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0019, 0x64, 0x0000}, + /* 0x5C */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x001B, 0x64, 0x0000}, + /* 0x5D */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x001A, 0x64, 0x0000}, + /* 0x5E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x001C, 0x64, 0x0000}, + /* 0x5F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x001D, 0x64, 0x0000}, + /* 0x60 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x2, 0x0011, 0x50, 0x01BE}, + /* 0x61 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x62 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x1, 0x0, 0x0011, 0x50, 0x01C0}, + /* 0x63 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x2, 0x0, 0x0011, 0x50, 0x01C1}, + /* 0x64 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x3, 0x0, 0x0011, 0x50, 0x0000}, + /* 0x65 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x3, 0x1, 0x0012, 0x50, 0x0000}, + /* 0x66 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x4, 0x0, 0x0011, 0x50, 0x01A1}, + /* 0x67 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x5, 0x0, 0x0011, 0x50, 0x01AE}, + /* 0x68 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x4, 0x0, 0x0011, 0x50, 0x01A1}, + /* 0x69 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x6A */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x8, 0x0, 0x0011, 0x50, 0x0000}, + /* 0x6B */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x5, 0x0, 0x0011, 0x50, 0x0000}, + /* 0x6C */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0011, 0x50, 0x0000}, + /* 0x6D */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x5, 0x0, 0x0011, 0x50, 0x0000}, + /* 0x6E */ {"Obj_kntr", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006C, 0x6E, 0x0000}, + /* 0x6F */ {"Obj_kntr", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006C, 0x6E, 0x0000}, + /* 0x70 */ {"O_gD_bmL2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000C, 0x64, 0x0198}, + /* 0x71 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000D, 0x64, 0x0000}, + /* 0x72 */ {"O_gD_BI", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x000B, 0x64, 0x0000}, + /* 0x73 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0xB, 0x0, 0x0011, 0x50, 0x0000}, + /* 0x74 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0011, 0x50, 0x0000}, + /* 0x75 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0xB, 0x0, 0x0011, 0x50, 0x0000}, + /* 0x76 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0011, 0x50, 0x0000}, + /* 0x77 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x7, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x78 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x79 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x2, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x7A */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x1, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x7B */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x4, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x7C */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x6, 0x0, 0x0011, 0x50, 0x01BF}, + /* 0x7D */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0013, 0x50, 0x0000}, + /* 0x7E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0013, 0x50, 0x0000}, + /* 0x7F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0013, 0x50, 0x01CF}, + /* 0x80 */ {"O_gD_lttr", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x005A, 0x64, 0x0000}, + /* 0x81 */ {"O_gD_bill", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0054, 0x64, 0x0000}, + /* 0x82 */ {"O_gD_wood", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0058, 0x64, 0x0000}, + /* 0x83 */ {"O_gD_pend", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x005D, 0x64, 0x0000}, + /* 0x84 */ {"O_gD_pend", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x005D, 0x64, 0x0000}, + /* 0x85 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x86 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x87 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x88 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x89 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x8A */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x8B */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x8C */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x8D */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x8E */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0079}, + /* 0x8F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0x90 */ {"O_gD_mem2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0022, 0x64, 0x0000}, + /* 0x91 */ {"O_gD_mem2", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0022, 0x64, 0x0000}, + /* 0x92 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x93 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x94 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x95 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x96 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x97 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x98 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0021, 0x64,-0x0001}, + /* 0x99 */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0x9A */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0x9B */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0x9C */ {"Obj_kntr", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006C, 0x6E, 0x0000}, + /* 0x9D */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x4, 0x0, 0x0011, 0x50, 0x01A1}, + /* 0x9E */ {"O_gD_hk_s", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0011, 0x50, 0x0000}, + /* 0x9F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0011, 0x50, 0x0000}, + /* 0xA0 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xA1 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0052, 0x64, 0x0000}, + /* 0xA2 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0052, 0x64, 0x0000}, + /* 0xA3 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0052, 0x64, 0x0000}, + /* 0xA4 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0052, 0x64, 0x0000}, + /* 0xA5 */ {"MirrorB", 0x0009,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xA6 */ {"MirrorB", 0x0009,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xA7 */ {"MirrorB", 0x0009,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xA8 */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0xA9 */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0xAA */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0xAB */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0xAC */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0xAD */ {"T_gD_kmps", 0x0007,-0x0001, 0x0004,-0x0001,-0x0001, -0x1, -0x1, 0x006F, 0x64, 0x0198}, + /* 0xAE */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xAF */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB0 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB1 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB2 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB3 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB4 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB5 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xB6 */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xB7 */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xB8 */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xB9 */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xBA */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xBB */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xBC */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xBD */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xBE */ {"T_gD_map", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0071, 0x64, 0x0197}, + /* 0xBF */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x0011, 0x50, 0x0000}, + /* 0xC0 */ {"O_gD_kabo", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0030, 0x50, 0x0000}, + /* 0xC1 */ {"O_gD_kabm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x002F, 0x50, 0x0000}, + /* 0xC2 */ {"O_gD_choo", 0x0009, 0x000F, 0x0006, 0x000C,-0x0001, -0x1, -0x1, 0x0008, 0x50, 0x0000}, + /* 0xC3 */ {"O_gD_chom", 0x0009, 0x000F, 0x0006, 0x000C,-0x0001, -0x1, -0x1, 0x0007, 0x50, 0x0000}, + /* 0xC4 */ {"O_gD_kuwo", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0038, 0x50, 0x0000}, + /* 0xC5 */ {"O_gD_kuwm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0037, 0x50, 0x0000}, + /* 0xC6 */ {"O_gD_bato", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0006, 0x50, 0x0000}, + /* 0xC7 */ {"O_gD_batm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0005, 0x50, 0x0000}, + /* 0xC8 */ {"O_gD_nano", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x003B, 0x50, 0x0000}, + /* 0xC9 */ {"O_gD_nanm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x003A, 0x50, 0x0000}, + /* 0xCA */ {"O_gD_dano", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x000A, 0x50, 0x0000}, + /* 0xCB */ {"O_gD_danm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0009, 0x50, 0x0000}, + /* 0xCC */ {"O_gD_kamo", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0034, 0x50, 0x0000}, + /* 0xCD */ {"O_gD_kamm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0033, 0x50, 0x0000}, + /* 0xCE */ {"O_gD_teno", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x005F, 0x50, 0x0000}, + /* 0xCF */ {"O_gD_tenm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x005E, 0x50, 0x0000}, + /* 0xD0 */ {"O_gD_kato", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0036, 0x50, 0x0000}, + /* 0xD1 */ {"O_gD_katm", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0035, 0x50, 0x0000}, + /* 0xD2 */ {"O_gD_tono", 0x0009, 0x000F, 0x0006, 0x000C,-0x0001, -0x1, -0x1, 0x0061, 0x50, 0x0000}, + /* 0xD3 */ {"O_gD_tonm", 0x0009, 0x000F, 0x0006, 0x000C,-0x0001, -0x1, -0x1, 0x0060, 0x50, 0x0000}, + /* 0xD4 */ {"O_gD_ario", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0004, 0x50, 0x0000}, + /* 0xD5 */ {"O_gD_arim", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x0003, 0x50, 0x0000}, + /* 0xD6 */ {"O_gD_kago", 0x0009, 0x000F, 0x0006, 0x000C,-0x0001, -0x1, -0x1, 0x0032, 0x50, 0x0000}, + /* 0xD7 */ {"O_gD_kagm", 0x0009, 0x000F, 0x0006, 0x000C,-0x0001, -0x1, -0x1, 0x0031, 0x50, 0x0000}, + /* 0xD8 */ {"N_gD_mskF", 0x0004,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xD9 */ {"N_gD_mskB", 0x0004,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xDA */ {"N_gD_mskT", 0x0004,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xDB */ {"MirrorB", 0x0009,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xDC */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xDD */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xDE */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xDF */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xE0 */ {"O_gD_tama", 0x0005, 0x000B,-0x0001, 0x0008,-0x0001, -0x1, -0x1, 0x003E, 0x64, 0x0000}, + /* 0xE1 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE2 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE3 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE4 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE5 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE6 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE7 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, -0x0001,-0x0001, 0x0, -0x1, 0x003D, 0x64, 0x0000}, + /* 0xE8 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, + /* 0xE9 */ {"O_gD_komo", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004F, 0x64, 0x0000}, + /* 0xEA */ {"O_gD_komo", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004F, 0x64, 0x0000}, + /* 0xEB */ {"O_gD_komo", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x004F, 0x64, 0x0000}, + /* 0xEC */ {"O_gD_TKC", 0x0009, 0x000C, 0x0006,-0x0001, 0x000F, -0x1, -0x1, 0x0026, 0x64, 0x0191}, + /* 0xED */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x4, -0x1, 0x002D, 0x3C, 0x0000}, + /* 0xEE */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0000}, + /* 0xEF */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x2, 0x0011, 0x50, 0x0000}, + /* 0xF0 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x2, 0x0011, 0x50, 0x0000}, + /* 0xF1 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x2, 0x0011, 0x50, 0x0000}, + /* 0xF2 */ {"O_gD_bott", 0x0006, 0x000C,-0x0001, 0x0009, 0x000F, 0x0, 0x2, 0x0011, 0x50, 0x0000}, + /* 0xF3 */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0000}, + /* 0xF4 */ {"O_gD_pump", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0029, 0x64, 0x0000}, + /* 0xF5 */ {"O_gD_chee", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0015, 0x64, 0x0000}, + /* 0xF6 */ {"O_gD_bkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x003F, 0x64, 0x0000}, + /* 0xF7 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x003C, 0x64, 0x0000}, + /* 0xF8 */ {"T_gD_kt", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006C, 0x6E, 0x0000}, + /* 0xF9 */ {"D_MKey_01", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0043, 0x78, 0x0000}, + /* 0xFA */ {"D_MKey_02", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0045, 0x78, 0x0000}, + /* 0xFB */ {"D_MKey_03", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0046, 0x78, 0x0000}, + /* 0xFC */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0000}, + /* 0xFD */ {"O_gD_Mkey", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x0017, 0x78, 0x0000}, + /* 0xFE */ {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0000}, +}; + +dItem_fieldItemResource field_item_res_randomizer[] = { + /* 0x00 */ {"Always", 0x0014,-0x0001, 0x0030, 0xFF, 0x1000}, + /* 0x01 */ {"Always", 0x0017,-0x0001, 0x0031, 0x0, 0x1000}, + /* 0x02 */ {"Always", 0x0017,-0x0001, 0x0031, 0x1, 0x1000}, + /* 0x03 */ {"Always", 0x0017,-0x0001, 0x0031, 0x2, 0x1000}, + /* 0x04 */ {"Always", 0x0017,-0x0001, 0x0031, 0x3, 0x1000}, + /* 0x05 */ {"Always", 0x0017,-0x0001, 0x0031, 0x4, 0x1000}, + /* 0x06 */ {"Always", 0x0017,-0x0001, 0x0031, 0x5, 0x1000}, + /* 0x07 */ {"Always", 0x0017,-0x0001, 0x0031, 0x6, 0x1000}, + /* 0x08 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x09 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x0A */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x0B */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x0C */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x0D */ {"O_gD_bomb", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x0E */ {"Always", 0x0023,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x0F */ {"Always", 0x0023,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x10 */ {"Always", 0x0023,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x11 */ {"Always", 0x0022,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x12 */ {"Always", 0x0024,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x13 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x14 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x15 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x16 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x17 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x18 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x19 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x1A */ {"O_gD_BI", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x1B */ {"O_gD_BI", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x1C */ {"O_gD_BI", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x1D */ {"O_gD_BI", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x1E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x1F */ {"Always", 0x0014,-0x0001, 0x0030, 0xFF, 0x1000}, + /* 0x20 */ {"T_g_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x21 */ {"Always", 0x0015, 0x000D, 0x0033, 0xFF, 0x1000}, + /* 0x22 */ {"Always", 0x0016, 0x000E, 0x0034, 0xFF, 0x1000}, + /* 0x23 */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x24 */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x25 */ {"O_gD_TKS", 0x0008,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x26 */ {"T_g_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x27 */ {"O_gD_TKC", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x28 */ {"O_g_SWA", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x29 */ {"MstrSword", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x2A */ {"T_gD_SHB", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x2B */ {"O_gD_SHC", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x2C */ {"O_gD_SHA", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x2D */ {"O_gD_mem2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x2E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x2F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x30 */ {"O_gD_marm", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x31 */ {"O_gD_ZORA", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x32 */ {"O_gD_Injy", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x33 */ {"O_gD_TKS", 0x0008,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x34 */ {"O_gD_puL2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x35 */ {"O_gD_puL2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x36 */ {"O_gD_puL3", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x37 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x38 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x39 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x3A */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x3B */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x3C */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x3D */ {"O_gD_sang", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x3E */ {"O_gD_hawk", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x3F */ {"O_gD_SWB", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x40 */ {"O_gD_boom", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x41 */ {"O_gD_SP", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x42 */ {"O_gD_IB", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x43 */ {"O_gD_bow", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x44 */ {"O_gD_HS", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x45 */ {"O_gD_boot", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x46 */ {"O_gD_CROD", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x47 */ {"O_gD_HS", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x48 */ {"T_gD_kt", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x49 */ {"MstrSword", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x4A */ {"O_gD_uktr", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x4B */ {"O_gD_pach", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x4C */ {"O_gD_CROD", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x4D */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x4E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x4F */ {"O_gD_bmL2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x50 */ {"O_gD_bomc", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x51 */ {"O_gD_bomc", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x52 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x53 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x54 */ {"O_gD_quL1", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x55 */ {"O_gD_quL2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x56 */ {"O_gD_quL3", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x57 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x58 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x59 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x5A */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x5B */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x5C */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x5D */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x5E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x5F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x60 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x61 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x62 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x63 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x64 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x65 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x66 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x67 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x68 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x69 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x6A */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x6B */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x6C */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x6D */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x6E */ {"Obj_kntr", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x6F */ {"Obj_kntr", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x70 */ {"O_gD_bmL2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x71 */ {"O_gD_PG", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x72 */ {"O_gD_BI", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x73 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x74 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x75 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x76 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x77 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x78 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x79 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x7A */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x7B */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x7C */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x7D */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x7E */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x7F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x80 */ {"O_gD_lttr", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x81 */ {"O_gD_bill", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x82 */ {"O_wood", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x83 */ {"O_gD_pend", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x84 */ {"O_gD_pend", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x85 */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x86 */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x87 */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x88 */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x89 */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x8A */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x8B */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x8C */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x8D */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x8E */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x8F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x90 */ {"O_gD_mem2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x91 */ {"O_gD_mem2", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x92 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x93 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x94 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x95 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x96 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x97 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x98 */ {"T_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x99 */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x9A */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x9B */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x9C */ {"Obj_kntr", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x9D */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x9E */ {"O_gD_hk_s", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0x9F */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA0 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA1 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA2 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA3 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA4 */ {"N_gD_Lpod", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA5 */ {"MirrorB", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA6 */ {"MirrorB", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA7 */ {"MirrorB", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA8 */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xA9 */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xAA */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xAB */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xAC */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xAD */ {"T_gD_kmps", 0x0007,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xAE */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xAF */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB0 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB1 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB2 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB3 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB4 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB5 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB6 */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB7 */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB8 */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xB9 */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xBA */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xBB */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xBC */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xBD */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xBE */ {"T_gD_map", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xBF */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC0 */ {"O_gD_kabo", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC1 */ {"O_gD_kabm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC2 */ {"O_gD_choo", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC3 */ {"O_gD_chom", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC4 */ {"O_gD_kuwo", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC5 */ {"O_gD_kuwm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC6 */ {"O_gD_bato", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC7 */ {"O_gD_batm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC8 */ {"O_gD_nano", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xC9 */ {"O_gD_nanm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xCA */ {"O_gD_dano", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xCB */ {"O_gD_danm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xCC */ {"O_gD_kamo", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xCD */ {"O_gD_kamm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xCE */ {"O_gD_teno", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xCF */ {"O_gD_tenm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD0 */ {"O_gD_kato", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD1 */ {"O_gD_katm", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD2 */ {"O_gD_tono", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD3 */ {"O_gD_tonm", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD4 */ {"O_gD_ario", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD5 */ {"O_gD_arim", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD6 */ {"O_gD_kago", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD7 */ {"O_gD_kagm", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD8 */ {"N_gD_mskF", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xD9 */ {"N_gD_mskB", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xDA */ {"N_gD_mskT", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xDB */ {"MirrorB", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xDC */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xDD */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xDE */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xDF */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE0 */ {"O_gD_tama", 0x0005,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE1 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE2 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE3 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE4 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE5 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE6 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE7 */ {"O_gD_memo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE8 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xE9 */ {"O_gD_komo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xEA */ {"O_gD_komo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xEB */ {"O_gD_komo", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xEC */ {"O_gD_TKC", 0x0009,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xED */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xEE */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xEF */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF0 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF1 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF2 */ {"O_gD_bott", 0x0006,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF3 */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF4 */ {"O_gD_pump", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF5 */ {"O_gD_chee", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF6 */ {"O_gD_bkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF7 */ {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF8 */ {"T_gD_kt", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xF9 */ {"D_MKey_01", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xFA */ {"D_MKey_02", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xFB */ {"D_MKey_03", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xFC */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xFD */ {"O_gD_Mkey", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, + /* 0xFE */ {"T_gD_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, +}; + +dItem_itemInfo item_info_randomizer[] = { + {15, 40, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, + {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 40, 30, 4}, {20, 40, 30, 4}, + {40, 60, 30, 0}, {40, 60, 30, 0}, {40, 60, 30, 0}, {40, 60, 30, 0}, {20, 80, 50, 0}, + {20, 80, 50, 0}, {20, 80, 50, 0}, {20, 80, 50, 0}, {35, 70, 30, 0}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, + {0, 70, 30,4}, {0, 70, 30,4}, {150, 40, 30, 17}, {230, 100, 50, 21}, {230, 100, 50, 21}, + {0, 70, 30,64}, {0, 70, 30,68}, {0, 70, 30,0}, {150, 70, 30,85}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,4}, {150, 60, 60, 255}, {0, 70, 30,0}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,0}, + {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,0}, {20, 255, 255, 4}, + {0, 70, 30,64}, {0, 70, 30,4}, {0, 70, 30,64}, {0, 70, 30,64}, {0, 70, 30,64}, + {0, 70, 30,64}, {0, 70, 30,64}, {150, 50, 20, 21}, {0, 70, 30,4}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30, 0}, {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {30, 50, 40, 5}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,4}, + {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,4}, {0, 70, 30,0}, {0, 70, 30,4}, + {0, 70, 30,0}, {0, 70, 30,4}, {0, 70, 30,4}, {150, 50, 20, 21}, {0, 70, 30,0}, + {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, {0, 70, 30,0}, +}; + +static dItem_itemResource s_vanilla_item_resource[255]; +static dItem_fieldItemResource s_vanilla_field_item_res[255]; +static dItem_itemInfo s_vanilla_item_info[255]; +static bool s_applied = false; + +void apply_item_data_tables() { + if (s_applied) { + return; + } + std::memcpy(s_vanilla_item_resource, dItem_data::item_resource, sizeof(s_vanilla_item_resource)); + std::memcpy(s_vanilla_field_item_res, dItem_data::field_item_res, sizeof(s_vanilla_field_item_res)); + std::memcpy(s_vanilla_item_info, dItem_data::item_info, sizeof(s_vanilla_item_info)); + std::memcpy(dItem_data::item_resource, item_resource_randomizer, sizeof(item_resource_randomizer)); + std::memcpy(dItem_data::field_item_res, field_item_res_randomizer, sizeof(field_item_res_randomizer)); + std::memcpy(dItem_data::item_info, item_info_randomizer, sizeof(item_info_randomizer)); + s_applied = true; +} + +void restore_item_data_tables() { + if (!s_applied) { + return; + } + std::memcpy(dItem_data::item_resource, s_vanilla_item_resource, sizeof(s_vanilla_item_resource)); + std::memcpy(dItem_data::field_item_res, s_vanilla_field_item_res, sizeof(s_vanilla_field_item_res)); + std::memcpy(dItem_data::item_info, s_vanilla_item_info, sizeof(s_vanilla_item_info)); + s_applied = false; +} + +} // namespace randomizer::item \ No newline at end of file diff --git a/mods/randomizer/src/item.hpp b/mods/randomizer/src/item.hpp new file mode 100644 index 0000000000..99b6eece67 --- /dev/null +++ b/mods/randomizer/src/item.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include + +namespace randomizer::item { +void exec_item_get(u8 item_no); +int check_item_get(u8 item_no, int param); + +void apply_item_data_tables(); +void restore_item_data_tables(); +} // namespace randomizer::item diff --git a/mods/randomizer/src/mod.cpp b/mods/randomizer/src/mod.cpp index a770ccf44a..8a2eb32ccc 100644 --- a/mods/randomizer/src/mod.cpp +++ b/mods/randomizer/src/mod.cpp @@ -1,9 +1,10 @@ #include "mods/service.hpp" #include "mods/svc/log.h" +#include "hooks.hpp" +#include "item.hpp" #include "session.hpp" #include "ui/ui.hpp" -#include "hooks.hpp" DEFINE_MOD(); IMPORT_SERVICE(HostService, svc_host); @@ -14,6 +15,7 @@ IMPORT_SERVICE(ResourceService, svc_res); IMPORT_SERVICE(ConfigService, svc_config); IMPORT_SERVICE(SaveService, svc_save); IMPORT_SERVICE(StageService, svc_stage); +IMPORT_SERVICE(ItemService, svc_item); extern "C" { @@ -28,6 +30,7 @@ MOD_EXPORT ModResult mod_initialize(ModError* error) { svc_config, svc_save, svc_stage, + svc_item, }); if (result != MOD_OK) { return mods::set_error(error, result, "failed to initialize session"); @@ -54,6 +57,7 @@ MOD_EXPORT ModResult mod_update(ModError*) { MOD_EXPORT ModResult mod_shutdown(ModError*) { svc_log->info(mod_ctx, "randomizer unloaded"); + randomizer::item::restore_item_data_tables(); return MOD_OK; } } diff --git a/mods/randomizer/src/session.cpp b/mods/randomizer/src/session.cpp index 749fd32fad..c6691df8b1 100644 --- a/mods/randomizer/src/session.cpp +++ b/mods/randomizer/src/session.cpp @@ -7,6 +7,8 @@ #include "item_ids.h" #include "tools.h" #include "stages.h" +#include "item.hpp" +#include "verify_item_functions.h" #include "d/d_com_inf_game.h" #include "d/d_item.h" @@ -21,7 +23,118 @@ ModResult initialize(const ServiceManager& services) { return MOD_OK; } +ItemCheckHandle s_check_resolver{}; +ItemGiveHandle s_check_observer{}; + +struct DerivedKey { + int stage_id; + u16 key; +}; + +std::optional parse_derived(const char* name, std::string_view prefix) { + if (std::strncmp(name, prefix.data(), prefix.size()) != 0) { + return std::nullopt; + } + const char* stage_begin = name + prefix.size(); + const char* stage_end = std::strchr(stage_begin, ':'); + if (stage_end == nullptr) { + return std::nullopt; + } + const std::string stage{stage_begin, stage_end}; + const int stage_id = getStageID(stage.c_str()); + if (stage_id < 0) { + return std::nullopt; + } + const int n = std::atoi(stage_end + 1); + return DerivedKey{stage_id, static_cast((stage_id << 8) | (n & 0xFF))}; +} + +template +bool lookup_override(const Map& map, u16 key, uint8_t* out_item, bool progressive) { + const auto it = map.find(key); + if (it == map.end()) { + return false; + } + *out_item = progressive ? static_cast(verifyProgressiveItem(it->second)) : it->second; + return true; +} + +bool resolve_check(ModContext*, const ItemCheckInfo* info, uint8_t* out_item, void*) { + auto& ctx = randomizer_GetContext(); + + if (auto it = ctx.mItemLocations.find(info->name); it != ctx.mItemLocations.end()) { + *out_item = static_cast(it->second.itemId); + return true; + } + + if (auto key = parse_derived(info->name, "chest:")) { + return lookup_override(ctx.mTreasureChestOverrides, key->key, out_item, false); + } + if (auto key = parse_derived(info->name, "freestanding:")) { + if (key->stage_id == Ook) { + if (auto it = ctx.mItemLocations.find("Forest Temple Gale Boomerang"); + it != ctx.mItemLocations.end()) { + *out_item = static_cast(verifyProgressiveItem(it->second.itemId)); + return true; + } + return false; + } + return lookup_override(ctx.mFreestandingItemOverrides, key->key, out_item, true); + } + if (auto key = parse_derived(info->name, "poe:")) { + return lookup_override(ctx.mPoeOverrides, key->key, out_item, false); + } + if (auto key = parse_derived(info->name, "shop:")) { + return lookup_override(ctx.mShopOverrides, key->key, out_item, true); + } + if (auto key = parse_derived(info->name, "sky:")) { + return lookup_override(ctx.mSkyCharacterOverrides, key->key, out_item, true); + } + + if (std::strncmp(info->name, "bug:", 4) == 0) { + const u8 insect = static_cast(std::atoi(info->name + 4)); + if (auto it = ctx.mBugRewardOverrides.find(insect); it != ctx.mBugRewardOverrides.end()) { + *out_item = static_cast(verifyProgressiveItem(it->second)); + return true; + } + return false; + } + + return false; +} + +void observe_give(ModContext*, const ItemGiveInfo* info, void*) { + if (info->check_name == nullptr) { + return; + } + + auto& ctx = randomizer_GetContext(); + if (ctx.mItemLocations.contains(info->check_name)) { + randomizer_setTempFlagForLocation(info->check_name); + } + + if (std::strcmp(info->check_name, "Arbiters Grounds Dungeon Reward") == 0) { + dComIfGs_onItem(0x9E, -1); + } else if (auto key = parse_derived(info->check_name, "freestanding:"); + key && key->stage_id == Ook) + { + dComIfGs_onItem(0x9D, -1); + randomizer_setTempFlagForLocation("Forest Temple Gale Boomerang"); + } +} + +void activateSeed() { + auto& ctx = randomizer_GetContext(); + + item::apply_item_data_tables(); + + svc_mng.item->set_check_resolver(mod_ctx, nullptr, resolve_check, nullptr, &s_check_resolver); + svc_mng.item->observe_gives(mod_ctx, observe_give, nullptr, &s_check_observer); +} + void setupRandomizerFile() { + activateSeed(); + // Setup file based on randomizer data auto& randoData = randomizer_GetContext(); randoData.mCreatingSave = true; @@ -46,22 +159,22 @@ void setupRandomizerFile() { { dComIfGs_onDarkClearLV(0); dComIfGs_setLightDropNum(0, 0x10); - execItemGet(dItemNo_Randomizer_DROP_CONTAINER_e); - execItemGet(dItemNo_Randomizer_WEAR_KOKIRI_e); + item::exec_item_get(dItemNo_Randomizer_DROP_CONTAINER_e); + item::exec_item_get(dItemNo_Randomizer_WEAR_KOKIRI_e); } if (dComIfGs_isEventBit(CLEARED_ELDIN_TWILIGHT)) { dComIfGs_onDarkClearLV(1); dComIfGs_setLightDropNum(1, 0x10); - execItemGet(dItemNo_Randomizer_DROP_CONTAINER02_e); + item::exec_item_get(dItemNo_Randomizer_DROP_CONTAINER02_e); } if (dComIfGs_isEventBit(CLEARED_LANAYRU_TWILIGHT)) { dComIfGs_onDarkClearLV(2); dComIfGs_setLightDropNum(2, 0x10); - execItemGet(dItemNo_Randomizer_DROP_CONTAINER03_e); + item::exec_item_get(dItemNo_Randomizer_DROP_CONTAINER03_e); } if (randoData.mSettings[RandomizerContext::SKIP_MINOR_CUTSCENES] == RandomizerContext::ON) @@ -90,7 +203,7 @@ void setupRandomizerFile() { // Set starting inventory for (const auto& itemId: randoData.mStartingInventory) { - execItemGet(itemId); + item::exec_item_get(itemId); } g_randomizerState = RandomizerState(); diff --git a/mods/randomizer/src/session.hpp b/mods/randomizer/src/session.hpp index e033ebb961..3c58f15b26 100644 --- a/mods/randomizer/src/session.hpp +++ b/mods/randomizer/src/session.hpp @@ -8,6 +8,7 @@ #include "mods/svc/resource.h" #include "mods/svc/save.h" #include "mods/svc/stage.h" +#include "mods/svc/item.h" namespace randomizer::session { struct ServiceManager { @@ -20,6 +21,7 @@ struct ServiceManager { const ConfigService* config; const SaveService* save; const StageService* stage; + const ItemService* item; }; extern ServiceManager svc_mng; diff --git a/src/d/d_item.cpp b/src/d/d_item.cpp index 5484bd584a..b50ceb40c2 100644 --- a/src/d/d_item.cpp +++ b/src/d/d_item.cpp @@ -269,7 +269,10 @@ static void (*item_func_ptr[256])() = { item_func_noentry, }; -inline void getItemFunc(u8 i_itemNo) { +#if !TARGET_PC +inline +#endif +void getItemFunc(u8 i_itemNo) { dComIfGs_onItemFirstBit(i_itemNo); item_func_ptr[i_itemNo](); }