示例#1
0
        public void GrimPatron_BRM_019()
        {
            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("Grim Patron"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            var minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1));
            var minion2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Reckless Rocketeer"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, minion1, testCard));
            Assert.AreEqual(2, game.CurrentOpponent.Board.Count);
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, minion2, testCard));
            Assert.AreEqual(1, game.CurrentOpponent.Board.Count);
        }
示例#2
0
        public static void Kazakus()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.DRUID,
                Player1Deck      = new List <Card>()
                {
                },
                Player2HeroClass = CardClass.DRUID,
                Player2Deck      = new List <Card>()
                {
                },
                FillDecks = false
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Kazakus"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard));
            game.Process(ChooseTask.Pick(game.CurrentPlayer, game.CurrentPlayer.Choice.Choices[0]));
            game.Process(ChooseTask.Pick(game.CurrentPlayer, game.CurrentPlayer.Choice.Choices[0]));
            game.Process(ChooseTask.Pick(game.CurrentPlayer, game.CurrentPlayer.Choice.Choices[0]));

            ShowLog(game, LogLevel.VERBOSE);
        }
示例#3
0
        public static void WhileCardTest()
        {
            bool flag = true;
            Game game = null;

            while (flag)
            {
                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("Dirty Rat"));
                var hasMinion = game.CurrentOpponent.HandZone.GetAll.Any(p => p is Minion);
                game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard));

                flag = hasMinion ? 1 == game.CurrentOpponent.BoardZone.Count : 0 == game.CurrentOpponent.BoardZone.Count;
            }

            ShowLog(game, LogLevel.VERBOSE);
            Console.WriteLine(game.CurrentOpponent.HandZone.FullPrint());
            Console.WriteLine(game.CurrentOpponent.BoardZone.FullPrint());
        }
示例#4
0
        public void BlackwingTechnician_BRM_033()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.PRIEST,
                DeckPlayer1      = new List <Card>()
                {
                    Cards.FromName("Azure Drake")
                },
                Player2HeroClass = CardClass.PRIEST,
                DeckPlayer2      = new List <Card>(),
                FillDecks        = false
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Blackwing Technician"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard1));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            var testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Blackwing Technician"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard2));
            Assert.AreEqual(3, ((Minion)testCard1).AttackDamage);
            Assert.AreEqual(5, ((Minion)testCard1).Health);
            Assert.AreEqual(2, ((Minion)testCard2).AttackDamage);
            Assert.AreEqual(4, ((Minion)testCard2).Health);
        }
示例#5
0
        public void MadBomberBasic3()
        {
            var game =
                new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.PRIEST,
                Player2HeroClass = CardClass.HUNTER,
                FillDecks        = true,
                Splitting        = true
            });

            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            game.StartGame();
            var hoarder1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Loot Hoarder"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, hoarder1));
            var hoarder2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Loot Hoarder"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, hoarder2));
            //game.Process(EndTurnTask.Any(game.CurrentPlayer));
            //var hoarder3 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Loot Hoarder"));
            //game.Process(PlayCardTask.Minion(game.CurrentPlayer, hoarder3));
            //var toad1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Huge Toad"));
            //game.Process(PlayCardTask.Minion(game.CurrentPlayer, toad1));
            var bomber1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Mad Bomber"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, bomber1));
            Assert.Equal(12, game.FinalSplits.Count);
            Assert.Equal(44, game.FinalSplits.Sum(p => p.SameState + 1));
        }
示例#6
0
        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);
        }
示例#7
0
        public void VolcanicDrake_BRM_025()
        {
            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("Volcanic Drake"));
            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(6, testCard.Cost);
            game.Process(HeroPowerTask.Any(game.CurrentPlayer, minion));
            Assert.AreEqual(5, testCard.Cost);
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            Assert.AreEqual(6, testCard.Cost);
        }
示例#8
0
        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);
        }
示例#9
0
        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);
        }
示例#10
0
        public void DruidOfTheFlame_BRM_010()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.DRUID,
                Player2HeroClass = CardClass.DRUID,
                FillDecks        = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Druid of the Flame"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard1, 1));
            var testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Druid of the Flame"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard2, 2));
            Assert.AreEqual(2, game.CurrentPlayer.Board.Count);
            Assert.AreEqual(5, ((Minion)game.CurrentPlayer.Board[0]).AttackDamage);
            Assert.AreEqual(2, ((Minion)game.CurrentPlayer.Board[0]).Health);
            Assert.AreEqual(2, ((Minion)game.CurrentPlayer.Board[1]).AttackDamage);
            Assert.AreEqual(5, ((Minion)game.CurrentPlayer.Board[1]).Health);
        }
