Browse Source

1.7.7 updates

mbunch_kascope 1 năm trước cách đây
mục cha
commit
21e7501729

+ 5 - 3
Assets/CardEffect/BT20/Black/BT20_055.cs

@@ -261,12 +261,14 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.CanTriggerOnAttack(hashtable, card))
+                    if (CardEffectCommons.IsOwnerTurn(card))
                     {
-                        if (CardEffectCommons.IsOwnerTurn(card))
+                        if(CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(CardEffectCommons.GetAttackerFromHashtable(hashtable), card))
                         {
                             if (!CardEffectCommons.GetCardFromHashtable(hashtable).IsFlipped)
-                                return true;
+                            {
+                                return card.PermanentOfThisCard().DigivolutionCards.Count > 0;
+                            }
                         }
                     }
 

+ 2 - 2
Assets/CardEffect/BT20/Black/BT20_057.cs

@@ -98,7 +98,7 @@ namespace DCGO.CardEffects.BT20
                                     int targetCost = 0;
 
                                     if (CardEffectCommons.HasMatchConditionPermanent(HasProperTraitInPlay))
-                                        targetCost += 5;
+                                        targetCost += 4;
 
                                     Cost -= targetCost;
                                 }
@@ -151,7 +151,7 @@ namespace DCGO.CardEffects.BT20
             if (timing == EffectTiming.None)
             {
                 ChangeCostClass changeCostClass = new ChangeCostClass();
-                changeCostClass.SetUpICardEffect("Play Cost -5", CanUseCondition, card);
+                changeCostClass.SetUpICardEffect("Play Cost -4", CanUseCondition, card);
                 changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => true, isChangePayingCost: () => true);
                 changeCostClass.SetNotShowUI(true);
                 cardEffects.Add(changeCostClass);

+ 1 - 9
Assets/CardEffect/BT20/Black/BT20_059.cs

@@ -178,15 +178,7 @@ namespace DCGO.CardEffects.BT20
 
                 bool CardSourceCondition(CardSource cardSource)
                 {
-                    if (PermanentCondition(cardSource.PermanentOfThisCard()))
-                    {
-                        if (cardSource == cardSource.PermanentOfThisCard().TopCard)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return PermanentCondition(cardSource.PermanentOfThisCard());
                 }
 
                 List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)

+ 1 - 0
Assets/CardEffect/BT20/Blue/BT20_027.cs

@@ -293,6 +293,7 @@ namespace DCGO.CardEffects.BT20
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
                     return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           CardEffectCommons.CanActivateSuspendCostEffect(card) &&
                            (permanent.TopCard.HasText("Dracomon") || permanent.TopCard.HasText("Examon"));
                 }
 

+ 1 - 1
Assets/CardEffect/BT20/Blue/BT20_102.cs

@@ -387,7 +387,7 @@ namespace DCGO.CardEffects.BT20
                                 effectDuration: EffectDuration.UntilEachTurnEnd,
                                 activateClass: activateClass));
 
-                            if (selectedPermanent.CanAttack(activateClass))
+                            if (selectedPermanent.CanAttack(activateClass, true))
                             {
                                 SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 

+ 28 - 59
Assets/CardEffect/BT20/Purple/BT20_065.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 
 namespace DCGO.CardEffects.BT20
 {
@@ -110,85 +111,53 @@ namespace DCGO.CardEffects.BT20
 
                                 if(selectedPermanent != null)
                                 {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
+                                    CardSource _topCard = selectedPermanent.TopCard;
 
-                                    bool PermanentCondition(Permanent permanent)
+                                    ActivateClass activateClass1 = new ActivateClass();
+                                    activateClass1.SetUpICardEffect("Memory -1", CanUseCondition1, selectedPermanent.TopCard);
+                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
+                                    activateClass1.SetEffectSourcePermanent(selectedPermanent);
+                                    CardEffectCommons.AddEffectToPermanent(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnDestroyedAnyone);
+
+                                    if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
                                     {
-                                        return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
                                     }
 
-                                    AddSkillClass addSkillClass = new AddSkillClass();
-                                    addSkillClass.SetUpICardEffect("Memory -1", CanUseCondition1, card);
-                                    addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
-                                    selectedPermanent.UntilOpponentTurnEndEffects.Add((_timing) => addSkillClass);
-
-                                    bool CanUseCondition1(Hashtable hashtable)
+                                    string EffectDiscription1()
                                     {
-                                        return true;
+                                        return "[On Deletion] Lose 1 memory.";
                                     }
 
-                                    bool CardSourceCondition(CardSource cardSource)
+                                    bool CanUseCondition1(Hashtable hashtable1)
                                     {
-                                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
+                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
                                         {
-                                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
+                                            if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable1, (permanent) => permanent == selectedPermanent))
                                             {
-                                                return true;
+                                                if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
+                                                {
+                                                    return true;
+                                                }
                                             }
                                         }
 
                                         return false;
                                     }
 
-                                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                                    bool CanActivateCondition1(Hashtable hashtable1)
                                     {
-                                        if (_timing == EffectTiming.OnDestroyedAnyone)
+                                        if (CardEffectCommons.IsTopCardInTrashOnDeletion(hashtable1))
                                         {
-                                            ActivateClass activateClass1 = new ActivateClass();
-                                            activateClass1.SetUpICardEffect("Memory -1", CanUseCondition2, cardSource);
-                                            activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
-                                            cardEffects.Add(activateClass1);
-
-                                            if (cardSource.PermanentOfThisCard() != null)
-                                            {
-                                                activateClass1.SetEffectSourcePermanent(cardSource.PermanentOfThisCard());
-                                            }
-
-                                            string EffectDiscription1()
-                                            {
-                                                return "[On Deletion] Lose 1 memory.";
-                                            }
-
-                                            bool CanUseCondition2(Hashtable hashtable)
-                                            {
-                                                if (CardSourceCondition(cardSource))
-                                                {
-                                                    if (CardEffectCommons.CanTriggerOnDeletion(hashtable, cardSource))
-                                                    {
-                                                        return true;
-                                                    }
-                                                }
-
-                                                return false;
-                                            }
-
-                                            bool CanActivateCondition1(Hashtable hashtable)
-                                            {
-                                                if (CardEffectCommons.CanActivateOnDeletion(cardSource))
-                                                {
-                                                    return true;
-                                                }
-
-                                                return false;
-                                            }
-
-                                            IEnumerator ActivateCoroutine1(Hashtable _hashtable)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(cardSource.Owner.AddMemory(-1, activateClass1));
-                                            }
+                                            return true;
                                         }
 
-                                        return cardEffects;
+                                        return false;
+                                    }
+
+                                    IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(_topCard.Owner.AddMemory(-1, activateClass1));
                                     }
                                 }
                             }

