Browse Source

initial black cards

mbunch_kascope 2 năm trước cách đây
mục cha
commit
01198e23fa

+ 3 - 0
Assets/CardBaseEntity/BT17/Black/Option/Clock_of_the_End-BT17-100.asset

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3edff8945cbc4ece7749db3c201abc5669398d8b66a832f5f9ee7c0ff37c4997
+size 1713

+ 0 - 0
Assets/CardBaseEntity/BT17/Black/Option/Doomsday_Clock-BT17-100.asset.meta → Assets/CardBaseEntity/BT17/Black/Option/Clock_of_the_End-BT17-100.asset.meta


+ 0 - 3
Assets/CardBaseEntity/BT17/Black/Option/Doomsday_Clock-BT17-100.asset

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b2d93b16b5ef8b47ece87411fb089788118f5e1d360e6e3e0bd2c92182c9dd49
-size 1709

+ 0 - 3
Assets/CardEffect/BT17/Black/Agumon_BT17_052.cs

@@ -64,9 +64,6 @@ namespace DCGO.CardEffects.BT17
             }
             #endregion
 
-
-
-
             return cardEffects;
         }
     }

+ 501 - 0
Assets/CardEffect/BT17/Black/Armageddemon_BT17_060.cs

@@ -0,0 +1,501 @@
+using System.Collections;
+using System.Collections.Generic;
+using static UnityEditor.PlayerSettings;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class Armageddemon_BT17_060 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Rush, Reboot, Blocker
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RushSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false,card: card,condition: null));
+            }
+            #endregion
+
+            #region On Play/When Digivolving Shared
+            int maxCost = 15;
+
+            bool CanSelectOpponentsPermanent(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    if (permanent.TopCard.GetCostItself <= maxCost)
+                    {
+                        if (permanent.TopCard.HasPlayCost)
+                        {
+                            return true;
+                        }
+                    }
+                }
+
+                return false;
+            }
+
+            bool CanEndSelectCondition(List<Permanent> permanents)
+            {
+                if (permanents.Count <= 0)
+                    return false;
+
+                int sumCost = 0;
+
+                foreach (Permanent permanent1 in permanents)
+                {
+                    sumCost += permanent1.TopCard.GetCostItself;
+                }
+
+                if (sumCost > maxCost)
+                    return false;
+
+                return true;
+            }
+
+            bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent)
+            {
+                int sumCost = 0;
+
+                foreach (Permanent permanent1 in permanents)
+                {
+                    sumCost += permanent1.TopCard.GetCostItself;
+                }
+
+                sumCost += permanent.TopCard.GetCostItself;
+
+                if (sumCost > maxCost)
+                    return false;
+
+                return true;
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete up to 15 play cost's worth of your opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] Delete up to 15 play cost's worth of your opponent's Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int destroyCount = card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectOpponentsPermanent);
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectOpponentsPermanent,
+                        canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
+                        canEndSelectCondition: CanEndSelectCondition,
+                        maxCount: destroyCount,
+                        canNoSelect: false,
+                        canEndNotMax: true,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete up to 15 play cost's worth of your opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] Delete up to 15 play cost's worth of your opponent's Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int destroyCount = card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectOpponentsPermanent);
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectOpponentsPermanent,
+                        canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
+                        canEndSelectCondition: CanEndSelectCondition,
+                        maxCount: destroyCount,
+                        canNoSelect: false,
+                        canEndNotMax: true,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+            #endregion
+
+            #region Your Turn - Can attack unsuspended
+            if (timing == EffectTiming.None)
+            {
+                CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
+                canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Can attack unsuspended Digimon", CanUseCondition, card);
+                canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(
+                    attackerCondition: AttackerCondition,
+                    defenderCondition: DefenderCondition,
+                    cardEffectCondition: CardEffectCondition);
+                cardEffects.Add(canAttackTargetDefendingPermanentClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool AttackerCondition(Permanent attacker)
+                {
+                    return attacker == card.PermanentOfThisCard();
+                }
+
+                bool DefenderCondition(Permanent defender)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(defender, card))
+                    {
+                        if (!defender.IsSuspended)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CardEffectCondition(ICardEffect cardEffect)
+                {
+                    return true;
+                }
+            }
+            #endregion
+
+            #region Reduce Cost - Effect
+            if (timing == EffectTiming.BeforePayCost)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Bottom deck card to reduce Cost -1", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetHashString("PlayCost-1_BT17_060");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "When this card would be played from the hand, by returning up to 13 cards with the [Unidentified] trait or [Diaboromon] in their text from your trash to the bottom of the deck, for each card returned, reduce the play cost by 1.";
+                }
+
+                bool CanSelectCardInTrash(CardSource source)
+                {
+                    if (source.EqualsCardName("Diaboromon"))
+                        return true;
+
+                    if (source.CardTraits.Contains("Unidentified"))
+                        return true;
+
+                    return false;
+                }
+
+                bool CardCondition(CardSource cardSource)
+                {
+                    if (cardSource == card)
+                    {
+                        if (CardEffectCommons.IsExistOnHand(cardSource))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, CardCondition))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.HasMatchConditionOpponentsCardInTrash(card, CanSelectCardInTrash);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionOpponentsCardInTrash(card, CanSelectCardInTrash))
+                    {
+                        bool CanNoSelect = true;
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        CardSource Card = CardEffectCommons.GetCardFromHashtable(_hashtable);
+
+                        if (Card != null)
+                        {
+                            if (Card.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) > Card.Owner.MaxMemoryCost)
+                            {
+                                CanNoSelect = false;
+                            }
+                        }
+
+                        int maxCount = 13;
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectCardInTrash,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => CanNoSelect,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: SelectCardCoroutine,
+                            message: "Select up to 13 cards to bottom of deck.",
+                            maxCount: maxCount,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        selectCardEffect.SetUpCustomMessage("Select up to 13 card(s) to bottom deck.", "The opponent is selecting up to 13 card(s) to bottom deck.");
+                        selectCardEffect.SetUpCustomMessage_ShowCard("Card(s) Bottom Decked");
+
+                        yield return StartCoroutine(selectCardEffect.Activate());
+
+                        IEnumerator SelectCardCoroutine(List<CardSource> sources)
+                        {
+                            if(sources.Count > 0)
+                            {
+                                selectedCards = sources.Clone();
+                                selectedCards.Reverse();
+                                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryTopCards(selectedCards));
+                            }
+                        }
+
+                        if(selectedCards.Count > 0)
+                        {
+                            if (card.Owner.CanReduceCost(null, card))
+                            {
+                                ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
+                            }
+
+                            ChangeCostClass changeCostClass = new ChangeCostClass();
+                            changeCostClass.SetUpICardEffect("Play Cost -1", CanUseCondition1, card);
+                            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                            card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
+
+                            bool CanUseCondition1(Hashtable hashtable)
+                            {
+                                return true;
+                            }
+
+                            int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                            {
+                                if (CardSourceCondition(cardSource))
+                                {
+                                    if (RootCondition(root))
+                                    {
+                                        if (PermanentsCondition(targetPermanents))
+                                        {
+                                            Cost -= selectedCards.Count;
+                                        }
+                                    }
+                                }
+
+                                return Cost;
+                            }
+
+                            bool PermanentsCondition(List<Permanent> targetPermanents)
+                            {
+                                if (targetPermanents == null)
+                                {
+                                    return true;
+                                }
+
+                                else
+                                {
+                                    if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
+                                    {
+                                        return true;
+                                    }
+                                }
+
+                                return false;
+                            }
+
+                            bool CardSourceCondition(CardSource cardSource)
+                            {
+                                return cardSource == card;
+                            }
+
+                            bool RootCondition(SelectCardEffect.Root root)
+                            {
+                                return true;
+                            }
+
+                            bool isUpDown()
+                            {
+                                return true;
+                            }
+
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region Reduce Cost - Not Shown
+            if (timing == EffectTiming.None)
+            {
+                ChangeCostClass changeCostClass = new ChangeCostClass();
+                changeCostClass.SetUpICardEffect("Play Cost -", CanUseCondition, card);
+                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => true, isChangePayingCost: () => true);
+                changeCostClass.SetNotShowUI(true);
+                cardEffects.Add(changeCostClass);
+
+                bool CanSelectCardInTrash(CardSource source)
+                {
+                    if (source.EqualsCardName("Diaboromon"))
+                        return true;
+
+                    if (source.CardTraits.Contains("Unidentified"))
+                        return true;
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (card.Owner.HandCards.Contains(card))
+                    {
+                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Bottom deck card to reduce Cost -1");
+
+                        if (activateClass != null)
+                        {
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardInTrash))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                {
+                    if (CardSourceCondition(cardSource))
+                    {
+                        if (RootCondition(root))
+                        {
+                            if (PermanentsCondition(targetPermanents))
+                            {
+                                Cost -= CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectCardInTrash);
+                            }
+                        }
+                    }
+
+                    return Cost;
+                }
+
+                bool PermanentsCondition(List<Permanent> targetPermanents)
+                {
+                    if (targetPermanents == null)
+                    {
+                        return true;
+                    }
+
+                    else
+                    {
+                        if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    if (cardSource != null)
+                    {
+                        if (cardSource == card)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool RootCondition(SelectCardEffect.Root root)
+                {
+                    return true;
+                }
+
+                bool isUpDown()
+                {
+                    return true;
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/Armageddemon_BT17_060.cs.meta

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

+ 542 - 0
Assets/CardEffect/BT17/Black/Chaosdramon_BT17_057.cs

@@ -0,0 +1,542 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class Chaosdramon_BT17_057 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+            if (timing == EffectTiming.None)
+            {
+                static bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.ContainsTraits("SoC") && targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 5;
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region [DigiXros -2] [Machinedramon] x 1 Lv.5 Digimon card w/[Cyborg] trait
+            if (timing == EffectTiming.None)
+            {
+                AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
+                addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", CanUseCondition, card);
+                addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
+                addDigiXrosConditionClass.SetNotShowUI(true);
+                cardEffects.Add(addDigiXrosConditionClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return true;
+                }
+
+                DigiXrosCondition GetDigiXros(CardSource cardSource)
+                {
+                    if (cardSource == card)
+                    {
+                        DigiXrosConditionElement element = new DigiXrosConditionElement(CanSelectCardCondition, "Machinedramon");
+
+                        bool CanSelectCardCondition(CardSource cardSource)
+                        {
+                            if (cardSource != null)
+                            {
+                                if (cardSource.Owner == card.Owner)
+                                {
+                                    if (cardSource.IsDigimon)
+                                    {
+                                        if (cardSource.CardNames_DigiXros.Contains("Machinedramon"))
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition1, "Lv.5 Digimon card w/[Cyborg] trait");
+
+                        bool CanSelectCardCondition1(CardSource cardSource)
+                        {
+                            if (cardSource != null)
+                            {
+                                if (cardSource.Owner == card.Owner)
+                                {
+                                    if (cardSource.IsDigimon)
+                                    {
+                                        if(cardSource.HasLevel && cardSource.Level == 5)
+                                        {
+                                            if (cardSource.ContainsTraits("Cyborg"))
+                                            {
+                                                return true;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>() { element, element1 };
+
+                        DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 2);
+
+                        return digiXrosCondition;
+                    }
+
+                    return null;
+                }
+            }
+
+            if (timing == EffectTiming.None)
+            {
+                AddMaxTrashCountDigiXrosClass addMaxTrashCountDigiXrosClass = new AddMaxTrashCountDigiXrosClass();
+                addMaxTrashCountDigiXrosClass.SetUpICardEffect($"Trash cards can be selected for DigiXros", CanUseCondition, card);
+                addMaxTrashCountDigiXrosClass.SetUpAddMaxTrashCountDigiXrosClass(getMaxTrashCount: GetCount);
+                addMaxTrashCountDigiXrosClass.SetNotShowUI(true);
+                cardEffects.Add(addMaxTrashCountDigiXrosClass);
+
+                bool HasTamer(Permanent permanent)
+                {
+                    if (permanent.IsTamer)
+                        return permanent.TopCard.CardColors.Contains(CardColor.Black);
+                    
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasTamer);
+                }
+
+                int GetCount(CardSource cardSource)
+                {
+                    if (cardSource == card)
+                    {
+                        return 100;
+                    }
+
+                    return 0;
+                }
+            }
+            #endregion
+
+            #region On Play/When Digivolving Shared
+            int maxCost = 7;
+
+            bool IsCyborgOrSoC(CardSource source)
+            {
+                if (source.ContainsTraits("Cyborg"))
+                    return true;
+
+                if (source.HasSocTraits)
+                    return true;
+
+                return false;
+            }
+
+            bool CanSelectOpponentsPermanent(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    if (permanent.TopCard.GetCostItself <= maxCost)
+                    {
+                        if (permanent.TopCard.HasPlayCost)
+                        {
+                            return true;
+                        }
+                    }
+                }
+
+                return false;
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("By placing 1 digivolution source, delete up to 7 play cost", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] By placing 1 card with the [Cyborg] or [SoC] trait from your trash as this Digimon's bottom digivolution card, delete up to 7 play cost worth of your opponent's Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnPlay(hashtable, card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsCyborgOrSoC))
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool sourceAdded = false;
+
+                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, IsCyborgOrSoC));
+
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                                canTargetCondition: IsCyborgOrSoC,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message: "Select 1 card to place at the bottom of digivolution cards.",
+                                maxCount: maxCount,
+                                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 place at the bottom of digivolution cards.", "The opponent is selecting 1 card to place at the bottom of digivolution cards.");
+
+                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    {
+                        if(cardSource != null)
+                        {
+                            sourceAdded = true;
+                        }
+                            yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { cardSource }, activateClass));
+                    }
+
+                    if (sourceAdded)
+                    {
+                        int destroyCount = card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectOpponentsPermanent);
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectOpponentsPermanent,
+                            canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
+                            canEndSelectCondition: CanEndSelectCondition,
+                            maxCount: destroyCount,
+                            canNoSelect: false,
+                            canEndNotMax: true,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        bool CanEndSelectCondition(List<Permanent> permanents)
+                        {
+                            if (permanents.Count <= 0)
+                                return false;
+
+                            int sumCost = 0;
+
+                            foreach (Permanent permanent1 in permanents)
+                            {
+                                sumCost += permanent1.TopCard.GetCostItself;
+                            }
+
+                            if (sumCost > maxCost)
+                                return false;
+
+                            return true;
+                        }
+
+                        bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent)
+                        {
+                            int sumCost = 0;
+
+                            foreach (Permanent permanent1 in permanents)
+                            {
+                                sumCost += permanent1.TopCard.GetCostItself;
+                            }
+
+                            sumCost += permanent.TopCard.GetCostItself;
+
+                            if (sumCost > maxCost)
+                                return false;
+
+                            return true;
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("By placing 1 digivolution source, delete up to 7 play cost", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] By placing 1 card with the [Cyborg] or [SoC] trait from your trash as this Digimon's bottom digivolution card, delete up to 7 play cost worth of your opponent's Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsCyborgOrSoC))
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool sourceAdded = false;
+
+                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, IsCyborgOrSoC));
+
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                                canTargetCondition: IsCyborgOrSoC,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message: "Select 1 card to place at the bottom of digivolution cards.",
+                                maxCount: maxCount,
+                                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 place at the bottom of digivolution cards.", "The opponent is selecting 1 card to place at the bottom of digivolution cards.");
+
+                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    {
+                        if (cardSource != null)
+                        {
+                            sourceAdded = true;
+                        }
+                        yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { cardSource }, activateClass));
+                    }
+
+                    if (sourceAdded)
+                    {
+                        int destroyCount = card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectOpponentsPermanent);
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectOpponentsPermanent,
+                            canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
+                            canEndSelectCondition: CanEndSelectCondition,
+                            maxCount: destroyCount,
+                            canNoSelect: false,
+                            canEndNotMax: true,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        bool CanEndSelectCondition(List<Permanent> permanents)
+                        {
+                            if (permanents.Count <= 0)
+                                return false;
+
+                            int sumCost = 0;
+
+                            foreach (Permanent permanent1 in permanents)
+                            {
+                                sumCost += permanent1.TopCard.GetCostItself;
+                            }
+
+                            if (sumCost > maxCost)
+                                return false;
+
+                            return true;
+                        }
+
+                        bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent)
+                        {
+                            int sumCost = 0;
+
+                            foreach (Permanent permanent1 in permanents)
+                            {
+                                sumCost += permanent1.TopCard.GetCostItself;
+                            }
+
+                            sumCost += permanent.TopCard.GetCostItself;
+
+                            if (sumCost > maxCost)
+                                return false;
+
+                            return true;
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region All Turns
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Prevent this Digimon from leaving the battle area", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetHashString("Substitute_BT17_057");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] When this Digimon would leave the battle area by one of your opponent's effects, by trashing 2 cards with the [Machine], [Cyborg] or [SoC] trait from this Digimon's digivolution cards, prevent it from leaving.";
+                }
+
+                bool CanSelectSourceCondition(CardSource cardSource)
+                {
+                    if (!cardSource.CanNotTrashFromDigivolutionCards(activateClass))
+                    {
+                        if (cardSource.ContainsTraits("Machine") || cardSource.ContainsTraits("Cyborg") || cardSource.HasSocTraits)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectSourceCondition) >= 2)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        Permanent selectedPermanent = card.PermanentOfThisCard();
+
+                        if (selectedPermanent.DigivolutionCards.Count(CanSelectSourceCondition) >= 2)
+                        {
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            int maxCount = Math.Min(2, selectedPermanent.DigivolutionCards.Count(CanSelectSourceCondition));
+
+                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                        canTargetCondition: CanSelectSourceCondition,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        canNoSelect: () => true,
+                                        selectCardCoroutine: SelectCardCoroutine,
+                                        afterSelectCardCoroutine: null,
+                                        message: "Select cards to discard.",
+                                        maxCount: maxCount,
+                                        canEndNotMax: false,
+                                        isShowOpponent: true,
+                                        mode: SelectCardEffect.Mode.Custom,
+                                        root: SelectCardEffect.Root.Custom,
+                                        customRootCardList: selectedPermanent.DigivolutionCards,
+                                        canLookReverseCard: true,
+                                        selectPlayer: card.Owner,
+                                        cardEffect: activateClass);
+
+                            selectCardEffect.SetNotShowCard();
+                            yield return StartCoroutine(selectCardEffect.Activate());
+
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                selectedCards.Add(cardSource);
+                                yield return null;
+                            }
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                if (selectedCards.Count == 2)
+                                {
+                                    selectedPermanent.willBeRemoveField = false;
+
+                                    selectedPermanent.HideDeleteEffect();
+                                    selectedPermanent.HideHandBounceEffect();
+                                    selectedPermanent.HideDeckBounceEffect();
+                                }
+
+                                yield return ContinuousController.instance.StartCoroutine(new ITrashDigivolutionCards(selectedPermanent, selectedCards, activateClass).TrashDigivolutionCards());
+                            }
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/Chaosdramon_BT17_057.cs.meta

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

