using System; using System.Collections; using System.Collections.Generic; // Akemi Suedou namespace DCGO.CardEffects.BT22 { public class BT22_095 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Security if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } #endregion #region Your Turn if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("+1 memory, then if you have 7 or less in hand, draw 1", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Your Turn] When any of your Digimon with the [Eater] trait are played, by suspending this Tamer, gain 1 memory. Then, if you have 7 or fewer cards in your hand, (Draw 1 card from your deck.)"; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, IsEater); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnField(card) && CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.CanActivateSuspendCostEffect(card); } bool IsEater(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && permanent.TopCard.HasEaterTraits; } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List { card.PermanentOfThisCard() }, hashtable).Tap()); if (card.Owner.CanAddMemory(activateClass)) yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass)); if (card.Owner.HandCards.Count <= 7) yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw()); } } #endregion #region Main if (timing == EffectTiming.OnDeclaration) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Place underneath a [Mother Eater]", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Main] Place this Tamer as any of your [Mother Eater]s' bottom digivolution card."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.HasMatchConditionPermanent(IsMotherEater); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnField(card) && CardEffectCommons.IsOwnerTurn(card); } bool IsMotherEater(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent,card) && permanent.TopCard.EqualsCardName("Mother Eater"); } IEnumerator ActivateCoroutine(Hashtable hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(IsMotherEater)) { Permanent motherEater = null; int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsMotherEater)); SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: IsMotherEater, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); IEnumerator SelectPermanentCoroutine(Permanent permanent) { motherEater = permanent; yield return null; } selectPermanentEffect.SetUpCustomMessage("Select 1 Mother eater to add to digivolution cards", "The opponent is selecting 1 Mother eater to add to digivolution cards"); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); if (motherEater != null) yield return ContinuousController.instance.StartCoroutine(new IPlacePermanentToDigivolutionCards(new List() { new Permanent[] { card.PermanentOfThisCard(), motherEater } }, false, activateClass).PlacePermanentToDigivolutionCards()); } } } #endregion #region ESS bool ESSCondition() { return CardEffectCommons.IsExistOnField(card) && card.PermanentOfThisCard().TopCard.EqualsCardName("Mother Eater"); } #region Rush if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.RushSelfStaticEffect(isInheritedEffect: true, card: card, condition: ESSCondition)); } #endregion #region Alliance if (timing == EffectTiming.OnAllyAttack) { cardEffects.Add(CardEffectFactory.AllianceSelfEffect(isInheritedEffect: true, card: card, condition: ESSCondition)); } #endregion #region Scapegoat if (timing == EffectTiming.WhenPermanentWouldBeDeleted) { cardEffects.Add(CardEffectFactory.ScapegoatSelfEffect(isInheritedEffect: true, card: card, condition: ESSCondition, effectName: "", effectDiscription: null)); } #endregion #endregion return cardEffects; } } }