diff --git a/src/great_fairy_hooks.c b/src/great_fairy_hooks.c index f99f566..c92a250 100644 --- a/src/great_fairy_hooks.c +++ b/src/great_fairy_hooks.c @@ -168,6 +168,11 @@ RECOMP_PATCH void EnElfgrp_Init(Actor* thisx, PlayState* play) { void EnElfgrp_OfferLoop(EnElfgrp* this, PlayState* play) { s32 type = ENELFGRP_GET_TYPE(&this->actor); + if (rando_get_slotdata_u32("shuffle_great_fairy_rewards") == 0) + { + return; + } + bool hasFairies = type == ENELFGRP_TYPE_MAGIC ? rando_has_item(0x01007F) : rando_has_item(0x010000 | (type - 1)) >= rando_get_slotdata_u32("required_stray_fairies"); if (hasFairies && !rando_location_is_checked(LOCATION_GREAT_FAIRY)) { diff --git a/src/item_text.c b/src/item_text.c index 67958ae..ecbf58a 100644 --- a/src/item_text.c +++ b/src/item_text.c @@ -102,6 +102,17 @@ static unsigned char p_pirate_bad_msg[128] = "Keep this\x01 bad picture of a pir 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 cursed_spider_msg_1[128] = "I have nothing to give you.\x11Go away.\xbf"; +static unsigned char cursed_spider_msg_2[128] = "Do not bother lifting the curse.\x11The mask is mine!\xbf"; +static unsigned char ssh_guy_msg_1[128] = "I am not giving you my mask.\x11It's mine and mine only!\xbf"; +static unsigned char ssh_guy_msg_2[128] = "Great, now my mask is gone. That\x11mask was giving me infinite riches.\x10Now what?\xbf"; +static unsigned char chest_game_not_goron_1[128] = "Sorry, but we only accept\x11\x01strong and burly\x00 individuals.\xbf"; +static unsigned char chest_game_human[128] = "Looks like you're collecting \x01masks\x00!\x11There's \x01one I like\x00, but I don't\x11know if you have it...\xbf"; +static unsigned char chest_game_deku[128] = "Which is unfortunate because\x11you are so cute!!!\xbf"; +static unsigned char chest_game_zora[128] = "It's too bad... You look like my type...\xbf"; +static unsigned char chest_game_disabled_1[128] = "Oh! A customer! Unfortunately,\x11we are under construction.\xbf"; +static unsigned char chest_game_disabled_2[128] = "We'll be opening\x01 after the carnival\x00.\x11It will be the best celebration!\xbf"; + static unsigned char fool_msg[128] = "You are a\x01 FOOL!\xbf"; static unsigned char shop_msg[128]; @@ -343,6 +354,89 @@ RECOMP_PATCH void Message_OpenText(PlayState* play, u16 textId) { case 0x74: msg = fool_msg; break; + case 0x910: // Cursed Spider first dialog + if ((s16) rando_get_slotdata_u32("shuffle_spiderhouse_reward") == 0) { + msg = cursed_spider_msg_1; + } + break; + case 0x914: // Cursed Spider recurring dialogs + if ((s16) rando_get_slotdata_u32("shuffle_spiderhouse_reward") == 0) { + msg = cursed_spider_msg_2; + } + break; + case 0x91B: // Cured Spider first dialog + if ((s16) rando_get_slotdata_u32("shuffle_spiderhouse_reward") == 0) { + msg = ssh_guy_msg_1; + } + break; + case 0x918: // Cured Spider recurring dialog + if ((s16) rando_get_slotdata_u32("shuffle_spiderhouse_reward") == 0) { + msg = ssh_guy_msg_2; + } + break; + case 0x76D: // Speaking to Treasure Game lady as human + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 1) { + msg = chest_game_not_goron_1; + } + else if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) + { + msg = chest_game_disabled_1; + } + break; + case 0x76C: // Speaking to Treasure Game lady as Deku + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 1) { + msg = chest_game_not_goron_1; + } + else if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) + { + msg = chest_game_disabled_1; + } + break; + case 0x76E: // Speaking to Treasure Game lady as Goron + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) { + msg = chest_game_disabled_1; + } + break; + case 0x76F: // Speaking to Treasure Game lady as Zora + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 1) { + msg = chest_game_not_goron_1; + } + else if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) + { + msg = chest_game_disabled_1; + } + break; + case 0x771: // Accepting or refusing to pay for Treasure Game lady as human + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 1) { + msg = chest_game_human; + } + else if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) + { + msg = chest_game_disabled_2; + } + break; + case 0x770: // Accepting or refusing to pay for Treasure Game lady as Deku + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 1) { + msg = chest_game_deku; + } + else if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) { + msg = chest_game_disabled_2; + } + break; + case 0x772: // Accepting or refusing to pay for Treasure Game lady as Goron + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) { + msg = chest_game_disabled_2; + } + break; + case 0x773: // Accepting or refusing to pay for Treasure Game lady as Zora + if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 1) { + msg = chest_game_zora; + } + else if ((s16) rando_get_slotdata_u32("shuffle_treasure_chest_game") == 0) + { + msg = chest_game_disabled_2; + } + break; default: break; } @@ -363,6 +457,12 @@ RECOMP_PATCH void Message_OpenText(PlayState* play, u16 textId) { font->msgBuf.schar[0] = 0x06; font->msgBuf.schar[1] = 0x71; } + if (textId == 0x910 || textId == 0x914 || textId == 0x91B || textId == 0x918 || + textId == 0x76D || textId == 0x76C || textId == 0x76E || textId == 0x76F || // Speaking to Treasure Game lady + textId == 0x770 || textId == 0x771 || textId == 0x772 || textId == 0x773) { // Choosing to pay for Treasure Game + font->msgBuf.schar[0] = 0x00; + } + if ((textId & 0xFF00) == 0x3600 || (textId & 0xFF00) == 0x3700 || (textId == 0x0880 && rando_shopsanity_enabled() && !rando_location_is_checked_async(0x090002))) { msg = shop_msg; font->msgBuf.schar[0] = 0x06; diff --git a/src/spiderhouse_man_hooks.c b/src/spiderhouse_man_hooks.c index 3d30349..4a1749b 100644 --- a/src/spiderhouse_man_hooks.c +++ b/src/spiderhouse_man_hooks.c @@ -65,6 +65,11 @@ void OnEnSth_Init(Actor* thisx, PlayState* play) { // fake skull token count for lower requirements Inventory_FakeSkullTokenCount(play->sceneId); + + // If ShuffleSpiderhouseReward is disabled, set the flag that prevent giving the SSH reward + if ((s16) rando_get_slotdata_u32("shuffle_spiderhouse_reward") == 0) { + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH); + } } RECOMP_HOOK_RETURN("EnSth_Init") @@ -125,7 +130,7 @@ RECOMP_PATCH void EnSth_GiveOceansideSpiderHouseReward(EnSth* this, PlayState* p } else { // this could all be moved into a hook? // handle all 3 day checks here as well - if (rando_location_is_checked(GI_WALLET_GIANT)) { + if (rando_location_is_checked(GI_WALLET_GIANT) || (s16) rando_get_slotdata_u32("shuffle_spiderhouse_reward") == 0) { STH_GI_ID(&this->actor) = GI_RUPEE_SILVER; } else { STH_GI_ID(&this->actor) = GI_WALLET_GIANT; diff --git a/src/yaml_generation_menu.c b/src/yaml_generation_menu.c index 44de643..ac42cf0 100644 --- a/src/yaml_generation_menu.c +++ b/src/yaml_generation_menu.c @@ -383,18 +383,36 @@ static EnumOptionValue shop_prices_options[] = { { "offensive", NULL }, }; +static EnumOptionValue rando_shuffle_spiderhouse_reward_options[] ={ + { "disabled", NULL }, + { "vanilla", NULL }, + { "enabled", NULL}, +}; + static EnumOptionValue rando_skullsanity_options[] = { { "vanilla", NULL }, { "anything", NULL }, { "ignore", NULL }, }; +static EnumOptionValue rando_shuffle_great_fairy_rewards_options[] ={ + { "disabled", NULL }, + { "vanilla", NULL }, + { "enabled", NULL}, +}; + static EnumOptionValue rando_shopsanity_options[] = { { "vanilla", NULL }, { "enabled", NULL }, { "advanced", NULL }, }; +static EnumOptionValue treasure_chest_game_shuffle_options[] = { + { "disabled", NULL }, + { "goron_only", NULL }, + { "everything", NULL }, +}; + static EnumOptionValue rando_damage_multiplier_options[] = { { "half", NULL }, { "normal", NULL }, @@ -485,8 +503,8 @@ void randoCreateYamlConfigMenu() { yaml_config_menu.num_options = 0; randoCreateRadioOption(&yaml_config_menu, "accessibility", "Accessibility:", rando_accessibility_options, ARRAY_COUNT(rando_accessibility_options), RANDO_ACCESSABILITY_FULL); randoCreateRadioOption(&yaml_config_menu, "logic_difficulty", "Logic Difficulty:", rando_logic_difficulty_options, ARRAY_COUNT(rando_logic_difficulty_options), RANDO_LOGIC_DIFFICULTY_NORMAL); - randoCreateIntSliderOption(&yaml_config_menu, "moon_remains_required", "Moon Boss Remains Required:", 1, 4, 1, 4); - randoCreateIntSliderOption(&yaml_config_menu, "majora_remains_required", "Majora Boss Remains Required:", 1, 4, 1, 4); + randoCreateIntSliderOption(&yaml_config_menu, "moon_remains_required", "Moon Boss Remains Required:", 0, 4, 1, 4); + randoCreateIntSliderOption(&yaml_config_menu, "majora_remains_required", "Majora Boss Remains Required:", 0, 4, 1, 4); randoCreateBoolPropOption(&yaml_config_menu, "camc", "Chests Match Contents:", true); randoCreateBoolPropOption(&yaml_config_menu, "swordless", "Start Swordless:", false); randoCreateBoolPropOption(&yaml_config_menu, "shieldless", "Start Shieldless:", false); @@ -495,10 +513,10 @@ void randoCreateYamlConfigMenu() { randoCreateRadioOption(&yaml_config_menu, "starting_hearts_are_containers_or_pieces", "Unused Starting Hearts are Distributed as:", rando_starting_hearts_type_options, ARRAY_COUNT(rando_starting_hearts_type_options), RANDO_STARTING_HEARTS_ARE_CONTAINERS); randoCreateRadioOption(&yaml_config_menu, "shuffle_regional_maps", "Shuffle Regional Maps:", rando_shuffle_regional_maps_options, ARRAY_COUNT(rando_shuffle_regional_maps_options), RANDO_SHUFFLE_REGIONAL_MAPS_VANILLA); randoCreateRadioOption(&yaml_config_menu, "shuffle_boss_remains", "Shuffle Boss Remains:", rando_shuffle_boss_remains_options, ARRAY_COUNT(rando_shuffle_boss_remains_options), RANDO_SHUFFLE_BOSS_REMAINS_VANILLA); - randoCreateBoolPropOption(&yaml_config_menu, "shuffle_spiderhouse_reward", "Shuffle Spiderhouse Rewards:", false); + randoCreateRadioOption(&yaml_config_menu, "shuffle_spiderhouse_reward", "Shuffle Spiderhouse Rewards:", rando_shuffle_spiderhouse_reward_options, ARRAY_COUNT(rando_shuffle_spiderhouse_reward_options), 0); randoCreateIntSliderOption(&yaml_config_menu, "required_skull_tokens", "Required Skulltula Tokens:", 0, 30, 1, 30); randoCreateRadioOption(&yaml_config_menu, "skullsanity", "Skull-Sanity Mode:", rando_skullsanity_options, ARRAY_COUNT(rando_skullsanity_options), RANDO_SKULLSANITY_VANILLA); - randoCreateBoolPropOption(&yaml_config_menu, "shuffle_great_fairy_rewards", "Shuffle Great Fairy Rewards:", false); + randoCreateRadioOption(&yaml_config_menu, "shuffle_great_fairy_rewards", "Shuffle Great Fairy Rewards:", rando_shuffle_great_fairy_rewards_options, ARRAY_COUNT(rando_shuffle_great_fairy_rewards_options), 0); randoCreateIntSliderOption(&yaml_config_menu, "required_stray_fairies", "Required Stray Fairies:", 0, 15, 1, 15); randoCreateBoolPropOption(&yaml_config_menu, "fairysanity", "Fairy-Sanity:", false); randoCreateRadioOption(&yaml_config_menu, "shop_prices", "Shop Prices:", shop_prices_options, ARRAY_COUNT(shop_prices_options), RANDO_SHOP_PRICES_VANILLA); @@ -509,6 +527,7 @@ void randoCreateYamlConfigMenu() { randoCreateBoolPropOption(&yaml_config_menu, "bosskeysanity", "Boss-Key-Sanity:", false); randoCreateBoolPropOption(&yaml_config_menu, "curiostity_shop_trades", "Curiosity Shop Trades:", false); randoCreateBoolPropOption(&yaml_config_menu, "intro_checks", "Intro Checks:", false); + randoCreateRadioOption(&yaml_config_menu, "shuffle_treasure_chest_game", "Treasure Chest Game Shuffle:", treasure_chest_game_shuffle_options, ARRAY_COUNT(treasure_chest_game_shuffle_options), 1); randoCreateBoolPropOption(&yaml_config_menu, "start_with_consumables", "Start With Consumables:", true); randoCreateBoolPropOption(&yaml_config_menu, "permanent_chateau_romani", "Permanent Chateau Romani:", true); randoCreateBoolPropOption(&yaml_config_menu, "start_with_inverted_time", "Start With Inverted Time:", true);