public void TestCriticalHitWithNemesisDiscardCriticalCardSuccess() { // Arrange SetupGameController("Cauldron.Anathema", DeckNamespace, "Ra", "Legacy", "Megalopolis"); // Supress Anathema's ability to play cards to create ideal testing env. CannotPlayCardsStatusEffect cannotPlayCardsStatusEffect = new CannotPlayCardsStatusEffect(); cannotPlayCardsStatusEffect.CardCriteria.IsVillain = true; cannotPlayCardsStatusEffect.UntilTargetLeavesPlay(Anathema.CharacterCard); RunCoroutine(this.GameController.AddStatusEffect(cannotPlayCardsStatusEffect, true, new CardSource(Anathema.CharacterCardController))); StartGame(); // Remove body part cards to create ideal testing env. RemoveVillainCards(); DecisionSelectCard = ra.CharacterCard; PutOnDeck(TangoOne, GetCard(DamnGoodGroundCardController.Identifier)); QuickHPStorage(Anathema); DecisionYesNo = true; DecisionSelectTarget = Anathema.CharacterCard; // Act GoToPlayCardPhase(TangoOne); PlayCard(CriticalHitCardController.Identifier); UsePower(TangoOne); // Assert QuickHPCheck(-5); // Snipe +1, Nemesis +1, Critical Hit + 3 = 5 }
public override IEnumerator Play() { IEnumerator coroutine; Card characterCard = null; if (base.CharacterCard.PromoIdentifierOrIdentifier == "WinterTiamatCharacter") { characterCard = base.TurnTaker.FindCard("InfernoTiamatCharacter"); } else if (base.CharacterCard.PromoIdentifierOrIdentifier == "HydraWinterTiamatCharacter") { characterCard = base.TurnTaker.FindCard("HydraInfernoTiamatCharacter"); } ; //If {Tiamat}, The Mouth of the Inferno is active, she deals each hero target 2+X fire damage, where X is the number of Element of Fire cards in the villain trash. if (characterCard.IsInPlayAndHasGameText && !characterCard.IsFlipped) { Func <Card, int?> X = (Card c) => new int?(PlusNumberOfThisCardInTrash(2)); coroutine = base.DealDamage(characterCard, (Card c) => c.IsHero, X, DamageType.Fire); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } //The hero with the most cards in play... List <TurnTaker> storedResults = new List <TurnTaker>(); coroutine = base.FindHeroWithMostCardsInPlay(storedResults); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (storedResults.Count <TurnTaker>() > 0) { //...may not play cards until the start of the next villain turn. TurnTaker isSpecificTurnTaker = storedResults.First <TurnTaker>(); CannotPlayCardsStatusEffect cannotPlayCardsStatusEffect = new CannotPlayCardsStatusEffect(); cannotPlayCardsStatusEffect.TurnTakerCriteria.IsSpecificTurnTaker = isSpecificTurnTaker; cannotPlayCardsStatusEffect.UntilStartOfNextTurn(base.TurnTaker); coroutine = base.AddStatusEffect(cannotPlayCardsStatusEffect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; }
public override IEnumerator Play() { //Destroy an Environment Card. IEnumerator coroutine = GameController.SelectAndDestroyCard(HeroTurnTakerController, new LinqCardCriteria((Card c) => c.IsEnvironment, "environment"), false, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //Select a Villain Deck. Until the start of {Rockstar}'s next turn, the target deck may not play cards. List <SelectLocationDecision> storedResults = new List <SelectLocationDecision>(); coroutine = GameController.SelectADeck(DecisionMaker, SelectionType.CannotPlayCards, loc => loc.IsVillain, storedResults, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidSelectLocation(storedResults)) { Location targetDeck = GetSelectedLocation(storedResults); CannotPlayCardsStatusEffect cannotPlayCardsStatusEffect = new CannotPlayCardsStatusEffect(); cannotPlayCardsStatusEffect.CardCriteria.NativeDeck = targetDeck; cannotPlayCardsStatusEffect.UntilStartOfNextTurn(TurnTaker); coroutine = AddStatusEffect(cannotPlayCardsStatusEffect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (!targetDeck.IsSubDeck) { PreventPhaseActionStatusEffect preventPhaseActionStatusEffect = new PreventPhaseActionStatusEffect(); preventPhaseActionStatusEffect.ToTurnPhaseCriteria.Phase = Phase.PlayCard; preventPhaseActionStatusEffect.ToTurnPhaseCriteria.TurnTaker = targetDeck.OwnerTurnTaker; preventPhaseActionStatusEffect.UntilStartOfNextTurn(TurnTaker); coroutine = AddStatusEffect(preventPhaseActionStatusEffect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } } //The Villain target with the highest HP deals Rockstar 3 Irreducible Projectile Damage. List <Card> storedVillainResults = new List <Card>(); DealDamageAction gameAction = new DealDamageAction(GameController, null, CharacterCard, 3, DamageType.Projectile, isIrreducible: true); coroutine = base.GameController.FindTargetWithHighestHitPoints(1, (Card card) => IsVillainTarget(card), storedVillainResults, gameAction, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } Card card2 = storedVillainResults.FirstOrDefault(); if (card2 != null) { coroutine = DealDamage(card2, CharacterCard, 3, DamageType.Projectile, isIrreducible: true, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; }