Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6785f23
Import Models
Caladius Oct 22, 2025
2dfab99
Give and Draw for Models
Caladius Oct 22, 2025
74843e2
Logic updates, need to do Evans Song
Caladius Oct 23, 2025
22f9888
Update OnFileCreate
Caladius Oct 23, 2025
a649d70
Fixes
Caladius Oct 23, 2025
bb8e3e5
clang
Caladius Oct 23, 2025
ceac5c2
Implement Japas Jam Session
Caladius Oct 23, 2025
a9a3fb6
Update to latest dev
Caladius Nov 6, 2025
d08ea20
Update naming uniformity
Caladius Nov 8, 2025
8728867
Rename Logic
Caladius Nov 8, 2025
5e3f65f
ugh
Caladius Nov 8, 2025
1e7ad30
Fixes VB, Logic, and removes magic numbers from Starting Items Macro.
Caladius Nov 14, 2025
6c6abe1
Update to latest develop
Caladius Nov 24, 2025
a243963
Adds Item Tracker implementation
Caladius Nov 24, 2025
75e6370
Adds Scarecrow song check and makes feedback changes.
Caladius Nov 25, 2025
ff91d7e
Stop error chime from starting an EDM album.
Caladius Nov 25, 2025
9e06375
Merge Conflict and Update
Caladius Nov 26, 2025
8d9eb09
Update mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp
Caladius Dec 3, 2025
956c47e
Update mm/2s2h/Rando/Logic/Logic.h
Caladius Dec 3, 2025
a0323c6
Update mm/2s2h/Rando/Logic/Logic.h
Caladius Dec 3, 2025
297f340
Update mm/2s2h/Enhancements/Songs/SkipScarecrowSong.cpp
Caladius Dec 3, 2025
15d7ce8
Undo Swim change (no idea why i did this)
Caladius Dec 7, 2025
2091fd3
Merge remote-tracking branch 'origin/develop' into develop-ocarina-bu…
Caladius Dec 7, 2025
ac97760
Merge branch 'develop-ocarina-buttons' of https://github.com/Caladius…
Caladius Dec 7, 2025
9422b0e
Reworked Hook
Caladius Dec 7, 2025
ad2a7ec
Merge remote-tracking branch 'upstream/develop' into finish-ocarina-b…
Eblo Jan 6, 2026
7829d8b
Cleanup
Eblo Jan 6, 2026
b8c4c67
Clean up
Eblo Jan 7, 2026
b6ef8ee
Merge remote-tracking branch 'upstream/develop' into finish-ocarina-b…
Eblo Jan 7, 2026
63ab61c
Merge pull request #19 from Eblo/finish-ocarina-buttons
Caladius Jan 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mm/2s2h/Enhancements/Trackers/ItemTracker/ItemTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern TrackerImageObject GetTextureObject(int16_t itemId, bool isRandoItem) {

if (isRandoItem) {
TrackerImageObject randoImageObject;
randoImageObject.textureColor = ImVec4(1, 1, 1, 1);
randoImageObject.textureColor = Ship_GetRandoItemColorTint(itemId);

switch (itemId) {
case RI_FROG_BLUE:
Expand Down Expand Up @@ -107,6 +107,13 @@ extern TrackerImageObject GetTextureObject(int16_t itemId, bool isRandoItem) {
case RI_TRIFORCE_PIECE:
itemObtained = gSaveContext.save.shipSaveInfo.rando.foundTriforcePieces > 0;
break;
case RI_OCARINA_BUTTON_A:
case RI_OCARINA_BUTTON_C_DOWN:
case RI_OCARINA_BUTTON_C_LEFT:
case RI_OCARINA_BUTTON_C_RIGHT:
case RI_OCARINA_BUTTON_C_UP:
itemObtained = Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A + (itemId - RI_OCARINA_BUTTON_A));
break;
default:
break;
}
Expand Down Expand Up @@ -431,6 +438,7 @@ void ItemTrackerWindow::Draw() {
uint32_t windowIndex = TRACKER_MAIN;
for (auto* window : itemTrackerWindows) {
if (window->empty()) {
windowIndex++;
continue;
}
bool singleWindowOpen = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ std::vector<std::string> listOrder = {
};

std::vector<std::string> randoListOrder = {
"Frogs", "Boss Souls", "Owl Statues", "Tingle Maps", "Misc",
"Frogs", "Ocarina Buttons", "Boss Souls", "Owl Statues", "Tingle Maps", "Misc",
};

std::map<std::string, std::tuple<int16_t, int16_t, int16_t>> defaultItemLists = {
Expand All @@ -43,6 +43,7 @@ std::map<std::string, std::tuple<int16_t, int16_t, int16_t>> defaultItemLists =

std::map<std::string, std::tuple<int16_t, int16_t, int16_t>> randoItemLists = {
{ "Frogs", { RI_FROG_BLUE, RI_FROG_WHITE, 4 } },
{ "Ocarina Buttons", { RI_OCARINA_BUTTON_A, RI_OCARINA_BUTTON_C_UP, 5 } },
{ "Boss Souls", { RI_SOUL_GOHT, RI_SOUL_TWINMOLD, 5 } },
{ "Owl Statues", { RI_OWL_CLOCK_TOWN_SOUTH, RI_OWL_ZORA_CAPE, 5 } },
{ "Tingle Maps", { RI_TINGLE_MAP_CLOCK_TOWN, RI_TINGLE_MAP_WOODFALL, 6 } },
Expand Down Expand Up @@ -248,8 +249,8 @@ void DrawItemList(std::string listName, int columns) {
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(5, 5));
std::vector<int16_t> emptyList;

if (listName == "Frogs" || listName == "Boss Souls" || listName == "Owl Statues" ||
listName == "Tingle Maps" || listName == "Misc") {
if (listName == "Frogs" || listName == "Ocarina Buttons" || listName == "Boss Souls" ||
listName == "Owl Statues" || listName == "Tingle Maps" || listName == "Misc") {
for (int j = std::get<0>(randoItemLists.at(listName)); j <= std::get<1>(randoItemLists.at(listName));
j++) {
ImGui::TableNextColumn();
Expand Down
2 changes: 2 additions & 0 deletions mm/2s2h/GameInteractor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ typedef enum {
VB_OBJ_MURE3_DROP_COLLECTIBLE,
VB_SET_PLAYER_CYLINDER_OC_FLAGS,
VB_GORON_RACE_RUBBERBANDING,
VB_PLAY_OCARINA_NOTE,
VB_TOTO_START_SOUND_CHECK,
} GIVanillaBehavior;

typedef enum {
Expand Down
16 changes: 16 additions & 0 deletions mm/2s2h/Rando/ActorBehavior/EnToto.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ActorBehavior.h"
#include <libultraship/bridge/consolevariablebridge.h>
#include "2s2h/Rando/Logic/Logic.h"

extern "C" {
#include "variables.h"
Expand Down Expand Up @@ -38,4 +39,19 @@ void Rando::ActorBehavior::InitEnTotoBehavior() {
Message_BombersNotebookQueueEvent(gPlayState, BOMBERS_NOTEBOOK_EVENT_MET_TOTO);
Message_BombersNotebookQueueEvent(gPlayState, BOMBERS_NOTEBOOK_EVENT_MET_GORMAN);
});

COND_VB_SHOULD(VB_TOTO_START_SOUND_CHECK, IS_RANDO && RANDO_SAVE_OPTIONS[RO_SHUFFLE_OCARINA_BUTTONS], {
EnToto* totoActor = va_arg(args, EnToto*);
if (totoActor->text->textId == 0x2B24) {
if (!(Rando::Logic::canPlaySong(OCARINA_SONG_WIND_FISH_HUMAN) ||
Rando::Logic::canPlaySong(OCARINA_SONG_WIND_FISH_DEKU) ||
Rando::Logic::canPlaySong(OCARINA_SONG_WIND_FISH_GORON) ||
Rando::Logic::canPlaySong(OCARINA_SONG_WIND_FISH_ZORA))) {
Message_ContinueTextbox(gPlayState, 0x2B25);
func_80BA36C0(totoActor, gPlayState, 0);
Flags_UnsetSwitch(gPlayState, ENTOTO_GET_SWITCH_FLAG_1(&totoActor->actor));
*should = false;
}
}
});
}
25 changes: 25 additions & 0 deletions mm/2s2h/Rando/ActorBehavior/Player.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ActorBehavior.h"
#include <libultraship/bridge/consolevariablebridge.h>
#include "2s2h/Rando/Logic/Logic.h"

extern "C" {
#include "variables.h"
Expand All @@ -10,6 +11,14 @@ extern s32 Player_SetAction(PlayState* play, Player* player, PlayerActionFunc ac
extern void Player_Action_1(Player* player, PlayState* play);
}

std::map<OcarinaButtonIndex, RandoInf> ocarinaButtonToFlagMap = {
{ OCARINA_BTN_A, RANDO_INF_OBTAINED_OCARINA_BUTTON_A },
{ OCARINA_BTN_C_DOWN, RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN },
{ OCARINA_BTN_C_RIGHT, RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT },
{ OCARINA_BTN_C_LEFT, RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT },
{ OCARINA_BTN_C_UP, RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP },
};

void RespawnOnWaterTouch(Player* player) {
// This is Honey & Darlings Shop, touching the water ends the minigame as its vanilla behavior.
// No reason to handle it a second time here.
Expand All @@ -30,4 +39,20 @@ void Rando::ActorBehavior::InitPlayerBehavior() {
RespawnOnWaterTouch(GET_PLAYER(gPlayState));
}
});
COND_VB_SHOULD(VB_PLAY_OCARINA_NOTE, IS_RANDO, {
u8* sCurOcarinaButtonIndex = va_arg(args, u8*);
u8* sCurOcarinaPitch = va_arg(args, u8*);
bool canPlayNote = true;

auto findNote = ocarinaButtonToFlagMap.find(static_cast<OcarinaButtonIndex>(*sCurOcarinaButtonIndex));
if (findNote != ocarinaButtonToFlagMap.end()) {
canPlayNote = Flags_GetRandoInf(findNote->second);
}

if (!canPlayNote) {
*sCurOcarinaButtonIndex = OCARINA_BTN_INVALID;
*sCurOcarinaPitch = OCARINA_PITCH_NONE;
Audio_PlaySfx(NA_SE_SY_OCARINA_ERROR);
}
});
}
26 changes: 24 additions & 2 deletions mm/2s2h/Rando/DrawItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,23 @@ void DrawAbilityItem(RandoItemId randoItemId, Actor* actor) {

Gfx_SetupDL25_Xlu(gPlayState->state.gfxCtx);

MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gPlayState->state.gfxCtx);
gSPDisplayList(POLY_XLU_DISP++, (Gfx*)abilityItemModel[randoItemId - RI_ABILITY_SWIM]);
MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gPlayState->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)abilityItemModel[randoItemId - RI_ABILITY_SWIM]);

CLOSE_DISPS(gPlayState->state.gfxCtx);
}

void DrawOcarinaButtonItem(RandoItemId randoItemId, Actor* actor) {
Gfx* ocarinaButtonModel[5] = {
(Gfx*)gOcarinaAButtonDL, (Gfx*)gOcarinaCDownButtonDL, (Gfx*)gOcarinaCLeftButtonDL,
(Gfx*)gOcarinaCRightButtonDL, (Gfx*)gOcarinaCUpButtonDL,
};

OPEN_DISPS(gPlayState->state.gfxCtx);
Gfx_SetupDL25_Opa(gPlayState->state.gfxCtx);

MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, gPlayState->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)ocarinaButtonModel[randoItemId - RI_OCARINA_BUTTON_A]);

CLOSE_DISPS(gPlayState->state.gfxCtx);
}
Expand Down Expand Up @@ -539,6 +554,13 @@ void Rando::DrawItem(RandoItemId randoItemId, Actor* actor) {
case RI_MAX_TRAP:
DrawTrapModel();
break;
case RI_OCARINA_BUTTON_A:
case RI_OCARINA_BUTTON_C_DOWN:
case RI_OCARINA_BUTTON_C_LEFT:
case RI_OCARINA_BUTTON_C_RIGHT:
case RI_OCARINA_BUTTON_C_UP:
DrawOcarinaButtonItem(randoItemId, actor);
break;
case RI_NONE:
case RI_UNKNOWN:
break;
Expand Down
7 changes: 7 additions & 0 deletions mm/2s2h/Rando/GiveItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ void Rando::GiveItem(RandoItemId randoItemId) {
case RI_TRAP:
Rando::MiscBehavior::OfferTrapItem();
break;
case RI_OCARINA_BUTTON_A:
case RI_OCARINA_BUTTON_C_DOWN:
case RI_OCARINA_BUTTON_C_LEFT:
case RI_OCARINA_BUTTON_C_RIGHT:
case RI_OCARINA_BUTTON_C_UP:
Flags_SetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A + (randoItemId - RI_OCARINA_BUTTON_A));
break;
case RI_JUNK:
case RI_NONE:
break;
Expand Down
71 changes: 70 additions & 1 deletion mm/2s2h/Rando/Logic/Logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ extern std::map<RandoRegionId, RandoRegion> Regions;
#define CAN_USE_HUMAN_SWORD (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) >= EQUIP_VALUE_SWORD_KOKIRI)
#define CAN_USE_SWORD (CAN_USE_HUMAN_SWORD || HAS_ITEM(ITEM_SWORD_GREAT_FAIRY) || CAN_BE_DEITY)
// Be careful here, as some checks require you to play the song as a specific form
#define CAN_PLAY_SONG(song) (HAS_ITEM(ITEM_OCARINA_OF_TIME) && CHECK_QUEST_ITEM(QUEST_SONG_##song))
#define CAN_PLAY_SONG(song) \
(HAS_ITEM(ITEM_OCARINA_OF_TIME) && CHECK_QUEST_ITEM(QUEST_SONG_##song) && \
Rando::Logic::canPlaySong(Ship_GetOcarinaSongByQuestId(QUEST_SONG_##song)))
#define CAN_RIDE_EPONA (CAN_PLAY_SONG(EPONA))
#define GBT_CAN_REVERSE_WATER_FLOW \
(RANDO_EVENTS[RE_GREAT_BAY_RED_SWITCH_1] && RANDO_EVENTS[RE_GREAT_BAY_RED_SWITCH_2] && \
Expand Down Expand Up @@ -136,6 +138,73 @@ inline std::string LogicString(std::string condition) {
return condition;
}

inline bool canPlaySong(u8 songId) {
switch (songId) {
case OCARINA_SONG_SONATA:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT));
case OCARINA_SONG_GORON_LULLABY:
case OCARINA_SONG_GORON_LULLABY_INTRO:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT));
case OCARINA_SONG_NEW_WAVE:
case OCARINA_SONG_ELEGY:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN));
case OCARINA_SONG_OATH:
case OCARINA_SONG_WIND_FISH_ZORA:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP));
case OCARINA_SONG_TIME:
case OCARINA_SONG_INVERTED_TIME:
case OCARINA_SONG_DOUBLE_TIME:
case OCARINA_SONG_WIND_FISH_GORON:
case OCARINA_SONG_EVAN_PART1:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN));
case OCARINA_SONG_HEALING:
case OCARINA_SONG_SARIAS:
case OCARINA_SONG_EVAN_PART2:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN));
case OCARINA_SONG_EPONAS:
case OCARINA_SONG_WIND_FISH_HUMAN:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT));
case OCARINA_SONG_SOARING:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP));
case OCARINA_SONG_STORMS:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP));
case OCARINA_SONG_SUNS:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP));
case OCARINA_SONG_WIND_FISH_DEKU:
return (Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_RIGHT) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_A) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_DOWN) &&
Flags_GetRandoInf(RANDO_INF_OBTAINED_OCARINA_BUTTON_C_LEFT));
// case OCARINA_SONG_SCARECROW_SPAWN:
// break;
default:
return true;
}
}

