implement Uli Cradle Delivery check

This commit is contained in:
gymnast86
2026-04-21 20:54:07 -07:00
parent 8774cfa31b
commit fa473d48a9
5 changed files with 34 additions and 4 deletions
+5
View File
@@ -1165,6 +1165,11 @@ int daNpc_Uri_c::cutEndCarryTutorial(int param_1) {
(s32)mFlow.getEventId(&local_48) == 1)
{
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
if (randomizer_IsActive()) {
local_48 = randomizer_getItemAtLocation("Uli Cradle Delivery");
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, local_48, 0, -1, -1, NULL, NULL);
}
+11 -1
View File
@@ -44,21 +44,31 @@ namespace dusk {
RandomizerContext randoData{};
// Settings we need to check ingame
for (const auto& [setting, info] : *randomizer::seedgen::settings::GetAllSettingsInfo()) {
if (info->NeedInGame()) {
randoData.mSettings[setting] = world->Setting(setting).GetCurrentOption();
}
}
// Chest overrides
// Set data for all locations
for (const auto& location : world->GetAllLocations()) {
const auto& metaData = location->GetMetadata();
// Chest Overrides
if (location->HasCategories("Chest")) {
const auto& stage = metaData[0]["Stage"].as<std::string>();
const auto& tboxId = metaData[0]["Tbox ID"].as<u8>();
const auto& itemId = location->GetCurrentItem()->GetID();
randoData.mTreasureChestOverrides[stage][tboxId] = itemId;
}
// Items that we lookup just by calling their location name
if (location->HasCategories("Location Name Lookup")) {
const auto& locationName = metaData.as<std::string>();
const int itemId = location->GetCurrentItem()->GetID();
randoData.mItemLocations[locationName] = itemId;
}
}
// Set starting inventory
@@ -55,6 +55,8 @@ std::optional<std::string> RandomizerContext::WriteToFile() {
}
}
out["mItemLocations"] = this->mItemLocations;
out["mStartHour"] = static_cast<u16>(this->mStartHour);
out["mMapBits"] = static_cast<u16>(this->mMapBits);
@@ -114,6 +116,13 @@ std::optional<std::string> RandomizerContext::LoadFromHash(const std::string& ha
}
}
// Items For Present Demos
for (const auto& locationNode : in["mItemLocations"]) {
const auto& locationName = locationNode.first.as<std::string>();
int itemId = locationNode.second.as<int>();
this->mItemLocations[locationName] = itemId;
}
// Starting hour
this->mStartHour = in["mStartHour"].as<u8>();
// Starting map bits
@@ -152,6 +161,10 @@ std::vector<u8> HexToBytes(std::string hex) {
return bytes;
}
int randomizer_getItemAtLocation(const std::string& locationName) {
return randomizer_GetContext().mItemLocations[locationName];
}
u32 getActorPatchesCurrentStageKey() {
u32 actorPatchesStageKey{};
actorPatchesStageKey |= getStageID(dComIfGp_getStartStageName()) << 16;
@@ -27,6 +27,7 @@ public:
std::list<u8> mStartingInventory{};
std::unordered_map<std::string, std::unordered_map<u8, u8>> mTreasureChestOverrides{};
std::unordered_map<std::string, std::unordered_map<u8, u8>> mPoeOverrides{};
std::unordered_map<std::string, int> mItemLocations{};
u8 mStartHour{0};
u8 mMapBits{};
@@ -41,6 +42,8 @@ RandomizerContext& randomizer_GetContext();
bool randomizer_IsActive();
int randomizer_getItemAtLocation(const std::string& locationName);
/**
* Helper function to convert raw bytes of a container to a hex string
*/
@@ -27,9 +27,8 @@
Categories:
- Overworld
- Ordona Province
- ARC
Metadata:
- None
- Location Name Lookup
Metadata: Uli Cradle Delivery
- Name: Ordon Cat Rescue
Original Item: Bottle with Half Milk