private IEnumerator MayReturnDestroyedResponse(DestroyCardAction dc) { Card toReturn = dc.CardToDestroy.Card; var decisionResult = new List <YesNoCardDecision> { }; IEnumerator coroutine = GameController.MakeYesNoCardDecision(DecisionMaker, SelectionType.MoveCardToHand, toReturn, storedResults: decisionResult, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (DidPlayerAnswerYes(decisionResult)) { dc.SetPostDestroyDestination(dc.CardToDestroy.Card.Owner.ToHero().Hand); dc.AddAfterDestroyedAction(() => DestroyThisCardIfMovedResponse(dc), this); } yield break; }
private IEnumerator DoFrenzy(DestroyCardAction arg) { arg.SetPostDestroyDestination(Frenzy.UnderLocation); return(DoNothing()); //var consume = this.GameController.Change(TurnTakerController, arg.CardToDestroy.Card, Card.UnderLocation, cardSource: GetCardSource()); //if(UseUnityCoroutines) { yield return this.GameController.StartCoroutine(consume); } else { this.GameController.ExhaustCoroutine(consume); } }
public IEnumerator MoveItToTheBottomOfItsDeckResponse(DestroyCardAction d, HeroTurnTaker hero, StatusEffect effect, int[] powerNumerals = null) { //...you may move it to the bottom of its deck. if (d.PostDestroyDestinationCanBeChanged) { var storedResults = new List <YesNoCardDecision>(); HeroTurnTakerController httc = null; if (hero != null) { httc = FindHeroTurnTakerController(hero); } var e = this.GameController.MakeYesNoCardDecision(httc, SelectionType.MoveCardToHand, d.CardToDestroy.Card, storedResults: storedResults, cardSource: GetCardSource()); if (UseUnityCoroutines) { yield return(this.GameController.StartCoroutine(e)); } else { this.GameController.ExhaustCoroutine(e); } if (DidPlayerAnswerYes(storedResults)) { var nativeDeck = d.CardToDestroy.Card.NativeDeck; var hand = nativeDeck.OwnerTurnTaker.ToHero().Hand; d.SetPostDestroyDestination(hand, false, storedResults.CastEnumerable <YesNoCardDecision, IDecision>(), cardSource: GetCardSource()); } } }
public IEnumerator MoveInsteadResponse(DestroyCardAction d) { CardSource actionCardSource = this.GetCardSource(); if (d.PostDestroyDestinationCanBeChanged) { this.AddInhibitorException((GameAction ga) => (ga is MoveCardAction && (ga as MoveCardAction).CardSource == actionCardSource) || (ga is MessageAction && (ga as MessageAction).CardSource == actionCardSource)); // Move into hand instead. d.SetPostDestroyDestination(this.HeroTurnTaker.Hand, showMessage: true, cardSource: actionCardSource); d.PostDestroyDestinationCanBeChanged = false; // Cannot remove inhibitor exception - the actual movement occurs afterwards as opposed to during an explicit coroutine. This should still be okay, functionally speaking - other areas also avoid removing inhibitor exceptions. } yield break; }
private IEnumerator SetPostDestroyOutOfGame(DestroyCardAction dc) { dc.SetPostDestroyDestination(TurnTaker.OutOfGame, showMessage: true, cardSource: GetCardSource()); IEnumerator coroutine = GameController.SendMessageAction("The Ram 1929 is removed from the game!", Priority.High, GetCardSource()); if (base.UseUnityCoroutines) { yield return(GameController.StartCoroutine(coroutine)); } else { GameController.ExhaustCoroutine(coroutine); } yield return(null); yield break; }
public IEnumerator MoveResponse(DestroyCardAction dca) { // "Whenever a non-hero card is destroyed by a hero card, you may put it under this card." List <YesNoCardDecision> result = new List <YesNoCardDecision>(); IEnumerator chooseCoroutine = base.GameController.MakeYesNoCardDecision(base.HeroTurnTakerController, SelectionType.MoveCardToUnderCard, dca.CardToDestroy.Card, storedResults: result, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(chooseCoroutine)); } else { base.GameController.ExhaustCoroutine(chooseCoroutine); } if (DidPlayerAnswerYes(result)) { dca.SetPostDestroyDestination(base.Card.UnderLocation, decisionSources: result.CastEnumerable <YesNoCardDecision, IDecision>()); } yield break; }
public IEnumerator PermanentIncreaseResponse(DestroyCardAction dca) { // "When this card is destroyed, increase damage dealt by villain targets by 1..." IncreaseDamageStatusEffect pitiless = new IncreaseDamageStatusEffect(1); pitiless.SourceCriteria.IsVillain = true; pitiless.UntilCardLeavesPlay(base.CharacterCard); IEnumerator statusCoroutine = base.GameController.AddStatusEffect(pitiless, true, GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(statusCoroutine)); } else { base.GameController.ExhaustCoroutine(statusCoroutine); } // "... and remove this card from the game." AddInhibitorException((GameAction ga) => ga is MoveCardAction && (ga as MoveCardAction).Destination.IsOutOfGame); dca.SetPostDestroyDestination(base.TurnTaker.OutOfGame, showMessage: true, cardSource: GetCardSource()); AddInhibitorException((GameAction ga) => ga is TargetLeavesPlayAction); yield break; }
private IEnumerator DestroyEnvironmentResponse(DestroyCardAction action) { //...put it beneath this card. action.SetPostDestroyDestination(base.Card.UnderLocation, cardSource: base.GetCardSource()); yield break; }
private IEnumerator Replace(DestroyCardAction arg) { arg.SetPostDestroyDestination(HeroTurnTaker.Hand, cardSource: GetCardSource()); return(DoNothing()); }
private IEnumerator PutUnderThisCardResponse(DestroyCardAction destroyCard) { destroyCard.SetPostDestroyDestination(base.Card.UnderLocation, cardSource: GetCardSource()); yield return(null); }