Beispiel #1
0
    public void CardAdditionCheck()
    {
        if (selectedCard != null)
        {
            //all ally cards activated are added to the board and active allies
            if (selectedCard.type == "Ally Card")
            {
                //ally cards always get added to active allies
                AllyCard ally = (AllyCard)selectedCard;
                players[currentPlayerIndex].activeAllies.Add(ally);
                players[currentPlayerIndex].hand.Remove(selectedCard);
                UIUtil.AddCardToPanel(UIUtil.CreateUIElement(selectedCard, cardPrefab), playerAllyPanels[currentPlayerIndex]);
            }
            else
            {
                //check cards for removal from card panel
                bool removedCard = userInput.CheckCard(selectedCard);

                if (removedCard)
                {
                    //removed card from panel So add it back to hand
                    players[currentPlayerIndex].hand.Add(selectedCard);
                    UIUtil.AddCardToPanel(UIUtil.CreateUIElement(selectedCard, cardPrefab), handPanel);
                }
                else
                {
                    bool addToPanel = true;

                    //CLUSTERFUCK
                    addToPanel = EventCheck(QuestCheck(TournamentCheck()));

                    //result
                    if (addToPanel)
                    {
                        //add it into the panel
                        players[currentPlayerIndex].hand.Remove(selectedCard);
                        userInput.AddToUICardPanel(UIUtil.CreateUIElement(selectedCard, cardPrefab));
                    }
                    else
                    {
                        //return it to hand since we didn't delete it from player we are fine
                        UIUtil.AddCardToPanel(UIUtil.CreateUIElement(selectedCard, cardPrefab), handPanel);
                    }
                }
            }

            //maybe we can check for certain cards like mordred here with some state
            selectedCard = null;
        }
    }