Пример #1
0
        private IEnumerator SpecialActionEvent()
        {
            Card one = Hand[firstCard];
            Card two = Hand[secondCard];

            EnableConfirmOptions(one, two);
            WaitForClickChoice clickChoice = new WaitForClickChoice(this, Decision.Cancel);

            yield return(clickChoice);

            EnableCancelButton(false);
            GameController.Instance.DisablePhaseOneClickable(PlayerNumber);
            if (clickChoice.Decision != Decision.Cancel)
            {
                DiscardCardFromHand(firstCard);
                if (firstCard < secondCard)
                {
                    secondCard--;
                }
                DiscardCardFromHand(secondCard);
                yield return(SpecialAction(clickChoice.Player));

                StopDiscarding();
            }
            else
            {
                StopDiscarding(!clickChoice.TimeUp);
            }
        }
        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);
        }
Пример #3
0
        protected override IEnumerator DrawPhase1()
        {
            if (GameController.Instance.SetPhaseOnePlayerHandsClickable(PlayerNumber))
            {
                WaitForClickChoice waitForPhaseOneChoice = new WaitForClickChoice(this);
                yield return(waitForPhaseOneChoice);

                switch (waitForPhaseOneChoice.Decision)
                {
                case Decision.Deck:
                    yield return(base.DrawPhase1());

                    break;

                case Decision.Player:
                    GameController.Instance.StealCard(PlayerNumber, waitForPhaseOneChoice.Player);
                    Draw();
                    break;
                }
            }
            else
            {
                yield return(base.DrawPhase1());
            }
        }
Пример #4
0
        protected override IEnumerator DrawPhase1()
        {
            if (GameController.Instance.SetPhaseOnePlayerPropertiesClickable(PlayerNumber))
            {
                WaitForClickChoice waitForPhaseOneChoice = new WaitForClickChoice(this);
                yield return(waitForPhaseOneChoice);

                switch (waitForPhaseOneChoice.Decision)
                {
                case Decision.Deck:
                    yield return(base.DrawPhase1());

                    break;

                case Decision.Player:
                    int targetPlayer = waitForPhaseOneChoice.Player;
                    switch (waitForPhaseOneChoice.Drop)
                    {
                    case Drop.Properties:
                        GameController.Instance.StealProperty(PlayerNumber, targetPlayer, waitForPhaseOneChoice.CardIndex);
                        break;

                    case Drop.Weapon:
                        GameController.Instance.StealWeapon(PlayerNumber, targetPlayer);
                        break;
                    }
                    break;
                }
            }
            else
            {
                yield return(base.DrawPhase1());
            }
        }
Пример #5
0
        protected override IEnumerator DrawPhase1()
        {
            if (GameController.HasDiscardStackCards)
            {
                GameController.Instance.SetPhaseOneDiscardClickable(PlayerNumber);
                WaitForClickChoice phaseOneChoice = new WaitForClickChoice(this);
                yield return(phaseOneChoice);

                switch (phaseOneChoice.Decision)
                {
                case Decision.Deck:
                    yield return(base.DrawPhase1());

                    break;

                case Decision.Discard:
                    Card discard = GameController.Instance.GetDiscardTopCard();
                    AddCard(discard);
                    Draw();
                    break;
                }
            }
            else
            {
                yield return(base.DrawPhase1());
            }
        }