ソースを参照

Rework PlayForFree and PlayForCost modes into CEC method

hooperk 1 ヶ月 前
コミット
674802eaf8
44 ファイル変更667 行追加1727 行削除
  1. 6 20
      Assets/Scripts/CardEffect/AD1/Blue/AD1_019.cs
  2. 7 45
      Assets/Scripts/CardEffect/AD1/Red/AD1_002.cs
  3. 9 47
      Assets/Scripts/CardEffect/AD1/Yellow/AD1_015.cs
  4. 9 47
      Assets/Scripts/CardEffect/AD1/Yellow/AD1_016.cs
  5. 5 16
      Assets/Scripts/CardEffect/BT25/Black/BT25_077.cs
  6. 21 70
      Assets/Scripts/CardEffect/BT25/Black/BT25_102.cs
  7. 6 16
      Assets/Scripts/CardEffect/BT25/Blue/BT25_023.cs
  8. 8 19
      Assets/Scripts/CardEffect/BT25/Green/BT25_052.cs
  9. 8 25
      Assets/Scripts/CardEffect/BT25/Green/BT25_055.cs
  10. 21 70
      Assets/Scripts/CardEffect/BT25/Green/BT25_099.cs
  11. 5 16
      Assets/Scripts/CardEffect/BT25/Purple/BT25_082.cs
  12. 5 23
      Assets/Scripts/CardEffect/BT25/Purple/BT25_083.cs
  13. 20 69
      Assets/Scripts/CardEffect/BT25/Red/BT25_094.cs
  14. 21 70
      Assets/Scripts/CardEffect/BT25/Red/BT25_095.cs
  15. 6 17
      Assets/Scripts/CardEffect/BT25/Red/BT25_104.cs
  16. 5 16
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_034.cs
  17. 7 20
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_039.cs
  18. 5 16
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_040.cs
  19. 5 16
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_042.cs
  20. 10 45
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_044.cs
  21. 21 70
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_097.cs
  22. 6 19
      Assets/Scripts/CardEffect/BT25/Yellow/BT25_098.cs
  23. 5 16
      Assets/Scripts/CardEffect/EX12/Black/EX12_072.cs
  24. 10 65
      Assets/Scripts/CardEffect/EX12/Blue/EX12_034.cs
  25. 5 20
      Assets/Scripts/CardEffect/EX12/Purple/EX12_063.cs
  26. 8 29
      Assets/Scripts/CardEffect/EX12/Purple/EX12_065.cs
  27. 17 65
      Assets/Scripts/CardEffect/EX12/White/EX12_074.cs
  28. 9 25
      Assets/Scripts/CardEffect/EX12/Yellow/EX12_045.cs
  29. 8 24
      Assets/Scripts/CardEffect/EX12/Yellow/EX12_046.cs
  30. 5 16
      Assets/Scripts/CardEffect/EX12/Yellow/EX12_047.cs
  31. 11 36
      Assets/Scripts/CardEffect/EX12/Yellow/EX12_069.cs
  32. 5 16
      Assets/Scripts/CardEffect/EX12/Yellow/EX12_070.cs
  33. 6 22
      Assets/Scripts/CardEffect/EX4/Purple/EX4_071.cs
  34. 12 65
      Assets/Scripts/CardEffect/P/Black/P_243.cs
  35. 7 45
      Assets/Scripts/CardEffect/P/Black/P_244.cs
  36. 9 47
      Assets/Scripts/CardEffect/P/Purple/P_240.cs
  37. 9 20
      Assets/Scripts/CardEffect/ST23/Green/ST23_07.cs
  38. 9 47
      Assets/Scripts/CardEffect/ST23/White/ST23_15.cs
  39. 9 47
      Assets/Scripts/CardEffect/ST24/White/ST24_15.cs
  40. 9 20
      Assets/Scripts/CardEffect/ST24/Yellow/ST24_05.cs
  41. 287 0
      Assets/Scripts/Script/CardEffectCommons/PlayEffects.cs
  42. 11 0
      Assets/Scripts/Script/CardEffectCommons/PlayEffects.cs.meta
  43. 0 165
      Assets/Scripts/Script/SelectCardEffect.cs
  44. 0 165
      Assets/Scripts/Script/SelectHandEffect.cs

+ 6 - 20
Assets/Scripts/CardEffect/AD1/Blue/AD1_019.cs

@@ -80,27 +80,13 @@ namespace DCGO.CardEffects.AD1
 
                         if (CardEffectCommons.HasMatchConditionOwnersHand(card, cardSource => IsAdventureDigimon(cardSource, reduceCost)))
                         {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                 canTargetCondition: cardSource => IsAdventureDigimon(cardSource, reduceCost),
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForCost,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetReducedCostTuple((reduceCost, null));
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 card to play", "The opponent is selecting 1 card to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                                SelectCardEffect.Root.Hand,
+                                activateClass,
+                                payCost: true,
+                                reduceCostTuple: (reduceCost, null)
+                            ));
                         }
                     }
                 }

+ 7 - 45
Assets/Scripts/CardEffect/AD1/Red/AD1_002.cs

@@ -191,55 +191,17 @@ namespace DCGO.CardEffects.AD1
                     #endregion
 
                     bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                    bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                    SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
                     if (doPlay)
                     {
                         #region Hand/Trash Card Selection & Play
-                        if (fromHand)
-                        {
-                            SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect2.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectHandEffect2.Activate());
-                        }
-                        else
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 card to play.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-                                
-                            yield return StartCoroutine(selectCardEffect.Activate());
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectPlayCondition,
+                            root,
+                            activateClass,
+                            payCost: false
+                        ));
                         #endregion
                     }
                 }

+ 9 - 47
Assets/Scripts/CardEffect/AD1/Yellow/AD1_015.cs

@@ -173,56 +173,18 @@ namespace DCGO.CardEffects.AD1
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
                     bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                    bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                    SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
                     if (doPlay)
                     {
-                        List<CardSource> selectedCards = new List<CardSource>();
-
-                        if (fromHand)
-                        {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanPlayTamerCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectHandEffect.Activate());
-                        }
-                        else
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanPlayTamerCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 card to play.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectCardEffect.Activate());
-                        }
+                        #region Hand/Trash Card Selection & Play
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanPlayTamerCondition,
+                            root,
+                            activateClass,
+                            payCost: false
+                        ));
+                        #endregion
                     }
                 }
 

+ 9 - 47
Assets/Scripts/CardEffect/AD1/Yellow/AD1_016.cs

@@ -87,56 +87,18 @@ namespace DCGO.CardEffects.AD1
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
                     bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                    bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                    SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
                     if (doPlay)
                     {
-                        List<CardSource> selectedCards = new List<CardSource>();
-
-                        if (fromHand)
-                        {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: IsMarcusDamonCard,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectHandEffect.Activate());
-                        }
-                        else
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                        canTargetCondition: IsMarcusDamonCard,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        canNoSelect: () => true,
-                                        selectCardCoroutine: null,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select 1 card to play.",
-                                        maxCount: 1,
-                                        canEndNotMax: false,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.PlayForFree,
-                                        root: SelectCardEffect.Root.Trash,
-                                        customRootCardList: null,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectCardEffect.Activate());
-                        }
+                        #region Hand/Trash Card Selection & Play
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: IsMarcusDamonCard,
+                            root,
+                            activateClass,
+                            payCost: false
+                        ));
+                        #endregion
                     }
                 }
 

