Fix big poe bottle logic (#4837)

* fix big poe logic

* oops
This commit is contained in:
Pepper0ni 2025-01-15 12:47:30 +00:00 committed by GitHub
parent d3c619ec2f
commit 95a4e1cfba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 11 deletions

View File

@ -164,7 +164,7 @@ static void ApplyAllAdvancmentItems(){
static void ValidateSphereZero(GetAccessibleLocationsStruct& gals){ static void ValidateSphereZero(GetAccessibleLocationsStruct& gals){
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
// Condition for verifying everything required for sphere 0, expanding search to all locations // Condition for verifying everything required for sphere 0, expanding search to all locations
if (logic->CanEmptyBigPoes && gals.validatedStartingRegion && gals.foundTempleOfTime && gals.haveTimeAccess) { if (logic->CouldEmptyBigPoes && gals.validatedStartingRegion && gals.foundTempleOfTime && gals.haveTimeAccess) {
// Apply all items that are necessary for checking all location access // Apply all items that are necessary for checking all location access
ApplyAllAdvancmentItems(); ApplyAllAdvancmentItems();
// Reset access as the non-starting age // Reset access as the non-starting age
@ -565,7 +565,7 @@ void ValidateEntrances(bool checkPoeCollectorAccess, bool checkOtherEntranceAcce
ctx->allLocationsReachable = false; ctx->allLocationsReachable = false;
if (checkPoeCollectorAccess){ if (checkPoeCollectorAccess){
logic->CanEmptyBigPoes = false; logic->CouldEmptyBigPoes = false;
} }
if (checkOtherEntranceAccess){ if (checkOtherEntranceAccess){

View File

@ -35,6 +35,7 @@ void RegionTable_Init_Market() {
areaTable[RR_MARKET_GUARD_HOUSE] = Region("Market Guard House", "Market Guard House", {}, NO_DAY_NIGHT_CYCLE, { areaTable[RR_MARKET_GUARD_HOUSE] = Region("Market Guard House", "Market Guard House", {}, NO_DAY_NIGHT_CYCLE, {
//Events //Events
EventAccess(&logic->CouldEmptyBigPoes, []{return logic->IsAdult;}),
EventAccess(&logic->CanEmptyBigPoes, []{return logic->IsAdult;}), EventAccess(&logic->CanEmptyBigPoes, []{return logic->IsAdult;}),
}, { }, {
//Locations //Locations

View File

@ -880,14 +880,27 @@ namespace Rando {
uint8_t Logic::BottleCount() { uint8_t Logic::BottleCount() {
uint8_t count = 0; uint8_t count = 0;
if (!CanEmptyBigPoes){ if (CouldEmptyBigPoes){
return 0;
}
for (int i = SLOT_BOTTLE_1; i <= SLOT_BOTTLE_4; i++) { for (int i = SLOT_BOTTLE_1; i <= SLOT_BOTTLE_4; i++) {
uint8_t item = GetSaveContext()->inventory.items[i]; uint8_t item = GetSaveContext()->inventory.items[i];
if (item != ITEM_NONE && (item != ITEM_LETTER_RUTO || (item == ITEM_LETTER_RUTO && DeliverLetter))) { switch (item) {
case ITEM_LETTER_RUTO:
if (DeliverLetter) {
count++; count++;
} }
break;
case ITEM_BIG_POE:
if (CanEmptyBigPoes) {
count++;
}
break;
case ITEM_NONE:
break;
default:
count++;
break;
}
}
} }
return count; return count;
} }

View File

@ -65,7 +65,10 @@ class Logic {
// Bottle Count // Bottle Count
uint8_t Bottles = 0; uint8_t Bottles = 0;
uint8_t NumBottles = 0; uint8_t NumBottles = 0;
bool CanEmptyBigPoes = true; //this event covers if the player can currently empty big poes in logic
bool CanEmptyBigPoes = false;
//this check covers if the generation has confirmed that it's possible to empty big poes if needed as adult
bool CouldEmptyBigPoes = true;
// Drops and Bottle Contents Access // Drops and Bottle Contents Access
bool NutPot = false; bool NutPot = false;