Skip to content

Commit

Permalink
StartingNotebook (#68)
Browse files Browse the repository at this point in the history
* StartingNotebook

theres a lot of extra adds / removes because the main mm3d_randomizer points to a specific commit and im too dumb to get it to work right. important changes are as follows
Settings.h > Added u8 startingNotebook;

Savefile.cpp > added if statement into starting inventory section
//Notebook
    if(gSettingsContext.startingNotebook > 0) {
      saveData.inventory.collect_register.bombers_notebook = 1;
    }

Spoiler_data.cpp > added two missing multilocation checks for the ranch map in snowhead

* Update settings.h

* Update savefile.cpp
  • Loading branch information
Tacoman369 authored May 27, 2024
1 parent 01ef895 commit 09d5cff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
17 changes: 2 additions & 15 deletions code/include/rnd/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ namespace rnd {
LOGIC_GLITCHED,
};

enum class KnowSetting : u8 {
KNOW_BASIC,
KNOW_ADVANCED,
// KNOW_COMPLETE,
};

enum class AmmoDropsSetting : u8 {
AMMODROPS_VANILLA,
AMMODROPS_BOMBCHU,
Expand Down Expand Up @@ -251,20 +245,13 @@ namespace rnd {
PLAY_ON_CITRA,
} PlayOption;

typedef enum {
REGION_NA,
REGION_EUR,
} Region;

typedef struct {
u8 hashIndexes[5];

u8 playOption;
u8 region;

u8 logic;
u8 locationsReachable;
u8 knowTheGame;

u8 shuffleDungeonEntrances;
u8 bombchusInLogic;
Expand Down Expand Up @@ -326,6 +313,7 @@ namespace rnd {

u8 startingConsumables;
u8 startingMaxRupees;
u8 startingNotebook;
u8 startingOcarina;
u8 startingHerosBow;
u8 startingFireArrows;
Expand Down Expand Up @@ -416,7 +404,6 @@ namespace rnd {
u8 enableFastOcarina;
u8 enableFastArrowSwap;
u8 twinmoldRestoration;
u8 enableNoAnimationTransform;

// Cutscene Skips
u8 skipHMSCutscenes;
Expand All @@ -429,7 +416,7 @@ namespace rnd {
u32 customMaskButton = 0;
u32 customNotebookButton = 0;
u32 customIngameSpoilerButton = 0;

u8 enableNoAnimationTransform;
// Extra MM Settings
u8 blastMaskCooldown;
} SettingsContext;
Expand Down
14 changes: 11 additions & 3 deletions code/source/rnd/savefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace rnd {
gSettingsContext.skipBombersMinigame = 1;
gSettingsContext.freeScarecrow = 1;
saveData.activate_dungeon_skip_portal_0xF0_for_all = 0xF0;
// SaveFile_FillOverWorldMapData();
SaveFile_FillOverWorldMapData();
saveData.inventory.collect_register.oath_to_order = 1;

// Boss Remains
Expand Down Expand Up @@ -366,7 +366,7 @@ namespace rnd {
// game::SaveData& saveBackupData = game::GetCommonData().save_backup;
game::SaveData& saveData = game::GetCommonData().save;
// give maps and compasses
if (gSettingsContext.mapsAndCompasses == (u8)MapsAndCompassesSetting::MAPSANDCOMPASSES_START_WITH) {
if (gSettingsContext.mapsAndCompasses == (u8)MapsAndCompassesSetting::MAPSANDCOMPASSES_ANY_DUNGEON) {
saveData.inventory.woodfall_dungeon_items.map = 1;
saveData.inventory.woodfall_dungeon_items.compass = 1;
saveData.inventory.snowhead_dungeon_items.map = 1;
Expand All @@ -376,6 +376,9 @@ namespace rnd {
saveData.inventory.stone_tower_dungeon_items.map = 1;
saveData.inventory.stone_tower_dungeon_items.compass = 1;
}
if (gSettingsContext.mapsAndCompasses == (u8)MapsAndCompassesSetting::MAPSANDCOMPASSES_OVERWORLD) {
SaveFile_FillOverWorldMapData();
}

// give small keys
if (gSettingsContext.keysanity == (u8)KeysanitySetting::KEYSANITY_START_WITH) {
Expand Down Expand Up @@ -465,7 +468,7 @@ namespace rnd {
} else {
saveData.inventory.inventory_count_register.quiver_upgrade = game::Quiver::NoQuiver;
#ifdef ENABLE_DEBUG
// saveData.inventory.inventory_count_register.quiver_upgrade = game::Quiver::Quiver50;
saveData.inventory.inventory_count_register.quiver_upgrade = game::Quiver::Quiver50;
// rnd::util::GetPointer<void(game::ItemId, int)>(0x21d440)(game::ItemId::Arrow, 0x1e);
#endif
}
Expand Down Expand Up @@ -776,6 +779,11 @@ namespace rnd {
if (gSettingsContext.startingSpinSettting == (u8)StartingSpinSetting::STARTINGSPIN_GREAT) {
saveData.has_great_spin_0x02 = 2;
}

//Notebook
if(gSettingsContext.startingNotebook > 0) {
saveData.inventory.collect_register.bombers_notebook = 1;
}
}

void SaveFile_ResetItemSlotsIfMatchesID(u8 itemSlot) {
Expand Down
14 changes: 11 additions & 3 deletions code/source/rnd/spoiler_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,22 @@ namespace rnd {
if ((scene == 0x5E) && (flag == 0xB7) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
SpoilerData_UpdateMultiLocations(type, 0x22, flag);
}
// Ranch Tingle Ranch Map > Snowhead Tingle Snowhead Map (Winter)
if ((scene == 0x22) && (flag == 0xB7) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
// Snowhead Tingle Ranch Map (Winter) > Snowhead Tingle Ranch Map (Spring)
if ((scene == 0x5D) && (flag == 0xB7) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
SpoilerData_UpdateMultiLocations(type, 0x5E, flag);
}
// Ranch Tingle Ranch Map > Snowhead Tingle Snowhead Map (Spring)
// Snowhead Tingle Ranch Map (Spring) > Snowhead Tingle Ranch Map (Winter)
if ((scene == 0x5E) && (flag == 0xB7) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
SpoilerData_UpdateMultiLocations(type, 0x5D, flag);
}
// Ranch Tingle Ranch Map > Snowhead Tingle Ranch Map (Winter)
if ((scene == 0x22) && (flag == 0xB7) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
SpoilerData_UpdateMultiLocations(type, 0x5D, flag);
}
// Ranch Tingle Ranch Map > Snowhead Tingle Ranch Map (Spring)
if ((scene == 0x22) && (flag == 0xB7) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
SpoilerData_UpdateMultiLocations(type, 0x5E, flag);
}
// Ranch Tingle Great Bay Map > Great Bay Tingle Great Bay Map
if ((scene == 0x22) && (flag == 0xB8) && (type == ItemOverride_Type::OVR_BASE_ITEM)) {
SpoilerData_UpdateMultiLocations(type, 0x37, flag);
Expand Down

0 comments on commit 09d5cff

Please sign in to comment.