public void TestHeartOfTheWandererTeamVillainDiscard() { SetupGameController("ErmineTeam", "Legacy", "BiomancerTeam", "Ra", "FrictionTeam", "Haka", "Cauldron.FSCContinuanceWanderer"); StartGame(); Card heart = GetCard("HeartOfTheWanderer"); DecisionMoveCardDestinations = new MoveCardDestination[] { new MoveCardDestination(ermineTeam.TurnTaker.Trash), new MoveCardDestination(legacy.TurnTaker.Trash), new MoveCardDestination(biomancerTeam.TurnTaker.Trash), new MoveCardDestination(ra.TurnTaker.Trash), new MoveCardDestination(frictionTeam.TurnTaker.Trash), new MoveCardDestination(haka.TurnTaker.Trash), new MoveCardDestination(fsc.TurnTaker.Trash) }; PlayCard(heart); //When this card enters play, reveal the top card of each deck in turn order and either discard it or replace it. AssertNumberOfCardsInTrash(ermineTeam, 1); AssertNumberOfCardsInTrash(legacy, 1); AssertNumberOfCardsInTrash(biomancerTeam, 1); AssertNumberOfCardsInTrash(ra, 1); AssertNumberOfCardsInTrash(frictionTeam, 1); AssertNumberOfCardsInTrash(haka, 1); AssertNumberOfCardsInTrash(fsc, 1); AssertNumberOfCardsInRevealed(ermineTeam, 0); AssertNumberOfCardsInRevealed(legacy, 0); AssertNumberOfCardsInRevealed(biomancerTeam, 0); AssertNumberOfCardsInRevealed(ra, 0); AssertNumberOfCardsInRevealed(frictionTeam, 0); AssertNumberOfCardsInRevealed(haka, 0); AssertNumberOfCardsInRevealed(fsc, 0); }
public void TestIncapacitateOption2ToDeck_Villain() { // Arrange SetupGameController("BaronBlade", DeckNamespace, "Ra", "Legacy", "Megalopolis"); StartGame(); Card backlashField = GetCard("BacklashField"); PutOnDeck(baron, backlashField); SetHitPoints(TangoOne.CharacterCard, 1); DealDamage(baron, TangoOne, 2, DamageType.Melee); DecisionSelectLocation = new LocationChoice(baron.TurnTaker.Deck); DecisionMoveCardDestination = new MoveCardDestination(baron.TurnTaker.Deck, false); // Act GoToUseIncapacitatedAbilityPhase(TangoOne); UseIncapacitatedAbility(TangoOne, 1); // Assert AssertIncapacitated(TangoOne); AssertOnTopOfDeck(baron, backlashField); }
public void TestIncapacitateOption2ToTrash_Hero() { // Arrange SetupGameController("BaronBlade", DeckNamespace, "Ra", "Legacy", "Megalopolis"); StartGame(); Card dangerSense = GetCard("DangerSense"); PutOnDeck(legacy, dangerSense); SetHitPoints(TangoOne.CharacterCard, 1); DealDamage(baron, TangoOne, 2, DamageType.Melee); DecisionSelectLocation = new LocationChoice(legacy.TurnTaker.Deck); DecisionMoveCardDestination = new MoveCardDestination(legacy.TurnTaker.Trash, false); // Act GoToUseIncapacitatedAbilityPhase(TangoOne); UseIncapacitatedAbility(TangoOne, 1); // Assert AssertIncapacitated(TangoOne); AssertOnTopOfTrash(legacy, dangerSense); }
public void TestCourier_Trigger() { SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); DestroyNonCharacterVillainCards(); Card courier = PlayCard("Courier"); Card hostage = PlayCard("HostageSituation"); Card police = PlayCard("PoliceBackup"); Card traffic = PlayCard("TrafficPileup"); Card envTopCard = env.TurnTaker.Deck.TopCard; //The first time each Turn an Environment Card is Destroyed, you may look at the Top Card of the Environment Deck and replace it or Discard it. DecisionMoveCardDestinations = new MoveCardDestination[] { new MoveCardDestination(env.TurnTaker.Trash), new MoveCardDestination(env.TurnTaker.Trash) }; DestroyCard(hostage, bunker.CharacterCard); AssertInTrash(envTopCard); envTopCard = env.TurnTaker.Deck.TopCard; //only first time per turn DestroyCard(police, legacy.CharacterCard); AssertOnTopOfDeck(envTopCard); //resets at the next turn GoToNextTurn(); DestroyCard(traffic, bunker.CharacterCard); AssertInTrash(envTopCard); }
public void TestRapidEvac() { SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); DestroyNonCharacterVillainCards(); Card traffic = PlayCard("TrafficPileup"); Card police = PlayCard("PoliceBackup"); Card hostage = PutOnDeck("HostageSituation"); SetHitPoints(baron, 5); SetHitPoints(traffic, 5); SetHitPoints(headlong, 5); SetHitPoints(legacy, 5); SetHitPoints(bunker, 5); SetHitPoints(scholar, 5); //Destroy an Environment Card. //Then, Reveal the top Card of the Environment Deck. Play it or Discard it. //Then each Hero and Environment Target gains 1 HP. DecisionSelectCard = police; DecisionMoveCardDestination = new MoveCardDestination(env.TurnTaker.Trash); // discard QuickHPStorage(baron.CharacterCard, headlong.CharacterCard, legacy.CharacterCard, bunker.CharacterCard, scholar.CharacterCard, traffic); PlayCard("RapidEvac"); AssertInTrash(police, hostage); QuickHPCheck(0, 1, 1, 1, 1, 1); }
public void TestBookOfTheDeadSearchTrashAndPutIntoHand() { SetupGameController("BaronBlade", "Cauldron.Necro", "Ra", "Megalopolis"); StartGame(); GoToPlayCardPhase(necro); //Search your deck or trash for a ritual and put it into play or into your hand. If you searched your deck, shuffle your deck. //since no decisions specified, searching deck and putting in play var ritual = PutInTrash("BloodRite"); QuickHandStorage(necro, ra); var shuffleCheck = necro.HeroTurnTaker.Deck.GetTopCards(2).Concat(necro.HeroTurnTaker.Deck.GetBottomCards(2)).ToList(); DecisionSelectLocation = new LocationChoice(necro.HeroTurnTaker.Trash); DecisionMoveCardDestination = new MoveCardDestination(necro.HeroTurnTaker.Hand); DecisionSelectCard = ritual; var card = PutIntoPlay("BookOfTheDead"); QuickHandCheck(2, 0); AssertInHand(necro, ritual); AssertInTrash(necro, card); AssertDeckShuffled(necro, shuffleCheck[0], shuffleCheck[1], shuffleCheck[2], shuffleCheck[3]); }
public override IEnumerator UsePower(int index = 0) { int trashedTricks = base.GetPowerNumeral(0, 2); MoveCardDestination hand = new MoveCardDestination(base.HeroTurnTaker.Hand); //Play any number of tricks from your hand, or put 2 tricks from your trash into your hand. IEnumerable <Function> functionChoices = new Function[] { //Play any number of tricks from your hand new Function(base.HeroTurnTakerController, "Play any number of tricks from your hand", SelectionType.PlayCard, () => base.SelectAndPlayCardsFromHand(base.HeroTurnTakerController, 40, true, cardCriteria: new LinqCardCriteria((Card c) => c.DoKeywordsContain("trick")))), //put 2 tricks from your trash into your hand new Function(base.HeroTurnTakerController, "put 2 tricks from your trash into your hand", SelectionType.MoveCardToHandFromTrash, () => base.GameController.SelectCardsFromLocationAndMoveThem(base.HeroTurnTakerController, base.TurnTaker.Trash, trashedTricks, trashedTricks, new LinqCardCriteria((Card c) => c.DoKeywordsContain("trick")), hand.ToEnumerable <MoveCardDestination>(), cardSource: base.GetCardSource())) }; SelectFunctionDecision selectFunction = new SelectFunctionDecision(base.GameController, base.HeroTurnTakerController, functionChoices, false); IEnumerator coroutine = base.GameController.SelectAndPerformFunction(selectFunction); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } yield break; }
public override IEnumerator Play() { //You may destroy an ongoing card. IEnumerator coroutine = base.GameController.SelectAndDestroyCard(base.HeroTurnTakerController, new LinqCardCriteria((Card c) => c.IsOngoing, "ongoing", true, false, null, null, false), true, null, null, base.GetCardSource(null)); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //Put an undead card from the trash into play. MoveCardDestination obj = new MoveCardDestination(base.TurnTaker.PlayArea, false, false, false); IEnumerator coroutine2 = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria((Card c) => this.IsUndead(c), "undead", true, false, null, null, false), obj.ToEnumerable <MoveCardDestination>(), true, true, false, false, null, false, true, null, false, false, null, null, base.GetCardSource(null)); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine2)); } else { base.GameController.ExhaustCoroutine(coroutine2); } yield break; }
public override IEnumerator Play() { //You may destroy an ongoing card. IEnumerator coroutine = base.GameController.SelectAndDestroyCard(base.DecisionMaker, new LinqCardCriteria((Card c) => c.IsInPlay && c.IsOngoing, "ongoing"), true, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //Put an undead card from the trash into play. var destinations = new MoveCardDestination(base.TurnTaker.PlayArea).ToEnumerable(); IEnumerator coroutine2 = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria(c => this.IsUndead(c), "undead"), destinations, isPutIntoPlay: true, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine2)); } else { base.GameController.ExhaustCoroutine(coroutine2); } yield break; }
public void TestEchonavigation() { SetupGameController("AkashBhuta", "Cauldron.Cricket", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); DecisionMoveCardDestinations = new MoveCardDestination[] { new MoveCardDestination(akash.TurnTaker.Trash), new MoveCardDestination(cricket.TurnTaker.Trash), new MoveCardDestination(legacy.TurnTaker.Trash), new MoveCardDestination(bunker.TurnTaker.Deck), new MoveCardDestination(scholar.TurnTaker.Deck), new MoveCardDestination(env.TurnTaker.Deck) }; Card topAkash = akash.TurnTaker.Deck.TopCard; Card topCricket = cricket.TurnTaker.Deck.TopCard; Card topLegacy = legacy.TurnTaker.Deck.TopCard; Card topBunker = bunker.TurnTaker.Deck.TopCard; Card topScholar = scholar.TurnTaker.Deck.TopCard; Card topEnv = env.TurnTaker.Deck.TopCard; Card echo = PutInHand("Echonavigation"); //One player may draw a card now. QuickHandStorage(cricket); DecisionSelectCard = cricket.CharacterCard; PlayCard(echo); //played echo from hand, drew a card, net 0 QuickHandCheck(0); //Reveal the top card of each deck. You may replace or discard each card. AssertOnTopOfTrash(akash, topAkash); //Echonavigation gets put on top AssertInTrash(cricket, topCricket); AssertOnTopOfTrash(legacy, topLegacy); AssertOnTopOfDeck(topBunker); AssertOnTopOfDeck(topScholar); AssertOnTopOfDeck(topEnv); }
public void TestHeartOfTheWandererReturn() { SetupGameController("Spite", "Legacy", "Ra", "Haka", "Cauldron.FSCContinuanceWanderer"); StartGame(); Card heart = GetCard("HeartOfTheWanderer"); DecisionMoveCardDestinations = new MoveCardDestination[] { new MoveCardDestination(spite.TurnTaker.Deck), new MoveCardDestination(legacy.TurnTaker.Deck), new MoveCardDestination(ra.TurnTaker.Deck), new MoveCardDestination(haka.TurnTaker.Deck), new MoveCardDestination(fsc.TurnTaker.Deck) }; PlayCard(heart); //When this card enters play, reveal the top card of each deck in turn order and either discard it or replace it. AssertNumberOfCardsInTrash(spite, 0); AssertNumberOfCardsInTrash(legacy, 0); AssertNumberOfCardsInTrash(ra, 0); AssertNumberOfCardsInTrash(haka, 0); AssertNumberOfCardsInTrash(fsc, 0); AssertNumberOfCardsInRevealed(spite, 0); AssertNumberOfCardsInRevealed(legacy, 0); AssertNumberOfCardsInRevealed(ra, 0); AssertNumberOfCardsInRevealed(haka, 0); AssertNumberOfCardsInRevealed(fsc, 0); }
public override IEnumerator Play() { MoveCardDestination turnTakerDeck = new MoveCardDestination(base.TurnTaker.Deck, true); MoveCardDestination turnTakerPlayArea = new MoveCardDestination(base.TurnTaker.PlayArea, true); List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); //You may shuffle a card from your trash into your deck... IEnumerator coroutine = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria((Card c) => c.IsInTrash), turnTakerDeck.ToEnumerable <MoveCardDestination>(), false, true, true, true, storedResults, showOutput: true, allowAutoDecide: true, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } SelectCardDecision selectCardDecision = storedResults.FirstOrDefault <SelectCardDecision>(); LinqCardCriteria cardCriteria = new LinqCardCriteria((Card c) => c.Identifier == selectCardDecision.SelectedCard.Identifier, "card with the same name", false); //...If you do... if (selectCardDecision != null && selectCardDecision.SelectedCard != null) { //...put a card with the same name from your trash into play. IEnumerable <Card> list = FindCardsWhere(new LinqCardCriteria((Card c) => c.Identifier == selectCardDecision.SelectedCard.Identifier && c.IsInTrash, "card with the same name", false)); coroutine = base.GameController.PlayCard(this.TurnTakerController, list.FirstOrDefault(), responsibleTurnTaker: this.TurnTaker, cardSource: base.GetCardSource(null)); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //Shuffle all copies of that card from your trash into your deck. coroutine = base.GameController.SelectCardsFromLocationAndMoveThem(this.HeroTurnTakerController, base.TurnTaker.Trash, list.Count <Card>(), this.TurnTaker.Trash.NumberOfCards, cardCriteria, turnTakerDeck.ToEnumerable <MoveCardDestination>(), responsibleTurnTaker: this.TurnTaker, selectionType: SelectionType.MoveCardOnDeck, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //actually shuffle deck coroutine = base.GameController.ShuffleLocation(this.TurnTaker.Deck); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; }
private IEnumerator ShuffleTwoSameCardFromTrashOrDestroyResponse(PhaseChangeAction phaseChange) { MoveCardDestination obj = new MoveCardDestination(base.TurnTaker.Deck, true); List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); //...shuffle 2 cards with the same name from your trash into your deck... IEnumerator coroutine = base.GameController.SelectCardAndStoreResults(base.HeroTurnTakerController, SelectionType.ShuffleCardIntoDeck, new LinqCardCriteria((Card c) => TwoOrMoreCopiesInTrash(c) && c.IsInTrash, "two cards with the same name"), storedResults, true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } SelectCardDecision selectCardDecision = storedResults.FirstOrDefault <SelectCardDecision>(); if (selectCardDecision != null && selectCardDecision.SelectedCard != null) { //Move second card coroutine = base.GameController.SelectCardAndStoreResults(base.HeroTurnTakerController, SelectionType.ShuffleCardIntoDeck, new LinqCardCriteria((Card c) => c.Identifier == selectCardDecision.SelectedCard.Identifier && c.InstanceIndex != selectCardDecision.SelectedCard.InstanceIndex && c.IsInTrash, "two cards with the same name"), storedResults, false); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //actually shuffle cards into deck IEnumerable <Card> cards = new Card[] { storedResults.FirstOrDefault().SelectedCard, storedResults.LastOrDefault().SelectedCard }; coroutine = base.GameController.ShuffleLocation(this.TurnTaker.Deck); coroutine = base.GameController.ShuffleCardsIntoLocation(HeroTurnTakerController, cards, base.TurnTaker.Deck, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } }//...or this card is destroyed. else { coroutine = base.GameController.DestroyCard(this.DecisionMaker, base.Card); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; }
private IEnumerator ShuffleTwoSameCardFromTrashOrDestroyResponse(PhaseChangeAction phaseChange) { MoveCardDestination obj = new MoveCardDestination(base.TurnTaker.Deck, true); List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); //...shuffle 2 cards with the same name from your trash into your deck... IEnumerator coroutine = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria((Card c) => TwoOrMoreCopiesInTrash(c), "two cards with the same name"), obj.ToEnumerable <MoveCardDestination>(), false, true, true, true, storedResults, false, true, null, false, true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } SelectCardDecision selectCardDecision = storedResults.FirstOrDefault <SelectCardDecision>(); LinqCardCriteria cardCriteria = new LinqCardCriteria((Card c) => c.Identifier == selectCardDecision.SelectedCard.Identifier, "card with the same name", false); if (selectCardDecision != null && selectCardDecision.SelectedCard != null) { //Move second card coroutine = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria((Card c) => c.Identifier == selectCardDecision.SelectedCard.Identifier, "two cards with the same name"), obj.ToEnumerable <MoveCardDestination>(), false, true, true, true, storedResults, false, true, null, false, true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //actually shuffle deck coroutine = base.GameController.ShuffleLocation(this.TurnTaker.Deck); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } }//...or this card is destroyed. else { coroutine = base.GameController.DestroyCard(this.DecisionMaker, base.Card); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; }
public override IEnumerator Play() { List <SelectCardDecision> target = new List <SelectCardDecision>(); //{Titan} deals 1 target 1 infernal damage. IEnumerator coroutine = base.GameController.SelectTargetsAndDealDamage(base.HeroTurnTakerController, new DamageSource(base.GameController, base.CharacterCard), 1, DamageType.Infernal, 1, false, 1, storedResultsDecisions: target, cardSource: base.GetCardSource()); if (UseUnityCoroutines) { yield return(GameController.StartCoroutine(coroutine)); } else { GameController.ExhaustCoroutine(coroutine); } if (target.FirstOrDefault() != null && target.FirstOrDefault().SelectedCard != null) { //Redirect the next damage dealt by that target back to itself. RedirectDamageStatusEffect statusEffect = new RedirectDamageStatusEffect() { NumberOfUses = 1, RedirectTarget = target.FirstOrDefault().SelectedCard, SourceCriteria = { IsSpecificCard = target.FirstOrDefault().SelectedCard } }; statusEffect.UntilCardLeavesPlay(target.FirstOrDefault().SelectedCard); coroutine = base.AddStatusEffect(statusEffect); if (UseUnityCoroutines) { yield return(GameController.StartCoroutine(coroutine)); } else { GameController.ExhaustCoroutine(coroutine); } } //If Titanform is in your trash, you may put it into play or into your hand. if (base.GetTitanform().Location.IsTrash) { IEnumerable <MoveCardDestination> locations = new MoveCardDestination[] { new MoveCardDestination(base.TurnTaker.PlayArea), new MoveCardDestination(base.HeroTurnTaker.Hand) }; coroutine = base.GameController.SelectLocationAndMoveCard(base.HeroTurnTakerController, base.GetTitanform(), locations, true, cardSource: base.GetCardSource()); if (UseUnityCoroutines) { yield return(GameController.StartCoroutine(coroutine)); } else { GameController.ExhaustCoroutine(coroutine); } } yield break; }
public IEnumerator OpenCrateFromTrash(PhaseChangeAction pca) { // "... if there are no Storage cards in play, put a Storage card from the environment trash into play." int cratesInPlay = FindCardsWhere((Card c) => c.IsInPlayAndHasGameText && c.DoKeywordsContain("storage")).Count(); int cratesInTrash = FindCardsWhere((Card c) => c.IsInTrash && c.DoKeywordsContain("storage")).Count(); String message = "There are already " + cratesInPlay.ToString() + " Storage cards in play."; List <Card> associatedCards = null; if (cratesInPlay >= 1) { associatedCards = new List <Card>(); associatedCards.Add(FindCardsWhere((Card c) => c.IsInPlayAndHasGameText && c.DoKeywordsContain("storage")).FirstOrDefault()); } if (cratesInPlay == 1) { message = "There is already a Storage card in play."; } else if (cratesInPlay <= 0 && cratesInTrash <= 0) { message = "There are no Storage cards in the trash for " + base.Card.Title + " to retrieve."; } else if (cratesInPlay <= 0) { message = "There are no Storage cards in play, so " + base.Card.Title + " retrieves one from the trash."; } IEnumerator showCoroutine = base.GameController.SendMessageAction(message, Priority.Medium, GetCardSource(), showCardSource: true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(showCoroutine)); } else { base.GameController.ExhaustCoroutine(showCoroutine); } if (cratesInPlay <= 0 && cratesInTrash > 0) { MoveCardDestination dest = new MoveCardDestination(base.TurnTaker.PlayArea); IEnumerator openCoroutine = base.GameController.SelectCardFromLocationAndMoveIt(DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria((Card c) => c.DoKeywordsContain("storage")), dest.ToEnumerable(), isPutIntoPlay: true, optional: false, responsibleTurnTaker: base.TurnTaker, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(openCoroutine)); } else { base.GameController.ExhaustCoroutine(openCoroutine); } } yield break; }
public IEnumerator DiscardForDamageResponse(PhaseChangeAction pca) { // "At the start of your turn, discard 3 cards from under this card. {ImpulseCharacter} deals 1 target 1 projectile damage for each card discarded this way." List <MoveCardAction> discarded = new List <MoveCardAction>(); for (int i = 0; i < 3; i++) { if (base.Card.UnderLocation.Cards.Count() > 0) { // Choose a card to discard List <SelectCardDecision> selected = new List <SelectCardDecision>(); IEnumerator selectCoroutine = base.GameController.SelectCardAndStoreResults(base.HeroTurnTakerController, SelectionType.DiscardCard, new LinqCardCriteria((Card c) => c.Location == base.Card.UnderLocation || c.Location == base.Card.BelowLocation), selected, optional: false, allowAutoDecide: base.Card.UnderLocation.Cards.Count() <= 3 - i, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(selectCoroutine)); } else { base.GameController.ExhaustCoroutine(selectCoroutine); } Card chosenCard = selected.FirstOrDefault().SelectedCard; // Discard it MoveCardDestination trash = FindCardController(chosenCard).GetTrashDestination(); IEnumerator discardCoroutine = base.GameController.MoveCard(base.TurnTakerController, chosenCard, trash.Location, showMessage: true, responsibleTurnTaker: base.TurnTaker, storedResults: discarded, actionSource: pca, isDiscard: true, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(discardCoroutine)); } else { base.GameController.ExhaustCoroutine(discardCoroutine); } } } int numDiscarded = GetNumberOfCardsMoved(discarded); for (int i = 0; i < numDiscarded; i++) { // Impulse deals 1 target 1 projectile damage IEnumerator damageCoroutine = base.GameController.SelectTargetsAndDealDamage(base.HeroTurnTakerController, new DamageSource(base.GameController, base.CharacterCard), 1, DamageType.Projectile, 1, false, 1, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(damageCoroutine)); } else { base.GameController.ExhaustCoroutine(damageCoroutine); } } yield break; }
private IEnumerator StartOfTurnResponse(PhaseChangeAction pca) { // You may put 1 Virus card from the villain trash beneath this card List <SelectCardDecision> cardsSelected = new List <SelectCardDecision>(); MoveCardDestination underThisCard = new MoveCardDestination(base.Card.UnderLocation); IEnumerator routine = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria(c => c.IsInTrash && IsVirus(c)), underThisCard.ToEnumerable(), optional: true, storedResults: cardsSelected, showOutput: true, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(routine)); } else { base.GameController.ExhaustCoroutine(routine); } if (!IsVectorFlipped()) { // {Vector} deals each hero 1 toxic damage routine = base.DealDamage(this.CharacterCard, c => c.IsHeroCharacterCard && !c.IsIncapacitatedOrOutOfGame, DamageToDeal, DamageType.Toxic); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(routine)); } else { base.GameController.ExhaustCoroutine(routine); } // Regain {H x 2} HP int hpGain = base.Game.H * 2; routine = this.GameController.GainHP(this.CharacterCard, hpGain, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(routine)); } else { base.GameController.ExhaustCoroutine(routine); } } yield break; }
public void TestCricketIncap2Trash() { SetupGameController("Apostate", "Cauldron.Cricket", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); SetupIncap(apostate); Card ring = PutOnDeck("TheLegacyRing"); DecisionSelectLocation = new LocationChoice(legacy.TurnTaker.Deck); DecisionMoveCardDestination = new MoveCardDestination(legacy.TurnTaker.Trash); //Look at the top card of a deck and replace or discard it. UseIncapacitatedAbility(cricket, 1); AssertOnTopOfTrash(legacy, ring); AssertNumberOfCardsInRevealed(cricket, 0); }
public IEnumerator PullAggroResponse(PhaseChangeAction pca) { // "... you may have a villain target deal {TheGoalieCharacter} 1 irreducible melee damage." List <SelectCardDecision> targetResults = new List <SelectCardDecision>(); IEnumerator chooseCoroutine = base.GameController.SelectCardAndStoreResults(base.HeroTurnTakerController, SelectionType.CardToDealDamage, new LinqCardCriteria((Card c) => c.IsVillain && c.IsTarget && c.IsInPlayAndHasGameText, "villain targets in play", false, false, "villain target in play", "villain targets in play"), targetResults, true, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(chooseCoroutine)); } else { base.GameController.ExhaustCoroutine(chooseCoroutine); } Card selectedTarget = GetSelectedCard(targetResults); if (selectedTarget != null) { List <DealDamageAction> damageResults = new List <DealDamageAction>(); IEnumerator meleeCoroutine = DealDamage(selectedTarget, base.CharacterCard, 1, DamageType.Melee, isIrreducible: true, storedResults: damageResults, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(meleeCoroutine)); } else { base.GameController.ExhaustCoroutine(meleeCoroutine); } // "If {TheGoalieCharacter} is dealt damage this way, you may play a Goalposts card from your trash." if (DidDealDamage(damageResults, toSpecificTarget: base.CharacterCard)) { MoveCardDestination dest = new MoveCardDestination(base.TurnTaker.PlayArea); IEnumerator playCoroutine = base.GameController.SelectCardFromLocationAndMoveIt(base.HeroTurnTakerController, base.TurnTaker.Trash, GoalpostsCards, dest.ToEnumerable(), optional: true, responsibleTurnTaker: base.TurnTaker, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(playCoroutine)); } else { base.GameController.ExhaustCoroutine(playCoroutine); } } } yield break; }
public override IEnumerator Play() { //"When this card enters play, reveal the top 2 cards of your deck. Replace 1 and discard the other.", var topDeck = new MoveCardDestination(TurnTaker.Deck); var trash = new MoveCardDestination(TurnTaker.Trash); IEnumerator coroutine = RevealCardsFromTopOfDeck_DetermineTheirLocation(DecisionMaker, DecisionMaker, TurnTaker.Deck, topDeck, trash, 2, 1, 0); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } yield break; }
public void TestHeadlongIncap3_Replace() { SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); DestroyNonCharacterVillainCards(); SetupIncap(baron); Card legacyTop = legacy.TurnTaker.Deck.TopCard; GoToUseIncapacitatedAbilityPhase(headlong); DecisionSelectLocation = new LocationChoice(legacy.TurnTaker.Deck); DecisionMoveCardDestination = new MoveCardDestination(legacy.TurnTaker.Deck); //You may look at the top card of a deck, then replace it or Discard it. UseIncapacitatedAbility(headlong, 2); AssertOnTopOfDeck(legacyTop); }
public void TestAreaKnowledge() { SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); DestroyNonCharacterVillainCards(); Card police = PutOnDeck("PoliceBackup"); Card hostage = PutOnDeck("HostageSituation"); Card traffic = PutOnDeck("TrafficPileup"); DecisionSelectCards = new Card[] { police, traffic, hostage }; DecisionMoveCardDestination = new MoveCardDestination(env.TurnTaker.Deck, toBottom: true); //Look at the Top 3 Cards of the Environment Deck. Place one into Play, one at the top or bottom of the Environment Deck, and one into the Trash. PlayCard("AreaKnowledge"); AssertNumberOfCardsInRevealed(headlong, 0); AssertInTrash(hostage); AssertInPlayArea(env, police); AssertOnBottomOfDeck(traffic); //Until the Start of {Headlong}’s next Turn, Heroes are Immune to Damage from Environment Cards. //should be immune to environment DecisionAutoDecideIfAble = true; QuickHPStorage(baron, legacy, bunker, scholar); DealDamage(police, (Card c) => true, 3, DamageType.Projectile); QuickHPCheck(-3, 0, 0, 0); //should not be immune to villain QuickHPUpdate(); DealDamage(baron, (Card c) => true, 3, DamageType.Projectile); QuickHPCheck(-3, -4, -3, -3); //should not be immune to hero QuickHPUpdate(); DealDamage(bunker, (Card c) => true, 3, DamageType.Projectile); QuickHPCheck(-3, -3, -3, -3); //should not be immune to once effect has expired GoToStartOfTurn(headlong); QuickHPUpdate(); DealDamage(police, (Card c) => true, 3, DamageType.Projectile); QuickHPCheck(-3, -3, -3, -3); }
public IEnumerator EmptyResponse(GameAction ga) { // Implied: when this card leaves play, put all cards under it into their appropriate trashes while (base.Card.UnderLocation.Cards.Count() > 0) { Card next = base.Card.UnderLocation.TopCard; MoveCardDestination trash = FindCardController(next).GetTrashDestination(); IEnumerator moveCoroutine = base.GameController.MoveCard(base.TurnTakerController, next, trash.Location, responsibleTurnTaker: base.TurnTaker, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(moveCoroutine)); } else { base.GameController.ExhaustCoroutine(moveCoroutine); } } yield break; }
public void TestAreaKnowledge_2CardsInDeck() { SetupGameController("BaronBlade", "Chasejyd.Headlong", "Legacy", "Bunker", "TheScholar", "Megalopolis"); StartGame(); DestroyNonCharacterVillainCards(); MoveAllCards(env, env.TurnTaker.Deck, env.TurnTaker.Trash); Card police = PutOnDeck("PoliceBackup"); Card traffic = PutOnDeck("TrafficPileup"); DecisionSelectCards = new Card[] { police, traffic }; DecisionMoveCardDestination = new MoveCardDestination(env.TurnTaker.Deck, toBottom: true); //Look at the Top 3 Cards of the Environment Deck. Place one into Play, one at the top or bottom of the Environment Deck, and one into the Trash. PlayCard("AreaKnowledge"); AssertNumberOfCardsInRevealed(headlong, 0); AssertInPlayArea(env, police); AssertOnBottomOfDeck(traffic); }
public override IEnumerator Play() { MoveCardDestination turnTakerDeck = new MoveCardDestination(base.TurnTaker.Deck, true, false, false); MoveCardDestination turnTakerPlayArea = new MoveCardDestination(base.TurnTaker.PlayArea, true, false, false); List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); //You may shuffle a card from your trash into your deck... IEnumerator coroutine = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, null, turnTakerDeck.ToEnumerable <MoveCardDestination>(), false, true, true, true, storedResults, false, true, null, false, true, null, null, base.GetCardSource(null)); SelectCardDecision selectCardDecision = storedResults.FirstOrDefault <SelectCardDecision>(); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } LinqCardCriteria cardCriteria = new LinqCardCriteria((Card c) => c.Identifier == selectCardDecision.SelectedCard.Identifier, "card with the same name", true, false, null, null, false); //...If you do... if (selectCardDecision != null && selectCardDecision.SelectedCard != null) { //...put a card with the same name from your trash into play. IEnumerator coroutine2 = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, cardCriteria, turnTakerPlayArea.ToEnumerable <MoveCardDestination>(), true, true, true, true, storedResults, false, true, null, false, true, null, null, base.GetCardSource(null)); //Shuffle all copies of that card from your trash into your deck. IEnumerator coroutine3 = base.GameController.SelectCardsFromLocationAndMoveThem(this.HeroTurnTakerController, base.TurnTaker.Trash, new int?(0), base.TurnTaker.Deck.NumberOfCards, cardCriteria, turnTakerDeck.ToEnumerable <MoveCardDestination>(), false, true, true, false, storedResults, null, true, false, false, this.TurnTaker, false, true, null, null, base.GetCardSource(null)); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine2)); yield return(base.GameController.StartCoroutine(coroutine3)); } else { base.GameController.ExhaustCoroutine(coroutine2); base.GameController.ExhaustCoroutine(coroutine3); } } yield break; }
public void TestReversalToHand() { SetupGameController("Omnitron", "Cauldron.Titan", "Haka", "Bunker", "TheScholar", "Megalopolis"); StartGame(); Card tform = PutInTrash("Titanform"); DecisionMoveCardDestination = new MoveCardDestination(titan.HeroTurnTaker.Hand); QuickHPStorage(omnitron); PlayCard("Reversal"); //{Titan} deals 1 target 1 infernal damage. QuickHPCheck(-1); //Redirect the next damage dealt by that target back to itself. QuickHPStorage(omnitron, titan); DealDamage(omnitron, titan, 2, DamageType.Melee); QuickHPCheck(-2, 0); //If Titanform is in your trash, you may put it into play or into your hand. AssertInHand(tform); }
private IEnumerator StartOfTurnResponse(PhaseChangeAction pca) { if (FindCardsWhere((Card c) => base.TurnTaker.Trash.HasCard(c) && IsVirus(c)).Any()) { MoveCardDestination turnTakerDeck = new MoveCardDestination(base.TurnTaker.Deck); IEnumerator routine = base.GameController.SelectCardFromLocationAndMoveIt(this.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria(c => base.TurnTaker.Trash.HasCard(c) && IsVirus(c)), turnTakerDeck.ToEnumerable(), showOutput: true, cardSource: base.GetCardSource()); IEnumerator routine2 = base.ShuffleDeck(this.DecisionMaker, base.TurnTaker.Deck); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(routine)); yield return(base.GameController.StartCoroutine(routine2)); } else { base.GameController.ExhaustCoroutine(routine); base.GameController.ExhaustCoroutine(routine2); } } else { IEnumerator routine = base.GameController.SendMessageAction("There are no Virus cards in " + base.CharacterCard.Title + "'s Trash", Priority.Medium, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(routine)); } else { base.GameController.ExhaustCoroutine(routine); } } yield break; }
public override IEnumerator Play() { //Search the villain deck and trash for all copies of Chain Reaction and put them into play. IEnumerator coroutine = base.PlayCardsFromLocation(base.TurnTaker.Deck, new LinqCardCriteria((Card c) => c.Identifier == "ChainReaction")); IEnumerator coroutine2 = base.PlayCardsFromLocation(base.TurnTaker.Trash, new LinqCardCriteria((Card c) => c.Identifier == "ChainReaction")); //Move 1 copy of Unstable Isotope from the villain trash to the villain deck. MoveCardDestination villianDeck = new MoveCardDestination(base.TurnTaker.Deck); IEnumerator coroutine3 = base.GameController.SelectCardFromLocationAndMoveIt(base.DecisionMaker, base.TurnTaker.Trash, new LinqCardCriteria((Card c) => c.Identifier == "UnstableIsotope"), villianDeck.ToEnumerable <MoveCardDestination>(), cardSource: base.GetCardSource()); //Shuffle the villain deck. IEnumerator coroutine4 = base.ShuffleDeck(this.DecisionMaker, base.TurnTaker.Deck); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); yield return(base.GameController.StartCoroutine(coroutine2)); yield return(base.GameController.StartCoroutine(coroutine3)); yield return(base.GameController.StartCoroutine(coroutine4)); } else { base.GameController.ExhaustCoroutine(coroutine); base.GameController.ExhaustCoroutine(coroutine2); base.GameController.ExhaustCoroutine(coroutine3); base.GameController.ExhaustCoroutine(coroutine4); } //{Gray} deals himself 2 energy damage. coroutine = base.DealDamage(base.CharacterCard, base.CharacterCard, 2, DamageType.Energy, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } yield break; }
public void TestMisbehaviorReveal1ToHand() { SetupGameController("Omnitron", "Cauldron.Titan", "Haka", "Bunker", "TheScholar", "Megalopolis"); StartGame(); Card tform = PutOnDeck("Titanform"); Card chap = PutOnDeck("TheChaplain"); Card prag = PutOnDeck("CombatPragmatism"); SetHitPoints(titan, 17); DecisionSelectNumber = 1; DecisionMoveCardDestination = new MoveCardDestination(titan.HeroTurnTaker.Hand); QuickHPStorage(titan); PlayCard("Misbehavior"); //Reveal up to 3 cards from the top of your deck. Put 1 of them into play or into your hand. Put the rest into your trash. AssertInDeck(new Card[] { tform, chap }); AssertInHand(prag); //{Titan} regains X HP, where X is 3 minus the number of cards revealed this way. QuickHPCheck(2); }