コード例 #1
0
        private IEnumerator MarkNotPrimed(CardEntersPlayAction cpa)
        {
            this._primed = false;
            yield return(null);

            yield break;
        }
コード例 #2
0
        public IEnumerator GoalpostsEntersResponse(CardEntersPlayAction cepa)
        {
            // "... it becomes indestructible until the end of the turn..."
            MakeIndestructibleStatusEffect immovableStatus = new MakeIndestructibleStatusEffect();

            immovableStatus.CardsToMakeIndestructible.IsSpecificCard = cepa.CardEnteringPlay;
            immovableStatus.UntilThisTurnIsOver(base.Game);
            IEnumerator immovableCoroutine = base.GameController.AddStatusEffect(immovableStatus, true, GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(immovableCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(immovableCoroutine);
            }
            // "... and you may play a Relay card from your trash."
            IEnumerator playCoroutine = base.GameController.SelectAndPlayCard(base.HeroTurnTakerController, base.FindCardsWhere(new LinqCardCriteria((Card c) => IsRelay(c) && c.Location == base.TurnTaker.Trash)), optional: true, isPutIntoPlay: false, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(playCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(playCoroutine);
            }
            yield break;
        }
コード例 #3
0
        private IEnumerator MoveOneShotUnderResponse(CardEntersPlayAction mc)
        {
            IEnumerator coroutine = GameController.CancelAction(mc);

            if (base.UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            coroutine = GameController.SendMessageAction($"The Ram stored {mc.CardEnteringPlay.Title} under itself!", Priority.Medium, GetCardSource(), new Card[] { mc.CardEnteringPlay });
            if (base.UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            coroutine = GameController.MoveCard(TurnTakerController, mc.CardEnteringPlay, this.Card.UnderLocation, showMessage: false, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #4
0
        private IEnumerator FrozenEntersPlayResponse(CardEntersPlayAction cp)
        {
            //this card and Tak Ahab each regain 3HP
            List <Card> cardsToGainHP = new List <Card> {
                base.Card
            };

            if (base.IsTakAhabInPlay())
            {
                Card takAhab = base.FindTakAhabInPlay();
                cardsToGainHP.Add(takAhab);
            }

            foreach (Card hpGainer in cardsToGainHP)
            {
                IEnumerator coroutine = base.GameController.GainHP(hpGainer, new int?(3), cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }

            yield break;
        }
コード例 #5
0
        private IEnumerator DestroySelfResponse(CardEntersPlayAction _)
        {
            IEnumerator routine;

            if (!base.GameController.IsCardIndestructible(base.Card))
            {
                // Ask player if they want to destroy this card
                List <YesNoCardDecision> storedResults = new List <YesNoCardDecision>();
                routine = base.GameController.MakeYesNoCardDecision(base.HeroTurnTakerController,
                                                                    SelectionType.DestroySelf, base.Card, storedResults: storedResults, cardSource: GetCardSource());

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

                if (!base.DidPlayerAnswerYes(storedResults))
                {
                    yield break;
                }

                //"May destroy this... If you do"
                //based on Bunker's Auxiliary Power Source, which uses the same wording
                AddAfterDestroyedAction(MoveAugmentsAndHeal);

                // Destroy this card
                List <DestroyCardAction> dcas = new List <DestroyCardAction>();
                routine = this.GameController.DestroyCard(this.DecisionMaker, this.Card, storedResults: dcas, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(routine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(routine);
                }

                //if the destruction manages to get cancelled, clean up the trigger
                RemoveAfterDestroyedAction(MoveAugmentsAndHeal);
            }
            else
            {
                routine = base.GameController.SendMessageAction(base.Card.Title + " is indestructible, so it cannot be destroyed for extra effects.",
                                                                Priority.Medium, GetCardSource(), null, true);

                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(routine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(routine);
                }
            }
            yield break;
        }
コード例 #6
0
        private IEnumerator EnvironmentCardPlayedResponse(CardEntersPlayAction cep)
        {
            //{Deeproot} gains 2 HP
            IEnumerator coroutine = GameController.GainHP(CharacterCard, 2, cardSource: GetCardSource());

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

            // {Deeproot} deals the Hero Target with the highest HP 3 Melee Damage.
            coroutine = DealDamageToHighestHP(CharacterCard, 1, c => c.IsHero && c.IsTarget && GameController.IsCardVisibleToCardSource(c, GetCardSource()), c => 3, DamageType.Melee);
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #7
0
 private bool IsCardEnteringPlayAsConstellationNextToTarget(CardEntersPlayAction ce)
 {
     //"Whenever a constellation enters play next to a target..."
     if (IsConstellation(ce.CardEnteringPlay) && ce.CardEnteringPlay.BattleZone == this.BattleZone)
     {
         var location = ce.CardEnteringPlay.Location;
         if (location != null && location.IsNextToCard && location.OwnerCard != null)
         {
             return(location.OwnerCard.IsTarget);
         }
     }
     return(false);
 }
 public bool CryosCardDrawCriteria(CardEntersPlayAction cep)
 {
     //"Whenever a Constellation enters play next to Starlight of Cryos-4, draw a card."
     if (IsConstellation(cep.CardEnteringPlay))
     {
         var location = cep.CardEnteringPlay.Location;
         if (location != null && location.IsNextToCard && location.OwnerCard != null)
         {
             return(location.OwnerCard == cryos);
         }
     }
     return(false);
 }
        private IEnumerator OldKnightDrawResponse(CardEntersPlayAction cep)
        {
            IEnumerator coroutine = DrawCard();

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
        private IEnumerator YoungKnightDamageResponse(CardEntersPlayAction cep)
        {
            IEnumerator coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, youngKnight), 1, DamageType.Toxic, 1, false, 1, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #11
0
        private IEnumerator DestroySelfResponse(CardEntersPlayAction action)
        {
            IEnumerator coroutine = base.GameController.DestroyCard(base.HeroTurnTakerController, base.Card, true, cardSource: base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #12
0
        private IEnumerator AdvancedResponse(CardEntersPlayAction cep)
        {
            //{Deeproot} gains 2 HP.
            SetCardPropertyToTrueIfRealAction(FirstTimeVillainOngoingOrPlantGrowthEntersPlayKey);
            IEnumerator coroutine = GameController.GainHP(CharacterCard, 2, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #13
0
        private IEnumerator MicrostormEntersPlayResponse(CardEntersPlayAction cep)
        {
            Card        card = base.TurnTaker.GetCardsWhere((Card c) => c.IsInPlayAndHasGameText && c.Identifier == cep.CardEnteringPlay.Identifier).FirstOrDefault();
            string      torrentPoolIdentifier = $"{card.Identifier}TorrentPool";
            TokenPool   torrentPool           = card.FindTokenPool(torrentPoolIdentifier);
            IEnumerator coroutine             = base.GameController.AddTokensToPool(torrentPool, 1, GetCardSource(null));

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #14
0
        public IEnumerator DrawOrPlayResponse(CardEntersPlayAction cepa)
        {
            base.SetCardPropertyToTrueIfRealAction(OneClusterPerTurn);
            // "... you may draw a card or play a card."
            IEnumerator drawPlayCoroutine = DrawACardOrPlayACard(base.HeroTurnTakerController, true);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(drawPlayCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(drawPlayCoroutine);
            }
            yield break;
        }
コード例 #15
0
        private IEnumerator PlayMomentumResponse(CardEntersPlayAction cpa)
        {
            SetCardPropertyToTrueIfRealAction(FirstTimeEnvironmentEntersPlayKey);

            //you may play a Momentum Card.
            IEnumerator coroutine = GameController.SelectAndPlayCardFromHand(HeroTurnTakerController, optional: true, cardCriteria: new LinqCardCriteria(c => IsMomentum(c), "momentum"), cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #16
0
        private IEnumerator EnterPlayResponse(CardEntersPlayAction cp)
        {
            //this card deals the target with the third highest HP 2 cold damage

            IEnumerator coroutine = base.DealDamageToHighestHP(base.Card, 3, (Card c) => c.IsTarget, (Card c) => 2, DamageType.Cold);

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

            yield break;
        }
コード例 #17
0
        private IEnumerator DamageOnUpCloseEntryResponse(CardEntersPlayAction cep)
        {
            Card upClose = cep.CardEnteringPlay;

            if (upClose.Location.IsNextToCard && upClose.Location.OwnerCard != null && upClose.Location.OwnerCard.IsTarget && upClose.Location.OwnerCard.IsHero)
            {
                IEnumerator damage = DealDamage(this.Card, upClose.Location.OwnerCard, H - 2, DamageType.Energy);
                if (base.UseUnityCoroutines)
                {
                    yield return(GameController.StartCoroutine(damage));
                }
                else
                {
                    GameController.ExhaustCoroutine(damage);
                }
            }
            yield break;
        }
コード例 #18
0
        private IEnumerator RemoveOtherThirdWaypointResponse(CardEntersPlayAction cp)
        {
            //grab the card to move
            Card otherThirdWaypoint = cp.CardEnteringPlay;

            //cancel entering play
            IEnumerator coroutine = base.CancelAction(cp);

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

            //move it out of the game

            //send the message
            coroutine = base.GameController.SendMessageAction(base.Card.Title + " removes " + otherThirdWaypoint.Title + " from the game!", Priority.Medium, base.GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }

            //do the move
            coroutine = base.GameController.MoveCard(base.TurnTakerController, otherThirdWaypoint, base.TurnTaker.OutOfGame, evenIfIndestructible: true, cardSource: base.GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #19
0
        private IEnumerator DestroyOngoingAndPlayCardResponse(CardEntersPlayAction cep)
        {
            IEnumerator coroutine = GameController.DestroyCard(DecisionMaker, cep.CardEnteringPlay, cardSource: GetCardSource());

            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            coroutine = PlayTheTopCardOfTheVillainDeckResponse(cep);
            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #20
0
        public IEnumerator DowsingCrystalDamage(CardEntersPlayAction cep)
        {
            //base.SetCardPropertyToTrueIfRealAction("InUse");
            //Log.Debug("DowsingCrystalDamage triggers");
            var dcTriggers = GameController.StatusEffectManager
                             .GetStatusEffectControllersInList(CardControllerListType.ActivatesEffects)
                             .Where((StatusEffectController sec) => (sec.StatusEffect as ActivateEffectStatusEffect).EffectName == "Dowsing Crystal trigger")
                             .ToList();

            //for each of the various Dowsing Crystal uses that have happened...
            foreach (StatusEffectController seController in dcTriggers)
            {
                var        currentTriggerEffect = seController.StatusEffect as ActivateEffectStatusEffect;
                Card       triggeringCrystal    = currentTriggerEffect.CardSource;
                CardSource crystalSource        = new CardSource(FindCardController(triggeringCrystal));

                if (!IsSpecificTriggerAvailable(seController))
                {
                    continue;
                }
                _inUseTriggers.Add(seController);

                if (!crystalSource.Card.IsInPlay)
                {
                    GameController.RemoveInhibitor(crystalSource.CardController);
                }

                //"(one hero target) may..."
                var storedYesNo       = new List <YesNoCardDecision> {
                };
                IEnumerator coroutine = GameController.MakeYesNoCardDecision(DecisionMaker, SelectionType.DealDamage, triggeringCrystal, storedResults: storedYesNo, cardSource: crystalSource);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }

                if (DidPlayerAnswerYes(storedYesNo))
                {
                    //"one hero target (may deal damage...)"
                    var storedDamageSource = new List <SelectTargetDecision> {
                    };
                    var heroTargets        = GameController.FindCardsWhere(new LinqCardCriteria((Card c) => c != null && c.IsTarget && c.IsHero && c.IsInPlayAndHasGameText), visibleToCard: crystalSource);
                    coroutine = GameController.SelectTargetAndStoreResults(DecisionMaker, heroTargets, storedDamageSource, damageAmount: (Card c) => 2, selectionType: SelectionType.HeroToDealDamage, cardSource: crystalSource);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine);
                    }

                    var selectedDecision = storedDamageSource.FirstOrDefault();
                    if (selectedDecision != null && selectedDecision.SelectedCard != null)
                    {
                        var damageSource = selectedDecision.SelectedCard;

                        //"...of a type of their choosing."
                        var damageTypeDecision = new List <SelectDamageTypeDecision> {
                        };
                        coroutine = GameController.SelectDamageType(FindHeroTurnTakerController(damageSource.Owner.ToHero()), damageTypeDecision, cardSource: crystalSource);
                        if (base.UseUnityCoroutines)
                        {
                            yield return(base.GameController.StartCoroutine(coroutine));
                        }
                        else
                        {
                            base.GameController.ExhaustCoroutine(coroutine);
                        }

                        var selectedDamage = DamageType.Melee;
                        if (damageTypeDecision.FirstOrDefault() != null && damageTypeDecision.FirstOrDefault().SelectedDamageType != null)
                        {
                            selectedDamage = (DamageType)damageTypeDecision.FirstOrDefault().SelectedDamageType;
                        }


                        //Log.Debug("Dowsing Crystal's trigger-on-Mara approach works so far.");

                        //attempts to give the damage a destroy-dowsing-crystal-for-boost effect

                        //does not seem to be needed yet, causes warnings in multiple-play-reactions
                        //may be required in some future scenario
                        //var damageSourceTempVar = (Card)AddTemporaryVariable("DowsingCrystalDamageSource", damageSource);

                        var boostDamageTrigger = new IncreaseDamageTrigger(GameController, (DealDamageAction dd) => LogAndReturnTrue(dd) && dd.DamageSource.Card == damageSource && dd.CardSource == crystalSource && triggeringCrystal.IsInPlay, DestroyCrystalToBoostDamageResponse, null, TriggerPriority.Low, false, crystalSource);

                        AddTrigger(boostDamageTrigger);

                        //"deal a non-hero target 2 damage"

                        coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, damageSource), 2, selectedDamage, 1, false, 1, additionalCriteria: ((Card c) => !c.IsHero), cardSource: crystalSource);
                        if (UseUnityCoroutines)
                        {
                            yield return(GameController.StartCoroutine(coroutine));
                        }
                        else
                        {
                            GameController.ExhaustCoroutine(coroutine);
                        }

                        RemoveTrigger(boostDamageTrigger);
                        //RemoveTemporaryVariables();
                    }

                    //"Once before your next turn..."
                    coroutine = GameController.ExpireStatusEffect(currentTriggerEffect, crystalSource);
                    if (UseUnityCoroutines)
                    {
                        yield return(GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        GameController.ExhaustCoroutine(coroutine);
                    }
                    _hasBeenUsedTriggers.Add(seController);
                }
                _inUseTriggers.Remove(seController);
            }

            yield break;
        }
コード例 #21
0
        public IEnumerator EntersPlayResponse(CardEntersPlayAction cepa)
        {
            // "When a villain One-Shot or a non-target environment card would enter play, you may discard it instead."
            Card entering = cepa.CardEnteringPlay;
            List <YesNoCardDecision> result = new List <YesNoCardDecision>();
            IEnumerator chooseCoroutine     = base.GameController.MakeYesNoCardDecision(base.HeroTurnTakerController, SelectionType.DiscardCard, entering, storedResults: result, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(chooseCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(chooseCoroutine);
            }
            if (DidPlayerAnswerYes(result))
            {
                // Discard the card instead of putting it into play
                AddCardPropertyJournalEntry("CardBlocked", entering);
                IEnumerator cancelCoroutine = CancelAction(cepa);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(cancelCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(cancelCoroutine);
                }
                MoveCardDestination trash            = FindCardController(entering).GetTrashDestination();
                IEnumerator         discardCoroutine = base.GameController.MoveCard(base.TurnTakerController, entering, trash.Location, responsibleTurnTaker: base.TurnTaker, isDiscard: true, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(discardCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(discardCoroutine);
                }

                // "If you do, destroy this card and {ImpulseCharacter} deals himself 2 melee and 2 energy damage."
                IEnumerator meleeCoroutine = base.GameController.DealDamageToSelf(base.HeroTurnTakerController, (Card c) => c == base.CharacterCard, 2, DamageType.Melee, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(meleeCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(meleeCoroutine);
                }
                IEnumerator energyCoroutine = base.GameController.DealDamageToSelf(base.HeroTurnTakerController, (Card c) => c == base.CharacterCard, 2, DamageType.Energy, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(energyCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(energyCoroutine);
                }
                IEnumerator destroyCoroutine = base.GameController.DestroyCard(base.HeroTurnTakerController, base.Card, responsibleCard: base.Card, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(destroyCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(destroyCoroutine);
                }
            }
            yield break;
        }
コード例 #22
0
 public IEnumerator GoalpostsEntersPlayResponse(CardEntersPlayAction cepa)
 {
     return(base.GameController.SendMessageAction(base.CharacterCard.Title + " retreats to the Goalposts, becoming immune to damage but unable to play cards or use powers...", Priority.High, GetCardSource(), associatedCards: cepa.CardEnteringPlay.ToEnumerable(), showCardSource: true));
 }
コード例 #23
0
        public IEnumerator ExplosionResponse(CardEntersPlayAction cepa)
        {
            // "... this card deals the non-environment target with the highest HP in each other play area 1 energy damage, ..."
            DealDamageAction previewDamage = new DealDamageAction(GetCardSource(), new DamageSource(base.GameController, base.Card), null, 1, DamageType.Energy);
            List <Location>  playAreas     = new List <Location>();

            // Get each other play area
            foreach (TurnTaker tt in base.GameController.AllTurnTakers)
            {
                Location ttPlayArea = tt.PlayArea;
                if (ttPlayArea.HighestRecursiveLocation != base.Card.Location.HighestRecursiveLocation)
                {
                    playAreas.Add(ttPlayArea);
                }
            }
            // For each other play area, find its non-environment target with the highest HP
            List <Card> highestTargets = new List <Card>();

            foreach (Location playArea in playAreas)
            {
                if (playArea.Cards.Any((Card c) => c.IsTarget && !c.IsEnvironment))
                {
                    List <Card> localHighest  = new List <Card>();
                    IEnumerator findCoroutine = base.GameController.FindTargetWithHighestHitPoints(1, (Card c) => c.Location.HighestRecursiveLocation == playArea && !c.IsEnvironment, localHighest, dealDamageInfo: previewDamage.ToEnumerable(), cardSource: GetCardSource());
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(findCoroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(findCoroutine);
                    }
                    if (localHighest != null && localHighest.Count() > 0)
                    {
                        highestTargets.Add(localHighest.FirstOrDefault());
                    }
                }
            }
            IEnumerator explodeCoroutine = base.DealDamage(base.Card, (Card c) => highestTargets.Contains(c), 1, DamageType.Energy);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(explodeCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(explodeCoroutine);
            }
            // "then deals itself 1 energy damage."
            IEnumerator selfDamageCoroutine = base.DealDamage(base.Card, base.Card, 1, DamageType.Energy, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(selfDamageCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(selfDamageCoroutine);
            }
            yield break;
        }
コード例 #24
0
        private IEnumerator DamageAndHealResponse(CardEntersPlayAction ce)
        {
            var constellation = ce.CardEnteringPlay;

            if (constellation == null)
            {
                yield break;
            }

            //pick Starlight to act with
            List <Card> storedResults      = new List <Card> {
            };
            IEnumerator chooseDamageSource = SelectActiveCharacterCardToDealDamage(storedResults, 1, DamageType.Energy);

            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(chooseDamageSource));
            }
            else
            {
                GameController.ExhaustCoroutine(chooseDamageSource);
            }
            Card actingStarlight = storedResults.FirstOrDefault();

            if (actingStarlight == null)
            {
                yield break;
            }


            Card target = null;

            if (constellation != null && constellation.Location != null)
            {
                target = constellation.Location.OwnerCard;
            }

            if (target != null)
            {
                //"...Starlight deals that target 1 energy damage..."
                var damageAction = DealDamage(actingStarlight, target, 1, DamageType.Energy, cardSource: GetCardSource());
                if (UseUnityCoroutines)
                {
                    yield return(GameController.StartCoroutine(damageAction));
                }
                else
                {
                    GameController.ExhaustCoroutine(damageAction);
                }
            }

            //"...and regains 1 HP."
            IEnumerator gainHPAction = GameController.GainHP(actingStarlight, 1, cardSource: GetCardSource());

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

            yield break;
        }
コード例 #25
0
 private IEnumerator ResetPlayToTheLeftResponse(CardEntersPlayAction arg)
 {
     SetCardProperty("PlayToTheLeft", false);
     yield return(null);
 }