From bf03336959c1f965c1a5eab91709792743515044 Mon Sep 17 00:00:00 2001 From: trippsc2 Date: Tue, 21 Apr 2020 15:07:20 -0400 Subject: [PATCH] Bugfixes and decided to not implement Retro as a separate mode. Incremented version number for release. --- OpenTracker.Models/BossSection.cs | 533 ++++++++---------- OpenTracker.Models/Enums/WorldState.cs | 3 +- OpenTracker.Models/ItemSection.cs | 12 +- OpenTracker.Models/Mode.cs | 19 +- OpenTracker.Models/OpenTracker.Models.csproj | 2 +- OpenTracker.Models/Region.cs | 6 +- OpenTracker.Setup/OpenTracker.Setup.vdproj | 8 +- OpenTracker/OpenTracker.csproj | 6 +- OpenTracker/ViewModels/MapControlVM.cs | 3 - .../ViewModels/ModeSettingsControlVM.cs | 31 +- OpenTracker/Views/ModeSettingsControl.xaml | 38 +- 11 files changed, 281 insertions(+), 380 deletions(-) diff --git a/OpenTracker.Models/BossSection.cs b/OpenTracker.Models/BossSection.cs index ddb4d88e..f9b783d9 100644 --- a/OpenTracker.Models/BossSection.cs +++ b/OpenTracker.Models/BossSection.cs @@ -18,7 +18,6 @@ public class BossSection : ISection private readonly Dictionary _regionIsSubscribed; private readonly Dictionary _itemSubscriptions; private readonly Dictionary _itemIsSubscribed; - private readonly Action _autoTrack; private readonly bool _subscribeToRoomMemory; private readonly bool _subscribeToItemMemory; private Boss _currentBossSubscription; @@ -30,6 +29,7 @@ public class BossSection : ISection public MarkingType? Marking { get => null; set { } } public Func GetAccessibility { get; } + public Action AutoTrack { get; } public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -112,7 +112,22 @@ public BossSection(Game game, LocationID iD) _boss = _game.Bosses[BossType.Aga]; Prize = _game.Items[ItemType.Aga]; - _autoTrack = () => + GetAccessibility = () => + { + AccessibilityLevel aga = _game.Regions[RegionID.Agahnim].Accessibility; + + if (_game.Items.Has(ItemType.ATSmallKey, 2) && _game.Items.CanRemoveCurtains()) + { + if (_game.Items.Has(ItemType.Lamp)) + return aga; + + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)aga); + } + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.ItemMemory.Count > 133) { @@ -125,25 +140,6 @@ public BossSection(Game game, LocationID iD) _subscribeToItemMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.Agahnim].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.ATSmallKey, 2) && _game.Items.CanRemoveCurtains()) - { - if (_game.Items.Has(ItemType.Lamp)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.Agahnim].Accessibility); - } - - return AccessibilityLevel.SequenceBreak; - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.Agahnim, new Mode()); _itemSubscriptions.Add(ItemType.ATSmallKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.MapsCompassesSmallKeys }); @@ -155,7 +151,23 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Armos]; - _autoTrack = () => + GetAccessibility = () => + { + AccessibilityLevel eP = _game.Regions[RegionID.EasternPalace].Accessibility; + + if (_game.Items.CanClearRedEyegoreGoriyaRooms() && _game.Items.Has(ItemType.EPBigKey)) + { + if (_game.Items.Has(ItemType.Lamp) || (_game.Items.Has(ItemType.FireRod) && + _game.Mode.ItemPlacement == ItemPlacement.Advanced)) + return eP; + + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)eP); + } + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 401) { @@ -168,27 +180,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.EasternPalace].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if ((_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) && - _game.Items.Has(ItemType.EPBigKey)) - { - if (_game.Items.Has(ItemType.Lamp) || (_game.Items.Has(ItemType.FireRod) && - _game.Mode.ItemPlacement == ItemPlacement.Advanced)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.EasternPalace].Accessibility); - } - - return AccessibilityLevel.SequenceBreak; - } - } - - return AccessibilityLevel.None; - }; - _updateOnItemPlacementChange = true; _updateOnEnemyShuffleChange = true; @@ -204,7 +195,24 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Lanmolas]; - _autoTrack = () => + GetAccessibility = () => + { + AccessibilityLevel dP = _game.Regions[RegionID.DesertPalace].Accessibility; + + if ((_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) && + _game.Items.Has(ItemType.DPBigKey)) + { + if (_game.Items.Has(ItemType.DPSmallKey)) + return dP; + + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)dP); + } + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 103) { @@ -217,29 +225,9 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.DesertPalace].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.Gloves) && (_game.Items.Has(ItemType.FireRod) || - _game.Items.Has(ItemType.Lamp)) && _game.Items.Has(ItemType.DPBigKey)) - { - if (_game.Items.Has(ItemType.DPSmallKey)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.DesertPalace].Accessibility); - } - - return AccessibilityLevel.SequenceBreak; - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.DesertPalace, new Mode()); - _itemSubscriptions.Add(ItemType.Gloves, new Mode()); + _itemSubscriptions.Add(ItemType.Gloves, new Mode() { EntranceShuffle = false }); _itemSubscriptions.Add(ItemType.FireRod, new Mode()); _itemSubscriptions.Add(ItemType.Lamp, new Mode()); _itemSubscriptions.Add(ItemType.DPBigKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.Keysanity }); @@ -250,7 +238,30 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Moldorm]; - _autoTrack = () => + GetAccessibility = () => + { + AccessibilityLevel tH = _game.Regions[RegionID.TowerOfHera].Accessibility; + + if (_game.Mode.DungeonItemShuffle == DungeonItemShuffle.Keysanity) + { + if (_game.Items.Has(ItemType.ToHBigKey)) + return tH; + + if (_game.Items.Has(ItemType.Hookshot)) + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)tH); + } + else + { + if (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) + return tH; + + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)tH); + } + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 15) { @@ -263,36 +274,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.TowerOfHera].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Mode.DungeonItemShuffle == DungeonItemShuffle.Keysanity) - { - if (_game.Items.Has(ItemType.ToHBigKey)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.TowerOfHera].Accessibility); - } - - if (_game.Items.Has(ItemType.Hookshot)) - return AccessibilityLevel.SequenceBreak; - } - else - { - if (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.TowerOfHera].Accessibility); - } - - return AccessibilityLevel.SequenceBreak; - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.TowerOfHera, new Mode()); _itemSubscriptions.Add(ItemType.ToHBigKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.Keysanity }); @@ -305,7 +286,23 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.HelmasaurKing]; - _autoTrack = () => + GetAccessibility = () => + { + AccessibilityLevel pD = _game.Regions[RegionID.PalaceOfDarkness].Accessibility; + + if (_game.Items.Has(ItemType.Hammer) && _game.Items.CanShootArrows() && + _game.Items.Has(ItemType.PoDBigKey) && _game.Items.Has(ItemType.PoDSmallKey)) + { + if (_game.Items.Has(ItemType.Lamp)) + return pD; + + return AccessibilityLevel.SequenceBreak; + } + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 181) { @@ -318,26 +315,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.PalaceOfDarkness].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.Bow) && - _game.Items.Has(ItemType.PoDBigKey) && _game.Items.Has(ItemType.PoDSmallKey)) - { - if (_game.Items.Has(ItemType.Lamp)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.PalaceOfDarkness].Accessibility); - } - - return AccessibilityLevel.SequenceBreak; - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.PalaceOfDarkness, new Mode()); _itemSubscriptions.Add(ItemType.Hammer, new Mode()); @@ -351,7 +328,16 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Arrghus]; - _autoTrack = () => + GetAccessibility = () => + { + if (_game.Items.Has(ItemType.Flippers) && _game.Items.Has(ItemType.Hookshot) && + _game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.SPSmallKey)) + return _game.Regions[RegionID.SwampPalace].Accessibility; + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 13) { @@ -364,21 +350,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.SwampPalace].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.Flippers) && _game.Items.Has(ItemType.Hookshot) && - _game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.SPSmallKey)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.SwampPalace].Accessibility); - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.SwampPalace, new Mode()); _itemSubscriptions.Add(ItemType.Flippers, new Mode()); @@ -391,7 +362,16 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Mothula]; - _autoTrack = () => + GetAccessibility = () => + { + if ((_game.Items.Has(ItemType.FireRod) || _game.Mode.EntranceShuffle.Value) && + _game.Items.CanRemoveCurtains()) + return _game.Regions[RegionID.SkullWoods].Accessibility; + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 83) { @@ -404,21 +384,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.SkullWoods].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if ((_game.Items.Has(ItemType.FireRod) || _game.Mode.EntranceShuffle.Value) && - _game.Items.CanRemoveCurtains()) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.SkullWoods].Accessibility); - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.SkullWoods, new Mode()); _itemSubscriptions.Add(ItemType.FireRod, new Mode() { EntranceShuffle = false }); @@ -429,7 +394,15 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Blind]; - _autoTrack = () => + GetAccessibility = () => + { + if (_game.Items.Has(ItemType.TTBigKey)) + return _game.Regions[RegionID.ThievesTown].Accessibility; + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 345) { @@ -442,20 +415,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.ThievesTown].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.TTBigKey)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.ThievesTown].Accessibility); - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.ThievesTown, new Mode()); _itemSubscriptions.Add(ItemType.TTBigKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.Keysanity }); @@ -465,7 +424,16 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Kholdstare]; - _autoTrack = () => + GetAccessibility = () => + { + if (_game.Items.CanMeltThings() && _game.Items.Has(ItemType.Hammer) && + (_game.Items.Has(ItemType.CaneOfSomaria) || _game.Items.Has(ItemType.IPSmallKey))) + return _game.Regions[RegionID.IcePalace].Accessibility; + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 445) { @@ -478,21 +446,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.IcePalace].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.CanMeltThings() && _game.Items.Has(ItemType.Hammer) && - (_game.Items.Has(ItemType.CaneOfSomaria) || _game.Items.Has(ItemType.IPSmallKey))) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.IcePalace].Accessibility); - } - } - - return AccessibilityLevel.None; - }; - _regionSubscriptions.Add(RegionID.IcePalace, new Mode()); _itemSubscriptions.Add(ItemType.FireRod, new Mode()); @@ -507,7 +460,24 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Vitreous]; - _autoTrack = () => + GetAccessibility = () => + { + AccessibilityLevel mM = _game.Regions[RegionID.MiseryMire].Accessibility; + + if ((_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots)) && + _game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.MMBigKey)) + { + if ((_game.Items.Has(ItemType.Hookshot) || (_game.Items.Has(ItemType.Boots) && + _game.Mode.ItemPlacement == ItemPlacement.Advanced)) && _game.Items.Has(ItemType.Lamp)) + return mM; + + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)mM); + } + + return AccessibilityLevel.None; + }; + + AutoTrack = () => { if (_game.AutoTracker.RoomMemory.Count > 289) { @@ -520,27 +490,6 @@ public BossSection(Game game, LocationID iD) _subscribeToRoomMemory = true; - GetAccessibility = () => - { - if (_game.Regions[RegionID.MiseryMire].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if ((_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots)) && - _game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.MMBigKey)) - { - if ((_game.Items.Has(ItemType.Hookshot) || (_game.Items.Has(ItemType.Boots) && - _game.Mode.ItemPlacement == ItemPlacement.Advanced)) && _game.Items.Has(ItemType.Lamp)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.MiseryMire].Accessibility); - } - - return AccessibilityLevel.SequenceBreak; - } - } - - return AccessibilityLevel.None; - }; - _updateOnItemPlacementChange = true; _regionSubscriptions.Add(RegionID.MiseryMire, new Mode()); @@ -556,104 +505,104 @@ public BossSection(Game game, LocationID iD) _defaultBoss = _game.Bosses[BossType.Trinexx]; - _autoTrack = () => + GetAccessibility = () => { - if (_game.AutoTracker.RoomMemory.Count > 329) - { - if ((_game.AutoTracker.RoomMemory[329] & 8) != 0) - Available = 0; - else - Available = 1; - } - }; + AccessibilityLevel frontAccess = _game.Regions[RegionID.TurtleRockFront].Accessibility; + AccessibilityLevel backAccess = _game.Regions[RegionID.TurtleRockBack].Accessibility; - _subscribeToRoomMemory = true; + AccessibilityLevel front = AccessibilityLevel.None; + AccessibilityLevel backFront = AccessibilityLevel.None; + AccessibilityLevel back = AccessibilityLevel.None; - GetAccessibility = () => - { - if (_game.Mode.EntranceShuffle.Value) + switch (_game.Mode.DungeonItemShuffle.Value) { - if (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.TRBigKey) - && _game.Items.Has(ItemType.TRSmallKey)) - return AccessibilityLevel.Normal; - } + case DungeonItemShuffle.Standard: + case DungeonItemShuffle.MapsCompasses: - if (_game.Mode.WorldState == WorldState.StandardOpen) - { - if (_game.Regions[RegionID.TurtleRockFront].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.TRBigKey) && - _game.Items.Has(ItemType.TRSmallKey, 3)) + if (_game.Items.Has(ItemType.CaneOfSomaria)) { - if (_game.Items.Has(ItemType.Lamp)) + front = (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)frontAccess); + back = (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)backAccess); + + if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.Lamp)) { - if (_game.Mode.DungeonItemShuffle < DungeonItemShuffle.MapsCompassesSmallKeys && - _game.Items.Has(ItemType.FireRod)) - return AccessibilityLevel.Normal; + front = frontAccess; + back = backAccess; } + } + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.TRSmallKey)) + { + backFront = (AccessibilityLevel)Math.Min(Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)frontAccess), (byte)backAccess); + back = (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)backAccess); - return AccessibilityLevel.SequenceBreak; + if (_game.Items.Has(ItemType.FireRod)) + backFront = (AccessibilityLevel)Math.Min((byte)frontAccess, (byte)backAccess); + } + + if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.TRSmallKey, 2)) + back = backAccess; + + if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.TRSmallKey, 4)) + { + front = (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)frontAccess); + + if (_game.Items.Has(ItemType.Lamp)) + front = frontAccess; + } } - } - } - if (_game.Mode.WorldState == WorldState.Inverted) - { - if (_game.Regions[RegionID.DeathMountainEastTop].Accessibility == AccessibilityLevel.Normal && - _game.Items.Has(ItemType.Mirror)) - { - if (_game.Items.Has(ItemType.TRBigKey) && _game.Items.Has(ItemType.TRSmallKey)) - return AccessibilityLevel.Normal; + break; + case DungeonItemShuffle.Keysanity: - return AccessibilityLevel.SequenceBreak; - } + if (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.TRBigKey)) + { + if (_game.Items.Has(ItemType.TRSmallKey)) + back = backAccess; - if (_game.Items.CanUseMedallions() && _game.Items.Has(ItemType.CaneOfSomaria) && - ((_game.Items.Has(ItemType.Bombos) && _game.Items.Has(ItemType.Ether) && - _game.Items.Has(ItemType.Quake)) || - (_game.Items.Has(ItemType.Bombos) && - _game.Items[ItemType.BombosDungeons].Current >= 2) || - (_game.Items.Has(ItemType.Ether) && - _game.Items[ItemType.EtherDungeons].Current >= 2) || - (_game.Items.Has(ItemType.Quake) && - _game.Items[ItemType.QuakeDungeons].Current >= 2)) && - _game.Regions[RegionID.DarkDeathMountainTop].Accessibility >= AccessibilityLevel.SequenceBreak) - { - if (_game.Items.Has(ItemType.TRBigKey) && _game.Items.Has(ItemType.TRSmallKey, 3) && - _game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.Lamp)) - return _game.Regions[RegionID.DarkDeathMountainTop].Accessibility; + if (_game.Items.Has(ItemType.TRSmallKey, 4)) + { + front = (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)frontAccess); - return AccessibilityLevel.SequenceBreak; - } + if (_game.Items.Has(ItemType.Lamp)) + front = frontAccess; + } + } - if (_game.Regions[RegionID.DeathMountainEastTop].Accessibility == AccessibilityLevel.SequenceBreak && - _game.Items.Has(ItemType.Mirror) && _game.Items.Has(ItemType.TRBigKey) && - _game.Items.Has(ItemType.TRSmallKey)) - return AccessibilityLevel.SequenceBreak; + break; } - return AccessibilityLevel.None; + return (AccessibilityLevel)Math.Max(Math.Max((byte)front, (byte)backFront), (byte)back); }; + AutoTrack = () => + { + if (_game.AutoTracker.RoomMemory.Count > 329) + { + if ((_game.AutoTracker.RoomMemory[329] & 8) != 0) + Available = 0; + else + Available = 1; + } + }; + + _subscribeToRoomMemory = true; + _updateOnWorldStateChange = true; _regionSubscriptions.Add(RegionID.TurtleRockFront, new Mode()); - _regionSubscriptions.Add(RegionID.DeathMountainEastTop, new Mode() { WorldState = WorldState.Inverted }); - _regionSubscriptions.Add(RegionID.DarkDeathMountainTop, new Mode() { WorldState = WorldState.Inverted }); + _regionSubscriptions.Add(RegionID.TurtleRockBack, new Mode()); _itemSubscriptions.Add(ItemType.CaneOfSomaria, new Mode()); _itemSubscriptions.Add(ItemType.TRBigKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.Keysanity }); _itemSubscriptions.Add(ItemType.TRSmallKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.MapsCompassesSmallKeys }); _itemSubscriptions.Add(ItemType.Lamp, new Mode()); _itemSubscriptions.Add(ItemType.FireRod, new Mode()); - _itemSubscriptions.Add(ItemType.Mirror, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.Sword, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.Bombos, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.BombosDungeons, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.Ether, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.EtherDungeons, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.Quake, new Mode() { WorldState = WorldState.Inverted }); - _itemSubscriptions.Add(ItemType.QuakeDungeons, new Mode() { WorldState = WorldState.Inverted }); break; @@ -665,31 +614,29 @@ public BossSection(Game game, LocationID iD) GetAccessibility = () => { - if (_game.Regions[RegionID.GanonsTower].Accessibility >= AccessibilityLevel.SequenceBreak) + AccessibilityLevel gT = _game.Regions[RegionID.GanonsTower].Accessibility; + + if (_game.Mode.DungeonItemShuffle >= DungeonItemShuffle.MapsCompassesSmallKeys) { - if (_game.Mode.DungeonItemShuffle == DungeonItemShuffle.Keysanity) + if (_game.Items.CanClearRedEyegoreGoriyaRooms() && _game.Items.Has(ItemType.GTBigKey)) { - if ((_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) && - _game.Items.Has(ItemType.GTSmallKey) && _game.Items.Has(ItemType.GTBigKey)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.GanonsTower].Accessibility); - } + if (_game.Items.Has(ItemType.GTSmallKey, 2)) + return gT; + + if (_game.Items.Has(ItemType.GTSmallKey, 1)) + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)gT); } - else + } + else + { + if (_game.Items.CanClearRedEyegoreGoriyaRooms()) { - if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) - { - if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.Hookshot) && - _game.Items.Has(ItemType.Boots) && _game.Items.Has(ItemType.CaneOfSomaria) && - _game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.GTSmallKey, 2)) - { - return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.Normal, - (byte)_game.Regions[RegionID.GanonsTower].Accessibility); - } + if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.Hookshot) && + _game.Items.Has(ItemType.Boots) && _game.Items.Has(ItemType.CaneOfSomaria) && + _game.Items.Has(ItemType.FireRod)) + return gT; - return AccessibilityLevel.SequenceBreak; - } + return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak, (byte)gT); } } @@ -791,7 +738,7 @@ private void OnRequirementChanged(object sender, PropertyChangedEventArgs e) private void OnMemoryCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (_game.AutoTracker.IsInGame() && !UserManipulated) - _autoTrack(); + AutoTrack(); } private void SubscribeToAutoTracker() diff --git a/OpenTracker.Models/Enums/WorldState.cs b/OpenTracker.Models/Enums/WorldState.cs index 890950d6..b5666af6 100644 --- a/OpenTracker.Models/Enums/WorldState.cs +++ b/OpenTracker.Models/Enums/WorldState.cs @@ -3,7 +3,6 @@ public enum WorldState { StandardOpen, - Inverted, - Retro + Inverted } } diff --git a/OpenTracker.Models/ItemSection.cs b/OpenTracker.Models/ItemSection.cs index 6f0579ca..1e40d506 100644 --- a/OpenTracker.Models/ItemSection.cs +++ b/OpenTracker.Models/ItemSection.cs @@ -5882,18 +5882,8 @@ public ItemSection(Game game, Location location, int index = 0) _updateOnDungeonItemShuffleChange = true; _regionSubscriptions.Add(RegionID.TurtleRockFront, new Mode()); - _regionSubscriptions.Add(RegionID.DeathMountainEastTop, new Mode()); - _regionSubscriptions.Add(RegionID.DarkDeathMountainTop, new Mode()); + _regionSubscriptions.Add(RegionID.TurtleRockBack, new Mode()); - _itemSubscriptions.Add(ItemType.Hammer, new Mode()); - _itemSubscriptions.Add(ItemType.Sword, new Mode()); - _itemSubscriptions.Add(ItemType.Bombos, new Mode()); - _itemSubscriptions.Add(ItemType.BombosDungeons, new Mode()); - _itemSubscriptions.Add(ItemType.Ether, new Mode()); - _itemSubscriptions.Add(ItemType.EtherDungeons, new Mode()); - _itemSubscriptions.Add(ItemType.Quake, new Mode()); - _itemSubscriptions.Add(ItemType.QuakeDungeons, new Mode()); - _itemSubscriptions.Add(ItemType.Mirror, new Mode()); _itemSubscriptions.Add(ItemType.CaneOfSomaria, new Mode()); _itemSubscriptions.Add(ItemType.FireRod, new Mode()); _itemSubscriptions.Add(ItemType.Lamp, new Mode()); diff --git a/OpenTracker.Models/Mode.cs b/OpenTracker.Models/Mode.cs index 33915be0..61e10de2 100644 --- a/OpenTracker.Models/Mode.cs +++ b/OpenTracker.Models/Mode.cs @@ -153,22 +153,9 @@ public bool Validate(Mode gameMode) } if (gameMode.WorldState != null && - WorldState != null) - { - switch (gameMode.WorldState.Value) - { - case Enums.WorldState.StandardOpen: - if (WorldState.Value != Enums.WorldState.StandardOpen && - WorldState.Value != Enums.WorldState.Retro) - return false; - break; - case Enums.WorldState.Inverted: - case Enums.WorldState.Retro: - if (WorldState != gameMode.WorldState) - return false; - break; - } - } + WorldState != null && + WorldState != gameMode.WorldState) + return false; if (gameMode.EntranceShuffle != null && EntranceShuffle != null && diff --git a/OpenTracker.Models/OpenTracker.Models.csproj b/OpenTracker.Models/OpenTracker.Models.csproj index 9c641e4d..82cf968b 100644 --- a/OpenTracker.Models/OpenTracker.Models.csproj +++ b/OpenTracker.Models/OpenTracker.Models.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 0.8.1 + 0.8.2 diff --git a/OpenTracker.Models/Region.cs b/OpenTracker.Models/Region.cs index 2cde851e..026ed3fd 100644 --- a/OpenTracker.Models/Region.cs +++ b/OpenTracker.Models/Region.cs @@ -820,7 +820,7 @@ public Region(Game game, RegionID iD) newExcludedRegions.Add(ID); // Standard, Open, and Retro modes - if (_game.Mode.WorldState != WorldState.StandardOpen) + if (_game.Mode.WorldState != WorldState.Inverted) { // Access via Turtle Rock Tunnel by mirror if (_game.Items.Has(ItemType.TurtleRockTunnelAccess) || @@ -1806,8 +1806,8 @@ public Region(Game game, RegionID iD) List newExcludedRegions = excludedRegions.GetRange(0, excludedRegions.Count); newExcludedRegions.Add(ID); - // Standard and Open modes - if (_game.Mode.WorldState != WorldState.Retro) + // Standard, Open, and Retro modes + if (_game.Mode.WorldState != WorldState.Inverted) { // Access via Dark Death Mountain top entrance with proper number of crystals if (_game.Items.Has(ItemType.TowerCrystals) && _game.Items.Has(ItemType.MoonPearl) && diff --git a/OpenTracker.Setup/OpenTracker.Setup.vdproj b/OpenTracker.Setup/OpenTracker.Setup.vdproj index b4d2e416..eb37af0c 100644 --- a/OpenTracker.Setup/OpenTracker.Setup.vdproj +++ b/OpenTracker.Setup/OpenTracker.Setup.vdproj @@ -274,15 +274,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:OpenTracker" - "ProductCode" = "8:{7ABF3E44-0DD5-48D4-A792-3BA6BCAB8C91}" - "PackageCode" = "8:{39BBFD34-33C5-432D-95C0-622DDFAC5408}" + "ProductCode" = "8:{DA8300DD-0D3F-47ED-BB1C-2E26D3D6B8EF}" + "PackageCode" = "8:{4979E0A2-6CDA-49D7-BB71-9933E800E906}" "UpgradeCode" = "8:{C98C2121-B4C5-473A-9B86-5407FEFFE8F1}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:0.8.1" + "ProductVersion" = "8:0.8.2" "Manufacturer" = "8:OpenTracker" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" @@ -824,7 +824,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_9E6FFC26C1B94A308AE37383659B05F8" { - "SourcePath" = "8:..\\OpenTracker\\obj\\Release\\netcoreapp3.1\\OpenTracker.exe" + "SourcePath" = "8:..\\OpenTracker\\obj\\Debug\\netcoreapp3.1\\OpenTracker.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_B21EA2C01C014AC99A33B72F50C26B5D" diff --git a/OpenTracker/OpenTracker.csproj b/OpenTracker/OpenTracker.csproj index 52b25161..a996daf3 100644 --- a/OpenTracker/OpenTracker.csproj +++ b/OpenTracker/OpenTracker.csproj @@ -4,10 +4,10 @@ netcoreapp3.1 triforce.ico - 0.8.1 + 0.8.2 Tripp - 0.8.1.0 - 0.8.1.0 + 0.8.2.0 + 0.8.2.0 osx-x64;linux-x64;debian-x64;rhel-x64;win-x64;win-x86;win7-x64;win7-x86 diff --git a/OpenTracker/ViewModels/MapControlVM.cs b/OpenTracker/ViewModels/MapControlVM.cs index 3c6ee253..8f959e48 100644 --- a/OpenTracker/ViewModels/MapControlVM.cs +++ b/OpenTracker/ViewModels/MapControlVM.cs @@ -55,9 +55,6 @@ private void UpdateMap() { WorldState worldState = WorldState.StandardOpen; - if (_game.Mode.WorldState != WorldState.Retro) - worldState = _game.Mode.WorldState.Value; - ImageSource = "avares://OpenTracker/Assets/Images/Maps/" + worldState.ToString().ToLower() + "_" + _iD.ToString().ToLower() + ".png"; diff --git a/OpenTracker/ViewModels/ModeSettingsControlVM.cs b/OpenTracker/ViewModels/ModeSettingsControlVM.cs index 3dc5ba13..9eadf6b5 100644 --- a/OpenTracker/ViewModels/ModeSettingsControlVM.cs +++ b/OpenTracker/ViewModels/ModeSettingsControlVM.cs @@ -69,11 +69,11 @@ public bool DungeonItemShuffleKeysanity set => this.RaiseAndSetIfChanged(ref _dungeonItemShuffleKeysanity, value); } - private bool _worldStateStandardOpen; - public bool WorldStateStandardOpen + private bool _worldStateStandardOpenRetro; + public bool WorldStateStandardOpenRetro { - get => _worldStateStandardOpen; - set => this.RaiseAndSetIfChanged(ref _worldStateStandardOpen, value); + get => _worldStateStandardOpenRetro; + set => this.RaiseAndSetIfChanged(ref _worldStateStandardOpenRetro, value); } private bool _worldStateInverted; @@ -83,13 +83,6 @@ public bool WorldStateInverted set => this.RaiseAndSetIfChanged(ref _worldStateInverted, value); } - private bool _worldStateRetro; - public bool WorldStateRetro - { - get => _worldStateRetro; - set => this.RaiseAndSetIfChanged(ref _worldStateRetro, value); - } - private bool _entranceShuffle; public bool EntranceShuffle { @@ -132,7 +125,7 @@ public ModeSettingsControlVM(Mode mode, UndoRedoManager undoRedoManager) _mode.PropertyChanged += OnModeChanged; - ItemPlacementCommand = ReactiveCommand.Create(SetItemPlacement, this.WhenAnyValue(x => x.WorldStateStandardOpen)); + ItemPlacementCommand = ReactiveCommand.Create(SetItemPlacement, this.WhenAnyValue(x => x.WorldStateStandardOpenRetro)); DungeonItemShuffleCommand = ReactiveCommand.Create(SetDungeonItemShuffle); WorldStateCommand = ReactiveCommand.Create(SetWorldState); EntranceShuffleCommand = ReactiveCommand.Create(ToggleEntranceShuffle); @@ -239,24 +232,16 @@ private void UpdateWorldState() switch (_mode.WorldState) { case null: - WorldStateStandardOpen = false; + WorldStateStandardOpenRetro = false; WorldStateInverted = false; - WorldStateRetro = false; break; case WorldState.StandardOpen: - WorldStateStandardOpen = true; + WorldStateStandardOpenRetro = true; WorldStateInverted = false; - WorldStateRetro = false; break; case WorldState.Inverted: - WorldStateStandardOpen = false; + WorldStateStandardOpenRetro = false; WorldStateInverted = true; - WorldStateRetro = false; - break; - case WorldState.Retro: - WorldStateStandardOpen = false; - WorldStateInverted = false; - WorldStateRetro = true; break; } } diff --git a/OpenTracker/Views/ModeSettingsControl.xaml b/OpenTracker/Views/ModeSettingsControl.xaml index 08e2620e..2cf166db 100644 --- a/OpenTracker/Views/ModeSettingsControl.xaml +++ b/OpenTracker/Views/ModeSettingsControl.xaml @@ -9,54 +9,50 @@ Mode=TwoWay}" StaysOpen="False" PlacementMode="Top" PlacementTarget="{Binding RelativeSource={RelativeSource AncestorType=Panel}}" HorizontalOffset="8" VerticalOffset="8"> - - - Basic - Advanced - - Standard - Maps/Compasses - Maps/Compasses/Small Keys - Keysanity - - Standard/Open - Standard/Open/Retro + Inverted - Retro - - + Entrance Shuffle - Boss Shuffle