+ 2 - 1
Assets/CardEffect/BT20/Purple/BT20_076.cs

@@ -224,7 +224,8 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 17 - 3
Assets/CardEffect/BT20/Purple/BT20_097.cs

@@ -134,6 +134,13 @@ namespace DCGO.CardEffects.BT20
                     return "[All Turns] When any of your [DexDorugoramon] would leave the battle area, <Delay>.\r\n• By return 1 [Dorumon] from those Digimon's digivolution cards to the hand, you may play 1 [DeathXmon] from your trash without paying the cost.";
                 }
 
+                bool DexDorugora(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           permanent.TopCard.EqualsCardName("DexDorugoramon") &&
+                           permanent.willBeRemoveField;
+                }
+
                 bool DexDorugoraWithSource(Permanent permanent)
                 {
                     return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
@@ -155,7 +162,7 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, DexDorugoraWithSource) &&
+                    return CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, DexDorugora) &&
                            CardEffectCommons.CanDeclareOptionDelayEffect(card);
                 }
 
@@ -209,7 +216,7 @@ namespace DCGO.CardEffects.BT20
                                     canTargetCondition_ByPreSelecetedList: null,
                                     canEndSelectCondition: null,
                                     canNoSelect: () => false,
-                                    selectCardCoroutine: null,
+                                    selectCardCoroutine: SelectDorumonCoroutine,
                                     afterSelectCardCoroutine: null,
                                     message: "Select 1 digivolution card.",
                                     maxCount: 1,
@@ -227,7 +234,14 @@ namespace DCGO.CardEffects.BT20
 
                         yield return StartCoroutine(selectCardEffect.Activate());
 
-                        if(selectedCards.Any(source => card.Owner.HandCards.Contains(source)))
+                        IEnumerator SelectDorumonCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+
+                            yield return null;
+                        }
+
+                        if (selectedCards.Any(source => card.Owner.HandCards.Contains(source)))
                         {
                             List<CardSource> selectedPlayedCards = new List<CardSource>();
 

+ 2 - 2
Assets/CardEffect/BT20/Purple/BT20_098.cs

@@ -86,7 +86,7 @@ namespace DCGO.CardEffects.BT20
 
                             int sumLevel = cardSources.Sum(source => source.Level);
 
-                            if (sumLevel >= maxLevel)
+                            if (sumLevel != maxLevel)
                             {
                                 return false;
                             }
@@ -100,7 +100,7 @@ namespace DCGO.CardEffects.BT20
 
                             sumLevel += cardSource.Level;
 
-                            if (sumLevel >= maxLevel)
+                            if (sumLevel > maxLevel)
                             {
                                 return false;
                             }

+ 22 - 26
Assets/CardEffect/BT20/Red/BT20_008.cs

@@ -10,9 +10,9 @@ namespace DCGO.CardEffects.BT20
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region start of main phase
             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());
@@ -88,49 +88,45 @@ namespace DCGO.CardEffects.BT20
                         yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
                     }
                 }
-                #endregion
             }
