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

Applied Second round of feedback. There is one issue I am not 100% sure I resolved correctly. I left it unresolved in the github conversation and commented on it.

S-E-I-G-E 1 год назад
Родитель
Сommit
ce9a8bf146

+ 30 - 36
Assets/CardEffect/BT20/Red/BT20_013.cs

@@ -19,6 +19,7 @@ namespace DCGO.CardEffects.BT20
                 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 ()
@@ -28,9 +29,9 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanUseCondition (Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.CanActivateSuspendCostEffect(card))
+                        if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                         {
                             return true;
                         }
@@ -40,9 +41,12 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanSelectCardCondition (CardSource cardSource)
                 {
-                    if (cardSource.ContainsCardName ("Sistermon") || cardSource.ContainsCardName ("Gankoomon"))
+                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: true, cardEffect: activateClass))
                     {
-                        return true;
+                        if (cardSource.ContainsCardName("Sistermon") || cardSource.ContainsCardName("Gankoomon"))
+                        {
+                            return true;
+                        }
                     }
                     return false;
                 }
@@ -150,30 +154,26 @@ namespace DCGO.CardEffects.BT20
 
                             int maxCount = 1;
 
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
-                            selectCardEffect.SetUp(
+                            selectHandEffect.SetUp(
                                 selectPlayer: card.Owner,
                                 canTargetCondition: CanSelectCardCondition,
                                 canTargetCondition_ByPreSelecetedList: null,
                                 canEndSelectCondition: null,
                                 maxCount: maxCount,
-                                message: "Select 1 card to play.",
-                                canNoSelect: () => true,
+                                canNoSelect: true,
                                 canEndNotMax: false,
                                 isShowOpponent: true,
                                 selectCardCoroutine: SelectCardCoroutine,
                                 afterSelectCardCoroutine: null,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Hand,
-                                customRootCardList: null,
-                                canLookReverseCard: false,
+                                mode: SelectHandEffect.Mode.Custom,
                                 cardEffect: activateClass);
 
-                            selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+                            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(selectCardEffect.Activate());
+                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
 
                             IEnumerator SelectCardCoroutine(CardSource cardSource)
                             {
@@ -204,18 +204,7 @@ namespace DCGO.CardEffects.BT20
             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)
+                bool Condition()
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
@@ -224,24 +213,29 @@ namespace DCGO.CardEffects.BT20
                             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;
                 }
+
+                cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    changeValue: 1000,
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: Condition,
+                    effectName: () => "Your Digimons gain DP +1000"));
                 #endregion
             }
-
             return cardEffects;
         }
     }

+ 90 - 112
Assets/CardEffect/BT20/Red/BT20_014.cs

@@ -15,8 +15,8 @@ namespace DCGO.CardEffects.BT20
                 {
                     #region On Play
                     ActivateClass activateClass = new ActivateClass();
-                    activateClass.SetUpICardEffect("", CanUseCondition, card);
-                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                    activateClass.SetUpICardEffect("Delete a Digimon with 5000DP or less", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                     cardEffects.Add(activateClass);
 
                     string EffectDiscription()
@@ -31,7 +31,14 @@ namespace DCGO.CardEffects.BT20
 
                     bool CanActivateCondition(Hashtable hashtable)
                     {
-                        return card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanent) >= 1;
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanent))
+                            {
+                                return true;
+                            }
+                        }
+                        return false;
                     }
 
                     bool CanSelectPermanent(Permanent permanent)
@@ -70,8 +77,8 @@ namespace DCGO.CardEffects.BT20
                 {
                     #region On Digivolve
                     ActivateClass activateClass = new ActivateClass();
-                    activateClass.SetUpICardEffect("", CanUseCondition, card);
-                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                    activateClass.SetUpICardEffect("Delete a Digimon with 5000DP or less", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                     cardEffects.Add(activateClass);
 
                     string EffectDiscription()
@@ -86,7 +93,14 @@ namespace DCGO.CardEffects.BT20
 
                     bool CanActivateCondition(Hashtable hashtable)
                     {
-                        return card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanent) >= 1;
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanent))
+                            {
+                                return true;
+                            }
+                        }
+                        return false;
                     }
 
                     bool CanSelectPermanent(Permanent permanent)
@@ -129,7 +143,7 @@ namespace DCGO.CardEffects.BT20
             {
                 #region End of Turn
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
+                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);
 
