Exemplo n.º 1
0
    public bool StoryCardDone()
    {
        if (isDoneStoryEvent)
        {
            //discard story card into story discard pile
            if (currentEvent != null)
            {
                List <Card> cards = new List <Card>();
                cards.Add(currentEvent);
                GameUtil.DiscardCards(storyDeck, cards, storyDeckDiscardPileUIButton);
                // storyDeckDiscardPileUIButton.myCard = currentEvent;
                //storyDeckDiscardPileUIButton.ChangeTexture();
                //storyDeck.discard.Add(currentEvent);
            }
            else if (currentQuest != null)
            {
                List <Card> cards = new List <Card>();
                cards.Add(currentQuest);
                GameUtil.DiscardCards(storyDeck, cards, storyDeckDiscardPileUIButton);
                //storyDeckDiscardPileUIButton.myCard = currentQuest;
                //storyDeckDiscardPileUIButton.ChangeTexture();
                //storyDeck.discard.Add(currentQuest);
            }
            else if (currentTournament != null)
            {
                List <Card> cards = new List <Card>();
                cards.Add(currentTournament);
                GameUtil.DiscardCards(storyDeck, cards, storyDeckDiscardPileUIButton);
                //storyDeckDiscardPileUIButton.myCard = currentTournament;
                //storyDeckDiscardPileUIButton.ChangeTexture();
                //storyDeck.discard.Add(currentTournament);
            }

            isDoneStoryEvent  = false;
            currentEvent      = null;
            currentQuest      = null;
            currentTournament = null;

            //reset players participation
            GameUtil.ResetPlayers(players);
            UIUtil.EmptyPanel(questPanel);
            System.Array.Clear(queriedCards, 0, queriedCards.Length);

            //reset turn to draw new story card
            drawStoryCard = true;
            GameUtil.ToggleDeckAnimation(storyDeckUIButton, drawStoryCard);
            userInput.DeactivateUI();      // just in case
            UIUtil.UpdatePlayerTurn(this); // go to next turn

            return(true);
        }

        return(false);
    }