From a926be3040b05a4ac5635daaaf489a2fc9b0410a Mon Sep 17 00:00:00 2001 From: Benedict Etzel Date: Tue, 3 Sep 2024 13:36:58 +0200 Subject: [PATCH] feat: detect Pagle's Fishing Rod the moment it is offered --- Hearthstone Deck Tracker/GameEventHandler.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Hearthstone Deck Tracker/GameEventHandler.cs b/Hearthstone Deck Tracker/GameEventHandler.cs index da96da5ff..e003c5c8a 100644 --- a/Hearthstone Deck Tracker/GameEventHandler.cs +++ b/Hearthstone Deck Tracker/GameEventHandler.cs @@ -1156,6 +1156,22 @@ public async void HandlePlayerMulliganDone() public void HandlePlayerEntityChoices(IHsChoice choice) { + if(choice.ChoiceType == ChoiceType.GENERAL && _game.IsBattlegroundsMatch) + { + if( + _game.Entities.TryGetValue(choice.SourceEntityId, out var source) && + source.GetTag(GameTag.BACON_IS_MAGIC_ITEM_DISCOVER) > 0 + ) + { + var offered = choice.OfferedEntityIds + ?.Select(id => _game.Entities.TryGetValue(id, out var e) ? e : null) + .WhereNotNull() + .Where(x => x.IsBattlegroundsTrinket) + .ToList() ?? new List(); + var existingTrinkets = Core.Game.Player.Trinkets.Select(x => x.Card.Id); + Core.Overlay.BattlegroundsMinionsVM.OnTrinkets(existingTrinkets.Concat(offered.Select(x => x.Card.Id))); + } + } } public void HandlePlayerEntitiesChosen(IHsCompletedChoice choice)