diff --git a/OpenTracker.Models/BossDictionary.cs b/OpenTracker.Models/BossDictionary.cs new file mode 100644 index 00000000..0feea07b --- /dev/null +++ b/OpenTracker.Models/BossDictionary.cs @@ -0,0 +1,76 @@ +using OpenTracker.Models.Enums; +using System.Collections.Generic; +using System.ComponentModel; + +namespace OpenTracker.Models +{ + public class BossDictionary : Dictionary, INotifyPropertyChanged + { + private readonly Game _game; + + public event PropertyChangedEventHandler PropertyChanged; + + private AccessibilityLevel _unknownBossAccessibility; + public AccessibilityLevel UnknownBossAccessibility + { + get => _unknownBossAccessibility; + private set + { + if (_unknownBossAccessibility != value) + { + _unknownBossAccessibility = value; + OnPropertyChanged(nameof(UnknownBossAccessibility)); + } + } + } + + public BossDictionary(Game game, int capacity) : base(capacity) + { + _game = game; + } + + private void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private void OnRequirementChanged(object sender, PropertyChangedEventArgs e) + { + UpdateUnknownBossAccessibility(); + } + + private void UpdateUnknownBossAccessibility() + { + bool BossInaccessibility = false; + + foreach (Boss boss in Values) + { + if (boss.Type != BossType.Aga) + { + if (boss.Accessibility < AccessibilityLevel.SequenceBreak) + { + BossInaccessibility = true; + break; + } + } + } + + if (BossInaccessibility) + UnknownBossAccessibility = AccessibilityLevel.SequenceBreak; + else + UnknownBossAccessibility = AccessibilityLevel.Normal; + } + + public void SubscribeToMemberEvents() + { + foreach (Boss boss in Values) + { + if (boss.Type != BossType.Aga) + boss.PropertyChanged += OnRequirementChanged; + } + + UpdateUnknownBossAccessibility(); + } + } +} diff --git a/OpenTracker.Models/BossSection.cs b/OpenTracker.Models/BossSection.cs index 4778167b..85eba669 100644 --- a/OpenTracker.Models/BossSection.cs +++ b/OpenTracker.Models/BossSection.cs @@ -406,7 +406,7 @@ public BossSection(Game game, LocationID iD) GetAccessibility = () => { if ((_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) && - _game.Items.Has(ItemType.GTSmallKey, 2) && _game.Items.Has(ItemType.GTBigKey)) + _game.Items.Has(ItemType.GTSmallKey, 1) && _game.Items.Has(ItemType.GTBigKey)) return AccessibilityLevel.Normal; return AccessibilityLevel.None; @@ -444,7 +444,9 @@ private void UpdateAccessibility() if (_game.Mode.BossShuffle.Value) { - if (Boss != null) + if (Boss == null) + bossAccessibility = _game.Bosses.UnknownBossAccessibility; + else bossAccessibility = Boss.Accessibility; } else @@ -484,7 +486,9 @@ private void OnPropertyChanging(string propertyName) { if (propertyName == nameof(Boss)) { - if (Boss != null) + if (Boss == null) + _game.Bosses.PropertyChanged -= OnBossChanged; + else if (Boss != _defaultBoss) Boss.PropertyChanged -= OnBossChanged; } @@ -508,7 +512,9 @@ private void OnPropertyChanged(string propertyName) if (propertyName == nameof(Boss)) { - if (Boss != null) + if (Boss == null) + _game.Bosses.PropertyChanged += OnBossChanged; + else if (Boss != _defaultBoss) Boss.PropertyChanged += OnBossChanged; UpdateAccessibility(); diff --git a/OpenTracker.Models/Game.cs b/OpenTracker.Models/Game.cs index 3c1f530b..a1b32a97 100644 --- a/OpenTracker.Models/Game.cs +++ b/OpenTracker.Models/Game.cs @@ -7,7 +7,7 @@ namespace OpenTracker.Models public class Game { public Mode Mode { get; } - public Dictionary Bosses { get; } + public BossDictionary Bosses { get; } public ItemDictionary Items { get; } public Dictionary Regions { get; } public LocationDictionary Locations { get; } @@ -24,7 +24,7 @@ public Game() EnemyShuffle = false }; - Bosses = new Dictionary(Enum.GetValues(typeof(BossType)).Length); + Bosses = new BossDictionary(this, Enum.GetValues(typeof(BossType)).Length); Items = new ItemDictionary(Mode, Enum.GetValues(typeof(ItemType)).Length); Regions = new Dictionary(Enum.GetValues(typeof(RegionID)).Length); Locations = new LocationDictionary(Enum.GetValues(typeof(LocationID)).Length); @@ -35,6 +35,8 @@ public Game() foreach (BossType type in Enum.GetValues(typeof(BossType))) Bosses.Add(type, new Boss(this, type)); + Bosses.SubscribeToMemberEvents(); + foreach (RegionID iD in Enum.GetValues(typeof(RegionID))) Regions.Add(iD, new Region(this, iD)); diff --git a/OpenTracker.Models/ItemSection.cs b/OpenTracker.Models/ItemSection.cs index b2c68045..98f690b2 100644 --- a/OpenTracker.Models/ItemSection.cs +++ b/OpenTracker.Models/ItemSection.cs @@ -2005,15 +2005,25 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.Lamp) && _game.Items.Has(ItemType.ATSmallKey)) - return AccessibilityLevel.Normal; - - return AccessibilityLevel.SequenceBreak; + if (_game.Items.Has(ItemType.ATSmallKey)) + { + if (_game.Items.Has(ItemType.Lamp)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available == 2) + return AccessibilityLevel.Partial; + + return AccessibilityLevel.None; }; itemReqs.Add(_game.Items[ItemType.Lamp]); itemReqs.Add(_game.Items[ItemType.ATSmallKey]); + PropertyChanged += OnRequirementChanged; + break; case LocationID.EasternPalace: @@ -2026,14 +2036,38 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.EPBigKey) && _game.Items.Has(ItemType.Lamp)) - return AccessibilityLevel.Normal; + if (_game.Mode.DungeonItemShuffle <= DungeonItemShuffle.MapsCompassesSmallKeys) + { + if (_game.Items.Has(ItemType.Lamp) && + (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (_game.Items.Has(ItemType.EPBigKey) && + (_game.Mode.EnemyShuffle.Value || _game.Items.Has(ItemType.Bow))) + { + if (_game.Items.Has(ItemType.Lamp)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } - return AccessibilityLevel.SequenceBreak; + if (_game.Items.Has(ItemType.EPBigKey) && Available > 1) + return AccessibilityLevel.Partial; + + if (Available > 2) + return AccessibilityLevel.Partial; + + return AccessibilityLevel.None; }; - itemReqs.Add(_game.Items[ItemType.EPBigKey]); itemReqs.Add(_game.Items[ItemType.Lamp]); + itemReqs.Add(_game.Items[ItemType.Bow]); + itemReqs.Add(_game.Items[ItemType.EPBigKey]); + + PropertyChanged += OnRequirementChanged; break; case LocationID.DesertPalace: @@ -2049,16 +2083,110 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.Boots) && _game.Items.Has(ItemType.DPSmallKey) && - _game.Items.Has(ItemType.DPBigKey)) - return AccessibilityLevel.Normal; + switch (_game.Mode.DungeonItemShuffle.Value) + { + case DungeonItemShuffle.Standard: + + if (_game.Items.Has(ItemType.Boots) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.Has(ItemType.Boots) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.Normal; + + if ((_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.Boots) && _game.Items.Has(ItemType.DPSmallKey) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.DPSmallKey) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.SequenceBreak; + + if (_game.Items.Has(ItemType.DPSmallKey)) + { + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 3) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.Keysanity: + + if (_game.Items.Has(ItemType.Boots) && _game.Items.Has(ItemType.DPBigKey) && + _game.Items.Has(ItemType.DPSmallKey) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.DPBigKey) && _game.Items.Has(ItemType.DPSmallKey) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + return AccessibilityLevel.SequenceBreak; + + if (_game.Items.Has(ItemType.DPBigKey) && _game.Items.Has(ItemType.DPSmallKey)) + { + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.DPBigKey) && + (_game.Items.Has(ItemType.Gloves) || _game.Mode.EntranceShuffle.Value) && + (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod))) + { + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.DPSmallKey)) + { + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.DPBigKey)) + { + if (Available > 3) + return AccessibilityLevel.Partial; + } + + if (Available > 4) + return AccessibilityLevel.Partial; + + break; + } - return AccessibilityLevel.SequenceBreak; + return AccessibilityLevel.None; }; itemReqs.Add(_game.Items[ItemType.Boots]); - itemReqs.Add(_game.Items[ItemType.DPSmallKey]); + itemReqs.Add(_game.Items[ItemType.Gloves]); + itemReqs.Add(_game.Items[ItemType.Lamp]); + itemReqs.Add(_game.Items[ItemType.FireRod]); itemReqs.Add(_game.Items[ItemType.DPBigKey]); + itemReqs.Add(_game.Items[ItemType.DPSmallKey]); + + PropertyChanged += OnRequirementChanged; break; case LocationID.TowerOfHera: @@ -2073,17 +2201,67 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if ((_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) && - _game.Items.Has(ItemType.ToHSmallKey) && _game.Items.Has(ItemType.ToHBigKey)) - return AccessibilityLevel.Normal; - - return AccessibilityLevel.SequenceBreak; + switch (_game.Mode.DungeonItemShuffle.Value) + { + case DungeonItemShuffle.Standard: + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if ((_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) && + _game.Items.Has(ItemType.ToHSmallKey)) + return AccessibilityLevel.Normal; + + if (Available > 1) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.Keysanity: + + if ((_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) && + _game.Items.Has(ItemType.ToHSmallKey) && _game.Items.Has(ItemType.ToHBigKey)) + return AccessibilityLevel.Normal; + + if ((_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) && + _game.Items.Has(ItemType.ToHSmallKey)) + { + if (Available > 3) + return AccessibilityLevel.Partial; + + if (_game.Items.Has(ItemType.Hookshot) && Available > 1) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.ToHBigKey)) + { + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.Hookshot) && Available > 2) + return AccessibilityLevel.Partial; + + if (Available > 4) + return AccessibilityLevel.Partial; + + break; + } + + return AccessibilityLevel.None; }; itemReqs.Add(_game.Items[ItemType.Lamp]); itemReqs.Add(_game.Items[ItemType.FireRod]); itemReqs.Add(_game.Items[ItemType.ToHSmallKey]); itemReqs.Add(_game.Items[ItemType.ToHBigKey]); + itemReqs.Add(_game.Items[ItemType.Hookshot]); + + PropertyChanged += OnRequirementChanged; break; case LocationID.PalaceOfDarkness: @@ -2098,18 +2276,171 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.Lamp) && _game.Items.Has(ItemType.PoDBigKey) && - _game.Items.Has(ItemType.PoDSmallKey, 5) && - (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value)) - return AccessibilityLevel.Normal; - - return AccessibilityLevel.SequenceBreak; + switch (_game.Mode.DungeonItemShuffle.Value) + { + case DungeonItemShuffle.Standard: + + if (_game.Items.Has(ItemType.Lamp) && _game.Items.Has(ItemType.Hammer) && + _game.Items.Has(ItemType.Bow)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.Has(ItemType.Lamp) && _game.Items.Has(ItemType.Hammer) && + _game.Items.Has(ItemType.Bow)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.Bow)) + return AccessibilityLevel.SequenceBreak; + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.Lamp) && _game.Items.Has(ItemType.Hammer) && + _game.Items.Has(ItemType.Bow) && _game.Items.Has(ItemType.PoDSmallKey, 5)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.Bow) && + _game.Items.Has(ItemType.PoDSmallKey, 4)) + return AccessibilityLevel.SequenceBreak; + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 1 && (_game.Items.Has(ItemType.PoDSmallKey, 4) || + (_game.Items.Has(ItemType.PoDSmallKey, 3) && _game.Items.Has(ItemType.Hammer)))) + return AccessibilityLevel.Partial; + + if (Available > 2 && (_game.Items.Has(ItemType.PoDSmallKey, 3) || + (_game.Items.Has(ItemType.PoDSmallKey, 2) && _game.Items.Has(ItemType.Hammer)))) + return AccessibilityLevel.Partial; + + if (Available > 3 && (_game.Items.Has(ItemType.PoDSmallKey, 2) || + (_game.Items.Has(ItemType.PoDSmallKey) && _game.Items.Has(ItemType.Hammer)))) + return AccessibilityLevel.Partial; + + if (Available > 8 && + (_game.Items.Has(ItemType.PoDSmallKey) || _game.Items.Has(ItemType.Hammer))) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey, 4) && Available > 3) + return AccessibilityLevel.Partial; + + if (_game.Items.Has(ItemType.PoDSmallKey, 3) && Available > 4) + return AccessibilityLevel.Partial; + + if (_game.Items.Has(ItemType.PoDSmallKey, 2) && Available > 5) + return AccessibilityLevel.Partial; + + if (_game.Items.Has(ItemType.PoDSmallKey) && Available > 10) + return AccessibilityLevel.Partial; + + if (Available > 12) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.Keysanity: + + if (_game.Items.Has(ItemType.Lamp) && _game.Items.Has(ItemType.Hammer) && + _game.Items.Has(ItemType.Bow) && _game.Items.Has(ItemType.PoDSmallKey, 5) && + _game.Items.Has(ItemType.PoDBigKey)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.Bow) && + _game.Items.Has(ItemType.PoDSmallKey, 4) && _game.Items.Has(ItemType.PoDBigKey)) + return AccessibilityLevel.SequenceBreak; + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (_game.Items.Has(ItemType.PoDSmallKey, 4) || + (_game.Items.Has(ItemType.PoDSmallKey, 3) && _game.Items.Has(ItemType.Hammer))) + { + if (_game.Items.Has(ItemType.PoDBigKey) && Available > 1) + return AccessibilityLevel.Partial; + + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey, 3) || + (_game.Items.Has(ItemType.PoDSmallKey, 2) && _game.Items.Has(ItemType.Hammer))) + { + if (_game.Items.Has(ItemType.PoDBigKey) && Available > 2) + return AccessibilityLevel.Partial; + + if (Available > 3) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey, 2) || + (_game.Items.Has(ItemType.PoDSmallKey) && _game.Items.Has(ItemType.Hammer))) + { + if (_game.Items.Has(ItemType.PoDBigKey) && Available > 3) + return AccessibilityLevel.Partial; + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (Available > 9 && + (_game.Items.Has(ItemType.PoDSmallKey) || _game.Items.Has(ItemType.Hammer))) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey, 4)) + { + if (_game.Items.Has(ItemType.PoDBigKey) && Available > 3) + return AccessibilityLevel.Partial; + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey, 3)) + { + if (_game.Items.Has(ItemType.PoDBigKey) && Available > 4) + return AccessibilityLevel.Partial; + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey, 2)) + { + if (_game.Items.Has(ItemType.PoDBigKey) && Available > 5) + return AccessibilityLevel.Partial; + + if (Available > 6) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.PoDSmallKey) && Available > 11) + return AccessibilityLevel.Partial; + + if (Available > 13) + return AccessibilityLevel.Partial; + + break; + } + + return AccessibilityLevel.None; }; itemReqs.Add(_game.Items[ItemType.Lamp]); + itemReqs.Add(_game.Items[ItemType.Hammer]); + itemReqs.Add(_game.Items[ItemType.Bow]); itemReqs.Add(_game.Items[ItemType.PoDBigKey]); itemReqs.Add(_game.Items[ItemType.PoDSmallKey]); - itemReqs.Add(_game.Items[ItemType.Bow]); + + PropertyChanged += OnRequirementChanged; break; case LocationID.SwampPalace: @@ -2124,14 +2455,98 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.Flippers)) + switch (_game.Mode.DungeonItemShuffle.Value) { + case DungeonItemShuffle.Standard: - if (_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.Hammer) && - _game.Items.Has(ItemType.SPSmallKey) && _game.Items.Has(ItemType.SPBigKey)) - return AccessibilityLevel.Normal; + if (_game.Items.Has(ItemType.Flippers)) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if (_game.Items.Has(ItemType.Hookshot)) + return AccessibilityLevel.Normal; - return AccessibilityLevel.SequenceBreak; + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + break; + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.Has(ItemType.Flippers)) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if (_game.Items.Has(ItemType.Hookshot)) + return AccessibilityLevel.Normal; + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.Flippers)) + { + if (_game.Items.Has(ItemType.SPSmallKey)) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if (_game.Items.Has(ItemType.Hookshot)) + return AccessibilityLevel.Normal; + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + if (Available > 8) + return AccessibilityLevel.Partial; + } + + break; + case DungeonItemShuffle.Keysanity: + + if (_game.Items.Has(ItemType.Flippers)) + { + if (_game.Items.Has(ItemType.SPSmallKey)) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if (_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.SPBigKey)) + return AccessibilityLevel.Normal; + + if (Available > 1 && _game.Items.Has(ItemType.Hookshot)) + return AccessibilityLevel.Partial; + + if (Available > 4 && _game.Items.Has(ItemType.SPBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (Available > 8) + return AccessibilityLevel.Partial; + } + + if (Available > 9) + return AccessibilityLevel.Partial; + } + + break; } return AccessibilityLevel.None; @@ -2143,6 +2558,8 @@ public ItemSection(Game game, Location location, int index = 0) itemReqs.Add(_game.Items[ItemType.SPSmallKey]); itemReqs.Add(_game.Items[ItemType.SPBigKey]); + PropertyChanged += OnRequirementChanged; + break; case LocationID.SkullWoods: @@ -2156,16 +2573,78 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.SWBigKey) && _game.Items.Has(ItemType.SWSmallKey) && - _game.Items.Has(ItemType.FireRod)) - return AccessibilityLevel.Normal; + switch (_game.Mode.DungeonItemShuffle.Value) + { + case DungeonItemShuffle.Standard: + case DungeonItemShuffle.MapsCompasses: + + if ((_game.Items.Has(ItemType.FireRod) || _game.Mode.EntranceShuffle.Value) && + _game.Items.CanRemoveCurtains()) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.FireRod) || _game.Mode.EntranceShuffle.Value) + { + if (_game.Items.CanRemoveCurtains()) + { + if (_game.Items.Has(ItemType.SWSmallKey)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 2) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.Keysanity: + + if (_game.Items.Has(ItemType.FireRod) || _game.Mode.EntranceShuffle.Value) + { + if (_game.Items.CanRemoveCurtains()) + { + if (_game.Items.Has(ItemType.SWBigKey) && _game.Items.Has(ItemType.SPSmallKey)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.SWBigKey)) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 1 && _game.Items.Has(ItemType.SWBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (Available > 2 && _game.Items.Has(ItemType.SWBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 3) + return AccessibilityLevel.Partial; + + break; + } - return AccessibilityLevel.SequenceBreak; + return AccessibilityLevel.None; }; + itemReqs.Add(_game.Items[ItemType.FireRod]); + itemReqs.Add(_game.Items[ItemType.Sword]); itemReqs.Add(_game.Items[ItemType.SWBigKey]); itemReqs.Add(_game.Items[ItemType.SWSmallKey]); - itemReqs.Add(_game.Items[ItemType.FireRod]); + + PropertyChanged += OnRequirementChanged; break; case LocationID.ThievesTown: @@ -2180,17 +2659,49 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.Has(ItemType.TTBigKey) && _game.Items.Has(ItemType.TTSmallKey) && - _game.Items.Has(ItemType.Hammer)) - return AccessibilityLevel.Normal; + switch (_game.Mode.DungeonItemShuffle.Value) + { + case DungeonItemShuffle.Standard: + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.Has(ItemType.Hammer)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.TTSmallKey)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + + case DungeonItemShuffle.Keysanity: + + if (_game.Items.Has(ItemType.TTBigKey)) + { + if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.TTSmallKey)) + return AccessibilityLevel.Normal; + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 4) + return AccessibilityLevel.Partial; + + break; + } - return AccessibilityLevel.SequenceBreak; + return AccessibilityLevel.None; }; itemReqs.Add(_game.Items[ItemType.TTBigKey]); itemReqs.Add(_game.Items[ItemType.TTSmallKey]); itemReqs.Add(_game.Items[ItemType.Hammer]); + PropertyChanged += OnRequirementChanged; + break; case LocationID.IcePalace: @@ -2204,13 +2715,84 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Items.CanMeltThings()) + switch (_game.Mode.DungeonItemShuffle.Value) { - if (_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.Hammer) && - _game.Items.Has(ItemType.IPBigKey)) - return AccessibilityLevel.Normal; - - return AccessibilityLevel.SequenceBreak; + case DungeonItemShuffle.Standard: + + if (_game.Items.CanMeltThings()) + { + if (_game.Items.Has(ItemType.Hammer) && + (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.CaneOfSomaria))) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + break; + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.CanMeltThings()) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.CanMeltThings()) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if ((_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.CaneOfSomaria)) || + (_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.IPSmallKey)) || + (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.IPSmallKey)) || + _game.Items.Has(ItemType.IPSmallKey, 2)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 3) + return AccessibilityLevel.Partial; + } + + break; + case DungeonItemShuffle.Keysanity: + + if (_game.Items.CanMeltThings()) + { + if (_game.Items.Has(ItemType.Hammer)) + { + if (((_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.CaneOfSomaria)) || + (_game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.IPSmallKey)) || + (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.IPSmallKey)) || + _game.Items.Has(ItemType.IPSmallKey, 2)) && _game.Items.Has(ItemType.IPBigKey)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.IPBigKey)) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 3 && _game.Items.Has(ItemType.IPBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + break; } return AccessibilityLevel.None; @@ -2219,10 +2801,14 @@ public ItemSection(Game game, Location location, int index = 0) itemReqs.Add(_game.Items[ItemType.FireRod]); itemReqs.Add(_game.Items[ItemType.Bombos]); itemReqs.Add(_game.Items[ItemType.Sword]); - itemReqs.Add(_game.Items[ItemType.Hookshot]); itemReqs.Add(_game.Items[ItemType.Hammer]); + itemReqs.Add(_game.Items[ItemType.Hookshot]); + itemReqs.Add(_game.Items[ItemType.CaneOfSomaria]); + itemReqs.Add(_game.Items[ItemType.IPSmallKey]); itemReqs.Add(_game.Items[ItemType.IPBigKey]); + PropertyChanged += OnRequirementChanged; + break; case LocationID.MiseryMire: @@ -2236,17 +2822,91 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - - if (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots)) + switch (_game.Mode.DungeonItemShuffle.Value) { - if ((_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) && - _game.Items.Has(ItemType.MMBigKey) && - (_game.Items.Has(ItemType.Hookshot) || (_game.Items.Has(ItemType.Boots) && - (_game.Mode.ItemPlacement == ItemPlacement.Advanced || - _game.Mode.WorldState == WorldState.Inverted)))) - return AccessibilityLevel.Normal; + case DungeonItemShuffle.Standard: + case DungeonItemShuffle.MapsCompasses: - return AccessibilityLevel.SequenceBreak; + if (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots)) + { + if (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if ((_game.Items.Has(ItemType.Hookshot) || + (_game.Items.Has(ItemType.Boots) && _game.Mode.ItemPlacement == ItemPlacement.Advanced)) && + _game.Items.Has(ItemType.Lamp)) + return AccessibilityLevel.Normal; + } + } + + return AccessibilityLevel.SequenceBreak; + } + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots)) + { + if (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if ((_game.Items.Has(ItemType.Hookshot) || + (_game.Items.Has(ItemType.Boots) && _game.Mode.ItemPlacement == ItemPlacement.Advanced)) && + _game.Items.Has(ItemType.Lamp)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 2 && _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.Partial; + + if (Available > 3) + return AccessibilityLevel.Partial; + } + + break; + case DungeonItemShuffle.Keysanity: + + if (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots)) + { + if (_game.Items.Has(ItemType.Lamp) || _game.Items.Has(ItemType.FireRod)) + { + if (_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.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 1 && _game.Items.Has(ItemType.MMBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (Available > 2 && + _game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.MMBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 3 && _game.Items.Has(ItemType.MMBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + break; } return AccessibilityLevel.None; @@ -2256,8 +2916,11 @@ public ItemSection(Game game, Location location, int index = 0) itemReqs.Add(_game.Items[ItemType.Boots]); itemReqs.Add(_game.Items[ItemType.Lamp]); itemReqs.Add(_game.Items[ItemType.FireRod]); + itemReqs.Add(_game.Items[ItemType.CaneOfSomaria]); itemReqs.Add(_game.Items[ItemType.MMBigKey]); + PropertyChanged += OnRequirementChanged; + break; case LocationID.TurtleRock: @@ -2271,78 +2934,323 @@ public ItemSection(Game game, Location location, int index = 0) GetAccessibility = () => { - if (_game.Mode.EntranceShuffle.Value) + AccessibilityLevel frontAccess() { - if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.Lamp) && - _game.Items.Has(ItemType.TRBigKey) && _game.Items.Has(ItemType.CaneOfSomaria)) + if (_game.Mode.EntranceShuffle.Value) return AccessibilityLevel.Normal; - return AccessibilityLevel.SequenceBreak; + if (_game.Mode.WorldState == WorldState.StandardOpen) + { + if (_game.Items.Has(ItemType.Hammer) && + _game.Items.CanUseMedallions() && ((_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))) + return _game.Regions[RegionID.DarkDeathMountainTop].Accessibility; + } + + if (_game.Mode.WorldState == WorldState.Inverted) + { + if (_game.Items.CanUseMedallions() && ((_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))) + return _game.Regions[RegionID.DarkDeathMountainTop].Accessibility; + } + + return AccessibilityLevel.None; } - if (_game.Mode.WorldState == WorldState.StandardOpen) + AccessibilityLevel backAccess() { - if (_game.Items.Has(ItemType.CaneOfSomaria)) - { - if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.Lamp) && - _game.Items.Has(ItemType.TRSmallKey) && _game.Items.Has(ItemType.TRBigKey) && - (_game.Items.Has(ItemType.Cape) || _game.Items.Has(ItemType.CaneOfByrna) || - _game.Items.Has(ItemType.Shield, 3) || - _game.Mode.ItemPlacement == ItemPlacement.Advanced)) - return AccessibilityLevel.Normal; + if (_game.Mode.EntranceShuffle.Value) + return AccessibilityLevel.Normal; - return AccessibilityLevel.SequenceBreak; + if (_game.Mode.WorldState == WorldState.Inverted) + { + if (_game.Regions[RegionID.DeathMountainEastTop].Accessibility >= AccessibilityLevel.SequenceBreak && + _game.Items.Has(ItemType.Mirror)) + return _game.Regions[RegionID.DeathMountainEastTop].Accessibility; } + + return AccessibilityLevel.None; } - if (_game.Mode.WorldState == WorldState.Inverted) + switch (_game.Mode.DungeonItemShuffle.Value) { - if (_game.Regions[RegionID.DeathMountainEastTop].Accessibility == AccessibilityLevel.Normal && - _game.Items.Has(ItemType.Mirror)) - { - if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.Lamp) && - _game.Items.Has(ItemType.TRBigKey) && _game.Items.Has(ItemType.CaneOfSomaria)) + case DungeonItemShuffle.Standard: + + if (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.FireRod) && + _game.Items.Has(ItemType.Lamp) && (_game.Mode.ItemPlacement == ItemPlacement.Advanced || + _game.Mode.WorldState == WorldState.Inverted || _game.Items.Has(ItemType.Cape) || + _game.Items.Has(ItemType.CaneOfByrna) || _game.Items.Has(ItemType.Shield, 3))) return AccessibilityLevel.Normal; - - return AccessibilityLevel.SequenceBreak; - } - - 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.FireRod) && _game.Items.Has(ItemType.Lamp) && - _game.Items.Has(ItemType.TRSmallKey, 3) && _game.Items.Has(ItemType.TRBigKey)) - return _game.Regions[RegionID.DarkDeathMountainTop].Accessibility; - - return AccessibilityLevel.SequenceBreak; - } - - if (_game.Regions[RegionID.DeathMountainEastTop].Accessibility == AccessibilityLevel.SequenceBreak && - _game.Items.Has(ItemType.Mirror)) - return AccessibilityLevel.SequenceBreak; + + if (backAccess() >= AccessibilityLevel.SequenceBreak) + return AccessibilityLevel.SequenceBreak; + + if (frontAccess() >= AccessibilityLevel.SequenceBreak && _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.SequenceBreak; + + break; + case DungeonItemShuffle.MapsCompasses: + + if (_game.Items.Has(ItemType.CaneOfSomaria) && _game.Items.Has(ItemType.FireRod) && + _game.Items.Has(ItemType.Lamp) && (_game.Mode.ItemPlacement == ItemPlacement.Advanced || + _game.Mode.WorldState == WorldState.Inverted || _game.Items.Has(ItemType.Cape) || + _game.Items.Has(ItemType.CaneOfByrna) || _game.Items.Has(ItemType.Shield, 3))) + return AccessibilityLevel.Normal; + + if (backAccess() >= AccessibilityLevel.SequenceBreak) + return AccessibilityLevel.SequenceBreak; + + if (frontAccess() >= AccessibilityLevel.SequenceBreak) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.SequenceBreak; + + if (Available > 2) + return AccessibilityLevel.Partial; + } + } + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + if (backAccess() >= AccessibilityLevel.SequenceBreak) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.TRSmallKey, 2) || + (_game.Items.Has(ItemType.TRSmallKey) && frontAccess() >= AccessibilityLevel.SequenceBreak)) + { + if (_game.Items.Has(ItemType.FireRod) && (_game.Mode.ItemPlacement == ItemPlacement.Advanced || + _game.Mode.WorldState == WorldState.Inverted || _game.Items.Has(ItemType.Cape) || + _game.Items.Has(ItemType.CaneOfByrna) || _game.Items.Has(ItemType.Shield, 3))) + return AccessibilityLevel.Normal; + + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey) || frontAccess() >= AccessibilityLevel.SequenceBreak) + { + if (Available > 1 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 3) + return AccessibilityLevel.Partial; + } + } + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (frontAccess() >= AccessibilityLevel.SequenceBreak) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.TRSmallKey, 4)) + { + if (_game.Items.Has(ItemType.FireRod)) + { + if (_game.Items.Has(ItemType.Lamp) && (_game.Mode.ItemPlacement == ItemPlacement.Advanced || + _game.Mode.WorldState == WorldState.Inverted || _game.Items.Has(ItemType.Cape) || + _game.Items.Has(ItemType.CaneOfByrna) || _game.Items.Has(ItemType.Shield, 3))) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey, 3)) + { + if (Available > 1 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 3) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey, 2)) + { + if (Available > 5 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey)) + { + if (Available > 7 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 9) + return AccessibilityLevel.Partial; + } + + if (Available > 8 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 10) + return AccessibilityLevel.Partial; + } + } + + break; + case DungeonItemShuffle.Keysanity: + + if (backAccess() >= AccessibilityLevel.SequenceBreak) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (frontAccess() >= AccessibilityLevel.SequenceBreak) + { + if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.TRSmallKey) && + _game.Items.Has(ItemType.TRBigKey) && (_game.Mode.ItemPlacement == ItemPlacement.Advanced || + _game.Mode.WorldState == WorldState.Inverted || _game.Items.Has(ItemType.Cape) || + _game.Items.Has(ItemType.CaneOfByrna) || _game.Items.Has(ItemType.Shield, 3))) + return AccessibilityLevel.Normal; + + if (Available > 4) + return AccessibilityLevel.Partial; + + if (Available > 3 && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 2 && + _game.Items.Has(ItemType.TRSmallKey) && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 2 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 1 && + _game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.TRSmallKey, 2) && + _game.Items.Has(ItemType.TRBigKey) && (_game.Mode.ItemPlacement == ItemPlacement.Advanced || + _game.Mode.WorldState == WorldState.Inverted || _game.Items.Has(ItemType.Cape) || + _game.Items.Has(ItemType.CaneOfByrna) || _game.Items.Has(ItemType.Shield, 3))) + return AccessibilityLevel.Normal; + + if (Available > 4 && _game.Items.Has(ItemType.TRSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 4 && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 3 && + _game.Items.Has(ItemType.TRSmallKey) && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 2 && + _game.Items.Has(ItemType.TRSmallKey) && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 2 && + _game.Items.Has(ItemType.TRSmallKey, 2) && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 1 && _game.Items.Has(ItemType.FireRod) && + _game.Items.Has(ItemType.TRSmallKey) && _game.Items.Has(ItemType.TRBigKey)) + return AccessibilityLevel.Partial; + } + + if (Available > 4 && + _game.Items.Has(ItemType.TRBigKey) && _game.Items.Has(ItemType.Hookshot)) + return AccessibilityLevel.Partial; + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (frontAccess() >= AccessibilityLevel.SequenceBreak) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.TRSmallKey, 4) && _game.Items.Has(ItemType.TRBigKey)) + { + if (_game.Items.Has(ItemType.FireRod)) + { + if (_game.Items.Has(ItemType.Lamp)) + return AccessibilityLevel.Normal; + + return AccessibilityLevel.SequenceBreak; + } + + if (Available > 2) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey, 3) && _game.Items.Has(ItemType.TRBigKey)) + { + if (Available > 1 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 3) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey, 2)) + { + if (_game.Items.Has(ItemType.TRBigKey)) + { + if (Available > 5 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + if (Available > 7 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 9) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.TRSmallKey)) + { + if (Available > 8 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 10) + return AccessibilityLevel.Partial; + } + + if (Available > 9 && _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Partial; + + if (Available > 11) + return AccessibilityLevel.Partial; + } + } + + break; } return AccessibilityLevel.None; }; - itemReqs.Add(_game.Items[ItemType.FireRod]); - itemReqs.Add(_game.Items[ItemType.Lamp]); - itemReqs.Add(_game.Items[ItemType.TRBigKey]); - itemReqs.Add(_game.Items[ItemType.CaneOfSomaria]); - itemReqs.Add(_game.Items[ItemType.TRSmallKey]); - itemReqs.Add(_game.Items[ItemType.Mirror]); - itemReqs.Add(_game.Items[ItemType.Hookshot]); - itemReqs.Add(_game.Items[ItemType.Cape]); - itemReqs.Add(_game.Items[ItemType.CaneOfByrna]); - itemReqs.Add(_game.Items[ItemType.Shield]); + itemReqs.Add(_game.Items[ItemType.Hammer]); itemReqs.Add(_game.Items[ItemType.Sword]); itemReqs.Add(_game.Items[ItemType.Bombos]); itemReqs.Add(_game.Items[ItemType.BombosDungeons]); @@ -2350,42 +3258,417 @@ public ItemSection(Game game, Location location, int index = 0) itemReqs.Add(_game.Items[ItemType.EtherDungeons]); itemReqs.Add(_game.Items[ItemType.Quake]); itemReqs.Add(_game.Items[ItemType.QuakeDungeons]); + itemReqs.Add(_game.Items[ItemType.Mirror]); + itemReqs.Add(_game.Items[ItemType.CaneOfSomaria]); + itemReqs.Add(_game.Items[ItemType.FireRod]); + itemReqs.Add(_game.Items[ItemType.Lamp]); + itemReqs.Add(_game.Items[ItemType.Cape]); + itemReqs.Add(_game.Items[ItemType.CaneOfByrna]); + itemReqs.Add(_game.Items[ItemType.Shield]); + itemReqs.Add(_game.Items[ItemType.TRSmallKey]); + itemReqs.Add(_game.Items[ItemType.TRBigKey]); + itemReqs.Add(_game.Items[ItemType.Hookshot]); _game.Regions[RegionID.DeathMountainEastTop].PropertyChanged += OnRequirementChanged; _game.Regions[RegionID.DarkDeathMountainTop].PropertyChanged += OnRequirementChanged; + PropertyChanged += OnRequirementChanged; + break; case LocationID.GanonsTower: _mapCompass = 2; _smallKey = 4; _bigKey = 1; - _baseTotal = 20; + _baseTotal = 19; Name = "Dungeon"; _standardRegion = _game.Regions[RegionID.GanonsTower]; _invertedRegion = _game.Regions[RegionID.GanonsTower]; GetAccessibility = () => { - if (_game.Items.Has(ItemType.Hammer) && _game.Items.Has(ItemType.FireRod) && - _game.Items.Has(ItemType.Hookshot) && _game.Items.Has(ItemType.Boots) && - _game.Items.Has(ItemType.CaneOfSomaria) && - (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) && - _game.Items.Has(ItemType.GTSmallKey, 2) && _game.Items.Has(ItemType.GTBigKey)) - return AccessibilityLevel.Normal; + switch (_game.Mode.DungeonItemShuffle.Value) + { + case DungeonItemShuffle.Standard: + + 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.Bow) || _game.Mode.EnemyShuffle.Value) && + _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && + (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots))) + { + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 2 && + (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value)) + return AccessibilityLevel.Partial; + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 4 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (Available > 7 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 8) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 13 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 14) + return AccessibilityLevel.Partial; + } + + } + + if (Available > 15 && _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.Partial; + + if (Available > 16) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.MapsCompasses: + + 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.Bow) || _game.Mode.EnemyShuffle.Value) && + _game.Items.Has(ItemType.FireRod)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && + (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots))) + { + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + return AccessibilityLevel.SequenceBreak; + + if (Available > 3) + return AccessibilityLevel.Partial; + } + + if (Available > 4 && + (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value)) + return AccessibilityLevel.Partial; + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 6 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 7) + return AccessibilityLevel.Partial; + } + + if (Available > 10) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 15 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 16) + return AccessibilityLevel.Partial; + } + } + + if (Available > 17 && _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.Partial; + + if (Available > 18) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.MapsCompassesSmallKeys: + + 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.Bow) || _game.Mode.EnemyShuffle.Value) && + _game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.GTSmallKey, 2)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && + (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots))) + { + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (_game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 5 && _game.Items.Has(ItemType.GTSmallKey, 2)) + return AccessibilityLevel.Partial; + + if (Available > 6 && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 7) + return AccessibilityLevel.Partial; + } + } + + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (Available > 8 && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 9) + return AccessibilityLevel.Partial; + } + + if (Available > 9 && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 10) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 9 && _game.Items.Has(ItemType.GTSmallKey) && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 10) + return AccessibilityLevel.Partial; + } + + if (Available > 13) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 19 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 20) + return AccessibilityLevel.Partial; + } + } + + if (Available > 21 && _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.Partial; + + if (Available > 22) + return AccessibilityLevel.Partial; + + break; + case DungeonItemShuffle.Keysanity: + + 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.Bow) || _game.Mode.EnemyShuffle.Value) && + _game.Items.Has(ItemType.FireRod) && _game.Items.Has(ItemType.GTSmallKey, 2) && + _game.Items.Has(ItemType.GTBigKey)) + return AccessibilityLevel.Normal; + + if (_game.Items.Has(ItemType.Hammer) && + (_game.Items.Has(ItemType.Hookshot) || _game.Items.Has(ItemType.Boots))) + { + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.GTBigKey)) + { + if ((_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) && + _game.Items.Has(ItemType.GTBigKey)) + { + if (_game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.SequenceBreak; + + if (Available > 1) + return AccessibilityLevel.Partial; + } + + if (Available > 4) + return AccessibilityLevel.Partial; + } + + if (Available > 5) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.GTBigKey)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 5 && _game.Items.Has(ItemType.GTSmallKey, 2)) + return AccessibilityLevel.Partial; + + if (Available > 6 && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 7) + return AccessibilityLevel.Partial; + } + } + } + + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (Available > 8 && + _game.Items.Has(ItemType.GTBigKey) && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 9 && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 9 && _game.Items.Has(ItemType.GTBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 10) + return AccessibilityLevel.Partial; + } + + if (Available > 9 && + _game.Items.Has(ItemType.GTSmallKey) && _game.Items.Has(ItemType.GTBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 10 && _game.Items.Has(ItemType.GTSmallKey)) + return AccessibilityLevel.Partial; + + if (Available > 10 && _game.Items.Has(ItemType.GTBigKey)) + return AccessibilityLevel.Partial; + + if (Available > 11) + return AccessibilityLevel.Partial; + } + + if (_game.Items.Has(ItemType.FireRod) || _game.Items.Has(ItemType.Lamp)) + { + if (_game.Items.Has(ItemType.CaneOfSomaria)) + { + if (_game.Items.Has(ItemType.GTBigKey)) + { + if (_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) + { + if (Available > 10 && _game.Items.Has(ItemType.GTSmallKey) && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 11) + return AccessibilityLevel.Partial; + } + + if (Available > 13) + return AccessibilityLevel.Partial; + } + + if (Available > 14) + return AccessibilityLevel.Partial; + } + + if ((_game.Items.Has(ItemType.Bow) || _game.Mode.EnemyShuffle.Value) && + _game.Items.Has(ItemType.GTBigKey)) + { + if (Available > 20 && + (_game.Items.Has(ItemType.Boots) || _game.Items.Has(ItemType.Hookshot))) + return AccessibilityLevel.Partial; + + if (Available > 21) + return AccessibilityLevel.Partial; + } + } + + if (Available > 22 && _game.Items.Has(ItemType.CaneOfSomaria)) + return AccessibilityLevel.Partial; + + if (Available > 23) + return AccessibilityLevel.Partial; + + break; + } - return AccessibilityLevel.SequenceBreak; + return AccessibilityLevel.None; }; itemReqs.Add(_game.Items[ItemType.Hammer]); - itemReqs.Add(_game.Items[ItemType.FireRod]); itemReqs.Add(_game.Items[ItemType.Hookshot]); itemReqs.Add(_game.Items[ItemType.Boots]); itemReqs.Add(_game.Items[ItemType.CaneOfSomaria]); itemReqs.Add(_game.Items[ItemType.Bow]); + itemReqs.Add(_game.Items[ItemType.FireRod]); + itemReqs.Add(_game.Items[ItemType.Lamp]); itemReqs.Add(_game.Items[ItemType.GTSmallKey]); itemReqs.Add(_game.Items[ItemType.GTBigKey]); + PropertyChanged += OnRequirementChanged; + break; } @@ -2449,7 +3732,7 @@ private void OnModeChanged(object sender, PropertyChangedEventArgs e) { UpdateAccessibility(); - if (e.PropertyName == "DungeonItemShuffle") + if (e.PropertyName == nameof(_game.Mode.DungeonItemShuffle)) SetTotal(); } @@ -2461,17 +3744,10 @@ private void OnPropertyChanged(string propertyName) public void Clear() { - Available = 0; - - if (Marking != null) + do { - if (Enum.TryParse(Marking.ToString(), out ItemType itemType)) - { - Item item = _game.Items[itemType]; - item.Change(1); - Marking = null; - } - } + Available--; + } while (Accessibility >= AccessibilityLevel.Inspect && Available > 0); } public bool IsAvailable() diff --git a/OpenTracker.Models/Location.cs b/OpenTracker.Models/Location.cs index bd842358..47671b97 100644 --- a/OpenTracker.Models/Location.cs +++ b/OpenTracker.Models/Location.cs @@ -1932,9 +1932,10 @@ public AccessibilityLevel GetAccessibility(Mode mode, ItemDictionary items) { AccessibilityLevel.None => AccessibilityLevel.None, AccessibilityLevel.Inspect => AccessibilityLevel.Inspect, - AccessibilityLevel.SequenceBreak when leastAccessible.Value <= AccessibilityLevel.Inspect => AccessibilityLevel.Partial, + AccessibilityLevel.Partial => AccessibilityLevel.Partial, + AccessibilityLevel.SequenceBreak when leastAccessible.Value <= AccessibilityLevel.Partial => AccessibilityLevel.Partial, AccessibilityLevel.SequenceBreak => AccessibilityLevel.SequenceBreak, - AccessibilityLevel.Normal when leastAccessible.Value <= AccessibilityLevel.Inspect => AccessibilityLevel.Partial, + AccessibilityLevel.Normal when leastAccessible.Value <= AccessibilityLevel.Partial => AccessibilityLevel.Partial, AccessibilityLevel.Normal when leastAccessible.Value == AccessibilityLevel.SequenceBreak => AccessibilityLevel.SequenceBreak, AccessibilityLevel.Normal => AccessibilityLevel.Normal, _ => throw new Exception(string.Format("Unknown availability state for location {0}", ID.ToString())), diff --git a/OpenTracker.Models/Region.cs b/OpenTracker.Models/Region.cs index d779b331..9c0d2cbe 100644 --- a/OpenTracker.Models/Region.cs +++ b/OpenTracker.Models/Region.cs @@ -1561,7 +1561,8 @@ public Region(Game game, RegionID iD) // Standard and Open modes if (_game.Mode.WorldState == WorldState.StandardOpen) { - if (!excludedRegions.Contains(RegionID.DarkWorldEast)) + // Access via East Dark World entrance + if (_game.Items.Has(ItemType.MoonPearl) && !excludedRegions.Contains(RegionID.DarkWorldEast)) return _game.Regions[RegionID.DarkWorldEast].GetAccessibility(newExcludedRegions); } @@ -1569,7 +1570,7 @@ public Region(Game game, RegionID iD) if (_game.Mode.WorldState == WorldState.Inverted) { // Access via East Dark World entrance - if (_game.Items.Has(ItemType.MoonPearl) && !excludedRegions.Contains(RegionID.DarkWorldEast)) + if (!excludedRegions.Contains(RegionID.DarkWorldEast)) return _game.Regions[RegionID.DarkWorldEast].GetAccessibility(newExcludedRegions); } diff --git a/OpenTracker.Setup/OpenTracker.Setup.vdproj b/OpenTracker.Setup/OpenTracker.Setup.vdproj index aca670aa..308c1927 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:{A3C83B98-5A66-4E86-A455-29CC361E56C5}" - "PackageCode" = "8:{26F4FDDD-0B2E-4218-BA21-CB9BCBA965C8}" + "ProductCode" = "8:{8560B543-CDC5-4378-A016-E7442882BFE7}" + "PackageCode" = "8:{6477EB62-4D47-47D0-A7B6-FC12ED9C33DB}" "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.6.2" + "ProductVersion" = "8:0.7.0" "Manufacturer" = "8:OpenTracker" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" @@ -824,7 +824,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_8BEB0D6860DB4F80B56A45FAD1BDE151" { - "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/Actions/ClearLocation.cs b/OpenTracker/Actions/ClearLocation.cs index f44a66c4..70ef15c2 100644 --- a/OpenTracker/Actions/ClearLocation.cs +++ b/OpenTracker/Actions/ClearLocation.cs @@ -55,7 +55,9 @@ public void Execute() _previousLocationCounts.Add(itemSection.Available); _previousMarkings.Add(itemSection.Marking); - if (itemSection.Marking != null) + itemSection.Clear(); + + if (itemSection.Available == 0 && itemSection.Marking != null) { Item item = _game.Items[Enum.Parse(itemSection.Marking.Value.ToString())]; itemSection.Marking = null; @@ -71,8 +73,6 @@ public void Execute() else _markedItems.Add(null); - itemSection.Available = 0; - break; } } diff --git a/OpenTracker/OpenTracker.csproj b/OpenTracker/OpenTracker.csproj index be857ee8..780274d4 100644 --- a/OpenTracker/OpenTracker.csproj +++ b/OpenTracker/OpenTracker.csproj @@ -4,10 +4,10 @@ netcoreapp3.1 triforce.ico - 0.6.2 + 0.7.0 Tripp - 0.6.2.0 - 0.6.2.0 + 0.7.0.0 + 0.7.0.0 osx-x64;linux-x64;debian-x64;rhel-x64;win-x64;win-x86;win7-x64;win7-x86 diff --git a/OpenTracker/Program.cs b/OpenTracker/Program.cs index 3d85f206..653eb02f 100644 --- a/OpenTracker/Program.cs +++ b/OpenTracker/Program.cs @@ -1,6 +1,4 @@ -using System; -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; +using Avalonia; using Avalonia.Logging.Serilog; using Avalonia.ReactiveUI; diff --git a/OpenTracker/ViewModels/MapLocationControlVM.cs b/OpenTracker/ViewModels/MapLocationControlVM.cs index 103a6bda..3faec230 100644 --- a/OpenTracker/ViewModels/MapLocationControlVM.cs +++ b/OpenTracker/ViewModels/MapLocationControlVM.cs @@ -296,7 +296,7 @@ public void ClearAvailableSections() foreach (ISection section in _mapLocation.Location.Sections) { if (section.IsAvailable() && - (section.Accessibility >= AccessibilityLevel.SequenceBreak || + (section.Accessibility >= AccessibilityLevel.Partial || (section.Accessibility == AccessibilityLevel.Inspect && section.Marking == null) || section is EntranceSection)) diff --git a/OpenTracker/ViewModels/SectionControlVM.cs b/OpenTracker/ViewModels/SectionControlVM.cs index 915e1bc3..bc1a3360 100644 --- a/OpenTracker/ViewModels/SectionControlVM.cs +++ b/OpenTracker/ViewModels/SectionControlVM.cs @@ -314,6 +314,7 @@ private void Update() case AccessibilityLevel.Inspect: ImageSource = "avares://OpenTracker/Assets/Images/chest0.png"; break; + case AccessibilityLevel.Partial: case AccessibilityLevel.SequenceBreak: case AccessibilityLevel.Normal: ImageSource = "avares://OpenTracker/Assets/Images/chest1.png"; @@ -444,7 +445,7 @@ public void ChangeAvailable(bool rightClick = false) if (_section is EntranceSection || (_section is BossSection bossSection && bossSection.Prize != null && bossSection.Prize.Type == ItemType.Aga2) || - _section.Accessibility >= AccessibilityLevel.SequenceBreak) + _section.Accessibility >= AccessibilityLevel.Partial) { switch (_section) {