Exemple #1
0
        public IEnumerator DamageOrDiscardResponse(GameAction ga)
        {
            // "... this card deals itself X + 2 psychic damage unless one player discards a card."
            DealDamageAction         preview = new DealDamageAction(GetCardSource(), new DamageSource(base.GameController, base.Card), base.Card, NumberOfImperialTargetsInPlay() + 2, DamageType.Psychic);
            List <DiscardCardAction> discard = new List <DiscardCardAction>();
            IEnumerator selectCoroutine      = base.GameController.SelectHeroToDiscardCard(DecisionMaker, optionalSelectHero: true, optionalDiscardCard: true, additionalHeroCriteria: new LinqTurnTakerCriteria((TurnTaker tt) => tt.IsHero && !tt.IsIncapacitatedOrOutOfGame && tt.ToHero().HasCardsInHand), storedResultsDiscard: discard, gameAction: preview, cardSource: GetCardSource());

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

            if (!DidDiscardCards(discard, 1, orMore: true))
            {
                IEnumerator damageCoroutine = DealDamage(base.Card, base.Card, NumberOfImperialTargetsInPlay() + 2, DamageType.Psychic, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(damageCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(damageCoroutine);
                }
            }
            yield break;
        }
Exemple #2
0
        private IEnumerator RedirectResponse(DealDamageAction dd)
        {
            //find the hero target with the highest hp
            List <Card> storedResults = new List <Card>();
            IEnumerator coroutine     = base.GameController.FindTargetWithHighestHitPoints(1, (Card c) => c.IsHero && c.IsTarget, storedResults, null, null, false, false, null, false, base.GetCardSource(null));

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            Card card = storedResults.FirstOrDefault <Card>();

            if (card != null)
            {
                //redirect damage to that target
                coroutine = base.GameController.RedirectDamage(dd, card, false, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
Exemple #3
0
        public IEnumerator DeadEndJobDealingDamageResponse(DealDamageAction dda)
        {
            // "As long as {Momentum} has more than..."
            Card momentum   = base.TurnTaker.FindCard("MomentumCharacter");
            int  momentumHP = momentum.HitPoints.Value;

            // "... {H * 3} HP, damage dealt by {Breakaway} is irreducible."
            if (momentumHP > Game.H * 3)
            {
                IEnumerator irreducibleCoroutine = base.GameController.MakeDamageIrreducible(dda, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(irreducibleCoroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(irreducibleCoroutine);
                }
            }
            // "... {H} HP, increase damage dealt by {Breakaway} by 1."
            if (momentumHP > Game.H)
            {
                IEnumerator increaseCoroutine = base.GameController.IncreaseDamage(dda, 1, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(increaseCoroutine));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(increaseCoroutine);
                }
            }
            yield break;
        }
 private IEnumerator MaybeIncreaseDamageByHeroTargetResponse(DealDamageAction dd)
 {
     if (base.GameController.PretendMode)
     {
         List <bool> storedResults = new List <bool>();
         IEnumerator coroutine     = base.DetermineIfGivenCardIsTargetWithLowestOrHighestHitPoints(dd.DamageSource.Card, highest: true, (Card c) => c.IsHero && c.IsTarget && c.IsInPlayAndHasGameText, dd, storedResults);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine);
         }
         PerformIncrease = storedResults.Count() > 0 && storedResults.First();
     }
     if (PerformIncrease.HasValue && PerformIncrease.Value)
     {
         IEnumerator coroutine2 = base.GameController.IncreaseDamage(dd, 1, cardSource: base.GetCardSource());
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine2));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine2);
         }
     }
     if (!base.GameController.PretendMode)
     {
         PerformIncrease = null;
     }
 }
