Skip to content

Commit

Permalink
feat: detect Pagle's Fishing Rod the moment it is offered
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Sep 3, 2024
1 parent 5f66952 commit a926be3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Hearthstone Deck Tracker/GameEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Entity>();
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)
Expand Down

0 comments on commit a926be3

Please sign in to comment.