public void Flamewaker_BRM_002() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = CardClass.MAGE, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Flamewaker")); game.Process(PlayCardTask.Any(game.CurrentPlayer, testCard)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); var minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Bloodfen Raptor")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1)); var minion2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); Assert.AreEqual(33, ((Minion)minion1).Health + ((Minion)minion2).Health + game.CurrentOpponent.Hero.Health); var spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Fireball")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell2, game.CurrentOpponent.Hero)); Assert.AreEqual(25, (((Minion)minion1).IsDead ? 0 : ((Minion)minion1).Health) + (((Minion)minion2).IsDead ? 0 : ((Minion)minion2).Health) + game.CurrentOpponent.Hero.Health); }
public void BasicAttackBuffTest1() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player2HeroClass = CardClass.HUNTER, FillDecks = true, FillDecksPredictably = true }); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); var minion1 = (ICharacter)Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Bloodfen Raptor")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1)); IPlayable spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Inner Rage")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, minion1)); Assert.Equal(5, ((Minion)minion1).AttackDamage); Assert.Equal(1, ((Minion)minion1).Health); game.Process(EndTurnTask.Any(game.CurrentPlayer)); IPlayable minion2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Aldor Peacekeeper")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, minion2, minion1)); Assert.Equal(1, ((Minion)minion1).AttackDamage); Assert.Equal(1, ((Minion)minion1).Health); }
public void MajordomoExecutus_BRM_027() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = CardClass.PRIEST, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Majordomo Executus")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); var spell = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Shadow Word: Death")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell, testCard)); Assert.AreEqual(8, game.CurrentOpponent.Hero.Health); game.Process(EndTurnTask.Any(game.CurrentPlayer)); game.Process(HeroPowerTask.Any(game.CurrentPlayer)); Assert.AreEqual(22, game.CurrentOpponent.Hero.Health); }
public void IceLance_CS2_031() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = CardClass.MAGE, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; IPlayable testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Ice Lance")); IPlayable testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Ice Lance")); Assert.False(game.CurrentOpponent.Hero.IsFrozen); Assert.Equal(30, game.CurrentOpponent.Hero.Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard1, game.CurrentOpponent.Hero)); Assert.True(game.CurrentOpponent.Hero.IsFrozen); Assert.Equal(30, game.CurrentOpponent.Hero.Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard2, game.CurrentOpponent.Hero)); Assert.Equal(26, game.CurrentOpponent.Hero.Health); }
public void BasicHealthBuffTest1() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player2HeroClass = CardClass.HUNTER, FillDecks = true, FillDecksPredictably = true }); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); var minion = (ICharacter)Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Bloodfen Raptor")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion)); IPlayable spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Power Word: Shield")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, minion)); Assert.Equal(4, ((Minion)minion).Health); game.Process(EndTurnTask.Any(game.CurrentPlayer)); IPlayable spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Hunter's Mark")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell2, minion)); Assert.Equal(1, ((Minion)minion).Health); }
public void SilenceRebuffTest() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player1Deck = new List <Card>() { Cards.FromName("Silence"), Cards.FromName("Power Word: Shield"), Cards.FromName("Murloc Tinyfin"), Cards.FromName("Power Word: Shield") }, Player2HeroClass = CardClass.PRIEST, Shuffle = false, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.Process(PlayCardTask.Any(game.CurrentPlayer, "Murloc Tinyfin")); Assert.Equal(1, game.CurrentPlayer.BoardZone[0].Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, "Power Word: Shield", game.CurrentPlayer.BoardZone[0])); Assert.Equal(3, game.CurrentPlayer.BoardZone[0].Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, "Silence", game.CurrentPlayer.BoardZone[0])); Assert.Equal(1, game.CurrentPlayer.BoardZone[0].Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, "Power Word: Shield", game.CurrentPlayer.BoardZone[0])); Assert.Equal(3, game.CurrentPlayer.BoardZone[0].Health); }
public static void BasicBuffTest() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player2HeroClass = CardClass.HUNTER, FillDecks = true }); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); var minion = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion)); var spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Power Word: Shield")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, minion)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); var spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Hunter's Mark")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell2, minion)); ShowLog(game, LogLevel.VERBOSE); }
public void Resurrect_BRM_017() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player2HeroClass = CardClass.MAGE, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Resurrect")); Assert.AreEqual(5, game.CurrentPlayer.Hand.Count); game.Process(PlayCardTask.Spell(game.CurrentPlayer, testCard)); Assert.AreEqual(5, game.CurrentPlayer.Hand.Count); var minion = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Injured Blademaster")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); var spell = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Fireball")); Assert.AreEqual(1, game.CurrentOpponent.Board.Count); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell, minion)); Assert.AreEqual(0, game.CurrentOpponent.Board.Count); game.Process(EndTurnTask.Any(game.CurrentPlayer)); game.Process(PlayCardTask.Spell(game.CurrentPlayer, testCard)); Assert.AreEqual(1, game.CurrentPlayer.Board.Count); Assert.AreEqual(minion.Card.Id, game.CurrentPlayer.Board[0].Card.Id); Assert.AreEqual(7, ((Minion)game.CurrentPlayer.Board[0]).Health); }
public static int OneRoundAOE(List <string> AICards, List <Card> combo, string comboClass) { if (!CARDCLASS.ContainsKey(comboClass)) { return(-1); } var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = (CardClass)CARDCLASS[comboClass], Shuffle = false, FillDecks = true, FillDecksPredictably = false }); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); foreach (string cardname in AICards) //draw all cards due to mana cost limit to 10/round { //Console.WriteLine(cardname); game.Process(PlayCardTask.Any(game.CurrentPlayer, Entity.FromCard(game.CurrentPlayer, Cards.FromName(cardname), zone: game.CurrentPlayer.HandZone))); game.Process(EndTurnTask.Any(game.CurrentPlayer)); //end round switch to our side game.Process(EndTurnTask.Any(game.CurrentPlayer)); //end round skip our side, back to opponent } game.Process(EndTurnTask.Any(game.CurrentPlayer)); //end round switch to our side if (combo[0].Type.ToString() != "MINION") //minion card use first { combo.Reverse(); } foreach (Card card in combo) //use card one by one { if (card.Type.ToString() != "MINION") { IPlayable SpellTest = Generic.DrawCard(game.CurrentPlayer, card); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, SpellTest, game.CurrentOpponent.BoardZone[0])); } else //spell or weapon { game.Process(PlayCardTask.Any(game.CurrentPlayer, Entity.FromCard(game.CurrentPlayer, card, zone: game.CurrentPlayer.HandZone))); } } /*Program.ShowLog(game, LogLevel.VERBOSE); * Console.WriteLine(game.CurrentOpponent.BoardZone.FullPrint()); * Console.WriteLine(game.CurrentPlayer.BoardZone.FullPrint());*/ int health = game.CurrentOpponent.BoardZone.Health(); return(health); }
public void BasicHealthAuraTest3() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player2HeroClass = CardClass.WARLOCK, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var minion1 = (ICharacter)Generic.DrawCard(game.Player1, Cards.FromName("Murloc Raider")); var minion2 = (ICharacter)Generic.DrawCard(game.Player1, Cards.FromName("Murloc Warleader")); IPlayable minion3 = Generic.DrawCard(game.Player1, Cards.FromName("Stormwind Champion")); IPlayable minion4 = Generic.DrawCard(game.Player1, Cards.FromName("Ironbeak Owl")); IPlayable spell1 = Generic.DrawCard(game.Player1, Cards.FromName("Power Word: Shield")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1)); game.Player1.UsedMana = 0; game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2)); game.Player1.UsedMana = 0; game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion3)); game.Player1.UsedMana = 0; game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, minion1)); Assert.Equal(4, minion1.Health); Assert.Equal(4, minion2.Health); Assert.Equal(6, ((ICharacter)minion3).Health); game.Process(PlayCardTask.MinionTarget(game.CurrentPlayer, minion4, minion2)); Assert.Equal(4, minion1.Health); Assert.Equal(4, minion2.Health); Assert.Equal(6, ((ICharacter)minion3).Health); Assert.Equal(2, ((ICharacter)minion4).Health); game.Process(EndTurnTask.Any(game.CurrentPlayer)); IPlayable spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Hellfire")); game.Process(PlayCardTask.Spell(game.CurrentPlayer, spell2)); Assert.Equal(1, minion1.Health); Assert.Equal(1, minion2.Health); Assert.Equal(3, ((ICharacter)minion3).Health); Assert.True(((ICharacter)minion4).IsDead); }
public void CloneSameState() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.SHAMAN, Player2HeroClass = CardClass.SHAMAN, FillDecks = true, History = false, Logging = false }); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); Game clone = game.Clone(); Assert.Equal(game.Hash(), clone.Hash()); SabberStoneCore.Model.Entities.IPlayable spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Lightning Bolt")); SabberStoneCore.Model.Entities.IPlayable minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar")); SabberStoneCore.Model.Entities.IPlayable spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Lightning Bolt")); SabberStoneCore.Model.Entities.IPlayable cSpell1 = Generic.DrawCard(clone.CurrentPlayer, Cards.FromName("Lightning Bolt")); SabberStoneCore.Model.Entities.IPlayable cSpell2 = Generic.DrawCard(clone.CurrentPlayer, Cards.FromName("Lightning Bolt")); SabberStoneCore.Model.Entities.IPlayable cMinion1 = Generic.DrawCard(clone.CurrentPlayer, Cards.FromName("Stonetusk Boar")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, game.CurrentOpponent.Hero)); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell2, game.CurrentOpponent.Hero)); game.Process(PlayCardTask.Any(game.CurrentPlayer, minion1)); clone.Process(PlayCardTask.Any(clone.CurrentPlayer, cMinion1)); clone.Process(PlayCardTask.SpellTarget(clone.CurrentPlayer, cSpell2, clone.CurrentOpponent.Hero)); clone.Process(PlayCardTask.SpellTarget(clone.CurrentPlayer, cSpell1, clone.CurrentOpponent.Hero)); GameTag[] ignored = new GameTag[] { GameTag.LAST_CARD_PLAYED, GameTag.ENTITY_ID }; string gameHash = game.Hash(ignored); string cloneHash = clone.Hash(ignored); Assert.Equal(gameHash, cloneHash); }
public void BasicHealthAuraTest2() { var game = new Game(new GameConfig { StartPlayer = 1, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; var minion1 = (ICharacter)Generic.DrawCard(game.Player1, Cards.FromName("Murloc Raider")); IPlayable minion2 = Generic.DrawCard(game.Player1, Cards.FromName("Ironbeak Owl")); IPlayable spell1 = Generic.DrawCard(game.Player1, Cards.FromName("Power Word: Shield")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1)); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, minion1)); Assert.Equal(3, minion1.Health); game.Process(PlayCardTask.MinionTarget(game.CurrentPlayer, minion2, minion1)); Assert.Equal(1, minion1.Health); game.Process(EndTurnTask.Any(game.CurrentPlayer)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); var minion3 = (ICharacter)Generic.DrawCard(game.Player1, Cards.FromName("Bloodfen Raptor")); IPlayable minion4 = Generic.DrawCard(game.Player1, Cards.FromName("Ironbeak Owl")); IPlayable spell2 = Generic.DrawCard(game.Player1, Cards.FromName("Power Word: Shield")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion3)); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell2, minion3)); Assert.Equal(4, minion3.Health); ((Minion)minion3).Damage = 3; game.Process(PlayCardTask.MinionTarget(game.CurrentPlayer, minion4, minion3)); Assert.Equal(1, minion3.Health); }
public void QuickShot_BRM_013() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.HUNTER, DeckPlayer1 = new List <Card>() { }, Player2HeroClass = CardClass.HUNTER, DeckPlayer2 = new List <Card>() { Cards.FromName("Alleycat"), Cards.FromName("Alleycat"), Cards.FromName("Kill Command"), Cards.FromName("Kill Command"), Cards.FromName("Unleash the Hounds"), Cards.FromName("Unleash the Hounds"), Cards.FromName("Houndmaster"), Cards.FromName("Houndmaster"), Cards.FromName("Savannah Highmane"), Cards.FromName("Savannah Highmane"), }, FillDecks = false }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Quick Shot")); var testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Quick Shot")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard1, game.CurrentOpponent.Hero)); Assert.AreEqual(27, game.CurrentOpponent.Hero.Health); Assert.AreEqual(0, game.CurrentPlayer.NumCardsDrawnThisTurn); Assert.AreEqual(20, game.CurrentPlayer.Hero.Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard2, game.CurrentOpponent.Hero)); Assert.AreEqual(0, game.CurrentPlayer.NumCardsDrawnThisTurn); Assert.AreEqual(24, game.CurrentOpponent.Hero.Health); Assert.AreEqual(15, game.CurrentPlayer.Hero.Health); }
public void GangUp_BRM_007() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.ROGUE, Player2HeroClass = CardClass.ROGUE, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Gang Up")); var minion = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Bloodfen Raptor")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion)); Assert.AreEqual(26, game.CurrentPlayer.Deck.Count); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard, minion)); Assert.AreEqual(29, game.CurrentPlayer.Deck.Count); }
public void SylvanasWindrunner_EX1_016() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.WARLOCK, Player2HeroClass = CardClass.MAGE, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; IPlayable minion11 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Bloodfen Raptor")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion11)); IPlayable minion12 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Leper Gnome")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion12)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); var minion2 = (ICharacter)Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Sylvanas Windrunner")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2)); int myBoardCount = game.CurrentPlayer.BoardZone.Count; int opBoardCount = game.CurrentOpponent.BoardZone.Count; IPlayable spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Fireball")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, minion2)); Assert.Equal(myBoardCount, game.CurrentPlayer.BoardZone.Count); Assert.Equal(opBoardCount - 1, game.CurrentOpponent.BoardZone.Count); }
public void NerubianEgg_FP1_007() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = CardClass.MAGE, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; SabberStoneCore.Model.Entities.IPlayable testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Nerubian Egg")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); SabberStoneCore.Model.Entities.IPlayable spell = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Fireball")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell, testCard)); Assert.Equal(1, game.CurrentOpponent.BoardZone.Count); Assert.Equal("FP1_007t", game.CurrentOpponent.BoardZone[0].Card.Id); }
public void PowerOverwhelming_EX1_316() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.WARLOCK, Player2HeroClass = CardClass.WARLOCK, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Power Overwhelming")); var minion = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion)); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard, minion)); Assert.AreEqual(5, ((Minion)minion).AttackDamage); Assert.AreEqual(5, ((Minion)minion).Health); game.Process(EndTurnTask.Any(game.CurrentPlayer)); Assert.AreEqual(true, minion.ToBeDestroyed); }
public void DragonkinSorcerer_BRM_020() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = CardClass.MAGE, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Dragonkin Sorcerer")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard)); var spell = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Power Word: Shield")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell, testCard)); Assert.AreEqual(1, game.CurrentPlayer.Hand.Triggers.Count); Assert.AreEqual(4, ((Minion)testCard).AttackDamage); Assert.AreEqual(8, ((Minion)testCard).Health); }
public void CloneSameState() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.SHAMAN, Player2HeroClass = CardClass.SHAMAN, FillDecks = true }); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); var clone = game.Clone(); Assert.AreEqual(game.Hash(), clone.Hash()); var spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Lightning Bolt")); var minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar")); var spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Lightning Bolt")); var cSpell1 = Generic.DrawCard(clone.CurrentPlayer, Cards.FromName("Lightning Bolt")); var cSpell2 = Generic.DrawCard(clone.CurrentPlayer, Cards.FromName("Lightning Bolt")); var cMinion1 = Generic.DrawCard(clone.CurrentPlayer, Cards.FromName("Stonetusk Boar")); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell1, game.CurrentOpponent.Hero)); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell2, game.CurrentOpponent.Hero)); game.Process(PlayCardTask.Any(game.CurrentPlayer, minion1)); clone.Process(PlayCardTask.Any(clone.CurrentPlayer, cMinion1)); clone.Process(PlayCardTask.SpellTarget(clone.CurrentPlayer, cSpell2, clone.CurrentOpponent.Hero)); clone.Process(PlayCardTask.SpellTarget(clone.CurrentPlayer, cSpell1, clone.CurrentOpponent.Hero)); var ignored = new GameTag[] { GameTag.LAST_CARD_PLAYED, GameTag.ENTITY_ID }; Assert.AreEqual(game.Hash(ignored), clone.Hash(ignored)); }
public static void CardsTest() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.PRIEST, Player1Deck = new List <Card>() { Cards.FromName("Silence"), Cards.FromName("Power Word: Shield"), Cards.FromName("Murloc Tinyfin"), Cards.FromName("Power Word: Shield") }, Player2HeroClass = CardClass.PRIEST, Shuffle = false, FillDecks = true, FillDecksPredictably = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.Process(PlayCardTask.Any(game.CurrentPlayer, "Murloc Tinyfin")); Console.WriteLine(((Minion)game.CurrentPlayer.BoardZone[0]).Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, "Power Word: Shield", game.CurrentPlayer.BoardZone[0])); Console.WriteLine(((Minion)game.CurrentPlayer.BoardZone[0]).Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, "Silence", game.CurrentPlayer.BoardZone[0])); Console.WriteLine(((Minion)game.CurrentPlayer.BoardZone[0]).Health); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, "Power Word: Shield", game.CurrentPlayer.BoardZone[0])); Console.WriteLine(((Minion)game.CurrentPlayer.BoardZone[0]).Health); ShowLog(game, LogLevel.VERBOSE); Console.WriteLine(game.CurrentOpponent.BoardZone.FullPrint()); //Console.WriteLine(game.CurrentPlayer.HandZone.FullPrint()); //Console.WriteLine(game.CurrentPlayer.DeckZone.FullPrint()); }
public void DragonsBreath_BRM_003() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player2HeroClass = CardClass.MAGE, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Dragon's Breath")); var minion = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar")); game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion)); Assert.AreEqual(1, testCard.Enchants.Count); Assert.AreEqual(5, testCard.Cost); game.Process(HeroPowerTask.Any(game.CurrentPlayer, minion)); Assert.AreEqual(4, testCard.Cost); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard, game.CurrentOpponent.Hero)); Assert.AreEqual(26, game.CurrentOpponent.Hero.Health); }
public void LavaShock_BRM_011() { var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.SHAMAN, Player2HeroClass = CardClass.SHAMAN, FillDecks = true }); game.StartGame(); game.Player1.BaseMana = 5; game.Player2.BaseMana = 5; var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Lava Shock")); var spell = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Ancestral Knowledge")); game.Process(PlayCardTask.Spell(game.CurrentPlayer, spell)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); game.Process(EndTurnTask.Any(game.CurrentPlayer)); Assert.AreEqual(4, game.CurrentPlayer.RemainingMana); game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, testCard, game.CurrentOpponent.Hero)); Assert.AreEqual(4, game.CurrentPlayer.RemainingMana); Assert.AreEqual(28, game.CurrentOpponent.Hero.Health); }
public static int OneRoundRemove(string AICard, List <Card> combo, string comboClass) { if (!CARDCLASS.ContainsKey(comboClass)) { return(-1); } var game = new Game(new GameConfig { StartPlayer = 1, Player1HeroClass = CardClass.MAGE, Player1Deck = new List <Card>() { Cards.FromName(AICard) }, Player2HeroClass = (CardClass)CARDCLASS[comboClass], Player2Deck = new List <Card>(), Shuffle = false, FillDecks = false, FillDecksPredictably = false }); foreach (Card testCard in combo) { game.Player2.DeckCards.Add(testCard); } game.Player1.BaseMana = 10; game.Player2.BaseMana = 10; game.StartGame(); //AI player var MinionAI = (ICharacter)Generic.DrawCard(game.CurrentPlayer, Cards.FromName(AICard)); //generate opponent minion game.Process(PlayCardTask.Minion(game.CurrentPlayer, MinionAI)); //use game.Process(EndTurnTask.Any(game.CurrentPlayer)); //end round switch to our side //Test case foreach (Card testCard in combo) //use combo card one by one { if (testCard.Type.ToString() == "MINION") { var MinionTest = (ICharacter)Generic.DrawCard(game.CurrentPlayer, testCard); //draw game.Process(PlayCardTask.Minion(game.CurrentPlayer, MinionTest)); //use } else //spell or weapon { IPlayable SpellTest = Generic.DrawCard(game.CurrentPlayer, testCard); //draw game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, SpellTest, MinionAI)); //use taget to opponet minion } } /*Program.ShowLog(game, LogLevel.VERBOSE); * Console.WriteLine(game.CurrentOpponent.BoardZone.FullPrint()); * Console.WriteLine(game.CurrentPlayer.BoardZone.FullPrint());*/ int health = game.CurrentOpponent.BoardZone.Health(); return(health); }