Esempio n. 1
0
        public void AdventureDeckCheck()
        {
            Quest.Core.Logger log  = new Quest.Core.Logger("AdventureDeckCheck");
            QuestMatch        game = ScenarioCreator.GameNoDeal(3);
            AdventureDeck     deck = new AdventureDeck(game);

            Assert.IsTrue(deck.Peek(deck) == "Test Of The Questing Beast");

            for (int i = 0; i < 77; i++)
            {
                deck.Draw();
                if (i == 2)
                {
                    Assert.IsTrue(deck.Peek(deck) == "Test Of Morgan Le Fey");
                }
                if (i == 10)
                {
                    Assert.IsTrue(deck.Peek(deck) == "Thieves");
                }
                if (i == 20)
                {
                    Assert.IsTrue(deck.Peek(deck) == "Saxons");
                }
                if (i == 30)
                {
                    Assert.IsTrue(deck.Peek(deck) == "Robber Knight");
                }
            }
        }
Esempio n. 2
0
    void drawCards(GameObject[] participants)
    {
        AdventureDeck advDeck = GameObject.Find("advdeck").GetComponent <AdventureDeck> ();

        foreach (GameObject i in participants)
        {
            advDeck.Draw().transform.SetParent(i.transform.GetChild(0));
        }
    }
Esempio n. 3
0
        public void TestDraw()
        {
            QuestMatch    game   = ScenarioCreator.EmptyGame();
            AdventureDeck deck   = new AdventureDeck(game);
            Player        player = new Player("Test Player", game);

            player.Draw(deck, 10);
            Assert.AreEqual(player.Hand.Count, 10);
            Assert.AreEqual(deck.Count, deck.DeckSize - 10);
        }
Esempio n. 4
0
 /**
  * Called by Taketurn when player lands on space that entails drawing from the
  * adventure deck. Fate can be used.
  */
 private static void DrawFromDeck()
 {
     if (Moved && ActionNeeded)
     {
         FightDiff    = AdventureDeck.ProduceCard(_startTileName);
         ActionNeeded = false;
     }
     if (!Done && Moved)
     {
         UseFate(FightDiff);
     }
 }
Esempio n. 5
0
        public QuestMatch(Logger logger = null, GameController controller = null)
        {
            this.id            = nextId++;
            this.players       = new List <Player>();
            this.roundEnded    = new List <Player>();
            this.currentPlayer = 0;
            this.storyDeck     = new StoryDeck(this);
            this.adventureDeck = new AdventureDeck(this);
            this.discardPile   = new DiscardPile(this);
            this.currentStory  = null;
            this.logger        = logger;
            this.Log("Creating new Quest match");

            if (controller != null)
            {
                this.controller = controller;
            }
            else
            {
                this.controller = new GameController(new NullQuestMessageHandler(), this);
            }
        }