示例#11
0
        public void CoreRager_BRM_014()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.HUNTER,
                DeckPlayer1      = new List <Card>()
                {
                },
                Player2HeroClass = CardClass.HUNTER,
                FillDecks        = false
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Core Rager"));
            var testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Core Rager"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard1));
            Assert.AreEqual(4, ((Minion)testCard1).Health);
            Assert.AreEqual(4, ((Minion)testCard1).AttackDamage);
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard2));
            Assert.AreEqual(7, ((Minion)testCard2).Health);
            Assert.AreEqual(7, ((Minion)testCard2).AttackDamage);
        }
示例#12
0
        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);
        }
示例#13
0
        public void TwilightWhelp_BRM_004()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.PRIEST,
                DeckPlayer1      = new List <Card>()
                {
                    Cards.FromName("Azure Drake")
                },
                Player2HeroClass = CardClass.PRIEST,
                DeckPlayer2      = new List <Card>(),
                FillDecks        = false
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Twilight Whelp"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard1));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            var testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Twilight Whelp"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard2));
            Assert.AreEqual(3, ((Minion)testCard1).Health);
            Assert.AreEqual(1, ((Minion)testCard2).Health);
        }
示例#14
0
        public void SecretActivation()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.HUNTER,
                Player2HeroClass = CardClass.ROGUE,
                FillDecks        = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Knife Juggler"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1));
            var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Snake Trap"));

            game.Process(PlayCardTask.Spell(game.CurrentPlayer, testCard));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            var minion2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, minion2, minion1));
            Assert.Equal(game.CurrentOpponent.Hero.Health > 27 ? 2 : 1, ((Minion)minion1).Health);
        }
示例#15
0
        static void CloneAdapt()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.DRUID,
                Player2HeroClass = CardClass.DRUID,
                FillDecks        = true
            });

            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            game.StartGame();

            var minion = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Elder Longneck"));
            var clone1 = game.Clone();
            var clone2 = game.Clone();
            var clone3 = game.Clone();
            var clone4 = game.Clone();

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[4]));
            game.Process(ChooseTask.Pick(game.CurrentPlayer, game.CurrentPlayer.Choice.Choices[0]));

            clone1.Process(PlayCardTask.Minion(clone1.CurrentPlayer, clone1.CurrentPlayer.HandZone[4]));
            clone1.Process(ChooseTask.Pick(clone1.CurrentPlayer, clone1.CurrentPlayer.Choice.Choices[0]));

            clone2.Process(PlayCardTask.Minion(clone2.CurrentPlayer, clone2.CurrentPlayer.HandZone[4]));
            clone2.Process(ChooseTask.Pick(clone2.CurrentPlayer, clone2.CurrentPlayer.Choice.Choices[0]));

            clone3.Process(PlayCardTask.Minion(clone3.CurrentPlayer, clone3.CurrentPlayer.HandZone[4]));
            clone3.Process(ChooseTask.Pick(clone3.CurrentPlayer, clone3.CurrentPlayer.Choice.Choices[0]));

            clone4.Process(PlayCardTask.Minion(clone4.CurrentPlayer, clone4.CurrentPlayer.HandZone[4]));
            clone4.Process(ChooseTask.Pick(clone4.CurrentPlayer, clone4.CurrentPlayer.Choice.Choices[0]));
        }
示例#16
0
        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);
        }
示例#17
0
        public void SolemnVigil_BRM_001()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.PALADIN,
                Player2HeroClass = CardClass.PALADIN,
                FillDecks        = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Solemn Vigil"));
            var minion1  = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1));
            Assert.AreEqual(1, testCard.Enchants.Count);
            Assert.AreEqual(5, testCard.Cost);
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            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(5, testCard.Cost);
            Assert.AreEqual(6, game.CurrentPlayer.Hand.Count);
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, minion1, minion2));
            Assert.AreEqual(3, testCard.Cost);
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, testCard));
            Assert.AreEqual(7, game.CurrentPlayer.Hand.Count);
        }
示例#18
0
        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);
        }
