using System.Collections; using System.Collections.Generic; using System.Linq; namespace DCGO.CardEffects.BT19 { public class BT19_008 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alternate Digivolution if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 2 && targetPermanent.TopCard.EqualsTraits("Xros Heart"); } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null)); } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Digivolve into [OmniShoutmon] from under your Tamers", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() { return "[On Play] This Digimon may digivolve into [OmniShoutmon] under your Tamers without paying the cost."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool DigivolveCardCondition(CardSource cardSource) { return cardSource.IsDigimon && cardSource.EqualsCardName("OmniShoutmon") && cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass); } bool TamerHasDigimonCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) && permanent.IsTamer && permanent.DigivolutionCards.Count(DigivolveCardCondition) >= 1; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.HasMatchConditionPermanent(TamerHasDigimonCondition); } IEnumerator ActivateCoroutine(Hashtable hashtable) { Permanent selectedPermanent = null; SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: TamerHasDigimonCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: true, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select a Tamer.", "The opponent is selecting a Tamer."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanent = permanent; yield return null; } if (selectedPermanent != null) { List selectedCards = new List(); SelectCardEffect selectCardEffect = GManager.instance.GetComponent(); selectCardEffect.SetUp( canTargetCondition: DigivolveCardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, canNoSelect: () => true, selectCardCoroutine: SelectCardCoroutine, afterSelectCardCoroutine: null, message: "Select 1 card to digivolve into.", maxCount: 1, canEndNotMax: false, isShowOpponent: true, mode: SelectCardEffect.Mode.Custom, root: SelectCardEffect.Root.Custom, customRootCardList: selectedPermanent.DigivolutionCards, canLookReverseCard: true, selectPlayer: card.Owner, cardEffect: activateClass); selectCardEffect.SetUpCustomMessage("Select 1 card to digivolve into.", "The opponent is selecting 1 card to digivolve into."); selectCardEffect.SetUpCustomMessage_ShowCard("Digivolve Card"); yield return StartCoroutine(selectCardEffect.Activate()); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCards.Add(cardSource); yield return null; } yield return ContinuousController.instance.StartCoroutine(new PlayCardClass( cardSources: selectedCards, hashtable: CardEffectCommons.CardEffectHashtable(activateClass), payCost: false, targetPermanent: card.PermanentOfThisCard(), isTapped: false, root: SelectCardEffect.Root.DigivolutionCards, activateETB: true).PlayCard()); } } } #endregion #region On Deletion if (timing == EffectTiming.OnDestroyedAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Reveal top 3 cards of the deck and play 1 [Xros Heart] Tamer from them, then ", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() { return "[On Deletion] Reveal the top 3 cards of your deck. Play 1 Tamer card with the [Xros Heart] trait among them without paying the cost. Return the rest to the bottom of the deck. Then, ."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass); } bool IsTamerCardCondition(CardSource cardSource) { return cardSource.IsTamer && cardSource.EqualsTraits("Xros Heart") && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass); } bool CanSelectSaveTamerPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) && permanent.IsTamer; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.CanActivateOnDeletion(card, activateClass); } IEnumerator ActivateCoroutine(Hashtable hashtable) { List selectedCards = new List(); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndSelect( revealCount: 3, selectCardConditions: new SelectCardConditionClass[] { new( canTargetCondition: IsTamerCardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, canNoSelect: false, selectCardCoroutine: SelectCardCoroutine, message: "Select 1 Tamer with the [Xros Heart] trait.", maxCount: 1, canEndNotMax: false, mode: SelectCardEffect.Mode.Custom ) }, remainingCardsPlace: RemainingCardsPlace.DeckBottom, activateClass: activateClass, canNoAction: false )); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCards.Add(cardSource); yield return null; } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards( cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Library, activateETB: true)); if (CardEffectCommons.CanActivateSave(hashtable, CanSelectSaveTamerPermanentCondition)) { yield return ContinuousController.instance.StartCoroutine( CardEffectCommons.SaveProcess(hashtable, activateClass, card, CanSelectSaveTamerPermanentCondition)); } } } #endregion #region Your Turn - ESS if (timing == EffectTiming.None) { bool Condition() { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.IsOwnerTurn(card) && card.PermanentOfThisCard().TopCard.EqualsTraits("Xros Heart"); } cardEffects.Add(CardEffectFactory.RushSelfStaticEffect(isInheritedEffect: true, card: card, condition: Condition)); } #endregion return cardEffects; } } }