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 71b7488 commit 557d7c3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ public bool IsThorimRelevant
set
{
SetProp(value);
OnPropertyChanged(nameof(AvailableTiers));
OnPropertyChanged(nameof(TierButtons));
OnPropertyChanged(nameof(Groups));
OnPropertyChanged(nameof(ShowTavernTier7));
UpdateTavernTier7Visibility();
}
}

Expand All @@ -99,10 +96,7 @@ public bool IsPaglesFishingRodRelevant
set
{
SetProp(value);
OnPropertyChanged(nameof(AvailableTiers));
OnPropertyChanged(nameof(TierButtons));
OnPropertyChanged(nameof(Groups));
OnPropertyChanged(nameof(ShowTavernTier7));
UpdateTavernTier7Visibility();
}
}

Expand All @@ -113,6 +107,9 @@ public void UpdateTavernTier7Visibility()
OnPropertyChanged(nameof(AvailableTiers));
OnPropertyChanged(nameof(TierButtons));
OnPropertyChanged(nameof(Groups));
OnPropertyChanged(nameof(ShowTavernTier7));
if(!ShowTavernTier7 && ActiveTier == 7)
ActiveTier = null;
}

public IEnumerable<string>? BannedMinions
Expand Down
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 557d7c3

Please sign in to comment.