+ 347 - 0
Assets/CardEffect/BT17/Black/ClockoftheEnd_BT17_100.cs

@@ -0,0 +1,347 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects
+{
+    public class ClockoftheEnd_BT17_100 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Main - Option Effect
+            if (timing == EffectTiming.OptionSkill)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play 1 [Diaboromon] Token, Then, place this card as the bottom digivolution", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Main] Play 1 [Diaboromon] Token without paying the cost. Then, place this card as the bottom digivolution card of 1 of your [Diaboromon] without [Clock of the End] in its digivolution cards.";
+                }
+
+                bool IsClockOfTheEnd(CardSource source)
+                {
+                    return source.EqualsCardName("Clock of the End");
+                }
+
+                bool HasDiaboromonWithoutClock(Permanent permanent)
+                {
+                    if (permanent.IsDigimon)
+                    {
+                        if (!permanent.IsToken)
+                        {
+                            if(permanent.DigivolutionCards.Count(IsClockOfTheEnd) == 0)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) >= 1)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+                    }
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(HasDiaboromonWithoutClock))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(HasDiaboromonWithoutClock));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: HasDiaboromonWithoutClock,
+                            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 get a digivolution card.", "The opponent is selecting 1 Digimon that will get a digivolution card.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            if (permanent != null)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(card.Owner.brainStormObject.CloseBrainstrorm(card));
+
+                                yield return ContinuousController.instance.StartCoroutine(permanent.AddDigivolutionCardsBottom(new List<CardSource>() { card }, activateClass));
+                            }
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region Start of Your Turn
+            if(timing == EffectTiming.OnStartTurn)
+            {
+                bool IsClockofTheEnd(Permanent permanent)
+                {
+                    return permanent.TopCard.EqualsCardName("Clock of the End");
+                }
+
+                if (CardEffectCommons.MatchConditionOwnersPermanentCount(card, IsClockofTheEnd) >= 4)
+                {
+                    GManager.instance.turnStateMachine.EndGame(card.Owner, false);
+                }
+            }
+            #endregion
+
+            #region All Turns - ESS
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete your 1 other Digimon to prevent this Digimon from leaving Battle Area", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Substitute_BT14_056");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] When this Digimon would leave the battle area by an opponent's effect, by deleting 1 of your other [Diaboromon], prevent it from leaving.";
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            if (permanent.TopCard.EqualsCardName("Diaboromon"))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card))
+                        {
+                            if (CardEffectCommons.IsByEffect(hashtable, cardEffect => !CardEffectCommons.IsOwnerEffect(cardEffect, card)))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    Permanent thisCardPermanent = card.PermanentOfThisCard();
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        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 to delete.", "The opponent is selecting 1 Digimon to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                                targetPermanents: new List<Permanent>() { permanent },
+                                activateClass: activateClass,
+                                successProcess: permanents => SuccessProcess(),
+                                failureProcess: null));
+
+                            IEnumerator SuccessProcess()
+                            {
+                                thisCardPermanent.willBeRemoveField = false;
+
+                                thisCardPermanent.HideDeleteEffect();
+                                thisCardPermanent.HideHandBounceEffect();
+                                thisCardPermanent.HideDeckBounceEffect();
+                                thisCardPermanent.HideWillRemoveFieldEffect();
+
+                                yield return null;
+                            }
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region End of Opponent's Turn - ESS
+            if (timing == EffectTiming.OnEndTurn)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Return 1 digivolution card to play a Digimon from digivolution cards", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetHashString("PlayDigimon_BT10_066");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[End of Opponent's Turn] Place 1 [Clock of the End] from this Digimon's digivolution cards in the battle area.";
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                        return cardSource.EqualsCardName("Clock of the End");
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectCardCondition) >= 1)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        Permanent selectedPermanent = card.PermanentOfThisCard();
+
+                        if (selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
+                        {
+                            int maxCount = Math.Min(1, selectedPermanent.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 card to play.",
+                                        maxCount: maxCount,
+                                        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 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)
+                            {
+                                if (cardSource != null)
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: cardSource, cardEffect: activateClass));
+                            }
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region Secutiry Effect
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect($"Add this card to hand", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSecurityEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Security] Add this card to the hand";
+                }
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/ClockoftheEnd_BT17_100.cs.meta

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