-            
+            #endregion
+
+            #region ESS
             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 ()
+                bool Condition()
                 {
-                    return "[Your Turn] All of your Digimon get +1000 DP.";
-                }
-
-                bool CanUseCondition (Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleArea (card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
                         if (CardEffectCommons.IsOwnerTurn(card))
                         {
                             return true;
                         }
                     }
+
                     return false;
                 }
 
-                IEnumerator ActivateCoroutine (Hashtable hashtable)
+                bool PermanentCondition(Permanent permanent)
                 {
-                    List<Permanent> permanents = card.Owner.GetBattleAreaDigimons();
-
-                    if (permanents.Count >= 1)
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        foreach (Permanent permanent in permanents)
-                        {
-                            yield return CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 1000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass);
-                        }
+                        return true;
                     }
+
+                    return false;
                 }
-                #endregion
+
+                cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    changeValue: 1000,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: Condition,
+                    effectName: () => "Your Digimons gain DP +1000"));
             }
+            #endregion
+
             return cardEffects;
         }
     }

+ 7 - 5
Assets/CardEffect/BT20/Red/BT20_013.cs

@@ -13,9 +13,10 @@ namespace DCGO.CardEffects.BT20
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Main Once Per Turn
             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());
@@ -128,7 +129,7 @@ namespace DCGO.CardEffects.BT20
 
                         bool CardSourceCondition(CardSource cardSource)
                         {
-                            if (cardSource.HasPlayCost)
+                            if (CanSelectCardCondition(cardSource))
                             {
                                 return true;
                             }
@@ -198,12 +199,12 @@ namespace DCGO.CardEffects.BT20
                         #endregion
                     }
                 }
-                #endregion
             }
+            #endregion
 
+            #region ESS
             if (timing == EffectTiming.None)
             {
-                #region Inherited
                 bool Condition()
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
@@ -234,8 +235,9 @@ namespace DCGO.CardEffects.BT20
                     card: card,
                     condition: Condition,
                     effectName: () => "Your Digimons gain DP +1000"));
-                #endregion
             }
+            #endregion
+
             return cardEffects;
         }
     }

+ 110 - 135
Assets/CardEffect/BT20/Red/BT20_014.cs

@@ -10,140 +10,122 @@ namespace DCGO.CardEffects.BT20
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region On Play
             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);
-                    }
+                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);
 
-                    bool CanActivateCondition(Hashtable hashtable)
-                    {
-                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                        {
-                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanent))
-                            {
-                                return true;
-                            }
-                        }
-                        return false;
-                    }
+                string EffectDiscription()
+                {
+                    return "[On Play] Delete 1 of your opponent's Digimon with 5000DP or less.";
+                }
 
-                    bool CanSelectPermanent(Permanent permanent)
-                    {
-                        return permanent.DP <= 5000;
-                    }
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
 
-                    IEnumerator ActivateCoroutine(Hashtable hashtable)
-                    {
-                        List<Permanent> selectedPermanents = new List<Permanent>();
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanent);
+                }
 
-                        int maxCount = 1;
+                bool CanSelectPermanent(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                           permanent.DP <= card.Owner.MaxDP_DeleteEffect(5000, activateClass);
+                }
 
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    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.SetUp(
+                        selectPlayer: card.Owner.Enemy,
+                        canTargetCondition: CanSelectPermanent,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        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.");
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
 
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                    }
-                    #endregion
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
-                {
-                    #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);
-                    }
+            }
+            #endregion
 
-                    bool CanActivateCondition(Hashtable hashtable)
-                    {
-                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                        {
-                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanent))
-                            {
-                                return true;
-                            }
-                        }
-                        return false;
-                    }
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                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);
 
-                    bool CanSelectPermanent(Permanent permanent)
-                    {
-                        return permanent.DP <= 5000;
-                    }
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] Delete 1 of your opponent's Digimon with 5000DP or less.";
+                }
 
-                    IEnumerator ActivateCoroutine(Hashtable hashtable)
-                    {
-                        List<Permanent> selectedPermanents = new List<Permanent>();
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
 
-                        int maxCount = 1;
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanent);
+                }
 
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                bool CanSelectPermanent(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                           permanent.DP <= card.Owner.MaxDP_DeleteEffect(5000, activateClass);
+                }
 
-                        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
-                            );
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner.Enemy,
+                        canTargetCondition: CanSelectPermanent,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass
+                        );
 
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                    }
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
 
-                    #endregion
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
             }
+            #endregion
 
+            #region End of Turn
             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.SetUpICardEffect("By suspending a Digimon, this Digimon may digivolve into a Digimon card with [Jesmon] in its name", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -152,6 +134,19 @@ namespace DCGO.CardEffects.BT20
                     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 CanSelectPermanentToSuspend(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           CardEffectCommons.CanActivateSuspendCostEffect(permanent.TopCard) &&
+                           (permanent != card.PermanentOfThisCard());
+                }
+
+                bool CanSelectCardToDigivolveInto(CardSource cardSource)
+                {
+                    return cardSource.ContainsCardName("Jesmon") &&
+                           cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass);
+                }
+
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
@@ -179,27 +174,6 @@ namespace DCGO.CardEffects.BT20
                     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)
                 {
 
@@ -248,18 +222,19 @@ namespace DCGO.CardEffects.BT20
                             successProcess: null));
                     }
                 }
