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

Merge pull request #79 from DCGO2/workbranch

Jesmon Cards
Michael8818 1 год назад
Родитель
Сommit
a5281533c5

+ 0 - 7
Assets/AddOn/GlitchFx-master/GlitchFx.unitypackage.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: d80f995af690a474e841364c1e88ee1b
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 137 - 0
Assets/CardEffect/BT20/Red/BT20_008.cs

@@ -0,0 +1,137 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT20
+{
+    public class BT20_008 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            if (timing == EffectTiming.OnStartMainPhase)
+            {
+                #region start of main phase
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash a card, draw a card, gain 1 memory", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Start of Your Main Phase] By trashing 1 card with [Huckmon] or [Sistermon] in its name or the [Royal Knight] trait in your hand, <Draw 1> and gain 1 memory.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return true;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                bool CanSelect(CardSource cardSource)
+                {
+                    if (cardSource.IsDigimon)
+                    {
+                        if (cardSource.ContainsCardName("Sistermon") || cardSource.ContainsCardName("Huckmon") || cardSource.HasRoyalKnightTraits)
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+                    bool discarded = false;
+                    if (card.Owner.HandCards.Count(CanSelect) >= 1)
+                    {
+                        int maxCount = 1;
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelect,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: AfterSelectCardCoroutine,
+                            mode: SelectHandEffect.Mode.Discard,
+                            cardEffect: activateClass);
+
+
+                        IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                        {
+                            if (cardSources.Count == 1)
+                            {
+                                discarded = true;
+                                yield return null;
+                            }
+                        }
+
+                        selectHandEffect.SetUpCustomMessage("Select 1 card to discard.", "The opponent is selecting 1 card to discard.");
+                        selectHandEffect.SetUpCustomMessage_ShowCard("Discarded Card");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    }
+
+                    if (discarded)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
+                    }
+                }
+                #endregion
+            }
+            
+            if (timing == EffectTiming.None)
+            {
+                #region inherited
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("All Digimon gain DP", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription ()
+                {
+                    return "[Your Turn] All of your Digimon get +1000 DP.";
+                }
+
+                bool CanUseCondition (Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea (card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine (Hashtable hashtable)
+                {
+                    List<Permanent> permanents = card.Owner.GetBattleAreaDigimons();
+
+                    if (permanents.Count >= 1)
+                    {
+                        foreach (Permanent permanent in permanents)
+                        {
+                            yield return CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 1000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass);
+                        }
+                    }
+                }
+                #endregion
+            }
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/Red/BT20_008.cs.meta

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

+ 242 - 0
Assets/CardEffect/BT20/Red/BT20_013.cs

@@ -0,0 +1,242 @@
+using DG.Tweening.Core.Easing;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine.TextCore.Text;
+
+namespace DCGO.CardEffects.BT20
+{
+    public class BT20_013 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            if (timing == EffectTiming.OnDeclaration)
+            {
+                #region Main Once Per Turn
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play a Digimon with the cost reduced by 2", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("PlayCost_BT20_013");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription ()
+                {
+                    return "[Main] [Once Per Turn] You may play 1 Digimon card with [Sistermon] or [Gankoomon] in its name from you hand with the play cost reduced by 2.";
+                }
+
+                bool CanUseCondition (Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanSelectCardCondition (CardSource cardSource)
+                {
+                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: true, cardEffect: activateClass))
+                    {
+                        if (cardSource.ContainsCardName("Sistermon") || cardSource.ContainsCardName("Gankoomon"))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine (Hashtable _hashtable)
+                {
+                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                        {
+                            new SelectionElement<bool>(message: $"Play Card", value : true, spriteIndex: 0),
+                            new SelectionElement<bool>(message: $"Not Play Card", value : false, spriteIndex: 1),
+                        };
+
+                    string selectPlayerMessage = "Will you play a card from your hand?";
+                    string notSelectPlayerMessage = "The opponent is deciding to play a card from their hand.";
+
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                    bool isPlaying = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                    if (isPlaying)
+                    {
+                        #region reduce play cost
+
+                        ChangeCostClass changeCostClass = new ChangeCostClass();
+                        changeCostClass.SetUpICardEffect($"Play Cost -2", CanUseCondition1, card);
+                        changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                        Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
+                        card.Owner.UntilCalculateFixedCostEffect.Add(getCardEffect);
+
+                        ICardEffect GetCardEffect(EffectTiming _timing)
+                        {
+                            if (_timing == EffectTiming.None)
+                            {
+                                return changeCostClass;
+                            }
+
+                            return null;
+                        }
+
+                        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 -= 2;
+                                    }
+                                }
+                            }
+
+                            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.HasPlayCost)
+                            {
+                                return true;
+                            }
+
+                            return false;
+                        }
+
+                        bool RootCondition(SelectCardEffect.Root root)
+                        {
+                            return true;
+                        }
+
+                        bool isUpDown()
+                        {
+                            return true;
+                        }
+
+                        #endregion
+
+                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
+                        {
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            int maxCount = 1;
+
+                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectHandEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                mode: SelectHandEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                            selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                            yield return ContinuousController.instance.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: true,
+                                isTapped: false,
+                                root: SelectCardEffect.Root.Hand,
+                                activateETB: true));
+                        }
+
+                        #region Remove Cost effect after use
+
+                        card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
+
+                        #endregion
+                    }
+                }
+                #endregion
+            }
+
+            if (timing == EffectTiming.None)
+            {
+                #region Inherited
+                bool Condition()
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    changeValue: 1000,
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: Condition,
+                    effectName: () => "Your Digimons gain DP +1000"));
+                #endregion
+            }
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/Red/BT20_013.cs.meta

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