+ 5 - 16
Assets/Scripts/CardEffect/BT25/Black/BT25_077.cs

@@ -75,23 +75,12 @@ namespace DCGO.CardEffects.BT25
 
             IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
             {
-                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                selectHandEffect.SetUp(
-                    selectPlayer: card.Owner,
+                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                     canTargetCondition: cardSource => CanPlayTSDigimonCondition(cardSource, activateClass),
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    maxCount: 1,
-                    canNoSelect: true,
-                    canEndNotMax: false,
-                    isShowOpponent: true,
-                    selectCardCoroutine: null,
-                    afterSelectCardCoroutine: null,
-                    mode: SelectHandEffect.Mode.PlayForFree,
-                    cardEffect: activateClass);
-
-                yield return StartCoroutine(selectHandEffect.Activate());
+                    SelectCardEffect.Root.Hand,
+                    activateClass,
+                    payCost: false
+                ));
             }
 
             CardEffectFactory.ActivateClassesForSharedEffects

+ 21 - 70
Assets/Scripts/CardEffect/BT25/Black/BT25_102.cs

@@ -110,28 +110,16 @@ namespace DCGO.CardEffects.BT25
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectFactory.ReplaceBottomSecurityWithFaceUpOptionEffect(card, activateClass));
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-                    int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
+                    }
                 }
             }
 
@@ -189,57 +177,20 @@ namespace DCGO.CardEffects.BT25
                             GManager.instance.userSelectionManager.SetInt(canSelectHand ? 1 : 2);
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
-                        bool fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 2;
+                        
+                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
-                        if (fromHand)
+                        if (doPlay)
                         {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-                        }
-                        if (fromTrash)
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
+                            #region Hand/Trash Card Selection & Play
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                 canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 digimon to play",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
+                            #endregion
                         }
                     }
                 }

+ 6 - 16
Assets/Scripts/CardEffect/BT25/Blue/BT25_023.cs

@@ -60,23 +60,13 @@ namespace DCGO.CardEffects.BT25
                 List<CardSource> selectedCards = new List<CardSource>();
                 int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, HasTamerInHand));
 
-                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                selectHandEffect.SetUp(
-                    selectPlayer: card.Owner,
+                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                     canTargetCondition: HasTamerInHand,
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    maxCount: maxCount,
-                    canNoSelect: true,
-                    canEndNotMax: false,
-                    isShowOpponent: true,
-                    selectCardCoroutine: null,
-                    afterSelectCardCoroutine: null,
-                    mode: SelectHandEffect.Mode.PlayForFree,
-                    cardEffect: activateClass);
-
-                yield return StartCoroutine(selectHandEffect.Activate());
+                    SelectCardEffect.Root.Hand,
+                    activateClass,
+                    payCost: false,
+                    maxCount: maxCount
+                ));
             }
             #endregion
 

+ 8 - 19
Assets/Scripts/CardEffect/BT25/Green/BT25_052.cs

@@ -233,33 +233,22 @@ namespace DCGO.CardEffects.BT25
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                        mode: SelectHandEffect.Mode.PlayForFree,
-                        cardEffect: activateClass);
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
                     IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                     {
                         if (cardSources.Count == 0)
                             activateClass.RemoveUse();
                         yield return null;
                     }
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                        canTargetCondition: CanSelectCardCondition,
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false,
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine
+                    ));
                 }
             }
-
             #endregion
 
             #region Link

+ 8 - 25
Assets/Scripts/CardEffect/BT25/Green/BT25_055.cs

@@ -149,40 +149,23 @@ namespace DCGO.CardEffects.BT25
 
                     if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                     {
-                        List<CardSource> selectedCards = new List<CardSource>();
-
-                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                        selectHandEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectCardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            selectCardCoroutine: null,
-                            afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                            mode: SelectHandEffect.Mode.PlayForFree,
-                            cardEffect: activateClass);
-
-                        selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                        selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-
                         IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                         {
                             if (cardSources.Count > 0)
                             {
                                 Used = true;
-
-                                yield return null;
                             }
 
                             yield return null;
                         }
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: false,
+                            afterSelectCardCoroutine: AfterSelectCardCoroutine
+                        ));
                     }
 
                     if (!Used)

+ 21 - 70
Assets/Scripts/CardEffect/BT25/Green/BT25_099.cs

@@ -152,28 +152,16 @@ namespace DCGO.CardEffects.BT25
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectFactory.ReplaceBottomSecurityWithFaceUpOptionEffect(card, activateClass));
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-                    int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
+                    }
                 }
             }
 
@@ -231,57 +219,20 @@ namespace DCGO.CardEffects.BT25
                             GManager.instance.userSelectionManager.SetInt(canSelectHand ? 1 : 2);
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
-                        bool fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 2;
+                        
+                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
-                        if (fromHand)
+                        if (doPlay)
                         {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-                        }
-                        if (fromTrash)
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
+                            #region Hand/Trash Card Selection & Play
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                 canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 digimon to play",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
+                            #endregion
                         }
                     }
                 }

+ 5 - 16
Assets/Scripts/CardEffect/BT25/Purple/BT25_082.cs

@@ -54,23 +54,12 @@ namespace DCGO.CardEffects.BT25
 
             IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
             {
-                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                selectHandEffect.SetUp(
-                    selectPlayer: card.Owner,
+                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                     canTargetCondition: TraitedTamer,
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    maxCount: 1,
-                    canNoSelect: true,
-                    canEndNotMax: false,
-                    isShowOpponent: true,
-                    selectCardCoroutine: null,
-                    afterSelectCardCoroutine: null,
-                    mode: SelectHandEffect.Mode.PlayForFree,
-                    cardEffect: activateClass);
-
-                yield return StartCoroutine(selectHandEffect.Activate());
+                    SelectCardEffect.Root.Hand,
+                    activateClass,
+                    payCost: false
+                ));
             }
             #endregion
 

+ 5 - 23
Assets/Scripts/CardEffect/BT25/Purple/BT25_083.cs

@@ -424,30 +424,12 @@ namespace DCGO.CardEffects.BT25
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                    selectCardEffect.SetUp(
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        canNoSelect: () => true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        message: "Select 1 level 4 or lower [Three Musketeers] digimon to play.",
-                        maxCount: 1,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        mode: SelectCardEffect.Mode.PlayForFree,
-                        root: SelectCardEffect.Root.Trash,
-                        customRootCardList: null,
-                        canLookReverseCard: true,
-                        selectPlayer: card.Owner,
-                        cardEffect: activateClass);
-
-                    selectCardEffect.SetUpCustomMessage("Select 1 level 4 or lower [Three Musketeers] digimon to play.", "The opponent is selecting 1 level 4 or lower [Three Musketeers] digimon to play.");
-                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                        SelectCardEffect.Root.Trash,
+                        activateClass,
+                        payCost: false
+                    ));
                 }
             }
             #endregion

+ 20 - 69
Assets/Scripts/CardEffect/BT25/Red/BT25_094.cs