-                #endregion
             }
+            #endregion
 
+            #region Your Turn - ESS
             if (timing == EffectTiming.None)
             {
-                #region inherited
                 bool CanUseCondition()
                 {
-                    return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && 
+                           CardEffectCommons.IsOwnerTurn(card);
                 }
 
-                bool PermanentCondition (Permanent permanent)
+                bool PermanentCondition(Permanent permanent)
                 {
                     if (permanent == card.PermanentOfThisCard())
                     {
@@ -272,9 +247,9 @@ namespace DCGO.CardEffects.BT20
                     return false;
                 }
 
-                cardEffects.Add(CardEffectFactory.RebootStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: true, card: card, condition: CanUseCondition));
-                #endregion
+                cardEffects.Add(CardEffectFactory.AllianceStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: true, card: card, condition: CanUseCondition));
             }
+            #endregion
 
             return cardEffects;
         }

+ 2 - 2
Assets/CardEffect/BT20/Red/BT20_016.cs

@@ -43,7 +43,7 @@ namespace DCGO.CardEffects.BT20
                                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
 
                                     {
-                                        if (permanent.TopCard.CardColors.Contains(CardColor.Purple))
+                                        if (permanent.TopCard.CardColors.Contains(CardColor.Red))
                                         {
                                             if (permanent.Levels_ForJogress(card).Contains(4))
                                             {
@@ -65,7 +65,7 @@ namespace DCGO.CardEffects.BT20
                                 {
                                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                                     {
-                                        if (permanent.TopCard.CardColors.Contains(CardColor.Red))
+                                        if (permanent.TopCard.CardColors.Contains(CardColor.Purple))
                                         {
                                             if (permanent.Levels_ForJogress(card).Contains(4))
                                             {

+ 2 - 2
Assets/CardEffect/BT20/Red/BT20_017.cs

@@ -96,14 +96,14 @@ namespace DCGO.CardEffects.BT20
             {
                 #region Your Turn
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Play token", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Delete 8k DP or less, Then 1 Digimon may attack.", 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.";
+                    return "[Your Turn] [Once Per Turn] When any of your other Digimon are played, delete 1 of your opponent's Digimon with 8000 DP or less. Then, 1 of you Digimon may attack.";
                 }
 
                 bool PermanentCondition (Permanent permanent)

+ 191 - 257
Assets/CardEffect/BT20/Red/BT20_019.cs

@@ -12,9 +12,10 @@ namespace DCGO.CardEffects.BT20
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region When Digivolving
             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());
@@ -25,22 +26,25 @@ namespace DCGO.CardEffects.BT20
                     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 SourceCondition(CardSource source)
+                {
+                    return source.EqualsCardName("Jesmon") || source.EqualsCardName("X Antibody");
+                }
+
+                bool CanSelectCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                }
+
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
-                    {
-                        return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
-                    }
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        return true;
-                    }
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
@@ -49,20 +53,39 @@ namespace DCGO.CardEffects.BT20
 
                     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)
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count(SourceCondition) >= 1)
                         {
                             #region select immunity recipient
                             {
+                                Permanent immunityPermanent = 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 will be immune from your opponent's effects.", "Opponent is selecting 1 Digimon that will be immune from your effects.");
+                                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
                                 IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                {
+                                    immunityPermanent = permanent;
+                                    yield return null;
+                                }
+
+                                if(immunityPermanent != null)
                                 {
                                     CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
                                     canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's effects.", CanUseConditionImmunity, card);
@@ -87,7 +110,7 @@ namespace DCGO.CardEffects.BT20
                                         return false;
                                     }
 
-                                    bool SkillCondition (ICardEffect cardEffect)
+                                    bool SkillCondition(ICardEffect cardEffect)
                                     {
                                         if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
                                         {
@@ -97,7 +120,7 @@ namespace DCGO.CardEffects.BT20
                                         return false;
                                     }
 
-                                    ICardEffect GetCardEffect (EffectTiming _timing)
+                                    ICardEffect GetCardEffect(EffectTiming _timing)
                                     {
                                         if (_timing == EffectTiming.None)
                                         {
@@ -106,313 +129,224 @@ namespace DCGO.CardEffects.BT20
                                         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
                         {
-                            #region Select attacker
+                            bool CanSelectAttackPermanentCondition(Permanent permanent)
                             {
-                                bool CanSelectAttackPermanentCondition(Permanent permanent)
+                                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                                 {
-                                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                                    if (permanent.CanAttack(activateClass))
                                     {
-                                        if (permanent.CanAttack(activateClass))
-                                        {
-                                            return true;
-                                        }
+                                        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());
+                                return false;
                             }
-                            #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))
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
                             {
-                                if (cardSource == this_card.TopCard)
-                                {
-                                    return true;
-                                }
-                            }
+                                SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 
-                            return false;
-                        }
+                                selectAttackEffect.SetUp(
+                                    attacker: permanent,
+                                    canAttackPlayerCondition: () => true,
+                                    defenderCondition: (permanent) => true,
+                                    cardEffect: activateClass);
 
-                        bool SkillCondition(ICardEffect cardEffect)
-                        {
-                            if (cardEffect != null)
-                            {
-                                if (cardEffect.EffectSourceCard != null)
-                                {
-                                    if (cardEffect.EffectSourceCard.Owner == card.Owner.Enemy)
-                                    {
-                                        return true;
-                                    }
-                                }
+                                yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                             }
-                            return false;
+
+                            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
                     }
                 }
-                #endregion
             }
+            #endregion
 
-
+            #region Your Turn
             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;
-                    }
+                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);
 
-                    bool DefenderCondition(Permanent permanent)
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                        if (CardEffectCommons.IsOwnerTurn(card))
                         {
-                            if (!permanent.IsSuspended)
-                            {
-                                return true;
-                            }
+                            return true;
                         }
-
-                        return false;
                     }
 
-                    bool CardEffectCondition(ICardEffect cardEffect)
+                    return false;
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        return true;
+                        if (permanent.TopCard.ContainsCardName("Sistermon") || permanent.TopCard.HasRoyalKnightTraits)
+                            return true;
                     }
 
-                    bool CanUseCondition(Hashtable hashtable)
-                    {
-                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                        {
-                            if (CardEffectCommons.IsOpponentTurn(card))
-                            {
-                                return true;
-                            }
-                        }
+                    return false;
+                }
 
-                        return false;
-                    }
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    return PermanentCondition(cardSource.PermanentOfThisCard());
+                }
 
