Forráskód Böngészése

Merge pull request #694 from BennAbbot/removed-rpcs-from-complex-dna-effects

Removed RPCs From More DNA Effects
x89rt2 4 hónapja
szülő
commit
bcfc728222
27 módosított fájl, 368 hozzáadás és 3598 törlés
  1. 8 108
      Assets/Scripts/CardEffect/BT16/Black/BT16_065.cs
  2. 14 124
      Assets/Scripts/CardEffect/BT16/Black/BT16_097.cs
  3. 26 135
      Assets/Scripts/CardEffect/BT16/Blue/BT16_092.cs
  4. 48 160
      Assets/Scripts/CardEffect/BT16/Red/BT16_091.cs
  5. 8 74
      Assets/Scripts/CardEffect/BT17/Purple/BT17_101.cs
  6. 19 125
      Assets/Scripts/CardEffect/BT20/Green/BT20_043.cs
  7. 14 237
      Assets/Scripts/CardEffect/BT20/Purple/BT20_066.cs
  8. 7 115
      Assets/Scripts/CardEffect/BT20/Purple/BT20_074.cs
  9. 14 237
      Assets/Scripts/CardEffect/BT20/Red/BT20_011.cs
  10. 7 109
      Assets/Scripts/CardEffect/BT20/Red/BT20_016.cs
  11. 7 114
      Assets/Scripts/CardEffect/BT20/Red/BT20_093.cs
  12. 18 127
      Assets/Scripts/CardEffect/BT20/Yellow/BT20_036.cs
  13. 9 120
      Assets/Scripts/CardEffect/BT23/Black/BT23_050.cs
  14. 9 120
      Assets/Scripts/CardEffect/BT23/Yellow/BT23_027.cs
  15. 8 118
      Assets/Scripts/CardEffect/BT24/Yellow/BT24_035.cs
  16. 16 249
      Assets/Scripts/CardEffect/EX3/Purple/EX3_058.cs
  17. 16 249
      Assets/Scripts/CardEffect/EX3/Red/EX3_008.cs
  18. 7 114
      Assets/Scripts/CardEffect/EX5/Blue/EX5_065.cs
  19. 7 106
      Assets/Scripts/CardEffect/EX6/Purple/EX6_074.cs
  20. 8 117
      Assets/Scripts/CardEffect/EX7/Black/EX7_047.cs
  21. 20 134
      Assets/Scripts/CardEffect/EX8/Blue/EX8_027.cs
  22. 22 132
      Assets/Scripts/CardEffect/EX8/Purple/EX8_060.cs
  23. 9 118
      Assets/Scripts/CardEffect/EX9/Blue/EX9_020.cs
  24. 7 116
      Assets/Scripts/CardEffect/EX9/Green/EX9_044.cs
  25. 9 118
      Assets/Scripts/CardEffect/EX9/Red/EX9_013.cs
  26. 7 118
      Assets/Scripts/CardEffect/P/Yellow/P_191.cs
  27. 24 4
      Assets/Scripts/Script/CardEffectCommons/DNADigivolveEffects.cs

+ 8 - 108
Assets/Scripts/CardEffect/BT16/Black/BT16_065.cs

@@ -1,4 +1,5 @@
 using Photon.Pun;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
@@ -599,104 +600,13 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    // DNA digivolve
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("Darkdramon_BT16_065");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                             CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                 CanSelectDNACardCondition,
+                                 payCost: true,
+                                 isHand: true,
+                                 activateClass
+                             ));
                 }
             }
 
@@ -704,15 +614,5 @@ namespace DCGO.CardEffects.BT16
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 14 - 124
Assets/Scripts/CardEffect/BT16/Black/BT16_097.cs

@@ -99,123 +99,23 @@ namespace DCGO.CardEffects.BT16
                     }
 
                     // DNA digivolve
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    yield return ContinuousController.instance.StartCoroutine(
+                          CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                              CanSelectDNACardCondition,
+                              payCost: true,
+                              isHand: true,
+                              activateClass,
+                              successProcess: OnDNASuccess
+                          ));
+
+                    IEnumerator OnDNASuccess(CardSource cardSource)
                     {
-                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
+                        if (card.Owner.LibraryCards.Count >= 1)
                         {
-                            List<CardSource> selectedDNACards = new List<CardSource>();
-
-                            SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectDNAEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectDNACardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectDNACoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                                "The opponent is selecting 1 card to DNA digivolve.");
-                            selectDNAEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectDNAEffect.Activate());
-
-                            IEnumerator SelectDNACoroutine(CardSource cardSource)
+                            if (card.Owner.CanAddSecurity(activateClass))
                             {
-                                selectedDNACards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedDNACards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedDNACards)
-                                {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        _jogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait("AncientAngelOfSteel_BT16_097");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                            (card: selectedCard,
-                                                isLocal: true,
-                                                isPayCost: true,
-                                                canNoSelect: true,
-                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                                .SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                        }
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText(
-                                                "The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !_endSelect);
-                                        _endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                    "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-
-                                            if (CardEffectCommons.IsExistOnBattleArea(selectedCard))
-                                            {
-                                                if (card.Owner.LibraryCards.Count >= 1)
-                                                {
-                                                    if (card.Owner.CanAddSecurity(activateClass))
-                                                    {
-                                                        yield return ContinuousController.instance.StartCoroutine(
-                                                            new IRecovery(card.Owner, 1, activateClass).Recovery());
-                                                        ;
-                                                    }
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    new IRecovery(card.Owner, 1, activateClass).Recovery());
                             }
                         }
                     }
@@ -398,15 +298,5 @@ namespace DCGO.CardEffects.BT16
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 26 - 135
Assets/Scripts/CardEffect/BT16/Blue/BT16_092.cs

@@ -99,133 +99,34 @@ namespace DCGO.CardEffects.BT16
                     }
 
                     // DNA digivolve
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    yield return ContinuousController.instance.StartCoroutine(
+                              CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                  CanSelectDNACardCondition,
+                                  payCost: true,
+                                  isHand: true,
+                                  activateClass,
+                                  successProcess: OnDNASuccess
+                              ));
+
+                    IEnumerator OnDNASuccess(CardSource cardSource)
                     {
-                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
-                        {
-                            List<CardSource> selectedDNACards = new List<CardSource>();
-
-                            SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectDNAEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectDNACardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectDNACoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                                "The opponent is selecting 1 card to DNA digivolve.");
-                            selectDNAEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectDNAEffect.Activate());
-
-                            IEnumerator SelectDNACoroutine(CardSource cardSource)
-                            {
-                                selectedDNACards.Add(cardSource);
-
-                                yield return null;
-                            }
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
+                                    targetPermanent: cardSource.PermanentOfThisCard(),
+                                    effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                    activateClass: activateClass));
+
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.GainCanNotBeDeletedByBattle(
+                                targetPermanent: cardSource.PermanentOfThisCard(),
+                                canNotBeDestroyedByBattleCondition: CanNotBeDestroyedByBattleCondition,
+                                effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                activateClass: activateClass,
+                                effectName: "Can't be deleted in battle"));
 
