diff --git a/Hearthstone Deck Tracker/Hearthstone/Player.cs b/Hearthstone Deck Tracker/Hearthstone/Player.cs index 3ed82e39b8..44cb350980 100644 --- a/Hearthstone Deck Tracker/Hearthstone/Player.cs +++ b/Hearthstone Deck Tracker/Hearthstone/Player.cs @@ -33,6 +33,7 @@ public Player(IGame game, bool isLocalPlayer) public int SpellsPlayedCount { get; private set; } public bool IsPlayingWhizbang { get; set; } public int PogoHopperPlayedCount {get; private set;} + public string LastDiedMinionCardId { get; set; } public bool HasCoin => Hand.Any(e => e.CardId == HearthDb.CardIds.NonCollectible.Neutral.TheCoin); public int HandCount => Hand.Count(); @@ -390,6 +391,8 @@ public void QuestPlayedFromHand(Entity entity, int turn) public void PlayToGraveyard(Entity entity, string cardId, int turn) { entity.Info.Turn = turn; + if(entity.IsMinion) + LastDiedMinionCardId = cardId; Log(entity); } diff --git a/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs b/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs index ca8b51cb88..fb01bd6507 100644 --- a/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs +++ b/Hearthstone Deck Tracker/LogReader/Handlers/PowerHandler.cs @@ -234,6 +234,7 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) var blockType = match.Success ? match.Groups["type"].Value : null; var cardId = match.Success ? match.Groups["Id"].Value : null; var target = GetTargetCardId(match); + var correspondPlayer = match.Success ? int.Parse(match.Groups["player"].Value) : -1; gameState.BlockStart(blockType, cardId, target); if(match.Success && (blockType == "TRIGGER" || blockType == "POWER")) @@ -328,6 +329,13 @@ public void Handle(string logLine, IHsGameState gameState, IGame game) case Collectible.Warrior.Wrenchcalibur: AddKnownCardId(gameState, NonCollectible.Neutral.SeaforiumBomber_BombToken); break; + case Collectible.Priest.SpiritOfTheDead: + if(correspondPlayer == game.Player.Id) + AddKnownCardId(gameState, game.Player.LastDiedMinionCardId); + else if(correspondPlayer == game.Opponent.Id) + AddKnownCardId(gameState, game.Opponent.LastDiedMinionCardId); + break; + } } else //POWER diff --git a/Hearthstone Deck Tracker/LogReader/LogConstants.cs b/Hearthstone Deck Tracker/LogReader/LogConstants.cs index ab987b593b..4b0f072349 100644 --- a/Hearthstone Deck Tracker/LogReader/LogConstants.cs +++ b/Hearthstone Deck Tracker/LogReader/LogConstants.cs @@ -25,7 +25,7 @@ public static class LogConstants public static class PowerTaskList { public static readonly Regex BlockStartRegex = - new Regex(@".*BLOCK_START.*BlockType=(?(\w+)).*id=(?\d*).*(cardId=(?(\w*))).*EffectCardId=(?(.*))\sEffectIndex=.*Target=(?(.+)).*SubOption=(?(.+))"); + new Regex(@".*BLOCK_START.*BlockType=(?(\w+)).*id=(?\d*).*(cardId=(?(\w*))).*player=(?\d*).*EffectCardId=(?(.*))\sEffectIndex=.*Target=(?(.+)).*SubOption=(?(.+))"); public static readonly Regex CardIdRegex = new Regex(@"cardId=(?(\w+))"); public static readonly Regex CreationRegex = new Regex(@"FULL_ENTITY - Updating.*id=(?(\d+)).*zone=(?(\w+)).*CardID=(?(\w*))");