Beispiel #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;
        }
        private IEnumerator ApplyStatusEffects(DealDamageAction dd)
        {
            OnPhaseChangeStatusEffect opcse = new OnPhaseChangeStatusEffect(this.CardWithoutReplacements, nameof(DealToxicToSelfResponse), $"{dd.Target.Title} will deal itself one Toxic damage at the end of this turn!", new TriggerType[] { TriggerType.PhaseChange, TriggerType.DealDamage }, this.Card);

            opcse.NumberOfUses = 1;
            opcse.UntilTargetLeavesPlay(dd.Target);
            opcse.TurnPhaseCriteria.Phase     = Phase.End;
            opcse.TurnPhaseCriteria.TurnTaker = base.GameController.ActiveTurnTaker;
            opcse.BeforeOrAfter = BeforeOrAfter.After;
            opcse.CardSource    = this.Card;
            opcse.UntilStartOfNextTurn(base.GameController.FindNextTurnTaker());
            IEnumerator coroutine = base.AddStatusEffect(opcse, true);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
        public override IEnumerator UseIncapacitatedAbility(int index)
        {
            /*
             * "One player may use a power now.",
             * "Destroy 1 ongoing card.",
             * "Select 1 environment target in play. Destroy it at the start of your next turn. Until then, it is immune to damage."
             */

            switch (index)
            {
            case 0:
            {
                //"One player may use a power now."
                IEnumerator coroutine = base.GameController.SelectHeroToUsePower(this.DecisionMaker, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                break;
            }

            case 1:
            {
                //"Destroy 1 ongoing card.",
                var coroutine = GameController.SelectAndDestroyCard(DecisionMaker, new LinqCardCriteria(c => c.IsOngoing, "ongoing"), false, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                break;
            }

            case 2:
            {
                //"Select 1 environment target in play. Destroy it at the start of your next turn. Until then, it is immune to damage."
                List <SelectCardDecision> storedResults = new List <SelectCardDecision>();
                var coroutine = GameController.SelectCardAndStoreResults(DecisionMaker, SelectionType.DestroyCard, new LinqCardCriteria(c => c.IsEnvironmentTarget, "environment target", false), storedResults, false,
                                                                         allowAutoDecide: true,
                                                                         cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }

                if (DidSelectCard(storedResults))
                {
                    var card = GetSelectedCard(storedResults);
                    if (IsRealAction())
                    {
                        Journal.RecordCardProperties(card, "MarkedForDestruction", true);
                    }
                    var immune = new ImmuneToDamageStatusEffect();
                    immune.CardSource = CharacterCard;
                    immune.TargetCriteria.IsSpecificCard = card;
                    immune.UntilCardLeavesPlay(card);

                    coroutine = base.AddStatusEffect(immune, true);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine);
                    }

                    var effect = new OnPhaseChangeStatusEffect(CardWithoutReplacements, nameof(DestroyMarkedTarget), $"{card.Title} will be destroyed at the start of {CharacterCard.Title}'s next turn.", new[] { TriggerType.DestroyCard }, CharacterCard);
                    effect.TurnPhaseCriteria.TurnTaker = TurnTaker;
                    effect.TurnPhaseCriteria.Phase     = Phase.Start;
                    effect.NumberOfUses   = 1;
                    effect.CanEffectStack = true;
                    effect.CardSource     = CharacterCard;
                    effect.UntilTargetLeavesPlay(card);

                    coroutine = base.AddStatusEffect(effect, true);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine);
                    }
                }
                break;
            }
            }
            yield break;
        }