-                            if (selectedDNACards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedDNACards)
-                                {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        _jogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait("AncientAngelOfSteel_BT16_097");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                            (card: selectedCard,
-                                                isLocal: true,
-                                                isPayCost: true,
-                                                canNoSelect: true,
-                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                                .SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                        }
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText(
-                                                "The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !_endSelect);
-                                        _endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                    "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-
-                                            if (CardEffectCommons.IsExistOnBattleArea(selectedCard))
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(
-                                                    targetPermanent: selectedCard.PermanentOfThisCard(),
-                                                    effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                                                    activateClass: activateClass));
-
-                                                yield return ContinuousController.instance.StartCoroutine(
-                                                    CardEffectCommons.GainCanNotBeDeletedByBattle(
-                                                        targetPermanent: selectedCard.PermanentOfThisCard(),
-                                                        canNotBeDestroyedByBattleCondition: CanNotBeDestroyedByBattleCondition,
-                                                        effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                                                        activateClass: activateClass,
-                                                        effectName: "Can't be deleted in battle"));
-
-                                                bool CanNotBeDestroyedByBattleCondition(Permanent permanent1, Permanent attackingPermanent,
-                                                    Permanent defendingPermanent, CardSource defendingCard)
-                                                {
-                                                    return permanent1 == attackingPermanent || permanent1 == defendingPermanent;
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                        bool CanNotBeDestroyedByBattleCondition(Permanent permanent1, Permanent attackingPermanent,
+                            Permanent defendingPermanent, CardSource defendingCard)
+                        {
+                            return permanent1 == attackingPermanent || permanent1 == defendingPermanent;
                         }
                     }
                 }
@@ -407,15 +308,5 @@ namespace DCGO.CardEffects.BT16
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 48 - 160
Assets/Scripts/CardEffect/BT16/Red/BT16_091.cs

@@ -99,162 +99,60 @@ namespace DCGO.CardEffects.BT16
                     }
 
                     // DNA digivolve
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    yield return ContinuousController.instance.StartCoroutine(
+                                          CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                              CanSelectDNACardCondition,
+                                              payCost: true,
+                                              isHand: true,
+                                              activateClass,
+                                              successProcess: OnDNASuccess
+                                          ));
+
+                    IEnumerator OnDNASuccess(CardSource cardSource)
                     {
-                        bool DNADigivolved = false;
-
-                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
-                        {
-                            List<CardSource> selectedDNACards = new List<CardSource>();
-
-                            SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectDNAEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectDNACardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectDNACoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                                "The opponent is selecting 1 card to DNA digivolve.");
-                            selectDNAEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectDNAEffect.Activate());
-
-                            IEnumerator SelectDNACoroutine(CardSource cardSource)
+                        List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
                             {
-                                selectedDNACards.Add(cardSource);
+                                new SelectionElement<bool>(message: $"Yes", value: true, spriteIndex: 0),
+                                new SelectionElement<bool>(message: $"No", value: false, spriteIndex: 1),
+                            };
 
-                                yield return null;
-                            }
+                        string selectPlayerMessage =
+                            "Will you give this Digimon [Security A+1] and must attack a player?";
+                        string notSelectPlayerMessage = "The opponent is choosing effects.";
+
+                        GManager.instance.userSelectionManager.SetBoolSelection(
+                            selectionElements: selectionElements, selectPlayer: card.Owner,
+                            selectPlayerMessage: selectPlayerMessage,
+                            notSelectPlayerMessage: notSelectPlayerMessage);
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance
+                            .userSelectionManager.WaitForEndSelect());
 
-                            if (selectedDNACards.Count >= 1)
+                        bool willGiveEffects = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                        if (willGiveEffects)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardEffectCommons.ChangeDigimonSAttack(cardSource.PermanentOfThisCard(), 1,
+                                    EffectDuration.UntilEachTurnEnd, activateClass));
+
+                            if (cardSource.PermanentOfThisCard() != null)
                             {
-                                foreach (CardSource selectedCard in selectedDNACards)
+                                if (cardSource.PermanentOfThisCard().CanAttack(activateClass))
                                 {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        _jogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait(
-                                            "BeastlyStormDanceofAffection_BT16_091");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                            (card: selectedCard,
-                                                isLocal: true,
-                                                isPayCost: true,
-                                                canNoSelect: true,
-                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .selectJogressEffect.SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                        }
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText(
-                                                "The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !_endSelect);
-                                        _endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                    "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-                                            DNADigivolved = true;
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                        }
-
-                                        if (DNADigivolved)
-                                        {
-                                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
-                                            {
-                                                new SelectionElement<bool>(message: $"Yes", value: true, spriteIndex: 0),
-                                                new SelectionElement<bool>(message: $"No", value: false, spriteIndex: 1),
-                                            };
-
-                                            string selectPlayerMessage =
-                                                "Will you give this Digimon [Security A+1] and must attack a player?";
-                                            string notSelectPlayerMessage = "The opponent is choosing effects.";
-
-                                            GManager.instance.userSelectionManager.SetBoolSelection(
-                                                selectionElements: selectionElements, selectPlayer: card.Owner,
-                                                selectPlayerMessage: selectPlayerMessage,
-                                                notSelectPlayerMessage: notSelectPlayerMessage);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .userSelectionManager.WaitForEndSelect());
-
-                                            bool willGiveEffects = GManager.instance.userSelectionManager.SelectedBoolValue;
-
-                                            if (willGiveEffects)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(
-                                                    CardEffectCommons.ChangeDigimonSAttack(selectedCard.PermanentOfThisCard(), 1,
-                                                        EffectDuration.UntilEachTurnEnd, activateClass));
-
-                                                if (selectedCard.PermanentOfThisCard() != null)
-                                                {
-                                                    if (selectedCard.PermanentOfThisCard().CanAttack(activateClass))
-                                                    {
-                                                        SelectAttackEffect selectAttackEffect =
-                                                            GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                                        selectAttackEffect.SetUp(
-                                                            attacker: selectedCard.PermanentOfThisCard(),
-                                                            canAttackPlayerCondition: () => true,
-                                                            defenderCondition: (permanent) => false,
-                                                            cardEffect: activateClass);
-
-                                                        selectAttackEffect.SetCanNotSelectNotAttack();
-
-                                                        yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
-                                                            .Activate());
-                                                    }
-                                                }
-                                            }
-                                        }
-                                    }
+                                    SelectAttackEffect selectAttackEffect =
+                                        GManager.instance.GetComponent<SelectAttackEffect>();
+
+                                    selectAttackEffect.SetUp(
+                                        attacker: cardSource.PermanentOfThisCard(),
+                                        canAttackPlayerCondition: () => true,
+                                        defenderCondition: (permanent) => false,
+                                        cardEffect: activateClass);
+
+                                    selectAttackEffect.SetCanNotSelectNotAttack();
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
+                                        .Activate());
                                 }
                             }
                         }
@@ -447,15 +345,5 @@ namespace DCGO.CardEffects.BT16
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 8 - 74
Assets/Scripts/CardEffect/BT17/Purple/BT17_101.cs

