Procházet zdrojové kódy

Merge pull request #929 from DCGO2/x89rt2-patch-20

X89rt2 patch 20
x89rt2 před 4 měsíci
rodič
revize
f307e1612a
39 změnil soubory, kde provedl 1034 přidání a 363 odebrání
  1. 2 2
      Assets/CardBaseEntity/AD1/Black/Tamer/AD1_023.asset
  2. 2 2
      Assets/CardBaseEntity/AD1/Black/Tamer/AD1_023_P1.asset
  3. 2 2
      Assets/CardBaseEntity/AD1/Blue/Tamer/AD1_020.asset
  4. 2 2
      Assets/CardBaseEntity/AD1/Blue/Tamer/AD1_020_P1.asset
  5. 2 2
      Assets/Scripts/CardEffect/AD1/Blue/AD1_012.cs
  6. 3 2
      Assets/Scripts/CardEffect/AD1/Blue/AD1_014.cs
  7. 2 2
      Assets/Scripts/CardEffect/AD1/Purple/AD1_018.cs
  8. 12 47
      Assets/Scripts/CardEffect/AD1/Red/AD1_002.cs
  9. 28 67
      Assets/Scripts/CardEffect/AD1/Yellow/AD1_015.cs
  10. 1 0
      Assets/Scripts/CardEffect/AD1/Yellow/AD1_017.cs
  11. 5 41
      Assets/Scripts/CardEffect/BT16/Black/BT16_063.cs
  12. 2 2
      Assets/Scripts/CardEffect/BT17/Blue/BT17_022.cs
  13. 1 1
      Assets/Scripts/CardEffect/BT21/Black/BT21_058.cs
  14. 121 29
      Assets/Scripts/CardEffect/BT24/Blue/BT24_090.cs
  15. 115 27
      Assets/Scripts/CardEffect/BT24/Green/BT24_094.cs
  16. 11 18
      Assets/Scripts/CardEffect/BT7/Yellow/BT7_032.cs
  17. 2 2
      Assets/Scripts/CardEffect/EX11/Black/EX11_066.cs
  18. 2 2
      Assets/Scripts/CardEffect/EX9/Yellow/EX9_032.cs
  19. 3 3
      Assets/Scripts/CardEffect/P/Purple/P_096.cs
  20. 2 1
      Assets/Scripts/CardEffect/P/White/P_206.cs
  21. 8 0
      Assets/Scripts/CardEffect/ST23/Yellow.meta
  22. 196 0
      Assets/Scripts/CardEffect/ST23/Yellow/ST23_05.cs
  23. 11 0
      Assets/Scripts/CardEffect/ST23/Yellow/ST23_05.cs.meta
  24. 8 0
      Assets/Scripts/CardEffect/ST24/Blue.meta
  25. 11 0
      Assets/Scripts/CardEffect/ST24/Blue/ST24_02.cs.meta
  26. 11 0
      Assets/Scripts/CardEffect/ST24/Blue/ST24_03.cs.meta
  27. 8 0
      Assets/Scripts/CardEffect/ST24/Green.meta
  28. 76 0
      Assets/Scripts/CardEffect/ST24/Green/ST24_08.cs
  29. 11 0
      Assets/Scripts/CardEffect/ST24/Green/ST24_08.cs.meta
  30. 123 0
      Assets/Scripts/CardEffect/ST24/Green/ST24_09.cs
  31. 11 0
      Assets/Scripts/CardEffect/ST24/Green/ST24_09.cs.meta
  32. 11 0
      Assets/Scripts/CardEffect/ST24/Yellow/ST24_05.cs.meta
  33. 85 32
      Assets/Scripts/Script/CardEffectFactory.cs
  34. 4 1
      Assets/Scripts/Script/CardEffects/AddSkillClass.cs
  35. 4 4
      Assets/Scripts/Script/ContinuousController.cs
  36. 13 1
      Assets/Scripts/Script/MultipleSkills.cs
  37. 73 70
      Assets/Scripts/Script/SelectJogressEffect.cs
  38. 49 0
      Assets/Scripts/Script/SelectPermanentEffect.cs
  39. 1 1
      ProjectSettings/ProjectSettings.asset

+ 2 - 2
Assets/CardBaseEntity/AD1/Black/Tamer/AD1_023.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:4676bb81350546a4861c4ca7eb7bfbf99bad53a770ba386ff74900fc497667cb
-size 1588
+oid sha256:cee5cef821235360a8aa2eedf8ea796b7e3eb86a6c3eb33b344209b09f3342c3
+size 1585

+ 2 - 2
Assets/CardBaseEntity/AD1/Black/Tamer/AD1_023_P1.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:5521d5bca62251045eea1e3c9e82067be25ce9f0a9ec9da8a01c6ab8d63caf46
-size 1594
+oid sha256:c7908917b255cec9c154e14c1c94d7d9dcd7bb150afbe42a2db43dc760a3327f
+size 1591

+ 2 - 2
Assets/CardBaseEntity/AD1/Blue/Tamer/AD1_020.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:f92ca68dce5c3ff40acb3501b1746e8eff1802a266bd029399b934b0535be0e3
-size 1568
+oid sha256:d26a4929abfe1690b9d548f1de494523b6b4c44f8f513d1a55a01cf211f0d37c
+size 1565

+ 2 - 2
Assets/CardBaseEntity/AD1/Blue/Tamer/AD1_020_P1.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:a41f146bd9f6385022c67e43a100738bb111c0abe82fbddc8f2fcfc90af86df2
-size 1574
+oid sha256:65c9deace4d98df0271d72bc9ea0314c38d35f811e2843dc8ea35044e975446b
+size 1571

+ 2 - 2
Assets/Scripts/CardEffect/AD1/Blue/AD1_012.cs

@@ -3,7 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
-// CresGararumon
+// CresGarurumon
 namespace DCGO.CardEffects.AD1
 {
     public class AD1_012 : CEntity_Effect
@@ -252,7 +252,7 @@ namespace DCGO.CardEffects.AD1
                         mode: SelectPermanentEffect.Mode.Custom,
                         cardEffect: activateClass);
 
-                    selectPermanentEffect.SetUpCustomMessage("Select 1 Greymon to unsuspend with this card.", "The opponent is selecting 1 Digimon to unsuspend.");
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to change the attack target to.", "The opponent is selecting 1 Digimon to change the attack target to.");
 
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 

+ 3 - 2
Assets/Scripts/CardEffect/AD1/Blue/AD1_014.cs

@@ -3,7 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
-// MetalGararumon
+// MetalGarurumon
 namespace DCGO.CardEffects.AD1
 {
     public class AD1_014 : CEntity_Effect
@@ -256,7 +256,8 @@ namespace DCGO.CardEffects.AD1
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleArea(card);
+                    return CardEffectCommons.IsExistOnBattleArea(card)
+                        && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 2 - 2
Assets/Scripts/CardEffect/AD1/Purple/AD1_018.cs

@@ -23,7 +23,7 @@ namespace DCGO.CardEffects.AD1
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.HasMatchConditionPermanent(WouldPlayCondition);
+                    return CardEffectCommons.HasMatchConditionOwnersPermanent(card, WouldPlayCondition);
                 }
 
                 bool WouldPlayCondition(Permanent permanent)
@@ -112,7 +112,6 @@ namespace DCGO.CardEffects.AD1
             }
             #endregion
                 
-
             #region On Play
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
@@ -215,6 +214,7 @@ namespace DCGO.CardEffects.AD1
                 activateClass.SetUpICardEffect("<De-Digivolve 1> 1 enemy Digimon, delete 1 enemy Digimon with play cost of 3 or less", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 activateClass.SetIsSecurityEffect(true);
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()

+ 12 - 47
Assets/Scripts/CardEffect/AD1/Red/AD1_002.cs

@@ -94,15 +94,21 @@ namespace DCGO.CardEffects.AD1
             #endregion
 
             #region Shared EoA/OD
-            string SharedEffectName()
-            {
-                return "May trash 1 [Hybrid]/[Ten Warriors] card, if so <Draw 2>, then may play 1 R/U/G tamer with inherits from hand or trash for free";
-            }
+            string SharedEffectName = "May trash 1 [Hybrid]/[Ten Warriors] card, if so <Draw 2>, then may play 1 R/U/G tamer with inherits from hand or trash for free";
+
+            CardEffectFactory.ActivateClassesForSharedEffects
+                (ref cardEffects, timing, card,
+                    SharedEffectName,
+                    SharedActivateCoroutine,
+                    SharedEffectDescription,
+                    optional: false,
+                    endOfAttack: true,
+                    onDeletion: true);
 
             string SharedEffectDescription(string tag)
             {
                 return $"[{tag}] You may trash 1 [Hybrid] or [Ten Warriors] trait card from your hand. If this effect trashed, <Draw 2>. Then, you may play 1 red, blue or green Tamer card with inherited effects from your hand or trash without paying the cost.";
-            }
+            }        
 
             bool CanSelectTrashCondition(CardSource cardSource)
             {
@@ -238,48 +244,7 @@ namespace DCGO.CardEffects.AD1
                     }
                 }
             }
