private OnPhaseChangeStatusEffect MakeTurntakerStartPhaseEffect(string methodToCall, TurnTaker target, TriggerType triggerType, string description) { OnPhaseChangeStatusEffect effect = new OnPhaseChangeStatusEffect(this.CardWithoutReplacements, methodToCall, description, new[] { triggerType }, this.Card); GameController.AddCardPropertyJournalEntry(Card, IncapTurnTakerKey, target); effect.UntilEndOfNextTurn(base.HeroTurnTaker); effect.TurnTakerCriteria.IsSpecificTurnTaker = base.HeroTurnTaker; effect.TurnPhaseCriteria.Phase = Phase.Start; effect.BeforeOrAfter = BeforeOrAfter.After; effect.UntilCardLeavesPlay(base.Card); return(effect); }
public override IEnumerator UsePower(int index = 0) { //"Play an equipment target next to a hero. Treat {TheKnight}'s name on that equipment as the name of the hero it is next to." //"..an equipment target..." List <SelectCardDecision> storedEquipment = new List <SelectCardDecision> { }; IEnumerator coroutine = GameController.SelectCardAndStoreResults(DecisionMaker, SelectionType.PlayCard, new LinqCardCriteria((Card c) => c.Location == this.HeroTurnTaker.Hand && IsEquipment(c) && c.IsTarget && GameController.CanPlayCard(FindCardController(c)) == CanPlayCardResult.CanPlay, "", false, singular: "playable equipment target", plural: "playable equipment targets"), storedEquipment, false, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (!DidSelectCard(storedEquipment)) { yield break; } Card equipment = storedEquipment.FirstOrDefault().SelectedCard; //"...next to a hero" List <SelectCardDecision> storedHero = new List <SelectCardDecision> { }; coroutine = GameController.SelectCardAndStoreResults(DecisionMaker, SelectionType.HeroCharacterCard, new LinqCardCriteria((Card c) => c.IsInPlayAndHasGameText && c.IsTarget && c.IsHeroCharacterCard && !c.IsIncapacitated, "hero character"), storedHero, false, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (!DidSelectCard(storedHero)) { yield break; } Card hero = storedHero.FirstOrDefault().SelectedCard; //...Treat {TheKnight}'s name on that equipment as the name of the hero it is next to." GameController.AddCardPropertyJournalEntry(equipment, VigilarKey, hero); //"Play an equipment target next to a hero." List <bool> wasCardPlayed = new List <bool> { }; coroutine = GameController.PlayCard(DecisionMaker, equipment, wasCardPlayed: wasCardPlayed, overridePlayLocation: hero.Owner.PlayArea, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } if (wasCardPlayed.Any() && wasCardPlayed.FirstOrDefault()) { coroutine = GameController.SendMessageAction($"{this.Card.Title} lends {equipment.Title} to {hero.Title}", Priority.Medium, GetCardSource(), new Card[] { equipment }); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } OnPhaseChangeStatusEffect messageStatusEffect = new OnPhaseChangeStatusEffect(CardWithoutReplacements, nameof(DoNothing), $"{Card.Title}'s name is treated as {hero.Title} on {equipment.Title}", new TriggerType[] { TriggerType.Other }, equipment); messageStatusEffect.UntilCardLeavesPlay(equipment); messageStatusEffect.CanEffectStack = true; coroutine = GameController.AddStatusEffect(messageStatusEffect, false, GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } } else { GameController.AddCardPropertyJournalEntry(equipment, VigilarKey, (Card)null); } yield break; }