示例#1
0
    public void dropOut()
    {
        PlayerController currPlayerCtrl = currQuest.players[currQuest.activePlayer].GetComponent <PlayerController>();
        PlayerModel      player         = currQuest.players[currQuest.activePlayer];
        PlayerView       view           = currQuest.players[currQuest.activePlayer].GetComponent <PlayerView>();


        Debug.Log("[Quest.cs:dropOut] Player " + (game.activePlayer + 1) + " has dropped out of the Test");
        game.view.promptUser("Player " + (game.activePlayer + 1) + " has dropped out at stage " + (currQuest.currStageId + 1));

        if (currQuest.activePlayer > 0)
        {
            currQuest.activePlayer -= 1;
        }
        currQuest.removePlayer(player);

        List <AdventureCard> cardsPlayed = new List <AdventureCard>(cardArea.GetComponentsInChildren <AdventureCard>());

        foreach (AdventureCard card in cardsPlayed)
        {
            currPlayerCtrl.hideCard(card.gameObject);
        }

        view.restoreHiddenCards();
        controller.nextPlayer();
    }
示例#2
0
    void findPassingPlayers()
    {
        List <PlayerModel> models = new List <PlayerModel>(currQuest.players);

        foreach (PlayerModel player in models)
        {
            PlayerController ctrl = player.GetComponent <PlayerController>();
            Debug.Log(currQuest.currStage);
            Debug.Log(player);
            if (compareBP(currQuest.currStage, player))
            {
                Debug.Log("[CombatController.cs:findPassingPlayers] player " + (player.index + 1) + " passed stage " + (currQuest.currStageId + 1));
                player.cardsPlayed4Quest.discardWeapons();
            }
            else
            {
                Debug.Log("[CombatController.cs:findPassingPlayers] player " + (player.index + 1) + " failed stage " + (currQuest.currStageId + 1));
                game.view.promptUser("Player " + (player.index + 1) + " has failed stage " + (currQuest.currStageId + 1));
                currQuest.removePlayer(player);
                player.cardsPlayed4Quest.discardWeaponsNAmours();
                player.cardsPlayed4Quest.Empty();
            }
            ctrl.saveHiddenAllies();
            ctrl.clearHiddenCards();
        }

        if (currQuest.numPlayers == 0)
        {
            controller.endFail();
        }
        else
        {
            controller.nextStage();
        }
    }