private void parseLineForTriggers(String Line, Player ActivePlayer, Player PassivePlayer) { Match match; match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Aetherphage \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (match.Success) { PassivePlayer.playerDeck.discardCard(new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value))); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Technosmith \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (match.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value) - 1)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Aetherforge Oracle \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (match.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value) - 1)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Apocrymancer \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (match.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value) - 1)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Metatransfer \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (match.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value) - 1)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Metamind Adept \\(lvl [0-9]\\) for ([0-9]) cards."); if (match.Success) { ActivePlayer.drawCard(Convert.ToInt16(match.Groups[1].Value)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Metamind Explorer \\(lvl [0-9]\\) for ([0-9]) cards."); if (match.Success) { ActivePlayer.drawCard(Convert.ToInt16(match.Groups[1].Value)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Metamind Overseer \\(lvl [0-9]\\) for ([0-9]) cards."); if (match.Success) { ActivePlayer.drawCard(Convert.ToInt16(match.Groups[1].Value)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Ghox, Metamind Paragon \\(lvl [0-9]\\) for ([0-9]) cards."); if (match.Success) { ActivePlayer.drawCard(Convert.ToInt16(match.Groups[1].Value)); return; } match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " triggers Delpha, Chronosculptor \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (match.Success) { ActivePlayer.playerDeck.levelUpCard(new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value) - 1)); return; } }
private void parseLineForPlay(String Line, Player ActivePlayer, Player PassivePlayer) { Match match; Match submatch; Card playedCard; match = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays ([a-zA-Z. ,']+) \\(lvl ([0-9])\\)"); if (match.Success) { playedCard = new Card(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value)); if (playedCard.CardDefinition.isBuggedDoublePlay() && lastPlayedCard.cardName == playedCard.cardName) { if (match.Groups[1].Value == "Oratek Battlebrand") { submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Oratek Battlebrand \\(lvl [0-9]\\)\\."); if (submatch.Success) { ActivePlayer.playerDeck.levelUpUnknownCard(); } submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Oratek Battlebrand \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)."); if (submatch.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[1].Value, Convert.ToInt16(submatch.Groups[2].Value))); } } lastPlayedCard = new Card("", 0); return; } ActivePlayer.playerDeck.playCard(playedCard); lastPlayedCard = playedCard; if (match.Groups[1].Value == "Metasight") { submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Metasight \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\) and ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (submatch.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[1].Value, Convert.ToInt16(submatch.Groups[2].Value) - 1)); ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[3].Value, Convert.ToInt16(submatch.Groups[4].Value) - 1)); } submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Metasight \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (submatch.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[1].Value, Convert.ToInt16(submatch.Groups[2].Value) - 1)); } return; } if (match.Groups[1].Value == "Metasight") { submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Perilous Insight \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\) and ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (submatch.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[1].Value, Convert.ToInt16(submatch.Groups[2].Value) - 1)); ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[3].Value, Convert.ToInt16(submatch.Groups[4].Value) - 1)); } submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Perilous Insight \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)"); if (submatch.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[1].Value, Convert.ToInt16(submatch.Groups[2].Value) - 1)); } return; } if (match.Groups[1].Value == "Energy Surge") { submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Energy Surge \\(lvl [0-9]\\) for ([0-9]) cards."); if (submatch.Success) { ActivePlayer.drawCard(Convert.ToInt16(submatch.Groups[1].Value)); } return; } if (match.Groups[1].Value == "Oratek Battlebrand") { submatch = Regex.Match(Line, @"^" + ActivePlayer.playerName + " plays Oratek Battlebrand \\(lvl [0-9]\\) targeting ([a-zA-Z. ,]+) \\(lvl ([0-9])\\)\\."); if (submatch.Success) { ActivePlayer.playerDeck.levelUpCardAndDiscard(new Card(submatch.Groups[1].Value, Convert.ToInt16(submatch.Groups[2].Value))); } } return; } }