diff options
| author | Caladius <Caladius@users.noreply.github.com> | 2025-10-18 19:57:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-18 19:57:30 -0400 |
| commit | 43fd6756030e24f49127aa8835d073038007378a (patch) | |
| tree | bcc007634a7c2aaabec64493741c1ee27fe9eb6f /mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp | |
| parent | 5ef25f993fd15bd08e529651a2d55f75db392ea4 (diff) | |
[Rando] Starting Items Rework (Cleaner Edition) (#1295)
* WIP
* Reworked Starting Items
* Clean up
* Clean up 2
* default macro for cvar
* Spoiler and Save File handling
* Fix spoiler drop
---------
Co-authored-by: Eblo <7004497+Eblo@users.noreply.github.com>
Diffstat (limited to 'mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp')
| -rw-r--r-- | mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp b/mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp index f9d691a73..f264bf407 100644 --- a/mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp +++ b/mm/2s2h/Rando/MiscBehavior/OnFileCreate.cpp @@ -59,6 +59,12 @@ void Rando::MiscBehavior::OnFileCreate(s16 fileNum) { (uint32_t)CVarGetInteger(randoStaticOption.cvar, randoStaticOption.defaultValue); } + std::vector<RandoItemId> startingItems = convertStartingItemsToRandoItemId( + CVarGetString("gRando.StartingItems", RANDO_STARTING_ITEMS_DEFAULT), ","); + + std::string startingItemSave = CreateStartingItemsToCvar(startingItems); + strncpy(RANDO_STARTING_ITEMS, startingItemSave.c_str(), startingItemSave.size() + 1); + if (RANDO_SAVE_OPTIONS[RO_STARTING_HEALTH] != 3) { gSaveContext.save.saveInfo.playerData.healthCapacity = gSaveContext.save.saveInfo.playerData.health = RANDO_SAVE_OPTIONS[RO_STARTING_HEALTH] * 0x10; @@ -76,23 +82,6 @@ void Rando::MiscBehavior::OnFileCreate(s16 fileNum) { AMMO(ITEM_DEKU_NUT) = CUR_CAPACITY(UPG_DEKU_NUTS); } - std::vector<RandoItemId> startingItems = {}; - for (size_t i = 0; i < Rando::StaticData::StartingItemsMap.size(); i++) { - RandoItemId itemId = Rando::StaticData::StartingItemsMap[i]; - RandoOptionId optionId; - if (i < 32) { - optionId = RO_STARTING_ITEMS_1; - } else if (i < 64) { - optionId = RO_STARTING_ITEMS_2; - } else { - optionId = RO_STARTING_ITEMS_3; - } - uint32_t startingItemsBits = RANDO_SAVE_OPTIONS[optionId]; - if ((startingItemsBits & (1 << (i % 32))) != 0) { - startingItems.push_back(itemId); - } - } - if (RANDO_SAVE_OPTIONS[RO_STARTING_MAPS_AND_COMPASSES]) { std::vector<RandoItemId> MapsAndCompasses = { RI_GREAT_BAY_COMPASS, RI_GREAT_BAY_MAP, RI_SNOWHEAD_COMPASS, |