-                    bool PermanentCondition(Permanent permanent)
+                List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                {
+                    if (_timing == EffectTiming.OnDetermineDoSecurityCheck)
                     {
-                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        bool Condition()
                         {
-                            if (permanent.TopCard.ContainsCardName("Sistermon") || permanent.TopCard.HasRoyalKnightTraits)
-                                return true;
+                            return CardSourceCondition(cardSource);
                         }
 
-                        return false;
+                        cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: Condition));
                     }
 
-                    bool CardSourceCondition(CardSource cardSource)
-                    {
-                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
-                        {
-                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
-                            {
-                                return true;
-                            }
-                        }
+                    return cardEffects;
+                }
 
-                        return false;
-                    }
+                CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
+                canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Can attack to unsuspended Digimon", CanUseCondition1, card);
+                canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(attackerCondition: PermanentCondition, defenderCondition: DefenderCondition, cardEffectCondition: CardEffectCondition);
+                cardEffects.Add(canAttackTargetDefendingPermanentClass);
 
-                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                bool CanUseCondition1(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                bool DefenderCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if (_timing == EffectTiming.None)
+                        if (!permanent.IsSuspended)
                         {
-                            bool Condition()
-                            {
-                                return CardSourceCondition(cardSource);
-                            }
-
-                            cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: Condition));
-
+                            return true;
                         }
-
-                        return cardEffects;
                     }
-                }
-                #endregion
 
+                    return false;
+                }
 
-                #region Inherit
+                bool CardEffectCondition(ICardEffect cardEffect)
                 {
-                    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;
-                    }
+                    return true;
+                }
+            }
+            #endregion
+
+            #region Inherit
+            if(timing == EffectTiming.None)
+            {
+                AddSkillClass addSkillClass = new AddSkillClass();
+                addSkillClass.SetUpICardEffect("[Your Turn] While this Digimon is [Jesmon GX], all of your Digimon gain <Piercing> and can also attack your opponent's unsuspended Digimon.", CanUseCondition, card);
+                addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
+                addSkillClass.SetIsInheritedEffect(true);
+                cardEffects.Add(addSkillClass);
 
-                    bool DefenderCondition(Permanent permanent)
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                        if (CardEffectCommons.IsOwnerTurn(card))
                         {
-                            if (!permanent.IsSuspended)
-                            {
-                                return true;
-                            }
+                            return card.PermanentOfThisCard().TopCard.EqualsCardName("Jesmon GX");
                         }
-
-                        return false;
                     }
 
-                    bool CardEffectCondition(ICardEffect cardEffect)
-                    {
-                        return true;
-                    }
+                    return false;
+                }
 
-                    bool CanUseCondition(Hashtable hashtable)
-                    {
-                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                        {
-                            if (CardEffectCommons.IsOpponentTurn(card))
-                            {
-                                return true;
-                            }
-                        }
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                }
 
