示例#1
0
 public override IEnumerator Play()
 {
     if (base.Card.Location.IsNextToCard)
     {
         //That hero cannot regain HP.
         CannotGainHPStatusEffect cannotGainHPStatusEffect = new CannotGainHPStatusEffect();
         cannotGainHPStatusEffect.TargetCriteria.IsSpecificCard = base.GetCardThisCardIsNextTo();
         cannotGainHPStatusEffect.UntilTargetLeavesPlay(base.Card);
         IEnumerator coroutine = base.AddStatusEffect(cannotGainHPStatusEffect);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine);
         }
     }
     yield break;
 }
示例#2
0
        public override IEnumerator Play()
        {
            //{DocHavoc} deals each target 1 radiant damage.
            List <DealDamageAction> storedDamageResults = new List <DealDamageAction>();

            IEnumerator routine = base.DealDamage(this.CharacterCard, c => c.IsTarget && c.IsInPlayAndHasGameText,
                                                  DamageAmount, DamageType.Radiant, storedResults: storedDamageResults);

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


            // Check non hero targets to see if they took the intended damage
            foreach (DealDamageAction dd in storedDamageResults.Where(dda => !dda.Target.IsHero && dda.DidDealDamage))
            {
                // Apply CannotGainHPStatusEffect until start of this hero's next turn
                CannotGainHPStatusEffect cannotGainHpStatusEffect = new CannotGainHPStatusEffect
                {
                    TargetCriteria = { IsSpecificCard = dd.Target }
                };
                cannotGainHpStatusEffect.UntilStartOfNextTurn(this.TurnTaker);

                IEnumerator statusEffectRoutine = base.AddStatusEffect(cannotGainHpStatusEffect);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(statusEffectRoutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(statusEffectRoutine);
                }
            }
        }
        private IEnumerator CannotGainHPResponse(DealDamageAction dd)
        {
            if (!dd.DidDealDamage || dd.DidDestroyTarget)
            {
                yield break;
            }

            CannotGainHPStatusEffect statusEffect = new CannotGainHPStatusEffect();

            statusEffect.CardSource = Card;
            statusEffect.TargetCriteria.IsSpecificCard = dd.Target;
            statusEffect.UntilStartOfNextTurn(TurnTaker);
            IEnumerator coroutine = AddStatusEffect(statusEffect);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
        public override IEnumerator Play()
        {
            //Until the start of {DrudgeTeam}'s next turn, Non-Villain cards cannot gain HP.
            CannotGainHPStatusEffect statusEffect = new CannotGainHPStatusEffect();

            statusEffect.CardSource = Card;
            statusEffect.TargetCriteria.IsVillain = false;
            statusEffect.UntilStartOfNextTurn(TurnTaker);
            IEnumerator coroutine = AddStatusEffect(statusEffect);

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

            //If Immortal Form is in {DrudgeTeam}'s trash, shuffle it back into his deck.
            Card immortalForm = FindCard(ImmortalFormIdentifier);

            if (!TurnTaker.Trash.HasCard(immortalForm))
            {
                yield break;
            }
            coroutine = GameController.ShuffleCardIntoLocation(DecisionMaker, immortalForm, TurnTaker.Deck, false, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
示例#5
0
        public override IEnumerator UseIncapacitatedAbility(int index)
        {
            switch (index)
            {
            case 0:
            {
                //One player may play a card now.
                IEnumerator coroutine = SelectHeroToPlayCard(DecisionMaker);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                break;
            }

            case 1:
            {
                //Destroy 1 hero ongoing, 1 non-hero ongoing, and 1 environment card.
                IEnumerator coroutine2 = base.GameController.SelectAndDestroyCard(DecisionMaker, new LinqCardCriteria((Card c) => c.IsOngoing && c.IsHero && c.IsInPlay, "hero ongoing"), false, cardSource: GetCardSource());
                IEnumerator coroutine3 = base.GameController.SelectAndDestroyCard(DecisionMaker, new LinqCardCriteria((Card c) => c.IsOngoing && !c.IsHero && c.IsInPlay, "non-hero ongoing"), false, cardSource: GetCardSource());
                IEnumerator coroutine4 = base.GameController.SelectAndDestroyCard(DecisionMaker, new LinqCardCriteria((Card c) => c.IsEnvironment && c.IsInPlay, "environment"), false, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine2));

                    yield return(base.GameController.StartCoroutine(coroutine3));

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

            case 2:
            {
                //Villain targets may not regain HP until the start of your turn.
                CannotGainHPStatusEffect cannotGainHPStatusEffect = new CannotGainHPStatusEffect();
                cannotGainHPStatusEffect.TargetCriteria.IsVillain = true;
                cannotGainHPStatusEffect.UntilStartOfNextTurn(base.TurnTaker);
                IEnumerator coroutine5 = AddStatusEffect(cannotGainHPStatusEffect);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine5));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine5);
                }
                break;
            }
            }
            yield break;
        }