Ejemplo n.º 1
0
        public void TestQuestParticipation()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestQuestParticipation"));
            Player aiPlayer = game.Players[0];

            aiPlayer.Behaviour = new Strategy1();

            RescueTheFairMaiden quest = new RescueTheFairMaiden(game); // 3 stages.

            game.CurrentStory = quest;

            //cards
            Lance         lance         = new Lance(game);         //20
            Dagger        dagger        = new Dagger(game);        //5
            Sword         sword         = new Sword(game);         //10
            SirGalahad    sirGalahad    = new SirGalahad(game);    //15
            SirLancelot   sirLancelot   = new SirLancelot(game);   //15
            KingPellinore kingPellinore = new KingPellinore(game); //10
            Mordred       mordred       = new Mordred(game);       //30
            Thieves       thieves       = new Thieves(game);       //5
            Boar          boar          = new Boar(game);          //5

            aiPlayer.Hand.Add(lance);
            aiPlayer.Hand.Add(dagger);
            aiPlayer.Hand.Add(sword);
            aiPlayer.Hand.Add(sirGalahad);
            aiPlayer.Hand.Add(boar);
            aiPlayer.Hand.Add(thieves);
            //hand: lance, dagger, sword, galahad, boar, thieves - not enough weapon/allies
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            aiPlayer.Hand.Add(sirLancelot);
            aiPlayer.Hand.Add(kingPellinore);
            //hand: lance, dagger, sword, galahad, lancelot, pelinore, boar, thieves
            Assert.IsTrue(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            aiPlayer.Hand.Remove(thieves);
            //not enough foes (to discard)
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));
            //2 foes, but mordred has too much bp
            aiPlayer.Hand.Add(mordred);
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));
        }
Ejemplo n.º 2
0
        public void TestQuestParticipation()
        {
            QuestMatch game = ScenarioCreator.GameNoDeal(1);

            game.AttachLogger(new Quest.Core.Logger("TestQuestParticipation"));
            Player aiPlayer = game.Players[0];

            aiPlayer.Behaviour = new Strategy2();

            RescueTheFairMaiden quest = new RescueTheFairMaiden(game); // 3 stages.

            game.CurrentStory = quest;

            // Make player knight, 10 BP.
            aiPlayer.Rank.AddShields(5);

            // Test cards.
            KingArthur  arthur      = new KingArthur(game);  // 10 BP.
            SirLancelot lancelot    = new SirLancelot(game); // 15 BP.
            SirGalahad  galahad     = new SirGalahad(game);  // 15 BP.
            Boar        boar        = new Boar(game);        // 5 BP, should be discarded.
            Thieves     thieves     = new Thieves(game);     // 5 BP, should be discarded.
            BlackKnight blackKnight = new BlackKnight(game); // 25 BP, should not be discarded.
            Excalibur   excalibur   = new Excalibur(game);   // +30 BP.
            Lance       lance       = new Lance(game);       // + 20 BP.

            // Cannot increase for all 3 stages, expect false.
            aiPlayer.Hand.Add(boar);
            aiPlayer.Hand.Add(thieves);
            aiPlayer.Hand.Add(blackKnight);
            aiPlayer.Hand.Add(arthur);
            aiPlayer.Hand.Add(lancelot);
            aiPlayer.Hand.Add(galahad);
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            // Add weapons, expect true.
            aiPlayer.Hand.Add(excalibur);
            aiPlayer.Hand.Add(lance);
            Assert.IsTrue(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));

            // Remove discardable foe less than 25 BP, expect false.
            aiPlayer.Hand.Remove(boar);
            Assert.IsFalse(aiPlayer.Behaviour.ParticipateInQuest(quest, aiPlayer.Hand));
        }