summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdflyer <jdflyer10@gmail.com>2021-09-01 21:11:23 -0700
committerjdflyer <jdflyer10@gmail.com>2021-09-01 21:11:23 -0700
commit8ccf52ea13eaaffea90b5ddb835f3a040ef62b74 (patch)
tree837fd74f5eee93432e424f60684fdc0e9aed99bd
parentc0c8644344ade28dfdad0f4340ad459b38e3e9c2 (diff)
Clang Format All
-rw-r--r--include/HUDConsole.h170
-rw-r--r--include/array.h26
-rw-r--r--include/chestRando.h284
-rw-r--r--include/controller.h58
-rw-r--r--include/customChecks.h652
-rw-r--r--include/defines.h14
-rw-r--r--include/eventListener.h113
-rw-r--r--include/game_patches.h415
-rw-r--r--include/gc/OSCache.h46
-rw-r--r--include/gc/OSModule.h26
-rw-r--r--include/global.h2
-rw-r--r--include/grottoChecks.h44
-rw-r--r--include/item.h151
-rw-r--r--include/itemChecks.h6
-rw-r--r--include/items.h518
-rw-r--r--include/keyPlacement.h100
-rw-r--r--include/memory.h12
-rw-r--r--include/mod.h551
-rw-r--r--include/musicRando.h5
-rw-r--r--include/patch.h36
-rw-r--r--include/singleton.h92
-rw-r--r--include/stage.h20
-rw-r--r--include/systemConsole.h12
-rw-r--r--include/tools.h127
-rw-r--r--include/tp/DynamicLink.h32
-rw-r--r--include/tp/JFWSystem.h44
-rw-r--r--include/tp/JKRExpHeap.h12
-rw-r--r--include/tp/Z2SceneMgr.h20
-rw-r--r--include/tp/Z2SeqMgr.h12
-rw-r--r--include/tp/d_a_alink.h91
-rw-r--r--include/tp/d_a_shop_item_static.h110
-rw-r--r--include/tp/d_com_inf_game.h1802
-rw-r--r--include/tp/d_item.h14
-rw-r--r--include/tp/d_item_data.h94
-rw-r--r--include/tp/d_kankyo.h26
-rw-r--r--include/tp/d_map_path_dmap.h12
-rw-r--r--include/tp/d_menu_collect.h10
-rw-r--r--include/tp/d_meter2_info.h13
-rw-r--r--include/tp/d_msg_flow.h10
-rw-r--r--include/tp/d_save.h17
-rw-r--r--include/tp/d_stage.h54
-rw-r--r--include/tp/dzx.h90
-rw-r--r--include/tp/evt_control.h14
-rw-r--r--include/tp/f_ap_game.h10
-rw-r--r--include/tp/f_op_actor_mng.h64
-rw-r--r--include/tp/f_op_scene_req.h12
-rw-r--r--include/tp/m_Do_controller_pad.h28
-rw-r--r--include/tp/m_Do_ext.h10
-rw-r--r--include/tp/resource.h10
-rw-r--r--source/HUDConsole.cpp520
-rw-r--r--source/array.cpp27
-rw-r--r--source/chestRando.cpp4677
-rw-r--r--source/controller.cpp37
-rw-r--r--source/cxx.cpp34
-rw-r--r--source/eventListener.cpp128
-rw-r--r--source/game_patches.cpp2422
-rw-r--r--source/grottoChecks.cpp145
-rw-r--r--source/item.cpp235
-rw-r--r--source/itemChecks.cpp7255
-rw-r--r--source/keyPlacement.cpp1059
-rw-r--r--source/memory.cpp20
-rw-r--r--source/mod.cpp1605
-rw-r--r--source/musicRando.cpp287
-rw-r--r--source/patch.cpp39
-rw-r--r--source/rel.cpp47
-rw-r--r--source/singleton.cpp93
-rw-r--r--source/stage.cpp263
-rw-r--r--source/systemConsole.cpp33
-rw-r--r--source/tools.cpp220
69 files changed, 15962 insertions, 9275 deletions
diff --git a/include/HUDConsole.h b/include/HUDConsole.h
index ff5e361..a14ed66 100644
--- a/include/HUDConsole.h
+++ b/include/HUDConsole.h
@@ -6,100 +6,100 @@
namespace mod
{
- struct Option
- {
- char Title[16];
- u8* Target;
- u32 Limit;
- };
+ struct Option
+ {
+ char Title[16];
+ u8* Target;
+ u32 Limit;
+ };
- struct Watch
- {
- char Title[16];
- void* Target;
- char Format;
- u8 Interpretation;
- };
+ struct Watch
+ {
+ char Title[16];
+ void* Target;
+ char Format;
+ u8 Interpretation;
+ };
- enum WatchInterpretation : u8
- {
- _u8 = 0,
- _u16 = 1,
- _u32 = 2,
- _u64 = 3,
- _s8 = 4,
- _s16 = 5,
- _s32 = 6,
- _s64 = 7,
- _str = 8
- };
+ enum WatchInterpretation : u8
+ {
+ _u8 = 0,
+ _u16 = 1,
+ _u32 = 2,
+ _u64 = 3,
+ _s8 = 4,
+ _s16 = 5,
+ _s32 = 6,
+ _s64 = 7,
+ _str = 8
+ };
- enum ConsoleActions : u8
- {
- Move_Up = 0,
- Move_Down = 1,
- Move_Left = 2,
- Move_Right = 3,
- Option_Increase = 4,
- Option_Decrease = 5
- };
+ enum ConsoleActions : u8
+ {
+ Move_Up = 0,
+ Move_Down = 1,
+ Move_Left = 2,
+ Move_Right = 3,
+ Option_Increase = 4,
+ Option_Decrease = 5
+ };
- class HUDConsole
- {
- public:
- HUDConsole(const char firstPage[16], u32 RGBA = 0x000000FF);
+ class HUDConsole
+ {
+ public:
+ HUDConsole( const char firstPage[16], u32 RGBA = 0x000000FF );
- /**
- * Adds an option to the Console
- *
- * @param page Page index where the option should appear
- * @param title Short description (limit 16)
- * @param target The target value that can be set via the menu
- * @param limit When target >= limit it will reset to 0
- */
- void addOption(u8 page, const char title[16], u8* target, u32 limit);
+ /**
+ * Adds an option to the Console
+ *
+ * @param page Page index where the option should appear
+ * @param title Short description (limit 16)
+ * @param target The target value that can be set via the menu
+ * @param limit When target >= limit it will reset to 0
+ */
+ void addOption( u8 page, const char title[16], u8* target, u32 limit );
- /**
- * Adds a watch to the console
- *
- * @param page Page index where the watch should appear
- * @param title Short description (limit 16)
- * @param target Target value to be represented
- * @param format Formatting char (s, d, u, x, ...)
- * @param interpretation How to read from the target* (mod::WatchInterpretation)
- */
- void addWatch(u8 page, const char title[16], void* target, char format, u8 interpretation);
+ /**
+ * Adds a watch to the console
+ *
+ * @param page Page index where the watch should appear
+ * @param title Short description (limit 16)
+ * @param target Target value to be represented
+ * @param format Formatting char (s, d, u, x, ...)
+ * @param interpretation How to read from the target* (mod::WatchInterpretation)
+ */
+ void addWatch( u8 page, const char title[16], void* target, char format, u8 interpretation );
- /**
- * Adds a page to the Console (pages can be switched with R/L)
- *
- * @param title The name to appear when this page is opened
- * @returns The index of the new page if successful otherwise -1
- */
- s8 addPage(const char title[16]);
+ /**
+ * Adds a page to the Console (pages can be switched with R/L)
+ *
+ * @param title The name to appear when this page is opened
+ * @returns The index of the new page if successful otherwise -1
+ */
+ s8 addPage( const char title[16] );
- /**
- * Performs an action
- *
- * @param consoleAction A valid mod::ConsoleAction that's going to be performed
- */
- void performAction(u8 consoleAction, u8 amount = 1);
+ /**
+ * Performs an action
+ *
+ * @param consoleAction A valid mod::ConsoleAction that's going to be performed
+ */
+ void performAction( u8 consoleAction, u8 amount = 1 );
- /**
- * Draws the current page and it's options
- */
- void draw();
+ /**
+ * Draws the current page and it's options
+ */
+ void draw();
- private:
- u8 selectedOption; // Y Position
- u8 selectedPage; // X Position
+ private:
+ u8 selectedOption; // Y Position
+ u8 selectedPage; // X Position
- u8 numOptions[MAX_HUDCONSOLE_PAGES];
- u8 numWatches[MAX_HUDCONSOLE_PAGES];
- u8 numPages;
+ u8 numOptions[MAX_HUDCONSOLE_PAGES];
+ u8 numWatches[MAX_HUDCONSOLE_PAGES];
+ u8 numPages;
- char pages[MAX_HUDCONSOLE_PAGES][16];
- Option options[MAX_HUDCONSOLE_PAGES][10];
- Watch watches[MAX_HUDCONSOLE_PAGES][10];
- };
-} \ No newline at end of file
+ char pages[MAX_HUDCONSOLE_PAGES][16];
+ Option options[MAX_HUDCONSOLE_PAGES][10];
+ Watch watches[MAX_HUDCONSOLE_PAGES][10];
+ };
+} // namespace mod \ No newline at end of file
diff --git a/include/array.h b/include/array.h
index 37cb27c..2f99cc2 100644
--- a/include/array.h
+++ b/include/array.h
@@ -4,16 +4,16 @@
namespace mod::array
{
- extern "C"
- {
- /**
- * Checks whether an array contains a value and returns it's index
- *
- * @param needle The value to be searched for
- * @param haystack Pointer to the array
- * @param count Number of elements within the array
- * @returns If successful the index of needle inside the array, otherwise -1
- */
- s32 indexOf(u16 needle, u16* haystack, size_t count);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ /**
+ * Checks whether an array contains a value and returns it's index
+ *
+ * @param needle The value to be searched for
+ * @param haystack Pointer to the array
+ * @param count Number of elements within the array
+ * @returns If successful the index of needle inside the array, otherwise -1
+ */
+ s32 indexOf( u16 needle, u16* haystack, size_t count );
+ }
+} // namespace mod::array \ No newline at end of file
diff --git a/include/chestRando.h b/include/chestRando.h
index a030d77..7d8c91c 100644
--- a/include/chestRando.h
+++ b/include/chestRando.h
@@ -1,148 +1,148 @@
#pragma once
+#include <tp/d_com_inf_game.h>
+
#include "defines.h"
#include "item.h"
-#include <tp/d_com_inf_game.h>
namespace mod
-{
- class ChestRandomizer
- {
- private:
- u8* itemOrder = nullptr; // Used for checksum
- u8 itemOrderIndex;
-
- public:
- // Conditions used by the generator to determine wether a check is already reachable
- u32 currentPlayerConditions;
-
- // Layer 0 conditions, basically
- u32 startConditions = 0b100000000000000100010; // AND, small key, master sword (<-locked anyway)
-
- // Debug values
- char lastSourceInfo[50];
- char lastDestInfo[50];
-
- u64 currentSeed;
- u16 checkSum;
-
- u16 totalChecks;
- u16 layerCheckCount;
- u16 empty;
- float rangeX = 400.0f;
- float rangeY = 200.0f;
- float rangeZ = 400.0f;
-
- u8 isProgressiveEnabled = 1;
- u8 isBugsanityEnabled = 1;
- u8 isPoesanityEnabled = 1;
- u8 isShopsanityEnabled = 1;
- u8 areDungeonItemsRandomized = 1;
- u8 isTwilightSkipEnabled = 1;
- u8 isKeysanityEnabled = 1;
- u8 areHeartPiecesRandomized = 1;
- u8 areRupeesRandomized = 1;
- u8 areAmmoRandomized = 1;
-
- u8 itemThatReplacesHalfMilk = 0;
- u8 itemThatReplacesSlingShot = 0;
-
- tp::d_com_inf_game::ItemSlots* itemWheel;
-
- public:
- /**
- * Generates a new set of chest replacements based
- * on current RAND_SEED
- */
- void generate();
-
- /**
- * Returns the item replacement if found, otherwise
- * the item that's passed via argument
- *
- * @param pos The cXyz of the chest
- * @param item Internal Item ID of the item
- */
- s32 getItemReplacement(const float pos[3], s32 item);
-
-
- /**
- * Checks if the stage given is a boss room
- * to know if we can spawn a HC
- *
- * excludes hyrule castle since boss doesn't spawn heart container
- */
- bool isStageBoss();
-
- /**
- * checks if the stage is one of the 5 grotto stages
- */
-
- bool isStageDungeon();
-
- bool isStageGrotto();
-
- bool isStageInterior();
-
- bool isStageCave();
-
- bool isStageSpecial();
-
- bool isStageTOD();
-
-
- private:
- /**
- * Finds a random source within a specified layer range
- */
- item::ItemCheck* findSource(u8 maxLayer, u8 minLayer = 0, item::ItemCheck* destCheck = nullptr);
-
- /**
- * Places dest into source and sets the flags necessary
- */
- void placeCheck(item::ItemCheck* sourceCheck, item::ItemCheck* destCheck);
-
- /**
- * Checks if the player with their current conditions can access the chest
- */
- bool checkCondition(item::ItemCheck* sourceCheck, item::ItemCheck* destCheck);
-
- /**
- * Checks if the item should be locked in place
- */
- bool isLocked(item::ItemCheck* check);
-
- /**
- * Checks if the stage given is a dungeon
- * to prevent heart containers to spawn there so boss heart containers can spawn (doesn't fix it entirely based on Zephiles)
- *
- *includes miniboss rooms but not boss rooms
- *excludes hyrule castle since boss doesn't spawn heart container
- */
- bool isStageADungeon(char* stage);
-
- /**
- * checks if item given is a type of bombs
- * to prevent problems with the game changing bomb type based on type of bombs in inventory
- *
- * excludes bomb bag+bombs
- */
- bool isItemBombs(u8 itemID);
-
- /**
- * checks if item given is a bottle content without a bottle
- */
- bool isItemBottleFill(u8 itemID);
-
- /**
- *
- * places the key checks correctly
- */
- void handleKeysanity();
-
- /**
- * check if the check gotten in a grotto is the right one
- */
- bool isGrottoCheckOk(u16 checkID);
- };
-} \ No newline at end of file
+{
+ class ChestRandomizer
+ {
+ private:
+ u8* itemOrder = nullptr; // Used for checksum
+ u8 itemOrderIndex;
+
+ public:
+ // Conditions used by the generator to determine wether a check is already reachable
+ u32 currentPlayerConditions;
+
+ // Layer 0 conditions, basically
+ u32 startConditions = 0b100000000000000100010; // AND, small key, master sword (<-locked anyway)
+
+ // Debug values
+ char lastSourceInfo[50];
+ char lastDestInfo[50];
+
+ u64 currentSeed;
+ u16 checkSum;
+
+ u16 totalChecks;
+ u16 layerCheckCount;
+ u16 empty;
+ float rangeX = 400.0f;
+ float rangeY = 200.0f;
+ float rangeZ = 400.0f;
+
+ u8 isProgressiveEnabled = 1;
+ u8 isBugsanityEnabled = 1;
+ u8 isPoesanityEnabled = 1;
+ u8 isShopsanityEnabled = 1;
+ u8 areDungeonItemsRandomized = 1;
+ u8 isTwilightSkipEnabled = 1;
+ u8 isKeysanityEnabled = 1;
+ u8 areHeartPiecesRandomized = 1;
+ u8 areRupeesRandomized = 1;
+ u8 areAmmoRandomized = 1;
+
+ u8 itemThatReplacesHalfMilk = 0;
+ u8 itemThatReplacesSlingShot = 0;
+
+ tp::d_com_inf_game::ItemSlots* itemWheel;
+
+ public:
+ /**
+ * Generates a new set of chest replacements based
+ * on current RAND_SEED
+ */
+ void generate();
+
+ /**
+ * Returns the item replacement if found, otherwise
+ * the item that's passed via argument
+ *
+ * @param pos The cXyz of the chest
+ * @param item Internal Item ID of the item
+ */
+ s32 getItemReplacement( const float pos[3], s32 item );
+
+ /**
+ * Checks if the stage given is a boss room
+ * to know if we can spawn a HC
+ *
+ * excludes hyrule castle since boss doesn't spawn heart container
+ */
+ bool isStageBoss();
+
+ /**
+ * checks if the stage is one of the 5 grotto stages
+ */
+
+ bool isStageDungeon();
+
+ bool isStageGrotto();
+
+ bool isStageInterior();
+
+ bool isStageCave();
+
+ bool isStageSpecial();
+
+ bool isStageTOD();
+
+ private:
+ /**
+ * Finds a random source within a specified layer range
+ */
+ item::ItemCheck* findSource( u8 maxLayer, u8 minLayer = 0, item::ItemCheck* destCheck = nullptr );
+
+ /**
+ * Places dest into source and sets the flags necessary
+ */
+ void placeCheck( item::ItemCheck* sourceCheck, item::ItemCheck* destCheck );
+
+ /**
+ * Checks if the player with their current conditions can access the chest
+ */
+ bool checkCondition( item::ItemCheck* sourceCheck, item::ItemCheck* destCheck );
+
+ /**
+ * Checks if the item should be locked in place
+ */
+ bool isLocked( item::ItemCheck* check );
+
+ /**
+ * Checks if the stage given is a dungeon
+ * to prevent heart containers to spawn there so boss heart containers can spawn (doesn't fix it entirely based on
+ *Zephiles)
+ *
+ *includes miniboss rooms but not boss rooms
+ *excludes hyrule castle since boss doesn't spawn heart container
+ */
+ bool isStageADungeon( char* stage );
+
+ /**
+ * checks if item given is a type of bombs
+ * to prevent problems with the game changing bomb type based on type of bombs in inventory
+ *
+ * excludes bomb bag+bombs
+ */
+ bool isItemBombs( u8 itemID );
+
+ /**
+ * checks if item given is a bottle content without a bottle
+ */
+ bool isItemBottleFill( u8 itemID );
+
+ /**
+ *
+ * places the key checks correctly
+ */
+ void handleKeysanity();
+
+ /**
+ * check if the check gotten in a grotto is the right one
+ */
+ bool isGrottoCheckOk( u16 checkID );
+ };
+} // namespace mod \ No newline at end of file
diff --git a/include/controller.h b/include/controller.h
index 5fc660c..eb0ef4b 100644
--- a/include/controller.h
+++ b/include/controller.h
@@ -4,33 +4,33 @@
namespace mod::controller
{
- enum PadInputs : u32
- {
- Button_DPad_Left = 0x00000001,
- Button_DPad_Right = 0x00000002,
- Button_DPad_Down = 0x00000004,
- Button_DPad_Up = 0x00000008,
- Button_Z = 0x00000010,
- Button_R = 0x00000020,
- Button_L = 0x00000040,
- Button_A = 0x00000100,
- Button_B = 0x00000200,
- Button_X = 0x00000400,
- Button_Y = 0x00000800,
- Button_Start = 0x00001000,
- Stick_C_Left = 0x00010000,
- Stick_C_Right = 0x00020000,
- Stick_C_Down = 0x00040000,
- Stick_C_Up = 0x00080000,
- Stick_Left = 0x01000000,
- Stick_Right = 0x02000000,
- Stick_Down = 0x04000000,
- Stick_Up = 0x08000000
- };
+ enum PadInputs : u32
+ {
+ Button_DPad_Left = 0x00000001,
+ Button_DPad_Right = 0x00000002,
+ Button_DPad_Down = 0x00000004,
+ Button_DPad_Up = 0x00000008,
+ Button_Z = 0x00000010,
+ Button_R = 0x00000020,
+ Button_L = 0x00000040,
+ Button_A = 0x00000100,
+ Button_B = 0x00000200,
+ Button_X = 0x00000400,
+ Button_Y = 0x00000800,
+ Button_Start = 0x00001000,
+ Stick_C_Left = 0x00010000,
+ Stick_C_Right = 0x00020000,
+ Stick_C_Down = 0x00040000,
+ Stick_C_Up = 0x00080000,
+ Stick_Left = 0x01000000,
+ Stick_Right = 0x02000000,
+ Stick_Down = 0x04000000,
+ Stick_Up = 0x08000000
+ };
- extern "C"
- {
- bool checkForButtonInput(u32 buttonCombo);
- bool checkForButtonInputSingleFrame(u32 buttonCombo);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ bool checkForButtonInput( u32 buttonCombo );
+ bool checkForButtonInputSingleFrame( u32 buttonCombo );
+ }
+} // namespace mod::controller \ No newline at end of file
diff --git a/include/customChecks.h b/include/customChecks.h
index feee56a..34f3e23 100644
--- a/include/customChecks.h
+++ b/include/customChecks.h
@@ -1,106 +1,580 @@
#pragma once
+#include <tp/d_com_inf_game.h>
+#include <tp/dzx.h>
+
#include "defines.h"
#include "tools.h"
-#include <tp/dzx.h>
-#include <tp/d_com_inf_game.h>
-
struct customCheck
{
- char stage[8];
- u8 room;
+ char stage[8];
+ u8 room;
- u8 chestType;
+ u8 chestType;
- u8 saveFlag;
- u8 itemID;
+ u8 saveFlag;
+ u8 itemID;
- u32 X;
- u32 Y;
- u32 Z;
+ u32 X;
+ u32 Y;
+ u32 Z;
- s32 Angle;
+ s32 Angle;
- void(*overrides)();
+ void ( *overrides )();
- bool(*requirement)();
+ bool ( *requirement )();
};
namespace mod
{
- customCheck customChecks[37] = {
- /*Ordon Shield*/
- {"F_SP103", 0, 0, 0x74, 0x2A, 0x456C12A0, 0x43390000, 0x44405C5E, 0x5FA0, []() { gameInfo.localAreaNodes.unk_0[0x8] |= 0x4;/*remove ordon shield*/ }, []() { return (gameInfo.scratchPad.eventBits[0x5] & 0x7A) != 0;/*have sewers been done*/ } },
- /*Ordon Sword*/
- {"R_SP01", 4, 0, 0x70, 0x28, 0x439D0602, 0x0, 0xC26ABE99, 0xCC7D, []() { gameInfo.localAreaNodes.unk_0[0x8] |= 0x1;/*got ordon sword*/ gameInfo.localAreaNodes.unk_0[0x1B] |= 0x8;/*remove ordon sword*/ }, []() { return (gameInfo.scratchPad.eventBits[0x5] & 0x7A) != 0;/*have sewers been done*/ } },
- /*Fishing rod*/
- {"F_SP103", 0, 1, 0x68, 0x4A, 0xC3FEB5F1, 0x42960000, 0x4514FB40, 0x883A, []() { gameInfo.scratchPad.eventBits[0x3] |= 0x5;/*brought Cradle to Uli and got fishing rod*/ gameInfo.scratchPad.eventBits[0x46] |= 0x1;/*took cradle from monkey*/ }, []() { return (gameInfo.localAreaNodes.unk_0[0xC] & 0x2) != 0;/*is goats 1 done*/ } },
- /*Sera Bottle*/
- {"F_SP103", 0, 1, 0x7C, 0x65, 0x444C8DC3, 0x42AF0000, 0xC4CB2577, 0xA3E7, []() { gameInfo.scratchPad.eventBits[0x12] |= 0x8;/*can shop at Sera's shop*/ gameInfo.scratchPad.eventBits[0x14] |= 0x8;/*Sera Bottle gotten*/ }, []() { return (gameInfo.localAreaNodes.unk_0[0xC] & 0x2) != 0;/*is goats 1 done*/ } },
- /*Slingshot*/
- {"F_SP103", 0, 0, 0x78, 0x4B, 0xC3EDF8A9, 0x44CD922E, 0x45F31BF5, 0x7881, nullptr /*Flag is set in game_patches to avoid interaction with vanilla check*/, []() { return (gameInfo.localAreaNodes.unk_0[0xC] & 0x2) != 0;/*is goats 1 done*/ } },
- /*Lantern*/
- {"F_SP108", 0xFF, 1, 0xF8, 0x48, 0xC66D4C1B, 0x41C19A25, 0xC65D2696, 0x36EC, nullptr, []() { return true; } },
- /*Zora Armor*/
- {"F_SP111", 0, 1, 0x7C, 0x31, 0x46A85A96, 0x43FA0000, 0x43944190, 0xC270, []() { gameInfo.scratchPad.eventBits[0x8] |= 0x4;/*got zora armor from Rutela*/ }, []() { return true; } },
- /*Coral Earring*/
- {"F_SP111", 0, 1, 0x78, 0x3D, 0x46A81087, 0x43FA57D9, 0xC3BCEFAC, 0xC270, []() { gameInfo.scratchPad.eventBits[0x3B] |= 0x80;/*Got Coral Earring from Ralis*/ }, []() { return tools::checkItemFlag(ItemFlags::Asheis_Sketch); } },
- /*Auru's Memo*/
- {"F_SP115", 0, 1, 0x7C, 0x90, 0xC7E2E398, 0xC6770800, 0x47656746, 0x143D, []() { gameInfo.scratchPad.eventBits[0x25] |= 0x30;/*Auru Cutscene Complete + Auru's Memo gotten*/ }, []() { return gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten == 0b1; } },
- /*Ashei's Sketch*/
- {"F_SP114", 0, 1, 0x7C, 0x91, 0x46F71891, 0xC6502A32, 0xC6348FA6, 0x86E6, []() { gameInfo.scratchPad.eventBits[0x29] |= 0x40;/*Got Ashei's Sketch from Ashei*/ }, []() { return true; } },
- /*Renardo's Letter*/
- {"R_SP109", 0, 1, 0x68, 0x80, 0x43D3A702, 0x0, 0x43D5A60B, 0xC1FD, []() { gameInfo.scratchPad.eventBits[0xF] |= 0x80;/*Got Renardo's Letter from Renardo*/ }, []() { return gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten == 0b1; } },
- /*Invoice*/
- {"R_SP116", 5, 1, 0x70, 0x81, 0x45282E22, 0xC48FC000, 0x453BED7D, 0x0000, []() { gameInfo.scratchPad.eventBits[0x21] |= 0x80;/*Got Invoice from Telma*/ }, []() { return tools::checkItemFlag(ItemFlags::Renardos_Letter); } },
- /*Wooden Statue*/
- {"F_SP122", 16, 1, 0x68, 0x82, 0xC7493734, 0xC5C3E9D7, 0x46F956C6, 0x7FE1, []() { gameInfo.scratchPad.eventBits[0x22] |= 0x80;/*Got Wooden Statue from wolves*/ }, []() { return tools::checkItemFlag(ItemFlags::Medicine_Scent); } },
- /*Ilia's Charm*/
- {"F_SP128", 0, 1, 0x64, 0x83, 0x44F7650C, 0x42D20705, 0xC4A1A68B, 0x4226, nullptr /*Flag is set in game_patches to avoid interaction with vanilla check*/, []() { return true; } },
- /*Horse Call*/
- {"R_SP109", 0, 1, 0x74, 0x84, 0x43CDBCA1, 0x0, 0xC31EEBF3, 0xBDBE, []() { gameInfo.scratchPad.eventBits[0x23] |= 0x20;/*Got horse call from Illia*/ }, []() { return tools::checkItemFlag(ItemFlags::Ilias_Charm); } },
- /*Fishing Hole Bottle*/
- {"F_SP127", 0, 1, 0x7C, 0x60, 0x45B27147, 0x420C0000, 0x450F716A, 0x62E5, []() { gameInfo.scratchPad.eventBits[0x39] |= 0x8;/*Got fishing hole bottle*/ }, []() { return true; } },
- /*Coro Key*/
- {"F_SP108", 0xFF, 0, 0xF4, 0xFE, 0xC64BA600, 0x403DA884, 0xC663BC8E, 0x7A11, [](){ gameInfo.scratchPad.eventBits[0x1A] |= 0x10;/*Talked to Coro after Faron Twilight*/ gameInfo.localAreaNodes.unk_0[0xD] |= 0x4;/*got Coro key*/ }, [](){ return gameInfo.scratchPad.clearedTwilights.Faron == 0b1; } },
- /*Gate Keys*/
- {"F_SP121", 0xFF, 1, 0x7C, 0xF3, 0xC781DFDB, 0xC607B38E, 0x47897B50, 0xC0C9, nullptr, []() { return (gameInfo.scratchPad.eventBits[0x8] & 0x40) != 0;/*was escort started*/ } },
- /*Camp Key*/
- {"F_SP118", 1, 0, 0x7C, 0x20, 0x457F816B, 0x43820000, 0xC572F680, 0x0000, []() { gameInfo.localAreaNodes.unk_0[0x4] |= 0x80;/*get camp key*/ }, []() { return true; } },
- /*Jovani Poe*/
- {"R_SP160", 5, 0, 0x7C, 0xE0, 0x45906531, 0xC2960000, 0x45229AEB, 0xC3C9, []() { gameInfo.localAreaNodes.unk_0[0x8] |= 0x80;/*killed poe*/ gameInfo.localAreaNodes.unk_0[0xF] |= 0x7;/*cs + open path to sewers*/ gameInfo.localAreaNodes.unk_0[0x17] |= 0x8; /*Gengle Free*/}, []() { return true; } },
- /*Shadow Crystal*/
- {"F_SP117", 1, 0, 0x7C, 0x32, 0xC36EB7DC, 0x44CB2000, 0xC5964574, 0x0000, []() { gameInfo.scratchPad.eventBits[0x10] |= 0x20;/*got master sword cs*/ }, []() { return true; } },
- /*Master Sword*/
- {"F_SP117", 1, 2, 0x78, 0x29, 0x4372ACFB, 0x44CB2000, 0xC5991A55, 0x0000, []() { gameInfo.scratchPad.eventBits[0x10] |= 0x20;/*got master sword cs*/ }, []() { return true; } },
- /*Powered Dominion Rod*/
- {"R_SP209", 7, 1, 0x70, 0x4C, 0xC3DB30E9, 0xC4408000, 0xC523C471, 0x3CF0, nullptr, []() { return tools::checkItemFlag(ItemFlags::Ancient_Sky_Book_empty); } },
- /*Light Master Sword*/
- {"F_SP125", 4, 1, 0x74, 0x49, 0x44E0DBF7, 0x45898B09, 0xC6A4AAFA, 0x7DBC, nullptr, []() { return ((gameInfo.scratchPad.eventBits[0x26] & 0x40) != 0) && (gameInfo.scratchPad.eventBits[0x26] & 0x20) != 0;/*both sols outside of Palace*/ } },
- /*Ending Blow*/
- {"F_SP108", 6, 2, 0xF0, 0xE1, 0xC71A5B41, 0x44898000, 0xC6E08544, 0x0000, nullptr, []() { return gameInfo.scratchPad.clearedTwilights.Faron == 0b1; } },
- /*Shield Bash*/
- {"F_SP104", 1, 2, 0x6C, 0xE2, 0xC4BB1F1C, 0x438C0000, 0xC613CAAA, 0x4138, []() { gameInfo.scratchPad.eventBits[0x3C] |= 0x8;/*Got skill from Ordon Wolf*/ }, []() { return (gameInfo.scratchPad.eventBits[0x3A] & 0x80) != 0;/*DMT howling stone done*/ } },
- /*Back Slice*/
- {"F_SP122", 8, 2, 0x78, 0xE3, 0xC78590C8, 0xC4834000, 0x45B7BC37, 0xC15B, []() { gameInfo.scratchPad.eventBits[0x3C] |= 0x4;/*Got skill from West CT Wolf*/ }, []() { return (gameInfo.scratchPad.eventBits[0x3A] & 0x40) != 0;/*UZR howling stone done*/ } },
- /*Helm Splitter*/
- {"F_SP122", 16, 2, 0x74, 0xE4, 0xC75990D6, 0xC5BEA000, 0x46C3B269, 0x0000, []() { gameInfo.scratchPad.eventBits[0x3C] |= 0x2;/*Got skill from South CT Wolf*/ }, []() { return (gameInfo.scratchPad.eventBits[0x3A] & 0x20) != 0;/*Faron howling stone done*/ } },
- /*Mortal Draw*/
- {"F_SP124", 0, 2, 0x78, 0xE5, 0xC53E0B78, 0x41C428F6, 0x46318C93, 0x4565, []() { gameInfo.scratchPad.eventBits[0x3C] |= 0x1;/*Got skill from Bublin Camp Wolf*/ }, []() { return (gameInfo.scratchPad.eventBits[0x3A] & 0x10) != 0;/*Lake Hylia howling stone done*/ } },
- /*Jump Strike*/
- {"F_SP111", 0, 2, 0x6C, 0xE6, 0x467D1395, 0x44034000, 0xC1F855A7, 0x3EE7, []() { gameInfo.scratchPad.eventBits[0x3D] |= 0x80;/*Got skill from Graveyard Wolf*/ }, []() { return (gameInfo.scratchPad.eventBits[0x3A] & 0x8) != 0;/*Snowpeak howling stone done*/ } },
- /*Great Spin*/
- {"F_SP116", 1, 2, 0x78, 0xE7, 0x42204113, 0x44480000, 0xC61FB41E, 0x0000, []() { gameInfo.scratchPad.eventBits[0x3D] |= 0x40;/*Got skill from Barrier Wolf*/ }, []() { return (gameInfo.scratchPad.eventBits[0x3A] & 0x4) != 0;/*Hidden Village howling stone done*/ } },
- /*Youth's Scent*/
- {"F_SP121", 0xFF, 0, 0x70, 0xB4, 0xC681A76B, 0xC5C99000, 0x4783ED29, 0xA6A9, []() { gameInfo.scratchPad.eventBits[0x22] |= 0x40;/*Got Youth's scent*/ gameInfo.localAreaNodes.unk_0[0x16] |= 0x4;/*Midna text after getting Youth's scent*/ gameInfo.localAreaNodes.unk_0[0x17] |= 0x40;/*got youth's scent cs*/ }, []() { return true; } },
- /*Ilia's Scent*/
- {"F_SP121", 0xFF, 0, 0x6C, 0xB0, 0xC5DD1EF2, 0x4529ED9A, 0xC73F5AD1, 0x71A6, []() { gameInfo.scratchPad.eventBits[0x22] |= 0x20;/*Got Ilia's scent*/ gameInfo.localAreaNodes.unk_0[0x16] |= 0x20;/*Midna text after getting Ilia's scent*/ gameInfo.localAreaNodes.unk_0[0x17] |= 0x80;/*got Ilia's scent cs*/ }, []() { return true; } },
- /*Poe Scent*/
- {"D_MN10", 0xFF, 0, 0x3C, 0xB2, 0xC1571A39, 0xC1200000, 0x4355109A, 0x0000, nullptr, []() { return true; } },
- /*Reekfish Scent*/
- {"F_SP113", 1, 0, 0x64, 0xB3, 0x456A7496, 0xC5BB109B, 0x464D4470, 0xD6E8, nullptr, []() { return tools::checkItemFlag(ItemFlags::Coral_Earring); } },
- /*Medicine Scent*/
- {"R_SP160", 2, 0, 0x74, 0xB5, 0x45EC0BF6, 0xC33E0000, 0xC4D9EA4C, 0xC26D, nullptr, []() { return true; } },
- /*Snowpeak Map*/
- {"D_MN11", 0xFF, 0, 0x74, 0x23, 0x447AF8E0, 0x00000000, 0xC42C93A9, 0xFEED, []() { gameInfo.localAreaNodes.unk_0[0xA] |= 0x10;/*got map from Yeta*/ gameInfo.scratchPad.eventBits[0xB] |= 0x20;/*Talked to Yeta in SPR first time*/ gameInfo.localAreaNodes.unk_0[0x10] |= 0x20;/*Yeta lets you open kitchen door*/ gameInfo.localAreaNodes.unk_0[0x16] |= 0x40;/*Yeta points to kitchen cs*/ }, []() { return true; } } };
+ customCheck customChecks[37] = {
+ /*Ordon Shield*/
+ { "F_SP103",
+ 0,
+ 0,
+ 0x74,
+ 0x2A,
+ 0x456C12A0,
+ 0x43390000,
+ 0x44405C5E,
+ 0x5FA0,
+ []()
+ {
+ gameInfo.localAreaNodes.unk_0[0x8] |= 0x4; /*remove ordon shield*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x5] & 0x7A ) != 0; /*have sewers been done*/
+ } },
+ /*Ordon Sword*/
+ { "R_SP01",
+ 4,
+ 0,
+ 0x70,
+ 0x28,
+ 0x439D0602,
+ 0x0,
+ 0xC26ABE99,
+ 0xCC7D,
+ []()
+ {
+ gameInfo.localAreaNodes.unk_0[0x8] |= 0x1; /*got ordon sword*/
+ gameInfo.localAreaNodes.unk_0[0x1B] |= 0x8; /*remove ordon sword*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x5] & 0x7A ) != 0; /*have sewers been done*/
+ } },
+ /*Fishing rod*/
+ { "F_SP103",
+ 0,
+ 1,
+ 0x68,
+ 0x4A,
+ 0xC3FEB5F1,
+ 0x42960000,
+ 0x4514FB40,
+ 0x883A,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3] |= 0x5; /*brought Cradle to Uli and got fishing rod*/
+ gameInfo.scratchPad.eventBits[0x46] |= 0x1; /*took cradle from monkey*/
+ },
+ []()
+ {
+ return ( gameInfo.localAreaNodes.unk_0[0xC] & 0x2 ) != 0; /*is goats 1 done*/
+ } },
+ /*Sera Bottle*/
+ { "F_SP103",
+ 0,
+ 1,
+ 0x7C,
+ 0x65,
+ 0x444C8DC3,
+ 0x42AF0000,
+ 0xC4CB2577,
+ 0xA3E7,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x12] |= 0x8; /*can shop at Sera's shop*/
+ gameInfo.scratchPad.eventBits[0x14] |= 0x8; /*Sera Bottle gotten*/
+ },
+ []()
+ {
+ return ( gameInfo.localAreaNodes.unk_0[0xC] & 0x2 ) != 0; /*is goats 1 done*/
+ } },
+ /*Slingshot*/
+ { "F_SP103",
+ 0,
+ 0,
+ 0x78,
+ 0x4B,
+ 0xC3EDF8A9,
+ 0x44CD922E,
+ 0x45F31BF5,
+ 0x7881,
+ nullptr /*Flag is set in game_patches to avoid interaction with vanilla check*/,
+ []()
+ {
+ return ( gameInfo.localAreaNodes.unk_0[0xC] & 0x2 ) != 0; /*is goats 1 done*/
+ } },
+ /*Lantern*/
+ { "F_SP108", 0xFF, 1, 0xF8, 0x48, 0xC66D4C1B, 0x41C19A25, 0xC65D2696, 0x36EC, nullptr, []() { return true; } },
+ /*Zora Armor*/
+ { "F_SP111",
+ 0,
+ 1,
+ 0x7C,
+ 0x31,
+ 0x46A85A96,
+ 0x43FA0000,
+ 0x43944190,
+ 0xC270,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x8] |= 0x4; /*got zora armor from Rutela*/
+ },
+ []() { return true; } },
+ /*Coral Earring*/
+ { "F_SP111",
+ 0,
+ 1,
+ 0x78,
+ 0x3D,
+ 0x46A81087,
+ 0x43FA57D9,
+ 0xC3BCEFAC,
+ 0xC270,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3B] |= 0x80; /*Got Coral Earring from Ralis*/
+ },
+ []() { return tools::checkItemFlag( ItemFlags::Asheis_Sketch ); } },
+ /*Auru's Memo*/
+ { "F_SP115",
+ 0,
+ 1,
+ 0x7C,
+ 0x90,
+ 0xC7E2E398,
+ 0xC6770800,
+ 0x47656746,
+ 0x143D,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x25] |= 0x30; /*Auru Cutscene Complete + Auru's Memo gotten*/
+ },
+ []() { return gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten == 0b1; } },
+ /*Ashei's Sketch*/
+ { "F_SP114",
+ 0,
+ 1,
+ 0x7C,
+ 0x91,
+ 0x46F71891,
+ 0xC6502A32,
+ 0xC6348FA6,
+ 0x86E6,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x40; /*Got Ashei's Sketch from Ashei*/
+ },
+ []() { return true; } },
+ /*Renardo's Letter*/
+ { "R_SP109",
+ 0,
+ 1,
+ 0x68,
+ 0x80,
+ 0x43D3A702,
+ 0x0,
+ 0x43D5A60B,
+ 0xC1FD,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0xF] |= 0x80; /*Got Renardo's Letter from Renardo*/
+ },
+ []() { return gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten == 0b1; } },
+ /*Invoice*/
+ { "R_SP116",
+ 5,
+ 1,
+ 0x70,
+ 0x81,
+ 0x45282E22,
+ 0xC48FC000,
+ 0x453BED7D,
+ 0x0000,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x21] |= 0x80; /*Got Invoice from Telma*/
+ },
+ []() { return tools::checkItemFlag( ItemFlags::Renardos_Letter ); } },
+ /*Wooden Statue*/
+ { "F_SP122",
+ 16,
+ 1,
+ 0x68,
+ 0x82,
+ 0xC7493734,
+ 0xC5C3E9D7,
+ 0x46F956C6,
+ 0x7FE1,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x22] |= 0x80; /*Got Wooden Statue from wolves*/
+ },
+ []() { return tools::checkItemFlag( ItemFlags::Medicine_Scent ); } },
+ /*Ilia's Charm*/
+ { "F_SP128",
+ 0,
+ 1,
+ 0x64,
+ 0x83,
+ 0x44F7650C,
+ 0x42D20705,
+ 0xC4A1A68B,
+ 0x4226,
+ nullptr /*Flag is set in game_patches to avoid interaction with vanilla check*/,
+ []() { return true; } },
+ /*Horse Call*/
+ { "R_SP109",
+ 0,
+ 1,
+ 0x74,
+ 0x84,
+ 0x43CDBCA1,
+ 0x0,
+ 0xC31EEBF3,
+ 0xBDBE,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x23] |= 0x20; /*Got horse call from Illia*/
+ },
+ []() { return tools::checkItemFlag( ItemFlags::Ilias_Charm ); } },
+ /*Fishing Hole Bottle*/
+ { "F_SP127",
+ 0,
+ 1,
+ 0x7C,
+ 0x60,
+ 0x45B27147,
+ 0x420C0000,
+ 0x450F716A,
+ 0x62E5,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x39] |= 0x8; /*Got fishing hole bottle*/
+ },
+ []() { return true; } },
+ /*Coro Key*/
+ { "F_SP108",
+ 0xFF,
+ 0,
+ 0xF4,
+ 0xFE,
+ 0xC64BA600,
+ 0x403DA884,
+ 0xC663BC8E,
+ 0x7A11,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x1A] |= 0x10; /*Talked to Coro after Faron Twilight*/
+ gameInfo.localAreaNodes.unk_0[0xD] |= 0x4; /*got Coro key*/
+ },
+ []() { return gameInfo.scratchPad.clearedTwilights.Faron == 0b1; } },
+ /*Gate Keys*/
+ { "F_SP121",
+ 0xFF,
+ 1,
+ 0x7C,
+ 0xF3,
+ 0xC781DFDB,
+ 0xC607B38E,
+ 0x47897B50,
+ 0xC0C9,
+ nullptr,
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x8] & 0x40 ) != 0; /*was escort started*/
+ } },
+ /*Camp Key*/
+ { "F_SP118",
+ 1,
+ 0,
+ 0x7C,
+ 0x20,
+ 0x457F816B,
+ 0x43820000,
+ 0xC572F680,
+ 0x0000,
+ []()
+ {
+ gameInfo.localAreaNodes.unk_0[0x4] |= 0x80; /*get camp key*/
+ },
+ []() { return true; } },
+ /*Jovani Poe*/
+ { "R_SP160",
+ 5,
+ 0,
+ 0x7C,
+ 0xE0,
+ 0x45906531,
+ 0xC2960000,
+ 0x45229AEB,
+ 0xC3C9,
+ []()
+ {
+ gameInfo.localAreaNodes.unk_0[0x8] |= 0x80; /*killed poe*/
+ gameInfo.localAreaNodes.unk_0[0xF] |= 0x7; /*cs + open path to sewers*/
+ gameInfo.localAreaNodes.unk_0[0x17] |= 0x8; /*Gengle Free*/
+ },
+ []() { return true; } },
+ /*Shadow Crystal*/
+ { "F_SP117",
+ 1,
+ 0,
+ 0x7C,
+ 0x32,
+ 0xC36EB7DC,
+ 0x44CB2000,
+ 0xC5964574,
+ 0x0000,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x10] |= 0x20; /*got master sword cs*/
+ },
+ []() { return true; } },
+ /*Master Sword*/
+ { "F_SP117",
+ 1,
+ 2,
+ 0x78,
+ 0x29,
+ 0x4372ACFB,
+ 0x44CB2000,
+ 0xC5991A55,
+ 0x0000,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x10] |= 0x20; /*got master sword cs*/
+ },
+ []() { return true; } },
+ /*Powered Dominion Rod*/
+ { "R_SP209",
+ 7,
+ 1,
+ 0x70,
+ 0x4C,
+ 0xC3DB30E9,
+ 0xC4408000,
+ 0xC523C471,
+ 0x3CF0,
+ nullptr,
+ []() { return tools::checkItemFlag( ItemFlags::Ancient_Sky_Book_empty ); } },
+ /*Light Master Sword*/
+ { "F_SP125",
+ 4,
+ 1,
+ 0x74,
+ 0x49,
+ 0x44E0DBF7,
+ 0x45898B09,
+ 0xC6A4AAFA,
+ 0x7DBC,
+ nullptr,
+ []()
+ {
+ return ( ( gameInfo.scratchPad.eventBits[0x26] & 0x40 ) != 0 ) &&
+ ( gameInfo.scratchPad.eventBits[0x26] & 0x20 ) != 0; /*both sols outside of Palace*/
+ } },
+ /*Ending Blow*/
+ { "F_SP108",
+ 6,
+ 2,
+ 0xF0,
+ 0xE1,
+ 0xC71A5B41,
+ 0x44898000,
+ 0xC6E08544,
+ 0x0000,
+ nullptr,
+ []() { return gameInfo.scratchPad.clearedTwilights.Faron == 0b1; } },
+ /*Shield Bash*/
+ { "F_SP104",
+ 1,
+ 2,
+ 0x6C,
+ 0xE2,
+ 0xC4BB1F1C,
+ 0x438C0000,
+ 0xC613CAAA,
+ 0x4138,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3C] |= 0x8; /*Got skill from Ordon Wolf*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x3A] & 0x80 ) != 0; /*DMT howling stone done*/
+ } },
+ /*Back Slice*/
+ { "F_SP122",
+ 8,
+ 2,
+ 0x78,
+ 0xE3,
+ 0xC78590C8,
+ 0xC4834000,
+ 0x45B7BC37,
+ 0xC15B,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3C] |= 0x4; /*Got skill from West CT Wolf*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x3A] & 0x40 ) != 0; /*UZR howling stone done*/
+ } },
+ /*Helm Splitter*/
+ { "F_SP122",
+ 16,
+ 2,
+ 0x74,
+ 0xE4,
+ 0xC75990D6,
+ 0xC5BEA000,
+ 0x46C3B269,
+ 0x0000,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3C] |= 0x2; /*Got skill from South CT Wolf*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x3A] & 0x20 ) != 0; /*Faron howling stone done*/
+ } },
+ /*Mortal Draw*/
+ { "F_SP124",
+ 0,
+ 2,
+ 0x78,
+ 0xE5,
+ 0xC53E0B78,
+ 0x41C428F6,
+ 0x46318C93,
+ 0x4565,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3C] |= 0x1; /*Got skill from Bublin Camp Wolf*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x3A] & 0x10 ) != 0; /*Lake Hylia howling stone done*/
+ } },
+ /*Jump Strike*/
+ { "F_SP111",
+ 0,
+ 2,
+ 0x6C,
+ 0xE6,
+ 0x467D1395,
+ 0x44034000,
+ 0xC1F855A7,
+ 0x3EE7,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3D] |= 0x80; /*Got skill from Graveyard Wolf*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x3A] & 0x8 ) != 0; /*Snowpeak howling stone done*/
+ } },
+ /*Great Spin*/
+ { "F_SP116",
+ 1,
+ 2,
+ 0x78,
+ 0xE7,
+ 0x42204113,
+ 0x44480000,
+ 0xC61FB41E,
+ 0x0000,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x3D] |= 0x40; /*Got skill from Barrier Wolf*/
+ },
+ []()
+ {
+ return ( gameInfo.scratchPad.eventBits[0x3A] & 0x4 ) != 0; /*Hidden Village howling stone done*/
+ } },
+ /*Youth's Scent*/
+ { "F_SP121",
+ 0xFF,
+ 0,
+ 0x70,
+ 0xB4,
+ 0xC681A76B,
+ 0xC5C99000,
+ 0x4783ED29,
+ 0xA6A9,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x22] |= 0x40; /*Got Youth's scent*/
+ gameInfo.localAreaNodes.unk_0[0x16] |= 0x4; /*Midna text after getting Youth's scent*/
+ gameInfo.localAreaNodes.unk_0[0x17] |= 0x40; /*got youth's scent cs*/
+ },
+ []() { return true; } },
+ /*Ilia's Scent*/
+ { "F_SP121",
+ 0xFF,
+ 0,
+ 0x6C,
+ 0xB0,
+ 0xC5DD1EF2,
+ 0x4529ED9A,
+ 0xC73F5AD1,
+ 0x71A6,
+ []()
+ {
+ gameInfo.scratchPad.eventBits[0x22] |= 0x20; /*Got Ilia's scent*/
+ gameInfo.localAreaNodes.unk_0[0x16] |= 0x20; /*Midna text after getting Ilia's scent*/
+ gameInfo.localAreaNodes.unk_0[0x17] |= 0x80; /*got Ilia's scent cs*/
+ },
+ []() { return true; } },
+ /*Poe Scent*/
+ { "D_MN10", 0xFF, 0, 0x3C, 0xB2, 0xC1571A39, 0xC1200000, 0x4355109A, 0x0000, nullptr, []() { return true; } },
+ /*Reekfish Scent*/
+ { "F_SP113",
+ 1,
+ 0,
+ 0x64,
+ 0xB3,
+ 0x456A7496,
+ 0xC5BB109B,
+ 0x464D4470,
+ 0xD6E8,
+ nullptr,
+ []() { return tools::checkItemFlag( ItemFlags::Coral_Earring ); } },
+ /*Medicine Scent*/
+ { "R_SP160", 2, 0, 0x74, 0xB5, 0x45EC0BF6, 0xC33E0000, 0xC4D9EA4C, 0xC26D, nullptr, []() { return true; } },
+ /*Snowpeak Map*/
+ { "D_MN11",
+ 0xFF,
+ 0,
+ 0x74,
+ 0x23,
+ 0x447AF8E0,
+ 0x00000000,
+ 0xC42C93A9,
+ 0xFEED,
+ []()
+ {
+ gameInfo.localAreaNodes.unk_0[0xA] |= 0x10; /*got map from Yeta*/
+ gameInfo.scratchPad.eventBits[0xB] |= 0x20; /*Talked to Yeta in SPR first time*/
+ gameInfo.localAreaNodes.unk_0[0x10] |= 0x20; /*Yeta lets you open kitchen door*/
+ gameInfo.localAreaNodes.unk_0[0x16] |= 0x40; /*Yeta points to kitchen cs*/
+ },
+ []() { return true; } } };
}; \ No newline at end of file
diff --git a/include/defines.h b/include/defines.h
index a93c71d..a49f786 100644
--- a/include/defines.h
+++ b/include/defines.h
@@ -16,13 +16,13 @@ typedef signed char s8;
// Helper
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c"
-#define BYTE_TO_BINARY(byte) \
- (byte & 0b10000000 ? '1' : '0'), (byte & 0b01000000 ? '1' : '0'), (byte & 0b00100000 ? '1' : '0'), \
- (byte & 0b00010000 ? '1' : '0'), (byte & 0b00001000 ? '1' : '0'), (byte & 0b00000100 ? '1' : '0'), \
- (byte & 0b00000010 ? '1' : '0'), (byte & 0b00000001 ? '1' : '0')
+#define BYTE_TO_BINARY( byte ) \
+ ( byte & 0b10000000 ? '1' : '0' ), ( byte & 0b01000000 ? '1' : '0' ), ( byte & 0b00100000 ? '1' : '0' ), \
+ ( byte & 0b00010000 ? '1' : '0' ), ( byte & 0b00001000 ? '1' : '0' ), ( byte & 0b00000100 ? '1' : '0' ), \
+ ( byte & 0b00000010 ? '1' : '0' ), ( byte & 0b00000001 ? '1' : '0' )
// Allows to transform data as bytes 1:1 from A<-->B and vice versa
-template <typename A, typename B>
+template<typename A, typename B>
union typeTransform
{
A a;
@@ -30,8 +30,8 @@ union typeTransform
};
// Array modification
-#define MAX_LOAD_EVENTS 40 // eventListener
-#define MAX_HUDCONSOLE_PAGES 12 // HUDConsole
+#define MAX_LOAD_EVENTS 40 // eventListener
+#define MAX_HUDCONSOLE_PAGES 12 // HUDConsole
// Mnemonics
#define AUTHOR "ZTPR"
diff --git a/include/eventListener.h b/include/eventListener.h
index f1d176a..1c9af7d 100644
--- a/include/eventListener.h
+++ b/include/eventListener.h
@@ -4,57 +4,62 @@
namespace mod::event
{
- /**
- * Runs when the according event triggers
- */
- typedef void (*EventFunction)();
-
- enum LoadEventAccuracy : u8
- {
- All = 0,
- Stage = 1,
- Stage_Room = 2,
- Stage_Room_Spawn = 3,
- Stage_Room_Spawn_State = 4
- };
-
- struct LoadEvent
- {
- char* Stage;
- u8 Room;
- u8 Spawn;
- u8 State;
- u8 Eventid; // Cutscene event id
- EventFunction Trigger;
- LoadEventAccuracy Accuracy;
- };
-
- class EventListener
- {
- private:
- u8 loadEventIndex;
- LoadEvent loadEvents[MAX_LOAD_EVENTS];
-
- public:
-
- EventListener();
-
- /**
- * Runs a loop that triggers the according event if it's conditions match
- */
- void checkLoadEvents();
-
- /**
- * Executes a function when certain load conditions match
- *
- * @param stage The stage identifier (internal id)
- * @param room The room identifier (internal room id)
- * @param spawn The spawnpoint identifier (internal spawn id)
- * @param state The state (internal state id)
- * @param csevent If it's a CS this is the id
- * @param trigger The (void) function(void) to be executed when the event occurs
- * @param accuracy Defines which of the identifiers have to match for the event to trigger
- */
- void addLoadEvent(char* stage, u8 room, u8 spawn, u8 state, u8 eventid, EventFunction trigger, LoadEventAccuracy accuracy = LoadEventAccuracy::All);
- };
-} \ No newline at end of file
+ /**
+ * Runs when the according event triggers
+ */
+ typedef void ( *EventFunction )();
+
+ enum LoadEventAccuracy : u8
+ {
+ All = 0,
+ Stage = 1,
+ Stage_Room = 2,
+ Stage_Room_Spawn = 3,
+ Stage_Room_Spawn_State = 4
+ };
+
+ struct LoadEvent
+ {
+ char* Stage;
+ u8 Room;
+ u8 Spawn;
+ u8 State;
+ u8 Eventid; // Cutscene event id
+ EventFunction Trigger;
+ LoadEventAccuracy Accuracy;
+ };
+
+ class EventListener
+ {
+ private:
+ u8 loadEventIndex;
+ LoadEvent loadEvents[MAX_LOAD_EVENTS];
+
+ public:
+ EventListener();
+
+ /**
+ * Runs a loop that triggers the according event if it's conditions match
+ */
+ void checkLoadEvents();
+
+ /**
+ * Executes a function when certain load conditions match
+ *
+ * @param stage The stage identifier (internal id)
+ * @param room The room identifier (internal room id)
+ * @param spawn The spawnpoint identifier (internal spawn id)
+ * @param state The state (internal state id)
+ * @param csevent If it's a CS this is the id
+ * @param trigger The (void) function(void) to be executed when the event occurs
+ * @param accuracy Defines which of the identifiers have to match for the event to trigger
+ */
+ void addLoadEvent( char* stage,
+ u8 room,
+ u8 spawn,
+ u8 state,
+ u8 eventid,
+ EventFunction trigger,
+ LoadEventAccuracy accuracy = LoadEventAccuracy::All );
+ };
+} // namespace mod::event \ No newline at end of file
diff --git a/include/game_patches.h b/include/game_patches.h
index 357613d..66b86bb 100644
--- a/include/game_patches.h
+++ b/include/game_patches.h
@@ -1,9 +1,8 @@
#pragma once
-#include "defines.h"
#include <tp/d_com_inf_game.h>
-
+#include "defines.h"
/**
* Contains functions that fix certain cutscenes
@@ -12,11 +11,11 @@
*/
namespace mod::cutscene_skip
{
- /**
- * Runs when master sword CS is skipped
- */
- s32 onMasterSwordSkip(void* unk, s32 unk2);
-}
+ /**
+ * Runs when master sword CS is skipped
+ */
+ s32 onMasterSwordSkip( void* unk, s32 unk2 );
+} // namespace mod::cutscene_skip
/**
* Contains patch functions that take no parameters
@@ -24,205 +23,203 @@ namespace mod::cutscene_skip
*/
namespace mod::game_patch
{
- /**
- * Enables the debug screen without
- * active debug mode; It triggers
- * automatically when crashing
- */
- void assemblyOverwrites();
-
- /**
- * Kills spider at links house
- */
- void killLinkHouseSpider();
-
- /**
- * Increasees Links climbing speed
- */
- void increaseClimbSpeed();
-
- /**
- * Removes the movementspeed limit
- * when wearing IB
- */
- void removeIBLimit();
-
-
- /**
- * Changes the max rupee amounts for each
- * of the wallets
- */
- void increaseWalletSize();
-
- /**
- * Skips sewers immediately
- * triggers the load to Ordon Spring
- * and sets the flags accordingly
- */
- void skipSewers();
-
- /**
- * Adds the chests that disappear after KB3
- * changes the state of faron from 1 to 3
- */
- void setBublinState();
-
- /**
- * Sets the flag after Ilia CS
- * which tells the game that you started
- * with sewers
- */
- void setFirstTimeWolf();
-
- /**
- * Sets form to human
- */
- void setHuman();
-
- /**
- * Sets form to wolf
- */
- void setWolf();
-
-
- /**
- * Activates the sense button (X)
- * for Wolf Link
- */
- void giveSense();
-
- /**
- * Tames Epona
- */
- void giveEpona();
-
- /**
- * Gives Master Sword and equips it
- */
- void giveMasterSword();
-
- /**
- * Gives Midna and sets the according sewers flag
- * Makes her appear on Z
- */
- void giveMidna();
-
- /**
- * Gives Midna Text that allows transformation
- */
- void giveMidnaTransform();
-
- /**
- * Removes the locks from the 2 bulblin gates in HF
- * change doesn't get saved so set it evry time you load into HF
- */
- void setFieldBits();
-
- /**
- * when spawning in goats 2, will warp you to Illia taking Epona CS
- */
- void skipGoats();
-
- /**
- * opens the door the the master sword in sacred grove
- */
- void setGroveFlags();
-
- /**
- * when you spawn into the Cart Escort, game will spawn you in Kakariko Afterwards
- */
- void skipCartEscort();
-
- /**
- * warps player to Lanayru twilight gate if they don't have MS
- */
- void setLanayruWolf();
-
- /**
- * Fixes the cannon and puts it at lake hylia
- */
- void earlyCiTS();
-
- /**
- * Fyer will let you go to the desert if you have MS
- */
- void earlyDesert();
-
- /**
- * give boss key to all dungeons
- */
- void checkBossKeysey();
-
- /**
- * check wether to show hawkeye and hylian shield in malo mart
- */
- void handleMaloShop();
-
- /**
- * check whether you have MS before being allowed to enter the desert
- */
- void accessDesert();
-
- /**
- * skips midna text and story CS
- */
- void skipTextAndCS();
-
- /**
- * escort avalable at any time
- */
- void setEscortState();
-
- /**
- * skips the zant CS for MDH
- */
- void skipMDHCS();
-
- void fixFTBossMusic();
-
- /**
- * won't allow you to leave the forest if Faron escape is disabled until you beat Diababa
- */
- void allowFaronEscape();
-
- /**
- * set MDH skip after Lanayru Twilight
- */
- void skipMDH();
-
- /**
- * unset the story flag and boss flag when re-entering a dungeon
- */
- void setLanternFlag();
-
- void breakBarrier();
-
- /**
- * unset the story flag and boss flag when re-entering a dungeon
- */
- void fixFTState();
- void fixGMState();
- void fixLBTState();
- void fixAGState();
- void fixSPRState();
- void fixToTState();
- void fixCiTSState();
-
- /**
- * reset the flags for a dungeon if it has been beaten or if a skip is active
- */
- void setFTDungeonFlag();
- void setFTBossFlag();
- void setGMDungeonFlag();
- void setGMBossFlag();
- void setLakeDungeonFlags();
- void setLBTBossFlag();
- void setAGDungeonFlag();
- void setAGBossFlag();
- void setSPRDungeonFlag();
- void setSPRBossFlag();
- void setToTDungeonFlag();
- void setToTBossFlag();
- void setCiTSDungeonFlag();
- void setCiTSBossFlag();
-} \ No newline at end of file
+ /**
+ * Enables the debug screen without
+ * active debug mode; It triggers
+ * automatically when crashing
+ */
+ void assemblyOverwrites();
+
+ /**
+ * Kills spider at links house
+ */
+ void killLinkHouseSpider();
+
+ /**
+ * Increasees Links climbing speed
+ */
+ void increaseClimbSpeed();
+
+ /**
+ * Removes the movementspeed limit
+ * when wearing IB
+ */
+ void removeIBLimit();
+
+ /**
+ * Changes the max rupee amounts for each
+ * of the wallets
+ */
+ void increaseWalletSize();
+
+ /**
+ * Skips sewers immediately
+ * triggers the load to Ordon Spring
+ * and sets the flags accordingly
+ */
+ void skipSewers();
+
+ /**
+ * Adds the chests that disappear after KB3
+ * changes the state of faron from 1 to 3
+ */
+ void setBublinState();
+
+ /**
+ * Sets the flag after Ilia CS
+ * which tells the game that you started
+ * with sewers
+ */
+ void setFirstTimeWolf();
+
+ /**
+ * Sets form to human
+ */
+ void setHuman();
+
+ /**
+ * Sets form to wolf
+ */
+ void setWolf();
+
+ /**
+ * Activates the sense button (X)
+ * for Wolf Link
+ */
+ void giveSense();
+
+ /**
+ * Tames Epona
+ */
+ void giveEpona();
+
+ /**
+ * Gives Master Sword and equips it
+ */
+ void giveMasterSword();
+
+ /**
+ * Gives Midna and sets the according sewers flag
+ * Makes her appear on Z
+ */
+ void giveMidna();
+
+ /**
+ * Gives Midna Text that allows transformation
+ */
+ void giveMidnaTransform();
+
+ /**
+ * Removes the locks from the 2 bulblin gates in HF
+ * change doesn't get saved so set it evry time you load into HF
+ */
+ void setFieldBits();
+
+ /**
+ * when spawning in goats 2, will warp you to Illia taking Epona CS
+ */
+ void skipGoats();
+
+ /**
+ * opens the door the the master sword in sacred grove
+ */
+ void setGroveFlags();
+
+ /**
+ * when you spawn into the Cart Escort, game will spawn you in Kakariko Afterwards
+ */
+ void skipCartEscort();
+
+ /**
+ * warps player to Lanayru twilight gate if they don't have MS
+ */
+ void setLanayruWolf();
+
+ /**
+ * Fixes the cannon and puts it at lake hylia
+ */
+ void earlyCiTS();
+
+ /**
+ * Fyer will let you go to the desert if you have MS
+ */
+ void earlyDesert();
+
+ /**
+ * give boss key to all dungeons
+ */
+ void checkBossKeysey();
+
+ /**
+ * check wether to show hawkeye and hylian shield in malo mart
+ */
+ void handleMaloShop();
+
+ /**
+ * check whether you have MS before being allowed to enter the desert
+ */
+ void accessDesert();
+
+ /**
+ * skips midna text and story CS
+ */
+ void skipTextAndCS();
+
+ /**
+ * escort avalable at any time
+ */
+ void setEscortState();
+
+ /**
+ * skips the zant CS for MDH
+ */
+ void skipMDHCS();
+
+ void fixFTBossMusic();
+
+ /**
+ * won't allow you to leave the forest if Faron escape is disabled until you beat Diababa
+ */
+ void allowFaronEscape();
+
+ /**
+ * set MDH skip after Lanayru Twilight
+ */
+ void skipMDH();
+
+ /**
+ * unset the story flag and boss flag when re-entering a dungeon
+ */
+ void setLanternFlag();
+
+ void breakBarrier();
+
+ /**
+ * unset the story flag and boss flag when re-entering a dungeon
+ */
+ void fixFTState();
+ void fixGMState();
+ void fixLBTState();
+ void fixAGState();
+ void fixSPRState();
+ void fixToTState();
+ void fixCiTSState();
+
+ /**
+ * reset the flags for a dungeon if it has been beaten or if a skip is active
+ */
+ void setFTDungeonFlag();
+ void setFTBossFlag();
+ void setGMDungeonFlag();
+ void setGMBossFlag();
+ void setLakeDungeonFlags();
+ void setLBTBossFlag();
+ void setAGDungeonFlag();
+ void setAGBossFlag();
+ void setSPRDungeonFlag();
+ void setSPRBossFlag();
+ void setToTDungeonFlag();
+ void setToTBossFlag();
+ void setCiTSDungeonFlag();
+ void setCiTSBossFlag();
+} // namespace mod::game_patch \ No newline at end of file
diff --git a/include/gc/OSCache.h b/include/gc/OSCache.h
index 6a08f2e..d3bb8a8 100644
--- a/include/gc/OSCache.h
+++ b/include/gc/OSCache.h
@@ -4,26 +4,26 @@
namespace gc::os_cache
{
- extern "C"
- {
- // DCEnable
- // DCInvalidateRange
- void DCFlushRange(void* startAddr, u32 nBytes);
- // DCStoreRange
- // DCFlushRangeNoSync
- // DCStoreRangeNoSync
- // DCZeroRange
- void ICInvalidateRange(void* startAddr, u32 nBytes);
- // ICFlashInvalidate
- // ICEnable
- // __LCEnable
- // LCEnable
- // LCDisable
- // LCStoreBlocks
- // LCStoreData
- // LCQueueWait
- // L2GlobalInvalidate
- // DMAErrorHandler
- // __OSCacheInit
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ // DCEnable
+ // DCInvalidateRange
+ void DCFlushRange( void* startAddr, u32 nBytes );
+ // DCStoreRange
+ // DCFlushRangeNoSync
+ // DCStoreRangeNoSync
+ // DCZeroRange
+ void ICInvalidateRange( void* startAddr, u32 nBytes );
+ // ICFlashInvalidate
+ // ICEnable
+ // __LCEnable
+ // LCEnable
+ // LCDisable
+ // LCStoreBlocks
+ // LCStoreData
+ // LCQueueWait
+ // L2GlobalInvalidate
+ // DMAErrorHandler
+ // __OSCacheInit
+ }
+} // namespace gc::os_cache \ No newline at end of file
diff --git a/include/gc/OSModule.h b/include/gc/OSModule.h
index 27cfdc3..6bb2c49 100644
--- a/include/gc/OSModule.h
+++ b/include/gc/OSModule.h
@@ -2,18 +2,18 @@
#include "defines.h"
-namespace gc::OSModule {
-
-struct OSModuleInfo
+namespace gc::OSModule
{
- u32 id;
- OSModuleInfo* next;
- OSModuleInfo* prev;
- u32 numSections;
- u32 sectionInfoOffset;
- u32 nameOffset;
- u32 nameSize;
- u32 version;
-} __attribute__((__packed__));
+ struct OSModuleInfo
+ {
+ u32 id;
+ OSModuleInfo* next;
+ OSModuleInfo* prev;
+ u32 numSections;
+ u32 sectionInfoOffset;
+ u32 nameOffset;
+ u32 nameSize;
+ u32 version;
+ } __attribute__( ( __packed__ ) );
-} \ No newline at end of file
+} // namespace gc::OSModule \ No newline at end of file
diff --git a/include/global.h b/include/global.h
index 17a3c0b..8e777c7 100644
--- a/include/global.h
+++ b/include/global.h
@@ -13,4 +13,4 @@ namespace mod::global
extern mod::event::EventListener* eventListenerPtr;
extern mod::HUDConsole* hudConsolePtr;
extern uint64_t* seedInSaveFile;
-} // namespace mod::global \ No newline at end of file
+} // namespace mod::global \ No newline at end of file
diff --git a/include/grottoChecks.h b/include/grottoChecks.h
index 23d8415..a7b8f7a 100644
--- a/include/grottoChecks.h
+++ b/include/grottoChecks.h
@@ -4,29 +4,29 @@
namespace mod::grottoChecks
{
- extern u16 g1_0[1];//Lanayru2
- extern u16 g1_1[2];//Eldin2
- extern u16 g1_2[1];//Ordon
- extern u16 g1_3[2];//Lanayru3
+ extern u16 g1_0[1]; // Lanayru2
+ extern u16 g1_1[2]; // Eldin2
+ extern u16 g1_2[1]; // Ordon
+ extern u16 g1_3[2]; // Lanayru3
- extern u16 g2_0[3];//Eldin4
- extern u16 g2_1[3];//Faron1
- extern u16 g2_2[1];//Sacred
- //extern u16 g2_3[0];//Eldin1
+ extern u16 g2_0[3]; // Eldin4
+ extern u16 g2_1[3]; // Faron1
+ extern u16 g2_2[1]; // Sacred
+ // extern u16 g2_3[0];//Eldin1
- extern u16 g3_0[3];//Gerudo3
- //extern u16 g3_1[0];//Gerudo2
- //extern u16 g3_2[0];//Snowpeak2
- //extern u16 g3_3[0];//Lanayru5
+ extern u16 g3_0[3]; // Gerudo3
+ // extern u16 g3_1[0];//Gerudo2
+ // extern u16 g3_2[0];//Snowpeak2
+ // extern u16 g3_3[0];//Lanayru5
- extern u16 g4_0[1];//Lanayru6
- extern u16 g4_1[1];//Gerudo1
- extern u16 g4_2[1];//Snowpeak1
- extern u16 g4_3[1];//Lanayru4
+ extern u16 g4_0[1]; // Lanayru6
+ extern u16 g4_1[1]; // Gerudo1
+ extern u16 g4_2[1]; // Snowpeak1
+ extern u16 g4_3[1]; // Lanayru4
- extern u16 g5_0[1];//Lanayru1
- //extern u16 g5_1[0];//Faron2
- extern u16 g5_2[1];//Lake2
- extern u16 g5_3[1];//Eldin3
- extern u16 g5_4[1];//Lake1
-} \ No newline at end of file
+ extern u16 g5_0[1]; // Lanayru1
+ // extern u16 g5_1[0];//Faron2
+ extern u16 g5_2[1]; // Lake2
+ extern u16 g5_3[1]; // Eldin3
+ extern u16 g5_4[1]; // Lake1
+} // namespace mod::grottoChecks \ No newline at end of file
diff --git a/include/item.h b/include/item.h
index cd9964e..03594fe 100644
--- a/include/item.h
+++ b/include/item.h
@@ -4,83 +4,82 @@
namespace mod::item
{
-
- /**
- * Returns the flag(s) to an item under certain conditions
- *
- * @param item Internal item ID
- * @param currentPlayerConditions Current conditions of the player
- */
- u32 getFlags(u8 item, u32 currentPlayerConditions);
+ /**
+ * Returns the flag(s) to an item under certain conditions
+ *
+ * @param item Internal item ID
+ * @param currentPlayerConditions Current conditions of the player
+ */
+ u32 getFlags( u8 item, u32 currentPlayerConditions );
- /**
- * Bitwise conditions for ItemCheck
- */
- enum Condition : u32
- {
- OR = 0b000000000000000000000,
- AND = 0b100000000000000000000,
- Lantern = 0b010000000000000000000,//0x48
- Iron_Boots = 0b001000000000000000000,//0x45
- Boomerang = 0b000100000000000000000,//0x40
- Slingshot = 0b000010000000000000000,//0x4B
- Bow = 0b000001000000000000000,//0x43
- Bombs = 0b000000100000000000000,//0x70 0x51
- Water_Bombs = 0b000000010000000000000,//0x70 0x51
- Bomb_Arrows = 0b000000001000000000000,//0x43 0x70 0x51
- Ball_And_Chain = 0b000000000100000000000,//0x42
- Clawshot = 0b000000000010000000000,//0x44
- Double_Clawshot = 0b000000000001000000000,//0x47
- Spinner = 0b000000000000100000000,//0x41
- Dominion_Rod = 0b000000000000010000000,//0x46
- Zora_Armor = 0b000000000000001000000,//0x31
- Small_Key = 0b000000000000000100000,//locked
- Coral_Earring = 0b000000000000000010000,//0x3D
- Wooden_Sword = 0b000000000000000001000,//0x3F
- Ordon_Sword = 0b000000000000000000100,//0x28
- Shadow_Crystal = 0b000000000000000000010,//0x32
- Shield = 0b000000000000000000001,//0x2C
- };
+ /**
+ * Bitwise conditions for ItemCheck
+ */
+ enum Condition : u32
+ {
+ OR = 0b000000000000000000000,
+ AND = 0b100000000000000000000,
+ Lantern = 0b010000000000000000000, // 0x48
+ Iron_Boots = 0b001000000000000000000, // 0x45
+ Boomerang = 0b000100000000000000000, // 0x40
+ Slingshot = 0b000010000000000000000, // 0x4B
+ Bow = 0b000001000000000000000, // 0x43
+ Bombs = 0b000000100000000000000, // 0x70 0x51
+ Water_Bombs = 0b000000010000000000000, // 0x70 0x51
+ Bomb_Arrows = 0b000000001000000000000, // 0x43 0x70 0x51
+ Ball_And_Chain = 0b000000000100000000000, // 0x42
+ Clawshot = 0b000000000010000000000, // 0x44
+ Double_Clawshot = 0b000000000001000000000, // 0x47
+ Spinner = 0b000000000000100000000, // 0x41
+ Dominion_Rod = 0b000000000000010000000, // 0x46
+ Zora_Armor = 0b000000000000001000000, // 0x31
+ Small_Key = 0b000000000000000100000, // locked
+ Coral_Earring = 0b000000000000000010000, // 0x3D
+ Wooden_Sword = 0b000000000000000001000, // 0x3F
+ Ordon_Sword = 0b000000000000000000100, // 0x28
+ Shadow_Crystal = 0b000000000000000000010, // 0x32
+ Shield = 0b000000000000000000001, // 0x2C
+ };
- enum ItemType : u8
- {
- Equip = 0,
- Gear = 1,
- Dungeon = 2,
- HeartPiece = 3,
- Story = 4,
- Ammo = 5,
- Misc = 6,
- Rupee = 7,
- Key = 8,
- Bottle = 9,
- Bug = 10,
- PoeSoul = 11,
- Shop = 12,
- Skill = 13,
- Scent = 14
- };
+ enum ItemType : u8
+ {
+ Equip = 0,
+ Gear = 1,
+ Dungeon = 2,
+ HeartPiece = 3,
+ Story = 4,
+ Ammo = 5,
+ Misc = 6,
+ Rupee = 7,
+ Key = 8,
+ Bottle = 9,
+ Bug = 10,
+ PoeSoul = 11,
+ Shop = 12,
+ Skill = 13,
+ Scent = 14
+ };
- /**
- * Contains item check info
- */
- struct ItemCheck
- {
- u8 itemID;
- u8 type;
- char* stage;
- u8 room;
- u8 sourceLayer;
- u8 destLayer;
- u32 condition;
- float position[3];
- ItemCheck* source;
- ItemCheck* destination;
- };
+ /**
+ * Contains item check info
+ */
+ struct ItemCheck
+ {
+ u8 itemID;
+ u8 type;
+ char* stage;
+ u8 room;
+ u8 sourceLayer;
+ u8 destLayer;
+ u32 condition;
+ float position[3];
+ ItemCheck* source;
+ ItemCheck* destination;
+ };
- /**
- * Contains the values for the flags to be set to skip the animations of first getting specific items
- */
- extern u8 itemGetAnimationFlags[10];
- extern u8 itemsWithNoFieldModel[2];
-} \ No newline at end of file
+ /**
+ * Contains the values for the flags to be set to skip the animations of first getting specific items
+ */
+ extern u8 itemGetAnimationFlags[10];
+ extern u8 itemsWithNoFieldModel[2];
+} // namespace mod::item \ No newline at end of file
diff --git a/include/itemChecks.h b/include/itemChecks.h
index a45acfe..93c9a56 100644
--- a/include/itemChecks.h
+++ b/include/itemChecks.h
@@ -5,6 +5,6 @@
namespace mod::item
{
- extern ItemCheck checks[505];
- extern u16 checkPriorityOrder[24];
-} \ No newline at end of file
+ extern ItemCheck checks[505];
+ extern u16 checkPriorityOrder[24];
+} // namespace mod::item \ No newline at end of file
diff --git a/include/items.h b/include/items.h
index 85f9608..d16bd13 100644
--- a/include/items.h
+++ b/include/items.h
@@ -4,263 +4,263 @@
namespace mod::items
{
- enum Item : u8
- {
- Recovery_Heart = 0x00,
- Green_Rupee = 0x01,
- Blue_Rupee = 0x02,
- Yellow_Rupee = 0x03,
- Red_Rupee = 0x04,
- Purple_Rupee = 0x05,
- Orange_Rupee = 0x06,
- Silver_Rupee = 0x07,
- /*Borrow_Bomb_Bag? = 0x08,*/
- /*Bomb_Bag_And_Bombs? = 0x09,*/
- Bombs_5 = 0x0A,
- Bombs_10 = 0x0B,
- Bombs_20 = 0x0C,
- Bombs_30 = 0x0D,
- Arrows_10 = 0x0E,
- Arrows_20 = 0x0F,
- Arrows_30 = 0x10,
- Arrows_1 = 0x11,
- Seeds_50 = 0x12,
- /*? = 0x13,*/
- /*? = 0x14,*/
- /*? = 0x15,*/
- Water_Bombs_5 = 0x16,
- Water_Bombs_10 = 0x17,
- Water_Bombs_15 = 0x18,
- Water_Bombs_3 = 0x19,
- Bomblings_5 = 0x1A,
- Bomblings_10 = 0x1B,
- Bomblings_3 = 0x1C,
- Bombling_1 = 0x1D,
- Fairy = 0x1E,
- Recovery_Heart_x3 = 0x1F,
- Small_Key = 0x20,
- Piece_of_Heart = 0x21,
- Heart_Container = 0x22,
- Dungeon_Map = 0x23,
- Compass = 0x24,
- Ooccoo_FT = 0x25,
- Big_Key = 0x26,
- Ooccoo_Jr = 0x27,
- Ordon_Sword = 0x28,
- Master_Sword = 0x29,
- Ordon_Shield = 0x2A,
- Wooden_Shield = 0x2B,
- Hylian_Shield = 0x2C,
- Ooccoos_Note = 0x2D,
- Ordon_Clothing = 0x2E,
- Heros_Clothes = 0x2F,
- Magic_Armor = 0x30,
- Zora_Armor = 0x31,
- /*does notting*/Shadow_Crystal = 0x32,
- Ooccoo_Dungeon = 0x33,
- /*unused*/Small_Wallet = 0x34,
- Big_Wallet = 0x35,
- Giant_Wallet = 0x36,
- /*Piece_of_Heart_2? = 0x37,*/
- /*Piece_of_Heart_3? = 0x38,*/
- /*Piece_of_Heart_4? = 0x39,*/
- /*Piece_of_Heart_5? = 0x3A,*/
- /*sword? = 0x3B,*/
- /*? = 0x3C,*/
- Coral_Earring = 0x3D,
- Hawkeye = 0x3E,
- Wooden_Sword = 0x3F,
- Boomerang = 0x40,
- Spinner = 0x41,
- Ball_and_Chain = 0x42,
- Heros_Bow = 0x43,
- Clawshot = 0x44,
- Iron_Boots = 0x45,
- Dominion_Rod = 0x46,
- Clawshots = 0x47,
- Lantern = 0x48,
- Master_Sword_Light = 0x49,
- Fishing_Rod = 0x4A,
- Slingshot = 0x4B,
- Dominion_Rod_Uncharged = 0x4C,
- /*? = 0x4D,*/
- /*? = 0x4E,*/
- Giant_Bomb_Bag = 0x4F,
- Empty_Bomb_Bag = 0x50,
- Goron_Bomb_Bag = 0x51,
- /*Giant_Bomb_Bag? = 0x52,*/
- /*? = 0x53,*/
- /*unused*/Small_Quiver = 0x54,
- Big_Quiver = 0x55,
- Giant_Quiver = 0x56,
- /*? = 0x57,*/
- Fishing_Rod_Lure = 0x58,
- Bow_Bombs = 0x59,
- Bow_Hawkeye = 0x5A,
- Fishing_Rod_Bee_Larva = 0x5B,
- Fishing_Rod_Coral_Earring = 0x5C,
- Fishing_Rod_Worm = 0x5D,
- Fishing_Rod_Earring_Bee_Larva = 0x5E,
- Fishing_Rod_Earring_Worm = 0x5F,
- Empty_Bottle = 0x60,
- Red_Potion_Shop = 0x61,
- Green_Potion = 0x62,
- Blue_Potion = 0x63,
- Milk = 0x64,
- Sera_Bottle = 0x65,
- Lantern_Oil_Shop = 0x66,
- Water = 0x67,
- Lantern_Oil_Scooped = 0x68,
- Red_Potion_Scooped = 0x69,
- Nasty_soup = 0x6A,
- Hot_spring_water_Scooped = 0x6B,
- Fairy_Bottle = 0x6C,
- Hot_Spring_Water_Shop = 0x6D,
- Lantern_Refill_Scooped = 0x6E,
- Lantern_Refill_Shop = 0x6F,
- Bomb_Bag_Regular_Bombs = 0x70,
- Bomb_Bag_Water_Bombs = 0x71,
- Bomb_Bag_Bomblings = 0x72,
- Fairy_Tears = 0x73,
- Worm = 0x74,
- Jovani_Bottle = 0x75,
- Bee_Larva_Scooped = 0x76,
- Rare_Chu_Jelly = 0x77,
- Red_Chu_Jelly = 0x78,
- Blue_Chu_Jelly = 0x79,
- Green_Chu_Jelly = 0x7A,
- Yellow_Chu_Jelly = 0x7B,
- Purple_Chu_Jelly = 0x7C,
- Simple_Soup = 0x7D,
- Good_Soup = 0x7E,
- Superb_Soup = 0x7F,
- Renardos_Letter = 0x80,
- Invoice = 0x81,
- Wooden_Statue = 0x82,
- Ilias_Charm = 0x83,
- Horse_Call = 0x84,
- /*? = 0x85,*/
- /*? = 0x86,*/
- /*? = 0x87,*/
- /*? = 0x88,*/
- /*? = 0x89,*/
- /*? = 0x8A,*/
- /*? = 0x8B,*/
- /*? = 0x8C,*/
- /*? = 0x8D,*/
- /*? = 0x8E,*/
- /*? = 0x8F,*/
- Aurus_Memo = 0x90,
- Asheis_Sketch = 0x91,
- /*? = 0x92,*/
- /*? = 0x93,*/
- /*? = 0x94,*/
- /*? = 0x95,*/
- /*? = 0x96,*/
- /*? = 0x97,*/
- /*? = 0x98,*/
- /*? = 0x99,*/
- /*? = 0x9A,*/
- /*? = 0x9B,*/
- Lantern_Yellow_Chu_Chu = 0x9C,
- Coro_Bottle = 0x9D,
- Bee_Larva_Shop = 0x9E,
- Black_Chu_Jelly = 0x9F,
- /*unused*/Tear_Of_Light = 0xA0,
- Vessel_Of_Light_Faron = 0xA1,
- Vessel_Of_Light_Eldin = 0xA2,
- Vessel_Of_Light_Lanayru = 0xA3,
- /*unused*/Vessel_Of_Light_Full = 0xA4,
- /*? = 0xA5,*/
- /*? = 0xA6,*/
- /*? = 0xA7,*/
- /*? = 0xA8,*/
- /*? = 0xA9,*/
- /*? = 0xAA,*/
- /*? = 0xAB,*/
- /*? = 0xAC,*/
- /*? = 0xAD,*/
- /*? = 0xAE,*/
- /*? = 0xAF,*/
- Ilias_Scent = 0xB0,
- /*Unused_Scent? = 0xB1,*/
- Poe_Scent = 0xB2,
- Reekfish_Scent = 0xB3,
- Youths_Scent = 0xB4,
- Medicine_Scent = 0xB5,
- /*? = 0xB6,*/
- /*? = 0xB7,*/
- /*? = 0xB8,*/
- /*? = 0xB9,*/
- /*? = 0xBA,*/
- /*? = 0xBB,*/
- /*? = 0xBC,*/
- /*? = 0xBD,*/
- /*? = 0xBE,*/
- /*Bottle_Insides? = 0xBF,*/
- Male_Beetle = 0xC0,
- Female_Beetle = 0xC1,
- Male_Butterfly = 0xC2,
- Female_Butterfly = 0xC3,
- Male_Stag_Beetle = 0xC4,
- Female_Stag_Beetle = 0xC5,
- Male_Grasshopper = 0xC6,
- Female_Grasshopper = 0xC7,
- Male_Phasmid = 0xC8,
- Female_Phasmid = 0xC9,
- Male_Pill_Bug = 0xCA,
- Female_Pill_Bug = 0xCB,
- Male_Mantis = 0xCC,
- Female_Mantis = 0xCD,
- Male_Ladybug = 0xCE,
- Female_Ladybug = 0xCF,
- Male_Snail = 0xD0,
- Female_Snail = 0xD1,
- Male_Dragonfly = 0xD2,
- Female_Dragonfly = 0xD3,
- Male_Ant = 0xD4,
- Female_Ant = 0xD5,
- Male_Dayfly = 0xD6,
- Female_Dayfly = 0xD7,
- /*? = 0xD8,*/
- /*? = 0xD9,*/
- /*? = 0xDA,*/
- /*? = 0xDB,*/
- /*? = 0xDC,*/
- /*? = 0xDD,*/
- /*? = 0xDE,*/
- /*? = 0xDF,*/
- Poe_Soul = 0xE0,
- /*? = 0xE1,*/
- /*? = 0xE2,*/
- /*? = 0xE3,*/
- /*? = 0xE4,*/
- /*? = 0xE5,*/
- /*? = 0xE6,*/
- /*? = 0xE7,*/
- /*? = 0xE8,*/
- Ancient_Sky_Book_empty = 0xE9,
- Ancient_Sky_Book_partly_filled = 0xEA,
- Ancient_Sky_Book_completed = 0xEB,
- Ooccoo_CitS = 0xEC,
- Purple_Rupee_Links_house = 0xED,
- Small_Key_N_Faron_Gate = 0xEE,
- /*Blue_Fire? = 0xEF,*/
- /*Blue_Fire? = 0xF0,*/
- /*Blue_Fire? = 0xF1,*/
- /*Blue_Fire? = 0xF2,*/
- Gate_Keys = 0xF3,
- Ordon_Pumpkin = 0xF4,
- Ordon_Goat_Cheese = 0xF5,
- Bed_Key = 0xF6,
- /*Shield? = 0xF7,*/
- Got_Lantern_Back = 0xF8,
- Key_Shard_1 = 0xF9,
- Key_Shard_2 = 0xFA,
- Key_Shard_3 = 0xFB,
- /*Key? = 0xFC,*/
- Big_Key_Goron_Mines = 0xFD,
- Coro_Key = 0xFE,
- /*Gives_Vanilla*/NullItem = 0xFF
- };
+ enum Item : u8
+ {
+ Recovery_Heart = 0x00,
+ Green_Rupee = 0x01,
+ Blue_Rupee = 0x02,
+ Yellow_Rupee = 0x03,
+ Red_Rupee = 0x04,
+ Purple_Rupee = 0x05,
+ Orange_Rupee = 0x06,
+ Silver_Rupee = 0x07,
+ /*Borrow_Bomb_Bag? = 0x08,*/
+ /*Bomb_Bag_And_Bombs? = 0x09,*/
+ Bombs_5 = 0x0A,
+ Bombs_10 = 0x0B,
+ Bombs_20 = 0x0C,
+ Bombs_30 = 0x0D,
+ Arrows_10 = 0x0E,
+ Arrows_20 = 0x0F,
+ Arrows_30 = 0x10,
+ Arrows_1 = 0x11,
+ Seeds_50 = 0x12,
+ /*? = 0x13,*/
+ /*? = 0x14,*/
+ /*? = 0x15,*/
+ Water_Bombs_5 = 0x16,
+ Water_Bombs_10 = 0x17,
+ Water_Bombs_15 = 0x18,
+ Water_Bombs_3 = 0x19,
+ Bomblings_5 = 0x1A,
+ Bomblings_10 = 0x1B,
+ Bomblings_3 = 0x1C,
+ Bombling_1 = 0x1D,
+ Fairy = 0x1E,
+ Recovery_Heart_x3 = 0x1F,
+ Small_Key = 0x20,
+ Piece_of_Heart = 0x21,
+ Heart_Container = 0x22,
+ Dungeon_Map = 0x23,
+ Compass = 0x24,
+ Ooccoo_FT = 0x25,
+ Big_Key = 0x26,
+ Ooccoo_Jr = 0x27,
+ Ordon_Sword = 0x28,
+ Master_Sword = 0x29,
+ Ordon_Shield = 0x2A,
+ Wooden_Shield = 0x2B,
+ Hylian_Shield = 0x2C,
+ Ooccoos_Note = 0x2D,
+ Ordon_Clothing = 0x2E,
+ Heros_Clothes = 0x2F,
+ Magic_Armor = 0x30,
+ Zora_Armor = 0x31,
+ /*does notting*/ Shadow_Crystal = 0x32,
+ Ooccoo_Dungeon = 0x33,
+ /*unused*/ Small_Wallet = 0x34,
+ Big_Wallet = 0x35,
+ Giant_Wallet = 0x36,
+ /*Piece_of_Heart_2? = 0x37,*/
+ /*Piece_of_Heart_3? = 0x38,*/
+ /*Piece_of_Heart_4? = 0x39,*/
+ /*Piece_of_Heart_5? = 0x3A,*/
+ /*sword? = 0x3B,*/
+ /*? = 0x3C,*/
+ Coral_Earring = 0x3D,
+ Hawkeye = 0x3E,
+ Wooden_Sword = 0x3F,
+ Boomerang = 0x40,
+ Spinner = 0x41,
+ Ball_and_Chain = 0x42,
+ Heros_Bow = 0x43,
+ Clawshot = 0x44,
+ Iron_Boots = 0x45,
+ Dominion_Rod = 0x46,
+ Clawshots = 0x47,
+ Lantern = 0x48,
+ Master_Sword_Light = 0x49,
+ Fishing_Rod = 0x4A,
+ Slingshot = 0x4B,
+ Dominion_Rod_Uncharged = 0x4C,
+ /*? = 0x4D,*/
+ /*? = 0x4E,*/
+ Giant_Bomb_Bag = 0x4F,
+ Empty_Bomb_Bag = 0x50,
+ Goron_Bomb_Bag = 0x51,
+ /*Giant_Bomb_Bag? = 0x52,*/
+ /*? = 0x53,*/
+ /*unused*/ Small_Quiver = 0x54,
+ Big_Quiver = 0x55,
+ Giant_Quiver = 0x56,
+ /*? = 0x57,*/
+ Fishing_Rod_Lure = 0x58,
+ Bow_Bombs = 0x59,
+ Bow_Hawkeye = 0x5A,
+ Fishing_Rod_Bee_Larva = 0x5B,
+ Fishing_Rod_Coral_Earring = 0x5C,
+ Fishing_Rod_Worm = 0x5D,
+ Fishing_Rod_Earring_Bee_Larva = 0x5E,
+ Fishing_Rod_Earring_Worm = 0x5F,
+ Empty_Bottle = 0x60,
+ Red_Potion_Shop = 0x61,
+ Green_Potion = 0x62,
+ Blue_Potion = 0x63,
+ Milk = 0x64,
+ Sera_Bottle = 0x65,
+ Lantern_Oil_Shop = 0x66,
+ Water = 0x67,
+ Lantern_Oil_Scooped = 0x68,
+ Red_Potion_Scooped = 0x69,
+ Nasty_soup = 0x6A,
+ Hot_spring_water_Scooped = 0x6B,
+ Fairy_Bottle = 0x6C,
+ Hot_Spring_Water_Shop = 0x6D,
+ Lantern_Refill_Scooped = 0x6E,
+ Lantern_Refill_Shop = 0x6F,
+ Bomb_Bag_Regular_Bombs = 0x70,
+ Bomb_Bag_Water_Bombs = 0x71,
+ Bomb_Bag_Bomblings = 0x72,
+ Fairy_Tears = 0x73,
+ Worm = 0x74,
+ Jovani_Bottle = 0x75,
+ Bee_Larva_Scooped = 0x76,
+ Rare_Chu_Jelly = 0x77,
+ Red_Chu_Jelly = 0x78,
+ Blue_Chu_Jelly = 0x79,
+ Green_Chu_Jelly = 0x7A,
+ Yellow_Chu_Jelly = 0x7B,
+ Purple_Chu_Jelly = 0x7C,
+ Simple_Soup = 0x7D,
+ Good_Soup = 0x7E,
+ Superb_Soup = 0x7F,
+ Renardos_Letter = 0x80,
+ Invoice = 0x81,
+ Wooden_Statue = 0x82,
+ Ilias_Charm = 0x83,
+ Horse_Call = 0x84,
+ /*? = 0x85,*/
+ /*? = 0x86,*/
+ /*? = 0x87,*/
+ /*? = 0x88,*/
+ /*? = 0x89,*/
+ /*? = 0x8A,*/
+ /*? = 0x8B,*/
+ /*? = 0x8C,*/
+ /*? = 0x8D,*/
+ /*? = 0x8E,*/
+ /*? = 0x8F,*/
+ Aurus_Memo = 0x90,
+ Asheis_Sketch = 0x91,
+ /*? = 0x92,*/
+ /*? = 0x93,*/
+ /*? = 0x94,*/
+ /*? = 0x95,*/
+ /*? = 0x96,*/
+ /*? = 0x97,*/
+ /*? = 0x98,*/
+ /*? = 0x99,*/
+ /*? = 0x9A,*/
+ /*? = 0x9B,*/
+ Lantern_Yellow_Chu_Chu = 0x9C,
+ Coro_Bottle = 0x9D,
+ Bee_Larva_Shop = 0x9E,
+ Black_Chu_Jelly = 0x9F,
+ /*unused*/ Tear_Of_Light = 0xA0,
+ Vessel_Of_Light_Faron = 0xA1,
+ Vessel_Of_Light_Eldin = 0xA2,
+ Vessel_Of_Light_Lanayru = 0xA3,
+ /*unused*/ Vessel_Of_Light_Full = 0xA4,
+ /*? = 0xA5,*/
+ /*? = 0xA6,*/
+ /*? = 0xA7,*/
+ /*? = 0xA8,*/
+ /*? = 0xA9,*/
+ /*? = 0xAA,*/
+ /*? = 0xAB,*/
+ /*? = 0xAC,*/
+ /*? = 0xAD,*/
+ /*? = 0xAE,*/
+ /*? = 0xAF,*/
+ Ilias_Scent = 0xB0,
+ /*Unused_Scent? = 0xB1,*/
+ Poe_Scent = 0xB2,
+ Reekfish_Scent = 0xB3,
+ Youths_Scent = 0xB4,
+ Medicine_Scent = 0xB5,
+ /*? = 0xB6,*/
+ /*? = 0xB7,*/
+ /*? = 0xB8,*/
+ /*? = 0xB9,*/
+ /*? = 0xBA,*/
+ /*? = 0xBB,*/
+ /*? = 0xBC,*/
+ /*? = 0xBD,*/
+ /*? = 0xBE,*/
+ /*Bottle_Insides? = 0xBF,*/
+ Male_Beetle = 0xC0,
+ Female_Beetle = 0xC1,
+ Male_Butterfly = 0xC2,
+ Female_Butterfly = 0xC3,
+ Male_Stag_Beetle = 0xC4,
+ Female_Stag_Beetle = 0xC5,
+ Male_Grasshopper = 0xC6,
+ Female_Grasshopper = 0xC7,
+ Male_Phasmid = 0xC8,
+ Female_Phasmid = 0xC9,
+ Male_Pill_Bug = 0xCA,
+ Female_Pill_Bug = 0xCB,
+ Male_Mantis = 0xCC,
+ Female_Mantis = 0xCD,
+ Male_Ladybug = 0xCE,
+ Female_Ladybug = 0xCF,
+ Male_Snail = 0xD0,
+ Female_Snail = 0xD1,
+ Male_Dragonfly = 0xD2,
+ Female_Dragonfly = 0xD3,
+ Male_Ant = 0xD4,
+ Female_Ant = 0xD5,
+ Male_Dayfly = 0xD6,
+ Female_Dayfly = 0xD7,
+ /*? = 0xD8,*/
+ /*? = 0xD9,*/
+ /*? = 0xDA,*/
+ /*? = 0xDB,*/
+ /*? = 0xDC,*/
+ /*? = 0xDD,*/
+ /*? = 0xDE,*/
+ /*? = 0xDF,*/
+ Poe_Soul = 0xE0,
+ /*? = 0xE1,*/
+ /*? = 0xE2,*/
+ /*? = 0xE3,*/
+ /*? = 0xE4,*/
+ /*? = 0xE5,*/
+ /*? = 0xE6,*/
+ /*? = 0xE7,*/
+ /*? = 0xE8,*/
+ Ancient_Sky_Book_empty = 0xE9,
+ Ancient_Sky_Book_partly_filled = 0xEA,
+ Ancient_Sky_Book_completed = 0xEB,
+ Ooccoo_CitS = 0xEC,
+ Purple_Rupee_Links_house = 0xED,
+ Small_Key_N_Faron_Gate = 0xEE,
+ /*Blue_Fire? = 0xEF,*/
+ /*Blue_Fire? = 0xF0,*/
+ /*Blue_Fire? = 0xF1,*/
+ /*Blue_Fire? = 0xF2,*/
+ Gate_Keys = 0xF3,
+ Ordon_Pumpkin = 0xF4,
+ Ordon_Goat_Cheese = 0xF5,
+ Bed_Key = 0xF6,
+ /*Shield? = 0xF7,*/
+ Got_Lantern_Back = 0xF8,
+ Key_Shard_1 = 0xF9,
+ Key_Shard_2 = 0xFA,
+ Key_Shard_3 = 0xFB,
+ /*Key? = 0xFC,*/
+ Big_Key_Goron_Mines = 0xFD,
+ Coro_Key = 0xFE,
+ /*Gives_Vanilla*/ NullItem = 0xFF
+ };
} \ No newline at end of file
diff --git a/include/keyPlacement.h b/include/keyPlacement.h
index 9ea0017..31a9bae 100644
--- a/include/keyPlacement.h
+++ b/include/keyPlacement.h
@@ -4,64 +4,64 @@
namespace mod::keyPlacement
{
- extern u16 FT_keys[4];
- extern u16 FT_1[5];
- extern u16 FT_2[5];
- extern u16 FT_3[9];
- extern u16 FT_4[9];
+ extern u16 FT_keys[4];
+ extern u16 FT_1[5];
+ extern u16 FT_2[5];
+ extern u16 FT_3[9];
+ extern u16 FT_4[9];
- extern u16 GM_keys[3];
- extern u16 GM_1[2];
- extern u16 GM_2[10];
- extern u16 GM_3[12];
+ extern u16 GM_keys[3];
+ extern u16 GM_1[2];
+ extern u16 GM_2[10];
+ extern u16 GM_3[12];
- extern u16 LBT_keys[3];
- extern u16 LBT_1[7];
- extern u16 LBT_2[9];
- extern u16 LBT_3[11];
+ extern u16 LBT_keys[3];
+ extern u16 LBT_1[7];
+ extern u16 LBT_2[9];
+ extern u16 LBT_3[11];
- extern u16 AG_keys[5];
- extern u16 AG_1[1];
- extern u16 AG_2[7];
- extern u16 AG_3[9];
- extern u16 AG_4[11];
- extern u16 AG_5[16];
+ extern u16 AG_keys[5];
+ extern u16 AG_1[1];
+ extern u16 AG_2[7];
+ extern u16 AG_3[9];
+ extern u16 AG_4[11];
+ extern u16 AG_5[16];
- extern u16 SPR_keys[6];
- extern u16 SPR_1[5];
- extern u16 SPR_2[6];
- extern u16 SPR_3[10];
- extern u16 SPR_4[13];
- extern u16 SPR_5[19];
- extern u16 SPR_6[22];
+ extern u16 SPR_keys[6];
+ extern u16 SPR_1[5];
+ extern u16 SPR_2[6];
+ extern u16 SPR_3[10];
+ extern u16 SPR_4[13];
+ extern u16 SPR_5[19];
+ extern u16 SPR_6[22];
- extern u16 ToT_keys[3];
- extern u16 ToT_1[2];
- extern u16 ToT_2[8];
- extern u16 ToT_3[16];
+ extern u16 ToT_keys[3];
+ extern u16 ToT_1[2];
+ extern u16 ToT_2[8];
+ extern u16 ToT_3[16];
- extern u16 CitS_keys[1];
- extern u16 CitS_1[7];
+ extern u16 CitS_keys[1];
+ extern u16 CitS_1[7];
- extern u16 PoT_keys[7];
- extern u16 PoT_1[1];
- extern u16 PoT_2[4];
- extern u16 PoT_3[6];
- extern u16 PoT_4[10];
- extern u16 PoT_5[14];
- extern u16 PoT_6[16];
- extern u16 PoT_7[17];
+ extern u16 PoT_keys[7];
+ extern u16 PoT_1[1];
+ extern u16 PoT_2[4];
+ extern u16 PoT_3[6];
+ extern u16 PoT_4[10];
+ extern u16 PoT_5[14];
+ extern u16 PoT_6[16];
+ extern u16 PoT_7[17];
- extern u16 HC_keys[3];
- extern u16 HC_1[9];
- extern u16 HC_2[15];
- extern u16 HC_3[15];
+ extern u16 HC_keys[3];
+ extern u16 HC_1[9];
+ extern u16 HC_2[15];
+ extern u16 HC_3[15];
- extern u16 F_keys[2];
- extern u16 F_1[4];
- extern u16 F_2[2];
+ extern u16 F_keys[2];
+ extern u16 F_1[4];
+ extern u16 F_2[2];
- extern u16 GD_keys[1];
- extern u16 GD_1[21];
+ extern u16 GD_keys[1];
+ extern u16 GD_1[21];
-} \ No newline at end of file
+} // namespace mod::keyPlacement \ No newline at end of file
diff --git a/include/memory.h b/include/memory.h
index 26beaf4..0cf6919 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -4,9 +4,9 @@
namespace mod::memory
{
- extern "C"
- {
- void* clearMemory(void* ptr, size_t size);
- void clear_DC_IC_Cache(void* ptr, u32 size);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ void* clearMemory( void* ptr, size_t size );
+ void clear_DC_IC_Cache( void* ptr, u32 size );
+ }
+} // namespace mod::memory \ No newline at end of file
diff --git a/include/mod.h b/include/mod.h
index 9a650ba..880689f 100644
--- a/include/mod.h
+++ b/include/mod.h
@@ -1,260 +1,307 @@
#pragma once
-#include "defines.h"
-#include <tp/d_com_inf_game.h>
#include <tp/DynamicLink.h>
+#include <tp/d_com_inf_game.h>
#include <tp/dzx.h>
-#include "eventListener.h"
-#include "chestRando.h"
-#include "HUDConsole.h"
+
#include <string>
+#include "HUDConsole.h"
+#include "chestRando.h"
+#include "defines.h"
+#include "eventListener.h"
+
namespace mod
{
- class Mod
- {
- public:
- Mod();
- /**
- * Init this and other stuff in order for all
- * modifications to work
- */
- void init();
-
- /**
- * Custom event listener that can
- * schedule function calls
- */
- event::EventListener* eventListener;
- ChestRandomizer* chestRandomizer;
- HUDConsole* hudConsole;
-
- // Options
- u8 customSeed; // Use custom seed?
- u8 randoEnabled; // Randomize chests?
- u8 truePause; // Disable controls during console?
- u8 inputBuffering; // En/Disable buffering
-
- //item search
- u8 lastItemSearchID;
- u8 itemSearchID;
-
- u8 lastItemReverseSearchID;
- u8 itemReverseSearchID;
- char itemSearchResults[30];
- char itemReverseSearchResults[30];
-
- //check search
- u8 checkSearchID1;
- u8 checkSearchID2;
-
- u8 checkReverseSearchID1;
- u8 checkReverseSearchID2;
-
- u16 lastCheckSearchID;
- u16 checkSearchID;
-
- u16 lastCheckReverseSearchID;
- u16 checkReverseSearchID;
- char checkSearchResults[30];
- char checkReverseSearchResults[30];
-
- // Debug info
- char lastItemFunc[32]; // Last called item create function
- char lastItemDataID[5];
- char lastItemDataX[30];
- char lastItemDataY[30];
- char lastItemDataZ[30];
-
- char currentPosX[30];
- char currentPosY[30];
- char currentPosZ[30];
-
- char linkAngle[30];
-
- u8 coordsAreInHex = 0;
-
- // Replacment handler
- s32 procItemCreateFunc(const float pos[3], s32 item, const char funcIdentifier[32]);
-
- u8 enableNormalTime = 1;
- u8 setDay = 1;
-
- u32 skyAngle;
-
- u8 enableQuickTransform = 1;
-
- u8 stage = 0;
- u8 room = 0;
- u8 spawn = 0;
- u8 state = 0;
- u8 trigerLoadSave = 0;
-
- u8 dungeonFlagsView1;
- u8 dungeonFlagsView2;
- u8 dungeonFlagsView3;
- u8 dungeonFlagsView4;
- u8 dungeonFlagsView5;
- u8 dungeonFlagsView6;
- u8 dungeonFlagsView7;
- u8 dungeonFlagsView8;
- u8 dungeonFlagsViewEdit;
-
- u16 colorResult;
-
- u8 topToggle = 1;
- u8 redTop = 0;
- u8 greenTop = 0;
- u8 blueTop = 0;
- u8 bottomToggle = 1;
- u8 redBottom = 0;
- u8 greenBottom = 0;
- u8 blueBottom = 0;
-
- u8 bottle4Contents;
- u8 bottleTrickOn = 0;
- u8 allowBottleItemsShopAnytime = 1;
- u8 shieldTrickOn = 0;
- u8 hadHShield;
- u8 hadOShield;
- u8 hadWShield;
- u8 bombBagTrickOn = 0;
- u8 bombBag1Contents;
- u8 bombBag2Contents;
- u8 bombBag3Contents;
- u8 bombBag1Ammo;
- u8 bombBag2Ammo;
- u8 bombBag3Ammo;
- u8 lastGoodSpawn;
-
- u8 yetaTrickOn = 0;
-
- u8 LBTBossDoorTrickOn = 0;
- u8 nbLBTKeys = 0;
-
- u8 eventFlagToEdit = 0;
- u8 newValueForEventFlag = 0;
- u8 triggerEventFlagEdit = 0;
- u8 innerRed = 0x50;
- u8 innerGreen = 0x28;
- u8 innerBlue = 0x14;
- u8 outerRed = 0x28;
- u8 outerGreen = 0x1E;
- u8 outerBlue = 0x0A;
-
- char itemName[10];
- //u8 newItemId;
-
- // Functions
- private:
- /**
- * Runs once each frame
- */
- void procNewFrame();
-
- /**
- * Runs when checking if the treasure chest content
- * should be returned or can be obtained
- */
- bool procCheckTreasureRupeeReturn(void* unk1, s32 item);
-
- s32 procEvtSkipper(void* evtPtr);
-
- bool proc_query022(void* unk1, void* unk2, s32 unk3);
-
- bool procDoLink(tp::dynamic_link::DynamicModuleControl* dmc);
-
- void procItem_func_UTUWA_HEART();
-
- bool canQuickTransform();
-
- bool canChangeToD();
-
- /**
- * gives the unlocked scent that can be seen in the current area (defaults to most advanced one obtained)
- */
- void giveAllStoryItems();
-
- /**
- * order the item wheel correctly
- */
- void reorderItemWheel();
-
- /**
- * Allows Yeta to always be in the living room even with the BK
- * Allows Yeto to always be in the kitchen even with the BK
- */
- void fixYetaAndYeto();
-
- /**
- * fix problem where opening LBT boss door removes a key
- */
- void fixLBTBossDoor();
-
- /**
- * removes the empty skybook if you are in the sanctuary basement
- */
- void preventPoweringUpDomRod();
-
- /**
- * gives the unlocked scent that can be seen in the current area (defaults to most advanced one obtained)
- */
- void giveAllScents();
-
- /**
- * renders all shop items buyable no matter what you have in you inv
- * only works for bottle items for now
- */
- void allowShopItemsAnytime();
-
- /**
- * checks if the current stage contains a shop
- */
- bool isStageShop();
-
- /**
- * Inserts custom TRES Boxes if applicable to this stage+room
- */
- void doCustomTRESActor(void* mStatus_roomControl);
-
- void changeLanternColor();
-
- void fixFTTotemMonkey();
-
- //void setFieldModels();
-
- //bool procActorCommonLayerInit(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, s32 unk3, void* unk4);
- // Private members
- //private:
-
-
- // Hook trampolines
- private:
- void (*fapGm_Execute_trampoline)() = nullptr;
-
- s32 (*evt_control_Skipper_trampoline)(void* eventPtr) = nullptr;
-
- bool (*query022_trampoline)(void* unk1, void* unk2, s32 unk3) = nullptr;
-
- bool (*do_link_trampoline)(tp::dynamic_link::DynamicModuleControl* dmc) = nullptr;
-
- bool (*checkTreasureRupeeReturn_trampoline)(void* unk1, s32 item) = nullptr;
-
- void (*item_func_UTUWA_HEART_trampoline)() = nullptr;
-
- bool (*actorCommonLayerInit_trampoline)(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, int unk3, void* unk4) = nullptr;
-
- void (*putSave_trampoline)(tp::d_com_inf_game::GameInfo* gameInfoPtr, s32 areaID) = nullptr;
-
- // Item functions
- s32 (*createItemForPresentDemo_trampoline)(const float pos[3], s32 item, u8 unk3, s32 unk4, s32 unk5, const float unk6[3], const float unk7[3]) = nullptr;
- s32 (*createItemForTrBoxDemo_trampoline)(const float pos[3], s32 item, s32 unk3, s32 unk4, const float unk5[3], const float unk6[3]) = nullptr;
- s32 (*createItemForBoss_trampoline)(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], float unk6, float unk7, s32 unk8) = nullptr;
- s32 (*createItemForMidBoss_trampoline)(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], s32 unk6, s32 unk7) = nullptr;
- s32 (*createItemForDirectGet_trampoline)(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], float unk6, float unk7) = nullptr;
- s32(*createItemForSimpleDemo_trampoline)(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], float unk6, float unk7) = nullptr;
- s32(*createItem_trampoline)(const float pos[3], s32 item, s32 unk3, s32 unk4, const float unk5[3], const float unk6[3], s32 unk7) = nullptr;
-
- void(*setItemBombNumCount_trampoline)(u32 unk1, u8 bagNb, short amount) = nullptr;
- };
-} \ No newline at end of file
+ class Mod
+ {
+ public:
+ Mod();
+ /**
+ * Init this and other stuff in order for all
+ * modifications to work
+ */
+ void init();
+
+ /**
+ * Custom event listener that can
+ * schedule function calls
+ */
+ event::EventListener* eventListener;
+ ChestRandomizer* chestRandomizer;
+ HUDConsole* hudConsole;
+
+ // Options
+ u8 customSeed; // Use custom seed?
+ u8 randoEnabled; // Randomize chests?
+ u8 truePause; // Disable controls during console?
+ u8 inputBuffering; // En/Disable buffering
+
+ // item search
+ u8 lastItemSearchID;
+ u8 itemSearchID;
+
+ u8 lastItemReverseSearchID;
+ u8 itemReverseSearchID;
+ char itemSearchResults[30];
+ char itemReverseSearchResults[30];
+
+ // check search
+ u8 checkSearchID1;
+ u8 checkSearchID2;
+
+ u8 checkReverseSearchID1;
+ u8 checkReverseSearchID2;
+
+ u16 lastCheckSearchID;
+ u16 checkSearchID;
+
+ u16 lastCheckReverseSearchID;
+ u16 checkReverseSearchID;
+ char checkSearchResults[30];
+ char checkReverseSearchResults[30];
+
+ // Debug info
+ char lastItemFunc[32]; // Last called item create function
+ char lastItemDataID[5];
+ char lastItemDataX[30];
+ char lastItemDataY[30];
+ char lastItemDataZ[30];
+
+ char currentPosX[30];
+ char currentPosY[30];
+ char currentPosZ[30];
+
+ char linkAngle[30];
+
+ u8 coordsAreInHex = 0;
+
+ // Replacment handler
+ s32 procItemCreateFunc( const float pos[3], s32 item, const char funcIdentifier[32] );
+
+ u8 enableNormalTime = 1;
+ u8 setDay = 1;
+
+ u32 skyAngle;
+
+ u8 enableQuickTransform = 1;
+
+ u8 stage = 0;
+ u8 room = 0;
+ u8 spawn = 0;
+ u8 state = 0;
+ u8 trigerLoadSave = 0;
+
+ u8 dungeonFlagsView1;
+ u8 dungeonFlagsView2;
+ u8 dungeonFlagsView3;
+ u8 dungeonFlagsView4;
+ u8 dungeonFlagsView5;
+ u8 dungeonFlagsView6;
+ u8 dungeonFlagsView7;
+ u8 dungeonFlagsView8;
+ u8 dungeonFlagsViewEdit;
+
+ u16 colorResult;
+
+ u8 topToggle = 1;
+ u8 redTop = 0;
+ u8 greenTop = 0;
+ u8 blueTop = 0;
+ u8 bottomToggle = 1;
+ u8 redBottom = 0;
+ u8 greenBottom = 0;
+ u8 blueBottom = 0;
+
+ u8 bottle4Contents;
+ u8 bottleTrickOn = 0;
+ u8 allowBottleItemsShopAnytime = 1;
+ u8 shieldTrickOn = 0;
+ u8 hadHShield;
+ u8 hadOShield;
+ u8 hadWShield;
+ u8 bombBagTrickOn = 0;
+ u8 bombBag1Contents;
+ u8 bombBag2Contents;
+ u8 bombBag3Contents;
+ u8 bombBag1Ammo;
+ u8 bombBag2Ammo;
+ u8 bombBag3Ammo;
+ u8 lastGoodSpawn;
+
+ u8 yetaTrickOn = 0;
+
+ u8 LBTBossDoorTrickOn = 0;
+ u8 nbLBTKeys = 0;
+
+ u8 eventFlagToEdit = 0;
+ u8 newValueForEventFlag = 0;
+ u8 triggerEventFlagEdit = 0;
+ u8 innerRed = 0x50;
+ u8 innerGreen = 0x28;
+ u8 innerBlue = 0x14;
+ u8 outerRed = 0x28;
+ u8 outerGreen = 0x1E;
+ u8 outerBlue = 0x0A;
+
+ char itemName[10];
+ // u8 newItemId;
+
+ // Functions
+ private:
+ /**
+ * Runs once each frame
+ */
+ void procNewFrame();
+
+ /**
+ * Runs when checking if the treasure chest content
+ * should be returned or can be obtained
+ */
+ bool procCheckTreasureRupeeReturn( void* unk1, s32 item );
+
+ s32 procEvtSkipper( void* evtPtr );
+
+ bool proc_query022( void* unk1, void* unk2, s32 unk3 );
+
+ bool procDoLink( tp::dynamic_link::DynamicModuleControl* dmc );
+
+ void procItem_func_UTUWA_HEART();
+
+ bool canQuickTransform();
+
+ bool canChangeToD();
+
+ /**
+ * gives the unlocked scent that can be seen in the current area (defaults to most advanced one obtained)
+ */
+ void giveAllStoryItems();
+
+ /**
+ * order the item wheel correctly
+ */
+ void reorderItemWheel();
+
+ /**
+ * Allows Yeta to always be in the living room even with the BK
+ * Allows Yeto to always be in the kitchen even with the BK
+ */
+ void fixYetaAndYeto();
+
+ /**
+ * fix problem where opening LBT boss door removes a key
+ */
+ void fixLBTBossDoor();
+
+ /**
+ * removes the empty skybook if you are in the sanctuary basement
+ */
+ void preventPoweringUpDomRod();
+
+ /**
+ * gives the unlocked scent that can be seen in the current area (defaults to most advanced one obtained)
+ */
+ void giveAllScents();
+
+ /**
+ * renders all shop items buyable no matter what you have in you inv
+ * only works for bottle items for now
+ */
+ void allowShopItemsAnytime();
+
+ /**
+ * checks if the current stage contains a shop
+ */
+ bool isStageShop();
+
+ /**
+ * Inserts custom TRES Boxes if applicable to this stage+room
+ */
+ void doCustomTRESActor( void* mStatus_roomControl );
+
+ void changeLanternColor();
+
+ void fixFTTotemMonkey();
+
+ // void setFieldModels();
+
+ // bool procActorCommonLayerInit(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, s32 unk3,
+ // void* unk4);
+ // Private members
+ // private:
+
+ // Hook trampolines
+ private:
+ void ( *fapGm_Execute_trampoline )() = nullptr;
+
+ s32 ( *evt_control_Skipper_trampoline )( void* eventPtr ) = nullptr;
+
+ bool ( *query022_trampoline )( void* unk1, void* unk2, s32 unk3 ) = nullptr;
+
+ bool ( *do_link_trampoline )( tp::dynamic_link::DynamicModuleControl* dmc ) = nullptr;
+
+ bool ( *checkTreasureRupeeReturn_trampoline )( void* unk1, s32 item ) = nullptr;
+
+ void ( *item_func_UTUWA_HEART_trampoline )() = nullptr;
+
+ bool ( *actorCommonLayerInit_trampoline )( void* mStatus_roomControl,
+ tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo,
+ int unk3,
+ void* unk4 ) = nullptr;
+
+ void ( *putSave_trampoline )( tp::d_com_inf_game::GameInfo* gameInfoPtr, s32 areaID ) = nullptr;
+
+ // Item functions
+ s32 ( *createItemForPresentDemo_trampoline )( const float pos[3],
+ s32 item,
+ u8 unk3,
+ s32 unk4,
+ s32 unk5,
+ const float unk6[3],
+ const float unk7[3] ) = nullptr;
+ s32 ( *createItemForTrBoxDemo_trampoline )( const float pos[3],
+ s32 item,
+ s32 unk3,
+ s32 unk4,
+ const float unk5[3],
+ const float unk6[3] ) = nullptr;
+ s32 ( *createItemForBoss_trampoline )( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ float unk6,
+ float unk7,
+ s32 unk8 ) = nullptr;
+ s32 ( *createItemForMidBoss_trampoline )( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ s32 unk6,
+ s32 unk7 ) = nullptr;
+ s32 ( *createItemForDirectGet_trampoline )( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ float unk6,
+ float unk7 ) = nullptr;
+ s32 ( *createItemForSimpleDemo_trampoline )( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ float unk6,
+ float unk7 ) = nullptr;
+ s32 ( *createItem_trampoline )( const float pos[3],
+ s32 item,
+ s32 unk3,
+ s32 unk4,
+ const float unk5[3],
+ const float unk6[3],
+ s32 unk7 ) = nullptr;
+
+ void ( *setItemBombNumCount_trampoline )( u32 unk1, u8 bagNb, short amount ) = nullptr;
+ };
+} // namespace mod \ No newline at end of file
diff --git a/include/musicRando.h b/include/musicRando.h
index c05204f..9595b4a 100644
--- a/include/musicRando.h
+++ b/include/musicRando.h
@@ -1,8 +1,9 @@
#pragma once
#include "defines.h"
-namespace mod::musicrando {
+namespace mod::musicrando
+{
extern u8 musicRandoEnabled;
extern u8 enemyBgmEnabled;
void initMusicRando();
-} \ No newline at end of file
+} // namespace mod::musicrando \ No newline at end of file
diff --git a/include/patch.h b/include/patch.h
index 6273c60..d5efd8f 100644
--- a/include/patch.h
+++ b/include/patch.h
@@ -5,27 +5,27 @@
namespace mod::patch
{
- void writeBranch(void* ptr, void* destination);
- void writeBranchLR(void* ptr, void* destination);
- void writeBranchMain(void* ptr, void* destination, u32 branch);
+ void writeBranch( void* ptr, void* destination );
+ void writeBranchLR( void* ptr, void* destination );
+ void writeBranchMain( void* ptr, void* destination, u32 branch );
- template<typename Func, typename Dest>
- Func hookFunction(Func function, Dest destination)
- {
- u32* instructions = reinterpret_cast<u32*>(function);
+ template<typename Func, typename Dest>
+ Func hookFunction( Func function, Dest destination )
+ {
+ u32* instructions = reinterpret_cast<u32*>( function );
- u32* trampoline = new u32[2];
+ u32* trampoline = new u32[2];
- // Original instruction
- trampoline[0] = instructions[0];
- memory::clear_DC_IC_Cache(&trampoline[0], sizeof(u32));
+ // Original instruction
+ trampoline[0] = instructions[0];
+ memory::clear_DC_IC_Cache( &trampoline[0], sizeof( u32 ) );
- // Branch to original function past hook
- writeBranch(&trampoline[1], &instructions[1]);
+ // Branch to original function past hook
+ writeBranch( &trampoline[1], &instructions[1] );
- // Write actual hook
- writeBranch(&instructions[0], reinterpret_cast<void*>(static_cast<Func>(destination)));
+ // Write actual hook
+ writeBranch( &instructions[0], reinterpret_cast<void*>( static_cast<Func>( destination ) ) );
- return reinterpret_cast<Func>(trampoline);
- }
-} \ No newline at end of file
+ return reinterpret_cast<Func>( trampoline );
+ }
+} // namespace mod::patch \ No newline at end of file
diff --git a/include/singleton.h b/include/singleton.h
index 8ae4523..43e2e30 100644
--- a/include/singleton.h
+++ b/include/singleton.h
@@ -2,56 +2,52 @@
#include "defines.h"
-
/**
* Contains variables that can be edited and read by everyone
*/
namespace mod
{
- class Singleton
- {
- public:
-
- static Singleton* getInstance();
-
- u8 isMDHSkipEnabled;
- u8 isForestEscapeEnabled;
- u8 isGateUnlockEnabled;
- u8 isGoatSkipEnabled;
- u8 isMSPuzzleSkipEnabled;
- u8 isCartEscortSkipEnabled;
- u8 isEarlyCiTSEnabled;
- u8 isCannonRepaired;
- u8 isEarlyDesertEnabled;
- u8 isBossKeyseyEnabled;
- u8 isSewerSkipEnabled;
- u8 shuffledSkybook;
- u8 isIntroSkipped;
- u8 isTwilightSkipped;
- u8 diababaMusicFixed;
- u8 midnaTimeControl;
- u8 hasActorCommonLayerRan;
- u8 isEarlyToTEnabled;
- u8 isEarlyPoTEnabled;
- u8 isGMStoryPatch;
- u8 isEarlyHCEnabled;
- u8 startWithCrystal;
-
- //dungeon flags
- u8 hasFTBeenBeaten;
- u8 hasGMBeenBeaten;
- u8 hasLBTBeenBeaten;
- u8 hasAGBeenBeaten;
- u8 hasSPRBeenBeaten;
- u8 hasToTBeenBeaten;
- u8 hasCiTSBeenBeaten;
- u8 hasCiTSOoccoo;
-
- private:
-
- static Singleton* instance;
-
- Singleton();
-
- };
-} \ No newline at end of file
+ class Singleton
+ {
+ public:
+ static Singleton* getInstance();
+
+ u8 isMDHSkipEnabled;
+ u8 isForestEscapeEnabled;
+ u8 isGateUnlockEnabled;
+ u8 isGoatSkipEnabled;
+ u8 isMSPuzzleSkipEnabled;
+ u8 isCartEscortSkipEnabled;
+ u8 isEarlyCiTSEnabled;
+ u8 isCannonRepaired;
+ u8 isEarlyDesertEnabled;
+ u8 isBossKeyseyEnabled;
+ u8 isSewerSkipEnabled;
+ u8 shuffledSkybook;
+ u8 isIntroSkipped;
+ u8 isTwilightSkipped;
+ u8 diababaMusicFixed;
+ u8 midnaTimeControl;
+ u8 hasActorCommonLayerRan;
+ u8 isEarlyToTEnabled;
+ u8 isEarlyPoTEnabled;
+ u8 isGMStoryPatch;
+ u8 isEarlyHCEnabled;
+ u8 startWithCrystal;
+
+ // dungeon flags
+ u8 hasFTBeenBeaten;
+ u8 hasGMBeenBeaten;
+ u8 hasLBTBeenBeaten;
+ u8 hasAGBeenBeaten;
+ u8 hasSPRBeenBeaten;
+ u8 hasToTBeenBeaten;
+ u8 hasCiTSBeenBeaten;
+ u8 hasCiTSOoccoo;
+
+ private:
+ static Singleton* instance;
+
+ Singleton();
+ };
+} // namespace mod \ No newline at end of file
diff --git a/include/stage.h b/include/stage.h
index ac4e1b7..4aa0c05 100644
--- a/include/stage.h
+++ b/include/stage.h
@@ -4,13 +4,13 @@
namespace mod::stage
{
- extern char allStages[76][8];
- extern const char* dungeonStages[18];
- extern const char* bossStages[8];
- extern const char* shopStages[8];
- extern const char* grottoStages[5];
- extern const char* caveStages[6];
- extern const char* interiorStages[8];
- extern const char* specialStages[3];
- extern const char* timeOfDayStages[18];
-} \ No newline at end of file
+ extern char allStages[76][8];
+ extern const char* dungeonStages[18];
+ extern const char* bossStages[8];
+ extern const char* shopStages[8];
+ extern const char* grottoStages[5];
+ extern const char* caveStages[6];
+ extern const char* interiorStages[8];
+ extern const char* specialStages[3];
+ extern const char* timeOfDayStages[18];
+} // namespace mod::stage \ No newline at end of file
diff --git a/include/systemConsole.h b/include/systemConsole.h
index c2aac6a..873292d 100644
--- a/include/systemConsole.h
+++ b/include/systemConsole.h
@@ -4,9 +4,9 @@
namespace mod::system_console
{
- extern "C"
- {
- void setBackgroundColor(u32 rgba);
- void setState(bool activeFlag, u32 totalLines);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ void setBackgroundColor( u32 rgba );
+ void setState( bool activeFlag, u32 totalLines );
+ }
+} // namespace mod::system_console \ No newline at end of file
diff --git a/include/tools.h b/include/tools.h
index 7162985..9f12cfb 100644
--- a/include/tools.h
+++ b/include/tools.h
@@ -1,77 +1,76 @@
#pragma once
-#include "defines.h"
-
-#include <tp/evt_control.h>
#include <tp/d_com_inf_game.h>
+#include <tp/evt_control.h>
+
+#include "defines.h"
namespace mod::tools
{
- extern "C"
- {
- extern u64 randomSeed;
+ extern "C"
+ {
+ extern u64 randomSeed;
+
+ /**
+ * Generates a simple random number (not perfectly random but good enough for most purposes)
+ * Note: It's best to use with a clock that advances randomSeed
+ * (C) http://xoshiro.di.unimi.it/splitmix64.c
+ *
+ * @param max The maximum number to return
+ * @returns A random integer between 0 and max, excluding max
+ */
+ u32 getRandom( u32 max );
+
+ /**
+ * Triggers the generator function which is a member function
+ * (This is a wrapper)
+ */
+ void triggerRandomGenerator();
- /**
- * Generates a simple random number (not perfectly random but good enough for most purposes)
- * Note: It's best to use with a clock that advances randomSeed
- * (C) http://xoshiro.di.unimi.it/splitmix64.c
- *
- * @param max The maximum number to return
- * @returns A random integer between 0 and max, excluding max
- */
- u32 getRandom(u32 max);
+ /**
+ * Triggers a load savely by setting some important
+ * variables for the game to handle it properly
+ */
+ void triggerSaveLoad( char* stage, u8 room, u8 spawn, u8 state = 0xFF, u8 event = 0xFF );
- /**
- * Triggers the generator function which is a member function
- * (This is a wrapper)
- */
- void triggerRandomGenerator();
+ /**
+ * Sets whether the cutscene can be skipped
+ *
+ * Unskippable cutscenes sometimes set flags so take care of them
+ * in the function that calls this if needed
+ *
+ * @param skippable If true the user can skip, otherwise unskippable
+ * @param fade If true the skip action will smoothly transition
+ * @param onSkip The tp::evt_control::csFunc that runs when trying to skip
+ */
+ void setCutscene( bool skippable, bool fade = true, tp::evt_control::csFunc onSkip = tp::evt_control::defaultSkipStb );
- /**
- * Triggers a load savely by setting some important
- * variables for the game to handle it properly
- */
- void triggerSaveLoad(char* stage, u8 room, u8 spawn, u8 state = 0xFF, u8 event = 0xFF);
+ /**
+ * Compares two floats and returns their difference
+ */
+ float fCompare( const float f1, const float f2 );
- /**
- * Sets whether the cutscene can be skipped
- *
- * Unskippable cutscenes sometimes set flags so take care of them
- * in the function that calls this if needed
- *
- * @param skippable If true the user can skip, otherwise unskippable
- * @param fade If true the skip action will smoothly transition
- * @param onSkip The tp::evt_control::csFunc that runs when trying to skip
- */
- void setCutscene(bool skippable, bool fade = true, tp::evt_control::csFunc onSkip = tp::evt_control::defaultSkipStb);
+ /**
+ * Generates a simple u32 checksum
+ *
+ * @param data The data you need a checksum for
+ * @param count The number of bytes
+ */
+ u16 fletcher16( u8* data, s32 count );
- /**
- * Compares two floats and returns their difference
- */
- float fCompare(const float f1, const float f2);
+ /**
+ * Sets a specific bit/flag in the itemFlags variable in tp::d_com_inf_game::gameInfo.scratchPad.itemFlags
+ */
+ void setItemFlag( ItemFlags flag );
- /**
- * Generates a simple u32 checksum
- *
- * @param data The data you need a checksum for
- * @param count The number of bytes
- */
- u16 fletcher16(u8* data, s32 count);
+ /**
+ * Unsets a specific bit/flag in the itemFlags variable in tp::d_com_inf_game::gameInfo.scratchPad.itemFlags
+ */
+ void clearItemFlag( ItemFlags flag );
- /**
- * Sets a specific bit/flag in the itemFlags variable in tp::d_com_inf_game::gameInfo.scratchPad.itemFlags
- */
- void setItemFlag(ItemFlags flag);
-
- /**
- * Unsets a specific bit/flag in the itemFlags variable in tp::d_com_inf_game::gameInfo.scratchPad.itemFlags
- */
- void clearItemFlag(ItemFlags flag);
-
-
- /**
- * Checks if a specific bit/flag in the itemFlags variable in tp::d_com_inf_game::gameInfo.scratchPad.itemFlags is set
- */
- bool checkItemFlag(ItemFlags flag);
- }
-} \ No newline at end of file
+ /**
+ * Checks if a specific bit/flag in the itemFlags variable in tp::d_com_inf_game::gameInfo.scratchPad.itemFlags is set
+ */
+ bool checkItemFlag( ItemFlags flag );
+ }
+} // namespace mod::tools \ No newline at end of file
diff --git a/include/tp/DynamicLink.h b/include/tp/DynamicLink.h
index 50ea632..b56cdd3 100644
--- a/include/tp/DynamicLink.h
+++ b/include/tp/DynamicLink.h
@@ -1,24 +1,24 @@
#pragma once
-#include "defines.h"
-
#include <gc/OSModule.h>
+#include "defines.h"
+
namespace tp::dynamic_link
{
- // Should try to fill in the variables at some point
- struct DynamicModuleControl
- {
- u8 unk_0[0x10];
- gc::OSModule::OSModuleInfo* moduleInfo;
- u8 unk_10[0x18];
- } __attribute__((__packed__));
+ // Should try to fill in the variables at some point
+ struct DynamicModuleControl
+ {
+ u8 unk_0[0x10];
+ gc::OSModule::OSModuleInfo* moduleInfo;
+ u8 unk_10[0x18];
+ } __attribute__( ( __packed__ ) );
- // This size may not be correct
- static_assert(sizeof(DynamicModuleControl) == 0x2C);
+ // This size may not be correct
+ static_assert( sizeof( DynamicModuleControl ) == 0x2C );
- extern "C"
- {
- bool do_link(DynamicModuleControl* dmc);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ bool do_link( DynamicModuleControl* dmc );
+ }
+} // namespace tp::dynamic_link \ No newline at end of file
diff --git a/include/tp/JFWSystem.h b/include/tp/JFWSystem.h
index 59add62..dfa4b96 100644
--- a/include/tp/JFWSystem.h
+++ b/include/tp/JFWSystem.h
@@ -4,28 +4,28 @@
namespace tp::jfw_system
{
- struct ConsoleLine
- {
- bool showLine;
- char line[61];
- } __attribute__((__packed__));
+ struct ConsoleLine
+ {
+ bool showLine;
+ char line[61];
+ } __attribute__( ( __packed__ ) );
- // Should try to fill in the missing variables at some point
- // Need to also get the exact size of this struct
- struct SystemConsole
- {
- u8 unk_0[0x60];
- u8 consoleColor[4]; // rgba
- u8 unk_64[0x4];
- bool consoleEnabled;
- u8 unk_69[3];
- ConsoleLine consoleLine[25]; // Should figure out the total amount of lines at some point
- } __attribute__((__packed__));
+ // Should try to fill in the missing variables at some point
+ // Need to also get the exact size of this struct
+ struct SystemConsole
+ {
+ u8 unk_0[0x60];
+ u8 consoleColor[4]; // rgba
+ u8 unk_64[0x4];
+ bool consoleEnabled;
+ u8 unk_69[3];
+ ConsoleLine consoleLine[25]; // Should figure out the total amount of lines at some point
+ } __attribute__( ( __packed__ ) );
- static_assert(sizeof(ConsoleLine) == 0x3E);
+ static_assert( sizeof( ConsoleLine ) == 0x3E );
- extern "C"
- {
- extern SystemConsole* systemConsole;
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern SystemConsole* systemConsole;
+ }
+} // namespace tp::jfw_system \ No newline at end of file
diff --git a/include/tp/JKRExpHeap.h b/include/tp/JKRExpHeap.h
index 60afb7c..7b9efd7 100644
--- a/include/tp/JKRExpHeap.h
+++ b/include/tp/JKRExpHeap.h
@@ -4,9 +4,9 @@
namespace tp::jkr_exp_heap
{
- extern "C"
- {
- void* do_alloc_JKRExpHeap(void* heap, u32 size, s32 unk3);
- void do_free_JKRExpHeap(void* heap, void* ptr);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ void* do_alloc_JKRExpHeap( void* heap, u32 size, s32 unk3 );
+ void do_free_JKRExpHeap( void* heap, void* ptr );
+ }
+} // namespace tp::jkr_exp_heap \ No newline at end of file
diff --git a/include/tp/Z2SceneMgr.h b/include/tp/Z2SceneMgr.h
index f3aa195..7fa5783 100644
--- a/include/tp/Z2SceneMgr.h
+++ b/include/tp/Z2SceneMgr.h
@@ -3,11 +3,21 @@
struct Z2SceneMgr;
-struct JAISoundID {
+struct JAISoundID
+{
u32 id;
};
-namespace tp::Z2AudioLib::SceneMgr {
- extern "C" {
- void sceneChange(Z2SceneMgr* sceneMgr, JAISoundID id,u8 SeWave1,u8 SeWave2,u8 BgmWave1,u8 BgmWave2,u8 DemoWave,bool param_7);
+namespace tp::Z2AudioLib::SceneMgr
+{
+ extern "C"
+ {
+ void sceneChange( Z2SceneMgr* sceneMgr,
+ JAISoundID id,
+ u8 SeWave1,
+ u8 SeWave2,
+ u8 BgmWave1,
+ u8 BgmWave2,
+ u8 DemoWave,
+ bool param_7 );
};
-}
+} // namespace tp::Z2AudioLib::SceneMgr
diff --git a/include/tp/Z2SeqMgr.h b/include/tp/Z2SeqMgr.h
index 2278e3c..6ffb084 100644
--- a/include/tp/Z2SeqMgr.h
+++ b/include/tp/Z2SeqMgr.h
@@ -2,9 +2,11 @@
struct Z2SeqMgr;
-namespace tp::Z2AudioLib::SeqMgr {
- extern "C" {
- void startBattleBgm(Z2SeqMgr* seqMgr, bool param_1);
- void subBgmStart(Z2SeqMgr* seqMgr, u32 id);
+namespace tp::Z2AudioLib::SeqMgr
+{
+ extern "C"
+ {
+ void startBattleBgm( Z2SeqMgr* seqMgr, bool param_1 );
+ void subBgmStart( Z2SeqMgr* seqMgr, u32 id );
}
-} \ No newline at end of file
+} // namespace tp::Z2AudioLib::SeqMgr \ No newline at end of file
diff --git a/include/tp/d_a_alink.h b/include/tp/d_a_alink.h
index 7a47f00..dbbfa5b 100644
--- a/include/tp/d_a_alink.h
+++ b/include/tp/d_a_alink.h
@@ -1,56 +1,55 @@
#pragma once
-#include "defines.h"
#include "d_com_inf_game.h"
+#include "defines.h"
namespace tp::d_a_alink
{
- // Should try to fill in the variables at some point
- struct LadderVars
- {
- u8 unk_0[0x28];
- float ladderClimbInitSpeed;
- u8 unk_2c[0x4];
- float ladderReachTopClimbUpSpeed;
- u8 unk_30[0x4];
- float ladderTopStartClimbDownSpeed;
- u8 unk_34[0x4];
- float ladderBottomGetOffSpeed;
- u8 unk_38[0x8];
- float ladderClimbSpeed;
- u8 unk_40[0x10];
- float wallClimbHorizontalSpeed;
- u8 unk_58[0x4];
- float wallClimbVerticalSpeed;
- u8 unk_5c[0x4];
- } __attribute__((__packed__));
-
+ // Should try to fill in the variables at some point
+ struct LadderVars
+ {
+ u8 unk_0[0x28];
+ float ladderClimbInitSpeed;
+ u8 unk_2c[0x4];
+ float ladderReachTopClimbUpSpeed;
+ u8 unk_30[0x4];
+ float ladderTopStartClimbDownSpeed;
+ u8 unk_34[0x4];
+ float ladderBottomGetOffSpeed;
+ u8 unk_38[0x8];
+ float ladderClimbSpeed;
+ u8 unk_40[0x10];
+ float wallClimbHorizontalSpeed;
+ u8 unk_58[0x4];
+ float wallClimbVerticalSpeed;
+ u8 unk_5c[0x4];
+ } __attribute__( ( __packed__ ) );
- static_assert(sizeof(LadderVars) == 0x70);
+ static_assert( sizeof( LadderVars ) == 0x70 );
- struct LinkStatus
- {
- u8 unk_0[0xA2];
- u8 status;
- } __attribute__((__packed__));
+ struct LinkStatus
+ {
+ u8 unk_0[0xA2];
+ u8 status;
+ } __attribute__( ( __packed__ ) );
- extern "C"
- {
- bool checkStageName(const char* name); // Checks if dComIfG_gameInfo.currentStage is equal to name
- void setStickData();
- bool checkHeavyStateOn(s32 unk1, s32 unk2);
- bool procCoMetamorphoseInit(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
- bool checkTreasureRupeeReturn(void* unk1, s32 item);
- bool lanternVariables(s8 unk1, s8 unk2);
- bool checkEventRun(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
- bool checkBoardRide(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
- bool checkCanoeRide(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
- bool checkHorseRide(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
- bool checkBoarRide(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
- bool checkSpinnerRide(tp::d_com_inf_game::LinkMapVars* linkMapPtr);
+ extern "C"
+ {
+ bool checkStageName( const char* name ); // Checks if dComIfG_gameInfo.currentStage is equal to name
+ void setStickData();
+ bool checkHeavyStateOn( s32 unk1, s32 unk2 );
+ bool procCoMetamorphoseInit( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
+ bool checkTreasureRupeeReturn( void* unk1, s32 item );
+ bool lanternVariables( s8 unk1, s8 unk2 );
+ bool checkEventRun( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
+ bool checkBoardRide( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
+ bool checkCanoeRide( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
+ bool checkHorseRide( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
+ bool checkBoarRide( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
+ bool checkSpinnerRide( tp::d_com_inf_game::LinkMapVars* linkMapPtr );
- // Variables
- extern LadderVars ladderVars;
- extern LinkStatus* linkStatus;
- }
-} \ No newline at end of file
+ // Variables
+ extern LadderVars ladderVars;
+ extern LinkStatus* linkStatus;
+ }
+} // namespace tp::d_a_alink \ No newline at end of file
diff --git a/include/tp/d_a_shop_item_static.h b/include/tp/d_a_shop_item_static.h
index 548b04d..8cfdf34 100644
--- a/include/tp/d_a_shop_item_static.h
+++ b/include/tp/d_a_shop_item_static.h
@@ -4,60 +4,60 @@
namespace tp::d_a_shop_item_static
{
- enum ShopItemDataIndex : u8
- {
- Sold_Out = 0x0,
- Lantern_Oil = 0x1, // Item Id = 0x66
- Red_Potion = 0x2, // Item Id = 0x61
- Milk = 0x3, // Item Id = 0x64
- Sera_Bottle = 0x4, // Item Id = 0x65
- Arrows = 0x5, // Item Id = 0xE to 0x10
- Wooden_Shield = 0x6, // Item Id = 0x2B
- Hylian_Shield = 0x7, // Item Id = 0x2C
- Bombs = 0x8, // Item Id = 0xA to 0xD
- Bomb_Bag_Water_Bombs = 0x9, // Item Id = 0x71 -- Uses Water Bomb model
- Bomb_Bag_Bomblings = 0xA, // Item Id = 0x72 -- Uses Bombling model
- Empty_Bomb_Bag = 0xB, // Item Id = 0x50 -- Possibly handles multiple different bomb bags
- Giant_Bomb_Bag = 0xC, // Item Id = 0x4F
- Land_Mine = 0xD, // Unused in getShopArcname
- Bottle = 0xE, // Unused in getShopArcname
- Bee_Larva = 0xF, // Item Id = 0x76
- Slingshot = 0x10, // Item Id = 0x4B
- Blue_Potion = 0x11, // Item Id = 0x63
- Hawkeye = 0x12, // Item Id = 0x3E
- Magic_Armor = 0x13, // Item Id = 0x30
- Magic_Armor_Sold_Out = 0x14,
- Green_Potion = 0x15, // Item Id = 0x62
- Jovani_Bottle = 0x16, // Item Id = 0x75
- };
-
- struct ShopItemData
- {
- char* arcName;
- s16 modelResIdx;
- s16 wBtkResIdx;
- s16 unk_8;
- s16 wBckResIdx;
- s16 unk_C;
- s16 wBrkResIdx;
- s16 wBtpResIdx;
- s16 unk_12;
- float posY;
- float scale;
- s16 wRot[4];
- u32 mFlags;
- u8 mShadowSize;
- u8 mCollisionH;
- u8 mCollisionR;
- u8 tevFrm;
- u8 btpFrm;
- u8 unk_2D[3];
- } __attribute__((__packed__));
+ enum ShopItemDataIndex : u8
+ {
+ Sold_Out = 0x0,
+ Lantern_Oil = 0x1, // Item Id = 0x66
+ Red_Potion = 0x2, // Item Id = 0x61
+ Milk = 0x3, // Item Id = 0x64
+ Sera_Bottle = 0x4, // Item Id = 0x65
+ Arrows = 0x5, // Item Id = 0xE to 0x10
+ Wooden_Shield = 0x6, // Item Id = 0x2B
+ Hylian_Shield = 0x7, // Item Id = 0x2C
+ Bombs = 0x8, // Item Id = 0xA to 0xD
+ Bomb_Bag_Water_Bombs = 0x9, // Item Id = 0x71 -- Uses Water Bomb model
+ Bomb_Bag_Bomblings = 0xA, // Item Id = 0x72 -- Uses Bombling model
+ Empty_Bomb_Bag = 0xB, // Item Id = 0x50 -- Possibly handles multiple different bomb bags
+ Giant_Bomb_Bag = 0xC, // Item Id = 0x4F
+ Land_Mine = 0xD, // Unused in getShopArcname
+ Bottle = 0xE, // Unused in getShopArcname
+ Bee_Larva = 0xF, // Item Id = 0x76
+ Slingshot = 0x10, // Item Id = 0x4B
+ Blue_Potion = 0x11, // Item Id = 0x63
+ Hawkeye = 0x12, // Item Id = 0x3E
+ Magic_Armor = 0x13, // Item Id = 0x30
+ Magic_Armor_Sold_Out = 0x14,
+ Green_Potion = 0x15, // Item Id = 0x62
+ Jovani_Bottle = 0x16, // Item Id = 0x75
+ };
- static_assert(sizeof(ShopItemData) == 0x30);
+ struct ShopItemData
+ {
+ char* arcName;
+ s16 modelResIdx;
+ s16 wBtkResIdx;
+ s16 unk_8;
+ s16 wBckResIdx;
+ s16 unk_C;
+ s16 wBrkResIdx;
+ s16 wBtpResIdx;
+ s16 unk_12;
+ float posY;
+ float scale;
+ s16 wRot[4];
+ u32 mFlags;
+ u8 mShadowSize;
+ u8 mCollisionH;
+ u8 mCollisionR;
+ u8 tevFrm;
+ u8 btpFrm;
+ u8 unk_2D[3];
+ } __attribute__( ( __packed__ ) );
- extern "C"
- {
- extern ShopItemData shopItemData[23]; // mData__12daShopItem_c
- }
-} \ No newline at end of file
+ static_assert( sizeof( ShopItemData ) == 0x30 );
+
+ extern "C"
+ {
+ extern ShopItemData shopItemData[23]; // mData__12daShopItem_c
+ }
+} // namespace tp::d_a_shop_item_static \ No newline at end of file
diff --git a/include/tp/d_com_inf_game.h b/include/tp/d_com_inf_game.h
index b17d4d5..dc997fc 100644
--- a/include/tp/d_com_inf_game.h
+++ b/include/tp/d_com_inf_game.h
@@ -1,957 +1,857 @@
#pragma once
-#include "defines.h"
-
#include <tp/evt_control.h>
+#include "defines.h"
+
namespace tp::d_com_inf_game
{
- enum class ItemFlagBits : u32
- {
- Recovery_Heart = 0,
- Green_Rupee = 1,
- Blue_Rupee = 2,
- Yellow_Rupee = 3,
- Red_Rupee = 4,
- Purple_Rupee = 5,
- Orange_Rupee = 6,
- Silver_Rupee = 7,
-
- Null_8 = 8,
- Null_9 = 9,
- Bombs_5 = 10,
- Bombs_10 = 11,
- Bombs_20 = 12,
- Bombs_30 = 13,
- Arrows_10 = 14,
- Arrows_20 = 15,
-
- Arrows_30 = 16,
- Arrows_1 = 17,
- Seeds_50 = 18,
- Null_13 = 19,
- Null_14 = 20,
- Null_15 = 21,
- Water_Bombs_5 = 22,
- Water_Bombs_10 = 23,
-
- Water_Bombs_15 = 24,
- Water_Bombs_3 = 25,
- Bomblings_5 = 26,
- Bomblings_10 = 27,
- Bomblings_3 = 28,
- Bombling_1 = 29,
- Fairy = 30,
- Recovery_Heart_x3 = 31,
-
- Small_Key = 32,
- Piece_of_Heart = 33,
- Heart_Container = 34,
- Dungeon_Map = 35,
- Compass = 36,
- Ooccoo_FT = 37,
- Big_Key = 38,
- Ooccoo_Jr = 39,//never set in normal game
-
- Ordon_Sword = 40,
- Master_Sword = 41,
- Ordon_Shield = 42,
- Wooden_Shield = 43,
- Hylian_Shield = 44,
- Ooccoos_Note = 45,//never set in normal game
- Ordon_Clothing = 46,//never set in normal game
- Heros_Clothes = 47,
-
- Magic_Armor = 48,
- Zora_Armor = 49,
- Shadow_Crystal = 50,//never set in normal game
- Ooccoo_Dungeon = 51,
- Small_Wallet = 52,//never set in normal game
- Big_Wallet = 53,
- Giant_Wallet = 54,
- Null_37 = 55,
-
- Null_38 = 56,
- Null_39 = 57,
- Null_3A = 58,
- Null_3B = 59,
- Null_3C = 60,
- Coral_Earring = 61,
- Hawkeye = 62,
- Wooden_Sword = 63,
-
- Boomerang = 64,
- Spinner = 65,
- Ball_and_Chain = 66,
- Heros_Bow = 67,
- Clawshot = 68,
- Iron_Boots = 69,
- Dominion_Rod = 70,
- Clawshots = 71,
-
- Lantern = 72,
- Master_Sword_Light = 73,
- Fishing_Rod = 74,
- Slingshot = 75,
- Dominion_Rod_Uncharged = 76,//never set in normal game
- Null_4D = 77,
- Null_4E = 78,
- Giant_Bomb_Bag = 79,
-
- Empty_Bomb_Bag = 80,//never set in normal game
- Goron_Bomb_Bag = 81,
- Null_52 = 82,
- Null_53 = 83,
- Small_Quiver = 84,//never set in normal game
- Big_Quiver = 85,
- Giant_Quiver = 86,
- Null_57 = 87,
-
- Fishing_Rod_Lure = 88,
- Bow_Bombs = 89,
- Bow_Hawkeye = 90,
- Fishing_Rod_Bee_Larva = 91,
- Fishing_Rod_Coral_Earring = 92,
- Fishing_Rod_Worm = 93,
- Fishing_Rod_Earring_Bee_Larva = 94,
- Fishing_Rod_Earring_Worm = 95,
-
- Empty_Bottle = 96,
- Red_Potion_Shop = 97,
- Green_Potion = 98,
- Blue_Potion = 99,
- Milk = 100,
- Sera_Bottle = 101,
- Lantern_Oil_Shop = 102,
- Water = 103,
-
- Lantern_Oil_Scooped = 104,
- Red_Potion_Scooped = 105,
- Nasty_soup = 106,
- Hot_spring_water_Scooped = 107,
- Fairy_Bottle = 108,
- Hot_Spring_Water_Shop = 109,
- Lantern_Refill_Scooped = 110,
- Lantern_Refill_Shop = 111,
-
- Bomb_Bag_Regular_Bombs = 112,
- Bomb_Bag_Water_Bombs = 113,
- Bomb_Bag_Bomblings = 114,
- Fairy_Tears = 115,
- Worm = 116,
- Jovani_Bottle = 117,
- Bee_Larva_Scooped = 118,
- Rare_Chu_Jelly = 119,
-
- Red_Chu_Jelly = 120,
- Blue_Chu_Jelly = 121,
- Green_Chu_Jelly = 122,
- Yellow_Chu_Jelly = 123,
- Purple_Chu_Jelly = 124,
- Simple_Soup = 125,
- Good_Soup = 126,
- Superb_Soup = 127,
-
- Renardos_Letter = 128,
- Invoice = 129,
- Wooden_Statue = 130,
- Ilias_Charm = 131,
- Horse_Call = 132,
- Null_85 = 133,
- Null_86 = 134,
- Null_87 = 135,
-
- Null_88 = 136,
- Null_89 = 137,
- Null_8A = 138,
- Null_8B = 139,
- Null_8C = 140,
- Null_8D = 141,
- Null_8E = 142,
- Null_8F = 143,
-
- Aurus_Memo = 144,
- Asheis_Sketch = 145,
- Null_92 = 146,
- Null_93 = 147,
- Null_94 = 148,
- Null_95 = 149,
- Null_96 = 150,
- Null_97 = 151,
-
- Null_98 = 152,
- Null_99 = 153,
- Null_9A = 154,
- Null_9B = 155,
- Lantern_Yellow_Chu_Chu = 156,
- Coro_Bottle = 157,
- Bee_Larva_Shop = 158,
- Black_Chu_Jelly = 159,
-
- Tear_Of_Light = 160,//never set in normal game
- Vessel_Of_Light_Faron = 161,
- Vessel_Of_Light_Eldin = 162,
- Vessel_Of_Light_Lanayru = 163,
- Vessel_Of_Light_Full = 164,//never set in normal game
- Null_A5 = 165,
- Null_A6 = 166,
- Null_A7 = 167,
-
- Null_A8 = 168,
- Null_A9 = 169,
- Null_AA = 170,
- Null_AB = 171,
- Null_AC = 172,
- Null_AD = 173,
- Null_AE = 174,
- Null_AF = 175,
-
- Ilias_Scent = 176,
- Null_B1 = 177,
- Poe_Scent = 178,
- Reekfish_Scent = 179,
- Youths_Scent = 180,
- Medicine_Scent = 181,
- Null_B6 = 182,
- Null_B7 = 183,
-
- Null_B8 = 184,
- Null_B9 = 185,
- Null_BA = 186,
- Null_BB = 187,
- Null_BC = 188,
- Null_BD = 189,
- Null_BE = 190,
- Null_BF = 191,
-
- Male_Beetle = 192,
- Female_Beetle = 193,
- Male_Butterfly = 194,
- Female_Butterfly = 195,
- Male_Stag_Beetle = 196,
- Female_Stag_Beetle = 197,
- Male_Grasshopper = 198,
- Female_Grasshopper = 199,
-
- Male_Phasmid = 200,
- Female_Phasmid = 201,
- Male_Pill_Bug = 202,
- Female_Pill_Bug = 203,
- Male_Mantis = 204,
- Female_Mantis = 205,
- Male_Ladybug = 206,
- Female_Ladybug = 207,
-
- Male_Snail = 208,
- Female_Snail = 209,
- Male_Dragonfly = 210,
- Female_Dragonfly = 211,
- Male_Ant = 212,
- Female_Ant = 213,
- Male_Dayfly = 214,
- Female_Dayfly = 215,
-
- Null_D8 = 216,//now used for hawkeye check
- Null_D9 = 217,//now used for malo hylian shield check
- Null_DA = 218,
- Null_DB = 219,//now used for sky letter 5
- Null_DC = 220,//now used for sky letter 4
- Null_DD = 221,//now used for sky letter 3
- Null_DE = 222,//now used for sky letter 2
- Null_DF = 223,//now used for sky letter 1
-
- Poe_Soul = 224,
- Null_E1 = 225,//now used for ending blow
- Null_E2 = 226,//now used for shield bash
- Null_E3 = 227,//now used for back slice
- Null_E4 = 228,//now used for helm splitter
- Null_E5 = 229,//now used for mortal draw
- Null_E6 = 230,//now used for jump strike
- Null_E7 = 231,//now used for great spin
-
- Null_E8 = 232,
- Ancient_Sky_Book_empty = 233,
- Ancient_Sky_Book_partly_filled = 234,
- Ancient_Sky_Book_completed = 235,
- Ooccoo_CitS = 236,
- Purple_Rupee_Links_house = 237,
- Small_Key_N_Faron_Gate = 238,
- Null_EF = 239,
-
- Null_F0 = 240,
- Null_F1 = 241,
- Null_F2 = 242,
- Gate_Keys = 243,
- Ordon_Pumpkin = 244,
- Ordon_Goat_Cheese = 245,
- Bed_Key = 246,
- Null_F7 = 247,
-
- Got_Lantern_Back = 248,
- Key_Shard_1 = 249,
- Key_Shard_2 = 250,
- Key_Shard_3 = 251,
- Null_FC = 252,
- Big_Key_Goron_Mines = 253,
- Coro_Key = 254,
- NullItem = 255,
- };
-
- struct Counters
- {
- u16 max_health;
- u16 health;
- u16 rupees;
- u16 max_lantern_oil;//constant
- u16 lantern_oil;//divide by max to get %
-
- } __attribute__((__packed__));
-
- struct EquipedItems
- {
- u8 unk;
- u8 item_X;
- u8 item_Y;
- u8 item_unk3;
- u8 item_unk4;
- u8 item_combo_X;//bow goes here, bombs/hawkeye go in main slot
- u8 item_combo_Y;//bow goes here, bombs/hawkeye go in main slot
- u8 item_combo_unk3;//bow goes here, bombs/hawkeye go in main slot
- u8 item_combo_unk4;//bow goes here, bombs/hawkeye go in main slot
- u8 clothes;
- u8 sword;
- u8 shield;
- u8 scent;
-
- } __attribute__((__packed__));
-
- struct ClearedTwilights
- {
- u8 unk_0 : 1,
- unk_1 : 1,
- unk_2 : 1,
- unk_3 : 1,
- unk_4 : 1,
- Lanayru : 1,
- Eldin : 1,
- Faron : 1;
-
- } __attribute__((__packed__));
-
- struct Epona
- {
- float position_X;
- float position_Y;
- float position_Z;
- u16 angle;
- char stage[8];
- u8 spawn;//unused
- u8 room;
- } __attribute__((__packed__));//size 0x18
-
- struct Link
- {
- char stage[8];
- u8 spawn;
- u8 room;
- u8 unk_62[0x2];
- float previous_position_X;
- float previous_position_Y;
- float previous_position_Z;
- u16 previous_angle;
- char previous_stage[8];
-
- } __attribute__((__packed__));//size 0x22
-
- struct ExploredRegions
- {
- u8 unk_0 : 1,
- Snowpeak : 1,
- Desert : 1,
- Lanayru : 1,
- Eldin : 1,
- Faron : 1,
- Ordon : 1,
- unk_8 : 1;
-
- } __attribute__((__packed__));
-
- struct Ooccoo
- {
- float position_X;
- float position_Y;
- float position_Z;
- u16 angle;
- char stage[8];// 7th byte will be 37 by default, rest 00. No clue why
- u8 spawn;//unused
- u8 room;
- u8 dungeon;
-
- } __attribute__((__packed__));//size 0x19
-
- struct MovingActors
- {
- Epona epona;
- Link link;
- u8 unk_7A[0x3];
- ExploredRegions exploredRegions;
- u8 unk_7E[0x2];
- Ooccoo ooccoo;
-
- } __attribute__((__packed__));//size 0x59
-
- struct ItemSlots
- {
- u8 Boomerang;
- u8 Lantern;
- u8 Spinner;
- u8 Iron_Boots;
- u8 Bow;
- u8 Hawkeye;
- u8 Ball_and_Chain;
- u8 Item_Slot;
- u8 Dominion_Rod;
- u8 Clawshot;
- u8 Double_Clawshot;
- u8 Bottle_1;
- u8 Bottle_2;
- u8 Bottle_3;
- u8 Bottle_4;
- u8 Bomb_Bag_1;
- u8 Bomb_Bag_2;
- u8 Bomb_Bag_3;
- u8 Ooccoo;
- u8 Story;
- u8 Fishing_Rod;
- u8 Horse_Call;
- u8 Sky_Book;
- u8 Slingshot;
- } __attribute__((__packed__));
-
- struct Ammo
- {
- u8 arrows;
- u8 bombs1;
- u8 bombs2;
- u8 bombs3;
- u8 unk_F0;
- u8 unk_F1;
- u8 unk_F2;
- u8 unk_F3;
- u8 seeds;
- u8 unk_F5;
- u8 unk_F6;
- u8 unk_F7;
- u8 max_arrows;//30,60,100
- u8 max_normal_bombs;//const (giant bomb bag just does this value x2)
- u8 max_water_bombs;//const (giant bomb bag just does this value x2)
- u8 max_bomblings;//const (giant bomb bag just does this value x2)
-
- } __attribute__((__packed__));//size 0x10
-
- struct DungeonRewards
- {
- u16 unk_0 : 1,
- unk_1 : 1,
- unk_2 : 1,
- unk_3 : 1,
- Palace_of_Twilight : 1,
- Lakebed_Temple : 1,
- Goron_Mines : 1,
- Forest_Temple : 1,
-
- unk_8 : 1,
- unk_9 : 1,
- unk_10 : 1,
- unk_11 : 1,
- City_in_the_Sky : 1,
- Temple_of_Time : 1,
- Snowpeak_Ruins : 1,
- Arbiters_Grounds : 1;
-
- } __attribute__((__packed__));
-
- struct TearsOfLightCounters
- {
- u8 Faron;
- u8 Eldin;
- u8 Lanayru;
-
- } __attribute__((__packed__));
-
- struct Letters
- {
- u16 From_Wife_of_Yeto : 1,
- Update : 1,
- Now_open_for_business : 1,
- Agithas_Dream : 1,
- Hey_kid : 1,
- Challenge_for_you : 1,
- They_came_so_quickly : 1,
- Heroes_come_together : 1,
-
- URGENT_Bomb_arrows : 1,
- Rare_item_in_stock : 1,
- Good_stuff_inside : 1,
- URGENT_NOTICE : 1,
- Post_office_notice : 1,
- Dear_Adventurer_1 : 1,
- Dear_Adventurer_2 : 1,
- About_Ilias_memory : 1;
-
- } __attribute__((__packed__));
-
- struct NumberOfFish
- {
- u16 Hyrule_Bass;
- u16 Hylian_Loach;
- u16 Hylian_Pike;
- u16 Ordon_Catfish;
- u16 Reekfish;
- u16 Greengill;
- } __attribute__((__packed__));
-
- struct LargestFishes
- {
- u8 Hyrule_Bass;
- u8 Hylian_Loach;
- u8 Hylian_Pike;
- u8 Ordon_Catfish;
- u8 Reekfish;
- u8 Greengill;
- } __attribute__((__packed__));
-
- struct FishingJournal
- {
- NumberOfFish numbers;//size 0xC
- u8 unk_178[0x14];//offset 0xC
- LargestFishes largest;//size 0x6 offset 0x20
-
- } __attribute__((__packed__));
-
- struct Settings
- {
- u8 sound;// Mono=0 / Stereo = 1 / Surround = 2
- u8 targettingType;// Hold = 0 / Switch = 1
- u8 rumble;// Off = 0 / On = 1
-
- } __attribute__((__packed__));
-
- struct DungeonFlags
- {
- u8 miniBossBeaten : 1,
- ooccooGotten : 1,
- bitSix : 1,
- containerGotten : 1,
- bossBeaten : 1,
- bigKeyGotten : 1,
- compassGotten : 1,
- mapGotten : 1;
- } __attribute__((__packed__));
-
- // Should try to fill in the missing variables at some point
- struct AreaNodes
- {
- u8 unk_0[0x1C];
- u8 nbKeys;
- DungeonFlags dungeon;
- u8 unk_1E[0x2];
- } __attribute__((__packed__));
-
- // Should try to fill in the missing variables at some point
- struct AllAreaNodes
- {
- AreaNodes Ordon;//00
- AreaNodes Sewers;//20
- AreaNodes Faron;//40
- AreaNodes Eldin;//60
- AreaNodes Lanayru;//80
- AreaNodes Null_5;//A0
- AreaNodes Hyrule_Field;//C0
- AreaNodes Sacred_Grove;//E0
- AreaNodes Snowpeak;//100
- AreaNodes Castle_Town;//120
- AreaNodes Gerudo_Desert;//140
- AreaNodes Fishing_Pond;//160
- AreaNodes Null_C;
- AreaNodes Null_D;
- AreaNodes Null_E;
- AreaNodes Null_F;
- AreaNodes Forest_Temple;
- AreaNodes Goron_Mines;
- AreaNodes Lakebed_Temple;
- AreaNodes Arbiters_Grounds;
- AreaNodes Snowpeak_Ruins;
- AreaNodes Temple_of_Time;
- AreaNodes City_in_the_Sky;
- AreaNodes Palace_of_Twilight;
- AreaNodes Hyrule_Castle;
- AreaNodes Cave_of_Ordeals;//includes Gorge Cave and Ice Block Cave
- AreaNodes Lake_Hylia_Cave;//includes Goron Stockcave
- AreaNodes Grottos;
- AreaNodes Null_1C;
- AreaNodes Null_1D;
- AreaNodes Null_1E;
- AreaNodes Null_1F;
- } __attribute__((__packed__));
-
- struct StageRooms
- {
- u64 room_31 : 1,
- room_30 : 1,
- room_29 : 1,
- room_28 : 1,
- room_27 : 1,
- room_26 : 1,
- room_25 : 1,
- room_24 : 1,
-
- room_23 : 1,
- room_22 : 1,
- room_21 : 1,
- room_20 : 1,
- room_19 : 1,
- room_18 : 1,
- room_17 : 1,
- room_16 : 1,
-
- room_15 : 1,
- room_14 : 1,
- room_13 : 1,
- room_12 : 1,
- room_11 : 1,
- room_10 : 1,
- room_09 : 1,
- room_08 : 1,
-
- room_07 : 1,
- room_06 : 1,
- room_05 : 1,
- room_04 : 1,
- room_03 : 1,
- room_02 : 1,
- room_01 : 1,
- room_00 : 1,
-
- room_63 : 1,
- room_62 : 1,
- room_61 : 1,
- room_60 : 1,
- room_59 : 1,
- room_58 : 1,
- room_57 : 1,
- room_56 : 1,
-
- room_55 : 1,
- room_54 : 1,
- room_53 : 1,
- room_52 : 1,
- room_51 : 1,
- room_50 : 1,
- room_49 : 1,
- room_48 : 1,
-
- room_47 : 1,
- room_46 : 1,
- room_45 : 1,
- room_44 : 1,
- room_43 : 1,
- room_42 : 1,
- room_41 : 1,
- room_40 : 1,
-
- room_39 : 1,
- room_38 : 1,
- room_37 : 1,
- room_36 : 1,
- room_35 : 1,
- room_34 : 1,
- room_33 : 1,
- room_32 : 1;
-
- } __attribute__((__packed__));
-
- struct ExploredStagesMap
- {
- StageRooms F_SP00;
- StageRooms F_SP103;
- StageRooms F_SP104;
- StageRooms R_SP01;
- StageRooms unk_4;
- StageRooms R_SP107;
- StageRooms F_SP108;
- StageRooms R_SP108;
- StageRooms F_SP117;
- StageRooms F_SP109;
- StageRooms F_SP110;
- StageRooms F_SP111;
- StageRooms R_SP109_R_SP209;
- StageRooms F_SP112_F_SP126;
- StageRooms F_SP113;
- StageRooms F_SP114;
- StageRooms F_SP115;
- StageRooms F_SP116;
- StageRooms F_SP118_F_SP124_F_SP125;
- StageRooms unk_19;
- StageRooms unk_20;
- StageRooms F_SP121_F_SP122;
- StageRooms D_MN05;
- StageRooms D_MN04;
- StageRooms D_MN01;
- StageRooms D_MN10;
- StageRooms D_MN11;
- StageRooms D_MN06;
- StageRooms D_MN07;
- StageRooms D_MN08;
- StageRooms D_MN09;
- StageRooms R_SP110;
- StageRooms R_SP116_R_SP161;
- StageRooms F_SP127;
- StageRooms F_SP128;
- StageRooms R_SP128;
- StageRooms R_SP300;
- StageRooms R_SP301;
- StageRooms F_SP200;
- StageRooms R_SP127;
- StageRooms D_SB00;
- StageRooms D_SB01;
- StageRooms D_SB02;
- StageRooms D_SB03;
- StageRooms D_SB04;
- StageRooms D_SB05_6_7_8_9;
- StageRooms unk_46;
- StageRooms unk_47;
- StageRooms unk_48;
- StageRooms unk_49;
- StageRooms D_SB10;
- StageRooms unk_51;
- StageRooms unk_52;
- StageRooms unk_53;
- StageRooms unk_54;
- StageRooms unk_55;
- StageRooms unk_56;
- StageRooms unk_57;
- StageRooms unk_58;
- StageRooms unk_59;
- StageRooms unk_60;
- StageRooms unk_61;
- StageRooms unk_62;
- StageRooms unk_63;
-
- } __attribute__((__packed__));
-
- // Should try to fill in the variables at some point
- struct ScratchPad
- {
- Counters counters;//size: 0xA offset: 0x0
- EquipedItems equipedItems;//size: 0xD offset: 0xA
- u8 unk_17[0x2];//offset: 0x17
- u8 equippedWallet;//offset: 0x19 (0 = small, 1 = big, 2 = giant)
- u8 unk_1A[0x4];//offset: 0x1A
- u8 form;//offset: 0x1E (0 = human, 1 = wolf)
- u8 unk_1F[0x12];//offset: 0x1F
- ClearedTwilights clearedTwilights;//offset: 0x31
- u8 unk_32[0x2];//offset: 0x32
- float skyAngle;//offset: 0x34 Impacts time of day poes and towns
- u8 unk_38[0x8];//offset: 0x38
- MovingActors movingActors;//size:0x59 offset: 0x40
- u8 unk_99[0x3];//offset: 0x99
- ItemSlots itemWheel;//size:0x18 offset 0x9C
- u8 itemSlotsOrder[0x18];//offset 0xB4
- u32 itemFlags[8];//size:0x20 offset 0xCC
- Ammo ammo;//size:0x10 offset: 0xEC
- u8 unk_FC[0xD];//offset 0xFC
- DungeonRewards dungeonRewards;//size: 0x2 offset: 0x109
- u8 unk_10B;
- u8 poeCount;//offset 0x10C
- u8 unk_10D[0x7];//offset 0x10D
- TearsOfLightCounters tearCounters;//size 0x3 offset: 0x114
- u8 unk_115[0x7];//offset: 0x115
- Letters recivedLetters;//size: 0x2 offset: 0x11E
- u8 unk_120[0x6];//offset: 0x120
- Letters readLetters;//size: 0x2 offset: 0x126
- u8 unk_128[0x44];//offset 0x128
- FishingJournal fishingJournal; //size: 0x26 offset: 0x16C
- u8 unk_192[0x22];//offset 0x192
- char linkName[16];//offset 0x1B4
- u8 unk_1C4;
- char eponaName[16];//offset 0x1C5
- u8 unk_1D5[0xC];//offset 0x1D5
- Settings optionsSettings;//size: 0x3 offset 0x1E1
- u8 unk_1E4[0xC];//offset 1E4
- AllAreaNodes allAreaNodes;//size: 0x400 offset 0x1F0
- ExploredStagesMap exploredMap;//size: 0x200 offset 0x5F0
- u8 eventBits[0x150]; // Bitfield (QuestLogOffset - 7F0)
- u8 miniGameBits[0x18]; // Bitfield
- } __attribute__((__packed__));
-
- struct RespawnValues
- {
- u8 room;//0xDB4
- u8 unk_DB5[0x5];//0xDB5
- u8 spawnPoint;//0xDB9
- u16 angle;//0xDBA
- float position_X;//0xDBC
- float position_Y;//0xDC0
- float position_Z;//0xDC4
- u8 respawnCutscene; //0xDC8
- u8 unk_DC9[0x7];//0xDC9
- u8 lastItem;//0xDD0
- u8 voidedAsWolf;//0xDD1
- u8 unk_DD2;//0xDD2
- u8 respawnAnimation;//0xDD3
-
- } __attribute__((__packed__));
-
-
- // Should try to fill in the missing variables at some point
- // Need to also get the exact size of this struct
- struct CurrentStageVars
- {
- char currentStage[8];
- s16 currentSpawnPoint;
- u8 unknown[4];
- } __attribute__((__packed__));
-
- // Should try to fill in the missing variables at some point
- // Need to also get the exact size of this struct
- struct NextStageVars
- {
- char nextStage[8];
- u8 isVoidorWarp;
- u8 nextSpawnPoint;
- u8 nextRoom;
- u8 nextState;
- u8 unk1;
- u8 unk2;
- u8 triggerLoad;
- u8 fadeType;
- } __attribute__((__packed__));
-
- // Should try to fill in the missing variables at some point
-
- struct EventSystem
- {
- u8 unk00[0x13]; // 4ec8 - 4eda
- u16 immediateControl; // 4edb - 4edc
- u8 unk_00[0x4]; // 4edd - 4EE0
- u8 nextEventID; // 4EE1
- u8 unk1A[0xC5];
- u8 actionStatus;
- u8 unkDF[0x5];
- u8 eventFlag;
- u8 unkE7[0x5];
- u8 currentEventID;
- u8 unk_ec[0x14];
- tp::evt_control::csFunc* onSkip; // if != 0 the function stored here will run, otherwise unskippable
- u8 unk_104[0xC];
- u32 fadeOnSkip; // if != 0 this will fade out the screen when skipping
- } __attribute__((__packed__));
-
- // Should try to fill in the missing variables at some point
- // Need to also get the exact size of this struct
- struct LinkMapVars
- {
- u8 unk_0[0x4D0];
- float pos[3];
- u8 unk_4DC[0x94];
- u32 isTargeting;//570 at 0x400000 link is targeting
- u8 unk_574[0x2A68];
- u16 equippedItem;
- } __attribute__((__packed__));
-
- struct TunicColor
- {
- u8 unk_0[0x32A0];
- u8 redTopToggle;//0x4 disables red
- u8 redTop;
- u8 greenTopToggle;//0x4 disables green
- u8 greenTop;
- u8 blueTopToggle;//0x4 disables blue
- u8 blueTop;
- u8 unk_32A6[0x2];
- u8 redBottomToggle;//0x4 disables red
- u8 redBottom;
- u8 greenBottomToggle;//0x4 disables green
- u8 greenBottom;
- u8 blueBottomToggle;//0x4 disables blue
- u8 blueBottom;
- } __attribute__((__packed__));
-
- // Should try to fill in the missing variables at some point
- struct GameInfo
- {
- ScratchPad scratchPad; // 0 - 957
- AreaNodes localAreaNodes; // 958 - 978 holds flags about the current area
- u8 unk_979[0x43B]; // 979 - DB3
- RespawnValues respawnValues;// DB4 - DD3
- u8 unkdd4[0x402C]; // dd4 - 4DFF
- char currentStage[8]; // 4E00 - 4E07
- u8 unk_4e08; // 4E08
- u8 currentSpawnID;// 4E09
- u8 unk_4e0A[4]; // 4E0A - 4E0D
- NextStageVars nextStageVars; // 4E0E - 4E1D
- u8 unk_4e1E[0xAA]; // 4E1E - 4EC7
- EventSystem eventSystem; // 4EC8 - 4FDB
- u8 unk_4fdc[0xDD0]; // 4FDC - 5DAB
- LinkMapVars* linkMapPtr; // 5DAC - 5DAF
- u8 unk_5db0[0x4];
- TunicColor* ColorPtr;// 5DB4 - 5DB7
- u8 unk_5db8[0x2A];//5DB8 - 5DE1
- u16 airMeter; //5DE2 - 5DE3 max = 258
- u8 unk_5de4[0x38];//5DE4 - 5E1B
- u8 rButtonText;//5E1C - 51EC
- u8 bButtonText;//5E1D - 51ED
- u8 unk_5E1E[0x6];//5E1E - 5E23
- u8 aButtonText; //5E24 - 5E24
- u8 unk_5e25;//5E25 - 5E25
- u8 stickButtonText;//5E26 - 5E26
- u8 unk_5e27[0xB];//5E27 - 5E5B
- u8 startButtonText;//5E32 - 5E32
- u8 unk_5e33[0xC];//5E33 - 5E3E
- u8 cButtonText;//5E3F - 5E3F
- u8 unk_5e40[0x1C];//5E40 - 5E5B
- u8 xButtonText;//5E5C - 5E5C set to sense and doesn't unset
- u8 unk_5e5D[0x3];//5E5D - 5E5F
- u8 yButtonText;//5E60 - 5E60 set to dig and doesn't unset
- u8 unk_5e61[0xB];//5E61 - 5E6B
- u8 xItem;//5E6C - 5E6C
- u8 yItem;//5E6D - 5E6D
- u8 unk_5E6E[0x22];//5E6E - 5E8F
- u8 bottomPromptShown;//5E90 set to 0x8 when button promt apprears on bottom of screen
- u8 topPromptShown;//5E91 set to 0x8 when button promt apprears on top of screen
- u8 unk_5e92[0x25];//5E92 - 5EB6
- u8 airTimerDepleted; //5EB7 - 5EB7
- u8 unk_5eb8[0x17F58];
-
-
- } __attribute__((__packed__));
-
- static_assert(sizeof(AreaNodes) == 0x20);
- static_assert(sizeof(ScratchPad) == 0x958);
- static_assert(sizeof(GameInfo) == 0x1DE10);
- static_assert(sizeof(DungeonFlags) == 0x1);
- static_assert(sizeof(FishingJournal) == 0x26);
- static_assert(sizeof(ExploredStagesMap) == 0x200);
- static_assert(sizeof(Epona) == 0x18);
- static_assert(sizeof(Link) == 0x22);
- static_assert(sizeof(Ooccoo) == 0x19);
- static_assert(sizeof(MovingActors) == 0x59);
- static_assert(sizeof(Ammo) == 0x10);
- static_assert(sizeof(RespawnValues) == 0x21);
- static_assert(sizeof(LinkMapVars*) == 0x4);
- static_assert(sizeof(EventSystem) == 0x114);
- static_assert(sizeof(NextStageVars) == 0x10);
-
-
- extern "C"
- {
- extern GameInfo dComIfG_gameInfo;
- extern u8 current_state;
- extern void setItemBombNumCount(u32 unk1, u8 bagNb, short amout);//amount will be the og (ex: if you can only have 5 more bombs and buy 10, it'll still ahow 10)
- extern u8 next_state;
- extern char izaBoatSignText[100];
- //extern char wallet_description[96];
- extern u8 can_warp;
- }
-} \ No newline at end of file
+ enum class ItemFlagBits : u32
+ {
+ Recovery_Heart = 0,
+ Green_Rupee = 1,
+ Blue_Rupee = 2,
+ Yellow_Rupee = 3,
+ Red_Rupee = 4,
+ Purple_Rupee = 5,
+ Orange_Rupee = 6,
+ Silver_Rupee = 7,
+
+ Null_8 = 8,
+ Null_9 = 9,
+ Bombs_5 = 10,
+ Bombs_10 = 11,
+ Bombs_20 = 12,
+ Bombs_30 = 13,
+ Arrows_10 = 14,
+ Arrows_20 = 15,
+
+ Arrows_30 = 16,
+ Arrows_1 = 17,
+ Seeds_50 = 18,
+ Null_13 = 19,
+ Null_14 = 20,
+ Null_15 = 21,
+ Water_Bombs_5 = 22,
+ Water_Bombs_10 = 23,
+
+ Water_Bombs_15 = 24,
+ Water_Bombs_3 = 25,
+ Bomblings_5 = 26,
+ Bomblings_10 = 27,
+ Bomblings_3 = 28,
+ Bombling_1 = 29,
+ Fairy = 30,
+ Recovery_Heart_x3 = 31,
+
+ Small_Key = 32,
+ Piece_of_Heart = 33,
+ Heart_Container = 34,
+ Dungeon_Map = 35,
+ Compass = 36,
+ Ooccoo_FT = 37,
+ Big_Key = 38,
+ Ooccoo_Jr = 39, // never set in normal game
+
+ Ordon_Sword = 40,
+ Master_Sword = 41,
+ Ordon_Shield = 42,
+ Wooden_Shield = 43,
+ Hylian_Shield = 44,
+ Ooccoos_Note = 45, // never set in normal game
+ Ordon_Clothing = 46, // never set in normal game
+ Heros_Clothes = 47,
+
+ Magic_Armor = 48,
+ Zora_Armor = 49,
+ Shadow_Crystal = 50, // never set in normal game
+ Ooccoo_Dungeon = 51,
+ Small_Wallet = 52, // never set in normal game
+ Big_Wallet = 53,
+ Giant_Wallet = 54,
+ Null_37 = 55,
+
+ Null_38 = 56,
+ Null_39 = 57,
+ Null_3A = 58,
+ Null_3B = 59,
+ Null_3C = 60,
+ Coral_Earring = 61,
+ Hawkeye = 62,
+ Wooden_Sword = 63,
+
+ Boomerang = 64,
+ Spinner = 65,
+ Ball_and_Chain = 66,
+ Heros_Bow = 67,
+ Clawshot = 68,
+ Iron_Boots = 69,
+ Dominion_Rod = 70,
+ Clawshots = 71,
+
+ Lantern = 72,
+ Master_Sword_Light = 73,
+ Fishing_Rod = 74,
+ Slingshot = 75,
+ Dominion_Rod_Uncharged = 76, // never set in normal game
+ Null_4D = 77,
+ Null_4E = 78,
+ Giant_Bomb_Bag = 79,
+
+ Empty_Bomb_Bag = 80, // never set in normal game
+ Goron_Bomb_Bag = 81,
+ Null_52 = 82,
+ Null_53 = 83,
+ Small_Quiver = 84, // never set in normal game
+ Big_Quiver = 85,
+ Giant_Quiver = 86,
+ Null_57 = 87,
+
+ Fishing_Rod_Lure = 88,
+ Bow_Bombs = 89,
+ Bow_Hawkeye = 90,
+ Fishing_Rod_Bee_Larva = 91,
+ Fishing_Rod_Coral_Earring = 92,
+ Fishing_Rod_Worm = 93,
+ Fishing_Rod_Earring_Bee_Larva = 94,
+ Fishing_Rod_Earring_Worm = 95,
+
+ Empty_Bottle = 96,
+ Red_Potion_Shop = 97,
+ Green_Potion = 98,
+ Blue_Potion = 99,
+ Milk = 100,
+ Sera_Bottle = 101,
+ Lantern_Oil_Shop = 102,
+ Water = 103,
+
+ Lantern_Oil_Scooped = 104,
+ Red_Potion_Scooped = 105,
+ Nasty_soup = 106,
+ Hot_spring_water_Scooped = 107,
+ Fairy_Bottle = 108,
+ Hot_Spring_Water_Shop = 109,
+ Lantern_Refill_Scooped = 110,
+ Lantern_Refill_Shop = 111,
+
+ Bomb_Bag_Regular_Bombs = 112,
+ Bomb_Bag_Water_Bombs = 113,
+ Bomb_Bag_Bomblings = 114,
+ Fairy_Tears = 115,
+ Worm = 116,
+ Jovani_Bottle = 117,
+ Bee_Larva_Scooped = 118,
+ Rare_Chu_Jelly = 119,
+
+ Red_Chu_Jelly = 120,
+ Blue_Chu_Jelly = 121,
+ Green_Chu_Jelly = 122,
+ Yellow_Chu_Jelly = 123,
+ Purple_Chu_Jelly = 124,
+ Simple_Soup = 125,
+ Good_Soup = 126,
+ Superb_Soup = 127,
+
+ Renardos_Letter = 128,
+ Invoice = 129,
+ Wooden_Statue = 130,
+ Ilias_Charm = 131,
+ Horse_Call = 132,
+ Null_85 = 133,
+ Null_86 = 134,
+ Null_87 = 135,
+
+ Null_88 = 136,
+ Null_89 = 137,
+ Null_8A = 138,
+ Null_8B = 139,
+ Null_8C = 140,
+ Null_8D = 141,
+ Null_8E = 142,
+ Null_8F = 143,
+
+ Aurus_Memo = 144,
+ Asheis_Sketch = 145,
+ Null_92 = 146,
+ Null_93 = 147,
+ Null_94 = 148,
+ Null_95 = 149,
+ Null_96 = 150,
+ Null_97 = 151,
+
+ Null_98 = 152,
+ Null_99 = 153,
+ Null_9A = 154,
+ Null_9B = 155,
+ Lantern_Yellow_Chu_Chu = 156,
+ Coro_Bottle = 157,
+ Bee_Larva_Shop = 158,
+ Black_Chu_Jelly = 159,
+
+ Tear_Of_Light = 160, // never set in normal game
+ Vessel_Of_Light_Faron = 161,
+ Vessel_Of_Light_Eldin = 162,
+ Vessel_Of_Light_Lanayru = 163,
+ Vessel_Of_Light_Full = 164, // never set in normal game
+ Null_A5 = 165,
+ Null_A6 = 166,
+ Null_A7 = 167,
+
+ Null_A8 = 168,
+ Null_A9 = 169,
+ Null_AA = 170,
+ Null_AB = 171,
+ Null_AC = 172,
+ Null_AD = 173,
+ Null_AE = 174,
+ Null_AF = 175,
+
+ Ilias_Scent = 176,
+ Null_B1 = 177,
+ Poe_Scent = 178,
+ Reekfish_Scent = 179,
+ Youths_Scent = 180,
+ Medicine_Scent = 181,
+ Null_B6 = 182,
+ Null_B7 = 183,
+
+ Null_B8 = 184,
+ Null_B9 = 185,
+ Null_BA = 186,
+ Null_BB = 187,
+ Null_BC = 188,
+ Null_BD = 189,
+ Null_BE = 190,
+ Null_BF = 191,
+
+ Male_Beetle = 192,
+ Female_Beetle = 193,
+ Male_Butterfly = 194,
+ Female_Butterfly = 195,
+ Male_Stag_Beetle = 196,
+ Female_Stag_Beetle = 197,
+ Male_Grasshopper = 198,
+ Female_Grasshopper = 199,
+
+ Male_Phasmid = 200,
+ Female_Phasmid = 201,
+ Male_Pill_Bug = 202,
+ Female_Pill_Bug = 203,
+ Male_Mantis = 204,
+ Female_Mantis = 205,
+ Male_Ladybug = 206,
+ Female_Ladybug = 207,
+
+ Male_Snail = 208,
+ Female_Snail = 209,
+ Male_Dragonfly = 210,
+ Female_Dragonfly = 211,
+ Male_Ant = 212,
+ Female_Ant = 213,
+ Male_Dayfly = 214,
+ Female_Dayfly = 215,
+
+ Null_D8 = 216, // now used for hawkeye check
+ Null_D9 = 217, // now used for malo hylian shield check
+ Null_DA = 218,
+ Null_DB = 219, // now used for sky letter 5
+ Null_DC = 220, // now used for sky letter 4
+ Null_DD = 221, // now used for sky letter 3
+ Null_DE = 222, // now used for sky letter 2
+ Null_DF = 223, // now used for sky letter 1
+
+ Poe_Soul = 224,
+ Null_E1 = 225, // now used for ending blow
+ Null_E2 = 226, // now used for shield bash
+ Null_E3 = 227, // now used for back slice
+ Null_E4 = 228, // now used for helm splitter
+ Null_E5 = 229, // now used for mortal draw
+ Null_E6 = 230, // now used for jump strike
+ Null_E7 = 231, // now used for great spin
+
+ Null_E8 = 232,
+ Ancient_Sky_Book_empty = 233,
+ Ancient_Sky_Book_partly_filled = 234,
+ Ancient_Sky_Book_completed = 235,
+ Ooccoo_CitS = 236,
+ Purple_Rupee_Links_house = 237,
+ Small_Key_N_Faron_Gate = 238,
+ Null_EF = 239,
+
+ Null_F0 = 240,
+ Null_F1 = 241,
+ Null_F2 = 242,
+ Gate_Keys = 243,
+ Ordon_Pumpkin = 244,
+ Ordon_Goat_Cheese = 245,
+ Bed_Key = 246,
+ Null_F7 = 247,
+
+ Got_Lantern_Back = 248,
+ Key_Shard_1 = 249,
+ Key_Shard_2 = 250,
+ Key_Shard_3 = 251,
+ Null_FC = 252,
+ Big_Key_Goron_Mines = 253,
+ Coro_Key = 254,
+ NullItem = 255,
+ };
+
+ struct Counters
+ {
+ u16 max_health;
+ u16 health;
+ u16 rupees;
+ u16 max_lantern_oil; // constant
+ u16 lantern_oil; // divide by max to get %
+
+ } __attribute__( ( __packed__ ) );
+
+ struct EquipedItems
+ {
+ u8 unk;
+ u8 item_X;
+ u8 item_Y;
+ u8 item_unk3;
+ u8 item_unk4;
+ u8 item_combo_X; // bow goes here, bombs/hawkeye go in main slot
+ u8 item_combo_Y; // bow goes here, bombs/hawkeye go in main slot
+ u8 item_combo_unk3; // bow goes here, bombs/hawkeye go in main slot
+ u8 item_combo_unk4; // bow goes here, bombs/hawkeye go in main slot
+ u8 clothes;
+ u8 sword;
+ u8 shield;
+ u8 scent;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct ClearedTwilights
+ {
+ u8 unk_0 : 1, unk_1 : 1, unk_2 : 1, unk_3 : 1, unk_4 : 1, Lanayru : 1, Eldin : 1, Faron : 1;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct Epona
+ {
+ float position_X;
+ float position_Y;
+ float position_Z;
+ u16 angle;
+ char stage[8];
+ u8 spawn; // unused
+ u8 room;
+ } __attribute__( ( __packed__ ) ); // size 0x18
+
+ struct Link
+ {
+ char stage[8];
+ u8 spawn;
+ u8 room;
+ u8 unk_62[0x2];
+ float previous_position_X;
+ float previous_position_Y;
+ float previous_position_Z;
+ u16 previous_angle;
+ char previous_stage[8];
+
+ } __attribute__( ( __packed__ ) ); // size 0x22
+
+ struct ExploredRegions
+ {
+ u8 unk_0 : 1, Snowpeak : 1, Desert : 1, Lanayru : 1, Eldin : 1, Faron : 1, Ordon : 1, unk_8 : 1;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct Ooccoo
+ {
+ float position_X;
+ float position_Y;
+ float position_Z;
+ u16 angle;
+ char stage[8]; // 7th byte will be 37 by default, rest 00. No clue why
+ u8 spawn; // unused
+ u8 room;
+ u8 dungeon;
+
+ } __attribute__( ( __packed__ ) ); // size 0x19
+
+ struct MovingActors
+ {
+ Epona epona;
+ Link link;
+ u8 unk_7A[0x3];
+ ExploredRegions exploredRegions;
+ u8 unk_7E[0x2];
+ Ooccoo ooccoo;
+
+ } __attribute__( ( __packed__ ) ); // size 0x59
+
+ struct ItemSlots
+ {
+ u8 Boomerang;
+ u8 Lantern;
+ u8 Spinner;
+ u8 Iron_Boots;
+ u8 Bow;
+ u8 Hawkeye;
+ u8 Ball_and_Chain;
+ u8 Item_Slot;
+ u8 Dominion_Rod;
+ u8 Clawshot;
+ u8 Double_Clawshot;
+ u8 Bottle_1;
+ u8 Bottle_2;
+ u8 Bottle_3;
+ u8 Bottle_4;
+ u8 Bomb_Bag_1;
+ u8 Bomb_Bag_2;
+ u8 Bomb_Bag_3;
+ u8 Ooccoo;
+ u8 Story;
+ u8 Fishing_Rod;
+ u8 Horse_Call;
+ u8 Sky_Book;
+ u8 Slingshot;
+ } __attribute__( ( __packed__ ) );
+
+ struct Ammo
+ {
+ u8 arrows;
+ u8 bombs1;
+ u8 bombs2;
+ u8 bombs3;
+ u8 unk_F0;
+ u8 unk_F1;
+ u8 unk_F2;
+ u8 unk_F3;
+ u8 seeds;
+ u8 unk_F5;
+ u8 unk_F6;
+ u8 unk_F7;
+ u8 max_arrows; // 30,60,100
+ u8 max_normal_bombs; // const (giant bomb bag just does this value x2)
+ u8 max_water_bombs; // const (giant bomb bag just does this value x2)
+ u8 max_bomblings; // const (giant bomb bag just does this value x2)
+
+ } __attribute__( ( __packed__ ) ); // size 0x10
+
+ struct DungeonRewards
+ {
+ u16 unk_0 : 1, unk_1 : 1, unk_2 : 1, unk_3 : 1, Palace_of_Twilight : 1, Lakebed_Temple : 1, Goron_Mines : 1,
+ Forest_Temple : 1,
+
+ unk_8 : 1, unk_9 : 1, unk_10 : 1, unk_11 : 1, City_in_the_Sky : 1, Temple_of_Time : 1, Snowpeak_Ruins : 1,
+ Arbiters_Grounds : 1;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct TearsOfLightCounters
+ {
+ u8 Faron;
+ u8 Eldin;
+ u8 Lanayru;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct Letters
+ {
+ u16 From_Wife_of_Yeto : 1, Update : 1, Now_open_for_business : 1, Agithas_Dream : 1, Hey_kid : 1, Challenge_for_you : 1,
+ They_came_so_quickly : 1, Heroes_come_together : 1,
+
+ URGENT_Bomb_arrows : 1, Rare_item_in_stock : 1, Good_stuff_inside : 1, URGENT_NOTICE : 1, Post_office_notice : 1,
+ Dear_Adventurer_1 : 1, Dear_Adventurer_2 : 1, About_Ilias_memory : 1;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct NumberOfFish
+ {
+ u16 Hyrule_Bass;
+ u16 Hylian_Loach;
+ u16 Hylian_Pike;
+ u16 Ordon_Catfish;
+ u16 Reekfish;
+ u16 Greengill;
+ } __attribute__( ( __packed__ ) );
+
+ struct LargestFishes
+ {
+ u8 Hyrule_Bass;
+ u8 Hylian_Loach;
+ u8 Hylian_Pike;
+ u8 Ordon_Catfish;
+ u8 Reekfish;
+ u8 Greengill;
+ } __attribute__( ( __packed__ ) );
+
+ struct FishingJournal
+ {
+ NumberOfFish numbers; // size 0xC
+ u8 unk_178[0x14]; // offset 0xC
+ LargestFishes largest; // size 0x6 offset 0x20
+
+ } __attribute__( ( __packed__ ) );
+
+ struct Settings
+ {
+ u8 sound; // Mono=0 / Stereo = 1 / Surround = 2
+ u8 targettingType; // Hold = 0 / Switch = 1
+ u8 rumble; // Off = 0 / On = 1
+
+ } __attribute__( ( __packed__ ) );
+
+ struct DungeonFlags
+ {
+ u8 miniBossBeaten : 1, ooccooGotten : 1, bitSix : 1, containerGotten : 1, bossBeaten : 1, bigKeyGotten : 1,
+ compassGotten : 1, mapGotten : 1;
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+ struct AreaNodes
+ {
+ u8 unk_0[0x1C];
+ u8 nbKeys;
+ DungeonFlags dungeon;
+ u8 unk_1E[0x2];
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+ struct AllAreaNodes
+ {
+ AreaNodes Ordon; // 00
+ AreaNodes Sewers; // 20
+ AreaNodes Faron; // 40
+ AreaNodes Eldin; // 60
+ AreaNodes Lanayru; // 80
+ AreaNodes Null_5; // A0
+ AreaNodes Hyrule_Field; // C0
+ AreaNodes Sacred_Grove; // E0
+ AreaNodes Snowpeak; // 100
+ AreaNodes Castle_Town; // 120
+ AreaNodes Gerudo_Desert; // 140
+ AreaNodes Fishing_Pond; // 160
+ AreaNodes Null_C;
+ AreaNodes Null_D;
+ AreaNodes Null_E;
+ AreaNodes Null_F;
+ AreaNodes Forest_Temple;
+ AreaNodes Goron_Mines;
+ AreaNodes Lakebed_Temple;
+ AreaNodes Arbiters_Grounds;
+ AreaNodes Snowpeak_Ruins;
+ AreaNodes Temple_of_Time;
+ AreaNodes City_in_the_Sky;
+ AreaNodes Palace_of_Twilight;
+ AreaNodes Hyrule_Castle;
+ AreaNodes Cave_of_Ordeals; // includes Gorge Cave and Ice Block Cave
+ AreaNodes Lake_Hylia_Cave; // includes Goron Stockcave
+ AreaNodes Grottos;
+ AreaNodes Null_1C;
+ AreaNodes Null_1D;
+ AreaNodes Null_1E;
+ AreaNodes Null_1F;
+ } __attribute__( ( __packed__ ) );
+
+ struct StageRooms
+ {
+ u64 room_31 : 1, room_30 : 1, room_29 : 1, room_28 : 1, room_27 : 1, room_26 : 1, room_25 : 1, room_24 : 1,
+
+ room_23 : 1, room_22 : 1, room_21 : 1, room_20 : 1, room_19 : 1, room_18 : 1, room_17 : 1, room_16 : 1,
+
+ room_15 : 1, room_14 : 1, room_13 : 1, room_12 : 1, room_11 : 1, room_10 : 1, room_09 : 1, room_08 : 1,
+
+ room_07 : 1, room_06 : 1, room_05 : 1, room_04 : 1, room_03 : 1, room_02 : 1, room_01 : 1, room_00 : 1,
+
+ room_63 : 1, room_62 : 1, room_61 : 1, room_60 : 1, room_59 : 1, room_58 : 1, room_57 : 1, room_56 : 1,
+
+ room_55 : 1, room_54 : 1, room_53 : 1, room_52 : 1, room_51 : 1, room_50 : 1, room_49 : 1, room_48 : 1,
+
+ room_47 : 1, room_46 : 1, room_45 : 1, room_44 : 1, room_43 : 1, room_42 : 1, room_41 : 1, room_40 : 1,
+
+ room_39 : 1, room_38 : 1, room_37 : 1, room_36 : 1, room_35 : 1, room_34 : 1, room_33 : 1, room_32 : 1;
+
+ } __attribute__( ( __packed__ ) );
+
+ struct ExploredStagesMap
+ {
+ StageRooms F_SP00;
+ StageRooms F_SP103;
+ StageRooms F_SP104;
+ StageRooms R_SP01;
+ StageRooms unk_4;
+ StageRooms R_SP107;
+ StageRooms F_SP108;
+ StageRooms R_SP108;
+ StageRooms F_SP117;
+ StageRooms F_SP109;
+ StageRooms F_SP110;
+ StageRooms F_SP111;
+ StageRooms R_SP109_R_SP209;
+ StageRooms F_SP112_F_SP126;
+ StageRooms F_SP113;
+ StageRooms F_SP114;
+ StageRooms F_SP115;
+ StageRooms F_SP116;
+ StageRooms F_SP118_F_SP124_F_SP125;
+ StageRooms unk_19;
+ StageRooms unk_20;
+ StageRooms F_SP121_F_SP122;
+ StageRooms D_MN05;
+ StageRooms D_MN04;
+ StageRooms D_MN01;
+ StageRooms D_MN10;
+ StageRooms D_MN11;
+ StageRooms D_MN06;
+ StageRooms D_MN07;
+ StageRooms D_MN08;
+ StageRooms D_MN09;
+ StageRooms R_SP110;
+ StageRooms R_SP116_R_SP161;
+ StageRooms F_SP127;
+ StageRooms F_SP128;
+ StageRooms R_SP128;
+ StageRooms R_SP300;
+ StageRooms R_SP301;
+ StageRooms F_SP200;
+ StageRooms R_SP127;
+ StageRooms D_SB00;
+ StageRooms D_SB01;
+ StageRooms D_SB02;
+ StageRooms D_SB03;
+ StageRooms D_SB04;
+ StageRooms D_SB05_6_7_8_9;
+ StageRooms unk_46;
+ StageRooms unk_47;
+ StageRooms unk_48;
+ StageRooms unk_49;
+ StageRooms D_SB10;
+ StageRooms unk_51;
+ StageRooms unk_52;
+ StageRooms unk_53;
+ StageRooms unk_54;
+ StageRooms unk_55;
+ StageRooms unk_56;
+ StageRooms unk_57;
+ StageRooms unk_58;
+ StageRooms unk_59;
+ StageRooms unk_60;
+ StageRooms unk_61;
+ StageRooms unk_62;
+ StageRooms unk_63;
+
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the variables at some point
+ struct ScratchPad
+ {
+ Counters counters; // size: 0xA offset: 0x0
+ EquipedItems equipedItems; // size: 0xD offset: 0xA
+ u8 unk_17[0x2]; // offset: 0x17
+ u8 equippedWallet; // offset: 0x19 (0 = small, 1 = big, 2 = giant)
+ u8 unk_1A[0x4]; // offset: 0x1A
+ u8 form; // offset: 0x1E (0 = human, 1 = wolf)
+ u8 unk_1F[0x12]; // offset: 0x1F
+ ClearedTwilights clearedTwilights; // offset: 0x31
+ u8 unk_32[0x2]; // offset: 0x32
+ float skyAngle; // offset: 0x34 Impacts time of day poes and towns
+ u8 unk_38[0x8]; // offset: 0x38
+ MovingActors movingActors; // size:0x59 offset: 0x40
+ u8 unk_99[0x3]; // offset: 0x99
+ ItemSlots itemWheel; // size:0x18 offset 0x9C
+ u8 itemSlotsOrder[0x18]; // offset 0xB4
+ u32 itemFlags[8]; // size:0x20 offset 0xCC
+ Ammo ammo; // size:0x10 offset: 0xEC
+ u8 unk_FC[0xD]; // offset 0xFC
+ DungeonRewards dungeonRewards; // size: 0x2 offset: 0x109
+ u8 unk_10B;
+ u8 poeCount; // offset 0x10C
+ u8 unk_10D[0x7]; // offset 0x10D
+ TearsOfLightCounters tearCounters; // size 0x3 offset: 0x114
+ u8 unk_115[0x7]; // offset: 0x115
+ Letters recivedLetters; // size: 0x2 offset: 0x11E
+ u8 unk_120[0x6]; // offset: 0x120
+ Letters readLetters; // size: 0x2 offset: 0x126
+ u8 unk_128[0x44]; // offset 0x128
+ FishingJournal fishingJournal; // size: 0x26 offset: 0x16C
+ u8 unk_192[0x22]; // offset 0x192
+ char linkName[16]; // offset 0x1B4
+ u8 unk_1C4;
+ char eponaName[16]; // offset 0x1C5
+ u8 unk_1D5[0xC]; // offset 0x1D5
+ Settings optionsSettings; // size: 0x3 offset 0x1E1
+ u8 unk_1E4[0xC]; // offset 1E4
+ AllAreaNodes allAreaNodes; // size: 0x400 offset 0x1F0
+ ExploredStagesMap exploredMap; // size: 0x200 offset 0x5F0
+ u8 eventBits[0x150]; // Bitfield (QuestLogOffset - 7F0)
+ u8 miniGameBits[0x18]; // Bitfield
+ } __attribute__( ( __packed__ ) );
+
+ struct RespawnValues
+ {
+ u8 room; // 0xDB4
+ u8 unk_DB5[0x5]; // 0xDB5
+ u8 spawnPoint; // 0xDB9
+ u16 angle; // 0xDBA
+ float position_X; // 0xDBC
+ float position_Y; // 0xDC0
+ float position_Z; // 0xDC4
+ u8 respawnCutscene; // 0xDC8
+ u8 unk_DC9[0x7]; // 0xDC9
+ u8 lastItem; // 0xDD0
+ u8 voidedAsWolf; // 0xDD1
+ u8 unk_DD2; // 0xDD2
+ u8 respawnAnimation; // 0xDD3
+
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+ // Need to also get the exact size of this struct
+ struct CurrentStageVars
+ {
+ char currentStage[8];
+ s16 currentSpawnPoint;
+ u8 unknown[4];
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+ // Need to also get the exact size of this struct
+ struct NextStageVars
+ {
+ char nextStage[8];
+ u8 isVoidorWarp;
+ u8 nextSpawnPoint;
+ u8 nextRoom;
+ u8 nextState;
+ u8 unk1;
+ u8 unk2;
+ u8 triggerLoad;
+ u8 fadeType;
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+
+ struct EventSystem
+ {
+ u8 unk00[0x13]; // 4ec8 - 4eda
+ u16 immediateControl; // 4edb - 4edc
+ u8 unk_00[0x4]; // 4edd - 4EE0
+ u8 nextEventID; // 4EE1
+ u8 unk1A[0xC5];
+ u8 actionStatus;
+ u8 unkDF[0x5];
+ u8 eventFlag;
+ u8 unkE7[0x5];
+ u8 currentEventID;
+ u8 unk_ec[0x14];
+ tp::evt_control::csFunc* onSkip; // if != 0 the function stored here will run, otherwise unskippable
+ u8 unk_104[0xC];
+ u32 fadeOnSkip; // if != 0 this will fade out the screen when skipping
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+ // Need to also get the exact size of this struct
+ struct LinkMapVars
+ {
+ u8 unk_0[0x4D0];
+ float pos[3];
+ u8 unk_4DC[0x94];
+ u32 isTargeting; // 570 at 0x400000 link is targeting
+ u8 unk_574[0x2A68];
+ u16 equippedItem;
+ } __attribute__( ( __packed__ ) );
+
+ struct TunicColor
+ {
+ u8 unk_0[0x32A0];
+ u8 redTopToggle; // 0x4 disables red
+ u8 redTop;
+ u8 greenTopToggle; // 0x4 disables green
+ u8 greenTop;
+ u8 blueTopToggle; // 0x4 disables blue
+ u8 blueTop;
+ u8 unk_32A6[0x2];
+ u8 redBottomToggle; // 0x4 disables red
+ u8 redBottom;
+ u8 greenBottomToggle; // 0x4 disables green
+ u8 greenBottom;
+ u8 blueBottomToggle; // 0x4 disables blue
+ u8 blueBottom;
+ } __attribute__( ( __packed__ ) );
+
+ // Should try to fill in the missing variables at some point
+ struct GameInfo
+ {
+ ScratchPad scratchPad; // 0 - 957
+ AreaNodes localAreaNodes; // 958 - 978 holds flags about the current area
+ u8 unk_979[0x43B]; // 979 - DB3
+ RespawnValues respawnValues; // DB4 - DD3
+ u8 unkdd4[0x402C]; // dd4 - 4DFF
+ char currentStage[8]; // 4E00 - 4E07
+ u8 unk_4e08; // 4E08
+ u8 currentSpawnID; // 4E09
+ u8 unk_4e0A[4]; // 4E0A - 4E0D
+ NextStageVars nextStageVars; // 4E0E - 4E1D
+ u8 unk_4e1E[0xAA]; // 4E1E - 4EC7
+ EventSystem eventSystem; // 4EC8 - 4FDB
+ u8 unk_4fdc[0xDD0]; // 4FDC - 5DAB
+ LinkMapVars* linkMapPtr; // 5DAC - 5DAF
+ u8 unk_5db0[0x4];
+ TunicColor* ColorPtr; // 5DB4 - 5DB7
+ u8 unk_5db8[0x2A]; // 5DB8 - 5DE1
+ u16 airMeter; // 5DE2 - 5DE3 max = 258
+ u8 unk_5de4[0x38]; // 5DE4 - 5E1B
+ u8 rButtonText; // 5E1C - 51EC
+ u8 bButtonText; // 5E1D - 51ED
+ u8 unk_5E1E[0x6]; // 5E1E - 5E23
+ u8 aButtonText; // 5E24 - 5E24
+ u8 unk_5e25; // 5E25 - 5E25
+ u8 stickButtonText; // 5E26 - 5E26
+ u8 unk_5e27[0xB]; // 5E27 - 5E5B
+ u8 startButtonText; // 5E32 - 5E32
+ u8 unk_5e33[0xC]; // 5E33 - 5E3E
+ u8 cButtonText; // 5E3F - 5E3F
+ u8 unk_5e40[0x1C]; // 5E40 - 5E5B
+ u8 xButtonText; // 5E5C - 5E5C set to sense and doesn't unset
+ u8 unk_5e5D[0x3]; // 5E5D - 5E5F
+ u8 yButtonText; // 5E60 - 5E60 set to dig and doesn't unset
+ u8 unk_5e61[0xB]; // 5E61 - 5E6B
+ u8 xItem; // 5E6C - 5E6C
+ u8 yItem; // 5E6D - 5E6D
+ u8 unk_5E6E[0x22]; // 5E6E - 5E8F
+ u8 bottomPromptShown; // 5E90 set to 0x8 when button promt apprears on bottom of screen
+ u8 topPromptShown; // 5E91 set to 0x8 when button promt apprears on top of screen
+ u8 unk_5e92[0x25]; // 5E92 - 5EB6
+ u8 airTimerDepleted; // 5EB7 - 5EB7
+ u8 unk_5eb8[0x17F58];
+
+ } __attribute__( ( __packed__ ) );
+
+ static_assert( sizeof( AreaNodes ) == 0x20 );
+ static_assert( sizeof( ScratchPad ) == 0x958 );
+ static_assert( sizeof( GameInfo ) == 0x1DE10 );
+ static_assert( sizeof( DungeonFlags ) == 0x1 );
+ static_assert( sizeof( FishingJournal ) == 0x26 );
+ static_assert( sizeof( ExploredStagesMap ) == 0x200 );
+ static_assert( sizeof( Epona ) == 0x18 );
+ static_assert( sizeof( Link ) == 0x22 );
+ static_assert( sizeof( Ooccoo ) == 0x19 );
+ static_assert( sizeof( MovingActors ) == 0x59 );
+ static_assert( sizeof( Ammo ) == 0x10 );
+ static_assert( sizeof( RespawnValues ) == 0x21 );
+ static_assert( sizeof( LinkMapVars* ) == 0x4 );
+ static_assert( sizeof( EventSystem ) == 0x114 );
+ static_assert( sizeof( NextStageVars ) == 0x10 );
+
+ extern "C"
+ {
+ extern GameInfo dComIfG_gameInfo;
+ extern u8 current_state;
+ extern void setItemBombNumCount(
+ u32 unk1,
+ u8 bagNb,
+ short amout ); // amount will be the og (ex: if you can only have 5 more bombs and buy 10, it'll still ahow 10)
+ extern u8 next_state;
+ extern char izaBoatSignText[100];
+ // extern char wallet_description[96];
+ extern u8 can_warp;
+ }
+} // namespace tp::d_com_inf_game \ No newline at end of file
diff --git a/include/tp/d_item.h b/include/tp/d_item.h
index 030b210..d2b16ac 100644
--- a/include/tp/d_item.h
+++ b/include/tp/d_item.h
@@ -4,10 +4,10 @@
namespace tp::d_item
{
- extern "C"
- {
- s32 execItemGet(u8 item);
- s32 checkItemGet(u8 item, s32 defaultValue);
- void item_func_UTUWA_HEART();
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ s32 execItemGet( u8 item );
+ s32 checkItemGet( u8 item, s32 defaultValue );
+ void item_func_UTUWA_HEART();
+ }
+} // namespace tp::d_item \ No newline at end of file
diff --git a/include/tp/d_item_data.h b/include/tp/d_item_data.h
index c5bd746..c18f488 100644
--- a/include/tp/d_item_data.h
+++ b/include/tp/d_item_data.h
@@ -1,52 +1,52 @@
-#pragma once
-
-#include "defines.h"
-#include <tp/d_stage.h>
-
-namespace tp::d_item_data
-{
+#pragma once
+
+#include <tp/d_stage.h>
- struct ItemResource // d_item_data.h
- {
- char* arcName;
- s16 modelResIdx;
- s16 btkResIdx;
- s16 bckResIdx;
- s16 brkResIdx;
- s16 btpResIdx;
- u8 tevFrm;
- u8 btpFrm;
- s16 ringTexResIdx;
- s16 unk_12[3];
- } __attribute__((__packed__));
+#include "defines.h"
+
+namespace tp::d_item_data
+{
+ struct ItemResource // d_item_data.h
+ {
+ char* arcName;
+ s16 modelResIdx;
+ s16 btkResIdx;
+ s16 bckResIdx;
+ s16 brkResIdx;
+ s16 btpResIdx;
+ u8 tevFrm;
+ u8 btpFrm;
+ s16 ringTexResIdx;
+ s16 unk_12[3];
+ } __attribute__( ( __packed__ ) );
- struct FieldItemRes // d_item_data.h
- {
- char* arcName;
- s16 modelResIdx;
- s16 bckAnmResIdx;
- s16 brkAnmResIdx;
- s16 unk_a;
- s16 heapSize;
- s16 unk_e;
- } __attribute__((__packed__));
+ struct FieldItemRes // d_item_data.h
+ {
+ char* arcName;
+ s16 modelResIdx;
+ s16 bckAnmResIdx;
+ s16 brkAnmResIdx;
+ s16 unk_a;
+ s16 heapSize;
+ s16 unk_e;
+ } __attribute__( ( __packed__ ) );
- struct ItemInfo // d_item_data.h
- {
- u8 mShadowSize;
- u8 mCollisionH;
- u8 mCollisionR;
- u8 mFlags;
- } __attribute__((__packed__));
+ struct ItemInfo // d_item_data.h
+ {
+ u8 mShadowSize;
+ u8 mCollisionH;
+ u8 mCollisionR;
+ u8 mFlags;
+ } __attribute__( ( __packed__ ) );
- static_assert(sizeof(ItemResource) == 0x18);
- static_assert(sizeof(FieldItemRes) == 0x10);
- static_assert(sizeof(ItemInfo) == 0x4);
+ static_assert( sizeof( ItemResource ) == 0x18 );
+ static_assert( sizeof( FieldItemRes ) == 0x10 );
+ static_assert( sizeof( ItemInfo ) == 0x4 );
- extern "C"
- {
- extern ItemResource item_resource[255]; // 0x803AC5A0 in US
- extern FieldItemRes field_item_res[255]; // 0x803ADD88 in US
- extern ItemInfo item_info[255]; // 0x803AED78 in US
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern ItemResource item_resource[255]; // 0x803AC5A0 in US
+ extern FieldItemRes field_item_res[255]; // 0x803ADD88 in US
+ extern ItemInfo item_info[255]; // 0x803AED78 in US
+ }
+} // namespace tp::d_item_data \ No newline at end of file
diff --git a/include/tp/d_kankyo.h b/include/tp/d_kankyo.h
index 4121959..c3d413e 100644
--- a/include/tp/d_kankyo.h
+++ b/include/tp/d_kankyo.h
@@ -4,18 +4,18 @@
namespace tp::d_kankyo
{
- // Should try to fill in the missing variables at some point
- struct EnvLight
- {
- u8 unk_0[0x98C];
- u8 currentRoom;
- u8 unk_98d[0x983];
- } __attribute__((__packed__));
+ // Should try to fill in the missing variables at some point
+ struct EnvLight
+ {
+ u8 unk_0[0x98C];
+ u8 currentRoom;
+ u8 unk_98d[0x983];
+ } __attribute__( ( __packed__ ) );
- static_assert(sizeof(EnvLight) == 0x1310);
+ static_assert( sizeof( EnvLight ) == 0x1310 );
- extern "C"
- {
- extern EnvLight env_light;
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern EnvLight env_light;
+ }
+} // namespace tp::d_kankyo \ No newline at end of file
diff --git a/include/tp/d_map_path_dmap.h b/include/tp/d_map_path_dmap.h
index 779a94f..75486d1 100644
--- a/include/tp/d_map_path_dmap.h
+++ b/include/tp/d_map_path_dmap.h
@@ -4,9 +4,9 @@
namespace tp::d_map_path_dmap
{
- extern "C"
- {
- void getMapPlayerPos(float posOut[3]);
- u32 getMapPlayerAngleY();
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ void getMapPlayerPos( float posOut[3] );
+ u32 getMapPlayerAngleY();
+ }
+} // namespace tp::d_map_path_dmap \ No newline at end of file
diff --git a/include/tp/d_menu_collect.h b/include/tp/d_menu_collect.h
index 8768ac4..c04879b 100644
--- a/include/tp/d_menu_collect.h
+++ b/include/tp/d_menu_collect.h
@@ -4,8 +4,8 @@
namespace tp::d_menu_collect
{
- extern "C"
- {
- void setWalletMaxNum();
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ void setWalletMaxNum();
+ }
+} // namespace tp::d_menu_collect \ No newline at end of file
diff --git a/include/tp/d_meter2_info.h b/include/tp/d_meter2_info.h
index f6f1b6c..ffb50bb 100644
--- a/include/tp/d_meter2_info.h
+++ b/include/tp/d_meter2_info.h
@@ -1,12 +1,13 @@
#pragma once
-#include "defines.h"
#include <tp/d_com_inf_game.h>
+#include "defines.h"
+
namespace tp::d_meter2_info
{
- extern "C"
- {
- extern void* wZButtonPtr;
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern void* wZButtonPtr;
+ }
+} // namespace tp::d_meter2_info \ No newline at end of file
diff --git a/include/tp/d_msg_flow.h b/include/tp/d_msg_flow.h
index 9a3c4f3..7ba202a 100644
--- a/include/tp/d_msg_flow.h
+++ b/include/tp/d_msg_flow.h
@@ -4,8 +4,8 @@
namespace tp::d_msg_flow
{
- extern "C"
- {
- bool query022(void* unk1, void* unk2, s32 unk3);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ bool query022( void* unk1, void* unk2, s32 unk3 );
+ }
+} // namespace tp::d_msg_flow \ No newline at end of file
diff --git a/include/tp/d_save.h b/include/tp/d_save.h
index 132a564..c27a25e 100644
--- a/include/tp/d_save.h
+++ b/include/tp/d_save.h
@@ -1,14 +1,15 @@
#pragma once
-#include "defines.h"
#include <tp/d_com_inf_game.h>
+#include "defines.h"
+
namespace tp::d_save
{
- extern "C"
- {
- u16 getRupeeMax();
- void getSave(tp::d_com_inf_game::GameInfo* gameInfoPtr, s32 areaID);
- void putSave(tp::d_com_inf_game::GameInfo* gameInfoPtr, s32 areaID);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ u16 getRupeeMax();
+ void getSave( tp::d_com_inf_game::GameInfo* gameInfoPtr, s32 areaID );
+ void putSave( tp::d_com_inf_game::GameInfo* gameInfoPtr, s32 areaID );
+ }
+} // namespace tp::d_save \ No newline at end of file
diff --git a/include/tp/d_stage.h b/include/tp/d_stage.h
index 873abb1..573fbf2 100644
--- a/include/tp/d_stage.h
+++ b/include/tp/d_stage.h
@@ -12,33 +12,33 @@
namespace tp::d_stage
{
- struct Item
- {
- char objectName[8];
- u8 paramOne;
- u8 paramTwo;
- u8 membitFlag;
- u8 item;
- float pos[3];
- s16 rot[3];
- u16 enemyNum;
- } __attribute__((__packed__));
+ struct Item
+ {
+ char objectName[8];
+ u8 paramOne;
+ u8 paramTwo;
+ u8 membitFlag;
+ u8 item;
+ float pos[3];
+ s16 rot[3];
+ u16 enemyNum;
+ } __attribute__( ( __packed__ ) );
- static_assert(sizeof(Item) == 0x20);
+ static_assert( sizeof( Item ) == 0x20 );
- extern "C"
- {
- extern void* mStatus_roomControl;
+ extern "C"
+ {
+ extern void* mStatus_roomControl;
- /**
- * @brief Initialises Actors, can run multiple times per load
- *
- * @param mStatus_roomControl Pointer to roomControl data (unknown)
- * @param chunkTypeInfo Pointer to dzxHeader
- * @param unk3 unknown
- * @param unk4 unknown
- */
- bool actorCommonLayerInit(void* mStatus_roomControl, dzxChunkTypeInfo* chunkTypeInfo, int unk3, void* unk4);
- bool actorInit(void* mStatus_roomControl, dzxChunkTypeInfo* chunkTypeInfo, int unk3, void* unk4);
- }
-} // namespace tp::d_stage \ No newline at end of file
+ /**
+ * @brief Initialises Actors, can run multiple times per load
+ *
+ * @param mStatus_roomControl Pointer to roomControl data (unknown)
+ * @param chunkTypeInfo Pointer to dzxHeader
+ * @param unk3 unknown
+ * @param unk4 unknown
+ */
+ bool actorCommonLayerInit( void* mStatus_roomControl, dzxChunkTypeInfo* chunkTypeInfo, int unk3, void* unk4 );
+ bool actorInit( void* mStatus_roomControl, dzxChunkTypeInfo* chunkTypeInfo, int unk3, void* unk4 );
+ }
+} // namespace tp::d_stage \ No newline at end of file
diff --git a/include/tp/dzx.h b/include/tp/dzx.h
index 2833981..c12512b 100644
--- a/include/tp/dzx.h
+++ b/include/tp/dzx.h
@@ -11,48 +11,48 @@
namespace tp::d_stage
{
- /**
- * @brief Holds information about the given dzx Chunktype
- *
- * Example:
- * TRES
- * 0001
- * 80401234 = 1 TRES Chunk at this address
- */
-
- struct Actr
- {
- char objectName[8];
- u32 parameters;
- float pos[3];
- s16 rot[3];
- u16 enemyNum;
- } __attribute__((__packed__));
- static_assert(sizeof(Actr) == 0x20);
-
- struct dzxChunkTypeInfo
- {
- char tag[4];
- u32 numChunks;
- void* chunkDataPtr;
- } __attribute__((__packed__));
-
- struct TRES
- {
- char actorName[8];
- u32 flags;
-
- float X;
- float Y;
- float Z;
-
- s32 angle;
-
- u8 item;
- u8 unk2[3]; // Seems to always be 0xFF
-
- TRES() { memset(this, 0xFF, sizeof(TRES)); }
- } __attribute__((__packed__));
- static_assert(sizeof(TRES) == 0x20);
-
-} // namespace tp \ No newline at end of file
+ /**
+ * @brief Holds information about the given dzx Chunktype
+ *
+ * Example:
+ * TRES
+ * 0001
+ * 80401234 = 1 TRES Chunk at this address
+ */
+
+ struct Actr
+ {
+ char objectName[8];
+ u32 parameters;
+ float pos[3];
+ s16 rot[3];
+ u16 enemyNum;
+ } __attribute__( ( __packed__ ) );
+ static_assert( sizeof( Actr ) == 0x20 );
+
+ struct dzxChunkTypeInfo
+ {
+ char tag[4];
+ u32 numChunks;
+ void* chunkDataPtr;
+ } __attribute__( ( __packed__ ) );
+
+ struct TRES
+ {
+ char actorName[8];
+ u32 flags;
+
+ float X;
+ float Y;
+ float Z;
+
+ s32 angle;
+
+ u8 item;
+ u8 unk2[3]; // Seems to always be 0xFF
+
+ TRES() { memset( this, 0xFF, sizeof( TRES ) ); }
+ } __attribute__( ( __packed__ ) );
+ static_assert( sizeof( TRES ) == 0x20 );
+
+} // namespace tp::d_stage \ No newline at end of file
diff --git a/include/tp/evt_control.h b/include/tp/evt_control.h
index 32301da..55e9bdc 100644
--- a/include/tp/evt_control.h
+++ b/include/tp/evt_control.h
@@ -4,10 +4,10 @@
namespace tp::evt_control
{
- typedef s32 (csFunc)(void* unk, s32 unk2);
- extern "C"
- {
- s32 skipper(void* eventPtr);
- s32 defaultSkipStb(void* unk, s32 unk2);
- }
-} \ No newline at end of file
+ typedef s32( csFunc )( void* unk, s32 unk2 );
+ extern "C"
+ {
+ s32 skipper( void* eventPtr );
+ s32 defaultSkipStb( void* unk, s32 unk2 );
+ }
+} // namespace tp::evt_control \ No newline at end of file
diff --git a/include/tp/f_ap_game.h b/include/tp/f_ap_game.h
index e362a86..d494731 100644
--- a/include/tp/f_ap_game.h
+++ b/include/tp/f_ap_game.h
@@ -4,8 +4,8 @@
namespace tp::f_ap_game
{
- extern "C"
- {
- void fapGm_Execute();
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ void fapGm_Execute();
+ }
+} // namespace tp::f_ap_game \ No newline at end of file
diff --git a/include/tp/f_op_actor_mng.h b/include/tp/f_op_actor_mng.h
index d0ca47c..7406b98 100644
--- a/include/tp/f_op_actor_mng.h
+++ b/include/tp/f_op_actor_mng.h
@@ -4,14 +4,56 @@
namespace tp::f_op_actor_mng
{
- extern "C"
- {
- s32 createItemForPresentDemo(const float pos[3], s32 item, u8 unk3, s32 unk4, s32 unk5, const float unk6[3], const float unk7[3]);
- s32 createItemForTrBoxDemo(const float pos[3], s32 item, s32 unk3, s32 unk4, const float unk5[3], const float unk6[3]);
- s32 createDemoItem(const float pos[3], s32 item, s32 unk3, const float unk4[3], s32 unk5, const float unk6[3], u8 unk7);
- s32 createItemForBoss(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], float unk6, float unk7, s32 unk8);
- s32 createItemForMidBoss(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], s32 unk6, s32 unk7);
- s32 createItemForDirectGet(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], float unk6, float unk7);
- s32 createItemForSimpleDemo(const float pos[3], s32 item, s32 unk3, const float unk4[3], const float unk5[3], float unk6, float unk7);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ s32 createItemForPresentDemo( const float pos[3],
+ s32 item,
+ u8 unk3,
+ s32 unk4,
+ s32 unk5,
+ const float unk6[3],
+ const float unk7[3] );
+ s32 createItemForTrBoxDemo( const float pos[3],
+ s32 item,
+ s32 unk3,
+ s32 unk4,
+ const float unk5[3],
+ const float unk6[3] );
+ s32 createDemoItem( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ s32 unk5,
+ const float unk6[3],
+ u8 unk7 );
+ s32 createItemForBoss( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ float unk6,
+ float unk7,
+ s32 unk8 );
+ s32 createItemForMidBoss( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ s32 unk6,
+ s32 unk7 );
+ s32 createItemForDirectGet( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ float unk6,
+ float unk7 );
+ s32 createItemForSimpleDemo( const float pos[3],
+ s32 item,
+ s32 unk3,
+ const float unk4[3],
+ const float unk5[3],
+ float unk6,
+ float unk7 );
+ }
+} // namespace tp::f_op_actor_mng \ No newline at end of file
diff --git a/include/tp/f_op_scene_req.h b/include/tp/f_op_scene_req.h
index a650dc3..f21fc4c 100644
--- a/include/tp/f_op_scene_req.h
+++ b/include/tp/f_op_scene_req.h
@@ -4,9 +4,9 @@
namespace tp::f_op_scene_req
{
- extern "C"
- {
- extern u8 freezeActors;
- extern s32 isUsingOfOverlap;
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern u8 freezeActors;
+ extern s32 isUsingOfOverlap;
+ }
+} // namespace tp::f_op_scene_req \ No newline at end of file
diff --git a/include/tp/m_Do_controller_pad.h b/include/tp/m_Do_controller_pad.h
index af38ac6..6f2a090 100644
--- a/include/tp/m_Do_controller_pad.h
+++ b/include/tp/m_Do_controller_pad.h
@@ -4,19 +4,19 @@
namespace tp::m_do_controller_pad
{
- // Should try to fill in the missing variables at some point
- struct CPadInfo
- {
- u8 unk_0[0x30];
- u32 buttonInput;
- u32 buttonInputTrg;
- u8 unk_38[0xC8];
- } __attribute__((__packed__));
+ // Should try to fill in the missing variables at some point
+ struct CPadInfo
+ {
+ u8 unk_0[0x30];
+ u32 buttonInput;
+ u32 buttonInputTrg;
+ u8 unk_38[0xC8];
+ } __attribute__( ( __packed__ ) );
- static_assert(sizeof(CPadInfo) == 0x100);
+ static_assert( sizeof( CPadInfo ) == 0x100 );
- extern "C"
- {
- extern CPadInfo cpadInfo;
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern CPadInfo cpadInfo;
+ }
+} // namespace tp::m_do_controller_pad \ No newline at end of file
diff --git a/include/tp/m_Do_ext.h b/include/tp/m_Do_ext.h
index 9c6b664..3b4043c 100644
--- a/include/tp/m_Do_ext.h
+++ b/include/tp/m_Do_ext.h
@@ -4,8 +4,8 @@
namespace tp::m_Do_ext
{
- extern "C"
- {
- extern void* archiveHeap;
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern void* archiveHeap;
+ }
+} // namespace tp::m_Do_ext \ No newline at end of file
diff --git a/include/tp/resource.h b/include/tp/resource.h
index 255d91e..57d83ea 100644
--- a/include/tp/resource.h
+++ b/include/tp/resource.h
@@ -4,8 +4,8 @@
namespace tp::resource
{
- extern "C"
- {
- extern void* parseCharacter_1Byte(const char** text);
- }
-} \ No newline at end of file
+ extern "C"
+ {
+ extern void* parseCharacter_1Byte( const char** text );
+ }
+} // namespace tp::resource \ No newline at end of file
diff --git a/source/HUDConsole.cpp b/source/HUDConsole.cpp
index 8e78484..08a59ac 100644
--- a/source/HUDConsole.cpp
+++ b/source/HUDConsole.cpp
@@ -1,259 +1,275 @@
#include "HUDConsole.h"
-#include "defines.h"
-#include "systemConsole.h"
#include <cstdio>
#include <cstring>
+#include "defines.h"
+#include "systemConsole.h"
+
namespace mod
{
- HUDConsole::HUDConsole(const char firstPage[16], u32 RGBA)
- {
- strcpy(pages[0], firstPage);
- numPages = 1;
-
- // Set the visibility flags for all lines but disable the console
- system_console::setState(true, 25);
- system_console::setState(false, 0);
-
- system_console::setBackgroundColor(RGBA);
- }
-
- void HUDConsole::addOption(u8 page, const char title[16], u8* target, u32 limit)
- {
- // Page is 0-based index, numPages the absolute counter
- if(page < numPages)
- {
- // Find the option struct
- u8 optionIndex = numOptions[page];
-
- if(optionIndex < 10)
- {
- strcpy(options[page][optionIndex].Title, title);
- options[page][optionIndex].Target = target;
- options[page][optionIndex].Limit = limit;
-
- // Incrase the counter
- numOptions[page]++;
- }
- }
- }
-
- void HUDConsole::addWatch(u8 page, const char title[16], void* target, char format, u8 interpretation)
- {
- // Page is 0-based index, numPages the absolute counter
- if(page < numPages)
- {
- // Find the watch struct
- u8 watchIndex = numWatches[page];
-
- if(watchIndex < 10)
- {
- strcpy(watches[page][watchIndex].Title, title);
- watches[page][watchIndex].Target = target;
- watches[page][watchIndex].Format = format;
- watches[page][watchIndex].Interpretation = interpretation;
-
- // Increase the counter
- numWatches[page]++;
- }
- }
- }
-
- s8 HUDConsole::addPage(const char title[16])
- {
- if(numPages < MAX_HUDCONSOLE_PAGES)
- {
- sprintf(pages[numPages], title);
- numPages++;
-
- return (numPages - 1);
- }
- return -1;
- }
-
- void HUDConsole::performAction(u8 consoleAction, u8 amount)
- {
- Option* o = &options[selectedPage][selectedOption];
- switch(consoleAction)
- {
- case ConsoleActions::Move_Up:
- // Y movement (Caret)
- if(selectedOption > 0)
- {
- selectedOption--;
- }
- else
- {
- // Go to last option
- selectedOption = numOptions[selectedPage] - 1;
- }
- break;
-
- case ConsoleActions::Move_Down:
- // Y movement (Caret)
- if(selectedOption < numOptions[selectedPage] - 1)
- {
- selectedOption++;
- }
- else
- {
- // Reset position
- selectedOption = 0;
- }
- break;
-
- case ConsoleActions::Move_Left:
- selectedOption = 0;
- // X Movement (Page)
- if(selectedPage > 0)
- {
- selectedPage--;
- }
- else
- {
- // Go to last page
- selectedPage = numPages - 1;
- }
- break;
-
- case ConsoleActions::Move_Right:
- selectedOption = 0;
- // X Movement (Page)
- if(selectedPage < numPages - 1)
- {
- selectedPage++;
- }
- else
- {
- // Go to first page
- selectedPage = 0;
- }
- break;
-
- case ConsoleActions::Option_Increase:
- if(numOptions[selectedPage] < 1) return;
- if(*o->Target + amount <= o->Limit)
- {
- *o->Target = *o->Target + amount;
- }
- else
- {
- // Loop back
- *o->Target = 0;
- }
- break;
-
- case ConsoleActions::Option_Decrease:
- if(numOptions[selectedPage] < 1) return;
- else if(*o->Target - amount >= 0)
- {
- *o->Target = *o->Target - amount;
- }
- else
- {
- // Loop back
- *o->Target = static_cast<u8>(o->Limit);
- }
- break;
- }
- }
-
- void HUDConsole::draw()
- {
- // Current line index
- u8 i = 0;
-
- tp::jfw_system::SystemConsole* console = sysConsolePtr;
-
- // Print heading
- sprintf(console->consoleLine[i].line, "[%d/%d][%-18s] %s (C) %s", selectedPage + 1, numPages, pages[selectedPage], VERSION, AUTHOR);
-
- // Print options
- for(i = 1; i <= numOptions[selectedPage]; i++)
- {
- // Template:
- // [>] [title] (padding) [value]
- u8 optionindex = i - 1; // Option[0] is line 1
- Option o = options[selectedPage][optionindex];
-
- if(o.Limit == 1)
- {
- sprintf(console->consoleLine[i].line, "%c%-25s %s", (optionindex == selectedOption ? '>' : ' '), o.Title, (*o.Target ? "Yes" : "No"));
- }
- else
- {
- sprintf(console->consoleLine[i].line, "%c%-25s %02x", (optionindex == selectedOption ? '>' : ' '), o.Title, *o.Target);
- }
- }
-
- for(i = i; i < 11; i++)
- {
- console->consoleLine[i].line[0] = '\0';
- }
-
- for(i = i; (i - 11) < numWatches[selectedPage]; i++)
- {
- u8 watchIndex = i - 11;
- // Print the watch to this line
- Watch w = watches[selectedPage][watchIndex];
-
- char format[12];
- sprintf(format, "%s%c", "%-15s %", w.Format);
-
- if(w.Interpretation == WatchInterpretation::_s64 || w.Interpretation == WatchInterpretation::_u64)
- {
- sprintf(format, "%s%c", "%-15s %ll", w.Format);
- }
-
- switch(w.Interpretation)
- {
- case WatchInterpretation::_u8:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u8*>(w.Target));
- break;
-
- case WatchInterpretation::_u16:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u16*>(w.Target));
- break;
-
- case WatchInterpretation::_u32:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u32*>(w.Target));
- break;
-
- case WatchInterpretation::_u64:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u64*>(w.Target));
- break;
-
- case WatchInterpretation::_s8:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s8*>(w.Target));
- break;
-
- case WatchInterpretation::_s16:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s16*>(w.Target));
- break;
-
- case WatchInterpretation::_s32:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s32*>(w.Target));
- break;
-
- case WatchInterpretation::_s64:
- sprintf(console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s64*>(w.Target));
- break;
-
- case WatchInterpretation::_str:
- sprintf(console->consoleLine[i].line, format, w.Title, reinterpret_cast<char*>(w.Target));
- break;
-
- default:
- strcpy(console->consoleLine[i].line, "Error parsing watch");
- break;
- }
- }
-
- for(i = i; i < 20; i++)
- {
- console->consoleLine[i].line[0] = '\0';
- }
-
- }
-} \ No newline at end of file
+ HUDConsole::HUDConsole( const char firstPage[16], u32 RGBA )
+ {
+ strcpy( pages[0], firstPage );
+ numPages = 1;
+
+ // Set the visibility flags for all lines but disable the console
+ system_console::setState( true, 25 );
+ system_console::setState( false, 0 );
+
+ system_console::setBackgroundColor( RGBA );
+ }
+
+ void HUDConsole::addOption( u8 page, const char title[16], u8* target, u32 limit )
+ {
+ // Page is 0-based index, numPages the absolute counter
+ if ( page < numPages )
+ {
+ // Find the option struct
+ u8 optionIndex = numOptions[page];
+
+ if ( optionIndex < 10 )
+ {
+ strcpy( options[page][optionIndex].Title, title );
+ options[page][optionIndex].Target = target;
+ options[page][optionIndex].Limit = limit;
+
+ // Incrase the counter
+ numOptions[page]++;
+ }
+ }
+ }
+
+ void HUDConsole::addWatch( u8 page, const char title[16], void* target, char format, u8 interpretation )
+ {
+ // Page is 0-based index, numPages the absolute counter
+ if ( page < numPages )
+ {
+ // Find the watch struct
+ u8 watchIndex = numWatches[page];
+
+ if ( watchIndex < 10 )
+ {
+ strcpy( watches[page][watchIndex].Title, title );
+ watches[page][watchIndex].Target = target;
+ watches[page][watchIndex].Format = format;
+ watches[page][watchIndex].Interpretation = interpretation;
+
+ // Increase the counter
+ numWatches[page]++;
+ }
+ }
+ }
+
+ s8 HUDConsole::addPage( const char title[16] )
+ {
+ if ( numPages < MAX_HUDCONSOLE_PAGES )
+ {
+ sprintf( pages[numPages], title );
+ numPages++;
+
+ return ( numPages - 1 );
+ }
+ return -1;
+ }
+
+ void HUDConsole::performAction( u8 consoleAction, u8 amount )
+ {
+ Option* o = &options[selectedPage][selectedOption];
+ switch ( consoleAction )
+ {
+ case ConsoleActions::Move_Up:
+ // Y movement (Caret)
+ if ( selectedOption > 0 )
+ {
+ selectedOption--;
+ }
+ else
+ {
+ // Go to last option
+ selectedOption = numOptions[selectedPage] - 1;
+ }
+ break;
+
+ case ConsoleActions::Move_Down:
+ // Y movement (Caret)
+ if ( selectedOption < numOptions[selectedPage] - 1 )
+ {
+ selectedOption++;
+ }
+ else
+ {
+ // Reset position
+ selectedOption = 0;
+ }
+ break;
+
+ case ConsoleActions::Move_Left:
+ selectedOption = 0;
+ // X Movement (Page)
+ if ( selectedPage > 0 )
+ {
+ selectedPage--;
+ }
+ else
+ {
+ // Go to last page
+ selectedPage = numPages - 1;
+ }
+ break;
+
+ case ConsoleActions::Move_Right:
+ selectedOption = 0;
+ // X Movement (Page)
+ if ( selectedPage < numPages - 1 )
+ {
+ selectedPage++;
+ }
+ else
+ {
+ // Go to first page
+ selectedPage = 0;
+ }
+ break;
+
+ case ConsoleActions::Option_Increase:
+ if ( numOptions[selectedPage] < 1 )
+ return;
+ if ( *o->Target + amount <= o->Limit )
+ {
+ *o->Target = *o->Target + amount;
+ }
+ else
+ {
+ // Loop back
+ *o->Target = 0;
+ }
+ break;
+
+ case ConsoleActions::Option_Decrease:
+ if ( numOptions[selectedPage] < 1 )
+ return;
+ else if ( *o->Target - amount >= 0 )
+ {
+ *o->Target = *o->Target - amount;
+ }
+ else
+ {
+ // Loop back
+ *o->Target = static_cast<u8>( o->Limit );
+ }
+ break;
+ }
+ }
+
+ void HUDConsole::draw()
+ {
+ // Current line index
+ u8 i = 0;
+
+ tp::jfw_system::SystemConsole* console = sysConsolePtr;
+
+ // Print heading
+ sprintf( console->consoleLine[i].line,
+ "[%d/%d][%-18s] %s (C) %s",
+ selectedPage + 1,
+ numPages,
+ pages[selectedPage],
+ VERSION,
+ AUTHOR );
+
+ // Print options
+ for ( i = 1; i <= numOptions[selectedPage]; i++ )
+ {
+ // Template:
+ // [>] [title] (padding) [value]
+ u8 optionindex = i - 1; // Option[0] is line 1
+ Option o = options[selectedPage][optionindex];
+
+ if ( o.Limit == 1 )
+ {
+ sprintf( console->consoleLine[i].line,
+ "%c%-25s %s",
+ ( optionindex == selectedOption ? '>' : ' ' ),
+ o.Title,
+ ( *o.Target ? "Yes" : "No" ) );
+ }
+ else
+ {
+ sprintf( console->consoleLine[i].line,
+ "%c%-25s %02x",
+ ( optionindex == selectedOption ? '>' : ' ' ),
+ o.Title,
+ *o.Target );
+ }
+ }
+
+ for ( i = i; i < 11; i++ )
+ {
+ console->consoleLine[i].line[0] = '\0';
+ }
+
+ for ( i = i; ( i - 11 ) < numWatches[selectedPage]; i++ )
+ {
+ u8 watchIndex = i - 11;
+ // Print the watch to this line
+ Watch w = watches[selectedPage][watchIndex];
+
+ char format[12];
+ sprintf( format, "%s%c", "%-15s %", w.Format );
+
+ if ( w.Interpretation == WatchInterpretation::_s64 || w.Interpretation == WatchInterpretation::_u64 )
+ {
+ sprintf( format, "%s%c", "%-15s %ll", w.Format );
+ }
+
+ switch ( w.Interpretation )
+ {
+ case WatchInterpretation::_u8:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u8*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_u16:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u16*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_u32:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u32*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_u64:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<u64*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_s8:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s8*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_s16:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s16*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_s32:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s32*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_s64:
+ sprintf( console->consoleLine[i].line, format, w.Title, *reinterpret_cast<s64*>( w.Target ) );
+ break;
+
+ case WatchInterpretation::_str:
+ sprintf( console->consoleLine[i].line, format, w.Title, reinterpret_cast<char*>( w.Target ) );
+ break;
+
+ default:
+ strcpy( console->consoleLine[i].line, "Error parsing watch" );
+ break;
+ }
+ }
+
+ for ( i = i; i < 20; i++ )
+ {
+ console->consoleLine[i].line[0] = '\0';
+ }
+ }
+} // namespace mod \ No newline at end of file
diff --git a/source/array.cpp b/source/array.cpp
index 76cbebe..ed97609 100644
--- a/source/array.cpp
+++ b/source/array.cpp
@@ -1,19 +1,20 @@
#include "array.h"
-#include "memory.h"
#include <cstring>
+#include "memory.h"
+
namespace mod::array
{
- s32 indexOf(u16 needle, u16* haystack, size_t count)
- {
- for (u32 i = 0; i < count; i++)
- {
- if (haystack[i] == needle)
- {
- return static_cast<s32>(i);
- }
- }
- return -1;
- }
-} \ No newline at end of file
+ s32 indexOf( u16 needle, u16* haystack, size_t count )
+ {
+ for ( u32 i = 0; i < count; i++ )
+ {
+ if ( haystack[i] == needle )
+ {
+ return static_cast<s32>( i );
+ }
+ }
+ return -1;
+ }
+} // namespace mod::array \ No newline at end of file
diff --git a/source/chestRando.cpp b/source/chestRando.cpp
index dd60741..2fa8fcf 100644
--- a/source/chestRando.cpp
+++ b/source/chestRando.cpp
@@ -1,2298 +1,2401 @@
#include "chestRando.h"
-#include "defines.h"
-#include "item.h"
-#include "items.h"
-#include "itemChecks.h"
-#include "tools.h"
-#include "array.h"
-#include "stage.h"
-#include "keyPlacement.h"
-#include "singleton.h"
-#include "grottoChecks.h"
-#include "game_patches.h"
+#include <tp/JFWSystem.h>
+#include <tp/d_a_alink.h>
#include <tp/d_com_inf_game.h>
#include <tp/d_item.h>
-#include <tp/d_a_alink.h>
#include <tp/d_kankyo.h>
-#include <tp/JFWSystem.h>
#include <tp/resource.h>
+
#include <cstdio>
#include <cstring>
+#include "array.h"
+#include "defines.h"
+#include "game_patches.h"
+#include "grottoChecks.h"
+#include "item.h"
+#include "itemChecks.h"
+#include "items.h"
+#include "keyPlacement.h"
+#include "singleton.h"
+#include "stage.h"
+#include "tools.h"
+
namespace mod
{
- void ChestRandomizer::generate()
- {
- // Reset
-
- itemWheel = &gameInfo.scratchPad.itemWheel;
-
- currentPlayerConditions = startConditions;
- currentSeed = tools::randomSeed;
-
- totalChecks = sizeof(item::checks) / sizeof(item::ItemCheck);
- empty = 0;
- layerCheckCount = 0;
-
- itemOrderIndex = 0;
-
- // Set up arrays
- itemOrder = new u8[totalChecks];
-
- item::ItemCheck* sourceCheck;
- item::ItemCheck* destCheck;
-
- // Reset randomization
- for (u16 i = 0; i < totalChecks; i++)
- {
- item::checks[i].destination = nullptr;
- item::checks[i].source = nullptr;
- }
-
- // Lock some checks
- for (u16 i = 0; i < totalChecks; i++)
- {
- if (isLocked(&item::checks[i]))
- {
- placeCheck(&item::checks[i], &item::checks[i]);
- }
- }
-
- handleKeysanity();
-
- //do needed items in order
- for (u16 i = 0; i < sizeof(item::checkPriorityOrder) / sizeof(u16); i++)
- {
- destCheck = &item::checks[item::checkPriorityOrder[i]];
- if (!destCheck->source)
- {
- if (destCheck->itemID == items::Item::Ordon_Sword)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x1, destCheck);//to prevent woodensword from being overwritten before losing it
- }
- else
- {
- sourceCheck = findSource(destCheck->destLayer, 0x0, destCheck);
- }
- placeCheck(sourceCheck, destCheck);
- //layerCheckCount++;
- }
- }
-
- // Place items that unlock other locations before caring about remaining items
- //useless
- /*for(u16 i = 0; i < totalChecks; i++)
- {
- destCheck = &item::checks[i];
- if(!destCheck->source)
- {
- // Free slot
- if(item::getFlags(destCheck->itemID, 0) != 0)
- {
- // This would unlock new checks, so place it
- if (destCheck->itemID == items::Item::Ordon_Shield || destCheck->itemID == items::Item::Wooden_Shield || destCheck->itemID == items::Item::Hylian_Shield)
- {
- sourceCheck = findSource(0xFF, 0x2, destCheck);//to prevent softlocking the game when you try to get ordon shield check
- }
- else
- {
- sourceCheck = findSource(0xFF, 0, destCheck);
- }
- placeCheck(sourceCheck, destCheck);
- }
- }
- }*/
-
- //do dungeon items
- for (u16 i = 0; i <= totalChecks; i++)
- {
- destCheck = &item::checks[i];
- if (!destCheck->source && destCheck->type == item::ItemType::Dungeon)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x0, destCheck);
- placeCheck(sourceCheck, destCheck);
- //layerCheckCount++;
- }
- }
-
- // Place layer checks
- for (u16 i = 0; i < totalChecks; i++)
- {
- destCheck = &item::checks[i];
-
- if (!destCheck->source)
- {
- // Free slot
- if (destCheck->destLayer != 0xFF)
- {
- // Layer check
- if (destCheck->itemID == items::Item::Ordon_Sword)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x1, destCheck);//to prevent woodensword from being overwritten before losing it
- }
- else if (destCheck->itemID == items::Item::Ordon_Shield || destCheck->itemID == items::Item::Wooden_Shield || destCheck->itemID == items::Item::Hylian_Shield)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x2, destCheck);//to prevent softlocking the game when you try to get ordon shield check
- }
- else if (destCheck->itemID == items::Item::Zora_Armor || destCheck->itemID == items::Item::Magic_Armor)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x2, destCheck);//to prevent softlocking the game when you try to get ordon shield check
- }
- else if (isProgressiveEnabled == 0)
- {
- if (destCheck->itemID == items::Item::Clawshots)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x7, destCheck);//to prevent Clawshots from being overwritten by Clawshot
- }
- else if (destCheck->itemID == items::Item::Big_Quiver)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x4, destCheck);//to prevent bow from being overwritten
- }
- else if (destCheck->itemID == items::Item::Giant_Quiver)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x8, destCheck);//to prevent bow from being overwritten
- }
- else if (destCheck->itemID == items::Item::Giant_Wallet)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x7, destCheck);//to prevent overwriting giant wallet with big wallet
- }
- else if (destCheck->itemID == items::Item::Giant_Bomb_Bag)
- {
- sourceCheck = findSource(destCheck->destLayer, 0x6, destCheck);//to prevent getting a 4th bag and possibly crashing the game
- }
- else
- {
- sourceCheck = findSource(destCheck->destLayer, 0x0, destCheck);
- }
- }
- else
- {
- sourceCheck = findSource(destCheck->destLayer, 0x0, destCheck);
- }
- placeCheck(sourceCheck, destCheck);
- layerCheckCount++;
- }
- }
- }
-
-
-
- // Place remaining
- for (u16 i = 0; i < totalChecks; i++)
- {
- destCheck = &item::checks[i];
-
- if (!destCheck->source)
- {
- if (destCheck->itemID == items::Item::Ordon_Shield || destCheck->itemID == items::Item::Wooden_Shield || destCheck->itemID == items::Item::Hylian_Shield)
- {
- sourceCheck = findSource(0xFF, 0x2, destCheck);//to prevent softlocking the game when you try to get ordon shield check
- }
- else
- {
- sourceCheck = findSource(0xFF, 0, destCheck);
- }
- placeCheck(sourceCheck, destCheck);
- }
- }
-
- // Count empty
- for (u16 i = 0; i < totalChecks; i++)
- {
- if (!item::checks[i].destination)
- {
- empty++;
- }
- }
-
- // Done
- checkSum = tools::fletcher16(itemOrder, sizeof(itemOrder));
-
- delete[] itemOrder;
-
- // Reset seed if the player wanted to lock it (otherwise it advances anyways)
- tools::randomSeed = currentSeed;
- }
-
- void ChestRandomizer::placeCheck(item::ItemCheck* sourceCheck, item::ItemCheck* destCheck)
- {
- // Add source item to the itemOrder array
- itemOrder[itemOrderIndex] = sourceCheck->itemID;
- itemOrderIndex++;
-
- // Place without asking
- sourceCheck->destination = destCheck;
- destCheck->source = sourceCheck;
-
- // Update player conditions!
- currentPlayerConditions = item::getFlags(destCheck->itemID, currentPlayerConditions);
- }
-
- item::ItemCheck* ChestRandomizer::findSource(u8 maxLayer, u8 minLayer, item::ItemCheck* destCheck)
- {
- if (minLayer == 0xFF)
- {
- minLayer = 0x0;
- }
-
- item::ItemCheck* sourceCheck;
- u16 index;
- do
- {
- index = tools::getRandom(totalChecks);
- sourceCheck = &item::checks[index];
- } while (!checkCondition(sourceCheck, destCheck) || sourceCheck->destination || sourceCheck->sourceLayer > maxLayer || sourceCheck->sourceLayer < minLayer ||
- (destCheck->type == item::ItemType::Bug && 0 == strcmp("R_SP160", sourceCheck->stage) && sourceCheck->room == 3) || //agitha can't give bugs
- (areDungeonItemsRandomized == 1 && destCheck->type == item::ItemType::Dungeon && 0 != strcmp(destCheck->stage, sourceCheck->stage)) || //dungeon items only in their own dungeon
- (areDungeonItemsRandomized == 1 && destCheck->type == item::ItemType::Dungeon && index == 115)); //dont place dungeon items at clawshot goron mines check
-
- return sourceCheck;
- }
-
- bool ChestRandomizer::checkCondition(item::ItemCheck* sourceCheck, item::ItemCheck* destCheck)
- {
- if ((sourceCheck->condition & item::Condition::AND) == item::Condition::AND)
- {
- if ((sourceCheck->condition & currentPlayerConditions) == sourceCheck->condition)
- {
- return true;
- }
- }
- else
- {
- if ((sourceCheck->condition & currentPlayerConditions) != 0)
- {
- return true;
- }
- }
- // If the destination item (which you'll receive) isn't required for this source and you don't require anything in this layer, it can be placed though
- if ((item::getFlags(destCheck->itemID, 0) & sourceCheck->condition) == 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- bool ChestRandomizer::isLocked(item::ItemCheck* check)
- {
- bool result = false;
-
- switch (check->type)
- {
- case item::ItemType::Key:
- // Small Keys + ordon pumpkin and cheese
- if (isKeysanityEnabled == 0 || (Singleton::getInstance()->isForestEscapeEnabled == 1 && isKeysanityEnabled == 1 && check->itemID == items::Item::Coro_Key))
- {
- result = true;
- }
- break;
-
- case item::ItemType::Dungeon:
- // Map, compass, big key
- if (areDungeonItemsRandomized == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::HeartPiece:
- // Map, compass, big key
- if (areHeartPiecesRandomized == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::Rupee:
- // Map, compass, big key
- if (areRupeesRandomized == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::Ammo:
- // Map, compass, big key
- if (areAmmoRandomized == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::Story:
- if (check->itemID != items::Item::Aurus_Memo && check->itemID != items::Item::Asheis_Sketch)
- {
- result = true;
- }
- break;
-
- case item::ItemType::Bug:
- if (isBugsanityEnabled == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::PoeSoul:
- if (isPoesanityEnabled == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::Shop:
- if (isShopsanityEnabled == 0)
- {
- result = true;
- }
- break;
-
- case item::ItemType::Skill:
- result = true;
- break;
-
- case item::ItemType::Scent:
- result = true;
- break;
- }
-
- switch (check->itemID)
- {
- /*case items::Item::Iron_Boots:
- result = true;
- break;*/
- case items::Item::Shadow_Crystal:
- if (Singleton::getInstance()->isMDHSkipEnabled == 0)
- {
- result = true;
- }
- break;
-
- case items::Item::Fishing_Rod:
- result = true;
- break;
-
- case items::Item::Ancient_Sky_Book_empty:
- if (isProgressiveEnabled == 0)
- {
- result = true;
- }
- break;
-
- case items::Item::Ancient_Sky_Book_partly_filled:
- if (Singleton::getInstance()->shuffledSkybook == 0)
- {
- result = true;
- }
- break;
-
- case items::Item::Ancient_Sky_Book_completed:
- if (Singleton::getInstance()->shuffledSkybook == 0)
- {
- result = true;
- }
- break;
-
-
- }
-
- return result;
- }
-
- s32 ChestRandomizer::getItemReplacement(const float pos[3], s32 item)
- {
- item::ItemCheck* sourceCheck;
- snprintf(lastSourceInfo, 50, "%s %4.0f %4.0f %4.0f", gameInfo.currentStage, pos[0], pos[1], pos[2]);
- snprintf(lastDestInfo, 50, "No Replacement found for this source");
-
- /*if (item == items::Item::Sera_Bottle)
- { //for testing only
- item = itemThatReplacesHalfMilk;
- if (item == items::Item::Dominion_Rod)
- {
- gameInfo.scratchPad.eventBits[0x25] |= 0x80;
- }
- else if (item == items::Item::Poe_Soul)
- {//increase poe counter
- gameInfo.scratchPad.poeCount++;
- }
- return item;
- }
- else if (item == items::Item::Slingshot)
- { //for testing only
- item = itemThatReplacesSlingShot;
- if (item == items::Item::Dominion_Rod)
- {
- item = items::Item::Dominion_Rod;
- gameInfo.scratchPad.eventBits[0x25] |= 0x80;
- }
- else if (item == items::Item::Poe_Soul)
- {//increase poe counter
- gameInfo.scratchPad.poeCount++;
- }
- return item;
- }*/
-
-
- if (item == items::Item::Heart_Container && isStageBoss())
- {//set flag for HC gotten
- gameInfo.localAreaNodes.dungeon.containerGotten = 0b1;
- if (tp::d_a_alink::checkStageName(stage::allStages[Stage_Fyrus]))
- {
- gameInfo.localAreaNodes.unk_0[0xA] |= 0x40; //open doors to mini boss to prevent softlocks
- }
- }
- else if (item == items::Item::Iron_Boots)
- {//set flag for having talked to Bo
- gameInfo.scratchPad.eventBits[0x1C] |= 0x20;
- }
- else if (item == items::Item::Poe_Soul && gameInfo.scratchPad.poeCount >= 1 && !(tp::d_a_alink::checkStageName(stage::allStages[Stage_Castle_Town_Shops]) && tp::d_kankyo::env_light.currentRoom == 5))
- {//decrease poe counter
- gameInfo.scratchPad.poeCount--;
- }
- else if (item == items::Item::Ooccoo_Dungeon && tp::d_a_alink::checkStageName(stage::allStages[Stage_City_in_the_Sky]))
- {
- Singleton::getInstance()->hasCiTSOoccoo = 1;
- }
- else if (item == items::Item::Vessel_Of_Light_Faron)
- {
- tp::d_com_inf_game::ScratchPad* scratchPadPtr = &gameInfo.scratchPad;
- u8* eventBitsPtr = &scratchPadPtr->eventBits[0];
- tp::d_com_inf_game::AllAreaNodes* allAreaNodesPtr = &scratchPadPtr->allAreaNodes;
- if (Singleton::getInstance()->isTwilightSkipped == 1)
- {
- //Set Faron Twilight Flags
- scratchPadPtr->clearedTwilights.Faron = 0b1; //Clear Faron Twilight
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Faron);
- scratchPadPtr->tearCounters.Faron = 16;
- eventBitsPtr[0x5] |= 0xFF; //Ensure Epona is Stolen, give Midna Charge
- eventBitsPtr[0x6] |= 0x10; //Faron Twilight Progression flag
- eventBitsPtr[0xC] |= 0x8; //Set Sword and Shield to not be on back
- tools::setItemFlag(ItemFlags::Heros_Clothes);
-
- //Set Eldin Twilight Flags
- scratchPadPtr->clearedTwilights.Eldin = 0b1; // Clear Eldin Twilight
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Eldin);
- scratchPadPtr->tearCounters.Eldin = 16;
- eventBitsPtr[0x6] |= 0x1; //tame Epona
- eventBitsPtr[0xA] |= 0x8; //Beat KB1
- eventBitsPtr[0x14] |= 0x10; //Put Bo Outside
- eventBitsPtr[0x7] |= 0xDE; //skip Gor Coron Sumo and Enter Mines also Trigger KB1 and mark Post-KB1 CS as watched, Eldin Twilight Story Progression Flag
- eventBitsPtr[0x41] |= 0x10; //Told Fado about the Kids
-
- //Set Lanayru Twilight Flags
- scratchPadPtr->clearedTwilights.Lanayru = 0b1; // Clear Lanayru Twilight
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Lanayru);
- scratchPadPtr->tearCounters.Lanayru = 16;
- allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x80;//water on Field map
- allAreaNodesPtr->Hyrule_Field.unk_0[0xF] |= 0x10;//open south CT Shortcut to Faron
- allAreaNodesPtr->Lanayru.unk_0[0xF] |= 0x1;//water on Map
- eventBitsPtr[0x30] |= 0x40; //gave springwater to south CT goron
- eventBitsPtr[0x8] |= 0x80; //ZD Thawed
- eventBitsPtr[0xC] |= 0x2; //Lanayru Twilight Story Progression Flag
- eventBitsPtr[0xA] |= 0x10; //Kagorok Howl at Lake
-
- //Unlock Map Regions
- scratchPadPtr->movingActors.exploredRegions.Snowpeak = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Desert = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Lanayru = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Eldin = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Faron = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Ordon = 0b1;
-
- //Unlock Warps
- allAreaNodesPtr->Ordon.unk_0[0xD] = 0x10; // give Ordon Spring Warp
- gameInfo.localAreaNodes.unk_0[0x13] = 0x80;//give S faron warp
- gameInfo.localAreaNodes.unk_0[0xB] = 0x4;//give N faron warp
- allAreaNodesPtr->Eldin.unk_0[0x9] |= 0x20; // give Death Mountain Warp
- allAreaNodesPtr->Eldin.unk_0[0x8] |= 0x80; // give Kakariko Warp
- allAreaNodesPtr->Hyrule_Field.unk_0[0x17] = 0x8; //give Bridge of Eldin Warp
- allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x8;//give castle town warp
- allAreaNodesPtr->Hyrule_Field.unk_0[0x9] |= 0x20; //give Gorge Warp
- allAreaNodesPtr->Lanayru.unk_0[0xB] |= 0x4; // give Zora's Domain Warp
- allAreaNodesPtr->Lanayru.unk_0[0xA] |= 0x4;//give lake hylia warp
-
- //Faron Escape
- if (Singleton::getInstance()->isForestEscapeEnabled == 1)
- {
- eventBitsPtr[0x6] |= 0x26; //warp the kak bridge, give map warp, set Forest Temple Story Flag
- }
- else
- {
- eventBitsPtr[0x6] |= 0x24; //warp the kak bridge, give map warp
- }
-
- //Skip MDH?
- if (Singleton::getInstance()->isMDHSkipEnabled == 1)
- {
- //set MDH flags
- gameInfo.scratchPad.eventBits[0xC] |= 0x1; //MDH Started
- gameInfo.scratchPad.eventBits[0x1E] |= 0x8; //MDH Completed
- }
-
- gameInfo.nextStageVars.triggerLoad |= 1;
- return item;
- }
- else
- {
- //Faron Escape
- if (Singleton::getInstance()->isForestEscapeEnabled == 1)
- {
- eventBitsPtr[0x6] |= 0x26; //warp the kak bridge, give map warp, set Forest Temple Story Flag
- }
- else
- {
- eventBitsPtr[0x6] |= 0x24; //warp the kak bridge, give map warp
- }
- gameInfo.localAreaNodes.unk_0[0x9] = 0x10;//unlock N Faron gate
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Faron);
- return item;
- }
- return item;
- }
- else if (item == items::Item::Vessel_Of_Light_Eldin)
- {
- tp::d_com_inf_game::ScratchPad* scratchPadPtr = &gameInfo.scratchPad;
- u8* eventBitsPtr = &scratchPadPtr->eventBits[0];
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Eldin);
- eventBitsPtr[0x6] |= 0x1; //tame Epona
- eventBitsPtr[0xA] |= 0x8; //Beat KB1
- eventBitsPtr[0x14] |= 0x10; //Put Bo Outside
- eventBitsPtr[0x7] |= 0xD6; //skip Gor Coron Sumo and Enter Mines also Trigger KB1 and mark Post-KB1 CS as watched
- return item;
- }
- else if (item == items::Item::Vessel_Of_Light_Lanayru)
- {
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Lanayru);
- return item;
- }
- else if (item == items::Item::Hylian_Shield && tp::d_a_alink::checkStageName("R_SP109"))
- {//set flag for Malo's Hylian Shield check
- tools::setItemFlag(ItemFlags::Null_D9);
- }
- else if (item == items::Item::Hawkeye)
- {//set flag for Hawkeye check
- tools::setItemFlag(ItemFlags::Null_D8);
- }
- else if (item == items::Item::Dungeon_Map && tp::d_a_alink::checkStageName("D_MN11"))
- {//set flag to be able to enter kitchen
- gameInfo.localAreaNodes.unk_0[0x10] |= 0x20;
- }
-
- for (u16 i = 0; i < totalChecks; i++)
- {
- sourceCheck = &item::checks[i];
-
- if (tp::d_a_alink::checkStageName(sourceCheck->stage) || (tp::d_a_alink::checkStageName("F_SP128") && 0 == strcmp(sourceCheck->stage, "R_SP128")))
- {
-
- if (isGrottoCheckOk(i))
- {
-
- if (isProgressiveEnabled == 1 && item == items::Item::Ancient_Sky_Book_completed)
- {
- item = items::Item::Ancient_Sky_Book_partly_filled;
- }
- // Correct stage
- if (sourceCheck->itemID == item || (isItemBombs(item) && isItemBombs(sourceCheck->itemID)) ||
- (item == items::Item::Red_Rupee && sourceCheck->itemID == items::Item::Giant_Bomb_Bag) ||
- (item == items::Item::Ooccoo_FT && sourceCheck->itemID == items::Item::Ooccoo_Dungeon) ||
- (item == items::Item::Lantern_Refill_Shop && sourceCheck->itemID == items::Item::Lantern_Oil_Shop) ||
- (item == items::Item::Lantern_Refill_Scooped && sourceCheck->itemID == items::Item::Lantern_Oil_Scooped) ||
- (sourceCheck->itemID == items::Item::Superb_Soup && (item == items::Item::Simple_Soup || item == items::Item::Good_Soup)))
- {
- bool isOk = false;
-
- if (sourceCheck->type == item::ItemType::Bug || sourceCheck->type == item::ItemType::Dungeon || sourceCheck->itemID == items::Item::Heart_Container ||
- sourceCheck->itemID == items::Item::Ball_and_Chain || sourceCheck->itemID == items::Item::Ancient_Sky_Book_empty)
- {//bugs have unique itemids so position doesn't matter
- //dungeon items are unique in their dungeon
- //there can only be one heart container per stage in vanilla, so position doesn't matter (also each one can be at 2 locations: if gotten after boss or if coming back)
- //BaC can be anywhere in the room so don't check the position
- //empty sky book can be outside the house or inside the house so don't check coords
- isOk = true;
- }
- else if (sourceCheck->itemID == items::Item::Piece_of_Heart && (0 == strcmp("F_SP127", sourceCheck->stage)))
- {//fishing hole freestanding PoH
- //it's alone in the fishing hole so it can only be that one
- isOk = true;
- }
- else
- {
- if (sourceCheck->type == item::ItemType::PoeSoul)
- {//poes can move a lot so give them more range
- //poe range= ~1400
- rangeX = 2800.0f;
- rangeY = 1400.0f;
- rangeZ = 2800.0f;
- }
- else if (sourceCheck->itemID == items::Item::Piece_of_Heart && ((0 == strcmp("F_SP121", sourceCheck->stage) && sourceCheck->room == 6) ||
- (0 == strcmp("F_SP109", sourceCheck->stage) && sourceCheck->room == 0) || (0 == strcmp("F_SP121", sourceCheck->stage) && sourceCheck->room == 3) ||
- (0 == strcmp("F_SP121", sourceCheck->stage) && sourceCheck->room == 0) || (0 == strcmp("F_SP128", sourceCheck->stage) && sourceCheck->room == 0)))
- {//freestanding PoH
- // they can be moved by boomerang and clawshot, so give them more range
- // clawshot and boomrang targetting range ~2000
- rangeX = 3000.0f;
- rangeY = 3000.0f;
- rangeZ = 3000.0f;
- }
- else if (sourceCheck->itemID == items::Item::Small_Key && 0 == strcmp("D_MN05", sourceCheck->stage) && sourceCheck->room == 5)
- {//totem chest in FT (it can be knocked down both ways so more range is required)
- rangeX = 500.0f;
- rangeY = 500.0f;
- rangeZ = 800.0f;
- }
- if (tools::fCompare(sourceCheck->position[0], pos[0]) < rangeX)
- {
- if (tools::fCompare(sourceCheck->position[1], pos[1]) < rangeY)
- {
- if (tools::fCompare(sourceCheck->position[2], pos[2]) < rangeZ)
- {
- isOk = true;
- }
- }
- }
- }
- if (isOk)
- {
- snprintf(lastSourceInfo, 50, "%s->%d->%x", sourceCheck->stage, sourceCheck->room, sourceCheck->itemID);
- if (sourceCheck->destination)
- {
- snprintf(lastDestInfo, 50, "%s->%d->%x", sourceCheck->destination->stage, sourceCheck->destination->room, sourceCheck->destination->itemID);
- item = sourceCheck->destination->itemID;
- if (sourceCheck->type == item::ItemType::Bug || sourceCheck->itemID == items::Item::Heart_Container)
- {
- sourceCheck->destination = &item::checks[263];//green rupee
- }
- else if (sourceCheck->type == item::ItemType::Shop)
- {
- sourceCheck->destination = &item::checks[i];
- }
- else if (sourceCheck->itemID != items::Item::Big_Quiver && sourceCheck->itemID != items::Item::Giant_Quiver && // quiver checks called twice somehow
- sourceCheck->type != item::ItemType::Dungeon && sourceCheck->type != item::ItemType::Gear && sourceCheck->type != item::ItemType::Equip) // some checks are called twice i don't wanna list them all, but dungeon items, gear, and equipable items only have one check each intheir stage
- {
- // Unset this check
- sourceCheck->destination = nullptr;
- }
- //progressive checks (doesn't work if you already have items when generating seed)
- if (isProgressiveEnabled == 1)
- {
- if (item == items::Item::Wooden_Sword && tools::checkItemFlag(ItemFlags::Wooden_Sword))
- {
- item = items::Item::Ordon_Sword;
- gameInfo.scratchPad.equipedItems.sword = 0x28;
- }
- else if (item == items::Item::Ordon_Sword && !tools::checkItemFlag(ItemFlags::Wooden_Sword))
- {
- item = items::Item::Wooden_Sword;
- gameInfo.scratchPad.equipedItems.sword = 0x3F;
- }
- else if (item == items::Item::Master_Sword && tools::checkItemFlag(ItemFlags::Master_Sword))
- {//for when MS and light Ms are implemented
- item = items::Item::Master_Sword_Light;
- gameInfo.scratchPad.equipedItems.sword = 0x49;
- }
- else if (item == items::Item::Master_Sword_Light && !tools::checkItemFlag(ItemFlags::Master_Sword))
- {//for when MS and light Ms are implemented
- item = items::Item::Master_Sword;
- gameInfo.scratchPad.equipedItems.sword = 0x29;
- }
- else if (item == items::Item::Clawshot && tools::checkItemFlag(ItemFlags::Clawshot))
- {
- item = items::Item::Clawshots;
- }
- else if (item == items::Item::Clawshots && !tools::checkItemFlag(ItemFlags::Clawshot))
- {
- item = items::Item::Clawshot;
- }
- else if (item == items::Item::Heros_Bow)
- {
- if (tools::checkItemFlag(ItemFlags::Heros_Bow) &&
- !tools::checkItemFlag(ItemFlags::Big_Quiver))
- {
- item = items::Item::Big_Quiver;
- }
- else if (tools::checkItemFlag(ItemFlags::Heros_Bow) &&
- tools::checkItemFlag(ItemFlags::Big_Quiver))
- {
- item = items::Item::Giant_Quiver;
- }
- }
- else if (item == items::Item::Big_Quiver)
- {
- if (!tools::checkItemFlag(ItemFlags::Heros_Bow))
- {
- item = items::Item::Heros_Bow;
- }
- else if (tools::checkItemFlag(ItemFlags::Big_Quiver))
- {
- item = items::Item::Giant_Quiver;
- }
- }
- else if (item == items::Item::Giant_Quiver)
- {
- if (!tools::checkItemFlag(ItemFlags::Heros_Bow))
- {
- item = items::Item::Heros_Bow;
- }
- else if (!tools::checkItemFlag(ItemFlags::Big_Quiver))
- {
- item = items::Item::Big_Quiver;
- }
- }
- else if (item == items::Item::Big_Wallet &&
- tools::checkItemFlag(ItemFlags::Big_Wallet))
- {
- item = items::Item::Giant_Wallet;
- }
- else if (item == items::Item::Giant_Wallet &&
- !tools::checkItemFlag(ItemFlags::Big_Wallet))
- {
- item = items::Item::Big_Wallet;
- }
- else if (item == items::Item::Ancient_Sky_Book_empty)
- {
- if (!tools::checkItemFlag(ItemFlags::Ancient_Sky_Book_empty))
- {
- item = items::Item::Ancient_Sky_Book_empty;
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DF))
- {//letter 1
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DF);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DE))
- {//letter 2
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DE);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DD))
- {//letter 3
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DD);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DC))
- {//letter 4
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DC);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DB))
- {//letter 5
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DB);
- }
- else if (tools::checkItemFlag(ItemFlags::Null_DB))
- {
- gameInfo.scratchPad.eventBits[0x60] |= 0x4; //set shad to be back in the basement
- gameInfo.scratchPad.eventBits[0x25] |= 0x40; //Set the Owl Statue in Kak to be able to be moved
- gameInfo.scratchPad.eventBits[0x5F] |= 0x20; //Shad leaves so you can warp
- gameInfo.scratchPad.eventBits[0x3B] |= 0x8; //repairs Cannon at lake
- item = items::Item::Ancient_Sky_Book_completed;
- }
- }
- else if (item == items::Item::Ancient_Sky_Book_partly_filled)
- {
- if (!tools::checkItemFlag(ItemFlags::Ancient_Sky_Book_empty))
- {
- item = items::Item::Ancient_Sky_Book_empty;
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DF))
- {//letter 1
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DF);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DE))
- {//letter 2
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DE);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DD))
- {//letter 3
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DD);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DC))
- {//letter 4
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DC);
- }
- else if (!tools::checkItemFlag(ItemFlags::Null_DB))
- {//letter 5
- item = items::Item::Ancient_Sky_Book_partly_filled;
- tools::setItemFlag(ItemFlags::Null_DB);
- }
- else if (tools::checkItemFlag(ItemFlags::Null_DB))
- {
- gameInfo.scratchPad.eventBits[0x60] |= 0x4; //set shad to be back in the basement
- gameInfo.scratchPad.eventBits[0x25] |= 0x40; //Set the Owl Statue in Kak to be able to be moved
- gameInfo.scratchPad.eventBits[0x5F] |= 0x20; //Shad leaves so you can warp
- gameInfo.scratchPad.eventBits[0x3B] |= 0x8; //repairs Cannon at lake
- item = items::Item::Ancient_Sky_Book_completed;
- }
- }
- else if (item == items::Item::Empty_Bomb_Bag)
- {
- if (itemWheel->Bomb_Bag_1 == 0xFF)
- {
- item = items::Item::Bomb_Bag_Regular_Bombs;
- }
- else if (itemWheel->Bomb_Bag_2 == 0xFF)
- {
- item = items::Item::Goron_Bomb_Bag;
- }
- else if (itemWheel->Bomb_Bag_3 == 0xFF)
- {
- item = items::Item::Goron_Bomb_Bag;
- }
- else if (!tools::checkItemFlag(ItemFlags::Giant_Bomb_Bag))
- {
- item = items::Item::Giant_Bomb_Bag;
- }
- else
- {
- item = items::Item::Bombs_30;
- }
- }
- else if (item == items::Item::Goron_Bomb_Bag)
- {
- if (itemWheel->Bomb_Bag_1 == 0xFF)
- {
- item = items::Item::Bomb_Bag_Regular_Bombs;
- }
- else if (itemWheel->Bomb_Bag_2 == 0xFF)
- {
- item = items::Item::Goron_Bomb_Bag;
- }
- else if (itemWheel->Bomb_Bag_3 == 0xFF)
- {
- item = items::Item::Goron_Bomb_Bag;
- }
- else if (!tools::checkItemFlag(ItemFlags::Giant_Bomb_Bag))
- {
- item = items::Item::Giant_Bomb_Bag;
- }
- else
- {
- item = items::Item::Bombs_30;
- }
- }
- else if (item == items::Item::Giant_Bomb_Bag)
- {
- if (itemWheel->Bomb_Bag_1 == 0xFF)
- {
- item = items::Item::Bomb_Bag_Regular_Bombs;
- }
- else if (itemWheel->Bomb_Bag_2 == 0xFF)
- {
- item = items::Item::Goron_Bomb_Bag;
- }
- else if (itemWheel->Bomb_Bag_3 == 0xFF)
- {
- item = items::Item::Goron_Bomb_Bag;
- }
- else if (!tools::checkItemFlag(ItemFlags::Giant_Bomb_Bag))
- {
- item = items::Item::Giant_Bomb_Bag;
- }
- else
- {
- item = items::Item::Bombs_30;
- }
- }
- else if (item == items::Item::Key_Shard_1)
- {
- if (tools::checkItemFlag(ItemFlags::Key_Shard_1) &&
- !tools::checkItemFlag(ItemFlags::Key_Shard_2))
- {
- item = items::Item::Key_Shard_2;
- }
- else if (tools::checkItemFlag(ItemFlags::Key_Shard_1) &&
- tools::checkItemFlag(ItemFlags::Key_Shard_2))
- {
- item = items::Item::Big_Key_Goron_Mines;
- tools::setItemFlag(ItemFlags::Key_Shard_3);//set this flag to show full key on the map
- }
- }
- else if (item == items::Item::Key_Shard_2)
- {
- if (!tools::checkItemFlag(ItemFlags::Key_Shard_1))
- {
- item = items::Item::Key_Shard_1;
- }
- else if (tools::checkItemFlag(ItemFlags::Key_Shard_1) &&
- tools::checkItemFlag(ItemFlags::Key_Shard_2))
- {
- item = items::Item::Big_Key_Goron_Mines;
- tools::setItemFlag(ItemFlags::Key_Shard_3);//set this flag to show full key on the map
- }
- }
- else if (item == items::Item::Big_Key_Goron_Mines)
- {
- if (!tools::checkItemFlag(ItemFlags::Key_Shard_1))
- {
- item = items::Item::Key_Shard_1;
- }
- else if (tools::checkItemFlag(ItemFlags::Key_Shard_1) &&
- !tools::checkItemFlag(ItemFlags::Key_Shard_2))
- {
- item = items::Item::Key_Shard_2;
- }
- else
- {
- tools::setItemFlag(ItemFlags::Key_Shard_3);//set this flag to show full key on the map
- }
- }
- else if (item == items::Item::Dominion_Rod && tools::checkItemFlag(ItemFlags::Dominion_Rod))
- {//for when powered dominion rod is implemented
- item = items::Item::Dominion_Rod_Uncharged;
- }
- else if (item == items::Item::Dominion_Rod_Uncharged && !tools::checkItemFlag(ItemFlags::Dominion_Rod))
- {//for when MS and light Ms are implemented
- item = items::Item::Dominion_Rod;
- }
- }
-
- if (item == items::Item::Poe_Soul && gameInfo.scratchPad.poeCount < 60)
- {//increase poe counter
- gameInfo.scratchPad.poeCount++;
- }
- else if (item == items::Item::Shadow_Crystal)
- {//shadow crystal doesn't actually do anything so we have to do its functionnality ourselves
- if (Singleton::getInstance()->startWithCrystal == 1)
- {
- item = items::Item::Silver_Rupee;
- }
- else
- {
- game_patch::giveMidnaTransform();
- if (Singleton::getInstance()->isMDHSkipEnabled == 1)
- {
- gameInfo.scratchPad.unk_1F[0x11] |= 0x8; //Midna on Back
- }
- }
- }
- else if (item == items::Item::Dominion_Rod_Uncharged)
- {
- gameInfo.scratchPad.eventBits[0x25] |= 0x80;//set flag to charge dominion rod
- }
- else if (item == items::Item::Ordon_Pumpkin)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.unk_0[0x9] |= 0x4; //Unlock Lobby Courtyard Door
- gameInfo.scratchPad.eventBits[0x4] |= 0x80; //Told Yeta About Pumpkin
- gameInfo.scratchPad.eventBits[0x0] |= 0x22; //Yeto took pumpkin and put it in soup
- gameInfo.scratchPad.eventBits[0x14] |= 0x40; //Unlock Lobby Door
- gameInfo.localAreaNodes.unk_0[0x9] |= 0x4;//unlock courtyard door
- }
- else if (item == items::Item::Ordon_Goat_Cheese)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.unk_0[0x9] |= 0x8; //Unlock West Wing Door
- gameInfo.scratchPad.eventBits[0x1] |= 0x20; //Told Yeta About Cheese
- gameInfo.scratchPad.eventBits[0x0] |= 0x11; //Yeto took Cheese and put it in soup
- gameInfo.scratchPad.eventBits[0x14] |= 0x20; //Unlock West Door
- gameInfo.localAreaNodes.unk_0[0x9] |= 0x8;//unlock west wing door
- }
- else if (item == 0xE1)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == 0xE2)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == 0xE3)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == 0xE4)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == 0xE5)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == 0xE6)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == 0xE7)
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x4) != 0)/*have ending blow*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x8) != 0)/*have shield attack*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x2) != 0)/*have back slice*/
- {
- if ((gameInfo.scratchPad.eventBits[0x29] & 0x1) != 0)/*have helm splitter*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x80) != 0)/*have mortal draw*/
- {
- if ((gameInfo.scratchPad.eventBits[0x2A] & 0x40) != 0)/*have jump strike*/
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x20;//give great spin
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x40;//give jumpstrike
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x2A] |= 0x80;//give mortal draw
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x1;//give helm splitter
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x2;//give back slice
- }
-
- }
- else
- {
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x8;//give shield attack
- }
- }
-
- }
- else
- {
- gameInfo.scratchPad.eventBits[0x29] |= 0x4;//give ending blow
- }
- }
- else if (item == items::Item::Reekfish_Scent)
- {
- gameInfo.scratchPad.eventBits[0x61] |= 0x20;//allow you to go to snowpeak
- }
- else if (item == items::Item::Medicine_Scent)
- {
- gameInfo.scratchPad.eventBits[0x2F] |= 0x4;//smelled Medicine Scent
- }
- else if (item == items::Item::Bed_Key)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bigKeyGotten = 0b1; //unlock Blizzetta Door
- if (Singleton::getInstance()->isBossKeyseyEnabled == 1)
- {
- item = items::Item::Red_Rupee;
- }
- }
- else if (item == items::Item::Big_Key && Singleton::getInstance()->isBossKeyseyEnabled == 1)
- {
- item = items::Item::Red_Rupee;
- }
- else if (!tools::checkItemFlag(ItemFlags::Slingshot) &&
- (item == items::Item::Seeds_50))
- {
- item = items::Item::Blue_Rupee;
- }
- else if (!tools::checkItemFlag(ItemFlags::Heros_Bow) &&
- (item == items::Item::Arrows_10 ||
- item == items::Item::Arrows_20 ||
- item == items::Item::Arrows_30 ||
- item == items::Item::Arrows_1))
- {
- item = items::Item::Blue_Rupee;
- }
- else if (gameInfo.scratchPad.itemWheel.Bomb_Bag_1 == 0xFF && isItemBombs(item))
- {
- item = items::Item::Blue_Rupee;
- }
- else if (gameInfo.scratchPad.itemWheel.Bottle_1 == 0xFF && isItemBottleFill(item))
- {
- if (tools::checkItemFlag(ItemFlags::Lantern))
- {
- if (item == items::Item::Lantern_Oil_Shop)
- {
- item = items::Item::Lantern_Refill_Shop;
- gameInfo.scratchPad.counters.lantern_oil = gameInfo.scratchPad.counters.max_lantern_oil;
- }
- else if (item == items::Item::Lantern_Oil_Scooped)
- {
- item = items::Item::Lantern_Refill_Scooped;
- gameInfo.scratchPad.counters.lantern_oil = gameInfo.scratchPad.counters.max_lantern_oil;
- }
- else if (item == items::Item::Yellow_Chu_Jelly)
- {
- item = items::Item::Lantern_Yellow_Chu_Chu;
- gameInfo.scratchPad.counters.lantern_oil = gameInfo.scratchPad.counters.max_lantern_oil;
- }
- else
- {
- item = items::Item::Blue_Rupee;
- }
- }
- else
- {
- item = items::Item::Blue_Rupee;
- }
- }
- /*if (item == items::Item::Blue_Rupee)
- {//somehow the blue rupee item get don't work normally
- tp::d_item::execItemGet(items::Item::Blue_Rupee);
- }*/
- return item;
- }
- else
- {
- snprintf(lastDestInfo, 50, "No replacement here.");
- //no return in the case where 2 items are close enough to be considered the same (bug rewards for example)
- }
- }
- }
- }
- }
- }
- return item;
- }
-
-
- bool ChestRandomizer::isStageADungeon(char* stage)
- {
- u32 totalDungeonStages = sizeof(stage::dungeonStages) / sizeof(stage::dungeonStages[0]);
- for (u32 i = 0; i < totalDungeonStages; i++)
- {
- if (0 == strcmp(stage, stage::dungeonStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isItemBombs(u8 itemID)
- {
- if (itemID == items::Item::Bombs_5 || itemID == items::Item::Bombs_10 || itemID == items::Item::Bombs_20 || itemID == items::Item::Bombs_30 ||
- itemID == items::Item::Water_Bombs_5 || itemID == items::Item::Water_Bombs_10 || itemID == items::Item::Water_Bombs_15 ||
- itemID == items::Item::Bomblings_5 || itemID == items::Item::Bomblings_10)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- bool ChestRandomizer::isItemBottleFill(u8 itemID)
- {
- if (itemID == items::Item::Red_Potion_Shop || itemID == items::Item::Green_Potion || itemID == items::Item::Blue_Potion || itemID == items::Item::Milk ||
- itemID == items::Item::Lantern_Oil_Shop || itemID == items::Item::Water || itemID == items::Item::Lantern_Oil_Scooped || itemID == items::Item::Red_Potion_Scooped ||
- itemID == items::Item::Nasty_soup || itemID == items::Item::Hot_spring_water_Scooped || itemID == items::Item::Fairy_Bottle || itemID == items::Item::Hot_Spring_Water_Shop ||
- itemID == items::Item::Fairy_Tears || itemID == items::Item::Worm || itemID == items::Item::Bee_Larva_Scooped || itemID == items::Item::Rare_Chu_Jelly ||
- itemID == items::Item::Red_Chu_Jelly || itemID == items::Item::Blue_Chu_Jelly || itemID == items::Item::Green_Chu_Jelly || itemID == items::Item::Yellow_Chu_Jelly ||
- itemID == items::Item::Purple_Chu_Jelly || itemID == items::Item::Simple_Soup || itemID == items::Item::Good_Soup || itemID == items::Item::Superb_Soup ||
- itemID == items::Item::Bee_Larva_Shop || itemID == items::Item::Black_Chu_Jelly)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- bool ChestRandomizer::isStageBoss()
- {
- u32 totalBossStages = sizeof(stage::bossStages) / sizeof(stage::bossStages[0]);
- for (u32 i = 0; i < totalBossStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::bossStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isStageGrotto()
- {
- u32 totalGrottoStages = sizeof(stage::grottoStages) / sizeof(stage::grottoStages[0]);
- for (u32 i = 0; i < totalGrottoStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::grottoStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isStageDungeon()
- {
- u32 totalDungeonStages = sizeof(stage::dungeonStages) / sizeof(stage::dungeonStages[0]);
- for (u32 i = 0; i < totalDungeonStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::dungeonStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isStageInterior()
- {
- u32 totalInteriorStages = sizeof(stage::interiorStages) / sizeof(stage::interiorStages[0]);
- for (u32 i = 0; i < totalInteriorStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::interiorStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isStageCave()
- {
- u32 totalCaveStages = sizeof(stage::caveStages) / sizeof(stage::caveStages[0]);
- for (u32 i = 0; i < totalCaveStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::caveStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isStageSpecial()
- {
- u32 totalSpecialStages = sizeof(stage::specialStages) / sizeof(stage::specialStages[0]);
- for (u32 i = 0; i < totalSpecialStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::specialStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- bool ChestRandomizer::isStageTOD()
- {
- u32 totalTODStages = sizeof(stage::timeOfDayStages) / sizeof(stage::timeOfDayStages[0]);
- for (u32 i = 0; i < totalTODStages; i++)
- {
- if (tp::d_a_alink::checkStageName(stage::timeOfDayStages[i]))
- {
- return true;
- }
- }
- return false;
- }
-
- void ChestRandomizer::handleKeysanity()
- {
- if (isKeysanityEnabled == 1)
- {
- item::ItemCheck* sourceCheck;
- item::ItemCheck* destCheck;
- u32 length;
- u16 index;
- //do FT_1
- length = sizeof(keyPlacement::FT_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::FT_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::FT_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do FT_2
- length = sizeof(keyPlacement::FT_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::FT_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::FT_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do FT_3
- length = sizeof(keyPlacement::FT_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::FT_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::FT_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do FT_4
- length = sizeof(keyPlacement::FT_4) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::FT_keys[3]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::FT_4[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do GM_1
- length = sizeof(keyPlacement::GM_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::GM_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::GM_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do GM_2
- length = sizeof(keyPlacement::GM_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::GM_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::GM_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do GM_3
- length = sizeof(keyPlacement::GM_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::GM_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::GM_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do LBT_1
- length = sizeof(keyPlacement::LBT_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::LBT_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::LBT_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do LBT_2
- length = sizeof(keyPlacement::LBT_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::LBT_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::LBT_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do LBT_3
- length = sizeof(keyPlacement::LBT_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::LBT_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::LBT_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do AG_1
- length = sizeof(keyPlacement::AG_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::AG_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::AG_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do AG_2
- length = sizeof(keyPlacement::AG_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::AG_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::AG_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do AG_3
- length = sizeof(keyPlacement::AG_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::AG_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::AG_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do AG_4
- length = sizeof(keyPlacement::AG_4) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::AG_keys[3]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::AG_4[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do AG_5
- length = sizeof(keyPlacement::AG_5) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::AG_keys[4]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::AG_5[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do SPR_1
- length = sizeof(keyPlacement::SPR_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::SPR_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::SPR_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do SPR_2
- length = sizeof(keyPlacement::SPR_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::SPR_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::SPR_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do SPR_3
- length = sizeof(keyPlacement::SPR_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::SPR_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::SPR_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do SPR_4
- length = sizeof(keyPlacement::SPR_4) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::SPR_keys[3]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::SPR_4[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do SPR_5
- length = sizeof(keyPlacement::SPR_5) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::SPR_keys[4]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::SPR_5[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do SPR_6
- length = sizeof(keyPlacement::SPR_6) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::SPR_keys[5]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::SPR_6[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do ToT_1
- length = sizeof(keyPlacement::ToT_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::ToT_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::ToT_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do ToT_2
- length = sizeof(keyPlacement::ToT_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::ToT_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::ToT_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do ToT_3
- length = sizeof(keyPlacement::ToT_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::ToT_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::ToT_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do CitS_1
- length = sizeof(keyPlacement::CitS_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::CitS_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::CitS_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do PoT_1
- length = sizeof(keyPlacement::PoT_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do PoT_2
- length = sizeof(keyPlacement::PoT_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do PoT_3
- length = sizeof(keyPlacement::PoT_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do PoT_4
- length = sizeof(keyPlacement::PoT_4) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[3]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_4[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do PoT_5
- length = sizeof(keyPlacement::PoT_5) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[4]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_5[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do PoT_6
- length = sizeof(keyPlacement::PoT_6) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[5]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_6[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do PoT_7
- length = sizeof(keyPlacement::PoT_7) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::PoT_keys[6]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::PoT_7[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do HC_1
- length = sizeof(keyPlacement::HC_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::HC_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::HC_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do HC_2
- length = sizeof(keyPlacement::HC_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::HC_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::HC_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- //do HC_3
- length = sizeof(keyPlacement::HC_3) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::HC_keys[2]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::HC_3[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
-
- //do F_1
- length = sizeof(keyPlacement::F_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::F_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::F_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- if (Singleton::getInstance()->isForestEscapeEnabled == 0)
- {
- //do F_2
- length = sizeof(keyPlacement::F_2) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::F_keys[1]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::F_2[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- }
-
- //do GD_1
- length = sizeof(keyPlacement::GD_1) / sizeof(u16);
- destCheck = &item::checks[keyPlacement::GD_keys[0]];
- do
- {
- index = tools::getRandom(length);
- sourceCheck = &item::checks[keyPlacement::GD_1[index]];
- } while (sourceCheck->destination || (sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0) ||
- (sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0) || (sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0));
- placeCheck(sourceCheck, destCheck);
- }
- }
-
- bool ChestRandomizer::isGrottoCheckOk(u16 checkID)
- {
- if (isStageGrotto())
- {
- u8 state = tp::d_com_inf_game::current_state;
- if (tp::d_a_alink::checkStageName(stage::grottoStages[0]))
- {
- if (state == '0')
- {
- u32 length = sizeof(grottoChecks::g1_0) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g1_0[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '1')
- {
- u32 length = sizeof(grottoChecks::g1_1) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g1_1[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '2')
- {
- u32 length = sizeof(grottoChecks::g1_2) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g1_2[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '3')
- {
- u32 length = sizeof(grottoChecks::g1_3) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g1_3[i])
- {
- return true;
- }
- }
- return false;
- }
- else
- {
- return true;
- }
- }
- else if (tp::d_a_alink::checkStageName(stage::grottoStages[1]))
- {
- if (state == '0')
- {
- u32 length = sizeof(grottoChecks::g2_0) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g2_0[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '1')
- {
- u32 length = sizeof(grottoChecks::g2_1) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g2_1[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '2')
- {
- u32 length = sizeof(grottoChecks::g2_2) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g2_2[i])
- {
- return true;
- }
- }
- return false;
- }
- /*else if (state == '3')
- {
- u32 length = sizeof(grottoChecks::g2_3) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g2_3[i])
- {
- return true;
- }
- }
- return false;
- }*/
- else
- {
- return true;
- }
- }
- else if (tp::d_a_alink::checkStageName(stage::grottoStages[2]))
- {
- if (state == '0')
- {
- u32 length = sizeof(grottoChecks::g3_0) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g3_0[i])
- {
- return true;
- }
- }
- return false;
- }
- /*else if (state == '1')
- {
- u32 length = sizeof(grottoChecks::g3_1) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g3_1[i])
- {
- return true;
- }
- }
- return false;
-
- }*/
- /*else if (state == '2')
- {
- u32 length = sizeof(grottoChecks::g3_2) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g3_2[i])
- {
- return true;
- }
- }
- return false;
- }*/
- /*else if (state == '3')
- {
- u32 length = sizeof(grottoChecks::g3_3) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g3_3[i])
- {
- return true;
- }
- }
- return false;
- }*/
- else
- {
- return true;
- }
- }
- else if (tp::d_a_alink::checkStageName(stage::grottoStages[3]))
- {
- if (state == '0')
- {
- u32 length = sizeof(grottoChecks::g4_0) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g4_0[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '1')
- {
- u32 length = sizeof(grottoChecks::g4_1) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g4_1[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '2')
- {
- u32 length = sizeof(grottoChecks::g4_2) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g4_2[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '3')
- {
- u32 length = sizeof(grottoChecks::g4_3) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g4_3[i])
- {
- return true;
- }
- }
- return false;
- }
- else
- {
- return true;
- }
- }
- else if (tp::d_a_alink::checkStageName(stage::grottoStages[4]))
- {
- if (state == '0')
- {
- u32 length = sizeof(grottoChecks::g5_0) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g5_0[i])
- {
- return true;
- }
- }
- return false;
- }
- /*else if (state == '1')
- {
- u32 length = sizeof(grottoChecks::g5_1) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g5_1[i])
- {
- return true;
- }
- }
- return false;
- }*/
- else if (state == '2')
- {
- u32 length = sizeof(grottoChecks::g5_2) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g5_2[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '3')
- {
- u32 length = sizeof(grottoChecks::g5_3) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g5_3[i])
- {
- return true;
- }
- }
- return false;
- }
- else if (state == '4')
- {
- u32 length = sizeof(grottoChecks::g5_4) / sizeof(u16);
- for (u16 i = 0; i < length; i++)
- {
- if (checkID == grottoChecks::g5_4[i])
- {
- return true;
- }
- }
- return false;
- }
- else
- {
- return true;
- }
- }
- else
- {
- return true;
- }
- }
- else
- {
- return true;
- }
- }
-} \ No newline at end of file
+ void ChestRandomizer::generate()
+ {
+ // Reset
+
+ itemWheel = &gameInfo.scratchPad.itemWheel;
+
+ currentPlayerConditions = startConditions;
+ currentSeed = tools::randomSeed;
+
+ totalChecks = sizeof( item::checks ) / sizeof( item::ItemCheck );
+ empty = 0;
+ layerCheckCount = 0;
+
+ itemOrderIndex = 0;
+
+ // Set up arrays
+ itemOrder = new u8[totalChecks];
+
+ item::ItemCheck* sourceCheck;
+ item::ItemCheck* destCheck;
+
+ // Reset randomization
+ for ( u16 i = 0; i < totalChecks; i++ )
+ {
+ item::checks[i].destination = nullptr;
+ item::checks[i].source = nullptr;
+ }
+
+ // Lock some checks
+ for ( u16 i = 0; i < totalChecks; i++ )
+ {
+ if ( isLocked( &item::checks[i] ) )
+ {
+ placeCheck( &item::checks[i], &item::checks[i] );
+ }
+ }
+
+ handleKeysanity();
+
+ // do needed items in order
+ for ( u16 i = 0; i < sizeof( item::checkPriorityOrder ) / sizeof( u16 ); i++ )
+ {
+ destCheck = &item::checks[item::checkPriorityOrder[i]];
+ if ( !destCheck->source )
+ {
+ if ( destCheck->itemID == items::Item::Ordon_Sword )
+ {
+ sourceCheck = findSource( destCheck->destLayer,
+ 0x1,
+ destCheck ); // to prevent woodensword from being overwritten before losing it
+ }
+ else
+ {
+ sourceCheck = findSource( destCheck->destLayer, 0x0, destCheck );
+ }
+ placeCheck( sourceCheck, destCheck );
+ // layerCheckCount++;
+ }
+ }
+
+ // Place items that unlock other locations before caring about remaining items
+ // useless
+ /*for(u16 i = 0; i < totalChecks; i++)
+ {
+ destCheck = &item::checks[i];
+ if(!destCheck->source)
+ {
+ // Free slot
+ if(item::getFlags(destCheck->itemID, 0) != 0)
+ {
+ // This would unlock new checks, so place it
+ if (destCheck->itemID == items::Item::Ordon_Shield || destCheck->itemID == items::Item::Wooden_Shield ||
+ destCheck->itemID == items::Item::Hylian_Shield)
+ {
+ sourceCheck = findSource(0xFF, 0x2, destCheck);//to prevent softlocking the game when you try to get
+ ordon shield check
+ }
+ else
+ {
+ sourceCheck = findSource(0xFF, 0, destCheck);
+ }
+ placeCheck(sourceCheck, destCheck);
+ }
+ }
+ }*/
+
+ // do dungeon items
+ for ( u16 i = 0; i <= totalChecks; i++ )
+ {
+ destCheck = &item::checks[i];
+ if ( !destCheck->source && destCheck->type == item::ItemType::Dungeon )
+ {
+ sourceCheck = findSource( destCheck->destLayer, 0x0, destCheck );
+ placeCheck( sourceCheck, destCheck );
+ // layerCheckCount++;
+ }
+ }
+
+ // Place layer checks
+ for ( u16 i = 0; i < totalChecks; i++ )
+ {
+ destCheck = &item::checks[i];
+
+ if ( !destCheck->source )
+ {
+ // Free slot
+ if ( destCheck->destLayer != 0xFF )
+ {
+ // Layer check
+ if ( destCheck->itemID == items::Item::Ordon_Sword )
+ {
+ sourceCheck =
+ findSource( destCheck->destLayer,
+ 0x1,
+ destCheck ); // to prevent woodensword from being overwritten before losing it
+ }
+ else if ( destCheck->itemID == items::Item::Ordon_Shield ||
+ destCheck->itemID == items::Item::Wooden_Shield ||
+ destCheck->itemID == items::Item::Hylian_Shield )
+ {
+ sourceCheck = findSource(
+ destCheck->destLayer,
+ 0x2,
+ destCheck ); // to prevent softlocking the game when you try to get ordon shield check
+ }
+ else if ( destCheck->itemID == items::Item::Zora_Armor || destCheck->itemID == items::Item::Magic_Armor )
+ {
+ sourceCheck = findSource(
+ destCheck->destLayer,
+ 0x2,
+ destCheck ); // to prevent softlocking the game when you try to get ordon shield check
+ }
+ else if ( isProgressiveEnabled == 0 )
+ {
+ if ( destCheck->itemID == items::Item::Clawshots )
+ {
+ sourceCheck =
+ findSource( destCheck->destLayer,
+ 0x7,
+ destCheck ); // to prevent Clawshots from being overwritten by Clawshot
+ }
+ else if ( destCheck->itemID == items::Item::Big_Quiver )
+ {
+ sourceCheck =
+ findSource( destCheck->destLayer, 0x4, destCheck ); // to prevent bow from being overwritten
+ }
+ else if ( destCheck->itemID == items::Item::Giant_Quiver )
+ {
+ sourceCheck =
+ findSource( destCheck->destLayer, 0x8, destCheck ); // to prevent bow from being overwritten
+ }
+ else if ( destCheck->itemID == items::Item::Giant_Wallet )
+ {
+ sourceCheck = findSource( destCheck->destLayer,
+ 0x7,
+ destCheck ); // to prevent overwriting giant wallet with big wallet
+ }
+ else if ( destCheck->itemID == items::Item::Giant_Bomb_Bag )
+ {
+ sourceCheck =
+ findSource( destCheck->destLayer,
+ 0x6,
+ destCheck ); // to prevent getting a 4th bag and possibly crashing the game
+ }
+ else
+ {
+ sourceCheck = findSource( destCheck->destLayer, 0x0, destCheck );
+ }
+ }
+ else
+ {
+ sourceCheck = findSource( destCheck->destLayer, 0x0, destCheck );
+ }
+ placeCheck( sourceCheck, destCheck );
+ layerCheckCount++;
+ }
+ }
+ }
+
+ // Place remaining
+ for ( u16 i = 0; i < totalChecks; i++ )
+ {
+ destCheck = &item::checks[i];
+
+ if ( !destCheck->source )
+ {
+ if ( destCheck->itemID == items::Item::Ordon_Shield || destCheck->itemID == items::Item::Wooden_Shield ||
+ destCheck->itemID == items::Item::Hylian_Shield )
+ {
+ sourceCheck =
+ findSource( 0xFF,
+ 0x2,
+ destCheck ); // to prevent softlocking the game when you try to get ordon shield check
+ }
+ else
+ {
+ sourceCheck = findSource( 0xFF, 0, destCheck );
+ }
+ placeCheck( sourceCheck, destCheck );
+ }
+ }
+
+ // Count empty
+ for ( u16 i = 0; i < totalChecks; i++ )
+ {
+ if ( !item::checks[i].destination )
+ {
+ empty++;
+ }
+ }
+
+ // Done
+ checkSum = tools::fletcher16( itemOrder, sizeof( itemOrder ) );
+
+ delete[] itemOrder;
+
+ // Reset seed if the player wanted to lock it (otherwise it advances anyways)
+ tools::randomSeed = currentSeed;
+ }
+
+ void ChestRandomizer::placeCheck( item::ItemCheck* sourceCheck, item::ItemCheck* destCheck )
+ {
+ // Add source item to the itemOrder array
+ itemOrder[itemOrderIndex] = sourceCheck->itemID;
+ itemOrderIndex++;
+
+ // Place without asking
+ sourceCheck->destination = destCheck;
+ destCheck->source = sourceCheck;
+
+ // Update player conditions!
+ currentPlayerConditions = item::getFlags( destCheck->itemID, currentPlayerConditions );
+ }
+
+ item::ItemCheck* ChestRandomizer::findSource( u8 maxLayer, u8 minLayer, item::ItemCheck* destCheck )
+ {
+ if ( minLayer == 0xFF )
+ {
+ minLayer = 0x0;
+ }
+
+ item::ItemCheck* sourceCheck;
+ u16 index;
+ do
+ {
+ index = tools::getRandom( totalChecks );
+ sourceCheck = &item::checks[index];
+ } while ( !checkCondition( sourceCheck, destCheck ) || sourceCheck->destination ||
+ sourceCheck->sourceLayer > maxLayer || sourceCheck->sourceLayer < minLayer ||
+ ( destCheck->type == item::ItemType::Bug && 0 == strcmp( "R_SP160", sourceCheck->stage ) &&
+ sourceCheck->room == 3 ) || // agitha can't give bugs
+ ( areDungeonItemsRandomized == 1 && destCheck->type == item::ItemType::Dungeon &&
+ 0 != strcmp( destCheck->stage, sourceCheck->stage ) ) || // dungeon items only in their own dungeon
+ ( areDungeonItemsRandomized == 1 && destCheck->type == item::ItemType::Dungeon &&
+ index == 115 ) ); // dont place dungeon items at clawshot goron mines check
+
+ return sourceCheck;
+ }
+
+ bool ChestRandomizer::checkCondition( item::ItemCheck* sourceCheck, item::ItemCheck* destCheck )
+ {
+ if ( ( sourceCheck->condition & item::Condition::AND ) == item::Condition::AND )
+ {
+ if ( ( sourceCheck->condition & currentPlayerConditions ) == sourceCheck->condition )
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if ( ( sourceCheck->condition & currentPlayerConditions ) != 0 )
+ {
+ return true;
+ }
+ }
+ // If the destination item (which you'll receive) isn't required for this source and you don't require anything in this
+ // layer, it can be placed though
+ if ( ( item::getFlags( destCheck->itemID, 0 ) & sourceCheck->condition ) == 0 )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ bool ChestRandomizer::isLocked( item::ItemCheck* check )
+ {
+ bool result = false;
+
+ switch ( check->type )
+ {
+ case item::ItemType::Key:
+ // Small Keys + ordon pumpkin and cheese
+ if ( isKeysanityEnabled == 0 || ( Singleton::getInstance()->isForestEscapeEnabled == 1 &&
+ isKeysanityEnabled == 1 && check->itemID == items::Item::Coro_Key ) )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Dungeon:
+ // Map, compass, big key
+ if ( areDungeonItemsRandomized == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::HeartPiece:
+ // Map, compass, big key
+ if ( areHeartPiecesRandomized == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Rupee:
+ // Map, compass, big key
+ if ( areRupeesRandomized == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Ammo:
+ // Map, compass, big key
+ if ( areAmmoRandomized == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Story:
+ if ( check->itemID != items::Item::Aurus_Memo && check->itemID != items::Item::Asheis_Sketch )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Bug:
+ if ( isBugsanityEnabled == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::PoeSoul:
+ if ( isPoesanityEnabled == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Shop:
+ if ( isShopsanityEnabled == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case item::ItemType::Skill:
+ result = true;
+ break;
+
+ case item::ItemType::Scent:
+ result = true;
+ break;
+ }
+
+ switch ( check->itemID )
+ {
+ /*case items::Item::Iron_Boots:
+ result = true;
+ break;*/
+ case items::Item::Shadow_Crystal:
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case items::Item::Fishing_Rod:
+ result = true;
+ break;
+
+ case items::Item::Ancient_Sky_Book_empty:
+ if ( isProgressiveEnabled == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case items::Item::Ancient_Sky_Book_partly_filled:
+ if ( Singleton::getInstance()->shuffledSkybook == 0 )
+ {
+ result = true;
+ }
+ break;
+
+ case items::Item::Ancient_Sky_Book_completed:
+ if ( Singleton::getInstance()->shuffledSkybook == 0 )
+ {
+ result = true;
+ }
+ break;
+ }
+
+ return result;
+ }
+
+ s32 ChestRandomizer::getItemReplacement( const float pos[3], s32 item )
+ {
+ item::ItemCheck* sourceCheck;
+ snprintf( lastSourceInfo, 50, "%s %4.0f %4.0f %4.0f", gameInfo.currentStage, pos[0], pos[1], pos[2] );
+ snprintf( lastDestInfo, 50, "No Replacement found for this source" );
+
+ /*if (item == items::Item::Sera_Bottle)
+ { //for testing only
+ item = itemThatReplacesHalfMilk;
+ if (item == items::Item::Dominion_Rod)
+ {
+ gameInfo.scratchPad.eventBits[0x25] |= 0x80;
+ }
+ else if (item == items::Item::Poe_Soul)
+ {//increase poe counter
+ gameInfo.scratchPad.poeCount++;
+ }
+ return item;
+ }
+ else if (item == items::Item::Slingshot)
+ { //for testing only
+ item = itemThatReplacesSlingShot;
+ if (item == items::Item::Dominion_Rod)
+ {
+ item = items::Item::Dominion_Rod;
+ gameInfo.scratchPad.eventBits[0x25] |= 0x80;
+ }
+ else if (item == items::Item::Poe_Soul)
+ {//increase poe counter
+ gameInfo.scratchPad.poeCount++;
+ }
+ return item;
+ }*/
+
+ if ( item == items::Item::Heart_Container && isStageBoss() )
+ { // set flag for HC gotten
+ gameInfo.localAreaNodes.dungeon.containerGotten = 0b1;
+ if ( tp::d_a_alink::checkStageName( stage::allStages[Stage_Fyrus] ) )
+ {
+ gameInfo.localAreaNodes.unk_0[0xA] |= 0x40; // open doors to mini boss to prevent softlocks
+ }
+ }
+ else if ( item == items::Item::Iron_Boots )
+ { // set flag for having talked to Bo
+ gameInfo.scratchPad.eventBits[0x1C] |= 0x20;
+ }
+ else if ( item == items::Item::Poe_Soul && gameInfo.scratchPad.poeCount >= 1 &&
+ !( tp::d_a_alink::checkStageName( stage::allStages[Stage_Castle_Town_Shops] ) &&
+ tp::d_kankyo::env_light.currentRoom == 5 ) )
+ { // decrease poe counter
+ gameInfo.scratchPad.poeCount--;
+ }
+ else if ( item == items::Item::Ooccoo_Dungeon &&
+ tp::d_a_alink::checkStageName( stage::allStages[Stage_City_in_the_Sky] ) )
+ {
+ Singleton::getInstance()->hasCiTSOoccoo = 1;
+ }
+ else if ( item == items::Item::Vessel_Of_Light_Faron )
+ {
+ tp::d_com_inf_game::ScratchPad* scratchPadPtr = &gameInfo.scratchPad;
+ u8* eventBitsPtr = &scratchPadPtr->eventBits[0];
+ tp::d_com_inf_game::AllAreaNodes* allAreaNodesPtr = &scratchPadPtr->allAreaNodes;
+ if ( Singleton::getInstance()->isTwilightSkipped == 1 )
+ {
+ // Set Faron Twilight Flags
+ scratchPadPtr->clearedTwilights.Faron = 0b1; // Clear Faron Twilight
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Faron );
+ scratchPadPtr->tearCounters.Faron = 16;
+ eventBitsPtr[0x5] |= 0xFF; // Ensure Epona is Stolen, give Midna Charge
+ eventBitsPtr[0x6] |= 0x10; // Faron Twilight Progression flag
+ eventBitsPtr[0xC] |= 0x8; // Set Sword and Shield to not be on back
+ tools::setItemFlag( ItemFlags::Heros_Clothes );
+
+ // Set Eldin Twilight Flags
+ scratchPadPtr->clearedTwilights.Eldin = 0b1; // Clear Eldin Twilight
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Eldin );
+ scratchPadPtr->tearCounters.Eldin = 16;
+ eventBitsPtr[0x6] |= 0x1; // tame Epona
+ eventBitsPtr[0xA] |= 0x8; // Beat KB1
+ eventBitsPtr[0x14] |= 0x10; // Put Bo Outside
+ eventBitsPtr[0x7] |= 0xDE; // skip Gor Coron Sumo and Enter Mines also Trigger KB1 and mark Post-KB1 CS as
+ // watched, Eldin Twilight Story Progression Flag
+ eventBitsPtr[0x41] |= 0x10; // Told Fado about the Kids
+
+ // Set Lanayru Twilight Flags
+ scratchPadPtr->clearedTwilights.Lanayru = 0b1; // Clear Lanayru Twilight
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Lanayru );
+ scratchPadPtr->tearCounters.Lanayru = 16;
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x80; // water on Field map
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xF] |= 0x10; // open south CT Shortcut to Faron
+ allAreaNodesPtr->Lanayru.unk_0[0xF] |= 0x1; // water on Map
+ eventBitsPtr[0x30] |= 0x40; // gave springwater to south CT goron
+ eventBitsPtr[0x8] |= 0x80; // ZD Thawed
+ eventBitsPtr[0xC] |= 0x2; // Lanayru Twilight Story Progression Flag
+ eventBitsPtr[0xA] |= 0x10; // Kagorok Howl at Lake
+
+ // Unlock Map Regions
+ scratchPadPtr->movingActors.exploredRegions.Snowpeak = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Desert = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Lanayru = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Eldin = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Faron = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Ordon = 0b1;
+
+ // Unlock Warps
+ allAreaNodesPtr->Ordon.unk_0[0xD] = 0x10; // give Ordon Spring Warp
+ gameInfo.localAreaNodes.unk_0[0x13] = 0x80; // give S faron warp
+ gameInfo.localAreaNodes.unk_0[0xB] = 0x4; // give N faron warp
+ allAreaNodesPtr->Eldin.unk_0[0x9] |= 0x20; // give Death Mountain Warp
+ allAreaNodesPtr->Eldin.unk_0[0x8] |= 0x80; // give Kakariko Warp
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x17] = 0x8; // give Bridge of Eldin Warp
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x8; // give castle town warp
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x9] |= 0x20; // give Gorge Warp
+ allAreaNodesPtr->Lanayru.unk_0[0xB] |= 0x4; // give Zora's Domain Warp
+ allAreaNodesPtr->Lanayru.unk_0[0xA] |= 0x4; // give lake hylia warp
+
+ // Faron Escape
+ if ( Singleton::getInstance()->isForestEscapeEnabled == 1 )
+ {
+ eventBitsPtr[0x6] |= 0x26; // warp the kak bridge, give map warp, set Forest Temple Story Flag
+ }
+ else
+ {
+ eventBitsPtr[0x6] |= 0x24; // warp the kak bridge, give map warp
+ }
+
+ // Skip MDH?
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 1 )
+ {
+ // set MDH flags
+ gameInfo.scratchPad.eventBits[0xC] |= 0x1; // MDH Started
+ gameInfo.scratchPad.eventBits[0x1E] |= 0x8; // MDH Completed
+ }
+
+ gameInfo.nextStageVars.triggerLoad |= 1;
+ return item;
+ }
+ else
+ {
+ // Faron Escape
+ if ( Singleton::getInstance()->isForestEscapeEnabled == 1 )
+ {
+ eventBitsPtr[0x6] |= 0x26; // warp the kak bridge, give map warp, set Forest Temple Story Flag
+ }
+ else
+ {
+ eventBitsPtr[0x6] |= 0x24; // warp the kak bridge, give map warp
+ }
+ gameInfo.localAreaNodes.unk_0[0x9] = 0x10; // unlock N Faron gate
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Faron );
+ return item;
+ }
+ return item;
+ }
+ else if ( item == items::Item::Vessel_Of_Light_Eldin )
+ {
+ tp::d_com_inf_game::ScratchPad* scratchPadPtr = &gameInfo.scratchPad;
+ u8* eventBitsPtr = &scratchPadPtr->eventBits[0];
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Eldin );
+ eventBitsPtr[0x6] |= 0x1; // tame Epona
+ eventBitsPtr[0xA] |= 0x8; // Beat KB1
+ eventBitsPtr[0x14] |= 0x10; // Put Bo Outside
+ eventBitsPtr[0x7] |=
+ 0xD6; // skip Gor Coron Sumo and Enter Mines also Trigger KB1 and mark Post-KB1 CS as watched
+ return item;
+ }
+ else if ( item == items::Item::Vessel_Of_Light_Lanayru )
+ {
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Lanayru );
+ return item;
+ }
+ else if ( item == items::Item::Hylian_Shield && tp::d_a_alink::checkStageName( "R_SP109" ) )
+ { // set flag for Malo's Hylian Shield check
+ tools::setItemFlag( ItemFlags::Null_D9 );
+ }
+ else if ( item == items::Item::Hawkeye )
+ { // set flag for Hawkeye check
+ tools::setItemFlag( ItemFlags::Null_D8 );
+ }
+ else if ( item == items::Item::Dungeon_Map && tp::d_a_alink::checkStageName( "D_MN11" ) )
+ { // set flag to be able to enter kitchen
+ gameInfo.localAreaNodes.unk_0[0x10] |= 0x20;
+ }
+
+ for ( u16 i = 0; i < totalChecks; i++ )
+ {
+ sourceCheck = &item::checks[i];
+
+ if ( tp::d_a_alink::checkStageName( sourceCheck->stage ) ||
+ ( tp::d_a_alink::checkStageName( "F_SP128" ) && 0 == strcmp( sourceCheck->stage, "R_SP128" ) ) )
+ {
+ if ( isGrottoCheckOk( i ) )
+ {
+ if ( isProgressiveEnabled == 1 && item == items::Item::Ancient_Sky_Book_completed )
+ {
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ }
+ // Correct stage
+ if ( sourceCheck->itemID == item || ( isItemBombs( item ) && isItemBombs( sourceCheck->itemID ) ) ||
+ ( item == items::Item::Red_Rupee && sourceCheck->itemID == items::Item::Giant_Bomb_Bag ) ||
+ ( item == items::Item::Ooccoo_FT && sourceCheck->itemID == items::Item::Ooccoo_Dungeon ) ||
+ ( item == items::Item::Lantern_Refill_Shop && sourceCheck->itemID == items::Item::Lantern_Oil_Shop ) ||
+ ( item == items::Item::Lantern_Refill_Scooped &&
+ sourceCheck->itemID == items::Item::Lantern_Oil_Scooped ) ||
+ ( sourceCheck->itemID == items::Item::Superb_Soup &&
+ ( item == items::Item::Simple_Soup || item == items::Item::Good_Soup ) ) )
+ {
+ bool isOk = false;
+
+ if ( sourceCheck->type == item::ItemType::Bug || sourceCheck->type == item::ItemType::Dungeon ||
+ sourceCheck->itemID == items::Item::Heart_Container ||
+ sourceCheck->itemID == items::Item::Ball_and_Chain ||
+ sourceCheck->itemID == items::Item::Ancient_Sky_Book_empty )
+ { // bugs have unique itemids so position doesn't matter
+ // dungeon items are unique in their dungeon
+ // there can only be one heart container per stage in vanilla, so position doesn't matter (also each
+ // one can be at 2 locations: if gotten after boss or if coming back) BaC can be anywhere in the
+ // room so don't check the position empty sky book can be outside the house or inside the house so
+ // don't check coords
+ isOk = true;
+ }
+ else if ( sourceCheck->itemID == items::Item::Piece_of_Heart &&
+ ( 0 == strcmp( "F_SP127", sourceCheck->stage ) ) )
+ { // fishing hole freestanding PoH
+ // it's alone in the fishing hole so it can only be that one
+ isOk = true;
+ }
+ else
+ {
+ if ( sourceCheck->type == item::ItemType::PoeSoul )
+ { // poes can move a lot so give them more range
+ // poe range= ~1400
+ rangeX = 2800.0f;
+ rangeY = 1400.0f;
+ rangeZ = 2800.0f;
+ }
+ else if ( sourceCheck->itemID == items::Item::Piece_of_Heart &&
+ ( ( 0 == strcmp( "F_SP121", sourceCheck->stage ) && sourceCheck->room == 6 ) ||
+ ( 0 == strcmp( "F_SP109", sourceCheck->stage ) && sourceCheck->room == 0 ) ||
+ ( 0 == strcmp( "F_SP121", sourceCheck->stage ) && sourceCheck->room == 3 ) ||
+ ( 0 == strcmp( "F_SP121", sourceCheck->stage ) && sourceCheck->room == 0 ) ||
+ ( 0 == strcmp( "F_SP128", sourceCheck->stage ) && sourceCheck->room == 0 ) ) )
+ { // freestanding PoH
+ // they can be moved by boomerang and clawshot, so give them more range
+ // clawshot and boomrang targetting range ~2000
+ rangeX = 3000.0f;
+ rangeY = 3000.0f;
+ rangeZ = 3000.0f;
+ }
+ else if ( sourceCheck->itemID == items::Item::Small_Key &&
+ 0 == strcmp( "D_MN05", sourceCheck->stage ) && sourceCheck->room == 5 )
+ { // totem chest in FT (it can be knocked down both ways so more range is required)
+ rangeX = 500.0f;
+ rangeY = 500.0f;
+ rangeZ = 800.0f;
+ }
+ if ( tools::fCompare( sourceCheck->position[0], pos[0] ) < rangeX )
+ {
+ if ( tools::fCompare( sourceCheck->position[1], pos[1] ) < rangeY )
+ {
+ if ( tools::fCompare( sourceCheck->position[2], pos[2] ) < rangeZ )
+ {
+ isOk = true;
+ }
+ }
+ }
+ }
+ if ( isOk )
+ {
+ snprintf( lastSourceInfo,
+ 50,
+ "%s->%d->%x",
+ sourceCheck->stage,
+ sourceCheck->room,
+ sourceCheck->itemID );
+ if ( sourceCheck->destination )
+ {
+ snprintf( lastDestInfo,
+ 50,
+ "%s->%d->%x",
+ sourceCheck->destination->stage,
+ sourceCheck->destination->room,
+ sourceCheck->destination->itemID );
+ item = sourceCheck->destination->itemID;
+ if ( sourceCheck->type == item::ItemType::Bug ||
+ sourceCheck->itemID == items::Item::Heart_Container )
+ {
+ sourceCheck->destination = &item::checks[263]; // green rupee
+ }
+ else if ( sourceCheck->type == item::ItemType::Shop )
+ {
+ sourceCheck->destination = &item::checks[i];
+ }
+ else if ( sourceCheck->itemID != items::Item::Big_Quiver &&
+ sourceCheck->itemID !=
+ items::Item::Giant_Quiver && // quiver checks called twice somehow
+ sourceCheck->type != item::ItemType::Dungeon &&
+ sourceCheck->type != item::ItemType::Gear &&
+ sourceCheck->type !=
+ item::ItemType::Equip ) // some checks are called twice i don't wanna list
+ // them all, but dungeon items, gear, and equipable
+ // items only have one check each intheir stage
+ {
+ // Unset this check
+ sourceCheck->destination = nullptr;
+ }
+ // progressive checks (doesn't work if you already have items when generating seed)
+ if ( isProgressiveEnabled == 1 )
+ {
+ if ( item == items::Item::Wooden_Sword && tools::checkItemFlag( ItemFlags::Wooden_Sword ) )
+ {
+ item = items::Item::Ordon_Sword;
+ gameInfo.scratchPad.equipedItems.sword = 0x28;
+ }
+ else if ( item == items::Item::Ordon_Sword &&
+ !tools::checkItemFlag( ItemFlags::Wooden_Sword ) )
+ {
+ item = items::Item::Wooden_Sword;
+ gameInfo.scratchPad.equipedItems.sword = 0x3F;
+ }
+ else if ( item == items::Item::Master_Sword &&
+ tools::checkItemFlag( ItemFlags::Master_Sword ) )
+ { // for when MS and light Ms are implemented
+ item = items::Item::Master_Sword_Light;
+ gameInfo.scratchPad.equipedItems.sword = 0x49;
+ }
+ else if ( item == items::Item::Master_Sword_Light &&
+ !tools::checkItemFlag( ItemFlags::Master_Sword ) )
+ { // for when MS and light Ms are implemented
+ item = items::Item::Master_Sword;
+ gameInfo.scratchPad.equipedItems.sword = 0x29;
+ }
+ else if ( item == items::Item::Clawshot && tools::checkItemFlag( ItemFlags::Clawshot ) )
+ {
+ item = items::Item::Clawshots;
+ }
+ else if ( item == items::Item::Clawshots && !tools::checkItemFlag( ItemFlags::Clawshot ) )
+ {
+ item = items::Item::Clawshot;
+ }
+ else if ( item == items::Item::Heros_Bow )
+ {
+ if ( tools::checkItemFlag( ItemFlags::Heros_Bow ) &&
+ !tools::checkItemFlag( ItemFlags::Big_Quiver ) )
+ {
+ item = items::Item::Big_Quiver;
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Heros_Bow ) &&
+ tools::checkItemFlag( ItemFlags::Big_Quiver ) )
+ {
+ item = items::Item::Giant_Quiver;
+ }
+ }
+ else if ( item == items::Item::Big_Quiver )
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Heros_Bow ) )
+ {
+ item = items::Item::Heros_Bow;
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Big_Quiver ) )
+ {
+ item = items::Item::Giant_Quiver;
+ }
+ }
+ else if ( item == items::Item::Giant_Quiver )
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Heros_Bow ) )
+ {
+ item = items::Item::Heros_Bow;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Big_Quiver ) )
+ {
+ item = items::Item::Big_Quiver;
+ }
+ }
+ else if ( item == items::Item::Big_Wallet && tools::checkItemFlag( ItemFlags::Big_Wallet ) )
+ {
+ item = items::Item::Giant_Wallet;
+ }
+ else if ( item == items::Item::Giant_Wallet &&
+ !tools::checkItemFlag( ItemFlags::Big_Wallet ) )
+ {
+ item = items::Item::Big_Wallet;
+ }
+ else if ( item == items::Item::Ancient_Sky_Book_empty )
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Ancient_Sky_Book_empty ) )
+ {
+ item = items::Item::Ancient_Sky_Book_empty;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DF ) )
+ { // letter 1
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DF );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DE ) )
+ { // letter 2
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DE );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DD ) )
+ { // letter 3
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DD );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DC ) )
+ { // letter 4
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DC );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DB ) )
+ { // letter 5
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DB );
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Null_DB ) )
+ {
+ gameInfo.scratchPad.eventBits[0x60] |=
+ 0x4; // set shad to be back in the basement
+ gameInfo.scratchPad.eventBits[0x25] |=
+ 0x40; // Set the Owl Statue in Kak to be able to be moved
+ gameInfo.scratchPad.eventBits[0x5F] |= 0x20; // Shad leaves so you can warp
+ gameInfo.scratchPad.eventBits[0x3B] |= 0x8; // repairs Cannon at lake
+ item = items::Item::Ancient_Sky_Book_completed;
+ }
+ }
+ else if ( item == items::Item::Ancient_Sky_Book_partly_filled )
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Ancient_Sky_Book_empty ) )
+ {
+ item = items::Item::Ancient_Sky_Book_empty;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DF ) )
+ { // letter 1
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DF );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DE ) )
+ { // letter 2
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DE );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DD ) )
+ { // letter 3
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DD );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DC ) )
+ { // letter 4
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DC );
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Null_DB ) )
+ { // letter 5
+ item = items::Item::Ancient_Sky_Book_partly_filled;
+ tools::setItemFlag( ItemFlags::Null_DB );
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Null_DB ) )
+ {
+ gameInfo.scratchPad.eventBits[0x60] |=
+ 0x4; // set shad to be back in the basement
+ gameInfo.scratchPad.eventBits[0x25] |=
+ 0x40; // Set the Owl Statue in Kak to be able to be moved
+ gameInfo.scratchPad.eventBits[0x5F] |= 0x20; // Shad leaves so you can warp
+ gameInfo.scratchPad.eventBits[0x3B] |= 0x8; // repairs Cannon at lake
+ item = items::Item::Ancient_Sky_Book_completed;
+ }
+ }
+ else if ( item == items::Item::Empty_Bomb_Bag )
+ {
+ if ( itemWheel->Bomb_Bag_1 == 0xFF )
+ {
+ item = items::Item::Bomb_Bag_Regular_Bombs;
+ }
+ else if ( itemWheel->Bomb_Bag_2 == 0xFF )
+ {
+ item = items::Item::Goron_Bomb_Bag;
+ }
+ else if ( itemWheel->Bomb_Bag_3 == 0xFF )
+ {
+ item = items::Item::Goron_Bomb_Bag;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Giant_Bomb_Bag ) )
+ {
+ item = items::Item::Giant_Bomb_Bag;
+ }
+ else
+ {
+ item = items::Item::Bombs_30;
+ }
+ }
+ else if ( item == items::Item::Goron_Bomb_Bag )
+ {
+ if ( itemWheel->Bomb_Bag_1 == 0xFF )
+ {
+ item = items::Item::Bomb_Bag_Regular_Bombs;
+ }
+ else if ( itemWheel->Bomb_Bag_2 == 0xFF )
+ {
+ item = items::Item::Goron_Bomb_Bag;
+ }
+ else if ( itemWheel->Bomb_Bag_3 == 0xFF )
+ {
+ item = items::Item::Goron_Bomb_Bag;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Giant_Bomb_Bag ) )
+ {
+ item = items::Item::Giant_Bomb_Bag;
+ }
+ else
+ {
+ item = items::Item::Bombs_30;
+ }
+ }
+ else if ( item == items::Item::Giant_Bomb_Bag )
+ {
+ if ( itemWheel->Bomb_Bag_1 == 0xFF )
+ {
+ item = items::Item::Bomb_Bag_Regular_Bombs;
+ }
+ else if ( itemWheel->Bomb_Bag_2 == 0xFF )
+ {
+ item = items::Item::Goron_Bomb_Bag;
+ }
+ else if ( itemWheel->Bomb_Bag_3 == 0xFF )
+ {
+ item = items::Item::Goron_Bomb_Bag;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Giant_Bomb_Bag ) )
+ {
+ item = items::Item::Giant_Bomb_Bag;
+ }
+ else
+ {
+ item = items::Item::Bombs_30;
+ }
+ }
+ else if ( item == items::Item::Key_Shard_1 )
+ {
+ if ( tools::checkItemFlag( ItemFlags::Key_Shard_1 ) &&
+ !tools::checkItemFlag( ItemFlags::Key_Shard_2 ) )
+ {
+ item = items::Item::Key_Shard_2;
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Key_Shard_1 ) &&
+ tools::checkItemFlag( ItemFlags::Key_Shard_2 ) )
+ {
+ item = items::Item::Big_Key_Goron_Mines;
+ tools::setItemFlag(
+ ItemFlags::Key_Shard_3 ); // set this flag to show full key on the map
+ }
+ }
+ else if ( item == items::Item::Key_Shard_2 )
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Key_Shard_1 ) )
+ {
+ item = items::Item::Key_Shard_1;
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Key_Shard_1 ) &&
+ tools::checkItemFlag( ItemFlags::Key_Shard_2 ) )
+ {
+ item = items::Item::Big_Key_Goron_Mines;
+ tools::setItemFlag(
+ ItemFlags::Key_Shard_3 ); // set this flag to show full key on the map
+ }
+ }
+ else if ( item == items::Item::Big_Key_Goron_Mines )
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Key_Shard_1 ) )
+ {
+ item = items::Item::Key_Shard_1;
+ }
+ else if ( tools::checkItemFlag( ItemFlags::Key_Shard_1 ) &&
+ !tools::checkItemFlag( ItemFlags::Key_Shard_2 ) )
+ {
+ item = items::Item::Key_Shard_2;
+ }
+ else
+ {
+ tools::setItemFlag(
+ ItemFlags::Key_Shard_3 ); // set this flag to show full key on the map
+ }
+ }
+ else if ( item == items::Item::Dominion_Rod &&
+ tools::checkItemFlag( ItemFlags::Dominion_Rod ) )
+ { // for when powered dominion rod is implemented
+ item = items::Item::Dominion_Rod_Uncharged;
+ }
+ else if ( item == items::Item::Dominion_Rod_Uncharged &&
+ !tools::checkItemFlag( ItemFlags::Dominion_Rod ) )
+ { // for when MS and light Ms are implemented
+ item = items::Item::Dominion_Rod;
+ }
+ }
+
+ if ( item == items::Item::Poe_Soul && gameInfo.scratchPad.poeCount < 60 )
+ { // increase poe counter
+ gameInfo.scratchPad.poeCount++;
+ }
+ else if ( item == items::Item::Shadow_Crystal )
+ { // shadow crystal doesn't actually do anything so we have to do its functionnality
+ // ourselves
+ if ( Singleton::getInstance()->startWithCrystal == 1 )
+ {
+ item = items::Item::Silver_Rupee;
+ }
+ else
+ {
+ game_patch::giveMidnaTransform();
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 1 )
+ {
+ gameInfo.scratchPad.unk_1F[0x11] |= 0x8; // Midna on Back
+ }
+ }
+ }
+ else if ( item == items::Item::Dominion_Rod_Uncharged )
+ {
+ gameInfo.scratchPad.eventBits[0x25] |= 0x80; // set flag to charge dominion rod
+ }
+ else if ( item == items::Item::Ordon_Pumpkin )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.unk_0[0x9] |=
+ 0x4; // Unlock Lobby Courtyard Door
+ gameInfo.scratchPad.eventBits[0x4] |= 0x80; // Told Yeta About Pumpkin
+ gameInfo.scratchPad.eventBits[0x0] |= 0x22; // Yeto took pumpkin and put it in soup
+ gameInfo.scratchPad.eventBits[0x14] |= 0x40; // Unlock Lobby Door
+ gameInfo.localAreaNodes.unk_0[0x9] |= 0x4; // unlock courtyard door
+ }
+ else if ( item == items::Item::Ordon_Goat_Cheese )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.unk_0[0x9] |=
+ 0x8; // Unlock West Wing Door
+ gameInfo.scratchPad.eventBits[0x1] |= 0x20; // Told Yeta About Cheese
+ gameInfo.scratchPad.eventBits[0x0] |= 0x11; // Yeto took Cheese and put it in soup
+ gameInfo.scratchPad.eventBits[0x14] |= 0x20; // Unlock West Door
+ gameInfo.localAreaNodes.unk_0[0x9] |= 0x8; // unlock west wing door
+ }
+ else if ( item == 0xE1 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == 0xE2 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == 0xE3 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == 0xE4 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == 0xE5 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == 0xE6 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == 0xE7 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x4 ) != 0 ) /*have ending blow*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x8 ) != 0 ) /*have shield attack*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x2 ) != 0 ) /*have back slice*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x29] & 0x1 ) != 0 ) /*have helm splitter*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x80 ) !=
+ 0 ) /*have mortal draw*/
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x2A] & 0x40 ) !=
+ 0 ) /*have jump strike*/
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x20; // give great spin
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x40; // give jumpstrike
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x2A] |= 0x80; // give mortal draw
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x1; // give helm splitter
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x2; // give back slice
+ }
+ }
+ else
+ {
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x8; // give shield attack
+ }
+ }
+ }
+ else
+ {
+ gameInfo.scratchPad.eventBits[0x29] |= 0x4; // give ending blow
+ }
+ }
+ else if ( item == items::Item::Reekfish_Scent )
+ {
+ gameInfo.scratchPad.eventBits[0x61] |= 0x20; // allow you to go to snowpeak
+ }
+ else if ( item == items::Item::Medicine_Scent )
+ {
+ gameInfo.scratchPad.eventBits[0x2F] |= 0x4; // smelled Medicine Scent
+ }
+ else if ( item == items::Item::Bed_Key )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bigKeyGotten =
+ 0b1; // unlock Blizzetta Door
+ if ( Singleton::getInstance()->isBossKeyseyEnabled == 1 )
+ {
+ item = items::Item::Red_Rupee;
+ }
+ }
+ else if ( item == items::Item::Big_Key && Singleton::getInstance()->isBossKeyseyEnabled == 1 )
+ {
+ item = items::Item::Red_Rupee;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Slingshot ) && ( item == items::Item::Seeds_50 ) )
+ {
+ item = items::Item::Blue_Rupee;
+ }
+ else if ( !tools::checkItemFlag( ItemFlags::Heros_Bow ) &&
+ ( item == items::Item::Arrows_10 || item == items::Item::Arrows_20 ||
+ item == items::Item::Arrows_30 || item == items::Item::Arrows_1 ) )
+ {
+ item = items::Item::Blue_Rupee;
+ }
+ else if ( gameInfo.scratchPad.itemWheel.Bomb_Bag_1 == 0xFF && isItemBombs( item ) )
+ {
+ item = items::Item::Blue_Rupee;
+ }
+ else if ( gameInfo.scratchPad.itemWheel.Bottle_1 == 0xFF && isItemBottleFill( item ) )
+ {
+ if ( tools::checkItemFlag( ItemFlags::Lantern ) )
+ {
+ if ( item == items::Item::Lantern_Oil_Shop )
+ {
+ item = items::Item::Lantern_Refill_Shop;
+ gameInfo.scratchPad.counters.lantern_oil =
+ gameInfo.scratchPad.counters.max_lantern_oil;
+ }
+ else if ( item == items::Item::Lantern_Oil_Scooped )
+ {
+ item = items::Item::Lantern_Refill_Scooped;
+ gameInfo.scratchPad.counters.lantern_oil =
+ gameInfo.scratchPad.counters.max_lantern_oil;
+ }
+ else if ( item == items::Item::Yellow_Chu_Jelly )
+ {
+ item = items::Item::Lantern_Yellow_Chu_Chu;
+ gameInfo.scratchPad.counters.lantern_oil =
+ gameInfo.scratchPad.counters.max_lantern_oil;
+ }
+ else
+ {
+ item = items::Item::Blue_Rupee;
+ }
+ }
+ else
+ {
+ item = items::Item::Blue_Rupee;
+ }
+ }
+ /*if (item == items::Item::Blue_Rupee)
+ {//somehow the blue rupee item get don't work normally
+ tp::d_item::execItemGet(items::Item::Blue_Rupee);
+ }*/
+ return item;
+ }
+ else
+ {
+ snprintf( lastDestInfo, 50, "No replacement here." );
+ // no return in the case where 2 items are close enough to be considered the same (bug rewards
+ // for example)
+ }
+ }
+ }
+ }
+ }
+ }
+ return item;
+ }
+
+ bool ChestRandomizer::isStageADungeon( char* stage )
+ {
+ u32 totalDungeonStages = sizeof( stage::dungeonStages ) / sizeof( stage::dungeonStages[0] );
+ for ( u32 i = 0; i < totalDungeonStages; i++ )
+ {
+ if ( 0 == strcmp( stage, stage::dungeonStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isItemBombs( u8 itemID )
+ {
+ if ( itemID == items::Item::Bombs_5 || itemID == items::Item::Bombs_10 || itemID == items::Item::Bombs_20 ||
+ itemID == items::Item::Bombs_30 || itemID == items::Item::Water_Bombs_5 || itemID == items::Item::Water_Bombs_10 ||
+ itemID == items::Item::Water_Bombs_15 || itemID == items::Item::Bomblings_5 ||
+ itemID == items::Item::Bomblings_10 )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ bool ChestRandomizer::isItemBottleFill( u8 itemID )
+ {
+ if ( itemID == items::Item::Red_Potion_Shop || itemID == items::Item::Green_Potion ||
+ itemID == items::Item::Blue_Potion || itemID == items::Item::Milk || itemID == items::Item::Lantern_Oil_Shop ||
+ itemID == items::Item::Water || itemID == items::Item::Lantern_Oil_Scooped ||
+ itemID == items::Item::Red_Potion_Scooped || itemID == items::Item::Nasty_soup ||
+ itemID == items::Item::Hot_spring_water_Scooped || itemID == items::Item::Fairy_Bottle ||
+ itemID == items::Item::Hot_Spring_Water_Shop || itemID == items::Item::Fairy_Tears ||
+ itemID == items::Item::Worm || itemID == items::Item::Bee_Larva_Scooped || itemID == items::Item::Rare_Chu_Jelly ||
+ itemID == items::Item::Red_Chu_Jelly || itemID == items::Item::Blue_Chu_Jelly ||
+ itemID == items::Item::Green_Chu_Jelly || itemID == items::Item::Yellow_Chu_Jelly ||
+ itemID == items::Item::Purple_Chu_Jelly || itemID == items::Item::Simple_Soup ||
+ itemID == items::Item::Good_Soup || itemID == items::Item::Superb_Soup || itemID == items::Item::Bee_Larva_Shop ||
+ itemID == items::Item::Black_Chu_Jelly )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ bool ChestRandomizer::isStageBoss()
+ {
+ u32 totalBossStages = sizeof( stage::bossStages ) / sizeof( stage::bossStages[0] );
+ for ( u32 i = 0; i < totalBossStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::bossStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isStageGrotto()
+ {
+ u32 totalGrottoStages = sizeof( stage::grottoStages ) / sizeof( stage::grottoStages[0] );
+ for ( u32 i = 0; i < totalGrottoStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::grottoStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isStageDungeon()
+ {
+ u32 totalDungeonStages = sizeof( stage::dungeonStages ) / sizeof( stage::dungeonStages[0] );
+ for ( u32 i = 0; i < totalDungeonStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::dungeonStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isStageInterior()
+ {
+ u32 totalInteriorStages = sizeof( stage::interiorStages ) / sizeof( stage::interiorStages[0] );
+ for ( u32 i = 0; i < totalInteriorStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::interiorStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isStageCave()
+ {
+ u32 totalCaveStages = sizeof( stage::caveStages ) / sizeof( stage::caveStages[0] );
+ for ( u32 i = 0; i < totalCaveStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::caveStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isStageSpecial()
+ {
+ u32 totalSpecialStages = sizeof( stage::specialStages ) / sizeof( stage::specialStages[0] );
+ for ( u32 i = 0; i < totalSpecialStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::specialStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ChestRandomizer::isStageTOD()
+ {
+ u32 totalTODStages = sizeof( stage::timeOfDayStages ) / sizeof( stage::timeOfDayStages[0] );
+ for ( u32 i = 0; i < totalTODStages; i++ )
+ {
+ if ( tp::d_a_alink::checkStageName( stage::timeOfDayStages[i] ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void ChestRandomizer::handleKeysanity()
+ {
+ if ( isKeysanityEnabled == 1 )
+ {
+ item::ItemCheck* sourceCheck;
+ item::ItemCheck* destCheck;
+ u32 length;
+ u16 index;
+ // do FT_1
+ length = sizeof( keyPlacement::FT_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::FT_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::FT_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do FT_2
+ length = sizeof( keyPlacement::FT_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::FT_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::FT_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do FT_3
+ length = sizeof( keyPlacement::FT_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::FT_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::FT_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do FT_4
+ length = sizeof( keyPlacement::FT_4 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::FT_keys[3]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::FT_4[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do GM_1
+ length = sizeof( keyPlacement::GM_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::GM_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::GM_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do GM_2
+ length = sizeof( keyPlacement::GM_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::GM_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::GM_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do GM_3
+ length = sizeof( keyPlacement::GM_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::GM_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::GM_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do LBT_1
+ length = sizeof( keyPlacement::LBT_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::LBT_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::LBT_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do LBT_2
+ length = sizeof( keyPlacement::LBT_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::LBT_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::LBT_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do LBT_3
+ length = sizeof( keyPlacement::LBT_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::LBT_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::LBT_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do AG_1
+ length = sizeof( keyPlacement::AG_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::AG_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::AG_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do AG_2
+ length = sizeof( keyPlacement::AG_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::AG_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::AG_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do AG_3
+ length = sizeof( keyPlacement::AG_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::AG_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::AG_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do AG_4
+ length = sizeof( keyPlacement::AG_4 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::AG_keys[3]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::AG_4[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do AG_5
+ length = sizeof( keyPlacement::AG_5 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::AG_keys[4]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::AG_5[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do SPR_1
+ length = sizeof( keyPlacement::SPR_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::SPR_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::SPR_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do SPR_2
+ length = sizeof( keyPlacement::SPR_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::SPR_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::SPR_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do SPR_3
+ length = sizeof( keyPlacement::SPR_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::SPR_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::SPR_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do SPR_4
+ length = sizeof( keyPlacement::SPR_4 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::SPR_keys[3]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::SPR_4[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do SPR_5
+ length = sizeof( keyPlacement::SPR_5 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::SPR_keys[4]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::SPR_5[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do SPR_6
+ length = sizeof( keyPlacement::SPR_6 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::SPR_keys[5]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::SPR_6[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do ToT_1
+ length = sizeof( keyPlacement::ToT_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::ToT_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::ToT_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do ToT_2
+ length = sizeof( keyPlacement::ToT_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::ToT_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::ToT_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do ToT_3
+ length = sizeof( keyPlacement::ToT_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::ToT_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::ToT_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do CitS_1
+ length = sizeof( keyPlacement::CitS_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::CitS_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::CitS_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do PoT_1
+ length = sizeof( keyPlacement::PoT_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do PoT_2
+ length = sizeof( keyPlacement::PoT_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do PoT_3
+ length = sizeof( keyPlacement::PoT_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do PoT_4
+ length = sizeof( keyPlacement::PoT_4 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[3]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_4[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do PoT_5
+ length = sizeof( keyPlacement::PoT_5 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[4]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_5[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do PoT_6
+ length = sizeof( keyPlacement::PoT_6 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[5]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_6[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do PoT_7
+ length = sizeof( keyPlacement::PoT_7 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::PoT_keys[6]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::PoT_7[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do HC_1
+ length = sizeof( keyPlacement::HC_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::HC_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::HC_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do HC_2
+ length = sizeof( keyPlacement::HC_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::HC_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::HC_2[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ // do HC_3
+ length = sizeof( keyPlacement::HC_3 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::HC_keys[2]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::HC_3[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+
+ // do F_1
+ length = sizeof( keyPlacement::F_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::F_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::F_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ if ( Singleton::getInstance()->isForestEscapeEnabled == 0 )
+ {
+ // do F_2
+ length = sizeof( keyPlacement::F_2 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::F_keys[1]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::F_2[index]];
+ } while ( sourceCheck->destination ||
+ ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ }
+
+ // do GD_1
+ length = sizeof( keyPlacement::GD_1 ) / sizeof( u16 );
+ destCheck = &item::checks[keyPlacement::GD_keys[0]];
+ do
+ {
+ index = tools::getRandom( length );
+ sourceCheck = &item::checks[keyPlacement::GD_1[index]];
+ } while ( sourceCheck->destination || ( sourceCheck->type == item::ItemType::PoeSoul && isPoesanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Bug && isBugsanityEnabled == 0 ) ||
+ ( sourceCheck->type == item::ItemType::Shop && isShopsanityEnabled == 0 ) );
+ placeCheck( sourceCheck, destCheck );
+ }
+ }
+
+ bool ChestRandomizer::isGrottoCheckOk( u16 checkID )
+ {
+ if ( isStageGrotto() )
+ {
+ u8 state = tp::d_com_inf_game::current_state;
+ if ( tp::d_a_alink::checkStageName( stage::grottoStages[0] ) )
+ {
+ if ( state == '0' )
+ {
+ u32 length = sizeof( grottoChecks::g1_0 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g1_0[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '1' )
+ {
+ u32 length = sizeof( grottoChecks::g1_1 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g1_1[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '2' )
+ {
+ u32 length = sizeof( grottoChecks::g1_2 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g1_2[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '3' )
+ {
+ u32 length = sizeof( grottoChecks::g1_3 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g1_3[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else if ( tp::d_a_alink::checkStageName( stage::grottoStages[1] ) )
+ {
+ if ( state == '0' )
+ {
+ u32 length = sizeof( grottoChecks::g2_0 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g2_0[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '1' )
+ {
+ u32 length = sizeof( grottoChecks::g2_1 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g2_1[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '2' )
+ {
+ u32 length = sizeof( grottoChecks::g2_2 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g2_2[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ /*else if (state == '3')
+ {
+ u32 length = sizeof(grottoChecks::g2_3) / sizeof(u16);
+ for (u16 i = 0; i < length; i++)
+ {
+ if (checkID == grottoChecks::g2_3[i])
+ {
+ return true;
+ }
+ }
+ return false;
+ }*/
+ else
+ {
+ return true;
+ }
+ }
+ else if ( tp::d_a_alink::checkStageName( stage::grottoStages[2] ) )
+ {
+ if ( state == '0' )
+ {
+ u32 length = sizeof( grottoChecks::g3_0 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g3_0[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ /*else if (state == '1')
+ {
+ u32 length = sizeof(grottoChecks::g3_1) / sizeof(u16);
+ for (u16 i = 0; i < length; i++)
+ {
+ if (checkID == grottoChecks::g3_1[i])
+ {
+ return true;
+ }
+ }
+ return false;
+
+ }*/
+ /*else if (state == '2')
+ {
+ u32 length = sizeof(grottoChecks::g3_2) / sizeof(u16);
+ for (u16 i = 0; i < length; i++)
+ {
+ if (checkID == grottoChecks::g3_2[i])
+ {
+ return true;
+ }
+ }
+ return false;
+ }*/
+ /*else if (state == '3')
+ {
+ u32 length = sizeof(grottoChecks::g3_3) / sizeof(u16);
+ for (u16 i = 0; i < length; i++)
+ {
+ if (checkID == grottoChecks::g3_3[i])
+ {
+ return true;
+ }
+ }
+ return false;
+ }*/
+ else
+ {
+ return true;
+ }
+ }
+ else if ( tp::d_a_alink::checkStageName( stage::grottoStages[3] ) )
+ {
+ if ( state == '0' )
+ {
+ u32 length = sizeof( grottoChecks::g4_0 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g4_0[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '1' )
+ {
+ u32 length = sizeof( grottoChecks::g4_1 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g4_1[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '2' )
+ {
+ u32 length = sizeof( grottoChecks::g4_2 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g4_2[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '3' )
+ {
+ u32 length = sizeof( grottoChecks::g4_3 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g4_3[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else if ( tp::d_a_alink::checkStageName( stage::grottoStages[4] ) )
+ {
+ if ( state == '0' )
+ {
+ u32 length = sizeof( grottoChecks::g5_0 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g5_0[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ /*else if (state == '1')
+ {
+ u32 length = sizeof(grottoChecks::g5_1) / sizeof(u16);
+ for (u16 i = 0; i < length; i++)
+ {
+ if (checkID == grottoChecks::g5_1[i])
+ {
+ return true;
+ }
+ }
+ return false;
+ }*/
+ else if ( state == '2' )
+ {
+ u32 length = sizeof( grottoChecks::g5_2 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g5_2[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '3' )
+ {
+ u32 length = sizeof( grottoChecks::g5_3 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g5_3[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else if ( state == '4' )
+ {
+ u32 length = sizeof( grottoChecks::g5_4 ) / sizeof( u16 );
+ for ( u16 i = 0; i < length; i++ )
+ {
+ if ( checkID == grottoChecks::g5_4[i] )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+} // namespace mod \ No newline at end of file
diff --git a/source/controller.cpp b/source/controller.cpp
index 51b4d4e..08532c1 100644
--- a/source/controller.cpp
+++ b/source/controller.cpp
@@ -1,25 +1,26 @@
#include "controller.h"
-#include "defines.h"
#include <tp/m_Do_controller_pad.h>
+#include "defines.h"
+
namespace mod::controller
{
- bool checkForButtonInput(u32 buttonCombo)
- {
- return (tp::m_do_controller_pad::cpadInfo.buttonInput & buttonCombo) == buttonCombo;
- }
+ bool checkForButtonInput( u32 buttonCombo )
+ {
+ return ( tp::m_do_controller_pad::cpadInfo.buttonInput & buttonCombo ) == buttonCombo;
+ }
- bool checkForButtonInputSingleFrame(u32 buttonCombo)
- {
- tp::m_do_controller_pad::CPadInfo* PadInfo = &tp::m_do_controller_pad::cpadInfo;
- if ((PadInfo->buttonInput & buttonCombo) == buttonCombo)
- {
- if (PadInfo->buttonInputTrg & buttonCombo)
- {
- return true;
- }
- }
- return false;
- }
-} \ No newline at end of file
+ bool checkForButtonInputSingleFrame( u32 buttonCombo )
+ {
+ tp::m_do_controller_pad::CPadInfo* PadInfo = &tp::m_do_controller_pad::cpadInfo;
+ if ( ( PadInfo->buttonInput & buttonCombo ) == buttonCombo )
+ {
+ if ( PadInfo->buttonInputTrg & buttonCombo )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+} // namespace mod::controller \ No newline at end of file
diff --git a/source/cxx.cpp b/source/cxx.cpp
index e3e05cb..7052996 100644
--- a/source/cxx.cpp
+++ b/source/cxx.cpp
@@ -1,29 +1,29 @@
-#include "defines.h"
-
-#include <tp/m_Do_ext.h>
#include <tp/JKRExpHeap.h>
+#include <tp/m_Do_ext.h>
#include <cstring>
-void* operator new(size_t size)
+#include "defines.h"
+
+void* operator new( size_t size )
{
- void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
- void* NewPtr = tp::jkr_exp_heap::do_alloc_JKRExpHeap(ArchiveHeapPtr, size, 0x20);
- return memset(NewPtr, 0, size);
+ void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
+ void* NewPtr = tp::jkr_exp_heap::do_alloc_JKRExpHeap( ArchiveHeapPtr, size, 0x20 );
+ return memset( NewPtr, 0, size );
}
-void* operator new[](size_t size)
+void* operator new[]( size_t size )
{
- void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
- void* NewPtr = tp::jkr_exp_heap::do_alloc_JKRExpHeap(ArchiveHeapPtr, size, 0x20);
- return memset(NewPtr, 0, size);
+ void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
+ void* NewPtr = tp::jkr_exp_heap::do_alloc_JKRExpHeap( ArchiveHeapPtr, size, 0x20 );
+ return memset( NewPtr, 0, size );
}
-void operator delete(void* ptr)
+void operator delete( void* ptr )
{
- void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
- return tp::jkr_exp_heap::do_free_JKRExpHeap(ArchiveHeapPtr, ptr);
+ void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
+ return tp::jkr_exp_heap::do_free_JKRExpHeap( ArchiveHeapPtr, ptr );
}
-void operator delete[](void* ptr)
+void operator delete[]( void* ptr )
{
- void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
- return tp::jkr_exp_heap::do_free_JKRExpHeap(ArchiveHeapPtr, ptr);
+ void* ArchiveHeapPtr = tp::m_Do_ext::archiveHeap;
+ return tp::jkr_exp_heap::do_free_JKRExpHeap( ArchiveHeapPtr, ptr );
} \ No newline at end of file
diff --git a/source/eventListener.cpp b/source/eventListener.cpp
index 74ae241..074a931 100644
--- a/source/eventListener.cpp
+++ b/source/eventListener.cpp
@@ -1,80 +1,84 @@
-#include "defines.h"
#include "eventListener.h"
+#include <tp/JFWSystem.h>
#include <tp/d_com_inf_game.h>
#include <tp/d_kankyo.h>
-#include <tp/JFWSystem.h>
#include <cstdio>
#include <cstring>
+#include "defines.h"
+
namespace mod::event
{
- EventListener::EventListener()
- {
- sprintf(sysConsolePtr->consoleLine[20].line, "Event Listener Initialized.");
- }
+ EventListener::EventListener() { sprintf( sysConsolePtr->consoleLine[20].line, "Event Listener Initialized." ); }
- void EventListener::addLoadEvent(char* stage, u8 room, u8 spawn, u8 state, u8 eventid, EventFunction trigger, LoadEventAccuracy accuracy)
- {
- if(loadEventIndex < MAX_LOAD_EVENTS)
- {
- // Add the event to the array
- loadEvents[loadEventIndex] = {stage, room, spawn, state, eventid, trigger, accuracy};
+ void EventListener::addLoadEvent( char* stage,
+ u8 room,
+ u8 spawn,
+ u8 state,
+ u8 eventid,
+ EventFunction trigger,
+ LoadEventAccuracy accuracy )
+ {
+ if ( loadEventIndex < MAX_LOAD_EVENTS )
+ {
+ // Add the event to the array
+ loadEvents[loadEventIndex] = { stage, room, spawn, state, eventid, trigger, accuracy };
- loadEventIndex++;
- }
- }
+ loadEventIndex++;
+ }
+ }
- void EventListener::checkLoadEvents()
- {
- char* stage = gameInfo.nextStageVars.nextStage;
- u8 room = gameInfo.nextStageVars.nextRoom;
- u8 spawn = static_cast<u8>(gameInfo.nextStageVars.nextSpawnPoint);
- u8 state = gameInfo.nextStageVars.nextState;
- u8 eventid = gameInfo.eventSystem.currentEventID;
+ void EventListener::checkLoadEvents()
+ {
+ char* stage = gameInfo.nextStageVars.nextStage;
+ u8 room = gameInfo.nextStageVars.nextRoom;
+ u8 spawn = static_cast<u8>( gameInfo.nextStageVars.nextSpawnPoint );
+ u8 state = gameInfo.nextStageVars.nextState;
+ u8 eventid = gameInfo.eventSystem.currentEventID;
- for(u8 i = 0; i < loadEventIndex; i++)
- {
- LoadEvent e = loadEvents[i];
- if(strcmp(stage, e.Stage) == 0)
- {
- // Stage is minimum requirement
- if(e.Accuracy == LoadEventAccuracy::Stage)
- {
- e.Trigger();
- }
+ for ( u8 i = 0; i < loadEventIndex; i++ )
+ {
+ LoadEvent e = loadEvents[i];
+ if ( strcmp( stage, e.Stage ) == 0 )
+ {
+ // Stage is minimum requirement
+ if ( e.Accuracy == LoadEventAccuracy::Stage )
+ {
+ e.Trigger();
+ }
- if(room == e.Room || e.Room == 0xFF)
- {
- if(e.Accuracy == LoadEventAccuracy::Stage_Room)
- {
- e.Trigger();
- }
+ if ( room == e.Room || e.Room == 0xFF )
+ {
+ if ( e.Accuracy == LoadEventAccuracy::Stage_Room )
+ {
+ e.Trigger();
+ }
- if(spawn == e.Spawn || e.Spawn == 0xFF)
- {
- if(e.Accuracy == LoadEventAccuracy::Stage_Room_Spawn)
- {
- e.Trigger();
- }
+ if ( spawn == e.Spawn || e.Spawn == 0xFF )
+ {
+ if ( e.Accuracy == LoadEventAccuracy::Stage_Room_Spawn )
+ {
+ e.Trigger();
+ }
- if(state == e.State || e.State == 0xFF)
- {
- if(e.Accuracy == LoadEventAccuracy::Stage_Room_Spawn_State)
- {
- e.Trigger();
- }
+ if ( state == e.State || e.State == 0xFF )
+ {
+ if ( e.Accuracy == LoadEventAccuracy::Stage_Room_Spawn_State )
+ {
+ e.Trigger();
+ }
- if(eventid == e.Eventid)
- {
- // No accuracy check since it's already ::All
- e.Trigger();
- }
- }
- }
- }
- }
- }
- }
-} \ No newline at end of file
+ if ( eventid == e.Eventid )
+ {
+ // No accuracy check since it's already ::All
+ e.Trigger();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} // namespace mod::event \ No newline at end of file
diff --git a/source/game_patches.cpp b/source/game_patches.cpp
index 3c9df66..437bd95 100644
--- a/source/game_patches.cpp
+++ b/source/game_patches.cpp
@@ -1,1210 +1,1238 @@
#include "game_patches.h"
-#include "defines.h"
-#include "stage.h"
-#include "tools.h"
-#include "singleton.h"
-#include "items.h"
-#include "itemChecks.h"
-#include <tp/d_menu_collect.h>
-#include <tp/d_a_alink.h>
-#include <tp/d_save.h>
-#include <tp/d_item.h>
#include <tp/JFWSystem.h>
-#include <tp/d_com_inf_game.h>
-#include <tp/evt_control.h>
-#include <tp/d_stage.h>
+#include <tp/d_a_alink.h>
#include <tp/d_a_shop_item_static.h>
-#include <tp/d_item_data.h>
+#include <tp/d_com_inf_game.h>
#include <tp/d_item.h>
-#include <cstring>
+#include <tp/d_item_data.h>
+#include <tp/d_menu_collect.h>
+#include <tp/d_save.h>
+#include <tp/d_stage.h>
+#include <tp/evt_control.h>
+
#include <cstdio>
+#include <cstring>
+#include "defines.h"
+#include "itemChecks.h"
+#include "items.h"
+#include "singleton.h"
+#include "stage.h"
+#include "tools.h"
namespace mod::cutscene_skip
{
- /**
- * Runs when master sword CS is skipped
- */
- s32 onMasterSwordSkip(void* unk, s32 unk2)
- {
- game_patch::giveMasterSword();
- game_patch::giveMidna();
- game_patch::giveMidnaTransform();
-
- gameInfo.nextStageVars.nextSpawnPoint = 0x96;
-
- tools::triggerSaveLoad(stage::allStages[Stage_Sacred_Grove], 0x1, 0x96);
-
- // Call actual skip function
- return tp::evt_control::defaultSkipStb(unk, unk2);
- }
-}
+ /**
+ * Runs when master sword CS is skipped
+ */
+ s32 onMasterSwordSkip( void* unk, s32 unk2 )
+ {
+ game_patch::giveMasterSword();
+ game_patch::giveMidna();
+ game_patch::giveMidnaTransform();
+
+ gameInfo.nextStageVars.nextSpawnPoint = 0x96;
+
+ tools::triggerSaveLoad( stage::allStages[Stage_Sacred_Grove], 0x1, 0x96 );
+
+ // Call actual skip function
+ return tp::evt_control::defaultSkipStb( unk, unk2 );
+ }
+} // namespace mod::cutscene_skip
namespace mod::game_patch
{
-
- void assemblyOverwrites()
- {
- // Default to US/JP
- u32* enableCrashScreen = reinterpret_cast<u32*>(0x8000B8A4);
-
- // Get the addresses to overwrite
- #ifdef TP_US
- enableCrashScreen = reinterpret_cast<u32*>(0x8000B8A4);
- #elif defined TP_EU
- enableCrashScreen = reinterpret_cast<u32*>(0x8000B878);
- #elif defined TP_JP
- enableCrashScreen = reinterpret_cast<u32*>(0x8000B8A4);
- #endif
-
- // Perform the overwrites
-
- /* If the address is loaded into the cache before the overwrite is made,
- then the cache will need to be cleared after the overwrite */
-
- // Enable the crash screen
- *enableCrashScreen = 0x48000014; // b 0x14
- }
-
- void killLinkHouseSpider()
- {
- // Kill Skulltula at Link's house
- gameInfo.localAreaNodes.unk_0[0xA] |= 0x1;
- }
-
- void increaseClimbSpeed()
- {
- // Adjust Link's climbing speeds
- tp::d_a_alink::LadderVars* LadderVars = &tp::d_a_alink::ladderVars;
- LadderVars->ladderClimbInitSpeed = 1.8;
- LadderVars->ladderReachTopClimbUpSpeed = 1.765;
- LadderVars->ladderTopStartClimbDownSpeed = 1.8;
- LadderVars->ladderBottomGetOffSpeed = 1.8;
- LadderVars->ladderClimbSpeed = 1.575;
- LadderVars->wallClimbHorizontalSpeed = 2.0;
- LadderVars->wallClimbVerticalSpeed = 1.875;
- }
-
- void removeIBLimit()
- {
- // li 0
- u32 li = 0x38600000;
- // b +4C
- u32 b = 0x4800004C;
-
- // CheckHeavyState overwrite
- u32 checkHeavyStateOnAddress = reinterpret_cast<u32>(&tp::d_a_alink::checkHeavyStateOn);
- *reinterpret_cast<u32*>(checkHeavyStateOnAddress + 0x84) = li;
-
- u32 setStickDataAddress = reinterpret_cast<u32>(&tp::d_a_alink::setStickData);
- *reinterpret_cast<u32*>(setStickDataAddress + 0x5FC) = b;
- }
-
-
- void increaseWalletSize()
- {
- // li
- u32 li = 0x38600000;
- u32 cmpwi = 0x2c000000;
-
- u32 getRupeeMaxAddress = reinterpret_cast<u32>(&tp::d_save::getRupeeMax);
- u32 setWalletMaxNumAddress = reinterpret_cast<u32>(&tp::d_menu_collect::setWalletMaxNum);
-
- // 300 -> 1000
- *reinterpret_cast<u32*>(getRupeeMaxAddress + 0x30) = li | 0x000003E8;
-
- // 600 -> 5000
- *reinterpret_cast<u32*>(getRupeeMaxAddress + 0x38) = li | 0x00001388;
-
- // 1000 -> 9999 (> 4 digit not good)
- *reinterpret_cast<u32*>(getRupeeMaxAddress + 0x40) = li | 0x0000270F;
-
- // 600 -> 5000
- *reinterpret_cast<u32*>(setWalletMaxNumAddress + 0x18) = cmpwi | 0x00001388;
-
- // 300 -> 1000
- *reinterpret_cast<u32*>(setWalletMaxNumAddress + 0x24) = cmpwi | 0x000003E8;
-
- // 1000 -> 9999
- *reinterpret_cast<u32*>(setWalletMaxNumAddress + 0x30) = cmpwi | 0x0000270F;
- }
-
- void skipSewers()
- {
- if (Singleton::getInstance()->isSewerSkipEnabled == 1)
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Skipping Sewers");
-
- // Set sewers flags
- giveSense();
-
- // We should be wolf
- setFirstTimeWolf();
-
- // Set sewers flags (escaped cell cs, Midna intro cs, unchained wolf link, zelda cutscene, First trip to Sewers Done)
- gameInfo.scratchPad.eventBits[0x05] |= 0x7A;
-
- // Set more sewers flags (talk to midna after escaping cell in sewers, listened to first guard in sewers)
- gameInfo.scratchPad.eventBits[0x1A] |= 0x82;
-
- // Set more sewers flags (spawned into sewers twilight as wolf)
- gameInfo.scratchPad.eventBits[0x4D] |= 0x8;
-
- gameInfo.scratchPad.equipedItems.sword = 0x3F;
-
- // Load back to Ordon Spring
- tools::triggerSaveLoad(stage::allStages[Stage_Ordon_Spring], 0x1, 0x3, 0x4);
- }
- giveMidna();
- gameInfo.scratchPad.equipedItems.sword = 0x3F;
- }
-
- void setFieldBits()
- {
- if ((Singleton::getInstance()->isGateUnlockEnabled == 1 && (gameInfo.localAreaNodes.unk_0[0x8] & 0x10) == 0) || tools::checkItemFlag(ItemFlags::Gate_Keys))
- {
- gameInfo.unk_979[0x7] |= 0x6;//2 = lanyru gate 4 = eldin gorge gate
- }
- }
-
- void skipGoats()
- {
- if (tp::d_com_inf_game::current_state == 0x63)
- {//goats 1
- if (Singleton::getInstance()->isGoatSkipEnabled == 1)
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Skipping Goats 1");
-
- // Load back to Ordon ranch after goats 1
- tools::triggerSaveLoad(stage::allStages[Stage_Ordon_Ranch], 0x0, 0x4, 0x7);
- }
- }
- else if (tp::d_com_inf_game::current_state == 0x39)
- {//goats 2
- if (Singleton::getInstance()->isGoatSkipEnabled == 1)
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Skipping Goats 2");
-
- gameInfo.localAreaNodes.unk_0[0xE] |= 0x2;//set flag for Fado text before goats
- gameInfo.localAreaNodes.unk_0[0x9] |= 0x60;//set flag for day 3 intro cs and goats 2 done
- //gameInfo.localAreaNodes.unk_0[0x9] |= 0x40;//set flag for day 3 intro cs and goats 2 done
-
-
- // Load back to Ordon village
- tools::triggerSaveLoad(stage::allStages[Stage_Ordon_Village], 0x0, 0x19, 0x8);
- }
- }
- }
-
- void fixFTState()
- {
- if (Singleton::getInstance()->hasFTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x6] &= ~0x2; //unset story flag
- if ((gameInfo.scratchPad.allAreaNodes.Forest_Temple.unk_0[0x12] & 0x10) == 0)
- {
- gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.ooccooGotten = 0b0;
- }
- }
- }
-
- void fixGMState()
- {
- if (Singleton::getInstance()->hasGMBeenBeaten == 1 || Singleton::getInstance()->isGMStoryPatch == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x7] &= ~0x1; //unset story flag
- if ((gameInfo.scratchPad.allAreaNodes.Goron_Mines.unk_0[0xE] & 0x2) == 0)
- {
- gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.ooccooGotten = 0b0;
- }
- }
- }
-
- void fixLBTState()
- {
- if (Singleton::getInstance()->hasLBTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x9] &= ~0x4; //unset story flag
- if ((gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.unk_0[0x11] & 0x80) == 0)
- {
- gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.ooccooGotten = 0b0;
- }
- }
- }
-
- void fixAGState()
- {
- if (Singleton::getInstance()->hasAGBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x20] &= ~0x10; //unset story flag
- if ((gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.unk_0[0x17] & 0x20) == 0)
- {
- gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.ooccooGotten = 0b0;
- }
- }
- }
-
- void fixSPRState()
- {
- if (Singleton::getInstance()->hasSPRBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x20] &= ~0x8; //unset story flag
- if ((gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.unk_0[0x1] & 0x1) == 0)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.ooccooGotten = 0b0;
- }
- }
- }
-
- void fixToTState()
- {
- if (Singleton::getInstance()->hasToTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x20] &= ~0x4; //unset story flag
- if ((gameInfo.scratchPad.allAreaNodes.Temple_of_Time.unk_0[0x4] & 0x80) == 0)
- {
- gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.ooccooGotten = 0b0;
- }
- }
- }
-
- void fixCiTSState()
- {
- if (Singleton::getInstance()->hasCiTSBeenBeaten == 1 || Singleton::getInstance()->isEarlyPoTEnabled == 1)
- {
- gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten = 0b0; //unset boss flag
- gameInfo.scratchPad.eventBits[0x20] &= ~0x2; //unset story flag
- }
- if (Singleton::getInstance()->hasCiTSOoccoo == 0)
- {
- gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.ooccooGotten = 0b0;
- }
- }
-
- void setFTDungeonFlag()
- {
- if (Singleton::getInstance()->hasFTBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasFTBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasFTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x6] |= 0x2; //set story flag
- }
- }
-
- void setGMDungeonFlag()
- {
- if (Singleton::getInstance()->hasGMBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasGMBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasGMBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x7] |= 0x1; //set story flag
- }
- else if (Singleton::getInstance()->isGMStoryPatch == 1)
- {
- gameInfo.scratchPad.eventBits[0x7] |= 0x1; //set story flag
- }
- }
-
- void setGMBossFlag()
- {
- if (Singleton::getInstance()->hasGMBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void setLakeDungeonFlags()
- {
- if (Singleton::getInstance()->hasLBTBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasLBTBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasLBTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x9] |= 0x4; //set story flag
- }
-
- if (Singleton::getInstance()->hasCiTSBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasCiTSBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasCiTSBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x20] |= 0x2; //set story flag
- }
- else if (Singleton::getInstance()->isEarlyPoTEnabled == 1)
- {
- gameInfo.scratchPad.eventBits[0x20] |= 0x2; //set story flag
- }
- }
-
- void setLBTBossFlag()
- {
- if (Singleton::getInstance()->hasLBTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void setAGDungeonFlag()
- {
- if (Singleton::getInstance()->hasAGBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasAGBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasAGBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x20] |= 0x10; //set story flag
- }
- }
-
- void setAGBossFlag()
- {
- if (Singleton::getInstance()->hasAGBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void setSPRDungeonFlag()
- {
- if (Singleton::getInstance()->hasSPRBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasSPRBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasSPRBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x20] |= 0x8; //set story flag
- }
- }
-
- void setSPRBossFlag()
- {
- if (Singleton::getInstance()->hasSPRBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void setToTDungeonFlag()
- {
- if (Singleton::getInstance()->hasToTBeenBeaten == 0 && gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten == 0b1)
- {
- Singleton::getInstance()->hasToTBeenBeaten = 1;
- }
- else if (Singleton::getInstance()->hasToTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten = 0b1; //set boss flag
- gameInfo.scratchPad.eventBits[0x20] |= 0x4; //set story flag
- }
-
- if (Singleton::getInstance()->isEarlyToTEnabled == 1)
- {
- gameInfo.nextStageVars.nextState = 0x2;
- }
- }
-
- void setToTBossFlag()
- {
- if (Singleton::getInstance()->hasToTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void setCiTSBossFlag()
- {
- if (Singleton::getInstance()->hasCiTSBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void setBublinState()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "state was not 1");
- if (gameInfo.nextStageVars.nextRoom != 3)
- {
- if ((gameInfo.scratchPad.eventBits[0xB] & 0x40) != 0)
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Setting Bublin State");
- // reload bublin camp as state 3
- //tools::triggerSaveLoad(gameInfo.nextStageVars.nextStage, gameInfo.nextStageVars.nextRoom, gameInfo.nextStageVars.nextSpawnPoint, a);
- gameInfo.nextStageVars.nextState = 0x3;
- }
- else
- {
- return;
- }
- }
- }
-
- void setGroveFlags()
- {
- if (Singleton::getInstance()->isMSPuzzleSkipEnabled == 1 && (gameInfo.localAreaNodes.unk_0[0xB] & 0x4) == 0)
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "Skipping MS Puzzle");
- gameInfo.localAreaNodes.unk_0[0xB] |= 0x4;//skip Sacred Grove Puzzle
- }
- }
-
- void checkBossKeysey()
- {
- if (Singleton::getInstance()->isBossKeyseyEnabled == 1)
- {
- tp::d_com_inf_game::AllAreaNodes* dungeonAreaNodesPtr = &gameInfo.scratchPad.allAreaNodes;
- dungeonAreaNodesPtr->Forest_Temple.dungeon.bigKeyGotten = 0b1; //unlock Diababa Door
- dungeonAreaNodesPtr->Goron_Mines.dungeon.bigKeyGotten = 0b1; //unlock Fryus Door
- dungeonAreaNodesPtr->Lakebed_Temple.dungeon.bigKeyGotten = 0b1; //unlock Morpheel Door
- dungeonAreaNodesPtr->Arbiters_Grounds.dungeon.bigKeyGotten = 0b1; //unlock Stallord Door
- dungeonAreaNodesPtr->Snowpeak_Ruins.dungeon.bigKeyGotten = 0b1; //unlock Blizzetta Door
- dungeonAreaNodesPtr->Temple_of_Time.dungeon.bigKeyGotten = 0b1; //unlock Armaghoma Door
- dungeonAreaNodesPtr->City_in_the_Sky.dungeon.bigKeyGotten = 0b1; //unlock Argorok Door
- dungeonAreaNodesPtr->Palace_of_Twilight.dungeon.bigKeyGotten = 0b1; //unlock Zant Door
- dungeonAreaNodesPtr->Hyrule_Castle.dungeon.bigKeyGotten = 0b1; //unlock Ganon Door
- }
- }
-
- /* Still in the works
- void unlockDungeonDoors()
- {
- if (Singleton::getInstance()->isMSPuzzleSkipEnabled == 1 && (gameInfo.localAreaNodes.unk_0[0xB] & 0x4) == 0)
- {
- //Forest Temple
- allAreaNodesPtr->Forest_Temple.unk_0[0xA] |= 0x8; //unlock Second Monkey Door
- allAreaNodesPtr->Forest_Temple.unk_0[0xB] |= 0x80; //unlock Gale Puzzle Monkey Door
-
- //Goron Mines
-
-
- //Lakebed Temple
-
- //Arbiter's Grounds
-
- //Snowpeak Ruins
-
- //Temple of Time
-
- //City in the Sky
-
- //Palace of Twilight
-
- //Hyrule Castle
- }
- }*/
-
- void earlyCiTS()
- {
- if (Singleton::getInstance()->isEarlyCiTSEnabled == 1)
- {
- gameInfo.scratchPad.eventBits[0x3B] |= 0x8; //repairs Cannon at lake
- }
- }
-
- void earlyDesert()
- {
- if (Singleton::getInstance()->isEarlyDesertEnabled)
- {
- gameInfo.scratchPad.eventBits[0x26] |= 0x80; //Allow you to use the cannon in the desert
- }
- }
-
- void accessDesert()
- {
- if (tools::checkItemFlag(ItemFlags::Shadow_Crystal))
- {
- return;
- }
- else
- {
- strncpy(gameInfo.nextStageVars.nextStage, stage::allStages[Stage_Lake_Hylia], sizeof(gameInfo.nextStageVars.nextStage) - 1);
- gameInfo.nextStageVars.nextRoom = 0x0;
- gameInfo.nextStageVars.nextSpawnPoint = 0x4D;
- tp::d_item::execItemGet(0x2);
- }
- }
-
- void breakBarrier()
- {
- if (Singleton::getInstance()->isEarlyHCEnabled == 1 && ((gameInfo.scratchPad.eventBits[0x1E] & 0x8) != 0))
- {
- gameInfo.scratchPad.eventBits[0x42] |= 0x8;
- }
- }
-
- void setEscortState()
- {
- if ((gameInfo.scratchPad.eventBits[0x8] & 0x40) == 0 && Singleton::getInstance()->isCartEscortSkipEnabled == 0 && tools::checkItemFlag(ItemFlags::Heros_Bow) && tools::checkItemFlag(ItemFlags::Boomerang) && gameInfo.scratchPad.clearedTwilights.Lanayru == 0b1)
- {
- gameInfo.nextStageVars.nextState = 0x8;
- gameInfo.nextStageVars.nextSpawnPoint = 0x14;
- }
- }
-
- void setFirstTimeWolf()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Set first time wolf");
-
- gameInfo.scratchPad.unk_1F[0x11] |= 1;
- }
-
- void setLanayruWolf()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Set wolf");
-
- if (gameInfo.scratchPad.form == 0 && !tools::checkItemFlag(ItemFlags::Shadow_Crystal) && !tools::checkItemFlag(ItemFlags::Vessel_Of_Light_Lanayru))
- {
-
- strncpy(gameInfo.nextStageVars.nextStage, stage::allStages[Stage_Hyrule_Field], sizeof(gameInfo.nextStageVars.nextStage) - 1);
- gameInfo.nextStageVars.nextRoom = 0x9;
- gameInfo.nextStageVars.nextSpawnPoint = 0xA;
- }
- else
- {
- return;
- }
- }
-
- void setHuman()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Set human");
-
- gameInfo.scratchPad.form = 0;
- }
-
- void setWolf()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Set wolf");
-
- gameInfo.scratchPad.form = 1;
- }
-
- void giveSense()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Give Senses");
-
- // Set the Sense (sewers) flag
- gameInfo.scratchPad.eventBits[0x43] |= 0x8;
- }
-
- void giveEpona()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Give Epona");
-
- // Set Epona tamed
- gameInfo.scratchPad.eventBits[0x6] |= 0x1;
- }
-
- void giveMasterSword()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Give MasterSword");
-
- // Set Master sword inventory flag
- tools::setItemFlag(ItemFlags::Master_Sword);
-
- // Equip Master sword (0x49 / 73)
- gameInfo.scratchPad.equipedItems.sword = 0x49;
- }
-
- void giveMidna()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Give Midna (sewers)");
-
- // Set Midna sewers flag
- gameInfo.scratchPad.eventBits[0xC] |= 0x10;
- }
-
- void giveMidnaTransform()
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> Give Midna Transform");
-
- // Set Midna Transform flag (gets set at Master Sword)
- gameInfo.scratchPad.eventBits[0xD] |= 0x4;
- }
-
- void handleMaloShop()
- {
- tp::d_com_inf_game::AreaNodes* maloLocalAreaNodesPtr = &gameInfo.localAreaNodes;
- //hylian shield check
- if ((gameInfo.scratchPad.eventBits[0xA] & 0x8) != 0)//KB1 done
- {
- if (!tools::checkItemFlag(ItemFlags::Null_D9))
- {
- strcpy(sysConsolePtr->consoleLine[20].line, "-> selling hylian shield");
- maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x2;//unset flag for hylian shield bought
- maloLocalAreaNodesPtr->unk_0[0x13] |= 0x40;//set flag for hylian shield on counter
- maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x40;//unset flag for red potion on right
- }
- else
- {
- maloLocalAreaNodesPtr->unk_0[0xC] |= 0x2;//set flag for hylian shield bought
- maloLocalAreaNodesPtr->unk_0[0x13] &= ~0x40;//unset flag for hylian shield on counter
- }
- }
-
- //hawkeye check
- if ((gameInfo.scratchPad.eventBits[0x9] & 0x40) != 0)//Bow mini-game started
- {
- if (!tools::checkItemFlag(ItemFlags::Null_D8))
- {
- maloLocalAreaNodesPtr->unk_0[0xC] |= 0x40;//set flag for hawkeye on counter
- maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x20;//unset flag for arrows on counter (else causes crash)
- maloLocalAreaNodesPtr->unk_0[0xD] &= ~0x8;//unset flag for hawkeye sold out
- maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x10;//unset flag for red potion on left
- }
- else
- {
- maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x40;//unset flag for hawkeye on counter
- if (tools::checkItemFlag(ItemFlags::Null_D9))
- {
- maloLocalAreaNodesPtr->unk_0[0xC] |= 0x20;//set flag for arrows on counter
- maloLocalAreaNodesPtr->unk_0[0x15] |= 0x40;//set flag for red potion on right
- maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x10;//unset flag for red potion on left
- maloLocalAreaNodesPtr->unk_0[0xD] |= 0x8;//set flag for hawkeye sold out
- }
- else
- {
- maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x20;//unset flag for arrows on counter
- maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x40;//unset flag for red potion on right
- maloLocalAreaNodesPtr->unk_0[0x15] |= 0x10;//set flag for red potion on left
- maloLocalAreaNodesPtr->unk_0[0xD] &= ~0x8;//unset flag for hawkeye sold out
-
- }
- }
- }
- }
-
- void allowFaronEscape()
- {
- if (Singleton::getInstance()->isForestEscapeEnabled == 0)
- {
- if (((gameInfo.scratchPad.eventBits[0x6] & 0x2) != 0) ||
- (gameInfo.scratchPad.eventBits[0x6] & 0x10) == 0)
- {
- return;
- }
- else
- {
- gameInfo.nextStageVars.nextState = 0x0;
- }
- }
- }
-
- void setLanternFlag()
- {
- gameInfo.scratchPad.eventBits[0xF] |= 0x1;/*got lantern from Coro*/
- }
-
- void skipMDHCS()
- {
- if (Singleton::getInstance()->isMDHSkipEnabled == 1)
- {
- strncpy(gameInfo.nextStageVars.nextStage, stage::allStages[Stage_Lake_Hylia], sizeof(gameInfo.nextStageVars.nextStage) - 1);
- gameInfo.nextStageVars.nextSpawnPoint = 0x7;
- gameInfo.nextStageVars.nextRoom = 0x0;
-
- }
- }
-
- void skipMDH()
- {
- if (Singleton::getInstance()->isMDHSkipEnabled == 1)
- {
- //set MDH flags
- gameInfo.scratchPad.eventBits[0xC] |= 0x1; //MDH Started
- gameInfo.scratchPad.eventBits[0x1E] |= 0x8; //MDH Completed
- }
- }
-
- void fixFTBossMusic()
- {
- if (Singleton::getInstance()->isForestEscapeEnabled == 1 && gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten == 0b0 && Singleton::getInstance()->diababaMusicFixed == 0)
- {
- gameInfo.scratchPad.eventBits[0x6] &= ~0x2;
- Singleton::getInstance()->diababaMusicFixed = 1;
- }
-
- if (Singleton::getInstance()->hasFTBeenBeaten == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten = 0b1; //set boss flag
- }
- }
-
- void skipTextAndCS()
- {
- //Set Scratchpad Pointer
- tp::d_com_inf_game::ScratchPad* scratchPadPtr = &gameInfo.scratchPad;
-
- //Set Letters Pointer
- tp::d_com_inf_game::Letters* LettersPtr = &scratchPadPtr->recivedLetters;
- LettersPtr->From_Wife_of_Yeto = 0b1;
- LettersPtr->Update = 0b1;
- LettersPtr->Now_open_for_business = 0b1;
- LettersPtr->Agithas_Dream = 0b1;
- LettersPtr->Hey_kid = 0b1;
- LettersPtr->Challenge_for_you = 0b1;
- LettersPtr->They_came_so_quickly = 0b1;
- LettersPtr->Heroes_come_together = 0b1;
- LettersPtr->URGENT_Bomb_arrows = 0b1;
- LettersPtr->Rare_item_in_stock = 0b1;
- LettersPtr->Good_stuff_inside = 0b1;
- LettersPtr->URGENT_NOTICE = 0b1;
- LettersPtr->Post_office_notice = 0b1;
- LettersPtr->Dear_Adventurer_1 = 0b1;
- LettersPtr->Dear_Adventurer_2 = 0b1;
- LettersPtr->About_Ilias_memory = 0b1;
-
- //Set Event Bits
- u8* eventBitsPtr = &scratchPadPtr->eventBits[0];
- eventBitsPtr[0x1] |= 0x40; //talked to Yeto First Time
- eventBitsPtr[0x3] |= 0x90; //Jaggle Calls out to link, talked to squirrel as wolf in Ordon
- eventBitsPtr[0x5] |= 0x10; //unchain wolf link
- eventBitsPtr[0x6] |= 0xC0; //CS after beating Ordon Shadow, cs after entering Faron twilight
- eventBitsPtr[0x7] |= 0x20; //Talked to Bo outside his house
- eventBitsPtr[0xB] |= 0x20; //Talked to Yeta First Time
- eventBitsPtr[0x10] |= 0x2; //Talked to Jaggle after climbing vines
- eventBitsPtr[0x5E] |= 0x10; //Midna Text After Beating Forest Temple
- eventBitsPtr[0x40] |= 0x8; //have been to desert (prevents cannon warp crash)
- eventBitsPtr[0x1B] |= 0x78; //skip the monkey escort
- eventBitsPtr[0x1D] = 0x40; //fight bublin after Fyer
- eventBitsPtr[0x22] |= 0x1; //Plumm initial CS watched
- eventBitsPtr[0x26] |= 0x2; //Talked to Yeto on Snowpeak
- eventBitsPtr[0x28] |= 0x40; //Used Ooccoo for the First Time
- eventBitsPtr[0x37] |= 0x4; // Postman Twilight Text
- eventBitsPtr[0x38] |= 0x6; //Enter Hena Cabin CS
- eventBitsPtr[0x3A] |= 0x1; //Talked to Ralis
- eventBitsPtr[0x42] |= 0x1; //Watched post ToT Ooccoo CS
- eventBitsPtr[0x45] |= 0x8; //Postman Letters Text
- eventBitsPtr[0x4A] |= 0x10; //Talo Cage CS
- eventBitsPtr[0x3E] |= 0x2; //city OoCCoo CS watched
- eventBitsPtr[0x59] |= 0x40; // Postman Met
- eventBitsPtr[0x5D] |= 0x40; //Midna text after Kagorok FLight
-
-
- //Set Area Node Flags
- tp::d_com_inf_game::AllAreaNodes* allAreaNodesPtr = &scratchPadPtr->allAreaNodes;
-
- allAreaNodesPtr->Ordon.unk_0[0x9] |= 0xAA; //exit shield house CS watched, day 3 intro CS, bee nest CS, Ranch first time CS
- allAreaNodesPtr->Ordon.unk_0[0xA] |= 0xF; //Ilia spring CS, Ordon Village CS
- allAreaNodesPtr->Ordon.unk_0[0xD] |= 0x82; //Approach Faron Twilight CS, Shield house intro cs
- allAreaNodesPtr->Ordon.unk_0[0xE] |= 0x4; //Midna CS after watching Bo and Jaggle Talk about shield
- allAreaNodesPtr->Ordon.unk_0[0xF] |= 0xC; //rusl talking to wife CS
- allAreaNodesPtr->Ordon.unk_0[0x17] |= 0x80; //enter village as wolf CS
-
- allAreaNodesPtr->Sewers.unk_0[0x8] |= 0x38; //wake up in Jail CS, text after first gate, text after rooftops
- allAreaNodesPtr->Sewers.unk_0[0x9] |= 0x18; //midna cs after digging out, midna intro cs
- allAreaNodesPtr->Sewers.unk_0[0xA] |= 0x41; //zelda tower intro cs, outside top door intro cs
- allAreaNodesPtr->Sewers.unk_0[0xB] |= 0x38; //other side of fence cs, top of stairway cs watched, stairway intro cs
- allAreaNodesPtr->Sewers.unk_0[0xF] |= 0x11; //midna cs after digging out watched, midna text when approaching first rooftop guard
-
- allAreaNodesPtr->Eldin.unk_0[0x9] |= 0x40;//goron mines DM cs
- allAreaNodesPtr->Eldin.unk_0[0x14] |= 1;//give midna jumps for top of sanctuary
- allAreaNodesPtr->Eldin.unk_0[0x10] |= 0x10;//skip Graveyard CS
- allAreaNodesPtr->Eldin.unk_0[0x11] |= 0x8;//midna text after meteor
- allAreaNodesPtr->Eldin.unk_0[0x13] |= 0x20;//skip Kak CS
-
- allAreaNodesPtr->Lanayru.unk_0[0xB] |= 0x81;//Zora domain frozen CS, talked to reluta
- allAreaNodesPtr->Lanayru.unk_0[0xC] |= 0x1;//midna text after jumping to lake from bridge
- allAreaNodesPtr->Lanayru.unk_0[0xD] |= 0x10;//ZD exit CS
- allAreaNodesPtr->Lanayru.unk_0[0xE] |= 0x20;//midna text after kagorok CS trigger
- allAreaNodesPtr->Lanayru.unk_0[0x12] |= 0x40;//midna text after frozen zd
- allAreaNodesPtr->Lanayru.unk_0[0x16] |= 0x80;//watched Ooccoo CiTS CS
-
- allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x60; //cutscene before eldin twilight and Lanayru twilight
- allAreaNodesPtr->Hyrule_Field.unk_0[0xD] |= 0x80; //midna text after warping gorge bridge
- allAreaNodesPtr->Hyrule_Field.unk_0[0xF] |= 0xB; //cutscene for Gorge Bridge Watched, Ilia Scent CS, midna text after lanayru field cs
- allAreaNodesPtr->Hyrule_Field.unk_0[0xE] |= 0x20; //cutscene for entering Field Watched
- allAreaNodesPtr->Hyrule_Field.unk_0[0x8] |= 0x81; //Midna text for warping the bridge, lanayru field CS
- allAreaNodesPtr->Hyrule_Field.unk_0[0x9] |= 0x9; //cs before kak, watched CS of Eldin Bridge returning
- allAreaNodesPtr->Hyrule_Field.unk_0[0x16] |= 0x13; //midna text after entering eldin twilight, midna text after entering Lanayru twilight, midna text before eldin twilight, midna text after eldin twilight
- allAreaNodesPtr->Hyrule_Field.unk_0[0x17] |= 0x10; //youth scent CS
-
- allAreaNodesPtr->Sacred_Grove.unk_0[0x8] |= 0x38; //lost woods intro cs, human block cs, midna text after human block
-
- allAreaNodesPtr->Snowpeak.unk_0[0x8] |= 0x4; //Mountiain top CS
- allAreaNodesPtr->Snowpeak.unk_0[0xB] |= 0x3; //Snowpeak Entrance CS, midna text in front of SPR
-
- allAreaNodesPtr->Castle_Town.unk_0[0xA] |= 0x4; //STAR Tent CS
- allAreaNodesPtr->Castle_Town.unk_0[0xF] |= 0x4; //Jovani House CS
-
- allAreaNodesPtr->Gerudo_Desert.unk_0[0x13] |= 0x40;//watched the CS when entering the desert
- allAreaNodesPtr->Gerudo_Desert.unk_0[0xA] |= 0x10;//Mirror Chamber Intro CS
-
- allAreaNodesPtr->Forest_Temple.unk_0[0x8] |= 0x61; //set Midna Text for Ook Bridge Broken, Boomerang, and freeing first monkey
- allAreaNodesPtr->Forest_Temple.unk_0[0x9] |= 0x40; //Ook Bridge Broken
- allAreaNodesPtr->Forest_Temple.unk_0[0xA] |= 0x3; //Boko bridge CS, one bridge CS
- allAreaNodesPtr->Forest_Temple.unk_0[0xE] |= 0x22; //Worm Bridge CS, second monkey CS
- allAreaNodesPtr->Forest_Temple.unk_0[0xF] |= 0xE; //Midna text for pre-diababa room and open room monkey, Big Baba CS
- allAreaNodesPtr->Forest_Temple.unk_0[0x10] |= 0x14; //Midna text for compass, eat open area bridge CS
- allAreaNodesPtr->Forest_Temple.unk_0[0x16] |= 0x2; //Entrance CS watched
-
- allAreaNodesPtr->Goron_Mines.unk_0[0x8] |= 0x1F; //upper magnet CS, first room switch 3 cs, first room switch 2 cs, outside bridge cs, crystal switch bridge cs
- allAreaNodesPtr->Goron_Mines.unk_0[0x9] |= 0x20; // bottom magnet cs
- allAreaNodesPtr->Goron_Mines.unk_0[0xD] |= 0x80; //outside magnet cs
- allAreaNodesPtr->Goron_Mines.unk_0[0xE] |= 0x30; //enter tall room cs
- allAreaNodesPtr->Goron_Mines.unk_0[0xF] |= 0x20; //open room CS
- allAreaNodesPtr->Goron_Mines.unk_0[0x10] |= 0xCC; //lava slug room cs, outside area beamos wall cs, second magnet in crystal switch cs, crystal switch room gate
- allAreaNodesPtr->Goron_Mines.unk_0[0x11] |= 0xB8; //opening cs, first room gate cs, first room switch 1 cs, water room magnet cs
- allAreaNodesPtr->Goron_Mines.unk_0[0x17] |= 0xF; //lava slug room cs watched, lava slug room flag, tall room CS flags
-
- allAreaNodesPtr->Lakebed_Temple.unk_0[0x8] |= 0x2; //stalactite midna text
- allAreaNodesPtr->Lakebed_Temple.unk_0[0xF] |= 0x3; //one gear room spinning cs, two gear room spinning cs
- allAreaNodesPtr->Lakebed_Temple.unk_0[0x14] |= 0x7; //main room cs, front bridge cs, opening cs
- allAreaNodesPtr->Lakebed_Temple.unk_0[0x15] |= 0x20; //staircase turn CS
- allAreaNodesPtr->Lakebed_Temple.unk_0[0x16] |= 0x8; // chu worm cs watched
-
- allAreaNodesPtr->Arbiters_Grounds.unk_0[0xB] |= 0x20; //spinner wall cs
- allAreaNodesPtr->Arbiters_Grounds.unk_0[0xE] |= 0x10; //opening CS
- allAreaNodesPtr->Arbiters_Grounds.unk_0[0x12] |= 0x8; //cs after raising rails
-
- allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x10] |= 0x10; //enter cannonball room cs
- allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x14] |= 0x41; //entrance cs, midna text after bedroom key
- allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x15] |= 0x2A; //freezard tower cs, enter NE room cs watched, East Courtyard Dig CS
- allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x16] |= 0x28; //midna text after cheese and pumpkin
-
- allAreaNodesPtr->Temple_of_Time.unk_0[0x8] |= 0x80; //Midna text about missing statue
- allAreaNodesPtr->Temple_of_Time.unk_0[0x9] |= 0x3C; //scales cs, entrance cs, scales move cs
- allAreaNodesPtr->Temple_of_Time.unk_0[0xA] |= 0x8; //statue move cs watched
- allAreaNodesPtr->Temple_of_Time.unk_0[0xF] |= 0x8; //gate outside darknut cs
- allAreaNodesPtr->Temple_of_Time.unk_0[0x12] |= 0xEE; //first room switch cs, 8f hall switch cs, before darknut gate open cs, elevator room switches cs, 3F hall switch cs, 2F hall switch cs
- allAreaNodesPtr->Temple_of_Time.unk_0[0x14] |= 0x4; //darknut room gate open cs
-
- allAreaNodesPtr->City_in_the_Sky.unk_0[0xC] |= 0xF; //fan tower cs, room before aerolfos, first room exit cs, entrance cs
- allAreaNodesPtr->City_in_the_Sky.unk_0[0xD] |= 0x6; // west bridge extended cs, east bridge extended cs
-
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0x9] |= 0x4; //Phantom zant 1 cs watched
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0xB] |= 0x2; //Entrance CS watched
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0xC] |= 0x82; //Midna Text when west hand seals sol, Light Sword CS
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0xD] |= 0x1; //Midna text after forced transform
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0xE] |= 0xB0; //Midna text after west hand drops sol, midna text about transformed twili, midna text after post zant save
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0xF] |= 0xC0; //Midna text after light sword, midna text after west sol in slot
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0x12] |= 0x4; // midna text after re-entering west after sol stolen
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0x13] |= 0x2; //midna text after entrance cs
- allAreaNodesPtr->Palace_of_Twilight.unk_0[0x16] |= 0x10; //watched EW 2nd room stairs CS
-
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x9] |= 0x1; //graveyard entrance cs
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x11] |= 0xC; //east wing cs
- allAreaNodesPtr->Hyrule_Castle.unk_0[0xe] |= 0x1; //midna text after outside gale
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x10] |= 0x24; //entrance cs, chandelier room east cs watched
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x13] |= 0x40; // Darknuts room CS
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x14] |= 0xB; //Midna text post KB4, lizalfos Room CS, midna text after graveyard SK
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x16] |= 0x1; //lone darknut room se torch cs
- allAreaNodesPtr->Hyrule_Castle.unk_0[0x17] |= 0x80; //lone darknut room me torch watched
-
- //Set Local Area Node flags
- allAreaNodesPtr->Faron.unk_0[0x8] = 0xFB;//give midna jumps in mist area
- allAreaNodesPtr->Faron.unk_0[0xC] |= 0x90;//set flag for midna to think you followed the monkey in the mist, trill lets you shop
- allAreaNodesPtr->Faron.unk_0[0x12] |= 0x4;//mark read the midna text when you warp to N Faron for bridge
- allAreaNodesPtr->Faron.unk_0[0xF] |= 0x8;//set flag for midna text after twilight
- allAreaNodesPtr->Faron.unk_0[0xE] |= 0x9;//cs after entering Faron,spring cs with spirit
- allAreaNodesPtr->Faron.unk_0[0x17] |= 0xC0;//kill bugs in Coro's House
-
-
- //Apply Overrides for custom chests
- gameInfo.scratchPad.eventBits[0x22] |= 0x4;/*Got Ilia's Charm from Impaz*/
- gameInfo.scratchPad.eventBits[0x49] |= 0x2;/*Bought Slingshot from Sera*/
-
- //Apply Randomizer Options
- checkBossKeysey();
- earlyCiTS();
- earlyDesert();
-
- if (Singleton::getInstance()->isEarlyToTEnabled == 1)
- {
- gameInfo.scratchPad.allAreaNodes.Sacred_Grove.unk_0[0x17] |= 0x10; //SG Portal
- gameInfo.scratchPad.allAreaNodes.Sacred_Grove.unk_0[0x9] |= 0x70; //ToT Stairs
- gameInfo.scratchPad.allAreaNodes.Sacred_Grove.unk_0[0xB] |= 0x10; //Pushed block as human
- }
-
- if (Singleton::getInstance()->isEarlyPoTEnabled == 1)
- {
- gameInfo.scratchPad.eventBits[0x20] |= 0x2; //CiTS Story Flag
- }
-
- if (Singleton::getInstance()->isGMStoryPatch == 1)
- {
- gameInfo.scratchPad.eventBits[0x7] |= 0x1; //Mines Story Flag
- gameInfo.scratchPad.eventBits[0x13] |= 0x20; //watched post GM cs
- gameInfo.scratchPad.allAreaNodes.Eldin.unk_0[0x14] |= 0x10; //barnes sells bombs
- }
-
- if (Singleton::getInstance()->isCartEscortSkipEnabled == 1)
- {
- gameInfo.scratchPad.eventBits[0x8] |= 0x40;//escort started
- gameInfo.scratchPad.eventBits[0x8] |= 0x10;//escort finished
- gameInfo.scratchPad.eventBits[0x8] |= 0x4;//got zora armor from Rutela
- gameInfo.scratchPad.allAreaNodes.Eldin.unk_0[0x17] |= 0x40;//remove rock in graveyard
- gameInfo.scratchPad.allAreaNodes.Eldin.unk_0[0x16] |= 0x40;
- }
-
- if (Singleton::getInstance()->startWithCrystal == 1)
- {
- giveMidnaTransform();
- tools::setItemFlag(ItemFlags::Shadow_Crystal);
-
- if (Singleton::getInstance()->isMDHSkipEnabled == 1)
- {
- gameInfo.scratchPad.unk_1F[0x11] |= 0x8; //Midna on Back
- }
- }
-
- Singleton::getInstance()->hasFTBeenBeaten = 0;
- Singleton::getInstance()->hasGMBeenBeaten = 0;
- Singleton::getInstance()->hasLBTBeenBeaten = 0;
- Singleton::getInstance()->hasAGBeenBeaten = 0;
- Singleton::getInstance()->hasSPRBeenBeaten = 0;
- Singleton::getInstance()->hasToTBeenBeaten = 0;
- Singleton::getInstance()->hasCiTSBeenBeaten = 0;
-
- if (Singleton::getInstance()->isIntroSkipped == 1)
- {
- //set Ordon Days 1,2, and 3 Flags
- allAreaNodesPtr->Ordon.unk_0[0x3] |= 0x1; //Gave cradle to Uli, got Fishing Rod from uli
- eventBitsPtr[0x4] |= 0x4; //Talked to Uli Day 1
- allAreaNodesPtr->Ordon.unk_0[0x9] |= 0x40; //Goats 2 done
- allAreaNodesPtr->Ordon.unk_0[0xC] |= 0x1A; //Day 2 CS watched, Goats 1 done, spawn wooden sword chest
- eventBitsPtr[0x45] |= 0x10; //Saved Talo
- eventBitsPtr[0x46] |= 0x11; //Came Back to Links House with Epona Day 1, took cradle from monkey
- eventBitsPtr[0x47] |= 0x2F; //Called Epona and Talked to everyone
- eventBitsPtr[0x48] |= 0x10; //Talked to Sera
- eventBitsPtr[0x62] |= 0x80; //Talked to Colin Day 1
- eventBitsPtr[0x4A] |= 0x60; //Day 1 done, sword training done
-
- eventBitsPtr[0x2] |= 0x40; //Slingshot and Sword Training started
- allAreaNodesPtr->Ordon.unk_0[0x8] |= 0x20; //Sword Training Started
- eventBitsPtr[0x10] |= 0x1; //Cat got Fish
- eventBitsPtr[0x16] |= 0x1; //Day 2 done
-
- allAreaNodesPtr->Ordon.unk_0[0xE] |= 0x2;//set flag for Fado text before goats
- allAreaNodesPtr->Ordon.unk_0[0x9] |= 0x60;//set flag for day 3 intro cs and goats 2 done
- eventBitsPtr[0x15] |= 0x80; //Watched CS for goats 2 done
-
- eventBitsPtr[0x1] |= 0x4; //Talked to Colin Day 3
- eventBitsPtr[0x3] |= 0x2; //Gave Sword to Talo
-
-
-
- if (Singleton::getInstance()->isSewerSkipEnabled == 1)
- {
- // Set sewers flags (escaped cell cs, Midna intro cs, unchained wolf link, zelda cutscene, First trip to Sewers Done)
- // Set more sewers flags (talk to midna after escaping cell in sewers, listened to first guard in sewers)
- gameInfo.scratchPad.eventBits[0x1A] |= 0x82;
-
- // Set more sewers flags (spawned into sewers twilight as wolf)
- gameInfo.scratchPad.eventBits[0x4D] |= 0x8;
-
- if (Singleton::getInstance()->isTwilightSkipped == 1)
- {
- //Set Faron Twilight Flags
- scratchPadPtr->clearedTwilights.Faron = 0b1; //Clear Faron Twilight
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Faron);
- scratchPadPtr->tearCounters.Faron = 16;
- eventBitsPtr[0x5] |= 0xFF; //Ensure Epona is Stolen, give Midna Charge
- eventBitsPtr[0x6] |= 0x10; //Faron Twilight Progression flag
- eventBitsPtr[0xC] |= 0x8; //Set Sword and Shield to not be on back
- tools::setItemFlag(ItemFlags::Heros_Clothes);
-
- //Set Eldin Twilight Flags
- scratchPadPtr->clearedTwilights.Eldin = 0b1; // Clear Eldin Twilight
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Eldin);
- scratchPadPtr->tearCounters.Eldin = 16;
- eventBitsPtr[0x6] |= 0x1; //tame Epona
- eventBitsPtr[0xA] |= 0x8; //Beat KB1
- eventBitsPtr[0x14] |= 0x10; //Put Bo Outside
- eventBitsPtr[0x7] |= 0xDE; //skip Gor Coron Sumo and Enter Mines also Trigger KB1 and mark Post-KB1 CS as watched, Eldin Twilight Story Progression Flag
- eventBitsPtr[0x41] |= 0x10; //Told Fado about the Kids
-
- //Set Lanayru Twilight Flags
- scratchPadPtr->clearedTwilights.Lanayru = 0b1; // Clear Lanayru Twilight
- tools::setItemFlag(ItemFlags::Vessel_Of_Light_Lanayru);
- scratchPadPtr->tearCounters.Lanayru = 16;
- allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x80;//water on Field map
- allAreaNodesPtr->Hyrule_Field.unk_0[0xF] |= 0x10;//open south CT Shortcut to Faron
- allAreaNodesPtr->Lanayru.unk_0[0xF] |= 0x1;//water on Map
- eventBitsPtr[0x30] |= 0x40; //gave springwater to south CT goron
- eventBitsPtr[0x8] |= 0x80; //ZD Thawed
- eventBitsPtr[0xC] |= 0x2; //Lanayru Twilight Story Progression Flag
- eventBitsPtr[0xA] |= 0x10; //Kagorok Howl at Lake
-
-
- //Skip MDH?
- if (Singleton::getInstance()->isMDHSkipEnabled == 1)
- {
- //set MDH flags
- gameInfo.scratchPad.eventBits[0xC] |= 0x1; //MDH Started
- gameInfo.scratchPad.eventBits[0x1E] |= 0x8; //MDH Completed
- }
-
-
- // Set sewers flags
- giveMidna();
- giveSense();
-
- // Set sewers flags (zelda cutscenes, unchained wolf link, bla)
- eventBitsPtr[0x05] |= 0x7A;
-
- //Unlock Map Regions
- scratchPadPtr->movingActors.exploredRegions.Snowpeak = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Desert = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Lanayru = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Eldin = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Faron = 0b1;
- scratchPadPtr->movingActors.exploredRegions.Ordon = 0b1;
-
- //Unlock Warps
- allAreaNodesPtr->Ordon.unk_0[0xD] = 0x10; // give Ordon Spring Warp
- allAreaNodesPtr->Faron.unk_0[0x13] = 0x80;//give S faron warp
- allAreaNodesPtr->Faron.unk_0[0xB] = 0x4;//give N faron warp
- allAreaNodesPtr->Eldin.unk_0[0x9] |= 0x20; // give Death Mountain Warp
- allAreaNodesPtr->Eldin.unk_0[0x8] |= 0x80; // give Kakariko Warp
- allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x8;//give castle town warp
- allAreaNodesPtr->Hyrule_Field.unk_0[0x9] |= 0x20; //give Gorge Warp
- allAreaNodesPtr->Hyrule_Field.unk_0[0x17] |= 0x8;//give Eldin warp
- allAreaNodesPtr->Lanayru.unk_0[0xB] |= 0x4; // give Zora's Domain Warp
- allAreaNodesPtr->Lanayru.unk_0[0xA] |= 0x4;//give lake hylia warp
- }
- }
-
- //Set Other Flags
- u16* secondTempAddress = reinterpret_cast<u16*>(&eventBitsPtr[0xF7]);
- *secondTempAddress |= 0x1F4;//make it so you only have to donate 500 Rupees to Charlo
- eventBitsPtr[0x20] |= 0x20; //MS Story Progression Flag
- eventBitsPtr[0x1E] |= 0x80; //Gor Ebizo at Malo Mart
- eventBitsPtr[0xA] |= 0x20; //Steal Eldin Bridge
- eventBitsPtr[0xF] |= 0x8; //Put Eldin BRidge Back
-
-
- //Faron Escape
- if (Singleton::getInstance()->isForestEscapeEnabled == 1)
- {
- eventBitsPtr[0x6] |= 0x26; //warp the kak bridge, give map warp, set Forest Temple Story Flag
- }
- else
- {
- eventBitsPtr[0x6] |= 0x24; //warp the kak bridge, give map warp
- }
-
- //Start Link in His House
- strncpy(gameInfo.nextStageVars.nextStage, stage::allStages[Stage_Ordon_Interiors], sizeof(gameInfo.nextStageVars.nextStage) - 1);
- gameInfo.nextStageVars.nextRoom = 0x4;
- gameInfo.nextStageVars.nextSpawnPoint = 0x4;
- gameInfo.scratchPad.skyAngle = 180;
- }
- else
- {
- //Set Other Flags
- u16* secondTempAddress = reinterpret_cast<u16*>(&eventBitsPtr[0xF7]);
- *secondTempAddress |= 0x1F4;//make it so you only have to donate 500 Rupees to Charlo
- eventBitsPtr[0x20] |= 0x20; //MS Story Progression Flag
- eventBitsPtr[0x1E] |= 0x80; //Gor Ebizo at Malo Mart
- eventBitsPtr[0xA] |= 0x20; //Steal Eldin Bridge
- eventBitsPtr[0xF] |= 0x8; //Put Eldin BRidge Back
- }
- }
-
- /*void setFieldModels()
- {
- tp::d_item_data::ItemResource* itemResPtr = &tp::d_item_data::item_resource[0];
- tp::d_item_data::FieldItemRes* fieldItemResPtr = &tp::d_item_data::field_item_res[0];
-
- u32 loopCount = sizeof(item::itemsWithNoFieldModel) / sizeof(item::itemsWithNoFieldModel[0]);
- for (u32 i = 0; i < loopCount; i++)
- {
- u32 item = item::itemsWithNoFieldModel[i]; // Retrieve as u32 to prevent rlwinm shenanigans
- fieldItemResPtr[item].arcName = itemResPtr[item].arcName;
- fieldItemResPtr[item].modelResIdx = itemResPtr[item].modelResIdx;
- }
-
- // For items that dont have a field model, use rupee item info to allow the item to be collected and whatnot
- // Using the yellow rupee because thats what i used in testing
- tp::d_item_data::ItemInfo* itemInfoPtr = &tp::d_item_data::item_info[0];
- tp::d_item_data::ItemInfo* yellowRupeeInfoPtr = &tp::d_item_data::item_info[items::Yellow_Rupee];
-
- loopCount = sizeof(item::itemsWithNoFieldModel) / sizeof(item::itemsWithNoFieldModel[0]);
- for (u32 i = 0; i < loopCount; i++)
- {
- u32 item = item::itemsWithNoFieldModel[i]; // Retrieve as u32 to prevent rlwinm shenanigans
- itemInfoPtr[item].mShadowSize = yellowRupeeInfoPtr->mShadowSize;
- itemInfoPtr[item].mCollisionH = yellowRupeeInfoPtr->mCollisionH;
- itemInfoPtr[item].mCollisionR = yellowRupeeInfoPtr->mCollisionR;
- itemInfoPtr[item].mFlags = yellowRupeeInfoPtr->mFlags;
- }
-
- // Modify a branch in itemGetNextExecute to allow the item get cutscene to play with items past 0x40
- // If you already have the item it gives you, then itll act like a rupee and appear over your head. This could be changed though.
- u32 address_US = 0x8015CF64;
- *reinterpret_cast<u32*>(address_US) = 0x48000018; // b 0x18
-
- // Hook dStage_actorCommonLayerInit to search for field items (probably only rupees) to replace based on object name
- bool procActorCommonLayerInit(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, s32 unk3, void* unk4)
- {
- Actr* actrPtr = chunkTypeInfo->chunkDataPtr;
- u32 numChunks = chunkTypeInfo->numChunks;
- for (u32 i = 0; i < numChunks; i++)
- {
- // Check for "item", as that seems to be whats used for rupees
- // Would check for chests and whatnot as well when changing the contents of those
- if (strncmp(actrPtr->objectName, "item", sizeof(Actr.objectName)))
- {
- // Change the item id
- u8* tempParamBytes = reinterpret_cast<u8*>(&actrPtr->parameters);
- tempParamBytes[3] = newItemId;
-
- // Changing the parameters probably isnt necessary for "item", but I'll add them anyway
- // Refer to Winditor for what the parameters do
- tempParamBytes[0] = 0xF3;
- tempParamBytes[1] = 0xFF;
- tempParamBytes[2] = 0x80;
- actrPtr->rot[2] = 0x3F;
- }
- }
- }
-
- // hook dStage_actorInit to search for field items (probably only heart containers) to replace based on object name
- // Not sure what is passed into dStage_actorInit, but r4 seems to be the same as dStage_actorCommonLayerInit
- bool procActorCommonLayerInit(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, s32 unk3, void* unk4)
- {
- Actr* actrPtr = chunkTypeInfo->chunkDataPtr;
- u32 numChunks = chunkTypeInfo->numChunks;
- for (u32 i = 0; i < numChunks; i++)
- {
- // Check for "htPiece", as that seems to be whats used for heart pieces
- // Not sure what name heart containers use
- if (strncmp(actrPtr->objectName, "htPiece", sizeof(Actr.objectName)))
- {
- // Change the object name to "item"
- strncpy(actrPtr->objectName, "item", sizeof(Actr.objectName));
-
- // Change the item id
- u8* tempParamBytes = reinterpret_cast<u8*>(&actrPtr->parameters);
- tempParamBytes[3] = newItemId;
-
- // Changing the parameters is necessary for this, as its being changed to use rupee parameters
- // Currently allows the item to respawn, so need to look into what handles that
- // Refer to Winditor for what the parameters do
- tempParamBytes[0] = 0xF3;
- tempParamBytes[1] = 0xFF;
- tempParamBytes[2] = 0x80;
- actrPtr->rot[2] = 0x3F;
- }
- }
- }
- }*/
-} \ No newline at end of file
+ void assemblyOverwrites()
+ {
+ // Default to US/JP
+ u32* enableCrashScreen = reinterpret_cast<u32*>( 0x8000B8A4 );
+
+// Get the addresses to overwrite
+#ifdef TP_US
+ enableCrashScreen = reinterpret_cast<u32*>( 0x8000B8A4 );
+#elif defined TP_EU
+ enableCrashScreen = reinterpret_cast<u32*>( 0x8000B878 );
+#elif defined TP_JP
+ enableCrashScreen = reinterpret_cast<u32*>( 0x8000B8A4 );
+#endif
+
+ // Perform the overwrites
+
+ /* If the address is loaded into the cache before the overwrite is made,
+ then the cache will need to be cleared after the overwrite */
+
+ // Enable the crash screen
+ *enableCrashScreen = 0x48000014; // b 0x14
+ }
+
+ void killLinkHouseSpider()
+ {
+ // Kill Skulltula at Link's house
+ gameInfo.localAreaNodes.unk_0[0xA] |= 0x1;
+ }
+
+ void increaseClimbSpeed()
+ {
+ // Adjust Link's climbing speeds
+ tp::d_a_alink::LadderVars* LadderVars = &tp::d_a_alink::ladderVars;
+ LadderVars->ladderClimbInitSpeed = 1.8;
+ LadderVars->ladderReachTopClimbUpSpeed = 1.765;
+ LadderVars->ladderTopStartClimbDownSpeed = 1.8;
+ LadderVars->ladderBottomGetOffSpeed = 1.8;
+ LadderVars->ladderClimbSpeed = 1.575;
+ LadderVars->wallClimbHorizontalSpeed = 2.0;
+ LadderVars->wallClimbVerticalSpeed = 1.875;
+ }
+
+ void removeIBLimit()
+ {
+ // li 0
+ u32 li = 0x38600000;
+ // b +4C
+ u32 b = 0x4800004C;
+
+ // CheckHeavyState overwrite
+ u32 checkHeavyStateOnAddress = reinterpret_cast<u32>( &tp::d_a_alink::checkHeavyStateOn );
+ *reinterpret_cast<u32*>( checkHeavyStateOnAddress + 0x84 ) = li;
+
+ u32 setStickDataAddress = reinterpret_cast<u32>( &tp::d_a_alink::setStickData );
+ *reinterpret_cast<u32*>( setStickDataAddress + 0x5FC ) = b;
+ }
+
+ void increaseWalletSize()
+ {
+ // li
+ u32 li = 0x38600000;
+ u32 cmpwi = 0x2c000000;
+
+ u32 getRupeeMaxAddress = reinterpret_cast<u32>( &tp::d_save::getRupeeMax );
+ u32 setWalletMaxNumAddress = reinterpret_cast<u32>( &tp::d_menu_collect::setWalletMaxNum );
+
+ // 300 -> 1000
+ *reinterpret_cast<u32*>( getRupeeMaxAddress + 0x30 ) = li | 0x000003E8;
+
+ // 600 -> 5000
+ *reinterpret_cast<u32*>( getRupeeMaxAddress + 0x38 ) = li | 0x00001388;
+
+ // 1000 -> 9999 (> 4 digit not good)
+ *reinterpret_cast<u32*>( getRupeeMaxAddress + 0x40 ) = li | 0x0000270F;
+
+ // 600 -> 5000
+ *reinterpret_cast<u32*>( setWalletMaxNumAddress + 0x18 ) = cmpwi | 0x00001388;
+
+ // 300 -> 1000
+ *reinterpret_cast<u32*>( setWalletMaxNumAddress + 0x24 ) = cmpwi | 0x000003E8;
+
+ // 1000 -> 9999
+ *reinterpret_cast<u32*>( setWalletMaxNumAddress + 0x30 ) = cmpwi | 0x0000270F;
+ }
+
+ void skipSewers()
+ {
+ if ( Singleton::getInstance()->isSewerSkipEnabled == 1 )
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Skipping Sewers" );
+
+ // Set sewers flags
+ giveSense();
+
+ // We should be wolf
+ setFirstTimeWolf();
+
+ // Set sewers flags (escaped cell cs, Midna intro cs, unchained wolf link, zelda cutscene, First trip to Sewers
+ // Done)
+ gameInfo.scratchPad.eventBits[0x05] |= 0x7A;
+
+ // Set more sewers flags (talk to midna after escaping cell in sewers, listened to first guard in sewers)
+ gameInfo.scratchPad.eventBits[0x1A] |= 0x82;
+
+ // Set more sewers flags (spawned into sewers twilight as wolf)
+ gameInfo.scratchPad.eventBits[0x4D] |= 0x8;
+
+ gameInfo.scratchPad.equipedItems.sword = 0x3F;
+
+ // Load back to Ordon Spring
+ tools::triggerSaveLoad( stage::allStages[Stage_Ordon_Spring], 0x1, 0x3, 0x4 );
+ }
+ giveMidna();
+ gameInfo.scratchPad.equipedItems.sword = 0x3F;
+ }
+
+ void setFieldBits()
+ {
+ if ( ( Singleton::getInstance()->isGateUnlockEnabled == 1 && ( gameInfo.localAreaNodes.unk_0[0x8] & 0x10 ) == 0 ) ||
+ tools::checkItemFlag( ItemFlags::Gate_Keys ) )
+ {
+ gameInfo.unk_979[0x7] |= 0x6; // 2 = lanyru gate 4 = eldin gorge gate
+ }
+ }
+
+ void skipGoats()
+ {
+ if ( tp::d_com_inf_game::current_state == 0x63 )
+ { // goats 1
+ if ( Singleton::getInstance()->isGoatSkipEnabled == 1 )
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Skipping Goats 1" );
+
+ // Load back to Ordon ranch after goats 1
+ tools::triggerSaveLoad( stage::allStages[Stage_Ordon_Ranch], 0x0, 0x4, 0x7 );
+ }
+ }
+ else if ( tp::d_com_inf_game::current_state == 0x39 )
+ { // goats 2
+ if ( Singleton::getInstance()->isGoatSkipEnabled == 1 )
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Skipping Goats 2" );
+
+ gameInfo.localAreaNodes.unk_0[0xE] |= 0x2; // set flag for Fado text before goats
+ gameInfo.localAreaNodes.unk_0[0x9] |= 0x60; // set flag for day 3 intro cs and goats 2 done
+ // gameInfo.localAreaNodes.unk_0[0x9] |= 0x40;//set flag for day 3 intro cs and goats 2 done
+
+ // Load back to Ordon village
+ tools::triggerSaveLoad( stage::allStages[Stage_Ordon_Village], 0x0, 0x19, 0x8 );
+ }
+ }
+ }
+
+ void fixFTState()
+ {
+ if ( Singleton::getInstance()->hasFTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x6] &= ~0x2; // unset story flag
+ if ( ( gameInfo.scratchPad.allAreaNodes.Forest_Temple.unk_0[0x12] & 0x10 ) == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.ooccooGotten = 0b0;
+ }
+ }
+ }
+
+ void fixGMState()
+ {
+ if ( Singleton::getInstance()->hasGMBeenBeaten == 1 || Singleton::getInstance()->isGMStoryPatch == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x7] &= ~0x1; // unset story flag
+ if ( ( gameInfo.scratchPad.allAreaNodes.Goron_Mines.unk_0[0xE] & 0x2 ) == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.ooccooGotten = 0b0;
+ }
+ }
+ }
+
+ void fixLBTState()
+ {
+ if ( Singleton::getInstance()->hasLBTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x9] &= ~0x4; // unset story flag
+ if ( ( gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.unk_0[0x11] & 0x80 ) == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.ooccooGotten = 0b0;
+ }
+ }
+ }
+
+ void fixAGState()
+ {
+ if ( Singleton::getInstance()->hasAGBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x20] &= ~0x10; // unset story flag
+ if ( ( gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.unk_0[0x17] & 0x20 ) == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.ooccooGotten = 0b0;
+ }
+ }
+ }
+
+ void fixSPRState()
+ {
+ if ( Singleton::getInstance()->hasSPRBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x20] &= ~0x8; // unset story flag
+ if ( ( gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.unk_0[0x1] & 0x1 ) == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.ooccooGotten = 0b0;
+ }
+ }
+ }
+
+ void fixToTState()
+ {
+ if ( Singleton::getInstance()->hasToTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x20] &= ~0x4; // unset story flag
+ if ( ( gameInfo.scratchPad.allAreaNodes.Temple_of_Time.unk_0[0x4] & 0x80 ) == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.ooccooGotten = 0b0;
+ }
+ }
+ }
+
+ void fixCiTSState()
+ {
+ if ( Singleton::getInstance()->hasCiTSBeenBeaten == 1 || Singleton::getInstance()->isEarlyPoTEnabled == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten = 0b0; // unset boss flag
+ gameInfo.scratchPad.eventBits[0x20] &= ~0x2; // unset story flag
+ }
+ if ( Singleton::getInstance()->hasCiTSOoccoo == 0 )
+ {
+ gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.ooccooGotten = 0b0;
+ }
+ }
+
+ void setFTDungeonFlag()
+ {
+ if ( Singleton::getInstance()->hasFTBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasFTBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasFTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x6] |= 0x2; // set story flag
+ }
+ }
+
+ void setGMDungeonFlag()
+ {
+ if ( Singleton::getInstance()->hasGMBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasGMBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasGMBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x7] |= 0x1; // set story flag
+ }
+ else if ( Singleton::getInstance()->isGMStoryPatch == 1 )
+ {
+ gameInfo.scratchPad.eventBits[0x7] |= 0x1; // set story flag
+ }
+ }
+
+ void setGMBossFlag()
+ {
+ if ( Singleton::getInstance()->hasGMBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Goron_Mines.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void setLakeDungeonFlags()
+ {
+ if ( Singleton::getInstance()->hasLBTBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasLBTBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasLBTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x9] |= 0x4; // set story flag
+ }
+
+ if ( Singleton::getInstance()->hasCiTSBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasCiTSBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasCiTSBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x20] |= 0x2; // set story flag
+ }
+ else if ( Singleton::getInstance()->isEarlyPoTEnabled == 1 )
+ {
+ gameInfo.scratchPad.eventBits[0x20] |= 0x2; // set story flag
+ }
+ }
+
+ void setLBTBossFlag()
+ {
+ if ( Singleton::getInstance()->hasLBTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Lakebed_Temple.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void setAGDungeonFlag()
+ {
+ if ( Singleton::getInstance()->hasAGBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasAGBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasAGBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x20] |= 0x10; // set story flag
+ }
+ }
+
+ void setAGBossFlag()
+ {
+ if ( Singleton::getInstance()->hasAGBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Arbiters_Grounds.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void setSPRDungeonFlag()
+ {
+ if ( Singleton::getInstance()->hasSPRBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasSPRBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasSPRBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x20] |= 0x8; // set story flag
+ }
+ }
+
+ void setSPRBossFlag()
+ {
+ if ( Singleton::getInstance()->hasSPRBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Snowpeak_Ruins.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void setToTDungeonFlag()
+ {
+ if ( Singleton::getInstance()->hasToTBeenBeaten == 0 &&
+ gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten == 0b1 )
+ {
+ Singleton::getInstance()->hasToTBeenBeaten = 1;
+ }
+ else if ( Singleton::getInstance()->hasToTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten = 0b1; // set boss flag
+ gameInfo.scratchPad.eventBits[0x20] |= 0x4; // set story flag
+ }
+
+ if ( Singleton::getInstance()->isEarlyToTEnabled == 1 )
+ {
+ gameInfo.nextStageVars.nextState = 0x2;
+ }
+ }
+
+ void setToTBossFlag()
+ {
+ if ( Singleton::getInstance()->hasToTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Temple_of_Time.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void setCiTSBossFlag()
+ {
+ if ( Singleton::getInstance()->hasCiTSBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.City_in_the_Sky.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void setBublinState()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "state was not 1" );
+ if ( gameInfo.nextStageVars.nextRoom != 3 )
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0xB] & 0x40 ) != 0 )
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Setting Bublin State" );
+ // reload bublin camp as state 3
+ // tools::triggerSaveLoad(gameInfo.nextStageVars.nextStage, gameInfo.nextStageVars.nextRoom,
+ // gameInfo.nextStageVars.nextSpawnPoint, a);
+ gameInfo.nextStageVars.nextState = 0x3;
+ }
+ else
+ {
+ return;
+ }
+ }
+ }
+
+ void setGroveFlags()
+ {
+ if ( Singleton::getInstance()->isMSPuzzleSkipEnabled == 1 && ( gameInfo.localAreaNodes.unk_0[0xB] & 0x4 ) == 0 )
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "Skipping MS Puzzle" );
+ gameInfo.localAreaNodes.unk_0[0xB] |= 0x4; // skip Sacred Grove Puzzle
+ }
+ }
+
+ void checkBossKeysey()
+ {
+ if ( Singleton::getInstance()->isBossKeyseyEnabled == 1 )
+ {
+ tp::d_com_inf_game::AllAreaNodes* dungeonAreaNodesPtr = &gameInfo.scratchPad.allAreaNodes;
+ dungeonAreaNodesPtr->Forest_Temple.dungeon.bigKeyGotten = 0b1; // unlock Diababa Door
+ dungeonAreaNodesPtr->Goron_Mines.dungeon.bigKeyGotten = 0b1; // unlock Fryus Door
+ dungeonAreaNodesPtr->Lakebed_Temple.dungeon.bigKeyGotten = 0b1; // unlock Morpheel Door
+ dungeonAreaNodesPtr->Arbiters_Grounds.dungeon.bigKeyGotten = 0b1; // unlock Stallord Door
+ dungeonAreaNodesPtr->Snowpeak_Ruins.dungeon.bigKeyGotten = 0b1; // unlock Blizzetta Door
+ dungeonAreaNodesPtr->Temple_of_Time.dungeon.bigKeyGotten = 0b1; // unlock Armaghoma Door
+ dungeonAreaNodesPtr->City_in_the_Sky.dungeon.bigKeyGotten = 0b1; // unlock Argorok Door
+ dungeonAreaNodesPtr->Palace_of_Twilight.dungeon.bigKeyGotten = 0b1; // unlock Zant Door
+ dungeonAreaNodesPtr->Hyrule_Castle.dungeon.bigKeyGotten = 0b1; // unlock Ganon Door
+ }
+ }
+
+ /* Still in the works
+ void unlockDungeonDoors()
+ {
+ if (Singleton::getInstance()->isMSPuzzleSkipEnabled == 1 && (gameInfo.localAreaNodes.unk_0[0xB] & 0x4) == 0)
+ {
+ //Forest Temple
+ allAreaNodesPtr->Forest_Temple.unk_0[0xA] |= 0x8; //unlock Second Monkey Door
+ allAreaNodesPtr->Forest_Temple.unk_0[0xB] |= 0x80; //unlock Gale Puzzle Monkey Door
+
+ //Goron Mines
+
+
+ //Lakebed Temple
+
+ //Arbiter's Grounds
+
+ //Snowpeak Ruins
+
+ //Temple of Time
+
+ //City in the Sky
+
+ //Palace of Twilight
+
+ //Hyrule Castle
+ }
+ }*/
+
+ void earlyCiTS()
+ {
+ if ( Singleton::getInstance()->isEarlyCiTSEnabled == 1 )
+ {
+ gameInfo.scratchPad.eventBits[0x3B] |= 0x8; // repairs Cannon at lake
+ }
+ }
+
+ void earlyDesert()
+ {
+ if ( Singleton::getInstance()->isEarlyDesertEnabled )
+ {
+ gameInfo.scratchPad.eventBits[0x26] |= 0x80; // Allow you to use the cannon in the desert
+ }
+ }
+
+ void accessDesert()
+ {
+ if ( tools::checkItemFlag( ItemFlags::Shadow_Crystal ) )
+ {
+ return;
+ }
+ else
+ {
+ strncpy( gameInfo.nextStageVars.nextStage,
+ stage::allStages[Stage_Lake_Hylia],
+ sizeof( gameInfo.nextStageVars.nextStage ) - 1 );
+ gameInfo.nextStageVars.nextRoom = 0x0;
+ gameInfo.nextStageVars.nextSpawnPoint = 0x4D;
+ tp::d_item::execItemGet( 0x2 );
+ }
+ }
+
+ void breakBarrier()
+ {
+ if ( Singleton::getInstance()->isEarlyHCEnabled == 1 && ( ( gameInfo.scratchPad.eventBits[0x1E] & 0x8 ) != 0 ) )
+ {
+ gameInfo.scratchPad.eventBits[0x42] |= 0x8;
+ }
+ }
+
+ void setEscortState()
+ {
+ if ( ( gameInfo.scratchPad.eventBits[0x8] & 0x40 ) == 0 && Singleton::getInstance()->isCartEscortSkipEnabled == 0 &&
+ tools::checkItemFlag( ItemFlags::Heros_Bow ) && tools::checkItemFlag( ItemFlags::Boomerang ) &&
+ gameInfo.scratchPad.clearedTwilights.Lanayru == 0b1 )
+ {
+ gameInfo.nextStageVars.nextState = 0x8;
+ gameInfo.nextStageVars.nextSpawnPoint = 0x14;
+ }
+ }
+
+ void setFirstTimeWolf()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Set first time wolf" );
+
+ gameInfo.scratchPad.unk_1F[0x11] |= 1;
+ }
+
+ void setLanayruWolf()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Set wolf" );
+
+ if ( gameInfo.scratchPad.form == 0 && !tools::checkItemFlag( ItemFlags::Shadow_Crystal ) &&
+ !tools::checkItemFlag( ItemFlags::Vessel_Of_Light_Lanayru ) )
+ {
+ strncpy( gameInfo.nextStageVars.nextStage,
+ stage::allStages[Stage_Hyrule_Field],
+ sizeof( gameInfo.nextStageVars.nextStage ) - 1 );
+ gameInfo.nextStageVars.nextRoom = 0x9;
+ gameInfo.nextStageVars.nextSpawnPoint = 0xA;
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ void setHuman()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Set human" );
+
+ gameInfo.scratchPad.form = 0;
+ }
+
+ void setWolf()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Set wolf" );
+
+ gameInfo.scratchPad.form = 1;
+ }
+
+ void giveSense()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Give Senses" );
+
+ // Set the Sense (sewers) flag
+ gameInfo.scratchPad.eventBits[0x43] |= 0x8;
+ }
+
+ void giveEpona()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Give Epona" );
+
+ // Set Epona tamed
+ gameInfo.scratchPad.eventBits[0x6] |= 0x1;
+ }
+
+ void giveMasterSword()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Give MasterSword" );
+
+ // Set Master sword inventory flag
+ tools::setItemFlag( ItemFlags::Master_Sword );
+
+ // Equip Master sword (0x49 / 73)
+ gameInfo.scratchPad.equipedItems.sword = 0x49;
+ }
+
+ void giveMidna()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Give Midna (sewers)" );
+
+ // Set Midna sewers flag
+ gameInfo.scratchPad.eventBits[0xC] |= 0x10;
+ }
+
+ void giveMidnaTransform()
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> Give Midna Transform" );
+
+ // Set Midna Transform flag (gets set at Master Sword)
+ gameInfo.scratchPad.eventBits[0xD] |= 0x4;
+ }
+
+ void handleMaloShop()
+ {
+ tp::d_com_inf_game::AreaNodes* maloLocalAreaNodesPtr = &gameInfo.localAreaNodes;
+ // hylian shield check
+ if ( ( gameInfo.scratchPad.eventBits[0xA] & 0x8 ) != 0 ) // KB1 done
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Null_D9 ) )
+ {
+ strcpy( sysConsolePtr->consoleLine[20].line, "-> selling hylian shield" );
+ maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x2; // unset flag for hylian shield bought
+ maloLocalAreaNodesPtr->unk_0[0x13] |= 0x40; // set flag for hylian shield on counter
+ maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x40; // unset flag for red potion on right
+ }
+ else
+ {
+ maloLocalAreaNodesPtr->unk_0[0xC] |= 0x2; // set flag for hylian shield bought
+ maloLocalAreaNodesPtr->unk_0[0x13] &= ~0x40; // unset flag for hylian shield on counter
+ }
+ }
+
+ // hawkeye check
+ if ( ( gameInfo.scratchPad.eventBits[0x9] & 0x40 ) != 0 ) // Bow mini-game started
+ {
+ if ( !tools::checkItemFlag( ItemFlags::Null_D8 ) )
+ {
+ maloLocalAreaNodesPtr->unk_0[0xC] |= 0x40; // set flag for hawkeye on counter
+ maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x20; // unset flag for arrows on counter (else causes crash)
+ maloLocalAreaNodesPtr->unk_0[0xD] &= ~0x8; // unset flag for hawkeye sold out
+ maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x10; // unset flag for red potion on left
+ }
+ else
+ {
+ maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x40; // unset flag for hawkeye on counter
+ if ( tools::checkItemFlag( ItemFlags::Null_D9 ) )
+ {
+ maloLocalAreaNodesPtr->unk_0[0xC] |= 0x20; // set flag for arrows on counter
+ maloLocalAreaNodesPtr->unk_0[0x15] |= 0x40; // set flag for red potion on right
+ maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x10; // unset flag for red potion on left
+ maloLocalAreaNodesPtr->unk_0[0xD] |= 0x8; // set flag for hawkeye sold out
+ }
+ else
+ {
+ maloLocalAreaNodesPtr->unk_0[0xC] &= ~0x20; // unset flag for arrows on counter
+ maloLocalAreaNodesPtr->unk_0[0x15] &= ~0x40; // unset flag for red potion on right
+ maloLocalAreaNodesPtr->unk_0[0x15] |= 0x10; // set flag for red potion on left
+ maloLocalAreaNodesPtr->unk_0[0xD] &= ~0x8; // unset flag for hawkeye sold out
+ }
+ }
+ }
+ }
+
+ void allowFaronEscape()
+ {
+ if ( Singleton::getInstance()->isForestEscapeEnabled == 0 )
+ {
+ if ( ( ( gameInfo.scratchPad.eventBits[0x6] & 0x2 ) != 0 ) || ( gameInfo.scratchPad.eventBits[0x6] & 0x10 ) == 0 )
+ {
+ return;
+ }
+ else
+ {
+ gameInfo.nextStageVars.nextState = 0x0;
+ }
+ }
+ }
+
+ void setLanternFlag() { gameInfo.scratchPad.eventBits[0xF] |= 0x1; /*got lantern from Coro*/ }
+
+ void skipMDHCS()
+ {
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 1 )
+ {
+ strncpy( gameInfo.nextStageVars.nextStage,
+ stage::allStages[Stage_Lake_Hylia],
+ sizeof( gameInfo.nextStageVars.nextStage ) - 1 );
+ gameInfo.nextStageVars.nextSpawnPoint = 0x7;
+ gameInfo.nextStageVars.nextRoom = 0x0;
+ }
+ }
+
+ void skipMDH()
+ {
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 1 )
+ {
+ // set MDH flags
+ gameInfo.scratchPad.eventBits[0xC] |= 0x1; // MDH Started
+ gameInfo.scratchPad.eventBits[0x1E] |= 0x8; // MDH Completed
+ }
+ }
+
+ void fixFTBossMusic()
+ {
+ if ( Singleton::getInstance()->isForestEscapeEnabled == 1 &&
+ gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten == 0b0 &&
+ Singleton::getInstance()->diababaMusicFixed == 0 )
+ {
+ gameInfo.scratchPad.eventBits[0x6] &= ~0x2;
+ Singleton::getInstance()->diababaMusicFixed = 1;
+ }
+
+ if ( Singleton::getInstance()->hasFTBeenBeaten == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Forest_Temple.dungeon.bossBeaten = 0b1; // set boss flag
+ }
+ }
+
+ void skipTextAndCS()
+ {
+ // Set Scratchpad Pointer
+ tp::d_com_inf_game::ScratchPad* scratchPadPtr = &gameInfo.scratchPad;
+
+ // Set Letters Pointer
+ tp::d_com_inf_game::Letters* LettersPtr = &scratchPadPtr->recivedLetters;
+ LettersPtr->From_Wife_of_Yeto = 0b1;
+ LettersPtr->Update = 0b1;
+ LettersPtr->Now_open_for_business = 0b1;
+ LettersPtr->Agithas_Dream = 0b1;
+ LettersPtr->Hey_kid = 0b1;
+ LettersPtr->Challenge_for_you = 0b1;
+ LettersPtr->They_came_so_quickly = 0b1;
+ LettersPtr->Heroes_come_together = 0b1;
+ LettersPtr->URGENT_Bomb_arrows = 0b1;
+ LettersPtr->Rare_item_in_stock = 0b1;
+ LettersPtr->Good_stuff_inside = 0b1;
+ LettersPtr->URGENT_NOTICE = 0b1;
+ LettersPtr->Post_office_notice = 0b1;
+ LettersPtr->Dear_Adventurer_1 = 0b1;
+ LettersPtr->Dear_Adventurer_2 = 0b1;
+ LettersPtr->About_Ilias_memory = 0b1;
+
+ // Set Event Bits
+ u8* eventBitsPtr = &scratchPadPtr->eventBits[0];
+ eventBitsPtr[0x1] |= 0x40; // talked to Yeto First Time
+ eventBitsPtr[0x3] |= 0x90; // Jaggle Calls out to link, talked to squirrel as wolf in Ordon
+ eventBitsPtr[0x5] |= 0x10; // unchain wolf link
+ eventBitsPtr[0x6] |= 0xC0; // CS after beating Ordon Shadow, cs after entering Faron twilight
+ eventBitsPtr[0x7] |= 0x20; // Talked to Bo outside his house
+ eventBitsPtr[0xB] |= 0x20; // Talked to Yeta First Time
+ eventBitsPtr[0x10] |= 0x2; // Talked to Jaggle after climbing vines
+ eventBitsPtr[0x5E] |= 0x10; // Midna Text After Beating Forest Temple
+ eventBitsPtr[0x40] |= 0x8; // have been to desert (prevents cannon warp crash)
+ eventBitsPtr[0x1B] |= 0x78; // skip the monkey escort
+ eventBitsPtr[0x1D] = 0x40; // fight bublin after Fyer
+ eventBitsPtr[0x22] |= 0x1; // Plumm initial CS watched
+ eventBitsPtr[0x26] |= 0x2; // Talked to Yeto on Snowpeak
+ eventBitsPtr[0x28] |= 0x40; // Used Ooccoo for the First Time
+ eventBitsPtr[0x37] |= 0x4; // Postman Twilight Text
+ eventBitsPtr[0x38] |= 0x6; // Enter Hena Cabin CS
+ eventBitsPtr[0x3A] |= 0x1; // Talked to Ralis
+ eventBitsPtr[0x42] |= 0x1; // Watched post ToT Ooccoo CS
+ eventBitsPtr[0x45] |= 0x8; // Postman Letters Text
+ eventBitsPtr[0x4A] |= 0x10; // Talo Cage CS
+ eventBitsPtr[0x3E] |= 0x2; // city OoCCoo CS watched
+ eventBitsPtr[0x59] |= 0x40; // Postman Met
+ eventBitsPtr[0x5D] |= 0x40; // Midna text after Kagorok FLight
+
+ // Set Area Node Flags
+ tp::d_com_inf_game::AllAreaNodes* allAreaNodesPtr = &scratchPadPtr->allAreaNodes;
+
+ allAreaNodesPtr->Ordon.unk_0[0x9] |=
+ 0xAA; // exit shield house CS watched, day 3 intro CS, bee nest CS, Ranch first time CS
+ allAreaNodesPtr->Ordon.unk_0[0xA] |= 0xF; // Ilia spring CS, Ordon Village CS
+ allAreaNodesPtr->Ordon.unk_0[0xD] |= 0x82; // Approach Faron Twilight CS, Shield house intro cs
+ allAreaNodesPtr->Ordon.unk_0[0xE] |= 0x4; // Midna CS after watching Bo and Jaggle Talk about shield
+ allAreaNodesPtr->Ordon.unk_0[0xF] |= 0xC; // rusl talking to wife CS
+ allAreaNodesPtr->Ordon.unk_0[0x17] |= 0x80; // enter village as wolf CS
+
+ allAreaNodesPtr->Sewers.unk_0[0x8] |= 0x38; // wake up in Jail CS, text after first gate, text after rooftops
+ allAreaNodesPtr->Sewers.unk_0[0x9] |= 0x18; // midna cs after digging out, midna intro cs
+ allAreaNodesPtr->Sewers.unk_0[0xA] |= 0x41; // zelda tower intro cs, outside top door intro cs
+ allAreaNodesPtr->Sewers.unk_0[0xB] |= 0x38; // other side of fence cs, top of stairway cs watched, stairway intro cs
+ allAreaNodesPtr->Sewers.unk_0[0xF] |=
+ 0x11; // midna cs after digging out watched, midna text when approaching first rooftop guard
+
+ allAreaNodesPtr->Eldin.unk_0[0x9] |= 0x40; // goron mines DM cs
+ allAreaNodesPtr->Eldin.unk_0[0x14] |= 1; // give midna jumps for top of sanctuary
+ allAreaNodesPtr->Eldin.unk_0[0x10] |= 0x10; // skip Graveyard CS
+ allAreaNodesPtr->Eldin.unk_0[0x11] |= 0x8; // midna text after meteor
+ allAreaNodesPtr->Eldin.unk_0[0x13] |= 0x20; // skip Kak CS
+
+ allAreaNodesPtr->Lanayru.unk_0[0xB] |= 0x81; // Zora domain frozen CS, talked to reluta
+ allAreaNodesPtr->Lanayru.unk_0[0xC] |= 0x1; // midna text after jumping to lake from bridge
+ allAreaNodesPtr->Lanayru.unk_0[0xD] |= 0x10; // ZD exit CS
+ allAreaNodesPtr->Lanayru.unk_0[0xE] |= 0x20; // midna text after kagorok CS trigger
+ allAreaNodesPtr->Lanayru.unk_0[0x12] |= 0x40; // midna text after frozen zd
+ allAreaNodesPtr->Lanayru.unk_0[0x16] |= 0x80; // watched Ooccoo CiTS CS
+
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x60; // cutscene before eldin twilight and Lanayru twilight
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xD] |= 0x80; // midna text after warping gorge bridge
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xF] |=
+ 0xB; // cutscene for Gorge Bridge Watched, Ilia Scent CS, midna text after lanayru field cs
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xE] |= 0x20; // cutscene for entering Field Watched
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x8] |= 0x81; // Midna text for warping the bridge, lanayru field CS
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x9] |= 0x9; // cs before kak, watched CS of Eldin Bridge returning
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x16] |=
+ 0x13; // midna text after entering eldin twilight, midna text after entering Lanayru twilight, midna text before
+ // eldin twilight, midna text after eldin twilight
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x17] |= 0x10; // youth scent CS
+
+ allAreaNodesPtr->Sacred_Grove.unk_0[0x8] |=
+ 0x38; // lost woods intro cs, human block cs, midna text after human block
+
+ allAreaNodesPtr->Snowpeak.unk_0[0x8] |= 0x4; // Mountiain top CS
+ allAreaNodesPtr->Snowpeak.unk_0[0xB] |= 0x3; // Snowpeak Entrance CS, midna text in front of SPR
+
+ allAreaNodesPtr->Castle_Town.unk_0[0xA] |= 0x4; // STAR Tent CS
+ allAreaNodesPtr->Castle_Town.unk_0[0xF] |= 0x4; // Jovani House CS
+
+ allAreaNodesPtr->Gerudo_Desert.unk_0[0x13] |= 0x40; // watched the CS when entering the desert
+ allAreaNodesPtr->Gerudo_Desert.unk_0[0xA] |= 0x10; // Mirror Chamber Intro CS
+
+ allAreaNodesPtr->Forest_Temple.unk_0[0x8] |=
+ 0x61; // set Midna Text for Ook Bridge Broken, Boomerang, and freeing first monkey
+ allAreaNodesPtr->Forest_Temple.unk_0[0x9] |= 0x40; // Ook Bridge Broken
+ allAreaNodesPtr->Forest_Temple.unk_0[0xA] |= 0x3; // Boko bridge CS, one bridge CS
+ allAreaNodesPtr->Forest_Temple.unk_0[0xE] |= 0x22; // Worm Bridge CS, second monkey CS
+ allAreaNodesPtr->Forest_Temple.unk_0[0xF] |=
+ 0xE; // Midna text for pre-diababa room and open room monkey, Big Baba CS
+ allAreaNodesPtr->Forest_Temple.unk_0[0x10] |= 0x14; // Midna text for compass, eat open area bridge CS
+ allAreaNodesPtr->Forest_Temple.unk_0[0x16] |= 0x2; // Entrance CS watched
+
+ allAreaNodesPtr->Goron_Mines.unk_0[0x8] |= 0x1F; // upper magnet CS, first room switch 3 cs, first room switch 2 cs,
+ // outside bridge cs, crystal switch bridge cs
+ allAreaNodesPtr->Goron_Mines.unk_0[0x9] |= 0x20; // bottom magnet cs
+ allAreaNodesPtr->Goron_Mines.unk_0[0xD] |= 0x80; // outside magnet cs
+ allAreaNodesPtr->Goron_Mines.unk_0[0xE] |= 0x30; // enter tall room cs
+ allAreaNodesPtr->Goron_Mines.unk_0[0xF] |= 0x20; // open room CS
+ allAreaNodesPtr->Goron_Mines.unk_0[0x10] |= 0xCC; // lava slug room cs, outside area beamos wall cs, second magnet
+ // in crystal switch cs, crystal switch room gate
+ allAreaNodesPtr->Goron_Mines.unk_0[0x11] |=
+ 0xB8; // opening cs, first room gate cs, first room switch 1 cs, water room magnet cs
+ allAreaNodesPtr->Goron_Mines.unk_0[0x17] |=
+ 0xF; // lava slug room cs watched, lava slug room flag, tall room CS flags
+
+ allAreaNodesPtr->Lakebed_Temple.unk_0[0x8] |= 0x2; // stalactite midna text
+ allAreaNodesPtr->Lakebed_Temple.unk_0[0xF] |= 0x3; // one gear room spinning cs, two gear room spinning cs
+ allAreaNodesPtr->Lakebed_Temple.unk_0[0x14] |= 0x7; // main room cs, front bridge cs, opening cs
+ allAreaNodesPtr->Lakebed_Temple.unk_0[0x15] |= 0x20; // staircase turn CS
+ allAreaNodesPtr->Lakebed_Temple.unk_0[0x16] |= 0x8; // chu worm cs watched
+
+ allAreaNodesPtr->Arbiters_Grounds.unk_0[0xB] |= 0x20; // spinner wall cs
+ allAreaNodesPtr->Arbiters_Grounds.unk_0[0xE] |= 0x10; // opening CS
+ allAreaNodesPtr->Arbiters_Grounds.unk_0[0x12] |= 0x8; // cs after raising rails
+
+ allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x10] |= 0x10; // enter cannonball room cs
+ allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x14] |= 0x41; // entrance cs, midna text after bedroom key
+ allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x15] |=
+ 0x2A; // freezard tower cs, enter NE room cs watched, East Courtyard Dig CS
+ allAreaNodesPtr->Snowpeak_Ruins.unk_0[0x16] |= 0x28; // midna text after cheese and pumpkin
+
+ allAreaNodesPtr->Temple_of_Time.unk_0[0x8] |= 0x80; // Midna text about missing statue
+ allAreaNodesPtr->Temple_of_Time.unk_0[0x9] |= 0x3C; // scales cs, entrance cs, scales move cs
+ allAreaNodesPtr->Temple_of_Time.unk_0[0xA] |= 0x8; // statue move cs watched
+ allAreaNodesPtr->Temple_of_Time.unk_0[0xF] |= 0x8; // gate outside darknut cs
+ allAreaNodesPtr->Temple_of_Time.unk_0[0x12] |=
+ 0xEE; // first room switch cs, 8f hall switch cs, before darknut gate open cs, elevator room switches cs, 3F
+ // hall switch cs, 2F hall switch cs
+ allAreaNodesPtr->Temple_of_Time.unk_0[0x14] |= 0x4; // darknut room gate open cs
+
+ allAreaNodesPtr->City_in_the_Sky.unk_0[0xC] |=
+ 0xF; // fan tower cs, room before aerolfos, first room exit cs, entrance cs
+ allAreaNodesPtr->City_in_the_Sky.unk_0[0xD] |= 0x6; // west bridge extended cs, east bridge extended cs
+
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0x9] |= 0x4; // Phantom zant 1 cs watched
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0xB] |= 0x2; // Entrance CS watched
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0xC] |= 0x82; // Midna Text when west hand seals sol, Light Sword CS
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0xD] |= 0x1; // Midna text after forced transform
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0xE] |= 0xB0; // Midna text after west hand drops sol, midna text about
+ // transformed twili, midna text after post zant save
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0xF] |=
+ 0xC0; // Midna text after light sword, midna text after west sol in slot
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0x12] |= 0x4; // midna text after re-entering west after sol stolen
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0x13] |= 0x2; // midna text after entrance cs
+ allAreaNodesPtr->Palace_of_Twilight.unk_0[0x16] |= 0x10; // watched EW 2nd room stairs CS
+
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x9] |= 0x1; // graveyard entrance cs
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x11] |= 0xC; // east wing cs
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0xe] |= 0x1; // midna text after outside gale
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x10] |= 0x24; // entrance cs, chandelier room east cs watched
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x13] |= 0x40; // Darknuts room CS
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x14] |=
+ 0xB; // Midna text post KB4, lizalfos Room CS, midna text after graveyard SK
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x16] |= 0x1; // lone darknut room se torch cs
+ allAreaNodesPtr->Hyrule_Castle.unk_0[0x17] |= 0x80; // lone darknut room me torch watched
+
+ // Set Local Area Node flags
+ allAreaNodesPtr->Faron.unk_0[0x8] = 0xFB; // give midna jumps in mist area
+ allAreaNodesPtr->Faron.unk_0[0xC] |=
+ 0x90; // set flag for midna to think you followed the monkey in the mist, trill lets you shop
+ allAreaNodesPtr->Faron.unk_0[0x12] |= 0x4; // mark read the midna text when you warp to N Faron for bridge
+ allAreaNodesPtr->Faron.unk_0[0xF] |= 0x8; // set flag for midna text after twilight
+ allAreaNodesPtr->Faron.unk_0[0xE] |= 0x9; // cs after entering Faron,spring cs with spirit
+ allAreaNodesPtr->Faron.unk_0[0x17] |= 0xC0; // kill bugs in Coro's House
+
+ // Apply Overrides for custom chests
+ gameInfo.scratchPad.eventBits[0x22] |= 0x4; /*Got Ilia's Charm from Impaz*/
+ gameInfo.scratchPad.eventBits[0x49] |= 0x2; /*Bought Slingshot from Sera*/
+
+ // Apply Randomizer Options
+ checkBossKeysey();
+ earlyCiTS();
+ earlyDesert();
+
+ if ( Singleton::getInstance()->isEarlyToTEnabled == 1 )
+ {
+ gameInfo.scratchPad.allAreaNodes.Sacred_Grove.unk_0[0x17] |= 0x10; // SG Portal
+ gameInfo.scratchPad.allAreaNodes.Sacred_Grove.unk_0[0x9] |= 0x70; // ToT Stairs
+ gameInfo.scratchPad.allAreaNodes.Sacred_Grove.unk_0[0xB] |= 0x10; // Pushed block as human
+ }
+
+ if ( Singleton::getInstance()->isEarlyPoTEnabled == 1 )
+ {
+ gameInfo.scratchPad.eventBits[0x20] |= 0x2; // CiTS Story Flag
+ }
+
+ if ( Singleton::getInstance()->isGMStoryPatch == 1 )
+ {
+ gameInfo.scratchPad.eventBits[0x7] |= 0x1; // Mines Story Flag
+ gameInfo.scratchPad.eventBits[0x13] |= 0x20; // watched post GM cs
+ gameInfo.scratchPad.allAreaNodes.Eldin.unk_0[0x14] |= 0x10; // barnes sells bombs
+ }
+
+ if ( Singleton::getInstance()->isCartEscortSkipEnabled == 1 )
+ {
+ gameInfo.scratchPad.eventBits[0x8] |= 0x40; // escort started
+ gameInfo.scratchPad.eventBits[0x8] |= 0x10; // escort finished
+ gameInfo.scratchPad.eventBits[0x8] |= 0x4; // got zora armor from Rutela
+ gameInfo.scratchPad.allAreaNodes.Eldin.unk_0[0x17] |= 0x40; // remove rock in graveyard
+ gameInfo.scratchPad.allAreaNodes.Eldin.unk_0[0x16] |= 0x40;
+ }
+
+ if ( Singleton::getInstance()->startWithCrystal == 1 )
+ {
+ giveMidnaTransform();
+ tools::setItemFlag( ItemFlags::Shadow_Crystal );
+
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 1 )
+ {
+ gameInfo.scratchPad.unk_1F[0x11] |= 0x8; // Midna on Back
+ }
+ }
+
+ Singleton::getInstance()->hasFTBeenBeaten = 0;
+ Singleton::getInstance()->hasGMBeenBeaten = 0;
+ Singleton::getInstance()->hasLBTBeenBeaten = 0;
+ Singleton::getInstance()->hasAGBeenBeaten = 0;
+ Singleton::getInstance()->hasSPRBeenBeaten = 0;
+ Singleton::getInstance()->hasToTBeenBeaten = 0;
+ Singleton::getInstance()->hasCiTSBeenBeaten = 0;
+
+ if ( Singleton::getInstance()->isIntroSkipped == 1 )
+ {
+ // set Ordon Days 1,2, and 3 Flags
+ allAreaNodesPtr->Ordon.unk_0[0x3] |= 0x1; // Gave cradle to Uli, got Fishing Rod from uli
+ eventBitsPtr[0x4] |= 0x4; // Talked to Uli Day 1
+ allAreaNodesPtr->Ordon.unk_0[0x9] |= 0x40; // Goats 2 done
+ allAreaNodesPtr->Ordon.unk_0[0xC] |= 0x1A; // Day 2 CS watched, Goats 1 done, spawn wooden sword chest
+ eventBitsPtr[0x45] |= 0x10; // Saved Talo
+ eventBitsPtr[0x46] |= 0x11; // Came Back to Links House with Epona Day 1, took cradle from monkey
+ eventBitsPtr[0x47] |= 0x2F; // Called Epona and Talked to everyone
+ eventBitsPtr[0x48] |= 0x10; // Talked to Sera
+ eventBitsPtr[0x62] |= 0x80; // Talked to Colin Day 1
+ eventBitsPtr[0x4A] |= 0x60; // Day 1 done, sword training done
+
+ eventBitsPtr[0x2] |= 0x40; // Slingshot and Sword Training started
+ allAreaNodesPtr->Ordon.unk_0[0x8] |= 0x20; // Sword Training Started
+ eventBitsPtr[0x10] |= 0x1; // Cat got Fish
+ eventBitsPtr[0x16] |= 0x1; // Day 2 done
+
+ allAreaNodesPtr->Ordon.unk_0[0xE] |= 0x2; // set flag for Fado text before goats
+ allAreaNodesPtr->Ordon.unk_0[0x9] |= 0x60; // set flag for day 3 intro cs and goats 2 done
+ eventBitsPtr[0x15] |= 0x80; // Watched CS for goats 2 done
+
+ eventBitsPtr[0x1] |= 0x4; // Talked to Colin Day 3
+ eventBitsPtr[0x3] |= 0x2; // Gave Sword to Talo
+
+ if ( Singleton::getInstance()->isSewerSkipEnabled == 1 )
+ {
+ // Set sewers flags (escaped cell cs, Midna intro cs, unchained wolf link, zelda cutscene, First trip to Sewers
+ // Done) Set more sewers flags (talk to midna after escaping cell in sewers, listened to first guard in sewers)
+ gameInfo.scratchPad.eventBits[0x1A] |= 0x82;
+
+ // Set more sewers flags (spawned into sewers twilight as wolf)
+ gameInfo.scratchPad.eventBits[0x4D] |= 0x8;
+
+ if ( Singleton::getInstance()->isTwilightSkipped == 1 )
+ {
+ // Set Faron Twilight Flags
+ scratchPadPtr->clearedTwilights.Faron = 0b1; // Clear Faron Twilight
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Faron );
+ scratchPadPtr->tearCounters.Faron = 16;
+ eventBitsPtr[0x5] |= 0xFF; // Ensure Epona is Stolen, give Midna Charge
+ eventBitsPtr[0x6] |= 0x10; // Faron Twilight Progression flag
+ eventBitsPtr[0xC] |= 0x8; // Set Sword and Shield to not be on back
+ tools::setItemFlag( ItemFlags::Heros_Clothes );
+
+ // Set Eldin Twilight Flags
+ scratchPadPtr->clearedTwilights.Eldin = 0b1; // Clear Eldin Twilight
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Eldin );
+ scratchPadPtr->tearCounters.Eldin = 16;
+ eventBitsPtr[0x6] |= 0x1; // tame Epona
+ eventBitsPtr[0xA] |= 0x8; // Beat KB1
+ eventBitsPtr[0x14] |= 0x10; // Put Bo Outside
+ eventBitsPtr[0x7] |= 0xDE; // skip Gor Coron Sumo and Enter Mines also Trigger KB1 and mark Post-KB1 CS
+ // as watched, Eldin Twilight Story Progression Flag
+ eventBitsPtr[0x41] |= 0x10; // Told Fado about the Kids
+
+ // Set Lanayru Twilight Flags
+ scratchPadPtr->clearedTwilights.Lanayru = 0b1; // Clear Lanayru Twilight
+ tools::setItemFlag( ItemFlags::Vessel_Of_Light_Lanayru );
+ scratchPadPtr->tearCounters.Lanayru = 16;
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x80; // water on Field map
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xF] |= 0x10; // open south CT Shortcut to Faron
+ allAreaNodesPtr->Lanayru.unk_0[0xF] |= 0x1; // water on Map
+ eventBitsPtr[0x30] |= 0x40; // gave springwater to south CT goron
+ eventBitsPtr[0x8] |= 0x80; // ZD Thawed
+ eventBitsPtr[0xC] |= 0x2; // Lanayru Twilight Story Progression Flag
+ eventBitsPtr[0xA] |= 0x10; // Kagorok Howl at Lake
+
+ // Skip MDH?
+ if ( Singleton::getInstance()->isMDHSkipEnabled == 1 )
+ {
+ // set MDH flags
+ gameInfo.scratchPad.eventBits[0xC] |= 0x1; // MDH Started
+ gameInfo.scratchPad.eventBits[0x1E] |= 0x8; // MDH Completed
+ }
+
+ // Set sewers flags
+ giveMidna();
+ giveSense();
+
+ // Set sewers flags (zelda cutscenes, unchained wolf link, bla)
+ eventBitsPtr[0x05] |= 0x7A;
+
+ // Unlock Map Regions
+ scratchPadPtr->movingActors.exploredRegions.Snowpeak = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Desert = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Lanayru = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Eldin = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Faron = 0b1;
+ scratchPadPtr->movingActors.exploredRegions.Ordon = 0b1;
+
+ // Unlock Warps
+ allAreaNodesPtr->Ordon.unk_0[0xD] = 0x10; // give Ordon Spring Warp
+ allAreaNodesPtr->Faron.unk_0[0x13] = 0x80; // give S faron warp
+ allAreaNodesPtr->Faron.unk_0[0xB] = 0x4; // give N faron warp
+ allAreaNodesPtr->Eldin.unk_0[0x9] |= 0x20; // give Death Mountain Warp
+ allAreaNodesPtr->Eldin.unk_0[0x8] |= 0x80; // give Kakariko Warp
+ allAreaNodesPtr->Hyrule_Field.unk_0[0xB] |= 0x8; // give castle town warp
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x9] |= 0x20; // give Gorge Warp
+ allAreaNodesPtr->Hyrule_Field.unk_0[0x17] |= 0x8; // give Eldin warp
+ allAreaNodesPtr->Lanayru.unk_0[0xB] |= 0x4; // give Zora's Domain Warp
+ allAreaNodesPtr->Lanayru.unk_0[0xA] |= 0x4; // give lake hylia warp
+ }
+ }
+
+ // Set Other Flags
+ u16* secondTempAddress = reinterpret_cast<u16*>( &eventBitsPtr[0xF7] );
+ *secondTempAddress |= 0x1F4; // make it so you only have to donate 500 Rupees to Charlo
+ eventBitsPtr[0x20] |= 0x20; // MS Story Progression Flag
+ eventBitsPtr[0x1E] |= 0x80; // Gor Ebizo at Malo Mart
+ eventBitsPtr[0xA] |= 0x20; // Steal Eldin Bridge
+ eventBitsPtr[0xF] |= 0x8; // Put Eldin BRidge Back
+
+ // Faron Escape
+ if ( Singleton::getInstance()->isForestEscapeEnabled == 1 )
+ {
+ eventBitsPtr[0x6] |= 0x26; // warp the kak bridge, give map warp, set Forest Temple Story Flag
+ }
+ else
+ {
+ eventBitsPtr[0x6] |= 0x24; // warp the kak bridge, give map warp
+ }
+
+ // Start Link in His House
+ strncpy( gameInfo.nextStageVars.nextStage,
+ stage::allStages[Stage_Ordon_Interiors],
+ sizeof( gameInfo.nextStageVars.nextStage ) - 1 );
+ gameInfo.nextStageVars.nextRoom = 0x4;
+ gameInfo.nextStageVars.nextSpawnPoint = 0x4;
+ gameInfo.scratchPad.skyAngle = 180;
+ }
+ else
+ {
+ // Set Other Flags
+ u16* secondTempAddress = reinterpret_cast<u16*>( &eventBitsPtr[0xF7] );
+ *secondTempAddress |= 0x1F4; // make it so you only have to donate 500 Rupees to Charlo
+ eventBitsPtr[0x20] |= 0x20; // MS Story Progression Flag
+ eventBitsPtr[0x1E] |= 0x80; // Gor Ebizo at Malo Mart
+ eventBitsPtr[0xA] |= 0x20; // Steal Eldin Bridge
+ eventBitsPtr[0xF] |= 0x8; // Put Eldin BRidge Back
+ }
+ }
+
+ /*void setFieldModels()
+ {
+ tp::d_item_data::ItemResource* itemResPtr = &tp::d_item_data::item_resource[0];
+ tp::d_item_data::FieldItemRes* fieldItemResPtr = &tp::d_item_data::field_item_res[0];
+
+ u32 loopCount = sizeof(item::itemsWithNoFieldModel) / sizeof(item::itemsWithNoFieldModel[0]);
+ for (u32 i = 0; i < loopCount; i++)
+ {
+ u32 item = item::itemsWithNoFieldModel[i]; // Retrieve as u32 to prevent rlwinm shenanigans
+ fieldItemResPtr[item].arcName = itemResPtr[item].arcName;
+ fieldItemResPtr[item].modelResIdx = itemResPtr[item].modelResIdx;
+ }
+
+ // For items that dont have a field model, use rupee item info to allow the item to be collected and whatnot
+ // Using the yellow rupee because thats what i used in testing
+ tp::d_item_data::ItemInfo* itemInfoPtr = &tp::d_item_data::item_info[0];
+ tp::d_item_data::ItemInfo* yellowRupeeInfoPtr = &tp::d_item_data::item_info[items::Yellow_Rupee];
+
+ loopCount = sizeof(item::itemsWithNoFieldModel) / sizeof(item::itemsWithNoFieldModel[0]);
+ for (u32 i = 0; i < loopCount; i++)
+ {
+ u32 item = item::itemsWithNoFieldModel[i]; // Retrieve as u32 to prevent rlwinm shenanigans
+ itemInfoPtr[item].mShadowSize = yellowRupeeInfoPtr->mShadowSize;
+ itemInfoPtr[item].mCollisionH = yellowRupeeInfoPtr->mCollisionH;
+ itemInfoPtr[item].mCollisionR = yellowRupeeInfoPtr->mCollisionR;
+ itemInfoPtr[item].mFlags = yellowRupeeInfoPtr->mFlags;
+ }
+
+ // Modify a branch in itemGetNextExecute to allow the item get cutscene to play with items past 0x40
+ // If you already have the item it gives you, then itll act like a rupee and appear over your head. This could be
+ changed though. u32 address_US = 0x8015CF64; *reinterpret_cast<u32*>(address_US) = 0x48000018; // b 0x18
+
+ // Hook dStage_actorCommonLayerInit to search for field items (probably only rupees) to replace based on object name
+ bool procActorCommonLayerInit(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, s32 unk3, void*
+ unk4)
+ {
+ Actr* actrPtr = chunkTypeInfo->chunkDataPtr;
+ u32 numChunks = chunkTypeInfo->numChunks;
+ for (u32 i = 0; i < numChunks; i++)
+ {
+ // Check for "item", as that seems to be whats used for rupees
+ // Would check for chests and whatnot as well when changing the contents of those
+ if (strncmp(actrPtr->objectName, "item", sizeof(Actr.objectName)))
+ {
+ // Change the item id
+ u8* tempParamBytes = reinterpret_cast<u8*>(&actrPtr->parameters);
+ tempParamBytes[3] = newItemId;
+
+ // Changing the parameters probably isnt necessary for "item", but I'll add them anyway
+ // Refer to Winditor for what the parameters do
+ tempParamBytes[0] = 0xF3;
+ tempParamBytes[1] = 0xFF;
+ tempParamBytes[2] = 0x80;
+ actrPtr->rot[2] = 0x3F;
+ }
+ }
+ }
+
+ // hook dStage_actorInit to search for field items (probably only heart containers) to replace based on object name
+ // Not sure what is passed into dStage_actorInit, but r4 seems to be the same as dStage_actorCommonLayerInit
+ bool procActorCommonLayerInit(void* mStatus_roomControl, tp::d_stage::dzxChunkTypeInfo* chunkTypeInfo, s32 unk3, void*
+ unk4)
+ {
+ Actr* actrPtr = chunkTypeInfo->chunkDataPtr;
+ u32 numChunks = chunkTypeInfo->numChunks;
+ for (u32 i = 0; i < numChunks; i++)
+ {
+ // Check for "htPiece", as that seems to be whats used for heart pieces
+ // Not sure what name heart containers use
+ if (strncmp(actrPtr->objectName, "htPiece", sizeof(Actr.objectName)))
+ {
+ // Change the object name to "item"
+ strncpy(actrPtr->objectName, "item", sizeof(Actr.objectName));
+
+ // Change the item id
+ u8* tempParamBytes = reinterpret_cast<u8*>(&actrPtr->parameters);
+ tempParamBytes[3] = newItemId;
+
+ // Changing the parameters is necessary for this, as its being changed to use rupee parameters
+ // Currently allows the item to respawn, so need to look into what handles that
+ // Refer to Winditor for what the parameters do
+ tempParamBytes[0] = 0xF3;
+ tempParamBytes[1] = 0xFF;
+ tempParamBytes[2] = 0x80;
+ actrPtr->rot[2] = 0x3F;
+ }
+ }
+ }
+ }*/
+} // namespace mod::game_patch \ No newline at end of file
diff --git a/source/grottoChecks.cpp b/source/grottoChecks.cpp
index 7b5cf37..bf4823e 100644
--- a/source/grottoChecks.cpp
+++ b/source/grottoChecks.cpp
@@ -1,104 +1,71 @@
#include "grottoChecks.h"
-#include "defines.h"
+#include "defines.h"
namespace mod::grottoChecks
{
- u16 g1_0[1]//Lanayru2
- {
- 73
- };
- u16 g1_1[2]//Eldin2
- {
- 121,
- 122
- };
- u16 g1_2[1]//Ordon
- {
- 167
- };
- u16 g1_3[2]//Lanayru3
- {
- 434,//poe 30
- 435//poe 31
- };
+ u16 g1_0[1] // Lanayru2
+ { 73 };
+ u16 g1_1[2] // Eldin2
+ { 121, 122 };
+ u16 g1_2[1] // Ordon
+ { 167 };
+ u16 g1_3[2] // Lanayru3
+ {
+ 434, // poe 30
+ 435 // poe 31
+ };
- u16 g2_0[3]//Eldin4
- {
- 163,
- 164,
- 165
- };
- u16 g2_1[3]//Faron1
- {
- 111,
- 112,
- 113
- };
- u16 g2_2[1]//Sacred
- {
- 72
- };
- /*u16 g2_3[0]//Eldin1
- {
+ u16 g2_0[3] // Eldin4
+ { 163, 164, 165 };
+ u16 g2_1[3] // Faron1
+ { 111, 112, 113 };
+ u16 g2_2[1] // Sacred
+ { 72 };
+ /*u16 g2_3[0]//Eldin1
+ {
- };*/
+ };*/
- u16 g3_0[3]//Gerudo3
- {
- 132,
- 420,//poe 16
- 421//poe 17
- };
- /*u16 g3_1[0]//Gerudo2
- {
+ u16 g3_0[3] // Gerudo3
+ {
+ 132,
+ 420, // poe 16
+ 421 // poe 17
+ };
+ /*u16 g3_1[0]//Gerudo2
+ {
- };*/
- /*u16 g3_2[0]//Snowpeak2
- {
+ };*/
+ /*u16 g3_2[0]//Snowpeak2
+ {
- };*/
- /*u16 g3_3[0]//Lanayru5
- {
+ };*/
+ /*u16 g3_3[0]//Lanayru5
+ {
- };*/
+ };*/
- u16 g4_0[1]//Lanayru6
- {
- 108
- };
- u16 g4_1[1]//Gerudo1
- {
- 124
- };
- u16 g4_2[1]//Snowpeak1
- {
- 189
- };
- u16 g4_3[1]//Lanayru4
- {
- 105
- };
+ u16 g4_0[1] // Lanayru6
+ { 108 };
+ u16 g4_1[1] // Gerudo1
+ { 124 };
+ u16 g4_2[1] // Snowpeak1
+ { 189 };
+ u16 g4_3[1] // Lanayru4
+ { 105 };
- u16 g5_0[1]//Lanayru1
- {
- 120
- };
- /*u16 g5_1[0]//Faron2
- {
+ u16 g5_0[1] // Lanayru1
+ { 120 };
+ /*u16 g5_1[0]//Faron2
+ {
- };*/
- u16 g5_2[1]//Lake2
- {
- 89
- };
- u16 g5_3[1]//Eldin3
- {
- 123
- };
- u16 g5_4[1]//Lake1
- {
- 102
- };
+ };*/
+ u16 g5_2[1] // Lake2
+ { 89 };
+ u16 g5_3[1] // Eldin3
+ { 123 };
+ u16 g5_4[1] // Lake1
+ { 102 };
-} \ No newline at end of file
+} // namespace mod::grottoChecks \ No newline at end of file
diff --git a/source/item.cpp b/source/item.cpp
index f0f57fe..411bae3 100644
--- a/source/item.cpp
+++ b/source/item.cpp
@@ -1,124 +1,121 @@
#include "item.h"
-#include "items.h"
-#include "defines.h"
+
#include <tp/d_com_inf_game.h>
+#include "defines.h"
+#include "items.h"
+
namespace mod::item
{
- u8 itemGetAnimationFlags[10] =
- {
- static_cast<u8>(ItemFlags::Blue_Rupee),
- static_cast<u8>(ItemFlags::Yellow_Rupee),
- static_cast<u8>(ItemFlags::Red_Rupee),
- static_cast<u8>(ItemFlags::Purple_Rupee),
- static_cast<u8>(ItemFlags::Orange_Rupee),
- static_cast<u8>(ItemFlags::Seeds_50),
- static_cast<u8>(ItemFlags::Arrows_30),
- static_cast<u8>(ItemFlags::Arrows_20),
- static_cast<u8>(ItemFlags::Arrows_10),
- static_cast<u8>(ItemFlags::Arrows_1),
- };
- u32 getFlags(u8 item, u32 currentPlayerConditions)
- {
- u32 flags = currentPlayerConditions;
- switch(item)
- {
- case items::Item::Lantern:
- flags |= item::Condition::Lantern;
- break;
-
- case items::Item::Iron_Boots:
- flags |= item::Condition::Iron_Boots;
- break;
-
- case items::Item::Boomerang:
- flags |= item::Condition::Boomerang;
- break;
-
- case items::Item::Slingshot:
- flags |= item::Condition::Slingshot;
- break;
-
- case items::Item::Heros_Bow:
- flags |= item::Condition::Bow;
- break;
-
- case items::Item::Goron_Bomb_Bag:
- flags |= item::Condition::Bombs;
- flags |= item::Condition::Water_Bombs;
- break;
-
- case items::Item::Empty_Bomb_Bag:
- flags |= item::Condition::Bombs;
- flags |= item::Condition::Water_Bombs;
- break;
-
- case items::Item::Ball_and_Chain:
- flags |= item::Condition::Ball_And_Chain;
- break;
-
- case items::Item::Clawshot:
- flags |= item::Condition::Clawshot;
- break;
-
- case items::Item::Clawshots:
- flags |= item::Condition::Double_Clawshot;
- break;
-
- case items::Item::Spinner:
- flags |= item::Condition::Spinner;
- break;
-
- case items::Item::Dominion_Rod_Uncharged:
- flags |= item::Condition::Dominion_Rod;
- break;
-
- case items::Item::Zora_Armor:
- flags |= item::Condition::Zora_Armor;
- break;
-
- case items::Item::Coral_Earring:
- flags |= item::Condition::Coral_Earring;
- break;
-
- case items::Item::Wooden_Sword:
- flags |= item::Condition::Wooden_Sword;
- break;
-
- case items::Item::Ordon_Sword:
- flags |= item::Condition::Ordon_Sword;
- break;
-
- case items::Item::Shadow_Crystal:
- flags |= item::Condition::Shadow_Crystal;
- break;
-
- case items::Item::Ordon_Shield:
- flags |= item::Condition::Shield;
- break;
-
- case items::Item::Wooden_Shield:
- flags |= item::Condition::Shield;
- break;
-
- case items::Item::Hylian_Shield:
- flags |= item::Condition::Shield;
- break;
-
- }
-
- if ((flags & item::Condition::Bow) && ((flags & item::Condition::Bombs) || (flags & item::Condition::Water_Bombs)))
- {
- // We have bow && (bombs || waterbombs) = bombarrows
- flags |= item::Condition::Bomb_Arrows;
- }
-
- return flags;
- }
-
- u8 itemsWithNoFieldModel[2] =
- {
- 0x32,
- 0x40
- };
-} \ No newline at end of file
+ u8 itemGetAnimationFlags[10] = {
+ static_cast<u8>( ItemFlags::Blue_Rupee ),
+ static_cast<u8>( ItemFlags::Yellow_Rupee ),
+ static_cast<u8>( ItemFlags::Red_Rupee ),
+ static_cast<u8>( ItemFlags::Purple_Rupee ),
+ static_cast<u8>( ItemFlags::Orange_Rupee ),
+ static_cast<u8>( ItemFlags::Seeds_50 ),
+ static_cast<u8>( ItemFlags::Arrows_30 ),
+ static_cast<u8>( ItemFlags::Arrows_20 ),
+ static_cast<u8>( ItemFlags::Arrows_10 ),
+ static_cast<u8>( ItemFlags::Arrows_1 ),
+ };
+ u32 getFlags( u8 item, u32 currentPlayerConditions )
+ {
+ u32 flags = currentPlayerConditions;
+ switch ( item )
+ {
+ case items::Item::Lantern:
+ flags |= item::Condition::Lantern;
+ break;
+
+ case items::Item::Iron_Boots:
+ flags |= item::Condition::Iron_Boots;
+ break;
+
+ case items::Item::Boomerang:
+ flags |= item::Condition::Boomerang;
+ break;
+
+ case items::Item::Slingshot:
+ flags |= item::Condition::Slingshot;
+ break;
+
+ case items::Item::Heros_Bow:
+ flags |= item::Condition::Bow;
+ break;
+
+ case items::Item::Goron_Bomb_Bag:
+ flags |= item::Condition::Bombs;
+ flags |= item::Condition::Water_Bombs;
+ break;
+
+ case items::Item::Empty_Bomb_Bag:
+ flags |= item::Condition::Bombs;
+ flags |= item::Condition::Water_Bombs;
+ break;
+
+ case items::Item::Ball_and_Chain:
+ flags |= item::Condition::Ball_And_Chain;
+ break;
+
+ case items::Item::Clawshot:
+ flags |= item::Condition::Clawshot;
+ break;
+
+ case items::Item::Clawshots:
+ flags |= item::Condition::Double_Clawshot;
+ break;
+
+ case items::Item::Spinner:
+ flags |= item::Condition::Spinner;
+ break;
+
+ case items::Item::Dominion_Rod_Uncharged:
+ flags |= item::Condition::Dominion_Rod;
+ break;
+
+ case items::Item::Zora_Armor:
+ flags |= item::Condition::Zora_Armor;
+ break;
+
+ case items::Item::Coral_Earring:
+ flags |= item::Condition::Coral_Earring;
+ break;
+
+ case items::Item::Wooden_Sword:
+ flags |= item::Condition::Wooden_Sword;
+ break;
+
+ case items::Item::Ordon_Sword:
+ flags |= item::Condition::Ordon_Sword;
+ break;
+
+ case items::Item::Shadow_Crystal:
+ flags |= item::Condition::Shadow_Crystal;
+ break;
+
+ case items::Item::Ordon_Shield:
+ flags |= item::Condition::Shield;
+ break;
+
+ case items::Item::Wooden_Shield:
+ flags |= item::Condition::Shield;
+ break;
+
+ case items::Item::Hylian_Shield:
+ flags |= item::Condition::Shield;
+ break;
+ }
+
+ if ( ( flags & item::Condition::Bow ) &&
+ ( ( flags & item::Condition::Bombs ) || ( flags & item::Condition::Water_Bombs ) ) )
+ {
+ // We have bow && (bombs || waterbombs) = bombarrows
+ flags |= item::Condition::Bomb_Arrows;
+ }
+
+ return flags;
+ }
+
+ u8 itemsWithNoFieldModel[2] = { 0x32, 0x40 };
+} // namespace mod::item \ No newline at end of file
diff --git a/source/itemChecks.cpp b/source/itemChecks.cpp
index 32e7951..f45ff9a 100644
--- a/source/itemChecks.cpp
+++ b/source/itemChecks.cpp
@@ -1,610 +1,6665 @@
-#include "item.h"
#include "itemChecks.h"
-#include "stage.h"
-#include "defines.h"
+#include "defines.h"
+#include "item.h"
+#include "stage.h"
namespace mod::item
{
- ItemCheck checks[505] = {
- /* 0 */{0x3F, 1, stage::allStages[65], 4, 0x0, 0x0, 0b000000000000000000000, -1.6259740, 0.0000000, -207.4881290, nullptr, nullptr}, //Wooden Sword Chest
- /* 1 */{0x03, 7, stage::allStages[40], 0, 0x1, 0xFF, 0b110000000000000000100, -3550.8691410, 4450.0000000, -694.8996580, nullptr, nullptr}, // South Faron Cave Small Chest
- /* 2 */{0xEE, 8, stage::allStages[45], 14, 0x1, 0xFF, 0b000000000000000000100, 1221.9044190, 50.0000000, -7.9423170, nullptr, nullptr}, //North Faron Cave Key Chest
- /* 3 */{0x21, 3, stage::allStages[45], 14, 0x1, 0xFF, 0b110000000000000000100, 1528.0000000, 250.0000000, -22.0000000, nullptr, nullptr}, //North Faron Cave Heart Piece Chest
- /* 4 */{0x03, 7, stage::allStages[45], 6, 0x1, 0xFF, 0b000000000000000000100, -38292.5312500, 400.0000000, -23129.9550780, nullptr, nullptr}, //Small Chest North of Trill
- /* 5 */{0xED, 7, stage::allStages[65], 7, 0x0, 0xFF, 0b110010000000000001000, 128.7043760, -1077.0000000, -607.5000000, nullptr, nullptr}, //Link's Basement Chest
- /* 6 */{0x03, 7, stage::allStages[6], 22, 0x1, 0xFF, 0b000000000000000000000, 900.0000000, 3110.0000000, 15825.0000000, nullptr, nullptr}, //FT Entrance Vine Chest
- /* 7 */{0x04, 7, stage::allStages[6], 0, 0x1, 0xFF, 0b100100000000000000000, 0.0000000, 2700.0000000, 5550.0000000, nullptr, nullptr}, //FT Central Chest Behind Stairs
- /* 8 */{0x23, 2, stage::allStages[6], 0, 0x1, 0x1, 0b110000000000000000000, 550.0000000, 3301.0095210, 5325.0000000, nullptr, nullptr}, //FT Map Chest
- /* 9 */{0x20, 8, stage::allStages[6], 9, 0x1, 0xFF, 0b110000000000000000000, 6908.0000000, 3580.2719730, -3305.0000000, nullptr, nullptr}, //FT Windless Bridge Chest
- /* 10 */{0x03, 7, stage::allStages[6], 2, 0x1, 0xFF, 0b110000000000000100000, 11559.7548830, 3152.0000000, 3761.2187500, nullptr, nullptr}, //FT Second Monkey Under Bridge Chest
- /* 11 */{0x20, 8, stage::allStages[6], 5, 0x1, 0xFF, 0b100000000000000100000, -9108.924805, 3302.0000000, 5547.310059, nullptr, nullptr}, //FT Totem Pole Chest
- /* 12 */{0x04, 7, stage::allStages[6], 5, 0x1, 0xFF, 0b100000000000000100000, -11721.1455080, 3750.0000000, 4717.8212890, nullptr, nullptr}, //FT West Tile Worm Small Chest
- /* 13 */{0x21, 3, stage::allStages[6], 3, 0x1, 0xFF, 0b110000000000000000000, -4000.0000000, 2955.5900880, 9075.0000000, nullptr, nullptr}, //FT Deku Like Heart Piece Chest
- /* 14 */{0x21, 3, stage::allStages[6], 5, 0x1, 0xFF, 0b110100000000000100000, -14275.0000000, 3402.7832030, 6150.0000000, nullptr, nullptr}, //FT West Tile Worm Heart Piece Chest
- /* 15 */{0x24, 2, stage::allStages[6], 0, 0x1, 0x1, 0b100100000000000000000, 0.0000000, 3150.0000000, 7125.0000000, nullptr, nullptr}, //FT Compass Chest
- /* 16 */{0x26, 2, stage::allStages[6], 1, 0x1, 0x1, 0b100100000000000000000, 9225.0009770, 3471.9599610, 8465.1347660, nullptr, nullptr}, //FT Big Key Chest
- /* 17 */{0x03, 7, stage::allStages[6], 1, 0x1, 0xFF, 0b000000000000000000000, 10261.0000000, 3175.0000000, 8295.0000000, nullptr, nullptr}, //FT East Water Cave Chest
- /* 18 */{0x20, 8, stage::allStages[6], 10, 0x2, 0xFF, 0b000100000010000000000, 1174.2510990, 5002.3901370, -9219.0937500, nullptr, nullptr}, //FT North Deku Like Chest
- /* 19 */{0x04, 7, stage::allStages[6], 11, 0x2, 0xFF, 0b100100000000000100000, 11183.0000000, 3806.5500490, -6305.0000000, nullptr, nullptr}, //FT East Tile Worm Chest
- /* 20 */{0x04, 7, stage::allStages[68], 2, 0x2, 0xFF, 0b000000000000000000000, -70.0000000, -6.0440000, -670.0000000, nullptr, nullptr}, //Kakariko Inn Small Chest
- /* 21 */{0x45, 0, stage::allStages[65], 0, 0x2, 0x2, 0b000000000000000000000, 320.8111880, 9.7100000, 1017.9390870, nullptr, nullptr}, //Iron Boots Chest
- /* 22 */{0x04, 7, stage::allStages[3], 1, 0x3, 0xFF, 0b001000000000000000000, 1050.0000000, -258.1840820, 13750.0000000, nullptr, nullptr}, //GM Entrance Small Chest
- /* 23 */{0x20, 8, stage::allStages[3], 3, 0x3, 0xFF, 0b001000000000000000000, 2700.0000000, -1378.3521730, 5175.0000000, nullptr, nullptr}, //GM Main Magnet Room Bottom Chest
- /* 24 */{0x23, 2, stage::allStages[3], 14, 0x3, 0x3, 0b001000000000000100000, -15984.1562500, -710.5994260, 1504.4143070, nullptr, nullptr}, //GM Map Chest
- /* 25 */{0x04, 7, stage::allStages[3], 14, 0x3, 0xFF, 0b001000000000000000000, -16176.0000000, -561.3822020, 895.0000000, nullptr, nullptr}, //GM Gor Amato Small Chest
- /* 26 */{0x21, 3, stage::allStages[3], 4, 0x3, 0xFF, 0b001000000000000000000, -5625.0000000, 448.7841190, 75.0000000, nullptr, nullptr}, //GM Magnet Maze Heart Piece Chest
- /* 27 */{0x20, 8, stage::allStages[3], 6, 0x3, 0xFF, 0b001000000000000000000, 1125.0000000, 600.0000000, -4725.0000000, nullptr, nullptr}, //GM Switch Room Underwater Chest
- /* 28 */{0x04, 7, stage::allStages[3], 6, 0x3, 0xFF, 0b001000000000000000000, 1000.0000000, 1650.0000000, -5650.0000000, nullptr, nullptr}, //GM Switch Room Small Chest
- /* 29 */{0x21, 3, stage::allStages[3], 6, 0x3, 0xFF, 0b001000000000000000000, -1350.0000000, 2350.0000000, -6200.0000000, nullptr, nullptr}, //GM After Switch Room Heart Piece Chest
- /* 30 */{0x20, 8, stage::allStages[3], 7, 0x3, 0xFF, 0b101000000000000100000, -1050.0000000, 2425.0000000, -14825.0000000, nullptr, nullptr}, //GM Outside Bemos Chest
- /* 31 */{0x03, 7, stage::allStages[3], 17, 0x3, 0xFF, 0b101000000000000100000, 13900.0000000, 2997.0900880, -17175.0000000, nullptr, nullptr}, //GM Gor Ebizo Small Chest
- /* 32 */{0x03, 7, stage::allStages[3], 9, 0x3, 0xFF, 0b101000000000000100000, 9950.0000000, 2475.0000000, -15375.0000000, nullptr, nullptr}, //GM Small Chest Before Dangoro
- /* 33 */{0x43, 0, stage::allStages[3], 11, 0x3, 0x3, 0b001000000000000000000, 7997.9995120, 2640.0000000, -5355.0000000, nullptr, nullptr}, //GM Bow Chest
- /* 34 */{0x24, 2, stage::allStages[3], 11, 0x4, 0x4, 0b101001000000000000000, 6488.3676760, 2640.0000000, -1673.5349120, nullptr, nullptr}, //GM Compass Chest
- /* 35 */{0x05, 7, stage::allStages[3], 16, 0x4, 0xFF, 0b101001000000000000000, 13975.0000000, 2476.4899900, -1675.0000000, nullptr, nullptr}, //GM Gor Liggs Small Chest
- /* 36 */{0x05, 7, stage::allStages[3], 3, 0x4, 0xFF, 0b101001000000000000000, 3625.0000000, 2637.8999020, 4050.0000000, nullptr, nullptr}, //GM Main Magnet Room Top Chest
- /* 37 */{0x05, 7, stage::allStages[3], 7, 0x4, 0xFF, 0b001000000000000000000, 2325.0000000, 1100.0000000, -17400.0000000, nullptr, nullptr}, //GM Outside Underwater Chest
- /* 38 */{0x21, 3, stage::allStages[46], 0, 0x5, 0xFF, 0b101000100000000000000, 1300.0000000, -1600.0000000, 16700.0000000, nullptr, nullptr}, //Eldin Spring Heart Piece Chest
- /* 39 */{0x05, 7, stage::allStages[48], 0, 0x2, 0xFF, 0b010000000000000000000, 16050.0000000, 200.0000000, 725.0000000, nullptr, nullptr}, //Kakariko Graveyard Lanturn Chest
- /* 40 */{0x05, 7, stage::allStages[68], 4, 0x3, 0xFF, 0b000000000000000000000, -887.4350590, 1000.0000000, -173.2907710, nullptr, nullptr}, //Kakariko Watchtower Chest
- /* 41 */{0x06, 7, stage::allStages[46], 0, 0x5, 0xFF, 0b000000101100000000000, -4027.7336430, 3200.0000000, -8970.9990230, nullptr, nullptr}, //Kakariko Watchtower Alcove Chest
- /* 42 */{0x21, 3, stage::allStages[56], 0, 0x5, 0xFF, 0b000000001000000000000, 11550.0000000, 2700.0000000, 24090.0000000, nullptr, nullptr}, //Eldin Bomb Rock Ledge Heart Piece Chest
- /* 43 */{0x03, 7, stage::allStages[50], 1, 0x5, 0xFF, 0b000000000000000000000, 2784.3178710, -4587.8901370, 10773.4140620, nullptr, nullptr}, //ZD Small Chest By Mother and Child Isles
- /* 44 */{0x04, 7, stage::allStages[50], 1, 0x8, 0xFF, 0b000000000000000000000, 3810.8435060, -3535.5300290, 11344.8876950, nullptr, nullptr}, //ZD Small Chest Under Waterfall
- /* 45 */{0x06, 7, stage::allStages[52], 0, 0x5, 0xFF, 0b001000000000000000000, -97123.5468750, -19490.0000000, 58585.6992190, nullptr, nullptr}, //Lake Hylia Underwater Chest
- /* 46 */{0x0F, 5, stage::allStages[0], 0, 0x6, 0xFF, 0b000000000000001000000, -1707.6793210, 1250.0000000, 15388.9882810, nullptr, nullptr}, //LBT Lobby Left Chest
- /* 47 */{0x17, 5, stage::allStages[0], 0, 0x6, 0xFF, 0b000000000000001000000, -144.6737980, 1250.0000000, 16525.8710940, nullptr, nullptr}, //LBT Lobby Rear Chest
- /* 48 */{0x17, 5, stage::allStages[0], 1, 0x6, 0xFF, 0b100000001000001000000, 1417.5971680, 1813.6099850, 7807.2255860, nullptr, nullptr}, //LBT Stalactite Room Small Chest
- /* 49 */{0x0F, 5, stage::allStages[0], 3, 0x6, 0xFF, 0b000000000000001000000, 1629.5045170, 0.0000000, 2049.6350100, nullptr, nullptr}, //LBT Central Room Small Chest
- /* 50 */{0x23, 2, stage::allStages[0], 3, 0x6, 0x6, 0b000000000000001000000, 2010.5773930, 0.0000000, -1656.3415530, nullptr, nullptr}, //LBT Map Chest
- /* 51 */{0x20, 8, stage::allStages[0], 8, 0x6, 0xFF, 0b100000001000001000000, 12900.0000000, -600.0000000, 1850.0000000, nullptr, nullptr}, //LBT East Stalactite Room Chest
- /* 52 */{0x16, 5, stage::allStages[0], 7, 0x6, 0xFF, 0b000000000000001100000, 8779.1152340, 1500.0000000, 1667.6258540, nullptr, nullptr}, //LBT East Second Floor Southwest Chest
- /* 53 */{0x20, 8, stage::allStages[0], 7, 0x6, 0xFF, 0b100000001000001100000, 11550.8037110, 1500.0000000, 2866.6462400, nullptr, nullptr}, //LBT East Second Floor Southeast Chest
- /* 54 */{0x17, 5, stage::allStages[0], 10, 0x6, 0xFF, 0b000000000000001100000, 18228.3320310, 3995.0000000, -466.3260800, nullptr, nullptr}, //LBT East Water Supply Small Chest
- /* 55 */{0x20, 8, stage::allStages[0], 9, 0x6, 0xFF, 0b000000000000001000000, 13550.0000000, 10.0000000, -2500.0000000, nullptr, nullptr}, //LBT Before Deku Toad Chest
- /* 56 */{0x04, 7, stage::allStages[0], 9, 0x6, 0xFF, 0b101000000000001100000, 13193.2910160, -1189.3100590, -2433.4060060, nullptr, nullptr}, //LBT Before Deku Toad Underwater Left Chest
- /* 57 */{0x16, 5, stage::allStages[0], 9, 0x6, 0xFF, 0b101000000000001100000, 13757.0000000, -1275.3310550, -4783.1503910, nullptr, nullptr}, //LBT Before Deku Toad Underwater Right Chest
- /* 58 */{0x44, 0, stage::allStages[2], 51, 0x6, 0x6, 0b000000000000001000000, 0.0000000, 0.0000000, 0.0000000, nullptr, nullptr}, //LBT Clawshot Chest
- /* 59 */{0x21, 3, stage::allStages[0], 3, 0x7, 0xFF, 0b100000000010001000000, -0.8691990, 2100.0000000, 2.1099050, nullptr, nullptr}, //LBT Chandelier Heart Piece Chest
- /* 60 */{0x05, 7, stage::allStages[0], 10, 0x7, 0xFF, 0b100000000010001100000, 21000.0000000, 4170.0000000, 85.0000000, nullptr, nullptr}, //LBT Eas Water Supply Clawshot Chest
- /* 61 */{0x04, 7, stage::allStages[0], 3, 0x7, 0xFF, 0b000000000000001000000, 0.0000000, -940.0000000, -315.5000000, nullptr, nullptr}, //LBT Central Room Center Spire Chest
- /* 62 */{0x17, 5, stage::allStages[0], 12, 0x7, 0xFF, 0b000000000010001000000, -10687.0947270, -299.3999940, -1161.5905760, nullptr, nullptr}, //LBT West Lower Small Chest
- /* 63 */{0x17, 5, stage::allStages[0], 13, 0x7, 0xFF, 0b100000000010001000000, -20310.0000000, 4015.0000000, 460.0000000, nullptr, nullptr}, //LBT West Water Supply Small Chest
- /* 64 */{0x24, 2, stage::allStages[0], 13, 0x7, 0x7, 0b100000000010001000000, -23100.0000000, 4200.0000000, -85.0000000, nullptr, nullptr}, //LBT Compass Chest
- /* 65 */{0x04, 7, stage::allStages[0], 11, 0x7, 0xFF, 0b101000000000001000000, -14158.2880860, 700.0000000, 2868.1103520, nullptr, nullptr}, //LBT West Second Floor Southwest Underwater Chest
- /* 66 */{0x04, 7, stage::allStages[0], 12, 0x7, 0xFF, 0b100000000010001000000, -10180.6718750, 1500.0000000, -1939.7305910, nullptr, nullptr}, //LBT West Second Floor Central Small Chest
- /* 67 */{0x04, 7, stage::allStages[0], 11, 0x7, 0xFF, 0b000000000000001000000, -10950.0000000, 1450.0000000, 2590.0000000, nullptr, nullptr}, //LBT West Second Floor Northeast Chest
- /* 68 */{0x18, 5, stage::allStages[0], 11, 0x7, 0xFF, 0b100000000010001000000, -9270.0000000, 1450.0000000, -2100.0000000, nullptr, nullptr}, //LBT West Second Floor Southeast Chest
- /* 69 */{0x26, 2, stage::allStages[0], 6, 0x7, 0x7, 0b101000001010001000000, -16549.8789060, -1345.7093510, 2820.3918460, nullptr, nullptr}, //LBT Big Key Chest
- /* 70 */{0x16, 5, stage::allStages[0], 5, 0x7, 0xFF, 0b101000000010001000000, -18544.2207030, -200.0000000, 475.5745850, nullptr, nullptr}, //LBT Underwater Maze Small Chest
- /* 71 */{0x21, 3, stage::allStages[0], 8, 0x7, 0xFF, 0b100000000010001000000, 11356.2246090, -550.0000000, 4896.6640620, nullptr, nullptr}, //LBT East Stalactite Heart Piece Chest
- /* 72 */{0x21, 3, stage::allStages[36], 1, 0x12, 0xFF, 0b100000100000000000010, -211.8681490, -61.3470460, -2693.1110840, nullptr, nullptr}, // Grotto - Deku Baba Heart Piece Chest
- /* 73 */{0x06, 7, stage::allStages[35], 0, 0x8, 0xFF, 0b100000000010000000010, 28.7614960, 2.9684250, -455.4558110, nullptr, nullptr}, //Grotto - Helmasaur Chest
- /* 74 */{0x1A, 5, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, -655.6493530, 1069.5000000, -4819.0908200, nullptr, nullptr}, //Lake Lanturn Cave First Chest
- /* 75 */{0x03, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 682.1680300, 1069.5000000, -6179.2060550, nullptr, nullptr}, //Lake Lanturn Cave Second Chest
- /* 76 */{0x04, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 2067.4831540, 966.9400020, -7130.3203120, nullptr, nullptr}, //Lake Lanturn Cave Third Chest
- /* 77 */{0x0E, 5, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 9980.4072270, 353.3800050, -7188.2241210, nullptr, nullptr}, //Lake Lanturn Cave Fourth Chest
- /* 78 */{0x04, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 8154.4853520, -721.9500120, -16215.0576170, nullptr, nullptr}, //Lake Lanturn Cave Fifth Chest
- /* 79 */{0x06, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 1585.2146000, -1584.6899410, -14877.4931640, nullptr, nullptr}, //Lake Lanturn Cave Sixth Chest
- /* 80 */{0x04, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 1678.4635010, -1586.6899410, -16192.1738280, nullptr, nullptr}, //Lake Lanturn Cave Seventh Chest
- /* 81 */{0x1A, 5, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, -642.0394290, -1703.1999510, -18994.8613280, nullptr, nullptr}, //Lake Lanturn Cave Eighth Chest
- /* 82 */{0x0E, 5, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, -7978.3588870, -2572.7099610, -16192.1738280, nullptr, nullptr}, //Lake Lanturn Cave Ninth Chest
- /* 83 */{0x05, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, -9292.6113280, -2572.7099610, -17523.3867190, nullptr, nullptr}, //Lake Lanturn Cave Tenth Chest
- /* 84 */{0x1B, 5, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 2974.3283690, -4197.5800780, -20501.6816410, nullptr, nullptr}, //Lake Lanturn Cave Eleventh Chest
- /* 85 */{0x05, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 1675.3985600, -4197.5800780, -21755.7343750, nullptr, nullptr}, //Lake Lanturn Cave Twelfth Chest
- /* 86 */{0x12, 5, stage::allStages[33], 0, 0x5, 0xFF, 0b000000001100000000000, 3981.5319820, -4081.0800780, -19125.3964840, nullptr, nullptr}, //Lake Lanturn Cave Thirtennth Chest
- /* 87 */{0x06, 7, stage::allStages[33], 0, 0x5, 0xFF, 0b110000001000000000000, 8324.2236330, -4070.1899410, -17814.0156250, nullptr, nullptr}, //Lake Lanturn Cave Fourteenth Chest
- /* 88 */{0x21, 3, stage::allStages[33], 0, 0x5, 0xFF, 0b110000001000000000000, 6582.5747070, -5144.5200200, -10032.9658200, nullptr, nullptr}, //Lake Lanturn Cave Heart Piece Chest
- /* 89 */{0x06, 7, stage::allStages[39], 4, 0x8, 0xFF, 0b000000000000000000010, -312.1882930, -27.1700000, -1501.0155030, nullptr, nullptr}, //Grotto - Water Toadpoli Chest
- /* 90 */{0x05, 7, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000010000000000, -91673.9453120, -16547.1699220, 49208.8203120, nullptr, nullptr}, //Outside Lanayru Spring - Left Statue Small Chest
- /* 91 */{0x06, 7, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000010000000000, -88884.070312, -16939.031250, 49405.648438, nullptr, nullptr}, //Outside Lanayru Spring - Right Statue Chest
- /* 92 */{0x02, 7, stage::allStages[52], 1, 0x5, 0xFF, 0b001000000000000000000, 593.5773930, -1276.7792970, 128.1360020, nullptr, nullptr}, //Lanayru Spring Underwater Left Chest
- /* 93 */{0x03, 7, stage::allStages[52], 1, 0x5, 0xFF, 0b001000000000000000000, -1262.2436520, -1380.8292240, 68.6994780, nullptr, nullptr}, //Lanayru Spring Underwater Right Chest
- /* 94 */{0x02, 7, stage::allStages[52], 1, 0x6, 0xFF, 0b000000000010000000000, -33.7100300, 1406.5571290, 4875.7338870, nullptr, nullptr}, //Lanayru Spring Southern Room Left Chest
- /* 95 */{0x0A, 5, stage::allStages[52], 1, 0x6, 0xFF, 0b000000000010000000000, 486.2900090, 1406.5479740, 4875.7338870, nullptr, nullptr}, //Lanayru Spring Southern Room Right Chest
- /* 96 */{0x21, 3, stage::allStages[52], 1, 0x6, 0xFF, 0b110000000010000000000, 224.6442720, 1406.5999760, 4862.4682620, nullptr, nullptr}, //Lanayru Spring Heart Piece Chest
- /* 97 */{0x06, 7, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000000000000000, -102601.6640620, -16650.6562500, 43399.9570310, nullptr, nullptr}, //Isle of Riches Top Platform
- /* 98 */{0x21, 3, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000000000000000, -102682.2031250, -17271.6835940, 43179.0781250, nullptr, nullptr}, //Isle of Riches 2nd Level
- /* 99 */{0x05, 7, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000000000000000, -102990.2421880, -17760.8300780, 42850.2382810, nullptr, nullptr}, //Isle of Riches 3rd Level
- /* 100 */{0x04, 7, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000000000000000, -103540.7812500, -18170.2578120, 42296.2421880, nullptr, nullptr}, //Isle of Riches 4th Level
- /* 101 */{0x03, 7, stage::allStages[52], 0, 0x6, 0xFF, 0b001000000000000000000, -104351.7031250, -18485.7714840, 41482.6367190, nullptr, nullptr}, //Isle of Riches 5th Level
- /* 102 */{ 0x06, 7, stage::allStages[39], 4, 0x8, 0xFF, 0b101000000000000000010, -371.4389950, -27.1700000, -1627.2565920, nullptr, nullptr }, //Grotto - Shell Blade Chest
- /* 103 */{0x05, 7, stage::allStages[50], 0, 0x6, 0xFF, 0b010000000000000000000, 200.0000000, -349.6226810, -1900.0000000, nullptr, nullptr}, //ZD Underwater Right Chest
- /* 104 */{0x05, 7, stage::allStages[50], 0, 0x6, 0xFF, 0b111100000000000000000, -200.0000000, -349.4964290, -1900.0000000, nullptr, nullptr}, //ZD Underwater Left Chest
- /* 105 */{ 0x05, 7, stage::allStages[38], 3, 0x8, 0xFF, 0b110000000000000000010, -1125.7841800, -133.9226530, -3012.3530270, nullptr, nullptr }, //Grotto - Skulltula Chest
- /* 106 */{0x06, 7, stage::allStages[56], 10, 0x6, 0xFF, 0b001000000000000000000, -46800.0000000, -4800.0000000, -22650.0000000, nullptr, nullptr}, //Behind Gate Underwater Chest
- /* 107 */{0x06, 7, stage::allStages[56], 13, 0x7, 0xFF, 0b000000000010000000000, -94100.0000000, -4420.0000000, 30009.9199220, nullptr, nullptr}, //Bridge Vines Chest
- /* 108 */{ 0x06, 7, stage::allStages[38], 3, 0x8, 0xFF, 0b110000000010000000010, -1061.2969970, -132.2552490, -3053.6071780, nullptr, nullptr }, //Grotto - Bubble Chest
- /* 109 */{0x05, 7, stage::allStages[56], 13, 0x7, 0xFF, 0b100000001010000000000, -80910.0000000, -6000.0000000, 64780.0000000, nullptr, nullptr}, //Outside Bubble Grotto Chest
- /* 110 */{0x06, 7, stage::allStages[56], 6, 0x7, 0xFF, 0b000000000010000000000, -46040.0000000, -9100.0000000, 80025.0000000, nullptr, nullptr}, //Faron Under Bridge Chest
- /* 111 */{ 0x04, 7, stage::allStages[36], 1, 0x8, 0xFF, 0b000000000000000000010, 578.9967040, -266.3237300, -2138.4619140, nullptr, nullptr }, //Grotto - Chu, Baba, and Keese Right Chest
- /* 112 */{ 0x03, 7, stage::allStages[36], 1, 0x8, 0xFF, 0b000000000000000000010, -281.6463620, -300.0000000, 910.2941280, nullptr, nullptr }, //Grotto - Chu, Baba, and Keese Rear Chest
- /* 113 */{ 0x04, 7, stage::allStages[36], 1, 0x8, 0xFF, 0b000000000000000000010, -754.0296020, -256.7704770, -3001.7814940, nullptr, nullptr }, //Grotto - Chu, Babe, and Keese Left Chest
- /* 114 */{0x21, 3, stage::allStages[47], 0, 0x4, 0xFF, 0b000000000000000000000, -1646.0109860, 379.2999880, 8487.9677730, nullptr, nullptr}, //Death Mountain Alcove Heart Piece Chest
- /* 115 */{0x05, 7, stage::allStages[3], 7, 0x7, 0xFF, 0b101000000010000000000, 2700.0000000, 4275.0000000, -19550.0000000, nullptr, nullptr}, //GM Outside Clawshot Chest
- /* 116 */{0x04, 7, stage::allStages[32], 0, 0x5, 0xFF, 0b000000001100000000000, -1056.4636230, 3145.5432130, -4376.8500980, nullptr, nullptr}, //Eldin Lantern Cave First Chest
- /* 117 */{0x21, 3, stage::allStages[32], 0, 0x5, 0xFF, 0b000000001100000000000, 6452.6201170, 4447.9018550, -6947.8505860, nullptr, nullptr}, //Eldin Lantern Cave Heart Piece Chest
- /* 118 */{0x05, 7, stage::allStages[32], 0, 0x5, 0xFF, 0b000000001100000000000, 7333.7602540, 4152.1391600, 1235.8031010, nullptr, nullptr}, //Eldin Lantern Cave Second Chest
- /* 119 */{ 0x06, 7, stage::allStages[57], 16, 0x8, 0xFF, 0b100000000010000000010, -53600.0000000, -3592.9699710, 23830.0000000, nullptr, nullptr }, //Castle Pillar Chest
- /* 120 */{ 0x06, 7, stage::allStages[39], 4, 0x8, 0xFF, 0b000000000000000000010, -240.3374330, -27.1700000, -1660.1081540, nullptr, nullptr }, //Grotto - Tetike Chest
- /* 121 */{ 0x05, 7, stage::allStages[35], 0, 0x8, 0xFF, 0b110000000000000000010, -1037.5682370, 1.0515240, -536.6557620, nullptr, nullptr }, //Grotto - Bombling Left Chest
- /* 122 */{ 0x05, 7, stage::allStages[35], 0, 0x8, 0xFF, 0b110000000000000000010, -193.2892910, 150.0000000, -1135.5745850, nullptr, nullptr }, //Grotto - Bombling Right Chest
- /* 123 */{ 0x05, 7, stage::allStages[39], 4, 0x8, 0xFF, 0b000000000000000000010, -251.5004430, -27.1700000, -1691.9121090, nullptr, nullptr }, //Grotto - Water Bomb Fish Chest
- /* 124 */{ 0x06, 7, stage::allStages[38], 3, 0x9, 0xFF, 0b000000000000000000010, -1066.0302730, -132.1377870, -3046.8808590, nullptr, nullptr }, //Grotto - Desert Skulltula Chest
- /* 125 */{ 0x04, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000010000000000, 51585.6210940, 1536.1500240, 58741.2500000, nullptr, nullptr }, //Desert Peahat Chest
- /* 126 */{ 0x04, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 51813.6796880, 171.0510250, 46656.2773440, nullptr, nullptr }, //East Canyon Chest
- /* 127 */{ 0x0E, 5, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 30472.5644530, 778.0640260, 50140.5703120, nullptr, nullptr }, //Desert Lone Small Chest
- /* 128 */{0x04, 7, stage::allStages[34], 10, 0x7, 0xFF, 0b000000000010000000000, 13825.0000000, 137.5000000, -34250.0000000, nullptr, nullptr}, //Eldin Stockcave Small Chest
- /* 129 */{0x06, 7, stage::allStages[34], 10, 0x7, 0xFF, 0b111000000010000000000, 9577.0000000, -2833.8898930, -33492.0000000, nullptr, nullptr}, //Eldin Stockcave Lanturn Chest
- /* 130 */{0x21, 3, stage::allStages[34], 10, 0x7, 0xFF, 0b101000000010000000000, 9515.7099610, -2850.0000000, -31912.3808590, nullptr, nullptr}, //Eldin Stockcave Heart Piece Chest
- /* 131 */{ 0x05, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000010000000000, -6940.8110350, 441.2112430, 48305.4023440, nullptr, nullptr },
- /* 132 */{ 0x06, 7, stage::allStages[37], 2, 0x9, 0xFF, 0b110000100010000000010, -128.8401180, 150.0000000, -1330.3356930, nullptr, nullptr },
- /* 133 */{ 0x04, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 9889.4482420, -732.8599850, 17813.8398440, nullptr, nullptr },
- /* 134 */{ 0x06, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 32741.2617190, 158.3099980, 68606.5468750, nullptr, nullptr },
- /* 135 */{ 0x04, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 3104.9711910, -732.8599850, 24575.0351560, nullptr, nullptr },
- /* 136 */{ 0x05, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 4945.0000000, -732.8599850, 25572.0000000, nullptr, nullptr },
- /* 137 */{ 0x0E, 5, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 1845.0000000, -732.8599850, 26130.0000000, nullptr, nullptr },
- /* 138 */{ 0x04, 7, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, -6532.4062500, -732.8599850, 20852.4121090, nullptr, nullptr },
- /* 139 */{ 0x0E, 5, stage::allStages[59], 0, 0x9, 0xFF, 0b000000000000000000000, 4681.0947270, -162.9400020, 12575.7626950, nullptr, nullptr },
- /* 140 */{ 0x0F, 5, stage::allStages[55], 1, 0x9, 0xFF, 0b000000000000000000000, 4761.6406250, 0.0000000, 1580.5701900, nullptr, nullptr },
- /* 141 */{ 0x05, 7, stage::allStages[55], 1, 0x9, 0xFF, 0b000000000000000000000, 2389.0454100, 260.0000000, -1473.3872070, nullptr, nullptr },
- /* 142 */{ 0x05, 7, stage::allStages[55], 3, 0x9, 0xFF, 0b010000000000000000000, 3633.6201170, 840.0000000, -12457.7001950, nullptr, nullptr },
- /* 143 */{ 0x20, 8, stage::allStages[24], 0, 0x9, 0xFF, 0b000000000000000000000, -3000.0000000, -19.0000000, 5600.0000000, nullptr, nullptr },
- /* 144 */{ 0x20, 8, stage::allStages[24], 15, 0x9, 0xFF, 0b000000000000000000000, 4125.0000000, -741.5800170, -2250.0000000, nullptr, nullptr },
- /* 145 */{ 0x21, 3, stage::allStages[24], 2, 0x9, 0xFF, 0b000000000000000000000, 1300.0000000, 62.5000000, -3012.5000000, nullptr, nullptr },
- /* 146 */{ 0x23, 2, stage::allStages[24], 2, 0x9, 0x9, 0b000000000000000000000, -1300.0000000, 50.0000000, -3012.5000000, nullptr, nullptr },
- /* 147 */{ 0x24, 2, stage::allStages[24], 4, 0x9, 0x9, 0b000000000000000100000, 9400.0000000, 990.0599980, 6100.0000000, nullptr, nullptr },
- /* 148 */{ 0x20, 8, stage::allStages[24], 4, 0x9, 0xFF, 0b000000000000000100000, 12275.0000000, 980.0000000, 4537.5000000, nullptr, nullptr },
- /* 149 */{ 0x20, 8, stage::allStages[24], 14, 0x9, 0xFF, 0b000000000000000100000, 4150.0000000, 825.0000000, 775.0000000, nullptr, nullptr },
- /* 150 */{ 0x04, 7, stage::allStages[24], 6, 0x9, 0xFF, 0b000000000000000000000, -4065.0000000, 150.0000000, -2660.0000000, nullptr, nullptr },
- /* 151 */{ 0x04, 7, stage::allStages[24], 6, 0x9, 0xFF, 0b000000000000000000000, -4450.0000000, 400.0000000, 1150.0000000, nullptr, nullptr },
- /* 152 */{ 0x0A, 5, stage::allStages[24], 7, 0x9, 0xFF, 0b000000100100000000000, -9975.0000000, 500.0000000, -600.0000000, nullptr, nullptr },
- /* 153 */{ 0x0A, 5, stage::allStages[24], 7, 0x9, 0xFF, 0b000000100100000000000, -8113.0000000, 500.0000000, -1382.0000000, nullptr, nullptr },
- /* 154 */{ 0x20, 8, stage::allStages[24], 16, 0x9, 0xFF, 0b000000000000000000000, 3970.0000000, -1050.0000000, -6080.0000000, nullptr, nullptr },
- /* 155 */{ 0x41, 0, stage::allStages[26], 51, 0x9, 0x9, 0b000100000010000000000, 0.0000000, 50.0000000, -6200.0000000, nullptr, nullptr },
- /* 156 */{ 0x0B, 5, stage::allStages[24], 13, 0x10, 0xFF, 0b000000000000100000000, -8331.4091800, -1800.0000000, -3677.7468260, nullptr, nullptr },
- /* 157 */{ 0x04, 7, stage::allStages[24], 13, 0x10, 0xFF, 0b000000000000100000000, -10212.5000000, -1840.0000000, -3725.0000000, nullptr, nullptr },
- /* 158 */{ 0x03, 7, stage::allStages[24], 13, 0x10, 0xFF, 0b000000000000100000000, -10812.5000000, -1825.0000000, -5712.5000000, nullptr, nullptr },
- /* 159 */{ 0x21, 3, stage::allStages[24], 13, 0x10, 0xFF, 0b000000000000100000000, -5475.0000000, -1325.0000000, -4875.0000000, nullptr, nullptr },
- /* 160 */{ 0x03, 7, stage::allStages[24], 13, 0x10, 0xFF, 0b000000000000100000000, -6225.0000000, -1125.0000000, -7275.0000000, nullptr, nullptr },
- /* 161 */{ 0x26, 2, stage::allStages[24], 9, 0x10, 0x10, 0b000000000000100000000, -3675.0000000, 500.0000000, -7250.0000000, nullptr, nullptr },
- /* 162 */{ 0x21, 3, stage::allStages[56], 11, 0x10, 0xFF, 0b000000000000100000000, -88260.0000000, 2950.0000000, -8150.0000000, nullptr, nullptr },
- /* 163 */{ 0x0A, 5, stage::allStages[36], 1, 0x10, 0xFF, 0b100000000000100000010, 464.9176030, -262.3106380, -709.6952510, nullptr, nullptr },
- /* 164 */{ 0x0A, 5, stage::allStages[36], 1, 0x10, 0xFF, 0b100000000000100000010, -1153.7760010, -255.8396450, -980.6660160, nullptr, nullptr },
- /* 165 */{ 0x21, 3, stage::allStages[36], 1, 0x10, 0xFF, 0b100000100000100000010, -211.8499450, -60.9387400, -2691.0991210, nullptr, nullptr },
- /* 166 */{ 0x06, 7, stage::allStages[57], 16, 0x10, 0xFF, 0b100000000010100000000, -51500.0000000, -5180.0000000, 25970.0000000, nullptr, nullptr },
- /* 167 */{ 0x05, 7, stage::allStages[35], 0, 0x8, 0xFF, 0b110000000000000000010, -277.2709660, 150.0000000, -1096.2886960, nullptr, nullptr },
- /* 168 */{0x04, 7, stage::allStages[45], 5, 0x1, 0xFF, 0b000000000000000000000, -25790.1093750, 330.0000000, -19842.9355470, nullptr, nullptr}, //Faron Mist Stump Chest
- /* 169 */{0x03, 7, stage::allStages[45], 5, 0x1, 0xFF, 0b000000000000000000000, -24845.1308590, -100.0000000, -26998.7226560, nullptr, nullptr}, //Faron Mist North Small Chest
- /* 170 */{0x05, 7, stage::allStages[45], 5, 0x1, 0xFF, 0b000000000000000000000, -25966.7851560, -83.1305240, -16071.9599610, nullptr, nullptr}, //Faron Mist East Chest
- /* 171 */{ 0x20, 8, stage::allStages[27], 4, 0x11, 0xFF, 0b000000000000000000000, -1500.0000000, -60.0000000, -4458.0000000, nullptr, nullptr },
- /* 172 */{ 0x04, 7, stage::allStages[27], 4, 0x11, 0xFF, 0b000000000000000000000, 1350.0000000, 50.0000000, -1400.0000000, nullptr, nullptr },
- /* 173 */{ 0xF4, 8, stage::allStages[27], 5, 0x11, 0x11, 0b000000000000000100000, 5300.0000000, 0.0000000, -5100.0000000, nullptr, nullptr },
- /* 174 */{ 0x20, 8, stage::allStages[27], 4, 0x11, 0xFF, 0b000000000000000000000, 1350.0000000, -40.0000000, -4150.0000000, nullptr, nullptr },
- /* 175 */{ 0x04, 7, stage::allStages[27], 8, 0x11, 0xFF, 0b000000100100000000000, -4355.0000000, 0.0000000, -2160.0000000, nullptr, nullptr },
- /* 176 */{ 0x24, 2, stage::allStages[27], 8, 0x11, 0x11, 0b000000100100000000000, -3510.0000000, 0.0000000, -1350.0000000, nullptr, nullptr },
- /* 177 */{ 0x0A, 5, stage::allStages[27], 4, 0x11, 0xFF, 0b000000100100000000000, 0.0000000, 0.0000000, -1250.0000000, nullptr, nullptr },
- /* 178 */{ 0xF5, 8, stage::allStages[29], 51, 0x12, 0x12, 0b000000000100000000000, 0.0000000, 0.0000000, -3196.0000000, nullptr, nullptr },
- /* 179 */{ 0x21, 3, stage::allStages[27], 7, 0x12, 0xFF, 0b000000000100000000000, -3600.0000000, 0.0000000, 1600.0000000, nullptr, nullptr },
- /* 180 */{ 0x20, 8, stage::allStages[27], 8, 0x12, 0xFF, 0b000000000100000000000, -4350.0000000, 950.0000000, -3850.0000000, nullptr, nullptr },
- /* 181 */{ 0x21, 3, stage::allStages[27], 0, 0x12, 0xFF, 0b000000000100000000000, 0.0000000, 1118.3201900, 4690.0000000, nullptr, nullptr },
- /* 182 */{ 0x04, 7, stage::allStages[27], 0, 0x12, 0xFF, 0b000000000100000000000, -900.0000000, -50.0000000, 5950.0000000, nullptr, nullptr },
- /* 183 */{ 0x03, 7, stage::allStages[27], 0, 0x12, 0xFF, 0b000000000100000000000, 930.0000000, -50.0000000, 5350.0000000, nullptr, nullptr },
- /* 184 */{ 0x20, 8, stage::allStages[27], 5, 0x12, 0xFF, 0b100000000110000000000, 4350.0000000, 953.0000000, -4900.0000000, nullptr, nullptr },
- /* 185 */{ 0x04, 7, stage::allStages[27], 9, 0x12, 0xFF, 0b000000000100000000000, -5347.3071290, -50.0000000, -6500.8867190, nullptr, nullptr },
- /* 186 */{ 0x0A, 5, stage::allStages[27], 9, 0x12, 0xFF, 0b000000100100000000000, -1818.3217770, 0.0000000, -7562.9838870, nullptr, nullptr },
- /* 187 */{ 0xF6, 2, stage::allStages[27], 11, 0x12, 0x12, 0b100000100100000000000, -4350.0000000, 1050.0000000, -8560.5742190, nullptr, nullptr },
- /* 188 */{ 0x06, 7, stage::allStages[51], 2, 0x12, 0xFF, 0b110000000100000000010, -6233.2583010, -1800.0000000, -9865.0205080, nullptr, nullptr },
- /* 189 */{ 0x06, 7, stage::allStages[38], 3, 0x12, 0xFF, 0b100000000100000000010, -810.7105710, -300.0000000, -2101.0502930, nullptr, nullptr },
- /* 190 */{ 0x21, 3, stage::allStages[30], 0, 0x12, 0xFF, 0b000000000100000000000, 0.0000000, 0.0000000, -7900.0000000, nullptr, nullptr },
- /* 191 */{ 0x0D, 5, stage::allStages[54], 3, 0x12, 0xFF, 0b110100000000000000000, -15394.4238280, 2300.0000000, 2483.9230960, nullptr, nullptr },
- /* 192 */{ 0x06, 7, stage::allStages[54], 3, 0x12, 0xFF, 0b000000000000100000000, -6840.3515620, 2000.0000000, 6329.0605470, nullptr, nullptr },
- /* 193 */{ 0x20, 8, stage::allStages[9], 0, 0x12, 0xFF, 0b110001000000000000000, 2500.0000000, 56.2500000, 368.7500000, nullptr, nullptr },
- /* 194 */{ 0x10, 5, stage::allStages[9], 1, 0x12, 0xFF, 0b000001000000000000000, -12.5000000, 1100.0000000, 8362.5000000, nullptr, nullptr },
- /* 195 */{ 0x04, 7, stage::allStages[9], 1, 0x12, 0xFF, 0b000001000000000000000, 5795.0000000, 2505.0000000, 4210.0000000, nullptr, nullptr },
- /* 196 */{ 0x23, 2, stage::allStages[9], 1, 0x12, 0x12, 0b000001000000000000000, 6925.0000000, 2325.0000000, 3400.0000000, nullptr, nullptr },
- /* 197 */{ 0x20, 8, stage::allStages[9], 3, 0x12, 0xFF, 0b100001000000100000000, -1737.5000000, 4500.0000000, 5812.5000000, nullptr, nullptr },
- /* 198 */{ 0x24, 2, stage::allStages[9], 4, 0x12, 0x12, 0b100001000000100000000, -3450.0000000, 4450.0000000, -5510.0000000, nullptr, nullptr },
- /* 199 */{ 0x05, 7, stage::allStages[9], 5, 0x12, 0xFF, 0b100001000000100000000, -30.0000000, 5750.0000000, -1515.0000000, nullptr, nullptr },
- /* 200 */{ 0x20, 8, stage::allStages[9], 7, 0x12, 0xFF, 0b100001000000100000000, 5319.0000000, 7550.0000000, 8592.7500000, nullptr, nullptr },
- /* 201 */{ 0x05, 7, stage::allStages[9], 7, 0x12, 0xFF, 0b100001000000100000000, 5300.0000000, 8100.0000000, -800.0000000, nullptr, nullptr },
- /* 202 */{ 0x46, 0, stage::allStages[11], 51, 0x12, 0x12, 0b100001000000100100000, 0.0000000, -350.0000000, -2400.0000000, nullptr, nullptr },
- /* 203 */{ 0x04, 7, stage::allStages[9], 5, 0x12, 0xFF, 0b100001000010100000000, 1195.0000000, 7400.0000000, 2350.0000000, nullptr, nullptr },
- /* 204 */{ 0x04, 7, stage::allStages[9], 6, 0x12, 0xFF, 0b100001000010100000000, 6135.0000000, 8000.0000000, 0.0000000, nullptr, nullptr },
- /* 205 */{ 0x26, 2, stage::allStages[9], 6, 0x12, 0x12, 0b100001000010100000000, 5350.0000000, 7400.0000000, 0.0000000, nullptr, nullptr },
- /* 206 */{ 0x21, 3, stage::allStages[9], 4, 0x13, 0xFF, 0b100001000000110000000, -8740.0000000, 5100.0000000, -4515.0000000, nullptr, nullptr },
- /* 207 */{ 0x04, 7, stage::allStages[9], 3, 0x12, 0xFF, 0b100001000000100000000, 0.0000000, 4850.0000000, 9200.0000000, nullptr, nullptr },
- /* 208 */{ 0x21, 3, stage::allStages[9], 3, 0x13, 0xFF, 0b100001000000110000000, 1740.0000000, 4500.0000000, 5815.0000000, nullptr, nullptr },
- /* 209 */{ 0x21, 3, stage::allStages[54], 2, 0x13, 0xFF, 0b100001000000010000000, 606.7956540, 1005.0000000, 8005.3901370, nullptr, nullptr },
- /* 210 */{ 0x04, 7, stage::allStages[53], 4, 0x13, 0xFF, 0b000000000000000000000, 6500.0000000, 426.0000000, -977.0000000, nullptr, nullptr },
- /* 211 */{ 0x21, 3, stage::allStages[56], 0, 0x13, 0xFF, 0b000000000000010000000, 31257.5957030, 900.0000000, -16115.4990230, nullptr, nullptr },
- /* 212 */{ 0x06, 7, stage::allStages[56], 3, 0x13, 0xFF, 0b000000000000010000000, -10245.4765620, -4400.0000000, 42817.0467500, nullptr, nullptr },
- /* 213 */{ 0x06, 7, stage::allStages[57], 8, 0x13, 0xFF, 0b000000000000010000000, -79819.4140620, -1301.2399900, 22400.6718750, nullptr, nullptr },
- /* 214 */{ 0x06, 7, stage::allStages[56], 13, 0x13, 0xFF, 0b100000000010010000000, -93284.5703120, -5000.0000000, 18235.7246090, nullptr, nullptr },
- /* 215 */{ 0x21, 3, stage::allStages[45], 5, 0x13, 0xFF, 0b100000100000010000000, -21012.1542970, 1350.0000000, -20630.3222660, nullptr, nullptr },
- /* 216 */{ 0x06, 7, stage::allStages[59], 0, 0x13, 0xFF, 0b000000000000010000000, 16263.9707030, 989.6500240, 60708.4648440, nullptr, nullptr },
- /* 217 */{ 0x18, 5, stage::allStages[12], 0, 0x14, 0xFF, 0b101000000010000000000, -1170.0834960, -755.0000000, 6670.0000000, nullptr, nullptr },
- /* 218 */{ 0x04, 7, stage::allStages[12], 0, 0x14, 0xFF, 0b101000000010000000000, 1170.0000000, -755.0000000, 6670.0000000, nullptr, nullptr },
- /* 219 */{ 0x20, 8, stage::allStages[12], 10, 0x15, 0xFF, 0b100000000010100000000, -14514.4443360, 0.0000000, -12000.8310550, nullptr, nullptr },
- /* 220 */{ 0x23, 2, stage::allStages[12], 5, 0x14, 0x14, 0b101000000010100000000, 17665.1347660, 0.0000000, -11924.1035160, nullptr, nullptr },
- /* 221 */{ 0x03, 7, stage::allStages[12], 7, 0x14, 0xFF, 0b101000000010100000000, 15824.6093750, -110.0000000, -9750.6855470, nullptr, nullptr },
- /* 222 */{ 0x04, 7, stage::allStages[12], 7, 0x14, 0xFF, 0b101000000010100000000, 17550.0000000, 1500.0000000, -7200.0000000, nullptr, nullptr },
- /* 223 */{ 0x05, 7, stage::allStages[12], 7, 0x14, 0xFF, 0b101000000010100000000, 13470.0000000, 1500.0000000, -7925.0000000, nullptr, nullptr },
- /* 224 */{ 0x47, 0, stage::allStages[14], 51, 0x14, 0x14, 0b101000000010100000000, -0.3629600, 600.0000000, 2279.7690430, nullptr, nullptr },
- /* 225 */{ 0x24, 2, stage::allStages[12], 4, 0x15, 0x15, 0b101000000001100000000, 10800.0000000, -1775.0000000, -11850.0000000, nullptr, nullptr },
- /* 226 */{ 0x0F, 5, stage::allStages[12], 10, 0x15, 0xFF, 0b100000000001100000000, -11099.1240230, -1500.0000000, -15658.8515620, nullptr, nullptr },
- /* 227 */{ 0x04, 7, stage::allStages[12], 10, 0x15, 0xFF, 0b100000000001100000000, -13458.7949220, 0.0000000, -13410.5566410, nullptr, nullptr },
- /* 228 */{ 0x0B, 5, stage::allStages[12], 10, 0x15, 0xFF, 0b100000000001100000000, -10742.9599610, 0.0000000, -15156.7197270, nullptr, nullptr },
- /* 229 */{ 0x03, 7, stage::allStages[12], 11, 0x15, 0xFF, 0b100000000001100000000, -15654.8398440, 2840.2299800, -18906.7890620, nullptr, nullptr },
- /* 230 */{ 0x0F, 5, stage::allStages[12], 11, 0x15, 0xFF, 0b100000000001100000000, -12630.1699220, 2430.8999020, -19611.4316410, nullptr, nullptr },
- /* 231 */{ 0x21, 3, stage::allStages[12], 11, 0x15, 0xFF, 0b100000000001100000000, -14567.1093750, 2281.0000000, -16989.0351560, nullptr, nullptr },
- /* 232 */{ 0x04, 7, stage::allStages[12], 12, 0x15, 0xFF, 0b100000000001100000000, -15782.7958980, 2980.0000000, -11466.6982420, nullptr, nullptr },
- /* 233 */{ 0x05, 7, stage::allStages[12], 12, 0x15, 0xFF, 0b100000000001100000000, -14270.5380860, 1982.1999510, -7411.9101560, nullptr, nullptr },
- /* 234 */{ 0x0A, 5, stage::allStages[12], 12, 0x15, 0xFF, 0b100000000001100000000, -12592.9677730, 2400.0000000, -13712.7675780, nullptr, nullptr },
- /* 235 */{ 0x21, 3, stage::allStages[12], 12, 0x15, 0xFF, 0b100000000001100000000, -11494.3183590, 3000.0000000, -9888.6738280, nullptr, nullptr },
- /* 236 */{ 0x04, 7, stage::allStages[12], 13, 0x15, 0xFF, 0b100000000001100000000, 75.2376170, 4500.0000000, -10853.4550780, nullptr, nullptr },
- /* 237 */{ 0x05, 7, stage::allStages[12], 13, 0x15, 0xFF, 0b100000000001100000000, 4010.3149410, 4500.0000000, -12451.9033200, nullptr, nullptr },
- /* 238 */{ 0x26, 2, stage::allStages[12], 2, 0x15, 0x15, 0b100000000001100000000, -1090.9830320, 4500.0000000, -12411.7617190, nullptr, nullptr },
- /* 239 */{ 0x04, 7, stage::allStages[12], 2, 0x15, 0xFF, 0b100000000001100000000, 11.8030090, 3000.0000000, -13501.7851560, nullptr, nullptr },
- /* 240 */{ 0x05, 7, stage::allStages[12], 14, 0x15, 0xFF, 0b100000000001100000000, 0.0000000, 894.4799800, -23853.0000000, nullptr, nullptr },
- /* 241 */{ 0x21, 3, stage::allStages[56], 3, 0x15, 0xFF, 0b000000000001000000000, -22100.0000000, -7176.0297850, 52140.0000000, nullptr, nullptr },
- /* 242 */{ 0x06, 7, stage::allStages[52], 1, 0x15, 0xFF, 0b000000000001000000000, -2816.4138180, 1305.0787350, -1395.7875980, nullptr, nullptr },
- /* 243 */{ 0x06, 7, stage::allStages[52], 1, 0x15, 0xFF, 0b000000000001000000000, 2798.9057620, 1322.1817720, -987.1356810, nullptr, nullptr },
- /* 244 */{ 0x06, 7, stage::allStages[57], 16, 0x15, 0xFF, 0b000000000001000000000, -57374.0820310, -9100.0000000, 29237.9062500, nullptr, nullptr },
- /* 245 */{ 0x20, 8, stage::allStages[15], 1, 0x15, 0xFF, 0b000000000000000000000, -3950.0000000, -1071.0000000, 1375.0000000, nullptr, nullptr },
- /* 246 */{ 0x20, 8, stage::allStages[15], 2, 0x15, 0xFF, 0b000000000010000100000, -3950.0000000, -1200.0000000, -5075.0000000, nullptr, nullptr },
- /* 247 */{ 0x24, 2, stage::allStages[15], 2, 0x15, 0x15, 0b000000000010000100000, -2700.0000000, -1196.0000000, -1661.0000000, nullptr, nullptr },
- /* 248 */{ 0x06, 7, stage::allStages[15], 2, 0x15, 0xFF, 0b000000000001000100000, -2400.0000000, -21.2500000, -1550.0000000, nullptr, nullptr },
- /* 249 */{ 0x21, 3, stage::allStages[15], 1, 0x15, 0xFF, 0b000000000010000000000, -6850.0000000, -771.2500000, 3200.0000000, nullptr, nullptr },
- /* 250 */{ 0x05, 7, stage::allStages[15], 4, 0x15, 0xFF, 0b000000000010000000000, 3250.0000000, -696.2500000, 1235.0000000, nullptr, nullptr },
- /* 251 */{ 0x20, 8, stage::allStages[15], 4, 0x15, 0xFF, 0b000000000010000000000, 4650.0000000, -696.2500000, 1235.0000000, nullptr, nullptr },
- /* 252 */{ 0x05, 7, stage::allStages[15], 5, 0x15, 0xFF, 0b000000000001000100000, 5700.0000000, 3.7500000, -4350.0000000, nullptr, nullptr },
- /* 253 */{ 0x05, 7, stage::allStages[15], 5, 0x15, 0xFF, 0b000000000001000100000, 2200.0000000, 3.7500000, -5100.0000000, nullptr, nullptr },
- /* 254 */{ 0x23, 2, stage::allStages[15], 5, 0x15, 0x15, 0b000000000001000100000, 2300.0000000, -396.2500000, -3300.0000000, nullptr, nullptr },
- /* 255 */{ 0x20, 8, stage::allStages[15], 5, 0x15, 0xFF, 0b000000000001000100000, 5600.0000000, -296.2500000, -3300.0000000, nullptr, nullptr },
- /* 256 */{ 0x21, 3, stage::allStages[15], 4, 0x15, 0xFF, 0b000000000001000000000, 5352.5000000, -171.2500000, 3500.0000000, nullptr, nullptr },
- /* 257 */{ 0x05, 7, stage::allStages[15], 4, 0x15, 0xFF, 0b000000000001000000000, 2547.5000000, -171.2500000, 3500.0000000, nullptr, nullptr },
- /* 258 */{0x20, 8, stage::allStages[15], 7, 0xFF, 0xFF, 0b000000000001000000000, 1500.0000000, 128.7500000, 6250.0000000, nullptr, nullptr}, //PoT Central First Room Chest
- /* 259 */{0x26, 2, stage::allStages[15], 11, 0xFF, 0xFF, 0b000000000001000100000, 0.0000000, 3130.0000000, -3600.0000000, nullptr, nullptr}, //PoT Big Key Chest
- /* 260 */{0x20, 8, stage::allStages[15], 11, 0xFF, 0xFF, 0b000000000001000100000, -2900.0000000, -71.2500000, -2055.0000000, nullptr, nullptr}, //PoT Central Outdoor Chest
- /* 261 */{0x20, 8, stage::allStages[15], 8, 0xFF, 0xFF, 0b000000000001000100000, -800.0000000, 1130.0000000, 1200.0000000, nullptr, nullptr}, //PoT Central Tower Chest
- /* 262 */{0x06, 7, stage::allStages[20], 9, 0xFF, 0xFF, 0b000000100000000000000, 4025.0000000, 152.0000000, -11735.0000000, nullptr, nullptr}, //HC Graveyard Grave Switch Room Right Chest
- /* 263 */{0x01, 7, stage::allStages[20], 9, 0xFF, 0xFF, 0b000000100000000000000, 3850.0000000, 152.0000000, -12725.0000000, nullptr, nullptr}, //HC Graveyard Grave Switch Room Front Left Small Chest
- /* 264 */{0x04, 7, stage::allStages[20], 9, 0xFF, 0xFF, 0b000000100000000000000, 4075.0000000, 150.0000000, -12725.0000000, nullptr, nullptr}, //HC Graveyard Grave Switch Room Back Left Small Chest
- /* 265 */{0x20, 8, stage::allStages[20], 9, 0xFF, 0xFF, 0b110000100000010000000, 375.0000000, 600.0000000, -6900.0000000, nullptr, nullptr}, //HC Graveyard Owl Statue Chest
- /* 266 */{0x23, 2, stage::allStages[20], 14, 0xFF, 0xFF, 0b000100000000000000000, 1210.0000000, 0.0000000, -7002.0000000, nullptr, nullptr}, //HC Map Chest
- /* 267 */{0x03, 7, stage::allStages[20], 14, 0xFF, 0xFF, 0b000100000000000000000, 4775.0000000, 1200.0000000, 3875.0000000, nullptr, nullptr}, //HC East Castle Balcony Chest
- /* 268 */{0x04, 7, stage::allStages[20], 13, 0xFF, 0xFF, 0b000000000000000000000, -6420.0000000, 30.0000000, -8017.8183590, nullptr, nullptr}, //HC West Courtyard Northern Small Chest
- /* 269 */{0x04, 7, stage::allStages[20], 13, 0xFF, 0xFF, 0b000000000000000000000, -6400.0000000, 350.0000000, 125.0000000, nullptr, nullptr}, //HC West Courtyard Central Small Chest
- /* 270 */{0x24, 2, stage::allStages[20], 1, 0xFF, 0xFF, 0b000000000010000100000, 2400.0000000, 1250.0000000, -875.0000000, nullptr, nullptr}, //HC Compass Chest
- /* 271 */{0x05, 7, stage::allStages[20], 2, 0xFF, 0xFF, 0b100100000010000000000, 25.0000000, 1875.0000000, -4975.0000000, nullptr, nullptr}, //HC Lantern Staircase Chest
- /* 272 */{0x05, 7, stage::allStages[20], 1, 0xFF, 0xFF, 0b100001000010000100000, -1225.0000000, 2000.0000000, 2125.0000000, nullptr, nullptr}, //HC Main Hall Southwest Chest
- /* 273 */{0x07, 7, stage::allStages[20], 1, 0xFF, 0xFF, 0b100001000010000100000, -2375.0000000, 1250.0000000, -900.0000000, nullptr, nullptr}, //HC Main Hall Northwest Chest
- /* 274 */{0x20, 8, stage::allStages[20], 15, 0xFF, 0xFF, 0b100100000010000000000, 8685.0000000, 2000.0000000, 8690.0000000, nullptr, nullptr}, //HC Southeast Balcony Tower Chest
- /* 275 */{0x26, 2, stage::allStages[20], 15, 0xFF, 0xFF, 0b100100000010000000000, -8700.0000000, 2000.0000000, 8700.0000000, nullptr, nullptr}, //HC Big Key Chest
- /* 276 */{0x02, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3350.0000000, 6150.0000000, 3675.0000000, nullptr, nullptr}, //HC Treasure Room First Chest
- /* 277 */{0x03, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3475.0000000, 6150.0000000, 3550.0000000, nullptr, nullptr}, //HC Treasure Room Second Chest
- /* 278 */{0x04, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3600.0000000, 6150.0000000, 3425.0000000, nullptr, nullptr}, //HC Treasure Room Third Chest
- /* 279 */{0x18, 5, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3700.0000000, 6150.0000000, 3250.0000000, nullptr, nullptr}, //HC Treasure Room Fourth Chest
- /* 280 */{0x0F, 5, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3700.0000000, 6150.0000000, 3075.0000000, nullptr, nullptr}, //HC Treasure Room Fifth Chest
- /* 281 */{0x0C, 5, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3700.0000000, 6150.0000000, 2750.0000000, nullptr, nullptr}, //HC Treasure Room First Small Chest
- /* 282 */{0x01, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3700.0000000, 6150.0000000, 2525.0000000, nullptr, nullptr}, //HC Treasure Room Second Small Chest
- /* 283 */{0x10, 5, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 3700.0000000, 6150.0000000, 2300.0000000, nullptr, nullptr}, //HC Treasure Room Third Small Chest
- /* 284 */{0x05, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 2650.0000000, 6150.0000000, 2125.0000000, nullptr, nullptr}, //HC Treasure Room Fourth Small Chest
- /* 285 */{0x1B, 5, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 2550.0000000, 6150.0000000, 2225.0000000, nullptr, nullptr}, //HC Treasure Room Fifth Small Chest
- /* 286 */{0x07, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 2450.0000000, 6150.0000000, 2325.0000000, nullptr, nullptr}, //HC Treasure Room Sixth Small Chest
- /* 287 */{0x12, 5, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 2350.0000000, 6150.0000000, 2425.0000000, nullptr, nullptr}, //HC Treasure Room Seventh Small Chest
- /* 288 */{0x06, 7, stage::allStages[20], 8, 0xFF, 0xFF, 0b100100000001100100000, 2250.0000000, 6150.0000000, 2525.0000000, nullptr, nullptr}, //HC Treasure Room Eighth Small Chest
- /* 289 */{0x40, 0, stage::allStages[8], 2, 0x1, 0x1, 0b000000000000000000000, 205.3669740, 3901.0000000, -6120.5043950, nullptr, nullptr}, //FT Boomerang
- /* 290 */{ 0x42, 0, stage::allStages[29], 51, 0x11, 0x11, 0b000000100100000000000, -0.0000460, 47.0000000, -473.7650150, nullptr, nullptr }, //SPR Ball and Chain
- /* 291 */{0x2A, 1, stage::allStages[43], 0, 0x1, 0x2, 0b000000000000000000100, 3845.178467, 185.000000, 697.817505, nullptr, nullptr}, //Ordon Shield
- /* 292 */{ 0x28, 1, stage::allStages[65], 4, 0x1, 0x7, 0b000000000000000000000, 266.211700, 0.000000, -55.204613, nullptr, nullptr }, //Ordon Sword
- /* 293 */{0x4A, 0, stage::allStages[43], 0, 0x0, 0x0, 0b000000000000000000000, -532.611450, 75.000000, 2287.597412, nullptr, nullptr}, //Fishing Rod
- /* 294 */{0x65, 9, stage::allStages[43], 0, 0x0, 0xFF, 0b000000000000000000000, 739.763489, 87.500000, -1685.456421, nullptr, nullptr}, //Sera Bottle
- /* 295 */{0x4B, 12, stage::allStages[43], 0, 0x0, 0x0, 0b000000000000000000000, -461.078217, 1618.401978, 7681.837891, nullptr, nullptr}, //Slingshot
- /* 296 */{0x48, 0, stage::allStages[45], 4, 0x0, 0x0, 0b100010000000000001000, -15089.815430, 26.508539, -14135.130859, nullptr, nullptr}, //Lantern
- /* 297 */{0x2C, 12, stage::allStages[68], 3, 0x2, 0x2, 0b001000000000000000000, -500.0000000, 320.0000000, -695.0000000, nullptr, nullptr}, //Hylian Shield (Malo)
- /* 298 */{0x2B, 12, stage::allStages[68], 3, 0x2, 0xFF, 0b001000000000000000000, -500.0000000, 320.0000000, -695.0000000, nullptr, nullptr}, //Wooden Shield (Malo)
- /* 299 */{0x55, 1, stage::allStages[74], 7, 0x7, 0x7, 0b111111100010000000000, -4400.0000000, 0.0000000, 2500.0000000, nullptr, nullptr}, //Big Quiver
- /* 300 */{ 0x56, 1, stage::allStages[74], 7, 0x15, 0x15, 0b111111100001000000000, -4400.0000000, 0.0000000, 2500.0000000, nullptr, nullptr }, //Giant Quiver
- /* 301 */{0x2C, 12, stage::allStages[73], 4, 0x5, 0xFF, 0b111111100000000000000, -494.7930300, 100.0000000, 3701.0000000, nullptr, nullptr}, //Hylian Shield (Goron)
- /* 302 */{0x21, 3, stage::allStages[46], 0, 0x2, 0xFF, 0b111111100000000000000, -2010.0000000, 151.0000000, 7897.0000000, nullptr, nullptr}, //Kakariko Bomb Rock Spire Heart Piece
- /* 303 */{0x21, 3, stage::allStages[56], 6, 0x2, 0xFF, 0b110110000000000000000, -46688.0000000, -7953.0000000, 86307.0000000, nullptr, nullptr}, //Faron Tree Heart Piece
- /* 304 */{0x21, 3, stage::allStages[56], 3, 0x2, 0xFF, 0b110110000000000000000, -21270.0000000, -5620.0000000, 55553.0000000, nullptr, nullptr}, //Kakariko Gorge Spire Heart Piece
- /* 305 */{0x22, 3, stage::allStages[7], 50, 0x2, 0xFF, 0b110110000000000000000, 50.0000000, 3.0000000, 1703.0000000, nullptr, nullptr}, //Diababa Heart Container
- /* 306 */{0x21, 3, stage::allStages[41], 0, 0x2, 0xFF, 0b001000000000000000000, -4358.0000000, 15307.0000000, -19476.0000000, nullptr, nullptr}, //Herding Goats Heart Piece
- /* 307 */{0x22, 3, stage::allStages[4], 50, 0x4, 0xFF, 0b111111000000000000000, 203.0000000, 0.0000000, 830.0000000, nullptr, nullptr}, //Fyrus Heart Container
- /* 308 */{0x22, 3, stage::allStages[1], 50, 0x7, 0xFF, 0b111111010010001000000, -915.0000000, -23960.0000000, 8916.0000000, nullptr, nullptr}, //Morpheel Heart Container
- /* 309 */{ 0x22, 3, stage::allStages[25], 50, 0x10, 0xFF, 0b111111010010101000000, 85.0000000, 1799.0000000, -1264.0000000, nullptr, nullptr },
- /* 310 */{ 0x22, 3, stage::allStages[28], 50, 0x12, 0xFF, 0b111111010110101000000, 279.0000000, 43.0000000, -865.0000000, nullptr, nullptr },
- /* 311 */{ 0x22, 3, stage::allStages[10], 50, 0x13, 0xFF, 0b111111010110111000000, 900.0000000, 0.0000000, 0.0000000, nullptr, nullptr },
- /* 312 */{ 0x22, 3, stage::allStages[13], 50, 0x15, 0xFF, 0b111111010101111000000, 317.0000000, 0.0000000, 764.0000000, nullptr, nullptr },
- /* 313 */{0x22, 3, stage::allStages[16], 10, 0xFF, 0xFF, 0b111111010101111000000, -3.0000000, 2525.0000000, -14603.0000000, nullptr, nullptr}, //Zant Heart Container
- /* 314 */{0x31, 1, stage::allStages[48], 0, 0x5, 0x5, 0b111111100000000000000, 21450.962891, 500.000000, 305.869934, nullptr, nullptr}, //Zora Armor
- /* 315 */{ 0x30, 12, stage::allStages[73], 0, 0x8, 0xFF, 0b111111100000000000000, 1557.0000000, -200.0000000, 3491.0000000, nullptr, nullptr }, //Magic Armor
- /* 316 */{0x4F, 1, stage::allStages[52], 0, 0x5, 0xFF, 0b111111110000000000000, -77679.9375000, -18765.0000000, 40764.0000000, nullptr, nullptr}, //Giant Bomb Bag
- /* 317 */{ 0x3D, 0, stage::allStages[48], 0, 0x10, 0x10, 0b111111010010101000000, 21413.962891, 500.681793, -368.516510, nullptr, nullptr },
- /* 318 */{ 0x3E, 12, stage::allStages[68], 3, 0x4, 0x12, 0b111111000000000000000, -500.0000000, 320.0000000, -695.0000000, nullptr, nullptr }, //Hawkeye
- /* 319 */{0x51, 0, stage::allStages[50], 0, 0x5, 0xFF, 0b111111010000000000000, 44.0000000, -3854.0000000, -2626.0000000, nullptr, nullptr}, //Goron Bomb Bag
- /* 320 */{0x50, 0, stage::allStages[68], 1, 0x4, 0x4, 0b111111000000000000000, 800.0000000, 0.0000000, -300.0000000, nullptr, nullptr}, //Barnes Bomb Bag
- /* 321 */{0x51, 0, stage::allStages[52], 0, 0x5, 0xFF, 0b111111100000000000000, -77680.0000000, -18765.0000000, 40764.0000000, nullptr, nullptr},//Iza Bomb Bag
- /* 322 */{ 0x90, 4, stage::allStages[52], 0, 0x8, 0x8, 0b111111010010001000000, -116117.015625, -15810.000000, 58812.617188, nullptr, nullptr }, //Auru's Memo
- /* 323 */{ 0x91, 4, stage::allStages[51], 0, 0x10, 0x10, 0b000000000000000000000, 31608.291016, -13330.000000, -11652.610352, nullptr, nullptr }, //Aeshi's Sketch
- /* 324 */{ 0x80, 4, stage::allStages[46], 0, 0xFF, 0x13, 0b000000000000000000000, -324.903625, 0.000000, 435.528595, nullptr, nullptr }, //Renardo's Letter
- /* 325 */{ 0x81, 4, stage::allStages[53], 5, 0xFF, 0x13, 0b000000000000000000000, 2694.345215, -1150.000000, 3105.746826, nullptr, nullptr }, //Invoice
- /* 326 */{ 0x82, 4, stage::allStages[57], 16, 0xFF, 0x13, 0b000000000000000000000, -51514.375000, -6269.229980, 31816.427734, nullptr, nullptr }, //Wooden Statue
- /* 327 */{ 0x83, 4, stage::allStages[63], 0, 0xFF, 0x13, 0b000000000000000000000, 2077.769775, 104.958275, -1301.828491, nullptr, nullptr }, //Ilia's Charm
- /* 328 */{ 0x84, 4, stage::allStages[68], 0, 0xFF, 0x13, 0b000000000000000000000, 312.675079, 0.000000, -160.984177, nullptr, nullptr }, //Horse Call
- /* 329 */{0x9d, 9, stage::allStages[45], 4, 0x1, 0xFF, 0b000000000000000000000, -13659.433594, -0.454284, -14367.083008, nullptr, nullptr}, //Coro Bottle
- /* 330 */{0x75, 9, stage::allStages[73], 5, 0xFF, 0xFF, 0b000000000000000000000, 4250.363281, 134.492020, 1813.639648, nullptr, nullptr}, //Jovani Bottle
- /* 331 */{ 0x60, 9, stage::allStages[62], 0, 0x5, 0x5, 0b000000000000000000000, 5772.262695, 35.000000, 2218.249512, nullptr, nullptr }, //Fishing Hole Bottle
- /* 332 */{0x2B, 12, stage::allStages[47], 3, 0x3, 0xFF, 0b001000000000000000000, -6545.0000000, -125.0000000, -2275.0000000, nullptr, nullptr}, //Wooden Shield (Goron)
- /* 333 */{0x21, 3, stage::allStages[46], 0, 0x4, 0xFF, 0b000001000000000000000, -900.000000, 0.780221, 6600.000000, nullptr, nullptr}, //Bow Shooting Game Heart Piece
- /* 334 */{0x21, 3, stage::allStages[53], 2, 0x5, 0xFF, 0b000000000000000000000, -4142.703125, 0.000000, -569.375000, nullptr, nullptr}, //Donation Heart Piece
- /* 335 */{ 0x21, 3, stage::allStages[62], 0, 0xFF, 0xFF, 0b101000000010000000000, -2678.128906, -167.094162, 2246.794186, nullptr, nullptr },
- /* 336 */{ 0x21, 3, stage::allStages[56], 0, 0x8, 0xFF, 0b000000000000000000000, -25148.583984, -200.000000, 9814.881836, nullptr, nullptr },
- /* 337 */{ 0x21, 3, stage::allStages[61], 0, 0x8, 0xFF, 0b000000000000000000000, 3618.216797, 232.476608, 541.905518, nullptr, nullptr },
- /* 338 */{ 0x21, 3, stage::allStages[55], 1, 0x9, 0xFF, 0b000000000000000000000, 4708.924805, 260.000000, -3120.967529, nullptr, nullptr }, //camp HP
- /* 339 */{ 0x23, 2, stage::allStages[27], 1, 0x11, 0x11, 0b000000000000000000000, 293.920288, 0.000000, -337.167480, nullptr, nullptr }, // Yeta Map
- /* 340 */{ 0x21, 3, stage::allStages[51], 1, 0x12, 0xFF, 0b000000000000000000000, -71795.539062, -54450.000000, 56396.738281, nullptr, nullptr },
- /* 341 */{ 0x21, 3, stage::allStages[63], 0, 0x13, 0xFF, 0b000000000000000000010, 2200.000000, 104.574730, -1200.000000, nullptr, nullptr },
- /* 342 */{0x20, 8, stage::allStages[20], 13, 0xFF, 0xFF, 0b000000000000000000000, -7625.000000, 52.000000, -5525.000000, nullptr, nullptr}, //
- /* 343 */{0x20, 8, stage::allStages[6], 7, 0x1, 0xFF, 0b000000000000000000000, -5703.254883, 4372.640137, 11664.798828, nullptr, nullptr},
-
+ ItemCheck checks[505] = {
+ /* 0 */ { 0x3F,
+ 1,
+ stage::allStages[65],
+ 4,
+ 0x0,
+ 0x0,
+ 0b000000000000000000000,
+ -1.6259740,
+ 0.0000000,
+ -207.4881290,
+ nullptr,
+ nullptr }, // Wooden Sword Chest
+ /* 1 */
+ { 0x03,
+ 7,
+ stage::allStages[40],
+ 0,
+ 0x1,
+ 0xFF,
+ 0b110000000000000000100,
+ -3550.8691410,
+ 4450.0000000,
+ -694.8996580,
+ nullptr,
+ nullptr }, // South Faron Cave Small Chest
+ /* 2 */
+ { 0xEE,
+ 8,
+ stage::allStages[45],
+ 14,
+ 0x1,
+ 0xFF,
+ 0b000000000000000000100,
+ 1221.9044190,
+ 50.0000000,
+ -7.9423170,
+ nullptr,
+ nullptr }, // North Faron Cave Key Chest
+ /* 3 */
+ { 0x21,
+ 3,
+ stage::allStages[45],
+ 14,
+ 0x1,
+ 0xFF,
+ 0b110000000000000000100,
+ 1528.0000000,
+ 250.0000000,
+ -22.0000000,
+ nullptr,
+ nullptr }, // North Faron Cave Heart Piece Chest
+ /* 4 */
+ { 0x03,
+ 7,
+ stage::allStages[45],
+ 6,
+ 0x1,
+ 0xFF,
+ 0b000000000000000000100,
+ -38292.5312500,
+ 400.0000000,
+ -23129.9550780,
+ nullptr,
+ nullptr }, // Small Chest North of Trill
+ /* 5 */
+ { 0xED,
+ 7,
+ stage::allStages[65],
+ 7,
+ 0x0,
+ 0xFF,
+ 0b110010000000000001000,
+ 128.7043760,
+ -1077.0000000,
+ -607.5000000,
+ nullptr,
+ nullptr }, // Link's Basement Chest
+ /* 6 */
+ { 0x03,
+ 7,
+ stage::allStages[6],
+ 22,
+ 0x1,
+ 0xFF,
+ 0b000000000000000000000,
+ 900.0000000,
+ 3110.0000000,
+ 15825.0000000,
+ nullptr,
+ nullptr }, // FT Entrance Vine Chest
+ /* 7 */
+ { 0x04,
+ 7,
+ stage::allStages[6],
+ 0,
+ 0x1,
+ 0xFF,
+ 0b100100000000000000000,
+ 0.0000000,
+ 2700.0000000,
+ 5550.0000000,
+ nullptr,
+ nullptr }, // FT Central Chest Behind Stairs
+ /* 8 */
+ { 0x23,
+ 2,
+ stage::allStages[6],
+ 0,
+ 0x1,
+ 0x1,
+ 0b110000000000000000000,
+ 550.0000000,
+ 3301.0095210,
+ 5325.0000000,
+ nullptr,
+ nullptr }, // FT Map Chest
+ /* 9 */
+ { 0x20,
+ 8,
+ stage::allStages[6],
+ 9,
+ 0x1,
+ 0xFF,
+ 0b110000000000000000000,
+ 6908.0000000,
+ 3580.2719730,
+ -3305.0000000,
+ nullptr,
+ nullptr }, // FT Windless Bridge Chest
+ /* 10 */
+ { 0x03,
+ 7,
+ stage::allStages[6],
+ 2,
+ 0x1,
+ 0xFF,
+ 0b110000000000000100000,
+ 11559.7548830,
+ 3152.0000000,
+ 3761.2187500,
+ nullptr,
+ nullptr }, // FT Second Monkey Under Bridge Chest
+ /* 11 */
+ { 0x20,
+ 8,
+ stage::allStages[6],
+ 5,
+ 0x1,
+ 0xFF,
+ 0b100000000000000100000,
+ -9108.924805,
+ 3302.0000000,
+ 5547.310059,
+ nullptr,
+ nullptr }, // FT Totem Pole Chest
+ /* 12 */
+ { 0x04,
+ 7,
+ stage::allStages[6],
+ 5,
+ 0x1,
+ 0xFF,
+ 0b100000000000000100000,
+ -11721.1455080,
+ 3750.0000000,
+ 4717.8212890,
+ nullptr,
+ nullptr }, // FT West Tile Worm Small Chest
+ /* 13 */
+ { 0x21,
+ 3,
+ stage::allStages[6],
+ 3,
+ 0x1,
+ 0xFF,
+ 0b110000000000000000000,
+ -4000.0000000,
+ 2955.5900880,
+ 9075.0000000,
+ nullptr,
+ nullptr }, // FT Deku Like Heart Piece Chest
+ /* 14 */
+ { 0x21,
+ 3,
+ stage::allStages[6],
+ 5,
+ 0x1,
+ 0xFF,
+ 0b110100000000000100000,
+ -14275.0000000,
+ 3402.7832030,
+ 6150.0000000,
+ nullptr,
+ nullptr }, // FT West Tile Worm Heart Piece Chest
+ /* 15 */
+ { 0x24,
+ 2,
+ stage::allStages[6],
+ 0,
+ 0x1,
+ 0x1,
+ 0b100100000000000000000,
+ 0.0000000,
+ 3150.0000000,
+ 7125.0000000,
+ nullptr,
+ nullptr }, // FT Compass Chest
+ /* 16 */
+ { 0x26,
+ 2,
+ stage::allStages[6],
+ 1,
+ 0x1,
+ 0x1,
+ 0b100100000000000000000,
+ 9225.0009770,
+ 3471.9599610,
+ 8465.1347660,
+ nullptr,
+ nullptr }, // FT Big Key Chest
+ /* 17 */
+ { 0x03,
+ 7,
+ stage::allStages[6],
+ 1,
+ 0x1,
+ 0xFF,
+ 0b000000000000000000000,
+ 10261.0000000,
+ 3175.0000000,
+ 8295.0000000,
+ nullptr,
+ nullptr }, // FT East Water Cave Chest
+ /* 18 */
+ { 0x20,
+ 8,
+ stage::allStages[6],
+ 10,
+ 0x2,
+ 0xFF,
+ 0b000100000010000000000,
+ 1174.2510990,
+ 5002.3901370,
+ -9219.0937500,
+ nullptr,
+ nullptr }, // FT North Deku Like Chest
+ /* 19 */
+ { 0x04,
+ 7,
+ stage::allStages[6],
+ 11,
+ 0x2,
+ 0xFF,
+ 0b100100000000000100000,
+ 11183.0000000,
+ 3806.5500490,
+ -6305.0000000,
+ nullptr,
+ nullptr }, // FT East Tile Worm Chest
+ /* 20 */
+ { 0x04,
+ 7,
+ stage::allStages[68],
+ 2,
+ 0x2,
+ 0xFF,
+ 0b000000000000000000000,
+ -70.0000000,
+ -6.0440000,
+ -670.0000000,
+ nullptr,
+ nullptr }, // Kakariko Inn Small Chest
+ /* 21 */
+ { 0x45,
+ 0,
+ stage::allStages[65],
+ 0,
+ 0x2,
+ 0x2,
+ 0b000000000000000000000,
+ 320.8111880,
+ 9.7100000,
+ 1017.9390870,
+ nullptr,
+ nullptr }, // Iron Boots Chest
+ /* 22 */
+ { 0x04,
+ 7,
+ stage::allStages[3],
+ 1,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ 1050.0000000,
+ -258.1840820,
+ 13750.0000000,
+ nullptr,
+ nullptr }, // GM Entrance Small Chest
+ /* 23 */
+ { 0x20,
+ 8,
+ stage::allStages[3],
+ 3,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ 2700.0000000,
+ -1378.3521730,
+ 5175.0000000,
+ nullptr,
+ nullptr }, // GM Main Magnet Room Bottom Chest
+ /* 24 */
+ { 0x23,
+ 2,
+ stage::allStages[3],
+ 14,
+ 0x3,
+ 0x3,
+ 0b001000000000000100000,
+ -15984.1562500,
+ -710.5994260,
+ 1504.4143070,
+ nullptr,
+ nullptr }, // GM Map Chest
+ /* 25 */
+ { 0x04,
+ 7,
+ stage::allStages[3],
+ 14,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ -16176.0000000,
+ -561.3822020,
+ 895.0000000,
+ nullptr,
+ nullptr }, // GM Gor Amato Small Chest
+ /* 26 */
+ { 0x21,
+ 3,
+ stage::allStages[3],
+ 4,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ -5625.0000000,
+ 448.7841190,
+ 75.0000000,
+ nullptr,
+ nullptr }, // GM Magnet Maze Heart Piece Chest
+ /* 27 */
+ { 0x20,
+ 8,
+ stage::allStages[3],
+ 6,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ 1125.0000000,
+ 600.0000000,
+ -4725.0000000,
+ nullptr,
+ nullptr }, // GM Switch Room Underwater Chest
+ /* 28 */
+ { 0x04,
+ 7,
+ stage::allStages[3],
+ 6,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ 1000.0000000,
+ 1650.0000000,
+ -5650.0000000,
+ nullptr,
+ nullptr }, // GM Switch Room Small Chest
+ /* 29 */
+ { 0x21,
+ 3,
+ stage::allStages[3],
+ 6,
+ 0x3,
+ 0xFF,
+ 0b001000000000000000000,
+ -1350.0000000,
+ 2350.0000000,
+ -6200.0000000,
+ nullptr,
+ nullptr }, // GM After Switch Room Heart Piece Chest
+ /* 30 */
+ { 0x20,
+ 8,
+ stage::allStages[3],
+ 7,
+ 0x3,
+ 0xFF,
+ 0b101000000000000100000,
+ -1050.0000000,
+ 2425.0000000,
+ -14825.0000000,
+ nullptr,
+ nullptr }, // GM Outside Bemos Chest
+ /* 31 */
+ { 0x03,
+ 7,
+ stage::allStages[3],
+ 17,
+ 0x3,
+ 0xFF,
+ 0b101000000000000100000,
+ 13900.0000000,
+ 2997.0900880,
+ -17175.0000000,
+ nullptr,
+ nullptr }, // GM Gor Ebizo Small Chest
+ /* 32 */
+ { 0x03,
+ 7,
+ stage::allStages[3],
+ 9,
+ 0x3,
+ 0xFF,
+ 0b101000000000000100000,
+ 9950.0000000,
+ 2475.0000000,
+ -15375.0000000,
+ nullptr,
+ nullptr }, // GM Small Chest Before Dangoro
+ /* 33 */
+ { 0x43,
+ 0,
+ stage::allStages[3],
+ 11,
+ 0x3,
+ 0x3,
+ 0b001000000000000000000,
+ 7997.9995120,
+ 2640.0000000,
+ -5355.0000000,
+ nullptr,
+ nullptr }, // GM Bow Chest
+ /* 34 */
+ { 0x24,
+ 2,
+ stage::allStages[3],
+ 11,
+ 0x4,
+ 0x4,
+ 0b101001000000000000000,
+ 6488.3676760,
+ 2640.0000000,
+ -1673.5349120,
+ nullptr,
+ nullptr }, // GM Compass Chest
+ /* 35 */
+ { 0x05,
+ 7,
+ stage::allStages[3],
+ 16,
+ 0x4,
+ 0xFF,
+ 0b101001000000000000000,
+ 13975.0000000,
+ 2476.4899900,
+ -1675.0000000,
+ nullptr,
+ nullptr }, // GM Gor Liggs Small Chest
+ /* 36 */
+ { 0x05,
+ 7,
+ stage::allStages[3],
+ 3,
+ 0x4,
+ 0xFF,
+ 0b101001000000000000000,
+ 3625.0000000,
+ 2637.8999020,
+ 4050.0000000,
+ nullptr,
+ nullptr }, // GM Main Magnet Room Top Chest
+ /* 37 */
+ { 0x05,
+ 7,
+ stage::allStages[3],
+ 7,
+ 0x4,
+ 0xFF,
+ 0b001000000000000000000,
+ 2325.0000000,
+ 1100.0000000,
+ -17400.0000000,
+ nullptr,
+ nullptr }, // GM Outside Underwater Chest
+ /* 38 */
+ { 0x21,
+ 3,
+ stage::allStages[46],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b101000100000000000000,
+ 1300.0000000,
+ -1600.0000000,
+ 16700.0000000,
+ nullptr,
+ nullptr }, // Eldin Spring Heart Piece Chest
+ /* 39 */
+ { 0x05,
+ 7,
+ stage::allStages[48],
+ 0,
+ 0x2,
+ 0xFF,
+ 0b010000000000000000000,
+ 16050.0000000,
+ 200.0000000,
+ 725.0000000,
+ nullptr,
+ nullptr }, // Kakariko Graveyard Lanturn Chest
+ /* 40 */
+ { 0x05,
+ 7,
+ stage::allStages[68],
+ 4,
+ 0x3,
+ 0xFF,
+ 0b000000000000000000000,
+ -887.4350590,
+ 1000.0000000,
+ -173.2907710,
+ nullptr,
+ nullptr }, // Kakariko Watchtower Chest
+ /* 41 */
+ { 0x06,
+ 7,
+ stage::allStages[46],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b000000101100000000000,
+ -4027.7336430,
+ 3200.0000000,
+ -8970.9990230,
+ nullptr,
+ nullptr }, // Kakariko Watchtower Alcove Chest
+ /* 42 */
+ { 0x21,
+ 3,
+ stage::allStages[56],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b000000001000000000000,
+ 11550.0000000,
+ 2700.0000000,
+ 24090.0000000,
+ nullptr,
+ nullptr }, // Eldin Bomb Rock Ledge Heart Piece Chest
+ /* 43 */
+ { 0x03,
+ 7,
+ stage::allStages[50],
+ 1,
+ 0x5,
+ 0xFF,
+ 0b000000000000000000000,
+ 2784.3178710,
+ -4587.8901370,
+ 10773.4140620,
+ nullptr,
+ nullptr }, // ZD Small Chest By Mother and Child Isles
+ /* 44 */
+ { 0x04,
+ 7,
+ stage::allStages[50],
+ 1,
+ 0x8,
+ 0xFF,
+ 0b000000000000000000000,
+ 3810.8435060,
+ -3535.5300290,
+ 11344.8876950,
+ nullptr,
+ nullptr }, // ZD Small Chest Under Waterfall
+ /* 45 */
+ { 0x06,
+ 7,
+ stage::allStages[52],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b001000000000000000000,
+ -97123.5468750,
+ -19490.0000000,
+ 58585.6992190,
+ nullptr,
+ nullptr }, // Lake Hylia Underwater Chest
+ /* 46 */
+ { 0x0F,
+ 5,
+ stage::allStages[0],
+ 0,
+ 0x6,
+ 0xFF,
+ 0b000000000000001000000,
+ -1707.6793210,
+ 1250.0000000,
+ 15388.9882810,
+ nullptr,
+ nullptr }, // LBT Lobby Left Chest
+ /* 47 */
+ { 0x17,
+ 5,
+ stage::allStages[0],
+ 0,
+ 0x6,
+ 0xFF,
+ 0b000000000000001000000,
+ -144.6737980,
+ 1250.0000000,
+ 16525.8710940,
+ nullptr,
+ nullptr }, // LBT Lobby Rear Chest
+ /* 48 */
+ { 0x17,
+ 5,
+ stage::allStages[0],
+ 1,
+ 0x6,
+ 0xFF,
+ 0b100000001000001000000,
+ 1417.5971680,
+ 1813.6099850,
+ 7807.2255860,
+ nullptr,
+ nullptr }, // LBT Stalactite Room Small Chest
+ /* 49 */
+ { 0x0F,
+ 5,
+ stage::allStages[0],
+ 3,
+ 0x6,
+ 0xFF,
+ 0b000000000000001000000,
+ 1629.5045170,
+ 0.0000000,
+ 2049.6350100,
+ nullptr,
+ nullptr }, // LBT Central Room Small Chest
+ /* 50 */
+ { 0x23,
+ 2,
+ stage::allStages[0],
+ 3,
+ 0x6,
+ 0x6,
+ 0b000000000000001000000,
+ 2010.5773930,
+ 0.0000000,
+ -1656.3415530,
+ nullptr,
+ nullptr }, // LBT Map Chest
+ /* 51 */
+ { 0x20,
+ 8,
+ stage::allStages[0],
+ 8,
+ 0x6,
+ 0xFF,
+ 0b100000001000001000000,
+ 12900.0000000,
+ -600.0000000,
+ 1850.0000000,
+ nullptr,
+ nullptr }, // LBT East Stalactite Room Chest
+ /* 52 */
+ { 0x16,
+ 5,
+ stage::allStages[0],
+ 7,
+ 0x6,
+ 0xFF,
+ 0b000000000000001100000,
+ 8779.1152340,
+ 1500.0000000,
+ 1667.6258540,
+ nullptr,
+ nullptr }, // LBT East Second Floor Southwest Chest
+ /* 53 */
+ { 0x20,
+ 8,
+ stage::allStages[0],
+ 7,
+ 0x6,
+ 0xFF,
+ 0b100000001000001100000,
+ 11550.8037110,
+ 1500.0000000,
+ 2866.6462400,
+ nullptr,
+ nullptr }, // LBT East Second Floor Southeast Chest
+ /* 54 */
+ { 0x17,
+ 5,
+ stage::allStages[0],
+ 10,
+ 0x6,
+ 0xFF,
+ 0b000000000000001100000,
+ 18228.3320310,
+ 3995.0000000,
+ -466.3260800,
+ nullptr,
+ nullptr }, // LBT East Water Supply Small Chest
+ /* 55 */
+ { 0x20,
+ 8,
+ stage::allStages[0],
+ 9,
+ 0x6,
+ 0xFF,
+ 0b000000000000001000000,
+ 13550.0000000,
+ 10.0000000,
+ -2500.0000000,
+ nullptr,
+ nullptr }, // LBT Before Deku Toad Chest
+ /* 56 */
+ { 0x04,
+ 7,
+ stage::allStages[0],
+ 9,
+ 0x6,
+ 0xFF,
+ 0b101000000000001100000,
+ 13193.2910160,
+ -1189.3100590,
+ -2433.4060060,
+ nullptr,
+ nullptr }, // LBT Before Deku Toad Underwater Left Chest
+ /* 57 */
+ { 0x16,
+ 5,
+ stage::allStages[0],
+ 9,
+ 0x6,
+ 0xFF,
+ 0b101000000000001100000,
+ 13757.0000000,
+ -1275.3310550,
+ -4783.1503910,
+ nullptr,
+ nullptr }, // LBT Before Deku Toad Underwater Right Chest
+ /* 58 */
+ { 0x44,
+ 0,
+ stage::allStages[2],
+ 51,
+ 0x6,
+ 0x6,
+ 0b000000000000001000000,
+ 0.0000000,
+ 0.0000000,
+ 0.0000000,
+ nullptr,
+ nullptr }, // LBT Clawshot Chest
+ /* 59 */
+ { 0x21,
+ 3,
+ stage::allStages[0],
+ 3,
+ 0x7,
+ 0xFF,
+ 0b100000000010001000000,
+ -0.8691990,
+ 2100.0000000,
+ 2.1099050,
+ nullptr,
+ nullptr }, // LBT Chandelier Heart Piece Chest
+ /* 60 */
+ { 0x05,
+ 7,
+ stage::allStages[0],
+ 10,
+ 0x7,
+ 0xFF,
+ 0b100000000010001100000,
+ 21000.0000000,
+ 4170.0000000,
+ 85.0000000,
+ nullptr,
+ nullptr }, // LBT Eas Water Supply Clawshot Chest
+ /* 61 */
+ { 0x04,
+ 7,
+ stage::allStages[0],
+ 3,
+ 0x7,
+ 0xFF,
+ 0b000000000000001000000,
+ 0.0000000,
+ -940.0000000,
+ -315.5000000,
+ nullptr,
+ nullptr }, // LBT Central Room Center Spire Chest
+ /* 62 */
+ { 0x17,
+ 5,
+ stage::allStages[0],
+ 12,
+ 0x7,
+ 0xFF,
+ 0b000000000010001000000,
+ -10687.0947270,
+ -299.3999940,
+ -1161.5905760,
+ nullptr,
+ nullptr }, // LBT West Lower Small Chest
+ /* 63 */
+ { 0x17,
+ 5,
+ stage::allStages[0],
+ 13,
+ 0x7,
+ 0xFF,
+ 0b100000000010001000000,
+ -20310.0000000,
+ 4015.0000000,
+ 460.0000000,
+ nullptr,
+ nullptr }, // LBT West Water Supply Small Chest
+ /* 64 */
+ { 0x24,
+ 2,
+ stage::allStages[0],
+ 13,
+ 0x7,
+ 0x7,
+ 0b100000000010001000000,
+ -23100.0000000,
+ 4200.0000000,
+ -85.0000000,
+ nullptr,
+ nullptr }, // LBT Compass Chest
+ /* 65 */
+ { 0x04,
+ 7,
+ stage::allStages[0],
+ 11,
+ 0x7,
+ 0xFF,
+ 0b101000000000001000000,
+ -14158.2880860,
+ 700.0000000,
+ 2868.1103520,
+ nullptr,
+ nullptr }, // LBT West Second Floor Southwest Underwater Chest
+ /* 66 */
+ { 0x04,
+ 7,
+ stage::allStages[0],
+ 12,
+ 0x7,
+ 0xFF,
+ 0b100000000010001000000,
+ -10180.6718750,
+ 1500.0000000,
+ -1939.7305910,
+ nullptr,
+ nullptr }, // LBT West Second Floor Central Small Chest
+ /* 67 */
+ { 0x04,
+ 7,
+ stage::allStages[0],
+ 11,
+ 0x7,
+ 0xFF,
+ 0b000000000000001000000,
+ -10950.0000000,
+ 1450.0000000,
+ 2590.0000000,
+ nullptr,
+ nullptr }, // LBT West Second Floor Northeast Chest
+ /* 68 */
+ { 0x18,
+ 5,
+ stage::allStages[0],
+ 11,
+ 0x7,
+ 0xFF,
+ 0b100000000010001000000,
+ -9270.0000000,
+ 1450.0000000,
+ -2100.0000000,
+ nullptr,
+ nullptr }, // LBT West Second Floor Southeast Chest
+ /* 69 */
+ { 0x26,
+ 2,
+ stage::allStages[0],
+ 6,
+ 0x7,
+ 0x7,
+ 0b101000001010001000000,
+ -16549.8789060,
+ -1345.7093510,
+ 2820.3918460,
+ nullptr,
+ nullptr }, // LBT Big Key Chest
+ /* 70 */
+ { 0x16,
+ 5,
+ stage::allStages[0],
+ 5,
+ 0x7,
+ 0xFF,
+ 0b101000000010001000000,
+ -18544.2207030,
+ -200.0000000,
+ 475.5745850,
+ nullptr,
+ nullptr }, // LBT Underwater Maze Small Chest
+ /* 71 */
+ { 0x21,
+ 3,
+ stage::allStages[0],
+ 8,
+ 0x7,
+ 0xFF,
+ 0b100000000010001000000,
+ 11356.2246090,
+ -550.0000000,
+ 4896.6640620,
+ nullptr,
+ nullptr }, // LBT East Stalactite Heart Piece Chest
+ /* 72 */
+ { 0x21,
+ 3,
+ stage::allStages[36],
+ 1,
+ 0x12,
+ 0xFF,
+ 0b100000100000000000010,
+ -211.8681490,
+ -61.3470460,
+ -2693.1110840,
+ nullptr,
+ nullptr }, // Grotto - Deku Baba Heart Piece Chest
+ /* 73 */
+ { 0x06,
+ 7,
+ stage::allStages[35],
+ 0,
+ 0x8,
+ 0xFF,
+ 0b100000000010000000010,
+ 28.7614960,
+ 2.9684250,
+ -455.4558110,
+ nullptr,
+ nullptr }, // Grotto - Helmasaur Chest
+ /* 74 */
+ { 0x1A,
+ 5,
+ stage::allStages[33],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b000000001100000000000,
+ -655.6493530,
+ 1069.5000000,
+ -4819.0908200,
+ nullptr,
+ nullptr }, // Lake Lanturn Cave First Chest
+ /* 75 */
+ { 0x03,
+ 7,
+ stage::allStages[33],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b000000001100000000000,
+ 682.1680300,
+ 1069.5000000,
+ -6179.2060550,
+ nullptr,
+ nullptr }, // Lake Lanturn Cave Second Chest
+ /* 76 */
+ { 0x04,
+ 7,
+ stage::allStages[33],
+ 0,
+ 0x5,
+ 0xFF,
+ 0b000000001100000000000,
+ 2067.4831540,
+ 966.9400020,
+ -7130.3203120,
+ nullptr,
+ nul