Exemple #1
0
        public override IEnumerator UsePower(int index = 0)
        {
            //==============================================================
            // Select a target, at the start of your next turn,
            // {TangoOne} deals that target 3 projectile damage.
            //==============================================================
            int numDamage = GetPowerNumeral(0, PowerDamageToDeal);
            IEnumerable <Card>          targets       = GameController.FindTargetsInPlay();
            List <SelectTargetDecision> storedResults = new List <SelectTargetDecision>();
            IEnumerator coroutine = GameController.SelectTargetAndStoreResults(DecisionMaker, targets, storedResults,
                                                                               damageSource: CharacterCard, damageAmount: card => numDamage, damageType: DamageType.Projectile,
                                                                               selectionType: SelectionType.SelectTargetNoDamage, cardSource: GetCardSource());

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

            Card target = storedResults.FirstOrDefault()?.SelectedCard;

            if (target != null)
            {
                OnPhaseChangeStatusEffect effect = new OnPhaseChangeStatusEffect(this.CardWithoutReplacements,
                                                                                 nameof(StartOfTurnDealDamageResponse),
                                                                                 $"{base.Card.Title} will deal {PowerDamageToDeal} projectile damage to {target.Title} at the start of her next turn",
                                                                                 new[] { TriggerType.DealDamage }, this.Card);
                effect.UntilEndOfNextTurn(base.HeroTurnTaker);
                effect.TurnTakerCriteria.IsSpecificTurnTaker = base.HeroTurnTaker;
                effect.UntilTargetLeavesPlay(target);
                effect.TurnPhaseCriteria.Phase = Phase.Start;
                effect.BeforeOrAfter           = BeforeOrAfter.After;
                effect.CanEffectStack          = true;
                effect.CardSource     = this.Card;
                effect.NumberOfUses   = 1;
                effect.DoesDealDamage = true;
                effect.SetPowerNumeralsArray(new int[] { numDamage });

                IEnumerator addStatusEffectRoutine = base.GameController.AddStatusEffect(effect, true, GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(addStatusEffectRoutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(addStatusEffectRoutine);
                }
            }
        }
        public override IEnumerator UsePower(int index = 0)
        {
            //Increase damage dealt by {Cricket} during your next turn by 1. {Cricket} may deal 1 target 1 sonic damage.
            int increaseNumeral = GetPowerNumeral(0, 1);
            int targetNumeral   = GetPowerNumeral(1, 1);
            int damageNumeral   = GetPowerNumeral(2, 1);

            //Increase damage dealt by {Cricket} during your next turn by 1.
            OnPhaseChangeStatusEffect statusEffect = new OnPhaseChangeStatusEffect(CardWithoutReplacements, nameof(IncreaseDamageResponse), "Increase damage dealt by {Cricket} during your next turn by 1", new TriggerType[] { TriggerType.IncreaseDamage }, base.Card);

            statusEffect.TurnTakerCriteria.IsSpecificTurnTaker = base.TurnTaker;
            statusEffect.TurnIndexCriteria.GreaterThan         = Game.TurnIndex;
            statusEffect.TurnPhaseCriteria.TurnTaker           = base.TurnTaker;
            statusEffect.NumberOfUses   = 1;
            statusEffect.CanEffectStack = true;
            statusEffect.UntilTargetLeavesPlay(base.CharacterCard);
            statusEffect.SetPowerNumeralsArray(new int[] { increaseNumeral });

            IEnumerator coroutine = base.AddStatusEffect(statusEffect);

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

            //{Cricket} may deal 1 target 1 sonic damage.
            coroutine = base.GameController.SelectTargetsAndDealDamage(base.HeroTurnTakerController, new DamageSource(base.GameController, base.CharacterCard), damageNumeral, DamageType.Sonic, targetNumeral, false, 0, cardSource: base.GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }