From a631a81a75ccf0ce24548175275836d1349068f1 Mon Sep 17 00:00:00 2001 From: Igor Cesar Date: Tue, 29 Oct 2024 18:11:08 +0000 Subject: [PATCH] feat: add support for patch 31.0.0 * fix: card ids * feat: implement Demon Hunter cards * feat: implement Librams counter * chore: drop unnecessary known card ids * feat: implement Talgath * feat: implement some active effects * feat: add Askara active effect * feat: add Ingenious Artificer active effect * feat: add Draenei Warrior active effects * feat: add known card mark to Astral vigiant * refactor: related cards system to use entities * feat: add Archimonde related cards * feat: add Foreboding Flame active effect * feat: add Infernal Stratagem active effect * feat: add Space Pirate active effect * feat: implement asteroid damage counter (Bolide Behemoth) * fix: velen related cards showing itself * fix: leak showing moldara spores on opponent hands * feat: prevent created cards from demon portal deck to show * feat: add kiljaeden counter * feat: add static related cards for GDB * fix: wrong cardId --------- Co-authored-by: Benedict Etzel Co-authored-by: mateuscechetto --- Hearthstone Deck Tracker/GameEventHandler.cs | 4 +- Hearthstone Deck Tracker/Hearthstone/Card.cs | 2 + .../Hearthstone/CardIds.cs | 4 +- .../Counters/AsteroidDamageCounter.cs | 44 ++++++++++++++++ .../Counters/KiljaedenCounter.cs | 42 +++++++++++++++ .../Counters/LibramCostReductionCounter.cs | 12 +++-- .../Hearthstone/DungeonRun.cs | 30 +++++------ .../Mage/IngeniousArtificerEnchantment.cs | 16 ++++++ .../Neutral/AceWayfinderEnchantment.cs | 17 +++++++ .../Neutral/AstrobiologistEnchantment.cs | 17 +++++++ .../Effects/Neutral/SpacePirateEnchantment.cs | 17 +++++++ .../Neutral/StarlightWandererEnchantment.cs | 17 +++++++ .../Neutral/StrandedSpacemanEnchantment.cs | 17 +++++++ .../Effects/Priest/AskaraEnchantment.cs | 16 ++++++ .../Effects/Rogue/LuckyCometEnchantmnet.cs | 16 ++++++ .../Rogue/SpacerockCollectorEnchantment.cs | 16 ++++++ .../Rogue/ValeeraTheHollowEnchantment.cs | 2 +- .../Shaman/SpacerockCollectorEnchantment.cs | 16 ++++++ .../Warlock/ForebodingFlameEnchantment.cs | 18 +++++++ .../Warlock/InfernalStratagemEnchantment.cs | 18 +++++++ .../Warrior/ExpeditionSergeantEnchantment.cs | 17 +++++++ .../UnyieldingVindicatorEnchantment.cs | 17 +++++++ .../Hearthstone/Player.cs | 51 ++++++++++--------- .../Cards/DeathKnight/WakenerOfSouls.cs | 21 ++++++++ .../Cards/DemonHunter/CrewmateGenerator.cs | 20 ++++++++ .../Cards/DemonHunter/DirdraRebelCaptain.cs | 8 +++ .../Cards/DemonHunter/EmergencyMeeting.cs | 8 +++ .../Cards/DemonHunter/Headhunt.cs | 8 +++ .../Cards/DemonHunter/ReturnPolicy.cs | 2 +- .../Cards/DemonHunter/VoroneiRecruiter.cs | 8 +++ .../Cards/Druid/HydrationStation.cs | 4 +- .../Cards/Hunter/PetParrot.cs | 2 +- .../Cards/Hunter/Product9.cs | 4 +- .../Cards/Hunter/Sasquawk.cs | 2 +- .../Cards/Hunter/StranglethornHeart.cs | 4 +- .../RelatedCardsSystem/Cards/Mage/Rewind.cs | 4 +- .../Cards/Mage/TheGalacticProjectionOrb.cs | 4 +- .../Cards/Neutral/VelenLeaderOfTheExiled.cs | 22 ++++++++ .../Cards/Paladin/LadyLiadrin.cs | 2 +- .../Cards/Paladin/LadyLiadrinCore.cs | 2 +- .../RelatedCardsSystem/Cards/Paladin/Tyr.cs | 4 +- .../Cards/Paladin/TyrsTears.cs | 4 +- .../Cards/Paladin/TyrsTearsForged.cs | 4 +- .../Cards/Paladin/YrelBeaconOfHope.cs | 19 +++++++ .../Cards/Rogue/ScroungingShipwright.cs | 29 +++++++++++ .../Cards/Rogue/StarshipSchematic.cs | 29 +++++++++++ .../Cards/Rogue/TessGreymane.cs | 2 +- .../Cards/Rogue/TessGreymaneCore.cs | 2 +- .../Cards/Shaman/Shudderwock.cs | 2 +- .../Cards/Warlock/Archimonde.cs | 24 +++++++++ .../Cards/Warrior/InventorBoom.cs | 4 +- .../LogReader/Handlers/PowerHandler.cs | 43 ++++++++++++---- 52 files changed, 635 insertions(+), 82 deletions(-) create mode 100644 Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/AsteroidDamageCounter.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/KiljaedenCounter.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Mage/IngeniousArtificerEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AceWayfinderEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AstrobiologistEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/SpacePirateEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StarlightWandererEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StrandedSpacemanEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Priest/AskaraEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/LuckyCometEnchantmnet.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/SpacerockCollectorEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Shaman/SpacerockCollectorEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/ForebodingFlameEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/InfernalStratagemEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/ExpeditionSergeantEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/UnyieldingVindicatorEnchantment.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DeathKnight/WakenerOfSouls.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/CrewmateGenerator.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/DirdraRebelCaptain.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/EmergencyMeeting.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/Headhunt.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/VoroneiRecruiter.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Neutral/VelenLeaderOfTheExiled.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/YrelBeaconOfHope.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/ScroungingShipwright.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/StarshipSchematic.cs create mode 100644 Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warlock/Archimonde.cs diff --git a/Hearthstone Deck Tracker/GameEventHandler.cs b/Hearthstone Deck Tracker/GameEventHandler.cs index 548d9cb3c..7ca53dba0 100644 --- a/Hearthstone Deck Tracker/GameEventHandler.cs +++ b/Hearthstone Deck Tracker/GameEventHandler.cs @@ -1874,7 +1874,7 @@ public void HandlePlayerPlayToGraveyard(Entity entity, string cardId, int turn, _game.ActiveEffects.TryRemoveEffect(entity, true); } - _game.Player.PlayToGraveyard(entity, cardId, turn); + _game.Player.PlayToGraveyard(entity, turn); var card = Database.GetCardFromId(entity.Info.LatestCardId); if(card != null) GameEvents.OnPlayerPlayToGraveyard.Execute(card); @@ -1891,7 +1891,7 @@ public async void HandleOpponentPlayToGraveyard(Entity entity, string? cardId, i } if(cardId != null) - _game.Opponent.PlayToGraveyard(entity, cardId, turn); + _game.Opponent.PlayToGraveyard(entity, turn); var card = Database.GetCardFromId(entity.Info.LatestCardId); if(card != null) GameEvents.OnOpponentPlayToGraveyard.Execute(card); diff --git a/Hearthstone Deck Tracker/Hearthstone/Card.cs b/Hearthstone Deck Tracker/Hearthstone/Card.cs index 51254b4b1..9054eeb55 100644 --- a/Hearthstone Deck Tracker/Hearthstone/Card.cs +++ b/Hearthstone Deck Tracker/Hearthstone/Card.cs @@ -321,6 +321,8 @@ public bool HasRace(Race race) public bool IsNaga() => HasRace(HearthDb.Enums.Race.NAGA); + public bool isDraenei() => HasRace(HearthDb.Enums.Race.DRAENEI); + public bool IsEmptyRace() => RaceEnum == HearthDb.Enums.Race.INVALID && SecondaryRaceEnum == HearthDb.Enums.Race.INVALID; [XmlIgnore] diff --git a/Hearthstone Deck Tracker/Hearthstone/CardIds.cs b/Hearthstone Deck Tracker/Hearthstone/CardIds.cs index b31108263..8ae75b33d 100644 --- a/Hearthstone Deck Tracker/Hearthstone/CardIds.cs +++ b/Hearthstone Deck Tracker/Hearthstone/CardIds.cs @@ -181,7 +181,7 @@ public class Hunter : EnumerateMultiId public static readonly MultiIdCard RatTrap = new MultiIdCard(Collectible.Hunter.RatTrap, Collectible.Hunter.RatTrapCore); public static readonly MultiIdCard SnakeTrap = new MultiIdCard(Collectible.Hunter.SnakeTrap, Collectible.Hunter.SnakeTrapCorePlaceholder, Collectible.Hunter.SnakeTrapVanilla); public static readonly MultiIdCard Snipe = new MultiIdCard(Collectible.Hunter.SnipeExpert1, Collectible.Hunter.SnipeVanilla, Collectible.Hunter.SnipeWONDERS); - public static readonly MultiIdCard VenomstrikeTrap = new MultiIdCard(Collectible.Hunter.VenomstrikeTrapICECROWN, Collectible.Hunter.VenomstrikeTrapInvalid); + public static readonly MultiIdCard VenomstrikeTrap = new MultiIdCard(Collectible.Hunter.VenomstrikeTrap, Collectible.Hunter.VenomstrikeTrapCorePlaceholder); public static readonly MultiIdCard WanderingMonster = new MultiIdCard(Collectible.Hunter.WanderingMonster, Collectible.Hunter.WanderingMonsterCorePlaceholder); public static readonly MultiIdCard Zombeeees = new MultiIdCard(Collectible.Hunter.Zombeeees); } @@ -194,7 +194,7 @@ public class Mage : EnumerateMultiId public static readonly MultiIdCard Effigy = new MultiIdCard(Collectible.Mage.Effigy); public static readonly MultiIdCard ExplosiveRunes = new MultiIdCard(Collectible.Mage.ExplosiveRunes, Collectible.Mage.ExplosiveRunesCore); public static readonly MultiIdCard FlameWard = new MultiIdCard(Collectible.Mage.FlameWard); - public static readonly MultiIdCard FrozenClone = new MultiIdCard(Collectible.Mage.FrozenCloneICECROWN, Collectible.Mage.FrozenCloneInvalid); + public static readonly MultiIdCard FrozenClone = new MultiIdCard(Collectible.Mage.FrozenClone, Collectible.Mage.FrozenCloneCorePlaceholder); public static readonly MultiIdCard IceBarrier = new MultiIdCard(Collectible.Mage.IceBarrier, Collectible.Mage.IceBarrierCore, Collectible.Mage.IceBarrierVanilla); public static readonly MultiIdCard IceBlock = new MultiIdCard(Collectible.Mage.IceBlock, Collectible.Mage.IceBlockVanilla); public static readonly MultiIdCard ManaBind = new MultiIdCard(Collectible.Mage.ManaBind); diff --git a/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/AsteroidDamageCounter.cs b/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/AsteroidDamageCounter.cs new file mode 100644 index 000000000..eba67ed8e --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/AsteroidDamageCounter.cs @@ -0,0 +1,44 @@ +using HearthDb.Enums; +using Hearthstone_Deck_Tracker.LogReader.Interfaces; +using Hearthstone_Deck_Tracker.Utility; +using Entity = Hearthstone_Deck_Tracker.Hearthstone.Entities.Entity; + +namespace Hearthstone_Deck_Tracker.Hearthstone.CounterSystem.Counters; + +public class AsteroidExtraDamageCounter : NumericCounter +{ + public override string LocalizedName => LocUtil.Get("Counter_AsteroidDamage", useCardLanguage: true); + protected override string? CardIdToShowInUI => HearthDb.CardIds.NonCollectible.Neutral.Asteroid; + public override string[] RelatedCards => new string[] {}; + + public AsteroidExtraDamageCounter(bool controlledByPlayer, GameV2 game) : base(controlledByPlayer, game) + { + } + + public override bool ShouldShow() => !Game.IsBattlegroundsMatch && Counter > 0; + + public override string[] GetCardsToDisplay() + { + return new [] + { + HearthDb.CardIds.NonCollectible.Neutral.Asteroid + }; + } + + public override bool IsDisplayValueLong => true; + + public override string ValueToShow() { + return string.Format(LocUtil.Get("Counter_AsteroidDamage_Damage", useCardLanguage: true), 2 + Counter); + } + + public override void HandleTagChange(GameTag tag, IHsGameState gameState, Entity entity, int value, int prevValue) + { + if(entity.IsControlledBy(Game.Player.Id) == IsPlayerCounter) + { + if((int)tag == 3559) + { + Counter = value; + } + } + } +} diff --git a/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/KiljaedenCounter.cs b/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/KiljaedenCounter.cs new file mode 100644 index 000000000..33cd3518f --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/KiljaedenCounter.cs @@ -0,0 +1,42 @@ +using System; +using HearthDb.Enums; +using Hearthstone_Deck_Tracker.LogReader.Interfaces; +using Entity = Hearthstone_Deck_Tracker.Hearthstone.Entities.Entity; + +namespace Hearthstone_Deck_Tracker.Hearthstone.CounterSystem.Counters; + +public class KiljaedenCounter : StatsCounter +{ + protected override string? CardIdToShowInUI => HearthDb.CardIds.Collectible.Neutral.Kiljaeden; + public override string[] RelatedCards => new string[] {}; + + public KiljaedenCounter(bool controlledByPlayer, GameV2 game) : base(controlledByPlayer, game) + { + } + + public override bool ShouldShow() => Game.IsTraditionalHearthstoneMatch && (AttackCounter > 0 || HealthCounter > 0); + + public override string[] GetCardsToDisplay() + { + return new [] + { + HearthDb.CardIds.Collectible.Neutral.Kiljaeden + }; + } + + public override string ValueToShow() => $"+{Math.Max(0, AttackCounter)} / +{Math.Max(0, HealthCounter)}"; + public override void HandleTagChange(GameTag tag, IHsGameState gameState, Entity entity, int value, int prevValue) + { + if(!Game.IsTraditionalHearthstoneMatch) + return; + + if(entity.Card.Id != HearthDb.CardIds.NonCollectible.Neutral.Kiljaeden_KiljaedensPortalEnchantment) + return; + + if(entity.IsControlledBy(Game.Player.Id) != IsPlayerCounter) + return; + + AttackCounter = entity.GetTag(GameTag.TAG_SCRIPT_DATA_NUM_2); + HealthCounter = entity.GetTag(GameTag.TAG_SCRIPT_DATA_NUM_2); + } +} diff --git a/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/LibramCostReductionCounter.cs b/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/LibramCostReductionCounter.cs index 9220fd8fc..5287267cd 100644 --- a/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/LibramCostReductionCounter.cs +++ b/Hearthstone Deck Tracker/Hearthstone/CounterSystem/Counters/LibramCostReductionCounter.cs @@ -13,8 +13,13 @@ public class LibramCostReductionCounter : NumericCounter public override string[] RelatedCards => new string[] { - HearthDb.CardIds.Collectible.Paladin.AldorAttendant, - HearthDb.CardIds.Collectible.Paladin.AldorTruthseeker + HearthDb.CardIds.Collectible.Paladin.LibramOfWisdom, + HearthDb.CardIds.Collectible.Paladin.LibramOfClarity, + HearthDb.CardIds.Collectible.Paladin.LibramOfDivinity, + HearthDb.CardIds.Collectible.Paladin.LibramOfJustice, + HearthDb.CardIds.Collectible.Paladin.LibramOfFaith, + HearthDb.CardIds.Collectible.Paladin.LibramOfJudgment, + HearthDb.CardIds.Collectible.Paladin.LibramOfHope, }; public LibramCostReductionCounter(bool controlledByPlayer, GameV2 game) : base(controlledByPlayer, game) @@ -41,7 +46,8 @@ public override string[] GetCardsToDisplay() private static readonly Dictionary EnchantLibramDict = new Dictionary { {HearthDb.CardIds.NonCollectible.Neutral.AldorAttendant_AldorAttendantEnchantment, 1}, - {HearthDb.CardIds.NonCollectible.Neutral.AldorTruthseeker_AldorTruthseekerEnchantment, 2} + {HearthDb.CardIds.NonCollectible.Neutral.AldorTruthseeker_AldorTruthseekerEnchantment, 2}, + {HearthDb.CardIds.NonCollectible.Paladin.InterstellarStarslicer_InterstellarLibramEnchantmentEnchantment, 1}, }; public override void HandleTagChange(GameTag tag, IHsGameState gameState, Entity entity, int value, int prevValue) diff --git a/Hearthstone Deck Tracker/Hearthstone/DungeonRun.cs b/Hearthstone Deck Tracker/Hearthstone/DungeonRun.cs index 300231085..d52ebff86 100644 --- a/Hearthstone Deck Tracker/Hearthstone/DungeonRun.cs +++ b/Hearthstone Deck Tracker/Hearthstone/DungeonRun.cs @@ -408,7 +408,7 @@ private static class TrlDefaultDecks Collectible.Warrior.Armorsmith, Collectible.Warrior.DrywhiskerArmorer, Collectible.Warrior.FieryWarAxeLegacy, - Collectible.Warrior.MountainfireArmorICECROWN, + Collectible.Warrior.MountainfireArmor, Collectible.Warrior.EmberscaleDrake, Collectible.Neutral.Waterboy, Collectible.Neutral.HiredGun, @@ -427,7 +427,7 @@ private static class TrlDefaultDecks Collectible.Neutral.EbonDragonsmith, Collectible.Neutral.TwilightGuardian, Collectible.Warrior.EmberscaleDrake, - Collectible.Neutral.BoneDrakeICECROWN, + Collectible.Neutral.BoneDrake, }, new List { @@ -440,7 +440,7 @@ private static class TrlDefaultDecks Collectible.Warrior.CruelTaskmaster, Collectible.Warrior.BloodhoofBrave, Collectible.Neutral.AmaniBerserker, - Collectible.Neutral.DeathspeakerICECROWN, + Collectible.Neutral.Deathspeaker, Collectible.Neutral.RagingWorgen, }, }; @@ -457,7 +457,7 @@ private static class TrlDefaultDecks Collectible.Shaman.JinyuWaterspeaker, Collectible.Shaman.FireguardDestroyer, Collectible.Neutral.MurlocRaiderLegacy, - Collectible.Neutral.DeadscaleKnightICECROWN, + Collectible.Neutral.DeadscaleKnight, Collectible.Neutral.HugeToad, Collectible.Neutral.TarCreeper, }, @@ -473,7 +473,7 @@ private static class TrlDefaultDecks Collectible.Neutral.FireFly, Collectible.Neutral.BilefinTidehunter, Collectible.Neutral.BelligerentGnome, - Collectible.Neutral.SaroniteChainGangICECROWN, + Collectible.Neutral.SaroniteChainGang, }, new List { @@ -515,10 +515,10 @@ private static class TrlDefaultDecks Collectible.Paladin.SealOfLight, Collectible.Paladin.BenevolentDjinn, Collectible.Paladin.TruesilverChampionLegacy, - Collectible.Paladin.ChillbladeChampionICECROWN, + Collectible.Paladin.ChillbladeChampion, Collectible.Neutral.Crystallizer, Collectible.Neutral.MadBomber, - Collectible.Neutral.HappyGhoulICECROWN, + Collectible.Neutral.HappyGhoul, Collectible.Neutral.MadderBomber }, new List @@ -621,7 +621,7 @@ private static class TrlDefaultDecks Collectible.Druid.EnchantedRaven, Collectible.Druid.PowerOfTheWild, Collectible.Druid.SavageStriker, - Collectible.Druid.GnashICECROWN, + Collectible.Druid.Gnash, Collectible.Druid.Bite, Collectible.Druid.SavageCombatant, Collectible.Neutral.Waterboy, @@ -685,7 +685,7 @@ private static class TrlDefaultDecks Collectible.Mage.ShimmeringTempest, Collectible.Mage.ExplosiveRunes, Collectible.Mage.SpellslingerTGT, - Collectible.Mage.GhastlyConjurerICECROWN, + Collectible.Mage.GhastlyConjurer, Collectible.Mage.BlastWave, Collectible.Neutral.TournamentAttendee, Collectible.Neutral.Brainstormer, @@ -699,7 +699,7 @@ private static class TrlDefaultDecks Collectible.Mage.Cinderstorm, Collectible.Mage.DalaranAspirantTGT, Collectible.Mage.FireballLegacy, - Collectible.Neutral.AcherusVeteranICECROWN, + Collectible.Neutral.AcherusVeteran, Collectible.Neutral.FlameJuggler, Collectible.Neutral.BlackwaldPixie, Collectible.Neutral.DragonhawkRider, @@ -713,7 +713,7 @@ private static class TrlDefaultDecks Collectible.Mage.FrostboltLegacy, Collectible.Mage.Snowchugger, Collectible.Neutral.VolatileElemental, - Collectible.Neutral.HyldnirFrostriderICECROWN, + Collectible.Neutral.HyldnirFrostrider, Collectible.Mage.ConeOfCold, Collectible.Neutral.IceCreamPeddler, Collectible.Mage.WaterElementalLegacy, @@ -727,22 +727,22 @@ private static class TrlDefaultDecks { NonCollectible.Priest.BwonsamdisSanctum, Collectible.Priest.CrystallineOracle, - Collectible.Priest.SpiritLashICECROWN, + Collectible.Priest.SpiritLash, Collectible.Priest.MuseumCuratorLOE, Collectible.Priest.DeadRinger, Collectible.Priest.ShiftingShade, Collectible.Priest.TortollanShellraiser, Collectible.Neutral.MistressOfMixtures, Collectible.Neutral.HarvestGolem, - Collectible.Neutral.ShallowGravediggerICECROWN, - Collectible.Neutral.TombLurkerICECROWN + Collectible.Neutral.ShallowGravedigger, + Collectible.Neutral.TombLurker }, new List { NonCollectible.Priest.BwonsamdisTome, Collectible.Priest.PsionicProbe, Collectible.Priest.PowerWordShieldLegacy, - Collectible.Priest.SpiritLashICECROWN, + Collectible.Priest.SpiritLash, Collectible.Priest.SandDrudge, Collectible.Priest.GildedGargoyle, Collectible.Priest.Mindgames, diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Mage/IngeniousArtificerEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Mage/IngeniousArtificerEnchantment.cs new file mode 100644 index 000000000..b045a9a45 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Mage/IngeniousArtificerEnchantment.cs @@ -0,0 +1,16 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Mage; + +public class IngeniousArtificerEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Mage.IngeniousArtificer_IngeniousArtficerFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Mage.IngeniousArtificer; + + public IngeniousArtificerEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.ManaCrystalModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AceWayfinderEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AceWayfinderEnchantment.cs new file mode 100644 index 000000000..71f4613fc --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AceWayfinderEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Neutral; + +public class AceWayfinderEnchantment: EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Neutral.AceWayfinder_AceWayfinderFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Neutral.AceWayfinder; + + public AceWayfinderEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AstrobiologistEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AstrobiologistEnchantment.cs new file mode 100644 index 000000000..56d8106f5 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/AstrobiologistEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Neutral; + +public class AstrobiologistEnchantment: EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Neutral.Astrobiologist_AstrobiologistEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Neutral.Astrobiologist; + + public AstrobiologistEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/SpacePirateEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/SpacePirateEnchantment.cs new file mode 100644 index 000000000..9d60463dd --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/SpacePirateEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Neutral; + +public class SpacePirateEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Neutral.SpacePirate_SpacePiracyEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Neutral.SpacePirate; + + public SpacePirateEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectTarget EffectTarget => EffectTarget.Self; + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.CostModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StarlightWandererEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StarlightWandererEnchantment.cs new file mode 100644 index 000000000..cd766aa2a --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StarlightWandererEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Neutral; + +public class StarlightWandererEnchantment: EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Neutral.StarlightWanderer_StarlightWandererFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Neutral.StarlightWanderer; + + public StarlightWandererEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StrandedSpacemanEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StrandedSpacemanEnchantment.cs new file mode 100644 index 000000000..fceb59df9 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Neutral/StrandedSpacemanEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Neutral; + +public class StrandedSpacemanEnchantment: EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Neutral.StrandedSpaceman_StrandedSpacemanFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Neutral.StrandedSpaceman; + + public StrandedSpacemanEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Priest/AskaraEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Priest/AskaraEnchantment.cs new file mode 100644 index 000000000..b820e92c7 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Priest/AskaraEnchantment.cs @@ -0,0 +1,16 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Priest; + +public class AskaraEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Priest.Askara_AskaraFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Priest.Askara; + + public AskaraEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.CostModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/LuckyCometEnchantmnet.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/LuckyCometEnchantmnet.cs new file mode 100644 index 000000000..715463faf --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/LuckyCometEnchantmnet.cs @@ -0,0 +1,16 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Rogue; + +public class LuckyComentEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Rogue.LuckyComet_ComboCometEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Rogue.LuckyComet; + + public LuckyComentEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/SpacerockCollectorEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/SpacerockCollectorEnchantment.cs new file mode 100644 index 000000000..0b8ed7403 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/SpacerockCollectorEnchantment.cs @@ -0,0 +1,16 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Rogue; + +public class SpacerockCollectorEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Rogue.SpacerockCollector_RockCollectionEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Rogue.SpacerockCollector; + + public SpacerockCollectorEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.CostModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/ValeeraTheHollowEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/ValeeraTheHollowEnchantment.cs index e42730401..b0d8d7f92 100644 --- a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/ValeeraTheHollowEnchantment.cs +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Rogue/ValeeraTheHollowEnchantment.cs @@ -5,7 +5,7 @@ namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Rogue; public class ValeeraTheHollowEnchantment : EntityBasedEffect { public override string CardId => HearthDb.CardIds.NonCollectible.Rogue.ValeeratheHollow_VeilOfShadowsEnchantment; - protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Rogue.ValeeraTheHollowICECROWN; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Rogue.ValeeraTheHollow; public ValeeraTheHollowEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) { diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Shaman/SpacerockCollectorEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Shaman/SpacerockCollectorEnchantment.cs new file mode 100644 index 000000000..acd5d8943 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Shaman/SpacerockCollectorEnchantment.cs @@ -0,0 +1,16 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Shaman; + +public class PlanetaryNavigatorEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Shaman.PlanetaryNavigator_PlanetaryNavigatorFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Shaman.PlanetaryNavigator; + + public PlanetaryNavigatorEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.CostModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/ForebodingFlameEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/ForebodingFlameEnchantment.cs new file mode 100644 index 000000000..ee57347fa --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/ForebodingFlameEnchantment.cs @@ -0,0 +1,18 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Warlock; + +public class ForebodingFlameEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Warlock.ForebodingFlame_BurningLegionsBoonEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Warlock.ForebodingFlame; + + public ForebodingFlameEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectTarget EffectTarget => EffectTarget.Self; + + public override EffectDuration EffectDuration => EffectDuration.Permanent; + public override EffectTag EffectTag => EffectTag.MinionModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/InfernalStratagemEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/InfernalStratagemEnchantment.cs new file mode 100644 index 000000000..50fab7a5c --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warlock/InfernalStratagemEnchantment.cs @@ -0,0 +1,18 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Warlock; + +public class InfernalStratagemEnchantment : EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Warlock.InfernalStratagem_StrategicInfernoEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Warlock.InfernalStratagem; + + public InfernalStratagemEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectTarget EffectTarget => EffectTarget.Self; + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.CostModification; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/ExpeditionSergeantEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/ExpeditionSergeantEnchantment.cs new file mode 100644 index 000000000..7249b7c28 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/ExpeditionSergeantEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Warrior; + +public class ExpeditionSergeantEnchantment: EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Warrior.ExpeditionSergeant_ExpeditionSergeantFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Warrior.ExpeditionSergeant; + + public ExpeditionSergeantEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/UnyieldingVindicatorEnchantment.cs b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/UnyieldingVindicatorEnchantment.cs new file mode 100644 index 000000000..dd96de9d7 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/EffectSystem/Effects/Warrior/UnyieldingVindicatorEnchantment.cs @@ -0,0 +1,17 @@ +using Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Enums; + +namespace Hearthstone_Deck_Tracker.Hearthstone.EffectSystem.Effects.Warrior; + +public class UnyieldingVindicatorEnchantment: EntityBasedEffect +{ + public override string CardId => HearthDb.CardIds.NonCollectible.Neutral.UnyieldingVindicator_UnyieldingVindicatorFutureBuffEnchantment; + protected override string CardIdToShowInUI => HearthDb.CardIds.Collectible.Warrior.UnyieldingVindicator; + + public UnyieldingVindicatorEnchantment(int entityId, bool isControlledByPlayer) : base(entityId, isControlledByPlayer) + { + } + + public override EffectDuration EffectDuration => EffectDuration.Conditional; + public override EffectTag EffectTag => EffectTag.MinionModification; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/Player.cs b/Hearthstone Deck Tracker/Hearthstone/Player.cs index fd858f8fd..7002102c8 100644 --- a/Hearthstone Deck Tracker/Hearthstone/Player.cs +++ b/Hearthstone Deck Tracker/Hearthstone/Player.cs @@ -39,21 +39,21 @@ public Player(IGame game, bool isLocalPlayer) public int Id { get; set; } public int Fatigue { get; set; } public bool IsLocalPlayer { get; } - public int SpellsPlayedCount => SpellsPlayedCardIds.Count; - public List SpellsPlayedCardIds { get; private set; } = new(); - public List SpellsPlayedInFriendlyCharacters { get; private set; } = new(); - public List CardsPlayedThisMatch { get; } = new(); - public List CardsPlayedThisTurn { get; private set; } = new List(); - public List CardsPlayedLastTurn { get; private set; } = new(); + public int SpellsPlayedCount => SpellsPlayedCards.Count; + public List SpellsPlayedCards { get; private set; } = new(); + public List SpellsPlayedInFriendlyCharacters { get; private set; } = new(); + public List CardsPlayedThisMatch { get; } = new(); + public List CardsPlayedThisTurn { get; private set; } = new List(); + public List CardsPlayedLastTurn { get; private set; } = new(); public bool IsPlayingWhizbang { get; set; } public int PogoHopperPlayedCount { get; private set; } - public string? LastDiedMinionCardId => DeadMinionsCardIds.LastOrDefault(); - public List DeadMinionsCardIds { get; } = new(); + public Entity? LastDiedMinionCard => DeadMinionsCards.LastOrDefault(); + public List DeadMinionsCards { get; } = new(); public string? LastDrawnCardId { get; set; } public int LibramReductionCount { get; private set; } public HashSet PlayedSpellSchools { get; private set; } = new HashSet(); public int AbyssalCurseCount { get; private set; } - public List SecretsTriggeredCardIds { get; } = new(); + public List SecretsTriggeredCards { get; } = new(); public bool HasCoin => Hand.Any(e => e.IsTheCoin); public int HandCount => Hand.Count(); @@ -108,6 +108,11 @@ private DeckState GetDeckState() return card; }).WhereNotNull(); + if(Hero != null && Hero.Tags.TryGetValue(GameTag.DEMON_PORTAL_DECK, out var isDemonPortalInPlay) + && isDemonPortalInPlay != 0) + createdCardsInDeck = Enumerable.Empty(); + + var originalCardsInDeckIds = DeckList.Instance.ActiveDeckVersion?.Cards .Where(x => x.Count > 0) .Select(x => Enumerable.Repeat(x.Id, x.Count)) @@ -465,18 +470,18 @@ public void Reset() Id = -1; Fatigue = 0; InDeckPredictions.Clear(); - SpellsPlayedCardIds.Clear(); + SpellsPlayedCards.Clear(); PogoHopperPlayedCount = 0; CardsPlayedThisTurn.Clear(); CardsPlayedLastTurn.Clear(); CardsPlayedThisMatch.Clear(); - SecretsTriggeredCardIds.Clear(); + SecretsTriggeredCards.Clear(); LastDrawnCardId = null; LibramReductionCount = 0; PlayedSpellSchools.Clear(); AbyssalCurseCount = 0; PastHeroPowers.Clear(); - DeadMinionsCardIds.Clear(); + DeadMinionsCards.Clear(); } public void Draw(Entity entity, int turn) @@ -523,12 +528,12 @@ public void Play(Entity entity, int turn) case (int)CardType.SPELL: if(entity.CardId != null) { - SpellsPlayedCardIds.Add(entity.CardId); + SpellsPlayedCards.Add(entity); if(entity.HasTag(GameTag.CARD_TARGET) && Core.Game.Entities.TryGetValue(entity.GetTag(GameTag.CARD_TARGET), out var target) && target.IsControlledBy(Id)) { - SpellsPlayedInFriendlyCharacters.Add(entity.CardId); + SpellsPlayedInFriendlyCharacters.Add(entity); } var activeMistahVistahs = PlayerEntities.Where(e => @@ -557,8 +562,8 @@ public void Play(Entity entity, int turn) } if(entity.CardId != null) { - CardsPlayedThisTurn.Add(entity.CardId); - CardsPlayedThisMatch.Add(entity.CardId); + CardsPlayedThisTurn.Add(entity); + CardsPlayedThisMatch.Add(entity); } //Log(entity); } @@ -699,7 +704,7 @@ private void UpdateKnownEntitiesInDeck(string cardId, int turn = int.MaxValue) public void SecretTriggered(Entity entity, int turn) { if(entity.CardId != null) - SecretsTriggeredCardIds.Add(entity.CardId); + SecretsTriggeredCards.Add(entity); //Log(entity); } @@ -723,7 +728,7 @@ public void SecretPlayedFromHand(Entity entity, int turn) entity.Info.Turn = turn; if(entity.CardId != null) { - SpellsPlayedCardIds.Add(entity.CardId); + SpellsPlayedCards.Add(entity); } if(entity.Tags.TryGetValue(GameTag.SPELL_SCHOOL, out var spellSchoolTag)) PlayedSpellSchools.Add((SpellSchool)spellSchoolTag); @@ -735,7 +740,7 @@ public void QuestPlayedFromHand(Entity entity, int turn) entity.Info.Turn = turn; if(entity.CardId != null) { - SpellsPlayedCardIds.Add(entity.CardId); + SpellsPlayedCards.Add(entity); } //Log(entity); } @@ -745,7 +750,7 @@ public void SigilPlayedFromHand(Entity entity, int turn) entity.Info.Turn = turn; if(entity.CardId != null) { - SpellsPlayedCardIds.Add(entity.CardId); + SpellsPlayedCards.Add(entity); } if(entity.Tags.TryGetValue(GameTag.SPELL_SCHOOL, out var spellSchoolTag)) PlayedSpellSchools.Add((SpellSchool)spellSchoolTag); @@ -757,18 +762,18 @@ public void ObjectivePlayedFromHand(Entity entity, int turn) entity.Info.Turn = turn; if(entity.CardId != null) { - SpellsPlayedCardIds.Add(entity.CardId); + SpellsPlayedCards.Add(entity); } if(entity.Tags.TryGetValue(GameTag.SPELL_SCHOOL, out var spellSchoolTag)) PlayedSpellSchools.Add((SpellSchool)spellSchoolTag); //Log(entity); } - public void PlayToGraveyard(Entity entity, string cardId, int turn) + public void PlayToGraveyard(Entity entity, int turn) { entity.Info.Turn = turn; if(entity.IsMinion) - DeadMinionsCardIds.Add(cardId); + DeadMinionsCards.Add(entity); //Log(entity); } diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DeathKnight/WakenerOfSouls.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DeathKnight/WakenerOfSouls.cs new file mode 100644 index 000000000..79fbf0a9c --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DeathKnight/WakenerOfSouls.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using System.Linq; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.DeathKnight; + +public class WakenerOfSouls: ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Deathknight.WakenerOfSouls; + + public bool ShouldShowForOpponent(Player opponent) => false; + + public List GetRelatedCards(Player player) => + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) + .Distinct() + .Where(card => card is { Mechanics: not null } + && card.Id != HearthDb.CardIds.Collectible.Deathknight.WakenerOfSouls + && card.Mechanics.Contains("Deathrattle")) + .OrderByDescending(card => card!.Cost) + .ToList(); +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/CrewmateGenerator.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/CrewmateGenerator.cs new file mode 100644 index 000000000..103124da2 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/CrewmateGenerator.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.DemonHunter; + +public abstract class CrewmateGenerator +{ + private readonly List _crewmates = new List { + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_AdminCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_EngineCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_HelmCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_GunnerCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_MedicalCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_ReconCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_ResearchCrewmateToken), + Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Demonhunter.VoroneiRecruiter_TacticalCrewmateToken), + }; + + public List GetRelatedCards(Player player) => + _crewmates; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/DirdraRebelCaptain.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/DirdraRebelCaptain.cs new file mode 100644 index 000000000..1b4327842 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/DirdraRebelCaptain.cs @@ -0,0 +1,8 @@ +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.DemonHunter; + +public class DirdraRebelCaptain: CrewmateGenerator, ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Demonhunter.DirdraRebelCaptain; + + public bool ShouldShowForOpponent(Player opponent) => false; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/EmergencyMeeting.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/EmergencyMeeting.cs new file mode 100644 index 000000000..d0f6e4289 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/EmergencyMeeting.cs @@ -0,0 +1,8 @@ +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.DemonHunter; + +public class EmergencyMeeting: CrewmateGenerator, ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Demonhunter.EmergencyMeeting; + + public bool ShouldShowForOpponent(Player opponent) => false; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/Headhunt.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/Headhunt.cs new file mode 100644 index 000000000..86161bd9b --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/Headhunt.cs @@ -0,0 +1,8 @@ +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.DemonHunter; + +public class Headhunt: CrewmateGenerator, ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Demonhunter.Headhunt; + + public bool ShouldShowForOpponent(Player opponent) => false; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/ReturnPolicy.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/ReturnPolicy.cs index 0e5f72e69..dbc7a013b 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/ReturnPolicy.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/ReturnPolicy.cs @@ -14,8 +14,8 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => player.CardsPlayedThisMatch + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card is { Mechanics: not null } && card.Mechanics.Contains("Deathrattle")) .OrderByDescending(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/VoroneiRecruiter.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/VoroneiRecruiter.cs new file mode 100644 index 000000000..45dbb6250 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/DemonHunter/VoroneiRecruiter.cs @@ -0,0 +1,8 @@ +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.DemonHunter; + +public class VoroneiRecruiter: CrewmateGenerator, ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Demonhunter.VoroneiRecruiter; + + public bool ShouldShowForOpponent(Player opponent) => false; +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Druid/HydrationStation.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Druid/HydrationStation.cs index 0e3989cd2..602041221 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Druid/HydrationStation.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Druid/HydrationStation.cs @@ -15,9 +15,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.DeadMinionsCardIds + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card is { Mechanics: not null } && card.Mechanics.Contains("Taunt")) .OrderByDescending(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/PetParrot.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/PetParrot.cs index 39e7279de..d2dbced6c 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/PetParrot.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/PetParrot.cs @@ -16,7 +16,7 @@ public bool ShouldShowForOpponent(Player opponent) public List GetRelatedCards(Player player) { var lastCost1 = player.CardsPlayedThisMatch - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .LastOrDefault(card => card is { Cost: 1 }); return lastCost1 != null ? new List { lastCost1 } : new List(); } diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Product9.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Product9.cs index 35851a557..d5c7de6ef 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Product9.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Product9.cs @@ -14,9 +14,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.SecretsTriggeredCardIds + player.SecretsTriggeredCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null) .OrderByDescending(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Sasquawk.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Sasquawk.cs index 0c0b1d0bd..e79b28fbd 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Sasquawk.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/Sasquawk.cs @@ -15,7 +15,7 @@ public bool ShouldShowForOpponent(Player opponent) public List GetRelatedCards(Player player) => player.CardsPlayedLastTurn - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .Where(card => card != null) .OrderByDescending(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/StranglethornHeart.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/StranglethornHeart.cs index 5a94ecfc2..a22d1ae2d 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/StranglethornHeart.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Hunter/StranglethornHeart.cs @@ -14,8 +14,8 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.DeadMinionsCardIds - .Select(Database.GetCardFromId) + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Where(card => card != null && card.IsBeast() && card.Cost > 4) .OrderByDescending(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/Rewind.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/Rewind.cs index 0a8a4c703..43f4cff23 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/Rewind.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/Rewind.cs @@ -14,9 +14,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.SpellsPlayedCardIds + player.SpellsPlayedCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null && card.Id != HearthDb.CardIds.Collectible.Mage.Rewind) .OrderByDescending(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/TheGalacticProjectionOrb.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/TheGalacticProjectionOrb.cs index 512cbf499..8df957003 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/TheGalacticProjectionOrb.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Mage/TheGalacticProjectionOrb.cs @@ -14,9 +14,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.SpellsPlayedCardIds + player.SpellsPlayedCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Neutral/VelenLeaderOfTheExiled.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Neutral/VelenLeaderOfTheExiled.cs new file mode 100644 index 000000000..48b1f7a53 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Neutral/VelenLeaderOfTheExiled.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using System.Linq; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.Neutral; + +public class VelenLeaderOfTheExiled: ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Neutral.VelenLeaderOfTheExiled; + + public bool ShouldShowForOpponent(Player opponent) + { + var card = Database.GetCardFromId(GetCardId()); + return CardUtils.IsCardFromFormat(card, Core.Game.CurrentFormat) && GetRelatedCards(opponent).Count > 2; + } + + public List GetRelatedCards(Player player) => + player.CardsPlayedThisMatch + .Select(entity => Database.GetCardFromId(entity.CardId)) + .Where(card => card is { Mechanics: not null } && card.isDraenei() && card.Id != GetCardId() && + (card.Mechanics.Contains("Battlecry") || card.Mechanics.Contains("Deathrattle"))) + .ToList(); +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrin.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrin.cs index 3260c6817..a41aa6f8f 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrin.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrin.cs @@ -11,6 +11,6 @@ public class LadyLiadrin: ICardWithRelatedCards public List GetRelatedCards(Player player) => player.SpellsPlayedInFriendlyCharacters - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .ToList(); } diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrinCore.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrinCore.cs index 446399bbc..273780d28 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrinCore.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/LadyLiadrinCore.cs @@ -15,6 +15,6 @@ public bool ShouldShowForOpponent(Player opponent) public List GetRelatedCards(Player player) => player.SpellsPlayedInFriendlyCharacters - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .ToList(); } diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/Tyr.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/Tyr.cs index cfb5748c0..040e069ee 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/Tyr.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/Tyr.cs @@ -14,9 +14,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.DeadMinionsCardIds + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null && card.IsClass(player.Class) && card.Attack is > 1 and < 5) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTears.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTears.cs index 8aabff148..c48f93420 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTears.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTears.cs @@ -14,9 +14,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.DeadMinionsCardIds + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null && card.IsClass(player.Class)) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTearsForged.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTearsForged.cs index db1271db4..a08ecaaf2 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTearsForged.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/TyrsTearsForged.cs @@ -10,9 +10,9 @@ public class TyrsTearsForged: ICardWithRelatedCards public bool ShouldShowForOpponent(Player opponent) => false; public List GetRelatedCards(Player player) => - player.DeadMinionsCardIds + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null && card.IsClass(player.Class)) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/YrelBeaconOfHope.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/YrelBeaconOfHope.cs new file mode 100644 index 000000000..3f1be2068 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Paladin/YrelBeaconOfHope.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.Paladin; + +public class YrelBeaconOfHope: ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Paladin.YrelBeaconOfHope; + + public bool ShouldShowForOpponent(Player opponent) => false; + + public List GetRelatedCards(Player player) => + new List + { + Database.GetCardFromId(HearthDb.CardIds.Collectible.Paladin.LibramOfWisdom), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Paladin.LibramOfJustice), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Paladin.LibramOfHope), + }; + +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/ScroungingShipwright.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/ScroungingShipwright.cs new file mode 100644 index 000000000..de59077d4 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/ScroungingShipwright.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Linq; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.Rogue; + +public class ScroungingShipwright: ICardWithRelatedCards +{ + private readonly List _starshipPieces = new List { + Database.GetCardFromId(HearthDb.CardIds.Collectible.Rogue.TheGravitationalDisplacer), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Demonhunter.ShattershardTurret), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Demonhunter.FelfusedBattery), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Druid.ShatariCloakfield), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Druid.StarlightReactor), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Deathknight.GuidingFigure), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Deathknight.SoulboundSpire), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Warlock.FelfireThrusters), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Warlock.HeartOfTheLegion), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Hunter.Biopod), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Hunter.SpecimenClaw), + }; + + public string GetCardId() => HearthDb.CardIds.Collectible.Rogue.ScroungingShipwright; + + public bool ShouldShowForOpponent(Player opponent) => false; + + public List GetRelatedCards(Player player) => + _starshipPieces.Where(card => card != null && !card.IsClass(player.Class)).ToList(); +} + diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/StarshipSchematic.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/StarshipSchematic.cs new file mode 100644 index 000000000..31030ebdd --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/StarshipSchematic.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Linq; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.Rogue; + +public class StarshipSchematic: ICardWithRelatedCards +{ + private readonly List _starshipPieces = new List + { + Database.GetCardFromId(HearthDb.CardIds.Collectible.Rogue.TheGravitationalDisplacer), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Demonhunter.ShattershardTurret), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Demonhunter.FelfusedBattery), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Druid.ShatariCloakfield), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Druid.StarlightReactor), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Deathknight.GuidingFigure), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Deathknight.SoulboundSpire), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Warlock.FelfireThrusters), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Warlock.HeartOfTheLegion), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Hunter.Biopod), + Database.GetCardFromId(HearthDb.CardIds.Collectible.Hunter.SpecimenClaw), + }; + + public string GetCardId() => HearthDb.CardIds.Collectible.Rogue.StarshipSchematic; + + public bool ShouldShowForOpponent(Player opponent) => false; + + public List GetRelatedCards(Player player) => + _starshipPieces.Where(card => card != null && !card.IsClass(player.Class)).ToList(); +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymane.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymane.cs index 1678227ce..ee25be7cb 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymane.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymane.cs @@ -14,7 +14,7 @@ public bool ShouldShowForOpponent(Player opponent) public List GetRelatedCards(Player player) => player.CardsPlayedThisMatch - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .Where(card => card != null && !card.IsClass(player.Class) && !card.IsNeutral) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymaneCore.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymaneCore.cs index 6d0c01f50..8b127b235 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymaneCore.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Rogue/TessGreymaneCore.cs @@ -15,7 +15,7 @@ public bool ShouldShowForOpponent(Player opponent) public List GetRelatedCards(Player player) => player.CardsPlayedThisMatch - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .Where(card => card != null && !card.IsClass(player.Class) && !card.IsNeutral) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Shaman/Shudderwock.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Shaman/Shudderwock.cs index c42629b12..4287a4106 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Shaman/Shudderwock.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Shaman/Shudderwock.cs @@ -15,7 +15,7 @@ public bool ShouldShowForOpponent(Player opponent) public List GetRelatedCards(Player player) => player.CardsPlayedThisMatch - .Select(Database.GetCardFromId) + .Select(entity => Database.GetCardFromId(entity.CardId)) .Where(card => card is { Mechanics: not null } && card.Mechanics.Contains("Battlecry")) .ToList(); } diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warlock/Archimonde.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warlock/Archimonde.cs new file mode 100644 index 000000000..e75e43855 --- /dev/null +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warlock/Archimonde.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Linq; + +namespace Hearthstone_Deck_Tracker.Hearthstone.RelatedCardsSystem.Cards.Warlock; + +public class Archimonde: ICardWithRelatedCards +{ + public string GetCardId() => HearthDb.CardIds.Collectible.Warlock.Archimonde; + + public bool ShouldShowForOpponent(Player opponent) + { + var card = Database.GetCardFromId(GetCardId()); + return CardUtils.MayCardBeRelevant(card, Core.Game.CurrentFormat, opponent.Class) && GetRelatedCards(opponent).Count > 1; + } + + public List GetRelatedCards(Player player) => + player.CardsPlayedThisMatch + .Where(entity => entity.Info.Created) + .Select(entity => Database.GetCardFromId(entity.CardId)) + .Distinct() + .Where(card => card is not null && card.IsDemon()) + .OrderByDescending(card => card!.Cost) + .ToList(); +} diff --git a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warrior/InventorBoom.cs b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warrior/InventorBoom.cs index 4aac9ce93..f4195c55b 100644 --- a/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warrior/InventorBoom.cs +++ b/Hearthstone Deck Tracker/Hearthstone/RelatedCardsSystem/Cards/Warrior/InventorBoom.cs @@ -14,9 +14,9 @@ public bool ShouldShowForOpponent(Player opponent) } public List GetRelatedCards(Player player) => - player.DeadMinionsCardIds + player.DeadMinionsCards + .Select(entity => Database.GetCardFromId(entity.CardId)) .Distinct() - .Select(Database.GetCardFromId) .Where(card => card != null && card.IsMech() && card.Cost > 4) .OrderBy(card => card!.Cost) .ToList(); diff --git a/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs b/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs index 9bea26841..d10fe9b56 100644 --- a/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs +++ b/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs @@ -237,7 +237,10 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) { if(entity.Info.GuessedCardState != GuessedCardState.None) entity.Info.GuessedCardState = GuessedCardState.Revealed; - if(entity.CardId is Collectible.Neutral.PrinceRenathalCore or Collectible.Neutral.PrinceRenathal) + if(entity.CardId is Collectible.Neutral.PrinceRenathalCore or + Collectible.Neutral.PrinceRenathal or + Collectible.Warrior.SporeEmpressMoldara or + NonCollectible.Warrior.SporeEmpressMoldara_ReplicatingSporeToken) { entity.Info.GuessedCardState = GuessedCardState.Revealed; Core.UpdateOpponentCards(); @@ -447,11 +450,13 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) case Collectible.Warrior.DirehornHatchling: AddKnownCardId(gameState, NonCollectible.Warrior.DirehornHatchling_DirehornMatriarchToken); break; - case Collectible.Mage.FrozenCloneICECROWN: + case Collectible.Mage.FrozenClone: + case Collectible.Mage.FrozenCloneCorePlaceholder: if(target != null) AddKnownCardId(gameState, target, 2); break; - case Collectible.Shaman.MoorabiICECROWN: + case Collectible.Shaman.Moorabi: + case Collectible.Shaman.MoorabiCorePlaceholder: case Collectible.Rogue.SonyaShadowdancer: if(target != null) AddKnownCardId(gameState, target); @@ -488,13 +493,13 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) case Collectible.Priest.SpiritOfTheDead: if(correspondPlayer == game.Player.Id) { - if(game.Player.LastDiedMinionCardId != null) - AddKnownCardId(gameState, game.Player.LastDiedMinionCardId); + if(game.Player.LastDiedMinionCard?.CardId != null) + AddKnownCardId(gameState, game.Player.LastDiedMinionCard.CardId); } else if(correspondPlayer == game.Opponent.Id) { - if(game.Opponent.LastDiedMinionCardId != null) - AddKnownCardId(gameState, game.Opponent.LastDiedMinionCardId); + if(game.Opponent.LastDiedMinionCard?.CardId != null) + AddKnownCardId(gameState, game.Opponent.LastDiedMinionCard.CardId); } break; case Collectible.Druid.SecureTheDeck: @@ -547,8 +552,11 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) if (actionStartingEntity != null) { var player = actionStartingEntity.IsControlledBy(game.Player.Id) ? game.Opponent : game.Player; - foreach(var card in player.CardsPlayedThisTurn) - AddKnownCardId(gameState, card); + foreach(var entity in player.CardsPlayedThisTurn) + { + if(entity.CardId != null) + AddKnownCardId(gameState, entity.CardId); + } } break; case Collectible.Rogue.EfficientOctoBot: @@ -777,7 +785,8 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) case Collectible.Neutral.EliseTheTrailblazer: AddKnownCardId(gameState, NonCollectible.Neutral.ElisetheTrailblazer_UngoroPackToken); break; - case Collectible.Mage.GhastlyConjurerICECROWN: + case Collectible.Mage.GhastlyConjurer: + case Collectible.Mage.GhastlyConjurerCorePlaceholder: AddKnownCardId(gameState, Collectible.Mage.MirrorImageLegacy); break; case Collectible.Druid.ThorngrowthSentries: @@ -1107,6 +1116,20 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) } } break; + case Collectible.Demonhunter.XortothBreakerOfStars: + AddKnownCardId(gameState, NonCollectible.Demonhunter.XortothBreakerofStars_StarOfOriginationToken); + AddKnownCardId(gameState, NonCollectible.Demonhunter.XortothBreakerofStars_StarOfConclusionToken); + break; + case Collectible.Rogue.Talgath: + AddKnownCardId(gameState, Collectible.Rogue.BackstabCore); + break; + case Collectible.Neutral.AstralVigilant: + AddKnownCardId(gameState, game.Opponent.CardsPlayedThisMatch + .Select(entity => Database.GetCardFromId(entity.CardId)) + .Where(card => card is { Mechanics: not null } && card.isDraenei()) + .Select(card => card!.Id) + .LastOrDefault()!); + break; default: if(playerEntity.Value != null && playerEntity.Value.GetTag(GameTag.CURRENT_PLAYER) == 1 && !gameState.PlayerUsedHeroPower