@@ -142,66 +142,14 @@ namespace DCGO.CardEffects.BT17
                 {
                     if (card.CanPlayJogress(true))
                     {
-                        _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-                        yield return GManager.instance.photonWaitController.StartWait("FenriloogamonTakemikazuchi_BT17_101");
-
-                        if (card.Owner.isYou || GManager.instance.IsAI)
-                        {
-                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                            (card: card,
-                                isLocal: true,
-                                isPayCost: true,
-                                canNoSelect: true,
-                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutineSelectDigivolutionRoots,
-                                noSelectCoroutine: null);
-
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                .SelectDigivolutionRoots());
-
-                            IEnumerator EndSelectCoroutineSelectDigivolutionRoots(List<Permanent> permanents)
-                            {
-                                if (permanents.Count == 2)
-                                {
-                                    _jogressEvoRootsFrameIDs =
-                                        permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                }
-
-                                yield return null;
-                            }
-
-                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                        }
-
-                        else
-                        {
-                            GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                        }
-
-                        yield return new WaitWhile(() => !_endSelect);
-                        _endSelect = false;
-
-                        GManager.instance.commandText.CloseCommandText();
-                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                .ShowCardEffect(new List<CardSource>() { card }, "Played Card", true, true));
-
-                            PlayCardClass playCard = new PlayCardClass(
-                                cardSources: new List<CardSource>() { card },
-                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                payCost: true,
-                                targetPermanent: null,
-                                isTapped: false,
-                                root: SelectCardEffect.Root.Trash,
-                                activateETB: true);
-
-                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(
+                                                 CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                     null,
+                                                     payCost: true,
+                                                     isHand: false,
+                                                     activateClass,
+                                                     ignoreSelection: true
+                                                 ));
                     }
                 }
             }
@@ -357,19 +305,5 @@ namespace DCGO.CardEffects.BT17
 
             return cardEffects;
         }
-
-        #region DNA
-
-        private bool _endSelect;
-        private int[] _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] jogressEvoRootsFrameIDs)
-        {
-            _jogressEvoRootsFrameIDs = jogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-
-        #endregion
     }
 }

+ 19 - 125
Assets/Scripts/CardEffect/BT20/Green/BT20_043.cs

@@ -541,125 +541,29 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    CardSource selectedCard = null;
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    if (isExistOnField(card))
                     {
-                        selectedCard = cardSource;
-
-                        yield return null;
-                    }
-
-                    if (selectedCard != null)
-                    {
-                        if (selectedCard.CanPlayJogress(true) && selectedCard.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
+                        yield return ContinuousController.instance.StartCoroutine(
+                                            CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                CanSelectCardCondition,
+                                                payCost: true,
+                                                isHand: true,
+                                                activateClass,
+                                                permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() },
+                                                successProcess: OnDNASuccess
+                                            ));
+
+                        IEnumerator OnDNASuccess(CardSource cardSource)
                         {
-                            JogressEvoRootsFrameIDs = new int[0];
-
-                            yield return GManager.instance.photonWaitController.StartWait("BanchoLeomon_BT20_036");
-
-                            if (card.Owner.isYou || GManager.instance.IsAI)
-                            {
-                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                           (card: selectedCard,
-                                                           isLocal: true,
-                                                           isPayCost: true,
-                                                           canNoSelect: true,
-                                                           endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                           noSelectCoroutine: null);
-
-                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
-
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                {
-                                    permanents = permanents.Distinct().ToList();
-
-                                    if (permanents.Count == 2)
-                                    {
-                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                        for (int i = 0; i < permanents.Count; i++)
-                                        {
-                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                            {
-                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                            }
-                                        }
-                                    }
-
-                                    if (!permanents.Contains(card.PermanentOfThisCard()))
-                                    {
-                                        JogressEvoRootsFrameIDs = new int[0];
-                                    }
-
-                                    yield return null;
-                                }
-
-                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                            }
-                            else
-                            {
-                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                            }
-
-                            yield return new WaitWhile(() => !endSelect);
-                            endSelect = false;
-
-                            GManager.instance.commandText.CloseCommandText();
-                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                            if (JogressEvoRootsFrameIDs.Length == 2)
-                            {
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                PlayCardClass playCard = new PlayCardClass(
-                                    cardSources: new List<CardSource>() { selectedCard },
-                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                    payCost: true,
-                                    targetPermanent: null,
-                                    isTapped: false,
-                                    root: SelectCardEffect.Root.Hand,
-                                    activateETB: true);
-
-                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-
-                                SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
+                            SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 
-                                selectAttackEffect.SetUp(
-                                    attacker: selectedCard.PermanentOfThisCard(),
-                                    canAttackPlayerCondition: () => true,
-                                    defenderCondition: _ => true,
-                                    cardEffect: activateClass);
+                            selectAttackEffect.SetUp(
+                                attacker: cardSource.PermanentOfThisCard(),
+                                canAttackPlayerCondition: () => true,
+                                defenderCondition: _ => true,
+                                cardEffect: activateClass);
 
-                                yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                         }
                     }
                 }
@@ -730,15 +634,5 @@ namespace DCGO.CardEffects.BT20
 
             return cardEffects;
         }
-
-        bool endSelect = false;
-        int[] JogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            endSelect = true;
-        }
     }
 }

+ 14 - 237
Assets/Scripts/CardEffect/BT20/Purple/BT20_066.cs

@@ -111,119 +111,13 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("StingmonBT20_066");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(
+                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                            CanSelectCardCondition,
+                                                            payCost: true,
+                                                            isHand: true,
+                                                            activateClass
+                                                        ));
                         }
                     }
                 }
@@ -331,119 +225,13 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("StingmonBT20_066");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(
+                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                            CanSelectCardCondition,
+                                                            payCost: true,
+                                                            isHand: true,
+                                                            activateClass
+                                                        ));
                         }
                     }
                 }
@@ -459,16 +247,5 @@ namespace DCGO.CardEffects.BT20
 
             return cardEffects;
         }
-
-
-         bool endSelect = false;
-        int[] JogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-        this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-        endSelect = true;
-        }
     }
 }

+ 7 - 115
Assets/Scripts/CardEffect/BT20/Purple/BT20_074.cs

@@ -280,113 +280,14 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("Dinobeemon_BT20_074");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                            CanSelectDNACardCondition,
+                                                            payCost: true,
+                                                            isHand: true,
+                                                            activateClass
+                                                        ));
                 }
-
-                
-                
-                    
-                
-
-
             }
             #endregion
 
@@ -419,14 +320,5 @@ namespace DCGO.CardEffects.BT20
         return cardEffects;
 
         }
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 14 - 237
Assets/Scripts/CardEffect/BT20/Red/BT20_011.cs

@@ -104,119 +104,13 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("ExVeemonBT20_011");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(
+                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                            CanSelectCardCondition,
+                                                            payCost: true,
+                                                            isHand: true,
+                                                            activateClass
+                                                        ));
                         }
                     }
                 }
@@ -321,119 +215,13 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("ExVeemonBT20_011");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(
+                                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                             CanSelectCardCondition,
+                                                             payCost: true,
+                                                             isHand: true,
+                                                             activateClass
+                                                         ));
                         }
                     }
                 }
@@ -459,16 +247,5 @@ namespace DCGO.CardEffects.BT20
             return cardEffects;
 
         }
-
-
-        bool endSelect = false;
-        int[] JogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-        this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-        endSelect = true;
-        }
     }
 }

