mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-07 03:17:22 -04:00
implement golden wolf checks
This commit is contained in:
@@ -67,6 +67,9 @@ std::optional<std::string> RandomizerContext::WriteToFile() {
|
||||
const std::unordered_map<u16, u16> u16SkyCharacterOverrides(this->mSkyCharacterOverrides.begin(), this->mSkyCharacterOverrides.end());
|
||||
out["mSkyCharacterOverrides"] = u16SkyCharacterOverrides;
|
||||
|
||||
const std::unordered_map<u16, u16> u16GoldenWolfOverrides(this->mGoldenWolfOverrides.begin(), this->mGoldenWolfOverrides.end());
|
||||
out["mGoldenWolfOverrides"] = u16GoldenWolfOverrides;
|
||||
|
||||
out["mItemLocations"] = this->mItemLocations;
|
||||
|
||||
out["mStartHour"] = static_cast<u16>(this->mStartHour);
|
||||
@@ -172,6 +175,13 @@ std::optional<std::string> RandomizerContext::LoadFromHash(const std::string& ha
|
||||
this->mSkyCharacterOverrides[key] = itemId;
|
||||
}
|
||||
|
||||
// Golden Wolves
|
||||
for (const auto& goldenWolfNode : in["mGoldenWolfOverrides"]) {
|
||||
u16 key = goldenWolfNode.first.as<u16>();
|
||||
u8 itemId = goldenWolfNode.second.as<u8>();
|
||||
this->mGoldenWolfOverrides[key] = itemId;
|
||||
}
|
||||
|
||||
// Items we call by location name
|
||||
for (const auto& locationNode : in["mItemLocations"]) {
|
||||
const auto& locationName = locationNode.first.as<std::string>();
|
||||
@@ -624,6 +634,14 @@ void GenerateAndWriteSeed(std::string& generationStatusMsg) {
|
||||
randoData.mSkyCharacterOverrides[key] = itemId;
|
||||
}
|
||||
|
||||
// Golden Wolves
|
||||
// Keyed by u16 of the event flag for obtaining the golden wolf item
|
||||
if (location->HasCategories("Golden Wolf")) {
|
||||
u16 flag = metaData[0]["Flag"].as<u16>();
|
||||
u8 itemId = location->GetCurrentItem()->GetID();
|
||||
randoData.mGoldenWolfOverrides[flag] = itemId;
|
||||
}
|
||||
|
||||
// Items that we lookup just by calling their location name
|
||||
if (location->HasCategories("Location Name Lookup")) {
|
||||
const auto& locationName = metaData.as<std::string>();
|
||||
@@ -833,4 +851,4 @@ void GenerateAndWriteSeed(std::string& generationStatusMsg) {
|
||||
}
|
||||
|
||||
generationStatusMsg = fmt::format("Seed generated! Hash: {}", randoData.mHash);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user