inline bool CanAccessDungeon(DungeonSceneIndex dungeonIndex) {
bool hasSongAccess = false;
bool hasFormAccess = false;
Expand Down
2 changes: 1 addition & 1 deletion mm/2s2h/Rando/Logic/Regions/Central.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static RegisterShipInitFunc initFunc([]() {
};
Regions[RR_MILK_BAR] = RandoRegion{ .sceneId = SCENE_MILK_BAR,
.checks = {
CHECK(RC_MILK_BAR_CIRCUS_LEADER_MASK, CAN_BE_DEKU && CAN_BE_GORON && CAN_BE_ZORA && HAS_ITEM(ITEM_OCARINA_OF_TIME)),
CHECK(RC_MILK_BAR_CIRCUS_LEADER_MASK, CAN_BE_DEKU && CAN_BE_GORON && CAN_BE_ZORA && HAS_ITEM(ITEM_OCARINA_OF_TIME) && (canPlaySong(OCARINA_SONG_WIND_FISH_HUMAN) && canPlaySong(OCARINA_SONG_WIND_FISH_DEKU) && canPlaySong(OCARINA_SONG_WIND_FISH_GORON) && canPlaySong(OCARINA_SONG_WIND_FISH_ZORA))),
CHECK(RC_MILK_BAR_MADAME_AROMA, HAS_ITEM(ITEM_MASK_KAFEIS_MASK) && Flags_GetRandoInf(RANDO_INF_OBTAINED_LETTER_TO_MAMA)),
CHECK(RC_MILK_BAR_PURCHASE_CHATEAU, CAN_AFFORD(RC_MILK_BAR_PURCHASE_CHATEAU) && HAS_ITEM(ITEM_MASK_ROMANI)),
CHECK(RC_MILK_BAR_PURCHASE_MILK, CAN_AFFORD(RC_MILK_BAR_PURCHASE_MILK) && HAS_ITEM(ITEM_MASK_ROMANI)),
Expand Down
2 changes: 1 addition & 1 deletion mm/2s2h/Rando/Logic/Regions/West.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static RegisterShipInitFunc initFunc([]() {
};
Regions[RR_ZORA_HALL_EVANS_ROOM] = RandoRegion{ .name = "Evan's Room", .sceneId = SCENE_BANDROOM,
.checks = {
CHECK(RC_ZORA_HALL_EVANS_PIECE_OF_HEART, HAS_ITEM(ITEM_OCARINA_OF_TIME)),
CHECK(RC_ZORA_HALL_EVANS_PIECE_OF_HEART, HAS_ITEM(ITEM_OCARINA_OF_TIME) && (canPlaySong(OCARINA_SONG_EVAN_PART1) && canPlaySong(OCARINA_SONG_EVAN_PART2))),
},
.exits = { // TO FROM
EXIT(ENTRANCE(ZORA_HALL, 4), ENTRANCE(ZORA_HALL_ROOMS, 3), true),
Expand Down
13 changes: 10 additions & 3 deletions mm/2s2h/Rando/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ std::unordered_map<int32_t, const char*> accessTrialsOptions = {
std::vector<int32_t> incompatibleWithVanilla = {
RO_SHUFFLE_BOSS_SOULS,
RO_SHUFFLE_SWIM,
RO_SHUFFLE_OCARINA_BUTTONS,
RO_PLENTIFUL_ITEMS,
};

Expand Down Expand Up @@ -280,6 +281,12 @@ static void DrawItemsTab() {
"into deep water will respawn Link.",
.disabled = IncompatibleWithLogicSetting(RO_SHUFFLE_SWIM),
.disabledTooltip = "Incompatible with current Logic Setting" } }));
CVarCheckbox("Shuffle Ocarina Buttons", Rando::StaticData::Options[RO_SHUFFLE_OCARINA_BUTTONS].cvar,
CheckboxOptions({ { .tooltip = "Shuffles the Buttons used to play Ocarina Notes,\n"
"you will be unable to play a song until you find all\n"
"notes for the given melody.",
.disabled = IncompatibleWithLogicSetting(RO_SHUFFLE_OCARINA_BUTTONS),
.disabledTooltip = "Incompatible with current Logic Setting" } }));
CVarCheckbox("Deku Stick Bag", "gPlaceholderBool",
CheckboxOptions({ { .disabled = true, .disabledTooltip = "Coming Soon" } }));
CVarCheckbox("Deku Nut Bag", "gPlaceholderBool",
Expand Down Expand Up @@ -420,8 +427,8 @@ static void DrawStartingItemsTab() {
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.0f, 1.0f, 1.0f, 0.2f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 1.0f, 1.0f, 0.1f));

std::vector<RandoItemId> setStartingItemsList =
convertStartingItemsToRandoItemId(CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT), ",");
std::vector<RandoItemId> setStartingItemsList = convertStartingItemsToRandoItemId(
CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT.c_str()), ",");
uint32_t listIndex = 0;
for (auto& startingItem : setStartingItemsList) {
ImGui::PushID(listIndex);
Expand Down Expand Up @@ -503,7 +510,7 @@ static void DrawStartingItemsTab() {
? ITEM_SONG_LULLABY
: randoStaticItem.itemId))) {
std::string currentStartingItems =
CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT);
CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT.c_str());
if (currentStartingItems.length() != 0) {
currentStartingItems += ",";
}
Expand Down
14 changes: 13 additions & 1 deletion mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void Rando::MiscBehavior::OnFileCreate(s16 fileNum) {
}

std::vector<RandoItemId> startingItems = convertStartingItemsToRandoItemId(
CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT), ",");
CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT.c_str()), ",");