@@ -140,19 +154,32 @@ namespace DCGO.CardEffects.BT20
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (card.Owner.HandCards.Count(CanSelectPlayCardCondition) >= 1)
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        return true;
+                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentToSuspend))
+                        {
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardToDigivolveInto))
+                            {
+                                return true;
+                            }
+                        }
                     }
                     return false;
                 }
 
-                bool CanSelectPlayCardCondition (CardSource cardSource)
+                bool CanSelectCardToDigivolveInto(CardSource cardSource)
                 {
                     if (cardSource.ContainsCardName("Jesmon"))
                     {
@@ -161,104 +188,64 @@ namespace DCGO.CardEffects.BT20
                     return false;
                 }
 
-                bool CanSelectSuspendPermanent (Permanent permanent)
+                bool CanSelectPermanentToSuspend (Permanent permanent)
                 {
                     if (permanent.CanSuspend)
                     {
-                        if (permanent.TopCard.Level == 5)
+                        if (permanent != card.PermanentOfThisCard())
                         {
                             return true;
-                        }    
+                        }
                     }
                     return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (card.Owner.HandCards.Count(CanSelectPlayCardCondition) >= 1)
-                    {
-                        if (card.Owner.GetBattleAreaDigimons().Count(CanSelectSuspendPermanent) >= 1)
-                        {
-
-                            #region select card to suspend
-                            List<Permanent> selectedPermanents = new List<Permanent>();
 
-                            int maxCount = 1;
+                    #region select card to suspend
+                    List<Permanent> selectedPermanents = new List<Permanent>();
 
-                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                    int maxCount = 1;
 
-                            selectPermanentEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectSuspendPermanent,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: maxCount,
-                                canNoSelect: false,
-                                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.");
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    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.");
 
-                            IEnumerator selectPermanentCoroutine (Permanent permanent)
-                            {
-                                selectedPermanents.Add( permanent );
-                                yield return null;
-                            }
-                            #endregion
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                            if (selectedPermanents.Count > 0)
-                            {
-                                #region select card to play
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectPlayCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    message: "Select 1 card to play.",
-                                    canNoSelect: () => true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectCardEffect.Mode.Custom,
-                                    root: SelectCardEffect.Root.Hand,
-                                    customRootCardList: null,
-                                    canLookReverseCard: false,
-                                    cardEffect: activateClass);
-
-                                selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                                selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                    cardSources: selectedCards,
-                                    activateClass: activateClass,
-                                    payCost: false,
-                                    isTapped: false,
-                                    root: SelectCardEffect.Root.Hand,
-                                    activateETB: true));
-                                #endregion
+                    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
@@ -267,34 +254,25 @@ namespace DCGO.CardEffects.BT20
             if (timing == EffectTiming.None)
             {
                 #region inherited
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
-                activateClass.SetIsInheritedEffect(true);
-                cardEffects.Add(activateClass);
-
-                cardEffects.Add(CardEffectFactory.AllianceSelfEffect(false, card, null));
-
-                string EffectDiscription()
-                {
-                    return "[Your Turn] This Digimon with the [Royal Knight] trait gains <Alliance>";
-                }
-
-                bool CanUseCondition(Hashtable hashtable)
+                bool CanUseCondition()
                 {
                     return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
+                bool PermanentCondition (Permanent permanent)
                 {
-                    return CardEffectCommons.IsExistOnBattleArea(card) &&
-                           card.PermanentOfThisCard().TopCard.HasRoyalKnightTraits;
-                }
+                    if (permanent == card.PermanentOfThisCard())
+                    {
+                        if (permanent.TopCard.HasRoyalKnightTraits)
+                        {
+                            return true;
+                        }
+                    }
 
-                IEnumerator ActivateCoroutine(Hashtable hashtable)
-                {
-                    yield return null;
+                    return false;
                 }
+
+                cardEffects.Add(CardEffectFactory.RebootStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: true, card: card, condition: CanUseCondition));
                 #endregion
             }
 

+ 8 - 22
Assets/CardEffect/BT20/Red/BT20_017.cs

@@ -12,14 +12,14 @@ namespace DCGO.CardEffects.BT20
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
-            #region OnPlay WhenDigivovling
+            
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 #region <OnPlay>
                 {
                     ActivateClass activateClass = new ActivateClass();
                     activateClass.SetUpICardEffect("Play a token", CanUseCondition, card);
-                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                     cardEffects.Add(activateClass);
 
                     string EffectDiscription()
@@ -57,7 +57,7 @@ namespace DCGO.CardEffects.BT20
                 {
                     ActivateClass activateClass = new ActivateClass();
                     activateClass.SetUpICardEffect("Play token", CanUseCondition, card);
-                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                     cardEffects.Add(activateClass);
 
                     string EffectDiscription()
@@ -83,7 +83,6 @@ namespace DCGO.CardEffects.BT20
                         return false;
                     }
 
-                    //#TODO Implement token effect script
                     IEnumerator ActivateCoroutine(Hashtable hashtable)
                     {
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass));
@@ -91,15 +90,14 @@ namespace DCGO.CardEffects.BT20
                 }
                 #endregion
             }