@@ -115,28 +115,16 @@ namespace DCGO.CardEffects.BT25
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectFactory.ReplaceBottomSecurityWithFaceUpOptionEffect(card, activateClass));
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-                    int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
+                    }
                 }
             }
 
@@ -194,57 +182,20 @@ namespace DCGO.CardEffects.BT25
                             GManager.instance.userSelectionManager.SetInt(canSelectHand ? 1 : 2);
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
-                        bool fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 2;
 
-                        if (fromHand)
-                        {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-                        }
-                        if (fromTrash)
+                        if (doPlay)
                         {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
+                            #region Hand/Trash Card Selection & Play
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                 canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 digimon to play",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
+                            #endregion
                         }
                     }
                 }

+ 21 - 70
Assets/Scripts/CardEffect/BT25/Red/BT25_095.cs

@@ -123,28 +123,16 @@ namespace DCGO.CardEffects.BT25
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectFactory.ReplaceBottomSecurityWithFaceUpOptionEffect(card, activateClass));
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-                    int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
+                    }
                 }
             }
 
@@ -202,57 +190,20 @@ namespace DCGO.CardEffects.BT25
                             GManager.instance.userSelectionManager.SetInt(canSelectHand ? 1 : 2);
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
-                        bool fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 2;
+                        
+                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
-                        if (fromHand)
+                        if (doPlay)
                         {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-                        }
-                        if (fromTrash)
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
+                            #region Hand/Trash Card Selection & Play
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                 canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 digimon to play",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
+                            #endregion
                         }
                     }
                 }

+ 6 - 17
Assets/Scripts/CardEffect/BT25/Red/BT25_104.cs

@@ -314,23 +314,12 @@ namespace DCGO.CardEffects.BT25
 
                     if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectTamerCondition))
                     {
-                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectTamerCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectHandEffect.Activate());
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectTamerCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: false
+                        ));
                     }
                 }
             }

+ 5 - 16
Assets/Scripts/CardEffect/BT25/Yellow/BT25_034.cs

@@ -59,23 +59,12 @@ namespace DCGO.CardEffects.BT25
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanPlayCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForFree,
-                        cardEffect: activateClass);
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false
+                    ));
                 }
             }
             #endregion

+ 7 - 20
Assets/Scripts/CardEffect/BT25/Yellow/BT25_039.cs

@@ -58,27 +58,14 @@ namespace DCGO.CardEffects.BT25
                 {
                     CardSource selectedCard = null;
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((7, null));
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play", "The opponent is selecting 1 card to play");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: true,
+                        reduceCostTuple: (7, null),
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine
+                    ));
 
                     IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                     {

+ 5 - 16
Assets/Scripts/CardEffect/BT25/Yellow/BT25_040.cs

@@ -62,23 +62,12 @@ namespace DCGO.CardEffects.BT25
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanPlayCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForFree,
-                        cardEffect: activateClass);
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false
+                    ));
                 }
             }
             #endregion

+ 5 - 16
Assets/Scripts/CardEffect/BT25/Yellow/BT25_042.cs

@@ -143,23 +143,12 @@ namespace DCGO.CardEffects.BT25
                 {
                     if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanPlayCardCondition))
                     {
-                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                        selectHandEffect.SetUp(
-                            selectPlayer: card.Owner,
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                             canTargetCondition: CanPlayCardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            selectCardCoroutine: null,
-                            afterSelectCardCoroutine: null,
-                            mode: SelectHandEffect.Mode.PlayForFree,
-                            cardEffect: activateClass);
-
-                        yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: false
+                        ));
                     }
 
                     List<Permanent> selectedPermaments = new List<Permanent>(); ;

+ 10 - 45
Assets/Scripts/CardEffect/BT25/Yellow/BT25_044.cs

@@ -184,7 +184,7 @@ namespace DCGO.CardEffects.BT25
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
                     bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                    bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                    SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
                     if (doPlay)
                     {
                         IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
@@ -194,50 +194,15 @@ namespace DCGO.CardEffects.BT25
                             yield return null;
                         }
 
-                        if (fromHand)
-                        {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectHandCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectHandEffect.Activate());
-                        }
-                        else
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectTrashCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                                message: "Select 1 card to play.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            yield return StartCoroutine(selectCardEffect.Activate());
-                        }
+                        #region Hand/Trash Card Selection & Play
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectHandCardCondition,
+                            root,
+                            activateClass,
+                            payCost: false,
+                            afterSelectCardCoroutine: AfterSelectCardCoroutine
+                        ));
+                        #endregion
                     }
                     
                     if(!executed) activateClass.RemoveUse();

+ 21 - 70
Assets/Scripts/CardEffect/BT25/Yellow/BT25_097.cs

@@ -151,28 +151,16 @@ namespace DCGO.CardEffects.BT25
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectFactory.ReplaceBottomSecurityWithFaceUpOptionEffect(card, activateClass));
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-                    int maxCount = Math.Min(1, card.Owner.HandCards.Count(CanSelectCardCondition));
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
+                    }
                 }
             }
 
@@ -230,57 +218,20 @@ namespace DCGO.CardEffects.BT25
                             GManager.instance.userSelectionManager.SetInt(canSelectHand ? 1 : 2);
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
-                        bool fromTrash = GManager.instance.userSelectionManager.SelectedIntValue == 2;
+                        
+                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
-                        if (fromHand)
+                        if (doPlay)
                         {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.PlayForFree,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-                        }
-                        if (fromTrash)
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
+                            #region Hand/Trash Card Selection & Play
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                 canTargetCondition: CanPlayCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: null,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 digimon to play",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.PlayForFree,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 digimon to play", "The opponent is selecting 1 digimon to play");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
+                            #endregion
                         }
                     }
                 }

+ 6 - 19
Assets/Scripts/CardEffect/BT25/Yellow/BT25_098.cs

@@ -99,26 +99,13 @@ namespace DCGO.CardEffects.BT25
 
                     IEnumerator SuccessProcess()
                     {
-                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                        selectHandEffect.SetUp(
-                            selectPlayer: card.Owner,
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                             canTargetCondition: CanSelectCardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            selectCardCoroutine: null,
-                            afterSelectCardCoroutine: null,
-                            mode: SelectHandEffect.Mode.PlayForCost,
-                            cardEffect: activateClass);
-
-                        selectHandEffect.SetReducedCostTuple((3, null));
-                        selectHandEffect.SetUpCustomMessage("Select 1 card to play", "The opponent is selecting 1 card to play");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
                     }
                 }
             }

+ 5 - 16
Assets/Scripts/CardEffect/EX12/Black/EX12_072.cs

@@ -119,23 +119,12 @@ namespace DCGO.CardEffects.EX12
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect2.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanPlayCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForFree,
-                        cardEffect: activateClass);
-
-                    yield return StartCoroutine(selectHandEffect2.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false
+                    ));
                 }
             }
             #endregion

+ 10 - 65
Assets/Scripts/CardEffect/EX12/Blue/EX12_034.cs