+ 283 - 0
Assets/CardEffect/BT17/Black/Diaboromon_BT17_059.cs

@@ -0,0 +1,283 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class Diaboromon_BT17_059 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("By placing [Clock of The End] in sources, Play 2 Diaboromon tokens", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] By placing 1 [Clock of The End] from your hand or trash as this Digimon's bottom digivolution card, you may play 2 [Diaboromon] (Digimon | 14 Cost | Level 6 | White | Mega | Unknown | Unidentified | DP3000) Tokens without paying its cost.";
+                }
+
+                bool HasClockofTheEnd(CardSource source)
+                {
+                    return source.EqualsCardName("Clock of The End");
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionOwnersHand(card, HasClockofTheEnd) || CardEffectCommons.HasMatchConditionOwnersHand(card, HasClockofTheEnd))
+                        {
+                            if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) >= 1)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool validCardInTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasClockofTheEnd);
+                    bool validCardInHand = CardEffectCommons.HasMatchConditionOwnersHand(card, HasClockofTheEnd);
+                    bool useTrash = false;
+                    bool cardAdded = false;
+
+                    if (validCardInTrash || validCardInHand)
+                    {
+                        #region Selecting Hand or Trash
+                        if (validCardInTrash && validCardInHand)
+                        {
+                            List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>()
+                                {
+                                    new SelectionElement<int>(message: $"Trash", value : 0, spriteIndex: 0),
+                                    new SelectionElement<int>(message: $"Hand", value : 1, spriteIndex: 0),
+                                    new SelectionElement<int>(message: $"No Selection", value : 2, spriteIndex: 1),
+                                };
+
+                            string selectPlayerMessage = "Will you use a card from hand or trash?";
+                            string notSelectPlayerMessage = "The opponent is choosing whether use a card from hand or trash.";
+
+                            GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                        }
+                        else if (validCardInTrash && !validCardInHand)
+                        {
+                            GManager.instance.userSelectionManager.SetInt(0);
+                        }
+                        else if (!validCardInTrash && validCardInHand)
+                        {
+                            GManager.instance.userSelectionManager.SetInt(1);
+                        }
+                        else
+                        {
+                            GManager.instance.userSelectionManager.SetInt(2);
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                        useTrash = (GManager.instance.userSelectionManager.SelectedIntValue == 0);
+                        #endregion
+
+                        if (GManager.instance.userSelectionManager.SelectedIntValue != 2)
+                        {
+                            #region Card Selection
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                if(cardSource != null)
+                                {
+                                    
+                                    yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
+                                                new List<CardSource>() { cardSource },
+                                                activateClass));
+                                    
+                                    cardAdded = true;
+                                }
+                            }
+
+                            if (!useTrash)
+                            {
+                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                selectHandEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: HasClockofTheEnd,
+                                    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 place at the bottom of digivolution cards.",
+                        "The opponent is selecting 1 card to place at the bottom of digivolution cards.");
+                                selectHandEffect.SetUpCustomMessage_ShowCard("Place bottom digivolution card");
+
+                                yield return StartCoroutine(selectHandEffect.Activate());
+                            }
+
+                            else
+                            {
+                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectCardEffect.SetUp(
+                                    canTargetCondition: HasClockofTheEnd,
+                                    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 place at the bottom of digivolution cards.",
+                        "The opponent is selecting 1 card to place at the bottom of digivolution cards.");
+                                selectCardEffect.SetUpCustomMessage_ShowCard("Place bottom digivolution card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            }
+                            #endregion
+                        }
+                    }
+
+                    if (cardAdded)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+                    }
+                }
+            }
+            #endregion
+
+            #region Opponets Turn
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Switch attack target to a [Diaboromon]", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("AttackSwitch_BT17_059");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Opponent's Turn] [Once Per Turn] When one of your opponent's Digimon attacks, you may switch the attack target to 1 of your Digimon with [Diaboromon] in its name.";
+                }
+
+                bool AttackingPermanent(Permanent permanent)
+                {
+                    return CardEffectCommons.IsOpponentPermanent(permanent, card);
+                }
+
+                bool DefendingPermanent(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        return permanent.TopCard.EqualsCardName("Diaboromon");
+
+                    return false;
+                }
+
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if(CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, AttackingPermanent))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (GManager.instance.attackProcess.AttackingPermanent != null)
+                        {
+                            if (GManager.instance.attackProcess.AttackingPermanent.CanSwitchAttackTarget)
+                            {
+                                if (CardEffectCommons.HasMatchConditionPermanent(DefendingPermanent))
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(DefendingPermanent))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(DefendingPermanent));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: DefendingPermanent,
+                            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 that opponent's Digimon attacks to.", "The opponent is selecting 1 Digimon that opponent's Digimon attacks to.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.attackProcess.SwitchDefender(
+                                activateClass,
+                                false,
+                                permanent));
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/Diaboromon_BT17_059.cs.meta

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