Exemple #5
0
        private IEnumerator DamagePreventionResponse(DealDamageAction dd)
        {
            List <YesNoCardDecision> storedResults = new List <YesNoCardDecision>();
            List <Card> list = new List <Card>();

            list.Add(base.Card);
            IEnumerator coroutine2 = base.GameController.MakeYesNoCardDecision(this.DecisionMaker, SelectionType.PreventDamage, base.Card, dd, storedResults, list, base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine2));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine2);
            }
            YesNoCardDecision yesNoCardDecision = storedResults.FirstOrDefault();

            if (yesNoCardDecision.Answer != null && yesNoCardDecision.Answer.Value)
            {
                base.SetCardPropertyToTrueIfRealAction("PreventionUsed");
                coroutine2 = base.CancelAction(dd, true, true, null, true);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine2));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine2);
                }
            }

            yield break;
        }
        public IEnumerator RedirectDestroyResponse(DealDamageAction dda)
        {
            // "... you may redirect that damage to a target of your choice."
            IEnumerator redirectCoroutine = base.GameController.SelectTargetAndRedirectDamage(base.HeroTurnTakerController, (Card c) => c.IsTarget, dda, optional: true, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(redirectCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(redirectCoroutine);
            }
            // "Then, destroy this card."
            IEnumerator destructCoroutine = base.GameController.DestroyCard(base.HeroTurnTakerController, base.Card, responsibleCard: base.Card, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(destructCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(destructCoroutine);
            }
            yield break;
        }
Exemple #7
0
        private IEnumerator ReduceDamageResponse(DealDamageAction dd)
        {
            List <DiscardCardAction> storedResults = new List <DiscardCardAction>();
            IEnumerator coroutine = base.SelectAndDiscardCards(base.HeroTurnTakerController, new int?(1), true, null, storedResults, false, null, null, null, SelectionType.DiscardCard, null);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (base.GetNumberOfCardsDiscarded(storedResults) == 1)
            {
                this.SetCardPropertyToTrueIfRealAction("KyossDiscardedToReduceDamage", null);
                coroutine = base.GameController.ReduceDamage(dd, 1, this._reduceTrigger, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
        }
Exemple #8
0
        public IEnumerator ReduceRetaliateResponse(DealDamageAction dda)
        {
            SetCardPropertyToTrueIfRealAction(OncePerTurn);
            // "... reduce damage dealt to {FractureCharacter} this turn by 1..."
            ReduceDamageStatusEffect protection = new ReduceDamageStatusEffect(1);

            protection.TargetCriteria.IsSpecificCard = base.CharacterCard;
            protection.UntilThisTurnIsOver(base.Game);
            IEnumerator statusCoroutine = base.GameController.AddStatusEffect(protection, true, GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(statusCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(statusCoroutine);
            }
            // "... and {FractureCharacter} may deal the source of that damage 1 psychic damage."
            if (dda.DamageSource != null && dda.DamageSource.IsTarget)
            {
                IEnumerator damageCoroutine = DealDamage(base.CharacterCard, dda.DamageSource.Card, 1, DamageType.Psychic, optional: true, isCounterDamage: true, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(damageCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(damageCoroutine);
                }
            }
            yield break;
        }
        private IEnumerator AdvancedResponse(DealDamageAction dd)
        {
            //That player must discard a card.
            HeroTurnTakerController hero = FindHeroTurnTakerController(dd.Target.Owner.ToHero());

            return(GameController.SelectAndDiscardCard(hero, cardSource: GetCardSource()));
        }
Exemple #10
0
 public IEnumerator PreventAndDestroy(DealDamageAction dda, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
 {
     if (!dda.IsPretend && effect.UsePowerExpiryCriteria.IsSpecificCard != base.Card)
     {
         effect.UsePowerExpiryCriteria.IsSpecificCard = base.Card;
         // "... prevent that damage..."
         IEnumerator preventCoroutine = GameController.CancelAction(dda, isPreventEffect: true, cardSource: GetCardSource());
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(preventCoroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(preventCoroutine);
         }
         // "... and you may destroy an environment card."
         IEnumerator destroyCoroutine = GameController.SelectAndDestroyCard(base.HeroTurnTakerController, new LinqCardCriteria((Card c) => c.IsEnvironment && c.IsInPlay, "environment"), true, responsibleCard: base.Card, cardSource: GetCardSource());
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(destroyCoroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(destroyCoroutine);
         }
     }
     yield break;
 }
        private IEnumerator Protect(DealDamageAction arg)
        {
            List <YesNoCardDecision> cardDecisions = new List <YesNoCardDecision>();
            var doIt = this.GameController.MakeYesNoCardDecision(DecisionMaker, SelectionType.MoveCardFromUnderCard, Card, arg, cardDecisions, null, GetCardSource());

            if (UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(doIt));
            }
            else
            {
                this.GameController.ExhaustCoroutine(doIt);
            }
            if (DidPlayerAnswerYes(cardDecisions))
            {
                var redirect = RedirectDamage(arg, TargetType.SelectTarget, c => c == Card);
                if (UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(redirect));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(redirect);
                }
            }
        }
Exemple #12
0
        private IEnumerator RedirectDamageResponse(DealDamageAction dd)
        {
            List <bool> shouldRedirect = new List <bool>();
            IEnumerator coroutine      = DetermineIfGivenCardIsTargetWithLowestOrHighestHitPoints(dd.Target, highest: true, (Card card) => card.IsHero && GameController.IsCardVisibleToCardSource(card, GetCardSource()), dd, shouldRedirect);

            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            if (!shouldRedirect.First())
            {
                yield break;
            }

            coroutine = GameController.RedirectDamage(dd, CharacterCard, isOptional: true, cardSource: GetCardSource());
            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }

            yield break;
        }
Exemple #13
0
        private IEnumerator DealDamageResponse(PhaseChangeAction phaseChange)
        {
            //Anathema deals the Hero character with the highest HP {H+1} melee damage..
            List <DealDamageAction> storedResults = new List <DealDamageAction>();
            IEnumerator             coroutine     = base.DealDamageToHighestHP(base.CharacterCard, 1, (Card c) => c.IsHeroCharacterCard, (Card c) => new int?(base.H + 1), DamageType.Melee, storedResults: storedResults);

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

            //If that Hero takes damage this way, they must destroy 1 of their ongoing cards.
            if (dd != null && dd.DidDealDamage && DidIntendedTargetTakeDamage(new DealDamageAction[] { dd }, dd.OriginalTarget))
            {
                HeroTurnTakerController httc = base.FindHeroTurnTakerController(dd.Target.Owner.ToHero());
                coroutine = base.GameController.SelectAndDestroyCard(httc, new LinqCardCriteria((Card c) => c.IsOngoing && c.Owner == dd.Target.Owner, "ongoing"), false, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
 public IEnumerator MaybeReduceDamageTakenResponse(DealDamageAction dda)
 {
     if (base.GameController.PretendMode)
     {
         List <bool> response       = new List <bool>();
         IEnumerator checkCoroutine = DetermineIfGivenCardIsTargetWithLowestOrHighestHitPoints(dda.Target, false, (Card c) => c.IsVillain, dda, response);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(checkCoroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(checkCoroutine);
         }
         PerformReduceTo = response.Count() > 0 && response.First();
     }
     if (PerformReduceTo.HasValue && PerformReduceTo.Value)
     {
         IEnumerator reduceCoroutine = base.GameController.ReduceDamage(dda, 2, reduceDamageToLowest, GetCardSource());
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(reduceCoroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(reduceCoroutine);
         }
     }
     if (!base.GameController.PretendMode)
     {
         PerformReduceTo = null;
     }
     yield break;
 }
        private IEnumerator RedirectDamageResponse(DealDamageAction dealDamage)
        {
            //you may redirect that damage to a hero with higher HP.

            //select hero with a higher hp
            List <SelectCardDecision> storedResults = new List <SelectCardDecision>();
            IEnumerator coroutine2 = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.RedirectDamage, new LinqCardCriteria((Card c) => c.IsHeroCharacterCard && c.HitPoints.Value > base.GetCardThisCardIsNextTo(true).HitPoints, "a hero with higher HP"), storedResults, true);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine2));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine2);
            }
            if (storedResults.Count <SelectCardDecision>() > 0)
            {
                //redirect the damage to them
                Card        newTarget  = storedResults.First().SelectedCard;
                IEnumerator coroutine3 = base.GameController.RedirectDamage(dealDamage, newTarget, false, base.GetCardSource(null));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine3));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine3);
                }
            }
            yield break;
        }
