Просмотр исходного кода

Add all red level 6 and 7 cardEffects

Andrej Erdelsky 2 лет назад
Родитель
Сommit
a38f1822f5

+ 2 - 2
Assets/CardBaseEntity/BT17/Red/Digimon/Gallantmon_Crimson_Mode-BT17-018.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:12a94ac1546ff3829004544f61590eac2b995c802ec9cd9c85d7e2f1854acd13
-size 1497
+oid sha256:46689827d050719948ce306686da2b47d4536d14ee3f3e13faff6c49d50d2a93
+size 1500

+ 2 - 2
Assets/CardBaseEntity/BT17/Red/Digimon/Gallantmon_Crimson_Mode-BT17-018_P1.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:3f101ef684e9d0a8690bc75fcfef03ba5e2f29925ee8edc1bddab535b5f3d6b9
-size 1503
+oid sha256:aa69c9899bbe25066590d1bff5c9d2b258baa1f829e692967813346043024998
+size 1506

+ 2 - 2
Assets/CardBaseEntity/BT17/Red/Digimon/Gallantmon_Crimson_Mode-BT17-018_P2.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:0a745466fd7d424de7d5fd36da22ebfa77e06978f6796e0511b0aad480382d8a
-size 1503
+oid sha256:58b96a9f4b6750220a7ca89f1b1ea671182e2a1cf16c28260af6851ff67cc957
+size 1506

+ 2 - 2
Assets/CardEffect/BT16/Green/Wormmon_BT16_040.cs