+ 261 - 0
Assets/CardEffect/BT17/Black/GroundLocomon_BT17_058.cs

@@ -0,0 +1,261 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class GroundLocomon_BT17_058 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Piercing
+            if (timing == EffectTiming.OnDetermineDoSecurityCheck)
+            {
+                cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region On Play/When Digivolving Shared
+            bool IsSelectableSource(CardSource source)
+            {
+                if (source.IsDigimon)
+                {
+                    if (source.CardColors.Contains(CardColor.Black))
+                    {
+                        if (source.HasLevel && source.Level <= 5)
+                            return true;
+                    }
+                }
+
+                return false;
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Reveal 3, Place 1 black level 5 or lower Digimon as bottom digivolution source", 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. Place 1 level 5 or lower black Digimon card among them as this Digimon's bottom digivolution card. Trash the rest.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
+                        revealCount: 3,
+                        simplifiedSelectCardConditions:
+                        new SimplifiedSelectCardConditionClass[]
+                        {
+                        new SimplifiedSelectCardConditionClass(
+                            canTargetCondition:IsSelectableSource,
+                            message: "Select 1 Black Level 5 or lower Digimon.",
+                            mode: SelectCardEffect.Mode.Custom,
+                            maxCount: 1,
+                            selectCardCoroutine: SelectedCardToSources),
+                        },
+                        remainingCardsPlace: RemainingCardsPlace.Trash,
+                        activateClass: activateClass,
+                        canNoSelect: false
+                    ));
+
+                    IEnumerator SelectedCardToSources(CardSource source)
+                    {
+                        if (source != null)
+                            yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { source }, activateClass));
+                    }
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Reveal 3, Place 1 black level 5 or lower Digimon as bottom digivolution source", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] Reveal the top 3 cards of your deck. Place 1 level 5 or lower black Digimon card among them as this Digimon's bottom digivolution card. Trash the rest.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
+                        revealCount: 3,
+                        simplifiedSelectCardConditions:
+                        new SimplifiedSelectCardConditionClass[]
+                        {
+                        new SimplifiedSelectCardConditionClass(
+                            canTargetCondition:IsSelectableSource,
+                            message: "Select 1 Black Level 5 or lower Digimon.",
+                            mode: SelectCardEffect.Mode.Custom,
+                            maxCount: 1,
+                            selectCardCoroutine: SelectedCardToSources),
+                        },
+                        remainingCardsPlace: RemainingCardsPlace.Trash,
+                        activateClass: activateClass,
+                        canNoSelect: false
+                    ));
+
+                    IEnumerator SelectedCardToSources(CardSource source)
+                    {
+                        if (source != null)
+                            yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { source }, activateClass));
+                    }
+                }
+            }
+            #endregion
+
+            #region End Of Attack
+            if (timing == EffectTiming.OnEndAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play 1 level 5 or lower digimon wiht [Machine] trait", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetHashString("EndOfAttack_BT17_058");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[End of Attack] [Once Per Turn] You may play 1 level 5 or lower Digimon card with the [Machine] trait from this Digimon's digivolution cards without paying the cost.";
+                }
+
+                bool CanSelectSourceCard(CardSource source)
+                {
+                    if (source.IsDigimon)
+                    {
+                        if(source.HasLevel && source.Level <= 5)
+                        {
+                            if (source.CardTraits.Contains("Machine"))
+                            {
+                                if (CardEffectCommons.CanPlayAsNewPermanent(card, false, activateClass))
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnEndAttack(hashtable, card))
+                            return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if(card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectSourceCard) > 0)
+                            return true;
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    Permanent permanent = card.PermanentOfThisCard();
+
+                    if (permanent.DigivolutionCards.Count(CanSelectSourceCard) >= 1)
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        int maxCount = 1;
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                                    canTargetCondition: CanSelectSourceCard,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 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
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/GroundLocomon_BT17_058.cs.meta

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

+ 219 - 0
Assets/CardEffect/BT17/Black/Infermon_BT17_055.cs

@@ -0,0 +1,219 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+
+
+namespace DCGO.CardEffects.BT17
+{
+    public class Infermon_BT17_055 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("<De-Digivolve 1>, 1 of our oppenents 8 cost or less can't attack players", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] <De-Digivolve 1> 1 of your opponent’s Digimon. Then, 1 of their Digimon with a play cost of 8 or less can’t attack players until the next end of their turn.";
+                }
+
+                bool IsOpponentsDigimon(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool IsOpponentsEightCostDigimon(Permanent permanent)
+                {
+                    if(CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if(permanent.TopCard.HasPlayCost && permanent.TopCard.GetCostItself <= 8)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsOpponentsDigimon))
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsOpponentsDigimon))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsOpponentsDigimon));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsOpponentsDigimon,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectDeDigivolvePermanent,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsOpponentsEightCostDigimon))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsOpponentsEightCostDigimon));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsOpponentsEightCostDigimon,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectCantAttackPermanent,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    IEnumerator SelectDeDigivolvePermanent(Permanent permanent)
+                    {
+                        if(permanent != null)
+                            yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
+                    }
+
+                    IEnumerator SelectCantAttackPermanent(Permanent permanent)
+                    {
+                        bool DefenderCondition(Permanent Defender)
+                        {
+                            return Defender == null;
+                        }
+
+                        if (permanent != null)
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttackPlayerEffect(
+                            attackerCondition: IsOpponentsEightCostDigimon,
+                            defenderCondition: DefenderCondition,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass,
+                            effectName: "Can't Attack Player"));
+                    }
+                }
+            }
+            #endregion
+
+            #region ESS
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("DeDigivolve_BT17_055");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] [Once Per Turn] When one of your other Digimon with [Diaboromon] in its name is played, <De-Digivolve 1> 1 of your opponent's Digimon.";
+                }
+
+                bool IsOpponentsDigimon(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool IsDiaboromon(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        return permanent.TopCard.EqualsCardName("Diaboromon");
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, IsDiaboromon))
+                        {
+                            return true;                                
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsOpponentsDigimon))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsOpponentsDigimon));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsOpponentsDigimon,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectDeDigivolvePermanent,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    IEnumerator SelectDeDigivolvePermanent(Permanent permanent)
+                    {
+                        if (permanent != null)
+                            yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
+                    }
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/Infermon_BT17_055.cs.meta

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

