Skip to content

Commit

Permalink
Corrected item UI problem that allowed item counts to go below zero.
Browse files Browse the repository at this point in the history
Fixed item count at Stumpy location.
Reworked South Dark World and all related regions/locations to correct misunderstanding in how Inverted Entrance rando works.
Added Aga2 as a boss prize that unlocks access to the Ganon hole in entrance randomizer, but is always aquirable to account for Fast Ganon requirements.
  • Loading branch information
trippsc2 committed Apr 1, 2020
1 parent d0135d9 commit 4d705b7
Show file tree
Hide file tree
Showing 12 changed files with 364 additions and 152 deletions.
22 changes: 22 additions & 0 deletions OpenTracker.Models/BossSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,28 @@ public BossSection(Game game, LocationID iD)
_game.Regions[RegionID.DeathMountainEastTop].PropertyChanged += OnRequirementChanged;
_game.Regions[RegionID.DarkDeathMountainTop].PropertyChanged += OnRequirementChanged;

break;

case LocationID.GanonsTower:

_defaultBoss = _game.Bosses[BossType.Aga];
_boss = _game.Bosses[BossType.Aga];
Prize = _game.Items[ItemType.Aga2];
_region = _game.Regions[RegionID.GanonsTower];

GetAccessibility = () =>
{
if ((_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) &&
_game.Items.Has(ItemType.GTSmallKey, 2) && _game.Items.Has(ItemType.GTBigKey))
return AccessibilityLevel.Normal;

return AccessibilityLevel.None;
};

itemReqs.Add(_game.Items[ItemType.Bow]);
itemReqs.Add(_game.Items[ItemType.GTSmallKey]);
itemReqs.Add(_game.Items[ItemType.GTBigKey]);

break;
}

Expand Down
65 changes: 49 additions & 16 deletions OpenTracker.Models/EntranceSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public EntranceSection(Game game, LocationID iD)
return AccessibilityLevel.Normal;
}

return AccessibilityLevel.Inspect;
return AccessibilityLevel.None;
};

itemReqs.Add(_game.Items[ItemType.MoonPearl]);
Expand Down Expand Up @@ -911,8 +911,6 @@ public EntranceSection(Game game, LocationID iD)
Name = "Cave";
_standardItemProvided = _game.Items[ItemType.DesertBackAccess];
_invertedItemProvided = _game.Items[ItemType.DesertBackAccess];
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