@@ -235,13 +235,13 @@ namespace DCGO.CardEffects.BT16
 
                 string EffectDiscription()
                 {
-                    return "[On Play] If it's your turn, 1 of your Digimomn may digivolve into a level 4 Digimon card with the [Insectiod] or [Free] trait from your trash with the digivolution cost reduced by 1.";
+                    return "[On Play] If it's your turn, 1 of your Digimon may digivolve into a level 4 Digimon card with the [Insectoid] or [Free] trait from your trash with the digivolution cost reduced by 1.";
                 }
 
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.CardTraits.Contains("Insectiod") || cardSource.CardTraits.Contains("Free"))
+                    if (cardSource.CardTraits.Contains("Insectoid") || cardSource.CardTraits.Contains("Free"))
                     {
                         if (cardSource.HasLevel && cardSource.Level == 4)
                         {

+ 1 - 1
Assets/CardEffect/BT17/Red/Aldamon_BT17_014.cs

@@ -481,7 +481,7 @@ namespace DCGO.CardEffects.BT17
 
             #endregion
 
-            #region Your Turn
+            #region Your Turn - ESS
 
             if (timing == EffectTiming.None)
             {

+ 410 - 0
Assets/CardEffect/BT17/Red/AncientGreymon_BT17_017.cs

@@ -0,0 +1,410 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class AncientGreymon_BT17_017 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region DigiXros
+
+            if (timing == EffectTiming.None)
+            {
+                AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
+                addDigiXrosConditionClass.SetUpICardEffect($"DigiXros -3", 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 elementAgunimon =
+                            new DigiXrosConditionElement(CanSelectCardConditionAgunimon, "Agunimon");
+
+                        bool CanSelectCardConditionAgunimon(CardSource conditionCardSource)
+                        {
+                            if (conditionCardSource != null)
+                            {
+                                if (conditionCardSource.Owner == card.Owner)
+                                {
+                                    if (conditionCardSource.IsDigimon)
+                                    {
+                                        if (conditionCardSource.CardNames_DigiXros.Contains("Agunimon"))
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        DigiXrosConditionElement elementBurningGreymon =
+                            new DigiXrosConditionElement(CanSelectCardConditionBurningGreymon, "BurningGreymon");
+
+                        bool CanSelectCardConditionBurningGreymon(CardSource conditionCardSource)
+                        {
+                            if (conditionCardSource != null)
+                            {
+                                if (conditionCardSource.Owner == card.Owner)
+                                {
+                                    if (conditionCardSource.IsDigimon)
+                                    {
+                                        if (conditionCardSource.CardNames_DigiXros.Contains("BurningGreymon"))
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>()
+                            { elementAgunimon, elementBurningGreymon };
+
+                        DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 3);
+
+                        return digiXrosCondition;
+                    }
+
+                    return null;
+                }
+            }
+
+            #endregion
+
+            #region Security Attack +1
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card,
+                    condition: null));
+            }
+
+            #endregion
+
+            #region On Play/ When Digivolving Shared
+
+            bool IsEnemyPermanentWithAsMuchOrLessDpSharedCondition(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    if (permanent.DP <= card.PermanentOfThisCard().DP)
+                    {
+                        return true;
+                    }
+                }
+
+                return false;
+            }
+
+            #endregion
+
+            #region On Play
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete 1 Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[On Play] Delete 1 of your opponent's Digimon with as much or less DP than this Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition))
+                    {
+                        int maxCount = Math.Min(1,
+                            CardEffectCommons.MatchConditionPermanentCount(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsEnemyPermanentWithAsMuchOrLessDpSharedCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            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 1 Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] Delete 1 of your opponent's Digimon with as much or less DP than this Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition))
+                    {
+                        int maxCount = Math.Min(1,
+                            CardEffectCommons.MatchConditionPermanentCount(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsEnemyPermanentWithAsMuchOrLessDpSharedCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+                }
+            }
+
+            #endregion
+
+            #region On Deletion
+
+            if (timing == EffectTiming.OnDestroyedAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(
+                    "Return 1 Tamer card and 1 Hybrid trait Digimon card from trash to hand, then play 1 Tamer from hand", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[On Deletion] Return 1 Tamer card and 1 [Hybrid] trait Digimon card from your trash to the hand. Then, you may play 1 Tamer card from your hand without paying the cost.";
+                }
+
+                bool IsTamerCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsTamer;
+                }
+
+                bool IsHybridDigimonCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon && cardSource.ContainsTraits("Hybrid");
+                }
+
+                bool CanSelectHandTamerCardCondition(CardSource cardSource)
+                {
+                    if (cardSource.IsTamer)
+                    {
+                        if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnTrash(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsTamerCardCondition))
+                        {
+                            return true;
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsHybridDigimonCardCondition))
+                        {
+                            return true;
+                        }
+
+                        if (card.Owner.HandCards.Count(CanSelectHandTamerCardCondition) >= 1)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsTamerCardCondition))
+                    {
+                        int maxCount = Math.Min(1, card.Owner.TrashCards.Count(IsTamerCardCondition));
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                            canTargetCondition: IsTamerCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => false,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: null,
+                            message: "Select 1 Tamer card to add to your hand.",
+                            maxCount: maxCount,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.AddHand,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                    }
+
+                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsHybridDigimonCardCondition))
+                    {
+                        int maxCount = Math.Min(1, card.Owner.TrashCards.Count(IsHybridDigimonCardCondition));
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                            canTargetCondition: IsHybridDigimonCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => false,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: null,
+                            message: "Select 1 Hybrid Digimon card to add to your hand.",
+                            maxCount: maxCount,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.AddHand,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                    }
+
+                    if (card.Owner.HandCards.Count(CanSelectHandTamerCardCondition) >= 1)
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectHandTamerCardCondition,
+                            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 Tamer card to play.",
+                            "The opponent is selecting 1 Tamer card to play.");
+                        selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectHandEffect.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.Hand, activateETB: true));
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Red/AncientGreymon_BT17_017.cs.meta

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

