public override bool MoveNext()
        {
            WaitForClickChoice waitForPhaseOne = Current as WaitForClickChoice;

            if (waitForPhaseOne != null)
            {
                cards--;
                switch (waitForPhaseOne.Decision)
                {
                case Decision.Deck:
                    player.Draw();
                    break;

                case Decision.Player:
                    int targetPlayer = waitForPhaseOne.Player;
                    availablePlayers.Remove(targetPlayer);
                    Current = GameController.Instance.PimPamPum(playerNumber, targetPlayer);
                    return(true);
                }
            }
            if (availablePlayers.Count > 0 && cards > 0)
            {
                GameController.Instance.SetPhaseOnePlayerClickable(playerNumber, availablePlayers);
                Current = new WaitForClickChoice(player);
                return(true);
            }
            player.Draw(cards);
            return(false);
        }
Esempio n. 2
0
        public void CheckMurder(int murderer, int killed)
        {
            Role killedRole = playerControllers[killed].Role;

            if (killedRole == Role.Sheriff)
            {
                int alone = PlayerStandingAlone;
                PlayerController alonePc = playerControllers[alone];
                if (PlayersAlive == 1 && alonePc.Role == Role.Renegade)
                {
                    Win(alone);
                }
                else
                {
                    Win(Team.Outlaw);
                }
            }
            else if (!SheriffFoesAlive)
            {
                Win(Team.Law);
            }
            else if (murderer != PimPamPumConstants.NoOne)
            {
                PlayerController pcMurderer = playerControllers[murderer];
                if (killedRole == Role.Outlaw)
                {
                    pcMurderer.Draw(3);
                }
                else if (killedRole == Role.Deputy && pcMurderer.Role == Role.Sheriff)
                {
                    pcMurderer.DiscardAll();
                }
            }
        }