+ 282 - 0
Assets/CardEffect/BT20/Red/BT20_014.cs

@@ -0,0 +1,282 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT20
+{
+    public class BT20_014 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                {
+                    #region On Play
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("Delete a Digimon with 5000DP or less", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                    cardEffects.Add(activateClass);
+
+                    string EffectDiscription()
+                    {
+                        return "[On Play] Delete 1 of your opponent's Digimon with 5000DP or less.";
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    }
+
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanent))
+                            {
+                                return true;
+                            }
+                        }
+                        return false;
+                    }
+
+                    bool CanSelectPermanent(Permanent permanent)
+                    {
+                        return permanent.DP <= 5000;
+                    }
+
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        List<Permanent> selectedPermanents = new List<Permanent>();
+
+                        int maxCount = 1;
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner.Enemy,
+                            canTargetCondition: CanSelectPermanent,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass
+                            );
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+                    #endregion
+                }
+                {
+                    #region On Digivolve
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("Delete a Digimon with 5000DP or less", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                    cardEffects.Add(activateClass);
+
+                    string EffectDiscription()
+                    {
+                        return "[On Digivolve] Delete 1 of your opponent's Digimon with 5000DP or less.";
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                    }
+
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanent))
+                            {
+                                return true;
+                            }
+                        }
+                        return false;
+                    }
+
+                    bool CanSelectPermanent(Permanent permanent)
+                    {
+                        return permanent.DP <= 5000;
+                    }
+
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        List<Permanent> selectedPermanents = new List<Permanent>();
+
+                        int maxCount = 1;
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner.Enemy,
+                            canTargetCondition: CanSelectPermanent,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass
+                            );
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    #endregion
+                }
+            }
+
+            if (timing == EffectTiming.OnEndTurn)
+            {
+                #region End of Turn
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Suspend a Digimon, then Digivolve this Digimon into a Digimon card with [Jesmon] in its name", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[End of Your Turn] By suspending 1 of your other Digimon, this Digiomon may digivolve into a Digimon card with [Jesmon] in its name in the hand without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentToSuspend))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardToDigivolveInto))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanSelectCardToDigivolveInto(CardSource cardSource)
+                {
+                    if (cardSource.ContainsCardName("Jesmon"))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                bool CanSelectPermanentToSuspend (Permanent permanent)
+                {
+                    if (permanent.CanSuspend)
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+
+                    #region select card to suspend
+                    List<Permanent> selectedPermanents = new List<Permanent>();
+
+                    int maxCount = 1;
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanentToSuspend,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: maxCount,
+                        canNoSelect: true,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: selectPermanentCoroutine,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Tap,
+                        cardEffect: activateClass
+                        );
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 card to suspend.", "The opponent is selecting 1 card to suspend.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator selectPermanentCoroutine (Permanent permanent)
+                    {
+                        selectedPermanents.Add( permanent );
+                        yield return null;
+                    }
+                    #endregion
+
+                    if (selectedPermanents.Count > 0)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            cardCondition: CanSelectCardToDigivolveInto,
+                            payCost: false,
+                            reduceCostTuple: null,
+                            fixedCostTuple: null,
+                            ignoreDigivolutionRequirementFixedCost: -1,
+                            isHand: true,
+                            activateClass: activateClass,
+                            successProcess: null));
+                    }
+                }
+                #endregion
+            }
+
+            if (timing == EffectTiming.None)
+            {
+                #region inherited
+                bool CanUseCondition()
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
+                }
+
+                bool PermanentCondition (Permanent permanent)
+                {
+                    if (permanent == card.PermanentOfThisCard())
+                    {
+                        if (permanent.TopCard.HasRoyalKnightTraits)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.RebootStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: true, card: card, condition: CanUseCondition));
+                #endregion
+            }
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/Red/BT20_014.cs.meta

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