-            #endregion
 
-            #region Your Turn
 
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
+                #region Your Turn
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play token", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("PlayLevel6_BT20_017");
                 cardEffects.Add(activateClass);
 
@@ -184,24 +182,13 @@ namespace DCGO.CardEffects.BT20
                             canNoSelect: false,
                             canEndNotMax: false,
                             selectPermanentCoroutine: null,
-                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
-                            mode: SelectPermanentEffect.Mode.Custom,
+                            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());
 
-                        IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
-                        {
-                            selectedPermanents = permanents;
-                            yield return null;
-                        }
-
-
-                        yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
-                            selectedPermanents,
-                            CardEffectCommons.CardEffectHashtable(activateClass)).Destroy());
-
                     }
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectAttackPermanentCondition))
@@ -255,10 +242,9 @@ namespace DCGO.CardEffects.BT20
 
                     }
                 }
+                #endregion
             }
 
-            #endregion
-
             return cardEffects;
         }
     }

+ 94 - 81
Assets/CardEffect/BT20/Red/BT20_019.cs

@@ -22,7 +22,7 @@ namespace DCGO.CardEffects.BT20
 
                 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. THne, 1 of your Digimon may attack.";
+                    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)
@@ -142,10 +142,7 @@ namespace DCGO.CardEffects.BT20
                                     {
                                         if (permanent.CanAttack(activateClass))
                                         {
-                                            if (card.Owner.Enemy.GetBattleAreaDigimons().Count((enemyDigimon) => permanent.CanAttackTargetDigimon(enemyDigimon, activateClass)) >= 1)
-                                            {
-                                                return true;
-                                            }
+                                            return true;
                                         }
                                     }
                                     return false;
@@ -234,21 +231,27 @@ namespace DCGO.CardEffects.BT20
             {
                 #region Your Turn
                 {
-                    ActivateClass activateClass = new ActivateClass();
-                    activateClass.SetUpICardEffect("Select digimon to gain piercing and can attack unsuspended digimon", CanUseCondition, card);
-                    activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
-                    cardEffects.Add(activateClass);
+                    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);
+
 
-                    String EffectDiscription ()
+                    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 "[Your Turn] All of your Digimon with [Sistermon] in their names or the [Royal Knight] trait gain <Piercing> and can also attack your opponent's unsuspended Digimon."
+                        return true;
                     }
 
-                    bool CanUseCondition(Hashtable hashtable)
+                    bool DefenderCondition(Permanent permanent)
                     {
-                        if (CardEffectCommons.IsExistOnBattleArea(card))
+                        if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
                         {
-                            if (CardEffectCommons.IsOpponentTurn(card))
+                            if (!permanent.IsSuspended)
                             {
                                 return true;
                             }
@@ -257,11 +260,16 @@ namespace DCGO.CardEffects.BT20
                         return false;
                     }
 
-                    bool PermanentCondition(Permanent permanent)
+                    bool CardEffectCondition(ICardEffect cardEffect)
                     {
-                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        return true;
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                         {
-                            if (permanent.DigivolutionCards.Count((card) => card.ContainsCardName("Sistermon") || card.HasRoyalKnightTraits) >= 1)
+                            if (CardEffectCommons.IsOpponentTurn(card))
                             {
                                 return true;
                             }
@@ -270,67 +278,88 @@ namespace DCGO.CardEffects.BT20
                         return false;
                     }
 
-                    IEnumerator ActivateCoroutine (Hashtable hashtable)
+                    bool PermanentCondition(Permanent permanent)
                     {
+                        if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                        {
+                            if (permanent.TopCard.ContainsCardName("Sistermon") || permanent.TopCard.HasRoyalKnightTraits)
+                                return true;
+                        }
 
-                        List<Permanent> permanents = card.Owner.GetBattleAreaDigimons();
+                        return false;
+                    }
 
-                        if (permanents.Count >= 1)
+                    bool CardSourceCondition(CardSource cardSource)
+                    {
+                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
                         {
-                            foreach (Permanent permanent in permanents)
+                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
                             {
-                                yield return CardEffectCommons.GainPierce(targetPermanent: permanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass, true);
+                                return true;
                             }
                         }
 
-                        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;
-                        }
+                        return false;
+                    }
 
-                        bool DefenderCondition(Permanent permanent)
+                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                    {
+                        if (_timing == EffectTiming.None)
                         {
-                            if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                            bool Condition()
                             {
-                                if (!permanent.IsSuspended)
-                                {
-                                    return true;
-                                }
+                                return CardSourceCondition(cardSource);
                             }
 
-                            return false;
-                        }
+                            cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: Condition));
 