+ 7 - 109
Assets/Scripts/CardEffect/BT20/Red/BT20_016.cs

@@ -327,105 +327,13 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("Paildramon_BT_016");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                            CanSelectDNACardCondition,
+                                                            payCost: true,
+                                                            isHand: true,
+                                                            activateClass
+                                                        ));
                 }
             }
             #endregion
@@ -439,16 +347,6 @@ namespace DCGO.CardEffects.BT20
 
             return cardEffects;
         }
-        
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }
 

+ 7 - 114
Assets/Scripts/CardEffect/BT20/Red/BT20_093.cs

@@ -214,106 +214,13 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator SuccessProcess()
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                        "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-                                yield return GManager.instance.photonWaitController.StartWait("Eldradimon_EX7_047");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                    (card: selectedCard,
-                                        isLocal: true,
-                                        isPayCost: true,
-                                        canNoSelect: true,
-                                        endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutineSelectDigivolutionRoots,
-                                        noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                        .SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutineSelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                .Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                        .ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                            CanSelectDNACardCondition,
+                                                            payCost: true,
+                                                            isHand: true,
+                                                            activateClass
+                                                        ));
                 }
             }
 
@@ -454,19 +361,5 @@ namespace DCGO.CardEffects.BT20
 
             return cardEffects;
         }
-
-        #region Photon DNA
-
-        bool _endSelect;
-        int[] _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] jogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = jogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-
-        #endregion
     }
 }

+ 18 - 127
Assets/Scripts/CardEffect/BT20/Yellow/BT20_036.cs

@@ -473,126 +473,27 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    CardSource selectedCard = null;
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectCardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() },
+                                             successProcess: OnDNASuccess
+                                         ));
+
+                    IEnumerator OnDNASuccess(CardSource cardSource)
                     {
-                        selectedCard = cardSource;
-
-                        yield return null;
-                    }
+                        SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 
-                    if (selectedCard != null)
-                    {
-                        if (selectedCard.CanPlayJogress(true) && selectedCard.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
-                        {
-                            JogressEvoRootsFrameIDs = new int[0];
-
-                            yield return GManager.instance.photonWaitController.StartWait("BanchoLeomon_BT20_036");
-
-                            if (card.Owner.isYou || GManager.instance.IsAI)
-                            {
-                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                           (card: selectedCard,
-                                                           isLocal: true,
-                                                           isPayCost: true,
-                                                           canNoSelect: true,
-                                                           endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                           noSelectCoroutine: null);
-
-                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
-
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                {
-                                    permanents = permanents.Distinct().ToList();
-
-                                    if (permanents.Count == 2)
-                                    {
-                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                        for (int i = 0; i < permanents.Count; i++)
-                                        {
-                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                            {
-                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                            }
-                                        }
-                                    }
+                        selectAttackEffect.SetUp(
+                            attacker: cardSource.PermanentOfThisCard(),
+                            canAttackPlayerCondition: () => true,
+                            defenderCondition: _ => true,
+                            cardEffect: activateClass);
 
-                                    if (!permanents.Contains(card.PermanentOfThisCard()))
-                                    {
-                                        JogressEvoRootsFrameIDs = new int[0];
-                                    }
-
-                                    yield return null;
-                                }
-
-                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                            }
-                            else
-                            {
-                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                            }
-
-                            yield return new WaitWhile(() => !endSelect);
-                            endSelect = false;
-
-                            GManager.instance.commandText.CloseCommandText();
-                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                            if (JogressEvoRootsFrameIDs.Length == 2)
-                            {
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                PlayCardClass playCard = new PlayCardClass(
-                                    cardSources: new List<CardSource>() { selectedCard },
-                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                    payCost: true,
-                                    targetPermanent: null,
-                                    isTapped: false,
-                                    root: SelectCardEffect.Root.Hand,
-                                    activateETB: true);
-
-                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-
-                                SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                selectAttackEffect.SetUp(
-                                    attacker: selectedCard.PermanentOfThisCard(),
-                                    canAttackPlayerCondition: () => true,
-                                    defenderCondition: _ => true,
-                                    cardEffect: activateClass);
-
-                                yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                            }
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                     }
                 }
             }
@@ -669,15 +570,5 @@ namespace DCGO.CardEffects.BT20
 
             return cardEffects;
         }
-
-        bool endSelect = false;
-        int[] JogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            endSelect = true;
-        }
     }
 }

+ 9 - 120
Assets/Scripts/CardEffect/BT23/Black/BT23_050.cs

@@ -1,4 +1,5 @@
 using Photon.Pun;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
@@ -102,115 +103,15 @@ namespace DCGO.CardEffects.BT23
                     }
                 }                
 
-                if (CardEffectCommons.IsOwnerTurn(card)
-                    && card.Owner.GetBattleAreaDigimons().Count >= 2
-                    && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectDNACardCondition))
+                if (CardEffectCommons.IsOwnerTurn(card))
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    #region Select Shakkoumon
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-                        yield return null;
-                    }
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 [Shakkoumon] to DNA digivolve into.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-
-                    #endregion
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        #region DNA Effect
-
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("Ankylomon_BT23_050");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-
-                        #endregion
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                            CanSelectDNACardCondition,
+                                            payCost: true,
+                                            isHand: true,
+                                            activateClass
+                                        ));
                 }
             }
 
@@ -274,17 +175,5 @@ namespace DCGO.CardEffects.BT23
 
             return cardEffects;
         }
-
-        #region Jogress Required
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-        #endregion
     }
 }

+ 9 - 120
Assets/Scripts/CardEffect/BT23/Yellow/BT23_027.cs

@@ -1,4 +1,5 @@
 using Photon.Pun;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
@@ -66,115 +67,15 @@ namespace DCGO.CardEffects.BT23
             {
                 yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
 
-                if (CardEffectCommons.IsOwnerTurn(card)
-                    && card.Owner.GetBattleAreaDigimons().Count >= 2
-                    && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectDNACardCondition))
+                if (CardEffectCommons.IsOwnerTurn(card))
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    #region Select Shakkoumon
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-                        yield return null;
-                    }
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 [Shakkoumon] to DNA digivolve into.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-
-                    #endregion
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        #region DNA Effect
-
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("Angemon_BT23_027");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-
-                        #endregion
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                     CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                         CanSelectDNACardCondition,
+                         payCost: true,
+                         isHand: true,
+                         activateClass
+                     ));
                 }
             }
 
@@ -247,17 +148,5 @@ namespace DCGO.CardEffects.BT23
 
             return cardEffects;
         }
-
-        #region Jogress Required
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-        #endregion
     }
 }

+ 8 - 118
Assets/Scripts/CardEffect/BT24/Yellow/BT24_035.cs

@@ -81,115 +81,15 @@ namespace DCGO.CardEffects.BT24
                     }
                 }                
 
-                if (CardEffectCommons.IsOwnerTurn(card)
-                    && card.Owner.GetBattleAreaDigimons().Count >= 2
-                    && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectDNACardCondition))
+                if (CardEffectCommons.IsOwnerTurn(card))
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    #region Select Silphymon
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-                        yield return null;
-                    }
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 [Silphymon] to DNA digivolve into.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-
-                    #endregion
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        #region DNA Effect
-
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("Gatomon_BT24_035");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-
-                        #endregion
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                     CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                         CanSelectDNACardCondition,
+                                         payCost: true,
+                                         isHand: true,
+                                         activateClass
+                                     ));
                 }
             }
 