示例#19
0
        public void BasicHealthAuraTest1()
        {
            var game =
                new Game(new GameConfig
            {
                StartPlayer          = 1,
                Player1HeroClass     = CardClass.PALADIN,
                Player2HeroClass     = CardClass.MAGE,
                FillDecks            = true,
                FillDecksPredictably = true
            });

            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;

            game.StartGame();

            IPlayable minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stormwind Champion"));
            IPlayable minion2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stormwind Champion"));
            IPlayable minion3 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Shattered Sun Cleric"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1));             // 6/6

            game.CurrentPlayer.UsedMana = 0;

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2));             // 7/7

            game.CurrentPlayer.UsedMana = 0;

            game.Process(PlayCardTask.MinionTarget(game.CurrentPlayer, minion3, minion2));

            game.CurrentPlayer.UsedMana = 0;

            game.Process(EndTurnTask.Any(game.CurrentPlayer));                  // (7/7), (8/8), (5/4)

            IPlayable spell1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Flamestrike"));

            game.Process(PlayCardTask.Spell(game.CurrentPlayer, spell1));               // (7/3), (8/4)

            game.CurrentPlayer.UsedMana = 0;

            IPlayable spell2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Arcane Explosion"));

            game.Process(PlayCardTask.Spell(game.CurrentPlayer, spell2));


            IPlayable spell3 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Arcane Explosion"));

            game.Process(PlayCardTask.Spell(game.CurrentPlayer, spell3));

            Assert.Equal(2, ((ICharacter)minion2).Health);              // (7/1), (8/2)

            IPlayable spell4 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Arcane Explosion"));

            game.Process(PlayCardTask.Spell(game.CurrentPlayer, spell4));

            Assert.Equal(1, ((ICharacter)minion2).Health);              // (7/1)
            Assert.Equal(Zone.PLAY, ((ICharacter)minion2).Zone.Type);
        }
示例#20
0
        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);
        }
示例#21
0
        private static void ChooseOneTest()
        {
            var game =
                new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.DRUID,
                Player1Deck      = new List <Card>()
                {
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Bloodfen Raptor"),
                    Cards.FromName("Raven Idol"),
                    Cards.FromName("Living Roots"),
                    Cards.FromName("Druid of the Saber"),
                    Cards.FromName("Wrath"),
                    Cards.FromName("Power of the Wild"),
                },
                Player2HeroClass = CardClass.DRUID,
                Player2Deck      = new List <Card>()
                {
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Bloodfen Raptor"),
                    Cards.FromName("Raven Idol"),
                    Cards.FromName("Living Roots"),
                    Cards.FromName("Druid of the Saber"),
                    Cards.FromName("Wrath"),
                    Cards.FromName("Power of the Wild"),
                },
                SkipMulligan = true,
                Shuffle      = false,
                FillDecks    = true
            });

            game.StartGame();
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            var options = game.CurrentPlayer.Options();

            Console.WriteLine($" *** - {game.CurrentPlayer.Name} options on {game.Turn}. - ***");
            options.ForEach(p => Console.WriteLine(p.FullPrint()));
            Console.WriteLine($" *** - PowerOptions - ***");
            Console.WriteLine(PowerOptionsBuilder.AllOptions(game, options)?.Print());
            //ShowLog(game, LogLevel.VERBOSE);
        }
示例#22
0
        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);
        }
示例#23
0
        public void SecretActivation()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer          = 1,
                Player1HeroClass     = CardClass.HUNTER,
                Player2HeroClass     = CardClass.ROGUE,
                FillDecks            = true,
                FillDecksPredictably = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;

            IPlayable minion1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Knife Juggler"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion1));
            IPlayable testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Snake Trap"));             // Spawns 3

            game.Process(PlayCardTask.Spell(game.CurrentPlayer, testCard));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));

            IPlayable minion2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Stonetusk Boar"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, minion2));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, minion2, minion1));

            Assert.Equal(4, game.CurrentOpponent.BoardZone.Count);
            if (game.CurrentPlayer.BoardZone.Count == 0)
            {
                // Minion was destroyed, so it's moved to graveyard with tags reset.
                Assert.Equal(1, game.CurrentPlayer.GraveyardZone.Count);
                Assert.Equal(game.CurrentOpponent.Hero.BaseHealth, game.CurrentOpponent.Hero.Health);
                Assert.Equal(game.CurrentPlayer.Hero.BaseHealth - 2, game.CurrentPlayer.Hero.Health);
            }
            else
            {
                // Minion was NOT destroyed, so it continued it's attack.
                Assert.Equal(0, game.CurrentPlayer.GraveyardZone.Count);
                Assert.Equal(game.CurrentOpponent.Hero.BaseHealth - 1, game.CurrentOpponent.Hero.Health);
                Assert.Equal(game.CurrentPlayer.Hero.BaseHealth - 3, game.CurrentPlayer.Hero.Health);
            }
        }