@@ -179,74 +179,19 @@ namespace DCGO.CardEffects.EX12
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
                         bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.DigivolutionCards;
 
                         if (doPlay)
                         {
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-                            }
-                            else
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => false,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 digivolution card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.Custom,
-                                    root: SelectCardEffect.Root.DigivolutionCards,
-                                    customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.", "The opponent is selecting 1 digivolution card to play.");
-                                selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                    cardSources: selectedCards,
-                                    activateClass: activateClass,
-                                    payCost: false,
-                                    isTapped: false,
-                                    root: SelectCardEffect.Root.DigivolutionCards,
-                                    activateETB: true));
-                            }
+                            #region Hand/Trash Card Selection & Play
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanSelectCardCondition,
+                                root,
+                                activateClass,
+                                payCost: false,
+                                targetPermanent: card.PermanentOfThisCard()
+                            ));
+                            #endregion
                         }
                     }
                 }

+ 5 - 20
Assets/Scripts/CardEffect/EX12/Purple/EX12_063.cs

@@ -135,27 +135,12 @@ namespace DCGO.CardEffects.EX12
                 
                 if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanPlayTrashDigimon))
                 {
-                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                    selectCardEffect.SetUp(
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanPlayTrashDigimon,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        canNoSelect: () => true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        message: "Select 1 card to play.",
-                        maxCount: 1,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        mode: SelectCardEffect.Mode.PlayForFree,
-                        root: SelectCardEffect.Root.Trash,
-                        customRootCardList: null,
-                        canLookReverseCard: true,
-                        selectPlayer: card.Owner,
-                        cardEffect: activateClass);
-                        
-                    yield return StartCoroutine(selectCardEffect.Activate());
+                        SelectCardEffect.Root.Trash,
+                        activateClass,
+                        payCost: false
+                    ));
                 }
             }
 

+ 8 - 29
Assets/Scripts/CardEffect/EX12/Purple/EX12_065.cs

@@ -58,8 +58,6 @@ namespace DCGO.CardEffects.EX12
 
             IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
             {
-                bool Used = false;
-
                 bool CanPlayCardCondition(CardSource cardSource)
                 {
                     return cardSource.HasPlayCost
@@ -69,42 +67,23 @@ namespace DCGO.CardEffects.EX12
                         && CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass);
                 }
 
-                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                selectCardEffect.SetUp(
+                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                     canTargetCondition: CanPlayCardCondition,
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    canNoSelect: () => true,
-                    selectCardCoroutine: null,
-                    afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                    message: "Select 1 card to play.",
-                    maxCount: 1,
-                    canEndNotMax: false,
-                    isShowOpponent: true,
-                    mode: SelectCardEffect.Mode.PlayForFree,
-                    root: SelectCardEffect.Root.Trash,
-                    customRootCardList: null,
-                    canLookReverseCard: true,
-                    selectPlayer: card.Owner,
-                    cardEffect: activateClass);
+                    SelectCardEffect.Root.Trash,
+                    activateClass,
+                    payCost: false,
+                    afterSelectCardCoroutine: AfterSelectCardCoroutine
+                ));
 
                 IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                 {
-                    if (cardSources != null)
+                    if (cardSources.Count == 0)
                     {
-                        Used = true;
+                        activateClass.RemoveUse();
 
                         yield return null;
                     }
                 }
-
-                yield return StartCoroutine(selectCardEffect.Activate());
-
-                if (!Used)
-                {
-                    activateClass.RemoveUse();
-                }
             }
             #endregion
 

+ 17 - 65
Assets/Scripts/CardEffect/EX12/White/EX12_074.cs

@@ -95,26 +95,16 @@ namespace DCGO.CardEffects.EX12
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectFactory.ReplaceBottomSecurityWithFaceUpOptionEffect(card, activateClass));
 
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play", "The opponent is selecting 1 card to play");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                            canTargetCondition: CanSelectCardCondition,
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: true,
+                            reduceCostTuple: (3, null)
+                        ));
+                    }
                 }
             }
             #endregion
@@ -172,56 +162,18 @@ namespace DCGO.CardEffects.EX12
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
                         bool doSelect = GManager.instance.userSelectionManager.SelectedIntValue != 3;
 
                         if (doSelect)
                         {
                             #region Hand/Trash Card Selection & Play
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect2.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect2.Activate());
-                            }
-                            else
-                            {
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanPlayCondition,
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
                             #endregion
                         }
                     }

+ 9 - 25
Assets/Scripts/CardEffect/EX12/Yellow/EX12_045.cs

@@ -112,38 +112,22 @@ namespace DCGO.CardEffects.EX12
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    bool isUsed = false;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((2, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play", "The opponent is selecting 1 card to play");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: true,
+                        reduceCostTuple: (2, null),
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine
+                    ));
 
                     IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                     {
-                        if (cardSources.Count > 0)
-                            isUsed = true;
+                        if (cardSources.Count == 0)
+                            activateClass.RemoveUse();
 
                         yield return null;
                     }
-
-                    if (!isUsed) activateClass.RemoveUse();
                 }
             }
             #endregion

+ 8 - 24
Assets/Scripts/CardEffect/EX12/Yellow/EX12_046.cs

@@ -211,39 +211,23 @@ namespace DCGO.CardEffects.EX12
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    bool Used = false;
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                        mode: SelectHandEffect.Mode.PlayForFree,
-                        cardEffect: activateClass);
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false,
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine
+                    ));
 
                     IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                     {
-                        if (cardSources.Count > 0)
+                        if (cardSources.Count == 0)
                         {
-                            Used = true;
+                            activateClass.RemoveUse();
 
                             yield return null;
                         }
                     }
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    if (!Used)
-                    {
-                        activateClass.RemoveUse();
-                    }
                 }
             }
             #endregion

+ 5 - 16
Assets/Scripts/CardEffect/EX12/Yellow/EX12_047.cs

@@ -247,23 +247,12 @@ namespace DCGO.CardEffects.EX12
 
                     if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectPlayCardCondition))
                     {
-                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                        selectHandEffect.SetUp(
-                            selectPlayer: card.Owner,
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                             canTargetCondition: CanSelectPlayCardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            selectCardCoroutine: null,
-                            afterSelectCardCoroutine: null,
-                            mode: SelectHandEffect.Mode.PlayForFree,
-                            cardEffect: activateClass);
-
-                        yield return StartCoroutine(selectHandEffect.Activate());
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: false
+                        ));
                     }
                 }
             }

+ 11 - 36
Assets/Scripts/CardEffect/EX12/Yellow/EX12_069.cs

@@ -63,27 +63,13 @@ namespace DCGO.CardEffects.EX12
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForCost,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetReducedCostTuple((3, null));
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
-                    selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: true,
+                        reduceCostTuple: (3, null)
+                    ));
                 }
             }
             #endregion
@@ -141,23 +127,12 @@ namespace DCGO.CardEffects.EX12
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect2.SetUp(
-                        selectPlayer: card.Owner,
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                         canTargetCondition: CanPlayCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.PlayForFree,
-                        cardEffect: activateClass);
-
-                    yield return StartCoroutine(selectHandEffect2.Activate());
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false
+                    ));
                 }
             }
             #endregion

+ 5 - 16
Assets/Scripts/CardEffect/EX12/Yellow/EX12_070.cs