@@ -240,15 +140,5 @@ namespace DCGO.CardEffects.BT24
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 16 - 249
Assets/Scripts/CardEffect/EX3/Purple/EX3_058.cs

@@ -180,124 +180,14 @@ namespace DCGO.CardEffects.EX3
                     {
                         if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent != card.PermanentOfThisCard()))
                         {
-                            if (card.Owner.HandCards.Count(CanSelectCardCondition1) >= 1)
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition1,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true) && selectedCard.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("Shadramon_EX3_058");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    if (!permanents.Contains(card.PermanentOfThisCard()))
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[0];
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectCardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() }
+                                         ));
                         }
                     }
                 }
@@ -374,142 +264,19 @@ namespace DCGO.CardEffects.EX3
                 {
                     if (isExistOnField(card))
                     {
-                        if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
-                        {
-                            if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true) && selectedCard.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("Flaedramon_EX3_008");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    if (!permanents.Contains(card.PermanentOfThisCard()))
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[0];
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectCardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() }
+                                         ));
                     }
                 }
             }
 
             return cardEffects;
         }
-
-        bool endSelect = false;
-        int[] JogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            endSelect = true;
-        }
     }
 }

+ 16 - 249
Assets/Scripts/CardEffect/EX3/Red/EX3_008.cs

@@ -180,124 +180,14 @@ namespace DCGO.CardEffects.EX3
                     {
                         if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent != card.PermanentOfThisCard()))
                         {
-                            if (card.Owner.HandCards.Count(CanSelectCardCondition1) >= 1)
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition1,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true) && selectedCard.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("Shadramon_EX3_058");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                    (card: selectedCard,
-                                                    isLocal: true,
-                                                    isPayCost: true,
-                                                    canNoSelect: true,
-                                                    endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                    noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    if (!permanents.Contains(card.PermanentOfThisCard()))
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[0];
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectCardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() }
+                                         ));
                         }
                     }
                 }
@@ -374,142 +264,19 @@ namespace DCGO.CardEffects.EX3
                 {
                     if (isExistOnField(card))
                     {
-                        if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
-                        {
-                            if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
-                            {
-                                List<CardSource> selectedCards = new List<CardSource>();
-
-                                int maxCount = 1;
-
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: CanSelectCardCondition,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: true,
-                                    selectCardCoroutine: SelectCardCoroutine,
-                                    afterSelectCardCoroutine: null,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
-
-                                selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                                selectHandEffect.SetNotShowCard();
-
-                                yield return StartCoroutine(selectHandEffect.Activate());
-
-                                IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                {
-                                    selectedCards.Add(cardSource);
-
-                                    yield return null;
-                                }
-
-                                if (selectedCards.Count >= 1)
-                                {
-                                    foreach (CardSource selectedCard in selectedCards)
-                                    {
-                                        if (selectedCard.CanPlayJogress(true) && selectedCard.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
-                                        {
-                                            JogressEvoRootsFrameIDs = new int[0];
-
-                                            yield return GManager.instance.photonWaitController.StartWait("Flaedramon_EX3_008");
-
-                                            if (card.Owner.isYou || GManager.instance.IsAI)
-                                            {
-                                                GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                            (card: selectedCard,
-                                                                            isLocal: true,
-                                                                            isPayCost: true,
-                                                                            canNoSelect: true,
-                                                                            endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                            noSelectCoroutine: null);
-
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
-
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                                IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                                {
-                                                    permanents = permanents.Distinct().ToList();
-
-                                                    if (permanents.Count == 2)
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[2];
-
-                                                        for (int i = 0; i < permanents.Count; i++)
-                                                        {
-                                                            if (i < JogressEvoRootsFrameIDs.Length)
-                                                            {
-                                                                JogressEvoRootsFrameIDs[i] = permanents[i].PermanentFrame.FrameID;
-                                                            }
-                                                        }
-                                                    }
-
-                                                    if (!permanents.Contains(card.PermanentOfThisCard()))
-                                                    {
-                                                        JogressEvoRootsFrameIDs = new int[0];
-                                                    }
-
-                                                    yield return null;
-                                                }
-
-                                                photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                            }
-
-                                            else
-                                            {
-                                                GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                            }
-
-                                            yield return new WaitWhile(() => !endSelect);
-                                            endSelect = false;
-
-                                            GManager.instance.commandText.CloseCommandText();
-                                            yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                            if (JogressEvoRootsFrameIDs.Length == 2)
-                                            {
-                                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                                PlayCardClass playCard = new PlayCardClass(
-                                                    cardSources: new List<CardSource>() { selectedCard },
-                                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                    payCost: true,
-                                                    targetPermanent: null,
-                                                    isTapped: false,
-                                                    root: SelectCardEffect.Root.Hand,
-                                                    activateETB: true);
-
-                                                playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                                yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectCardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() }
+                                         ));
                     }
                 }
             }
 
             return cardEffects;
         }
-
-        bool endSelect = false;
-        int[] JogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            endSelect = true;
-        }
     }
 }

+ 7 - 114
Assets/Scripts/CardEffect/EX5/Blue/EX5_065.cs

@@ -305,110 +305,13 @@ public class EX5_065 : CEntity_Effect
                 if (played)
                 {
                     // DNA digivolve
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
-                    {
-                        if (card.Owner.HandCards.Count(CanSelectCardCondition1) >= 1)
-                        {
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            int maxCount = 1;
-
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectCardCondition1,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: maxCount,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                            selectHandEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectHandEffect.Activate());
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedCards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedCards)
-                                {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        JogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait("SayoAndKou_EX5_065");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                        (card: selectedCard,
-                                                                        isLocal: true,
-                                                                        isPayCost: true,
-                                                                        canNoSelect: true,
-                                                                        endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                        noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    JogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, JogressEvoRootsFrameIDs);
-                                        }
-
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !endSelect);
-                                        endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (JogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(JogressEvoRootsFrameIDs);
-
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectCardCondition1,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass
+                                         ));
                 }
             }
         }
@@ -420,14 +323,4 @@ public class EX5_065 : CEntity_Effect
 
         return cardEffects;
     }
-
-    bool endSelect = false;
-    int[] JogressEvoRootsFrameIDs = new int[0];
-
-    [PunRPC]
-    public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-    {
-        this.JogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-        endSelect = true;
-    }
 }

+ 7 - 106
Assets/Scripts/CardEffect/EX6/Purple/EX6_074.cs

@@ -208,102 +208,13 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    List<CardSource> selectedDNACards = new List<CardSource>();
-
-                    SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectDNAEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectDNACoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.", "The opponent is selecting 1 card to DNA digivolve.");
-                    selectDNAEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectDNAEffect.Activate());
-
-                    IEnumerator SelectDNACoroutine(CardSource cardSource)
-                    {
-                        selectedDNACards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedDNACards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedDNACards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = new int[0];
-
-                                yield return GManager.instance.photonWaitController.StartWait("MireiMikagura_EX6_074");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                                                (card: selectedCard,
-                                                                isLocal: true,
-                                                                isPayCost: true,
-                                                                canNoSelect: true,
-                                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                                noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                     CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                         CanSelectDNACardCondition,
+                         payCost: true,
+                         isHand: true,
+                         activateClass
+                     ));
                 }
             }
             #endregion