-            #endregion
-
-            #region End of Attack
-            if (timing == EffectTiming.OnEndAttack)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, hashtable => SharedActivateCoroutine(hashtable, activateClass), -1, false, SharedEffectDescription("End of Attack"));
-                cardEffects.Add(activateClass);
-
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                        && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
-                }
-
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
-                }
-            }
-            #endregion
-
-            #region On Deletion
-            if (timing == EffectTiming.OnDestroyedAnyone)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, hashtable => SharedActivateCoroutine(hashtable, activateClass), -1, false, SharedEffectDescription("On Deletion"));
-                cardEffects.Add(activateClass);
-
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
-                }
-
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.CanActivateOnDeletion(card);
-                }
-            }
-            #endregion
+            #endregion         
 
             #region Your Turn - ESS
             if (timing == EffectTiming.None)

+ 28 - 67
Assets/Scripts/CardEffect/AD1/Yellow/AD1_015.cs

@@ -40,11 +40,18 @@ namespace DCGO.CardEffects.AD1
             #region DPReduction WD / WA / WA ESS
 
             string DPReductionEffectName = "Give 1 Opponent's digimon -4k DP";
+            
+            CardEffectFactory.ActivateClassesForSharedEffects
+                (ref cardEffects, timing, card,
+                    DPReductionEffectName,
+                    DPReductionActivateCoroutine,
+                    DPReductionEffectDescription,
+                    optional: false,
+                    whenDigivolving: true,
+                    whenAttacking: true);
 
             string DPReductionEffectDescription(string tag) => $"[{tag}] 1 of your opponent's Digimon gets -4000 DP for the turn.";
 
-            bool DPReductionCanActivateCondition(Hashtable hashtable) => CardEffectCommons.IsExistOnBattleArea(card);
-
             bool IsEnemyDigimon(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
 
             IEnumerator DPReductionActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
@@ -76,53 +83,26 @@ namespace DCGO.CardEffects.AD1
                     }
                 }
             }
-            #endregion
-
-            #region When Digivolving
-            if (timing == EffectTiming.OnEnterFieldAnyone)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect(DPReductionEffectName, CanUseCondition, card);
-                activateClass.SetUpActivateClass(DPReductionCanActivateCondition, hash => DPReductionActivateCoroutine(hash, activateClass), -1, false, DPReductionEffectDescription("When Digivolving"));
-                cardEffects.Add(activateClass);
+            #endregion        
 
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                        && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
-                }
-            }
-            #endregion
-
-            #region When Attacking
+            #region When Attacking - ESS
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect(DPReductionEffectName, CanUseCondition, card);
-                activateClass.SetUpActivateClass(DPReductionCanActivateCondition, hash => DPReductionActivateCoroutine(hash, activateClass), -1, false, DPReductionEffectDescription("When Attacking"));
+                activateClass.SetUpActivateClass(CanActivateCondition, hash => DPReductionActivateCoroutine(hash, activateClass), -1, false, DPReductionEffectDescription("When Attacking"));
+                activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                    return CardEffectCommons.IsExistOnBattleArea(card)
                         && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
                 }
-            }
-            #endregion
-
-            #region When Attacking - ESS
-            if (timing == EffectTiming.OnAllyAttack)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect(DPReductionEffectName, CanUseCondition, card);
-                activateClass.SetUpActivateClass(DPReductionCanActivateCondition, hash => DPReductionActivateCoroutine(hash, activateClass), -1, false, DPReductionEffectDescription("When Attacking"));
-                activateClass.SetIsInheritedEffect(true);
-                cardEffects.Add(activateClass);
 
-                bool CanUseCondition(Hashtable hashtable)
+                bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                        && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleArea(card);
                 }
             }
             #endregion
@@ -131,6 +111,16 @@ namespace DCGO.CardEffects.AD1
 
             string PlayTamerEffectName = "You may play 1 Yellow / Black / Purple Tamer with inherited effects, then by placing a hybrid card under a tamer: draw 2";
 
+            CardEffectFactory.ActivateClassesForSharedEffects
+                (ref cardEffects, timing, card,
+                    PlayTamerEffectName,
+                    PlayTamerActivateCoroutine,
+                    PlayTamerEffectDescription,
+                    additionalActivateCondition: PlayTamerCanActivateCondition,
+                    optional: false,
+                    endOfAttack: true,
+                    onDeletion: true);
+
             string PlayTamerEffectDescription(string tag) => $"[{tag}] You may play 1 yellow, black or purple Tamer card with inherited effects from your hand or trash without paying the cost. Then, by placing 1 [Hybrid] or [Ten Warriors] trait card from your hand under this Digimon or your Tamers, <Draw 2>.";
 
             bool CanPlayTamerCondition(CardSource cardSource)
@@ -152,10 +142,9 @@ namespace DCGO.CardEffects.AD1
 
             bool PlayTamerCanActivateCondition(Hashtable hashtable)
             {
-                return CardEffectCommons.IsExistOnBattleArea(card)
-                    && (CardEffectCommons.HasMatchConditionOwnersHand(card, CanPlayTamerCondition)
+                return CardEffectCommons.HasMatchConditionOwnersHand(card, CanPlayTamerCondition)
                         || CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanPlayTamerCondition)
-                        || CardEffectCommons.HasMatchConditionOwnersHand(card, CanPlaceCardCondition));
+                        || CardEffectCommons.HasMatchConditionOwnersHand(card, CanPlaceCardCondition);
             }
 
             IEnumerator PlayTamerActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
@@ -337,34 +326,6 @@ namespace DCGO.CardEffects.AD1
             }
             #endregion
 
-            #region End of Attack
-            if (timing == EffectTiming.OnEndAttack)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect(PlayTamerEffectName, CanUseCondition, card);
-                activateClass.SetUpActivateClass(PlayTamerCanActivateCondition, hash => PlayTamerActivateCoroutine(hash, activateClass), -1, false, PlayTamerEffectDescription("End of Attack"));
-                cardEffects.Add(activateClass);
-
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                        && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
-                }
-            }
-            #endregion
-
-            #region On deletion
-            if (timing == EffectTiming.OnDestroyedAnyone)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect(PlayTamerEffectName, CanUseCondition, card);
-                activateClass.SetUpActivateClass(PlayTamerCanActivateCondition, hash => PlayTamerActivateCoroutine(hash, activateClass), -1, false, PlayTamerEffectDescription("On Deletion"));
-                cardEffects.Add(activateClass);
-
-                bool CanUseCondition(Hashtable hashtable) => CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
-            }
-            #endregion
-
             return cardEffects;
         }
     }

+ 1 - 0
Assets/Scripts/CardEffect/AD1/Yellow/AD1_017.cs

@@ -209,6 +209,7 @@ namespace DCGO.CardEffects.AD1
                 activateClass.SetUpICardEffect("Give 1 enemy Digimon <Sec A. -1>, -3K DP 1 enemy Digimon until end of your turn", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 activateClass.SetIsSecurityEffect(true);
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()

+ 5 - 41
Assets/Scripts/CardEffect/BT16/Black/BT16_063.cs

@@ -130,49 +130,13 @@ namespace DCGO.CardEffects.BT16
 
                     if (selectedPermanent != null)
                     {
-                        CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
-                        canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effect", CanUseUnaffectedCondition, card);
-                        canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardUnaffectedCondition, SkillCondition: SkillCondition);
-                        selectedPermanent.UntilOpponentTurnEndEffects.Add((_timing) => canNotAffectedClass);
+                        #region Give Digimon Effect Immunity
 
-                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateBuffEffect(selectedPermanent));
-
-                        bool CanUseUnaffectedCondition(Hashtable hashtable)
-                        {
-                            return CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent);
-                        }
-
-                        bool CardUnaffectedCondition(CardSource cardSource)
-                        {
-                            if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
-                            {
-                                if (cardSource == selectedPermanent.TopCard)
-                                {
-                                    return true;
-                                }
-                            }
+                        selectedPermanent.UntilOpponentTurnEndEffects.Add((_timing) => PermanentEffectFactory.DigimonEffectImmunity(selectedPermanent));
 
-                            return false;
-                        }
-
-                        bool SkillCondition(ICardEffect cardEffect)
-                        {
-                            if (cardEffect != null)
-                            {
-                                if (cardEffect.EffectSourceCard != null)
-                                {
-                                    if (cardEffect.EffectSourceCard.Owner == card.Owner.Enemy)
-                                    {
-                                        if (cardEffect.IsDigimonEffect)
-                                        {
-                                            return true;
-                                        }
-                                    }
-                                }
-                            }
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateBuffEffect(selectedPermanent));
 
-                            return false;
-                        }
+                        #endregion
                     }
 
                     if (CardEffectCommons.IsJogress(hashtable))
@@ -262,4 +226,4 @@ namespace DCGO.CardEffects.BT16
             return cardEffects;
         }
     }
-}
+}

+ 2 - 2
Assets/Scripts/CardEffect/BT17/Blue/BT17_022.cs