-                        bool CardEffectCondition(ICardEffect cardEffect)
-                        {
-                            return true;
                         }
-                    }
 
-                    
+                        return cardEffects;
+                    }
                 }
                 #endregion
 
+
                 #region Inherit
                 {
-                    ActivateClass activateClass = new ActivateClass();
-                    activateClass.SetUpICardEffect("Select digimon to gain piercing and can attack unsuspended digimon", CanUseCondition, card);
-                    activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
-                    cardEffects.Add(activateClass);
+                    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;
+                    }
 
-                    String EffectDiscription()
+                    bool CardEffectCondition(ICardEffect cardEffect)
                     {
-                        return "[Your Turn] While this Digimon is [Jesmon GX], all of your Digimon gain <Piercing> and can also attack your opponent's unsuspended Digimon.";
+                        return true;
                     }
 
                     bool CanUseCondition(Hashtable hashtable)
                     {
-                        if (CardEffectCommons.IsExistOnBattleArea(card))
+                        if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                         {
                             if (CardEffectCommons.IsOpponentTurn(card))
                             {
@@ -345,7 +374,7 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                         {
-                            if (permanent.TopCard.CardNames.Contains("Jesmon GX"))
+                            if (permanent.TopCard.EqualsCardName("Jesmon GX"))
                             {
                                 return true;
                             }
@@ -354,52 +383,36 @@ namespace DCGO.CardEffects.BT20
                         return false;
                     }
 
-                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    bool CardSourceCondition(CardSource cardSource)
                     {
-
-                        List<Permanent> permanents = card.Owner.GetBattleAreaDigimons();
-
-                        if (permanents.Count >= 1)
+                        if (PermanentCondition(cardSource.PermanentOfThisCard()))
                         {
-                            foreach (Permanent permanent in permanents)
+                            if (cardSource == cardSource.PermanentOfThisCard().TopCard)
                             {
-                                yield return CardEffectCommons.GainPierce(targetPermanent: permanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass, true);
+                                return true;
                             }
                         }
 
-                        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;
-                        }
+                        return false;
+                    }
 
-                        bool DefenderCondition(Permanent permanent)
+                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                    {
+                        if (_timing == EffectTiming.None)
                         {
-                            if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                            bool Condition()
                             {
-                                if (!permanent.IsSuspended)
-                                {
-                                    return true;
-                                }
+                                return CardSourceCondition(cardSource);
                             }
 
-                            return false;
+                            cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: true, card: card, condition: Condition));
                         }
 
-                        bool CardEffectCondition(ICardEffect cardEffect)
-                        {
-                            return true;
-                        }
+                        return cardEffects;
                     }
                 }
                 #endregion
-                
             }
-
             return cardEffects;
         }
     }

+ 8 - 2
Assets/CardEffect/BT20/Red/BT20_021.cs

@@ -73,6 +73,7 @@ namespace DCGO.CardEffects.BT20
                 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()
@@ -281,6 +282,7 @@ namespace DCGO.CardEffects.BT20
                 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()
@@ -489,11 +491,12 @@ namespace DCGO.CardEffects.BT20
                 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] 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.";
+                    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)
@@ -693,14 +696,16 @@ namespace DCGO.CardEffects.BT20
 
             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 Knigght] 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'd digivolution cards, trash your opponent's top security card";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -734,6 +739,7 @@ namespace DCGO.CardEffects.BT20
                             fromTop: true).DestroySecurity());
                     }
                 }
+                #endregion
             }
 
                 return cardEffects;

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

@@ -1,7 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 
-namespace DCGO.CardEffects.BT20
+namespace DCGO.CardEffects.Token
 {
     public class BT20_17_token : CEntity_Effect
     {
@@ -51,7 +51,7 @@ namespace DCGO.CardEffects.BT20
                     return false;
                 }
 
-                cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null, permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy ([Black])", effectDiscription: DecoyDiscription()));
+                cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null, permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy (Red/Black)", effectDiscription: DecoyDiscription()));
             }
 
             #endregion