fix: use trick names for scrub and house of skulltula hints (#2528)

* update writealllocations to always write trickname and start seeing where things break

* handle simple vs complex items

* always grab a trick name

---------

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2023-02-24 03:21:35 -05:00 committed by GitHub
parent df6da69f7d
commit 95fe6b492b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -726,42 +726,39 @@ static void WriteAllLocations(int language) {
break;
}
// Eventually check for other things here like fake name
if (location->HasScrubsanityPrice() || location->HasShopsanityPrice()) {
jsonData["locations"][location->GetName()]["item"] = placedItemName;
if (location->GetPlacedItemKey() == ICE_TRAP && location->IsCategory(Category::cShop)) {
switch (language) {
case 0:
default:
jsonData["locations"][location->GetName()]["model"] =
ItemFromGIID(iceTrapModels[location->GetRandomizerCheck()]).GetName().english;
jsonData["locations"][location->GetName()]["trickName"] =
NonShopItems[TransformShopIndex(GetShopIndex(key))].Name.english;
break;
case 2:
jsonData["locations"][location->GetName()]["model"] =
ItemFromGIID(iceTrapModels[location->GetRandomizerCheck()]).GetName().french;
jsonData["locations"][location->GetName()]["trickName"] =
NonShopItems[TransformShopIndex(GetShopIndex(key))].Name.french;
break;
}
}
jsonData["locations"][location->GetName()]["price"] = location->GetPrice();
} else if (location->GetPlacedItemKey() == ICE_TRAP && iceTrapModels.contains(location->GetRandomizerCheck())) {
jsonData["locations"][location->GetName()]["item"] = placedItemName;
switch (language) {
case 0:
default:
jsonData["locations"][location->GetName()]["model"] =
ItemFromGIID(iceTrapModels[location->GetRandomizerCheck()]).GetName().english;
break;
case 2:
jsonData["locations"][location->GetName()]["model"] =
ItemFromGIID(iceTrapModels[location->GetRandomizerCheck()]).GetName().french;
break;
}
} else {
// If it's a simple item (not an ice trap, doesn't have a price)
// just add the name of the item and move on
if (!location->HasScrubsanityPrice() &&
!location->HasShopsanityPrice() &&
location->GetPlacedItemKey() != ICE_TRAP) {
jsonData["locations"][location->GetName()] = placedItemName;
continue;
}
// We're dealing with a complex item, build out the json object for it
jsonData["locations"][location->GetName()]["item"] = placedItemName;
if (location->HasScrubsanityPrice() || location->HasShopsanityPrice()) {
jsonData["locations"][location->GetName()]["price"] = location->GetPrice();
}
if (location->GetPlacedItemKey() == ICE_TRAP) {
switch (language) {
case 0:
default:
jsonData["locations"][location->GetName()]["model"] =
ItemFromGIID(iceTrapModels[location->GetRandomizerCheck()]).GetName().english;
jsonData["locations"][location->GetName()]["trickName"] =
GetIceTrapName(iceTrapModels[location->GetRandomizerCheck()]).english;
break;
case 2:
jsonData["locations"][location->GetName()]["model"] =
ItemFromGIID(iceTrapModels[location->GetRandomizerCheck()]).GetName().french;
jsonData["locations"][location->GetName()]["trickName"] =
GetIceTrapName(iceTrapModels[location->GetRandomizerCheck()]).french;
break;
}
}
}
}