+ 37 - 33
Assets/CardEffect/BT17/Red/Flamemon_BT17_009.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace DCGO.CardEffects.BT17
 {
@@ -113,7 +114,7 @@ namespace DCGO.CardEffects.BT17
                 string EffectDescription()
                 {
                     return
-                        "[On Play] You may play 1 Tamer card with inherited effects from your hand without paying the cost.";
+                        "[On Deletion] You may play 1 Tamer card with inherited effects from your hand without paying the cost.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -142,7 +143,7 @@ namespace DCGO.CardEffects.BT17
                 {
                     if (CardEffectCommons.CanActivateOnDeletionInherited(hashtable, card))
                     {
-                        if (card.Owner.HandCards.Count >= 1)
+                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                         {
                             return true;
                         }
@@ -153,39 +154,42 @@ namespace DCGO.CardEffects.BT17
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 Tamer card to play.",
-                        "The opponent is selecting 1 Tamer card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {
-                        selectedCards.Add(cardSource);
-                        yield return null;
-                    }
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            mode: SelectHandEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectHandEffect.SetUpCustomMessage("Select 1 Tamer card to play.",
+                            "The opponent is selecting 1 Tamer card to play.");
+                        selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectHandEffect.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.Hand, activateETB: true));
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass,
+                                payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+                    }
                 }
             }
 

+ 344 - 0
Assets/CardEffect/BT17/Red/GallantmonCrimsonModeAce_BT17_018.cs

