diff --git a/src/TrackerCouncil.Smz3.Data/Configuration/ConfigTypes/ItemData.cs b/src/TrackerCouncil.Smz3.Data/Configuration/ConfigTypes/ItemData.cs index 153674ff..14b90831 100644 --- a/src/TrackerCouncil.Smz3.Data/Configuration/ConfigTypes/ItemData.cs +++ b/src/TrackerCouncil.Smz3.Data/Configuration/ConfigTypes/ItemData.cs @@ -309,10 +309,10 @@ public bool IsJunk(Config? config) /// This method only considers the item's value on its own. Call TrackerBase.IsWorth(ItemData) to include /// items that this item might logically lead to. /// - public bool IsProgression(Config? config, bool isLocalPlayerItem) + public bool IsPossibleProgression(Config? config, bool isLocalPlayerItem) { - // Todo: We can add special logic like checking if it's one of the first two swords - return InternalItemType.IsPossibleProgression(config?.ZeldaKeysanity == true, config?.MetroidKeysanity == true, isLocalPlayerItem); + return InternalItemType.IsPossibleProgression(config?.ZeldaKeysanity == true, config?.MetroidKeysanity == true, + isLocalPlayerItem); } /// diff --git a/src/TrackerCouncil.Smz3.SeedGenerator/Generation/GameHintService.cs b/src/TrackerCouncil.Smz3.SeedGenerator/Generation/GameHintService.cs index 862dd450..31a4c813 100644 --- a/src/TrackerCouncil.Smz3.SeedGenerator/Generation/GameHintService.cs +++ b/src/TrackerCouncil.Smz3.SeedGenerator/Generation/GameHintService.cs @@ -8,7 +8,6 @@ using TrackerCouncil.Smz3.Data.Configuration; using TrackerCouncil.Smz3.Data.Configuration.ConfigFiles; using TrackerCouncil.Smz3.Data.GeneratedData; -using TrackerCouncil.Smz3.Data.Options; using TrackerCouncil.Smz3.Data.Services; using TrackerCouncil.Smz3.Data.WorldData; using TrackerCouncil.Smz3.Data.WorldData.Regions; @@ -158,8 +157,10 @@ public void GetInGameHints(World hintPlayerWorld, List allWorlds, Playthr var importantLocations = GetImportantLocations(allWorlds); locationsToCheck = locationsToCheck.Where(l => s_importantLocations.Contains(l.Id) || l.Item.Progression || - l.Item.Type.IsInAnyCategory(ItemCategory.SmallKey, ItemCategory.BigKey, ItemCategory.Keycard) || - l.Item.Type is ItemType.Super or ItemType.PowerBomb or ItemType.ProgressiveSword or ItemType.SilverArrows).ToList(); + l.Item.Type.IsInAnyCategory(ItemCategory.SmallKey, + ItemCategory.BigKey, ItemCategory.Keycard, + ItemCategory.PossibleProgression, + ItemCategory.ProgressionOnLimitedAmount)).ToList(); if (!locationsToCheck.Any()) { @@ -183,8 +184,9 @@ public LocationUsefulness GetUsefulness(List locations, List al var importantLocations = GetImportantLocations(allWorlds); locations = locations.Where(l => s_importantLocations.Contains(l.Id) || l.Item.Progression || - l.Item.Type.IsInAnyCategory(ItemCategory.SmallKey, ItemCategory.BigKey, ItemCategory.Keycard) || - l.Item.Type is ItemType.Super or ItemType.PowerBomb or ItemType.ProgressiveSword or ItemType.SilverArrows).ToList(); + l.Item.Type.IsInAnyCategory(ItemCategory.SmallKey, ItemCategory.BigKey, + ItemCategory.Keycard, ItemCategory.PossibleProgression, + ItemCategory.ProgressionOnLimitedAmount)).ToList(); if (!locations.Any()) { @@ -200,13 +202,13 @@ public LocationUsefulness GetUsefulness(List locations, List al /// private IEnumerable GetProgressionItemHints(World hintPlayerWorld, IEnumerable spheres, int count) { - // Grab items for the player marked as progression that are not junk or scam items + // Grab items for the player marked as progression that are not junk var progressionLocations = spheres .SelectMany(x => x.Locations) - .Where(x => x.Item.World == hintPlayerWorld && x.Item.Progression && - !x.Item.Type.IsInAnyCategory(ItemCategory.Junk, ItemCategory.Scam)).ToList(); + .Where(x => x.Item.World == hintPlayerWorld && x.Item.Type.IsInCategory(ItemCategory.PossibleProgression) && + !x.Item.Type.IsInCategory(ItemCategory.Scam)).ToList(); progressionLocations = - progressionLocations.TakeLast(progressionLocations.Count() / 2).Shuffle(_random).Take(count).ToList(); + progressionLocations.TakeLast(progressionLocations.Count() / 3).Shuffle(_random).Take(count).ToList(); return progressionLocations.Select(x => new Hint(() => GetProgressionItemHint(x))); @@ -660,21 +662,22 @@ private IEnumerable GetImportantLocations(List allWorlds) // Get the first accessible ammo locations to make sure early ammo isn't considered mandatory when there // are others available var spheres = _playthroughService.GenerateSpheres(allWorlds.SelectMany(x => x.Locations)); - var ammoItemTypes = new List() - { - ItemType.Missile, - ItemType.Super, - ItemType.PowerBomb, - ItemType.ETank, - ItemType.ReserveTank, + var ammoItemTypes = new Dictionary() + { + { ItemType.Missile, 1 }, + { ItemType.Super, 1 }, + { ItemType.PowerBomb, 2 }, + { ItemType.ETank, 3 }, + { ItemType.ReserveTank, 3}, + { ItemType.HeartContainer, 3 } }; var ammoLocations = new List(); foreach (var sphere in spheres) { - foreach (var location in sphere.Locations.Where(x => ammoItemTypes.Contains(x.Item.Type))) + foreach (var location in sphere.Locations.Where(x => ammoItemTypes.ContainsKey(x.Item.Type))) { if (ammoLocations.Count(x => - x.Item.World.Id == location.Item.World.Id && x.Item.Type == location.Item.Type) < 3) + x.Item.World.Id == location.Item.World.Id && x.Item.Type == location.Item.Type) < ammoItemTypes[location.Item.Type]) { ammoLocations.Add(location); } @@ -684,7 +687,7 @@ private IEnumerable GetImportantLocations(List allWorlds) return allWorlds.SelectMany(w => w.Locations) .Where(l => s_importantLocations.Contains(l.Id) || l.Item.Progression || l.Item.Type.IsInAnyCategory(ItemCategory.SmallKey, ItemCategory.BigKey, - ItemCategory.Keycard) || l.Item.Type is ItemType.Super or ItemType.PowerBomb or ItemType.ProgressiveSword or ItemType.SilverArrows) + ItemCategory.Keycard, ItemCategory.PossibleProgression)) .Concat(ammoLocations) .Distinct(); } diff --git a/src/TrackerCouncil.Smz3.Shared/Enums/ItemCategory.cs b/src/TrackerCouncil.Smz3.Shared/Enums/ItemCategory.cs index 1775833a..9e2894a6 100644 --- a/src/TrackerCouncil.Smz3.Shared/Enums/ItemCategory.cs +++ b/src/TrackerCouncil.Smz3.Shared/Enums/ItemCategory.cs @@ -103,9 +103,20 @@ public enum ItemCategory /// IgnoreOnMultiplayerCompletion, + /// + /// An item that is never considered progression, such as maps, compasses, or arrows + /// NeverProgression, - ProgressionOnlyOnFirst, + /// + /// An item that can be the progression if it's one of the first ones picked up + /// + ProgressionOnLimitedAmount, + + /// + /// An item that is at least sometimes required to complete the game + /// + PossibleProgression, /// /// If this is a Metroid map in an archipelago game diff --git a/src/TrackerCouncil.Smz3.Shared/Enums/ItemType.cs b/src/TrackerCouncil.Smz3.Shared/Enums/ItemType.cs index bee8edb1..9e533fe8 100644 --- a/src/TrackerCouncil.Smz3.Shared/Enums/ItemType.cs +++ b/src/TrackerCouncil.Smz3.Shared/Enums/ItemType.cs @@ -212,19 +212,19 @@ public enum ItemType : byte ProgressiveTunic = 0x60, [Description("Progressive Shield")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.PossibleProgression)] ProgressiveShield = 0x5F, [Description("Progressive Sword")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] ProgressiveSword = 0x5E, [Description("Bow")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Bow = 0x0B, [Description("Silver Arrows")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Nice)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Nice, ItemCategory.PossibleProgression)] SilverArrows = 0x58, [Description("Blue Boomerang")] @@ -236,51 +236,51 @@ public enum ItemType : byte RedBoomerang = 0x2A, [Description("Hookshot")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Hookshot = 0x0A, [Description("Mushroom")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.PossibleProgression)] Mushroom = 0x29, [Description("Magic Powder")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.PossibleProgression)] Powder = 0x0D, [Description("Fire Rod")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Firerod = 0x07, [Description("Ice Rod")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Icerod = 0x08, [Description("Bombos")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Medallion)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Medallion, ItemCategory.PossibleProgression)] Bombos = 0x0f, [Description("Ether")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Medallion)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Medallion, ItemCategory.PossibleProgression)] Ether = 0x10, [Description("Quake")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Medallion)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Medallion, ItemCategory.PossibleProgression)] Quake = 0x11, [Description("Lamp")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Lamp = 0x12, [Description("Hammer")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Hammer = 0x09, [Description("Shovel")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Shovel = 0x13, [Description("Flute")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Flute = 0x14, [Description("Bug Catching Net")] @@ -288,47 +288,47 @@ public enum ItemType : byte Bugnet = 0x21, [Description("Book of Mudora")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Book = 0x1D, [Description("Bottle")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] Bottle = 0x16, [Description("Cane of Somaria")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Somaria = 0x15, [Description("Cane of Byrna")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Byrna = 0x18, [Description("Magic Cape")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Cape = 0x19, [Description("Magic Mirror")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Mirror = 0x1A, [Description("Pegasus Boots")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Boots = 0x4B, [Description("Progressive Glove")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] ProgressiveGlove = 0x61, [Description("Zora's Flippers")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] Flippers = 0x1E, [Description("Moon Pearl")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] MoonPearl = 0x1F, [Description("Half Magic")] - [ItemCategory(ItemCategory.Zelda)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.PossibleProgression)] HalfMagic = 0x4E, [Description("Piece of Heart")] @@ -336,11 +336,11 @@ public enum ItemType : byte HeartPiece = 0x17, [Description("Heart Container")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.ProgressionOnLimitedAmount)] HeartContainer = 0x3E, [Description("Sanctuary Heart Container")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.NeverProgression)] HeartContainerRefill = 0x3F, [Description("Three Bombs")] @@ -372,15 +372,15 @@ public enum ItemType : byte TwentyRupees2 = 0x47, [Description("Fifty Rupees")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.IgnoreOnMultiplayerCompletion)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.IgnoreOnMultiplayerCompletion, ItemCategory.NeverProgression)] FiftyRupees = 0x41, [Description("One Hundred Rupees")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.NeverProgression)] OneHundredRupees = 0x40, [Description("Three Hundred Rupees")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.PossibleProgression)] ThreeHundredRupees = 0x46, [Description("+5 Bomb Capacity")] @@ -464,19 +464,19 @@ public enum ItemType : byte CardLowerNorfairBoss = 0xDF, [Description("Missile")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.Plentiful, ItemCategory.ProgressionOnlyOnFirst)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.Plentiful, ItemCategory.ProgressionOnLimitedAmount)] Missile = 0xC2, [Description("Super Missile")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.Plentiful, ItemCategory.ProgressionOnlyOnFirst)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.Plentiful, ItemCategory.ProgressionOnLimitedAmount)] Super = 0xC3, [Description("Power Bomb")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.ProgressionOnLimitedAmount)] PowerBomb = 0xC4, [Description("Grappling Beam")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Grapple = 0xB0, [Description("X-Ray Scope")] @@ -484,23 +484,23 @@ public enum ItemType : byte XRay = 0xB1, [Description("Energy Tank")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.ProgressionOnLimitedAmount)] ETank = 0xC0, [Description("Reserve Tank")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.Scam, ItemCategory.Junk, ItemCategory.ProgressionOnLimitedAmount)] ReserveTank = 0xC1, [Description("Charge Beam")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Charge = 0xBB, [Description("Ice Beam")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Ice = 0xBC, [Description("Wave Beam")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Wave = 0xBD, [Description("Spazer")] @@ -508,67 +508,67 @@ public enum ItemType : byte Spazer = 0xBE, [Description("Plasma Beam")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Plasma = 0xBF, [Description("Varia Suit")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Varia = 0xB2, [Description("Gravity Suit")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Gravity = 0xB6, [Description("Morphing Ball")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Morph = 0xB4, [Description("Morph Bombs")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] Bombs = 0xB9, [Description("Spring Ball")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] SpringBall = 0xB3, [Description("Screw Attack")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] ScrewAttack = 0xB5, [Description("Hi-Jump Boots")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] HiJump = 0xB7, [Description("Space Jump")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] SpaceJump = 0xB8, [Description("Speed Booster")] - [ItemCategory(ItemCategory.Metroid)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.PossibleProgression)] SpeedBooster = 0xBA, [Description("Bottle with Red Potion")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] BottleWithRedPotion = 0x2B, [Description("Bottle with Green Potion")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] BottleWithGreenPotion = 0x2C, [Description("Bottle with Blue Potion")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] BottleWithBluePotion = 0x2D, [Description("Bottle with Fairy")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] BottleWithFairy = 0x3D, [Description("Bottle with Bee")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] BottleWithBee = 0x3C, [Description("Bottle with Gold Bee")] - [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle)] + [ItemCategory(ItemCategory.Zelda, ItemCategory.Scam, ItemCategory.Bottle, ItemCategory.PossibleProgression)] BottleWithGoldBee = 0x48, [Description("Red Potion Refill")] @@ -600,26 +600,26 @@ public enum ItemType : byte CardBoss = 0xF2, [Description("Brinstar Map")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap, ItemCategory.NeverProgression)] SmMapBrinstar = 0xCA, [Description("Wrecked Ship Map")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap, ItemCategory.NeverProgression)] SmMapWreckedShip = 0xCB, [Description("Maridia Map")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap, ItemCategory.NeverProgression)] SmMapMaridia = 0xCC, [Description("Lower Norfair Map")] - [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap)] + [ItemCategory(ItemCategory.Metroid, ItemCategory.MetroidMap, ItemCategory.NeverProgression)] SmMapLowerNorfair = 0xCD, [Description("Other Game Item")] - [ItemCategory(ItemCategory.NonRandomized)] + [ItemCategory(ItemCategory.NonRandomized, ItemCategory.NeverProgression)] OtherGameItem = 0xFE, [Description("Important Other Game Item")] - [ItemCategory(ItemCategory.NonRandomized)] + [ItemCategory(ItemCategory.NonRandomized, ItemCategory.PossibleProgression)] OtherGameProgressionItem = 0xFF } diff --git a/src/TrackerCouncil.Smz3.Shared/Enums/ItemTypeExtensions.cs b/src/TrackerCouncil.Smz3.Shared/Enums/ItemTypeExtensions.cs index 53ef4dcb..e9e65cd3 100644 --- a/src/TrackerCouncil.Smz3.Shared/Enums/ItemTypeExtensions.cs +++ b/src/TrackerCouncil.Smz3.Shared/Enums/ItemTypeExtensions.cs @@ -75,13 +75,7 @@ public static bool IsPossibleProgression(this ItemType itemType, bool isZeldaKey if (itemType.IsInCategory(ItemCategory.Keycard)) return isMetroidKeysanity || !isLocalPlayerItem; - if (itemType == ItemType.OtherGameProgressionItem) - return true; - - if (itemType == ItemType.Nothing || itemType.IsInAnyCategory(ItemCategory.Junk, ItemCategory.Scam, ItemCategory.NonRandomized, ItemCategory.Map, ItemCategory.Compass, ItemCategory.Nice)) - return false; - - return true; + return itemType.IsInAnyCategory(ItemCategory.PossibleProgression); } /// diff --git a/src/TrackerCouncil.Smz3.Tracking/NaturalLanguage.cs b/src/TrackerCouncil.Smz3.Tracking/NaturalLanguage.cs index 4e10b29b..2efbc5a7 100644 --- a/src/TrackerCouncil.Smz3.Tracking/NaturalLanguage.cs +++ b/src/TrackerCouncil.Smz3.Tracking/NaturalLanguage.cs @@ -98,8 +98,8 @@ public static string Join(IEnumerable items, Config config) return (item, count); }).ToList(); - var interestingItems = groupedItems.Where(x => x.item.Metadata.IsProgression(config, x.item.IsLocalPlayerItem)).ToList(); - var junkItems = groupedItems.Where(x => !x.item.Metadata.IsProgression(config, x.item.IsLocalPlayerItem)).OrderBy(x => x.item.IsDungeonItem).ToList(); + var interestingItems = groupedItems.Where(x => x.item.Metadata.IsPossibleProgression(config, x.item.IsLocalPlayerItem)).ToList(); + var junkItems = groupedItems.Where(x => !x.item.Metadata.IsPossibleProgression(config, x.item.IsLocalPlayerItem)).OrderBy(x => x.item.IsDungeonItem).ToList(); if (junkItems.Count == 0) { diff --git a/src/TrackerCouncil.Smz3.Tracking/Tracker.cs b/src/TrackerCouncil.Smz3.Tracking/Tracker.cs index a955d81e..2d454a14 100644 --- a/src/TrackerCouncil.Smz3.Tracking/Tracker.cs +++ b/src/TrackerCouncil.Smz3.Tracking/Tracker.cs @@ -633,7 +633,7 @@ public override void UpdateAllAccessibility(bool forceRefreshAll, params Item[] // Skip if the items don't affect anything if (items.Length > 0 && !forceRefreshAll && items.All(x => x.Type.IsInCategory(ItemCategory.NeverProgression) || - (x.TrackingState > 1 && x.Type.IsInCategory(ItemCategory.ProgressionOnlyOnFirst)))) + (x.TrackingState > 1 && x.Type.IsInCategory(ItemCategory.ProgressionOnLimitedAmount)))) { return; } diff --git a/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerItemService.cs b/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerItemService.cs index eb89eed9..f129f593 100644 --- a/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerItemService.cs +++ b/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerItemService.cs @@ -239,7 +239,7 @@ public bool TrackItem(Item item, string? trackedAs = null, float? confidence = n var addedEvent = History.AddEvent( HistoryEventType.TrackedItem, - item.Metadata.IsProgression(World.Config, item.IsLocalPlayerItem), + item.Metadata.IsPossibleProgression(World.Config, item.IsLocalPlayerItem), item.Metadata.NameWithArticle, location ); diff --git a/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerLocationService.cs b/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerLocationService.cs index daa7bef3..2018d80e 100644 --- a/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerLocationService.cs +++ b/src/TrackerCouncil.Smz3.Tracking/TrackingServices/TrackerLocationService.cs @@ -453,7 +453,7 @@ private void GiveLocationComment(ItemType item, Location location, bool isTracki } // Give some sass if the user tracks or marks the wrong item at a // location unless the user is clearing a useless item like missiles - else if (location.Item.Type != ItemType.Nothing && !item.IsEquivalentTo(location.Item.Type) && (item != ItemType.Nothing || location.Item.Metadata.IsProgression(World.Config, location.Item.IsLocalPlayerItem))) + else if (location.Item.Type != ItemType.Nothing && !item.IsEquivalentTo(location.Item.Type) && (item != ItemType.Nothing || location.Item.Metadata.IsPossibleProgression(World.Config, location.Item.IsLocalPlayerItem))) { if (confidence == null || confidence < Options.MinimumSassConfidence) return;