Explorar el Código

Add all blue Tamer and Option cardEffects

Andrej Erdelsky hace 2 años
padre
commit
be90f42664

+ 7 - 4
Assets/CardEffect/BT17/Blue/AncientGarurumon_BT17_028.cs

@@ -161,7 +161,7 @@ namespace DCGO.CardEffects.BT17
             }
 
             #endregion
-            
+
             #region When Digivolving
 
             if (timing == EffectTiming.OnEnterFieldAnyone)
@@ -257,9 +257,12 @@ namespace DCGO.CardEffects.BT17
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        return CardEffectCommons.CanTriggerWhenAddHand(hashtable,
-                            player => player == card.Owner || player == card.Owner.Enemy,
-                            cardEffect => cardEffect != null);
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return CardEffectCommons.CanTriggerWhenAddHand(hashtable,
+                                player => player == card.Owner || player == card.Owner.Enemy,
+                                cardEffect => cardEffect != null);
+                        }
                     }
 
                     return false;

+ 305 - 0
Assets/CardEffect/BT17/Blue/DavisMotomiyaAndKenIchijoji_BT17_084.cs

@@ -0,0 +1,305 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class DavisMotomiyaAndKenIchijoji_BT17_084 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Start of Your Turn
+
+            if (timing == EffectTiming.OnStartTurn)
+            {
+                cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
+            }
+
+            #endregion
+
+            #region All Turns
+
+            if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play level 4 or lower Digimon card from digivolution cards of deleted Digimon",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                activateClass.SetHashString("PlaySource_BT17_084");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[All Turns] When one of your level 5 or higher Digimon with the [Free] trait would be deleted in battle, by suspending this Tamer, you may play 1 level 4 or lower Digimon card from that Digimon's digivolution cards without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, IsOwnerPermanentCondition))
+                        {
+                            if (CardEffectCommons.IsByBattle(hashtable))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool IsOwnerPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           permanent.Level <= 5 &&
+                           permanent.TopCard.ContainsTraits("Free") &&
+                           permanent.DigivolutionCards.Count(CanSelectSourceCardCondition) >= 1;
+                }
+
+                bool IsOwnerPermanentToBeDeletedCondition(Permanent permanent)
+                {
+                    return IsOwnerPermanentCondition(permanent) && permanent.willBeRemoveField;
+                }
+
+                bool CanSelectSourceCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon && cardSource.Level <= 4;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanActivateSuspendCostEffect(card))
+                        {
+                            return CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsOwnerPermanentCondition);
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() },
+                            CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsOwnerPermanentToBeDeletedCondition))
+                    {
+                        int maxCount = Math.Min(1,
+                            CardEffectCommons.MatchConditionPermanentCount(IsOwnerPermanentToBeDeletedCondition));
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsOwnerPermanentToBeDeletedCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage(
+                            "Select 1 Digimon which has digivolution cards.",
+                            "The opponent is selecting 1 Digimon which has digivolution cards.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            if (permanent != null)
+                            {
+                                if (permanent.DigivolutionCards.Count(CanSelectSourceCardCondition) >= 1)
+                                {
+                                    maxCount = Math.Min(1,
+                                        permanent.DigivolutionCards.Count(CanSelectSourceCardCondition));
+
+                                    List<CardSource> selectedCards = new List<CardSource>();
+
+                                    SelectCardEffect selectCardEffect =
+                                        GManager.instance.GetComponent<SelectCardEffect>();
+
+                                    selectCardEffect.SetUp(
+                                        canTargetCondition: CanSelectSourceCardCondition,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        canNoSelect: () => true,
+                                        selectCardCoroutine: SelectCardCoroutine,
+                                        afterSelectCardCoroutine: null,
+                                        message: "Select 1 digivolution card to play.",
+                                        maxCount: maxCount,
+                                        canEndNotMax: false,
+                                        isShowOpponent: true,
+                                        mode: SelectCardEffect.Mode.Custom,
+                                        root: SelectCardEffect.Root.Custom,
+                                        customRootCardList: permanent.DigivolutionCards,
+                                        canLookReverseCard: true,
+                                        selectPlayer: card.Owner,
+                                        cardEffect: activateClass);
+
+                                    selectCardEffect.SetUpCustomMessage(
+                                        "Select 1 digivolution card to play.",
+                                        "The opponent is selecting 1 digivolution card to play.");
+                                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                                    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.DigivolutionCards,
+                                            activateETB: true));
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region End of Your Turn
+
+            if (timing == EffectTiming.OnEndTurn)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("1 of your Digimon with the [Free] trait can attack a Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                activateClass.SetHashString("Attack_BT17_084");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[End of Your Turn] 1 of your Digimon with the [Free] trait may attack an opponent's Digimon.";
+                }
+
+                bool IsFreePermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.TopCard.ContainsTraits("Free"))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsFreePermanentCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsFreePermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsFreePermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage(
+                            "Select 1 Digimon that will attack.",
+                            "The opponent is selecting 1 Digimon that will attack.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null)
+                        {
+                            if (selectedPermanent.CanAttack(activateClass))
+                            {
+                                if (selectedPermanent.CanAttackTargetDigimon(null, activateClass))
+                                {
+                                    SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
+
+                                    selectAttackEffect.SetUp(
+                                        attacker: selectedPermanent,
+                                        canAttackPlayerCondition: () => false,
+                                        defenderCondition: _ => true,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Security Effect
+
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Blue/DavisMotomiyaAndKenIchijoji_BT17_084.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 34893ae2696122e44aa2e8be49f701a4
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 83 - 0
Assets/CardEffect/BT17/Blue/KojiMinamoto_BT17_083.cs

@@ -0,0 +1,83 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class KojiMinamoto_BT17_083 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Security Effect
+
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
+            }
+
+            #endregion
+
+            #region Start of Your Turn
+
+            if (timing == EffectTiming.OnStartTurn)
+            {
+                cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
+            }
+
+            #endregion
+
+            #region Your Turn
+
+            if (timing == EffectTiming.OnAddHand)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Gain 1 Memory and Jamming", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Gain1MemoryJamming_BT17_083");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return
+                        "[Your Turn] [Once Per Turn] When an effect adds cards to your hand, gain 1 memory. Then, this Digimon gains [Jamming] for the turn.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return CardEffectCommons.CanTriggerWhenAddHand(hashtable,
+                                player => player == card.Owner,
+                                cardEffect => cardEffect != null);
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        card.Owner.AddMemory(1, activateClass));
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainJamming(
+                        targetPermanent: card.PermanentOfThisCard(), effectDuration: EffectDuration.UntilEachTurnEnd,
+                        activateClass: activateClass));
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Blue/KojiMinamoto_BT17_083.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e657fcc8f29d93d4a8391b8de576b2ee
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Assets/CardEffect/BT17/Blue/MetalGarurumon_BT17_027.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 using System;
 using System.Linq;
 
-namespace DCGO.CardEffects
+namespace DCGO.CardEffects.BT17
 {
     public class MetalGarurumon_BT17_027 : CEntity_Effect
     {

+ 332 - 0
Assets/CardEffect/BT17/Blue/MinamiUehara_BT17_082.cs

@@ -0,0 +1,332 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class MinamiUehara_BT17_082 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region On Play
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play 1 [Labramon] or [Seasarmon] from hand or digivolution cards", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[On Play] You may play 1 [Labramon]/[Seasarmon] from your hand or from one of your Digimon's digivolution cards without paying the cost.";
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                    {
+                        if (cardSource.IsDigimon)
+                        {
+                            return cardSource.ContainsCardName("Labramon") ||
+                                   cardSource.ContainsCardName("Seasarmon");
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.Owner.HandCards.Count >= 1)
+                        {
+                            return true;
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
+                    bool canSelectDigivolutionCards = CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+
+                    if (canSelectHand || canSelectDigivolutionCards)
+                    {
+                        if (canSelectHand && canSelectDigivolutionCards)
+                        {
+                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>
+                            {
+                                new(message: "From hand", value: true, spriteIndex: 0),
+                                new(message: "From digivolution cards", value: false, spriteIndex: 1),
+                            };
+
+                            string selectPlayerMessage = "From which area do you play a card?";
+                            string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
+
+                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements,
+                                selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
+                                notSelectPlayerMessage: notSelectPlayerMessage);
+                        }
+
+                        else
+                        {
+                            GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                            .WaitForEndSelect());
+
+                        bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+                            yield return null;
+                        }
+
+                        if (fromHand)
+                        {
+                            int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
+
+                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                            selectHandEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                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 StartCoroutine(selectHandEffect.Activate());
+                        }
+
+                        else
+                        {
+                            int maxCount = Math.Min(1,
+                                CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                            SelectPermanentEffect selectPermanentEffect =
+                                GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            selectPermanentEffect.SetUpCustomMessage(
+                                "Select 1 Digimon which has digivolution cards.",
+                                "The opponent is selecting 1 Digimon which has digivolution cards.");
+
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                            {
+                                if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
+                                {
+                                    maxCount = Math.Min(1,
+                                        permanent.DigivolutionCards.Count(CanSelectCardCondition));
+
+                                    SelectCardEffect selectCardEffect =
+                                        GManager.instance.GetComponent<SelectCardEffect>();
+
+                                    selectCardEffect.SetUp(
+                                        canTargetCondition: CanSelectCardCondition,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        canNoSelect: () => true,
+                                        selectCardCoroutine: SelectCardCoroutine,
+                                        afterSelectCardCoroutine: null,
+                                        message: "Select 1 digivolution card to play.",
+                                        maxCount: maxCount,
+                                        canEndNotMax: false,
+                                        isShowOpponent: true,
+                                        mode: SelectCardEffect.Mode.Custom,
+                                        root: SelectCardEffect.Root.Custom,
+                                        customRootCardList: permanent.DigivolutionCards,
+                                        canLookReverseCard: true,
+                                        selectPlayer: card.Owner,
+                                        cardEffect: activateClass);
+
+                                    selectCardEffect.SetUpCustomMessage(
+                                        "Select 1 digivolution card to play.",
+                                        "The opponent is selecting 1 digivolution card to play.");
+                                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                                    yield return StartCoroutine(selectCardEffect.Activate());
+                                }
+                            }
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                            cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false,
+                            root: (fromHand) ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.DigivolutionCards,
+                            activateETB: true));
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Your Turn
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("1 of your blue Digimon gains [Rush] for the turn", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true,
+                    EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[All Turns] When one of your Digimon is played from digivolution cards, by suspending this Tamer, 1 of your blue Digimon gains for the turn.";
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                }
+
+                bool IsBluePermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           permanent.IsDigimon &&
+                           permanent.TopCard.CardColors.Contains(CardColor.Blue);
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
+                            {
+                                return CardEffectCommons.IsFromDigimonDigivolutionCards(hashtable);
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanActivateSuspendCostEffect(card))
+                        {
+                            return CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsBluePermanentCondition);
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() },
+                            CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsBluePermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsBluePermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsBluePermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain Rush.",
+                            "The opponent is selecting 1 Digimon that will gain Rush.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(targetPermanent: permanent,
+                                effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Security Effect
+
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Blue/MinamiUehara_BT17_082.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c725e31d1f5a1984f842bfa6058c8a4d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 371 - 0
Assets/CardEffect/BT17/Blue/ReturntothePrimogenitor_BT17_097.cs

@@ -0,0 +1,371 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class ReturntothePrimogenitor_BT17_097 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Main Effect
+
+            if (timing == EffectTiming.OptionSkill)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Digivolve into level 5 or higher [Free] trait Digimon",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Main] 1 of your Digimon may digivolve into a level 5 or higher Digimon card with the [Free] trait in your hand with the digivolution cost reduced by 4. Then, place this card in the battle area.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
+                }
+
+                bool CanSelectHandCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon &&
+                           cardSource.Level >= 5 &&
+                           cardSource.CardTraits.Contains("Free");
+                }
+
+                bool CanSelectOwnPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           card.Owner.HandCards.Where(CanSelectHandCardCondition).Any(cardSource =>
+                               cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass));
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnPermanentCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectOwnPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will digivolve.",
+                            "The opponent is selecting 1 Digimon that will digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                targetPermanent: selectedPermanent,
+                                cardCondition: CanSelectHandCardCondition,
+                                payCost: true,
+                                reduceCostTuple: (reduceCost: 4, reduceCostCardCondition: null),
+                                fixedCostTuple: null,
+                                ignoreDigivolutionRequirementFixedCost: -1,
+                                isHand: true,
+                                activateClass: activateClass,
+                                successProcess: null));
+                        }
+                    }
+
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
+                }
+            }
+
+            #endregion
+
+            #region Delay Effect
+
+            if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(
+                    "Digivolve into a Digimon card with [Imperialdramon] in its name in your hand to prevent deletion",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDescription());
+                activateClass.SetHashString("DigivolveIntoImperialdramon_BT17_097");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[All Turns] When one of your Digimon with the [Free] trait would be deleted other than by one of your effects, [Delay] • By digivolving that Digimon into a Digimon card with [Imperialdramon] in its name in your hand without paying the cost, prevent that deletion.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanDeclareOptionDelayEffect(card) &&
+                           CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, IsOwnerPermanentCondition) &&
+                           !CardEffectCommons.IsByEffect(hashtable,
+                               cardEffect => CardEffectCommons.IsOwnerEffect(cardEffect, card));
+                }
+
+                bool CanSelectHandCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon &&
+                           cardSource.ContainsCardName("Imperialdramon");
+                }
+
+
+                bool IsOwnerPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           permanent.TopCard.ContainsTraits("Free") &&
+                           card.Owner.HandCards.Where(CanSelectHandCardCondition).Any(cardSource =>
+                               cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass));
+                }
+
+                bool IsOwnerPermanentToBeDeletedCondition(Permanent permanent)
+                {
+                    return IsOwnerPermanentCondition(permanent) && permanent.willBeRemoveField;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                            targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() },
+                            activateClass: activateClass, successProcess: permanents => SuccessProcess(),
+                            failureProcess: null));
+                }
+
+                IEnumerator SuccessProcess()
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsOwnerPermanentToBeDeletedCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        int maxCount = Math.Min(1,
+                            CardEffectCommons.MatchConditionPermanentCount(IsOwnerPermanentToBeDeletedCondition));
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsOwnerPermanentToBeDeletedCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage(
+                            "Select 1 Digimon to digivolve.",
+                            "The opponent is selecting 1 Digimon to digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                targetPermanent: selectedPermanent,
+                                cardCondition: CanSelectHandCardCondition,
+                                payCost: false,
+                                reduceCostTuple: null,
+                                fixedCostTuple: null,
+                                ignoreDigivolutionRequirementFixedCost: -1,
+                                isHand: true,
+                                activateClass: activateClass,
+                                successProcess: null));
+                            
+                            selectedPermanent.willBeRemoveField = false;
+                            selectedPermanent.HideDeleteEffect();
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Security Effect
+
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(
+                    $"Play 1 [Davis Motomiya] or [Ken Ichijoji] from hand or trash and place this card in the battle area",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDescription());
+                activateClass.SetIsSecurityEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Security] You may play 1 Tamer card with [Davis Motomiya]/[Ken Ichijoji] in its name from your hand or trash without paying the cost. Then, place this card in the battle area.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                    {
+                        if (cardSource.IsTamer)
+                        {
+                            return cardSource.ContainsCardName("Davis Motomiya") ||
+                                   cardSource.ContainsCardName("DavisMotomiya") ||
+                                   cardSource.ContainsCardName("Ken Ichijoji") ||
+                                   cardSource.ContainsCardName("KenIchijoji");
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
+                    bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
+
+                    if (canSelectHand || canSelectTrash)
+                    {
+                        if (canSelectHand && canSelectTrash)
+                        {
+                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>
+                            {
+                                new(message: "From hand", value: true, spriteIndex: 0),
+                                new(message: "From trash", value: false, spriteIndex: 1),
+                            };
+
+                            string selectPlayerMessage = "From which area do you play a card?";
+                            string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
+
+                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements,
+                                selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
+                                notSelectPlayerMessage: notSelectPlayerMessage);
+                        }
+
+                        else
+                        {
+                            GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                            .WaitForEndSelect());
+
+                        bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+                            yield return null;
+                        }
+
+                        if (fromHand)
+                        {
+                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                            selectHandEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: 1,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                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 StartCoroutine(selectHandEffect.Activate());
+                        }
+
+                        else
+                        {
+                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => true,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message: "Select 1 card to play.",
+                                maxCount: 1,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Trash,
+                                customRootCardList: null,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                            selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                            selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                        }
+
+                        SelectCardEffect.Root root = SelectCardEffect.Root.Hand;
+
+                        if (!fromHand)
+                        {
+                            root = SelectCardEffect.Root.Trash;
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                            cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: root,
+                            activateETB: true));
+                    }
+
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Blue/ReturntothePrimogenitor_BT17_097.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 115322534ba208047948415aa935946a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 1
Assets/CardEffect/BT17/Red/MiraculousMegaKnight_BT17_095.cs

@@ -19,7 +19,6 @@ namespace DCGO.CardEffects.BT17
                 activateClass.SetUpICardEffect($"Play 1 [Agumon] or [Gabumon] from your hand or trash",
                     CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDescription());
-                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()