Esempio n. 1
0
        public override bool MoveNext()
        {
            WaitForCardResponse responseTimer = Current as WaitForCardResponse;

            if (responseTimer != null)
            {
                currentDecision = responseTimer.Decision;
                switch (responseTimer.Decision)
                {
                case Decision.Avoid:
                    currentDecision = Decision.Pending;
                    dodges++;
                    SetCardResponse(player, responseTimer);
                    return(true);

                case Decision.Barrel:
                    currentDecision = Decision.Pending;
                    barrelsUsed++;
                    Current = new DrawEffectCoroutine(playerController);
                    return(true);
                }
            }
            DrawEffectCoroutine drawEffectCoroutine = Current as DrawEffectCoroutine;

            if (drawEffectCoroutine != null)
            {
                Card drawEffectCard = drawEffectCoroutine.DrawEffectCard;
                dodge   = Card.CheckCondition <Barrel>(drawEffectCard);
                dodges += dodge ? 1 : 0;
                Current = GameController.Instance.BarrelEffect(player, drawEffectCard, dodge);
                return(true);
            }
            if (dodges < misses && currentDecision != Decision.TakeHit)
            {
                playerController.EnableMissedsResponse();
                if (barrelsUsed < barrels)
                {
                    playerController.EnableBarrelButton(true);
                }
                Current = new WaitForCardResponse(playerController);
                return(true);
            }
            TakeHit = dodges < misses || currentDecision == Decision.TakeHit;
            playerController.DisableCards();
            return(false);
        }
Esempio n. 2
0
    public override bool MoveNext()
    {
        WaitForCardResponse responseTimer = Current as WaitForCardResponse;

        if (responseTimer != null)
        {
            currentDecision = responseTimer.Decision;
            switch (responseTimer.Decision)
            {
            case Decision.Avoid:
                currentDecision = Decision.Pending;
                dodges++;
                SetCardResponse(responseTimer);
                return(true);

            case Decision.Barrel:
                currentDecision = Decision.Pending;
                barrelsUsed++;
                Current = new DrawEffectCoroutine(character);
                return(true);
            }
        }
        DrawEffectCoroutine drawEffectCoroutine = Current as DrawEffectCoroutine;

        if (drawEffectCoroutine != null)
        {
            Card drawEffectCard = drawEffectCoroutine.DrawEffectCard;
            dodge   = EveryCowboyForHimself.CheckConditionBarrel(drawEffectCard);
            dodges += dodge ? 1 : 0;
            Current = EveryCowboyForHimself.BarrelEffect(character, drawEffectCard);
            return(true);
        }
        if (dodges < misses && currentDecision != Decision.TakeHit)
        {
            Current = new WaitForCardResponse(character);
            return(true);
        }
        TakeHit = dodges < misses || currentDecision == Decision.TakeHit;
        return(false);
    }