Skip to content

Commit

Permalink
fix(Player): coin detection
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Dec 12, 2023
1 parent d3e0461 commit b82567c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Hearthstone Deck Tracker/Hearthstone/Entities/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ public void ClearCardId()

public bool IsCurrentPlayer => HasTag(GameTag.CURRENT_PLAYER);

public bool IsTheCoin => CardId == HearthDb.CardIds.NonCollectible.Neutral.TheCoinCore || (IsSpell && GetTag((GameTag)2088) == 1);

public bool HasCardId => !string.IsNullOrEmpty(CardId);

public int ZonePosition
Expand Down Expand Up @@ -267,8 +269,7 @@ public CardMark CardMark
{
if(Hidden)
return CardMark.None;
if(_entity.CardId == HearthDb.CardIds.NonCollectible.Neutral.TheCoinCore
|| _entity.CardId == HearthDb.CardIds.NonCollectible.Neutral.TradePrinceGallywix_GallywixsCoinToken)
if(_entity.IsTheCoin)
return CardMark.Coin;
if(Returned)
return CardMark.Returned;
Expand Down
2 changes: 1 addition & 1 deletion Hearthstone Deck Tracker/Hearthstone/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Player(IGame game, bool isLocalPlayer)
public HashSet<SpellSchool> PlayedSpellSchools { get; private set; } = new HashSet<SpellSchool>();
public int AbyssalCurseCount { get; private set; }

public bool HasCoin => Hand.Any(e => e.CardId == HearthDb.CardIds.NonCollectible.Neutral.TheCoinCore);
public bool HasCoin => Hand.Any(e => e.IsTheCoin);
public int HandCount => Hand.Count();
public int DeckCount => Deck.Count();

Expand Down

0 comments on commit b82567c

Please sign in to comment.