public override IEnumerator Play() { //"Search your deck for a Single Hand Equipment card and put it into play. Shuffle your deck.", //"Select a hero target. Until the start of your next turn, increase damage dealt by that target by 1." var criteria = new LinqCardCriteria(c => IsEquipment(c) && IsSingleHandCard(c), "single hand equipment"); var coroutine = base.SearchForCards(this.DecisionMaker, true, false, 1, 1, criteria, true, false, false, shuffleAfterwards: true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } var storedResult = new List <SelectCardDecision>(); criteria = new LinqCardCriteria(c => c.IsHero && c.IsTarget && c.IsInPlayAndHasGameText, "hero target"); coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.IncreaseDamage, criteria, storedResult, false, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidSelectCard(storedResult)) { Card card = GetSelectedCard(storedResult); IncreaseDamageStatusEffect increaseDamageStatusEffect = new IncreaseDamageStatusEffect(1); increaseDamageStatusEffect.SourceCriteria.IsSpecificCard = card; increaseDamageStatusEffect.UntilStartOfNextTurn(base.TurnTaker); increaseDamageStatusEffect.UntilTargetLeavesPlay(card); coroutine = base.AddStatusEffect(increaseDamageStatusEffect, true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; }
public IEnumerator IncreaseDamageResponse(PhaseChangeAction _, OnPhaseChangeStatusEffect sourceEffect) { int increaseNumeral = sourceEffect.PowerNumeralsToChange[0]; IncreaseDamageStatusEffect statusEffect = new IncreaseDamageStatusEffect(increaseNumeral); statusEffect.UntilThisTurnIsOver(Game); statusEffect.UntilTargetLeavesPlay(base.CharacterCard); IEnumerator coroutine = base.AddStatusEffect(statusEffect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } yield break; }
public override IEnumerator Play() { // "Draw a card." IEnumerator drawCoroutine = base.GameController.DrawCard(base.HeroTurnTaker, optional: false, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(drawCoroutine)); } else { base.GameController.ExhaustCoroutine(drawCoroutine); } // "Select a target. Until the start of your next turn, reduce damage dealt by that target by 1 and increase damage dealt to that target by 1." List <SelectCardDecision> choice = new List <SelectCardDecision>(); IEnumerator selectCoroutine = base.GameController.SelectCardAndStoreResults(base.HeroTurnTakerController, SelectionType.SelectTargetNoDamage, new LinqCardCriteria((Card c) => c.IsTarget && c.IsInPlayAndHasGameText && GameController.IsCardVisibleToCardSource(c, GetCardSource())), choice, false, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(selectCoroutine)); } else { base.GameController.ExhaustCoroutine(selectCoroutine); } if (choice != null && choice.Count > 0) { Card chosen = choice.FirstOrDefault().SelectedCard; ReduceDamageStatusEffect reduction = new ReduceDamageStatusEffect(1); reduction.SourceCriteria.IsSpecificCard = chosen; reduction.UntilStartOfNextTurn(base.TurnTaker); reduction.UntilTargetLeavesPlay(chosen); IEnumerator reduceCoroutine = base.GameController.AddStatusEffect(reduction, true, GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(reduceCoroutine)); } else { base.GameController.ExhaustCoroutine(reduceCoroutine); } IncreaseDamageStatusEffect enhancement = new IncreaseDamageStatusEffect(1); enhancement.TargetCriteria.IsSpecificCard = chosen; enhancement.UntilStartOfNextTurn(base.TurnTaker); enhancement.UntilTargetLeavesPlay(chosen); IEnumerator increaseCoroutine = base.GameController.AddStatusEffect(enhancement, true, GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(increaseCoroutine)); } else { base.GameController.ExhaustCoroutine(increaseCoroutine); } } yield break; }
public override IEnumerator UseIncapacitatedAbility(int index) { switch (index) { case 0: { //One hero may deal himself 2 toxic damage to draw 2 cards now. //Select a Hero List <SelectCardDecision> storedHero = new List <SelectCardDecision>(); var criteria = new LinqCardCriteria((Card c) => c.IsInPlayAndHasGameText && c.IsHeroCharacterCard && !c.IsIncapacitatedOrOutOfGame, "hero", false); IEnumerator coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.DealDamageSelf, criteria, storedHero, false, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidSelectCard(storedHero)) { //Ask hero if they want to deal damage to themselves Card heroCard = GetSelectedCard(storedHero); HeroTurnTakerController httc = base.FindHeroTurnTakerController(heroCard.Owner.ToHero()); List <DealDamageAction> storedResults = new List <DealDamageAction>(); coroutine = base.GameController.DealDamageToSelf(httc, (Card c) => c == heroCard, 2, DamageType.Toxic, false, storedResults, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } coroutine = base.DrawCards(httc, 2); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } yield break; } case 1: { //One hero may discard up to 3 cards, then regain 2 HP for each card discarded. //Select hero to discard cards List <SelectTurnTakerDecision> storedResultsTurnTaker = new List <SelectTurnTakerDecision>(); List <DiscardCardAction> storedResultsDiscard = new List <DiscardCardAction>(); IEnumerator coroutine = base.GameController.SelectHeroToDiscardCards(this.DecisionMaker, 0, 3, storedResultsTurnTaker: storedResultsTurnTaker, storedResultsDiscard: storedResultsDiscard, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } //then determine hero character card to gain Hp. This may not work with Obliveon reward characters int numCardsDiscarded = GetNumberOfCardsDiscarded(storedResultsDiscard); if (numCardsDiscarded > 0) { var httc = FindHeroTurnTakerController(GetSelectedTurnTaker(storedResultsTurnTaker).ToHero()); if (httc.HasMultipleCharacterCards) { coroutine = base.GameController.SelectAndGainHP(httc, numCardsDiscarded * 2, false, c => c.IsInPlayAndHasGameText && c.IsHeroCharacterCard && c.IsInLocation(httc.HeroTurnTaker.PlayArea), cardSource: base.GetCardSource()); } else { coroutine = base.GameController.GainHP(httc.CharacterCard, numCardsDiscarded * 2, cardSource: base.GetCardSource()); } } else { //no cards were discarded, send message to inform player of result coroutine = base.GameController.SendMessageAction("No cards were discarded, so no HP is gained.", Priority.Medium, base.GetCardSource()); } if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } break; } case 2: { //Select a hero target. Increase damage dealt by that target by 3 and increase damage dealt to that target by 2 until the start of your next turn. //Select a hero target List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); IEnumerator coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.IncreaseDamage, new LinqCardCriteria((Card c) => !c.IsIncapacitatedOrOutOfGame && c.IsHero && c.IsTarget && c.IsInPlayAndHasGameText, "hero target"), storedResults, false, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidSelectCard(storedResults)) { Card selectedTarget = GetSelectedCard(storedResults); //Until start of turn, increase damage dealt by that selected card by 3 IncreaseDamageStatusEffect increaseDamageDealtStatusEffect = new IncreaseDamageStatusEffect(3); increaseDamageDealtStatusEffect.SourceCriteria.IsSpecificCard = selectedTarget; increaseDamageDealtStatusEffect.UntilStartOfNextTurn(base.TurnTaker); increaseDamageDealtStatusEffect.UntilTargetLeavesPlay(selectedTarget); IEnumerator coroutine2 = base.AddStatusEffect(increaseDamageDealtStatusEffect); //Until start of turn, increase damage dealt to that selected card by 2 IncreaseDamageStatusEffect increaseDamageTakenStatusEffect = new IncreaseDamageStatusEffect(2); increaseDamageTakenStatusEffect.TargetCriteria.IsSpecificCard = selectedTarget; increaseDamageTakenStatusEffect.UntilStartOfNextTurn(base.TurnTaker); increaseDamageTakenStatusEffect.UntilTargetLeavesPlay(selectedTarget); IEnumerator coroutine3 = base.AddStatusEffect(increaseDamageTakenStatusEffect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine2)); yield return(base.GameController.StartCoroutine(coroutine3)); } else { base.GameController.ExhaustCoroutine(coroutine2); base.GameController.ExhaustCoroutine(coroutine3); } } break; } } yield break; }
public override IEnumerator UseIncapacitatedAbility(int index) { IEnumerator coroutine; switch (index) { case 0: { //"One player may play a card now." coroutine = base.SelectHeroToPlayCard(this.HeroTurnTakerController); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } yield break; } case 1: { //"Reduce damage dealt to 1 target by 1 until the start of your next turn." List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.SelectTargetFriendly, new LinqCardCriteria(c => c.IsInPlayAndHasGameText && c.IsTarget, "targets in play", false), storedResults, false, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidSelectCard(storedResults)) { Card selectedCard = GetSelectedCard(storedResults); ReduceDamageStatusEffect reduceDamageStatusEffect = new ReduceDamageStatusEffect(1); reduceDamageStatusEffect.TargetCriteria.IsSpecificCard = selectedCard; reduceDamageStatusEffect.UntilStartOfNextTurn(base.TurnTaker); reduceDamageStatusEffect.UntilTargetLeavesPlay(selectedCard); coroutine = base.AddStatusEffect(reduceDamageStatusEffect, true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } break; } case 2: { //"Increase damage dealt by 1 target by 1 until the start of your next turn." List <SelectCardDecision> storedResults = new List <SelectCardDecision>(); coroutine = base.GameController.SelectCardAndStoreResults(this.DecisionMaker, SelectionType.SelectTargetFriendly, new LinqCardCriteria(c => c.IsInPlayAndHasGameText && c.IsTarget, "targets in play", false), storedResults, false, cardSource: base.GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidSelectCard(storedResults)) { Card selectedCard = GetSelectedCard(storedResults); IncreaseDamageStatusEffect increaseDamageStatusEffect = new IncreaseDamageStatusEffect(1); increaseDamageStatusEffect.SourceCriteria.IsSpecificCard = selectedCard; increaseDamageStatusEffect.UntilStartOfNextTurn(base.TurnTaker); increaseDamageStatusEffect.UntilTargetLeavesPlay(selectedCard); coroutine = base.AddStatusEffect(increaseDamageStatusEffect, true); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } break; } } yield break; }