std::string startingItemSave = CreateStartingItemsToCvar(startingItems);
strncpy(RANDO_STARTING_ITEMS, startingItemSave.c_str(), startingItemSave.size() + 1);
Expand Down Expand Up @@ -253,6 +253,18 @@ void Rando::MiscBehavior::OnFileCreate(s16 fileNum) {
Flags_SetRandoInf(RANDO_INF_OBTAINED_SWIM);
}

// Shuffle Ocarina Buttons or grant the Rando INF if not enabled
if (RANDO_SAVE_OPTIONS[RO_SHUFFLE_OCARINA_BUTTONS] == RO_GENERIC_YES) {
for (int i = RI_OCARINA_BUTTON_A; i <= RI_OCARINA_BUTTON_C_UP; i++) {
itemPool.push_back((RandoItemId)i);
}
} else {
for (int i = RANDO_INF_OBTAINED_OCARINA_BUTTON_A; i <= RANDO_INF_OBTAINED_OCARINA_BUTTON_C_UP;
i++) {
Flags_SetRandoInf(i);
}
}

// Remove starting items from the pool (but only one per entry in startingItems)
for (RandoItemId startingItem : startingItems) {
auto it = std::find(itemPool.begin(), itemPool.end(), startingItem);
Expand Down
5 changes: 3 additions & 2 deletions mm/2s2h/Rando/Rando.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
#define RANDO_EVENTS gSaveContext.save.shipSaveInfo.rando.randoEvents
#define RANDO_STARTING_ITEMS gSaveContext.save.shipSaveInfo.rando.randoStartingItems

#define RANDO_STARTING_ITEMS_DEFAULT \
"109,126,91,146" // This includes a Progressive Sword, Hero's Shield, Ocarina of Time, and Song of Time
#define RANDO_STARTING_ITEMS_DEFAULT \
(std::to_string(RI_PROGRESSIVE_SWORD) + "," + std::to_string(RI_SHIELD_HERO) + "," + std::to_string(RI_OCARINA) + \
"," + std::to_string(RI_SONG_TIME))

namespace Rando {

Expand Down
Loading
Loading