Exemplo n.º 1
0
        protected void AddCannotPlayCardsStatusEffect(TurnTakerController ttc, bool heroesCannotPlay, bool villainsCannotPlay)
        {
            CannotPlayCardsStatusEffect effect = new CannotPlayCardsStatusEffect();

            effect.CardCriteria.IsHero    = new bool?(heroesCannotPlay);
            effect.CardCriteria.IsVillain = new bool?(villainsCannotPlay);
            effect.UntilStartOfNextTurn(ttc.TurnTaker);
            this.RunCoroutine(this.GameController.AddStatusEffect(effect, true, new CardSource(ttc.CharacterCardController)));
        }
Exemplo n.º 2
0
        private void AddCannotPlayCardsStatusEffect(TurnTakerController ttc, bool heroes, bool villains)
        {
            CannotPlayCardsStatusEffect effect = new CannotPlayCardsStatusEffect();

            effect.CardCriteria.IsHero    = heroes;
            effect.CardCriteria.IsVillain = villains;
            effect.UntilStartOfNextTurn(ttc.TurnTaker);
            RunCoroutine(GameController.AddStatusEffect(effect, true, ttc.CharacterCardController.GetCardSource()));
        }
        public override IEnumerator Play()
        {
            IEnumerator coroutine;
            Card        characterCard = base.TurnTaker.FindCard("InfernoTiamatCharacter");

            //If {Tiamat}, The Mouth of the Inferno is active, she deals each hero target 2+X fire damage, where X is the number of Element of Fire 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.Fire);

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

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

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

            if (storedResults.Count <TurnTaker>() > 0)
            {
                //...may not play cards until the start of the next villain turn.
                TurnTaker isSpecificTurnTaker = storedResults.First <TurnTaker>();
                CannotPlayCardsStatusEffect cannotPlayCardsStatusEffect = new CannotPlayCardsStatusEffect();
                cannotPlayCardsStatusEffect.TurnTakerCriteria.IsSpecificTurnTaker = isSpecificTurnTaker;
                cannotPlayCardsStatusEffect.UntilStartOfNextTurn(base.TurnTaker);
                coroutine = base.AddStatusEffect(cannotPlayCardsStatusEffect);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
Exemplo n.º 4
0
 public IEnumerator PreventPlayResponse(List <Card> targets, TurnTaker player)
 {
     // "... cards from that target's deck cannot be played until the start of your turn."
     foreach (Card c in targets)
     {
         //Log.Debug("Creating CannotPlayCardsStatusEffect for " + c.Title);
         //Log.Debug(c.Title + "'s associated deck is " + c.NativeDeck.Identifier);
         //Log.Debug("'You' in this power is " + player.Identifier);
         CannotPlayCardsStatusEffect hinder = new CannotPlayCardsStatusEffect();
         hinder.CardCriteria.NativeDeck = c.NativeDeck;
         hinder.UntilStartOfNextTurn(player);
         IEnumerator statusCoroutine = AddStatusEffect(hinder);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(statusCoroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(statusCoroutine);
         }
     }
     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;
        }