private IEnumerator SelfDamageResponse(UsePowerAction upa)
        {
            var storedHero        = new List <Card> {
            };
            IEnumerator coroutine = FindCharacterCard(upa.HeroUsingPower.TurnTaker, SelectionType.DealDamageSelf, storedHero);

            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            if (storedHero.FirstOrDefault() != null)
            {
                var hero = storedHero.FirstOrDefault();
                coroutine = DealDamage(hero, hero, 2, DamageType.Psychic, cardSource: GetCardSource());
                if (UseUnityCoroutines)
                {
                    yield return(GameController.StartCoroutine(coroutine));
                }
                else
                {
                    GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
        private IEnumerator DamageSelfToUsePowerResponse(UsePowerAction p)
        {
            base.SetCardPropertyToTrueIfRealAction("UsedFocusPower", null);
            List <DealDamageAction> storedResults = new List <DealDamageAction>();
            IEnumerator             hitSelf       = base.GameController.SelectTargetsAndDealDamage(this.DecisionMaker, new DamageSource(base.GameController, base.CharacterCard), 2, DamageType.Fire, 1, true, 1, false, false, false, (Card c) => c == base.CharacterCard, null, storedResults, null, null, false, null, null, false, null, base.GetCardSource(null));

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(hitSelf));
            }
            else
            {
                base.GameController.ExhaustCoroutine(hitSelf);
            }
            if (base.DidDealDamage(storedResults, base.CharacterCard, null))
            {
                IEnumerator usePower = base.GameController.SelectAndUsePower(base.HeroTurnTakerController, true, null, 1, true, null, false, false, true, true, null, false, false, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(usePower));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(usePower);
                }
            }
            yield break;
        }
示例#3
0
        private IEnumerator SuperimposePowerResponse(UsePowerAction action)
        {
            IEnumerator coroutine = CancelAction(action);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            System.Console.WriteLine($"### Canceled - {action.Power}");

            coroutine = base.SelectAndUsePower(base.FindCardController(cardThisIsNextTo), true);
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
示例#4
0
        private IEnumerator DestroyHeroOngoingOrEquipmentResponse(UsePowerAction action)
        {
            IEnumerator coroutine = base.GameController.SelectAndDestroyCard(this.DecisionMaker, new LinqCardCriteria((Card c) => c.IsHero && (c.IsOngoing || base.IsEquipment(c)) && GameController.IsCardVisibleToCardSource(c, GetCardSource()), "hero ongoing or equipment"), false, cardSource: base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
        private IEnumerator ModifyDamageTypeAndAmountFromPowerResponse(UsePowerAction power, Func <Func <DealDamageAction, bool>, ITrigger> addDealDamageTrigger, int?increaseDamageAmount = null, bool makeDamageIrreducible = false)
        {
            RemoveTemporaryTriggers();
            CardController powerCardController              = power.Power.IsContributionFromCardSource ? power.Power.CardSource.CardController : power.Power.CardController;
            Func <DealDamageAction, bool> argChangeType     = (DealDamageAction dd) => dd.CardSource.PowerSource != null && dd.CardSource.PowerSource == power.Power && (dd.CardSource.CardController == powerCardController || dd.CardSource.AssociatedCardSources.Any((CardSource cs) => cs.CardController == powerCardController)) && !dd.DamageModifiers.Where((ModifyDealDamageAction md) => md is ChangeDamageTypeAction).Select((ModifyDealDamageAction md) => md.CardSource.CardController).Contains(this) && !powerCardController.Card.IsBeingDestroyed;
            Func <DealDamageAction, bool> argIncreaseDamage = (DealDamageAction dd) => dd.CardSource.PowerSource != null && dd.CardSource.PowerSource == power.Power && (dd.CardSource.CardController == powerCardController || dd.CardSource.AssociatedCardSources.Any((CardSource cs) => cs.CardController == powerCardController)) && !dd.DamageModifiers.Where((ModifyDealDamageAction md) => md is IncreaseDamageAction).Select((ModifyDealDamageAction md) => md.CardSource.CardController).Contains(this) && !powerCardController.Card.IsBeingDestroyed;

            AddToTemporaryTriggerList(addDealDamageTrigger(argIncreaseDamage));
            AddToTemporaryTriggerList(AddChangeTypeTrigger(argChangeType));
            AddToTemporaryTriggerList(AddTrigger((AddStatusEffectAction se) => se.StatusEffect.DoesDealDamage && se.CardSource.PowerSource != null && se.CardSource.PowerSource == power.Power, (AddStatusEffectAction se) => ModifyDamageFromEffectResponse(se, increaseDamageAmount.Value, power.Power), TriggerType.Hidden, TriggerTiming.Before));
            yield return(null);

            yield break;
        }
        private IEnumerator UsePowerResponse(UsePowerAction action)
        {
            var coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, CharacterCard), 1, DamageType.Energy, 1, false, 0,
                                                                      additionalCriteria: c => !c.IsHero && c.IsTarget && c.IsInPlayAndHasGameText,
                                                                      cardSource: GetCardSource());

            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
        private IEnumerator DiscardResponse(UsePowerAction upa)
        {
            // "Whenever a hero uses a power, their player discards a card."
            HeroTurnTakerController discarding       = upa.HeroUsingPower;
            IEnumerator             discardCoroutine = base.GameController.SelectAndDiscardCard(discarding, responsibleTurnTaker: base.TurnTaker, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(discardCoroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(discardCoroutine);
            }
            yield break;
        }
        private IEnumerator UsePowerAgainResponse(UsePowerAction action)
        {
            StatusEffect[] statusEffects = base.Game.StatusEffects.Where((StatusEffect effect) => effect.CardSource == base.CharacterCard && effect.CardDestroyedExpiryCriteria.Card == action.Power.CardSource.Card).ToArray();
            if (statusEffects.Any())
            {
                //If a power has been setup more than once, use it more than once
                foreach (StatusEffect statusEffect in statusEffects)
                {
                    //remove the fake status effect
                    base.GameController.StatusEffectManager.RemoveStatusEffect(statusEffect);

                    IEnumerator coroutine = UsePowerOnOtherCard(action.Power.CardSource.Card, action.Power.Index);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine);
                    }
                }
            }
            yield break;
        }
 private IEnumerator HeroUsedPowerResponse(UsePowerAction upa)
 {
     // Note when a hero uses a power during their turn
     base.SetCardPropertyToTrueIfRealAction(PowerThisTurn);
     yield break;
 }