@@ -317,15 +228,5 @@ namespace DCGO.CardEffects.EX6
 
             return cardEffects;
         }
-
-        bool _endSelect = false;
-        int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 8 - 117
Assets/Scripts/CardEffect/EX7/Black/EX7_047.cs

@@ -239,7 +239,7 @@ namespace DCGO.CardEffects.EX7
 
                 string EffectDescription()
                 {
-                    return "[End of Your Turn] (End of Your Turn) 2 of your Digimon may DNA digivolve into a Digimon card with the [NSp] trait in your hand.";
+                    return "[End of Your Turn] (Once Per Turn) 2 of your Digimon may DNA digivolve into a Digimon card with the [NSp] trait in your hand.";
                 }
                 
                 bool CanUseCondition(Hashtable hashtable)
@@ -263,108 +263,13 @@ namespace DCGO.CardEffects.EX7
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                        "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-                                yield return GManager.instance.photonWaitController.StartWait("Eldradimon_EX7_047");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                    (card: selectedCard,
-                                        isLocal: true,
-                                        isPayCost: true,
-                                        canNoSelect: true,
-                                        endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutineSelectDigivolutionRoots,
-                                        noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                        .SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutineSelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                .Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                        .ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                             CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                                 CanSelectDNACardCondition,
+                                                 payCost: true,
+                                                 isHand: true,
+                                                 activateClass
+                                             ));
                 }
             }
 
@@ -372,19 +277,5 @@ namespace DCGO.CardEffects.EX7
 
             return cardEffects;
         }
-
-        #region Photon DNA
-
-        bool _endSelect;
-        int[] _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] jogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = jogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-
-        #endregion
     }
 }

+ 20 - 134
Assets/Scripts/CardEffect/EX8/Blue/EX8_027.cs

@@ -189,136 +189,32 @@ namespace DCGO.CardEffects.EX8
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    bool DNADigivolved = false;
-
                     // DNA digivolve
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectDNACardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() },
+                                             successProcess: OnDNASuccess
+                                         ));
+
+                    IEnumerator OnDNASuccess(CardSource cardSource)
                     {
-                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
+                        if (cardSource.PermanentOfThisCard().CanAttack(activateClass))
                         {
-                            List<CardSource> selectedDNACards = new List<CardSource>();
-
-                            SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
+                            SelectAttackEffect selectAttackEffect =
+                                GManager.instance.GetComponent<SelectAttackEffect>();
 
-                            selectDNAEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectDNACardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectDNACoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
+                            selectAttackEffect.SetUp(
+                                attacker: cardSource.PermanentOfThisCard(),
+                                canAttackPlayerCondition: () => true,
+                                defenderCondition: (permanent) => true,
                                 cardEffect: activateClass);
 
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                                "The opponent is selecting 1 card to DNA digivolve.");
-                            selectDNAEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectDNAEffect.Activate());
-
-                            IEnumerator SelectDNACoroutine(CardSource cardSource)
-                            {
-                                selectedDNACards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedDNACards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedDNACards)
-                                {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        _jogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait("Plesiomon_EX8_027");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                            (card: selectedCard,
-                                                isLocal: true,
-                                                isPayCost: true,
-                                                canNoSelect: true,
-                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                                .SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                        }
-
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText(
-                                                "The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !_endSelect);
-                                        _endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                    "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-                                            DNADigivolved = true;
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                        }
-
-                                        if (DNADigivolved)
-                                        {
-                                            if (selectedCard.PermanentOfThisCard() != null)
-                                            {
-                                                if (selectedCard.PermanentOfThisCard().CanAttack(activateClass))
-                                                {
-                                                    SelectAttackEffect selectAttackEffect =
-                                                        GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                                    selectAttackEffect.SetUp(
-                                                        attacker: selectedCard.PermanentOfThisCard(),
-                                                        canAttackPlayerCondition: () => true,
-                                                        defenderCondition: (permanent) => true,
-                                                        cardEffect: activateClass);
-
-                                                    yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
-                                                        .Activate());
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
+                                .Activate());
                         }
                     }
                 }
@@ -327,15 +223,5 @@ namespace DCGO.CardEffects.EX8
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 22 - 132
Assets/Scripts/CardEffect/EX8/Purple/EX8_060.cs

@@ -188,130 +188,34 @@ namespace DCGO.CardEffects.EX8
                 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-                    
-                    bool DNADigivolved = false;
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                        "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectDNACardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass,
+                                             permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() },
+                                             successProcess: OnDNASuccess
+                                         ));
+
+                    IEnumerator OnDNASuccess(CardSource cardSource)
                     {
-                        foreach (CardSource selectedCard in selectedCards)
+                        if (cardSource.PermanentOfThisCard().CanAttack(activateClass))
                         {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = Array.Empty<int>();
+                            SelectAttackEffect selectAttackEffect =
+                                GManager.instance.GetComponent<SelectAttackEffect>();
 
-                                yield return GManager.instance.photonWaitController.StartWait("Myotismon_EX8_060");
+                            selectAttackEffect.SetUp(
+                                attacker: cardSource.PermanentOfThisCard(),
+                                canAttackPlayerCondition: () => true,
+                                defenderCondition: (permanent) => true,
+                                cardEffect: activateClass);
 
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                    (card: selectedCard,
-                                        isLocal: true,
-                                        isPayCost: true,
-                                        canNoSelect: true,
-                                        endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutineSelectDigivolutionRoots,
-                                        noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                        .SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutineSelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                .Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                        .ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-                                    DNADigivolved = true;
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                                
-                                if (DNADigivolved)
-                                {
-                                    if (selectedCard.PermanentOfThisCard() != null)
-                                    {
-                                        if (selectedCard.PermanentOfThisCard().CanAttack(activateClass))
-                                        {
-                                            SelectAttackEffect selectAttackEffect =
-                                                GManager.instance.GetComponent<SelectAttackEffect>();
-
-                                            selectAttackEffect.SetUp(
-                                                attacker: selectedCard.PermanentOfThisCard(),
-                                                canAttackPlayerCondition: () => true,
-                                                defenderCondition: (permanent) => true,
-                                                cardEffect: activateClass);
-
-                                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
-                                                .Activate());
-                                        }
-                                    }
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect
+                                .Activate());
                         }
                     }
+
                 }
             }
             #endregion
@@ -413,19 +317,5 @@ namespace DCGO.CardEffects.EX8
 
             return cardEffects;
         }
-            
-        #region Photon DNA
-
-        bool _endSelect;
-        int[] _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] jogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = jogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-
-        #endregion
     }
 }

+ 9 - 118
Assets/Scripts/CardEffect/EX9/Blue/EX9_020.cs

@@ -1,8 +1,9 @@
+using Photon.Pun;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using UnityEngine;
-using Photon.Pun;
 
 //CresGarurumon
 namespace DCGO.CardEffects.EX9
