Example #1
0
        private IEnumerator StartOfTurnPhaseShiftResponse(PhaseChangeAction pca)
        {
            TurnTaker heroTT = pca.GameController.ActiveTurnTaker;
            HeroTurnTakerController heroTTC = pca.GameController.ActiveTurnTakerController.ToHero();

            List <YesNoCardDecision> storedResults = new List <YesNoCardDecision>();
            IEnumerator routine = base.GameController.MakeYesNoCardDecision(heroTTC, YesNoSelectionType, this.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;
            }

            var extraAction = new IncreasePhaseActionCountStatusEffect(1);

            extraAction.UntilThisTurnIsOver(Game);
            extraAction.ToTurnPhaseCriteria.Phase     = PhaseToIncrease;
            extraAction.ToTurnPhaseCriteria.TurnTaker = GameController.ActiveTurnTaker;
            extraAction.CardSource = this.Card;

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

            var skippedAction = new PreventPhaseActionStatusEffect();

            skippedAction.UntilThisTurnIsOver(Game);
            skippedAction.ToTurnPhaseCriteria.Phase     = PhaseToSkip;
            skippedAction.ToTurnPhaseCriteria.TurnTaker = GameController.ActiveTurnTaker;
            skippedAction.CardSource = this.Card;

            routine = AddStatusEffect(skippedAction);
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(routine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(routine);
            }
            yield break;
        }
        private IEnumerator EndOfTurnResponse()
        {
            List <SelectCardDecision> storedResults = new List <SelectCardDecision>();
            IEnumerator coroutine = base.GameController.SelectTargetsAndDealDamage(base.HeroTurnTakerController, new DamageSource(base.GameController, base.CharacterCard), 1, DamageType.Projectile, 1, false, 1, false, false, false, null, storedResults, null, null, null, true, null, null, false, null, GetCardSource(null));

            if (UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            Card target = storedResults.FirstOrDefault()?.SelectedCard;

            if ((base.GameController.IsCardInPlayAndNotUnderCard(base.PsionicTorrentIdentifier) || base.GameController.IsCardInPlayAndNotUnderCard(base.ToxicCloudIdentifier)) && target != null)
            {
                ReduceDamageStatusEffect rdse = new ReduceDamageStatusEffect(1);
                rdse.SourceCriteria.IsSpecificCard = target;
                rdse.UntilStartOfNextTurn(this.TurnTaker);
                rdse.UntilCardLeavesPlay(target);
                coroutine = AddStatusEffect(rdse, true);
                if (UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            if (base.GameController.IsCardInPlayAndNotUnderCard(base.PsionicTorrentIdentifier) && base.GameController.IsCardInPlayAndNotUnderCard(base.ToxicCloudIdentifier))
            {
                PreventPhaseActionStatusEffect ppase = new PreventPhaseActionStatusEffect();
                ppase.ToTurnPhaseCriteria.Phase     = new Phase?(Phase.PlayCard);
                ppase.ToTurnPhaseCriteria.TurnTaker = base.FindEnvironment(null).TurnTaker;
                ppase.UntilEndOfPhase(base.FindEnvironment(null).TurnTaker, Phase.PlayCard);
                coroutine = AddStatusEffect(ppase, true);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                coroutine = base.GameController.SendMessageAction("Skip the next environment play phase!", Priority.High, GetCardSource(null), null, false);
                if (UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
        }
Example #3
0
        public override IEnumerator Play()
        {
            IEnumerator coroutine;
            Card        characterCard = base.TurnTaker.FindCard("StormTiamatCharacter");

            //If {Tiamat}, The Eye of the Storm is active, she deals each hero target 2+X lightning damage, where X is the number of Element of Lightning cards in the villain trash.
            if (characterCard.IsInPlayAndHasGameText && !characterCard.IsFlipped)
            {
                Func <Card, int?> X = (Card c) => new int?(PlusNumberOfThisCardInTrash(2));
                coroutine = base.DealDamage(characterCard, (Card c) => c.IsHero, X, DamageType.Lightning);

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

            //The hero with the most cards in hand...
            List <TurnTaker> storedResults = new List <TurnTaker>();

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

            if (storedResults.Count <TurnTaker>() > 0)
            {
                //...may not draw cards until the start of the next villain turn.
                TurnTaker isSpecificTurnTaker = storedResults.First <TurnTaker>();
                PreventPhaseActionStatusEffect preventPhaseActionStatusEffect = new PreventPhaseActionStatusEffect();
                preventPhaseActionStatusEffect.ToTurnPhaseCriteria.Phase     = new Phase?(Phase.DrawCard);
                preventPhaseActionStatusEffect.ToTurnPhaseCriteria.TurnTaker = isSpecificTurnTaker;
                preventPhaseActionStatusEffect.UntilStartOfNextTurn(base.TurnTaker);
                coroutine = base.AddStatusEffect(preventPhaseActionStatusEffect);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
        public override IEnumerator Play()
        {
            List <DestroyCardAction> storedResults = new List <DestroyCardAction>();
            IEnumerator coroutine = base.GameController.SelectAndDestroyCard(this.DecisionMaker, new LinqCardCriteria((Card c) => (c.IsOngoing && c.IsVillain) || (c.IsDevice && c.HitPoints <= 6) || (c.IsRelic && c.HitPoints <= 6), "villain ongoing, device with 6 or less HP, or relic with 6 or less HP", false, false, "villain ongoing card, device with 6 or less HP, or relic with 6 or less HP", "villain ongoing cards, devices with 6 or less HP, or relics with 6 or less HP", false), true, storedResults, null, base.GetCardSource(null));

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            List <DestroyCardAction> dca = new List <DestroyCardAction>();

            coroutine = base.GameController.SelectAndDestroyCard(this.DecisionMaker, new LinqCardCriteria((Card c) => IsMicrostorm(c) && c.IsInPlayAndHasGameText, "microstorm", false, false, null, null, false), true, dca, null, null);
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (DidDestroyCard(dca))
            {
                var vilTurnTaker = GameController.AllTurnTakers.Where((TurnTaker tt) => tt.IsVillain || tt.IsVillainTeam);
                var vilToSkip    = vilTurnTaker.FirstOrDefault();
                PreventPhaseActionStatusEffect ppase = new PreventPhaseActionStatusEffect();
                ppase.ToTurnPhaseCriteria.Phase     = new Phase?(Phase.PlayCard);
                ppase.ToTurnPhaseCriteria.TurnTaker = vilToSkip;
                ppase.UntilEndOfPhase(vilToSkip, Phase.PlayCard);
                ppase.NumberOfUses = 1;
                coroutine          = AddStatusEffect(ppase, true);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                coroutine = base.GameController.SendMessageAction("Skip the next villain play phase!", Priority.High, GetCardSource(null), null, false);
                if (UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                yield break;
            }
        }
Example #5
0
        public override IEnumerator Play()
        {
            List <DiscardCardAction> storedResults = new List <DiscardCardAction>();
            IEnumerator coroutine = base.SelectAndDiscardCards(this.DecisionMaker, null, false, new int?(0), storedResults, false, null, null, null, SelectionType.DiscardCard, null);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            int numberOfCardsDiscarded = base.GetNumberOfCardsDiscarded(storedResults);

            if (numberOfCardsDiscarded > 0)
            {
                coroutine = base.DrawCards(this.DecisionMaker, numberOfCardsDiscarded, false, false, null, true, null);
            }
            else
            {
                coroutine = base.GameController.SendMessageAction(base.TurnTaker.Name + " did not discard any cards, so no cards will be drawn.", Priority.High, base.GetCardSource(null), null, true);
            }
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (numberOfCardsDiscarded >= 4)
            {
                PreventPhaseActionStatusEffect ppase = new PreventPhaseActionStatusEffect();
                ppase.ToTurnPhaseCriteria.Phase     = Phase.PlayCard;
                ppase.ToTurnPhaseCriteria.TurnTaker = this.TurnTaker;
                ppase.NumberOfUses = 1;
                ppase.CardSource   = this.Card;
                coroutine          = AddStatusEffect(ppase, true);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
        public override IEnumerator Play()
        {
            //Destroy an Environment Card.

            IEnumerator coroutine = GameController.SelectAndDestroyCard(HeroTurnTakerController, new LinqCardCriteria((Card c) => c.IsEnvironment, "environment"), false, cardSource: GetCardSource());

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

            //Select a Villain Deck. Until the start of {Rockstar}'s next turn, the target deck may not play cards.
            List <SelectLocationDecision> storedResults = new List <SelectLocationDecision>();

            coroutine = GameController.SelectADeck(DecisionMaker, SelectionType.CannotPlayCards, loc => loc.IsVillain, storedResults, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (DidSelectLocation(storedResults))
            {
                Location targetDeck = GetSelectedLocation(storedResults);
                CannotPlayCardsStatusEffect cannotPlayCardsStatusEffect = new CannotPlayCardsStatusEffect();
                cannotPlayCardsStatusEffect.CardCriteria.NativeDeck = targetDeck;
                cannotPlayCardsStatusEffect.UntilStartOfNextTurn(TurnTaker);
                coroutine = AddStatusEffect(cannotPlayCardsStatusEffect);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                if (!targetDeck.IsSubDeck)
                {
                    PreventPhaseActionStatusEffect preventPhaseActionStatusEffect = new PreventPhaseActionStatusEffect();
                    preventPhaseActionStatusEffect.ToTurnPhaseCriteria.Phase     = Phase.PlayCard;
                    preventPhaseActionStatusEffect.ToTurnPhaseCriteria.TurnTaker = targetDeck.OwnerTurnTaker;
                    preventPhaseActionStatusEffect.UntilStartOfNextTurn(TurnTaker);
                    coroutine = AddStatusEffect(preventPhaseActionStatusEffect);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine);
                    }
                }
            }

            //The Villain target with the highest HP deals Rockstar 3 Irreducible Projectile Damage.
            List <Card>      storedVillainResults = new List <Card>();
            DealDamageAction gameAction           = new DealDamageAction(GameController, null, CharacterCard, 3, DamageType.Projectile, isIrreducible: true);

            coroutine = base.GameController.FindTargetWithHighestHitPoints(1, (Card card) => IsVillainTarget(card), storedVillainResults, gameAction, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            Card card2 = storedVillainResults.FirstOrDefault();

            if (card2 != null)
            {
                coroutine = DealDamage(card2, CharacterCard, 3, DamageType.Projectile, isIrreducible: true, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }