예제 #1
0
    public void SetupStoryCardCheck()
    {
        if (drawnStoryCard != null)
        {
            Debug.Log("DRAWN STORY CARD: " + drawnStoryCard.name);

            UIUtil.EmptyPanel(questStagePanel);
            questStageBPTotal.text = "";
            questStageNumber.text  = "";

            //setup quest , tournament or event
            if (drawnStoryCard.type == "Event Card")
            {
                currentEvent = (EventCard)drawnStoryCard;
            }
            else if (drawnStoryCard.type == "Tournament Card")
            {
                userInput.ActivateBooleanCheck("Do you want to participate?");
                currentTournament = (TournamentCard)drawnStoryCard;
            }
            else if (drawnStoryCard.type == "Quest Card")
            {
                //store player that first drew the quest card
                QuestState.questDrawer = currentPlayerIndex;
                userInput.ActivateBooleanCheck("Do you want to sponsor this quest?");
                currentQuest = (QuestCard)drawnStoryCard;
            }

            numIterations = 0;
            UIUtil.AddCardToPanel(UIUtil.CreateUIElement(drawnStoryCard, cardPrefab), questPanel);
            drawnStoryCard = null;
        }
    }
예제 #2
0
    //Check players for 1 or more winners and return them in the winners array
    public static void FindWinners(List <Player> players, List <int> winners, UIInput userInput)
    {
        //check for winners
        for (int i = 0; i < players.Count; i++)
        {
            if (players[i].rankUpCheck(players[i].score, 0))
            {
                //store the index of the winners of the game
                winners.Add(i);
            }
        }

        //create a userPrompt for the winners
        if (winners.Count > 0)
        {
            string winner = "";

            //code for showing winners here
            for (int i = 0; i < winners.Count; i++)
            {
                winner += players[winners[i]].name;
            }

            winner += " Won the Game!!!";

            userInput.ActivateBooleanCheck(winner);
        }
    }