public override IEnumerator UsePower(int index = 0)
        {
            IEnumerator coroutine;
            int         powerNumeral = GetPowerNumeral(0, 1);
            string      turnTakerName;

            // Draw a card.
            coroutine = this.GameController.DrawCard(this.HeroTurnTaker);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            // Set up response.
            if (base.TurnTaker.IsHero)
            {
                turnTakerName = this.TurnTaker.Name;
            }
            else
            {
                turnTakerName = this.Card.Title;
            }

            // ReduceDamage isn't technically an accurate trigger, but CancelAction alone causes the numbers to not work well when boosting or reducing, so it has to be kept.
            OnDealDamageStatusEffect onDealDamageStatusEffect = new OnDealDamageStatusEffect(this.CardWithoutReplacements, "PreventResponse", "Whenever " + turnTakerName + " is dealt exactly " + powerNumeral + " damage, prevent that damage.", new TriggerType[] { TriggerType.ReduceDamage, TriggerType.CancelAction }, this.HeroTurnTaker, this.Card, new int[] { powerNumeral });

            onDealDamageStatusEffect.TargetCriteria.IsSpecificCard = this.CharacterCard;
            onDealDamageStatusEffect.CanEffectStack = false;
            onDealDamageStatusEffect.BeforeOrAfter  = BeforeOrAfter.Before;
            onDealDamageStatusEffect.DamageAmountCriteria.EqualTo = powerNumeral;
            onDealDamageStatusEffect.UntilEndOfNextTurn(this.HeroTurnTaker);

            coroutine = this.AddStatusEffect(onDealDamageStatusEffect);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
        public override IEnumerator UsePower(int index = 0)
        {
            string      turnTakerName;
            IEnumerator coroutine;
            int         powerNumeral = this.GetPowerNumeral(0, 1);

            // Draw a card.
            coroutine = this.GameController.DrawCard(this.HeroTurnTaker);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            // Set up heal response.
            if (base.TurnTaker.IsHero)
            {
                turnTakerName = this.TurnTaker.Name;
            }
            else
            {
                turnTakerName = this.Card.Title;
            }
            OnDealDamageStatusEffect onDealDamageStatusEffect = new OnDealDamageStatusEffect(this.CardWithoutReplacements, "HealResponse", "Whenever " + turnTakerName + " is dealt damage, they regain " + powerNumeral + " HP.", new TriggerType[] { TriggerType.DealDamage }, this.HeroTurnTaker, this.Card, new int[] { powerNumeral });

            onDealDamageStatusEffect.TargetCriteria.IsSpecificCard = this.CharacterCard;
            onDealDamageStatusEffect.SourceCriteria.IsSpecificCard = this.CharacterCard;
            onDealDamageStatusEffect.CanEffectStack = true;
            onDealDamageStatusEffect.BeforeOrAfter  = BeforeOrAfter.After;
            onDealDamageStatusEffect.UntilEndOfNextTurn(this.HeroTurnTaker);

            coroutine = this.AddStatusEffect(onDealDamageStatusEffect);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
Esempio n. 3
0
        private IEnumerator ApplyStatusEffects(DealDamageAction dd)
        {
            var target = dd.Target;
            OnDealDamageStatusEffect oddse = new OnDealDamageStatusEffect(this.CardWithoutReplacements, nameof(DealDamageToSelfResponse), $"Until the end of your next turn, when {target.Title} deals another target damage, {target.Title} deals itself 1 psychic damage.", new TriggerType[] { TriggerType.DealDamage }, base.TurnTaker, this.Card);

            oddse.UntilTargetLeavesPlay(target);
            oddse.SourceCriteria.IsSpecificCard    = target;
            oddse.TargetCriteria.IsNotSpecificCard = target;
            oddse.UntilEndOfNextTurn(base.TurnTaker);
            oddse.BeforeOrAfter  = BeforeOrAfter.After;
            oddse.DoesDealDamage = true;
            oddse.DamageAmountCriteria.GreaterThan = 0;
            IEnumerator coroutine = AddStatusEffect(oddse, true);

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