Exemple #16
0
        public IEnumerator SplashDamageResponse(DealDamageAction dda)
        {
            base.SetCardPropertyToTrueIfRealAction(OncePerTurn);
            // "... this card deals 1 infernal damage to each non-environment target in the damaged target's play area."
            Card     originalTarget = dda.Target;
            Location splashZone     = null;

            if (originalTarget.IsInPlay)
            {
                // If it's in play, its play area is its current location
                splashZone = originalTarget.Location.HighestRecursiveLocation;
            }
            else
            {
                // If not, its play area is the play area associated with its deck
                splashZone = originalTarget.Owner.PlayArea;
            }
            IEnumerator damageCoroutine = base.DealDamage(base.Card, (Card c) => !c.IsEnvironment && c.Location.HighestRecursiveLocation == splashZone, 1, DamageType.Infernal);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(damageCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(damageCoroutine);
            }
            yield break;
        }
        public IEnumerator MaybeRedirectDamageResponse(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
        {
            //...you may redirect that damage to Titan.
            var storedYesNo       = new List <YesNoCardDecision> {
            };
            IEnumerator coroutine = GameController.MakeYesNoCardDecision(FindHeroTurnTakerController(hero.ToHero()), SelectionType.RedirectDamage, this.Card, storedResults: storedYesNo, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (DidPlayerAnswerYes(storedYesNo))
            {
                coroutine = RedirectDamage(dd, TargetType.SelectTarget, (Card c) => hero.CharacterCards.Contains(c));
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
        public IEnumerator ReduceAndInvertResponse(DealDamageAction dda)
        {
            // "... reduce that damage by 1 and change its damage type to the type that wasn't chosen."
            DamageType invertedType = DamageType.Energy;

            if (MostRecentChosen().Value == DamageType.Fire)
            {
                invertedType = DamageType.Cold;
            }
            else
            {
                invertedType = DamageType.Fire;
            }
            IEnumerator reduceCoroutine = base.GameController.ReduceDamage(dda, 1, ReduceDamageTrigger, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(reduceCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(reduceCoroutine);
            }
            IEnumerator invertCoroutine = base.GameController.ChangeDamageType(dda, invertedType, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(invertCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(invertCoroutine);
            }
            yield break;
        }
        private IEnumerator FirstTimeDealDamageResponse(DealDamageAction action)
        {
            base.SetCardPropertyToTrueIfRealAction(FirstTimeDealDamage);
            //Increase damage dealt to Obstacles by 1 by the first hero target damaged by {Phase} each round.
            //...by 1...
            IncreaseDamageStatusEffect statusEffect = new IncreaseDamageStatusEffect(1);

            //...by the first hero target damaged by {Phase}...
            statusEffect.SourceCriteria.IsSpecificCard = action.Target;
            //...dealt to Obstacles...
            statusEffect.TargetCriteria.HasAnyOfTheseKeywords = new List <string>()
            {
                "obstacle"
            };
            //...each round.
            statusEffect.UntilStartOfNextTurn(base.TurnTaker);
            IEnumerator coroutine = base.AddStatusEffect(statusEffect);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
        public IEnumerator HealAttackResponse(DealDamageAction dda)
        {
            // "... this card regains {H - 1} HP..."
            IEnumerator healCoroutine = base.GameController.GainHP(base.Card, base.H - 1, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(healCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(healCoroutine);
            }
            // "... and deals the {H - 1} non-Pathogen targets with the highest HP 1 toxic damage each."
            IEnumerator attackCoroutine = DealDamageToHighestHP(base.Card, 1, (Card c) => !c.DoKeywordsContain("pathogen"), (Card c) => 1, DamageType.Toxic, numberOfTargets: () => base.H - 1);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(attackCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(attackCoroutine);
            }
            yield break;
        }
Exemple #21
0
        private IEnumerator MoveCardResponse(DealDamageAction action)
        {
            //...you may put the top card of your deck beneath this one.
            List <YesNoCardDecision> storedResults = new List <YesNoCardDecision>();
            IEnumerator coroutine = base.GameController.MakeYesNoCardDecision(base.HeroTurnTakerController, SelectionType.MoveCardToUnderCard, base.Card, storedResults: storedResults, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (DidPlayerAnswerYes(storedResults))
            {
                coroutine = base.GameController.MoveCard(base.TurnTakerController, base.TurnTaker.Deck.TopCard, base.Card.UnderLocation, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
        private IEnumerator HeroDamagedResponse(DealDamageAction action)
        {
            List<DiscardCardAction> results = new List<DiscardCardAction>();
            var coroutine = GameController.SelectAndDiscardCard(DecisionMaker, optional: true, storedResults: results, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return base.GameController.StartCoroutine(coroutine);
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }

            if (DidDiscardCards(results, 1))
            {
                base.SetCardPropertyToTrueIfRealAction(TrackingKey);

                coroutine = GameController.SelectAndUsePower(DecisionMaker, optional: true, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return base.GameController.StartCoroutine(coroutine);
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
        }
Exemple #23
0
        private IEnumerator DealDamageResponse(DealDamageAction dda)
        {
            if (dda.IsPretend)
            {
                IEnumerator pretend = base.CancelAction(dda);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(pretend));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(pretend);
                }
            }
            else
            {
                int damageToDeal = this.Game.H - 2;

                IEnumerator dealDamageRoutine = this.DealDamage(dda.Target, dda.DamageSource.Card, damageToDeal, DamageType.Radiant, isCounterDamage: true, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(dealDamageRoutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(dealDamageRoutine);
                }
            }
        }
        private IEnumerator PreventDamageDecision(DealDamageAction dd)
        {
            //Offer the player a yes/no decision if they want to prevent the damage
            //This currently doesn't have any text on the decision other than yes/no, room for improvement
            List <Card> list = new List <Card>();

            list.Add(base.Card);
            YesNoDecision yesNo     = new YesNoDecision(base.GameController, base.HeroTurnTakerController, SelectionType.PreventDamage, false, dd, list, base.GetCardSource(null));
            IEnumerator   coroutine = base.GameController.MakeDecisionAction(yesNo, true);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            //if player said yes, set BuffUsed to true and prevent the damage
            if (yesNo.Answer != null && yesNo.Answer.Value)
            {
                base.CharacterCardController.SetCardPropertyToTrueIfRealAction("PreventionUsed", null);
                IEnumerator coroutine2 = base.CancelAction(dd, true, true, null, true);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine2));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine2);
                }
            }
            yield break;
        }
 private IEnumerator PreventDamageAndScatterResponse(DealDamageAction dd)
 {
     StatusEffect[] statusEffects = base.Game.StatusEffects.Where((StatusEffect effect) => effect.CardSource == this.Card && effect.CardDestroyedExpiryCriteria.Card == base.CharacterCard).ToArray();
     if (statusEffects.Any())
     {
         foreach (StatusEffect status in statusEffects)
         {
             var         damageType   = dd.DamageType;
             int         numOfTargets = dd.Amount;
             int         damageAmount = status.NumberOfUses.Value;
             IEnumerator coroutine    = base.GameController.SelectTargetsAndDealDamage(base.HeroTurnTakerController, dd.DamageSource, damageAmount, damageType, numOfTargets, false, 0, false, false, false, (Card c) => c != base.CharacterCard, null, null, null, null, false, null, null, false, null, GetCardSource(null));
             if (UseUnityCoroutines)
             {
                 yield return(base.GameController.StartCoroutine(coroutine));
             }
             else
             {
                 base.GameController.ExhaustCoroutine(coroutine);
             }
             base.AddCardPropertyJournalEntry(PreventAndScatterPropertyKey, (bool?)null);
             base.GameController.StatusEffectManager.RemoveStatusEffect(status);
         }
     }
     yield break;
 }
Exemple #26
0
        private IEnumerator IncreaseDamageDecision(DealDamageAction dd)
        {
            //Offer the player a yes/no decision if they want to increase that damage by 2
            //This currently doesn't have any text on the decision other than yes/no, room for improvement

            List <YesNoCardDecision> storedResults = new List <YesNoCardDecision>();
            IEnumerator coroutine = base.GameController.MakeYesNoCardDecision(DecisionMaker, SelectionType.IncreaseNextDamage, base.Card,
                                                                              action: dd,
                                                                              storedResults: storedResults,
                                                                              cardSource: base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (base.DidPlayerAnswerYes(storedResults))
            {
                //if player said yes, set BuffUsed to true and Increase Damage
                base.SetCardPropertyToTrueIfRealAction("BuffUsed");
                coroutine = base.GameController.IncreaseDamage(dd, 2, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
Exemple #27
0
        private IEnumerator IncreaseOrDiscardResponse(DealDamageAction action)
        {
            HeroTurnTakerController  target        = base.FindHeroTurnTakerController(action.Target.Owner.ToHero());
            List <DiscardCardAction> storedResults = new List <DiscardCardAction>();
            IEnumerator coroutine = base.GameController.SelectAndDiscardCards(base.FindHeroTurnTakerController(action.Target.Owner.ToHero()), new int?(1), true, new int?(1), storedResults: storedResults);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (DidDiscardCards(storedResults, 0))
            {
                coroutine = base.GameController.IncreaseDamage(action, 1, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
 private IEnumerator MaybeReduceDamageToVillainTargetResponse(DealDamageAction dd)
 {
     if (GameController.PretendMode)
     {
         List <bool> storedResults = new List <bool>();
         IEnumerator coroutine     = DetermineIfGivenCardIsTargetWithLowestOrHighestHitPoints(dd.Target, highest: false, (Card c) => IsVillainTarget(c) && c != CharacterCard && c.IsInPlayAndHasGameText, dd, storedResults);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine);
         }
         PerformReduction = storedResults.Count() > 0 && storedResults.First();
     }
     if (PerformReduction.HasValue && PerformReduction.Value)
     {
         IEnumerator coroutine2 = GameController.ReduceDamage(dd, 2, _reduceDamageTrigger, GetCardSource());
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine2));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine2);
         }
     }
     if (!GameController.PretendMode)
     {
         PerformReduction = null;
     }
 }
Exemple #29
0
        private IEnumerator ChangePursuedResponse(DealDamageAction action)
        {
            Card pursuit = base.FindCard(SingleMindedPursuitIdent);
            List <YesNoCardDecision> storedResults = new List <YesNoCardDecision>();
            IEnumerator coroutine = base.GameController.MakeYesNoCardDecision(this.DecisionMaker, SelectionType.MoveCardNextToCard, pursuit, storedResults: storedResults, associatedCards: action.Target.ToEnumerable <Card>());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (base.DidPlayerAnswerYes(storedResults))
            {
                coroutine = base.GameController.MoveCard(base.TurnTakerController, pursuit, action.Target.NextToLocation, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
        }
        private IEnumerator RedirectResponse(DealDamageAction action)
        {
            List <Card> storedResults = new List <Card>();
            IEnumerator coroutine     = base.GameController.FindTargetWithHighestHitPoints(1, (Card c) => c.IsHero, storedResults, cardSource: base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            Card card = storedResults.FirstOrDefault <Card>();

            if (action.IsRedirectable && card != null)
            {
                coroutine = base.GameController.RedirectDamage(action, card, cardSource: base.GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }