using System.Collections; using System.Collections.Generic; using UnityEngine.XR; namespace DCGO.CardEffects.P { public class P_136 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Play 1 [Shoemon] from your hand", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] You may play 1 [Shoemon] from your hand without paying the cost."; } bool SelectShoemon(CardSource cardSource) { if (cardSource.CardNames.Contains("Shoemon")) { if (CardEffectCommons.CanPlayAsNewPermanent( cardSource: cardSource, payCost: false, cardEffect: activateClass, isBreedingArea: false)) { return true; } } return false; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.HasMatchConditionOwnersHand(card, SelectShoemon)) { return true; } } return true; } IEnumerator ActivateCoroutine(Hashtable hashtable) { SelectHandEffect selectHandEffect = GManager.instance.GetComponent(); selectHandEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: SelectShoemon, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: true, canEndNotMax: false, isShowOpponent: true, selectCardCoroutine: null, afterSelectCardCoroutine: PlaySelectedCard, mode: SelectHandEffect.Mode.Custom, cardEffect: activateClass); selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play."); selectHandEffect.SetUpCustomMessage_ShowCard("Played Card"); yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate()); IEnumerator PlaySelectedCard(List selectedCards) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards( cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true)); } } } #endregion #region Your Turn - When Digivolving if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription()); activateClass.SetHashString("Digivoles_P_136"); cardEffects.Add(activateClass); string EffectDiscription() { return "[Your Turn][Once Per Turn] When one of your Digimon digivolves into a Digimon with the[Puppet] trait, by suspending this Tamer, gain 1 memory."; } bool IsDigmonDigivolve(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)) { if (permanent.TopCard.ContainsTraits("Puppet")) { return true; } } return false; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) return CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, IsDigmonDigivolve); return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanActivateSuspendCostEffect(card)) { return true; } } return false; } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap()); yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass)); } } #endregion #region Security Effect if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } #endregion return cardEffects; } } }