+ 251 - 0
Assets/CardEffect/BT20/Red/BT20_017.cs

@@ -0,0 +1,251 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT20
+{
+    //Regular Jesmon
+    public class BT20_017 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                #region <OnPlay>
+                {
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("Play a token", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                    cardEffects.Add(activateClass);
+
+                    string EffectDiscription()
+                    {
+                        return "[On Play] Play 1 [Atho, René & Por] Token. (Digimon/White/6000 DP/<Reboot>/<Blocker>/<Decoy Red/Black>)";
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return (CardEffectCommons.CanTriggerOnPlay(hashtable, card));
+                    }
+
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) >= 1)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    //#TODO Implement token effect script
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass));
+                    }
+                }
+                #endregion
+
+                #region <WhenDigivovling>
+                {
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("Play token", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                    cardEffects.Add(activateClass);
+
+                    string EffectDiscription()
+                    {
+                        return "[When Digivolving] Play 1 [Atho, René & Por] Token. (Digimon/White/6000 DP/<Reboot> <Blocker> <Decoy Red/Black>)";
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card));
+                    }
+
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame() && frame.IsBattleAreaFrame()) >= 1)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass));
+                    }
+                }
+                #endregion
+            }
+
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                #region Your Turn
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play token", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("PlayLevel6_BT20_017");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription ()
+                {
+                    return "[Your Turn] [Once Per Turn] When any of your other Digimon are played, delete 1 of your opponent's Digimon with 8000 SP or less. Then, 1 of you Digimon may attack.";
+                }
+
+                bool PermanentCondition (Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                }
+
+                bool CanUseCondition (Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition (Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectDeletePermanentCondition (Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(8000, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectAttackPermanentCondition (Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.CanAttack(activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine (Hashtable hashtable)
+                {
+                    List<Permanent> selectedPermanents = new List<Permanent>();
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectDeletePermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectDeletePermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectDeletePermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "Opponent is selecting one Digimon to delete.");
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    }
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectAttackPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectAttackPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectAttackPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will attack.", "Opponent is selecting on Digimon that will attack.");
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator AfterSelectPermanentCoroutine (List<Permanent> permanents)
+                        {
+                            selectedPermanents = permanents;
+                            yield return null;
+                        }
+
+                        foreach (Permanent permanent in selectedPermanents)
+                        {
+                            Permanent selectedPermanent = permanent;
+
+                            if (selectedPermanent != null)
+                            {
+                                if (selectedPermanent.CanAttack(activateClass))
+                                {
+                                    SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
+
+                                    selectAttackEffect.SetUp(
+                                        attacker: selectedPermanent,
+                                        canAttackPlayerCondition: () => true,
+                                        defenderCondition: (permanent) => true,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
+                                }
+                            }
+                        }
+
+                    }
+                }
+                #endregion
+            }
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/Red/BT20_017.cs.meta

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

+ 419 - 0
Assets/CardEffect/BT20/Red/BT20_019.cs

@@ -0,0 +1,419 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http.Headers;
+
+namespace DCGO.CardEffects.BT20
+{
+    public class BT20_019 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                #region When Digivolving
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Become unaffected by opponents effects, then can attack", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] if [Jesmon]/[X Antibody] is in this Digimon's digivoulution cards, for the turn, 1 of your Digimon isn't affected by your opponent's effects. Then, 1 of your Digimon may attack.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
+                    {
+                        return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                    }
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    Permanent this_card = card.PermanentOfThisCard();
+
+                    if (this_card != null)
+                    {
+                        bool CanSelectCondition(Permanent permanent)
+                        {
+                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                            {
+                                return true;
+                            }
+                            return false;
+                        }
+
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Jesmon") || cardSource.EqualsCardName("X Antibody")) >= 1)
+                        {
+                            #region select immunity recipient
+                            {
+                                IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                {
+                                    CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
+                                    canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's effects.", CanUseConditionImmunity, card);
+                                    canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
+                                    card.Owner.UntilEachTurnEndEffects.Add(GetCardEffect);
+
+                                    bool CanUseConditionImmunity(Hashtable hashtable)
+                                    {
+                                        return true;
+                                    }
+
+                                    bool CardCondition(CardSource cardSource)
+                                    {
+                                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(cardSource))
+                                        {
+                                            if (card.Owner == cardSource.Owner)
+                                            {
+                                                return true;
+                                            }
+                                        }
+
+                                        return false;
+                                    }
+
+                                    bool SkillCondition (ICardEffect cardEffect)
+                                    {
+                                        if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
+                                        {
+                                            return true;
+                                        }
+
+                                        return false;
+                                    }
+
+                                    ICardEffect GetCardEffect (EffectTiming _timing)
+                                    {
+                                        if (_timing == EffectTiming.None)
+                                        {
+                                            return canNotAffectedClass;
+                                        }
+                                        return null;
+                                    }
+
+                                    yield return null;
+                                }
+
+                                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectCondition));
+
+                                SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                selectPermanentEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectCondition,
+                                    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 be immune from your opponent's effects.", "Opponent is selecting on Digimon that will be immune from your effects.");
+                                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                
+                            }
+                            #endregion
+                        }
+
+                        {
+                            #region Select attacker
+                            {
+                                bool CanSelectAttackPermanentCondition(Permanent permanent)
+                                {
+                                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                                    {
+                                        if (permanent.CanAttack(activateClass))
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                    return false;
+                                }
+
+                                IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                {
+                                    SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
+
+                                    selectAttackEffect.SetUp(
+                                        attacker: permanent,
+                                        canAttackPlayerCondition: () => true,
+                                        defenderCondition: (permanent) => true,
+                                        cardEffect: activateClass);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
+                                }
+
+                                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectAttackPermanentCondition));
+
+                                SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                selectPermanentEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectAttackPermanentCondition,
+                                    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 be immune from your opponent's effects.", "Opponent is selecting on Digimon that will be immune from your effects.");
+                                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                            }
+                            #endregion
+                        }
+
+                        CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
+                        canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's effects", CanUseCondition1, card);
+                        canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
+                        this_card.UntilOpponentTurnEndEffects.Add((_timing) => canNotAffectedClass);
+
+                        bool CanUseCondition1(Hashtable hashtable)
+                        {
+                            return CardEffectCommons.IsPermanentExistsOnBattleArea(this_card);
+                        }
+
+                        bool CardCondition(CardSource cardSource)
+                        {
+                            if (CardEffectCommons.IsPermanentExistsOnBattleArea(this_card))
+                            {
+                                if (cardSource == this_card.TopCard)
+                                {
+                                    return true;
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        bool SkillCondition(ICardEffect cardEffect)
+                        {
+                            if (cardEffect != null)
+                            {
+                                if (cardEffect.EffectSourceCard != null)
+                                {
+                                    if (cardEffect.EffectSourceCard.Owner == card.Owner.Enemy)
+                                    {
+                                        return true;
+                                    }
+                                }
+                            }
+                            return false;
+                        }
+                    }
+                }
+                #endregion
+            }
+
+
+            if (timing == EffectTiming.None)
+            {
+                #region Your Turn
+                {
+                    AddSkillClass addSkillClass = new AddSkillClass();
+                    addSkillClass.SetUpICardEffect("[Your Turn] All of your Digimon with [Sistermon] or the [Royal Knight] trait gain <Piercing> and can attack your opponent's unsuspended Digimon.", CanUseCondition, card);
+                    addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
+                    cardEffects.Add(addSkillClass);
+
+
+                    CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
+                    canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Can attack to unsuspended Digimon", CanUseCondition1, card);
+                    canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(attackerCondition: PermanentCondition, defenderCondition: DefenderCondition, cardEffectCondition: CardEffectCondition);
+                    card.Owner.UntilOpponentTurnEndEffects.Add((_timing) => canAttackTargetDefendingPermanentClass);
+
+                    bool CanUseCondition1(Hashtable hashtable)
+                    {
+                        return true;
+                    }
+
+                    bool DefenderCondition(Permanent permanent)
+                    {
+                        if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                        {
+                            if (!permanent.IsSuspended)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool CardEffectCondition(ICardEffect cardEffect)
+                    {
+                        return true;
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (CardEffectCommons.IsOpponentTurn(card))
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool PermanentCondition(Permanent permanent)
+                    {
+                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        {
+                            if (permanent.TopCard.ContainsCardName("Sistermon") || permanent.TopCard.HasRoyalKnightTraits)
+                                return true;
+                        }
+
+                        return false;
+                    }
+
+                    bool CardSourceCondition(CardSource cardSource)
+                    {
+                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
+                        {
+                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                    {
+                        if (_timing == EffectTiming.None)
+                        {
+                            bool Condition()
+                            {
+                                return CardSourceCondition(cardSource);
+                            }
+
+                            cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: Condition));
+
+                        }
+
+                        return cardEffects;
+                    }
+                }
+                #endregion
+
+
+                #region Inherit
+                {
+                    AddSkillClass addSkillClass = new AddSkillClass();
+                    addSkillClass.SetUpICardEffect("While this Digimon is [JesmonGX], all of you Digimon gain <Piercing> and can also attack your opponent's unsuspended Digimon.", CanUseCondition, card);
+                    addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
+                    cardEffects.Add(addSkillClass);
+
+                    CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
+                    canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Can attack to unsuspended Digimon", CanUseCondition1, card);
+                    canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(attackerCondition: PermanentCondition, defenderCondition: DefenderCondition, cardEffectCondition: CardEffectCondition);
+                    canAttackTargetDefendingPermanentClass.SetIsInheritedEffect(true);
+                    card.Owner.UntilOpponentTurnEndEffects.Add((_timing) => canAttackTargetDefendingPermanentClass);
+
+                    bool CanUseCondition1(Hashtable hashtable)
+                    {
+                        return true;
+                    }
+
+                    bool DefenderCondition(Permanent permanent)
+                    {
+                        if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                        {
+                            if (!permanent.IsSuspended)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool CardEffectCondition(ICardEffect cardEffect)
+                    {
+                        return true;
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (CardEffectCommons.IsOpponentTurn(card))
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool PermanentCondition(Permanent permanent)
+                    {
+                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        {
+                            if (permanent.TopCard.EqualsCardName("Jesmon GX"))
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool CardSourceCondition(CardSource cardSource)
+                    {
+                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
+                        {
+                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                    {
+                        if (_timing == EffectTiming.None)
+                        {
+                            bool Condition()
+                            {
+                                return CardSourceCondition(cardSource);
+                            }
+
+                            cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: true, card: card, condition: Condition));
+                        }
+
+                        return cardEffects;
+                    }
+                }
+                #endregion
+            }
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/Red/BT20_019.cs.meta

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

+ 748 - 0
Assets/CardEffect/BT20/Red/BT20_021.cs

@@ -0,0 +1,748 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT20
+{
+    public class BT20_021 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region DNA Digivolution
+            if (timing == EffectTiming.None)
+            {
+                AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass();
+                addJogressConditionClass.SetUpICardEffect($"DNA Digivolution", CanUseCondition, card);
+                addJogressConditionClass.SetUpAddJogressConditionClass(getJogressCondition: GetJogress);
+                addJogressConditionClass.SetNotShowUI(true);
+                cardEffects.Add(addJogressConditionClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return true;
+                }
+
+                JogressCondition GetJogress(CardSource cardSource)
+                {
+                    if (cardSource == card)
+                    {
+                        bool PermanentCondition1(Permanent permanent)
+                        {
+                            return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
+                                && permanent.TopCard.ContainsCardName("Jesmon")
+                                && permanent.Levels_ForJogress(card).Contains(6);
+                        }
+
+                        bool PermanentCondition2(Permanent permanent)
+                        {
+                            return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
+                                && permanent.TopCard.ContainsCardName("Gankoomon")
+                                && permanent.Levels_ForJogress(card).Contains(6);
+                        }
+
+                        JogressConditionElement[] elements =
+                        {
+                            new (PermanentCondition1, "a level 6 with [Jesmon] in name"),
+                            new (PermanentCondition2, "a level 6 with [Gankoomon] in name")
+                        };
+
+                        JogressCondition jogress_condition = new JogressCondition(elements, 0);
+                        return jogress_condition;
+                    }
+
+                    return null;
+                }
+
+            }
+            #endregion
+
+            #region BlastDigivolve
+            if (timing == EffectTiming.OnCounterTiming)
+            {
+                cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
+            }
+            #endregion
+
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                #region OnPlay
+                ActivateClass activate_class = new ActivateClass();
+                activate_class.SetUpICardEffect("Select 1 card, delete 1 card", CanUseCondition, card);
+                activate_class.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activate_class.SetHashString("Delete_BT20_021");
+                cardEffects.Add(activate_class);
+
+                string EffectDescription()
+                {
+                    return "[OnPlay] [Once Per Turn] Place 1 [Royal Knight] trait card from your hand or trash as this Digimon's bottom digivolution card, delete 1 of your opponent's Digimon with as much or less DP as this digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return (CardEffectCommons.CanTriggerOnPlay(hashtable, card));
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (cardSource.HasRoyalKnightTraits)
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
+                        bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
+
+                        if (canSelectHand || canSelectTrash)
+                        {
+                            if (canSelectHand && canSelectHand)
+                            {
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value: false, spriteIndex: 1),
+                                };
+
+                                string selectPlayerMessage = "From which area do you select a card?";
+                                string notSelectPlayerMessage = "The opponent is choosing from which are to select a card.";
+
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                            }
+                            else
+                            {
+                                GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                            }
+
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                            bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            IEnumerator SelectCardCoroutine(CardSource card)
+                            {
+                                selectedCards.Add(card);
+
+                                yield return null;
+                            }
+
+                            if (fromHand)
+                            {
+                                int maxCount = 1;
+
+                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                selectHandEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: maxCount,
+                                    canNoSelect: true,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    mode: SelectHandEffect.Mode.Custom,
+                                    cardEffect: activate_class);
+
+                                selectHandEffect.SetUpCustomMessage(
+                                    "Select 1 card to place on bottom of digivolution cards.",
+                                    "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                                selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                            }
+                            else
+                            {
+                                int maxCount = 1;
+
+                                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 place on 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: activate_class);
+
+                                selectCardEffect.SetUpCustomMessage(
+                                    "Select 1 card to place on bottom of digivolution cards.",
+                                    "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                                selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            }
+
+                            CardSource selectedCard = null;
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                if (CardEffectCommons.IsExistOnBattleArea(card))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
+                                        selectedCards,
+                                        activate_class));
+
+                                    selectedCard = selectedCards[0];
+                                }
+                            }
+
+                            if (selectedCard != null)
+                            {
+                                List<Permanent> deleteTargets = new List<Permanent>();
+
+                                bool CanSelectForDeletion(Permanent permanent)
+                                {
+                                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                                    {
+                                        if (permanent.DP <= card.PermanentOfThisCard().DP)
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                    return false;
+                                }
+
+                                IEnumerator AfterSelectionCoroutine(List<Permanent> permanents)
+                                {
+                                    deleteTargets = permanents.Clone();
+
+                                    yield return null;
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectForDeletion))
+                                {
+                                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectForDeletion));
+
+                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectForDeletion,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        maxCount: maxCount,
+                                        canNoSelect: false,
+                                        canEndNotMax: false,
+                                        selectPermanentCoroutine: null,
+                                        afterSelectPermanentCoroutine: AfterSelectionCoroutine,
+                                        mode: SelectPermanentEffect.Mode.Custom,
+                                        cardEffect: activate_class);
+
+                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                }
+
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargets, activateClass: activate_class, successProcess: null, failureProcess: null));
+
+                            }
+                        }
+                    }
+                }
+
+                #endregion
+            }
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                #region When Digivolving
+                ActivateClass activate_class = new ActivateClass();
+                activate_class.SetUpICardEffect("Select 1 card, delete 1 card", CanUseCondition, card);
+                activate_class.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activate_class.SetHashString("Delete_BT20_021");
+                cardEffects.Add(activate_class);
+
+                string EffectDescription()
+                {
+                    return "[When Digivolving] [Once Per Turn] Place 1 [Royal Knight] trait card from your hand or trash as this Digimon's bottom digivolution card, delete 1 of your opponent's Digimon with as much or less DP as this digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card));
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (cardSource.HasRoyalKnightTraits)
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
+                        bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
+
+                        if (canSelectHand || canSelectTrash)
+                        {
+                            if (canSelectHand && canSelectHand)
+                            {
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value: false, spriteIndex: 1),
+                                };
+
+                                string selectPlayerMessage = "From which area do you select a card?";
+                                string notSelectPlayerMessage = "The opponent is choosing from which are to select a card.";
+
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                            }
+                            else
+                            {
+                                GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                            }
+
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                            bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            IEnumerator SelectCardCoroutine(CardSource card)
+                            {
+                                selectedCards.Add(card);
+
+                                yield return null;
+                            }
+
+                            if (fromHand)
+                            {
+                                int maxCount = 1;
+
+                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                selectHandEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: maxCount,
+                                    canNoSelect: true,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    mode: SelectHandEffect.Mode.Custom,
+                                    cardEffect: activate_class);
+
+                                selectHandEffect.SetUpCustomMessage(
+                                    "Select 1 card to place on bottom of digivolution cards.",
+                                    "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                                selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                            }
+                            else
+                            {
+                                int maxCount = 1;
+
+                                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 place on 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: activate_class);
+
+                                selectCardEffect.SetUpCustomMessage(
+                                    "Select 1 card to place on bottom of digivolution cards.",
+                                    "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                                selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            }
+
+                            CardSource selectedCard = null;
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                if (CardEffectCommons.IsExistOnBattleArea(card))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
+                                        selectedCards,
+                                        activate_class));
+
+                                    selectedCard = selectedCards[0];
+                                }
+                            }
+
+                            if (selectedCard != null)
+                            {
+                                List<Permanent> deleteTargets = new List<Permanent>();
+
+                                bool CanSelectForDeletion(Permanent permanent)
+                                {
+                                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                                    {
+                                        if (permanent.DP <= card.PermanentOfThisCard().DP)
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                    return false;
+                                }
+
+                                IEnumerator AfterSelectionCoroutine(List<Permanent> permanents)
+                                {
+                                    deleteTargets = permanents.Clone();
+
+                                    yield return null;
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectForDeletion))
+                                {
+                                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectForDeletion));
+
+                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectForDeletion,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        maxCount: maxCount,
+                                        canNoSelect: false,
+                                        canEndNotMax: false,
+                                        selectPermanentCoroutine: null,
+                                        afterSelectPermanentCoroutine: AfterSelectionCoroutine,
+                                        mode: SelectPermanentEffect.Mode.Custom,
+                                        cardEffect: activate_class);
+
+                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                }
+
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargets, activateClass: activate_class, successProcess: null, failureProcess: null));
+
+                            }
+                        }
+                    }
+                }
+
+                #endregion
+            }
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                #region When attacking 1
+                ActivateClass activate_class = new ActivateClass();
+                activate_class.SetUpICardEffect("Select 1 card, delete 1 card", CanUseCondition, card);
+                activate_class.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activate_class.SetHashString("Delete_BT20_021");
+                cardEffects.Add(activate_class);
+
+                string EffectDescription()
+                {
+                    return "[When Attacking] [Once Per Turn] By placing 1 [Royal Knight] trait card from your hand or trash as this Digimon's bottom digivolution card, delete 1 of your opponent's Digimon with as much or less DP as this digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return (CardEffectCommons.CanTriggerOnAttack(hashtable, card));
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (cardSource.HasRoyalKnightTraits)
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        bool canSelectHand = card.Owner.HandCards.Count(CanSelectCardCondition) >= 1;
+                        bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
+
+                        if (canSelectHand || canSelectTrash)
+                        {
+                            if (canSelectHand && canSelectHand)
+                            {
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value: false, spriteIndex: 1),
+                                };
+
+                                string selectPlayerMessage = "From which area do you select a card?";
+                                string notSelectPlayerMessage = "The opponent is choosing from which are to select a card.";
+
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                            }
+                            else
+                            {
+                                GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                            }
+
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                            bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            IEnumerator SelectCardCoroutine(CardSource card)
+                            {
+                                selectedCards.Add(card);
+
+                                yield return null;
+                            }
+
+                            if (fromHand)
+                            {
+                                int maxCount = 1;
+
+                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                selectHandEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: maxCount,
+                                    canNoSelect: true,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    mode: SelectHandEffect.Mode.Custom,
+                                    cardEffect: activate_class);
+
+                                selectHandEffect.SetUpCustomMessage(
+                                    "Select 1 card to place on bottom of digivolution cards.",
+                                    "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                                selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                            }
+                            else
+                            {
+                                int maxCount = 1;
+
+                                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 place on 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: activate_class);
+
+                                selectCardEffect.SetUpCustomMessage(
+                                    "Select 1 card to place on bottom of digivolution cards.",
+                                    "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                                selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            }
+
+                            CardSource selectedCard = null;
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                if (CardEffectCommons.IsExistOnBattleArea(card))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
+                                        selectedCards,
+                                        activate_class));
+
+                                    selectedCard = selectedCards[0];
+                                }
+                            }
+
+                            if (selectedCard != null)
+                            {
+                                List<Permanent> deleteTargets = new List<Permanent>();
+
+                                bool CanSelectForDeletion(Permanent permanent)
+                                {
+                                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                                    {
+                                        if (permanent.DP <= card.PermanentOfThisCard().DP)
+                                        {
+                                            return true;
+                                        }
+                                    }
+                                    return false;
+                                }
+
+                                IEnumerator AfterSelectionCoroutine(List<Permanent> permanents)
+                                {
+                                    deleteTargets = permanents.Clone();
+
+                                    yield return null;
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectForDeletion))
+                                {
+                                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectForDeletion));
+
+                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                    selectPermanentEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: CanSelectForDeletion,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        maxCount: maxCount,
+                                        canNoSelect: false,
+                                        canEndNotMax: false,
+                                        selectPermanentCoroutine: null,
+                                        afterSelectPermanentCoroutine: AfterSelectionCoroutine,
+                                        mode: SelectPermanentEffect.Mode.Custom,
+                                        cardEffect: activate_class);
+
+                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                }
+
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargets, activateClass: activate_class, successProcess: null, failureProcess: null));
+
+                            }
+                        }
+                    }
+                }
+
+                #endregion
+            }
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                #region when attacking 2
+                ActivateClass activate_class = new ActivateClass();
+                activate_class.SetUpICardEffect("Select 1 card, delete 1 card", CanUseCondition, card);
+                activate_class.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activate_class.SetHashString("Unsuspend_BT20_021");
+                cardEffects.Add(activate_class);
+
+                string EffectDescription()
+                {
+                    return "[When Attacking] [Once per Turn] This Digimon unsuspends. Then, for every 2 [Royal Knight] trait cards in this Digimon'd digivolution cards, trash your opponent's top security card";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return (CardEffectCommons.CanTriggerOnAttack(hashtable, card));
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    Permanent selectedPermanent = card.PermanentOfThisCard();
+
+                    yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activate_class).Unsuspend());
+
+                    int num_security_deletes = selectedPermanent.DigivolutionCards.Count((card)=>(card.HasRoyalKnightTraits)) % 2;
+
+                    if (num_security_deletes > 0)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                            player: card.Owner.Enemy,
+                            destroySecurityCount: 1,
+                            cardEffect: activate_class,
+                            fromTop: true).DestroySecurity());
+                    }
+                }
+                #endregion
+            }
+
+                return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/Red/BT20_021.cs.meta

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