@@ -122,23 +122,12 @@ namespace DCGO.CardEffects.EX12
 
                     IEnumerator SuccessProcess()
                     {
-                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                        selectHandEffect.SetUp(
-                            selectPlayer: card.Owner,
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                             canTargetCondition: CanSelectCardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            selectCardCoroutine: null,
-                            afterSelectCardCoroutine: null,
-                            mode: SelectHandEffect.Mode.PlayForFree,
-                            cardEffect: activateClass);
-
-                        yield return StartCoroutine(selectHandEffect.Activate());
+                            SelectCardEffect.Root.Hand,
+                            activateClass,
+                            payCost: false
+                        ));
                     }
                 }
             }

+ 6 - 22
Assets/Scripts/CardEffect/EX4/Purple/EX4_071.cs

@@ -145,29 +145,13 @@ namespace DCGO.CardEffects.EX4
                                     {
                                         if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardCondition(cardSource)))
                                         {
-                                            List<CardSource> selectedCards = new List<CardSource>();
-
-                                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                            selectCardEffect.SetUp(
+                                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                                 canTargetCondition: CanSelectCardCondition,
-                                                canTargetCondition_ByPreSelecetedList: null,
-                                                canEndSelectCondition: null,
-                                                canNoSelect: () => false,
-                                                selectCardCoroutine: null,
-                                                afterSelectCardCoroutine: null,
-                                                message: "Select 1 [Ravemon] to play.",
-                                                maxCount: 1,
-                                                canEndNotMax: false,
-                                                isShowOpponent: true,
-                                                mode: SelectCardEffect.Mode.PlayForFree,
-                                                root: SelectCardEffect.Root.Trash,
-                                                customRootCardList: null,
-                                                canLookReverseCard: true,
-                                                selectPlayer: card.Owner,
-                                                cardEffect: activateClass1);
-
-                                            yield return StartCoroutine(selectCardEffect.Activate());
+                                                SelectCardEffect.Root.Trash,
+                                                activateClass,
+                                                payCost: false,
+                                                canNoSelect: false
+                                            ));
                                         }
                                     }
                                 }

+ 12 - 65
Assets/Scripts/CardEffect/P/Black/P_243.cs

@@ -167,27 +167,12 @@ namespace DCGO.CardEffects.P
 
                             if (cardsAdded)
                             {
-                                SelectCardEffect selectCardEffect2 = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect2.SetUp(
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
                                     canTargetCondition: CanSelectCardCondition2,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect2.Activate());
+                                    SelectCardEffect.Root.Trash,
+                                    activateClass,
+                                    payCost: false
+                                ));
                             }
                         }
                     }
@@ -247,56 +232,18 @@ namespace DCGO.CardEffects.P
                         }
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
                         bool doSelect = GManager.instance.userSelectionManager.SelectedIntValue != 3;
 
                         if (doSelect)
                         {
                             #region Hand/Trash Card Selection & Play
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect2.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect2.Activate());
-                            }
-                            else
-                            {
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanPlayCondition,
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
                             #endregion
                         }
                     }

+ 7 - 45
Assets/Scripts/CardEffect/P/Black/P_244.cs

@@ -68,53 +68,15 @@ namespace DCGO.CardEffects.P
                             yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
                             #endregion
 
-                            bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+                            SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedBoolValue ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
 
                             #region Hand/Trash Card Selection & Play
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect2.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect2.Activate());
-                            }
-                            else
-                            {
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanSelectCardCondition,
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
                             #endregion
                         }
                     }

+ 9 - 47
Assets/Scripts/CardEffect/P/Purple/P_240.cs

@@ -313,56 +313,18 @@ namespace DCGO.CardEffects.P
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
                         #endregion
 
-                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
+                        bool doSelect = GManager.instance.userSelectionManager.SelectedIntValue != 3;
 
-                        if (doPlay)
+                        if (doSelect)
                         {
                             #region Hand/Trash Card Selection & Play
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect2.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectPlayCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect2.Activate());
-                            }
-                            else
-                            {
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanSelectPlayCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanSelectPlayCardCondition,
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
                             #endregion
                         }
                     }

+ 9 - 20
Assets/Scripts/CardEffect/ST23/Green/ST23_07.cs

@@ -58,26 +58,15 @@ namespace DCGO.CardEffects.ST23
                         && CardEffectCommons.CanPlayAsNewPermanent(source, false, activateClass);
                 }
 
-                List<CardSource> selectedCards = new List<CardSource>();
-                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, HasTamerInHand));
-
-                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                selectHandEffect.SetUp(
-                    selectPlayer: card.Owner,
-                    canTargetCondition: HasTamerInHand,
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    maxCount: maxCount,
-                    canNoSelect: true,
-                    canEndNotMax: false,
-                    isShowOpponent: true,
-                    selectCardCoroutine: null,
-                    afterSelectCardCoroutine: null,
-                    mode: SelectHandEffect.Mode.PlayForFree,
-                    cardEffect: activateClass);
-
-                yield return StartCoroutine(selectHandEffect.Activate());
+                if (CardEffectCommons.HasMatchConditionOwnersHand(card, HasTamerInHand))
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                        canTargetCondition: HasTamerInHand,
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false
+                    ));
+                }
             }
             #endregion
 

+ 9 - 47
Assets/Scripts/CardEffect/ST23/White/ST23_15.cs

@@ -79,56 +79,18 @@ namespace DCGO.CardEffects.ST23
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
                         #endregion
 
-                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
+                        bool doSelect = GManager.instance.userSelectionManager.SelectedIntValue != 3;
 
-                        if (doPlay)
+                        if (doSelect)
                         {
                             #region Hand/Trash Card Selection & Play
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect2.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect2.Activate());
-                            }
-                            else
-                            {
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanSelectPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanSelectPlayCondition,
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
                             #endregion
                         }
                     }

+ 9 - 47
Assets/Scripts/CardEffect/ST24/White/ST24_15.cs

@@ -78,56 +78,18 @@ namespace DCGO.CardEffects.ST24
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
                         #endregion
 
-                        bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
-                        bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
+                        SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedIntValue == 1 ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
+                        bool doSelect = GManager.instance.userSelectionManager.SelectedIntValue != 3;
 
-                        if (doPlay)
+                        if (doSelect)
                         {
                             #region Hand/Trash Card Selection & Play
-                            if (fromHand)
-                            {
-                                SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect2.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: 1,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.PlayForFree,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectHandEffect2.Activate());
-                            }
-                            else
-                            {
-                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect.SetUp(
-                                    canTargetCondition: CanSelectPlayCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    canNoSelect: () => true,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: null,
-                                    message: "Select 1 card to play.",
-                                    maxCount: 1,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    mode: SelectCardEffect.Mode.PlayForFree,
-                                    root: SelectCardEffect.Root.Trash,
-                                    customRootCardList: null,
-                                    canLookReverseCard: true,
-                                    selectPlayer: card.Owner,
-                                    cardEffect: activateClass);
-
-                                yield return StartCoroutine(selectCardEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                                canTargetCondition: CanSelectPlayCondition,
+                                root,
+                                activateClass,
+                                payCost: false
+                            ));
                             #endregion
                         }
                     }

+ 9 - 20
Assets/Scripts/CardEffect/ST24/Yellow/ST24_05.cs

@@ -60,26 +60,15 @@ namespace DCGO.CardEffects.ST24
                         && CardEffectCommons.CanPlayAsNewPermanent(source, false, activateClass);
                 }
 