GetAccessibility = () =>
{
Expand Down Expand Up @@ -1268,8 +1266,6 @@ public EntranceSection(Game game, LocationID iD)
Name = "Cave";
_standardItemProvided = _game.Items[ItemType.BumperCaveAccess];
_invertedItemProvided = _game.Items[ItemType.BumperCaveAccess];
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

GetAccessibility = () =>
{
Expand Down Expand Up @@ -1410,9 +1406,9 @@ public EntranceSection(Game game, LocationID iD)

Name = "House";
_standardItemProvided = _game.Items[ItemType.DarkWorldSouthAccess];
_invertedItemProvided = _game.Items[ItemType.LightWorldAccess];
_invertedItemProvided = _game.Items[ItemType.DarkWorldSouthAccess];
_standardRegion = _game.Regions[RegionID.DarkWorldSouth];
_invertedRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

GetAccessibility = () => { return AccessibilityLevel.Normal; };

Expand Down Expand Up @@ -1550,10 +1546,27 @@ public EntranceSection(Game game, LocationID iD)

GetAccessibility = () =>
{
// Default to full access, but not open until GT completed or Fast Ganon mode
return AccessibilityLevel.Normal;
if (_game.Mode.WorldState == WorldState.StandardOpen)
{
if (_game.Items.Has(ItemType.Aga2))
return AccessibilityLevel.Normal;
}

if (_game.Mode.WorldState == WorldState.Inverted)
{
if (_game.Items.Has(ItemType.Aga2))
return _game.Regions[RegionID.HyruleCastleSecondFloor].Accessibility;

return AccessibilityLevel.Inspect;
}

return AccessibilityLevel.None;
};

itemReqs.Add(_game.Items[ItemType.Aga2]);

_game.Regions[RegionID.HyruleCastleSecondFloor].PropertyChanged += OnRequirementChanged;

break;
case LocationID.DarkIceRodCave:

Expand Down Expand Up @@ -1673,7 +1686,6 @@ public EntranceSection(Game game, LocationID iD)
_standardItemProvided = _game.Items[ItemType.LakeHyliaFairyIslandAccess];
_invertedItemProvided = _game.Items[ItemType.LakeHyliaFairyIslandAccess];
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

GetAccessibility = () =>
{
Expand All @@ -1690,7 +1702,9 @@ public EntranceSection(Game game, LocationID iD)

if (_game.Mode.WorldState == WorldState.Inverted)
{
if (_game.Items.Has(ItemType.Gloves, 2) && _game.Items.Has(ItemType.Flippers))
if ((_game.Regions[RegionID.DarkWorldSouth].Accessibility == AccessibilityLevel.Normal ||
_game.Regions[RegionID.DarkWorldSouthEast].Accessibility == AccessibilityLevel.Normal) &&
_game.Items.Has(ItemType.Gloves, 2) && _game.Items.Has(ItemType.Flippers))
return AccessibilityLevel.Normal;

if (_game.Items.Has(ItemType.MoonPearl))
Expand All @@ -1703,7 +1717,9 @@ public EntranceSection(Game game, LocationID iD)
return AccessibilityLevel.SequenceBreak;
}

if (_game.Items.Has(ItemType.Gloves, 2))
if ((_game.Regions[RegionID.DarkWorldSouth].Accessibility >= AccessibilityLevel.SequenceBreak ||
_game.Regions[RegionID.DarkWorldSouthEast].Accessibility == AccessibilityLevel.SequenceBreak) &&
_game.Items.Has(ItemType.Gloves, 2))
return AccessibilityLevel.SequenceBreak;
}

Expand Down Expand Up @@ -1815,7 +1831,6 @@ public EntranceSection(Game game, LocationID iD)
_standardItemProvided = _game.Items[ItemType.IcePalaceAccess];
_invertedItemProvided = _game.Items[ItemType.IcePalaceAccess];
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

GetAccessibility = () =>
{
Expand All @@ -1835,7 +1850,9 @@ public EntranceSection(Game game, LocationID iD)

if (_game.Mode.WorldState == WorldState.Inverted)
{
if (_game.Items.Has(ItemType.Flippers))
if ((_game.Regions[RegionID.DarkWorldSouth].Accessibility == AccessibilityLevel.Normal ||
_game.Regions[RegionID.DarkWorldSouthEast].Accessibility == AccessibilityLevel.Normal) &&
_game.Items.Has(ItemType.Flippers))
return AccessibilityLevel.Normal;

if (_game.Items.Has(ItemType.Mirror))
Expand All @@ -1846,9 +1863,15 @@ public EntranceSection(Game game, LocationID iD)
if (_game.Regions[RegionID.LightWorld].Accessibility == AccessibilityLevel.Normal &&
_game.Items.Has(ItemType.Flippers) && _game.Items.Has(ItemType.MoonPearl))
return AccessibilityLevel.Normal;

if (_game.Regions[RegionID.LightWorld].Accessibility >= AccessibilityLevel.SequenceBreak &&
_game.Items.Has(ItemType.MoonPearl))
return AccessibilityLevel.SequenceBreak;
}

return AccessibilityLevel.SequenceBreak;
if (_game.Regions[RegionID.DarkWorldSouth].Accessibility >= AccessibilityLevel.SequenceBreak ||
_game.Regions[RegionID.DarkWorldSouthEast].Accessibility >= AccessibilityLevel.SequenceBreak)
return AccessibilityLevel.SequenceBreak;
}

return AccessibilityLevel.None;
Expand Down Expand Up @@ -2454,7 +2477,6 @@ public EntranceSection(Game game, LocationID iD)
_standardItemProvided = _game.Items[ItemType.TurtleRockSafetyDoorAccess];
_invertedItemProvided = _game.Items[ItemType.TurtleRockSafetyDoorAccess];
_standardRegion = _game.Regions[RegionID.DarkDeathMountainTop];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

GetAccessibility = () =>
{
Expand Down Expand Up @@ -2499,6 +2521,17 @@ public EntranceSection(Game game, LocationID iD)

itemReqs.Add(_game.Items[ItemType.Mirror]);

break;
case LocationID.LinksHouseEntrance:

Name = "Link's House";
_standardItemProvided = _game.Items[ItemType.LightWorldAccess];
_invertedItemProvided = _game.Items[ItemType.LightWorldAccess];
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

GetAccessibility = () => { return AccessibilityLevel.Normal; };

break;
}

Expand Down
1 change: 1 addition & 0 deletions OpenTracker.Models/Enums/ItemType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public enum ItemType
Sword,
Shield,
Mail,
Aga2,
GreenPendant,
Pendant,
Crystal,
Expand Down
3 changes: 2 additions & 1 deletion OpenTracker.Models/Enums/LocationID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public enum LocationID
TRLedgeLeft,
TRLedgeRight,
TRSafetyDoor,
HookshotCaveTop
HookshotCaveTop,
LinksHouseEntrance
}
}
2 changes: 1 addition & 1 deletion OpenTracker.Models/ItemSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ public ItemSection(Game game, Location location, int index = 0)
break;
case LocationID.HauntedGrove:

