Skip to content

Commit

Permalink
fix winuser ischild ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
briaguya-ai committed Nov 12, 2023
1 parent f033cb6 commit 849057b
Show file tree
Hide file tree
Showing 18 changed files with 181 additions and 181 deletions.
12 changes: 6 additions & 6 deletions soh/soh/Enhancements/randomizer/3drando/location_access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ std::vector<EventAccess> grottoEvents = {
//set the logic to be a specific age and time of day and see if the condition still holds
bool LocationAccess::CheckConditionAtAgeTime(bool& age, bool& time) const {

IsChild = false;
Logic::IsChild = false;
IsAdult = false;
AtDay = false;
AtNight = false;
Expand All @@ -45,8 +45,8 @@ bool LocationAccess::ConditionsMet() const {
Area* parentRegion = AreaTable(Rando::Context::GetInstance()->GetItemLocation(location)->GetParentRegionKey());
bool conditionsMet = false;

if ((parentRegion->childDay && CheckConditionAtAgeTime(IsChild, AtDay)) ||
(parentRegion->childNight && CheckConditionAtAgeTime(IsChild, AtNight)) ||
if ((parentRegion->childDay && CheckConditionAtAgeTime(Logic::IsChild, AtDay)) ||
(parentRegion->childNight && CheckConditionAtAgeTime(Logic::IsChild, AtNight)) ||
(parentRegion->adultDay && CheckConditionAtAgeTime(IsAdult, AtDay)) ||
(parentRegion->adultNight && CheckConditionAtAgeTime(IsAdult, AtNight))) {
conditionsMet = true;
Expand Down Expand Up @@ -128,8 +128,8 @@ bool Area::UpdateEvents(SearchMode mode) {
continue;
}

if ((childDay && event.CheckConditionAtAgeTime(IsChild, AtDay)) ||
(childNight && event.CheckConditionAtAgeTime(IsChild, AtNight)) ||
if ((childDay && event.CheckConditionAtAgeTime(Logic::IsChild, AtDay)) ||
(childNight && event.CheckConditionAtAgeTime(Logic::IsChild, AtNight)) ||
(adultDay && event.CheckConditionAtAgeTime(IsAdult, AtDay)) ||
(adultNight && event.CheckConditionAtAgeTime(IsAdult, AtNight))) {
event.EventOccurred();
Expand Down Expand Up @@ -269,7 +269,7 @@ void AreaTable_Init() {

areaTable[RR_ROOT_EXITS] = Area("Root Exits", "", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {}, {
//Exits
Entrance(RR_CHILD_SPAWN, {[]{return IsChild;}}),
Entrance(RR_CHILD_SPAWN, {[]{return Logic::IsChild;}}),
Entrance(RR_ADULT_SPAWN, {[]{return IsAdult;}}),
Entrance(RR_MINUET_OF_FOREST_WARP, {[]{return CanPlay(MinuetOfForest);}}),
Entrance(RR_BOLERO_OF_FIRE_WARP, {[]{return CanPlay(BoleroOfFire) && CanLeaveForest;}}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ void AreaTable_Init_BottomOfTheWell() {
---------------------------*/
areaTable[RR_BOTTOM_OF_THE_WELL_ENTRYWAY] = Area("Bottom of the Well Entryway", "Bottom of the Well", RHT_BOTTOM_OF_THE_WELL, NO_DAY_NIGHT_CYCLE, {}, {}, {
//Exits
Entrance(RR_BOTTOM_OF_THE_WELL_MAIN_AREA, {[]{return Dungeon::BottomOfTheWell.IsVanilla() && IsChild && (CanChildAttack || Nuts);}}),
Entrance(RR_BOTTOM_OF_THE_WELL_MQ_PERIMETER, {[]{return Dungeon::BottomOfTheWell.IsMQ() && IsChild;}}),
Entrance(RR_BOTTOM_OF_THE_WELL_MAIN_AREA, {[]{return Dungeon::BottomOfTheWell.IsVanilla() && Logic::IsChild && (CanChildAttack || Nuts);}}),
Entrance(RR_BOTTOM_OF_THE_WELL_MQ_PERIMETER, {[]{return Dungeon::BottomOfTheWell.IsMQ() && Logic::IsChild;}}),
Entrance(RR_KAKARIKO_VILLAGE, {[]{return true;}}),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ void AreaTable_Init_CastleTown() {
Entrance(RR_MARKET_ENTRANCE, {[]{return true;}}),
Entrance(RR_TOT_ENTRANCE, {[]{return true;}}),
Entrance(RR_CASTLE_GROUNDS, {[]{return true;}}),
Entrance(RR_MARKET_BAZAAR, {[]{return IsChild && AtDay;}}),
Entrance(RR_MARKET_MASK_SHOP, {[]{return IsChild && AtDay;}}),
Entrance(RR_MARKET_SHOOTING_GALLERY, {[]{return IsChild && AtDay;}}),
Entrance(RR_MARKET_BOMBCHU_BOWLING, {[]{return IsChild;}}),
Entrance(RR_MARKET_TREASURE_CHEST_GAME, {[]{return IsChild && AtNight;}}),
Entrance(RR_MARKET_POTION_SHOP, {[]{return IsChild && AtDay;}}),
Entrance(RR_MARKET_BACK_ALLEY, {[]{return IsChild;}}),
Entrance(RR_MARKET_BAZAAR, {[]{return Logic::IsChild && AtDay;}}),
Entrance(RR_MARKET_MASK_SHOP, {[]{return Logic::IsChild && AtDay;}}),
Entrance(RR_MARKET_SHOOTING_GALLERY, {[]{return Logic::IsChild && AtDay;}}),
Entrance(RR_MARKET_BOMBCHU_BOWLING, {[]{return Logic::IsChild;}}),
Entrance(RR_MARKET_TREASURE_CHEST_GAME, {[]{return Logic::IsChild && AtNight;}}),
Entrance(RR_MARKET_POTION_SHOP, {[]{return Logic::IsChild && AtDay;}}),
Entrance(RR_MARKET_BACK_ALLEY, {[]{return Logic::IsChild;}}),
});

areaTable[RR_MARKET_BACK_ALLEY] = Area("Market Back Alley", "Market", RHT_THE_MARKET, NO_DAY_NIGHT_CYCLE, {}, {}, {
Expand Down Expand Up @@ -53,7 +53,7 @@ void AreaTable_Init_CastleTown() {
areaTable[RR_TEMPLE_OF_TIME] = Area("Temple of Time", "Temple of Time", RHT_TEMPLE_OF_TIME, NO_DAY_NIGHT_CYCLE, {}, {
//Locations
LocationAccess(RC_TOT_LIGHT_ARROWS_CUTSCENE, {[]{return IsAdult && CanTriggerLACS;}}),
LocationAccess(RC_ALTAR_HINT_CHILD, {[]{return IsChild;}}),
LocationAccess(RC_ALTAR_HINT_CHILD, {[]{return Logic::IsChild;}}),
LocationAccess(RC_ALTAR_HINT_ADULT, {[]{return IsAdult;}}),
}, {
//Exits
Expand All @@ -75,7 +75,7 @@ void AreaTable_Init_CastleTown() {
areaTable[RR_CASTLE_GROUNDS] = Area("Castle Grounds", "Castle Grounds", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {}, {
//Exits
Entrance(RR_THE_MARKET, {[]{return true;}}),
Entrance(RR_HYRULE_CASTLE_GROUNDS, {[]{return IsChild;}}),
Entrance(RR_HYRULE_CASTLE_GROUNDS, {[]{return Logic::IsChild;}}),
Entrance(RR_GANONS_CASTLE_GROUNDS, {[]{return IsAdult;}}),
});

Expand Down Expand Up @@ -154,7 +154,7 @@ void AreaTable_Init_CastleTown() {

areaTable[RR_CASTLE_GROUNDS_FROM_GANONS_CASTLE] = Area("Castle Grounds From Ganon's Castle", "Castle Grounds From Ganon's Castle", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {}, {
// Exits
Entrance(RR_HYRULE_CASTLE_GROUNDS, { [] { return IsChild; }}),
Entrance(RR_HYRULE_CASTLE_GROUNDS, { [] { return Logic::IsChild; }}),
Entrance(RR_GANONS_CASTLE_LEDGE, { [] { return IsAdult; }}),
});

Expand All @@ -168,7 +168,7 @@ void AreaTable_Init_CastleTown() {
areaTable[RR_MARKET_GUARD_HOUSE] = Area("Market Guard House", "Market Guard House", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {
//Locations
LocationAccess(RC_MARKET_10_BIG_POES, {[]{return IsAdult && BigPoeKill;}}),
LocationAccess(RC_MARKET_GS_GUARD_HOUSE, {[]{return IsChild;}}),
LocationAccess(RC_MARKET_GS_GUARD_HOUSE, {[]{return Logic::IsChild;}}),
}, {
//Exits
Entrance(RR_MARKET_ENTRANCE, {[]{return true;}}),
Expand Down Expand Up @@ -200,7 +200,7 @@ void AreaTable_Init_CastleTown() {

areaTable[RR_MARKET_SHOOTING_GALLERY] = Area("Market Shooting Gallery", "Market Shooting Gallery", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {
//Locations
LocationAccess(RC_MARKET_SHOOTING_GALLERY_REWARD, {[]{return IsChild;}}),
LocationAccess(RC_MARKET_SHOOTING_GALLERY_REWARD, {[]{return Logic::IsChild;}}),
}, {
//Exits
Entrance(RR_THE_MARKET, {[]{return true;}}),
Expand Down Expand Up @@ -262,7 +262,7 @@ void AreaTable_Init_CastleTown() {

areaTable[RR_MARKET_DOG_LADY_HOUSE] = Area("Market Dog Lady House", "Market Dog Lady House", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {
//Locations
LocationAccess(RC_MARKET_LOST_DOG, {[]{return IsChild && AtNight;}}),
LocationAccess(RC_MARKET_LOST_DOG, {[]{return Logic::IsChild && AtNight;}}),
}, {
//Exits
Entrance(RR_MARKET_BACK_ALLEY, {[]{return true;}}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void AreaTable_Init_DeathMountain() {
EventAccess(&BeanPlantFairy, {[]{return BeanPlantFairy || (CanPlantBean(RR_DEATH_MOUNTAIN_TRAIL) && CanPlay(SongOfStorms) && (HasExplosives || GoronBracelet));}}),
}, {
//Locations
LocationAccess(RC_DMT_CHEST, {[]{return CanBlastOrSmash || (LogicDMTBombable && IsChild && GoronBracelet);}}),
LocationAccess(RC_DMT_CHEST, {[]{return CanBlastOrSmash || (LogicDMTBombable && Logic::IsChild && GoronBracelet);}}),
LocationAccess(RC_DMT_FREESTANDING_POH, {[]{return CanTakeDamage || CanUse(RG_HOVER_BOOTS) || (IsAdult && CanPlantBean(RR_DEATH_MOUNTAIN_TRAIL) && (HasExplosives || GoronBracelet));}}),
LocationAccess(RC_DMT_GS_BEAN_PATCH, {[]{return CanPlantBugs && (HasExplosives || GoronBracelet || (LogicDMTSoilGS && (CanTakeDamage || CanUse(RG_HOVER_BOOTS)) && CanUse(RG_BOOMERANG)));}}),
LocationAccess(RC_DMT_GS_NEAR_KAK, {[]{return CanBlastOrSmash;}}),
Expand All @@ -29,7 +29,7 @@ void AreaTable_Init_DeathMountain() {
//Events
EventAccess(&PrescriptionAccess, {[]{return PrescriptionAccess || (IsAdult && (BrokenSwordAccess || BrokenSword));}}),
EventAccess(&GossipStoneFairy, {[]{return GossipStoneFairy || CanSummonGossipFairy;}}),
EventAccess(&BugRock, {[]{return BugRock || IsChild;}}),
EventAccess(&BugRock, {[]{return BugRock || Logic::IsChild;}}),
}, {
//Locations
LocationAccess(RC_DMT_TRADE_BROKEN_SWORD, {[]{return IsAdult && BrokenSword;}}),
Expand All @@ -41,7 +41,7 @@ void AreaTable_Init_DeathMountain() {
//Exits
Entrance(RR_DEATH_MOUNTAIN_TRAIL, {[]{return true;}}),
Entrance(RR_DMC_UPPER_LOCAL, {[]{return true;}}),
Entrance(RR_DMT_OWL_FLIGHT, {[]{return IsChild;}}),
Entrance(RR_DMT_OWL_FLIGHT, {[]{return Logic::IsChild;}}),
Entrance(RR_DMT_COW_GROTTO, {[]{return Here(RR_DEATH_MOUNTAIN_SUMMIT, []{return CanBlastOrSmash;});}}),
Entrance(RR_DMT_GREAT_FAIRY_FOUNTAIN, {[]{return Here(RR_DEATH_MOUNTAIN_SUMMIT, []{return CanBlastOrSmash;});}}),
});
Expand Down Expand Up @@ -80,21 +80,21 @@ void AreaTable_Init_DeathMountain() {
areaTable[RR_GORON_CITY] = Area("Goron City", "Goron City", RHT_GORON_CITY, NO_DAY_NIGHT_CYCLE, {
//Events
EventAccess(&GossipStoneFairy, {[]{return GossipStoneFairy || CanSummonGossipFairyWithoutSuns;}}),
EventAccess(&StickPot, {[]{return StickPot || IsChild;}}),
EventAccess(&StickPot, {[]{return StickPot || Logic::IsChild;}}),
EventAccess(&BugRock, {[]{return BugRock || (CanBlastOrSmash || CanUse(RG_SILVER_GAUNTLETS));}}),
EventAccess(&GoronCityChildFire, {[]{return GoronCityChildFire || (IsChild && CanUse(RG_DINS_FIRE));}}),
EventAccess(&GoronCityChildFire, {[]{return GoronCityChildFire || (Logic::IsChild && CanUse(RG_DINS_FIRE));}}),
EventAccess(&GCWoodsWarpOpen, {[]{return GCWoodsWarpOpen || (CanBlastOrSmash || CanUse(RG_DINS_FIRE) || CanUse(RG_FAIRY_BOW) || GoronBracelet || GoronCityChildFire);}}),
EventAccess(&GCDaruniasDoorOpenChild, {[]{return GCDaruniasDoorOpenChild || (IsChild && CanPlay(ZeldasLullaby));}}),
EventAccess(&GCDaruniasDoorOpenChild, {[]{return GCDaruniasDoorOpenChild || (Logic::IsChild && CanPlay(ZeldasLullaby));}}),
EventAccess(&StopGCRollingGoronAsAdult, {[]{return StopGCRollingGoronAsAdult || (IsAdult && (GoronBracelet || HasExplosives || Bow || (LogicGoronCityLinkGoronDins && CanUse(RG_DINS_FIRE))));}}),
}, {
//Locations
LocationAccess(RC_GC_MAZE_LEFT_CHEST, {[]{return CanUse(RG_MEGATON_HAMMER) || CanUse(RG_SILVER_GAUNTLETS) || (LogicGoronCityLeftMost && HasExplosives && CanUse(RG_HOVER_BOOTS));}}),
LocationAccess(RC_GC_MAZE_CENTER_CHEST, {[]{return CanBlastOrSmash || CanUse(RG_SILVER_GAUNTLETS);}}),
LocationAccess(RC_GC_MAZE_RIGHT_CHEST, {[]{return CanBlastOrSmash || CanUse(RG_SILVER_GAUNTLETS);}}),
LocationAccess(RC_GC_POT_FREESTANDING_POH, {[]{return IsChild && GoronCityChildFire && (Bombs || (GoronBracelet && LogicGoronCityPotWithStrength) || (HasBombchus && LogicGoronCityPot));}}),
LocationAccess(RC_GC_ROLLING_GORON_AS_CHILD, {[]{return IsChild && (HasExplosives || (GoronBracelet && LogicChildRollingWithStrength));}}),
LocationAccess(RC_GC_POT_FREESTANDING_POH, {[]{return Logic::IsChild && GoronCityChildFire && (Bombs || (GoronBracelet && LogicGoronCityPotWithStrength) || (HasBombchus && LogicGoronCityPot));}}),
LocationAccess(RC_GC_ROLLING_GORON_AS_CHILD, {[]{return Logic::IsChild && (HasExplosives || (GoronBracelet && LogicChildRollingWithStrength));}}),
LocationAccess(RC_GC_ROLLING_GORON_AS_ADULT, {[]{return StopGCRollingGoronAsAdult;}}),
LocationAccess(RC_GC_GS_BOULDER_MAZE, {[]{return IsChild && CanBlastOrSmash;}}),
LocationAccess(RC_GC_GS_BOULDER_MAZE, {[]{return Logic::IsChild && CanBlastOrSmash;}}),
LocationAccess(RC_GC_GS_CENTER_PLATFORM, {[]{return IsAdult;}}),
LocationAccess(RC_GC_MEDIGORON, {[]{return IsAdult && AdultsWallet && (CanBlastOrSmash || GoronBracelet);}}),
LocationAccess(RC_GC_MAZE_GOSSIP_STONE, {[]{return CanBlastOrSmash || CanUse(RG_SILVER_GAUNTLETS);}}),
Expand All @@ -103,7 +103,7 @@ void AreaTable_Init_DeathMountain() {
//Exits
Entrance(RR_DEATH_MOUNTAIN_TRAIL, {[]{return true;}}),
Entrance(RR_GC_WOODS_WARP, {[]{return GCWoodsWarpOpen;}}),
Entrance(RR_GC_SHOP, {[]{return (IsAdult && StopGCRollingGoronAsAdult) || (IsChild && (CanBlastOrSmash || GoronBracelet || GoronCityChildFire || CanUse(RG_FAIRY_BOW)));}}),
Entrance(RR_GC_SHOP, {[]{return (IsAdult && StopGCRollingGoronAsAdult) || (Logic::IsChild && (CanBlastOrSmash || GoronBracelet || GoronCityChildFire || CanUse(RG_FAIRY_BOW)));}}),
Entrance(RR_GC_DARUNIAS_CHAMBER, {[]{return (IsAdult && StopGCRollingGoronAsAdult) || GCDaruniasDoorOpenChild;}}),
Entrance(RR_GC_GROTTO_PLATFORM, {[]{return IsAdult && ((CanPlay(SongOfTime) && ((EffectiveHealth > 2) || CanUse(RG_GORON_TUNIC) || CanUse(RG_LONGSHOT) || CanUse(RG_NAYRUS_LOVE))) || (EffectiveHealth > 1 && CanUse(RG_GORON_TUNIC) && CanUse(RG_HOOKSHOT)) || (CanUse(RG_NAYRUS_LOVE) && CanUse(RG_HOOKSHOT)) || (EffectiveHealth > 2 && CanUse(RG_HOOKSHOT) && LogicGoronCityGrotto));}}),
});
Expand All @@ -119,10 +119,10 @@ void AreaTable_Init_DeathMountain() {

areaTable[RR_GC_DARUNIAS_CHAMBER] = Area("GC Darunias Chamber", "Goron City", RHT_GORON_CITY, NO_DAY_NIGHT_CYCLE, {
//Events
EventAccess(&GoronCityChildFire, {[]{return GoronCityChildFire || (IsChild && CanUse(RG_STICKS));}}),
EventAccess(&GoronCityChildFire, {[]{return GoronCityChildFire || (Logic::IsChild && CanUse(RG_STICKS));}}),
}, {
//Locations
LocationAccess(RC_GC_DARUNIAS_JOY, {[]{return IsChild && CanPlay(SariasSong);}}),
LocationAccess(RC_GC_DARUNIAS_JOY, {[]{return Logic::IsChild && CanPlay(SariasSong);}}),
}, {
//Exits
Entrance(RR_GORON_CITY, {[]{return true;}}),
Expand All @@ -132,7 +132,7 @@ void AreaTable_Init_DeathMountain() {
areaTable[RR_GC_GROTTO_PLATFORM] = Area("GC Grotto Platform", "Goron City", RHT_GORON_CITY, NO_DAY_NIGHT_CYCLE, {}, {}, {
//Exits
Entrance(RR_GC_GROTTO, {[]{return true;}}),
Entrance(RR_GORON_CITY, {[]{return EffectiveHealth > 2 || CanUse(RG_GORON_TUNIC) || CanUse(RG_NAYRUS_LOVE) || ((IsChild || CanPlay(SongOfTime)) && CanUse(RG_LONGSHOT));}}),
Entrance(RR_GORON_CITY, {[]{return EffectiveHealth > 2 || CanUse(RG_GORON_TUNIC) || CanUse(RG_NAYRUS_LOVE) || ((Logic::IsChild || CanPlay(SongOfTime)) && CanUse(RG_LONGSHOT));}}),
});

areaTable[RR_GC_SHOP] = Area("GC Shop", "GC Shop", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {
Expand Down Expand Up @@ -173,7 +173,7 @@ void AreaTable_Init_DeathMountain() {
}, {
//Locations
LocationAccess(RC_DMC_WALL_FREESTANDING_POH, {[]{return FireTimer >= 16 || Hearts >= 3;}}),
LocationAccess(RC_DMC_GS_CRATE, {[]{return (FireTimer >= 8 || Hearts >= 3) && IsChild && CanChildAttack;}}),
LocationAccess(RC_DMC_GS_CRATE, {[]{return (FireTimer >= 8 || Hearts >= 3) && Logic::IsChild && CanChildAttack;}}),
LocationAccess(RC_DMC_GOSSIP_STONE, {[]{return HasExplosives && (FireTimer >= 16 || Hearts >= 3);}}),
}, {
//Exits
Expand All @@ -185,7 +185,7 @@ void AreaTable_Init_DeathMountain() {

areaTable[RR_DMC_LADDER_AREA_NEARBY] = Area("DMC Ladder Area Nearby", "Death Mountain Crater", RHT_DEATH_MOUNTAIN_CRATER, NO_DAY_NIGHT_CYCLE, {}, {
//Locations
LocationAccess(RC_DMC_DEKU_SCRUB, {[]{return IsChild && CanStunDeku;}}),
LocationAccess(RC_DMC_DEKU_SCRUB, {[]{return Logic::IsChild && CanStunDeku;}}),
}, {
//Exits
Entrance(RR_DMC_UPPER_NEARBY, {[]{return Hearts >= 3;}}),
Expand Down Expand Up @@ -228,7 +228,7 @@ void AreaTable_Init_DeathMountain() {
Entrance(RR_DMC_CENTRAL_NEARBY, {[]{return true;}}),
Entrance(RR_DMC_LOWER_NEARBY, {[]{return (IsAdult && CanPlantBean(RR_DMC_CENTRAL_LOCAL)) || CanUse(RG_HOVER_BOOTS) || CanUse(RG_HOOKSHOT);}}),
Entrance(RR_DMC_UPPER_NEARBY, {[]{return IsAdult && CanPlantBean(RR_DMC_CENTRAL_LOCAL);}}),
Entrance(RR_FIRE_TEMPLE_ENTRYWAY, {[]{return (IsChild && Hearts >= 3 && ShuffleDungeonEntrances.IsNot(SHUFFLEDUNGEONS_OFF)) || (IsAdult && FireTimer >= 24);}}),
Entrance(RR_FIRE_TEMPLE_ENTRYWAY, {[]{return (Logic::IsChild && Hearts >= 3 && ShuffleDungeonEntrances.IsNot(SHUFFLEDUNGEONS_OFF)) || (IsAdult && FireTimer >= 24);}}),
});

areaTable[RR_DMC_GREAT_FAIRY_FOUNTAIN] = Area("DMC Great Fairy Fountain", "DMC Great Fairy Fountain", RHT_NONE, NO_DAY_NIGHT_CYCLE, {}, {
Expand Down
Loading

0 comments on commit 849057b

Please sign in to comment.