+ 1 - 1
Assets/CardEffect/BT17/Black/Keramon_BT17_053.cs

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

+ 185 - 0
Assets/CardEffect/BT17/Black/Locomon_BT17_056.cs

@@ -0,0 +1,185 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects
+{
+    public class Locomon_BT17_056 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region All Turns - Attack Target Switched
+            if (timing == EffectTiming.OnAttackTargetChanged)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Reveal 3, Place 1 [Parasitemon] or 1 black level 5 or lower Digimon as bottom digivolution source", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("Reveal_BT17_056");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] [Once Per Turn] When an attack target is switched, reveal the top 3 cards of your deck. Place 1 [Parasitemon] or 1 black level 5 or lower Digimon card among them as this Digimon's bottom digivolution card. Trash the rest.";
+                }
+                
+                bool IsSelectableSource(CardSource source)
+                {
+                    if(source.EqualsCardName("Parasitemon"))
+                        return true;
+
+                    if (source.IsDigimon)
+                    {
+                        if (source.CardColors.Contains(CardColor.Black))
+                        {
+                            if (source.HasLevel && source.Level <= 5)
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return CardEffectCommons.CanTriggerOnAttackTargetSwitch(hashtable, card);
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
+                        revealCount: 3,
+                        simplifiedSelectCardConditions:
+                        new SimplifiedSelectCardConditionClass[]
+                        {
+                        new SimplifiedSelectCardConditionClass(
+                            canTargetCondition:IsSelectableSource,
+                            message: "Select 1 [Parasitemon] or Black Level 5 or lower Digimon.",
+                            mode: SelectCardEffect.Mode.Custom,
+                            maxCount: 1,
+                            selectCardCoroutine: SelectedCardToSources),
+                        },
+                        remainingCardsPlace: RemainingCardsPlace.Trash,
+                        activateClass: activateClass,
+                        canNoSelect: false
+                    ));
+
+                    IEnumerator SelectedCardToSources (CardSource source)
+                    {
+                        if(source != null)
+                            yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { source }, activateClass));
+                    }
+                }
+            }
+            #endregion
+
+            #region All Turns - Digivolution Source Added
+            if (timing == EffectTiming.OnAddDigivolutionCards)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Digivolve into [GroundLocomon]", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] When one of your Digimon's effects adds to this Digimon's digivolution cards, this Digimon may digivolve into [GroundLocomon] in the hand without paying the cost.";
+                }
+
+                bool IsGroundLocomon(CardSource source)
+                {
+                    if (source.EqualsCardName("GroundLocomon"))
+                    {
+                        if (source.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, true, activateClass, SelectCardEffect.Root.Hand))
+                            return true;
+                    }
+
+                    return false;
+                }
+
+                bool IsThisDigimon(Permanent permanent)
+                {
+                    return card.PermanentOfThisCard() == permanent;
+                }
+
+                bool IsMyDigimonEffect(ICardEffect effect)
+                {
+                    if(effect.EffectSourceCard != null)
+                    {
+                        if(effect.EffectSourceCard.Owner == card.Owner)
+                        {
+                            return effect.IsDigimonEffect;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnAddDigivolutionCard(hashtable, IsThisDigimon, IsMyDigimonEffect, null))
+                        {
+                            return CardEffectCommons.HasMatchConditionOwnersHand(card, IsGroundLocomon);
+                        }
+                    }
+                    return true;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                    targetPermanent: card.PermanentOfThisCard(),
+                    cardCondition: IsGroundLocomon,
+                    payCost: false,
+                    reduceCostTuple: null,
+                    fixedCostTuple: null,
+                    ignoreDigivolutionRequirementFixedCost: -1,
+                    isHand: true,
+                    activateClass: activateClass,
+                    successProcess: null));
+                }
+            }
+            #endregion
+
+            #region All Turns - ESS
+            if (timing == EffectTiming.None)
+            {
+                bool condition()
+                {
+                    if (!CardEffectCommons.IsOwnerTurn(card))
+                        return false;
+
+                    if (card.PermanentOfThisCard().TopCard.ContainsTraits("Machine"))
+                        return false;
+
+                    return true;
+                }
+
+                cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: condition));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Black/Locomon_BT17_056.cs.meta

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