_baseTotal = 2;
_baseTotal = 1;
Name = "Stumpy";
_standardRegion = _game.Regions[RegionID.DarkWorldSouth];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];
Expand Down
33 changes: 24 additions & 9 deletions OpenTracker.Models/Location.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public Location(Game game, LocationID iD)
MapLocations.Add(new MapLocation(this, MapID.DarkWorld, 1097, 1366,
new Mode()
{
WorldState = WorldState.Inverted
WorldState = WorldState.Inverted,
EntranceShuffle = false
}));
itemSections = 1;
break;
Expand Down Expand Up @@ -183,7 +184,10 @@ public Location(Game game, LocationID iD)
case LocationID.BombosTablet:
Name = "Bombos Tablet";
MapLocations.Add(new MapLocation(this, MapID.LightWorld, 440, 1845, new Mode()));
MapLocations.Add(new MapLocation(this, MapID.DarkWorld, 440, 1845, new Mode()));
MapLocations.Add(new MapLocation(this, MapID.DarkWorld, 440, 1845, new Mode()
{
WorldState = WorldState.StandardOpen
}));
itemSections = 1;
break;
case LocationID.SouthOfGrove:
Expand Down Expand Up @@ -753,6 +757,7 @@ public Location(Game game, LocationID iD)
EntranceShuffle = true
}));
itemSections = 1;
BossSection = new BossSection(game, iD);
break;
case LocationID.LumberjackHouse:
Name = "Lumber House";
Expand Down Expand Up @@ -1362,13 +1367,6 @@ public Location(Game game, LocationID iD)
MapLocations.Add(new MapLocation(this, MapID.DarkWorld, 1098, 1382,
new Mode()
{
WorldState = WorldState.StandardOpen,
EntranceShuffle = true
}));
MapLocations.Add(new MapLocation(this, MapID.LightWorld, 1098, 1382,
new Mode()
{
WorldState = WorldState.Inverted,
EntranceShuffle = true
}));
entranceSection = true;
Expand Down Expand Up @@ -1447,9 +1445,16 @@ public Location(Game game, LocationID iD)
break;
case LocationID.GanonHole:
Name = "Ganon Hole";
MapLocations.Add(new MapLocation(this, MapID.LightWorld, 902, 862,
new Mode()
{
WorldState = WorldState.Inverted,
EntranceShuffle = true
}));
MapLocations.Add(new MapLocation(this, MapID.DarkWorld, 1000, 820,
new Mode()
{
WorldState = WorldState.StandardOpen,
EntranceShuffle = true
}));
entranceSection = true;
Expand Down Expand Up @@ -1868,6 +1873,16 @@ public Location(Game game, LocationID iD)
}));
entranceSection = true;
break;
case LocationID.LinksHouseEntrance:
Name = "Link's House";
MapLocations.Add(new MapLocation(this, MapID.LightWorld, 1098, 1382,
new Mode()
{
WorldState = WorldState.Inverted,
EntranceShuffle = true
}));
entranceSection = true;
break;
}

for (int i = 0; i < itemSections; i++)
Expand Down
Loading

0 comments on commit 4d705b7

Please sign in to comment.