@@ -212,113 +213,13 @@ namespace DCGO.CardEffects.EX9
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
-                    {
-                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
-                        {
-                            List<CardSource> selectedDNACards = new List<CardSource>();
-
-                            SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectDNAEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectDNACardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectDNACoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                                "The opponent is selecting 1 card to DNA digivolve.");
-                            selectDNAEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectDNAEffect.Activate());
-
-                            IEnumerator SelectDNACoroutine(CardSource cardSource)
-                            {
-                                selectedDNACards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedDNACards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedDNACards)
-                                {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        _jogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait("CresGarurumon_EX9_020");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                            (card: selectedCard,
-                                                isLocal: true,
-                                                isPayCost: true,
-                                                canNoSelect: true,
-                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                                .SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                        }
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText(
-                                                "The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !_endSelect);
-                                        _endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                    "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectDNACardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass
+                                         ));
                 }
             }
             #endregion
@@ -346,15 +247,5 @@ namespace DCGO.CardEffects.EX9
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 7 - 116
Assets/Scripts/CardEffect/EX9/Green/EX9_044.cs

@@ -477,108 +477,13 @@ namespace DCGO.CardEffects.EX9
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    List<CardSource> selectedCards = new List<CardSource>();
-
-                    bool DNADigivolved = false;
-                    int maxCount = 1;
-
-                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                    selectHandEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectDNACardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        mode: SelectHandEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectHandEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                        "The opponent is selecting 1 card to DNA digivolve.");
-                    selectHandEffect.SetNotShowCard();
-
-                    yield return StartCoroutine(selectHandEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
-                    {
-                        selectedCards.Add(cardSource);
-
-                        yield return null;
-                    }
-
-                    if (selectedCards.Count >= 1)
-                    {
-                        foreach (CardSource selectedCard in selectedCards)
-                        {
-                            if (selectedCard.CanPlayJogress(true))
-                            {
-                                _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-                                yield return GManager.instance.photonWaitController.StartWait("Hydramon_EX9_044");
-
-                                if (card.Owner.isYou || GManager.instance.IsAI)
-                                {
-                                    GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                    (card: selectedCard,
-                                        isLocal: true,
-                                        isPayCost: true,
-                                        canNoSelect: true,
-                                        endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutineSelectDigivolutionRoots,
-                                        noSelectCoroutine: null);
-
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                        .SelectDigivolutionRoots());
-
-                                    IEnumerator EndSelectCoroutineSelectDigivolutionRoots(List<Permanent> permanents)
-                                    {
-                                        if (permanents.Count == 2)
-                                        {
-                                            _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                .Map(permanent => permanent.PermanentFrame.FrameID);
-                                        }
-
-                                        yield return null;
-                                    }
-
-                                    photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                }
-                                else
-                                {
-                                    GManager.instance.commandText.OpenCommandText("The opponent is choosing a card to DNA digivolve.");
-                                }
-
-                                yield return new WaitWhile(() => !_endSelect);
-                                _endSelect = false;
-
-                                GManager.instance.commandText.CloseCommandText();
-                                yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                if (_jogressEvoRootsFrameIDs.Length == 2)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
-                                        .ShowCardEffect(new List<CardSource>() { selectedCard }, "Played Card", true, true));
-
-                                    PlayCardClass playCard = new PlayCardClass(
-                                        cardSources: new List<CardSource>() { selectedCard },
-                                        hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                        payCost: true,
-                                        targetPermanent: null,
-                                        isTapped: false,
-                                        root: SelectCardEffect.Root.Hand,
-                                        activateETB: true);
-
-                                    playCard.SetJogress(_jogressEvoRootsFrameIDs);
-                                    DNADigivolved = true;
-                                    yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectDNACardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass
+                                         ));
                 }
             }
 
@@ -586,19 +491,5 @@ namespace DCGO.CardEffects.EX9
 
             return cardEffects;
         }
-
-        #region Photon DNA
-
-        bool _endSelect;
-        int[] _jogressEvoRootsFrameIDs = Array.Empty<int>();
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] jogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = jogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-
-        #endregion
     }
 }

+ 9 - 118
Assets/Scripts/CardEffect/EX9/Red/EX9_013.cs

@@ -1,8 +1,9 @@
+using Photon.Pun;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using UnityEngine;
-using Photon.Pun;
 
 namespace DCGO.CardEffects.EX9
 {
@@ -279,113 +280,13 @@ namespace DCGO.CardEffects.EX9
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2)
-                    {
-                        if (card.Owner.HandCards.Count(CanSelectDNACardCondition) >= 1)
-                        {
-                            List<CardSource> selectedDNACards = new List<CardSource>();
-
-                            SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectDNAEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectDNACardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: 1,
-                                canNoSelect: true,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                selectCardCoroutine: SelectDNACoroutine,
-                                afterSelectCardCoroutine: null,
-                                mode: SelectHandEffect.Mode.Custom,
-                                cardEffect: activateClass);
-
-                            selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                                "The opponent is selecting 1 card to DNA digivolve.");
-                            selectDNAEffect.SetNotShowCard();
-
-                            yield return StartCoroutine(selectDNAEffect.Activate());
-
-                            IEnumerator SelectDNACoroutine(CardSource cardSource)
-                            {
-                                selectedDNACards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedDNACards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedDNACards)
-                                {
-                                    if (selectedCard.CanPlayJogress(true))
-                                    {
-                                        _jogressEvoRootsFrameIDs = new int[0];
-
-                                        yield return GManager.instance.photonWaitController.StartWait("BlitzGreymon_EX9_013");
-
-                                        if (card.Owner.isYou || GManager.instance.IsAI)
-                                        {
-                                            GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                            (card: selectedCard,
-                                                isLocal: true,
-                                                isPayCost: true,
-                                                canNoSelect: true,
-                                                endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                                noSelectCoroutine: null);
-
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                                .SelectDigivolutionRoots());
-
-                                            IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                            {
-                                                if (permanents.Count == 2)
-                                                {
-                                                    _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                        .Map(permanent => permanent.PermanentFrame.FrameID);
-                                                }
-
-                                                yield return null;
-                                            }
-
-                                            photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                        }
-                                        else
-                                        {
-                                            GManager.instance.commandText.OpenCommandText(
-                                                "The opponent is choosing a card to DNA digivolve.");
-                                        }
-
-                                        yield return new WaitWhile(() => !_endSelect);
-                                        _endSelect = false;
-
-                                        GManager.instance.commandText.CloseCommandText();
-                                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                        if (_jogressEvoRootsFrameIDs.Length == 2)
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                                .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                    "Played Card", true, true));
-
-                                            PlayCardClass playCard = new PlayCardClass(
-                                                cardSources: new List<CardSource>() { selectedCard },
-                                                hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                                payCost: true,
-                                                targetPermanent: null,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true);
-
-                                            playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                            yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectDNACardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass
+                                         ));
 
                     if (CardEffectCommons.HasMatchConditionPermanent(IsYourAttackingDigimon))
                     {
@@ -449,15 +350,5 @@ namespace DCGO.CardEffects.EX9
 
             return cardEffects;
         }
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
     }
 }

+ 7 - 118
Assets/Scripts/CardEffect/P/Yellow/P_191.cs