@@ -17,7 +17,7 @@ namespace DCGO.CardEffects.BT17
             {
                 bool Condition()
                 {
-                    return card.Owner.HandCards.Contains(card);
+                    return true;
                 }
 
                 bool PermanentCondition(Permanent targetPermanent)
@@ -227,4 +227,4 @@ namespace DCGO.CardEffects.BT17
             return cardEffects;
         }
     }
-}
+}

+ 1 - 1
Assets/Scripts/CardEffect/BT21/Black/BT21_058.cs

@@ -14,7 +14,7 @@ namespace DCGO.CardEffects.BT21
 
             #region OP/WD Shared
 
-            string SharedEffectName = "Trash 1 Digimon sources. 2 Digimon or Tamers can't Suspend or Activate When Digivolving";
+            string SharedEffectName = "Reveal 3, add 1 [Vemmon] in text, trash rest, place up to 2 [Vemmon] from trash under 1 Digimon.";
 
             string SharedEffectDescription(string tag) => $"[{tag}] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
 

+ 121 - 29
Assets/Scripts/CardEffect/BT24/Blue/BT24_090.cs

@@ -36,6 +36,7 @@ namespace DCGO.CardEffects.BT24
 
             #region All Turns - Security
 
+            #region Blocker
             if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent permanent)
@@ -45,56 +46,147 @@ namespace DCGO.CardEffects.BT24
                         && permanent.TopCard.HasTSTraits;
                 }
 
-                #region Blocker
                 bool CanUseCondition()
                 {
                     return CardEffectCommons.IsExistInSecurity(card, false);
                 }
 
                 cardEffects.Add(CardEffectFactory.BlockerStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: false, card: card, condition: CanUseCondition));
-                #endregion
-
-                #region Alliance
-                AddSkillClass addSkillClass1 = new AddSkillClass();
-                addSkillClass1.SetUpICardEffect("Your Digimon gain <Alliance>", CanUseCondition1, card);
-                addSkillClass1.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects1);
-                cardEffects.Add(addSkillClass1);
+                
+            }
+            #endregion
 
-                bool CardSourceCondition(CardSource cardSource)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(cardSource) &&
-                           cardSource == cardSource.PermanentOfThisCard().TopCard &&
-                           PermanentCondition(cardSource.PermanentOfThisCard());
-                }
+            #region Alliance
 
-                bool CanUseCondition1(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistInSecurity(card, false) &&
-                           CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasOXII);
-                }
+            string GrantedAllianceHashstring(CardSource cardSource) => $"BT24_090_Alliance_On_{cardSource.CardIndex}_From_{card.CardIndex}";//Get unique reference of this card granting to particular cardsource
 
+            /// Alliance effect which is granted to all of your Digimon while this card is face up in security
+            /// The effect itself tracks if the card granting it is still present and if the conditions for granting are still met
+            ICardEffect GetAllianceEffect(CardSource cardSource)
+            {
                 bool HasOXII(Permanent permanent)
                 {
                     return permanent.TopCard.EqualsCardName("Neptunemon")
                         || permanent.TopCard.EqualsCardName("Venusmon");
                 }
 
-                List<ICardEffect> GetEffects1(CardSource cardSource, List<ICardEffect> effects, EffectTiming effectTiming)
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false) //Is this card that provides the effect still providing the effect
+                        && cardSource == cardSource.PermanentOfThisCard().TopCard //Added effects don't check if it is inherited or not so have to check that this is the topcard
+                        && (cardSource.CardColors.Contains(CardColor.Blue) || cardSource.CardColors.Contains(CardColor.Yellow))
+                        && cardSource.HasTSTraits // Does this card meet conditions
+                        && CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasOXII); // Is the condition for granting met
+                }
+
+                ICardEffect cardEffect = CardEffectFactory.AllianceSelfEffect(false, cardSource, Condition);
+                cardEffect.SetHashString(GrantedAllianceHashstring(cardSource)); // Unique identifier using exact card object references
+                return cardEffect;
+            }
+
+            ///Grant all cards in a permanent the effect permanently
+            ///Grants to every card so effect can survive through degeneration
+            ///The effect's CanUseCondition will deactivate when the conditions for granting are not met
+            void GrantEffect(List<Permanent> permanents)
+            {
+                foreach (Permanent permanent in permanents)
                 {
-                    if (effectTiming == EffectTiming.OnAllyAttack)
+                    foreach(CardSource cardSource in permanent.cardSources)
                     {
-                        bool Condition()
-                        {
-                            return CardSourceCondition(cardSource);
-                        }
+                        if(!cardSource.HasDP || permanent.EffectList_ForCard(EffectTiming.OnAllyAttack, cardSource).Any(effect => effect.HashString == GrantedAllianceHashstring(cardSource)))
+                            continue; // if the card could not be a relevant top card or if it already has the effect, don't grant the effect
 
-                        effects.Add(CardEffectFactory.AllianceSelfEffect(false, cardSource, Condition));
+                        Func<EffectTiming, ICardEffect> getCardEffect = CardEffectCommons.GetCardEffectByEffectTiming(timing: EffectTiming.OnAllyAttack, cardEffect: GetAllianceEffect(cardSource));
+
+                        permanent.PermanentEffects.Add(getCardEffect);
                     }
+                }
+            }
+
+            string SharedEffectDescription() => "(Security) [All Turns] All of your blue or yellow [TS] trait Digimon gain <Blocker>. While you have [Neptunemon] or [Venusmon], all of your blue or yellow [TS] trait Digimon gain <Alliance>."; 
+
+            bool IsYourPermanent(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card);
+
+            #region Give permanents conditional Alliance on card added to security
+            if (timing == EffectTiming.OnAddSecurity)
+            {
+                ActivateClass activateClass = new();
+                activateClass.SetUpICardEffect("Set Up Alliance", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription());
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false)
+                        && CardEffectCommons.GetCardSourcesFromHashtable(hashtable).Contains(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanents = card.Owner.GetBattleAreaPermanents();
+                    GrantEffect(permanents);
+                    yield return null;
+                }
+            }
+            #endregion
+
+            #region Give permanents conditional Alliance on permanent enter
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new();
+                activateClass.SetUpICardEffect("Set Up Alliance", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription());
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false)
+                        && (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, IsYourPermanent)
+                            || CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, IsYourPermanent));
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanents = CardEffectCommons.GetHashtablesFromHashtable(hashtable)
+                            .Map(CardEffectCommons.GetPermanentFromHashtable)
+                            .Filter(IsYourPermanent);
+                    GrantEffect(permanents);
+                    yield return null;
+                }
+            }
+            #endregion
+
+            #region Give permanents conditional Alliance on card added to permanent stack
+            if(timing == EffectTiming.OnAddDigivolutionCards)
+            {
+                ActivateClass activateClass = new();
+                activateClass.SetUpICardEffect("Set Up Alliance", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription());
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
 
-                    return effects;
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false)
+                        && CardEffectCommons.CanTriggerOnAddDigivolutionCard(
+                                hashtable: hashtable,
+                                permanentCondition: IsYourPermanent,
+                                cardEffectCondition: null,
+                                cardCondition: null);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanents = new List<Permanent>() { CardEffectCommons.GetPermanentFromHashtable(hashtable) };
+                    GrantEffect(permanents);
+                    yield return null;
                 }
-                #endregion
             }
+            #endregion
+
+            #endregion
 
             #endregion
 
@@ -376,4 +468,4 @@ namespace DCGO.CardEffects.BT24
             return cardEffects;
         }
     }
-}
+}

+ 115 - 27
Assets/Scripts/CardEffect/BT24/Green/BT24_094.cs

@@ -34,7 +34,7 @@ namespace DCGO.CardEffects.BT24
 
             #endregion
 
-            #region All Turns - Security
+            #region All Turns - Security DP
 
             if (timing == EffectTiming.None)
             {
@@ -59,49 +59,137 @@ namespace DCGO.CardEffects.BT24
                     condition: CanUseCondition,
                     effectName: () => "All of your green or yellow [TS] trait Digimon get +2000 DP."));
                 #endregion
+            }
 
-                #region Alliance
-                AddSkillClass addSkillClass1 = new AddSkillClass();
-                addSkillClass1.SetUpICardEffect("Your Digimon gain <Alliance>", CanUseCondition1, card);
-                addSkillClass1.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects1);
-                cardEffects.Add(addSkillClass1);
+            #region All Turns - Security Alliance
+            string GrantedAllianceHashstring(CardSource cardSource) => $"BT24_090_Alliance_On_{cardSource.CardIndex}_From_{card.CardIndex}";//Get unique reference of this card granting to particular cardsource
 
-                bool CanUseCondition1(Hashtable hashtable)
+            /// Alliance effect which is granted to all of your Digimon while this card is face up in security
+            /// The effect itself tracks if the card granting it is still present and if the conditions for granting are still met
+            ICardEffect GetAllianceEffect(CardSource cardSource)
+            {
+                bool HasOXII(Permanent permanent)
                 {
-                    return CardEffectCommons.IsExistInSecurity(card, false) &&
-                           CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasOXII);
+                    return permanent.TopCard.EqualsCardName("Merukimon")
+                        || permanent.TopCard.EqualsCardName("Minervamon");
                 }
 
