Пример #1
0
    public void foeReveal(ActiveQuest activeQuest)
    {
        if (enemyBP == null)
        {
            enemyBP = createHeaderMessage(panelPosX + panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), " ");
        }
        Destroy(playerBP);
        clearGameObjectArray(cardsToShow);
        clearGameObjectArray(currButtons);
        showCards(activeQuest.getStageWeapons(activeQuest.getCurrentStageNum()), new Vector2(panelPosX + panelWidth / 10, panelPosY), new Vector2(10, 10));
        showCard(activeQuest.getCurrentStage());



        stageWinners    = new GameObject[activeQuest.getPlayerNum() + 1];
        stageWinners[0] = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), "Winners");
        createButtonMessage(panelPosX, panelPosY - panelHeight / 10, "OK");
        for (int i = 1; i < activeQuest.getPlayerNum() + 1; i++)
        {
            stageWinners[i] = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2 - i * (panelHeight / 15), new Vector3(0, 0, 0), activeQuest.getPlayer(i - 1).getName());
        }
    }
    public void gotCardLimitReached(Card [] cards)
    {
        Debug.Log("gotCardLimitReached");
        if (gameState == state.PROSPERITY)
        {
            //players[activePlayerOther].discardCard(cards);
            activePlayerMeta = nextPlayer(activePlayerMeta);
            for (int i = 0; i < cards.Length; i++)
            {
                if (Object.ReferenceEquals(cards[i].GetType(), typeof(Amour)))
                {
                    Debug.Log("Setting amour to inPlay");
                    players[activePlayerOther].addCard(new Card[] { cards[i] }, true);
                }

                players[activePlayerOther].discardCard(new Card[] { cards[i] });
            }
            advDeck.discardCard(cards);
            drawXGeneralNumberOfCards(2, state.PROSPERITY, players);
        }
        if (gameState == state.QUEENSFAVOR)
        {
            //players[activePlayerOther].discardCard(cards);
            for (int i = 0; i < cards.Length; i++)
            {
                if (Object.ReferenceEquals(cards[i].GetType(), typeof(Amour)))
                {
                    Debug.Log("Setting amour to inPlay");
                    players[activePlayerOther].addCard(new Card[] { cards[i] }, true);
                }

                players[activePlayerOther].discardCard(new Card[] { cards[i] });
            }
            advDeck.discardCard(cards);
            drawXGeneralNumberOfCards(2, state.PROSPERITY, tempPlayerArr);
        }
        else if (gameState == state.KINGSCALL)
        {
            Player[] nextPlayers;
            if (tempPlayerArr.Length - 1 > 0)
            {
                nextPlayers = new Player[tempPlayerArr.Length - 1];
                for (int i = 0; i < nextPlayers.Length; i++)
                {
                    nextPlayers[i] = tempPlayerArr[i + 1];
                }
            }
            else
            {
                nextPlayers = null;
            }
            kingsCall(nextPlayers);
        }
        else
        {
            advDeck.discardCard(cards);
            if (activePlayerOther == -1)
            {
                //activeQuest.getSponsor().discardCard(cards);
                for (int i = 0; i < cards.Length; i++)
                {
                    if (Object.ReferenceEquals(cards[i].GetType(), typeof(Amour)))
                    {
                        Debug.Log("Setting amour to inPlay");
                        activeQuest.getSponsor().addCard(new Card[] { cards[i] }, true);
                    }

                    activeQuest.getSponsor().discardCard(new Card[] { cards[i] });
                }
            }
            else
            {
                //activeQuest.getPlayer(activePlayerOther).discardCard(cards);
                for (int i = 0; i < cards.Length; i++)
                {
                    if (Object.ReferenceEquals(cards[i].GetType(), typeof(Amour)))
                    {
                        Debug.Log("Setting amour to inPlay");
                        activeQuest.getPlayer(activePlayerOther).addCard(new Card[] { cards[i] }, true);
                    }

                    activeQuest.getPlayer(activePlayerOther).discardCard(new Card[] { cards[i] });
                }
            }
            userInputState = state.STANDBY;
            if (gameState == state.QUESTSTARTING)
            {
                startQuest();
            }
            else if (gameState == state.QUESTINPROGRESS)
            {
                endStage();
            }
            else if (gameState == state.QUESTWRAPUP)
            {
                endQuest();
            }
        }
    }