Exemple #1
0
    public bool TournamentCheck()
    {
        bool addToPanel = true;

        if (currentTournament != null)
        {
            // we are in a tournament check for weapon, amour cards allies are always added
            if (selectedCard.type == "Weapon Card")
            {
                for (int i = 0; i < userInput.cardPrompt.selectedCards.Count; i++)
                {
                    if (userInput.cardPrompt.selectedCards[i].name == selectedCard.name)
                    {
                        //duplicate exists cannot add it in
                        addToPanel = false;
                    }
                }
            }
            else if (selectedCard.type == "Amour Card")
            {
                //check for any amours already played
                if (!GameUtil.AnyAmours(TournamentState.undiscardedCards[currentPlayerIndex]))
                {
                    addToPanel = true;
                }
                else
                {
                    addToPanel = false;
                }

                //check amours at the moment
                for (int i = 0; i < userInput.cardPrompt.selectedCards.Count; i++)
                {
                    if (userInput.cardPrompt.selectedCards[i].type == "Amour Card")
                    {
                        //more than one amour cannot add it
                        addToPanel = false;
                    }
                }
            }
            else
            {
                // not weapon amour or ally
                return(false);
            }
        }

        return(addToPanel);
    }
Exemple #2
0
    public bool QuestCheck(bool result)
    {
        bool addToPanel = result;

        if (currentQuest != null)
        {
            //if it is the sponsor check that he added cards properly
            if (players[currentPlayerIndex].sponsoring)
            {
                if (GameUtil.AnyTests(userInput.cardPrompt.selectedCards))
                {
                    addToPanel = false;
                }
                else if (selectedCard.type == "Test Card")
                {
                    //check that it is the only card in the panel and do not allow him to any more cards
                    if (userInput.cardPrompt.selectedCards.Count > 0)
                    {
                        addToPanel = false;
                    }
                    else
                    {
                        addToPanel = true;
                    }
                }
                else if (selectedCard.type == "Foe Card")
                {
                    if (!GameUtil.AnyFoes(userInput.cardPrompt.selectedCards))
                    {
                        addToPanel = true;
                    }
                    else
                    {
                        addToPanel = false;
                    }
                }
                else if (selectedCard.type == "Weapon Card")
                {
                    // we have a weapon card which needs a special check
                    for (int i = 0; i < userInput.cardPrompt.selectedCards.Count; i++)
                    {
                        if (userInput.cardPrompt.selectedCards[i].name == selectedCard.name)
                        {
                            //duplicate exists cannot add it in
                            addToPanel = false;
                            break;
                        }
                    }

                    //if no duplication check if there is a foe in there
                    if (addToPanel)
                    {
                        addToPanel = GameUtil.AnyFoes(userInput.cardPrompt.selectedCards);
                    }
                }
                else
                {
                    addToPanel = false;
                }
            }
            else if (players[currentPlayerIndex].participating)
            {
                //only allowed weapon and amour cards
                if (selectedCard.type == "Weapon Card")
                {
                    for (int i = 0; i < userInput.cardPrompt.selectedCards.Count; i++)
                    {
                        if (userInput.cardPrompt.selectedCards[i].name == selectedCard.name)
                        {
                            //duplicate exists cannot add it in
                            addToPanel = false;
                            break;
                        }
                    }
                }
                else if (selectedCard.type == "Amour Card")
                {
                    //MAYBEEEEEE NEEEEEEDDSSSSSSS A CHANGEEEEE
                    //check for any amours already played
                    if (!GameUtil.AnyAmours(QuestState.amours[currentPlayerIndex]))
                    {
                        addToPanel = true;
                    }
                    else
                    {
                        addToPanel = false;
                    }

                    //check for amours played at this instance
                    for (int i = 0; i < userInput.cardPrompt.selectedCards.Count; i++)
                    {
                        if (userInput.cardPrompt.selectedCards[i].type == "Amour Card")
                        {
                            //more than one amour cannot add it
                            addToPanel = false;
                            break;
                        }
                    }
                }
                else if (selectedCard.type == "Foe Card")
                {
                    if (QuestState.stages != null)
                    {
                        if (QuestState.stages[QuestState.currentStage] != null)
                        {
                            if (QuestState.stages[QuestState.currentStage][0] != null)
                            {
                                if (QuestState.stages[QuestState.currentStage][0].type == "Test Card")
                                {
                                    addToPanel = true;
                                }
                                else
                                {
                                    addToPanel = false;
                                }
                            }
                            else
                            {
                                addToPanel = false;
                            }
                        }
                        else
                        {
                            addToPanel = false;
                        }
                    }
                    else
                    {
                        addToPanel = false;
                    }
                }
                else
                {
                    // not weapon amour or ally
                    addToPanel = false;
                }
            }
        }

        return(addToPanel);
    }