-                bool CardSourceCondition(CardSource cardSource)
+                bool Condition()
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(cardSource) &&
-                           cardSource == cardSource.PermanentOfThisCard().TopCard &&
-                           PermanentCondition(cardSource.PermanentOfThisCard());
+                    return CardEffectCommons.IsExistInSecurity(card, false) //Is this card that provides the effect still providing the effect
+                        && cardSource == cardSource.PermanentOfThisCard().TopCard //Added effects don't check if it is inherited or not so have to check that this is the topcard
+                        && (cardSource.CardColors.Contains(CardColor.Blue) || cardSource.CardColors.Contains(CardColor.Yellow))
+                        && cardSource.HasTSTraits // Does this card meet conditions
+                        && CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasOXII); // Is the condition for granting met
                 }
 
-                bool HasOXII(Permanent permanent)
-                {
-                    return permanent.TopCard.EqualsCardName("Merukimon")
-                        || permanent.TopCard.EqualsCardName("Minervamon");
-                }
+                ICardEffect cardEffect = CardEffectFactory.AllianceSelfEffect(false, cardSource, Condition);
+                cardEffect.SetHashString(GrantedAllianceHashstring(cardSource)); // Unique identifier using exact card object references
+                return cardEffect;
+            }
 
-                List<ICardEffect> GetEffects1(CardSource cardSource, List<ICardEffect> effects, EffectTiming effectTiming)
+            ///Grant all cards in a permanent the effect permanently
+            ///Grants to every card so effect can survive through degeneration
+            ///The effect's CanUseCondition will deactivate when the conditions for granting are not met
+            void GrantEffect(List<Permanent> permanents)
+            {
+                foreach (Permanent permanent in permanents)
                 {
-                    if (effectTiming == EffectTiming.OnAllyAttack)
+                    foreach (CardSource cardSource in permanent.cardSources)
                     {
-                        bool Condition()
-                        {
-                            return CardSourceCondition(cardSource);
-                        }
+                        if (!cardSource.HasDP || permanent.EffectList_ForCard(EffectTiming.OnAllyAttack, cardSource).Any(effect => effect.HashString == GrantedAllianceHashstring(cardSource)))
+                            continue; // if the card could not be a relevant top card or if it already has the effect, don't grant the effect
 
-                        effects.Add(CardEffectFactory.AllianceSelfEffect(false, cardSource, Condition));
+                        Func<EffectTiming, ICardEffect> getCardEffect = CardEffectCommons.GetCardEffectByEffectTiming(timing: EffectTiming.OnAllyAttack, cardEffect: GetAllianceEffect(cardSource));
+
+                        permanent.PermanentEffects.Add(getCardEffect);
                     }
+                }
+            }
+
+            string SharedEffectDescription() => "(Security) [All Turns] All of your blue or yellow [TS] trait Digimon gain <Blocker>. While you have [Neptunemon] or [Venusmon], all of your blue or yellow [TS] trait Digimon gain <Alliance>.";
+
+            bool IsYourPermanent(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card);
+
+            #region Give permanents conditional Alliance on card added to security
+            if (timing == EffectTiming.OnAddSecurity)
+            {
+                ActivateClass activateClass = new();
+                activateClass.SetUpICardEffect("Set Up Alliance", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription());
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
 
-                    return effects;
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false)
+                        && CardEffectCommons.GetCardSourcesFromHashtable(hashtable).Contains(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanents = card.Owner.GetBattleAreaPermanents();
+                    GrantEffect(permanents);
+                    yield return null;
+                }
+            }
+            #endregion
+
+            #region Give permanents conditional Alliance on permanent enter
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new();
+                activateClass.SetUpICardEffect("Set Up Alliance", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription());
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false)
+                        && (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, IsYourPermanent)
+                            || CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, IsYourPermanent));
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanents = CardEffectCommons.GetHashtablesFromHashtable(hashtable)
+                            .Map(CardEffectCommons.GetPermanentFromHashtable)
+                            .Filter(IsYourPermanent);
+                    GrantEffect(permanents);
+                    yield return null;
                 }
-                #endregion
             }
+            #endregion
+
+            #region Give permanents conditional Alliance on card added to permanent stack
+            if (timing == EffectTiming.OnAddDigivolutionCards)
+            {
+                ActivateClass activateClass = new();
+                activateClass.SetUpICardEffect("Set Up Alliance", CanUseCondition, card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription());
+                activateClass.SetIsBackgroundProcess(true);
+                cardEffects.Add(activateClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false)
+                        && CardEffectCommons.CanTriggerOnAddDigivolutionCard(
+                                hashtable: hashtable,
+                                permanentCondition: IsYourPermanent,
+                                cardEffectCondition: null,
+                                cardCondition: null);
+                }
 
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> permanents = new List<Permanent>() { CardEffectCommons.GetPermanentFromHashtable(hashtable) };
+                    GrantEffect(permanents);
+                    yield return null;
+                }
+            }
+            #endregion
+            #endregion
             #endregion
 
             #region Main Effect

+ 11 - 18
Assets/Scripts/CardEffect/BT7/Yellow/BT7_032.cs

@@ -1,11 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
-using System.Linq;
-using Photon;
-using System;
-using Photon.Pun;
 
+// Pulsemon
 public class BT7_032 : CEntity_Effect
 {
     public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
@@ -15,8 +11,9 @@ public class BT7_032 : CEntity_Effect
         if (timing == EffectTiming.OnAllyAttack)
         {
             ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect("Memory +2", CanUseCondition, card);
-            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+            activateClass.SetUpICardEffect("If you have 3 security cards, gain 2 memory", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+            activateClass.SetIsOptionalOverride(_ => card.Owner.SecurityCards.Count != 3);//Effect is optional while you do not have 3 mem to whiff
             activateClass.SetIsInheritedEffect(true);
             activateClass.SetHashString("Memory+2_BT7_032");
             cardEffects.Add(activateClass);
@@ -28,25 +25,21 @@ public class BT7_032 : CEntity_Effect
 
             bool CanUseCondition(Hashtable hashtable)
             {
-                return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                return CardEffectCommons.IsExistOnBattleArea(card)
+                    && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
             }
 
             bool CanActivateCondition(Hashtable hashtable)
             {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
-                {
-                    if (card.Owner.SecurityCards.Count == 3)
-                    {
-                        return true;
-                    }
-                }
-
-                return false;
+                return CardEffectCommons.IsExistOnBattleArea(card);
             }
 
             IEnumerator ActivateCoroutine(Hashtable _hashtable)
             {
-                yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(2, activateClass));
+                if (card.Owner.SecurityCards.Count == 3)
+                { 
+                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(2, activateClass));
+                }
             }
         }
 

+ 2 - 2
Assets/Scripts/CardEffect/EX11/Black/EX11_066.cs

@@ -41,7 +41,7 @@ namespace DCGO.CardEffects.EX11
 
             #region Shared OP / SOYMP
 
-            string SharedEffectName = "Trash 1 Vemmon in text to Draw 1, Gain 1 Memory";
+            string SharedEffectName = "Trash 1 [Vemmon] in text to <Draw 1> and gain 1 memory";
 
             string SharedEffectDescription(string tag) => $"[{tag}] By trashing 1 card with [Vemmon] in its text from your hand, <Draw 1> and gain 1 memory.";
 
@@ -134,7 +134,7 @@ namespace DCGO.CardEffects.EX11
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Reveal 2. Place All Vemmon under played or Digivolved digimon, trash the rest.", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Reveal 2. Place all [Vemmon] under played or digivolved digimon, trash the rest.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 

+ 2 - 2
Assets/Scripts/CardEffect/EX9/Yellow/EX9_032.cs

@@ -31,7 +31,7 @@ namespace DCGO.CardEffects.EX9
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("By Deleting a token or [Puppet] digimon, digivolve into a [puppet] in hand", CanUseCondition, card);
+                activateClass.SetUpICardEffect("By deleting a token or [Puppet] digimon, digivolve into a [Puppet] in hand", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -324,4 +324,4 @@ namespace DCGO.CardEffects.EX9
             return cardEffects;
         }
     }
-}
+}

+ 3 - 3
Assets/Scripts/CardEffect/P/Purple/P_096.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
@@ -131,7 +131,7 @@ namespace DCGO.CardEffects.P
 
                         bool canSelect() => (canSelectTamer() || canSelectTrash()) && maxSelectCardCount() >= 1;
 
-                        while (canSelect())
+                        while (canSelect() && digivolutionCards.Count <2)
                         {
                             bool fromTrash = false;
                             bool noSelect = false;
@@ -490,4 +490,4 @@ namespace DCGO.CardEffects.P
             return cardEffects;
         }
     }
-}
+}

+ 2 - 1
Assets/Scripts/CardEffect/P/White/P_206.cs

@@ -251,6 +251,7 @@ namespace DCGO.CardEffects.P
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("you may play 1 3 cost or less digimon from hand or trash, then add this card to hand", CanUseCondition, card);
                 activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