+ 62 - 0
Assets/CardEffect/BT20/White/BT20_17_token.cs

@@ -0,0 +1,62 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.Token
+{
+    public class BT20_17_token : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Reboot
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region Blocker
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region Decoy
+
+            if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
+            {
+                string DecoyDiscription()
+                {
+                    return "<Decoy (Red)/(Black)> (When one of your other Red or Black Digimon would be deleted by an opponent's effect, you may delete this Digimon to prevent that deletion.)";
+                }
+
+                bool CanSelectDecoyPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            if (permanent.TopCard.CardColors.Contains(CardColor.Red) || permanent.TopCard.CardColors.Contains(CardColor.Black))
+                            {
+                                if (permanent.willBeRemoveField)
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null, permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy (Red/Black)", effectDiscription: DecoyDiscription()));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/White/BT20_17_token.cs.meta

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

+ 10 - 0
Assets/Scripts/CardEffectCommons.cs

@@ -322,6 +322,16 @@ public partial class CardEffectCommons
     }
     #endregion
 
+    public static IEnumerator PlayAthoRenePorToken (ICardEffect activateClass)
+    {
+        yield return ContinuousController.instance.StartCoroutine(PlayToken(
+            tokenData: ContinuousController.instance.AthoRenePorToken,
+            activateClass: activateClass,
+            isOwnerPermanent: true,
+            isTapped: false
+            ));
+    }
+
     #region Security effect of "add this card to hand"
     public static IEnumerator AddThisCardToHand(CardSource card1, ICardEffect activateClass)
     {

+ 22 - 0
Assets/Scripts/ContinuousController.cs

@@ -117,6 +117,7 @@ public class ContinuousController : MonoBehaviour
     public CEntity_Base TaomonToken { get; private set; }
     public CEntity_Base RapidmonToken { get; private set; }
     public CEntity_Base PipeFoxToken { get; private set; }
+    public CEntity_Base AthoRenePorToken { get; private set; }
     public CardRestriction BanList { get; private set; } = new CardRestriction(new List<CardLimitCount>(), new List<BannedPair>());
 
     void LoadBanList()
@@ -414,6 +415,27 @@ public class ContinuousController : MonoBehaviour
         };
 
         await PipeFoxToken.GetCardSprite();
+
+        AthoRenePorToken = new CEntity_Base()
+        {
+            cardColors = new List<CardColor>() { CardColor.White },
+            PlayCost = -1,
+            Level = 0,
+            CardName_JPN = "",
+            CardName_ENG = "Atho, René & Por",
+            Form_JPN = new List<string>(),
+            Form_ENG = new List<string>(),
+            Attribute_JPN = new List<string>(),
+            Attribute_ENG = new List<string>(),
+            Type_JPN = new List<string>(),
+            Type_ENG = new List<string>(),
+            CardSpriteName = "BT20-017-token",
+            cardKind = CardKind.Digimon,
+            DP = 6000,
+            CardEffectClassName = "BT20_017_token"
+        };
+
+        await AthoRenePorToken.GetCardSprite();
     }
 
     public static ContinuousController instance = null;