@@ -0,0 +1,344 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class GallantmonCrimsonModeAce_BT17_018 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel6 && targetPermanent.TopCard.ContainsCardName("Gallantmon");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 4,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Ace - Blast Digivolve
+
+            if (timing == EffectTiming.OnCounterTiming)
+            {
+                cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
+            }
+
+            #endregion
+
+            #region On Play/ When Digivolving Shared
+
+            int maxDPDeletionValue = 15000;
+            
+            #endregion
+
+            #region On Play
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete opponent's Digimon whose total DP adds up to 15000 or less", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[On Play] Choose any number of your opponent's Digimon whose total DP adds up to 15000 or less and delete them.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(maxDPDeletionValue, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        {
+                            int maxCount = Math.Min(card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanentCondition),
+                                CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                maxCount: maxCount,
+                                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 sumDP = 0;
+
+                                foreach (Permanent permanent in permanents)
+                                {
+                                    sumDP += permanent.DP;
+                                }
+
+                                if (sumDP > card.Owner.MaxDP_DeleteEffect(maxDPDeletionValue, activateClass))
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+
+                            bool CanTargetConditionByPreSelectedList(List<Permanent> permanents, Permanent permanent)
+                            {
+                                int sumDP = 0;
+
+                                foreach (Permanent permanent1 in permanents)
+                                {
+                                    sumDP += permanent1.DP;
+                                }
+
+                                sumDP += permanent.DP;
+
+                                if (sumDP > card.Owner.MaxDP_DeleteEffect(maxDPDeletionValue, activateClass))
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete opponent's Digimon whose total DP adds up to 15000 or less", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] Choose any number of your opponent's Digimon whose total DP adds up to 15000 or less and delete them.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(maxDPDeletionValue, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                        {
+                            int maxCount = Math.Min(card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanentCondition),
+                                CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                maxCount: maxCount,
+                                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 sumDP = 0;
+
+                                foreach (Permanent permanent in permanents)
+                                {
+                                    sumDP += permanent.DP;
+                                }
+
+                                if (sumDP > card.Owner.MaxDP_DeleteEffect(maxDPDeletionValue, activateClass))
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+
+                            bool CanTargetConditionByPreSelectedList(List<Permanent> permanents, Permanent permanent)
+                            {
+                                int sumDP = 0;
+
+                                foreach (Permanent permanent1 in permanents)
+                                {
+                                    sumDP += permanent1.DP;
+                                }
+
+                                sumDP += permanent.DP;
+
+                                if (sumDP > card.Owner.MaxDP_DeleteEffect(maxDPDeletionValue, activateClass))
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+            
+            #region When Attacking
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                int Count()
+                {
+                    return (card.Owner.TrashCards.Count + card.Owner.Enemy.TrashCards.Count) / 10;
+                }
+
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect($"Trash {Count()} cards from the top of your opponent's security stack", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Attacking] [Once Per Turn] For every 10 cards in both player's trash, trash 1 card from the top of your opponent's security stack.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.Owner.Enemy.SecurityCards.Count >= 1)
+                        {
+                            if (Count() >= 1)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                        player: card.Owner.Enemy,
+                        destroySecurityCount: Count(),
+                        cardEffect: activateClass,
+                        fromTop: true).DestroySecurity());
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Red/GallantmonCrimsonModeAce_BT17_018.cs.meta

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

+ 279 - 0
Assets/CardEffect/BT17/Red/Gallantmon_BT17_016.cs

@@ -0,0 +1,279 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class Gallantmon_BT17_016 : 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(
+                    "Delete 1 Digimon with 8000 DP or less, or get +3000 DP and [Blocker] until the end of your opponent's turn",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
+                    EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] Delete 1 of your opponent's Digimon with 8000 DP or less. If this effect didn't delete, this Digimon gets +3000 DP and gains [Blocker] until the end of your opponent's turn.";
+                }
+
+                bool CanSelectOpponentPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(8000, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1,
+                            CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectOpponentPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                            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 AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                        {
+                            deleteTargetPermanents = permanents.Clone();
+                            yield return null;
+                        }
+                    }
+
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                            targetPermanents: deleteTargetPermanents, activateClass: activateClass,
+                            successProcess: null, failureProcess: FailureProcess));
+
+                    IEnumerator FailureProcess()
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            changeValue: 3000,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass));
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass));
+                    }
+                }
+            }
+
+            #endregion
+
+            #region When Attacking
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(
+                    "Delete 1 Digimon with 8000 DP or less, or get +3000 DP and [Blocker] until the end of your opponent's turn",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
+                    EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] Delete 1 of your opponent's Digimon with 8000 DP or less. If this effect didn't delete, this Digimon gets +3000 DP and gains [Blocker] until the end of your opponent's turn.";
+                }
+
+                bool CanSelectOpponentPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(8000, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1,
+                            CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectOpponentPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                            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 AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                        {
+                            deleteTargetPermanents = permanents.Clone();
+                            yield return null;
+                        }
+                    }
+
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                            targetPermanents: deleteTargetPermanents, activateClass: activateClass,
+                            successProcess: null, failureProcess: FailureProcess));
+
+                    IEnumerator FailureProcess()
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            changeValue: 3000,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass));
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass));
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Your Turn
+
+            if (timing == EffectTiming.None)
+            {
+                CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
+                canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's effects", CanUseCondition, card);
+                canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
+
+                cardEffects.Add(canNotAffectedClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                bool CardCondition(CardSource cardSource)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            if (card.Owner.MemoryForPlayer <= 0)
+                            {
+                                if (card == card.PermanentOfThisCard().TopCard)
+                                {
+                                    if (cardSource == card.PermanentOfThisCard().TopCard)
+                                    {
+                                        return true;
+                                    }
+                                }
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool SkillCondition(ICardEffect cardEffect)
+                {
+                    return CardEffectCommons.IsOpponentEffect(cardEffect, card);
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Red/Gallantmon_BT17_016.cs.meta

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

+ 532 - 0
Assets/CardEffect/BT17/Red/WarGreymon_BT17_015.cs

@@ -0,0 +1,532 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT17
+{
+    public class WarGreymon_BT17_015 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel5 && targetPermanent.TopCard.ContainsCardName("Greymon");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 3,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Play Cost Reduction
+
+            if (timing == EffectTiming.None)
+            {
+                ChangeCostClass changeCostClass = new ChangeCostClass();
+                changeCostClass.SetUpICardEffect($"Play Cost -3", CanUseCondition, card);
+                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost,
+                    cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: IsUpDown,
+                    isCheckAvailability: () => false, isChangePayingCost: () => true);
+
+                cardEffects.Add(changeCostClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (card.Owner.HandCards.Contains(card))
+                    {
+                        if (!CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsCorrectTamer))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool IsCorrectTamer(Permanent permanent)
+                {
+                    return permanent.IsTamer && (permanent.TopCard.ContainsCardName("Tai Kamiya") ||
+                                                 permanent.TopCard.ContainsCardName("TaiKamiya"));
+                }
+
+                int ChangeCost(CardSource cardSource, int cost, SelectCardEffect.Root root,
+                    List<Permanent> targetPermanents)
+                {
+                    if (CardSourceCondition(cardSource))
+                    {
+                        if (RootCondition(root))
+                        {
+                            if (PermanentsCondition(targetPermanents))
+                            {
+                                cost -= 3;
+                            }
+                        }
+                    }
+
+                    return cost;
+                }
+
+                bool PermanentsCondition(List<Permanent> targetPermanents)
+                {
+                    if (targetPermanents == null)
+                    {
+                        return true;
+                    }
+
+                    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;
+                }
+            }
+
+            #endregion
+
+            #region On Play/ When Digivolving Shared
+
+            bool CanSelectOwnPermanentSharedCondition(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
+                {
+                    if (permanent.TopCard.ContainsCardName("Gabumon"))
+                    {
+                        return true;
+                    }
+                }
+
+                return false;
+            }
+
+            bool CanSelectHandCardSharedCondition(CardSource cardSource)
+            {
+                return cardSource.IsDigimon && cardSource.ContainsCardName("MetalGarurumon");
+            }
+
+            #endregion
+            
+            #region On Play
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Choose 1 effect", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[On Play] Activate 1 of the effects below: ・Delete 1 of your opponent's Digimon with 8000 DP or less. ・1 of your [Gabumon] may digivolve into [MetalGarurumon] in your hand, ignoring its digivolution requirements and without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanSelectOpponentPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(8000, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                        {
+                            return true;
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnPermanentSharedCondition) &&
+                            card.Owner.HandCards.Count(CanSelectHandCardSharedCondition) >= 1)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        yield return GManager.instance.photonWaitController.StartWait("WarGreymon_BT17");
+
+                        List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>()
+                        {
+                            new(message: "Delete 1 of your opponent's Digimon with 8000 DP or less",
+                                value: 0, spriteIndex: 0),
+                            new(
+                                message: "1 of your [Gabumon] may digivolve into [MetalGarurumon] in your hand",
+                                value: 1, spriteIndex: 0),
+                        };
+
+                        string selectPlayerMessage = "Which effect will you activate?";
+                        string notSelectPlayerMessage = "The opponent is choosing which effect to activate.";
+
+                        GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements,
+                            selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
+                            notSelectPlayerMessage: notSelectPlayerMessage);
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                            .WaitForEndSelect());
+
+                        int actionID = GManager.instance.userSelectionManager.SelectedIntValue;
+
+                        switch (actionID)
+                        {
+                            case 0:
+                            {
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                                {
+                                    int maxCount = Math.Min(1,
+                                        CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
+
+                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectOpponentPermanentCondition,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        maxCount: maxCount,
+                                        canNoSelect: false,
+                                        canEndNotMax: false,
+                                        selectPermanentCoroutine: null,
+                                        afterSelectPermanentCoroutine: null,
+                                        mode: SelectPermanentEffect.Mode.Destroy,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                }
+
+                                break;
+                            }
+
+                            case 1:
+                            {
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnPermanentSharedCondition) &&
+                                    card.Owner.HandCards.Count(CanSelectHandCardSharedCondition) >= 1)
+                                {
+                                    Permanent selectedPermanent = null;
+
+                                    int maxCount = Math.Min(1,
+                                        CardEffectCommons.MatchConditionPermanentCount(CanSelectOwnPermanentSharedCondition));
+
+                                    SelectPermanentEffect selectPermanentEffect =
+                                        GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectOwnPermanentSharedCondition,
+                                        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 will digivolve.",
+                                        "The opponent is selecting 1 Digimon that will digivolve.");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                    {
+                                        selectedPermanent = permanent;
+                                        yield return null;
+                                    }
+
+                                    if (selectedPermanent != null)
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(
+                                            CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                                targetPermanent: selectedPermanent,
+                                                cardCondition: CanSelectHandCardSharedCondition,
+                                                payCost: false,
+                                                reduceCostTuple: null,
+                                                fixedCostTuple: null,
+                                                ignoreDigivolutionRequirementFixedCost: -1,
+                                                isHand: true,
+                                                activateClass: activateClass,
+                                                successProcess: null,
+                                                ignoreLevel: true,
+                                                ignoreSelection: true));
+                                    }
+                                }
+
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Choose 1 effect", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] Activate 1 of the effects below: ・Delete 1 of your opponent's Digimon with 8000 DP or less. ・1 of your [Gabumon] may digivolve into [MetalGarurumon] in your hand, ignoring its digivolution requirements and without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanSelectOpponentPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(8000, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                        {
+                            return true;
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnPermanentSharedCondition) &&
+                            card.Owner.HandCards.Count(CanSelectHandCardSharedCondition) >= 1)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        yield return GManager.instance.photonWaitController.StartWait("WarGreymon_BT17");
+
+                        List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>()
+                        {
+                            new(message: "Delete 1 of your opponent's Digimon with 8000 DP or less",
+                                value: 0, spriteIndex: 0),
+                            new(
+                                message: "1 of your [Gabumon] may digivolve into [MetalGarurumon] in your hand",
+                                value: 1, spriteIndex: 0),
+                        };
+
+                        string selectPlayerMessage = "Which effect will you activate?";
+                        string notSelectPlayerMessage = "The opponent is choosing which effect to activate.";
+
+                        GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements,
+                            selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
+                            notSelectPlayerMessage: notSelectPlayerMessage);
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
+                            .WaitForEndSelect());
+
+                        int actionID = GManager.instance.userSelectionManager.SelectedIntValue;
+
+                        switch (actionID)
+                        {
+                            case 0:
+                            {
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                                {
+                                    int maxCount = Math.Min(1,
+                                        CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
+
+                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectOpponentPermanentCondition,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        maxCount: maxCount,
+                                        canNoSelect: false,
+                                        canEndNotMax: false,
+                                        selectPermanentCoroutine: null,
+                                        afterSelectPermanentCoroutine: null,
+                                        mode: SelectPermanentEffect.Mode.Destroy,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                }
+
+                                break;
+                            }
+
+                            case 1:
+                            {
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnPermanentSharedCondition) &&
+                                    card.Owner.HandCards.Count(CanSelectHandCardSharedCondition) >= 1)
+                                {
+                                    Permanent selectedPermanent = null;
+
+                                    int maxCount = Math.Min(1,
+                                        CardEffectCommons.MatchConditionPermanentCount(CanSelectOwnPermanentSharedCondition));
+
+                                    SelectPermanentEffect selectPermanentEffect =
+                                        GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectOwnPermanentSharedCondition,
+                                        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 will digivolve.",
+                                        "The opponent is selecting 1 Digimon that will digivolve.");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                    {
+                                        selectedPermanent = permanent;
+                                        yield return null;
+                                    }
+
+                                    if (selectedPermanent != null)
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(
+                                            CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                                targetPermanent: selectedPermanent,
+                                                cardCondition: CanSelectHandCardSharedCondition,
+                                                payCost: false,
+                                                reduceCostTuple: null,
+                                                fixedCostTuple: null,
+                                                ignoreDigivolutionRequirementFixedCost: -1,
+                                                isHand: true,
+                                                activateClass: activateClass,
+                                                successProcess: null,
+                                                ignoreLevel: true,
+                                                ignoreSelection: true));
+                                    }
+                                }
+
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region When Attacking - ESS
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash the top card of opponent's security", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Attacking][Once Per Turn] If this Digimon has [Omnimon] in its name, trash the top card of your opponent's security stack.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.PermanentOfThisCard().TopCard.ContainsCardName("Omnimon"))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                        player: card.Owner.Enemy,
+                        destroySecurityCount: 1,
+                        cardEffect: activateClass,
+                        fromTop: true).DestroySecurity());
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT17/Red/WarGreymon_BT17_015.cs.meta

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