+ 36 - 8
Assets/CardEffect/BT17/Black/Trailmon_BT17_054.cs

@@ -1,7 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 
-namespace DCGO.CardEffects
+namespace DCGO.CardEffects.BT17
 {
     public class Trailmon_BT17_054 : CEntity_Effect
     {
@@ -9,33 +9,61 @@ namespace DCGO.CardEffects
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
-            if (timing == EffectTiming.None)
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect("Reveal 3, add 1 Tamer or 1 Digimon with [Machine] in traits", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "";
+                    return "[On Play] Reveal the top 3 cards of your deck. Add 1 Tamer card or 1 Digimon card with the [Machine] trait among them to the hand. Trash the rest.";
+                }
+
+                bool IsTamerorMachine(CardSource cardSource)
+                {
+                    if (cardSource.IsTamer)
+                        return true;
+
+                    if (cardSource.IsDigimon && cardSource.ContainsTraits("Machine"))
+                        return true;
+
+                    return false;
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable,card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
+                        revealCount: 3,
+                        simplifiedSelectCardConditions:
+                        new SimplifiedSelectCardConditionClass[]
+                        {
+                        new SimplifiedSelectCardConditionClass(
+                            canTargetCondition:IsTamerorMachine,
+                            message: "Select 1 Tamer or Digimon with [Machine] in trait.",
+                            mode: SelectCardEffect.Mode.AddHand,
+                            maxCount: 1,
+                            selectCardCoroutine: null),
+                        },
+                        remainingCardsPlace: RemainingCardsPlace.Trash,
+                        activateClass: activateClass,
+                        canNoSelect: false
+                    ));
                 }
             }
+            #endregion
 
             #region All Turns - ESS
             if (timing == EffectTiming.None)