-                        return false;
-                    }
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    return PermanentCondition(cardSource.PermanentOfThisCard());
+                }
 
-                    bool PermanentCondition(Permanent permanent)
+                List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                {
+                    if (_timing == EffectTiming.OnDetermineDoSecurityCheck)
                     {
-                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        bool Condition()
                         {
-                            if (permanent.TopCard.EqualsCardName("Jesmon GX"))
-                            {
-                                return true;
-                            }
+                            return CardSourceCondition(cardSource);
                         }
 
-                        return false;
+                        cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: Condition));
                     }
 
-                    bool CardSourceCondition(CardSource cardSource)
-                    {
-                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
-                        {
-                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
-                            {
-                                return true;
-                            }
-                        }
+                    return cardEffects;
+                }
 
-                        return false;
-                    }
+                CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
+                canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Can attack to unsuspended Digimon", CanUseCondition1, card);
+                canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(attackerCondition: PermanentCondition, defenderCondition: DefenderCondition, cardEffectCondition: CardEffectCondition);
+                canAttackTargetDefendingPermanentClass.SetIsInheritedEffect(true);
+                cardEffects.Add(canAttackTargetDefendingPermanentClass);
 
-                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                bool CanUseCondition1(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                bool DefenderCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                     {
-                        if (_timing == EffectTiming.None)
+                        if (!permanent.IsSuspended)
                         {
-                            bool Condition()
-                            {
-                                return CardSourceCondition(cardSource);
-                            }
-
-                            cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: true, card: card, condition: Condition));
+                            return true;
                         }
-
-                        return cardEffects;
                     }
+
+                    return false;
+                }
+
+                bool CardEffectCondition(ICardEffect cardEffect)
+                {
+                    return true;
                 }
-                #endregion
             }
+            #endregion
+
             return cardEffects;
         }
     }

+ 6 - 9
Assets/CardEffect/BT20/Red/BT20_021.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using UnityEngine;
 
 namespace DCGO.CardEffects.BT20
 {
@@ -698,14 +699,14 @@ namespace DCGO.CardEffects.BT20
             {
                 #region when attacking 2
                 ActivateClass activate_class = new ActivateClass();
-                activate_class.SetUpICardEffect("Select 1 card, delete 1 card", CanUseCondition, card);
+                activate_class.SetUpICardEffect("Unsuspend, Then for every 2 [Royal Knight] traits in sources, trash opponent's top security", 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";
+                    return "[When Attacking] [Once per Turn] This Digimon unsuspends. Then, for every 2 [Royal Knight] trait cards in this Digimon's digivolution cards, trash your opponent's top security card";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -715,11 +716,7 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        return true;
-                    }
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
@@ -728,13 +725,13 @@ namespace DCGO.CardEffects.BT20
 
                     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;
+                    int num_security_deletes = Mathf.FloorToInt(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,
+                            destroySecurityCount: num_security_deletes,
                             cardEffect: activate_class,
                             fromTop: true).DestroySecurity());
                     }

+ 2 - 4
Assets/CardEffect/BT20/Red/BT20_094.cs

@@ -182,7 +182,7 @@ namespace DCGO.CardEffects.BT20
 
             #region Delay Effect
             
