private IEnumerator DiscardResponse(DiscardCardAction discardCard)
        {
            List <MoveCardAction> storedResults = new List <MoveCardAction>();
            IEnumerator           coroutine     = this.GameController.DiscardTopCard(this.HeroTurnTaker.Deck, storedResults, cardSource: this.GetCardSource());

            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
Esempio n. 2
0
        private IEnumerator DiscardCardResponse(DiscardCardAction arg)
        {
            SetCardPropertyToTrueIfRealAction(FirstTimeDiscard);
            IEnumerator coroutine = DrawCard(hero: HeroTurnTaker, optional: true);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }

            yield break;
        }
Esempio n. 3
0
        private IEnumerator HeroDiscardedResponse(DiscardCardAction dca)
        {
            //{Screech} deals that Target 1 Irreducible Sonic Damage.
            SetCardPropertyToTrueIfRealAction(FirstTimeDiscardKey);
            HeroTurnTakerController httc = dca.HeroTurnTakerController;
            Card        target           = httc.CharacterCard;
            IEnumerator coroutine;

            if (httc.HasMultipleCharacterCards)
            {
                List <SelectCardDecision> storedDecision = new List <SelectCardDecision>();
                DealDamageAction          gameAction     = new DealDamageAction(GetCardSource(), null, null, 1, DamageType.Sonic, isIrreducible: true);
                coroutine = GameController.SelectCardAndStoreResults(DecisionMaker, SelectionType.DealDamage, new LinqCardCriteria((Card c) => c.Owner == httc.TurnTaker && c.IsCharacter && !c.IsIncapacitatedOrOutOfGame, $"active {httc.TurnTaker.Name} heroes"), storedDecision, false, gameAction: gameAction, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                SelectCardDecision selectCardDecision = storedDecision.FirstOrDefault();
                if (DidSelectCard(storedDecision))
                {
                    target = GetSelectedCard(storedDecision);
                }
            }

            coroutine = DealDamage(CharacterCard, target, 1, DamageType.Sonic, isIrreducible: true, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
Esempio n. 4
0
        public override IEnumerator UseIncapacitatedAbility(int index)
        {
            switch (index)
            {
            case 0:
            {
                //One hero may deal himself 2 toxic damage to draw 2 cards now.

                //Select a Hero
                List <SelectCardDecision> storedHero;
                storedHero = new List <SelectCardDecision>();
                IEnumerator coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.DealDamageSelf, new LinqCardCriteria((Card c) => c.IsInPlayAndHasGameText && c.IsHero && c.IsCharacter && !c.IsIncapacitatedOrOutOfGame, "hero", false, false, null, null, false), storedHero, false, false, null, true, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                SelectCardDecision selectCardDecision = storedHero.FirstOrDefault <SelectCardDecision>();

                if (selectCardDecision != null && selectCardDecision.SelectedCard != null)
                {
                    //Ask hero if they want to deal damage to themselves
                    Card heroCard = selectCardDecision.SelectedCard;
                    HeroTurnTakerController hero          = base.FindHeroTurnTakerController(heroCard.Owner.ToHero());
                    List <DealDamageAction> storedResults = new List <DealDamageAction>();
                    Card thisCard = this.Card;

                    IEnumerator coroutine2 = base.GameController.DealDamageToSelf(hero, (Card c) => c == heroCard, 2, DamageType.Toxic, false, storedResults, true, null, null, base.GetCardSource(null));
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine2));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine2);
                    }
                    DealDamageAction dealDamageAction = storedResults.FirstOrDefault <DealDamageAction>();
                    if (dealDamageAction != null && dealDamageAction.CardSource != null)
                    {
                        //if they did deal damage to themselves, they draw 2 cards
                        IEnumerator coroutine3 = base.DrawCards(hero, 2, false, false, null, true, null);
                        if (base.UseUnityCoroutines)
                        {
                            yield return(base.GameController.StartCoroutine(coroutine3));
                        }
                        else
                        {
                            base.GameController.ExhaustCoroutine(coroutine3);
                        }
                    }
                    hero          = null;
                    storedResults = null;
                }
                yield break;
            }

            case 1:
            {
                //One hero may discard up to 3 cards, then regain 2 HP for each card discarded.

                //Select hero to discard cards
                List <DiscardCardAction> storedResult = new List <DiscardCardAction>();
                IEnumerator coroutine = base.GameController.SelectHeroToDiscardCards(this.DecisionMaker, 0, new int?(3), false, false, false, null, null, null, storedResult, null, false, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                int numCardsDiscarded = storedResult.Count <DiscardCardAction>();
                if (numCardsDiscarded > 0)
                {
                    //Have selected hero gain HP equal to 2 times the number of cards discarded
                    DiscardCardAction discardCardAction = storedResult.FirstOrDefault <DiscardCardAction>();
                    IEnumerator       coroutine2        = base.GameController.GainHP(discardCardAction.HeroTurnTakerController.CharacterCard, new int?(numCardsDiscarded * 2), null, null, base.GetCardSource(null));
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine2));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine2);
                    }
                    discardCardAction = null;
                }
                else
                {
                    //no cards were discarded, send message to inform player of result
                    IEnumerator coroutine3 = base.GameController.SendMessageAction("No cards were discarded, so no HP is gained.", Priority.Medium, base.GetCardSource(null), null, false);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine3));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine3);
                    }
                }
                break;
            }

            case 2:
            {
                //Select a hero target. Increase damage dealt by that target by 3 and increase damage dealt to that target by 2 until the start of your next turn.

                //Select a hero
                List <SelectCardDecision> storedResults = new List <SelectCardDecision>();
                IEnumerator coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.IncreaseDamage, new LinqCardCriteria((Card c) => !c.IsIncapacitatedOrOutOfGame && c.IsHeroCharacterCard, "hero character", true, false, null, null, false), storedResults, false, false, null, true, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                SelectCardDecision selectCardDecision = storedResults.FirstOrDefault <SelectCardDecision>();
                if (selectCardDecision != null && selectCardDecision.SelectedCard != null)
                {
                    //Until start of turn, increase damage dealt by that selected card by 3
                    IncreaseDamageStatusEffect increaseDamageDealtStatusEffect = new IncreaseDamageStatusEffect(3);
                    increaseDamageDealtStatusEffect.SourceCriteria.IsSpecificCard = selectCardDecision.SelectedCard;
                    increaseDamageDealtStatusEffect.UntilStartOfNextTurn(base.TurnTaker);
                    IEnumerator coroutine2 = base.AddStatusEffect(increaseDamageDealtStatusEffect, true);

                    //Until start of turn, increase damage dealt to that selected card by 2
                    IncreaseDamageStatusEffect increaseDamageTakenStatusEffect = new IncreaseDamageStatusEffect(2);
                    increaseDamageTakenStatusEffect.TargetCriteria.IsSpecificCard = selectCardDecision.SelectedCard;
                    increaseDamageTakenStatusEffect.UntilStartOfNextTurn(base.TurnTaker);
                    IEnumerator coroutine3 = base.AddStatusEffect(increaseDamageTakenStatusEffect, true);

                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine2));

                        yield return(base.GameController.StartCoroutine(coroutine3));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine2);
                        base.GameController.ExhaustCoroutine(coroutine3);
                    }
                }
                break;
            }
            }
            yield break;
        }