-                List<CardSource> selectedCards = new List<CardSource>();
-                int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, HasTamerInHand));
-
-                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                selectHandEffect.SetUp(
-                    selectPlayer: card.Owner,
-                    canTargetCondition: HasTamerInHand,
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    maxCount: maxCount,
-                    canNoSelect: true,
-                    canEndNotMax: false,
-                    isShowOpponent: true,
-                    selectCardCoroutine: null,
-                    afterSelectCardCoroutine: null,
-                    mode: SelectHandEffect.Mode.PlayForFree,
-                    cardEffect: activateClass);
-
-                yield return StartCoroutine(selectHandEffect.Activate());
+                if (CardEffectCommons.HasMatchConditionOwnersHand(card, HasTamerInHand))
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
+                        canTargetCondition: HasTamerInHand,
+                        SelectCardEffect.Root.Hand,
+                        activateClass,
+                        payCost: false
+                    ));
+                }
             }
             #endregion
 

+ 287 - 0
Assets/Scripts/Script/CardEffectCommons/PlayEffects.cs

@@ -0,0 +1,287 @@
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using System.Linq;
+using UnityEngine;
+
+public partial class CardEffectCommons
+{
+    public static IEnumerator PlayByEffect(Func<CardSource, bool> canTargetCondition,
+        SelectCardEffect.Root root,
+        ICardEffect cardEffect,
+        bool payCost,
+        Func<List<CardSource>, CardSource, bool> canTargetCondition_ByPreSelecetedList = null,
+        Func<List<CardSource>, bool> canEndSelectCondition = null,
+        Func<List<CardSource>, IEnumerator> afterSelectCardCoroutine = null,
+        int maxCount = 1,
+        bool canNoSelect = true,
+        bool canEndNotMax = false,
+        (int reduceCost, Func<CardSource, bool> reduceCostCardCondition)? reduceCostTuple = null,
+        (int fixedCost, Func<CardSource, bool> fixedCostCardCondition)? fixedCostTuple = null,
+        Permanent targetPermanent = null)
+    {
+        if (cardEffect == null) yield break;
+
+        Player owner = cardEffect.EffectSourceCard.Owner;
+
+        List<CardSource> selectedCards = new List<CardSource>();
+
+        IEnumerator SelectCardCoroutine(CardSource card)
+        {
+            selectedCards.Add(card);
+            yield return null;
+        }
+        switch (root)
+        {
+            case SelectCardEffect.Root.Hand:
+            {
+                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                selectHandEffect.SetUp(
+                    selectPlayer: owner,
+                    canTargetCondition: canTargetCondition,
+                    canTargetCondition_ByPreSelecetedList: canTargetCondition_ByPreSelecetedList,
+                    canEndSelectCondition: canEndSelectCondition,
+                    maxCount: maxCount,
+                    canNoSelect: canNoSelect,
+                    canEndNotMax: canEndNotMax,
+                    isShowOpponent: true,
+                    selectCardCoroutine: SelectCardCoroutine,
+                    afterSelectCardCoroutine: afterSelectCardCoroutine,
+                    mode: SelectHandEffect.Mode.Custom,
+                    cardEffect: cardEffect);
+
+                selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+                break;
+            }
+
+            case SelectCardEffect.Root.DigivolutionCards:
+            {
+                if (targetPermanent == null) yield break;
+
+                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                selectCardEffect.SetUp(
+                    canTargetCondition: canTargetCondition,
+                    canTargetCondition_ByPreSelecetedList: canTargetCondition_ByPreSelecetedList,
+                    canEndSelectCondition: canEndSelectCondition,
+                    canNoSelect: () => canNoSelect,
+                    selectCardCoroutine: SelectCardCoroutine,
+                    afterSelectCardCoroutine: afterSelectCardCoroutine,
+                    message: "Select 1 card to play.",
+                    maxCount: maxCount,
+                    canEndNotMax: canEndNotMax,
+                    isShowOpponent: true,
+                    mode: SelectCardEffect.Mode.Custom,
+                    root: root,
+                    customRootCardList: targetPermanent.DigivolutionCards,
+                    canLookReverseCard: true,
+                    selectPlayer: owner,
+                    cardEffect: cardEffect);
+
+                selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+
+                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                break;
+            }
+
+            case SelectCardEffect.Root.LinkedCards:
+            {
+                if (targetPermanent == null) yield break;
+                
+                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                selectCardEffect.SetUp(
+                    canTargetCondition: canTargetCondition,
+                    canTargetCondition_ByPreSelecetedList: canTargetCondition_ByPreSelecetedList,
+                    canEndSelectCondition: canEndSelectCondition,
+                    canNoSelect: () => canNoSelect,
+                    selectCardCoroutine: SelectCardCoroutine,
+                    afterSelectCardCoroutine: afterSelectCardCoroutine,
+                    message: "Select 1 card to play.",
+                    maxCount: maxCount,
+                    canEndNotMax: canEndNotMax,
+                    isShowOpponent: true,
+                    mode: SelectCardEffect.Mode.Custom,
+                    root: root,
+                    customRootCardList: targetPermanent.LinkedCards,
+                    canLookReverseCard: true,
+                    selectPlayer: owner,
+                    cardEffect: cardEffect);
+
+                selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+
+                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                break;
+            }
+
+            default:
+            {
+                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                selectCardEffect.SetUp(
+                    canTargetCondition: canTargetCondition,
+                    canTargetCondition_ByPreSelecetedList: canTargetCondition_ByPreSelecetedList,
+                    canEndSelectCondition: canEndSelectCondition,
+                    canNoSelect: () => canNoSelect,
+                    selectCardCoroutine: SelectCardCoroutine,
+                    afterSelectCardCoroutine: afterSelectCardCoroutine,
+                    message: "Select 1 card to play.",
+                    maxCount: maxCount,
+                    canEndNotMax: canEndNotMax,
+                    isShowOpponent: true,
+                    mode: SelectCardEffect.Mode.Custom,
+                    root: root,
+                    customRootCardList: null,
+                    canLookReverseCard: true,
+                    selectPlayer: owner,
+                    cardEffect: cardEffect);
+
+                selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+
+                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                break;
+            }
+        }
+
+        bool PermanentsCondition(List<Permanent> targetPermanents)
+        {
+            if (targetPermanents == null)
+            {
+                return true;
+            }
+
+            else
+            {
+                if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        bool SharedCardCondition(CardSource cardSource) => selectedCards.Contains(cardSource);
+        bool RootCondition(SelectCardEffect.Root root) => true;
+        bool CanUseCondition(Hashtable hashtable) => true;
+
+        #region reduce cost
+
+        Func<EffectTiming, ICardEffect> getChangeCostEffect = null;
+
+        if (reduceCostTuple != null)
+        {
+            bool CardCondition(CardSource cardSource)
+            {
+                return SharedCardCondition(cardSource)
+                    && (reduceCostTuple.Value.reduceCostCardCondition == null || reduceCostTuple.Value.reduceCostCardCondition(cardSource));
+            }
+
+            int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+            {
+                if (PermanentsCondition(targetPermanents))
+                {
+                    Cost -= reduceCostTuple.Value.reduceCost;
+                }
+
+                return Cost;
+            }
+
+            bool isUpDown() => true;
+
+            ChangeCostClass changeCostClass = new ChangeCostClass();
+            changeCostClass.SetUpICardEffect($"Play Cost -{reduceCostTuple.Value.reduceCost}", CanUseCondition, cardEffect.EffectSourceCard);
+            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+            getChangeCostEffect = GetCardEffect;
+
+            ICardEffect GetCardEffect(EffectTiming _timing)
+            {
+                if (_timing == EffectTiming.None)
+                {
+                    return changeCostClass;
+                }
+
+                return null;
+            }
+
+            if (getChangeCostEffect != null)
+            {
+                owner.UntilCalculateFixedCostEffect.Add(getChangeCostEffect);
+            }
+        }
+
+        #endregion
+
+        #region set fixed cost
+
+        Func<EffectTiming, ICardEffect> getFixedCostEffect = null;
+
+        if (fixedCostTuple != null)
+        {
+            bool CardCondition(CardSource cardSource)
+            {
+                return SharedCardCondition(cardSource)
+                    && (fixedCostTuple.Value.fixedCostCardCondition == null || fixedCostTuple.Value.fixedCostCardCondition(cardSource));
+            }
+
+            int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+            {
+                if (PermanentsCondition(targetPermanents))
+                {
+                    Cost = fixedCostTuple.Value.fixedCost;
+                }
+
+                return Cost;
+            }
+
+            bool isUpDown() => false;
+
+            ChangeCostClass changeCostClass = new ChangeCostClass();
+            changeCostClass.SetUpICardEffect($"Play Cost {fixedCostTuple.Value.fixedCost}", CanUseCondition, cardEffect.EffectSourceCard);
+            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+            getFixedCostEffect = GetCardEffect;
+
+            ICardEffect GetCardEffect(EffectTiming _timing)
+            {
+                if (_timing == EffectTiming.None)
+                {
+                    return changeCostClass;
+                }
+
+                return null;
+            }
+
+            if (getFixedCostEffect != null)
+            {
+                owner.UntilCalculateFixedCostEffect.Add(getFixedCostEffect);
+            }
+        }
+
+        #endregion
+
+        yield return ContinuousController.instance.StartCoroutine(
+            CardEffectCommons.PlayPermanentCards(
+                cardSources: selectedCards, 
+                activateClass: cardEffect, 
+                payCost: payCost, 
+                isTapped: false, 
+                root: root, 
+                activateETB: true));
+        
+        #region release effect
+        if (getChangeCostEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getChangeCostEffect);
+        #endregion
+
+        #region release effect
+        if (getFixedCostEffect != null) owner.UntilCalculateFixedCostEffect.Remove(getFixedCostEffect);
+        #endregion
+    }
+
+    //TODO: UseByEffect
+
+    //TODO: PlayOrUseByEffect
+}

+ 11 - 0
Assets/Scripts/Script/CardEffectCommons/PlayEffects.cs.meta

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

+ 0 - 165
Assets/Scripts/Script/SelectCardEffect.cs

@@ -185,8 +185,6 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
         Discard,
         // PutLibraryTop,
         // PutLibraryBottom,
-        PlayForFree,
-        PlayForCost,
         Custom,
     }
 
@@ -412,14 +410,6 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
                                 message = "Select cards to trash.";
                                 break;
 
-                            case Mode.PlayForFree:
-                                message = "Select cards to play without paying the cost.";
-                                break;
-
-                            case Mode.PlayForCost:
-                                message = "Select cards to play.";
-                                break;
-
                             case Mode.Custom:
                                 message = "Select cards.";
                                 break;
@@ -715,12 +705,6 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
                                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards put on the trash", true, true));
                                     break;
 
-
-                                case Mode.PlayForFree:
-                                case Mode.PlayForCost:
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Played cards", true, true));
-                                    break;
-
                                 case Mode.Custom:
                                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Selected Cards", true, true));
                                     break;
@@ -811,155 +795,6 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
                     }
                     break;
 
