Skip to content

Commit

Permalink
feat: show tourist when a related card is played
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuscechetto committed Sep 17, 2024
1 parent ae23c1a commit dba23b4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,26 @@ public void Handle(string logLine, IHsGameState gameState, IGame game)
_tagChangeHandler.InvokeQueuedActions(game);
gameState.CurrentEntityHasCardId = !string.IsNullOrEmpty(cardId);
gameState.CurrentEntityZone = zone;

// For tourists, a different entity of the Tourist card is created by the TouristEnchantment, and that entity is REMOVEDFROMGAME.
// we can predict, then, that there is a real entity of that cardId on the opponents deck.
if(zone == Zone.REMOVEDFROMGAME && gameState.CurrentBlock != null)
{
Entity? actionStartingEntity = null;
if(game.Entities.TryGetValue(gameState.CurrentBlock.SourceEntityId, out actionStartingEntity))
{
if(
actionStartingEntity.CardId == NonCollectible.Neutral.TouristVfxEnchantmentEnchantment
&& actionStartingEntity.IsControlledBy(game.Opponent.Id)
)
{
game.Opponent.PredictUniqueCardInDeck(cardId, false);
Core.UpdateOpponentCards();
}
}

}

return;
}
else if(UpdatingEntityRegex.IsMatch(logLine))
Expand Down

0 comments on commit dba23b4

Please sign in to comment.