+                activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()
@@ -386,4 +387,4 @@ namespace DCGO.CardEffects.P
             return cardEffects;
         }
     }
-}
+}

+ 8 - 0
Assets/Scripts/CardEffect/ST23/Yellow.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d4b34529b5811d2499cf5c4c90275a03
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 196 - 0
Assets/Scripts/CardEffect/ST23/Yellow/ST23_05.cs

@@ -0,0 +1,196 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+// Habakirimon
+namespace DCGO.CardEffects.ST23
+{
+    public class ST23_05 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Digivolution Condition
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsTraits("Glowing Dawn");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 5, permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region shared WD / WA
+
+            string SharedHashString = "ST23_05_WD_WA";
+
+            string SharedEffectName = "Place 1 opponent's lowest DP Digimon on top of security. Then may trash top security from the player with most security to Recover +1";
+
+            string SharedEffectDescription(string tag) => $"[{tag}] [Once Per Turn] Place 1 of your opponent's lowest DP Digimon as the top security card. Then, by trashing the top security card of 1 player with the most security cards, <Recovery +1>.";
+
+            CardEffectFactory.ActivateClassesForSharedEffects(ref cardEffects, timing, card,
+                                                              SharedEffectName,
+                                                              SharedActivateCoroutine,
+                                                              SharedEffectDescription,
+                                                              false,
+                                                              isOptionalFunction: IsOptional,
+                                                              maxCountPerTurn: 1,
+                                                              hashValue: SharedHashString,
+                                                              whenDigivolving: true,
+                                                              whenAttacking: true
+                                                              );
+
+            bool IsOptional(Hashtable hashtable) => !CardEffectCommons.HasMatchConditionPermanent(IsWeakestEnemyDigimon);
+
+            bool IsWeakestEnemyDigimon(Permanent permanent) => CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy);
+
+            IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
+            {
+                if (card.Owner.CanAddSecurity(activateClass))
+                {
+                    int validTargets = CardEffectCommons.MatchConditionOpponentsPermanentCount(card, IsWeakestEnemyDigimon);
+                    if (validTargets == 1)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(
+                                card.Owner.Enemy.GetBattleAreaDigimons().Filter(IsWeakestEnemyDigimon).FirstOrDefault(), 
+                                CardEffectCommons.CardEffectHashtable(activateClass), true, false).PutSecurity());
+                    }
+                    else if (validTargets > 1)
+                    {
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+    
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsWeakestEnemyDigimon,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.PutSecurityTop,
+                            cardEffect: activateClass);
+    
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to place in security.", "The opponent is selecting 1 Digimon to place in security.");
+    
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+                }
+                bool validOwnerSecurity = card.Owner.SecurityCards.Count > 0 && card.Owner.SecurityCards.Count >= card.Owner.Enemy.SecurityCards.Count;
+                bool validEnemySecurity = card.Owner.Enemy.SecurityCards.Count > 0 && card.Owner.Enemy.SecurityCards.Count >= card.Owner.SecurityCards.Count;
+
+                if (validOwnerSecurity || validEnemySecurity)
+                {
+                    List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>();
+                    if (validOwnerSecurity)
+                    {
+                        selectionElements.Add(new (message: $"Trash your own top security card", value : 1, spriteIndex: 0));
+                    }
+                    if (validEnemySecurity)
+                    {
+                        selectionElements.Add(new (message: $"Trash your opponent's top security card", value : 2, spriteIndex: 0));
+                    }
+                    selectionElements.Add( new (message: $"Don't trash security", value: 3, spriteIndex: 1));
+
+                    string selectPlayerMessage = "Will you trash 1 player's security to <Recover +1>?";
+                    string notSelectPlayerMessage = "The opponent is choosing if they will trash a security.";
+
+                    GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                    bool doTrash = GManager.instance.userSelectionManager.SelectedIntValue != 3;
+                    bool ownSecurity = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                    if (doTrash)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashSecurityAndProcessAccordingToResult(
+                            player: ownSecurity ? card.Owner : card.Owner.Enemy,
+                            trashAmount: 1,
+                            activateClass: activateClass,
+                            fromTop: true,
+                            successProcess: SuccessProcess,
+                            failureProcess: null
+                        ));
+
+                        IEnumerator SuccessProcess(List<CardSource> cardSources)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region All Turns Protect Glowing Dawn
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("By trashing top security, card doesn't leave", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetHashString("ST23_15_AT_Protect");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] [Once Per Turn] When any of your [Glowing Dawn] trait Digimon would leave the battle area, by trashing your top security card, they don't leave.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card)
+                        && CardEffectCommons.CanTriggerWhenPermanentRemoveField(hashtable, PermanentCondition);
+                        
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                        && card.Owner.SecurityCards.Count > 0;
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
+                        && permanent.TopCard.EqualsTraits("Glowing Dawn");
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashSecurityAndProcessAccordingToResult(
+                        player: card.Owner,
+                        trashAmount: 1,
+                        activateClass: activateClass,
+                        fromTop: true,
+                        successProcess: SuccessProcess,
+                        failureProcess: null
+                    ));
+
+                    IEnumerator SuccessProcess(List<CardSource> cardSources)
+                    {
+                        List<Permanent> protectedPermanents = CardEffectCommons.GetPermanentsFromHashtable(hashtable)
+                                    .Filter(PermanentCondition);
+
+                        foreach (Permanent permanent in protectedPermanents)
+                        {
+                            permanent.willBeRemoveField = false;
+                            permanent.HideDeleteEffect();
+                            permanent.HideHandBounceEffect();
+                            permanent.HideDeckBounceEffect();
+                            permanent.HideWillRemoveFieldEffect();
+                        }
+
+                        yield return null;
+                    }
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/CardEffect/ST23/Yellow/ST23_05.cs.meta

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

+ 8 - 0
Assets/Scripts/CardEffect/ST24/Blue.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2c44ddfde5ed34d4ab774c91679627ba
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 0
Assets/Scripts/CardEffect/ST24/Blue/ST24_02.cs.meta

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

+ 11 - 0
Assets/Scripts/CardEffect/ST24/Blue/ST24_03.cs.meta

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

+ 8 - 0
Assets/Scripts/CardEffect/ST24/Green.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 44f65b0e1ae6bcb458dbb33731f7af2f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 76 - 0
Assets/Scripts/CardEffect/ST24/Green/ST24_08.cs

@@ -0,0 +1,76 @@
+using System.Collections.Generic;
+
+// Lalamon
+namespace DCGO.CardEffects.ST24
+{
+    public class ST24_08 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alt Digivolution Condition
+
+            if (timing == EffectTiming.None)
+            {
+                static bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return  targetPermanent.TopCard.EqualsTraits("DATA SQUAD");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 2, permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+
+            #endregion
+
+            #region Your Turn - Reduced Digivolution Cost
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent == card.PermanentOfThisCard();
+                }
+
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsTraits("DATA SQUAD");
+                }
+
+                bool RootCondition(SelectCardEffect.Root root)
+                {
+                    return true;
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
+                    changeValue: -1,
+                    permanentCondition: PermanentCondition,
+                    cardCondition: CardSourceCondition,
+                    rootCondition: RootCondition,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: Condition,
+                    setFixedCost: false));
+            }
+            #endregion
+
+            #region Inherited
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/CardEffect/ST24/Green/ST24_08.cs.meta

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

+ 123 - 0
Assets/Scripts/CardEffect/ST24/Green/ST24_09.cs

