using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT21 { //Zenith public class BT21_087 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Start of Your Turn if (timing == EffectTiming.OnStartTurn) { cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card)); } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect($"Reveal the top 3 cards of deck", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] Reveal the top 3 cards of your deck. Among them, play 1 [Vemmon] without paying the cost or add 1 card with [Vemmon] in its text to the hand. Trash the rest."; } bool CanSelectCardCondition(CardSource cardSource) { return cardSource.HasText("Vemmon"); } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && card.Owner.LibraryCards.Count >= 1; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { CardSource selectedCard = null; yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect( revealCount: 3, simplifiedSelectCardConditions: new SimplifiedSelectCardConditionClass[] { new SimplifiedSelectCardConditionClass( canTargetCondition:CanSelectCardCondition, message: "Select 1 [Vemmon] or 1 card with [Vemmon] in its text.", mode: SelectCardEffect.Mode.Custom, maxCount: 1, selectCardCoroutine: SelectCardCoroutine), }, remainingCardsPlace: RemainingCardsPlace.Trash, activateClass: activateClass, canNoSelect: true )); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCard = cardSource; yield return null; } bool playCard = false; if(selectedCard != null) { if (selectedCard.EqualsCardName("Vemmon")) { List> selectionElements = new List>() { new SelectionElement(message: $"Play", value : true, spriteIndex: 0), new SelectionElement(message: $"Add to your hand", value : false, spriteIndex: 1), }; string selectPlayerMessage = "Will you play this card or add it to your hand?"; string notSelectPlayerMessage = "The opponent is choosing whether to play the selected card or add it to their hand."; GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage); yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect()); playCard = GManager.instance.userSelectionManager.SelectedBoolValue; } if (playCard) { if(CardEffectCommons.CanPlayAsNewPermanent(selectedCard, false, activateClass, SelectCardEffect.Root.Library)) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards( cardSources: new List { selectedCard }, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Library, activateETB: true)); } else { yield return ContinuousController.instance.StartCoroutine(new ITrashDeckCards(new List { selectedCard }, activateClass).TrashDeckCards()); } } else { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(selectedCard, activateClass)); } } } } #endregion #region Security if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } #endregion return cardEffects; } } }