-            if (timing == EffectTiming.OnDeclaration)
+            if (timing == EffectTiming.OnLoseSecurity)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect(
@@ -194,9 +194,7 @@ namespace DCGO.CardEffects.BT20
                 
                 string EffectDescription()
                 {
-                    return
-                        "You may play 1 [Imperialdramon: Dragon Mode] from any of your [Imperialdramon: Fighter Mode]'s digivolution cards without paying the cost.";
-                        
+                    return"[All Turns] When your opponent's security stack is removed from, <Delay>.\r\n• You may play 1 [Imperialdramon: Dragon Mode] from any of your [Imperialdramon: Fighter Mode]'s digivolution cards without paying the cost.";
                 }
                 
                 bool IsOwnerPermanentCondition(Permanent permanent)

+ 1 - 1
Assets/CardEffect/BT20/White/BT20_083.cs

@@ -187,7 +187,7 @@ namespace DCGO.CardEffects.BT20
                 {
                     if (CardEffectCommons.IsExistOnBreedingArea(card))
                     {
-                        if (CardEffectCommons.CanActivateSuspendCostEffect(card))
+                        if (CardEffectCommons.CanActivateSuspendCostEffect(card, true))
                         {
                             return true;
                         }

+ 3 - 9
Assets/CardEffect/BT20/White/BT20_091.cs

@@ -111,15 +111,9 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, PermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, PermanentCondition) &&
+                           CardEffectCommons.IsOpponentTurn(card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 1 - 1
Assets/CardEffect/BT20/White/BT20_17_token.cs

@@ -1,7 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 
-namespace DCGO.CardEffects.Token
+namespace DCGO.CardEffects.Tokens
 {
     public class BT20_17_token : CEntity_Effect
     {

+ 1 - 0
Assets/CardEffect/BT20/Yellow/BT20_035.cs

@@ -307,6 +307,7 @@ namespace DCGO.CardEffects.BT20
                 activateClass.SetUpICardEffect("<Recovery +1(Deck)>", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("Recover_BT20-035");
+                activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 2 - 2
Assets/CardEffect/BT20/Yellow/BT20_036.cs

@@ -62,7 +62,7 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsExistOnHand(cardSource))
                         {
-                            return true;
+                            return CardEffectCommons.HasMatchConditionPermanent(HasAccelTraitInPlay);
                         }
                     }
 
@@ -174,7 +174,7 @@ namespace DCGO.CardEffects.BT20
                 {
                     if (card.Owner.HandCards.Contains(card))
                     {
-                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Play Cost -5");
+                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Reduce the play cost by 5");
 
                         if (activateClass != null)
                         {

+ 2 - 2
Assets/CardEffect/BT20/Yellow/BT20_037.cs

@@ -76,7 +76,7 @@ namespace DCGO.CardEffects.BT20
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("For each level 6 in sources, suspend 1 Digimon, Then Opponent's Digimon/Tamers can activate [On Play] or unsuspend", CanUseCondition, card);
+                activateClass.SetUpICardEffect("For each level 6 in sources, suspend 1 Digimon and memory +1, Then Opponent's Digimon/Tamers can activate [On Play] or unsuspend", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -145,7 +145,7 @@ namespace DCGO.CardEffects.BT20
                     DisableEffectClass invalidationClass = new DisableEffectClass();
                     invalidationClass.SetUpICardEffect("Ignore [On Play] Effect of opponent's Digimon/Tamers", CanUseCondition, card);
                     invalidationClass.SetUpDisableEffectClass(DisableCondition: InvalidateCondition);
-                    card.Owner.Enemy.UntilOpponentTurnEndEffects.Add((_timing) => invalidationClass);
+                    card.Owner.UntilOpponentTurnEndEffects.Add((_timing) => invalidationClass);
 
                     bool CanUseCondition(Hashtable hashtable)
                     {

+ 40 - 46
Assets/CardEffect/EX8/Purple/EX8_059.cs

@@ -178,7 +178,7 @@ namespace DCGO.CardEffects.EX8
                                     {
                                         if (CardEffectCommons.IsTopCardInTrashOnDeletion(hashtable1))
                                         {
-                                            return true;
+                                            return _topCard.Owner.HandCards.Count > 0;
                                         }
 
                                         return false;
@@ -186,28 +186,25 @@ namespace DCGO.CardEffects.EX8
 
                                     IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
                                     {
-                                        if (selectedPermanent.TopCard.Owner.HandCards.Count >= 1)
-                                        {
-                                            int discardCount = 1;
-
-                                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                            selectHandEffect.SetUp(
-                                                selectPlayer: selectedPermanent.TopCard.Owner,
-                                                canTargetCondition: (cardSource) => true,
-                                                canTargetCondition_ByPreSelecetedList: null,
-                                                canEndSelectCondition: null,
-                                                maxCount: discardCount,
-                                                canNoSelect: false,
-                                                canEndNotMax: false,
-                                                isShowOpponent: true,
-                                                selectCardCoroutine: null,
-                                                afterSelectCardCoroutine: null,
-                                                mode: SelectHandEffect.Mode.Discard,
-                                                cardEffect: activateClass);
-
-                                            yield return StartCoroutine(selectHandEffect.Activate());
-                                        }
+                                        yield return ContinuousController.instance.StartCoroutine(_topCard.Owner.AddMemory(-1, activateClass1));
+
+                                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                        selectHandEffect.SetUp(
+                                            selectPlayer: _topCard.Owner,
+                                            canTargetCondition: (cardSource) => true,
+                                            canTargetCondition_ByPreSelecetedList: null,
+                                            canEndSelectCondition: null,
+                                            maxCount: 1,
+                                            canNoSelect: false,
+                                            canEndNotMax: false,
+                                            isShowOpponent: true,
+                                            selectCardCoroutine: null,
+                                            afterSelectCardCoroutine: null,
+                                            mode: SelectHandEffect.Mode.Discard,
+                                            cardEffect: activateClass);
+
+                                        yield return StartCoroutine(selectHandEffect.Activate());
                                     }
                                 }
                             }
@@ -358,7 +355,7 @@ namespace DCGO.CardEffects.EX8
                                     {
                                         if (CardEffectCommons.IsTopCardInTrashOnDeletion(hashtable1))
                                         {
-                                            return true;
+                                            return _topCard.Owner.HandCards.Count > 0;
                                         }
 
                                         return false;
@@ -366,28 +363,25 @@ namespace DCGO.CardEffects.EX8
 
                                     IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
                                     {
-                                        if (selectedPermanent.TopCard.Owner.HandCards.Count >= 1)
-                                        {
-                                            int discardCount = 1;
-
-                                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                            selectHandEffect.SetUp(
-                                                selectPlayer: selectedPermanent.TopCard.Owner,
-                                                canTargetCondition: (cardSource) => true,
-                                                canTargetCondition_ByPreSelecetedList: null,
-                                                canEndSelectCondition: null,
-                                                maxCount: discardCount,
-                                                canNoSelect: false,
-                                                canEndNotMax: false,
-                                                isShowOpponent: true,
-                                                selectCardCoroutine: null,
-                                                afterSelectCardCoroutine: null,
-                                                mode: SelectHandEffect.Mode.Discard,
-                                                cardEffect: activateClass);
-
-                                            yield return StartCoroutine(selectHandEffect.Activate());
-                                        }
+                                        yield return ContinuousController.instance.StartCoroutine(_topCard.Owner.AddMemory(-1, activateClass1));
+
+                                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                        selectHandEffect.SetUp(
+                                            selectPlayer: _topCard.Owner,
+                                            canTargetCondition: (cardSource) => true,
+                                            canTargetCondition_ByPreSelecetedList: null,
+                                            canEndSelectCondition: null,
+                                            maxCount: 1,
+                                            canNoSelect: false,
+                                            canEndNotMax: false,
+                                            isShowOpponent: true,
+                                            selectCardCoroutine: null,
+                                            afterSelectCardCoroutine: null,
+                                            mode: SelectHandEffect.Mode.Discard,
+                                            cardEffect: activateClass);
+
+                                        yield return StartCoroutine(selectHandEffect.Activate());
                                     }
                                 }
                             }

+ 2 - 2
Assets/CardEffect/P/Yellow/P_172.cs

@@ -436,7 +436,7 @@ namespace DCGO.CardEffects.P
                         {
                             yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
                                 targetPermanent: selectedPermanent, 
-                                changeValue: 5000, 
+                                changeValue: -5000, 
                                 effectDuration: EffectDuration.UntilEachTurnEnd, 
                                 activateClass: activateClass));
                         }
@@ -542,7 +542,7 @@ namespace DCGO.CardEffects.P
                         {
                             yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
                                 targetPermanent: selectedPermanent,
-                                changeValue: 5000,
+                                changeValue: -5000,
                                 effectDuration: EffectDuration.UntilEachTurnEnd,
                                 activateClass: activateClass));
                         }

+ 14 - 3
Assets/Scripts/CardEffectCommons/CanUseEffects/CanSuspend.cs

@@ -7,14 +7,14 @@ using UnityEngine;
 public partial class CardEffectCommons
 {
     #region Can activate effects by suspending oneself
-    public static bool CanActivateSuspendCostEffect(CardSource card)
+    public static bool CanActivateSuspendCostEffect(CardSource card, bool includeBreeding = false)
     {
-        return CanActivatePermanentSuspendCostEffect(card.PermanentOfThisCard());
+        return CanActivatePermanentSuspendCostEffect(card.PermanentOfThisCard(), includeBreeding);
     }
     #endregion
 
     #region Can activate effects by suspending permanent
-    public static bool CanActivatePermanentSuspendCostEffect(Permanent permanent)
+    public static bool CanActivatePermanentSuspendCostEffect(Permanent permanent, bool includeBreeding = false)
     {
         if (IsPermanentExistsOnBattleArea(permanent))
         {
@@ -24,6 +24,17 @@ public partial class CardEffectCommons
             }
         }
 
+        if (includeBreeding)
+        {
+            if (IsPermanentExistsOnBreedingArea(permanent))
+            {
+                if (!permanent.IsSuspended && permanent.CanSuspend)
+                {
+                    return true;
+                }
+            }
+        }
+
         return false;
     }
     #endregion

+ 21 - 0
Assets/Scripts/CardEffectCommons/GetFromHashtable.cs

@@ -246,6 +246,27 @@ public partial class CardEffectCommons
     }
     #endregion
 
+    #region Get Attacking Permanent from hashtable
+    public static Permanent GetAttackerFromHashtable(Hashtable hashtable)
+    {
+        if (hashtable != null)
+        {
+            if (hashtable.ContainsKey("AttackingPermanent"))
+            {
+                if (hashtable["AttackingPermanent"] is Permanent)
+                {
+                    Permanent permanent = (Permanent)hashtable["AttackingPermanent"];
+
+                    return permanent;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    #endregion
+
     #region Get hashtables from hashtable of card effect
     public static List<Hashtable> GetHashtablesFromHashtable(Hashtable hashtable)
     {

+ 1 - 6
Assets/Scripts/CardSource.cs

@@ -1530,12 +1530,7 @@ public class CardSource : MonoBehaviour
     {
         get
         {
-            if (CardTraits.Contains("Royal Knight") || CardTraits.Contains("RoyalKnight"))
-            {
-                return true;
-            }
-
-            return false;
+            return CardTraits.Equals("Royal Knight");
         }
     }
     #endregion