@@ -0,0 +1,123 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+// Sunflowmon
+namespace DCGO.CardEffects.ST24
+{
+    public class ST24_09 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alt Digivolution Condition
+            if (timing == EffectTiming.None)
+            {
+                static bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsTraits("DATA SQUAD");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 3, permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region Shared OP/WD
+            string SharedEffectName = "May suspend enemy Digimon or Tamer, may place top deck face down under [DATA SQUAD] tamer";
+
+            CardEffectFactory.ActivateClassesForSharedEffects
+                (ref cardEffects, timing, card,
+                    SharedEffectName,
+                    SharedActivateCoroutine,
+                    SharedEffectDescription,
+                    optional: false,
+                    onPlay: true,
+                    whenDigivolving: true);
+
+            string SharedEffectDescription(string tag) => $"[{tag}] You may suspend 1 of your opponent's Digimon or Tamers. Then, you may place the top card of your deck face down under any of your [DATA SQUAD] trait Tamers.";
+
+            bool CanSelectPermanentCondition(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card)
+                    && (permanent.TopCard.IsDigimon
+                        || permanent.TopCard.IsTamer);
+            }
+
+            bool CanSelectOwnDataSquadTamer(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaTamer(permanent, card)
+                    && permanent.TopCard.EqualsTraits("DATA SQUAD");
+            }
+
+            IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
+            {
+                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                selectPermanentEffect.SetUp(
+                    selectPlayer: card.Owner,
+                    canTargetCondition: CanSelectPermanentCondition,
+                    canTargetCondition_ByPreSelecetedList: null,
+                    canEndSelectCondition: null,
+                    maxCount: maxCount,
+                    canNoSelect: true,
+                    canEndNotMax: false,
+                    selectPermanentCoroutine: null,
+                    afterSelectPermanentCoroutine: null,
+                    mode: SelectPermanentEffect.Mode.Tap,
+                    cardEffect: activateClass);
+
+                selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon/Tamer to suspend.", "The opponent is selecting 1 Digimon/Tamer to suspend.");
+
+                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());               
+
+                if (card.Owner.LibraryCards.Count > 1 && CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnDataSquadTamer))
+                {
+                    SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect1.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectOwnDataSquadTamer,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: true,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect1.SetUpCustomMessage("Select 1 [DATA SQUAD] trait Tamer to place the top card of your deck face down under.", "The opponent is selecting 1 [DATA SQUAD] trait Tamer to place the top card of your deck face down under.");
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect1.Activate());
+
+                    IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanent)
+                    {
+                        if (permanent != null)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(permanent[0].AddDigivolutionCardsBottom(
+                                                        new List<CardSource> { card.Owner.LibraryCards[0] }, activateClass, isFacedown: true));
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region Inherited
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/CardEffect/ST24/Green/ST24_09.cs.meta

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

+ 11 - 0
Assets/Scripts/CardEffect/ST24/Yellow/ST24_05.cs.meta

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

+ 85 - 32
Assets/Scripts/Script/CardEffectFactory.cs

@@ -825,6 +825,7 @@ public partial class CardEffectFactory
                                                                     bool optional,
                                                                     Func<Hashtable, bool> additionalUseCondition = null,
                                                                     Func<Hashtable, bool> additionalActivateCondition = null, 
+                                                                    Func<Hashtable, bool> isOptionalFunction = null,
                                                                     int maxCountPerTurn = -1,
                                                                     string hashValue = null,
                                                                     bool whenMoving = false,
@@ -842,51 +843,51 @@ public partial class CardEffectFactory
     {
         if (whenMoving && timing == EffectTiming.OnMove)
         {
-            cardEffects.Add(WhenMovingClass(card, effectName, activateCoroutine, effectDescription("When Moving"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(WhenMovingClass(card, effectName, activateCoroutine, effectDescription("When Moving"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (onPlay && timing == EffectTiming.OnEnterFieldAnyone)
         {
-            cardEffects.Add(OnPlayClass(card, effectName, activateCoroutine, effectDescription("On Play"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(OnPlayClass(card, effectName, activateCoroutine, effectDescription("On Play"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (whenDigivolving && timing == EffectTiming.OnEnterFieldAnyone)
         {
-            cardEffects.Add(WhenDigivolvingClass(card, effectName, activateCoroutine, effectDescription("When Digivolving"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(WhenDigivolvingClass(card, effectName, activateCoroutine, effectDescription("When Digivolving"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (whenAttacking && timing == EffectTiming.OnAllyAttack)
         {
-            cardEffects.Add(WhenAttackingClass(card, effectName, activateCoroutine, effectDescription("When Attacking"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(WhenAttackingClass(card, effectName, activateCoroutine, effectDescription("When Attacking"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (onDeletion && timing == EffectTiming.OnDestroyedAnyone)
         {
-            cardEffects.Add(OnDeletionClass(card, effectName, activateCoroutine, effectDescription("On Deletion"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(OnDeletionClass(card, effectName, activateCoroutine, effectDescription("On Deletion"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (whenLinking && timing == EffectTiming.WhenLinked)
         {
-            cardEffects.Add(WhenLinkingClass(card, effectName, activateCoroutine, effectDescription("When Linking"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(WhenLinkingClass(card, effectName, activateCoroutine, effectDescription("When Linking"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (endOfAttack && timing == EffectTiming.OnEndAttack)
         {
-            cardEffects.Add(EndOfAttackClass(card, effectName, activateCoroutine, effectDescription("End of Attack"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(EndOfAttackClass(card, effectName, activateCoroutine, effectDescription("End of Attack"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (endOfYourTurn && timing == EffectTiming.OnEndTurn)
         {
-            cardEffects.Add(EndOfYourTurnClass(card, effectName, activateCoroutine, effectDescription("End of Your Turn"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(EndOfYourTurnClass(card, effectName, activateCoroutine, effectDescription("End of Your Turn"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (endOfOpponentTurn && timing == EffectTiming.OnEndTurn)
         {
-            cardEffects.Add(EndOfYourOpponentsTurnClass(card, effectName, activateCoroutine, effectDescription("End of Opponent's Turn"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(EndOfYourOpponentsTurnClass(card, effectName, activateCoroutine, effectDescription("End of Opponent's Turn"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (endOfAllTurns && timing == EffectTiming.OnEndTurn)
         {
-            cardEffects.Add(EndOfAllTurnsClass(card, effectName, activateCoroutine, effectDescription("End of All Turns"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(EndOfAllTurnsClass(card, effectName, activateCoroutine, effectDescription("End of All Turns"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if(startOfYourMainPhase && timing == EffectTiming.OnStartMainPhase)
         {
-            cardEffects.Add(StartOfYourMainPhaseClass(card, effectName, activateCoroutine, effectDescription("Start of Your Main Phase"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(StartOfYourMainPhaseClass(card, effectName, activateCoroutine, effectDescription("Start of Your Main Phase"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
         if (counter && timing == EffectTiming.OnCounterTiming)
         {
-            cardEffects.Add(CounterClass(card, effectName, activateCoroutine, effectDescription("Counter"), optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
+            cardEffects.Add(CounterClass(card, effectName, activateCoroutine, effectDescription("Counter"), optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue));
         }
 
         return cardEffects;
@@ -903,6 +904,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 int maxCountPerTurn = -1,
                                                 string hashValue = null,
                                                 bool isInheritedEffect = false,
@@ -915,6 +917,7 @@ public partial class CardEffectFactory
         activateClass.SetUpActivateClass(canActivateCondition, hashtable => activateCoroutine(hashtable, activateClass), maxCountPerTurn, optional, effectDescription);
         activateClass.SetHashString(hashValue);
         activateClass.SetIsSecurityEffect(isSecurityEffect);
+        activateClass.SetIsOptionalOverride(isOptionalFunction);
         return activateClass;
     }
 
@@ -927,13 +930,14 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
                                                 string hashValue = null,
                                                 bool isInherited = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, false);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, false);
 
         bool PermanentCondition(Permanent permanent)
         {
@@ -963,13 +967,14 @@ public partial class CardEffectFactory
                                             Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                             string effectDescription,
                                             bool optional,
+                                            Func<Hashtable, bool> isOptionalFunction = null,
                                             Func<Hashtable, bool> additionalUseCondition = null,
                                             Func<Hashtable, bool> additionalActivateCondition = null,
                                             int maxCountPerTurn = -1,
                                             string hashValue = null,
                                             bool isInherited = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, false);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, false);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -994,6 +999,7 @@ public partial class CardEffectFactory
                                                         Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                         string effectDescription,
                                                         bool optional,
+                                                        Func<Hashtable, bool> isOptionalFunction = null,
                                                         Func<Hashtable, bool> additionalUseCondition = null,
                                                         Func<Hashtable, bool> additionalActivateCondition = null,
                                                         int maxCountPerTurn = -1,
@@ -1001,7 +1007,7 @@ public partial class CardEffectFactory
                                                         bool isInherited = false,
                                                         bool isLinked = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -1025,6 +1031,7 @@ public partial class CardEffectFactory
                                                     Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                     string effectDescription,
                                                     bool optional,
+                                                    Func<Hashtable, bool> isOptionalFunction = null,
                                                     Func<Hashtable, bool> additionalUseCondition = null,
                                                     Func<Hashtable, bool> additionalActivateCondition = null,
                                                     int maxCountPerTurn = -1,
@@ -1032,7 +1039,7 @@ public partial class CardEffectFactory
                                                     bool isInherited = false,
                                                     bool isLinked = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -1057,6 +1064,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1064,7 +1072,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -1089,6 +1097,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1097,7 +1106,7 @@ public partial class CardEffectFactory
                                                 bool isLinked = false
                                                 )
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -1122,10 +1131,11 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null)
     {
-        ActivateClass activateClass = ActivateClass(card, effectName, CanUseCondition, additionalActivateCondition, activateCoroutine, effectDescription, optional, -1, null, false, false);
+        ActivateClass activateClass = ActivateClass(card, effectName, CanUseCondition, additionalActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, -1, null, false, false);
         activateClass.SetIsSecurityEffect(true);
         return activateClass;
 
@@ -1145,6 +1155,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1152,7 +1163,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -1179,6 +1190,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1186,7 +1198,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        ActivateClass activateClass = ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        ActivateClass activateClass = ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
         activateClass.SetIsCounterEffect(true);
         return activateClass;
 
@@ -1219,6 +1231,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1228,7 +1241,7 @@ public partial class CardEffectFactory
                                                 bool yourTurn = false,
                                                 bool opponentTurn = false)
     {
-        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, maxCountPerTurn, hashValue, isInherited, isLinked);
+        return ActivateClass(card, effectName, CanUseCondition, CanActivateCondition, activateCoroutine, effectDescription, optional, isOptionalFunction, maxCountPerTurn, hashValue, isInherited, isLinked);
 
         bool CanUseCondition(Hashtable hashtable)
         {
@@ -1255,6 +1268,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1262,7 +1276,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
     }
 
     public static ActivateClass StartOfYourMainPhaseClass(CardSource card,
@@ -1270,6 +1284,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1277,7 +1292,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
     }
 
     public static ActivateClass EndOfYourTurnClass(CardSource card,
@@ -1285,6 +1300,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1292,7 +1308,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
     }
 
     public static ActivateClass YourTurnClass(CardSource card,
@@ -1300,6 +1316,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1307,7 +1324,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, false);
     }
 
     #endregion
@@ -1319,6 +1336,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1326,7 +1344,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
     }
 
     public static ActivateClass StartOfYourOpponentsMainPhaseClass(CardSource card,
@@ -1334,6 +1352,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1341,7 +1360,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
     }
 
     public static ActivateClass EndOfYourOpponentsTurnClass(CardSource card,
@@ -1349,6 +1368,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1356,7 +1376,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
     }
 
     public static ActivateClass OpponentsTurnClass(CardSource card,
@@ -1364,6 +1384,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1371,7 +1392,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, false, true);
     }
 
     #endregion
@@ -1383,6 +1404,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1390,7 +1412,7 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, true);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, true);
     }
 
     public static ActivateClass AllTurnsClass(CardSource card,
@@ -1398,6 +1420,7 @@ public partial class CardEffectFactory
                                                 Func<Hashtable, ActivateClass, IEnumerator> activateCoroutine,
                                                 string effectDescription,
                                                 bool optional,
+                                                Func<Hashtable, bool> isOptionalFunction = null,
                                                 Func<Hashtable, bool> additionalUseCondition = null,
                                                 Func<Hashtable, bool> additionalActivateCondition = null,
                                                 int maxCountPerTurn = -1,
@@ -1405,8 +1428,38 @@ public partial class CardEffectFactory
                                                 bool isInherited = false,
                                                 bool isLinked = false)
     {
-        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, true);
+        return TurnTimingClass(card, effectName, activateCoroutine, effectDescription, optional, isOptionalFunction, additionalUseCondition, additionalActivateCondition, maxCountPerTurn, hashValue, isInherited, isLinked, true, true);
     }
 
     #endregion
+
+    #region At end of turn lose 3 memory
+    public static ActivateClass EoTLose3Memory(CardSource card)
+    {
+        ActivateClass activateClass1 = new ActivateClass();
+        activateClass1.SetUpICardEffect("Memory -3", CanUseCondition1, card);
+        activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
+        return activateClass1;
+
+        string EffectDiscription1()
+        {
+            return "Lose 3 memory.";
+        }
+
+        bool CanUseCondition1(Hashtable hashtable)
+        {
+            return true;
+        }
+
+        bool CanActivateCondition1(Hashtable hashtable)
+        {
+            return true;
+        }
+
+        IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
+        {
+            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-3, activateClass1));
+        }
+    }
+    #endregion
 }

+ 4 - 1
Assets/Scripts/Script/CardEffects/AddSkillClass.cs

@@ -19,7 +19,10 @@ public class AddSkillClass : ICardEffect, IAddSkillEffect
             getCardEffect = _getEffects(card, getCardEffect, timing);
         }
 
-        SetEffectSourceCard(card);
+        foreach (ICardEffect effect in getCardEffect)
+        {
+            effect.SetEffectSourceCard(card);
+        }
 
         return getCardEffect;
     }

+ 4 - 4
Assets/Scripts/Script/ContinuousController.cs

@@ -350,7 +350,7 @@ public class ContinuousController : MonoBehaviour
             Attribute_ENG = new List<string>(),
             Type_JPN = new List<string>(),
             Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-091-token",
+            CardSpriteName = "BT19-091-token-red",
             cardKind = CardKind.Digimon,
             DP = 6000
         };
@@ -370,7 +370,7 @@ public class ContinuousController : MonoBehaviour
             Attribute_ENG = new List<string>(),
             Type_JPN = new List<string>(),
             Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-091-token",
+            CardSpriteName = "BT19-091-token-yellow",
             cardKind = CardKind.Digimon,
             DP = 6000
         };
@@ -390,7 +390,7 @@ public class ContinuousController : MonoBehaviour
             Attribute_ENG = new List<string>(),
             Type_JPN = new List<string>(),
             Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-091-token",
+            CardSpriteName = "BT19-091-token-green",
             cardKind = CardKind.Digimon,
             DP = 6000
         };
@@ -1626,4 +1626,4 @@ public enum Language
 {
     ENG,
     JPN,
-}
+}

+ 13 - 1
Assets/Scripts/Script/MultipleSkills.cs

@@ -276,13 +276,17 @@ public class MultipleSkills : MonoBehaviourPunCallbacks
                             {
                                 yield return StartCoroutine(GManager.instance.selectCardPanel.OpenSelectCardPanel(
                                 Message: "Multiple effects are triggered.\nChoose which effect to process.",
+                                NotSelectButtonMessage: "Don't activate these effects.",
+                                EndSelectButtonMessage: "End Selection", 
+                                _OnClickNotSelectButtonAction: null, 
+                                _OnClickEndSelectButtonAction: null,
                                 RootCardSources: RootCardSources,
                                 _CanTargetCondition: (cardSource) => true,
                                 _CanTargetCondition_ByPreSelecetedList: null,
                                 _CanEndSelectCondition: null,
                                 _MaxCount: 1,
                                 _CanEndNotMax: false,
-                                _CanNoSelect: () => false,
+                                _CanNoSelect: () => skillInfos_active.All(skillInfo => skillInfo.CardEffect.IsOptional),
                                 CanLookReverseCard: true,
                                 skillInfos: skillInfos_active,
                                 root: SelectCardEffect.Root.None));
@@ -291,6 +295,14 @@ public class MultipleSkills : MonoBehaviourPunCallbacks
                                 {
                                     skillIndex = GManager.instance.selectCardPanel.SelectedIndex[0];
                                 }
+                                else
+                                {
+                                    foreach(SkillInfo skillInfo in skillInfos_active)
+                                    {
+                                        StackedSkillInfos.Remove(skillInfo);
+                                    }
+                                    continue;
+                                }
                             }
 
                             else

+ 73 - 70
Assets/Scripts/Script/SelectJogressEffect.cs

@@ -209,96 +209,75 @@ public class SelectJogressEffect : MonoBehaviour
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, _card))
                     {
-                        if (!selectedEvoRoots.Contains(permanent))
+                        if(!_card.CanNotEvolve(permanent))
                         {
-                            if (element.EvoRootCondition != null)
+                            if (!selectedEvoRoots.Contains(permanent))
                             {
-                                if (element.EvoRootCondition(permanent))
+                                if (element.EvoRootCondition != null)
                                 {
-                                    if (_customPermanentConditions != null)
+                                    if (element.EvoRootCondition(permanent))
                                     {
-                                        if (_customPermanentConditions.Length == 1)
+                                        if (_customPermanentConditions != null)
                                         {
-                                            if (_customPermanentConditions[0] != null)
+                                            if (_customPermanentConditions.Length == 1)
                                             {
-                                                if (_card.Owner.GetBattleAreaDigimons().Count(_customPermanentConditions[0]) >= 1)
+                                                if (_customPermanentConditions[0] != null)
                                                 {
-                                                    if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 0)
+                                                    if (_card.Owner.GetBattleAreaDigimons().Count(_customPermanentConditions[0]) >= 1)
                                                     {
-                                                        if (!_customPermanentConditions[0](permanent))
+                                                        if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 0)
                                                         {
-                                                            if (i == 1)
-                                                            {
-                                                                return false;
-                                                            }
-
-                                                            else
+                                                            if (!_customPermanentConditions[0](permanent))
                                                             {
-                                                                JogressConditionElement element1 = selectedDNA.elements[1];
-
-                                                                if (_card.Owner.GetBattleAreaDigimons().Count((permanent1) => permanent1 != permanent && element1.EvoRootCondition(permanent1) && _customPermanentConditions[0](permanent1)) == 0)
+                                                                if (i == 1)
                                                                 {
                                                                     return false;
                                                                 }
+
+                                                                else
+                                                                {
+                                                                    JogressConditionElement element1 = selectedDNA.elements[1];
+
+                                                                    if (_card.Owner.GetBattleAreaDigimons().Count((permanent1) => permanent1 != permanent && element1.EvoRootCondition(permanent1) && _customPermanentConditions[0](permanent1)) == 0)
+                                                                    {
+                                                                        return false;
+                                                                    }
+                                                                }
                                                             }
                                                         }
                                                     }
-                                                }
 
-                                                else
-                                                {
-                                                    return false;
+                                                    else
+                                                    {
+                                                        return false;
+                                                    }
                                                 }
                                             }
-                                        }
 
-                                        else if (_customPermanentConditions.Length == 2)
-                                        {
-                                            if (_customPermanentConditions[0] != null && _customPermanentConditions[1] != null)
+                                            else if (_customPermanentConditions.Length == 2)
                                             {
-                                                if (_card.Owner.GetBattleAreaDigimons().Count(_customPermanentConditions[0]) >= 1 && _card.Owner.GetBattleAreaDigimons().Count(_customPermanentConditions[1]) >= 1)
+                                                if (_customPermanentConditions[0] != null && _customPermanentConditions[1] != null)
                                                 {
-                                                    if (i == 1)
+                                                    if (_card.Owner.GetBattleAreaDigimons().Count(_customPermanentConditions[0]) >= 1 && _card.Owner.GetBattleAreaDigimons().Count(_customPermanentConditions[1]) >= 1)
                                                     {
-                                                        if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 0 && selectedEvoRoots.Count(_customPermanentConditions[1]) == 0)
-                                                        {
-                                                            return false;
-                                                        }
-
-                                                        if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 0 && selectedEvoRoots.Count(_customPermanentConditions[1]) == 1)
+                                                        if (i == 1)
                                                         {
-                                                            if (!_customPermanentConditions[0](permanent))
+                                                            if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 0 && selectedEvoRoots.Count(_customPermanentConditions[1]) == 0)
                                                             {
                                                                 return false;
                                                             }
-                                                        }
-
-                                                        if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 1 && selectedEvoRoots.Count(_customPermanentConditions[1]) == 0)
-                                                        {
-                                                            if (!_customPermanentConditions[1](permanent))
-                                                            {
-                                                                return false;
-                                                            }
-                                                        }
-                                                    }
 
-                                                    else
-                                                    {
-                                                        if (_customPermanentConditions[0](permanent) || _customPermanentConditions[1](permanent))
-                                                        {
-                                                            JogressConditionElement element1 = selectedDNA.elements[1];
-
-                                                            if (_customPermanentConditions[0](permanent))
+                                                            if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 0 && selectedEvoRoots.Count(_customPermanentConditions[1]) == 1)
                                                             {
-                                                                if (_card.Owner.GetBattleAreaDigimons().Count((permanent1) => permanent1 != permanent && element1.EvoRootCondition(permanent1) && _customPermanentConditions[1](permanent1)) == 0)
+                                                                if (!_customPermanentConditions[0](permanent))
                                                                 {
                                                                     return false;
                                                                 }
                                                             }
 
-                                                            if (_customPermanentConditions[1](permanent))
+                                                            if (selectedEvoRoots.Count(_customPermanentConditions[0]) == 1 && selectedEvoRoots.Count(_customPermanentConditions[1]) == 0)
                                                             {
-                                                                if (_card.Owner.GetBattleAreaDigimons().Count((permanent1) => permanent1 != permanent && element1.EvoRootCondition(permanent1) && _customPermanentConditions[0](permanent1)) == 0)
+                                                                if (!_customPermanentConditions[1](permanent))
                                                                 {
                                                                     return false;
                                                                 }
@@ -307,31 +286,55 @@ public class SelectJogressEffect : MonoBehaviour
 
                                                         else
                                                         {
-                                                            return false;
+                                                            if (_customPermanentConditions[0](permanent) || _customPermanentConditions[1](permanent))
+                                                            {
+                                                                JogressConditionElement element1 = selectedDNA.elements[1];
+
+                                                                if (_customPermanentConditions[0](permanent))
+                                                                {
+                                                                    if (_card.Owner.GetBattleAreaDigimons().Count((permanent1) => permanent1 != permanent && element1.EvoRootCondition(permanent1) && _customPermanentConditions[1](permanent1)) == 0)
+                                                                    {
+                                                                        return false;
+                                                                    }
+                                                                }
+
+                                                                if (_customPermanentConditions[1](permanent))
+                                                                {
+                                                                    if (_card.Owner.GetBattleAreaDigimons().Count((permanent1) => permanent1 != permanent && element1.EvoRootCondition(permanent1) && _customPermanentConditions[0](permanent1)) == 0)
+                                                                    {
+                                                                        return false;
+                                                                    }
+                                                                }
+                                                            }
+
+                                                            else
+                                                            {
+                                                                return false;
+                                                            }
                                                         }
                                                     }
-                                                }
 
-                                                else
-                                                {
-                                                    return false;
+                                                    else
+                                                    {
+                                                        return false;
+                                                    }
                                                 }
                                             }
                                         }
-                                    }
 
-                                    if (i == 0)
-                                    {
-                                        List<Permanent> nextCandidates = _card.Owner.GetBattleAreaDigimons()
-                                            .Filter(permanent1 => permanent1 != permanent);
-
-                                        if (nextCandidates.Count(selectedDNA.elements[1].EvoRootCondition) == 0)
+                                        if (i == 0)
                                         {
-                                            return false;
+                                            List<Permanent> nextCandidates = _card.Owner.GetBattleAreaDigimons()
+                                                .Filter(permanent1 => permanent1 != permanent);
+
+                                            if (nextCandidates.Count(selectedDNA.elements[1].EvoRootCondition) == 0)
+                                            {
+                                                return false;
+                                            }
                                         }
-                                    }
 
-                                    return true;
+                                        return true;
+                                    }
                                 }
                             }
                         }

+ 49 - 0
Assets/Scripts/Script/SelectPermanentEffect.cs

@@ -89,6 +89,11 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
         _defenderCondition = defenderCondition;
     }
 
+    public void SetPlaceFaceUp()
+    {
+        _isFaceUp = true;
+    }
+
     //Player to select
     Player _selectPlayer = null;
     //Conditions of units that can be selected
@@ -116,6 +121,7 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
     int _degenerationCount = 1;
     bool _canAttackPlayer = true;
     Func<Permanent, bool> _defenderCondition = (permanent) => true;
+    bool _isFaceUp = false;
 
     public enum Mode
     {
@@ -125,6 +131,8 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
         Bounce,
         PutLibraryBottom,
         PutLibraryTop,
+        PutSecurityBottom,
+        PutSecurityTop,
         Degenerate,
         Attack,
         Custom
@@ -244,6 +252,8 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
         List<Permanent> untapPermanents = new List<Permanent>();
         List<Permanent> libraryBottomPermanents = new List<Permanent>();
         List<Permanent> libraryTopPermanents = new List<Permanent>();
+        List<Permanent> securityBottomPermanents = new List<Permanent>();
+        List<Permanent> securityTopPermanents = new List<Permanent>();
         List<Permanent> handBouncePermanents = new List<Permanent>();
         List<Permanent> degeneratePermanents = new List<Permanent>();
         List<Permanent> attackPermanents = new List<Permanent>();
@@ -327,6 +337,14 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
                             message = "Select cards to put on top of the deck.";
                             break;
 
+                        case Mode.PutSecurityBottom:
+                            message = "Select cards to put on bottom of security.";
+                            break;
+
+                        case Mode.PutSecurityTop:
+                            message = "Select cards to put on top of security.";
+                            break;
+
                         case Mode.Degenerate:
                             message = $"Select cards to De-Digivolve {_degenerationCount}.";
                             break;
@@ -863,6 +881,15 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
                                 libraryTopPermanents.Add(targetPermanent);
                                 break;
 
+                            case Mode.PutSecurityBottom:
+
+                                securityBottomPermanents.Add(targetPermanent);
+                                break;
+
+                            case Mode.PutSecurityTop:
+                                securityTopPermanents.Add(targetPermanent);
+                                break;
+
                             case Mode.Degenerate:
                                 degeneratePermanents.Add(targetPermanent);
                                 break;
@@ -919,6 +946,28 @@ public class SelectPermanentEffect : MonoBehaviourPunCallbacks
                         yield return ContinuousController.instance.StartCoroutine(new DeckTopBounceClass(libraryTopPermanents, hashtable).DeckBounce());
                     }
 
+                    if (securityBottomPermanents.Count > 0)
+                    {
+                        if (_cardEffect.EffectSourceCard.Owner.CanAddSecurity(_cardEffect))
+                        {
+                            foreach (Permanent targetPermanent in securityBottomPermanents)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(targetPermanent, CardEffectCommons.CardEffectHashtable(_cardEffect), false, _isFaceUp).PutSecurity());
+                            }
+                        }
+                    }
+
+                    if (securityTopPermanents.Count > 0)
+                    {
+                        if (_cardEffect.EffectSourceCard.Owner.CanAddSecurity(_cardEffect))
+                        {
+                            foreach (Permanent targetPermanent in securityTopPermanents)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(targetPermanent, CardEffectCommons.CardEffectHashtable(_cardEffect), true, _isFaceUp).PutSecurity());
+                            }
+                        }
+                    }
+
                     if (handBouncePermanents.Count > 0)
                     {
                         yield return ContinuousController.instance.StartCoroutine(new HandBounceClaass(handBouncePermanents, hashtable).Bounce());

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:113b3f924915cbef9c388b358e51a4d658e37ad04b6b61406799bd7189dc8e0c
+oid sha256:90c9a9851dae21bd75acad53899bc68188413b2a6dd8db2f05cba4bb61220692
 size 20480