Пример #1
0
        public IEnumerator ReduceToOne(DealDamageAction dda, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
        {
            // "... reduce that damage to 1."
            IEnumerator reduceCoroutine = base.GameController.ReduceDamage(dda, dda.Amount - 1, null, GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(reduceCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(reduceCoroutine);
            }
            yield break;
        }
Пример #2
0
        public void TestDaybreakHeadlongIncap2()
        {
            SetupGameController("BaronBlade", "Chasejyd.Headlong/DaybreakHeadlongCharacter", "Legacy", "Bunker", "TheScholar", "Megalopolis");
            StartGame();
            DestroyNonCharacterVillainCards();

            SetupIncap(baron);
            //Two Players may draw a card.
            DecisionSelectTurnTakers = new TurnTaker[] { bunker.TurnTaker, scholar.TurnTaker };
            QuickHandStorage(legacy, bunker, scholar);

            UseIncapacitatedAbility(headlong, 1);

            QuickHandCheck(0, 1, 1);
        }
Пример #3
0
        public IEnumerator MoveFromTrashToDeckResponse(TurnTaker tt)
        {
            // "... put a card from their trash on the bottom of their deck."
            IEnumerator moveCoroutine = base.GameController.SelectAndMoveCard(base.GameController.FindHeroTurnTakerController(tt.ToHero()), (Card c) => c.IsInLocation(tt.Trash), tt.Deck, toBottom: true, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(moveCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(moveCoroutine);
            }
            yield break;
        }
#pragma warning disable IDE0060 // Remove unused parameter

        public IEnumerator PreventResponse(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
#pragma warning restore IDE0060 // Remove unused parameter
        {
            // Exactly 1 damage is checked in the Criteria, so just prevent the damage.
            IEnumerator coroutine = this.CancelAction(dd, true, true, null, true);

            if (this.UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(coroutine));
            }
            else
            {
                this.GameController.ExhaustCoroutine(coroutine);
            }
        }
Пример #5
0
        public void TacticalRelocation_()
        {
            SetupGameController("BaronBlade", "Cauldron.Vanish", "Ra", "TheWraith", "Megalopolis");
            StartGame();

            DecisionSelectTurnTakers = new TurnTaker[] { ra.TurnTaker, wraith.TurnTaker };
            QuickHPStorage(baron, vanish, ra, wraith);
            //will use the base power and deal some damage or something, don't matter. we just check it was used.
            var card = PlayCard("TacticalRelocation");

            AssertInTrash(vanish, card);

            QuickHPCheck(0, 0, -3, -3);

            Assert.Fail("Test not implemented");
        }
Пример #6
0
        public void TestDaybreakHeadlongInnatePower()
        {
            SetupGameController("BaronBlade", "Chasejyd.Headlong/DaybreakHeadlongCharacter", "Legacy", "Bunker", "TheScholar", "Megalopolis");
            StartGame();

            Card police = PutOnDeck("PoliceBackup");

            //Two Players may draw a card.
            //You may Destroy an Environment Card or Play the top Card of the Environment Deck.
            DecisionSelectFunction   = 1;
            DecisionSelectTurnTakers = new TurnTaker[] { bunker.TurnTaker, scholar.TurnTaker };
            QuickHandStorage(headlong, legacy, bunker, scholar);
            UsePower(headlong);
            QuickHandCheck(0, 0, 1, 1);
            AssertInPlayArea(env, police);
        }
Пример #7
0
        public IEnumerator DiscardOrRemoveChoice(TurnTaker tt, List <MoveCardAction> moveResults)
        {
            // "... reveals the top card of their deck. They may discard it or remove it from the game."
            HeroTurnTakerController player          = base.GameController.FindHeroTurnTakerController(tt.ToHero());
            List <Card>             revealed        = new List <Card>();
            IEnumerator             revealCoroutine = base.GameController.RevealCards(player, tt.Deck, 1, revealed, revealedCardDisplay: RevealedCardDisplay.ShowRevealedCards, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(revealCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(revealCoroutine);
            }
            Card revealedCard = GetRevealedCard(revealed);

            if (revealedCard != null)
            {
                List <Function> options = new List <Function>();
                options.Add(new Function(player, "Discard it", SelectionType.DiscardCard, () => base.GameController.DiscardCard(player, revealedCard, null, responsibleTurnTaker: tt, cardSource: GetCardSource())));
                options.Add(new Function(player, "Remove it from the game", SelectionType.RemoveCardFromGame, () => base.GameController.MoveCard(player, revealedCard, tt.OutOfGame, showMessage: true, responsibleTurnTaker: tt, storedResults: moveResults, cardSource: GetCardSource())));
                List <Card> relevantCards = new List <Card>();
                relevantCards.Add(revealedCard);
                SelectFunctionDecision choice          = new SelectFunctionDecision(base.GameController, player, options, false, associatedCards: relevantCards, cardSource: GetCardSource());
                IEnumerator            chooseCoroutine = base.GameController.SelectAndPerformFunction(choice, null, relevantCards);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(chooseCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(chooseCoroutine);
                }
            }
            IEnumerator cleanCoroutine = CleanupRevealedCards(tt.Revealed, tt.Deck);

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(cleanCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(cleanCoroutine);
            }
            yield break;
        }
Пример #8
0
        public override IEnumerator UsePower(int index = 0)
        {
            int numTargets = GetPowerNumeral(0, 1);
            int damageAmt  = GetPowerNumeral(1, 2);
            // "1 target deals itself 2 irreducible projectile damage."
            List <SelectCardsDecision> selection = new List <SelectCardsDecision>();
            IEnumerator selectCoroutine          = base.GameController.SelectCardsAndStoreResults(base.HeroTurnTakerController, SelectionType.DealDamageSelf, (Card c) => c.IsInPlayAndHasGameText && c.IsTarget, numTargets, selection, false, requiredDecisions: numTargets, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(selectCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(selectCoroutine);
            }
            //Log.Debug("selection.Count(): " + selection.Count().ToString());
            //Log.Debug("selection.Where((SelectCardsDecision dec) => dec != null).Count(): " + selection.Where((SelectCardsDecision dec) => dec != null).Count().ToString());
            //Log.Debug("selection.Where((SelectCardsDecision dec) => dec != null && dec.SelectedCard != null).Count(): " + selection.Where((SelectCardsDecision dec) => dec != null && dec.SelectedCard != null).Count().ToString());
            List <Card> selectedTargets = GetSelectedCards(selection).ToList();
            //Log.Debug("selectedTargets.Count(): " + selectedTargets.Count().ToString());
            IEnumerator selfDamageCoroutine = base.GameController.DealDamageToSelf(base.HeroTurnTakerController, (Card c) => selectedTargets.Contains(c), 2, DamageType.Projectile, isIrreducible: true, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(selfDamageCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(selfDamageCoroutine);
            }
            // "You may destroy this card. If you do, cards from that target's deck cannot be played until the start of your turn."
            TurnTaker youDefinition = base.TurnTaker;
            Func <GameAction, IEnumerator> preventPlayAction = AddBeforeDestroyAction((GameAction ga) => PreventPlayResponse(selectedTargets, youDefinition));
            IEnumerator destructCoroutine = base.GameController.DestroyCard(base.HeroTurnTakerController, base.Card, optional: true, responsibleCard: base.Card, associatedCards: selectedTargets, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(destructCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(destructCoroutine);
            }
            RemoveDestroyAction(BeforeOrAfter.Before, preventPlayAction);
            yield break;
        }
        private IEnumerator DestroyRadiationBackResponse(DestroyCardAction action)
        {
            Card      source = action.GetCardDestroyer();
            TurnTaker responsibleTurnTaker = source?.Owner;

            //Whenever a radiation card is destroyed by a hero card, {Gray} deals that hero {H - 1} energy damage.
            IEnumerator coroutine;

            //if its not a hero destroying it do no damage
            if (responsibleTurnTaker != null && responsibleTurnTaker.IsHero && !responsibleTurnTaker.IsIncapacitatedOrOutOfGame)
            {
                List <Card> results = new List <Card>();
                coroutine = base.FindCharacterCardToTakeDamage(responsibleTurnTaker, results, Card, Game.H - 1, DamageType.Energy);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }

                coroutine = base.DealDamage(base.Card, results.First(), Game.H - 1, DamageType.Energy);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            //Whenever a copy of Radioactive Cascade is destroyed, {Gray} deals the hero with the highest HP {H - 1} energy damage.
            if (action.CardToDestroy.Card.Identifier == "RadioactiveCascade")
            {
                coroutine = base.DealDamageToHighestHP(base.Card, 1, (Card c) => c.IsHero, (Card c) => new int?(Game.H - 1), DamageType.Energy);
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
Пример #10
0
        public IEnumerator StabOrDestroyResponse(PhaseChangeAction pca)
        {
            // "... this card may deal a character card in this play area {H - 1} psychic damage."
            List <DealDamageAction> storedResultsDamage = new List <DealDamageAction>();
            IEnumerator             damageCoroutine     = base.GameController.SelectTargetsAndDealDamage(base.DecisionMaker, new DamageSource(base.GameController, base.Card), Game.H - 1, DamageType.Psychic, 1, false, 0, additionalCriteria: (Card c) => c.IsCharacter && c.Location.HighestRecursiveLocation == base.Card.Location.HighestRecursiveLocation, storedResultsDamage: storedResultsDamage, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(damageCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(damageCoroutine);
            }
            // "If it deals no damage this way, destroy a non-character card from this play area's deck, then destroy this card."
            if (storedResultsDamage == null || storedResultsDamage.Count((DealDamageAction dda) => dda.DidDealDamage) <= 0)
            {
                // Destroy a non-character card from this play area's deck
                TurnTaker host = base.Card.Location.OwnerTurnTaker;
                HeroTurnTakerController boss = DecisionMaker;
                if (host.IsHero)
                {
                    boss = base.GameController.FindHeroTurnTakerController(host.ToHero());
                }
                IEnumerator destroyNonCharacterCoroutine = base.GameController.SelectAndDestroyCard(boss, new LinqCardCriteria((Card c) => c.Owner == host && !c.IsCharacter, "from " + host.Name + "'s deck", useCardsSuffix: false, useCardsPrefix: true), false, responsibleCard: base.Card, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(destroyNonCharacterCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(destroyNonCharacterCoroutine);
                }
                // Destroy this card
                IEnumerator selfDestructCoroutine = base.GameController.DestroyCard(DecisionMaker, base.Card, optional: false, showOutput: true, responsibleCard: base.Card, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(selfDestructCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(selfDestructCoroutine);
                }
            }
            yield break;
        }
Пример #11
0
        public void TestWastelandRoninCricketIncap1()
        {
            SetupGameController("AkashBhuta", "Cauldron.Cricket/WastelandRoninCricketCharacter", "Legacy", "Bunker", "TheScholar", "Magmaria");
            StartGame();
            SetupIncap(akash);

            DecisionSelectTurnTakers = new TurnTaker[] { bunker.TurnTaker, scholar.TurnTaker };
            SetHitPoints(scholar, 17);

            //One hero may use a power now.
            QuickHandStorage(bunker);
            QuickHPStorage(scholar);
            UseIncapacitatedAbility(cricket, 0);
            UseIncapacitatedAbility(cricket, 0);
            QuickHandCheck(1);
            QuickHPCheck(1);
        }
Пример #12
0
 public IEnumerator PlayOngEqp(TurnTaker tt)
 {
     if (tt.IsHero && !tt.IsIncapacitatedOrOutOfGame)
     {
         HeroTurnTakerController httc          = FindHeroTurnTakerController(tt.ToHero());
         IEnumerator             playCoroutine = SelectAndPlayCardFromHand(httc, cardCriteria: new LinqCardCriteria((Card c) => c.DoKeywordsContain("ongoing") || c.DoKeywordsContain("equipment"), "ongoing or equipment"), associateCardSource: true);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(playCoroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(playCoroutine);
         }
     }
     yield break;
 }
 public IEnumerator PreventDamage(DealDamageAction dda, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
 {
     // "[b]BLOCKED[/b] heroes can't deal damage to non-Terrain villain targets."
     if (dda != null && dda.Target != null && dda.Target.IsVillain && !dda.Target.DoKeywordsContain("terrain"))
     {
         IEnumerator preventCoroutine = CancelAction(dda);
         if (base.UseUnityCoroutines)
         {
             yield return(this.GameController.StartCoroutine(preventCoroutine));
         }
         else
         {
             this.GameController.ExhaustCoroutine(preventCoroutine);
         }
     }
     yield break;
 }
Пример #14
0
        private IEnumerator MayDrawTwoDiscardTwo(TurnTaker tt)
        {
            var player = FindHeroTurnTakerController(tt?.ToHero());

            if (player == null)
            {
                yield break;
            }

            var         storedYesNo = new List <YesNoCardDecision>();
            IEnumerator coroutine   = GameController.MakeYesNoCardDecision(player, SelectionType.DiscardAndDrawCard, this.Card, storedResults: storedYesNo, cardSource: GetCardSource());

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

            if (DidPlayerAnswerYes(storedYesNo))
            {
                coroutine = GameController.DrawCards(player, 2, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }

                coroutine = GameController.SelectAndDiscardCards(player, 2, false, 2, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
Пример #15
0
 public IEnumerator WinterDrawCardReponse(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
 {
     //they draw a card
     if (dd.DamageSource != null && dd.DidDealDamage)
     {
         HeroTurnTaker source    = dd.DamageSource.Card.Owner.ToHero();
         IEnumerator   coroutine = base.DrawCard(source);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine);
         }
     }
     yield break;
 }
Пример #16
0
        public void TestTitanIncap1()
        {
            SetupGameController("Apostate", "Cauldron.Titan", "Haka", "Bunker", "TheScholar", "Megalopolis");
            StartGame();
            SetupIncap(apostate);

            DecisionSelectTurnTakers = new TurnTaker[] { haka.TurnTaker, bunker.TurnTaker, scholar.TurnTaker };

            //One player may use a power now.s
            SetHitPoints(scholar, 17);
            QuickHandStorage(bunker);
            QuickHPStorage(apostate, scholar);
            UseIncapacitatedAbility(titan, 0);
            UseIncapacitatedAbility(titan, 0);
            UseIncapacitatedAbility(titan, 0);
            QuickHandCheck(1);
            QuickHPCheck(-2, 1);
        }
        public IEnumerator ChangeDamageTypeResponse(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
        {
            // You may change its type by spending a token

            TokenPool elementPool = base.CharacterCard.FindTokenPool(LadyOfTheWoodElementPoolIdentifier);

            if (elementPool == null || !base.TurnTaker.IsHero)
            {
                TurnTaker turnTaker = FindTurnTakersWhere((TurnTaker tt) => tt.Identifier == "LadyOfTheWood").FirstOrDefault();
                if (turnTaker != null)
                {
                    elementPool = turnTaker.CharacterCard.FindTokenPool(LadyOfTheWoodElementPoolIdentifier);
                }
            }

            List <RemoveTokensFromPoolAction> storedResults = new List <RemoveTokensFromPoolAction>();
            IEnumerator coroutine = base.GameController.RemoveTokensFromPool(elementPool, 1, storedResults: storedResults, optional: true, cardSource: base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            if (DidRemoveTokens(storedResults))
            {
                //Select a damage type.
                List <SelectDamageTypeDecision> storedDamageTypeResults = new List <SelectDamageTypeDecision>();
                coroutine = base.GameController.SelectDamageType(FindHeroTurnTakerController(hero.ToHero()), storedDamageTypeResults, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                DamageType damageType = GetSelectedDamageType(storedDamageTypeResults).Value;
                dd.DamageType = damageType;
            }
            yield break;
        }
        public List <Card> ManageCharactersOffToTheSide(bool banish = true)
        {
            List <Card> characterCards = new List <Card> {
            };

            foreach (string charID in nightloreCouncilIdentifiers)
            {
                Card target = TurnTaker.FindCard(charID);
                characterCards.Add(target);

                Location oldLocation = target.Location;
                Location destination;
                if (oldLocation.IsOffToTheSide)
                {
                    //Log.Debug("Looking for destination...");
                    if (banish)
                    {
                        //Log.Debug("Attempting to banish...");
                        destination = TurnTaker.InTheBox;
                    }
                    else
                    {
                        //Log.Debug("Putting in play...");
                        destination = TurnTaker.PlayArea;
                    }

                    TurnTaker.MoveCard(target, destination);

                    /*
                     * oldLocation.RemoveCard(target);
                     * destination.AddCard(target);
                     *
                     * if (target.Location.Name == LocationName.PlayArea && !GameController.Game.OrderedCardsInPlay.Contains(target))
                     * {
                     *  //Log.Debug("But the game does not know that it is in play");
                     *  GameController.Game.AssignPlayCardIndex(target);
                     *  //Log.Debug($"Given index {target.PlayIndex}");
                     * }
                     */
                }
            }
            return(characterCards);
        }
        public IEnumerator MoveCardToHandResponse(TurnTaker tt)
        {
            // "... may return a card from their trash to their hand."
            HeroTurnTakerController    httc = FindHeroTurnTakerController(tt.ToHero());
            List <MoveCardDestination> dest = new List <MoveCardDestination>();

            dest.Add(new MoveCardDestination(httc.HeroTurnTaker.Hand));
            IEnumerator moveCoroutine = base.GameController.SelectCardFromLocationAndMoveIt(httc, tt.Trash, new LinqCardCriteria((Card c) => c.Location == tt.Trash), dest, optional: true, responsibleTurnTaker: base.TurnTaker, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(moveCoroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(moveCoroutine);
            }
            yield break;
        }
        private IEnumerator HealResponse(DealDamageAction dda, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
        {
            // Impulse regains 2 HP
            int hpGain = powerNumerals[0];

            if (hpGain > 0)
            {
                IEnumerator healCoroutine = base.GameController.GainHP(base.Card, hpGain, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(healCoroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(healCoroutine);
                }
            }
            yield break;
        }
Пример #21
0
        public void TestRapidLeadership_Power()
        {
            SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis");
            StartGame();
            DestroyNonCharacterVillainCards();

            Card rapid      = PlayCard("RapidLeadership");
            Card legacyPlay = PutInHand("NextEvolution");
            Card bunkerDraw = bunker.TurnTaker.Deck.TopCard;

            //One other Hero may Play a Card. Then one other Hero may Draw a Card.
            DecisionSelectTurnTakers = new TurnTaker[] { legacy.TurnTaker, bunker.TurnTaker };
            DecisionSelectCardToPlay = legacyPlay;

            UsePower(rapid);

            AssertInPlayArea(legacy, legacyPlay);
            AssertInHand(bunkerDraw);
        }
Пример #22
0
        public void TestConvincingDoubleBasic()
        {
            //There are a million things that could go wrong with Convincing Double.
            //For now I'm just going to make a very basic test to show that the fundamental
            //functionality is there.

            SetupGameController("BaronBlade", "Cauldron.MagnificentMara", "Legacy", "Bunker", "TheScholar", "Megalopolis");

            StartGame();
            Card thokk       = PutInHand("Thokk");
            Card external    = PutInHand("ExternalCombustion");
            Card transmutive = PutInHand("TransmutiveRecovery");

            //needs extra one-shots in hand so we actually make decisions
            PutInHand("BolsterAllies");
            PutInHand("KnowWhenToTurnLoose");
            PutInHand("AdhesiveFoamGrenade");

            DecisionSelectTurnTakers = new TurnTaker[] { legacy.TurnTaker, bunker.TurnTaker, scholar.TurnTaker, legacy.TurnTaker };
            DecisionSelectCards      = new Card[] { thokk, GetCardInPlay("MobileDefensePlatform"), external, transmutive };
            DecisionAutoDecideIfAble = true;
            SetHitPoints(new TurnTakerController[] { legacy, bunker, scholar }, 15);

            QuickHandStorage(legacy, bunker, scholar);
            QuickHPStorage(legacy, bunker, scholar);
            AssertNotDamageSource(legacy.CharacterCard);

            for (int i = 0; i < 3; i++)
            {
                DecisionSelectTurnTakersIndex = i;
                PlayCard("ConvincingDouble");
                //first, Legacy hands Thokk to Bunker
                //then Bunker hands External Combustion to Scholar
                //finally Scholar gives Transmutive Recovery to Legacy
            }

            //each one lost a card, Legacy drew 2 from Recovery and Bunker drew 1 from Thokk
            QuickHandCheck(1, 0, -1);

            //Legacy gained two, Bunker gained nothing, Scholar hit himself for two
            QuickHPCheck(2, 0, -2);
        }
Пример #23
0
 public IEnumerator FallReduceDamageReponse(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
 {
     //Reduce damage dealt by that target by 1 until the start of their next turn.
     if (dd.DamageSource != null && dd.DidDealDamage)
     {
         ReduceDamageStatusEffect reduceDamageStatusEffect = new ReduceDamageStatusEffect(1);
         reduceDamageStatusEffect.SourceCriteria.IsSpecificCard = dd.Target;
         reduceDamageStatusEffect.UntilStartOfNextTurn(dd.DamageSource.Card.Owner);
         IEnumerator coroutine = base.AddStatusEffect(reduceDamageStatusEffect);
         if (base.UseUnityCoroutines)
         {
             yield return(base.GameController.StartCoroutine(coroutine));
         }
         else
         {
             base.GameController.ExhaustCoroutine(coroutine);
         }
     }
     yield break;
 }
Пример #24
0
        public IEnumerator SpringGainHPReponse(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
        {
            //they regain that much HP
            int amountToGain = dd.Amount;

            if (dd.DamageSource != null && dd.DidDealDamage)
            {
                Card        source    = dd.DamageSource.Card;
                IEnumerator coroutine = base.GameController.GainHP(source, amountToGain, cardSource: GetCardSource());
                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
            }
            yield break;
        }
Пример #25
0
        public IEnumerator PlayCardResponse(DealDamageAction action, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
        {
            var uses = GetCardPropertyJournalEntryInteger("Incap2Effect") ?? 0;

            if (IsRealAction())
            {
                Journal.RecordCardProperties(CharacterCard, "Incap2Effect", 0);
            }

            //...they may play a card
            IEnumerator coroutine = base.GameController.SelectAndPlayCardsFromHand(base.GameController.FindHeroTurnTakerController(action.Target.Owner.ToHero()), uses, true, cardSource: base.GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
Пример #26
0
        public override IEnumerator Play()
        {
            //"1 player may..."
            List <SelectTurnTakerDecision> storedResults = new List <SelectTurnTakerDecision>();
            IEnumerator coroutine = GameController.SelectHeroTurnTaker(DecisionMaker, SelectionType.RevealCardsFromDeck, optional: true, allowAutoDecide: false, storedResults, new LinqTurnTakerCriteria((TurnTaker tt) => GameController.IsTurnTakerVisibleToCardSource(tt, GetCardSource()) && !tt.IsIncapacitatedOrOutOfGame, "active heroes"), cardSource: GetCardSource());

            if (UseUnityCoroutines)
            {
                yield return(GameController.StartCoroutine(coroutine));
            }
            else
            {
                GameController.ExhaustCoroutine(coroutine);
            }
            TurnTaker hero = GetSelectedTurnTaker(storedResults);

            if (hero == null || !hero.IsHero)
            {
                yield break;
            }
            HeroTurnTakerController heroTTC = FindHeroTurnTakerController(hero.ToHero());

            if (heroTTC != null)
            {
                //"...look at the top 5 cards of their deck, put 1 of them into play, then put the rest on the bottom of their deck in any order."

                IEnumerator coroutine3 = RevealCardsWithCustomLogic(heroTTC);
                if (UseUnityCoroutines)
                {
                    yield return(GameController.StartCoroutine(coroutine3));
                }
                else
                {
                    GameController.ExhaustCoroutine(coroutine3);
                }
            }

            yield break;
        }
Пример #27
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;
 }
Пример #28
0
        private IEnumerator Sap(DealDamageAction arg)
        {
            List <YesNoCardDecision> decision = new List <YesNoCardDecision>();
            var decide = this.GameController.MakeYesNoCardDecision(HeroTurnTakerController, SelectionType.MoveCardFromUnderCard, Card, null, decision, null, GetCardSource());

            if (UseUnityCoroutines)
            {
                yield return(this.GameController.StartCoroutine(decide));
            }
            else
            {
                this.GameController.ExhaustCoroutine(decide);
            }
            if (DidPlayerAnswerYes(decision))
            {
                TurnTaker owner   = arg.Target.Owner;
                var       destroy = this.GameController.SelectAndDestroyCard(HeroTurnTakerController, new LinqCardCriteria(c => (c.IsOngoing) && !(c.IsCharacter) && c.Location == owner.PlayArea), false, null, Card, GetCardSource());
                if (UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(destroy));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(destroy);
                }
                destroy = DestroyCardUnderThis();
                if (UseUnityCoroutines)
                {
                    yield return(this.GameController.StartCoroutine(destroy));
                }
                else
                {
                    this.GameController.ExhaustCoroutine(destroy);
                }
            }
        }
Пример #29
0
        public void TestSetUpCard()
        {
            SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis");
            StartGame();
            DestroyNonCharacterVillainCards();

            Card battalion = PlayCard("BladeBattalion");
            Card setup     = PutInTrash("SetUp");

            DecisionSelectTarget     = baron.CharacterCard;
            DecisionSelectTurnTakers = new TurnTaker[] { bunker.TurnTaker, legacy.TurnTaker };

            QuickHPStorage(baron.CharacterCard, battalion, headlong.CharacterCard, legacy.CharacterCard, bunker.CharacterCard, scholar.CharacterCard);
            QuickHandStorage(headlong, legacy, bunker, scholar);

            PlayCard(setup);

            //Deal one Non-Hero Target 1 Melee Damage.
            //If a Target takes Damage this way, another Hero deals that same Target 3 Irreducible Melee Damage.
            QuickHPCheck(-4, 0, 0, 0, 0, 0);

            //One Hero may Draw a Card.
            QuickHandCheck(0, 1, 0, 0);
        }
Пример #30
0
 private bool ShouldIncreasePhaseActionCount(TurnTaker tt)
 {
     return(tt == base.GetCardThisCardIsNextTo(true).Owner);
 }