-                case Mode.PlayForFree:
-                    yield return ContinuousController.instance.StartCoroutine(
-                            CardEffectCommons.PlayPermanentCards(
-                                cardSources: _targetCards, 
-                                activateClass: _cardEffect, 
-                                payCost: false, 
-                                isTapped: false, 
-                                root: _root, 
-                                activateETB: true));
-                    break;
-
-                case Mode.PlayForCost:
-                    {
-                        bool PermanentsCondition(List<Permanent> targetPermanents)
-                        {
-                            if (targetPermanents == null)
-                            {
-                                return true;
-                            }
-
-                            else
-                            {
-                                if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                                {
-                                    return true;
-                                }
-                            }
-
-                            return false;
-                        }
-
-                        bool SharedCardCondition(CardSource cardSource) => _targetCards.Contains(cardSource);
-                        bool RootCondition(SelectCardEffect.Root root) => true;
-                        bool CanUseCondition(Hashtable hashtable) => true;
-
-                        #region reduce cost
-
-                        Func<EffectTiming, ICardEffect> getChangeCostEffect = null;
-
-                        if (_reduceCostTuple != null)
-                        {
-                            bool CardCondition(CardSource cardSource)
-                            {
-                                return SharedCardCondition(cardSource)
-                                    && (_reduceCostTuple.Value.reduceCostCardCondition == null || _reduceCostTuple.Value.reduceCostCardCondition(cardSource));
-                            }
-
-                            int ChangeCost(CardSource cardSource, int Cost, Root root, List<Permanent> targetPermanents)
-                            {
-                                if (PermanentsCondition(targetPermanents))
-                                {
-                                    Cost -= _reduceCostTuple.Value.reduceCost;
-                                }
-
-                                return Cost;
-                            }
-
-                            bool isUpDown() => true;
-
-                            ChangeCostClass changeCostClass = new ChangeCostClass();
-                            changeCostClass.SetUpICardEffect($"Play Cost -{_reduceCostTuple.Value.reduceCost}", CanUseCondition, _cardEffect.EffectSourceCard);
-                            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                            getChangeCostEffect = GetCardEffect;
-
-                            ICardEffect GetCardEffect(EffectTiming _timing)
-                            {
-                                if (_timing == EffectTiming.None)
-                                {
-                                    return changeCostClass;
-                                }
-
-                                return null;
-                            }
-
-                            if (getChangeCostEffect != null)
-                            {
-                                _selectPlayer.UntilCalculateFixedCostEffect.Add(getChangeCostEffect);
-                            }
-                        }
-
-                        #endregion
-
-                        #region set fixed cost
-
-                        Func<EffectTiming, ICardEffect> getFixedCostEffect = null;
-
-                        if (_fixedCostTuple != null)
-                        {
-                            bool CardCondition(CardSource cardSource)
-                            {
-                                return SharedCardCondition(cardSource)
-                                    && (_fixedCostTuple.Value.fixedCostCardCondition == null || _fixedCostTuple.Value.fixedCostCardCondition(cardSource));
-                            }
-
-                            int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
-                            {
-                                if (PermanentsCondition(targetPermanents))
-                                {
-                                    Cost = _fixedCostTuple.Value.fixedCost;
-                                }
-
-                                return Cost;
-                            }
-
-                            bool isUpDown() => false;
-
-                            ChangeCostClass changeCostClass = new ChangeCostClass();
-                            changeCostClass.SetUpICardEffect($"Play Cost {_fixedCostTuple.Value.fixedCost}", CanUseCondition, _cardEffect.EffectSourceCard);
-                            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                            getFixedCostEffect = GetCardEffect;
-
-                            ICardEffect GetCardEffect(EffectTiming _timing)
-                            {
-                                if (_timing == EffectTiming.None)
-                                {
-                                    return changeCostClass;
-                                }
-
-                                return null;
-                            }
-
-                            if (getFixedCostEffect != null)
-                            {
-                                _selectPlayer.UntilCalculateFixedCostEffect.Add(getFixedCostEffect);
-                            }
-                        }
-
-                        #endregion
-
-                        yield return ContinuousController.instance.StartCoroutine(
-                            CardEffectCommons.PlayPermanentCards(
-                                cardSources: _targetCards, 
-                                activateClass: _cardEffect, 
-                                payCost: true, 
-                                isTapped: false, 
-                                root: SelectCardEffect.Root.Hand, 
-                                activateETB: true));
-                        
-                        #region release effect
-                        if (getChangeCostEffect != null) _selectPlayer.UntilCalculateFixedCostEffect.Remove(getChangeCostEffect);
-                        #endregion
-
-                        #region release effect
-                        if (getFixedCostEffect != null) _selectPlayer.UntilCalculateFixedCostEffect.Remove(getFixedCostEffect);
-                        #endregion
-
-                        break;
-                    }
-
                 case Mode.Custom:
                     if (_selectCardCoroutine != null)
                     {

+ 0 - 165
Assets/Scripts/Script/SelectHandEffect.cs

@@ -128,8 +128,6 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
         PutLibraryTop,
         PutLibraryBottom,
         PutSecurityBottom,
-        PlayForFree,
-        PlayForCost,
         Custom
     }
 