示例#24
0
        public void BlackwingCorruptor_BRM_034()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.PRIEST,
                DeckPlayer1      = new List <Card>()
                {
                    Cards.FromName("Azure Drake"),
                    Cards.FromName("Blackwing Corruptor"),
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Bloodfen Raptor"),
                    Cards.FromName("Bloodfen Raptor")
                },
                Player2HeroClass = CardClass.PRIEST,
                DeckPlayer2      = new List <Card>()
                {
                    Cards.FromName("Blackwing Corruptor"),
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Bloodfen Raptor"),
                    Cards.FromName("Bloodfen Raptor")
                },
                FillDecks = false,
                Shuffle   = false
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Blackwing Corruptor"));

            game.Process(PlayCardTask.MinionTarget(game.CurrentPlayer, testCard1, game.CurrentOpponent.Hero));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            var testCard2 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Blackwing Corruptor"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard2));
            Assert.AreEqual(1, game.Player1.Board.Count);
            Assert.AreEqual(1, game.Player2.Board.Count);
            Assert.AreEqual(30, game.Player1.Hero.Health);
            Assert.AreEqual(27, game.Player2.Hero.Health);
        }
示例#25
0
        public void FireguardDestroyer_BRM_012()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.SHAMAN,
                Player2HeroClass = CardClass.SHAMAN,
                FillDecks        = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Fireguard Destroyer"));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard));
            Assert.AreEqual(true, ((Minion)testCard).AttackDamage >= 4);
            Assert.AreEqual(true, ((Minion)testCard).AttackDamage < 8);
        }
示例#26
0
		public void MadBomberBasic1()
		{
			var game =
				new Game(new GameConfig
				{
					StartPlayer = 1,
					Player1HeroClass = CardClass.PRIEST,
					Player2HeroClass = CardClass.HUNTER,
					FillDecks = true,
					Splitting = true
				});
			game.Player1.BaseMana = 10;
			game.Player2.BaseMana = 10;
			game.StartGame();
			IPlayable bomber1 = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Mad Bomber"));
			game.Process(PlayCardTask.Minion(game.CurrentPlayer, bomber1));
			Assert.Equal(4, game.FinalSplits.Count);
			Assert.Equal(8, game.FinalSplits.Sum(p => p.SameState));
		}
示例#27
0
        public void Nefarian_BRM_030()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.MAGE,
                Player2HeroClass = CardClass.DRUID,
                FillDecks        = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            var testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Nefarian"));

            Assert.AreEqual(5, game.CurrentPlayer.Hand.Count);
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard));
            Assert.AreEqual(6, game.CurrentPlayer.Hand.Count);
            Assert.AreEqual(CardClass.DRUID, game.CurrentPlayer.Hand[5].Card.Class);
            Assert.AreEqual(CardClass.DRUID, game.CurrentPlayer.Hand[4].Card.Class);
        }
示例#28
0
        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);
        }
示例#29
0
        public void SecretOrderOfPlay()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.MAGE,
                Player1Deck      = new List <Card>()
                {
                    Cards.FromName("Vaporize"),
                    Cards.FromName("Ice Barrier"),
                    Cards.FromName("Stonetusk Boar")
                },
                Player2HeroClass = CardClass.HUNTER,
                Player2Deck      = new List <Card>()
                {
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Freezing Trap"),
                    Cards.FromName("Explosive Trap")
                },
                Shuffle              = false,
                FillDecks            = true,
                FillDecksPredictably = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Vaporize"));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Ice Barrier"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(8, game.CurrentOpponent.Hero.Armor);
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Freezing Trap"));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Explosive Trap"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(30, game.CurrentOpponent.Hero.Health);
        }
示例#30
0
        public static void CardsTest()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.PRIEST,
                Player1Deck      = new List <Card>
                {
                    Cards.FromName("Murloc Raider"),
                    Cards.FromName("Murloc Raider"),
                    Cards.FromName("Murloc Tidehunter"),
                    Cards.FromName("Murloc Tidehunter"),
                    Cards.FromName("Herald Volazj"),
                },
                Player2HeroClass = CardClass.PRIEST,
                FillDecks        = false,
                Shuffle          = false
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));             // Murloc Raider
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));             // Murloc Raider
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));             // Murloc Tidehunter
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));             // Murloc Tidehunter
            game.Process(EndTurnTask.Any(game.CurrentPlayer));

            game.Process(EndTurnTask.Any(game.CurrentPlayer));

            game.Process(PlayCardTask.Minion(game.CurrentPlayer, game.CurrentPlayer.HandZone[0]));             // Herald Volazj

            ShowLog(game, LogLevel.VERBOSE);

            Console.WriteLine(game.CurrentPlayer.BoardZone.FullPrint());
            Console.WriteLine(game.CurrentPlayer.HandZone.FullPrint());
            Console.WriteLine(game.CurrentPlayer.DeckZone.FullPrint());
        }