Skip to content

Commit

Permalink
recycle and malorne fixes (mostly)
Browse files Browse the repository at this point in the history
  • Loading branch information
Epix37 committed Aug 19, 2015
1 parent c49a69a commit f2b6be5
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions Hearthstone Deck Tracker/HsLogReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ private void Analyze(string log)
}
if (!string.IsNullOrEmpty(actionStartingCardId))
{
if (actionStartingCardId == "BRM_007") //Gang Up
if (actionStartingCardId == "BRM_007") //Gang Up
{
int id = Game.Entities.Count + 1;
if(playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
{
var target = match.Groups["target"].Value.Trim();
Expand All @@ -447,7 +448,10 @@ private void Analyze(string log)
{
var targetCardId = cardIdMatch.Groups["cardId"].Value.Trim();
for(int i = 0; i < 3; i++)
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Player);
_gameHandler.HandlePlayerGetToDeck(targetCardId, GetTurnNumber());
}
}
}
}
Expand All @@ -456,14 +460,17 @@ private void Analyze(string log)
//if I pass the entity id here I could know if a drawn card is one of the copies.
// (should probably not be implemented :))
for(int i = 0; i < 3; i++)
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Opponent);
_gameHandler.HandleOpponentGetToDeck(GetTurnNumber());
}
}
}
else if (actionStartingCardId == "GVG_056") //Iron Juggernaut
else if(actionStartingCardId == "GVG_056") //Iron Juggernaut
{
// burrowing mine will be the entity created next
int id = Game.Entities.Count + 1;
if (playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
if(playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Opponent);
_gameHandler.HandleOpponentGetToDeck(GetTurnNumber());
Expand All @@ -474,6 +481,46 @@ private void Analyze(string log)
_gameHandler.HandlePlayerGetToDeck("GVG_056t", GetTurnNumber());
}
}
else if(actionStartingCardId == "GVG_031") //Recycle
{
// Recycled card will be the entity created next
int id = Game.Entities.Count + 1;
if(playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Opponent);
_gameHandler.HandleOpponentGetToDeck(GetTurnNumber());
}
else
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Player);
var target = match.Groups["target"].Value.Trim();
if(target.StartsWith("[") && _entityRegex.IsMatch(target))
{
var cardIdMatch = _cardIdRegex.Match(target);
if(cardIdMatch.Success)
{
var targetCardId = cardIdMatch.Groups["cardId"].Value.Trim();
for(int i = 0; i < 3; i++)
_gameHandler.HandlePlayerGetToDeck(targetCardId, GetTurnNumber());
}
}
}
}
else if(actionStartingCardId == "GVG_035") //Malorne
{
// Malorne will be the entity created next
int id = Game.Entities.Count + 1;
if(playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Opponent);
_gameHandler.HandleOpponentGetToDeck(GetTurnNumber());
}
else
{
ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Player);
_gameHandler.HandlePlayerGetToDeck("GVG_035", GetTurnNumber());
}
}


else
Expand Down

0 comments on commit f2b6be5

Please sign in to comment.