@@ -230,14 +228,6 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
 
                             break;
 
-                        case Mode.PlayForFree:
-                            message = "Select cards to play for without paying the cost.";
-                            break;
-
-                        case Mode.PlayForCost:
-                            message = "Select cards to play.";
-                            break;
-
                         case Mode.Custom:
                             message = "Select cards in your hand.";
                             break;
@@ -684,13 +674,6 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
 
                                     break;
 
-                                case Mode.PlayForFree:
-                                case Mode.PlayForCost:
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Played cards", true, true));
-
-                                    break;
-
                                 case Mode.Custom:
 
                                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Selected cards", true, true));
@@ -745,154 +728,6 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
                             yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(cardSource,false, _isFaceUp));
                         break;
 
-                    case Mode.PlayForFree:
-                        yield return ContinuousController.instance.StartCoroutine(
-                            CardEffectCommons.PlayPermanentCards(
-                                cardSources: _targetCards, 
-                                activateClass: _cardEffect, 
-                                payCost: false, 
-                                isTapped: false, 
-                                root: SelectCardEffect.Root.Hand, 
-                                activateETB: true));
-                        break;
-
-                    case Mode.PlayForCost:
-                        {
-                            bool PermanentsCondition(List<Permanent> targetPermanents)
-                            {
-                                if (targetPermanents == null)
-                                {
-                                    return true;
-                                }
-
-                                else
-                                {
-                                    if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                                    {
-                                        return true;
-                                    }
-                                }
-
-                                return false;
-                            }
-
-                            bool SharedCardCondition(CardSource cardSource) => _targetCards.Contains(cardSource);
-                            bool RootCondition(SelectCardEffect.Root root) => true;
-                            bool CanUseCondition(Hashtable hashtable) => true;
-
-                            #region reduce cost
-
-                            Func<EffectTiming, ICardEffect> getChangeCostEffect = null;
-
-                            if (_reduceCostTuple != null)
-                            {
-                                bool CardCondition(CardSource cardSource)
-                                {
-                                    return SharedCardCondition(cardSource)
-                                        && (_reduceCostTuple.Value.reduceCostCardCondition == null || _reduceCostTuple.Value.reduceCostCardCondition(cardSource));
-                                }
-
-                                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
-                                {
-                                    if (PermanentsCondition(targetPermanents))
-                                    {
-                                        Cost -= _reduceCostTuple.Value.reduceCost;
-                                    }
-
-                                    return Cost;
-                                }
-
-                                bool isUpDown() => true;
-
-                                ChangeCostClass changeCostClass = new ChangeCostClass();
-                                changeCostClass.SetUpICardEffect($"Play Cost -{_reduceCostTuple.Value.reduceCost}", CanUseCondition, _cardEffect.EffectSourceCard);
-                                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                                getChangeCostEffect = GetCardEffect;
-
-                                ICardEffect GetCardEffect(EffectTiming _timing)
-                                {
-                                    if (_timing == EffectTiming.None)
-                                    {
-                                        return changeCostClass;
-                                    }
-
-                                    return null;
-                                }
-
-                                if (getChangeCostEffect != null)
-                                {
-                                    _selectPlayer.UntilCalculateFixedCostEffect.Add(getChangeCostEffect);
-                                }
-                            }
-
-                            #endregion
-
-                            #region set fixed cost
-
-                            Func<EffectTiming, ICardEffect> getFixedCostEffect = null;
-
-                            if (_fixedCostTuple != null)
-                            {
-                                bool CardCondition(CardSource cardSource)
-                                {
-                                    return SharedCardCondition(cardSource)
-                                        && (_fixedCostTuple.Value.fixedCostCardCondition == null || _fixedCostTuple.Value.fixedCostCardCondition(cardSource));
-                                }
-
-                                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
-                                {
-                                    if (PermanentsCondition(targetPermanents))
-                                    {
-                                        Cost = _fixedCostTuple.Value.fixedCost;
-                                    }
-
-                                    return Cost;
-                                }
-
-                                bool isUpDown() => false;
-
-                                ChangeCostClass changeCostClass = new ChangeCostClass();
-                                changeCostClass.SetUpICardEffect($"Play Cost {_fixedCostTuple.Value.fixedCost}", CanUseCondition, _cardEffect.EffectSourceCard);
-                                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                                getFixedCostEffect = GetCardEffect;
-
-                                ICardEffect GetCardEffect(EffectTiming _timing)
-                                {
-                                    if (_timing == EffectTiming.None)
-                                    {
-                                        return changeCostClass;
-                                    }
-
-                                    return null;
-                                }
-
-                                if (getFixedCostEffect != null)
-                                {
-                                    _selectPlayer.UntilCalculateFixedCostEffect.Add(getFixedCostEffect);
-                                }
-                            }
-
-                            #endregion
-
-                            yield return ContinuousController.instance.StartCoroutine(
-                                CardEffectCommons.PlayPermanentCards(
-                                    cardSources: _targetCards, 
-                                    activateClass: _cardEffect, 
-                                    payCost: true, 
-                                    isTapped: false, 
-                                    root: SelectCardEffect.Root.Hand, 
-                                    activateETB: true));
-                            
-                            #region release effect
-                            if (getChangeCostEffect != null) _selectPlayer.UntilCalculateFixedCostEffect.Remove(getChangeCostEffect);
-                            #endregion
-
-                            #region release effect
-                            if (getFixedCostEffect != null) _selectPlayer.UntilCalculateFixedCostEffect.Remove(getFixedCostEffect);
-                            #endregion
-
-                            break;
-                        }
                 }
                 #endregion