コード例 #1
0
        public override IEnumerator UsePower(int index = 0)
        {
            int targets1 = GetPowerNumeral(0, 1);
            int damages1 = GetPowerNumeral(1, 2);
            int discards = GetPowerNumeral(2, 3);

            var coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, CharacterCard), damages1, DamageType.Energy, targets1, false, targets1, cardSource: GetCardSource());

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

            var selectCardsDecision = new SelectCardsDecision(GameController, DecisionMaker, c => c.IsInLocation(DecisionMaker.HeroTurnTaker.Hand), SelectionType.DiscardCard, discards, false, 0,
                                                              eliminateOptions: true,
                                                              cardSource: GetCardSource());

            coroutine = GameController.SelectCardsAndDoAction(selectCardsDecision, (SelectCardDecision d) => DiscardAndDealDamage(d), cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #2
0
        public override IEnumerator Play()
        {
            var coroutine = GameController.DrawCards(this.DecisionMaker, 2, cardSource: GetCardSource());

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

            var selectCardsDecision = new SelectCardsDecision(GameController, DecisionMaker, c => c.IsInLocation(DecisionMaker.HeroTurnTaker.Hand), SelectionType.DiscardCard, null, false, 0, eliminateOptions: true, cardSource: GetCardSource());

            coroutine = GameController.SelectCardsAndDoAction(selectCardsDecision, (SelectCardDecision d) => DiscardAndDealDamage(d), cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #3
0
        public override IEnumerator UsePower(int index = 0)
        {
            int         powerNumeral = this.GetPowerNumeral(0, 1); // Damage to deal.
            IEnumerator coroutine;

            // Draw a card.
            coroutine = this.DrawCards(this.HeroTurnTakerController, 1);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            SelectCardsDecision selectCardsDecision = new SelectCardsDecision(this.GameController, this.DecisionMaker, (Card c) => c.IsInPlay && c.IsEnvironment && !c.IsTarget, SelectionType.CardToDealDamage, null, false, null, true, true, false, new Func <int>(this.NumEnvironmentToDamage), null, null, null, this.GetCardSource());

            coroutine = this.GameController.SelectCardsAndDoAction(selectCardsDecision, (SelectCardDecision sc) => this.EnvironmentDamageResponse(sc, powerNumeral), null, null, this.GetCardSource(), null, false, null);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            this.actedEnvironments.Clear();
        }
        public override IEnumerator Play()
        {
            int maxNumberOfPairs = (from c in base.TurnTaker.Trash.Cards
                                    where TwoOrMoreCopiesInTrash(c)
                                    select c).Count <Card>() / 2;

            //Shuffle any number of pairs of cards with the same name from your trash into your deck.
            SelectCardsDecision selectCardsDecision = new SelectCardsDecision(base.GameController, base.HeroTurnTakerController, (Card c) => TwoOrMoreCopiesInTrash(c) && c.IsInTrash, SelectionType.ShuffleCardIntoDeck, maxNumberOfPairs, true, new int?(0), true, false, false, null, null, null, null, base.GetCardSource(null));
            //Pick first Card
            IEnumerator coroutine = base.GameController.SelectCardsAndDoAction(selectCardsDecision, this.ShufflePairIntoDeckResponse, cardSource: base.GetCardSource());

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

            //You may destroy up to X ongoing or environment cards, where X is the number of pairs you shuffled this way.
            coroutine = base.GameController.SelectAndDestroyCards(this.HeroTurnTakerController, new LinqCardCriteria((Card c) => c.IsOngoing || c.IsEnvironment), X, true, new int?(0), responsibleCard: this.CharacterCard, cardSource: base.GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #5
0
        private IEnumerator MoveCardToDeckResponse(TurnTakerController turnTakerController)
        {
            TurnTaker turnTaker = turnTakerController.TurnTaker;
            //allow each hero to choose for themselves, TangoOne decides for the villain and environment deck.
            HeroTurnTakerController decisionMaker = turnTaker.IsHero ? turnTakerController.ToHero() : this.DecisionMaker;

            var scsd = new SelectCardsDecision(GameController, decisionMaker, c => c.Location == turnTaker.Trash, SelectionType.ShuffleCardFromTrashIntoDeck,
                                               numberOfCards: CardsToMoveFromTrash,
                                               isOptional: false,
                                               requiredDecisions: CardsToMoveFromTrash,
                                               allowAutoDecide: true,
                                               cardSource: GetCardSource());
            IEnumerator coroutine = GameController.SelectCardsAndDoAction(scsd, scd => GameController.MoveCard(decisionMaker, scd.SelectedCard, turnTaker.Deck, cardSource: GetCardSource()), cardSource: GetCardSource());

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

            coroutine = base.GameController.ShuffleLocation(turnTaker.Deck, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
        }
コード例 #6
0
        public override IEnumerator UsePower(int index = 0)
        {
            //"{TheOldKnightCharacter} deals 1 target 2 irreducible lightning damage. Return 1 of your equipment cards in play to your hand."
            int         targets   = GetPowerNumeral(0, 1);
            int         damage    = GetPowerNumeral(1, 2);
            int         returns   = GetPowerNumeral(2, 1);
            IEnumerator coroutine = GameController.SelectTargetsAndDealDamage(DecisionMaker, new DamageSource(GameController, this.Card), damage, DamageType.Lightning, targets, false, targets, isIrreducible: true, cardSource: GetCardSource());

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

            var selectCards = new SelectCardsDecision(GameController, DecisionMaker, (Card c) => c.IsInPlayAndHasGameText && IsEquipment(c) && c.Owner == this.TurnTaker, SelectionType.ReturnToHand, returns, false, returns, cardSource: GetCardSource());

            coroutine = GameController.SelectCardsAndDoAction(selectCards, ReturnEquipmentToHand, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
コード例 #7
0
        private IEnumerator MoveAugmentsAndHeal(GameAction _)
        {
            IEnumerator routine;

            // If you do, select any number of Augments in play and move each one next to a new hero.

            var augmentsToMove = new SelectCardsDecision(GameController, DecisionMaker, (Card c) => c.IsInPlayAndHasGameText && IsAugment(c), SelectionType.MoveCard, null, false, 0, eliminateOptions: true, cardSource: GetCardSource());

            routine = GameController.SelectCardsAndDoAction(augmentsToMove, MoveAugment, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(routine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(routine);
            }

            // ...Then, each augmented hero regains 2HP.
            routine = this.GameController.GainHP(this.HeroTurnTakerController, IsAugmentedHeroCharacterCard, HpGain,
                                                 cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(routine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(routine);
            }
            yield break;
        }
        public override IEnumerator UsePower(int index = 0)
        {
            List <int> numerals = new List <int>()
            {
                this.GetPowerNumeral(0, 3),              // Max HP
                this.GetPowerNumeral(1, 1),              // Number of Targets
                this.GetPowerNumeral(2, 1)               // Damage.
            };

            // You may play an ongoing.
            IEnumerator coroutine;

            coroutine = this.SelectAndPlayCardsFromHand(this.DecisionMaker, 1, false, 0, new LinqCardCriteria((Card c) => c.IsOngoing, "ongoing", true));
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            // Make distortions HP targets. (Note that this does not apply to pre-existing targets - this is a quirk of how the engine currently applies those effects.)
            MakeTargetStatusEffect makeTargetStatusEffect = new MakeTargetStatusEffect(numerals[0], false);

            makeTargetStatusEffect.CardsToMakeTargets.HasAnyOfTheseKeywords = new List <string>()
            {
                "distortion"
            };
            makeTargetStatusEffect.UntilStartOfNextTurn(this.TurnTaker);
            coroutine = this.AddStatusEffect(makeTargetStatusEffect, true);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            SelectCardsDecision selectCardsDecision = new SelectCardsDecision(base.GameController, this.DecisionMaker, (Card c) => c.IsInPlay && c.IsDistortion, SelectionType.CardToDealDamage, null, false, null, true, true, false, new Func <int>(this.NumDistortionsToDamage), null, null, null, base.GetCardSource(null));

            coroutine = base.GameController.SelectCardsAndDoAction(selectCardsDecision, (SelectCardDecision sc) => this.DistortionDamageResponse(sc, numerals[1], numerals[2]), null, null, base.GetCardSource(null), null, false, null);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            this.actedDistortions.Clear();
        }
コード例 #9
0
        public override IEnumerator UsePower(int index = 0)
        {
            int augsToMove = GetPowerNumeral(0, 1);
            // You may move 1 Augment in play next to a new hero.
            var scd = new SelectCardsDecision(GameController, DecisionMaker, (Card c) => c.IsInPlayAndHasGameText && IsAugment(c), SelectionType.MoveCardNextToCard,
                                              numberOfCards: augsToMove,
                                              isOptional: false,
                                              requiredDecisions: 0,
                                              eliminateOptions: true,
                                              cardSource: GetCardSource());

            IEnumerator routine = base.GameController.SelectCardsAndDoAction(scd, MoveAugment);

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

            // Draw 2 cards.
            int cardsToDrawNumeral = GetPowerNumeral(1, CardsToDraw);

            routine = base.DrawCards(this.HeroTurnTakerController, cardsToDrawNumeral);
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(routine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(routine);
            }

            // Discard a card
            routine = base.GameController.SelectAndDiscardCards(this.HeroTurnTakerController, CardsToDiscard, false,
                                                                CardsToDiscard, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(routine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(routine);
            }
        }
コード例 #10
0
        public override IEnumerator Play()
        {
            //"You may destroy 1 ongoing card.",
            IEnumerator coroutine = GameController.SelectAndDestroyCard(DecisionMaker, new LinqCardCriteria((Card c) => c.IsInPlayAndHasGameText && c.IsOngoing, "ongoing"), true, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            //"Select up to 3 non-character targets in play with 2 or fewer HP.
            var storedTargets = new List <SelectCardsDecision> {
            };

            coroutine = GameController.SelectCardsAndStoreResults(DecisionMaker, SelectionType.MoveCardOnBottomOfDeck, (Card c) => c.IsInPlayAndHasGameText && c.IsTarget && !c.IsCharacter && c.HitPoints <= 2 && GameController.IsCardVisibleToCardSource(c, GetCardSource()),
                                                                  3, storedTargets, false, 0, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }

            if (DidSelectCards(storedTargets))
            {
                //Place those targets on the bottom of their associated decks in any order."
                var targetsToMove = GetSelectedCards(storedTargets);
                var moveDecision  = new SelectCardsDecision(GameController, DecisionMaker, (Card c) => targetsToMove.Contains(c), SelectionType.MoveCardOnBottomOfDeck, targetsToMove.Count(), requiredDecisions: targetsToMove.Count(), eliminateOptions: true, allowAutoDecide: true, cardSource: GetCardSource());
                coroutine = GameController.SelectCardsAndDoAction(moveDecision, MoveToBottomOfDeck, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
コード例 #11
0
        protected IEnumerator RevealCardsFromTopOfDeck_PutOnTopInChoosenOrder(HeroTurnTakerController hero, Location deck)
        {
            List <Card> revealedCards = new List <Card>();
            IEnumerator coroutine     = this.GameController.RevealCards(hero, deck, CardsToReveal, revealedCards, false, RevealedCardDisplay.None, null, this.GetCardSource(null));

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

            List <Card> allRevealedCards = new List <Card>(revealedCards);

            if (revealedCards.Count == 2)
            {
                List <SelectCardsDecision> selectCardDecisions = new List <SelectCardsDecision>();
                coroutine = GameController.SelectCardsAndStoreResults(hero, SelectionType.MoveCardOnDeck, (Card c) => revealedCards.Contains(c), 1, selectCardDecisions, false,
                                                                      cardSource: GetCardSource(),
                                                                      ignoreBattleZone: true);
                if (this.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }
                SelectCardsDecision selectCardsDecision = selectCardDecisions.FirstOrDefault();
                SelectCardDecision  selectCardDecision  = selectCardsDecision?.SelectCardDecisions.FirstOrDefault();
                Card selectedCard = selectCardDecision?.SelectedCard;
                Card otherCard    = revealedCards.First(c => c != selectedCard);

                if (selectedCard != null)
                {
                    coroutine = this.GameController.MoveCard(this.TurnTakerController, otherCard, deck, cardSource: GetCardSource());
                    if (this.UseUnityCoroutines)
                    {
                        yield return(this.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        this.GameController.ExhaustCoroutine(coroutine);
                    }
                    coroutine = this.GameController.MoveCard(this.TurnTakerController, selectedCard, deck, decisionSources: new[] { selectCardDecision }, cardSource: GetCardSource());
                    if (this.UseUnityCoroutines)
                    {
                        yield return(this.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        this.GameController.ExhaustCoroutine(coroutine);
                    }
                }
            }
            else if (revealedCards.Count == 1)
            {
                Card   card    = revealedCards[0];
                string message = $"{card.Title} is the only card in {deck.GetFriendlyName()}.";
                coroutine = this.GameController.SendMessageAction(message, Priority.High, GetCardSource(), new Card[] { card });
                if (this.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }
                coroutine = this.GameController.MoveCard(this.TurnTakerController, card, deck, cardSource: GetCardSource());
                if (this.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }
            }
            coroutine = this.CleanupCardsAtLocations(new List <Location>()
            {
                deck.OwnerTurnTaker.Revealed
            }, deck, cardsInList: allRevealedCards);
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }