From 243221e7666bacbc460ce2815964cf91238189ba Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Tue, 24 Mar 2026 04:27:31 +0000 Subject: [PATCH 01/15] EZTR stuff --- include/eztr_api.h | 2235 ++++++++++++++++++++++++++++++++++++++++ mod.toml | 1 + pyglue | 2 +- src/eztr_text.c | 833 +++++++++++++++ src/item_give.c | 14 +- src/moon_child_hooks.c | 50 +- 6 files changed, 3108 insertions(+), 27 deletions(-) create mode 100644 include/eztr_api.h create mode 100644 src/eztr_text.c diff --git a/include/eztr_api.h b/include/eztr_api.h new file mode 100644 index 0000000..3680621 --- /dev/null +++ b/include/eztr_api.h @@ -0,0 +1,2235 @@ +#ifndef __EZTR_API__ +#define __EZTR_API__ + +/*! \file eztr_api.h + \version 2.3.0 + \brief The main header for EZTR + */ + +#include "modding.h" +#include "global.h" + +#ifdef DOXYGEN +#define EZTR_IMPORT(func) func +#define EZTR_PACK_STRUCT + +#else + +#define EZTR_IMPORT(func) RECOMP_IMPORT(EZTR_MOD_ID_STR, func) +#define EZTR_PACK_STRUCT __attribute__((packed)) + +typedef struct { + u16 new_id; + u8 out_success; +} _EZTR_CustomMsgHandleSetter; + +#define __EZTR_CUSTOM_MSG_HANDLE_BODY(name) { \ + static u16 id; \ + static u8 is_set = 0; \ + if (setter != NULL) { \ + if (is_set) { \ + _EZTR_ReportDebugMessage("EZTR_CustomMsgHandle '" #name "', Header Version 2.3.0: The textId has already been set and will not be updated."); \ + setter->out_success = 0; \ + } \ + else { \ + _EZTR_ReportDebugMessage("EZTR_CustomMsgHandle '" #name "', Header Version 2.3.0: Assignment of textId was successful."); \ + id = setter->new_id; \ + is_set = 1; \ + setter->out_success = 1; \ + } \ + } \ + return id; \ +} \ + +#endif + +/** + * \defgroup General + * + * \brief General API information. + * + * @{ + */ + + +/** + * @brief The mod id string for EZTR. + * + * The `eztr_api.h` imports all the functions and events needed for EZTR, + * so you probably won't need to use this directly. + */ +#define EZTR_MOD_ID_STR "MM_EZ_Text_Replacer_API" + +#ifndef DOXYGEN +EZTR_IMPORT( void _EZTR_ReportFatalMessage(char* msg)); +EZTR_IMPORT( void _EZTR_ReportErrorMessage(char* msg)); +EZTR_IMPORT( void _EZTR_ReportWarningMessage(char* msg)); +EZTR_IMPORT( void _EZTR_ReportInfoMessage(char* msg)); +EZTR_IMPORT( void _EZTR_ReportDebugMessage(char* msg)); +EZTR_IMPORT( void _EZTR_ReportVerboseMessage(char* msg)); + +// Typo, Included for backwards compatibility: +EZTR_IMPORT( void _EXTR_ReportErrorMessage(char* msg)); +#endif + +#define EZTR_MSG_HIGHEST_ID 0x354C +/** + * @brief The the full size of message buffer, in bytes. + * + * Also equivalent to maximum length of buffer in single-byte characters (`char`). + */ +#define EZTR_MSG_BUFFER_SIZE 1280 + +/** + * @brief The maximum length of buffer in two-byte characters (`wchar`). + * + * Not really used, but included for parity with the base game. + */ +#define EZTR_MSG_BUFFER_WIDE_SIZE 640 + +/** + * @brief The size of the message buffer's header region, in bytes. + * + * Also servers as the starting index of the message buffer's content region. + * + */ +#define EZTR_MSG_HEADER_SIZE 11 + +/** + * @brief The size of the message buffer's content region, in bytes. + * + * Useful if you need to loop throught a buffer's content. + */ + #define EZTR_MSG_CONTENT_SIZE 1269 // MESSAGE_BUFFER_SIZE - MESSAGE_HEADER_SIZE + +#define EZTR_MSG_ENDING_CHAR '\xBF' +#define EZTR_PIPE_CHAR '|' + +/** @}*/ + +/** + * \defgroup CustomMsgHandle + * + * \brief Macros and types used for working with the handles for custom messages. + * + * This page contains all of the information in custom message handles an how to use them. + * + * It's worth noting that a custom message handle is actually a function, defined through macros. + * In brief, here are the important things to know: + * * The handler's only argument is a pointer that EZTR uses internally. Modders don't need to use it. + * * You can retrieve the handle's textId by calling it with NULL as the argument (`handle(NULL)`) + * * By default, the handle can only have its textId assigned once (See below on how to change this behavior). + * * Handles created using `EZTR_DEFINE_CUSTOM_MSG_HANDLE`, the recommended macro for creating custom message handles, are marked with `RECOMP_EXPORT`. + * + * This implementation was decided on to ensure that the textIds of custom messages are not lost through + * variable reassignments, and to facilitate mods potentially needing to access/modify each other's messages. + * + * For those interested in the technical details: The function's only argument is used by EZTR to set the textId variable + * when a custom message is assigned to it, and to check that the assignment was a success. + * + * The version of the handle function included in this header stores the textId in a static variable, and includes logic that + * will only allow the textId to be set once. If a second attempt to set the ID is made, an error message is printed. Rather than + * change a handle's textId, you should change the stored message at that id. + * + * If you want to change the behavior of the handles, you can write your own custom message handle functions, but + * it's not recommended. + * + * @{ + */ + +/** + * @brief Uses to set/get the actual symbol name for custom message handles + * If you want to add a prefix/suffix to your custom message handles globally, it can be done here. + */ +#ifdef EZTR_NO_HANDLE_PREFIX +#define EZTR_CUSTOM_MSG_HANDLE_NAME(name) name +#else +#define EZTR_CUSTOM_MSG_HANDLE_NAME(name_suffix) EZTR_CustomMsgHandle_##name_suffix +#endif +/** + * @brief Creates a non-exported CustomMsgHandle object + * + * Most mods are not installed in a vacuum. You should consider exporting your custom message handles + * so that other mods can access the messages you define if need be (compatibility patches, addons, etc.) + * + */ +#define EZTR_DEFINE_CUSTOM_MSG_HANDLE_NO_EXPORT(name) \ +u16 EZTR_CUSTOM_MSG_HANDLE_NAME(name)(_EZTR_CustomMsgHandleSetter* setter) \ +__EZTR_CUSTOM_MSG_HANDLE_BODY(name) + +/** + * @brief Creates a CustomMsgHandle object + * + * This is the primary method for creating handles for custom messages. You'll need to use this macro + * inside one of your .c files (outside of any functions) to create the handle itself. Use + * `EZTR_DECLARE_CUSTOM_MSG_HANDLE` to access the handle from other files. + * + * See the `EZTR_CustomMsgHandle` documentation for more information about handles and how they work. + * + */ +#define EZTR_DEFINE_CUSTOM_MSG_HANDLE(name) RECOMP_EXPORT \ +u16 EZTR_CUSTOM_MSG_HANDLE_NAME(name)(_EZTR_CustomMsgHandleSetter* setter) \ +__EZTR_CUSTOM_MSG_HANDLE_BODY(name) + +/** + * @brief Creates a declaration for a CustomMsgHandle object. + * + * Use this reference handles created in other .c files. Also works in headers. + * + */ +#define EZTR_DECLARE_CUSTOM_MSG_HANDLE(name) u16 EZTR_CUSTOM_MSG_HANDLE_NAME(name)(_EZTR_CustomMsgHandleSetter* setter) + +/** + * @brief Creates a declaration for a CustomMsgHandle object. Alternative to `EZTR_DECLARE_CUSTOM_MSG_HANDLE`. + * + * Use this reference handles created in other .c files. Also works in headers. + * + */ +#define EZTR_EXTERN_CUSTOM_MSG_HANDLE(name) EZTR_DECLARE_CUSTOM_MSG_HANDLE(name) + + +/** + * @brief Declares and imports a CustomMsgHandle object from another mod. + * + * This will allow you to use and interact with custom messages from other mods. + */ +#define EZTR_IMPORT_CUSTOM_MSG_HANDLE(mod_str, name_suffix) RECOMP_IMPORT(mod_str, u16 EZTR_CustomMsgHandle_##name_suffix(_EZTR_CustomMsgHandleSetter* setter)) + +/** + * @brief Declares and imports a CustomMsgHandle object from another mod. + * + * This will allow you to use and interact with custom messages from other mods. + */ +#define EZTR_IMPORT_CUSTOM_MSG_HANDLE_NO_PREFIX(mod_str, name) RECOMP_IMPORT(mod_str, u16 name(_EZTR_CustomMsgHandleSetter* setter)) + +/** + * @brief Gets the textId from a custom message handle. + * + * A more readable alternative to `handle(NULL)` + * + */ +#define EZTR_GET_CUSTOM_MSG_ID(handle) handle(NULL) + +// Shorthand: +/** + * @brief Shorthand for `EZTR_CUSTOM_MSG_HANDLE_NAME()` + * + * Useful if you want to use global prefixes. + * + */ +#define EZTR_HNAME(name_suffix) EZTR_CUSTOM_MSG_HANDLE_NAME(name_suffix) + +/** + * @brief Gets the textId from a custom message handle. + * + * A more readable alternative to `handle(NULL)`, and shorthand for `EZTR_GET_CUSTOM_MSG_ID()` + * + * Note that this macro won't apply the global prefix if it's enabled. You'll need to use something like + * `EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(my_handle))` or `EZTR_GET_ID(EZTR_HNAME(my_handle))`. + */ +#define EZTR_GET_ID(handle) EZTR_GET_CUSTOM_MSG_ID(handle) + + +/** + * @brief Gets the textId from a custom message handle. + * + * A more readable alternative to `EZTR_CustomMsgHandle_##handle(NULL)`. + * + * This macro WILL apply the global prefix if it's enabled, and can be considered shorthand for + * `EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(my_handle))` or `EZTR_GET_ID(EZTR_HNAME(my_handle))`. + */ +#define EZTR_GET_ID_H(handle) EZTR_GET_CUSTOM_MSG_ID(EZTR_CUSTOM_MSG_HANDLE_NAME(handle)) + +/** @}*/ +/** + * @brief A macro to easily create message callback functions. + * + * This macro can be used to create both the function definition and declaration (if one is needed); + * + * * To create the definition, use `EZTR_MSG_CALLBACK(my_callback) {...}` + * * To create the declaration, use `EZTR_MSG_CALLBACK(my_callback);` + * + * `my_callback` can then be passed to any `EZTR_Basic_*` function as the `callback` argument. + * `my_callback` will be run immediately after EZTR loads the message from its internal + * table, allowing you to make changes (or completely regenerate the message from scratch) + * before the message is displayed. + * + * The function generated by this macro has 3 arguments: + * * `EZTR_MsgBuffer* buf` - A message buffer, prepopulated with a copy of whatever message you stored. Write to this buffer the change the message. + * * `u16 textId` - The textId of the message. Useful if you want multiple messages to be controlled by one callback function. + * * `PlayState* play` - The current PlayState for the game. This makes it easy to generate text based on the game's state. + * + */ +#define EZTR_MSG_CALLBACK(fname) void fname(EZTR_MsgBuffer* buf, u16 textId, PlayState* play) + +/** + * @brief Used to declare a function that should run after EZTR has finished initializing. + * + * This is where you should declare all of your text replacements. You don't want to declare them during a + * `recomp_on_init` event, since EZTR may not have initialized itself yet, and attempting to declare text + * replacements before that will cause a crash. Additionally, declaring messaged here will ensure that mod + * priority order is respected when declaring replacements. + * + * As of version 2.1.0, EZTR now enforces that message all calls to `EZTR_Basic_*` functions must be made here. + * + * Example: `EZTR_ON_INIT void declare_my_text() {...}` + * + */ +#define EZTR_ON_INIT RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnInit) + +/** + * @brief Used to declare a callback function for when EZTR dumps a message. Normally, EZTR only prints that message to the game console, + * but this callback will allow you to do other things with that information. This `EZTR_ON_DUMP_BUFFER` event is only called when EZTR's + * text dump setting is set to `On`. + * + * This is a feature intended for developers, for the creation of EZTR-related tools. It should not be used for gameplay. + * + * The functions parameters are + * * `const char* category`, currently only returns 'Game'. + * * `u16 textId`, the ID of the message being dumped. + * * ` s32 len`, the size of the message in bytes. + * * `EZTR_MsgBuffer* buf`, the message buffer itself. + * + */ +#define EZTR_ON_DUMP_BUFFER(func_name) \ + RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnDumpBuffer) void func_name(const char* category, u16 textId, s32 len, EZTR_MsgBuffer* buf) + +/** + * @brief Used to declare a callback function for when EZTR dumps the entire message buffer. Normally, EZTR only prints that message to the game console, + * but this callback will allow you to do other things with that information. This `EZTR_ON_DUMP_BUFFER` event is only called when EZTR's + * text dump setting is set to `Full`. + * + * This is a feature intended for developers, for the creation of EZTR-related tools. It should not be used for gameplay. + * + * The functions parameters are + * * `const char* category`, currently only returns 'Game'. + * * `u16 textId`, the ID of the message being dumped. + * * ` s32 len`, the size of the message in bytes. + * * `EZTR_MsgBuffer* buf`, the message buffer itself. + * + */ +#define EZTR_ON_DUMP_BUFFER_FULL(func_name) \ + RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnDumpBufferFull) void func_name(const char* category, u16 textId, s32 len, EZTR_MsgBuffer* buf) + +/** + * @brief Used by certain members of `EZTR_MsgData` (and the message header generally) to indicate that said member is not in use. + * + * The header members in question are: + * + * * `next_message_id` + * * `first_item_rupees` + * * `second_item_rupees` + * + */ +#define EZTR_NO_VALUE 0xffff + +/** + * \defgroup Types + * + * \brief Type definitions that EZTR uses for Majora's Mask messages. + * + * @{ + */ + +/** + * @brief The message buffers type as defined in the Majora's Mask decompilation. + * + * While you can edit messages by interacting with this struct directly, EZTR + * offers much better ways of editing messages. + */ +typedef union { + char schar[EZTR_MSG_BUFFER_SIZE]; // msgBuf + u16 wchar[EZTR_MSG_BUFFER_WIDE_SIZE]; // msgBufWide + u64 force_structure_alignment_msg; +} EZTR_MsgBuffer_Raw; + + +/** + * @brief The message buffer, but with the header and content regions defined as seperate arrays. + * + * The `content` member can be passed to the `EZTR_MsgSContent_` functions for use in text operations. + * + */ +typedef struct { + char header[EZTR_MSG_HEADER_SIZE]; + char content[EZTR_MSG_CONTENT_SIZE]; +} EZTR_MsgBuffer_Partition; + + +/** + * @brief The message buffer, with the header represented as its individual members. + * + * When compiled, this struct is marked with the `packed` attribute to ensure that it's members align + * to their proper locations within the buffer. + * + * The `padding` member represents a section of the buffer that is unused, and should thus be ignored. + * + * The `content` member can be passed to the `EZTR_MsgSContent_` functions for use in text operations. + * + */ +typedef struct EZTR_PACK_STRUCT { + u8 text_box_type; + u8 text_box_y_pos; + u8 display_icon; + u16 next_message_id; + u16 first_item_rupees; + u16 second_item_rupees; + u16 padding; + char content[EZTR_MSG_CONTENT_SIZE]; +} EZTR_MsgBuffer_Data; + +/** + * @brief A union of the three MsgBuffer structs, and the primary type for interacting with message data. + * + * Each member of the union is a different way of representing the buffer in code. + * + * * `raw` is the buffer as it exists in the Majora's Mask decomp. + * * `partitions` is the buffer, seperated into it's two primary regions (header and content). + * * `data` is the buffer, with it's header and content values listed as individual members. + * + * Do not allocate this on the stack, as you'll likely end up with a StackOverflow. Instead, create a buffer using + * `EZTR_MsgBuffer_Create()` of one of it's sister functions. + */ +typedef union { + EZTR_MsgBuffer_Raw raw; + EZTR_MsgBuffer_Partition partitions; + EZTR_MsgBuffer_Data data; +} EZTR_MsgBuffer; + +/** + * @brief The type declaration for custom message handle. + * + * These are created using either the `EZTR_DEFINE_CUSTOM_MSG_HANDLE()` macro + * or the `EZTR_DEFINE_CUSTOM_MSG_HANDLE_NO_EXPORT()` macro in one of your .c files, + * outside of any functions. + * + * + */ +typedef u16 (*EZTR_CustomMsgHandle)(_EZTR_CustomMsgHandleSetter* setter); + +/** + * @brief The function pointer type for message callbacks. + * + * To easily create functions that match this type, see the `EZTR_MSG_CALLBACK()` macro. + * + */ +typedef void (*EZTR_MsgCallback)(EZTR_MsgBuffer* buf, u16 textId, PlayState* play); + +/** + * @brief Used in the message header to indicate the style of textbox used for the message. + * + * You can set the text box type by assigning to the `text_box_type` member of EZTR_MsgData, + * or by using `EZTR_MsgBuffer_SetTextBoxType()`. + * + */ +typedef enum { + EZTR_STANDARD_TEXT_BOX_I = 0X00, + EZTR_WOODEN_SIGN_BACKGROUND = 0X01, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX = 0X02, + EZTR_OCARINA_STAFF = 0X03, + EZTR_INVISIBLE_TEXT_BOX_I = 0X04, + EZTR_INVISIBLE_TEXT_BOX_II = 0X05, + EZTR_STANDARD_TEXT_BOX_II = 0X06, + EZTR_INVISIBLE_TEXT_BOX = 0X07, + EZTR_BLUE_TEXT_BOX = 0X08, + EZTR_RED_TEXT_BOX_I = 0X09, + EZTR_INVISIBLE_TEXT_BOX_III = 0X0A, + EZTR_INVISIBLE_TEXT_BOX_IV = 0X0B, + EZTR_INVISIBLE_TEXT_BOX_V = 0X0C, + EZTR_BOMBERS_NOTEBOOK = 0X0D, + EZTR_INVISIBLE_TEXT_BOX_VI = 0X0E, + EZTR_RED_TEXT_BOX_II = 0X0F +} EZTR_TextBoxType; + +/** + * @brief Used in the message header to indicate a display icon for the message. + * + * You can set the display icon by assigning to the `display_icon` member of EZTR_MsgData, + * or by using `EZTR_MsgBuffer_SetTextBoxDIsplayIcon()`. + * + * Note that the value for not displaying an icon is `EZTR_ICON_NO_ICON`, and NOT + * + * `EZTR_ICON_NOTHING` or it's variants. + */ +typedef enum { + EZTR_ICON_NOTHING = 0x00, + EZTR_ICON_GREEN_RUPEE = 0x01, + EZTR_ICON_BLUE_RUPEE = 0x02, + EZTR_ICON_WHITE_RUPEE = 0x03, + EZTR_ICON_RED_RUPEE = 0x04, + EZTR_ICON_PURPLE_RUPEE = 0x05, + EZTR_ICON_WHITE_RUPEE_1 = 0x06, + EZTR_ICON_ORANGE_RUPEE = 0x07, + EZTR_ICON_ADULT_WALLET = 0x08, + EZTR_ICON_GIANTS_WALLET = 0x09, + EZTR_ICON_RECOVERY_HEART = 0x0A, + EZTR_ICON_RECOVERY_HEART_1 = 0x0B, + EZTR_ICON_PIECE_OF_HEART = 0x0C, + EZTR_ICON_HEART_CONTAINER = 0x0D, + EZTR_ICON_SMALL_MAGIC_JAR = 0x0E, + EZTR_ICON_LARGE_MAGIC_JAR = 0x0F, + EZTR_ICON_RECOVERY_HEART_2 = 0x10, + EZTR_ICON_STRAY_FAIRY = 0x11, + EZTR_ICON_RECOVERY_HEART_3 = 0x12, + EZTR_ICON_RECOVERY_HEART_4 = 0x13, + EZTR_ICON_BOMB = 0x14, + EZTR_ICON_BOMB_1 = 0x15, + EZTR_ICON_BOMB_2 = 0x16, + EZTR_ICON_BOMB_3 = 0x17, + EZTR_ICON_BOMB_4 = 0x18, + EZTR_ICON_DEKU_STICK = 0x19, + EZTR_ICON_BOMBCHU = 0x1A, + EZTR_ICON_BOMB_BAG = 0x1B, + EZTR_ICON_BIG_BOMB_BAG = 0x1C, + EZTR_ICON_BIGGER_BOMB_BAG = 0x1D, + EZTR_ICON_HEROS_BOW = 0x1E, + EZTR_ICON_HEROS_BOW_1 = 0x1F, + EZTR_ICON_HEROS_BOW_2 = 0x20, + EZTR_ICON_HEROS_BOW_3 = 0x21, + EZTR_ICON_QUIVER = 0x22, + EZTR_ICON_BIG_QUIVER = 0x23, + EZTR_ICON_BIGGEST_QUIVER = 0x24, + EZTR_ICON_FIRE_ARROW = 0x25, + EZTR_ICON_ICE_ARROW = 0x26, + EZTR_ICON_LIGHT_ARROW = 0x27, + EZTR_ICON_DEKU_NUT = 0x28, + EZTR_ICON_DEKU_NUT_1 = 0x29, + EZTR_ICON_DEKU_NUT_2 = 0x2A, + EZTR_ICON_NOTHING_1 = 0x2B, + EZTR_ICON_NOTHING_2 = 0x2C, + EZTR_ICON_NOTHING_3 = 0x2D, + EZTR_ICON_NOTHING_4 = 0x2E, + EZTR_ICON_NOTHING_5 = 0x2F, + EZTR_ICON_NOTHING_6 = 0x30, + EZTR_ICON_NOTHING_7 = 0x31, + EZTR_ICON_HEROS_SHIELD = 0x32, + EZTR_ICON_MIRROR_SHIELD = 0x33, + EZTR_ICON_POWDER_KEG = 0x34, + EZTR_ICON_MAGIC_BEAN = 0x35, + EZTR_ICON_PICTOGRAPH_BOX = 0x36, + EZTR_ICON_KOKIRI_SWORD = 0x37, + EZTR_ICON_RAZOR_SWORD = 0x38, + EZTR_ICON_GILDED_SWORD = 0x39, + EZTR_ICON_FIERCE_DEITYS_SWORD = 0x3A, + EZTR_ICON_GREAT_FAIRYS_SWORD = 0x3B, + EZTR_ICON_SMALL_KEY = 0x3C, + EZTR_ICON_BOSS_KEY = 0x3D, + EZTR_ICON_DUNGEON_MAP = 0x3E, + EZTR_ICON_COMPASS = 0x3F, + EZTR_ICON_POWDER_KEG_1 = 0x40, + EZTR_ICON_HOOKSHOT = 0x41, + EZTR_ICON_LENS_OF_TRUTH = 0x42, + EZTR_ICON_PICTOGRAPH_BOX_1 = 0x43, + EZTR_ICON_FISHING_ROD = 0x44, + EZTR_ICON_NOTHING_8 = 0x45, + EZTR_ICON_NOTHING_9 = 0x46, + EZTR_ICON_NOTHING_10 = 0x47, + EZTR_ICON_NOTHING_11 = 0x48, + EZTR_ICON_NOTHING_12 = 0x49, + EZTR_ICON_NOTHING_13 = 0x4A, + EZTR_ICON_NOTHING_14 = 0x4B, + EZTR_ICON_OCARINA_OF_TIME = 0x4C, + EZTR_ICON_NOTHING_15 = 0x4D, + EZTR_ICON_NOTHING_16 = 0x4E, + EZTR_ICON_NOTHING_17 = 0x4F, + EZTR_ICON_BOMBERS_NOTEBOOK = 0x50, + EZTR_ICON_NOTHING_18 = 0x51, + EZTR_ICON_GOLD_SKULLTULA_TOKEN = 0x52, + EZTR_ICON_NOTHING_19 = 0x53, + EZTR_ICON_NOTHING_20 = 0x54, + EZTR_ICON_ODOLWAS_REMAINS = 0x55, + EZTR_ICON_GOHTS_REMAINS = 0x56, + EZTR_ICON_GYORGS_REMAINS = 0x57, + EZTR_ICON_TWINMOLDS_REMAINS = 0x58, + EZTR_ICON_RED_POTION = 0x59, + EZTR_ICON_EMPTY_BOTTLE = 0x5A, + EZTR_ICON_RED_POTION_1 = 0x5B, + EZTR_ICON_GREEN_POTION = 0x5C, + EZTR_ICON_BLUE_POTION = 0x5D, + EZTR_ICON_FAIRYS_SPIRIT = 0x5E, + EZTR_ICON_DEKU_PRINCESS = 0x5F, + EZTR_ICON_MILK = 0x60, + EZTR_ICON_MILK_HALF = 0x61, + EZTR_ICON_FISH = 0x62, + EZTR_ICON_BUG = 0x63, + EZTR_ICON_BLUE_FIRE = 0x64, + EZTR_ICON_POE = 0x65, + EZTR_ICON_BIG_POE = 0x66, + EZTR_ICON_SPRING_WATER = 0x67, + EZTR_ICON_HOT_SPRING_WATER = 0x68, + EZTR_ICON_ZORA_EGG = 0x69, + EZTR_ICON_GOLD_DUST = 0x6A, + EZTR_ICON_MUSHROOM = 0x6B, + EZTR_ICON_NOTHING_21 = 0x6C, + EZTR_ICON_NOTHING_22 = 0x6D, + EZTR_ICON_SEAHORSE = 0x6E, + EZTR_ICON_CHATEAU_ROMANI = 0x6F, + EZTR_ICON_HYLIAN_LOACH = 0x70, + EZTR_ICON_NOTHING_23 = 0x71, + EZTR_ICON_NOTHING_24 = 0x72, + EZTR_ICON_NOTHING_25 = 0x73, + EZTR_ICON_NOTHING_26 = 0x74, + EZTR_ICON_NOTHING_27 = 0x75, + EZTR_ICON_NOTHING_28 = 0x76, + EZTR_ICON_NOTHING_29 = 0x77, + EZTR_ICON_DEKU_MASK = 0x78, + EZTR_ICON_GORON_MASK = 0x79, + EZTR_ICON_ZORA_MASK = 0x7A, + EZTR_ICON_FIERCE_DEITY_MASK = 0x7B, + EZTR_ICON_MASK_OF_TRUTH = 0x7C, + EZTR_ICON_KAFEIS_MASK = 0x7D, + EZTR_ICON_ALL_NIGHT_MASK = 0x7E, + EZTR_ICON_BUNNY_HOOD = 0x7F, + EZTR_ICON_KEATON_MASK = 0x80, + EZTR_ICON_GARO_MASK = 0x81, + EZTR_ICON_ROMANI_MASK = 0x82, + EZTR_ICON_CIRCUS_LEADERS_MASK = 0x83, + EZTR_ICON_POSTMANS_HAT = 0x84, + EZTR_ICON_COUPLES_MASK = 0x85, + EZTR_ICON_GREAT_FAIRYS_MASK = 0x86, + EZTR_ICON_GIBDO_MASK = 0x87, + EZTR_ICON_DON_GEROS_MASK = 0x88, + EZTR_ICON_KAMAROS_MASK = 0x89, + EZTR_ICON_CAPTAINS_HAT = 0x8A, + EZTR_ICON_STONE_MASK = 0x8B, + EZTR_ICON_BREMEN_MASK = 0x8C, + EZTR_ICON_BLAST_MASK = 0x8D, + EZTR_ICON_MASK_OF_SCENTS = 0x8E, + EZTR_ICON_GIANTS_MASK = 0x8F, + EZTR_ICON_NOTHING_30 = 0x90, + EZTR_ICON_CHATEAU_ROMANI_1 = 0x91, + EZTR_ICON_MILK_1 = 0x92, + EZTR_ICON_GOLD_DUST_1 = 0x93, + EZTR_ICON_HYLIAN_LOACH_1 = 0x94, + EZTR_ICON_SEAHORSE_1 = 0x95, + EZTR_ICON_MOONS_TEAR = 0x96, + EZTR_ICON_TOWN_TITLE_DEED = 0x97, + EZTR_ICON_SWAMP_TITLE_DEED = 0x98, + EZTR_ICON_MOUNTAIN_TITLE_DEED = 0x99, + EZTR_ICON_OCEAN_TITLE_DEED = 0x9A, + EZTR_ICON_NOTHING_31 = 0x9B, + EZTR_ICON_NOTHING_32 = 0x9C, + EZTR_ICON_NOTHING_33 = 0x9D, + EZTR_ICON_NOTHING_34 = 0x9E, + EZTR_ICON_NOTHING_35 = 0x9F, + EZTR_ICON_ROOM_KEY = 0xA0, + EZTR_ICON_SPECIAL_DELIVERY_TO_MAMA = 0xA1, + EZTR_ICON_NOTHING_36 = 0xA2, + EZTR_ICON_NOTHING_37 = 0xA3, + EZTR_ICON_NOTHING_38 = 0xA4, + EZTR_ICON_NOTHING_39 = 0xA5, + EZTR_ICON_NOTHING_40 = 0xA6, + EZTR_ICON_NOTHING_41 = 0xA7, + EZTR_ICON_NOTHING_42 = 0xA8, + EZTR_ICON_NOTHING_43 = 0xA9, + EZTR_ICON_LETTER_TO_KAFEI = 0xAA, + EZTR_ICON_PENDANT_OF_MEMORIES = 0xAB, + EZTR_ICON_NOTHING_44 = 0xAC, + EZTR_ICON_NOTHING_45 = 0xAD, + EZTR_ICON_NOTHING_46 = 0xAE, + EZTR_ICON_NOTHING_47 = 0xAF, + EZTR_ICON_NOTHING_48 = 0xB0, + EZTR_ICON_NOTHING_49 = 0xB1, + EZTR_ICON_NOTHING_50 = 0xB2, + EZTR_ICON_TINGLES_MAP = 0xB3, + EZTR_ICON_TINGLES_MAP_1 = 0xB4, + EZTR_ICON_TINGLES_MAP_2 = 0xB5, + EZTR_ICON_TINGLES_MAP_3 = 0xB6, + EZTR_ICON_TINGLES_MAP_4 = 0xB7, + EZTR_ICON_TINGLES_MAP_5 = 0xB8, + EZTR_ICON_TINGLES_MAP_6 = 0xB9, + EZTR_ICON_NOTHING_51 = 0xBA, + EZTR_ICON_NOTHING_52 = 0xBB, + EZTR_ICON_NOTHING_53 = 0xBC, + EZTR_ICON_NOTHING_54 = 0xBD, + EZTR_ICON_NOTHING_55 = 0xBE, + EZTR_ICON_NOTHING_56 = 0xBF, + EZTR_ICON_NOTHING_57 = 0xC0, + EZTR_ICON_NOTHING_58 = 0xC1, + EZTR_ICON_NOTHING_59 = 0xC2, + EZTR_ICON_NOTHING_60 = 0xC3, + EZTR_ICON_NOTHING_61 = 0xC4, + EZTR_ICON_NOTHING_62 = 0xC5, + EZTR_ICON_NOTHING_63 = 0xC6, + EZTR_ICON_NOTHING_64 = 0xC7, + EZTR_ICON_NOTHING_65 = 0xC8, + EZTR_ICON_NOTHING_66 = 0xC9, + EZTR_ICON_NOTHING_67 = 0xCA, + EZTR_ICON_NOTHING_68 = 0xCB, + EZTR_ICON_NOTHING_69 = 0xCC, + EZTR_ICON_NOTHING_70 = 0xCD, + EZTR_ICON_NOTHING_71 = 0xCE, + EZTR_ICON_NOTHING_72 = 0xCF, + EZTR_ICON_NOTHING_73 = 0xD0, + EZTR_ICON_NOTHING_74 = 0xD1, + EZTR_ICON_NOTHING_75 = 0xD2, + EZTR_ICON_NOTHING_76 = 0xD3, + EZTR_ICON_NOTHING_77 = 0xD4, + EZTR_ICON_NOTHING_78 = 0xD5, + EZTR_ICON_NOTHING_79 = 0xD6, + EZTR_ICON_NOTHING_80 = 0xD7, + EZTR_ICON_SMALL_BLACK_LINE = 0xD8, + EZTR_ICON_SMALL_BLACK_LINE_1 = 0xD9, + EZTR_ICON_SMALL_BLACK_LINE_2 = 0xDA, + EZTR_ICON_SMALL_BLACK_LINE_3 = 0xDB, + EZTR_ICON_ANJU = 0xDC, + EZTR_ICON_KAFEI = 0xDD, + EZTR_ICON_CURIOSITY_SHOP_OWNER = 0xDE, + EZTR_ICON_BOMB_SHOP_OWNERS_MOTHER = 0xDF, + EZTR_ICON_ROMANI = 0xE0, + EZTR_ICON_CREMIA = 0xE1, + EZTR_ICON_MAYOR_DOTOUR = 0xE2, + EZTR_ICON_MADAME_AROMA = 0xE3, + EZTR_ICON_TOTO = 0xE4, + EZTR_ICON_GORMAN = 0xE5, + EZTR_ICON_POSTMAN = 0xE6, + EZTR_ICON_ROSA_SISTERS = 0xE7, + EZTR_ICON_TOILET_HAND = 0xE8, + EZTR_ICON_GRANNY = 0xE9, + EZTR_ICON_KAMARO = 0xEA, + EZTR_ICON_GROG = 0xEB, + EZTR_ICON_GORMAN_BROTHERS = 0xEC, + EZTR_ICON_SHIRO = 0xED, + EZTR_ICON_GURU_GURU = 0xEE, + EZTR_ICON_BOMBERS = 0xEF, + EZTR_ICON_EXCLAMATION_MARK = 0xF0, + EZTR_ICON_NOTHING_81 = 0xF1, + EZTR_ICON_NOTHING_82 = 0xF2, + EZTR_ICON_NOTHING_83 = 0xF3, + EZTR_ICON_NOTHING_84 = 0xF4, + EZTR_ICON_NOTHING_85 = 0xF5, + EZTR_ICON_NOTHING_86 = 0xF6, + EZTR_ICON_NOTHING_87 = 0xF7, + EZTR_ICON_NOTHING_88 = 0xF8, + EZTR_ICON_NOTHING_89 = 0xF9, + EZTR_ICON_NOTHING_90 = 0xFA, + EZTR_ICON_NOTHING_91 = 0xFB, + EZTR_ICON_NOTHING_92 = 0xFC, + EZTR_ICON_NOTHING_93 = 0xFD, + EZTR_ICON_NO_ICON = 0xFE, + EZTR_ICON_MAX = 0xFE +} EZTR_TextBoxIcon; + +/** @}*/ + + +/** + * \defgroup Control_Code_Macros + * \brief Macros for the various control codes and non-printable bytes used in the Majora's Mask text encoding. + * + * Most of this information was pulled from [the CloudModding wiki](https://wiki.cloudmodding.com/mm/Text_Format). + * + * @{ + */ +/** + * @brief Following Text Color: Default + * + * Default is usually white, but may be black (ie: for notebook updates). + * + */ +#define EZTR_CC_COLOR_DEFAULT "\x00" + +/** + * @brief Following Text Color: Red + */ +#define EZTR_CC_COLOR_RED "\x01" + +/** + * @brief Following Text Color: Green + */ +#define EZTR_CC_COLOR_GREEN "\x02" + +/** + * @brief Following Text Color: Blue + */ +#define EZTR_CC_COLOR_BLUE "\x03" + +/** + * @brief Following Text Color: Yellow + */ +#define EZTR_CC_COLOR_YELLOW "\x04" + +/** + * @brief Following Text Color: Turquoise + */ +#define EZTR_CC_COLOR_LIGHTBLUE "\x05" + +/** + * @brief Following Text Color: Pink + */ +#define EZTR_CC_COLOR_PINK "\x06" + +/** + * @brief Following Text Color: Silver + */ +#define EZTR_CC_COLOR_SILVER "\x07" + +/** + * @brief Following Text Color: Orange + */ +#define EZTR_CC_COLOR_ORANGE "\x08" + +/** + * @brief Slows down text (not used) + * + * Text normally prints 2 letters at a time. 0A acts as a null character. So 0A0A prints nothing not even a space when normally 2 letters are printed. + * + */ +#define EZTR_CC_TEXT_SPEED "\x0a" + +/** + * @brief Print: Hits Required to Win Jungle Cruise Reward + */ +#define EZTR_CC_HS_BOAT_ARCHERY "\x0b" + +/** + * @brief Print: Stray Fairies Collected in Current Dungeon + * + */ +#define EZTR_CC_STRAY_FAIRIES "\x0c" + +/** + * @brief Print: Gold Skulltulas Collected in Current Spider House + */ +#define EZTR_CC_TOKENS "\x0d" + +/** + * @brief Print: 0 + */ +#define EZTR_CC_POINTS_TENS "\x0e" + +/** + * @brief Print: 0 + */ +#define EZTR_CC_POINTS_THOUSANDS "\x0f" + +/** + * @brief Box Break I + * + * Used when four lines of text have been printed, but can technically be used anywhere. More robust than 12/000B? [?] + * + */ +#define EZTR_CC_BOX_BREAK "\x10" + +/** + * @brief Line Break + */ +#define EZTR_CC_NEWLINE "\x11" + +/** + * @brief Box Break II + * + * Used when three lines of text have been printed. Usually preceded by a 13/000C character. + * + */ +#define EZTR_CC_BOX_BREAK2 "\x12" + +/** + * @brief Reset Cursor Position to Start of Current Line + * + * Used as a filler when there are fewer than four lines of text. Usually preceded by a newline when two lines of text have been printed. + * + */ +#define EZTR_CC_CARRIAGE_RETURN "\x13" + +/** + * @brief Print: xx Spaces + * + * The value of the next byte will control how many spaces to print. + * + */ +#define EZTR_CC_SHIFT "\x14" + +/** + * @brief Print: %c Spaces + * + * The value of the next byte will control how many spaces to print. + * This macro adds a `%%c` flag after the control code, enabling you to set the argument byte using EZTR's printf handling. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + */ +#define EZTR_CC_SHIFT_ARGC "\x14%c" + +/** + * @brief Disable Text Skip I + * + * Triangle box. Does not play sound. + * + */ +#define EZTR_CC_CONTINUE "\x15" + +/** + * @brief Print: Player Name + */ +#define EZTR_CC_NAME "\x16" + +/** + * @brief Enable: Instantaneous Text + */ +#define EZTR_CC_QUICKTEXT_ENABLE "\x17" + +/** + * @brief Disable: Instantaneous Text + */ +#define EZTR_CC_QUICKTEXT_DISABLE "\x18" + +/** + * @brief Disable Text Skip II + * + * Triangle box. Plays "Text Finished" sound. + * + */ +#define EZTR_CC_EVENT "\x19" + +/** + * @brief Disable Text Box Close + * + * Used for shop item descriptions. + * + */ +#define EZTR_CC_PERSISTENT "\x1a" + +/** + * @brief Delay for xxxx Before Printing Remaining Text + * + * The next two bytes determine the length of the delay. + * + */ +#define EZTR_CC_BOX_BREAK_DELAYED "\x1b" + +/** + * @brief Delay for xxxx Before Printing Remaining Text + * + * The next two bytes determine the length of the delay. + * This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + */ +#define EZTR_CC_BOX_BREAK_DELAYED_ARGW "\x1b%w" + + +/** + * @brief Keep Text on Screen for xxxx Before Closing + * + * The next two bytes determine the length of the delay. + * + * Player can move around while text is displayed. + * + */ +#define EZTR_CC_FADE "\x1c" + +/** + * @brief Keep Text on Screen for xxxx Before Closing + * + * The next two bytes determine the length of the delay. + * This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * Player can move around while text is displayed. + * + */ +#define EZTR_CC_FADE_ARGW "\x1c%w" + +/** + * @brief Delay for xxxx Before Ending Conversation + * + * The next two bytes determine the length of the delay. + * + */ +#define EZTR_CC_FADE_SKIPPABLE "\x1d" + +/** + * @brief Delay for xxxx Before Ending Conversation + * + * The next two bytes determine the length of the delay. + * This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + */ +#define EZTR_CC_FADE_SKIPPABLE_ARGW "\x1d%w" + +/** + * @brief Play Sound Effect xxxx + * + * The next two bytes will be the ID of the sound effect. The ID values are the same as the ones used with `Audio_PlaySfx`. + * + */ +#define EZTR_CC_SFX "\x1e" + +/** + * @brief Play Sound Effect xxxx + * + * The next two bytes will be the ID of the sound effect. The ID values are the same as the ones used with `Audio_PlaySfx`. + * This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + */ +#define EZTR_CC_SFX_ARGW "\x1e%w" + +/** + * @brief Delay for xxxx Before Resuming Text Flow + * + * The next two bytes determine the length of the delay. + * + */ +#define EZTR_CC_DELAY "\x1f" + +/** + * @brief Delay for xxxx Before Resuming Text Flow + * + * The next two bytes determine the length of the delay. + * This macro adds a `%%w` flag after the control code, enabling you to set the argument bytes using EZTR's printf handling. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + */ +#define EZTR_CC_DELAY_ARGW "\x1f%w" + +/** + * @brief Displays the A Button icon + */ +#define EZTR_CC_BTN_A "\xb0" + +/** + * @brief Displays the B button icon + */ +#define EZTR_CC_BTN_B "\xb1" + +/** + * @brief Displays the C buttons icon + */ +#define EZTR_CC_BTN_C "\xb2" + +/** + * @brief Displays the L button icon + */ +#define EZTR_CC_BTN_L "\xb3" + +/** + * @brief Displays the R button icon + */ +#define EZTR_CC_BTN_R "\xb4" + +/** + * @brief Displays the Z button icon + */ +#define EZTR_CC_BTN_Z "\xb5" + +/** + * @brief Displays the C-up button icon + */ +#define EZTR_CC_BTN_CUP "\xb6" + +/** + * @brief Displays the C-down button icon + */ +#define EZTR_CC_BTN_CDOWN "\xb7" + +/** + * @brief Displays the C-left button icon + */ +#define EZTR_CC_BTN_CLEFT "\xb8" + +/** + * @brief Displays the C-right button icon + */ +#define EZTR_CC_BTN_CRIGHT "\xb9" + +/** + * @brief DDisplays the Z targeting icon + */ +#define EZTR_CC_Z_TARGET "\xba" + +/** + * @brief Displays the Control Pad icon + */ +#define EZTR_CC_CONTROL_PAD "\xbb" + +/** + * @brief Message End Marker + * + * This is the termination character for message content. + * + */ +#define EZTR_CC_END "\xbf" + +/** + * @brief Ocarina Song Failure + * + * Draws red X across the text box on the screen & centers text vertically/pushes it out. + * + */ +#define EZTR_CC_BACKGROUND "\xc1" + +/** + * @brief Initialize Selection: Two Choices + */ +#define EZTR_CC_TWO_CHOICE "\xc2" + +/** + * @brief Initialize Selection: Three Choices + */ +#define EZTR_CC_THREE_CHOICE "\xc3" + +/** + * @brief Print: Postman's Counting Game Results + */ +#define EZTR_CC_TIMER_POSTMAN "\xc4" + +/** + * @brief Timer Value + */ +#define EZTR_CC_TIMER_MINIGAME_1 "\xc5" + +/** + * @brief Timer Value + */ +#define EZTR_CC_TIMER_2 "\xc6" + +/** + * @brief Print: Remaining Time Till Moon Falls (Clock Tower Roof) + */ +#define EZTR_CC_TIMER_MOON_CRASH "\xc7" + +/** + * @brief Print: Deku Scrub Playground Results + */ +#define EZTR_CC_TIMER_MINIGAME_2 "\xc8" + +/** + * @brief Timer Value + */ +#define EZTR_CC_TIMER_ENV_HAZARD "\xc9" + +/** + * @brief Timer Value + */ +#define EZTR_CC_TIME "\xca" + +/** + * @brief Print: Shooting Gallery Minigame Results + */ +#define EZTR_CC_CHEST_FLAGS "\xcb" + +/** + * @brief Display Prompt: Withdraw or Deposit Rupees + */ +#define EZTR_CC_INPUT_BANK "\xcc" + +/** + * @brief Print: Number of Rupees Entered or Bet + */ +#define EZTR_CC_RUPEES_SELECTED "\xcd" + +/** + * @brief Print: Total Rupees in Bank or Won by Betting + */ +#define EZTR_CC_RUPEES_TOTAL "\xce" + +/** + * @brief Print: Time Remaining in Hours & Minutes + */ +#define EZTR_CC_TIME_UNTIL_MOON_CRASH "\xcf" + +/** + * @brief Display Prompt: Rupees to Bet + */ +#define EZTR_CC_INPUT_DOGGY_RACETRACK_BET "\xd0" + +/** + * @brief Display Prompt: Bombers' Code + */ +#define EZTR_CC_INPUT_BOMBER_CODE "\xd1" + +/** + * @brief Item Prompt + * + * Delays closing the text box. + * + */ +#define EZTR_CC_PAUSE_MENU "\xd2" + +/** + * @brief [?] + */ +#define EZTR_CC_TIME_SPEED "\xd3" + +/** + * @brief Print: Song of Soaring Destination + */ +#define EZTR_CC_OWL_WARP "\xd4" + +/** + * @brief Display Prompt: Lottery Number + */ +#define EZTR_CC_INPUT_LOTTERY_CODE "\xd5" + +/** + * @brief Print: 123456 + * + * Each number's color is indicative of the Spider House mask code. + * + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE "\xd6" + +/** + * @brief Print: Remaining Stray Fairies in Woodfall Temple + */ +#define EZTR_CC_STRAY_FAIRIES_LEFT_WOODFALL "\xd7" + +/** + * @brief Print: Remaining Stray Fairies in Snowhead Temple + */ +#define EZTR_CC_STRAY_FAIRIES_LEFT_SNOWHEAD "\xd8" + +/** + * @brief Print: Remaining Stray Fairies in Great Bay Temple + */ +#define EZTR_CC_STRAY_FAIRIES_LEFT_GREAT_BAY "\xd9" + +/** + * @brief Print: Remaining Stray Fairies in Stone Tower Temple + */ +#define EZTR_CC_STRAY_FAIRIES_LEFT_STONE_TOWER "\xda" + +/** + * @brief Print: Jungle Cruise Minigame Results + */ +#define EZTR_CC_POINTS_BOAT_ARCHERY "\xdb" + +/** + * @brief Print: Winning Lottery Numbers + */ +#define EZTR_CC_LOTTERY_CODE "\xdc" + +/** + * @brief Print: Player's Lottery Numbers + */ +#define EZTR_CC_LOTTERY_CODE_GUESS "\xdd" + +/** + * @brief Print: Item Value in Rupees + * + * Default: 51 Rupees + * + */ +#define EZTR_CC_HELD_ITEM_PRICE "\xde" + +/** + * @brief Print: Bombers' Code + */ +#define EZTR_CC_BOMBER_CODE "\xdf" + +/** + * @brief End Conversation + * + * Used exclusively for NPCs. Usually followed by a BF/0500 command. + * + */ +#define EZTR_CC_EVENT2 "\xe0" + +/** + * @brief Print: Color of Oceanside Spider House Mask 1 + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_1 "\xe1" + +/** + * @brief Print: Color of Oceanside Spider House Mask 2 + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_2 "\xe2" + +/** + * @brief Print: Color of Oceanside Spider House Mask 3 + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_3 "\xe3" + +/** + * @brief Print: Color of Oceanside Spider House Mask 4 + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_4 "\xe4" + +/** + * @brief Print: Color of Oceanside Spider House Mask 5 + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_5 "\xe5" + +/** + * @brief Print: Color of Oceanside Spider House Mask 6 + */ +#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_6 "\xe6" + +/** + * @brief Print: Remaining Time Till Moon Falls + */ +#define EZTR_CC_HOURS_UNTIL_MOON_CRASH "\xe7" + +/** + * @brief Print: Remaining Time Till Morning in Hours & Minutes + */ +#define EZTR_CC_TIME_UNTIL_NEW_DAY "\xe8" + +/** + * @brief Print: Total Rupees in Bank + */ +#define EZTR_CC_HS_POINTS_BANK_RUPEES "\xf0" + +/** + * @brief Print: 0 + */ +#define EZTR_CC_HS_POINTS_UNK_1 "\xf1" + +/** + * @brief Print: 0 + */ +#define EZTR_CC_HS_POINTS_FISHING "\xf2" + +/** + * @brief Print: 0"10' + */ +#define EZTR_CC_HS_TIME_BOAT_ARCHERY "\xf3" + +/** + * @brief Print: :0"00' + */ +#define EZTR_CC_HS_TIME_HORSE_BACK_BALLOON "\xf4" + +/** + * @brief Print: Timer or Highscore in 00"00' Format [?] + * + * SRAM Offset: 0xEF2 + * + */ +#define EZTR_CC_HS_TIME_LOTTERY_GUESS "\xf5" + +/** + * @brief Print: Town Shooting Gallery Highscore + */ +#define EZTR_CC_HS_TOWN_SHOOTING_GALLERY "\xf6" + +/** + * @brief Print: 00'00"00 + */ +#define EZTR_CC_HS_UNK_1 "\xf7" + +/** + * @brief Print: Magic Bean Price + */ +#define EZTR_CC_HS_UNK_3_LOWER "\xf8" + +/** + * @brief Print: Epona Balloon Archery Highscore I + */ +#define EZTR_CC_HS_HORSE_BACK_BALLOON "\xf9" + +/** + * @brief Print: Deku Scrub Playground Highscore (Day 1) + */ +#define EZTR_CC_HS_DEKU_PLAYGROUND_DAY_1 "\xfa" + +/** + * @brief Print: Deku Scrub Playground Highscore (Day 2) + */ +#define EZTR_CC_HS_DEKU_PLAYGROUND_DAY_2 "\xfb" + +/** + * @brief Print: Deku Scrub Playground Highscore (Day 3) + */ +#define EZTR_CC_HS_DEKU_PLAYGROUND_DAY_3 "\xfc" + +/** + * @brief Print: Broken Character [?] + */ +#define EZTR_CC_DEKU_PLAYGROUND_NAME_DAY_1 "\xfd" + +/** + * @brief [?] + */ +#define EZTR_CC_DEKU_PLAYGROUND_NAME_DAY_2 "\xfe" + +/** + * @brief [?] + */ +#define EZTR_CC_DEKU_PLAYGROUND_NAME_DAY_3 "\xff" + +/** @}*/ + +/** + * \defgroup Basic_Replacement + * \brief functions for replacing vanilla messages. + * + * These functions are currently your primary means of declaring replacements, using Majora's Mask's built-in dialog handling. + * + * @{ + */ + + +/** + * @brief Declare a replacement of a vanilla message by copying from a buffer defined by the user. + * + * If you've defined a message using the MsgBuffer/MsgSContent functions, you can use this to set it (or, rather, + * a copy of it) as a replacement for a vanilla message. + * + * Note that this function is meant for replacing vanilla messages only. It will not allow you to use a textId greater + * than 0x354C, as that is the highest textId value found in the vanilla game. + * If you wish to create/modify a custom message, see `EZTR_Basic_AddCustomBuffer()` and EZTR_Basic_ReplaceCustomBuffer()` + * + * @param textId The id of the vanilla message you wish to replace. + * @param buf The message buffer to copy from. + * @param callback A function pointer to call right before this text is displayed. Useful for dynamic text. Set as NULL if + * you don't want to use a callback. See `EZTR_MsgCallback` for more information. + */ +EZTR_IMPORT(void EZTR_Basic_ReplaceBuffer(u16 textId, EZTR_MsgBuffer* buf, EZTR_MsgCallback callback)); + +/** + * @brief Declare a replacement of a vanilla message by defining the header attributes and message content. + * + * This is probably the easiest method to declare replacement text. + * + * The `content` argument uses EZTR's printf formatting arguments, specified after `callback`. + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * Note that this function is meant for replacing vanilla messages only. It will not allow you to use a textId greater + * than 0x354C, as that is the highest textId value found in the vanilla game. + * If you wish to create/modify a custom message, see `EZTR_Basic_AddCustomText()` and EZTR_Basic_ReplaceCustomText()` + * + * @param textId The id of the vanilla message you wish to replace. + * @param text_box_type The style of textbox to display. Use the `EZTR_TextBoxType` enum for more readable values. + * @param text_box_y_pos The vertical position of the textbox on-screen. + * @param display_icon Displays an icon in the textbox. Use the `EZTR_TextBoxIcon` enum for more readable values. + * Use `EZTR_ICON_NO_ICON` for no icon. + * @param next_message_id The next message to display. If there is no next message, or the next message is determined by code, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param first_item_rupees The price of the first item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param second_item_rupees The price of the second item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param pipe_escape_bytes If true, `content` is passed through `EZTR_MsgBuffer_Sprintf("%m", content)`. If false, + * then `content` is copied directly into storage. + * @param content The new text content to display. Accepts valid EZTR printf type specifiers. If you want empty content (for use with dynamic messages), use "\xBF". + * @param callback A function pointer to call right before this text is displayed. Useful for dynamic messages. + * Set as NULL if you don't want to use a callback. See `EZTR_MsgCallback` for more information. + * @param ... variable arguments, using EZTR's printf implementation. + */ +EZTR_IMPORT(void EZTR_Basic_ReplaceText( + u16 textId, + u8 text_box_type, + u8 text_box_y_pos, + u8 display_icon, + u16 next_message_id, + u16 first_item_rupees, + u16 second_item_rupees, + bool pipe_escape_bytes, + char* content, + EZTR_MsgCallback callback, + ... +)); + +/** + * @brief Declare a replacement of a vanilla message, where the replacement message is empty. + * + * This is primarily used if you want the message to be completely dynamically generated. + * + * Note that this function is meant for replacing vanilla messages only. It will not allow you to use a textId greater + * than 0x354C, as that is the highest textId value found in the vanilla game. + * If you wish to create/modify a custom message, see `EZTR_Basic_AddCustomTextEmpty()` and EZTR_Basic_ReplaceCustomTextEmpty()` + * + * @param textId The id of the vanilla message you wish to replace. + * @param callback A function pointer to call right before this text is displayed, in which you will construct the + * complete message buffer dynamically. See `EZTR_MsgCallback` for more information. + */ +EZTR_IMPORT(void EZTR_Basic_ReplaceTextEmpty(u16 textId, EZTR_MsgCallback callback)); +/** @} */ + +/** + * \defgroup Basic_CustomMessages + * \brief Functions for creating and replacing new messages. + * @{ + * + */ + +/** + * @brief Declare a brand new (i.e: custom) message by copying from a buffer defined by the user. + * + * If you've defined a message using the MsgBuffer/MsgSContent functions, you can use this to set it (or, rather, + * a copy of it) as the new message. + * + * To avoid potential ID conflicts between mods, the u16 textId for this message will be assigned by EZTR and + * will be accessable via the handle. See `EZTR_CustomMsgHandle` for more information on how custom message handles work. + * + * @param handle The handle for the new message. + * @param buf The message buffer to copy from. + * @param callback A function pointer to call right before this text is displayed. Useful for dynamic text. Set as NULL if + * you don't want to use a callback. See `EZTR_MsgCallback` for more information. + */ +EZTR_IMPORT(void EZTR_Basic_AddCustomBuffer(EZTR_CustomMsgHandle handle, EZTR_MsgBuffer* buf, EZTR_MsgCallback callback)); + +/** + * @brief Declare a brand new (i.e: custom) message by defining the header attributes and message content. + * + * This is probably the easiest method to declare new messages. + * + * The `content` argument uses EZTR's printf formatting arguments, specified after `callback`. + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * To avoid potential ID conflicts between mods, the u16 textId for this message will be assigned by EZTR and + * will be accessable via the handle. See `EZTR_CustomMsgHandle` for more information on how custom message handles work. + * + * @param handle The handle for the new message. + * @param text_box_type The style of textbox to display. Use the `EZTR_TextBoxType` enum for more readable values. + * @param text_box_y_pos The vertical position of the textbox on-screen. + * @param display_icon Displays an icon in the textbox. Use the `EZTR_TextBoxIcon` enum for more readable values. + * Use `EZTR_ICON_NO_ICON` for no icon. + * @param next_message_id The next message to display. If there is no next message, or the next message is determined by code, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param first_item_rupees The price of the first item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param second_item_rupees The price of the second item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param pipe_escape_bytes If true, `content` is passed through `EZTR_MsgBuffer_Sprintf("%m", content)`. If false, + * then `content` is copied directly into storage. + * @param content The new text content to display. If you want empty content (for use with dynamic messages), use "\xBF". + * @param callback A function pointer to call right before this text is displayed. Useful for dynamic messages. + * Set as NULL if you don't want to use a callback. See `EZTR_MsgCallback` for more information. + * @param ... variable arguments, using EZTR's printf implementation. + */ +EZTR_IMPORT(void EZTR_Basic_AddCustomText(EZTR_CustomMsgHandle handle, u8 text_box_type, u8 text_box_y_pos, u8 display_icon, + u16 next_message_id, u16 first_item_rupees, u16 second_item_rupees, bool pipe_escape_bytes, char* content, EZTR_MsgCallback callback, ...)); + +/** + * @brief Declare a brand new (i.e: custom) message, where the replacement message is empty. + * + * This is primarily used if you want the message to be completely dynamically generated. + * + * To avoid potential ID conflicts between mods, the u16 textId for this message will be assigned by EZTR and + * will be accessable via the handle. See `EZTR_CustomMsgHandle` for more information on how custom message handles work. + * + * @param handle The handle for the new message. + * @param callback A function pointer to call right before this text is displayed, in which you will construct the + * complete message buffer dynamically. See `EZTR_MsgCallback` for more information. + */ +EZTR_IMPORT(void EZTR_Basic_AddCustomTextEmpty(EZTR_CustomMsgHandle handle, EZTR_MsgCallback callback)); + +/** + * @brief Declare a replacement for a custom message by copying from a buffer defined by the user. + * + * If you've defined a message using the MsgBuffer/MsgSContent functions, you can use this to set it (or, rather, + * a copy of it) as the new message. + * + * @deprecated since 2.3.0. The new handling of message replacement order makes this unnecessary. + * As of this version, this function just wraps `EZTR_Basic_AddCustomBuffer` for compatability. + * + * @param handle The handle for the message being replaced. + * @param buf The message buffer to copy from. + * @param callback A function pointer to call right before this text is displayed. Useful for dynamic text. Set as NULL if + * you don't want to use a callback. See `EZTR_MsgCallback` for more information. + */ +EZTR_IMPORT(void EZTR_Basic_ReplaceCustomBuffer(EZTR_CustomMsgHandle handle, EZTR_MsgBuffer* buf, EZTR_MsgCallback callback)); + +/** + * @brief Declare a replacement of a custom message by defining the header attributes and message content. + * + * This is probably the easiest method to replace custom messages, even those defined by other mods. + * + * The `content` argument uses EZTR's printf formatting arguments, specified after `callback`. + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @deprecated since 2.3.0. The new handling of message replacement order makes this unnecessary. + * As of this version, this function just wraps `EZTR_Basic_AddCustomText` for compatability. + * + * @param handle The handle for the message being replaced. + * @param text_box_type The style of textbox to display. Use the `EZTR_TextBoxType` enum for more readable values. + * @param text_box_y_pos The vertical position of the textbox on-screen. + * @param display_icon Displays an icon in the textbox. Use the `EZTR_TextBoxIcon` enum for more readable values. + * Use `EZTR_ICON_NO_ICON` for no icon. + * @param next_message_id The next message to display. If there is no next message, or the next message is determined by code, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param first_item_rupees The price of the first item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param second_item_rupees The price of the second item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param pipe_escape_bytes If true, `content` is passed through `EZTR_MsgBuffer_Sprintf("%m", content)`. If false, + * then `content` is copied directly into storage. + * @param content The new text content to display. If you want empty content (for use with dynamic messages), use "\xBF". + * @param callback A function pointer to call right before this text is displayed. Useful for dynamic messages. + * Set as NULL if you don't want to use a callback. See `EZTR_MsgCallback` for more information. + * @param ... variable arguments, using EZTR's printf implementation. + */ +EZTR_IMPORT(void EZTR_Basic_ReplaceCustomText(EZTR_CustomMsgHandle handle, u8 text_box_type, u8 text_box_y_pos, u8 display_icon, + u16 next_message_id, u16 first_item_rupees, u16 second_item_rupees, bool pipe_escape_bytes, char* content, EZTR_MsgCallback callback, ...)); + +/** + * @brief Declare a replacement of a custom message, where the replacement message is empty. + * + * This is primarily used if you want the message to be completely dynamically generated. + * + * @deprecated since 2.3.0. The new handling of message replacement order makes this unnecessary. + * As of this version, this function just wraps `EZTR_Basic_AddCustomTextEmpty` for compatability. + * + * @param handle The handle for the message being replaced. + * @param callback A function pointer to call right before this text is displayed, in which you will construct the + * complete message buffer dynamically. See `EZTR_MsgCallback` for more information. + */ +EZTR_IMPORT(void EZTR_Basic_ReplaceCustomTextEmpty(EZTR_CustomMsgHandle handle, EZTR_MsgCallback callback)); + +/** @} */ + +/** + * \defgroup MsgBuffer + * \brief Functions for high-level message buffer operations. + * @{ + */ + + +/** + * @brief Creates a new message buffer object on the heap. + * + * The created buffer will be have a default header and an empty content region. + * You need to free any buffer you create using this function with `EZTR_MsgBuffer_Destroy()`, + * or else you will create a memory leak. + * + * @return MsgBuffer* A pointer to the buffer you created. + */ +EZTR_IMPORT(EZTR_MsgBuffer* EZTR_MsgBuffer_Create()); + +/** + * @brief Creates a new message buffer object on the heap, and copies `src` into it. + * + * Equivalent to `buf = EZTR_MsgBuffer_Create(); EZTR_MsgBuffer_Copy(buf);` + * + * You need to free any buffer you create using this function with `EZTR_MsgBuffer_Destroy()`, + * or else you will create a memory leak. + * + * @param src The content to copy into the buffer. Expected to have a header region, and be terminated with '\xBF'. + * @return MsgBuffer* A pointer to the buffer you created. + */ +EZTR_IMPORT(EZTR_MsgBuffer* EZTR_MsgBuffer_CreateFromStr(char* src)); + +/** + * @brief Creates a new message buffer object on the heap, and copies `src` into it for up to `len` bytes. + * + * Equivalent to `buf = EZTR_MsgBuffer_Create(); EZTR_MsgBuffer_CopyN(buf, len);` + * + * You need to free any buffer you create using this function with `EZTR_MsgBuffer_Destroy()`, + * or else you will create a memory leak. + * + * @param src The content to copy into the buffer. Expected to have a header region, and be terminated with '\xBF'. + * @param len The maximum number of bytes to copy. If a '\xBF` is encountered in the content region of `src`, the function will stop copying before `len` is reached. + * @return MsgBuffer* A pointer to the buffer you created. + */ +EZTR_IMPORT(EZTR_MsgBuffer* EZTR_MsgBuffer_CreateFromStrN(char* src, size_t len)); + +/** + * @brief Frees/destroys a message buffer. + * + * EZTR only expects you to destroy buffers that you create youself using one of the above functions. + * Buffers given to you by in `MsgCallback` functions are created and destroyed by EZTR. + * + * @param buf A pointer to the message buffer to destroy. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_Destroy(EZTR_MsgBuffer* buf)); + +// Copy: +/** + * @brief Copies data from `src` into the message buffer `dst`. + * + * Unlike something like `strcoy()`, this method is safe as long as dst is a full-sized message buffer, + * as it will not copy beyond the message buffer size. + * + * Because `src` is expected to have a header region, the message termination characters '\xBF' are ignored + * for the first 11 bytes. + * + * @param dst The message buffer to copy into. + * @param src The data to copy. If you want to copy from another message buffer, use `src->raw.schar` or typecast src as `char*`. + * @return u32 The number of bytes copied. + */ +EZTR_IMPORT(u32 EZTR_MsgBuffer_Copy(EZTR_MsgBuffer* dst, char* src)); + + /** + * @brief Copies data from `src` into the message buffer `dst`, up to `len` bytes. + * + * Because `src` is expected to have a header region, the message termination characters '\xBF' are ignored + * for the first 11 bytes. + * + * @param dst The message buffer to copy into. + * @param src The data to copy. If you want to copy from another message buffer, use `src->raw.schar` or typecast src as `char*`. + * @param len The maximum number of bytes to copy. If a '\xBF` is encountered in the content region of `src`, the function + * will stop copying before `len` is reached. + * @return u32 The number of bytes copied. + */ +EZTR_IMPORT(u32 EZTR_MsgBuffer_NCopy(EZTR_MsgBuffer* dst, char* src, size_t len)); + +/** + * @brief Gets the size of the message buffer's stored data, in bytes. + * + * Does not include the termination character '\xBF'. + * + * @param buf The buffer to measure. + * @return u32 The number of bytes the message buffer's data takes up. + */ +EZTR_IMPORT(u32 EZTR_MsgBuffer_Len(EZTR_MsgBuffer* buf)); + +/** + * @brief Gets the size of the message buffer's content region, in bytes. + * + * Effectively `EZTR_MsgBuffer_Len(buf) - 11` or `EZTR_MsgSContent_Len(buf->partition.content)`. + * Does not include the termination character '\xBF'. + * + * @param buf The buffer to measure. + * @return u32 The number of bytes the message buffer's content takes up. + */ +EZTR_IMPORT(u32 EZTR_MsgBuffer_ContentLen(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets a message buffer's header to default values. + * + * The default values for a message buffer header are: + * + * * text_box_type = EZTR_STANDARD_TEXT_BOX_I (0) + * * text_box_y_pos = 0 + * * display_icon = EZTR_ICON_NO_ICON (0xFE) + * * next_message_id = EZTR_NO_VALUE (0xFFFF) + * * first_item_rupees = EZTR_NO_VALUE (0xFFFF) + * * second_item_rupees = EZTR_NO_VALUE (0xFFFF) + * + * @param buf the message buffer to write to. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_WriteDefaultHeader(EZTR_MsgBuffer* buf)); + +/** + * @brief + * + * @param buf the message buffer to write to. + * @param text_box_type The style of textbox to display. Use the `EZTR_TextBoxType` enum for more readable values. + * @param text_box_y_pos The vertical position of the textbox on-screen. + * @param display_icon Displays an icon in the textbox. Use the `EZTR_TextBoxIcon` enum for more readable values. + * Use `EZTR_ICON_NO_ICON` for no icon. + * @param next_message_id The next message to display. If there is no next message, or the next message is determined by code, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param first_item_rupees The price of the first item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + * @param second_item_rupees The price of the second item being offered for sale, if one exists. If there is no item, + * use 0xFFFF or `EZTR_NO_VALUE`. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_WriteHeader(EZTR_MsgBuffer* buf, u8 text_box_type, u8 text_box_y_pos, u8 display_icon, + u16 next_message_id, u16 first_item_rupees, u16 second_item_rupees)); + +/** + * @brief Retrieves the text_box_type from a message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to read from. + * @return u8 The text_box_type of the message buffer. If `EZTR_MsgBufferData` is being packed correctly, this will be + * equivalent to `buf->data.text_box_type`. + */ +EZTR_IMPORT(u8 EZTR_MsgBuffer_GetTextBoxType(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets the text_box_type of the message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to write to. + * @param type The new text_box_type value. If `EZTR_MsgBufferData` is being packed correctly, this will be equivalent + * to `buf->data.text_box_type = type` + */ +EZTR_IMPORT(void EZTR_MsgBuffer_SetTextBoxType(EZTR_MsgBuffer* buf, u8 type)); + +/** + * @brief Retrieves the text_box_y_pos from a message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to read from. + * @return u8 The text_box_y_pos of the message buffer. If `EZTR_MsgBufferData` is being packed correctly, this will be + * equivalent to `buf->data.text_box_y_pos`. + */ +EZTR_IMPORT(u8 EZTR_MsgBuffer_GetTextBoxYPos(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets the text_box_y_pos of the message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to write to. + * @param pos The new text_box_y_pos value. If `EZTR_MsgBufferData` is being packed correctly, this will be equivalent + * to `buf->data.text_box_y_pos = pos` + */ +EZTR_IMPORT(void EZTR_MsgBuffer_SetTextBoxYPos(EZTR_MsgBuffer* buf, u8 pos)); + +/** + * @brief Retrieves the display_icon from a message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to read from. + * @return u8 The display_icon of the message buffer. If `EZTR_MsgBufferData` is being packed correctly, this will be + * equivalent to `buf->data.display_icon`. + */ +EZTR_IMPORT(u8 EZTR_MsgBuffer_GetTextBoxDisplayIcon(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets the display_icon of the message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to write to. + * @param icon The new display_icon value. If `EZTR_MsgBufferData` is being packed correctly, this will be equivalent + * to `buf->data.display_icon = icon` + */ +EZTR_IMPORT(void EZTR_MsgBuffer_SetTextBoxDisplayIcon(EZTR_MsgBuffer* buf, u8 icon)); + +/** + * @brief Retrieves the next_message_id from a message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to read from. + * @return u16 The display_icon of the message buffer. If `EZTR_MsgBufferData` is being packed correctly, this will be + * equivalent to `buf->data.next_message_id`. + */ +EZTR_IMPORT(u16 EZTR_MsgBuffer_GetNextMsg(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets the next_message_id of the message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to write to. + * @param textId The new display_icon value. If `EZTR_MsgBufferData` is being packed correctly, this will be equivalent + * to `buf->data.next_message_id = icon`. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_SetNextMsg(EZTR_MsgBuffer* buf, u16 textId)); + +/** + * @brief Retrieves the first_item_rupees from a message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to read from. + * @return u16 The first_item_rupees of the message buffer. If `EZTR_MsgBufferData` is being packed correctly, this will be + * equivalent to `buf->data.first_item_rupees`. + */ +EZTR_IMPORT(u16 EZTR_MsgBuffer_GetFirstItemRupees(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets the first_item_rupees of the message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to write to. + * @param value The new first_item_rupees value. If `EZTR_MsgBufferData` is being packed correctly, this will be equivalent + * to `buf->data.first_item_rupees = icon`. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_SetFirstItemRupees(EZTR_MsgBuffer* buf, u16 val)); + +/** + * @brief Retrieves the second_item_rupees from a message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to read from. + * @return u16 The second_item_rupees of the message buffer. If `EZTR_MsgBufferData` is being packed correctly, this will be + * equivalent to `buf->data.second_item_rupees`. + */ +EZTR_IMPORT(u16 EZTR_MsgBuffer_GetSecondItemRupees(EZTR_MsgBuffer* buf)); + +/** + * @brief Sets the second_item_rupees of the message buffer's header. + * + * Useful if your compiler is having trouble with the `__attribute_((packed))` on `EZTR_MsgBufferData`, and the data isn't + * lining up correctly. + * + * @param buf The message buffer to write to. + * @param value The new second_item_rupees value. If `EZTR_MsgBufferData` is being packed correctly, this will be equivalent + * to `buf->data.second_item_rupees = icon`. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_SetSecondItemRupees(EZTR_MsgBuffer* buf, u16 val)); + +/** + * @brief Prints the contents of a message buffer to the console. + * + * Each value in the header will be labeled. The content region will stop printing after the '\xBF' termination character. + * + * @param buf The message buffer to print. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_Print(EZTR_MsgBuffer* buf)); + +/** + * @brief Prints the contents of a message buffer to the console, formatted as a `EZTR_Basic_ReplaceText` call. + * + * The string literal for the content will end with the '\xBF' termination character. + * + * @param buf The message buffer to print. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_PrintCCode(EZTR_MsgBuffer* buf)); + +/** + * @brief Prints the contents of a message buffer to the console. + * + * Each value in the header will be labeled. The this function prints the entire 1279 bytes of the content region. + * + * @param buf The message buffer to print. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_PrintFull(EZTR_MsgBuffer* buf)); + +/** + * @brief Prints the contents of a message buffer to the console, formatted as a `EZTR_Basic_ReplaceText` call. + * + * The this function prints the entire 1279 bytes of the content region. + * + * @param buf The message buffer to print. + */ +EZTR_IMPORT(void EZTR_MsgBuffer_PrintFullCCode(EZTR_MsgBuffer* buf)); + +/** + * @brief Gets a pointer to the beginning of the content region for a desired message buffer. + * + * Equivalent to `buf->partition.content`, or `buf->data.content` assuming EZTR_MsgBufferData is being packed correctly. + * + * @param buf The buffer to get the the content from. + * @return char* The beginning of the message buffer's content region. + */ +EZTR_IMPORT(char* EZTR_MsgBuffer_GetContentPtr(EZTR_MsgBuffer* buf)); + +/** @}*/ + + +/** + * \defgroup MsgSContent + * \brief Functions for manipulating message text content. + * @{ + */ + + +/** + * @brief Sets the message message content as empty. + * + * This is accomplished by setting the first character in the message content to the '\xBF' termination character. + * No other bytes are effected. + * + * @param cont A pointer to message content string. + */ +EZTR_IMPORT(void EZTR_MsgSContent_SetEmpty(char* cont)); + +/** + * @brief Gets the length of the a message content string in bytes, not counting the '\xBF' termination character + * + * Similar to `strlen()` for null-terminated strings. + * + * This function is safe as long as `cont` points to the beginning of a message buffer's content region, since it + * will not count bytes beyond that size. + * + * @param cont The message content you want to get the length of. + * @return u32 The length of the message content, in bytes. + */ +EZTR_IMPORT(u32 EZTR_MsgSContent_Len(char* cont)); + +/** + * @brief Copies message content from `src` into the `dst`, up to `len` bytes. + * + * Similar to `strncpy()` for null-terminated strings. + * + * @param dst The location to copy message content into. + * @param src The message content to copy. + * @param len The maximum number of bytes to copy. If a '\xBF' is encountered in `src`, the function will stop copying + * before `len` is reached. + * @return u32 The number of bytes copied. + */ +EZTR_IMPORT(u32 EZTR_MsgSContent_NCopy(char* dst, char* src, size_t len)); + +/** + * @brief Copies message content from `src` into the `dst`. + * + * Similar to `strcpy()` for null-terminated strings. + * + * This function is safe as long as `dst` points to the beginning of a message buffer's content region, since it + * will not copy bytes beyond that size. + * + * @param dst The location to copy message content into. + * @param src The message content to copy. Should be '\xBF' terminated. + * @return u32 The number of bytes copied. + */ +EZTR_IMPORT(u32 EZTR_MsgSContent_Copy(char* dst, char* src)); + +/** + * @brief Copies the message content of `src` onto the end of `dst`, up to `len` bytes from `src`. + * + * Similar to `strncat()` for null-terminated strings. + * + * This function will not produce message content larger than a message buffer's content region. Copying will + * stop once the maximum size is reached. + * + * @param dst The location to append message content into. + * @param src The message content to copy. + * @param len The maximum number of bytes to copy. If a '\xBF' is encountered in `src`, the function will stop copying + * before `len` is reached. + * @return char* The pointer to the new string (i.e: to `dst`). + */ +EZTR_IMPORT(char* EZTR_MsgSContent_NCat(char* dst, char* src, size_t len)); + +/** + * @brief Copies the message content of `src` onto the end of `dst`. + * + * Similar to `strcat()` for null-terminated strings. + * + * This function is safe as long as `dst` points to the beginning of a message buffer's content region, as it + * will not produce message content larger than a message buffer's content region. Copying will + * stop once the maximum size is reached. + * + * @param dst The location to append message content into. + * @param src The message content to copy. Should be '\xBF' terminated. + * @return char* The pointer to the new string (i.e: to `dst`). + */ +EZTR_IMPORT(char* EZTR_MsgSContent_Cat(char* dst, char* src)); + +/** + * @brief Compares up to `len` bytes of two message content strings. + * + * Similar to `strncmp()` for null-terminated strings, but with one notable difference: + * With `strncmp()`, if two strings are equal for the first `n` characters, but one string continues after `n` while + * the other doesn't, the shorter string is considered 'lesser' because the null terminator `'\x00'` is naturally + * the lowest possible ASCII value. Because strings in MM are `'\xBF'` terminated, that behavior won't apply here. + * + * In `EZTR_MsgSContent_NCmp()`, a special case is applied: If two strings are equal for `n` characters, but the + * next character after `n` is `'\xBF'` in one of the strings, it is considered the lesser string regardless of + * what the other character is. + * + * @param str1 The first message content string to compare. + * @param str2 The second message content string to compare. + * @param len The maximum number of bytes to compare. + * @return s32 Returns 0 is the strings are the same, 1 if the first string is greater than the second, and + * -1 if the second string is greater than the first. + */ +EZTR_IMPORT(s32 EZTR_MsgSContent_NCmp(char* str1, char* str2, size_t len)); + +/** + * @brief Compares two message content strings. + * + * This function is safe as long as both `str1` and `str2` point to the content region of message buffers, as the + * comparison will not continue beyond that size. + * + * Similar to `strcmp()` for null-terminated strings, but with one notable difference: + * With `strncmp()`, if two strings are equal for the first `n` characters, but one string continues after `n` while + * the other doesn't, the shorter string is considered 'lesser' because the null terminator `'\x00'` is naturally + * the lowest possible ASCII value. Because strings in MM are `'\xBF'` terminated, that behavior won't apply here. + * + * In `EZTR_MsgSContent_Cmp()`, a special case is applied: If two strings are equal for `n` characters, but the + * next character after `n` is `'\xBF'` in one of the strings, it is considered the lesser string regardless of + * what the other character is. + * + * @param str1 The first message content string to compare. + * @param str2 The second message content string to compare. + * @return s32 Returns 0 is the strings are the same, 1 if the first string is greater than the second, and + * -1 if the second string is greater than the first. + */ +EZTR_IMPORT(s32 EZTR_MsgSContent_Cmp(char* str1, char* str2)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version uses pipe-escaped byte handling in the main formatting argument. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_Printf(const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version uses pipe-escaped byte handling in the main formatting argument. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_PrintfLine(const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version uses pipe-escaped byte handling in the main formatting argument. + * + * Unlike `EZTR_MsgSContent_Printf()`, this function will append a newline to the end of + * console output. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param buffer + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_Sprintf(char* buffer, const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version uses pipe-escaped byte handling in the main formatting argument. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param buffer + * @param count + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_Snprintf(char* buffer, size_t count, const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version uses pipe-escaped byte handling in the main formatting argument. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param buffer + * @param count + * @param format + * @param va + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_Vsnprintf(char* buffer, size_t count, const char* format, va_list va)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version uses pipe-escaped byte handling in the main formatting argument. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param format + * @param va + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_Vprintf(const char* format, va_list va)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param out + * @param arg + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_Fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_Printf(const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_PrintfLine(const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * Unlike `EZTR_MsgSContent_Printf()`, this function will append a newline to the end of + * console output. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param buffer + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_Sprintf(char* buffer, const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param buffer + * @param count + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_Snprintf(char* buffer, size_t count, const char* format, ...)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param buffer + * @param count + * @param format + * @param va + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_Vsnprintf(char* buffer, size_t count, const char* format, va_list va)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param format + * @param va + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_Vprintf(const char* format, va_list va)); + +/** + * @brief A modified version of printf, specially designed to handle message content. + * This version does not use pipe-escaped byte handling in the main formatting argument, + * but are still used with the `%m` type specifier. + * + * See \ref prinf_functions for more information on EZTR's custom printf behavior. + * + * @param out + * @param arg + * @param format + * @param ... + * @return int + */ +EZTR_IMPORT(int EZTR_MsgSContent_NoPipe_Fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...)); + +/** @}*/ + +#endif \ No newline at end of file diff --git a/mod.toml b/mod.toml index f44ac45..9e7ecf6 100644 --- a/mod.toml +++ b/mod.toml @@ -39,6 +39,7 @@ dependencies = [ "owls_never_quit:1.0.0", "mm_recomp_better_double_sot:1.0.1", "mm_recomp_colors:0.5.0", + "MM_EZ_Text_Replacer_API:2.3.0", "REPY_PopularPythonPackages:1.0.0" ] diff --git a/pyglue b/pyglue index 0875e88..dacae9c 160000 --- a/pyglue +++ b/pyglue @@ -1 +1 @@ -Subproject commit 0875e88a3338d2eec2ada9edbd1ce10146b8ce1b +Subproject commit dacae9cbbdacd1f76d1ff930655895e5147a19da diff --git a/src/eztr_text.c b/src/eztr_text.c new file mode 100644 index 0000000..5babd63 --- /dev/null +++ b/src/eztr_text.c @@ -0,0 +1,833 @@ +#include "modding.h" +#include "global.h" +#include "recomputils.h" +#include "recompconfig.h" +#include "eztr_api.h" +#include "attributes.h" + +#include "apcommon.h" + +#include "z64snap.h" + +//old defines that I didn't use +// #define RANDO_AP_ITEM "\xFF" +// #define RANDO_AP_PLAYER "\xFE" +// #define RANDO_AP_COLOR "\xFD" + +//sets colours for AP item class. probably doesn't work +// u8 getAPItemColor(u32 location) { +// switch (rando_get_location_type(location)) { +// case 1: return 0x05; // EZTR_CC_COLOR_LIGHTBLUE; // progression - purple +// case 2: return 0x03; // EZTR_CC_COLOR_BLUE; // useful - blue +// case 3: return 0x08; // EZTR_CC_COLOR_ORANGE; // trap - orange +// case 0: +// default: return 0x07; // EZTR_CC_COLOR_SILVER; // filler - grey +// } +// } +u8 getAPItemColor(u32 location) { + u32 type = rando_get_location_type(location); + if (type & 0b001) { + return 0x05; // EZTR_CC_COLOR_LIGHTBLUE; // progression - purple + } else if (type & 0b010) { + return 0x03; // EZTR_CC_COLOR_BLUE; // useful - blue + } else if (type & 0b100) { + return 0x08; // EZTR_CC_COLOR_ORANGE; // trap - orange + } else { + return 0x07; // EZTR_CC_COLOR_SILVER; // filler - grey + } +} +//Get info from Rando to replace the text with item class colour, player name and item name +EZTR_MSG_CALLBACK(randoAPSend) { + u32 location = rando_get_last_location_sent(); + char* player_name; + char* item_name; + + rando_get_location_item_player(location, &player_name); + rando_get_location_item_name(location, &item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "You found " EZTR_CC_COLOR_RED "%s" EZTR_CC_COLOR_DEFAULT "'s" EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + player_name, + getAPItemColor(location), + item_name + ); + + recomp_free(player_name); + recomp_free(item_name); +} +EZTR_MSG_CALLBACK(randoAPSelf) { + u32 location = rando_get_last_location_sent(); + char* item_name; + + rando_get_location_item_name(location, &item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "You found your" EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + getAPItemColor(location), + item_name + ); + + recomp_free(item_name); +} +EZTR_MSG_CALLBACK(randoTingle) { + +} +EZTR_MSG_CALLBACK(randoShop) { + +} +EZTR_MSG_CALLBACK(randoScrub) { + +} +EZTR_MSG_CALLBACK(randoMilkBar) { + +} +//honestly don't know, but seems important +// char* item_str; +// char* player_str; + +// rando_get_location_item_name(rando_get_last_location_sent(), &item_str); +// rando_get_location_item_player(rando_get_last_location_sent(), &player_str); +// sanitizeRandoText(item_str); +// sanitizeRandoText(player_str); + + +//text sanitize stolen from old file. Not sure what role this plays exactly, but I know it fixes crashes on funky letters +//commented out because this function is already in use elsewhere +// void sanitizeRandoText(char* rando_string) { +// u8 c = rando_string[0]; +// u8 next = 0; +// u8 i = 0; +// bool shift_string = false; + +// while (c != 0) { +// if (c <= 0x08 || (c >= 0x0A && c <= 0x1F) || (c >= 0xB0 && c <= 0xBB) || (c >= 0xBF && c <= 0xE8) || (c >= 0xF0 && c <= 0xFF)) { +// next = rando_string[i+1]; +// if (c == 0xC3 && next == 0xA1) { // á +// rando_string[i] = 0x98; +// shift_string = true; +// } else { +// rando_string[i] = 0xAE; // replace all invalid bytes with ¿ +// } +// } + +// if (shift_string) { +// u8 new_i = i + 1; +// u8 new_c = rando_string[new_i]; +// u8 new_next = rando_string[new_i + 1]; +// while (new_c != 0) { +// rando_string[new_i] = new_next; +// new_i++; +// new_c = rando_string[new_i]; +// new_next = rando_string[new_i + 1]; +// } +// shift_string = false; +// } + +// i++; +// c = rando_string[i]; +// } +// } + +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Send_Item);//"You sent [player] their [item]" +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Self_Item);//"You found your [item]" +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Kokiri_Sword); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Bombchu_Bag); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_CTSF);//stray fairies +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFBK);//boss keys +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHBK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBBK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STBK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSK);//small keys +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFMap);//maps +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHMap); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBMap); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STMap); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFCompass);//compasses +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHCompass); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBCompass); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STCompass); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Swamp_Token);//skull tokens +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Ocean_Token); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_FOOL); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Moon_Child_Return); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Tingle); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Shop); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Scrub); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Milk_Bar); + + +//text replacements for AP items. Not yet set up. Probably won't use but keeping here just in case. +// EZTR_MSG_CALLBACK(randoAPSend) { +// buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, +// EZTR_MsgSContent_Sprintf(buf->data.content, "You found " EZTR_CC_COLOR_RED "\xFE" EZTR_CC_COLOR_DEFAULT "'s" EZTR_CC_NEWLINE "" RANDO_AP_COLOR "\xFF" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END ""), + + +// } + +//text replacements for pictograph box +EZTR_MSG_CALLBACK(randoPictograph) { + if (!CHECK_QUEST_ITEM(QUEST_PICTOGRAPH)) { + Snap_RecordPictographedActors(play); + } + + if (Snap_CheckFlag(PICTO_VALID_MONKEY)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a monkey" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_BIG_OCTO)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a Big Octo" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_SCARECROW)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a scarecrow" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_TINGLE)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of Tingle" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_DEKU_KING)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the Deku King" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_GOOD)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_TOO_FAR)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_LULU_HEAD)) { + if (Snap_CheckFlag(PICTO_VALID_LULU_RIGHT_ARM) && Snap_CheckFlag(PICTO_VALID_LULU_LEFT_ARM)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } + } else if (Snap_CheckFlag(PICTO_VALID_IN_SWAMP)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the swamp" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } + else { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } +} + +//Replacements of existing IDs +EZTR_ON_INIT void init_text() { + EZTR_Basic_ReplaceText( + 0x1B9E,//Sonata of Awakening + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_GREEN "Sonata of Awakening" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1B9F,//Goron's Lullaby + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_RED "Goron's Lullaby" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA0,//New Wave Bossa Nova + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_BLUE "New Wave Bossa Nova" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA1,//Elegy of Emptiness + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_ORANGE "Elegy of Emptiness" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA2,//Oath to Order + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_PINK "Oath to Order" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA4,//Song of Time + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_LIGHTBLUE "Song of Time" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA5,//Song of Healing + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_PINK "Song of Healing" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA6,//Epona's Song + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got " EZTR_CC_COLOR_ORANGE "Epona's Song" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA7,//Song of Soaring + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_RED "Song of Soaring" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x1BA6,//Song of Storms + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_RED "Song of Storms" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x00C8,//Magic Power 1 + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_SMALL_MAGIC_JAR, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You've been granted " EZTR_CC_COLOR_GREEN "Magic Power" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x00CA,//Spin Attack Upgrade + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You mastered the " EZTR_CC_COLOR_RED "Spin Attack" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x353C,//Fast Dog + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "..." EZTR_CC_END "", + NULL + ); + EZTR_Basic_ReplaceText( + 0x3545,//Slow Dog + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "" EZTR_CC_SFX "|29|13Hoo-whine." EZTR_CC_NEWLINE "How can any of us win against..." EZTR_CC_NEWLINE "" EZTR_CC_COLOR_BLUE "blue god" EZTR_CC_COLOR_DEFAULT "..." EZTR_CC_END "", + NULL + ); + + // EZTR_Basic_ReplaceText( + // 0x20D0,//Gossip Hint joke + // EZTR_STANDARD_TEXT_BOX_II, + // 0, + // EZTR_ICON_NO_ICON, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // false, + // "Use the " EZTR_CC_COLOR_RED "!hint" EZTR_CC_COLOR_DEFAULT " command to hint" EZTR_CC_NEWLINE "for an item!" EZTR_CC_END "", + // NULL + // ); + EZTR_Basic_ReplaceText( + 0x20D0,//Replaces the Gossip Stone Tatl text to test if it can read the AP items correctly without fully implimenting it on get item. + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoAPSend + ); + EZTR_Basic_ReplaceText( + 0x0090,//Replaces rando text for filler AP items. + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "No, that didn't work. Try again.", + NULL + ); + EZTR_Basic_ReplaceText( + 0x00B3,//Replaces rando text for useful AP items. + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "No, that didn't work. Try again.", + NULL + ); + EZTR_Basic_ReplaceText( + 0x0077,//Replaces rando text for progression AP items. + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "No, that didn't work. Try again.", + randoAPSend + ); + //Pictograph Box text + EZTR_Basic_ReplaceText( + 0x00F8, + EZTR_STANDARD_TEXT_BOX_I, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoPictograph + ); + + + //Custom IDs for items not normally obtained + //AP send item text. Probably doesn't work. + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Send_Item), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoAPSend + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Self_Item), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoAPSelf + ); + + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Kokiri_Sword), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_KOKIRI_SWORD, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_RED "Kokiri Sword" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Bombchu_Bag), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_BOMBCHU, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_RED "Bombchu Bag" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_CTSF), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_STRAY_FAIRY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_ORANGE "Clock Town" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFSF), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_STRAY_FAIRY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHSF), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_STRAY_FAIRY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSF), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_STRAY_FAIRY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSF), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_STRAY_FAIRY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFBK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_BOSS_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Boss Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHBK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_BOSS_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Boss Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBBK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_BOSS_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Boss Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBBK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_BOSS_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Boss Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFSK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_SMALL_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHSK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_SMALL_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_SMALL_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSK), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_SMALL_KEY, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFMap), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_DUNGEON_MAP, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Map" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHMap), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_DUNGEON_MAP, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Map" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBMap), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_DUNGEON_MAP, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Map" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBMap), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_DUNGEON_MAP, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Map" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFCompass), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_COMPASS, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Compass" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHCompass), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_COMPASS, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Compass" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBCompass), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_COMPASS, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Compass" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBCompass), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_COMPASS, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Compass" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Swamp_Token), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_GOLD_SKULLTULA_TOKEN, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got a "EZTR_CC_COLOR_RED "Swamp Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Ocean_Token), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_GOLD_SKULLTULA_TOKEN, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got an "EZTR_CC_COLOR_RED "Ocean Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_FOOL), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You are a" EZTR_CC_COLOR_RED "FOOL" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Moon_Child_Return), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + 1, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "...But you are not strong enough..." EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "Shall... I send you back?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END "", + NULL + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Tingle), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoTingle + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Shop), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoShop + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Scrub), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoScrub + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Milk_Bar), + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoMilkBar + ); +} diff --git a/src/item_give.c b/src/item_give.c index d6df97a..df67942 100644 --- a/src/item_give.c +++ b/src/item_give.c @@ -5,6 +5,16 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "apcommon.h" +#include "eztr_api.h" +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_Send_Item); +//EZTR_GET_ID(Rando_Send_Item) "0x77" +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_Self_Item); +//EZTR_GET_ID(Rando_Self_Item) "0x71" +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_GI_Bombchu_Bag); +//EZTR_GET_ID(Rando_GI_Bombchu_Bag) "0x54" +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_GI_Kokiri_Sword); +//EZTR_GET_ID(Rando_GI_Kokiri_Sword) "0x37" + extern s16 sExtraItemBases[]; extern s16 sAmmoRefillCounts[]; @@ -437,7 +447,7 @@ GetItemEntry sGetItemTable_ap[] = { GET_ITEM(ITEM_MASK_KAFEIS_MASK, OBJECT_GI_MASK05, GID_MASK_KAFEIS_MASK, 0x8F, GIFIELD(GIFIELD_20 | GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_LONG), // GI_90 - GET_ITEM(ITEM_DEED_LAND, OBJECT_UNSET_0, GID_APLOGO_FILLER, 0x90, 0, 0), + GET_ITEM(ITEM_DEED_LAND, OBJECT_UNSET_0, GID_APLOGO_FILLER, 0x77, 0, 0), // GI_CHATEAU GET_ITEM(ITEM_CHATEAU_2, OBJECT_GI_BOTTLE_21, GID_CHATEAU, 0x91, GIFIELD(GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_LONG), @@ -529,7 +539,7 @@ GetItemEntry sGetItemTable_ap[] = { GET_ITEM(ITEM_DEED_LAND, OBJECT_GI_BOTTLE_04, GID_SF_CLOCKTOWN, 0xB2, GIFIELD(GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_SHORT), // GI_B3 //GET_ITEM(ITEM_NONE, OBJECT_GI_MSSA, GID_MASK_SUN, 0xB3, GIFIELD(GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_LONG), - GET_ITEM(ITEM_DEED_LAND, OBJECT_UNSET_0, GID_APLOGO_USEFUL, 0xB3, GIFIELD(GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_LONG), + GET_ITEM(ITEM_DEED_LAND, OBJECT_UNSET_0, GID_APLOGO_USEFUL, 0x77, GIFIELD(GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_LONG), // GI_TINGLE_MAP_CLOCK_TOWN GET_ITEM(ITEM_TINGLE_MAP, OBJECT_GI_FIELDMAP, GID_TINGLE_MAP, 0xB4, GIFIELD(GIFIELD_20 | GIFIELD_NO_COLLECTIBLE, 0), CHEST_ANIM_LONG), diff --git a/src/moon_child_hooks.c b/src/moon_child_hooks.c index 40d9025..90688c9 100644 --- a/src/moon_child_hooks.c +++ b/src/moon_child_hooks.c @@ -2,6 +2,9 @@ #include "global.h" #include "apcommon.h" +#include "eztr_api.h" +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_Moon_Child_Return); + #define MOONCHILD_LIMB_MAX 0x12 #include "overlays/actors/ovl_En_Js/z_en_js.h" @@ -43,7 +46,7 @@ RECOMP_PATCH void func_8096A38C(EnJs* this, PlayState* play) { case 0: // @rando send player back to first day if they don't meet the victory condition if (!rando_met_majora_condition()) { - Message_ContinueTextbox(play, 0x2778); + Message_ContinueTextbox(play, EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Moon_Child_Return))); Animation_MorphToPlayOnce(&this->skelAnime, &gMoonChildGettingUpAnim, -5.0f); this->unk_2B8 |= 0x10; break; @@ -83,7 +86,7 @@ RECOMP_PATCH void func_8096A38C(EnJs* this, PlayState* play) { case 0: // @rando send player back to first day if they don't meet the victory condition if (rando_location_is_checked(GI_MASK_FIERCE_DEITY) && !rando_met_majora_condition()) { - Message_ContinueTextbox(play, 0x2778); + Message_ContinueTextbox(play, EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Moon_Child_Return))); Animation_MorphToPlayOnce(&this->skelAnime, &gMoonChildGettingUpAnim, -5.0f); this->unk_2B8 |= 0x10; break; @@ -103,31 +106,30 @@ RECOMP_PATCH void func_8096A38C(EnJs* this, PlayState* play) { break; // @rando send player back to first day if they don't meet the victory condition - case 0x2778: - switch (play->msgCtx.choiceIndex) { - case 0: - Message_CloseTextbox(play); - SET_EVENTINF(EVENTINF_TRIGGER_DAYTELOP); - gSaveContext.save.day = 0; - gSaveContext.respawnFlag = -4; - play->nextEntrance = ENTRANCE(SOUTH_CLOCK_TOWN, 0); - gSaveContext.save.entrance = play->nextEntrance; - play->transitionTrigger = TRANS_TRIGGER_START; - play->transitionType = TRANS_TYPE_FADE_BLACK; - Sram_SaveEndOfCycle(play); - break; + default: + if (play->msgCtx.currentTextId == EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Moon_Child_Return))) { + switch (play->msgCtx.choiceIndex) { + case 0: + Message_CloseTextbox(play); + SET_EVENTINF(EVENTINF_TRIGGER_DAYTELOP); + gSaveContext.save.day = 0; + gSaveContext.respawnFlag = -4; + play->nextEntrance = ENTRANCE(SOUTH_CLOCK_TOWN, 0); + gSaveContext.save.entrance = play->nextEntrance; + play->transitionTrigger = TRANS_TRIGGER_START; + play->transitionType = TRANS_TYPE_FADE_BLACK; + Sram_SaveEndOfCycle(play); + break; - case 1: - Message_ContinueTextbox(play, 0x21FD); - break; + case 1: + Message_ContinueTextbox(play, 0x21FD); + break; - default: - break; + default: + break; + } } break; - - default: - break; } } break; @@ -187,7 +189,7 @@ void EnJs_PreventFightAfterFDOffer(EnJs* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actor.flags &= ~ACTOR_FLAG_10000; this->actionFunc = func_8096A38C; - Message_StartTextbox(play, 0x2778, &this->actor); + Message_StartTextbox(play, EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Moon_Child_Return)), &this->actor); } else { Actor_OfferTalkExchange(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } From a73ae1f17e0f0742e37249ea464e35ee2dd0c3b4 Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Wed, 29 Apr 2026 09:11:42 +0100 Subject: [PATCH 02/15] whatever this is --- pyglue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyglue b/pyglue index 55610ce..5d2cf62 160000 --- a/pyglue +++ b/pyglue @@ -1 +1 @@ -Subproject commit 55610cec770c0745fbea750ed27581a4a8095c2a +Subproject commit 5d2cf6288417a91f5d55deddaefde74cc6febb3a From 810a919860eebb85e194569bd9a66a6fc4cf9744 Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Wed, 6 May 2026 00:35:16 +0100 Subject: [PATCH 03/15] attempting to use the correct text boxes --- include/apcommon.h | 6 +++--- src/eztr_text.c | 15 ++++++++++----- src/item_give.c | 14 +++++++------- src/play_main_hooks.c | 18 +++++++++--------- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/include/apcommon.h b/include/apcommon.h index 6c566f5..15bf982 100644 --- a/include/apcommon.h +++ b/include/apcommon.h @@ -327,13 +327,13 @@ typedef enum { u8 randoItemGive(u32 gi); u32 rando_get_item_id(u32 location_id); -typedef struct GetItemEntry { +typedef struct GetItemEntryAP { /* 0x0 */ u8 itemId; /* 0x1 */ u8 field; // various bit-packed data /* 0x2 */ s16 gid; // defines the draw id and chest opening animation /* 0x3 */ u8 textId; /* 0x4 */ u16 objectId; -} GetItemEntry; // size = 0x6 +} GetItemEntryAP; // size = 0x6 bool isAP(s16 gi); @@ -341,7 +341,7 @@ u16 getObjectId(s16 gi); s16 getGid(s16 gi); -u8 getTextId(s16 gi); +u16 getTextId(s16 gi); extern s8 giToItemId[]; diff --git a/src/eztr_text.c b/src/eztr_text.c index 5babd63..ba85ba7 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -217,7 +217,7 @@ EZTR_MSG_CALLBACK(randoPictograph) { EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } } - +extern GetItemEntryAP sGetItemTable_ap[]; //Replacements of existing IDs EZTR_ON_INIT void init_text() { EZTR_Basic_ReplaceText( @@ -530,7 +530,7 @@ EZTR_ON_INIT void init_text() { EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHSF), @@ -541,7 +541,7 @@ EZTR_ON_INIT void init_text() { EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSF), @@ -552,7 +552,7 @@ EZTR_ON_INIT void init_text() { EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSF), @@ -563,7 +563,7 @@ EZTR_ON_INIT void init_text() { EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFBK), @@ -830,4 +830,9 @@ EZTR_ON_INIT void init_text() { "\xBF", randoMilkBar ); + sGetItemTable_ap[GI_SWORD_KOKIRI].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Kokiri_Sword)); + sGetItemTable_ap[GI_BAG_BOMBCHU].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Bombchu_Bag)); + // sGetItemTable_ap[GI_APLOGO_USEFUL].textId = EZTR_GET_ID_H(Rando_Send_Item); + // sGetItemTable_ap[GI_APLOGO_FILLER].textId = EZTR_GET_ID_H(Rando_Send_Item); + // sGetItemTable_ap[GI_APLOGO_PROG].textId = EZTR_GET_ID_H(Rando_Send_Item); } diff --git a/src/item_give.c b/src/item_give.c index df67942..b5f5d11 100644 --- a/src/item_give.c +++ b/src/item_give.c @@ -67,7 +67,7 @@ void func_8082DB90(PlayState* play, Player* this, PlayerAnimationHeader* anim); */ #define GIFIELD(flags, dropType) ((flags) | (dropType)) -GetItemEntry sGetItemTable_ap[] = { +GetItemEntryAP sGetItemTable_ap[] = { // GI_RUPEE_GREEN GET_ITEM(ITEM_RUPEE_GREEN, OBJECT_GI_RUPY, GID_RUPEE_GREEN, 0xC4, GIFIELD(0, ITEM00_RUPEE_GREEN), CHEST_ANIM_SHORT), // GI_RUPEE_BLUE @@ -722,7 +722,7 @@ s16 getGid(s16 gi) { return (((gid < 0) ? -1 : 1)*gid) - 1; } -u8 getTextId(s16 gi) { +u16 getTextId(s16 gi) { return sGetItemTable_ap[gi - 1].textId; } @@ -842,7 +842,7 @@ RECOMP_PATCH void func_80848250(PlayState* play, Player* this) { // Player_UpdateCurrentGetItemDrawId? RECOMP_PATCH void func_8082ECE0(Player* this) { - GetItemEntry* giEntry; + GetItemEntryAP* giEntry; s16 gid; if (itemWorkaround) { giEntry = &sGetItemTable_ap[trueGI - 1]; @@ -895,7 +895,7 @@ RECOMP_PATCH s32 func_808482E0(PlayState* play, Player* this) { } if (this->av1.actionVar1 == 0) { - GetItemEntry* giEntry; + GetItemEntryAP* giEntry; if (itemWorkaround) { gi = ABS_ALT(trueGI); if (rando_has_item(GI_OCARINA_OF_TIME)) { @@ -1364,7 +1364,7 @@ typedef struct EnBom { } EnBom; // size = 0x204 void func_8082DAD4(Player* this); -void func_8083D168(PlayState* play, Player* this, GetItemEntry* giEntry); +void func_8083D168(PlayState* play, Player* this, GetItemEntryAP* giEntry); s32 func_80832558(PlayState* play, Player* this, PlayerFuncD58 arg2); void func_8082E920(PlayState* play, Player* this, s32 moveFlags); void Player_AnimationPlayOnce(PlayState* play, Player* this, PlayerAnimationHeader* anim); @@ -1377,7 +1377,7 @@ RECOMP_PATCH s32 Player_ActionChange_2(Player* this, PlayState* play) { if (interactRangeActor != NULL) { if (this->getItemId > GI_NONE) { if (this->getItemId < GI_MAX || this->getItemId > GI_MAX) { - GetItemEntry* giEntry = &sGetItemTable_ap[this->getItemId - 1]; + GetItemEntryAP* giEntry = &sGetItemTable_ap[this->getItemId - 1]; interactRangeActor->parent = &this->actor; if ((Item_CheckObtainability(giEntry->itemId) == ITEM_NONE) || ((s16)giEntry->objectId == OBJECT_GI_BOMB_2)) { @@ -1415,7 +1415,7 @@ RECOMP_PATCH s32 Player_ActionChange_2(Player* this, PlayState* play) { if (itemWorkaround) { this->getItemId = -trueGI; } - GetItemEntry* giEntry = &sGetItemTable_ap[-this->getItemId - 1]; + GetItemEntryAP* giEntry = &sGetItemTable_ap[-this->getItemId - 1]; EnBox* chest = (EnBox*)interactRangeActor; /*if ((giEntry->itemId != ITEM_NONE) && diff --git a/src/play_main_hooks.c b/src/play_main_hooks.c index bb2f6c9..9fa3199 100644 --- a/src/play_main_hooks.c +++ b/src/play_main_hooks.c @@ -966,15 +966,15 @@ void update_rando(PlayState* play) { u32 item_type = REPY_FN_GET_U32("item_type"); // note: this could probably be done differently, but partially uses old systems for now - if (player != rando_get_own_slot_id() || recomp_get_config_u32("local_notifications")) { - char* item_name; - char* player_name; - rando_get_item_name_from_id(item_id, &item_name); - rando_get_sending_player_name(location, &player_name); - randoEmitRecieveNotification(item_name, player_name, randoConvertItemId(item_id), item_type); - recomp_free(item_name); - recomp_free(player_name); - } + // if (player != rando_get_own_slot_id() || recomp_get_config_u32("local_notifications")) { + // char* item_name; + // char* player_name; + // rando_get_item_name_from_id(item_id, &item_name); + // rando_get_sending_player_name(location, &player_name); + // randoEmitRecieveNotification(item_name, player_name, randoConvertItemId(item_id), item_type); + // recomp_free(item_name); + // recomp_free(player_name); + // } randoItemGive(item_id); } From f5e027ca94fac800beb3695ee2020e3f504d9d69 Mon Sep 17 00:00:00 2001 From: Hyped Date: Wed, 6 May 2026 02:15:27 -0700 Subject: [PATCH 04/15] fix issues with items using EZTR text --- include/apcommon.h | 2 +- src/eztr_text.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/apcommon.h b/include/apcommon.h index 15bf982..2d932b8 100644 --- a/include/apcommon.h +++ b/include/apcommon.h @@ -331,7 +331,7 @@ typedef struct GetItemEntryAP { /* 0x0 */ u8 itemId; /* 0x1 */ u8 field; // various bit-packed data /* 0x2 */ s16 gid; // defines the draw id and chest opening animation - /* 0x3 */ u8 textId; + /* 0x3 */ u16 textId; /* 0x4 */ u16 objectId; } GetItemEntryAP; // size = 0x6 diff --git a/src/eztr_text.c b/src/eztr_text.c index ba85ba7..2b13a09 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -830,8 +830,9 @@ EZTR_ON_INIT void init_text() { "\xBF", randoMilkBar ); - sGetItemTable_ap[GI_SWORD_KOKIRI].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Kokiri_Sword)); - sGetItemTable_ap[GI_BAG_BOMBCHU].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Bombchu_Bag)); + + sGetItemTable_ap[GI_SWORD_KOKIRI - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Kokiri_Sword)); + sGetItemTable_ap[GI_BAG_BOMBCHU - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Bombchu_Bag)); // sGetItemTable_ap[GI_APLOGO_USEFUL].textId = EZTR_GET_ID_H(Rando_Send_Item); // sGetItemTable_ap[GI_APLOGO_FILLER].textId = EZTR_GET_ID_H(Rando_Send_Item); // sGetItemTable_ap[GI_APLOGO_PROG].textId = EZTR_GET_ID_H(Rando_Send_Item); From 111f5a3fabcc84f736c3c0069489696d895a71fa Mon Sep 17 00:00:00 2001 From: Hyped Date: Wed, 6 May 2026 02:20:36 -0700 Subject: [PATCH 05/15] adjust formatting for eztr_text.c --- src/eztr_text.c | 171 ++++++++++++++++++++++++++---------------------- 1 file changed, 91 insertions(+), 80 deletions(-) diff --git a/src/eztr_text.c b/src/eztr_text.c index 2b13a09..a85381b 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -9,12 +9,14 @@ #include "z64snap.h" -//old defines that I didn't use +extern GetItemEntryAP sGetItemTable_ap[]; + +// old defines that I didn't use // #define RANDO_AP_ITEM "\xFF" // #define RANDO_AP_PLAYER "\xFE" // #define RANDO_AP_COLOR "\xFD" -//sets colours for AP item class. probably doesn't work +// sets colours for AP item class. probably doesn't work // u8 getAPItemColor(u32 location) { // switch (rando_get_location_type(location)) { // case 1: return 0x05; // EZTR_CC_COLOR_LIGHTBLUE; // progression - purple @@ -24,6 +26,7 @@ // default: return 0x07; // EZTR_CC_COLOR_SILVER; // filler - grey // } // } + u8 getAPItemColor(u32 location) { u32 type = rando_get_location_type(location); if (type & 0b001) { @@ -36,7 +39,8 @@ u8 getAPItemColor(u32 location) { return 0x07; // EZTR_CC_COLOR_SILVER; // filler - grey } } -//Get info from Rando to replace the text with item class colour, player name and item name + +// Get info from Rando to replace the text with item class colour, player name and item name EZTR_MSG_CALLBACK(randoAPSend) { u32 location = rando_get_last_location_sent(); char* player_name; @@ -56,6 +60,7 @@ EZTR_MSG_CALLBACK(randoAPSend) { recomp_free(player_name); recomp_free(item_name); } + EZTR_MSG_CALLBACK(randoAPSelf) { u32 location = rando_get_last_location_sent(); char* item_name; @@ -71,19 +76,24 @@ EZTR_MSG_CALLBACK(randoAPSelf) { recomp_free(item_name); } + EZTR_MSG_CALLBACK(randoTingle) { } + EZTR_MSG_CALLBACK(randoShop) { } + EZTR_MSG_CALLBACK(randoScrub) { } + EZTR_MSG_CALLBACK(randoMilkBar) { } -//honestly don't know, but seems important + +// honestly don't know, but seems important // char* item_str; // char* player_str; @@ -93,8 +103,8 @@ EZTR_MSG_CALLBACK(randoMilkBar) { // sanitizeRandoText(player_str); -//text sanitize stolen from old file. Not sure what role this plays exactly, but I know it fixes crashes on funky letters -//commented out because this function is already in use elsewhere +// text sanitize stolen from old file. Not sure what role this plays exactly, but I know it fixes crashes on funky letters +// commented out because this function is already in use elsewhere // void sanitizeRandoText(char* rando_string) { // u8 c = rando_string[0]; // u8 next = 0; @@ -130,32 +140,32 @@ EZTR_MSG_CALLBACK(randoMilkBar) { // } // } -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Send_Item);//"You sent [player] their [item]" -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Self_Item);//"You found your [item]" +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Send_Item); // "You sent [player] their [item]" +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Self_Item); // "You found your [item]" EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Kokiri_Sword); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Bombchu_Bag); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_CTSF);//stray fairies +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_CTSF); // stray fairies EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSF); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSF); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSF); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSF); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFBK);//boss keys +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFBK); // boss keys EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHBK); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBBK); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STBK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSK);//small keys +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSK); // small keys EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSK); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSK); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFMap);//maps +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFMap); // maps EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHMap); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBMap); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STMap); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFCompass);//compasses +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFCompass); // compasses EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHCompass); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBCompass); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STCompass); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Swamp_Token);//skull tokens +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Swamp_Token); // skull tokens EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Ocean_Token); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_FOOL); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Moon_Child_Return); @@ -165,7 +175,7 @@ EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Scrub); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Milk_Bar); -//text replacements for AP items. Not yet set up. Probably won't use but keeping here just in case. +// text replacements for AP items. Not yet set up. Probably won't use but keeping here just in case. // EZTR_MSG_CALLBACK(randoAPSend) { // buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, // EZTR_MsgSContent_Sprintf(buf->data.content, "You found " EZTR_CC_COLOR_RED "\xFE" EZTR_CC_COLOR_DEFAULT "'s" EZTR_CC_NEWLINE "" RANDO_AP_COLOR "\xFF" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END ""), @@ -173,55 +183,55 @@ EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Milk_Bar); // } -//text replacements for pictograph box +// text replacements for pictograph box EZTR_MSG_CALLBACK(randoPictograph) { - if (!CHECK_QUEST_ITEM(QUEST_PICTOGRAPH)) { - Snap_RecordPictographedActors(play); - } + if (!CHECK_QUEST_ITEM(QUEST_PICTOGRAPH)) { + Snap_RecordPictographedActors(play); + } - if (Snap_CheckFlag(PICTO_VALID_MONKEY)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a monkey" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_BIG_OCTO)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a Big Octo" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_SCARECROW)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a scarecrow" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_TINGLE)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of Tingle" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_DEKU_KING)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the Deku King" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_GOOD)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_TOO_FAR)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else if (Snap_CheckFlag(PICTO_VALID_LULU_HEAD)) { - if (Snap_CheckFlag(PICTO_VALID_LULU_RIGHT_ARM) && Snap_CheckFlag(PICTO_VALID_LULU_LEFT_ARM)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } else { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } - } else if (Snap_CheckFlag(PICTO_VALID_IN_SWAMP)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the swamp" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } - else { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, - EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); - } + if (Snap_CheckFlag(PICTO_VALID_MONKEY)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a monkey" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_BIG_OCTO)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a Big Octo" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_SCARECROW)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a scarecrow" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_TINGLE)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of Tingle" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_DEKU_KING)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the Deku King" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_GOOD)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_TOO_FAR)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else if (Snap_CheckFlag(PICTO_VALID_LULU_HEAD)) { + if (Snap_CheckFlag(PICTO_VALID_LULU_RIGHT_ARM) && Snap_CheckFlag(PICTO_VALID_LULU_LEFT_ARM)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } else { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } + } else if (Snap_CheckFlag(PICTO_VALID_IN_SWAMP)) { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the swamp" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } + else { + buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); + } } -extern GetItemEntryAP sGetItemTable_ap[]; -//Replacements of existing IDs + +// Replacements of existing IDs EZTR_ON_INIT void init_text() { EZTR_Basic_ReplaceText( - 0x1B9E,//Sonata of Awakening + 0x1B9E, // Sonata of Awakening EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -233,7 +243,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1B9F,//Goron's Lullaby + 0x1B9F, // Goron's Lullaby EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -245,7 +255,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA0,//New Wave Bossa Nova + 0x1BA0, // New Wave Bossa Nova EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -257,7 +267,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA1,//Elegy of Emptiness + 0x1BA1, // Elegy of Emptiness EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -269,7 +279,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA2,//Oath to Order + 0x1BA2, // Oath to Order EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -281,7 +291,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA4,//Song of Time + 0x1BA4, // Song of Time EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -293,7 +303,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA5,//Song of Healing + 0x1BA5, // Song of Healing EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -305,7 +315,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA6,//Epona's Song + 0x1BA6, // Epona's Song EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -317,7 +327,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA7,//Song of Soaring + 0x1BA7, // Song of Soaring EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -329,7 +339,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x1BA6,//Song of Storms + 0x1BA6, // Song of Storms EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -341,7 +351,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x00C8,//Magic Power 1 + 0x00C8, // Magic Power 1 EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_SMALL_MAGIC_JAR, @@ -353,7 +363,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x00CA,//Spin Attack Upgrade + 0x00CA, // Spin Attack Upgrade EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -365,7 +375,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x353C,//Fast Dog + 0x353C, // Fast Dog EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, @@ -377,7 +387,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x3545,//Slow Dog + 0x3545, // Slow Dog EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, @@ -390,7 +400,7 @@ EZTR_ON_INIT void init_text() { ); // EZTR_Basic_ReplaceText( - // 0x20D0,//Gossip Hint joke + // 0x20D0, // Gossip Hint joke // EZTR_STANDARD_TEXT_BOX_II, // 0, // EZTR_ICON_NO_ICON, @@ -402,7 +412,7 @@ EZTR_ON_INIT void init_text() { // NULL // ); EZTR_Basic_ReplaceText( - 0x20D0,//Replaces the Gossip Stone Tatl text to test if it can read the AP items correctly without fully implimenting it on get item. + 0x20D0, // Replaces the Gossip Stone Tatl text to test if it can read the AP items correctly without fully implimenting it on get item. EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -414,7 +424,7 @@ EZTR_ON_INIT void init_text() { randoAPSend ); EZTR_Basic_ReplaceText( - 0x0090,//Replaces rando text for filler AP items. + 0x0090, // Replaces rando text for filler AP items. EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -426,7 +436,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x00B3,//Replaces rando text for useful AP items. + 0x00B3, // Replaces rando text for useful AP items. EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -438,7 +448,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_ReplaceText( - 0x0077,//Replaces rando text for progression AP items. + 0x0077, // Replaces rando text for progression AP items. EZTR_STANDARD_TEXT_BOX_II, 0, EZTR_ICON_NO_ICON, @@ -449,7 +459,8 @@ EZTR_ON_INIT void init_text() { "No, that didn't work. Try again.", randoAPSend ); - //Pictograph Box text + + // Pictograph Box text EZTR_Basic_ReplaceText( 0x00F8, EZTR_STANDARD_TEXT_BOX_I, @@ -464,8 +475,8 @@ EZTR_ON_INIT void init_text() { ); - //Custom IDs for items not normally obtained - //AP send item text. Probably doesn't work. + // Custom IDs for items not normally obtained + // AP send item text. Probably doesn't work. EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Send_Item), EZTR_STANDARD_TEXT_BOX_II, 0, From 104890cc965bcbafcba3dee6069a370eebdcc972 Mon Sep 17 00:00:00 2001 From: Hyped Date: Wed, 6 May 2026 02:40:11 -0700 Subject: [PATCH 06/15] actually label rando item GIs for stray fairies/songs --- include/apcommon.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/apcommon.h b/include/apcommon.h index 2d932b8..5bb9497 100644 --- a/include/apcommon.h +++ b/include/apcommon.h @@ -20,6 +20,23 @@ #define GI_BAG_BOMBCHU GI_54 +#define GI_STRAY_FAIRY_CLOCKTOWN GI_B2 +#define GI_STRAY_FAIRY_WOODFALL GI_46 +#define GI_STRAY_FAIRY_SNOWHEAD GI_47 +#define GI_STRAY_FAIRY_GREATBAY GI_48 +#define GI_STRAY_FAIRY_STONETOWER GI_49 + +#define GI_SONG_TIME GI_A6 +#define GI_SONG_HEALING GI_AF +#define GI_SONG_EPONA GI_A5 +#define GI_SONG_SOARING GI_A3 +#define GI_SONG_STORMS GI_A2 +#define GI_SONG_SONATA GI_AE +#define GI_SONG_LULLABY GI_AD +#define GI_SONG_NOVA GI_AC +#define GI_SONG_ELEGY GI_A8 +#define GI_SONG_OATH GI_A7 + #define GI_SPIN_ATTACK GI_71 #define GI_OCEAN_SKULL_TOKEN GI_72 #define GI_DEFENSE_DOUBLE GI_73 From 5852534b1bc20c2dd727a2d17262272e2b502708 Mon Sep 17 00:00:00 2001 From: Hyped Date: Thu, 14 May 2026 02:00:00 -0700 Subject: [PATCH 07/15] git is mad because of these extra spaces --- include/apcommon.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/apcommon.h b/include/apcommon.h index 5bb9497..891e5ae 100644 --- a/include/apcommon.h +++ b/include/apcommon.h @@ -26,16 +26,16 @@ #define GI_STRAY_FAIRY_GREATBAY GI_48 #define GI_STRAY_FAIRY_STONETOWER GI_49 -#define GI_SONG_TIME GI_A6 -#define GI_SONG_HEALING GI_AF -#define GI_SONG_EPONA GI_A5 -#define GI_SONG_SOARING GI_A3 -#define GI_SONG_STORMS GI_A2 -#define GI_SONG_SONATA GI_AE -#define GI_SONG_LULLABY GI_AD -#define GI_SONG_NOVA GI_AC -#define GI_SONG_ELEGY GI_A8 -#define GI_SONG_OATH GI_A7 +#define GI_SONG_TIME GI_A6 +#define GI_SONG_HEALING GI_AF +#define GI_SONG_EPONA GI_A5 +#define GI_SONG_SOARING GI_A3 +#define GI_SONG_STORMS GI_A2 +#define GI_SONG_SONATA GI_AE +#define GI_SONG_LULLABY GI_AD +#define GI_SONG_NOVA GI_AC +#define GI_SONG_ELEGY GI_A8 +#define GI_SONG_OATH GI_A7 #define GI_SPIN_ATTACK GI_71 #define GI_OCEAN_SKULL_TOKEN GI_72 From 63ed91c2886d9a597a7fbe5ae85ddb6a0d95e325 Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Thu, 28 May 2026 04:37:03 +0100 Subject: [PATCH 08/15] a bunch of stuff I don't remember, but the changelog might have some hints --- src/eztr_text.c | 1039 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 792 insertions(+), 247 deletions(-) diff --git a/src/eztr_text.c b/src/eztr_text.c index a85381b..f584f6d 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -40,6 +40,48 @@ u8 getAPItemColor(u32 location) { } } +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Send_Item); // "You sent [player] their [item]" +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Self_Item); // "You found your [item]" +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Kokiri_Sword); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Bombchu_Bag); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Magic); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SpinAttack); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_DoubleDefense); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Songs); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Souls); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Frogs); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_CTSF); // stray fairies +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSF); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFBK); // boss keys +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHBK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBBK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STBK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSK); // small keys +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSK); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFMap); // maps +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHMap); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBMap); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STMap); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFCompass); // compasses +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHCompass); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBCompass); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STCompass); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Swamp_Token); // skull tokens +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Ocean_Token); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_OwlStatue); // Owl Statues +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Owl_Hidden); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_FOOL); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Moon_Child_Return); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Tingle); // Shops +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Shop); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Scrub); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Milk_Bar); + // Get info from Rando to replace the text with item class colour, player name and item name EZTR_MSG_CALLBACK(randoAPSend) { u32 location = rando_get_last_location_sent(); @@ -76,9 +118,84 @@ EZTR_MSG_CALLBACK(randoAPSelf) { recomp_free(item_name); } +EZTR_MSG_CALLBACK(randoGIOwlStatue) { + u32 location = rando_get_last_location_sent(); + char* item_name; -EZTR_MSG_CALLBACK(randoTingle) { + rando_get_location_item_name(location, &item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "You can now soar to the" EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + getAPItemColor(location), + item_name + ); + + recomp_free(item_name); +} +EZTR_MSG_CALLBACK(randoGISongs) { + u32 location = rando_get_last_location_sent(); + char* item_name; + + rando_get_location_item_name(location, &item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "You learned the " EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + getAPItemColor(location), + item_name + ); + + recomp_free(item_name); +} +EZTR_MSG_CALLBACK(randoGIMagic) { + u8 magic_count = rando_has_item(AP_ITEM_ID_MAGIC); + if (magic_count < 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got " EZTR_CC_COLOR_RED "Magic Power" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + } else if (magic_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "Your " EZTR_CC_COLOR_RED "Magic Power" EZTR_CC_COLOR_DEFAULT " has been " EZTR_CC_COLOR_RED "doubled" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); + } +} +EZTR_MSG_CALLBACK(randoGISouls) { + u32 location = rando_get_last_location_sent(); + char* item_name; + + rando_get_location_item_name(location, &item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "You found the" EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + getAPItemColor(location), + item_name + ); + + recomp_free(item_name); +} +EZTR_MSG_CALLBACK(randoGIFrogs) { + u32 location = rando_get_last_location_sent(); + char* item_name; + + rando_get_location_item_name(location, &item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "You found the" EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + getAPItemColor(location), + item_name + ); + recomp_free(item_name); +} + + +EZTR_MSG_CALLBACK(randoTingle) { + rando_location_is_checked() } EZTR_MSG_CALLBACK(randoShop) { @@ -93,6 +210,407 @@ EZTR_MSG_CALLBACK(randoMilkBar) { } +EZTR_MSG_CALLBACK(WoodfallStrayFairyCount) { + u8 fairy_count = rando_has_item(AP_ITEM_ID_STRAY_FAIRY_WOODFALL); + u8 fairy_required = rando_get_slotdata_u32("required_stray_fairies"); + u8 fairy_remaining = fairy_required - fairy_count; + if (fairy_count >= fairy_required) { + if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_PINK "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_PINK "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_PINK "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_PINK "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } + } else if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } +} +EZTR_MSG_CALLBACK(SnowheadStrayFairyCount) { + u8 fairy_count = rando_has_item(AP_ITEM_ID_STRAY_FAIRY_SNOWHEAD); + u8 fairy_required = rando_get_slotdata_u32("required_stray_fairies"); + u8 fairy_remaining = fairy_required - fairy_count; + if (fairy_count >= fairy_required) { + if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } + } else if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } +} +EZTR_MSG_CALLBACK(GreatBayStrayFairyCount) { + u8 fairy_count = rando_has_item(AP_ITEM_ID_STRAY_FAIRY_GREATBAY); + u8 fairy_required = rando_get_slotdata_u32("required_stray_fairies"); + u8 fairy_remaining = fairy_required - fairy_count; + if (fairy_count >= fairy_required) { + if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } + } else if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } +} +EZTR_MSG_CALLBACK(StoneTowerStrayFairyCount) { + u8 fairy_count = rando_has_item(AP_ITEM_ID_STRAY_FAIRY_STONETOWER); + u8 fairy_required = rando_get_slotdata_u32("required_stray_fairies"); + u8 fairy_remaining = fairy_required - fairy_count; + if (fairy_count >= fairy_required) { + if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_YELLOW "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_YELLOW "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_YELLOW "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_YELLOW "Great Fairy " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + fairy_count + ); + } + } else if (fairy_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else if (fairy_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + fairy_count, + fairy_remaining + ); + } +} +EZTR_MSG_CALLBACK(SnowheadSmallKeyCount) { + u8 key_count = rando_has_item(AP_ITEM_ID_KEY_SMALL_SNOWHEAD); + if (key_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } else if (key_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } else if (key_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } +} +EZTR_MSG_CALLBACK(StoneTowerSmallKeyCount) { + u8 key_count = rando_has_item(AP_ITEM_ID_KEY_SMALL_STONETOWER); + if (key_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } else if (key_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } else if (key_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", + key_count); + } +} +EZTR_MSG_CALLBACK(SwampSpiderTokenCount) { + u8 token_count = rando_has_item(GI_TRUE_SKULL_TOKEN); + u8 token_required = rando_get_slotdata_u32("required_skull_tokens"); + u8 token_remaining = token_required - token_count; + if (token_count >= token_required) { + if (token_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 21) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 22) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 23) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_GREEN "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } + } else if (token_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 21) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 22) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 23) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_GREEN "Swamp " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } +} +EZTR_MSG_CALLBACK(OceanSpiderTokenCount) { + u8 token_count = rando_has_item(GI_OCEAN_SKULL_TOKEN); + u8 token_required = rando_get_slotdata_u32("required_skull_tokens"); + u8 token_remaining = token_required - token_count; + if (token_count >= token_required) { + if (token_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 21) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 22) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else if (token_count == 23) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Head to the " EZTR_CC_COLOR_BLUE "Spider House " EZTR_CC_COLOR_DEFAULT "for your" EZTR_CC_NEWLINE "reward if you haven't already." EZTR_CC_END "", + token_count); + } + } else if (token_count == 1) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 2) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 3) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 21) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dst" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 22) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dnd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else if (token_count == 23) { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%drd" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } else { + EZTR_MsgSContent_Sprintf(buf->data.content, + "You got a " EZTR_CC_COLOR_BLUE "Ocean " EZTR_CC_COLOR_RED "Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED "%dth" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_NEWLINE "Only " EZTR_CC_COLOR_RED "%d" EZTR_CC_COLOR_DEFAULT " more left to find!" EZTR_CC_END "", + token_count, + token_remaining + ); + } +} + // honestly don't know, but seems important // char* item_str; // char* player_str; @@ -140,44 +658,13 @@ EZTR_MSG_CALLBACK(randoMilkBar) { // } // } -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Send_Item); // "You sent [player] their [item]" -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Self_Item); // "You found your [item]" -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Kokiri_Sword); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Bombchu_Bag); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_CTSF); // stray fairies -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSF); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSF); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSF); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSF); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFBK); // boss keys -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHBK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBBK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STBK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFSK); // small keys -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHSK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBSK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STSK); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFMap); // maps -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHMap); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBMap); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STMap); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_WFCompass); // compasses -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_SHCompass); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_GBCompass); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_STCompass); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Swamp_Token); // skull tokens -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Ocean_Token); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_FOOL); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Moon_Child_Return); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Tingle); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Shop); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Scrub); -EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Milk_Bar); + + // text replacements for AP items. Not yet set up. Probably won't use but keeping here just in case. // EZTR_MSG_CALLBACK(randoAPSend) { -// buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, +// buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, // EZTR_MsgSContent_Sprintf(buf->data.content, "You found " EZTR_CC_COLOR_RED "\xFE" EZTR_CC_COLOR_DEFAULT "'s" EZTR_CC_NEWLINE "" RANDO_AP_COLOR "\xFF" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END ""), @@ -190,40 +677,40 @@ EZTR_MSG_CALLBACK(randoPictograph) { } if (Snap_CheckFlag(PICTO_VALID_MONKEY)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a monkey" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_BIG_OCTO)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a Big Octo" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_SCARECROW)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of a scarecrow" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_TINGLE)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of Tingle" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_DEKU_KING)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the Deku King" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_GOOD)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_TOO_FAR)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of a pirate" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else if (Snap_CheckFlag(PICTO_VALID_LULU_HEAD)) { if (Snap_CheckFlag(PICTO_VALID_LULU_RIGHT_ARM) && Snap_CheckFlag(PICTO_VALID_LULU_LEFT_ARM)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "good picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "bad picture of Lulu" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } } else if (Snap_CheckFlag(PICTO_VALID_IN_SWAMP)) { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture of the swamp" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } else { - buf->data.text_box_type = EZTR_STANDARD_TEXT_BOX_II, + buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } } @@ -231,254 +718,218 @@ EZTR_MSG_CALLBACK(randoPictograph) { // Replacements of existing IDs EZTR_ON_INIT void init_text() { EZTR_Basic_ReplaceText( - 0x1B9E, // Sonata of Awakening - EZTR_STANDARD_TEXT_BOX_II, + 0x353C, // Fast Dog + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_GREEN "Sonata of Awakening" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + true, + "..." EZTR_CC_END "", NULL ); EZTR_Basic_ReplaceText( - 0x1B9F, // Goron's Lullaby - EZTR_STANDARD_TEXT_BOX_II, + 0x3545, // Slow Dog + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_RED "Goron's Lullaby" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + true, + "" EZTR_CC_SFX "|29|13Hoo-whine." EZTR_CC_NEWLINE "How can any of us win against..." EZTR_CC_NEWLINE "" EZTR_CC_COLOR_BLUE "blue dog" EZTR_CC_COLOR_DEFAULT "..." EZTR_CC_END "", NULL ); + + // EZTR_Basic_ReplaceText( + // 0x20D0, // Gossip Hint joke + // EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + // 0, + // EZTR_ICON_NO_ICON, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // false, + // "Use the " EZTR_CC_COLOR_RED "!hint" EZTR_CC_COLOR_DEFAULT " command to hint" EZTR_CC_NEWLINE "for an item!" EZTR_CC_END "", + // NULL + // ); + // EZTR_Basic_ReplaceText( + // 0x20D0, // Replaces the Gossip Stone Tatl text to test if it can read the AP items correctly without fully implimenting it on get item. + // EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + // 0, + // EZTR_ICON_NO_ICON, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // false, + // "\xBF", + // randoAPSend + // ); + + // Pictograph Box text EZTR_Basic_ReplaceText( - 0x1BA0, // New Wave Bossa Nova - EZTR_STANDARD_TEXT_BOX_II, + 0x00F8, + EZTR_STANDARD_TEXT_BOX_I, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got the " EZTR_CC_COLOR_BLUE "New Wave Bossa Nova" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + randoPictograph ); + // Tingle Text + // North Clock Town Tingle EZTR_Basic_ReplaceText( - 0x1BA1, // Elegy of Emptiness + 0x1D11, EZTR_STANDARD_TEXT_BOX_II, - 0, + 1, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_ORANGE "Elegy of Emptiness" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + 5, + 40, + true, + "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Clock Town " EZTR_CC_COLOR_RED "5 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Woodfall " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", NULL ); + // Path to Swamp Tingle (Woodfall) EZTR_Basic_ReplaceText( - 0x1BA2, // Oath to Order + 0x1D12, EZTR_STANDARD_TEXT_BOX_II, - 0, + 1, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_PINK "Oath to Order" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + 20, + 40, + true, + "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Woodfall " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", NULL ); + // Twin Islands Tingle (Snowhead) EZTR_Basic_ReplaceText( - 0x1BA4, // Song of Time + 0x1D13, EZTR_STANDARD_TEXT_BOX_II, - 0, + 1, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_LIGHTBLUE "Song of Time" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + 20, + 40, + true, + "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Snowhead " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Romani Ranch " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", NULL ); + // Milk Road Tingle EZTR_Basic_ReplaceText( - 0x1BA5, // Song of Healing + 0x1D14, EZTR_STANDARD_TEXT_BOX_II, - 0, + 1, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_PINK "Song of Healing" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + 20, + 40, + true, + "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Romani Ranch " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Great Bay " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", NULL ); + // Great Bay Coast Tingle EZTR_Basic_ReplaceText( - 0x1BA6, // Epona's Song + 0x1D15, EZTR_STANDARD_TEXT_BOX_II, - 0, + 1, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You got " EZTR_CC_COLOR_ORANGE "Epona's Song" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + 20, + 40, + true, + "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Great Bay " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Stone Tower " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", NULL ); + // Ikana Canyon Tingle EZTR_Basic_ReplaceText( - 0x1BA7, // Song of Soaring + 0x1D16, EZTR_STANDARD_TEXT_BOX_II, - 0, + 1, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You got the " EZTR_CC_COLOR_RED "Song of Soaring" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + 20, + 40, + true, + "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Stone Tower " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Clock Town " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", NULL ); - EZTR_Basic_ReplaceText( - 0x1BA6, // Song of Storms - EZTR_STANDARD_TEXT_BOX_II, + + + // Custom Text IDs + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Send_Item), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got the " EZTR_CC_COLOR_RED "Song of Storms" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL - ); - EZTR_Basic_ReplaceText( - 0x00C8, // Magic Power 1 - EZTR_STANDARD_TEXT_BOX_II, - 0, - EZTR_ICON_SMALL_MAGIC_JAR, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "You've been granted " EZTR_CC_COLOR_GREEN "Magic Power" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + randoAPSend ); - EZTR_Basic_ReplaceText( - 0x00CA, // Spin Attack Upgrade - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Self_Item), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You mastered the " EZTR_CC_COLOR_RED "Spin Attack" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + randoAPSelf ); - EZTR_Basic_ReplaceText( - 0x353C, // Fast Dog + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Songs), EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, - true, - "..." EZTR_CC_END "", - NULL + false, + "\xBF", + randoGISongs ); - EZTR_Basic_ReplaceText( - 0x3545, // Slow Dog + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Magic), EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, - EZTR_ICON_NO_ICON, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - true, - "" EZTR_CC_SFX "|29|13Hoo-whine." EZTR_CC_NEWLINE "How can any of us win against..." EZTR_CC_NEWLINE "" EZTR_CC_COLOR_BLUE "blue god" EZTR_CC_COLOR_DEFAULT "..." EZTR_CC_END "", - NULL - ); - - // EZTR_Basic_ReplaceText( - // 0x20D0, // Gossip Hint joke - // EZTR_STANDARD_TEXT_BOX_II, - // 0, - // EZTR_ICON_NO_ICON, - // EZTR_NO_VALUE, - // EZTR_NO_VALUE, - // EZTR_NO_VALUE, - // false, - // "Use the " EZTR_CC_COLOR_RED "!hint" EZTR_CC_COLOR_DEFAULT " command to hint" EZTR_CC_NEWLINE "for an item!" EZTR_CC_END "", - // NULL - // ); - EZTR_Basic_ReplaceText( - 0x20D0, // Replaces the Gossip Stone Tatl text to test if it can read the AP items correctly without fully implimenting it on get item. - EZTR_STANDARD_TEXT_BOX_II, - 0, - EZTR_ICON_NO_ICON, + EZTR_ICON_LARGE_MAGIC_JAR, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, "\xBF", - randoAPSend + randoGIMagic ); - EZTR_Basic_ReplaceText( - 0x0090, // Replaces rando text for filler AP items. - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SpinAttack), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "No, that didn't work. Try again.", + "You mastered the " EZTR_CC_COLOR_RED "Spin Attack" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", NULL ); - EZTR_Basic_ReplaceText( - 0x00B3, // Replaces rando text for useful AP items. - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_DoubleDefense), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, - EZTR_ICON_NO_ICON, + EZTR_ICON_HEART_CONTAINER, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "No, that didn't work. Try again.", + "Your " EZTR_CC_COLOR_RED "defense" EZTR_CC_COLOR_DEFAULT " has been" EZTR_CC_NEWLINE "strengthened!" EZTR_CC_NEWLINE "Enemies now do half as much" EZTR_CC_NEWLINE "damage as before!" EZTR_CC_END "", NULL ); - EZTR_Basic_ReplaceText( - 0x0077, // Replaces rando text for progression AP items. - EZTR_STANDARD_TEXT_BOX_II, - 0, - EZTR_ICON_NO_ICON, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "No, that didn't work. Try again.", - randoAPSend - ); - - // Pictograph Box text - EZTR_Basic_ReplaceText( - 0x00F8, - EZTR_STANDARD_TEXT_BOX_I, - 0, - EZTR_ICON_NO_ICON, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "\xBF", - randoPictograph - ); - - - // Custom IDs for items not normally obtained - // AP send item text. Probably doesn't work. - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Send_Item), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Souls), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, @@ -486,22 +937,22 @@ EZTR_ON_INIT void init_text() { EZTR_NO_VALUE, false, "\xBF", - randoAPSend + randoGISouls ); - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Self_Item), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Frogs), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, - EZTR_ICON_NO_ICON, + EZTR_ICON_DON_GEROS_MASK, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, "\xBF", - randoAPSelf + randoGIFrogs ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Kokiri_Sword), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_KOKIRI_SWORD, EZTR_NO_VALUE, @@ -512,7 +963,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Bombchu_Bag), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_BOMBCHU, EZTR_NO_VALUE, @@ -523,7 +974,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_CTSF), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_STRAY_FAIRY, EZTR_NO_VALUE, @@ -534,51 +985,51 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFSF), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_STRAY_FAIRY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", - NULL + "\xBF", + WoodfallStrayFairyCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHSF), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_STRAY_FAIRY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", - NULL + "\xBF", + SnowheadStrayFairyCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSF), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_STRAY_FAIRY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", - NULL + "\xBF", + GreatBayStrayFairyCount ); - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSF), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_STSF), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_STRAY_FAIRY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Stray Fairy" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "This is your " EZTR_CC_COLOR_RED EZTR_CC_STRAY_FAIRIES "" EZTR_CC_COLOR_DEFAULT " one." EZTR_CC_END "", - NULL + "\xBF", + StoneTowerStrayFairyCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFBK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_BOSS_KEY, EZTR_NO_VALUE, @@ -589,7 +1040,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHBK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_BOSS_KEY, EZTR_NO_VALUE, @@ -600,7 +1051,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBBK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_BOSS_KEY, EZTR_NO_VALUE, @@ -610,8 +1061,8 @@ EZTR_ON_INIT void init_text() { "You got the " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Boss Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", NULL ); - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBBK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_STBK), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_BOSS_KEY, EZTR_NO_VALUE, @@ -622,51 +1073,51 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFSK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_SMALL_KEY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + "You got the " EZTR_CC_COLOR_PINK "Woodfall " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHSK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_SMALL_KEY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + SnowheadSmallKeyCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_SMALL_KEY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + "You got the " EZTR_CC_COLOR_BLUE "Great Bay " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", NULL ); - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBSK), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_STSK), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_SMALL_KEY, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a " EZTR_CC_COLOR_YELLOW "Stone Tower " EZTR_CC_COLOR_RED "Small Key" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + StoneTowerSmallKeyCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFMap), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_DUNGEON_MAP, EZTR_NO_VALUE, @@ -677,7 +1128,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHMap), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_DUNGEON_MAP, EZTR_NO_VALUE, @@ -688,7 +1139,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBMap), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_DUNGEON_MAP, EZTR_NO_VALUE, @@ -699,7 +1150,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBMap), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_DUNGEON_MAP, EZTR_NO_VALUE, @@ -710,7 +1161,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_WFCompass), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_COMPASS, EZTR_NO_VALUE, @@ -721,7 +1172,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_SHCompass), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_COMPASS, EZTR_NO_VALUE, @@ -732,7 +1183,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBCompass), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_COMPASS, EZTR_NO_VALUE, @@ -743,7 +1194,7 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_GBCompass), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_COMPASS, EZTR_NO_VALUE, @@ -754,29 +1205,29 @@ EZTR_ON_INIT void init_text() { NULL ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Swamp_Token), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_GOLD_SKULLTULA_TOKEN, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got a "EZTR_CC_COLOR_RED "Swamp Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + SwampSpiderTokenCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Ocean_Token), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_GOLD_SKULLTULA_TOKEN, EZTR_NO_VALUE, EZTR_NO_VALUE, EZTR_NO_VALUE, false, - "You got an "EZTR_CC_COLOR_RED "Ocean Skulltula Token" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", - NULL + "\xBF", + OceanSpiderTokenCount ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_FOOL), - EZTR_STANDARD_TEXT_BOX_II, + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, 0, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, @@ -841,10 +1292,104 @@ EZTR_ON_INIT void init_text() { "\xBF", randoMilkBar ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_OwlStatue), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoGIOwlStatue + ); + EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_GI_Owl_Hidden), + EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "You got the" EZTR_CC_COLOR_RED " Hidden Owl Statue" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_NEWLINE "You can now " EZTR_CC_NEWLINE "" EZTR_CC_COLOR_RED "Index Warp" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END "", + NULL + ); - sGetItemTable_ap[GI_SWORD_KOKIRI - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Kokiri_Sword)); + sGetItemTable_ap[GI_BOSS_SOUL_ODOLWA - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); // Souls + sGetItemTable_ap[GI_BOSS_SOUL_GOHT - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_BOSS_SOUL_GYORG - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_BOSS_SOUL_TWINMOLD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_BOSS_SOUL_MAJORA - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_MISC_SOUL_COW - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_MISC_SOUL_KEATON - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_MISC_SOUL_GOLD_SKULLTULAS - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_MISC_SOUL_BUTTERFLY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_NPC_GENERIC - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_UTILITY_GENERIC - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_ENEMY_GENERIC - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_ABSURD_GENERIC - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Souls)); + sGetItemTable_ap[GI_FROG_BLUE - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Frogs)); // Frogs + sGetItemTable_ap[GI_FROG_CYAN - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Frogs)); + sGetItemTable_ap[GI_FROG_PINK - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Frogs)); + sGetItemTable_ap[GI_FROG_YELLOW - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Frogs)); + sGetItemTable_ap[GI_FROG_WHITE - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Frogs)); + sGetItemTable_ap[GI_SWORD_KOKIRI - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Kokiri_Sword)); // Items sGetItemTable_ap[GI_BAG_BOMBCHU - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Bombchu_Bag)); - // sGetItemTable_ap[GI_APLOGO_USEFUL].textId = EZTR_GET_ID_H(Rando_Send_Item); - // sGetItemTable_ap[GI_APLOGO_FILLER].textId = EZTR_GET_ID_H(Rando_Send_Item); - // sGetItemTable_ap[GI_APLOGO_PROG].textId = EZTR_GET_ID_H(Rando_Send_Item); + sGetItemTable_ap[GI_SCARECROW - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_MAGIC_UPGRADE - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Magic)); + sGetItemTable_ap[GI_SPIN_ATTACK - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_SpinAttack)); + sGetItemTable_ap[GI_DEFENSE_DOUBLE - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_DoubleDefense)); + sGetItemTable_ap[GI_AP_PROG - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); // AP Non-local items + sGetItemTable_ap[GI_AP_FILLER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_AP_USEFUL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_OOT_ITEM_PROG - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); // Custom OoT/WW items just in case we want them + sGetItemTable_ap[GI_OOT_ITEM_FILLER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_OOT_ITEM_USEFUL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_WW_ITEM_PROG - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_WW_ITEM_FILLER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_WW_ITEM_USEFUL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Send_Item)); + sGetItemTable_ap[GI_STRAY_FAIRY_CLOCKTOWN - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_CTSF)); // Stray Fairies + sGetItemTable_ap[GI_STRAY_FAIRY_WOODFALL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_WFSF)); + sGetItemTable_ap[GI_STRAY_FAIRY_SNOWHEAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_SHSF)); + sGetItemTable_ap[GI_STRAY_FAIRY_GREATBAY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_GBSF)); + sGetItemTable_ap[GI_STRAY_FAIRY_STONETOWER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_STSF)); + sGetItemTable_ap[GI_KEY_BOSS_WOODFALL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_WFBK)); // Boss Keys + sGetItemTable_ap[GI_KEY_BOSS_SNOWHEAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_SHBK)); + sGetItemTable_ap[GI_KEY_BOSS_GREATBAY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_GBBK)); + sGetItemTable_ap[GI_KEY_BOSS_STONETOWER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_STBK)); + sGetItemTable_ap[GI_KEY_SMALL_WOODFALL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_WFSK)); // Small Keys + sGetItemTable_ap[GI_KEY_SMALL_SNOWHEAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_SHSK)); + sGetItemTable_ap[GI_KEY_SMALL_GREATBAY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_GBSK)); + sGetItemTable_ap[GI_KEY_SMALL_STONETOWER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_STSK)); + sGetItemTable_ap[GI_MAP_WOODFALL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_WFMap)); // Maps + sGetItemTable_ap[GI_MAP_SNOWHEAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_SHMap)); + sGetItemTable_ap[GI_MAP_GREATBAY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_GBMap)); + sGetItemTable_ap[GI_MAP_STONETOWER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_STMap)); + sGetItemTable_ap[GI_COMPASS_WOODFALL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_WFCompass)); // Compasses + sGetItemTable_ap[GI_COMPASS_SNOWHEAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_SHCompass)); + sGetItemTable_ap[GI_COMPASS_GREATBAY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_GBCompass)); + sGetItemTable_ap[GI_COMPASS_STONETOWER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_STCompass)); + sGetItemTable_ap[GI_TRUE_SKULL_TOKEN - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Swamp_Token)); // Skulltula Tokens + sGetItemTable_ap[GI_OCEAN_SKULL_TOKEN - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Ocean_Token)); + sGetItemTable_ap[GI_OWL_GREAT_BAY_COAST - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); // Owl Statues + sGetItemTable_ap[GI_OWL_ZORA_CAPE - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_SNOWHEAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_MOUNTAIN_VILLAGE - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_CLOCK_TOWN - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_MILK_ROAD - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_WOODFALL - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_SOUTHERN_SWAMP - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_IKANA_CANYON - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_STONE_TOWER - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_OWL_HIDDEN - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Self_Item)); + sGetItemTable_ap[GI_SONG_TIME - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); // Songs + sGetItemTable_ap[GI_SONG_HEALING - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_EPONA - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_SOARING - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_STORMS - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_SONATA - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_LULLABY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_NOVA - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_ELEGY - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); + sGetItemTable_ap[GI_SONG_OATH - 1].textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_GI_Songs)); } From 90bffec1d98ca474b59869c2386d373475529dd8 Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Thu, 28 May 2026 22:08:40 +0100 Subject: [PATCH 09/15] Tingle shop works correctly. Though long item names will make it look silly. --- src/eztr_text.c | 402 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 377 insertions(+), 25 deletions(-) diff --git a/src/eztr_text.c b/src/eztr_text.c index f584f6d..fb3fe64 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -194,8 +194,360 @@ EZTR_MSG_CALLBACK(randoGIFrogs) { } -EZTR_MSG_CALLBACK(randoTingle) { - rando_location_is_checked() +EZTR_MSG_CALLBACK(randoTingleClockTown) { + u32 tingleFirstItem = GI_TINGLE_MAP_CLOCK_TOWN; + char* player_name; + char* get_player_name; + char* item_name; + char* get_item_name; + u32 tingleSecondItem = GI_TINGLE_MAP_WOODFALL; + char* player_name2; + char* get_player_name2; + char* item_name2; + char* get_item_name2; + + char* rupee_cost1; + char* rupee_cost2; + + + rando_get_location_item_player(tingleFirstItem, &get_player_name); + rando_get_location_item_name(tingleFirstItem, &get_item_name); + rando_get_location_item_player(tingleSecondItem, &get_player_name2); + rando_get_location_item_name(tingleSecondItem, &get_item_name2); + + if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; + } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; + } else {player_name = get_player_name; + } + if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; + } else {item_name = get_item_name; + } + if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; + } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; + } else {player_name2 = get_player_name2; + } + if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; + } else {item_name2 = get_item_name2; + } + if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; + } else {rupee_cost1 = "5 Rupees"; + } + if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; + } else {rupee_cost2 = "40 Rupees"; + } + + + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", + player_name, + item_name, + rupee_cost1, + player_name2, + item_name2, + rupee_cost2 + ); + + recomp_free(get_item_name); + recomp_free(get_item_name2); + recomp_free(get_player_name); + recomp_free(get_player_name2); +} +EZTR_MSG_CALLBACK(randoTingleWoodfall) { + u32 tingleFirstItem = GI_TINGLE_MAP_WOODFALL; + char* player_name; + char* get_player_name; + char* item_name; + char* get_item_name; + u32 tingleSecondItem = GI_TINGLE_MAP_SNOWHEAD; + char* player_name2; + char* get_player_name2; + char* item_name2; + char* get_item_name2; + + char* rupee_cost1; + char* rupee_cost2; + + + rando_get_location_item_player(tingleFirstItem, &get_player_name); + rando_get_location_item_name(tingleFirstItem, &get_item_name); + rando_get_location_item_player(tingleSecondItem, &get_player_name2); + rando_get_location_item_name(tingleSecondItem, &get_item_name2); + + if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; + } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; + } else {player_name = get_player_name; + } + if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; + } else {item_name = get_item_name; + } + if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; + } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; + } else {player_name2 = get_player_name2; + } + if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; + } else {item_name2 = get_item_name2; + } + if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; + } else {rupee_cost1 = "20 Rupees"; + } + if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; + } else {rupee_cost2 = "40 Rupees"; + } + + + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, + item_name, + rupee_cost1, + player_name2, + item_name2, + rupee_cost2 + ); + + recomp_free(get_item_name); + recomp_free(get_item_name2); + recomp_free(get_player_name); + recomp_free(get_player_name2); +} +EZTR_MSG_CALLBACK(randoTingleSnowhead) { + u32 tingleFirstItem = GI_TINGLE_MAP_SNOWHEAD; + char* player_name; + char* get_player_name; + char* item_name; + char* get_item_name; + u32 tingleSecondItem = GI_TINGLE_MAP_ROMANI_RANCH; + char* player_name2; + char* get_player_name2; + char* item_name2; + char* get_item_name2; + + char* rupee_cost1; + char* rupee_cost2; + + + rando_get_location_item_player(tingleFirstItem, &get_player_name); + rando_get_location_item_name(tingleFirstItem, &get_item_name); + rando_get_location_item_player(tingleSecondItem, &get_player_name2); + rando_get_location_item_name(tingleSecondItem, &get_item_name2); + + if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; + } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; + } else {player_name = get_player_name; + } + if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; + } else {item_name = get_item_name; + } + if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; + } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; + } else {player_name2 = get_player_name2; + } + if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; + } else {item_name2 = get_item_name2; + } + if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; + } else {rupee_cost1 = "20 Rupees"; + } + if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; + } else {rupee_cost2 = "40 Rupees"; + } + + + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, + item_name, + rupee_cost1, + player_name2, + item_name2, + rupee_cost2 + ); + + recomp_free(get_item_name); + recomp_free(get_item_name2); + recomp_free(get_player_name); + recomp_free(get_player_name2); +} +EZTR_MSG_CALLBACK(randoTingleMilkRoad) { + u32 tingleFirstItem = GI_TINGLE_MAP_ROMANI_RANCH; + char* player_name; + char* get_player_name; + char* item_name; + char* get_item_name; + u32 tingleSecondItem = GI_TINGLE_MAP_GREAT_BAY; + char* player_name2; + char* get_player_name2; + char* item_name2; + char* get_item_name2; + + char* rupee_cost1; + char* rupee_cost2; + + + rando_get_location_item_player(tingleFirstItem, &get_player_name); + rando_get_location_item_name(tingleFirstItem, &get_item_name); + rando_get_location_item_player(tingleSecondItem, &get_player_name2); + rando_get_location_item_name(tingleSecondItem, &get_item_name2); + + if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; + } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; + } else {player_name = get_player_name; + } + if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; + } else {item_name = get_item_name; + } + if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; + } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; + } else {player_name2 = get_player_name2; + } + if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; + } else {item_name2 = get_item_name2; + } + if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; + } else {rupee_cost1 = "20 Rupees"; + } + if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; + } else {rupee_cost2 = "40 Rupees"; + } + + + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, + item_name, + rupee_cost1, + player_name2, + item_name2, + rupee_cost2 + ); + + recomp_free(get_item_name); + recomp_free(get_item_name2); + recomp_free(get_player_name); + recomp_free(get_player_name2); +} +EZTR_MSG_CALLBACK(randoTingleGreatBay) { + u32 tingleFirstItem = GI_TINGLE_MAP_GREAT_BAY; + char* player_name; + char* get_player_name; + char* item_name; + char* get_item_name; + u32 tingleSecondItem = GI_TINGLE_MAP_STONE_TOWER; + char* player_name2; + char* get_player_name2; + char* item_name2; + char* get_item_name2; + + char* rupee_cost1; + char* rupee_cost2; + + + rando_get_location_item_player(tingleFirstItem, &get_player_name); + rando_get_location_item_name(tingleFirstItem, &get_item_name); + rando_get_location_item_player(tingleSecondItem, &get_player_name2); + rando_get_location_item_name(tingleSecondItem, &get_item_name2); + + if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; + } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; + } else {player_name = get_player_name; + } + if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; + } else {item_name = get_item_name; + } + if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; + } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; + } else {player_name2 = get_player_name2; + } + if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; + } else {item_name2 = get_item_name2; + } + if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; + } else {rupee_cost1 = "20 Rupees"; + } + if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; + } else {rupee_cost2 = "40 Rupees"; + } + + + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, + item_name, + rupee_cost1, + player_name2, + item_name2, + rupee_cost2 + ); + + recomp_free(get_item_name); + recomp_free(get_item_name2); + recomp_free(get_player_name); + recomp_free(get_player_name2); +} +EZTR_MSG_CALLBACK(randoTingleStoneTower) { + u32 tingleFirstItem = GI_TINGLE_MAP_STONE_TOWER; + char* player_name; + char* get_player_name; + char* item_name; + char* get_item_name; + u32 tingleSecondItem = GI_TINGLE_MAP_CLOCK_TOWN; + char* player_name2; + char* get_player_name2; + char* item_name2; + char* get_item_name2; + + char* rupee_cost1; + char* rupee_cost2; + + + rando_get_location_item_player(tingleFirstItem, &get_player_name); + rando_get_location_item_name(tingleFirstItem, &get_item_name); + rando_get_location_item_player(tingleSecondItem, &get_player_name2); + rando_get_location_item_name(tingleSecondItem, &get_item_name2); + + if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; + } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; + } else {player_name = get_player_name; + } + if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; + } else {item_name = get_item_name; + } + if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; + } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; + } else {player_name2 = get_player_name2; + } + if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; + } else {item_name2 = get_item_name2; + } + if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; + } else {rupee_cost1 = "20 Rupees"; + } + if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; + } else {rupee_cost2 = "40 Rupees"; + } + + + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, + item_name, + rupee_cost1, + player_name2, + item_name2, + rupee_cost2 + ); + + recomp_free(get_item_name); + recomp_free(get_item_name2); + recomp_free(get_player_name); + recomp_free(get_player_name2); } EZTR_MSG_CALLBACK(randoShop) { @@ -791,8 +1143,8 @@ EZTR_ON_INIT void init_text() { 5, 40, true, - "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Clock Town " EZTR_CC_COLOR_RED "5 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Woodfall " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - NULL + "\xBF", + randoTingleClockTown ); // Path to Swamp Tingle (Woodfall) EZTR_Basic_ReplaceText( @@ -804,8 +1156,8 @@ EZTR_ON_INIT void init_text() { 20, 40, true, - "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Woodfall " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Snowhead " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - NULL + "\xBF", + randoTingleWoodfall ); // Twin Islands Tingle (Snowhead) EZTR_Basic_ReplaceText( @@ -817,8 +1169,8 @@ EZTR_ON_INIT void init_text() { 20, 40, true, - "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Snowhead " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Romani Ranch " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - NULL + "\xBF", + randoTingleSnowhead ); // Milk Road Tingle EZTR_Basic_ReplaceText( @@ -830,8 +1182,8 @@ EZTR_ON_INIT void init_text() { 20, 40, true, - "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Romani Ranch " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Great Bay " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - NULL + "\xBF", + randoTingleMilkRoad ); // Great Bay Coast Tingle EZTR_Basic_ReplaceText( @@ -843,8 +1195,8 @@ EZTR_ON_INIT void init_text() { 20, 40, true, - "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Great Bay " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Stone Tower " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - NULL + "\xBF", + randoTingleGreatBay ); // Ikana Canyon Tingle EZTR_Basic_ReplaceText( @@ -856,8 +1208,8 @@ EZTR_ON_INIT void init_text() { 20, 40, true, - "" EZTR_CC_COLOR_GREEN "" EZTR_CC_THREE_CHOICE "Stone Tower " EZTR_CC_COLOR_RED "20 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "Clock Town " EZTR_CC_COLOR_RED "40 Rupees" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - NULL + "\xBF", + randoTingleStoneTower ); @@ -1248,17 +1600,17 @@ EZTR_ON_INIT void init_text() { "...But you are not strong enough..." EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "Shall... I send you back?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END "", NULL ); - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Tingle), - EZTR_STANDARD_TEXT_BOX_II, - 0, - EZTR_ICON_NO_ICON, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - EZTR_NO_VALUE, - false, - "\xBF", - randoTingle - ); + // EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Tingle), + // EZTR_STANDARD_TEXT_BOX_II, + // 0, + // EZTR_ICON_NO_ICON, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // EZTR_NO_VALUE, + // false, + // "\xBF", + // randoTingle + // ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Shop), EZTR_STANDARD_TEXT_BOX_II, 0, From f3c8eab940b9642efaadbcc8a797f13539aa3c19 Mon Sep 17 00:00:00 2001 From: Hyped Date: Thu, 28 May 2026 20:35:50 -0700 Subject: [PATCH 10/15] move shop text to EZTR + misc shop cleanup this was annoying --- include/shops.h | 34 +++++++++++ src/eztr_text.c | 117 +++++++++++++++++++++++++++++++++----- src/item_text.c | 2 +- src/shop_hooks.c | 129 ++++++++++++++++++++++++++++++++++-------- src/shop_item_hooks.c | 12 ++-- 5 files changed, 251 insertions(+), 43 deletions(-) create mode 100644 include/shops.h diff --git a/include/shops.h b/include/shops.h new file mode 100644 index 0000000..6489adf --- /dev/null +++ b/include/shops.h @@ -0,0 +1,34 @@ +#define FSN_LIMB_MAX 0x12 +#define ENFSN_LIMB_MAX FSN_LIMB_MAX + 1 +#include "overlays/actors/ovl_En_Fsn/z_en_fsn.h" + +typedef enum { + /* 0 */ ENFSN_CUTSCENESTATE_STOPPED, + /* 1 */ ENFSN_CUTSCENESTATE_WAITING, + /* 2 */ ENFSN_CUTSCENESTATE_PLAYING +} EnFsnCutsceneState; + +#define ANI_LIMB_MAX 0x10 +#define ENOSSAN_LIMB_MAX MAX((s32)FSN_LIMB_MAX + 1, (s32)ANI_LIMB_MAX) +#include "overlays/actors/ovl_En_Ossan/z_en_ossan.h" + +#define ZORA_LIMB_MAX 0x14 +#define BOMB_SHOPKEEPER_LIMB_MAX 0x10 +#define GORON_LIMB_MAX 0x12 +#define ENSOB1_LIMB_MAX MAX(MAX((s32)ZORA_LIMB_MAX, (s32)BOMB_SHOPKEEPER_LIMB_MAX), (s32)GORON_LIMB_MAX) +#include "overlays/actors/ovl_En_Sob1/z_en_sob1.h" + +#include "overlays/actors/ovl_En_Trt/z_en_trt.h" + +extern EnFsn* sEnFsn; +extern EnOssan* sEnOssan; +extern EnSob1* sEnSob1; +extern EnTrt* sEnTrt; + +#include "overlays/actors/ovl_En_GirlA/z_en_girla.h" + +#define LOCATION_SHOP_ITEM (0x090000 | this->items[this->cursorIndex]->itemParams) +#define LOCATION_SHOP_ITEM_ID(shopId) (0x090000 | shopId) +#define LOCATION_FSN_RUPEE (0x070000 | (this->actor.id) << 8 | this->getItemId) + +s32 rando_get_shop_price(u32 shop_item_id); \ No newline at end of file diff --git a/src/eztr_text.c b/src/eztr_text.c index fb3fe64..40dbb28 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -6,6 +6,7 @@ #include "attributes.h" #include "apcommon.h" +#include "shops.h" #include "z64snap.h" @@ -27,6 +28,8 @@ extern GetItemEntryAP sGetItemTable_ap[]; // } // } +void sanitizeRandoText(char* rando_string); + u8 getAPItemColor(u32 location) { u32 type = rando_get_location_type(location); if (type & 0b001) { @@ -79,6 +82,7 @@ EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_FOOL); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Moon_Child_Return); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Tingle); // Shops EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Shop); +EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Shop_Buying); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Scrub); EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Milk_Bar); @@ -550,8 +554,93 @@ EZTR_MSG_CALLBACK(randoTingleStoneTower) { recomp_free(get_player_name2); } +extern s16 shopItemId; EZTR_MSG_CALLBACK(randoShop) { + u32 shop_location = LOCATION_SHOP_ITEM_ID(shopItemId); + s32 price = rando_get_shop_price(shopItemId); + + EZTR_MsgBuffer_SetFirstItemRupees(buf, price); + + char* item_name; + char* player_name; + rando_get_location_item_name(shop_location, &item_name); + rando_get_location_item_player(shop_location, &player_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + + char* classificationText; + u32 type = rando_get_location_type(shop_location); + if (type & 0b001) { + classificationText = EZTR_CC_COLOR_LIGHTBLUE "Progression Item" EZTR_CC_COLOR_DEFAULT EZTR_CC_END; + } else if (type & 0b010) { + classificationText = EZTR_CC_COLOR_BLUE "Useful Item" EZTR_CC_COLOR_DEFAULT EZTR_CC_END; + } else if (type & 0b100) { + classificationText = EZTR_CC_COLOR_ORANGE "Trap" EZTR_CC_COLOR_DEFAULT EZTR_CC_END; + } else { + classificationText = EZTR_CC_COLOR_SILVER "Filler Item" EZTR_CC_COLOR_DEFAULT EZTR_CC_END; + } + + char forText[128]; + if (!rando_get_location_has_local_item(shop_location)) { + EZTR_MsgSContent_Snprintf( + forText, + 128, + " for" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + forText, + 128, + EZTR_CC_END + ); + } + + char* extraText; + if (shopItemId == SI_POTION_BLUE) { + extraText = EZTR_CC_NEWLINE EZTR_CC_COLOR_LIGHTBLUE "Requires a Magic Mushroom" EZTR_CC_END; + } else { + extraText = EZTR_CC_END; + } + + EZTR_MsgSContent_Sprintf( + buf->data.content, + EZTR_CC_COLOR_RED "%s: %d Rupees" EZTR_CC_NEWLINE + EZTR_CC_COLOR_DEFAULT "This is a %m%m%m" EZTR_CC_PERSISTENT EZTR_CC_END, + item_name, + price, + classificationText, + forText, + extraText + ); + + recomp_free(item_name); + recomp_free(player_name); +} + +EZTR_MSG_CALLBACK(randoShopBuy) { + u32 shop_location = LOCATION_SHOP_ITEM_ID(shopItemId); + s32 price = rando_get_shop_price(shopItemId); + EZTR_MsgBuffer_SetFirstItemRupees(buf, price); + + char* item_name; + rando_get_location_item_name(shop_location, &item_name); + sanitizeRandoText(item_name); + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "%s: %d Rupees" EZTR_CC_NEWLINE + EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN EZTR_CC_TWO_CHOICE + "I'll buy it" EZTR_CC_NEWLINE + "No thanks" EZTR_CC_PERSISTENT EZTR_CC_END, + item_name, + price + ); + + recomp_free(item_name); } EZTR_MSG_CALLBACK(randoScrub) { @@ -1600,20 +1689,10 @@ EZTR_ON_INIT void init_text() { "...But you are not strong enough..." EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "Shall... I send you back?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END "", NULL ); - // EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Tingle), - // EZTR_STANDARD_TEXT_BOX_II, - // 0, - // EZTR_ICON_NO_ICON, - // EZTR_NO_VALUE, - // EZTR_NO_VALUE, - // EZTR_NO_VALUE, - // false, - // "\xBF", - // randoTingle - // ); - EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Shop), + EZTR_Basic_AddCustomText( + EZTR_HNAME(Rando_Shop), EZTR_STANDARD_TEXT_BOX_II, - 0, + 0x30, EZTR_ICON_NO_ICON, EZTR_NO_VALUE, EZTR_NO_VALUE, @@ -1622,6 +1701,18 @@ EZTR_ON_INIT void init_text() { "\xBF", randoShop ); + EZTR_Basic_AddCustomText( + EZTR_HNAME(Rando_Shop_Buying), + EZTR_STANDARD_TEXT_BOX_II, + 0x31, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoShopBuy + ); EZTR_Basic_AddCustomText(EZTR_HNAME(Rando_Scrub), EZTR_STANDARD_TEXT_BOX_II, 0, diff --git a/src/item_text.c b/src/item_text.c index d363006..facb7ae 100644 --- a/src/item_text.c +++ b/src/item_text.c @@ -806,7 +806,7 @@ RECOMP_PATCH void Message_OpenText(PlayState* play, u16 textId) { recomp_free(player2_str); } - // Potion Shop + // Shop Text if ((textId & 0xFF00) == 0x3600 || (textId & 0xFF00) == 0x3700 || (textId == 0x0880 && rando_get_slotdata_u32("shopsanity") && !rando_location_is_checked(0x090002))) { msg = shop_msg; font->msgBuf.schar[0] = 0x06; diff --git a/src/shop_hooks.c b/src/shop_hooks.c index 9ba9692..2fbb3e2 100644 --- a/src/shop_hooks.c +++ b/src/shop_hooks.c @@ -2,32 +2,9 @@ #include "global.h" #include "apcommon.h" -#include "overlays/actors/ovl_En_GirlA/z_en_girla.h" +#include "shops.h" -#define LOCATION_SHOP_ITEM (0x090000 | this->items[this->cursorIndex]->itemParams) -#define LOCATION_FSN_RUPEE (0x070000 | (this->actor.id) << 8 | this->getItemId) - -#define FSN_LIMB_MAX 0x12 -#define ENFSN_LIMB_MAX FSN_LIMB_MAX + 1 // Note: adding 1 to FSN_LIMB_MAX due to bug in the skeleton, see bug in object_fsn.xml -#include "overlays/actors/ovl_En_Fsn/z_en_fsn.h" - -typedef enum { - /* 0 */ ENFSN_CUTSCENESTATE_STOPPED, - /* 1 */ ENFSN_CUTSCENESTATE_WAITING, - /* 2 */ ENFSN_CUTSCENESTATE_PLAYING -} EnFsnCutsceneState; - -#define ANI_LIMB_MAX 0x10 -#define ENOSSAN_LIMB_MAX MAX((s32)FSN_LIMB_MAX + 1, (s32)ANI_LIMB_MAX) -#include "overlays/actors/ovl_En_Ossan/z_en_ossan.h" - -#define ZORA_LIMB_MAX 0x14 -#define BOMB_SHOPKEEPER_LIMB_MAX 0x10 -#define GORON_LIMB_MAX 0x12 -#define ENSOB1_LIMB_MAX MAX(MAX((s32)ZORA_LIMB_MAX, (s32)BOMB_SHOPKEEPER_LIMB_MAX), (s32)GORON_LIMB_MAX) -#include "overlays/actors/ovl_En_Sob1/z_en_sob1.h" - -#include "overlays/actors/ovl_En_Trt/z_en_trt.h" +s16 shopItemId; s32 rando_get_shop_price(u32 shop_item_id) { REPY_FN_SETUP_RANDO; @@ -45,6 +22,8 @@ s32 rando_get_shop_price(u32 shop_item_id) { void EnFsn_SetupResumeInteraction(EnFsn* this, PlayState* play); void EnFsn_PlayerCannotBuy(EnFsn* this, PlayState* play); +EnFsn* sEnFsn; + RECOMP_PATCH void EnFsn_GiveItem(EnFsn* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { if ((this->isSelling == true) && @@ -133,10 +112,36 @@ RECOMP_PATCH void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, PlayState* play) { } } +RECOMP_HOOK("EnFsn_CursorLeftRight") +void PreRandoGrabSelectedItem_EnFsn_CursorLeftRight(EnFsn* this) { + sEnFsn = this; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK_RETURN("EnFsn_CursorLeftRight") +void RandoGrabSelectedItem_EnFsn_CursorLeftRight() { + EnFsn* this = sEnFsn; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK("EnFsn_FaceShopkeeperSelling") +void PreRandoGrabSelectedItem_EnFsn_FaceShopkeeperSelling(EnFsn* this, PlayState* play) { + sEnFsn = this; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK_RETURN("EnFsn_FaceShopkeeperSelling") +void RandoGrabSelectedItem_EnFsn_FaceShopkeeperSelling() { + EnFsn* this = sEnFsn; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + // Trading Post void EnOssan_SetupAction(EnOssan* this, EnOssanActionFunc action); void EnOssan_SetupItemPurchased(EnOssan* this, PlayState* play); +EnOssan* sEnOssan; + extern ShopItem sShops_ovl_En_Ossan[2][8]; RECOMP_HOOK("EnOssan_SpawnShopItems") @@ -177,10 +182,56 @@ RECOMP_PATCH void EnOssan_SetupBuyItemWithFanfare(PlayState* play, EnOssan* this EnOssan_SetupAction(this, EnOssan_BuyItemWithFanfare); } +RECOMP_HOOK("EnOssan_FaceShopkeeper") // grabbing selected item, annoyingly need to hook before and after +void PreRandoGrabSelectedItem_EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { + sEnOssan = this; +} + +RECOMP_HOOK_RETURN("EnOssan_FaceShopkeeper") +void RandoGrabSelectedItem_EnOssan_FaceShopkeeper() { + EnOssan* this = sEnOssan; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK("EnOssan_CursorUpDown") +void PreRandoGrabSelectedItem_EnOssan_CursorUpDown(EnOssan* this) { + sEnOssan = this; +} + +RECOMP_HOOK_RETURN("EnOssan_CursorUpDown") +void RandoGrabSelectedItem_EnOssan_CursorUpDown() { + EnOssan* this = sEnOssan; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK("EnOssan_BrowseLeftShelf") +void PreRandoGrabSelectedItem_EnOssan_BrowseLeftShelf(EnOssan* this, PlayState* play) { + sEnOssan = this; +} + +RECOMP_HOOK_RETURN("EnOssan_BrowseLeftShelf") +void RandoGrabSelectedItem_EnOssan_BrowseLeftShelf() { + EnOssan* this = sEnOssan; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK("EnOssan_BrowseRightShelf") +void PreRandoGrabSelectedItem_EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) { + sEnOssan = this; +} + +RECOMP_HOOK_RETURN("EnOssan_BrowseRightShelf") +void RandoGrabSelectedItem_EnOssan_BrowseRightShelf() { + EnOssan* this = sEnOssan; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + // Zora, Goron, and Bomb void EnSob1_SetupAction(EnSob1* this, EnSob1ActionFunc action); void EnSob1_SetupItemPurchased(EnSob1* this, PlayState* play); +EnSob1* sEnSob1; + extern ShopItem sShops_ovl_En_Sob1[4][3]; RECOMP_HOOK("EnSob1_SpawnShopItems") @@ -221,6 +272,28 @@ RECOMP_PATCH void EnSob1_SetupBuyItemWithFanfare(PlayState* play, EnSob1* this) EnSob1_SetupAction(this, EnSob1_BuyItemWithFanfare); } +RECOMP_HOOK("EnSob1_FaceShopkeeper") +void PreRandoGrabSelectedItem_EnSob1_FaceShopkeeper(EnSob1* this, PlayState* play) { + sEnSob1 = this; +} + +RECOMP_HOOK_RETURN("EnSob1_FaceShopkeeper") +void RandoGrabSelectedItem_EnSob1_FaceShopkeeper() { + EnSob1* this = sEnSob1; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + +RECOMP_HOOK("EnSob1_CursorLeftRight") +void PreRandoGrabSelectedItem_EnSob1_CursorLeftRight(PlayState* play, EnSob1* this) { + sEnSob1 = this; +} + +RECOMP_HOOK_RETURN("EnSob1_CursorLeftRight") +void RandoGrabSelectedItem_EnSob1_CursorLeftRight() { + EnSob1* this = sEnSob1; + shopItemId = this->items[this->cursorIndex]->actor.params; +} + // Kotake void EnTrt_SetupItemGiven(EnTrt* this, PlayState* play); @@ -423,4 +496,10 @@ RECOMP_PATCH void EnTrt_SelectItem(EnTrt* this, PlayState* play) { } } } +} + +RECOMP_HOOK("EnTrt_GetItemTextId") +void RandoGrabSelectedItem_EnTrt_GetItemTextId(EnTrt* this) { + shopItemId = this->items[this->cursorIndex]->actor.params; + // also set/unset free potion flag here } \ No newline at end of file diff --git a/src/shop_item_hooks.c b/src/shop_item_hooks.c index cd7541d..ab06d14 100644 --- a/src/shop_item_hooks.c +++ b/src/shop_item_hooks.c @@ -3,9 +3,11 @@ #include "apcommon.h" +#include "eztr_api.h" +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_Shop); +EZTR_DECLARE_CUSTOM_MSG_HANDLE(Rando_Shop_Buying); + #define LOCATION_SHOP_ITEM (0x090000 | this->actor.params) -#define SHOP_ITEM_TEXT (0x3600 | this->actor.params) -#define SHOP_ITEM_BUY_TEXT (0x3700 | this->actor.params) #include "overlays/actors/ovl_En_GirlA/z_en_girla.h" @@ -188,7 +190,7 @@ RECOMP_PATCH void EnGirlA_InitItem(PlayState* play, EnGirlA* this) { shopObjectLoading[this->actor.params] = false; shopObjectLoaded[this->actor.params] = false; - this->actor.textId = SHOP_ITEM_TEXT; + this->actor.textId = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Shop)); this->isOutOfStock = false; this->actor.draw = EnGirlA_Draw; } @@ -203,7 +205,9 @@ RECOMP_PATCH void EnGirlA_InitalUpdate(EnGirlA* this, PlayState* play) { this->actor.params == SI_SWORD_GILDED )) { s16 trueGI = rando_get_item_id(LOCATION_SHOP_ITEM); - ShopItemEntry item = { getObjectId(trueGI), getGid(trueGI), NULL, 1, SHOP_ITEM_TEXT, SHOP_ITEM_BUY_TEXT, trueGI, EnGirlA_RandoCanBuyFunc, + u16 shopItemText = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Shop)); + u16 shopBuyText = EZTR_GET_CUSTOM_MSG_ID(EZTR_HNAME(Rando_Shop_Buying)); + ShopItemEntry item = { getObjectId(trueGI), getGid(trueGI), NULL, 1, shopItemText, shopBuyText, trueGI, EnGirlA_RandoCanBuyFunc, EnGirlA_RandoBuyFunc, EnGirlA_RandoBuyFanfare }; ShopItemEntry* shopItem = &item; From 6bb1dd00056fb9c981a0e729f12132af977b61ad Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Sat, 30 May 2026 16:12:26 +0100 Subject: [PATCH 11/15] Rewiting of the Tingle text. Code has noticeably less Tingle than before as every tingle is handled by a single callback. --- src/eztr_text.c | 495 ++++++++++++++------------------------------- src/tingle_hooks.c | 7 + 2 files changed, 161 insertions(+), 341 deletions(-) diff --git a/src/eztr_text.c b/src/eztr_text.c index 40dbb28..947391e 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -197,361 +197,174 @@ EZTR_MSG_CALLBACK(randoGIFrogs) { recomp_free(item_name); } - -EZTR_MSG_CALLBACK(randoTingleClockTown) { +extern s16 currentTingle; +EZTR_MSG_CALLBACK(randoTingle) { u32 tingleFirstItem = GI_TINGLE_MAP_CLOCK_TOWN; char* player_name; - char* get_player_name; char* item_name; - char* get_item_name; + u16 price1 = 5; u32 tingleSecondItem = GI_TINGLE_MAP_WOODFALL; char* player_name2; - char* get_player_name2; char* item_name2; - char* get_item_name2; - - char* rupee_cost1; - char* rupee_cost2; - - - rando_get_location_item_player(tingleFirstItem, &get_player_name); - rando_get_location_item_name(tingleFirstItem, &get_item_name); - rando_get_location_item_player(tingleSecondItem, &get_player_name2); - rando_get_location_item_name(tingleSecondItem, &get_item_name2); - - if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; - } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; - } else {player_name = get_player_name; - } - if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; - } else {item_name = get_item_name; - } - if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; - } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; - } else {player_name2 = get_player_name2; - } - if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; - } else {item_name2 = get_item_name2; - } - if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; - } else {rupee_cost1 = "5 Rupees"; - } - if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; - } else {rupee_cost2 = "40 Rupees"; - } - - - - EZTR_MsgSContent_Sprintf( - buf->data.content, - "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", - player_name, - item_name, - rupee_cost1, - player_name2, - item_name2, - rupee_cost2 - ); - - recomp_free(get_item_name); - recomp_free(get_item_name2); - recomp_free(get_player_name); - recomp_free(get_player_name2); + u16 price2 = 40; + +switch (currentTingle) { + case TINGLE_MAP_CLOCK_TOWN: + tingleFirstItem = GI_TINGLE_MAP_CLOCK_TOWN; + tingleSecondItem = GI_TINGLE_MAP_WOODFALL; + price1 = 5; + price2 = 40; + break; + + case TINGLE_MAP_WOODFALL: + tingleFirstItem = GI_TINGLE_MAP_WOODFALL; + tingleSecondItem = GI_TINGLE_MAP_SNOWHEAD; + price1 = 20; + price2 = 40; + break; + + case TINGLE_MAP_SNOWHEAD: + tingleFirstItem = GI_TINGLE_MAP_SNOWHEAD; + tingleSecondItem = GI_TINGLE_MAP_ROMANI_RANCH; + price1 = 20; + price2 = 40; + break; + + case TINGLE_MAP_ROMANI_RANCH: + tingleFirstItem = GI_TINGLE_MAP_ROMANI_RANCH; + tingleSecondItem = GI_TINGLE_MAP_GREAT_BAY; + price1 = 20; + price2 = 40; + break; + + case TINGLE_MAP_GREAT_BAY: + tingleFirstItem = GI_TINGLE_MAP_GREAT_BAY; + tingleSecondItem = GI_TINGLE_MAP_STONE_TOWER; + price1 = 20; + price2 = 40; + break; + + case TINGLE_MAP_STONE_TOWER: + tingleFirstItem = GI_TINGLE_MAP_STONE_TOWER; + tingleSecondItem = GI_TINGLE_MAP_CLOCK_TOWN; + price1 = 20; + price2 = 40; + break; } -EZTR_MSG_CALLBACK(randoTingleWoodfall) { - u32 tingleFirstItem = GI_TINGLE_MAP_WOODFALL; - char* player_name; - char* get_player_name; - char* item_name; - char* get_item_name; - u32 tingleSecondItem = GI_TINGLE_MAP_SNOWHEAD; - char* player_name2; - char* get_player_name2; - char* item_name2; - char* get_item_name2; - - char* rupee_cost1; - char* rupee_cost2; - - rando_get_location_item_player(tingleFirstItem, &get_player_name); - rando_get_location_item_name(tingleFirstItem, &get_item_name); - rando_get_location_item_player(tingleSecondItem, &get_player_name2); - rando_get_location_item_name(tingleSecondItem, &get_item_name2); - - if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; - } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; - } else {player_name = get_player_name; - } - if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; - } else {item_name = get_item_name; - } - if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; - } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; - } else {player_name2 = get_player_name2; - } - if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; - } else {item_name2 = get_item_name2; - } - if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; - } else {rupee_cost1 = "20 Rupees"; - } - if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; - } else {rupee_cost2 = "40 Rupees"; - } + rando_get_location_item_player(tingleFirstItem, &player_name); + rando_get_location_item_name(tingleFirstItem, &item_name); + rando_get_location_item_player(tingleSecondItem, &player_name2); + rando_get_location_item_name(tingleSecondItem, &item_name2); - - - EZTR_MsgSContent_Sprintf( - buf->data.content, - "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, - item_name, - rupee_cost1, - player_name2, - item_name2, - rupee_cost2 - ); - - recomp_free(get_item_name); - recomp_free(get_item_name2); - recomp_free(get_player_name); - recomp_free(get_player_name2); -} -EZTR_MSG_CALLBACK(randoTingleSnowhead) { - u32 tingleFirstItem = GI_TINGLE_MAP_SNOWHEAD; - char* player_name; - char* get_player_name; - char* item_name; - char* get_item_name; - u32 tingleSecondItem = GI_TINGLE_MAP_ROMANI_RANCH; - char* player_name2; - char* get_player_name2; - char* item_name2; - char* get_item_name2; - - char* rupee_cost1; - char* rupee_cost2; - - - rando_get_location_item_player(tingleFirstItem, &get_player_name); - rando_get_location_item_name(tingleFirstItem, &get_item_name); - rando_get_location_item_player(tingleSecondItem, &get_player_name2); - rando_get_location_item_name(tingleSecondItem, &get_item_name2); - - if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; - } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; - } else {player_name = get_player_name; - } - if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; - } else {item_name = get_item_name; - } - if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; - } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; - } else {player_name2 = get_player_name2; - } - if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; - } else {item_name2 = get_item_name2; - } - if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; - } else {rupee_cost1 = "20 Rupees"; - } - if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; - } else {rupee_cost2 = "40 Rupees"; - } - - - - EZTR_MsgSContent_Sprintf( - buf->data.content, - "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, - item_name, - rupee_cost1, - player_name2, - item_name2, - rupee_cost2 - ); - - recomp_free(get_item_name); - recomp_free(get_item_name2); - recomp_free(get_player_name); - recomp_free(get_player_name2); -} -EZTR_MSG_CALLBACK(randoTingleMilkRoad) { - u32 tingleFirstItem = GI_TINGLE_MAP_ROMANI_RANCH; - char* player_name; - char* get_player_name; - char* item_name; - char* get_item_name; - u32 tingleSecondItem = GI_TINGLE_MAP_GREAT_BAY; - char* player_name2; - char* get_player_name2; - char* item_name2; - char* get_item_name2; - - char* rupee_cost1; - char* rupee_cost2; - - - rando_get_location_item_player(tingleFirstItem, &get_player_name); - rando_get_location_item_name(tingleFirstItem, &get_item_name); - rando_get_location_item_player(tingleSecondItem, &get_player_name2); - rando_get_location_item_name(tingleSecondItem, &get_item_name2); - - if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; - } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; - } else {player_name = get_player_name; - } - if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; - } else {item_name = get_item_name; - } - if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; - } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; - } else {player_name2 = get_player_name2; - } - if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; - } else {item_name2 = get_item_name2; - } - if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; - } else {rupee_cost1 = "20 Rupees"; - } - if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; - } else {rupee_cost2 = "40 Rupees"; - } - - - - EZTR_MsgSContent_Sprintf( - buf->data.content, - "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, - item_name, - rupee_cost1, - player_name2, - item_name2, - rupee_cost2 - ); - - recomp_free(get_item_name); - recomp_free(get_item_name2); - recomp_free(get_player_name); - recomp_free(get_player_name2); -} -EZTR_MSG_CALLBACK(randoTingleGreatBay) { - u32 tingleFirstItem = GI_TINGLE_MAP_GREAT_BAY; - char* player_name; - char* get_player_name; - char* item_name; - char* get_item_name; - u32 tingleSecondItem = GI_TINGLE_MAP_STONE_TOWER; - char* player_name2; - char* get_player_name2; - char* item_name2; - char* get_item_name2; - - char* rupee_cost1; - char* rupee_cost2; - - - rando_get_location_item_player(tingleFirstItem, &get_player_name); - rando_get_location_item_name(tingleFirstItem, &get_item_name); - rando_get_location_item_player(tingleSecondItem, &get_player_name2); - rando_get_location_item_name(tingleSecondItem, &get_item_name2); - - if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; - } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; - } else {player_name = get_player_name; + char player_name_with_space1[128]; + if (!rando_get_location_has_local_item(tingleFirstItem) && (!rando_location_is_checked(tingleFirstItem))) { + EZTR_MsgSContent_Snprintf( + player_name_with_space1, + 128, + " %s" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_with_space1, + 128, + EZTR_CC_END + ); } - if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; - } else {item_name = get_item_name; + char player_name_with_space2[128]; + if (!rando_get_location_has_local_item(tingleSecondItem) && (!rando_location_is_checked(tingleSecondItem))) { + EZTR_MsgSContent_Snprintf( + player_name_with_space2, + 128, + " %s" EZTR_CC_END, + player_name2 + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_with_space2, + 128, + EZTR_CC_END + ); } - if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; - } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; - } else {player_name2 = get_player_name2; + char item_sold_out1[128]; + if (!rando_location_is_checked(tingleFirstItem)) { + EZTR_MsgSContent_Snprintf( + item_sold_out1, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_sold_out1, + 128, + EZTR_CC_COLOR_SILVER "SOLD OUT" EZTR_CC_END + ); } - if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; - } else {item_name2 = get_item_name2; + char item_sold_out2[128]; + if (!rando_location_is_checked(tingleSecondItem)) { + EZTR_MsgSContent_Snprintf( + item_sold_out2, + 128, + "%s" EZTR_CC_END, + item_name2 + ); + } else { + EZTR_MsgSContent_Snprintf( + item_sold_out2, + 128, + EZTR_CC_COLOR_SILVER "SOLD OUT" EZTR_CC_END + ); } - if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; - } else {rupee_cost1 = "20 Rupees"; + char remove_rupee_when_checked1[128]; + if (!rando_location_is_checked(tingleFirstItem)) { + EZTR_MsgSContent_Snprintf( + remove_rupee_when_checked1, + 128, + " %d Rupees" EZTR_CC_END, + price1 + ); + } else { + EZTR_MsgSContent_Snprintf( + remove_rupee_when_checked1, + 128, + EZTR_CC_END + ); } - if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; - } else {rupee_cost2 = "40 Rupees"; + char remove_rupee_when_checked2[128]; + if (!rando_location_is_checked(tingleSecondItem)) { + EZTR_MsgSContent_Snprintf( + remove_rupee_when_checked2, + 128, + " %d Rupees" EZTR_CC_END, + price2 + ); + } else { + EZTR_MsgSContent_Snprintf( + remove_rupee_when_checked2, + 128, + EZTR_CC_END + ); } - - - EZTR_MsgSContent_Sprintf( buf->data.content, - "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, - item_name, - rupee_cost1, - player_name2, - item_name2, - rupee_cost2 + EZTR_CC_THREE_CHOICE EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_LIGHTBLUE "%m" EZTR_CC_COLOR_RED "%m" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_LIGHTBLUE "%m" EZTR_CC_COLOR_RED "%m" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END, + item_sold_out1, + player_name_with_space1, + remove_rupee_when_checked1, + item_sold_out2, + player_name_with_space2, + remove_rupee_when_checked2 ); - - recomp_free(get_item_name); - recomp_free(get_item_name2); - recomp_free(get_player_name); - recomp_free(get_player_name2); -} -EZTR_MSG_CALLBACK(randoTingleStoneTower) { - u32 tingleFirstItem = GI_TINGLE_MAP_STONE_TOWER; - char* player_name; - char* get_player_name; - char* item_name; - char* get_item_name; - u32 tingleSecondItem = GI_TINGLE_MAP_CLOCK_TOWN; - char* player_name2; - char* get_player_name2; - char* item_name2; - char* get_item_name2; - - char* rupee_cost1; - char* rupee_cost2; - - rando_get_location_item_player(tingleFirstItem, &get_player_name); - rando_get_location_item_name(tingleFirstItem, &get_item_name); - rando_get_location_item_player(tingleSecondItem, &get_player_name2); - rando_get_location_item_name(tingleSecondItem, &get_item_name2); - - if (rando_location_is_checked(tingleFirstItem) == true) {player_name = ""; - } else if (rando_get_location_has_local_item(tingleFirstItem) == true) {player_name = ""; - } else {player_name = get_player_name; - } - if (rando_location_is_checked(tingleFirstItem) == true) {item_name = "SOLD OUT"; - } else {item_name = get_item_name; - } - if (rando_location_is_checked(tingleSecondItem) == true) {player_name2 = ""; - } else if (rando_get_location_has_local_item(tingleSecondItem) == true) {player_name2 = ""; - } else {player_name2 = get_player_name2; - } - if (rando_location_is_checked(tingleSecondItem) == true) {item_name2 = "SOLD OUT"; - } else {item_name2 = get_item_name2; - } - if (rando_location_is_checked(tingleFirstItem) == true) {rupee_cost1 = ""; - } else {rupee_cost1 = "20 Rupees"; - } - if (rando_location_is_checked(tingleSecondItem) == true) {rupee_cost2 = ""; - } else {rupee_cost2 = "40 Rupees"; - } - - - - EZTR_MsgSContent_Sprintf( - buf->data.content, - "" EZTR_CC_THREE_CHOICE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_LIGHTBLUE "%s " EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_RED " %s" EZTR_CC_NEWLINE "" EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END "", player_name, - item_name, - rupee_cost1, - player_name2, - item_name2, - rupee_cost2 - ); + recomp_free(item_name); + recomp_free(item_name2); + recomp_free(player_name); + recomp_free(player_name2); - recomp_free(get_item_name); - recomp_free(get_item_name2); - recomp_free(get_player_name); - recomp_free(get_player_name2); } extern s16 shopItemId; @@ -1233,7 +1046,7 @@ EZTR_ON_INIT void init_text() { 40, true, "\xBF", - randoTingleClockTown + randoTingle ); // Path to Swamp Tingle (Woodfall) EZTR_Basic_ReplaceText( @@ -1246,7 +1059,7 @@ EZTR_ON_INIT void init_text() { 40, true, "\xBF", - randoTingleWoodfall + randoTingle ); // Twin Islands Tingle (Snowhead) EZTR_Basic_ReplaceText( @@ -1259,7 +1072,7 @@ EZTR_ON_INIT void init_text() { 40, true, "\xBF", - randoTingleSnowhead + randoTingle ); // Milk Road Tingle EZTR_Basic_ReplaceText( @@ -1272,7 +1085,7 @@ EZTR_ON_INIT void init_text() { 40, true, "\xBF", - randoTingleMilkRoad + randoTingle ); // Great Bay Coast Tingle EZTR_Basic_ReplaceText( @@ -1285,7 +1098,7 @@ EZTR_ON_INIT void init_text() { 40, true, "\xBF", - randoTingleGreatBay + randoTingle ); // Ikana Canyon Tingle EZTR_Basic_ReplaceText( @@ -1298,7 +1111,7 @@ EZTR_ON_INIT void init_text() { 40, true, "\xBF", - randoTingleStoneTower + randoTingle ); diff --git a/src/tingle_hooks.c b/src/tingle_hooks.c index 3f36435..a0631da 100644 --- a/src/tingle_hooks.c +++ b/src/tingle_hooks.c @@ -26,4 +26,11 @@ RECOMP_PATCH s32 EnBal_CheckIfMapUnlocked(EnBal* this, PlayState* play) { } RECOMP_PATCH void EnBal_UnlockSelectedAreaMap(EnBal* this) { +} + +s16 currentTingle; + +RECOMP_HOOK("EnBal_HandleConversation") +void WhoIsThisTingle(EnBal* this, PlayState* play) { + currentTingle = this->locationMapId; } \ No newline at end of file From 144bb8243f3034417b936cb38b07e9be9707b53f Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Tue, 2 Jun 2026 04:01:46 +0100 Subject: [PATCH 12/15] Sanitized all item and player names, added Scrub text, Milk Bar text, hints for the Ikana gravestones and lottery checks --- src/akindonuts_hooks.c | 7 + src/eztr_text.c | 766 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 769 insertions(+), 4 deletions(-) diff --git a/src/akindonuts_hooks.c b/src/akindonuts_hooks.c index 772f486..9e23ead 100644 --- a/src/akindonuts_hooks.c +++ b/src/akindonuts_hooks.c @@ -291,4 +291,11 @@ RECOMP_PATCH void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { this->unk_35E = 2; } this->unk_356++; +} + +s16 currentScrub; + +RECOMP_HOOK("func_80BEEE10") +void WhoIsThisScrub(Actor* thisx, PlayState* play) { + currentScrub = ENAKINDONUTS_GET_3(thisx); } \ No newline at end of file diff --git a/src/eztr_text.c b/src/eztr_text.c index 947391e..612028e 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -94,6 +94,8 @@ EZTR_MSG_CALLBACK(randoAPSend) { rando_get_location_item_player(location, &player_name); rando_get_location_item_name(location, &item_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); EZTR_MsgSContent_Sprintf( buf->data.content, @@ -112,6 +114,7 @@ EZTR_MSG_CALLBACK(randoAPSelf) { char* item_name; rando_get_location_item_name(location, &item_name); + sanitizeRandoText(item_name); EZTR_MsgSContent_Sprintf( buf->data.content, @@ -127,6 +130,7 @@ EZTR_MSG_CALLBACK(randoGIOwlStatue) { char* item_name; rando_get_location_item_name(location, &item_name); + sanitizeRandoText(item_name); EZTR_MsgSContent_Sprintf( buf->data.content, @@ -142,6 +146,7 @@ EZTR_MSG_CALLBACK(randoGISongs) { char* item_name; rando_get_location_item_name(location, &item_name); + sanitizeRandoText(item_name); EZTR_MsgSContent_Sprintf( buf->data.content, @@ -171,6 +176,7 @@ EZTR_MSG_CALLBACK(randoGISouls) { char* item_name; rando_get_location_item_name(location, &item_name); + sanitizeRandoText(item_name); EZTR_MsgSContent_Sprintf( buf->data.content, @@ -186,6 +192,7 @@ EZTR_MSG_CALLBACK(randoGIFrogs) { char* item_name; rando_get_location_item_name(location, &item_name); + sanitizeRandoText(item_name); EZTR_MsgSContent_Sprintf( buf->data.content, @@ -256,13 +263,17 @@ switch (currentTingle) { rando_get_location_item_name(tingleFirstItem, &item_name); rando_get_location_item_player(tingleSecondItem, &player_name2); rando_get_location_item_name(tingleSecondItem, &item_name2); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + sanitizeRandoText(item_name2); + sanitizeRandoText(player_name2); char player_name_with_space1[128]; if (!rando_get_location_has_local_item(tingleFirstItem) && (!rando_location_is_checked(tingleFirstItem))) { EZTR_MsgSContent_Snprintf( player_name_with_space1, 128, - " %s" EZTR_CC_END, + " (" EZTR_CC_COLOR_LIGHTBLUE "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, player_name ); } else { @@ -277,7 +288,7 @@ switch (currentTingle) { EZTR_MsgSContent_Snprintf( player_name_with_space2, 128, - " %s" EZTR_CC_END, + " (" EZTR_CC_COLOR_LIGHTBLUE "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, player_name2 ); } else { @@ -349,8 +360,8 @@ switch (currentTingle) { } EZTR_MsgSContent_Sprintf( buf->data.content, - EZTR_CC_THREE_CHOICE EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_LIGHTBLUE "%m" EZTR_CC_COLOR_RED "%m" EZTR_CC_NEWLINE - EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_LIGHTBLUE "%m" EZTR_CC_COLOR_RED "%m" EZTR_CC_NEWLINE + EZTR_CC_THREE_CHOICE EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_COLOR_PINK "%m" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_COLOR_PINK "%m" EZTR_CC_NEWLINE EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END, item_sold_out1, player_name_with_space1, @@ -456,12 +467,244 @@ EZTR_MSG_CALLBACK(randoShopBuy) { recomp_free(item_name); } +#define LOCATION_SCRUB_SHOP(item) (0x090100 | item) + +extern s16 currentScrub; EZTR_MSG_CALLBACK(randoScrub) { + u32 scrubLocation = LOCATION_SCRUB_SHOP(GI_MAGIC_BEANS); + char* player_name; + char* item_name; + u16 price = 5; + char vanilla_scrub_text[256]; + switch (currentScrub) { + case 0: + scrubLocation = LOCATION_SCRUB_SHOP(GI_MAGIC_BEANS); + price = 10; + EZTR_MsgSContent_Snprintf( + vanilla_scrub_text, + 256, + EZTR_CC_SFX "|3A|D2Do you know what " EZTR_CC_COLOR_GREEN "magic beans" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "are, sir?" + EZTR_CC_NEWLINE "I'll sell you one for " EZTR_CC_COLOR_PINK "10 Rupees" EZTR_CC_COLOR_DEFAULT "." EZTR_CC_EVENT "" EZTR_CC_END "", + NULL + ); + break; + case 1: + scrubLocation = LOCATION_SCRUB_SHOP(GI_BOMB_BAG_40); + price = 200; + EZTR_MsgSContent_Snprintf( + vanilla_scrub_text, + 256, + EZTR_CC_SFX "|38|81I'll give you my Biggest Bomb Bag," + EZTR_CC_NEWLINE "regularly priced at " EZTR_CC_COLOR_PINK "1000 Rupees" EZTR_CC_COLOR_DEFAULT "..." + EZTR_CC_NEWLINE "" EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "In return, you'll give me your " EZTR_CC_COLOR_RED "Big" + EZTR_CC_NEWLINE "Bomb Bag " EZTR_CC_COLOR_DEFAULT "and just " EZTR_CC_COLOR_PINK "200 Rupees" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_EVENT "" EZTR_CC_END "", + NULL + ); + break; + case 2: + scrubLocation = LOCATION_SCRUB_SHOP(GI_POTION_GREEN); + price = 40; + EZTR_MsgSContent_Snprintf( + vanilla_scrub_text, + 256, + EZTR_CC_SFX "|39|8CI'll sell you a " EZTR_CC_COLOR_GREEN "Green Potion" EZTR_CC_COLOR_DEFAULT " for" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_PINK "40 Rupees" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_EVENT2 "" EZTR_CC_END "", + NULL + ); + break; + case 3: + scrubLocation = LOCATION_SCRUB_SHOP(GI_POTION_BLUE); + price = 100; + EZTR_MsgSContent_Snprintf( + vanilla_scrub_text, + 256, + EZTR_CC_SFX "|3A|D2Don't you need any " EZTR_CC_COLOR_BLUE "Blue Potion" EZTR_CC_COLOR_DEFAULT " in" + EZTR_CC_NEWLINE "case you get cursed?" + EZTR_CC_NEWLINE "One drink is " EZTR_CC_COLOR_PINK "100 Rupees" EZTR_CC_COLOR_DEFAULT "." EZTR_CC_EVENT "" EZTR_CC_END "", + NULL + ); + break; + } + + if (rando_get_slotdata_u32("scrubsanity") && !rando_location_is_checked(scrubLocation)) { + rando_get_location_item_player(scrubLocation, &player_name); + rando_get_location_item_name(scrubLocation, &item_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + + // SANITIZE PLAYER AND ITEM NAMES HERE + + char player_name_when_nonlocal[128]; + if (!rando_get_location_has_local_item(scrubLocation) && (!rando_location_is_checked(scrubLocation))) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_NEWLINE "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_END + ); + } + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "For " EZTR_CC_COLOR_PINK "%d Rupees" EZTR_CC_COLOR_DEFAULT ", I'm selling" + EZTR_CC_NEWLINE "%c%s" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_EVENT "" EZTR_CC_END, + price, + getAPItemColor(scrubLocation), + item_name, + player_name_when_nonlocal + ); + + recomp_free(item_name); + recomp_free(player_name); + } else { + EZTR_MsgSContent_Sprintf( + buf->data.content, + "%m" EZTR_CC_EVENT "" EZTR_CC_END, + vanilla_scrub_text + ); + } } +// #define LOCATION_MILK (ACTOR_ID_BARTEN << 8 | GI_MILK) +#define MILK_BAR_LOCATION_CHATEAU GI_CHATEAU + EZTR_MSG_CALLBACK(randoMilkBar) { + u32 milkBarFirstItem = 0x026392; // Regular Milk Purchase check ID + char* player_name; + char* item_name; + u16 price1 = 20; + u32 milkBarSecondItem = MILK_BAR_LOCATION_CHATEAU; + char* player_name2; + char* item_name2; + u16 price2 = 200; + + rando_get_location_item_player(milkBarFirstItem, &player_name); + rando_get_location_item_name(milkBarFirstItem, &item_name); + rando_get_location_item_player(milkBarSecondItem, &player_name2); + rando_get_location_item_name(milkBarSecondItem, &item_name2); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + sanitizeRandoText(item_name2); + sanitizeRandoText(player_name2); + + char player_name_with_space1[128]; + if (!rando_get_location_has_local_item(milkBarFirstItem) && (!rando_location_is_checked(milkBarFirstItem))) { + EZTR_MsgSContent_Snprintf( + player_name_with_space1, + 128, + " (" EZTR_CC_COLOR_LIGHTBLUE "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_with_space1, + 128, + EZTR_CC_END + ); + } + char player_name_with_space2[128]; + if (!rando_get_location_has_local_item(milkBarSecondItem) && (!rando_location_is_checked(milkBarSecondItem))) { + EZTR_MsgSContent_Snprintf( + player_name_with_space2, + 128, + " (" EZTR_CC_COLOR_LIGHTBLUE "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name2 + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_with_space2, + 128, + EZTR_CC_END + ); + } + char item_sold_already1[128]; + if (!rando_location_is_checked(milkBarFirstItem)) { + EZTR_MsgSContent_Snprintf( + item_sold_already1, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_sold_already1, + 128, + EZTR_CC_COLOR_GREEN "Regular Milk:" EZTR_CC_END + ); + } + char item_sold_already2[128]; + if (!rando_location_is_checked(milkBarSecondItem)) { + EZTR_MsgSContent_Snprintf( + item_sold_already2, + 128, + "%s" EZTR_CC_END, + item_name2 + ); + } else { + EZTR_MsgSContent_Snprintf( + item_sold_already2, + 128, + EZTR_CC_COLOR_GREEN "Chateau:" EZTR_CC_END + ); + } + char rupee_cost1[128]; + if (!rando_location_is_checked(milkBarFirstItem)) { + EZTR_MsgSContent_Snprintf( + rupee_cost1, + 128, + " %d Rupees" EZTR_CC_END, + price1 + ); + } else { + EZTR_MsgSContent_Snprintf( + rupee_cost1, + 128, + " 20 Rupees" EZTR_CC_END + ); + } + char rupee_cost2[128]; + if (!rando_location_is_checked(milkBarSecondItem)) { + EZTR_MsgSContent_Snprintf( + rupee_cost2, + 128, + " %d Rupees" EZTR_CC_END, + price2 + ); + } else { + EZTR_MsgSContent_Snprintf( + rupee_cost2, + 128, + " 200 Rupees" EZTR_CC_END + ); + } + EZTR_MsgSContent_Sprintf( + buf->data.content, + "What'll it be?" + EZTR_CC_CARRIAGE_RETURN EZTR_CC_CARRIAGE_RETURN EZTR_CC_NEWLINE + EZTR_CC_BOX_BREAK2 EZTR_CC_THREE_CHOICE EZTR_CC_COLOR_GREEN "%m:" EZTR_CC_COLOR_PINK "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "%m:" EZTR_CC_COLOR_PINK "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "Nothing" EZTR_CC_END, + item_sold_already1, + rupee_cost1, + player_name_with_space1, + item_sold_already2, + rupee_cost2, + player_name_with_space2 + ); + recomp_free(item_name); + recomp_free(item_name2); + recomp_free(player_name); + recomp_free(player_name2); + } EZTR_MSG_CALLBACK(WoodfallStrayFairyCount) { @@ -968,9 +1211,512 @@ EZTR_MSG_CALLBACK(randoPictograph) { EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } } +EZTR_MSG_CALLBACK(randoLotterySignHint) { + u32 lotteryItem = LOCATION_LOTTERY_SHOP; + char* player_name; + char* item_name; + + rando_get_location_item_player(lotteryItem, &player_name); + rando_get_location_item_name(lotteryItem, &item_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + + char player_name_when_nonlocal[128]; + if (!rando_get_location_has_local_item(lotteryItem) && (!rando_location_is_checked(lotteryItem))) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_END + ); + } + char item_is_checked[128]; + if (!rando_location_is_checked(lotteryItem)) { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + EZTR_CC_COLOR_SILVER "50 Rupees" EZTR_CC_END + ); + } + char* lotteryItemClass; + u32 type = rando_get_location_type(lotteryItem); + if (type & 0b001) { + lotteryItemClass = EZTR_CC_COLOR_LIGHTBLUE "" EZTR_CC_END; + } else if (type & 0b010) { + lotteryItemClass = EZTR_CC_COLOR_BLUE "" EZTR_CC_END; + } else if (type & 0b100) { + lotteryItemClass = EZTR_CC_COLOR_ORANGE "" EZTR_CC_END; + } else { + lotteryItemClass = EZTR_CC_COLOR_SILVER "" EZTR_CC_END; + } + EZTR_MsgSContent_Sprintf( + buf->data.content, + " Lottery Shop" + EZTR_CC_NEWLINE "Grand Prize:" + EZTR_CC_NEWLINE "%m%m" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + lotteryItemClass, + item_is_checked, + player_name_when_nonlocal + ); + + recomp_free(item_name); + recomp_free(player_name); + +} +EZTR_MSG_CALLBACK(randoLotteryNPCHint) { + u32 lotteryItem = LOCATION_LOTTERY_SHOP; + char* player_name; + char* item_name; + + rando_get_location_item_player(lotteryItem, &player_name); + rando_get_location_item_name(lotteryItem, &item_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + + char player_name_when_nonlocal[128]; + if (!rando_get_location_has_local_item(lotteryItem) && (!rando_location_is_checked(lotteryItem))) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_END + ); + } + char item_is_checked[128]; + if (!rando_location_is_checked(lotteryItem)) { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + EZTR_CC_COLOR_SILVER "50 Rupees" EZTR_CC_COLOR_DEFAULT "." EZTR_CC_END + ); + } + char* lotteryItemClass; + u32 type = rando_get_location_type(lotteryItem); + if (type & 0b001) { + lotteryItemClass = EZTR_CC_COLOR_LIGHTBLUE "" EZTR_CC_END; + } else if (type & 0b010) { + lotteryItemClass = EZTR_CC_COLOR_BLUE "" EZTR_CC_END; + } else if (type & 0b100) { + lotteryItemClass = EZTR_CC_COLOR_ORANGE "" EZTR_CC_END; + } else { + lotteryItemClass = EZTR_CC_COLOR_SILVER "" EZTR_CC_END; + } + EZTR_MsgSContent_Sprintf( + buf->data.content, + "Would you like the chance to buy" + EZTR_CC_NEWLINE "your dreams for " EZTR_CC_COLOR_PINK "10 Rupees" EZTR_CC_COLOR_DEFAULT "?" + EZTR_CC_NEWLINE "" EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "Pick any three numbers, and if" + EZTR_CC_NEWLINE "those are picked, you'll win" + EZTR_CC_NEWLINE "%m%m" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + lotteryItemClass, + item_is_checked, + player_name_when_nonlocal + ); + + recomp_free(item_name); + recomp_free(player_name); + +} +EZTR_MSG_CALLBACK(randoGrave1Hint) { + u32 location1 = 0x0000A2; // Graveyard Day 1 Iron Knuckle Song + char* player_name; + char* item_name; + u32 location2 = 0x060C03; // Graveyard Day 1 Bats Chest + char* player_name2; + char* item_name2; + rando_get_location_item_player(location1, &player_name); + rando_get_location_item_name(location1, &item_name); + rando_get_location_item_player(location2, &player_name2); + rando_get_location_item_name(location2, &item_name2); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + sanitizeRandoText(item_name2); + sanitizeRandoText(player_name2); + + char player_name_when_nonlocal[128]; + if (!rando_get_location_has_local_item(location1)) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_END + ); + } + char item_is_checked[128]; + if (!rando_location_is_checked(location1)) { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + EZTR_CC_COLOR_SILVER "nothing" EZTR_CC_END + ); + } + char player_name_when_nonlocal2[128]; + if (!rando_get_location_has_local_item(location2)) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal2, + 128, + "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name2 + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal2, + 128, + EZTR_CC_END + ); + } + char item_is_checked2[128]; + if (!rando_location_is_checked(location2)) { + EZTR_MsgSContent_Snprintf( + item_is_checked2, + 128, + "%s" EZTR_CC_END, + item_name2 + ); + } else { + EZTR_MsgSContent_Snprintf( + item_is_checked2, + 128, + EZTR_CC_COLOR_SILVER "nothing" EZTR_CC_END + ); + } + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "Hear lies the melody that" + EZTR_CC_NEWLINE "summons the tears of" + EZTR_CC_NEWLINE "%c%m" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" + EZTR_CC_NEWLINE EZTR_CC_BOX_BREAK2 "Those who defeat the" + EZTR_CC_NEWLINE "evil will find" + EZTR_CC_NEWLINE "%c%m" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + getAPItemColor(location1), + item_is_checked, + player_name_when_nonlocal, + getAPItemColor(location2), + item_is_checked2, + player_name_when_nonlocal2 + ); + + recomp_free(item_name); + recomp_free(player_name); + recomp_free(item_name2); + recomp_free(player_name2); + +} +EZTR_MSG_CALLBACK(randoGrave2Hint) { + u32 location1 = 0x060C00; // Graveyard Day 2 Iron Knuckle Chest + char* player_name; + char* item_name; + + rando_get_location_item_player(location1, &player_name); + rando_get_location_item_name(location1, &item_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + + char player_name_when_nonlocal[128]; + if (!rando_get_location_has_local_item(location1)) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_END + ); + } + char item_is_checked[128]; + if (!rando_location_is_checked(location1)) { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + EZTR_CC_COLOR_SILVER "nothing" EZTR_CC_END + ); + } + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "Those who possess eyes that can" + EZTR_CC_NEWLINE "see the truth will find" + EZTR_CC_NEWLINE "%c%m" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + getAPItemColor(location1), + item_is_checked, + player_name_when_nonlocal + ); + + recomp_free(item_name); + recomp_free(player_name); + +} +EZTR_MSG_CALLBACK(randoGrave3Hint) { + u32 location1 = 0x063000; // Graveyard Day 3 Dampe Big Poe Chest + char* player_name; + char* item_name; + + rando_get_location_item_player(location1, &player_name); + rando_get_location_item_name(location1, &item_name); + sanitizeRandoText(item_name); + sanitizeRandoText(player_name); + + char player_name_when_nonlocal[128]; + if (!rando_get_location_has_local_item(location1)) { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + player_name + ); + } else { + EZTR_MsgSContent_Snprintf( + player_name_when_nonlocal, + 128, + EZTR_CC_END + ); + } + char item_is_checked[128]; + if (!rando_location_is_checked(location1)) { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + "%s" EZTR_CC_END, + item_name + ); + } else { + EZTR_MsgSContent_Snprintf( + item_is_checked, + 128, + EZTR_CC_COLOR_SILVER "nothing" EZTR_CC_END + ); + } + + EZTR_MsgSContent_Sprintf( + buf->data.content, + "Bringing light to the darkness" + EZTR_CC_NEWLINE "will reveal to you" + EZTR_CC_NEWLINE "%c%m" + EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + getAPItemColor(location1), + item_is_checked, + player_name_when_nonlocal + ); + + recomp_free(item_name); + recomp_free(player_name); + +} // Replacements of existing IDs EZTR_ON_INIT void init_text() { + EZTR_Basic_ReplaceText( + 0x13F9, // Night 1 Ikana Gravestone + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoGrave1Hint +); +EZTR_Basic_ReplaceText( + 0x13FB, // Night 2 Ikana Gravestone + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoGrave2Hint +); +EZTR_Basic_ReplaceText( + 0x13FA, // Night 3 Ikana Gravestone + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoGrave3Hint +); + EZTR_Basic_ReplaceText( + 0x1C13, // Lottery Shop sign + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoLotterySignHint + ); + EZTR_Basic_ReplaceText( + 0x2B5C, // Lottery Shop NPC + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoLotteryNPCHint + ); + EZTR_Basic_ReplaceText( + 0x15E9, // Magic Bean Scrub + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x15F3, // Magic Bean Scrub in new home + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x1600, // Bomb Bag Scrub + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x1606, // Bomb Bag Scrub in new home + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x1612, // Green Potion Scrub + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x1617, // Green Potion Scrub in new home + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x1626, // Blue Potion Scrub + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); + EZTR_Basic_ReplaceText( + 0x162D, // Blue Potion Scrub in new home + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoScrub + ); EZTR_Basic_ReplaceText( 0x353C, // Fast Dog EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, @@ -1034,6 +1780,18 @@ EZTR_ON_INIT void init_text() { "\xBF", randoPictograph ); + EZTR_Basic_ReplaceText( + 0x2B0B, + EZTR_STANDARD_TEXT_BOX_II, + 1, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + 20, + 200, + true, + "\xBF", + randoMilkBar + ); // Tingle Text // North Clock Town Tingle EZTR_Basic_ReplaceText( From ed86dae7f041f2e5392ec4eb91d038de2bb5b21a Mon Sep 17 00:00:00 2001 From: Hyped Date: Wed, 3 Jun 2026 02:35:32 -0700 Subject: [PATCH 13/15] remove item_text.c deal with the consequences later --- src/eztr_text.c | 67 ++- src/item_text.c | 1335 ----------------------------------------------- 2 files changed, 49 insertions(+), 1353 deletions(-) delete mode 100644 src/item_text.c diff --git a/src/eztr_text.c b/src/eztr_text.c index 612028e..e85cec8 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -12,24 +12,6 @@ extern GetItemEntryAP sGetItemTable_ap[]; -// old defines that I didn't use -// #define RANDO_AP_ITEM "\xFF" -// #define RANDO_AP_PLAYER "\xFE" -// #define RANDO_AP_COLOR "\xFD" - -// sets colours for AP item class. probably doesn't work -// u8 getAPItemColor(u32 location) { -// switch (rando_get_location_type(location)) { -// case 1: return 0x05; // EZTR_CC_COLOR_LIGHTBLUE; // progression - purple -// case 2: return 0x03; // EZTR_CC_COLOR_BLUE; // useful - blue -// case 3: return 0x08; // EZTR_CC_COLOR_ORANGE; // trap - orange -// case 0: -// default: return 0x07; // EZTR_CC_COLOR_SILVER; // filler - grey -// } -// } - -void sanitizeRandoText(char* rando_string); - u8 getAPItemColor(u32 location) { u32 type = rando_get_location_type(location); if (type & 0b001) { @@ -43,6 +25,55 @@ u8 getAPItemColor(u32 location) { } } +void sanitizeRandoText(char* rando_string) { + u8 c = rando_string[0]; + u8 next = 0; + u8 i = 0; + bool shift_string = false; + + while (c != 0) { + if (c <= 0x08 || (c >= 0x0A && c <= 0x1F) || (c >= 0xB0 && c <= 0xBB) || (c >= 0xBF && c <= 0xE8) || (c >= 0xF0 && c <= 0xFF)) { + next = rando_string[i+1]; + if (c == 0xC3 && next == 0xA1) { // á + rando_string[i] = 0x98; + shift_string = true; + } else { + rando_string[i] = 0xAE; // replace all invalid bytes with ¿ + } + } + + if (shift_string) { + u8 new_i = i + 1; + u8 new_c = rando_string[new_i]; + u8 new_next = rando_string[new_i + 1]; + while (new_c != 0) { + rando_string[new_i] = new_next; + new_i++; + new_c = rando_string[new_i]; + new_next = rando_string[new_i + 1]; + } + shift_string = false; + } + + i++; + c = rando_string[i]; + } +} + +RECOMP_HOOK_RETURN("Message_OpenText") +void Post_Message_OpenText() { + PlayState* play = gPlay; + MessageContext* msgCtx = &play->msgCtx; + + // QoL: let us skip all text + msgCtx->textUnskippable = false; + + // below is if we specifically need to unset skippable text from the original function + // if ((msgCtx->unk11F0C == 1) || (msgCtx->unk11F0C == 3)) { + // msgCtx->textUnskippable = false; + // } +} + EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Send_Item); // "You sent [player] their [item]" EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_Self_Item); // "You found your [item]" EZTR_DEFINE_CUSTOM_MSG_HANDLE(Rando_GI_Kokiri_Sword); diff --git a/src/item_text.c b/src/item_text.c deleted file mode 100644 index facb7ae..0000000 --- a/src/item_text.c +++ /dev/null @@ -1,1335 +0,0 @@ -#include "modding.h" - -#include "apcommon.h" - -#include "z64snap.h" - -#define TINGLE_LOCATION_BASE 0xB4 -#define SCRUB_LOCATION_BASE 0x090100 -#define MILK_BAR_LOCATION_MILK 0x090100 | GI_MILK -#define MILK_BAR_LOCATION_CHATEAU GI_CHATEAU - -void Message_OpenText(PlayState* play, u16 textId); - -void sanitizeRandoText(char* rando_string) { - u8 c = rando_string[0]; - u8 next = 0; - u8 i = 0; - bool shift_string = false; - - while (c != 0) { - if (c <= 0x08 || (c >= 0x0A && c <= 0x1F) || (c >= 0xB0 && c <= 0xBB) || (c >= 0xBF && c <= 0xE8) || (c >= 0xF0 && c <= 0xFF)) { - next = rando_string[i+1]; - if (c == 0xC3 && next == 0xA1) { // á - rando_string[i] = 0x98; - shift_string = true; - } else { - rando_string[i] = 0xAE; // replace all invalid bytes with ¿ - } - } - - if (shift_string) { - u8 new_i = i + 1; - u8 new_c = rando_string[new_i]; - u8 new_next = rando_string[new_i + 1]; - while (new_c != 0) { - rando_string[new_i] = new_next; - new_i++; - new_c = rando_string[new_i]; - new_next = rando_string[new_i + 1]; - } - shift_string = false; - } - - i++; - c = rando_string[i]; - } -} - -RECOMP_PATCH void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor) { - MessageContext* msgCtx = &play->msgCtx; - msgCtx->ocarinaAction = 0xFFFF; - Message_OpenText(play, textId); - msgCtx->talkActor = actor; - msgCtx->msgMode = MSGMODE_TEXT_START; - msgCtx->stateTimer = 0; - msgCtx->textDelayTimer = 0; - play->msgCtx.ocarinaMode = OCARINA_MODE_NONE; -} - -#undef SEGMENT_ROM_START -#define SEGMENT_ROM_START(segment) (_ ## segment ## SegmentRomStart) - -extern u8 D_801C6A70; -extern s32 sCharTexSize; -extern s32 sCharTexScale; -extern s32 D_801F6B08; - -static unsigned char ap_msg[128]; -static unsigned char self_msg[128]; -static unsigned char ctsf_msg[128] = "You found\x08 Clock Town's\x06 Stray Fairy\x00!\xbf"; -static unsigned char wfsf_msg[128] = "You found a\x02 Woodfall\x06 Stray Fairy\x00!\xbf"; -static unsigned char shsf_msg[128] = "You found a\x05 Snowhead\x06 Stray Fairy\x00!\xbf"; -static unsigned char gbsf_msg[128] = "You found a\x03 Great Bay\x06 Stray Fairy\x00!\xbf"; -static unsigned char stsf_msg[128] = "You found a\x04 Stone Tower\x06 Stray Fairy\x00!\xbf"; -static unsigned char sot_msg[128] = "You got the\x05 Song of Time\x00!\xbf"; -static unsigned char soh_msg[128] = "You got the\x05 Song of Healing\x00!\xbf"; -static unsigned char es_msg[128] = "You got\x05 Epona's Song\x00!\xbf"; -static unsigned char sost_msg[128] = "You got the\x05 Song of Storms\x00!\xbf"; -static unsigned char sos_msg[128] = "You got the\x05 Song of Soaring\x00!\xbf"; -static unsigned char soa_msg[128] = "You got the\x05 Sonata of Awakening\x00!\xbf"; -static unsigned char gl_msg[128] = "You got the\x05 Goron's Lullaby\x00!\xbf"; -static unsigned char nwbn_msg[128] = "You got the\x05 New Wave Bossa Nova\x00!\xbf"; -static unsigned char eoe_msg[128] = "You got the\x05 Elegy of Emptiness\x00!\xbf"; -static unsigned char oto_msg[128] = "You got the\x05 Oath to Order\x00!\xbf"; -static unsigned char ssht_msg[128] = "You got a\x02 Swamp Token\x00!\xbf"; -static unsigned char osht_msg[128] = "You got an\x03 Ocean Token\x00!\xbf"; -static unsigned char sword_msg[128] = "You got the\x01 Kokiri Sword\x00!\xbf"; -static unsigned char spin_msg[128] = "You mastered the\x01 Spin Attack\x00!\xbf"; -static unsigned char magic_msg[128] = "You've been granted\x01 Magic Power\x00!\xbf"; -static unsigned char sk_msg[128] = "You got a\x01 Small Key\x00! \xbf"; -static unsigned char bk_msg[128] = "You got the\x01 Boss Key\x00! \xbf"; -static unsigned char map_msg[128] = "You found a\x01 Map\x00! \xbf"; -static unsigned char compass_msg[128] = "You found a\x01 Compass\x00! \xbf"; -static unsigned char bb_msg[128] = "You found a\x05 Bombchu Bag\x00! \xbf"; - -static unsigned char p_monkey_msg[128] = "Keep this\x01 picture of a monkey\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_big_octo_msg[128] = "Keep this\x01 picture of a Big Octo\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_lulu_good_msg[128] = "Keep this\x01 good picture of Lulu\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_lulu_bad_msg[128] = "Keep this\x01 bad picture of Lulu\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_scarecrow_msg[128] = "Keep this\x01 picture of a scarecrow\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_tingle_msg[128] = "Keep this\x01 picture of Tingle\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_deku_king_msg[128] = "Keep this\x01 picture of the Deku King\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_swamp_msg[128] = "Keep this\x01 picture of the swamp\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_pirate_good_msg[128] = "Keep this\x01 good picture of a pirate\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; -static unsigned char p_pirate_bad_msg[128] = "Keep this\x01 bad picture of a pirate\x00?\x02\x11\x11\xc2Yes\x11No\xbf"; - -static unsigned char slow_dog_msg[128] = "Hoo-whine.\x11How can any of us win against...\x10.\x0a.\x0a." "\x03" "blue dog" "\x00" "?\xbf"; -static unsigned char fast_dog_msg[128] = "\x0a\x0a\x0a\x0a\x0a\x0a.\x0a.\x0a.\x0a\x0a\x0a\x0a\xbf"; - -static unsigned char fool_msg[128] = "You are a\x01 FOOL!\xbf"; - -static unsigned char shop_msg[128]; -static unsigned char tingle_msg[512]; - -static unsigned char moon_weak_msg[128] = "...But you are not strong enough...\x11\x13\x13\x12Shall...I send you back?\x02\x11\x11\xc2Yes\x11No\xbf"; - -static unsigned char tingle_msg[512]; -static unsigned char scrub_msg[256]; -static unsigned char milkbar_msg[512]; - -#define TINGLE_LOCATION_BASE 0xB4 -#define SCRUB_LOCATION_BASE 0x090100 - -static s16 sTingleMapOptions[6][2] = { - { 0, 1 }, // CLOCK_TOWN: offers Clock Town, Woodfall - { 1, 2 }, // WOODFALL: offers Woodfall, Snowhead - { 2, 3 }, // SNOWHEAD: offers Snowhead, Romani Ranch - { 3, 4 }, // ROMANI_RANCH: offers Romani Ranch, Great Bay - { 4, 5 }, // GREAT_BAY: offers Great Bay, Stone Tower - { 5, 0 }, // STONE_TOWER: offers Stone Tower, Clock Town -}; - -static s16 sScrubGI[4] = { - GI_MAGIC_BEANS, // 0 - Swamp (10 rupees) - GI_BOMB_BAG_40, // 1 - Goron (200 rupees) - GI_POTION_GREEN, // 2 - Zora (40 rupees) - GI_POTION_BLUE, // 3 - Ikana (100 rupees) -}; - -static s16 sScrubPrices[4] = { - 10, - 200, - 40, - 100, -}; - -static u8 sold_prefix[] = "\x07SOLD - "; -static u8 rupees_str[] = " Rupees"; -static u8 no_thanks_str[] = "No thanks"; -static u8 nothing_str[] = "Nothing"; -static u8 yes_str[] = "Yes"; -static u8 no_str[] = "No"; - -u8 getItemColor(u32 location) { - switch (rando_get_location_type(location)) { - case 1: return 0x05; // progression - purple - case 2: return 0x03; // useful - blue - case 3: return 0x08; // trap - orange - case 0: - default: return 0x07; // filler - grey - } -} - -void Message_FindMessage(PlayState* play, u16 textId); - -s32 rando_get_shop_price(u32 shop_item_id); - -RECOMP_PATCH void Message_OpenText(PlayState* play, u16 textId) { - MessageContext* msgCtx = &play->msgCtx; - Font* font = &msgCtx->font; - Player* player = GET_PLAYER(play); - f32 var_fv0; - uintptr_t i; - u32 ffcount = 0; - unsigned char* msg = NULL; - s16 price; - - // recomp_printf("text id: 0x%04X\n", textId); - - if (textId == 0x52 && rando_get_slotdata_u32("skullsanity") != 2) { - textId = 0x75; - } - - if (textId == 0xC8 && rando_has_item(0x020000) > 1) { - textId = 0xCC; - } - - if (play->msgCtx.msgMode == MSGMODE_NONE) { - gSaveContext.prevHudVisibility = gSaveContext.hudVisibility; - } - - if (textId == 0xFF) { - func_80115844(play, DO_ACTION_STOP); - play->msgCtx.hudVisibility = gSaveContext.hudVisibility; - Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C); - gSaveContext.save.unk_06 = 20; - } else if ((textId == 0x579) || (textId == 0x8D8)) { - Interface_SetHudVisibility(HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE); - } else if (((textId == 0x28) || (textId == 0x29) || (textId == 0x2A)) && - (player->transformation == PLAYER_FORM_DEKU)) { - //! FAKE: - if (msgCtx) {} - textId = 0xC9; - } else if (textId == 0x11) { - if (gSaveContext.save.saveInfo.inventory.strayFairies[((void)0, gSaveContext.dungeonIndex)] == 0xF) { - textId = 0xF3; - } - } else if ((textId == 0x92) && (play->sceneId == SCENE_KOEPONARACE)) { - textId = 0xCD; - } else if ((textId == 0xC) && ((GET_QUEST_HEART_PIECE_COUNT - 1) != 0)) { - textId = GET_QUEST_HEART_PIECE_COUNT - 1; - textId += 0xC4; - if (textId == 0xC3) { - textId = 0xC7; - } - } - - msgCtx->currentTextId = textId; - - if ((msgCtx->currentTextId == 0xC) || (msgCtx->currentTextId == 0xD) || (msgCtx->currentTextId == 0xC5) || - (msgCtx->currentTextId == 0xC6) || (msgCtx->currentTextId == 0xC7)) { - Interface_SetHudVisibility(HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE); - } - - msgCtx->messageHasSetSfx = false; - D_801C6A70 = 0; - msgCtx->textboxSkipped = false; - msgCtx->textIsCredits = false; - var_fv0 = 1.0f; - - if (play->pauseCtx.bombersNotebookOpen) { - if (gSaveContext.options.language == LANGUAGE_JPN) { - msgCtx->textCharScale = 1.4f; - msgCtx->unk11FFC = 0x1E; - msgCtx->unk11FF8 = 0x32; - var_fv0 = 1.4; - } else { - msgCtx->textCharScale = 1.4f; - msgCtx->unk11FFC = 0x16; - msgCtx->unk11FF8 = 0x32; - var_fv0 = 1.4; - } - } else if (textId >= 0x4E20) { - msgCtx->textIsCredits = true; - msgCtx->textCharScale = 0.85f; - msgCtx->unk11FFC = 6; - msgCtx->unk11FF8 = 0x14; - } else if (gSaveContext.options.language == LANGUAGE_JPN) { - msgCtx->textCharScale = 0.88f; - msgCtx->unk11FFC = 0x12; - msgCtx->unk11FF8 = 0x32; - } else { - msgCtx->textCharScale = 0.75f; - msgCtx->unk11FFC = 0xC; - msgCtx->unk11FF8 = 0x41; - } - - sCharTexSize = msgCtx->textCharScale * 16.0f; - sCharTexScale = 1024.0f / msgCtx->textCharScale; - D_801F6B08 = 1024.0f / var_fv0; - - if (msgCtx->textIsCredits) { - Message_FindCreditsMessage(play, textId); - msgCtx->msgLength = font->messageEnd; - DmaMgr_SendRequest0(&font->msgBuf, (uintptr_t) &SEGMENT_ROM_START(staff_message_data_static)[font->messageStart], - font->messageEnd); - } else if (gSaveContext.options.language == LANGUAGE_JPN) { - Message_FindMessage(play, textId); - msgCtx->msgLength = font->messageEnd; - DmaMgr_SendRequest0(&font->msgBuf, (uintptr_t) &SEGMENT_ROM_START(message_data_static)[font->messageStart], - font->messageEnd); - } else { - Message_FindMessageNES(play, textId); - msgCtx->msgLength = font->messageEnd; - DmaMgr_SendRequest0(&font->msgBuf, (uintptr_t) &SEGMENT_ROM_START(message_data_static)[font->messageStart], - font->messageEnd); - } - - msgCtx->choiceNum = 0; - msgCtx->textUnskippable = false; - msgCtx->textboxEndType = TEXTBOX_ENDTYPE_00; - msgCtx->textDrawPos = 0; - msgCtx->msgBufPos = 0; - msgCtx->decodedTextLen = 0; - - switch (textId) { - case 0x37: - msg = sword_msg; - break; - case 0xCA: - msg = spin_msg; - break; - case 0xC8: - msg = magic_msg; - break; - case 0x72: - msg = osht_msg; - break; - case 0x75: - msg = ssht_msg; - break; - case 0xA2: - msg = sost_msg; - break; - case 0xA3: - msg = sos_msg; - break; - case 0xA5: - msg = es_msg; - break; - case 0xA7: - msg = oto_msg; - break; - case 0xA8: - msg = eoe_msg; - break; - case 0xAC: - msg = nwbn_msg; - break; - case 0xAD: - msg = gl_msg; - break; - case 0xAE: - msg = soa_msg; - break; - case 0xAF: - msg = soh_msg; - break; - case 0xB0: - msg = sot_msg; - break; - case 0xB2: - msg = ctsf_msg; - break; - case 0x46: - msg = wfsf_msg; - break; - case 0x47: - msg = shsf_msg; - break; - case 0x48: - msg = gbsf_msg; - break; - case 0x49: - msg = stsf_msg; - break; - case GI_AP_FILLER: - case GI_AP_PROG: - case GI_AP_USEFUL: - msg = ap_msg; - break; - case 0xF8: - if (!CHECK_QUEST_ITEM(QUEST_PICTOGRAPH)) { - Snap_RecordPictographedActors(play); - } - - if (Snap_CheckFlag(PICTO_VALID_MONKEY)) { - msg = p_monkey_msg; - } else if (Snap_CheckFlag(PICTO_VALID_BIG_OCTO)) { - msg = p_big_octo_msg; - } else if (Snap_CheckFlag(PICTO_VALID_SCARECROW)) { - msg = p_scarecrow_msg; - } else if (Snap_CheckFlag(PICTO_VALID_TINGLE)) { - msg = p_tingle_msg; - } else if (Snap_CheckFlag(PICTO_VALID_DEKU_KING)) { - msg = p_deku_king_msg; - } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_GOOD)) { - msg = p_pirate_good_msg; - } else if (Snap_CheckFlag(PICTO_VALID_PIRATE_TOO_FAR)) { - msg = p_pirate_bad_msg; - } else if (Snap_CheckFlag(PICTO_VALID_LULU_HEAD)) { - if (Snap_CheckFlag(PICTO_VALID_LULU_RIGHT_ARM) && Snap_CheckFlag(PICTO_VALID_LULU_LEFT_ARM)) { - msg = p_lulu_good_msg; - } else { - msg = p_lulu_bad_msg; - } - } else if (Snap_CheckFlag(PICTO_VALID_IN_SWAMP)) { - msg = p_swamp_msg; - } - break; - case 0x353C: - msg = fast_dog_msg; - break; - case 0x3545: - msg = slow_dog_msg; - break; - case 0x2778: - msg = moon_weak_msg; - break; - case 0x3C: - msg = sk_msg; - break; - case 0x3D: - msg = bk_msg; - break; - case 0x3E: - msg = map_msg; - break; - case 0x3F: - msg = compass_msg; - break; - case 0x54: - msg = bb_msg; - break; - case 0x74: - msg = fool_msg; - break; - case 0x71: - msg = self_msg; - break; - default: - break; - } - - if (msg != NULL) { - font->msgBuf.schar[0] = 0x02; - font->msgBuf.schar[1] = 0x00; - font->msgBuf.schar[2] = 0xFE; - for (i = 0; i < 128; ++i) { - font->msgBuf.schar[i + 11] = msg[i]; - if (msg[i] == 0xBF) { - break; - } - } - } - - if (textId == 0xF8) { - font->msgBuf.schar[0] = 0x06; - font->msgBuf.schar[1] = 0x71; - } - -// Tingle map purchase menus (0x1D11-0x1D16) - if (textId >= 0x1D11 && textId <= 0x1D16) { - u8 locationMapId = textId - 0x1D11; - u32 location1 = TINGLE_LOCATION_BASE + sTingleMapOptions[locationMapId][0]; - u32 location2 = TINGLE_LOCATION_BASE + sTingleMapOptions[locationMapId][1]; - bool sold1 = rando_location_is_checked(location1); - bool sold2 = rando_location_is_checked(location2); - - char* item1_str; - char* item2_str; - char* player1_str; - char* player2_str; - rando_get_location_item_name(location1, &item1_str); - rando_get_location_item_name(location2, &item2_str); - rando_get_location_item_player(location1, &player1_str); - rando_get_location_item_player(location2, &player2_str); - sanitizeRandoText(item1_str); - sanitizeRandoText(item2_str); - sanitizeRandoText(player1_str); - sanitizeRandoText(player2_str); - - s16 price1 = 20; - s16 price2 = 40; - s16 gi1 = rando_get_item_id(location1); - s16 gi2 = rando_get_item_id(location2); - - msgCtx->unk1206C = price1; - msgCtx->unk12070 = price2; - - font->msgBuf.schar[0] = 0x06; - font->msgBuf.schar[1] = 0x01; - font->msgBuf.schar[2] = 0xFE; - font->msgBuf.schar[3] = 0xFF; - font->msgBuf.schar[4] = 0xFF; - font->msgBuf.schar[5] = 0x00; - font->msgBuf.schar[6] = 0x14; - font->msgBuf.schar[7] = 0x00; - font->msgBuf.schar[8] = 0x28; - font->msgBuf.schar[9] = 0xFF; - font->msgBuf.schar[10] = 0xFF; - - u16 msg_i = 11; - - font->msgBuf.schar[msg_i++] = 0x02; - font->msgBuf.schar[msg_i++] = 0xC3; - - if (sold1) { - for (i = 0; sold_prefix[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = sold_prefix[i]; - } - } else { - font->msgBuf.schar[msg_i++] = getItemColor(location1); - } - - for (i = 0; item1_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = item1_str[i]; - } - - if (!sold1) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ':'; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = 0x01; - - if (price1 >= 10) { - font->msgBuf.schar[msg_i++] = (price1 / 10) + 0x30; - } - font->msgBuf.schar[msg_i++] = (price1 % 10) + 0x30; - - for (i = 0; rupees_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = rupees_str[i]; - } - - if (gi1 == GI_AP_PROG || gi1 == GI_AP_USEFUL || gi1 == GI_AP_FILLER) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = '('; - for (i = 0; player1_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = player1_str[i]; - } - font->msgBuf.schar[msg_i++] = ')'; - } - } - - font->msgBuf.schar[msg_i++] = 0x11; - font->msgBuf.schar[msg_i++] = 0x02; - - if (sold2) { - for (i = 0; sold_prefix[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = sold_prefix[i]; - } - } else { - font->msgBuf.schar[msg_i++] = getItemColor(location2); - } - - for (i = 0; item2_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = item2_str[i]; - } - - if (!sold2) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ':'; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = 0x01; - - if (price2 >= 10) { - font->msgBuf.schar[msg_i++] = (price2 / 10) + 0x30; - } - font->msgBuf.schar[msg_i++] = (price2 % 10) + 0x30; - - for (i = 0; rupees_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = rupees_str[i]; - } - - if (gi2 == GI_AP_PROG || gi2 == GI_AP_USEFUL || gi2 == GI_AP_FILLER) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = '('; - for (i = 0; player2_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = player2_str[i]; - } - font->msgBuf.schar[msg_i++] = ')'; - } - } - - font->msgBuf.schar[msg_i++] = 0x11; - font->msgBuf.schar[msg_i++] = 0x02; - - for (i = 0; no_thanks_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = no_thanks_str[i]; - } - - font->msgBuf.schar[msg_i++] = 0xBF; - - recomp_free(item1_str); - recomp_free(item2_str); - recomp_free(player1_str); - recomp_free(player2_str); - } - - // Business Scrubs (0x15EA) - if (textId == 0x15EA && rando_get_slotdata_u32("scrubsanity")) { - Actor* talkActor = msgCtx->talkActor; - if (talkActor != NULL && talkActor->id == ACTOR_EN_AKINDONUTS) { - s32 scrubType = talkActor->params & 3; - u32 location = SCRUB_LOCATION_BASE | sScrubGI[scrubType]; - s16 scrub_price = sScrubPrices[scrubType]; - bool sold = rando_location_is_checked(location); - - char* item_str; - char* player_str; - rando_get_location_item_name(location, &item_str); - rando_get_location_item_player(location, &player_str); - sanitizeRandoText(item_str); - sanitizeRandoText(player_str); - - s16 gi_item = rando_get_item_id(location); - - font->msgBuf.schar[0] = 0x06; - font->msgBuf.schar[1] = 0x01; - font->msgBuf.schar[2] = 0xFE; - font->msgBuf.schar[3] = 0xFF; - font->msgBuf.schar[4] = 0xFF; - font->msgBuf.schar[5] = 0xFF; - font->msgBuf.schar[6] = 0xFF; - font->msgBuf.schar[7] = 0xFF; - font->msgBuf.schar[8] = 0xFF; - font->msgBuf.schar[9] = 0xFF; - font->msgBuf.schar[10] = 0xFF; - - u16 msg_i = 11; - - if (sold) { - for (i = 0; sold_prefix[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = sold_prefix[i]; - } - } else { - font->msgBuf.schar[msg_i++] = getItemColor(location); - } - - for (i = 0; item_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = item_str[i]; - } - - if (!sold) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ':'; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = 0x01; - - if (scrub_price >= 100) { - font->msgBuf.schar[msg_i++] = (scrub_price / 100) + 0x30; - } - if (scrub_price >= 10) { - font->msgBuf.schar[msg_i++] = ((scrub_price % 100) / 10) + 0x30; - } - font->msgBuf.schar[msg_i++] = (scrub_price % 10) + 0x30; - - for (i = 0; rupees_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = rupees_str[i]; - } - - if (gi_item == GI_AP_PROG || gi_item == GI_AP_USEFUL || gi_item == GI_AP_FILLER) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = '('; - for (i = 0; player_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = player_str[i]; - } - font->msgBuf.schar[msg_i++] = ')'; - } - } - - font->msgBuf.schar[msg_i++] = 0x11; - font->msgBuf.schar[msg_i++] = 0x11; - font->msgBuf.schar[msg_i++] = 0x02; - font->msgBuf.schar[msg_i++] = 0xC2; - - for (i = 0; yes_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = yes_str[i]; - } - - font->msgBuf.schar[msg_i++] = 0x11; - - for (i = 0; no_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = no_str[i]; - } - - font->msgBuf.schar[msg_i++] = 0xBF; - - recomp_free(item_str); - recomp_free(player_str); - } - } - - // Milk Bar (0x2B0B) - if (textId == 0x2B0B && rando_get_slotdata_u32("shopsanity")) { - u32 location1 = 0x26392; // (ACTOR_EN_TAB << 8) | GI_MILK - u32 location2 = 0x91; // GI_CHATEAU - bool sold1 = rando_location_is_checked(location1); - bool sold2 = rando_location_is_checked(location2); - - char* item1_str; - char* item2_str; - char* player1_str; - char* player2_str; - rando_get_location_item_name(location1, &item1_str); - rando_get_location_item_name(location2, &item2_str); - rando_get_location_item_player(location1, &player1_str); - rando_get_location_item_player(location2, &player2_str); - sanitizeRandoText(item1_str); - sanitizeRandoText(item2_str); - sanitizeRandoText(player1_str); - sanitizeRandoText(player2_str); - - s16 price1 = 20; - s16 price2 = 200; - s16 gi1 = rando_get_item_id(location1); - s16 gi2 = rando_get_item_id(location2); - - msgCtx->unk1206C = price1; - msgCtx->unk12070 = price2; - - font->msgBuf.schar[0] = 0x06; - font->msgBuf.schar[1] = 0x01; - font->msgBuf.schar[2] = 0xFE; - font->msgBuf.schar[3] = 0xFF; - font->msgBuf.schar[4] = 0xFF; - font->msgBuf.schar[5] = 0x00; - font->msgBuf.schar[6] = 0x14; - font->msgBuf.schar[7] = 0x00; - font->msgBuf.schar[8] = 0xC8; - font->msgBuf.schar[9] = 0xFF; - font->msgBuf.schar[10] = 0xFF; - - u16 msg_i = 11; - - font->msgBuf.schar[msg_i++] = 0x02; - font->msgBuf.schar[msg_i++] = 0xC3; - - if (sold1) { - for (i = 0; sold_prefix[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = sold_prefix[i]; - } - } else { - font->msgBuf.schar[msg_i++] = getItemColor(location1); - } - - for (i = 0; item1_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = item1_str[i]; - } - - if (!sold1) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ':'; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = 0x01; - - if (price1 >= 10) { - font->msgBuf.schar[msg_i++] = (price1 / 10) + 0x30; - } - font->msgBuf.schar[msg_i++] = (price1 % 10) + 0x30; - - for (i = 0; rupees_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = rupees_str[i]; - } - - if (gi1 == GI_AP_PROG || gi1 == GI_AP_USEFUL || gi1 == GI_AP_FILLER) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = '('; - for (i = 0; player1_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = player1_str[i]; - } - font->msgBuf.schar[msg_i++] = ')'; - } - } - - font->msgBuf.schar[msg_i++] = 0x11; - font->msgBuf.schar[msg_i++] = 0x02; - - if (sold2) { - for (i = 0; sold_prefix[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = sold_prefix[i]; - } - } else { - font->msgBuf.schar[msg_i++] = getItemColor(location2); - } - - for (i = 0; item2_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = item2_str[i]; - } - - if (!sold2) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ':'; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = 0x01; - - if (price2 >= 100) { - font->msgBuf.schar[msg_i++] = (price2 / 100) + 0x30; - } - if (price2 >= 10) { - font->msgBuf.schar[msg_i++] = ((price2 % 100) / 10) + 0x30; - } - font->msgBuf.schar[msg_i++] = (price2 % 10) + 0x30; - - for (i = 0; rupees_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = rupees_str[i]; - } - - if (gi2 == GI_AP_PROG || gi2 == GI_AP_USEFUL || gi2 == GI_AP_FILLER) { - font->msgBuf.schar[msg_i++] = 0x00; - font->msgBuf.schar[msg_i++] = ' '; - font->msgBuf.schar[msg_i++] = '('; - for (i = 0; player2_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = player2_str[i]; - } - font->msgBuf.schar[msg_i++] = ')'; - } - } - - font->msgBuf.schar[msg_i++] = 0x11; - font->msgBuf.schar[msg_i++] = 0x02; - - for (i = 0; nothing_str[i] != 0; i++) { - font->msgBuf.schar[msg_i++] = nothing_str[i]; - } - - font->msgBuf.schar[msg_i++] = 0xBF; - - recomp_free(item1_str); - recomp_free(item2_str); - recomp_free(player1_str); - recomp_free(player2_str); - } - - // Shop Text - if ((textId & 0xFF00) == 0x3600 || (textId & 0xFF00) == 0x3700 || (textId == 0x0880 && rando_get_slotdata_u32("shopsanity") && !rando_location_is_checked(0x090002))) { - msg = shop_msg; - font->msgBuf.schar[0] = 0x06; - font->msgBuf.schar[1] = 0x30; - if (textId == 0x0880) { - price = rando_get_shop_price(0x02); // SI_POTION_BLUE - } else { - price = rando_get_shop_price(textId & 0xFF); - } - // recomp_printf("shop price: %d 0x%02X%02X\n", price, ((price & 0xFF00) >> 8), (price & 0xFF)); - font->msgBuf.schar[5] = (price & 0xFF00) >> 8; - font->msgBuf.schar[6] = price & 0xFF; - msgCtx->unk1206C = price; - } - - if (msg == ssht_msg) { - u8 count_str[128] = "\x11This is your \xbf"; - u8 count_done_str[128] = "\x11You've found all of them!\xbf"; - u8* count_msg = count_str; - u8 swamp_token_count = ((rando_get_slotdata_u32("skullsanity") != 2) ? rando_has_item(GI_TRUE_SKULL_TOKEN) : Inventory_GetSkullTokenCount(0x27)); - if (swamp_token_count >= 30) { - count_msg = count_done_str; - } - u8 end_i = i + 11; - for (i = 0; i < 128; ++i) { - font->msgBuf.schar[end_i + i] = count_msg[i]; - if (count_msg[i] == 0xBF) { - if (count_msg == count_done_str) { - break; - } - u8 count_suffix[2] = "th"; - if ((swamp_token_count % 10) == 1 && swamp_token_count != 11) { - count_suffix[0] = 's'; - count_suffix[1] = 't'; - } else if ((swamp_token_count % 10) == 2 && swamp_token_count != 12) { - count_suffix[0] = 'n'; - count_suffix[1] = 'd'; - } else if ((swamp_token_count % 10) == 3 && swamp_token_count != 13) { - count_suffix[0] = 'r'; - count_suffix[1] = 'd'; - } - font->msgBuf.schar[end_i + i] = 0x01; - i += 1; - if (swamp_token_count >= 10) { - font->msgBuf.schar[end_i + i] = (swamp_token_count / 10) + 0x30; - i += 1; - } - font->msgBuf.schar[end_i + i] = (swamp_token_count % 10) + 0x30; - font->msgBuf.schar[end_i + i + 1] = count_suffix[0]; - font->msgBuf.schar[end_i + i + 2] = count_suffix[1]; - font->msgBuf.schar[end_i + i + 3] = 0x00; - font->msgBuf.schar[end_i + i + 4] = '.'; - font->msgBuf.schar[end_i + i + 5] = 0xBF; - break; - } - } - } else if (msg == osht_msg) { - u8 count_str[128] = "\x11This is your \xbf"; - u8 count_done_str[128] = "\x11You've found all of them!\xbf"; - u8* count_msg = count_str; - u8 ocean_token_count = ((rando_get_slotdata_u32("skullsanity") != 2) ? rando_has_item(GI_OCEAN_SKULL_TOKEN) : Inventory_GetSkullTokenCount(0x28)); - if (ocean_token_count >= 30) { - count_msg = count_done_str; - } - u8 end_i = i + 11; - for (i = 0; i < 128; ++i) { - font->msgBuf.schar[end_i + i] = count_msg[i]; - if (count_msg[i] == 0xBF) { - if (count_msg == count_done_str) { - break; - } - u8 count_suffix[2] = "th"; - if ((ocean_token_count % 10) == 1 && ocean_token_count != 11) { - count_suffix[0] = 's'; - count_suffix[1] = 't'; - } else if ((ocean_token_count % 10) == 2 && ocean_token_count != 12) { - count_suffix[0] = 'n'; - count_suffix[1] = 'd'; - } else if ((ocean_token_count % 10) == 3 && ocean_token_count != 13) { - count_suffix[0] = 'r'; - count_suffix[1] = 'd'; - } - font->msgBuf.schar[end_i + i] = 0x01; - i += 1; - if (ocean_token_count >= 10) { - font->msgBuf.schar[end_i + i] = (ocean_token_count / 10) + 0x30; - i += 1; - } - font->msgBuf.schar[end_i + i] = (ocean_token_count % 10) + 0x30; - font->msgBuf.schar[end_i + i + 1] = count_suffix[0]; - font->msgBuf.schar[end_i + i + 2] = count_suffix[1]; - font->msgBuf.schar[end_i + i + 3] = 0x00; - font->msgBuf.schar[end_i + i + 4] = '.'; - font->msgBuf.schar[end_i + i + 5] = 0xBF; - break; - } - } - } else if (msg == wfsf_msg || msg == shsf_msg || msg == gbsf_msg || msg == stsf_msg) { - u8 count_str[128] = "\x11This is your \xbf"; - u8 count_done_str[128] = "\x11You've found all of them!\xbf"; - u8* count_msg = count_str; - recomp_printf("fairy type: %d\n", textId - 0x46); - u8 fairy_count = rando_has_item(0x010000 | (textId - 0x46)); - if (fairy_count >= 0xF) { - count_msg = count_done_str; - } - u8 end_i = i + 11; - for (i = 0; i < 128; ++i) { - font->msgBuf.schar[end_i + i] = count_msg[i]; - if (count_msg[i] == 0xBF) { - if (count_msg == count_done_str) { - break; - } - u8 count_suffix[2] = "th"; - if ((fairy_count % 10) == 1 && fairy_count != 11) { - count_suffix[0] = 's'; - count_suffix[1] = 't'; - } else if ((fairy_count % 10) == 2 && fairy_count != 12) { - count_suffix[0] = 'n'; - count_suffix[1] = 'd'; - } else if ((fairy_count % 10) == 3 && fairy_count != 13) { - count_suffix[0] = 'r'; - count_suffix[1] = 'd'; - } - font->msgBuf.schar[end_i + i] = 0x01; - i += 1; - if (fairy_count >= 10) { - font->msgBuf.schar[end_i + i] = (fairy_count / 10) + 0x30; - i += 1; - } - font->msgBuf.schar[end_i + i] = (fairy_count % 10) + 0x30; - font->msgBuf.schar[end_i + i + 1] = count_suffix[0]; - font->msgBuf.schar[end_i + i + 2] = count_suffix[1]; - font->msgBuf.schar[end_i + i + 3] = 0x00; - font->msgBuf.schar[end_i + i + 4] = '.'; - font->msgBuf.schar[end_i + i + 5] = 0xBF; - break; - } - } - } else if (msg == sk_msg || msg == bk_msg || msg == map_msg || msg == compass_msg) { - u8* dungeon_msg; - u8 wf_str[128] = "\x02(Woodfall)\x00\xbf"; - u8 sh_str[128] = "\x05(Snowhead)\x00\xbf"; - u8 gb_str[128] = "\x03(Great Bay)\x00\xbf"; - u8 st_str[128] = "\x04(Stone Tower)\x00\xbf"; - - u8 dungeonId = (rando_get_item_id(rando_get_last_location_sent()) - GI_MAX - 1) / 4; - switch (dungeonId) { - case 0: - dungeon_msg = wf_str; - break; - case 1: - dungeon_msg = sh_str; - break; - case 2: - dungeon_msg = gb_str; - break; - case 3: - dungeon_msg = st_str; - break; - } - u8 end_i = i + 11; - for (i = 0; i < 128; ++i) { - font->msgBuf.schar[end_i + i] = dungeon_msg[i]; - if (dungeon_msg[i] == 0xBF) { - break; - } - } - - // small key count - if (msg == sk_msg) { - u8 count_str[128] = "\x11This is your \xbf"; - u8* count_msg = count_str; - u8 new_end_i = end_i + i; - for (i = 0; i < 128; ++i) { - font->msgBuf.schar[new_end_i + i] = count_msg[i]; - if (count_msg[i] == 0xBF) { - u8 key_count = rando_has_item(0x090078 + (dungeonId * 0x100)); - u8 count_suffix[2] = "th"; - if ((key_count % 10) == 1 && key_count != 11) { - count_suffix[0] = 's'; - count_suffix[1] = 't'; - } else if ((key_count % 10) == 2 && key_count != 12) { - count_suffix[0] = 'n'; - count_suffix[1] = 'd'; - } else if ((key_count % 10) == 3 && key_count != 13) { - count_suffix[0] = 'r'; - count_suffix[1] = 'd'; - } - font->msgBuf.schar[new_end_i + i] = 0x01; - i += 1; - if (key_count >= 10) { - font->msgBuf.schar[new_end_i + i] = (key_count / 10) + 0x30; - i += 1; - } - font->msgBuf.schar[new_end_i + i] = (key_count % 10) + 0x30; - font->msgBuf.schar[new_end_i + i + 1] = count_suffix[0]; - font->msgBuf.schar[new_end_i + i + 2] = count_suffix[1]; - font->msgBuf.schar[new_end_i + i + 3] = 0x00; - font->msgBuf.schar[new_end_i + i + 4] = '.'; - font->msgBuf.schar[new_end_i + i + 5] = 0xBF; - break; - } - } - } - } else if (msg == shop_msg) { - char* item_str; - char* player_str; - - u32 shop_location = (0x090000 | (textId & 0xFF)); - bool buying = false; - // witch blue potion | SI_POTION_BLUE - if (textId == 0x0880) { - shop_location = 0x090002; - } - - rando_get_location_item_name(shop_location, &item_str); - rando_get_location_item_player(shop_location, &player_str); - sanitizeRandoText(item_str); - sanitizeRandoText(player_str); - - u8 rupees_str[128] = " Rupees\x11"; - u8 buy_str[128] = "\x11\x02\xc2I'll buy it\x11No thanks\x1A"; - u8 mushroom_str[128] = "\x11\x05Requires a Magic Mushroom"; - - // these colors could change - u8 desc_str[128] = "This is a"; - u8 prog_str[128] = "\x03 Progression Item "; - u8 useful_str[128] = "\x05 Useful Item "; - u8 junk_str[128] = "\x07 Filler Item "; - u8 trap_str[128] = "\x01 Trap "; - u8* type_msg; - - switch (rando_get_location_type(shop_location)) { - case 1: - type_msg = prog_str; - break; - case 2: - type_msg = useful_str; - break; - case 3: - type_msg = trap_str; - break; - case 0: - default: - type_msg = junk_str; - break; - } - - u8 msg_i = 11; - - if ((textId & 0xFF00) == 0x3700) { - font->msgBuf.schar[1] = 0x31; - buying = true; - } else { - font->msgBuf.schar[msg_i] = 0x01; - msg_i += 1; - } - - char c = item_str[0]; - i = 0; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = item_str[i]; - } - msg_i += i; - - font->msgBuf.schar[msg_i] = ':'; - font->msgBuf.schar[msg_i + 1] = ' '; - msg_i += 2; - - if (price >= 100) { - font->msgBuf.schar[msg_i] = (price / 100) + 0x30; - msg_i += 1; - } - if (price >= 10) { - font->msgBuf.schar[msg_i] = ((price % 100) / 10) + 0x30; - msg_i += 1; - } - font->msgBuf.schar[msg_i] = (price % 10) + 0x30; - msg_i += 1; - - i = 0; - c = rupees_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = rupees_str[i]; - } - msg_i += i; - - if (!buying) { - font->msgBuf.schar[msg_i] = 0x00; - msg_i += 1; - - i = 0; - c = desc_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = desc_str[i]; - } - msg_i += i; - - i = 0; - c = type_msg[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = type_msg[i]; - } - msg_i += i; - - s16 shopGI = rando_get_item_id(shop_location); - if (shopGI == GI_AP_PROG || shopGI == GI_AP_USEFUL || shopGI == GI_AP_FILLER) { - font->msgBuf.schar[msg_i] = 0x00; - font->msgBuf.schar[msg_i + 1] = 'f'; - font->msgBuf.schar[msg_i + 2] = 'o'; - font->msgBuf.schar[msg_i + 3] = 'r'; - font->msgBuf.schar[msg_i + 4] = 0x02; - font->msgBuf.schar[msg_i + 5] = 0x11; - msg_i += 6; - - i = 0; - c = player_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = player_str[i]; - } - msg_i += i; - } - - // witch blue potion | SI_POTION_BLUE - if (textId == 0x0880) { - i = 0; - c = mushroom_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = mushroom_str[i]; - } - msg_i += i; - } - - font->msgBuf.schar[msg_i] = 0x1A; - msg_i += 1; - } else { - for (i = 0; i < 128; ++i) { - if (buy_str[i] == 0xBF) { - break; - } - font->msgBuf.schar[msg_i + i] = buy_str[i]; - } - - msg_i += i; - } - - font->msgBuf.schar[msg_i] = 0xBF; - recomp_free(item_str); - recomp_free(player_str); - } else if (msg == ap_msg) { - char was_sent_str[128] = "was sent to "; - char* item_str; - char* player_str; - - rando_get_location_item_name(rando_get_last_location_sent(), &item_str); - rando_get_location_item_player(rando_get_last_location_sent(), &player_str); - sanitizeRandoText(item_str); - sanitizeRandoText(player_str); - - char c = item_str[0]; - u32 msg_i = 11; - font->msgBuf.schar[msg_i] = 0x05; - msg_i += 1; - - while (c != 0) { - font->msgBuf.schar[msg_i] = c; - msg_i += 1; - c = item_str[msg_i - 12]; - } - - font->msgBuf.schar[msg_i] = 0x11; - font->msgBuf.schar[msg_i + 1] = 0x00; - msg_i += 2; - - u32 i = 0; - c = was_sent_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = was_sent_str[i]; - } - - msg_i += i; - font->msgBuf.schar[msg_i] = 0x01; - msg_i += 1; - i = 0; - c = player_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = player_str[i]; - } - - msg_i += i; - font->msgBuf.schar[msg_i] = 0x00; - font->msgBuf.schar[msg_i + 1] = '!'; - font->msgBuf.schar[msg_i + 2] = 0xBF; - - recomp_free(item_str); - recomp_free(player_str); - } else if (msg == self_msg) { - char you_found_str[128] = "You found your\x11\x01"; - char* item_str; - - rando_get_location_item_name(rando_get_last_location_sent(), &item_str); - sanitizeRandoText(item_str); - - char c = you_found_str[0]; - u32 msg_i = 11; - font->msgBuf.schar[msg_i] = 0x00; - msg_i += 1; - - while (c != 0) { - font->msgBuf.schar[msg_i] = c; - msg_i += 1; - c = you_found_str[msg_i - 12]; - } - - u32 i = 0; - c = item_str[0]; - - while (c != 0) { - font->msgBuf.schar[msg_i + i] = c; - i += 1; - c = item_str[i]; - } - - msg_i += i; - font->msgBuf.schar[msg_i] = 0x00; - font->msgBuf.schar[msg_i + 1] = '!'; - font->msgBuf.schar[msg_i + 2] = 0xBF; - - recomp_free(item_str); - } - - // for reverse-engineering text - //~ size_t text_i = msgCtx->msgBufPos; - //~ char c = font->msgBuf.schar[text_i]; - //~ while (c != '\xbf') { - //~ recomp_printf("%c", c); - //~ text_i += 1; - //~ c = font->msgBuf.schar[text_i]; - //~ } - - //~ text_i = msgCtx->msgBufPos; - //~ c = font->msgBuf.schar[text_i]; - //~ while (c != '\xbf') { - //~ recomp_printf("0x%02X ", (u8) c); - //~ text_i += 1; - //~ c = font->msgBuf.schar[text_i]; - //~ } - - msgCtx->unk11F08 = font->msgBuf.schar[msgCtx->msgBufPos] << 8; - msgCtx->unk11F08 |= font->msgBuf.schar[msgCtx->msgBufPos + 1]; - - msgCtx->unk11F18 = (msgCtx->unk11F08 & 0xF000) >> 0xC; - msgCtx->textBoxType = (msgCtx->unk11F08 & 0xF00) >> 8; - msgCtx->textBoxPos = (msgCtx->unk11F08 & 0xF0) >> 4; - msgCtx->unk11F0C = msgCtx->unk11F08 & 0xF; - - if ((msgCtx->unk11F0C == 1) || (msgCtx->unk11F0C == 3)) { - //msgCtx->textUnskippable = true; - } - msgCtx->itemId = 0xFE; - - if ((msgCtx->textBoxType == TEXTBOX_TYPE_5) || (msgCtx->textBoxType == TEXTBOX_TYPE_D) || - (play->pauseCtx.bombersNotebookOpen)) { - msgCtx->unk120CE = msgCtx->unk120D0 = msgCtx->unk120D2 = 0; - } else { - msgCtx->unk120CE = msgCtx->unk120D0 = msgCtx->unk120D2 = 0xFF; - } - - msgCtx->choiceIndex = 0; - - if (msgCtx->unk11F0C != 3) { - msgCtx->textColorAlpha = 0xFF; - } else { - msgCtx->textColorAlpha = 0; - } - - if (textId == 0x1467) { - Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_KAFEI); - } - - if (textId == 0x2955) { - Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_ANJU); - Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_MET_KAFEI); - Message_BombersNotebookQueueEvent(play, BOMBERS_NOTEBOOK_EVENT_RECEIVED_COUPLES_MASK); - } -} - -// not really an item, but nice QOL text modification -extern u16 sReactionTextIds[][PLAYER_MASK_GIANT - 1]; - -RECOMP_PATCH u16 Text_GetFaceReaction(PlayState* play, FaceReactionSet reactionSet) { - // ease up on trading post mask restriction - if (reactionSet == FACE_REACTION_SET_CURIOSITY_SHOP_MAN) { - return 0; - } - - if ((Player_GetMask(play) > PLAYER_MASK_NONE) && (Player_GetMask(play) < PLAYER_MASK_GIANT)) { - return sReactionTextIds[reactionSet][Player_GetMask(play) - 1]; - } - return 0; -} \ No newline at end of file From 2803cb54504141bffecb88dc15976d5bb6bf496a Mon Sep 17 00:00:00 2001 From: Hyped Date: Wed, 3 Jun 2026 03:00:03 -0700 Subject: [PATCH 14/15] fix kotake blue potion + adjust lottery text + cleanup --- src/eztr_text.c | 89 ++++++++++++++++--------------------------------- 1 file changed, 29 insertions(+), 60 deletions(-) diff --git a/src/eztr_text.c b/src/eztr_text.c index e85cec8..26b62a4 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -1139,63 +1139,10 @@ EZTR_MSG_CALLBACK(OceanSpiderTokenCount) { } } -// honestly don't know, but seems important -// char* item_str; -// char* player_str; - -// rando_get_location_item_name(rando_get_last_location_sent(), &item_str); -// rando_get_location_item_player(rando_get_last_location_sent(), &player_str); -// sanitizeRandoText(item_str); -// sanitizeRandoText(player_str); - - -// text sanitize stolen from old file. Not sure what role this plays exactly, but I know it fixes crashes on funky letters -// commented out because this function is already in use elsewhere -// void sanitizeRandoText(char* rando_string) { -// u8 c = rando_string[0]; -// u8 next = 0; -// u8 i = 0; -// bool shift_string = false; - -// while (c != 0) { -// if (c <= 0x08 || (c >= 0x0A && c <= 0x1F) || (c >= 0xB0 && c <= 0xBB) || (c >= 0xBF && c <= 0xE8) || (c >= 0xF0 && c <= 0xFF)) { -// next = rando_string[i+1]; -// if (c == 0xC3 && next == 0xA1) { // á -// rando_string[i] = 0x98; -// shift_string = true; -// } else { -// rando_string[i] = 0xAE; // replace all invalid bytes with ¿ -// } -// } - -// if (shift_string) { -// u8 new_i = i + 1; -// u8 new_c = rando_string[new_i]; -// u8 new_next = rando_string[new_i + 1]; -// while (new_c != 0) { -// rando_string[new_i] = new_next; -// new_i++; -// new_c = rando_string[new_i]; -// new_next = rando_string[new_i + 1]; -// } -// shift_string = false; -// } - -// i++; -// c = rando_string[i]; -// } -// } - - - - - // text replacements for AP items. Not yet set up. Probably won't use but keeping here just in case. // EZTR_MSG_CALLBACK(randoAPSend) { // buf->data.text_box_type = EZTR_TRANSLUSCENT_BLUE_TEXT_BOX, -// EZTR_MsgSContent_Sprintf(buf->data.content, "You found " EZTR_CC_COLOR_RED "\xFE" EZTR_CC_COLOR_DEFAULT "'s" EZTR_CC_NEWLINE "" RANDO_AP_COLOR "\xFF" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END ""), - - +// EZTR_MsgSContent_Sprintf(buf->data.content, "You found " EZTR_CC_COLOR_RED "\xFE" EZTR_CC_COLOR_DEFAULT "'s" EZTR_CC_NEWLINE "" RANDO_AP_COLOR "\xFF" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END ""), // } // text replacements for pictograph box @@ -1242,6 +1189,7 @@ EZTR_MSG_CALLBACK(randoPictograph) { EZTR_MsgSContent_Sprintf(buf->data.content, "Keep this " EZTR_CC_COLOR_RED "picture" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_COLOR_GREEN "" EZTR_CC_NEWLINE "" EZTR_CC_NEWLINE "" EZTR_CC_TWO_CHOICE "Yes" EZTR_CC_NEWLINE "No" EZTR_CC_END ""); } } + EZTR_MSG_CALLBACK(randoLotterySignHint) { u32 lotteryItem = LOCATION_LOTTERY_SHOP; char* player_name; @@ -1257,7 +1205,7 @@ EZTR_MSG_CALLBACK(randoLotterySignHint) { EZTR_MsgSContent_Snprintf( player_name_when_nonlocal, 128, - "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + EZTR_CC_NEWLINE "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, player_name ); } else { @@ -1267,6 +1215,7 @@ EZTR_MSG_CALLBACK(randoLotterySignHint) { EZTR_CC_END ); } + char item_is_checked[128]; if (!rando_location_is_checked(lotteryItem)) { EZTR_MsgSContent_Snprintf( @@ -1282,6 +1231,7 @@ EZTR_MSG_CALLBACK(randoLotterySignHint) { EZTR_CC_COLOR_SILVER "50 Rupees" EZTR_CC_END ); } + char* lotteryItemClass; u32 type = rando_get_location_type(lotteryItem); if (type & 0b001) { @@ -1293,12 +1243,13 @@ EZTR_MSG_CALLBACK(randoLotterySignHint) { } else { lotteryItemClass = EZTR_CC_COLOR_SILVER "" EZTR_CC_END; } + EZTR_MsgSContent_Sprintf( buf->data.content, " Lottery Shop" EZTR_CC_NEWLINE "Grand Prize:" EZTR_CC_NEWLINE "%m%m" - EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END, lotteryItemClass, item_is_checked, player_name_when_nonlocal @@ -1306,8 +1257,8 @@ EZTR_MSG_CALLBACK(randoLotterySignHint) { recomp_free(item_name); recomp_free(player_name); - } + EZTR_MSG_CALLBACK(randoLotteryNPCHint) { u32 lotteryItem = LOCATION_LOTTERY_SHOP; char* player_name; @@ -1323,7 +1274,7 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { EZTR_MsgSContent_Snprintf( player_name_when_nonlocal, 128, - "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, + EZTR_CC_NEWLINE "(" EZTR_CC_COLOR_GREEN "%s" EZTR_CC_COLOR_DEFAULT ")" EZTR_CC_END, player_name ); } else { @@ -1333,6 +1284,7 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { EZTR_CC_END ); } + char item_is_checked[128]; if (!rando_location_is_checked(lotteryItem)) { EZTR_MsgSContent_Snprintf( @@ -1348,6 +1300,7 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { EZTR_CC_COLOR_SILVER "50 Rupees" EZTR_CC_COLOR_DEFAULT "." EZTR_CC_END ); } + char* lotteryItemClass; u32 type = rando_get_location_type(lotteryItem); if (type & 0b001) { @@ -1359,6 +1312,7 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { } else { lotteryItemClass = EZTR_CC_COLOR_SILVER "" EZTR_CC_END; } + EZTR_MsgSContent_Sprintf( buf->data.content, "Would you like the chance to buy" @@ -1366,7 +1320,7 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { EZTR_CC_NEWLINE "" EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "Pick any three numbers, and if" EZTR_CC_NEWLINE "those are picked, you'll win" EZTR_CC_NEWLINE "%m%m" - EZTR_CC_NEWLINE "" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", + EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", lotteryItemClass, item_is_checked, player_name_when_nonlocal @@ -1374,8 +1328,8 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { recomp_free(item_name); recomp_free(player_name); - } + EZTR_MSG_CALLBACK(randoGrave1Hint) { u32 location1 = 0x0000A2; // Graveyard Day 1 Iron Knuckle Song char* player_name; @@ -1823,6 +1777,21 @@ EZTR_Basic_ReplaceText( "\xBF", randoMilkBar ); + + // Kotake Blue Potion Text + EZTR_Basic_ReplaceText( + 0x0880, + EZTR_STANDARD_TEXT_BOX_II, + 0x30, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + false, + "\xBF", + randoShop + ); + // Tingle Text // North Clock Town Tingle EZTR_Basic_ReplaceText( From 1915b5618b879735db82aed55eb575692e0a5b20 Mon Sep 17 00:00:00 2001 From: Delcatty16 <38985645+Delcatty16@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:55:49 +0100 Subject: [PATCH 15/15] Added bank hint and cleaned up lottery hints more --- src/eztr_text.c | 80 ++++++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/src/eztr_text.c b/src/eztr_text.c index 26b62a4..25b1a8b 100644 --- a/src/eztr_text.c +++ b/src/eztr_text.c @@ -391,15 +391,15 @@ switch (currentTingle) { } EZTR_MsgSContent_Sprintf( buf->data.content, - EZTR_CC_THREE_CHOICE EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_COLOR_PINK "%m" EZTR_CC_NEWLINE - EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_COLOR_PINK "%m" EZTR_CC_NEWLINE + EZTR_CC_THREE_CHOICE EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_RED "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_NEWLINE + EZTR_CC_COLOR_GREEN "%m" EZTR_CC_COLOR_RED "%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_NEWLINE EZTR_CC_COLOR_GREEN "No thanks" EZTR_CC_END, item_sold_out1, - player_name_with_space1, remove_rupee_when_checked1, + player_name_with_space1, item_sold_out2, - player_name_with_space2, - remove_rupee_when_checked2 + remove_rupee_when_checked2, + player_name_with_space2 ); recomp_free(item_name); @@ -1190,6 +1190,30 @@ EZTR_MSG_CALLBACK(randoPictograph) { } } +EZTR_MSG_CALLBACK(randoBankHints) { + u32 bankFirstItem = 0x000008; // West Clock Town Bank 200 Rupees + u32 bankSecondItem = 0x080177; // West Clock Town Bank 500 Rupees + u32 bankThirdItem = 0x070177; // West Clock Town Bank 1000 Rupees + + char* is_bank_important; + u32 type = rando_get_location_type(bankFirstItem); + u32 type2 = rando_get_location_type(bankSecondItem); + u32 type3 = rando_get_location_type(bankThirdItem); + if (type & 0b001 || type2 & 0b001 || type3 & 0b001) { + is_bank_important = "." EZTR_CC_NEWLINE "At least one of them looks" EZTR_CC_COLOR_LIGHTBLUE "important" EZTR_CC_COLOR_DEFAULT "!" EZTR_CC_END; + } else if (type & 0b010 || type2 & 0b010 || type3 & 0b010) { + is_bank_important = "." EZTR_CC_NEWLINE "At least one of them looks" EZTR_CC_COLOR_BLUE "useful" EZTR_CC_COLOR_DEFAULT "." EZTR_CC_END; + } else { + is_bank_important = EZTR_CC_NEWLINE "that I was going to " EZTR_CC_COLOR_SILVER "throw away" EZTR_CC_COLOR_DEFAULT "." EZTR_CC_END; + } + EZTR_MsgSContent_Sprintf( + buf->data.content, + "For example, if you deposit enough" EZTR_CC_NEWLINE + EZTR_CC_COLOR_PINK "Rupees" EZTR_CC_COLOR_DEFAULT ", you'll get up to three items%m" EZTR_CC_EVENT EZTR_CC_END, + is_bank_important + ); + +} EZTR_MSG_CALLBACK(randoLotterySignHint) { u32 lotteryItem = LOCATION_LOTTERY_SHOP; char* player_name; @@ -1231,26 +1255,14 @@ EZTR_MSG_CALLBACK(randoLotterySignHint) { EZTR_CC_COLOR_SILVER "50 Rupees" EZTR_CC_END ); } - - char* lotteryItemClass; - u32 type = rando_get_location_type(lotteryItem); - if (type & 0b001) { - lotteryItemClass = EZTR_CC_COLOR_LIGHTBLUE "" EZTR_CC_END; - } else if (type & 0b010) { - lotteryItemClass = EZTR_CC_COLOR_BLUE "" EZTR_CC_END; - } else if (type & 0b100) { - lotteryItemClass = EZTR_CC_COLOR_ORANGE "" EZTR_CC_END; - } else { - lotteryItemClass = EZTR_CC_COLOR_SILVER "" EZTR_CC_END; - } - + EZTR_MsgSContent_Sprintf( buf->data.content, " Lottery Shop" EZTR_CC_NEWLINE "Grand Prize:" - EZTR_CC_NEWLINE "%m%m" + EZTR_CC_NEWLINE "%c%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END, - lotteryItemClass, + getAPItemColor(lotteryItem), item_is_checked, player_name_when_nonlocal ); @@ -1301,27 +1313,15 @@ EZTR_MSG_CALLBACK(randoLotteryNPCHint) { ); } - char* lotteryItemClass; - u32 type = rando_get_location_type(lotteryItem); - if (type & 0b001) { - lotteryItemClass = EZTR_CC_COLOR_LIGHTBLUE "" EZTR_CC_END; - } else if (type & 0b010) { - lotteryItemClass = EZTR_CC_COLOR_BLUE "" EZTR_CC_END; - } else if (type & 0b100) { - lotteryItemClass = EZTR_CC_COLOR_ORANGE "" EZTR_CC_END; - } else { - lotteryItemClass = EZTR_CC_COLOR_SILVER "" EZTR_CC_END; - } - EZTR_MsgSContent_Sprintf( buf->data.content, "Would you like the chance to buy" EZTR_CC_NEWLINE "your dreams for " EZTR_CC_COLOR_PINK "10 Rupees" EZTR_CC_COLOR_DEFAULT "?" EZTR_CC_NEWLINE "" EZTR_CC_CARRIAGE_RETURN "" EZTR_CC_BOX_BREAK2 "Pick any three numbers, and if" EZTR_CC_NEWLINE "those are picked, you'll win" - EZTR_CC_NEWLINE "%m%m" + EZTR_CC_NEWLINE "%c%m" EZTR_CC_COLOR_DEFAULT "%m" EZTR_CC_END "", - lotteryItemClass, + getAPItemColor(lotteryItem), item_is_checked, player_name_when_nonlocal ); @@ -1606,6 +1606,18 @@ EZTR_Basic_ReplaceText( "\xBF", randoLotteryNPCHint ); + EZTR_Basic_ReplaceText( + 0x044D, // Bank hints + EZTR_STANDARD_TEXT_BOX_II, + 0, + EZTR_ICON_NO_ICON, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + EZTR_NO_VALUE, + true, + "\xBF", + randoBankHints + ); EZTR_Basic_ReplaceText( 0x15E9, // Magic Bean Scrub EZTR_STANDARD_TEXT_BOX_II,