Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        public void Forewarned_YesIndestructible()
        {
            SetupGameController("BaronBlade", "Cauldron.Vanish", "Ra", "TheWraith", "Megalopolis");
            StartGame();

            RemoveMobileDefensePlatform();

            DiscardAllCards(vanish, ra, wraith);

            var card = PlayCard("Forewarned");

            AssertInPlayArea(vanish, card);

            DecisionYesNo = true;

            var effect = new MakeIndestructibleStatusEffect();

            effect.UntilCardLeavesPlay(card);
            effect.CardsToMakeIndestructible.IsSpecificCard = card;
            effect.CardSource = card;
            var cardSource = GetCardController(card).GetCardSource();

            RunCoroutine(GameController.AddStatusEffect(effect, true, cardSource));

            QuickHandStorage(vanish, ra, wraith);
            GoToStartOfTurn(vanish);

            QuickHandCheck(0, 0, 0);
            AssertInPlayArea(vanish, card);
        }
Exemplo n.º 3
0
        public void TestIronRetortDestroyIndestructible()
        {
            SetupGameController("Apostate", "Cauldron.Quicksilver", "Legacy", "Ra", "RookCity");
            StartGame();

            DealDamage(apostate, quicksilver, 10, DamageType.Cold);
            Card melee  = PutInHand("FrenziedMelee");
            Card retort = PlayCard("IronRetort");

            AssertInPlayArea(quicksilver, retort);

            var effect = new MakeIndestructibleStatusEffect();

            effect.CardSource = quicksilver.CharacterCard;
            effect.UntilEndOfNextTurn(quicksilver.TurnTaker);
            effect.CardsToMakeIndestructible.IsSpecificCard = retort;
            base.RunCoroutine(GameController.AddStatusEffect(effect, false, GetCardController(quicksilver.CharacterCard).GetCardSource()));

            //When {Quicksilver} is dealt damage, you may destroy this card. If you do, you may play a card.
            //we want to destroy, but it fails, so no card is played
            DecisionSelectCardToPlay = melee;
            DecisionYesNo            = true;
            DealDamage(apostate, quicksilver, 2, DamageType.Cold);
            AssertInPlayArea(quicksilver, retort);
            AssertInHand(quicksilver, melee);
        }
        public override IEnumerator UsePower(int index = 0)
        {
            int powerNumeral = this.GetPowerNumeral(0, 1);

            List <PlayCardAction> storedResults = new List <PlayCardAction>();

            IEnumerator coroutine;

            // You may play a Software.
            coroutine = this.GameController.SelectAndPlayCardFromHand(this.HeroTurnTakerController, true, cardCriteria: new LinqCardCriteria((Card c) => c.IsSoftware, "software"), storedResults: storedResults, cardSource: this.GetCardSource());
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            // No successful card play means destroy.
            if (storedResults.Count > 0 && storedResults.FirstOrDefault().WasCardPlayed)
            {
                Card playedCard = storedResults.FirstOrDefault().CardToPlay;
                if (playedCard != null)
                {
                    MakeIndestructibleStatusEffect makeIndestructibleStatusEffect = new MakeIndestructibleStatusEffect();
                    makeIndestructibleStatusEffect.CardsToMakeIndestructible.IsSpecificCard = playedCard;
                    makeIndestructibleStatusEffect.UntilEndOfNextTurn(this.HeroTurnTaker);
                    coroutine = this.AddStatusEffect(makeIndestructibleStatusEffect, true);
                    if (UseUnityCoroutines)
                    {
                        yield return(this.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        this.GameController.ExhaustCoroutine(coroutine);
                    }
                }
            }

            // Deal damage to two targets equal to number of software.
            int amount = this.FindCardsWhere((Card c) => c.IsInPlay && c.IsSoftware).Count();

            coroutine = this.GameController.SelectTargetsAndDealDamage(this.DecisionMaker, new DamageSource(this.GameController, this.CharacterCard), amount, DamageType.Lightning, powerNumeral, false, powerNumeral, cardSource: this.GetCardSource());
            if (UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
        public override IEnumerator UsePower(int index = 0)
        {
            int powerNumeral = this.GetPowerNumeral(0, 1);

            List <SelectCardDecision> storedResults = new List <SelectCardDecision>();

            IEnumerator coroutine;

            MakeIndestructibleStatusEffect makeIndestructibleStatusEffect = new MakeIndestructibleStatusEffect();

            makeIndestructibleStatusEffect.CardsToMakeIndestructible.HasAnyOfTheseKeywords = new List <string>()
            {
                "component"
            };
            makeIndestructibleStatusEffect.CardsToMakeIndestructible.OwnedBy = this.HeroTurnTaker;
            makeIndestructibleStatusEffect.UntilStartOfNextTurn(this.HeroTurnTaker);
            coroutine = this.AddStatusEffect(makeIndestructibleStatusEffect, true);
            if (UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            // Deal damage to a target equal to component count.
            int amount = this.FindCardsWhere((Card c) => c.IsInPlay && c.IsComponent && c.Owner == this.HeroTurnTaker).Count();

            coroutine = this.GameController.SelectTargetsAndDealDamage(this.DecisionMaker, new DamageSource(this.GameController, this.CharacterCard), amount, DamageType.Lightning, powerNumeral, false, powerNumeral, cardSource: this.GetCardSource());
            if (UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            // Deal self damage.
            coroutine = this.GameController.DealDamageToTarget(new DamageSource(this.GameController, this.CharacterCard), this.CharacterCard, amount, DamageType.Lightning, cardSource: this.GetCardSource(null));
            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
Exemplo n.º 6
0
        public void JauntingReflex_UsePowerIndestructible()
        {
            SetupGameController("BaronBlade", "Cauldron.Vanish", "Ra", "TheWraith", "Megalopolis");
            StartGame();

            var card = PlayCard("JauntingReflex");

            AssertInPlayArea(vanish, card);

            var effect = new MakeIndestructibleStatusEffect();

            effect.CardsToMakeIndestructible.IsSpecificCard = card;
            effect.UntilThisTurnIsOver(base.GameController.Game);
            base.RunCoroutine(GameController.AddStatusEffect(effect, false, base.GetCardController(card).GetCardSource()));

            QuickHandStorage(vanish, ra, wraith);
            UsePower(card);
            //card not destroyed, no cards drawn
            AssertInPlayArea(vanish, card);
            QuickHandCheck(0, 0, 0);
        }
Exemplo n.º 7
0
        private IEnumerator SetRoomsIndestructibleResponse(GameAction ga)
        {
            //room cards become indestructible until the end of the turn
            base.SetCardPropertyToTrueIfRealAction("Indestructible", null);
            MakeIndestructibleStatusEffect makeIndestructibleStatusEffect = new MakeIndestructibleStatusEffect();

            makeIndestructibleStatusEffect.CardsToMakeIndestructible.HasAnyOfTheseKeywords = new List <string>()
            {
                "room"
            };
            makeIndestructibleStatusEffect.ToTurnPhaseExpiryCriteria.Phase = new Phase?(Phase.End);
            IEnumerator coroutine = base.AddStatusEffect(makeIndestructibleStatusEffect, true);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
Exemplo n.º 8
0
        public override IEnumerator UsePower(int index = 0)
        {
            int powerNumeral = this.GetPowerNumeral(0, 2);
            List <SelectCardDecision> storedResults = new List <SelectCardDecision>();

            IEnumerator coroutine;

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

            // Select a construct target.
            coroutine = this.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.SelectTargetFriendly,
                                                                      new LinqCardCriteria((Card c) => c.IsInPlayAndHasGameText && c.IsConstruct && c.IsTarget, "construct target"),
                                                                      storedResults, false, cardSource: this.GetCardSource());
            if (UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }

            Card selectedCard = this.GetSelectedCard(storedResults);

            if (selectedCard != null)
            {
                // Make Indestructible.
                MakeIndestructibleStatusEffect mi = new MakeIndestructibleStatusEffect();
                mi.CardsToMakeIndestructible.IsSpecificCard = selectedCard;
                mi.UntilStartOfNextTurn(this.HeroTurnTaker);
                coroutine = this.GameController.AddStatusEffect(mi, true, this.GetCardSource());
                if (UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }

                // Construct Damages Self.
                coroutine = this.GameController.DealDamageToTarget(new DamageSource(this.GameController, selectedCard), selectedCard, powerNumeral, DamageType.Energy, cardSource: this.GetCardSource(null));
                if (this.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }
            }
        }
        public override IEnumerator UsePower(int index = 0)
        {
            int powerNumeral = this.GetPowerNumeral(0, 1);

            List <SelectCardsDecision> storedResults = new List <SelectCardsDecision>();

            IEnumerator coroutine;

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

            if (this.FindCardsWhere((Card c) => c.IsInPlayAndHasGameText && c.IsOngoing && c.Owner == this.HeroTurnTaker).Count() > 0)
            {
                // Select an ongoing.
                coroutine = this.GameController.SelectCardsAndStoreResults(this.DecisionMaker, SelectionType.MakeIndestructible,
                                                                           (Card c) => c.IsInPlayAndHasGameText && c.IsOngoing && c.Owner == this.HeroTurnTaker, powerNumeral,
                                                                           storedResults, false, powerNumeral, cardSource: this.GetCardSource());
                if (UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }

                List <Card> selectedCards = this.GetSelectedCards(storedResults).ToList();
                if (selectedCards != null && selectedCards.Count() > 0)
                {
                    MakeIndestructibleStatusEffect makeIndestructibleStatusEffect = new MakeIndestructibleStatusEffect();
                    makeIndestructibleStatusEffect.CardsToMakeIndestructible.IsOneOfTheseCards = selectedCards;
                    makeIndestructibleStatusEffect.CardsToMakeIndestructible.OwnedBy           = this.HeroTurnTaker;
                    makeIndestructibleStatusEffect.UntilEndOfNextTurn(this.HeroTurnTaker);
                    coroutine = this.AddStatusEffect(makeIndestructibleStatusEffect, true);
                    if (UseUnityCoroutines)
                    {
                        yield return(this.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        this.GameController.ExhaustCoroutine(coroutine);
                    }
                }
            }
            else
            {
                string turnTakerName;

                // Set up response.
                if (base.TurnTaker.IsHero)
                {
                    turnTakerName = this.TurnTaker.Name;
                }
                else
                {
                    turnTakerName = this.Card.Title;
                }
                coroutine = this.GameController.SendMessageAction(turnTakerName + " does not have any Ongoings in play, so he cannot make any indestructible. Whoops!", Priority.Medium, this.GetCardSource(), null, true);
                if (this.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(coroutine);
                }
            }
        }
        public IEnumerator WouldLeavePlayResponse(GameAction ga)
        {
            // "When this card would leave play, instead..."
            IEnumerator replaceCoroutine = base.GameController.CancelAction(ga, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(replaceCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(replaceCoroutine);
            }
            // "... it and the target it's next to each regain 5 HP..."
            List <Card> toHeal = new List <Card>();

            toHeal.Add(base.Card);
            if (GetCardThisCardIsNextTo() != null)
            {
                toHeal.Add(GetCardThisCardIsNextTo());
            }
            IEnumerator healCoroutine = base.GameController.GainHP(base.DecisionMaker, (Card c) => toHeal.Contains(c), 5, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(healCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(healCoroutine);
            }
            // "... then move it next to the non-Antibody non-[b]tagged[/b] target with the third lowest HP..."
            List <Card> match         = new List <Card>();
            IEnumerator findCoroutine = base.GameController.FindTargetWithLowestHitPoints(3, (Card c) => !c.DoKeywordsContain("antibody") && !IsTagged(c), match, evenIfCannotDealDamage: true, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(findCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(findCoroutine);
            }
            if (match != null && match.Count() > 0)
            {
                Card        selected        = match.FirstOrDefault();
                IEnumerator attachCoroutine = base.GameController.MoveCard(base.TurnTakerController, base.Card, selected.NextToLocation, playCardIfMovingToPlayArea: false, responsibleTurnTaker: base.TurnTaker, evenIfIndestructible: true, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(attachCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(attachCoroutine);
                }
            }
            // "... and it becomes indestructible until the end of the turn."
            MakeIndestructibleStatusEffect dontDestroyAgain = new MakeIndestructibleStatusEffect();

            dontDestroyAgain.CardsToMakeIndestructible.IsSpecificCard = base.Card;
            dontDestroyAgain.UntilThisTurnIsOver(base.Game);
            IEnumerator statusCoroutine = base.GameController.AddStatusEffect(dontDestroyAgain, true, GetCardSource());

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