@@ -380,110 +380,13 @@ namespace DCGO.CardEffects.P
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (card.Owner.GetBattleAreaDigimons().Count >= 2 && card.Owner.HandCards.Exists(CanSelectDNACardCondition))
-                    {
-                        List<CardSource> selectedDNACards = new List<CardSource>();
-
-                        SelectHandEffect selectDNAEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                        selectDNAEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectDNACardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            selectCardCoroutine: SelectDNACoroutine,
-                            afterSelectCardCoroutine: null,
-                            mode: SelectHandEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectDNAEffect.SetUpCustomMessage("Select 1 card to DNA digivolve.",
-                            "The opponent is selecting 1 card to DNA digivolve.");
-                        selectDNAEffect.SetNotShowCard();
-
-                        yield return StartCoroutine(selectDNAEffect.Activate());
-
-                        IEnumerator SelectDNACoroutine(CardSource cardSource)
-                        {
-                            selectedDNACards.Add(cardSource);
-
-                            yield return null;
-                        }
-
-                        if (selectedDNACards.Count >= 1)
-                        {
-                            foreach (CardSource selectedCard in selectedDNACards)
-                            {
-                                if (selectedCard.CanPlayJogress(true))
-                                {
-                                    _jogressEvoRootsFrameIDs = new int[0];
-
-                                    yield return GManager.instance.photonWaitController.StartWait("Apollomon_P_191");
-
-                                    if (card.Owner.isYou || GManager.instance.IsAI)
-                                    {
-                                        GManager.instance.selectJogressEffect.SetUp_SelectDigivolutionRoots
-                                        (card: selectedCard,
-                                            isLocal: true,
-                                            isPayCost: true,
-                                            canNoSelect: true,
-                                            endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
-                                            noSelectCoroutine: null);
-
-                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect
-                                            .SelectDigivolutionRoots());
-
-                                        IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
-                                        {
-                                            if (permanents.Count == 2)
-                                            {
-                                                _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray()
-                                                    .Map(permanent => permanent.PermanentFrame.FrameID);
-                                            }
-
-                                            yield return null;
-                                        }
-
-                                        photonView.RPC("SetJogressEvoRootsFrameIDs", RpcTarget.All, _jogressEvoRootsFrameIDs);
-                                    }
-                                    else
-                                    {
-                                        GManager.instance.commandText.OpenCommandText(
-                                            "The opponent is choosing a card to DNA digivolve.");
-                                    }
-
-                                    yield return new WaitWhile(() => !_endSelect);
-                                    _endSelect = false;
-
-                                    GManager.instance.commandText.CloseCommandText();
-                                    yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
-
-                                    if (_jogressEvoRootsFrameIDs.Length == 2)
-                                    {
-                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance
-                                            .GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { selectedCard },
-                                                "Played Card", true, true));
-
-                                        PlayCardClass playCard = new PlayCardClass(
-                                            cardSources: new List<CardSource>() { selectedCard },
-                                            hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                            payCost: true,
-                                            targetPermanent: null,
-                                            isTapped: false,
-                                            root: SelectCardEffect.Root.Hand,
-                                            activateETB: true);
-
-                                        playCard.SetJogress(_jogressEvoRootsFrameIDs);
-
-                                        yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
-                                    }
-                                }
-                            }
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                                         CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                                             CanSelectDNACardCondition,
+                                             payCost: true,
+                                             isHand: true,
+                                             activateClass
+                                         ));
 
                     if (CardEffectCommons.HasMatchConditionPermanent(IsYourAttackingDigimon))
                     {
@@ -616,19 +519,5 @@ namespace DCGO.CardEffects.P
 
             return cardEffects;
         }
-
-        #region End of your turn DNA required
-
-        private bool _endSelect = false;
-        private int[] _jogressEvoRootsFrameIDs = new int[0];
-
-        [PunRPC]
-        public void SetJogressEvoRootsFrameIDs(int[] JogressEvoRootsFrameIDs)
-        {
-            this._jogressEvoRootsFrameIDs = JogressEvoRootsFrameIDs;
-            _endSelect = true;
-        }
-
-        #endregion
     }
 }

+ 24 - 4
Assets/Scripts/Script/CardEffectCommons/DNADigivolveEffects.cs

@@ -460,14 +460,16 @@ public partial class CardEffectCommons
         bool isHand,
         ICardEffect activateClass,
         Func<Permanent, bool>[] permanentConditions = null,
-        IEnumerator successProcess = null,
+        Func<CardSource, IEnumerator> successProcess = null,
         bool ignoreSelection = false,
-        IEnumerator failedProcess = null,
+        Func<IEnumerator> failedProcess = null,
         bool isOptional = true)
     {
         Player owner = activateClass.EffectSourceCard.Owner;
         CardSource dnaTarget = null;
 
+        const int DnaPermanentCount = 2;
+
         IEnumerator SelectCardCoroutine(CardSource cardSource)
         {
             dnaTarget = cardSource;
@@ -481,6 +483,12 @@ public partial class CardEffectCommons
                 && cardSource.CanPlayJogress(true);
         }
 
+        if (owner.GetBattleAreaDigimons().Count < DnaPermanentCount)
+        {
+            yield return ContinuousController.instance.StartCoroutine(failedProcess());
+            yield break;
+        }
+
         int maxCount = 1;
 
         if (ignoreSelection)
@@ -538,6 +546,7 @@ public partial class CardEffectCommons
             yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
         }
 
+        bool processSuccessful = false;
         if (dnaTarget != null)
         {
             Component component = activateClass.EffectSourceCard.cEntity_EffectController.gameObject.AddComponent(typeof (SetJogressEvoRootsController));
@@ -563,7 +572,7 @@ public partial class CardEffectCommons
 
                 IEnumerator EndSelectCoroutine_SelectDigivolutionRoots(List<Permanent> permanents)
                 {
-                    if (permanents.Count == 2)
+                    if (permanents.Count == DnaPermanentCount)
                     {
                         _jogressEvoRootsFrameIDs = permanents.Distinct().ToArray().Map(permanent => permanent.PermanentFrame.FrameID);
                     }
@@ -584,7 +593,7 @@ public partial class CardEffectCommons
             GManager.instance.commandText.CloseCommandText();
             yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
 
-            if (controller.JogressEvoRootsFrameIDs.Length == 2)
+            if (controller.JogressEvoRootsFrameIDs.Length == DnaPermanentCount)
             {
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(new List<CardSource>() { dnaTarget }, "Played Card", true, true));
 
@@ -600,8 +609,19 @@ public partial class CardEffectCommons
                 playCard.SetJogress(controller.JogressEvoRootsFrameIDs);
 
                 yield return ContinuousController.instance.StartCoroutine(playCard.PlayCard());
+
+                processSuccessful = CardEffectCommons.IsExistOnBattleArea(dnaTarget);
             }
         }
+
+        if (processSuccessful && successProcess != null)
+        {
+            yield return ContinuousController.instance.StartCoroutine(successProcess(dnaTarget));
+        }
+        else if (!processSuccessful && failedProcess != null)
+        {
+            yield return ContinuousController.instance.StartCoroutine(failedProcess());
+        }
     }
 
     #endregion